(function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("agGrid", [], f);} else if ("object" == typeof exports) {exports["agGrid"] = f();} else {g["agGrid"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports }; if (typeof require === 'undefined') { function require(name) { throw new Error('Unknown module: ' + name); } } 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 __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); // packages/ag-grid-enterprise/src/main-umd-styles.ts var main_umd_styles_exports = {}; __export(main_umd_styles_exports, { ALWAYS_SYNC_GLOBAL_EVENTS: () => ALWAYS_SYNC_GLOBAL_EVENTS, AdvancedFilterModule: () => AdvancedFilterModule, AgAbstractCellEditor: () => AgAbstractCellEditor, AgAbstractInputField: () => AgAbstractInputField, AgAbstractLabel: () => AgAbstractLabel, AgCheckbox: () => AgCheckbox, AgCheckboxSelector: () => AgCheckboxSelector, AgColumn: () => AgColumn, AgColumnGroup: () => AgColumnGroup, AgContentEditableField: () => AgContentEditableField, AgContentEditableFieldSelector: () => AgContentEditableFieldSelector, AgFilterButtonSelector: () => AgFilterButtonSelector, AgInputDateField: () => AgInputDateField, AgInputNumberField: () => AgInputNumberField, AgInputNumberFieldSelector: () => AgInputNumberFieldSelector, AgInputTextArea: () => AgInputTextArea, AgInputTextField: () => AgInputTextField, AgInputTextFieldSelector: () => AgInputTextFieldSelector, AgPickerField: () => AgPickerField, AgPopupComponent: () => AgPopupComponent, AgPromise: () => AgPromise, AgProvidedColumnGroup: () => AgProvidedColumnGroup, AgRadioButton: () => AgRadioButton, AgRadioButtonSelector: () => AgRadioButtonSelector, AgSelect: () => AgSelect, AgSelectSelector: () => AgSelectSelector, AgToggleButton: () => AgToggleButton, AgToggleButtonSelector: () => AgToggleButtonSelector, AggregationModule: () => AggregationModule, AiToolkitModule: () => AiToolkitModule, AlignedGridsModule: () => AlignedGridsModule, AllCommunityModule: () => AllCommunityModule, AllEnterpriseModule: () => AllEnterpriseModule, AutoScrollService: () => AutoScrollService, BaseColsService: () => BaseColsService, BaseComponentWrapper: () => BaseComponentWrapper, BaseCreator: () => BaseCreator, BaseGridSerializingSession: () => BaseGridSerializingSession, BaseSelectionService: () => BaseSelectionService, BatchEditModule: () => BatchEditModule, BeanStub: () => BeanStub, BigIntFilterModule: () => BigIntFilterModule, CellApiModule: () => CellApiModule, CellRangeType: () => CellRangeType, CellSelectionModule: () => CellSelectionModule, CellSpanModule: () => CellSpanModule, CellStyleModule: () => CellStyleModule, CheckboxEditorModule: () => CheckboxEditorModule, ClientSideRowModelApiModule: () => ClientSideRowModelApiModule, ClientSideRowModelModule: () => ClientSideRowModelModule, ClipboardModule: () => ClipboardModule, ColumnApiModule: () => ColumnApiModule, ColumnAutoSizeModule: () => ColumnAutoSizeModule, ColumnHoverModule: () => ColumnHoverModule, ColumnKeyCreator: () => ColumnKeyCreator, ColumnMenuModule: () => ColumnMenuModule, ColumnsToolPanelModule: () => ColumnsToolPanelModule, Component: () => Component, ContextMenuModule: () => ContextMenuModule, CssClassManager: () => CssClassManager, CsvExportModule: () => CsvExportModule, CustomEditorModule: () => CustomEditorModule, CustomFilterModule: () => CustomFilterModule, DateEditorModule: () => DateEditorModule, DateFilterModule: () => DateFilterModule, Direction: () => Direction, DragAndDropModule: () => DragAndDropModule, DragSourceType: () => DragSourceType, EventApiModule: () => EventApiModule, ExcelExportModule: () => ExcelExportModule, ExternalFilterModule: () => ExternalFilterModule, FakeHScrollComp: () => FakeHScrollComp, FakeVScrollComp: () => FakeVScrollComp, FilterButtonComp: () => FilterButtonComp, FilterComp: () => FilterComp, FilterWrapperComp: () => FilterWrapperComp, FiltersToolPanelModule: () => FiltersToolPanelModule, FindModule: () => FindModule, FormulaModule: () => FormulaModule, GROUP_AUTO_COLUMN_ID: () => GROUP_AUTO_COLUMN_ID, GROUP_HIERARCHY_COLUMN_ID_PREFIX: () => GROUP_HIERARCHY_COLUMN_ID_PREFIX, GridBodyCtrl: () => GridBodyCtrl, GridChartsModule: () => GridChartsModule, GridCoreCreator: () => GridCoreCreator, GridCtrl: () => GridCtrl, GridHeaderCtrl: () => GridHeaderCtrl, GridStateModule: () => GridStateModule, GroupFilterModule: () => GroupFilterModule, GroupInstanceIdCreator: () => GroupInstanceIdCreator, HeaderRowContainerCtrl: () => HeaderRowContainerCtrl, HighlightChangesModule: () => HighlightChangesModule, InfiniteRowModelModule: () => InfiniteRowModelModule, IntegratedChartsModule: () => IntegratedChartsModule, KeyCode: () => KeyCode, LargeTextEditorModule: () => LargeTextEditorModule, LicenseManager: () => GridLicenseManager, LocalEventService: () => LocalEventService, LocaleModule: () => LocaleModule, LocaleService: () => LocaleService, ManagedFocusFeature: () => ManagedFocusFeature, MasterDetailModule: () => MasterDetailModule, MenuModule: () => MenuModule, ModuleRegistry: () => ModuleRegistry, MultiFilterModule: () => MultiFilterModule, NewFiltersToolPanelModule: () => NewFiltersToolPanelModule, NumberEditorModule: () => NumberEditorModule, NumberFilterModule: () => NumberFilterModule, PaginationModule: () => PaginationModule, PinnedRowModel: () => PinnedRowModel, PinnedRowModule: () => PinnedRowModule, PivotModule: () => PivotModule, PositionableFeature: () => PositionableFeature, ProvidedFilter: () => ProvidedFilter, QuickFilterModule: () => QuickFilterModule, ROW_NUMBERS_COLUMN_ID: () => ROW_NUMBERS_COLUMN_ID, RangeSelectionModule: () => RangeSelectionModule, RefPlaceholder: () => RefPlaceholder, RenderApiModule: () => RenderApiModule, RichSelectModule: () => RichSelectModule, RowApiModule: () => RowApiModule, RowAutoHeightModule: () => RowAutoHeightModule, RowContainerCtrl: () => RowContainerCtrl, RowDragModule: () => RowDragModule, RowGroupingEditModule: () => RowGroupingEditModule, RowGroupingModule: () => RowGroupingModule, RowGroupingPanelModule: () => RowGroupingPanelModule, RowNode: () => RowNode, RowNumbersModule: () => RowNumbersModule, RowSelectionModule: () => RowSelectionModule, RowStyleModule: () => RowStyleModule, SELECTION_COLUMN_ID: () => SELECTION_COLUMN_ID, STRUCTURED_SCHEMA_FEATURES: () => STRUCTURED_SCHEMA_FEATURES, ScrollApiModule: () => ScrollApiModule, SelectEditorModule: () => SelectEditorModule, ServerSideRowModelApiModule: () => ServerSideRowModelApiModule, ServerSideRowModelModule: () => ServerSideRowModelModule, ServerSideTransactionResultStatus: () => ServerSideTransactionResultStatus, SetFilterModule: () => SetFilterModule, SideBarModule: () => SideBarModule, SparklinesModule: () => SparklinesModule, StatusBarModule: () => StatusBarModule, TabGuardClassNames: () => TabGuardClassNames, TabGuardComp: () => TabGuardComp, TabGuardCtrl: () => TabGuardCtrl, TabGuardFeature: () => TabGuardFeature, TextEditorModule: () => TextEditorModule, TextFilterModule: () => TextFilterModule, TooltipModule: () => TooltipModule, TouchListener: () => TouchListener, TreeDataModule: () => TreeDataModule, UndoRedoEditModule: () => UndoRedoEditModule, ValidationModule: () => ValidationModule, ValueCacheModule: () => ValueCacheModule, VanillaFrameworkOverrides: () => VanillaFrameworkOverrides, ViewportRowModelModule: () => ViewportRowModelModule, _AgBeanStub: () => AgBeanStub, _AgColorPicker: () => AgColorPicker, _AgColorPickerSelector: () => AgColorPickerSelector, _AgComponentStub: () => AgComponentStub, _AgContext: () => AgContext, _AgContextMenuService: () => AgContextMenuService, _AgDialog: () => AgDialog, _AgGroupComponent: () => AgGroupComponent, _AgGroupComponentSelector: () => AgGroupComponentSelector, _AgInputRange: () => AgInputRange, _AgInputRangeSelector: () => AgInputRangeSelector, _AgMenuItemComponent: () => AgMenuItemComponent, _AgMenuItemRenderer: () => AgMenuItemRenderer, _AgMenuList: () => AgMenuList, _AgPanel: () => AgPanel, _AgPositionableFeature: () => AgPositionableFeature, _AgSlider: () => AgSlider, _AgSliderSelector: () => AgSliderSelector, _AgTabGuardComp: () => AgTabGuardComp, _AgTabGuardFeature: () => AgTabGuardFeature, _AgTabbedLayout: () => AgTabbedLayout, _AgTooltipComponent: () => AgTooltipComponent, _AgTooltipFeature: () => AgTooltipFeature, _AgVirtualList: () => AgVirtualList, _AgVirtualListDragFeature: () => AgVirtualListDragFeature, _BOOLEAN_MIXED_GRID_OPTIONS: () => _BOOLEAN_MIXED_GRID_OPTIONS, _BaseDragAndDropService: () => BaseDragAndDropService, _BaseDragService: () => BaseDragService, _BaseEnvironment: () => BaseEnvironment, _BaseEventService: () => BaseEventService, _BasePopupService: () => BasePopupService, _BaseRegistry: () => BaseRegistry, _BaseTooltipStateManager: () => BaseTooltipStateManager, _ChangedRowNodes: () => ChangedRowNodes, _ColumnFilterModule: () => ColumnFilterModule, _ColumnGroupModule: () => ColumnGroupModule, _ColumnMoveModule: () => ColumnMoveModule, _CsrmSsrmSharedApiModule: () => CsrmSsrmSharedApiModule, _DragModule: () => DragModule, _EditCoreModule: () => EditCoreModule, _EmptyBean: () => EmptyBean, _FOCUS_MANAGED_CLASS: () => FOCUS_MANAGED_CLASS, _FilterCoreModule: () => FilterCoreModule, _FilterValueModule: () => FilterValueModule, _GET_ALL_EVENTS: () => _GET_ALL_EVENTS, _GET_ALL_GRID_OPTIONS: () => _GET_ALL_GRID_OPTIONS, _GET_SHALLOW_GRID_OPTIONS: () => _GET_SHALLOW_GRID_OPTIONS, _HeaderComp: () => HeaderComp, _HorizontalResizeModule: () => HorizontalResizeModule, _KeyboardNavigationModule: () => KeyboardNavigationModule, _MONTHS: () => MONTHS, _PUBLIC_EVENTS: () => _PUBLIC_EVENTS, _PUBLIC_EVENT_HANDLERS_MAP: () => _PUBLIC_EVENT_HANDLERS_MAP, _PopupModule: () => PopupModule, _ROW_ID_PREFIX_BOTTOM_PINNED: () => ROW_ID_PREFIX_BOTTOM_PINNED, _ROW_ID_PREFIX_ROW_GROUP: () => ROW_ID_PREFIX_ROW_GROUP, _ROW_ID_PREFIX_TOP_PINNED: () => ROW_ID_PREFIX_TOP_PINNED, _RowModelSharedApiModule: () => RowModelSharedApiModule, _STOP_PROPAGATION_CALLBACKS: () => STOP_PROPAGATION_CALLBACKS, _SharedDragAndDropModule: () => SharedDragAndDropModule, _SharedExportModule: () => SharedExportModule, _SharedMenuModule: () => SharedMenuModule, _SharedRowSelectionModule: () => SharedRowSelectionModule, _SortModule: () => SortModule, _SsrmInfiniteSharedApiModule: () => SsrmInfiniteSharedApiModule, _addAdditionalCss: () => _addAdditionalCss, _addColumnDefaultAndTypes: () => _addColumnDefaultAndTypes, _addFocusableContainerListener: () => _addFocusableContainerListener, _addGridCommonParams: () => _addGridCommonParams, _addOrRemoveAttribute: () => _addOrRemoveAttribute, _anchorElementToMouseMoveEvent: () => _anchorElementToMouseMoveEvent, _applyColumnState: () => _applyColumnState, _areCellsEqual: () => _areCellsEqual, _areColIdsEqual: () => _areColIdsEqual, _areEqual: () => _areEqual, _areSortDefsEqual: () => _areSortDefsEqual, _asThemeImpl: () => _asThemeImpl, _attemptToRestoreCellFocus: () => _attemptToRestoreCellFocus, _batchCall: () => _batchCall, _camelCaseToHumanText: () => _camelCaseToHumanText, _canSkipShowingRowGroup: () => _canSkipShowingRowGroup, _clearElement: () => _clearElement, _columnsMatch: () => _columnsMatch, _combineAttributesAndGridOptions: () => _combineAttributesAndGridOptions, _consoleError: () => _consoleError, _convertColumnEventSourceType: () => _convertColumnEventSourceType, _coreThemeDefaults: () => coreDefaults, _createAgElement: () => _createAgElement, _createCellId: () => _createCellId, _createColumnTree: () => _createColumnTree, _createColumnTreeWithIds: () => _createColumnTreeWithIds, _createElement: () => _createElement, _createGlobalRowEvent: () => _createGlobalRowEvent, _createIcon: () => _createIcon, _createIconNoSpan: () => _createIconNoSpan, _createRowNodeSibling: () => _createRowNodeSibling, _createSharedTheme: () => createSharedTheme, _csrmFirstLeaf: () => _csrmFirstLeaf, _csrmReorderAllLeafs: () => _csrmReorderAllLeafs, _debounce: () => _debounce, _defaultComparator: () => _defaultComparator, _destroyColumnTree: () => _destroyColumnTree, _doOnce: () => _doOnce, _downloadFile: () => _downloadFile, _errMsg: () => _errMsg, _error: () => _error, _escapeString: () => _escapeString, _exists: () => _exists, _findEnterpriseCoreModule: () => _findEnterpriseCoreModule, _findFocusableElements: () => _findFocusableElements, _findNextFocusableElement: () => _findNextFocusableElement, _findTabbableParent: () => _findTabbableParent, _flatten: () => _flatten, _focusGridInnerElement: () => _focusGridInnerElement, _focusInto: () => _focusInto, _focusNextGridCoreContainer: () => _focusNextGridCoreContainer, _forEachChangedGroupDepthFirst: () => _forEachChangedGroupDepthFirst, _formatNumberCommas: () => _formatNumberCommas, _fuzzySuggestions: () => _fuzzySuggestions, _getAbsoluteHeight: () => _getAbsoluteHeight, _getAbsoluteRowIndex: () => _getAbsoluteRowIndex, _getAbsoluteWidth: () => _getAbsoluteWidth, _getActiveDomElement: () => _getActiveDomElement, _getAriaPosInSet: () => _getAriaPosInSet, _getCallbackForEvent: () => _getCallbackForEvent, _getCellByPosition: () => _getCellByPosition, _getCellCtrlForEventTarget: () => _getCellCtrlForEventTarget, _getCellPositionForEvent: () => _getCellPositionForEvent, _getCellRendererDetails: () => _getCellRendererDetails, _getCheckboxLocation: () => _getCheckboxLocation, _getCheckboxes: () => _getCheckboxes, _getClientSideRowModel: () => _getClientSideRowModel, _getColumnState: () => _getColumnState, _getColumnStateFromColDef: () => _getColumnStateFromColDef, _getColumnsFromTree: () => _getColumnsFromTree, _getDateParts: () => _getDateParts, _getDefaultFloatingFilterType: () => _getDefaultFloatingFilterType, _getDefaultSimpleFilter: () => _getDefaultSimpleFilter, _getDisplaySortForColumn: () => _getDisplaySortForColumn, _getDocument: () => _getDocument, _getEditorRendererDetails: () => _getEditorRendererDetails, _getEnableColumnSelection: () => _getEnableColumnSelection, _getFillHandle: () => _getFillHandle, _getFilterDetails: () => _getFilterDetails, _getFilterModel: () => _getFilterModel, _getFilterParamsForDataType: () => _getFilterParamsForDataType, _getFirstRow: () => _getFirstRow, _getFloatingFilterCompDetails: () => _getFloatingFilterCompDetails, _getFloatingFiltersHeight: () => getFloatingFiltersHeight, _getGlobalGridOption: () => _getGlobalGridOption, _getGrandTotalRow: () => _getGrandTotalRow, _getGridOption: () => _getGridOption, _getGridRegisteredModules: () => _getGridRegisteredModules, _getGroupAggFiltering: () => _getGroupAggFiltering, _getGroupSelection: () => _getGroupSelection, _getGroupSelectsDescendants: () => _getGroupSelectsDescendants, _getGroupTotalRowCallback: () => _getGroupTotalRowCallback, _getHeaderCheckbox: () => _getHeaderCheckbox, _getHeaderClassesFromColDef: () => _getHeaderClassesFromColDef, _getHeaderRowCount: () => getHeaderRowCount, _getInnerCellRendererDetails: () => _getInnerCellRendererDetails, _getInnerHeight: () => _getInnerHeight, _getInnerWidth: () => _getInnerWidth, _getIsRowSelectable: () => _getIsRowSelectable, _getLastRow: () => _getLastRow, _getLocaleTextFromFunc: () => _getLocaleTextFromFunc, _getLocaleTextFromMap: () => _getLocaleTextFromMap, _getLocaleTextFunc: () => _getLocaleTextFunc, _getMaxConcurrentDatasourceRequests: () => _getMaxConcurrentDatasourceRequests, _getNormalisedMousePosition: () => _getNormalisedMousePosition, _getPageBody: () => _getPageBody, _getParamType: () => getParamType, _getRootNode: () => _getRootNode, _getRowAbove: () => _getRowAbove, _getRowBelow: () => _getRowBelow, _getRowContainerClass: () => _getRowContainerClass, _getRowContainerOptions: () => _getRowContainerOptions, _getRowCtrlForEventTarget: () => _getRowCtrlForEventTarget, _getRowHeightAsNumber: () => _getRowHeightAsNumber, _getRowHeightForNode: () => _getRowHeightForNode, _getRowIdCallback: () => _getRowIdCallback, _getRowNode: () => _getRowNode, _getRowSelectionMode: () => _getRowSelectionMode, _getRowSpanContainerClass: () => _getRowSpanContainerClass, _getRowViewportClass: () => _getRowViewportClass, _getServerSideRowModel: () => _getServerSideRowModel, _getShouldDisplayTooltip: () => _getShouldDisplayTooltip, _getSortDefFromColDef: () => _getSortDefFromColDef, _getSortDefFromInput: () => _getSortDefFromInput, _getSuppressMultiRanges: () => _getSuppressMultiRanges, _getToolPanelClassesFromColDef: () => _getToolPanelClassesFromColDef, _getViewportRowModel: () => _getViewportRowModel, _getWindow: () => _getWindow, _interpretAsRightClick: () => _interpretAsRightClick, _isAnimateRows: () => _isAnimateRows, _isBrowserFirefox: () => _isBrowserFirefox, _isBrowserSafari: () => _isBrowserSafari, _isCellSelectionEnabled: () => _isCellSelectionEnabled, _isClientSideRowModel: () => _isClientSideRowModel, _isColumnMenuAnchoringEnabled: () => _isColumnMenuAnchoringEnabled, _isColumnsSortingCoupledToGroup: () => _isColumnsSortingCoupledToGroup, _isComponent: () => _isComponent, _isDomLayout: () => _isDomLayout, _isElementInEventPath: () => _isElementInEventPath, _isElementOverflowingCallback: () => _isElementOverflowingCallback, _isEventFromPrintableCharacter: () => _isEventFromPrintableCharacter, _isExpressionString: () => _isExpressionString, _isFocusableFormField: () => _isFocusableFormField, _isFullWidthGroupRow: () => _isFullWidthGroupRow, _isGetRowHeightFunction: () => _isGetRowHeightFunction, _isGroupHideColumnsUntilExpanded: () => _isGroupHideColumnsUntilExpanded, _isGroupMultiAutoColumn: () => _isGroupMultiAutoColumn, _isGroupRowsSticky: () => _isGroupRowsSticky, _isGroupUseEntireRow: () => _isGroupUseEntireRow, _isIOSUserAgent: () => _isIOSUserAgent, _isKeyboardMode: () => _isKeyboardMode, _isLegacyMenuEnabled: () => _isLegacyMenuEnabled, _isMultiRowSelection: () => _isMultiRowSelection, _isNodeOrElement: () => _isNodeOrElement, _isNothingFocused: () => _isNothingFocused, _isPromise: () => _isPromise, _isRowBefore: () => _isRowBefore, _isRowNumbers: () => _isRowNumbers, _isRowSelection: () => _isRowSelection, _isSameRow: () => _isSameRow, _isServerSideRowModel: () => _isServerSideRowModel, _isSetFilterByDefault: () => _isSetFilterByDefault, _isShowTooltipWhenTruncated: () => _isShowTooltipWhenTruncated, _isSortDirectionValid: () => _isSortDirectionValid, _isSortTypeValid: () => _isSortTypeValid, _isStopPropagationForAgGrid: () => _isStopPropagationForAgGrid, _isUseApplyButton: () => _isUseApplyButton, _isUsingNewCellSelectionAPI: () => _isUsingNewCellSelectionAPI, _isUsingNewRowSelectionAPI: () => _isUsingNewRowSelectionAPI, _isVisible: () => _isVisible, _jsonEquals: () => _jsonEquals, _last: () => _last, _loadTemplate: () => _loadTemplate, _logPreInitWarn: () => _logPreInitWarn, _makeNull: () => _makeNull, _mergeDeep: () => _mergeDeep, _missing: () => _missing, _normalizeSortDirection: () => _normalizeSortDirection, _normalizeSortType: () => _normalizeSortType, _observeResize: () => _observeResize, _paramToVariableName: () => paramToVariableName, _paramValueToCss: () => paramValueToCss, _parseBigIntOrNull: () => _parseBigIntOrNull, _parseDateTimeFromString: () => _parseDateTimeFromString, _placeCaretAtEnd: () => _placeCaretAtEnd, _preInitErrMsg: () => _preInitErrMsg, _prevOrNextDisplayedRow: () => _prevOrNextDisplayedRow, _processOnChange: () => _processOnChange, _radioCssClass: () => _radioCssClass, _refreshFilterUi: () => _refreshFilterUi, _refreshHandlerAndUi: () => _refreshHandlerAndUi, _registerModule: () => _registerModule, _removeAllFromArray: () => _removeAllFromArray, _removeAriaExpanded: () => _removeAriaExpanded, _removeAriaSort: () => _removeAriaSort, _removeFromArray: () => _removeFromArray, _removeFromParent: () => _removeFromParent, _requestAnimationFrame: () => _requestAnimationFrame, _resetColumnState: () => _resetColumnState, _selectAllCells: () => _selectAllCells, _serialiseDate: () => _serialiseDate, _setAriaActiveDescendant: () => _setAriaActiveDescendant, _setAriaChecked: () => _setAriaChecked, _setAriaColCount: () => _setAriaColCount, _setAriaColIndex: () => _setAriaColIndex, _setAriaColSpan: () => _setAriaColSpan, _setAriaControls: () => _setAriaControls, _setAriaControlsAndLabel: () => _setAriaControlsAndLabel, _setAriaDescribedBy: () => _setAriaDescribedBy, _setAriaDisabled: () => _setAriaDisabled, _setAriaExpanded: () => _setAriaExpanded, _setAriaHasPopup: () => _setAriaHasPopup, _setAriaHidden: () => _setAriaHidden, _setAriaInvalid: () => _setAriaInvalid, _setAriaLabel: () => _setAriaLabel, _setAriaLabelledBy: () => _setAriaLabelledBy, _setAriaLevel: () => _setAriaLevel, _setAriaOrientation: () => _setAriaOrientation, _setAriaPosInSet: () => _setAriaPosInSet, _setAriaRole: () => _setAriaRole, _setAriaRowCount: () => _setAriaRowCount, _setAriaRowIndex: () => _setAriaRowIndex, _setAriaSelected: () => _setAriaSelected, _setAriaSetSize: () => _setAriaSetSize, _setAriaSort: () => _setAriaSort, _setColMenuVisible: () => _setColMenuVisible, _setDisabled: () => _setDisabled, _setDisplayed: () => _setDisplayed, _setFixedWidth: () => _setFixedWidth, _setScrollLeft: () => _setScrollLeft, _setUmd: () => _setUmd, _setVisible: () => _setVisible, _sharedThemeDefaults: () => sharedDefaults, _shouldUpdateColVisibilityAfterGroup: () => _shouldUpdateColVisibilityAfterGroup, _skipFocusableContainerListenerForAgGrid: () => _skipFocusableContainerListenerForAgGrid, _stopPropagationForAgGrid: () => _stopPropagationForAgGrid, _suppressCellMouseEvent: () => _suppressCellMouseEvent, _themeAlpineParams: () => themeAlpineParams, _themeBalhamParams: () => themeBalhamParams, _themeMaterialParams: () => themeMaterialParams, _themeQuartzParams: () => themeQuartzParams, _toString: () => _toString, _toStringOrNull: () => _toStringOrNull, _translate: () => _translate, _translateForFilter: () => translateForFilter, _unwrapUserComp: () => _unwrapUserComp, _updateColsMap: () => _updateColsMap, _updateColumnState: () => _updateColumnState, _updateFilterModel: () => _updateFilterModel, _waitUntil: () => _waitUntil, _warn: () => _warn, _warnOnce: () => _warnOnce, agTestIdFor: () => agTestIdFor, buttonStyleAlpine: () => buttonStyleAlpine, buttonStyleBalham: () => buttonStyleBalham, buttonStyleBase: () => buttonStyleBase, buttonStyleQuartz: () => buttonStyleQuartz, checkboxStyleDefault: () => checkboxStyleDefault, colorSchemeDark: () => colorSchemeDark, colorSchemeDarkBlue: () => colorSchemeDarkBlue, colorSchemeDarkWarm: () => colorSchemeDarkWarm, colorSchemeLight: () => colorSchemeLight, colorSchemeLightCold: () => colorSchemeLightCold, colorSchemeLightWarm: () => colorSchemeLightWarm, colorSchemeVariable: () => colorSchemeVariable, columnDropStyleBordered: () => columnDropStyleBordered, columnDropStylePlain: () => columnDropStylePlain, convertColumnGroupState: () => convertColumnGroupState, convertColumnState: () => convertColumnState, createGrid: () => createGrid2, createPart: () => createPart, createTheme: () => createTheme, distributeGroupValue: () => distributeGroupValue, exportMultipleSheetsAsExcel: () => exportMultipleSheetsAsExcel, getGridApi: () => getGridApi, getGridElement: () => getGridElement, getMultipleSheetsAsExcel: () => getMultipleSheetsAsExcel, iconOverrides: () => iconOverrides, iconSetAlpine: () => iconSetAlpine, iconSetBalham: () => iconSetBalham, iconSetMaterial: () => iconSetMaterial, iconSetQuartz: () => iconSetQuartz, iconSetQuartzBold: () => iconSetQuartzBold, iconSetQuartzLight: () => iconSetQuartzLight, iconSetQuartzRegular: () => iconSetQuartzRegular, inputStyleBase: () => inputStyleBase, inputStyleBordered: () => inputStyleBordered, inputStyleUnderlined: () => inputStyleUnderlined, isColumn: () => isColumn, isColumnGroup: () => isColumnGroup, isColumnGroupAutoCol: () => isColumnGroupAutoCol, isColumnSelectionCol: () => isColumnSelectionCol, isCombinedFilterModel: () => isCombinedFilterModel, isProvidedColumnGroup: () => isProvidedColumnGroup, isRowNumberCol: () => isRowNumberCol, isSpecialCol: () => isSpecialCol, onRowHeightChanged: () => onRowHeightChanged, provideGlobalGridOptions: () => provideGlobalGridOptions, resetRowHeights: () => resetRowHeights, setupAgTestIds: () => setupAgTestIds, styleMaterial: () => styleMaterial, tabStyleAlpine: () => tabStyleAlpine, tabStyleBase: () => tabStyleBase, tabStyleMaterial: () => tabStyleMaterial, tabStyleQuartz: () => tabStyleQuartz, tabStyleRolodex: () => tabStyleRolodex, themeAlpine: () => themeAlpine, themeBalham: () => themeBalham, themeMaterial: () => themeMaterial, themeQuartz: () => themeQuartz, wrapAgTestIdFor: () => wrapAgTestIdFor }); module.exports = __toCommonJS(main_umd_styles_exports); // community-modules/styles/ag-grid.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '.ag-filter-panel-buttons {\n display: flex;\n justify-content: flex-end;\n overflow: hidden;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;\n flex-wrap: wrap;\n gap: var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);\n}\n\n.ag-filter-panel-buttons-button {\n line-height: 1.5;\n}\n\n.ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button {\n color: var(--ag-filter-panel-apply-button-color);\n background-color: var(--ag-filter-panel-apply-button-background-color);\n}\n\n.ag-filter-panel > *:where(:last-child) {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-row.ag-row-pinned-source {\n color: var(--ag-pinned-source-row-text-color);\n background-color: var(--ag-pinned-source-row-background-color);\n font-weight: var(--ag-pinned-source-row-font-weight);\n}\n\n.ag-row.ag-row-pinned {\n color: var(--ag-pinned-row-text-color);\n background-color: var(--ag-pinned-row-background-color);\n font-weight: var(--ag-pinned-row-font-weight);\n}\n\n.ag-floating-top-viewport {\n border-bottom: var(--ag-pinned-row-border);\n}\n\n.ag-floating-bottom-viewport {\n border-top: var(--ag-pinned-row-border);\n}\n\n.ag-measurement-container {\n --ag-legacy-styles-loaded: "true";\n}\n\n.ag-icon {\n font-family: var(--ag-icon-font-family);\n font-weight: var(--ag-icon-font-weight);\n color: var(--ag-icon-font-color);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n position: relative;\n}\n.ag-icon::before {\n content: "";\n font-family: inherit;\n}\n.ag-icon::after {\n background: transparent var(--ag-icon-image, none) center/contain no-repeat;\n display: var(--ag-icon-image-display);\n opacity: var(--ag-icon-image-opacity, 0.9);\n position: absolute;\n inset: 0;\n content: "";\n}\n\n.ag-icon-aggregation {\n font-family: var(--ag-icon-font-family-aggregation, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-aggregation, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-aggregation, var(--ag-icon-font-color));\n}\n\n.ag-icon-aggregation::before {\n content: var(--ag-icon-font-code-aggregation, "\\f101");\n display: var(--ag-icon-font-display-aggregation, var(--ag-icon-font-display));\n}\n\n.ag-icon-aggregation::after {\n background-image: var(--ag-icon-image-aggregation, var(--ag-icon-image));\n display: var(--ag-icon-image-display-aggregation, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-aggregation, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-arrows {\n font-family: var(--ag-icon-font-family-arrows, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-arrows, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-arrows, var(--ag-icon-font-color));\n}\n\n.ag-icon-arrows::before {\n content: var(--ag-icon-font-code-arrows, "\\f102");\n display: var(--ag-icon-font-display-arrows, var(--ag-icon-font-display));\n}\n\n.ag-icon-arrows::after {\n background-image: var(--ag-icon-image-arrows, var(--ag-icon-image));\n display: var(--ag-icon-image-display-arrows, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-arrows, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-asc {\n font-family: var(--ag-icon-font-family-asc, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-asc, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-asc, var(--ag-icon-font-color));\n}\n\n.ag-icon-asc::before {\n content: var(--ag-icon-font-code-asc, "\\f103");\n display: var(--ag-icon-font-display-asc, var(--ag-icon-font-display));\n}\n\n.ag-icon-asc::after {\n background-image: var(--ag-icon-image-asc, var(--ag-icon-image));\n display: var(--ag-icon-image-display-asc, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-asc, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-aasc {\n font-family: var(--ag-icon-font-family-aasc, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-aasc, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-aasc, var(--ag-icon-font-color));\n}\n\n.ag-icon-aasc::before {\n content: var(--ag-icon-font-code-aasc, "\\f13c");\n display: var(--ag-icon-font-display-aasc, var(--ag-icon-font-display));\n}\n\n.ag-icon-aasc::after {\n background-image: var(--ag-icon-image-aasc, var(--ag-icon-image));\n display: var(--ag-icon-image-display-aasc, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-aasc, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-adesc {\n font-family: var(--ag-icon-font-family-adesc, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-adesc, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-adesc, var(--ag-icon-font-color));\n}\n\n.ag-icon-adesc::before {\n content: var(--ag-icon-font-code-adesc, "\\f13d");\n display: var(--ag-icon-font-display-adesc, var(--ag-icon-font-display));\n}\n\n.ag-icon-adesc::after {\n background-image: var(--ag-icon-image-adesc, var(--ag-icon-image));\n display: var(--ag-icon-image-display-adesc, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-adesc, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-cancel {\n font-family: var(--ag-icon-font-family-cancel, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-cancel, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-cancel, var(--ag-icon-font-color));\n}\n\n.ag-icon-cancel::before {\n content: var(--ag-icon-font-code-cancel, "\\f104");\n display: var(--ag-icon-font-display-cancel, var(--ag-icon-font-display));\n}\n\n.ag-icon-cancel::after {\n background-image: var(--ag-icon-image-cancel, var(--ag-icon-image));\n display: var(--ag-icon-image-display-cancel, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-cancel, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-chart {\n font-family: var(--ag-icon-font-family-chart, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-chart, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-chart, var(--ag-icon-font-color));\n}\n\n.ag-icon-chart::before {\n content: var(--ag-icon-font-code-chart, "\\f105");\n display: var(--ag-icon-font-display-chart, var(--ag-icon-font-display));\n}\n\n.ag-icon-chart::after {\n background-image: var(--ag-icon-image-chart, var(--ag-icon-image));\n display: var(--ag-icon-image-display-chart, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-chart, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-checkbox-checked {\n font-family: var(--ag-icon-font-family-checkbox-checked, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-checkbox-checked, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-checkbox-checked, var(--ag-icon-font-color));\n}\n\n.ag-icon-checkbox-checked::before {\n content: var(--ag-icon-font-code-checkbox-checked, "\\f106");\n display: var(--ag-icon-font-display-checkbox-checked, var(--ag-icon-font-display));\n}\n\n.ag-icon-checkbox-checked::after {\n background-image: var(--ag-icon-image-checkbox-checked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-checked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-checked, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-checkbox-indeterminate {\n font-family: var(--ag-icon-font-family-checkbox-indeterminate, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-checkbox-indeterminate, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-checkbox-indeterminate, var(--ag-icon-font-color));\n}\n\n.ag-icon-checkbox-indeterminate::before {\n content: var(--ag-icon-font-code-checkbox-indeterminate, "\\f107");\n display: var(--ag-icon-font-display-checkbox-indeterminate, var(--ag-icon-font-display));\n}\n\n.ag-icon-checkbox-indeterminate::after {\n background-image: var(--ag-icon-image-checkbox-indeterminate, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-indeterminate, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-indeterminate, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-checkbox-unchecked {\n font-family: var(--ag-icon-font-family-checkbox-unchecked, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-checkbox-unchecked, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-checkbox-unchecked, var(--ag-icon-font-color));\n}\n\n.ag-icon-checkbox-unchecked::before {\n content: var(--ag-icon-font-code-checkbox-unchecked, "\\f108");\n display: var(--ag-icon-font-display-checkbox-unchecked, var(--ag-icon-font-display));\n}\n\n.ag-icon-checkbox-unchecked::after {\n background-image: var(--ag-icon-image-checkbox-unchecked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-unchecked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-unchecked, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-color-picker {\n font-family: var(--ag-icon-font-family-color-picker, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-color-picker, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-color-picker, var(--ag-icon-font-color));\n}\n\n.ag-icon-color-picker::before {\n content: var(--ag-icon-font-code-color-picker, "\\f109");\n display: var(--ag-icon-font-display-color-picker, var(--ag-icon-font-display));\n}\n\n.ag-icon-color-picker::after {\n background-image: var(--ag-icon-image-color-picker, var(--ag-icon-image));\n display: var(--ag-icon-image-display-color-picker, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-color-picker, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-columns {\n font-family: var(--ag-icon-font-family-columns, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-columns, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-columns, var(--ag-icon-font-color));\n}\n\n.ag-icon-columns::before {\n content: var(--ag-icon-font-code-columns, "\\f10a");\n display: var(--ag-icon-font-display-columns, var(--ag-icon-font-display));\n}\n\n.ag-icon-columns::after {\n background-image: var(--ag-icon-image-columns, var(--ag-icon-image));\n display: var(--ag-icon-image-display-columns, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-columns, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-contracted {\n font-family: var(--ag-icon-font-family-contracted, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-contracted, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-contracted, var(--ag-icon-font-color));\n}\n\n.ag-icon-contracted::before {\n content: var(--ag-icon-font-code-contracted, "\\f10b");\n display: var(--ag-icon-font-display-contracted, var(--ag-icon-font-display));\n}\n\n.ag-icon-contracted::after {\n background-image: var(--ag-icon-image-contracted, var(--ag-icon-image));\n display: var(--ag-icon-image-display-contracted, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-contracted, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-copy {\n font-family: var(--ag-icon-font-family-copy, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-copy, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-copy, var(--ag-icon-font-color));\n}\n\n.ag-icon-copy::before {\n content: var(--ag-icon-font-code-copy, "\\f10c");\n display: var(--ag-icon-font-display-copy, var(--ag-icon-font-display));\n}\n\n.ag-icon-copy::after {\n background-image: var(--ag-icon-image-copy, var(--ag-icon-image));\n display: var(--ag-icon-image-display-copy, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-copy, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-cross {\n font-family: var(--ag-icon-font-family-cross, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-cross, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-cross, var(--ag-icon-font-color));\n}\n\n.ag-icon-cross::before {\n content: var(--ag-icon-font-code-cross, "\\f10d");\n display: var(--ag-icon-font-display-cross, var(--ag-icon-font-display));\n}\n\n.ag-icon-cross::after {\n background-image: var(--ag-icon-image-cross, var(--ag-icon-image));\n display: var(--ag-icon-image-display-cross, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-cross, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-csv {\n font-family: var(--ag-icon-font-family-csv, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-csv, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-csv, var(--ag-icon-font-color));\n}\n\n.ag-icon-csv::before {\n content: var(--ag-icon-font-code-csv, "\\f10e");\n display: var(--ag-icon-font-display-csv, var(--ag-icon-font-display));\n}\n\n.ag-icon-csv::after {\n background-image: var(--ag-icon-image-csv, var(--ag-icon-image));\n display: var(--ag-icon-image-display-csv, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-csv, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-cut {\n font-family: var(--ag-icon-font-family-cut, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-cut, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-cut, var(--ag-icon-font-color));\n}\n\n.ag-icon-cut::before {\n content: var(--ag-icon-font-code-cut, "\\f10f");\n display: var(--ag-icon-font-display-cut, var(--ag-icon-font-display));\n}\n\n.ag-icon-cut::after {\n background-image: var(--ag-icon-image-cut, var(--ag-icon-image));\n display: var(--ag-icon-image-display-cut, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-cut, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-desc {\n font-family: var(--ag-icon-font-family-desc, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-desc, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-desc, var(--ag-icon-font-color));\n}\n\n.ag-icon-desc::before {\n content: var(--ag-icon-font-code-desc, "\\f110");\n display: var(--ag-icon-font-display-desc, var(--ag-icon-font-display));\n}\n\n.ag-icon-desc::after {\n background-image: var(--ag-icon-image-desc, var(--ag-icon-image));\n display: var(--ag-icon-image-display-desc, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-desc, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-excel {\n font-family: var(--ag-icon-font-family-excel, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-excel, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-excel, var(--ag-icon-font-color));\n}\n\n.ag-icon-excel::before {\n content: var(--ag-icon-font-code-excel, "\\f111");\n display: var(--ag-icon-font-display-excel, var(--ag-icon-font-display));\n}\n\n.ag-icon-excel::after {\n background-image: var(--ag-icon-image-excel, var(--ag-icon-image));\n display: var(--ag-icon-image-display-excel, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-excel, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-expanded {\n font-family: var(--ag-icon-font-family-expanded, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-expanded, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-expanded, var(--ag-icon-font-color));\n}\n\n.ag-icon-expanded::before {\n content: var(--ag-icon-font-code-expanded, "\\f112");\n display: var(--ag-icon-font-display-expanded, var(--ag-icon-font-display));\n}\n\n.ag-icon-expanded::after {\n background-image: var(--ag-icon-image-expanded, var(--ag-icon-image));\n display: var(--ag-icon-image-display-expanded, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-expanded, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-eye-slash {\n font-family: var(--ag-icon-font-family-eye-slash, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-eye-slash, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-eye-slash, var(--ag-icon-font-color));\n}\n\n.ag-icon-eye-slash::before {\n content: var(--ag-icon-font-code-eye-slash, "\\f113");\n display: var(--ag-icon-font-display-eye-slash, var(--ag-icon-font-display));\n}\n\n.ag-icon-eye-slash::after {\n background-image: var(--ag-icon-image-eye-slash, var(--ag-icon-image));\n display: var(--ag-icon-image-display-eye-slash, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-eye-slash, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-eye {\n font-family: var(--ag-icon-font-family-eye, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-eye, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-eye, var(--ag-icon-font-color));\n}\n\n.ag-icon-eye::before {\n content: var(--ag-icon-font-code-eye, "\\f114");\n display: var(--ag-icon-font-display-eye, var(--ag-icon-font-display));\n}\n\n.ag-icon-eye::after {\n background-image: var(--ag-icon-image-eye, var(--ag-icon-image));\n display: var(--ag-icon-image-display-eye, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-eye, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-filter {\n font-family: var(--ag-icon-font-family-filter, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-filter, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-filter, var(--ag-icon-font-color));\n}\n\n.ag-icon-filter::before {\n content: var(--ag-icon-font-code-filter, "\\f115");\n display: var(--ag-icon-font-display-filter, var(--ag-icon-font-display));\n}\n\n.ag-icon-filter::after {\n background-image: var(--ag-icon-image-filter, var(--ag-icon-image));\n display: var(--ag-icon-image-display-filter, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-filter, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-first {\n font-family: var(--ag-icon-font-family-first, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-first, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-first, var(--ag-icon-font-color));\n}\n\n.ag-icon-first::before {\n content: var(--ag-icon-font-code-first, "\\f116");\n display: var(--ag-icon-font-display-first, var(--ag-icon-font-display));\n}\n\n.ag-icon-first::after {\n background-image: var(--ag-icon-image-first, var(--ag-icon-image));\n display: var(--ag-icon-image-display-first, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-first, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-grip {\n font-family: var(--ag-icon-font-family-grip, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-grip, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-grip, var(--ag-icon-font-color));\n}\n\n.ag-icon-grip::before {\n content: var(--ag-icon-font-code-grip, "\\f117");\n display: var(--ag-icon-font-display-grip, var(--ag-icon-font-display));\n}\n\n.ag-icon-grip::after {\n background-image: var(--ag-icon-image-grip, var(--ag-icon-image));\n display: var(--ag-icon-image-display-grip, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-grip, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-group {\n font-family: var(--ag-icon-font-family-group, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-group, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-group, var(--ag-icon-font-color));\n}\n\n.ag-icon-group::before {\n content: var(--ag-icon-font-code-group, "\\f118");\n display: var(--ag-icon-font-display-group, var(--ag-icon-font-display));\n}\n\n.ag-icon-group::after {\n background-image: var(--ag-icon-image-group, var(--ag-icon-image));\n display: var(--ag-icon-image-display-group, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-group, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-last {\n font-family: var(--ag-icon-font-family-last, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-last, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-last, var(--ag-icon-font-color));\n}\n\n.ag-icon-last::before {\n content: var(--ag-icon-font-code-last, "\\f119");\n display: var(--ag-icon-font-display-last, var(--ag-icon-font-display));\n}\n\n.ag-icon-last::after {\n background-image: var(--ag-icon-image-last, var(--ag-icon-image));\n display: var(--ag-icon-image-display-last, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-last, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-left {\n font-family: var(--ag-icon-font-family-left, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-left, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-left, var(--ag-icon-font-color));\n}\n\n.ag-icon-left::before {\n content: var(--ag-icon-font-code-left, "\\f11a");\n display: var(--ag-icon-font-display-left, var(--ag-icon-font-display));\n}\n\n.ag-icon-left::after {\n background-image: var(--ag-icon-image-left, var(--ag-icon-image));\n display: var(--ag-icon-image-display-left, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-left, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-linked {\n font-family: var(--ag-icon-font-family-linked, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-linked, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-linked, var(--ag-icon-font-color));\n}\n\n.ag-icon-linked::before {\n content: var(--ag-icon-font-code-linked, "\\f11b");\n display: var(--ag-icon-font-display-linked, var(--ag-icon-font-display));\n}\n\n.ag-icon-linked::after {\n background-image: var(--ag-icon-image-linked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-linked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-linked, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-loading {\n font-family: var(--ag-icon-font-family-loading, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-loading, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-loading, var(--ag-icon-font-color));\n}\n\n.ag-icon-loading::before {\n content: var(--ag-icon-font-code-loading, "\\f11c");\n display: var(--ag-icon-font-display-loading, var(--ag-icon-font-display));\n}\n\n.ag-icon-loading::after {\n background-image: var(--ag-icon-image-loading, var(--ag-icon-image));\n display: var(--ag-icon-image-display-loading, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-loading, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-maximize {\n font-family: var(--ag-icon-font-family-maximize, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-maximize, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-maximize, var(--ag-icon-font-color));\n}\n\n.ag-icon-maximize::before {\n content: var(--ag-icon-font-code-maximize, "\\f11d");\n display: var(--ag-icon-font-display-maximize, var(--ag-icon-font-display));\n}\n\n.ag-icon-maximize::after {\n background-image: var(--ag-icon-image-maximize, var(--ag-icon-image));\n display: var(--ag-icon-image-display-maximize, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-maximize, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-menu {\n font-family: var(--ag-icon-font-family-menu, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-menu, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-menu, var(--ag-icon-font-color));\n}\n\n.ag-icon-menu::before {\n content: var(--ag-icon-font-code-menu, "\\f11e");\n display: var(--ag-icon-font-display-menu, var(--ag-icon-font-display));\n}\n\n.ag-icon-menu::after {\n background-image: var(--ag-icon-image-menu, var(--ag-icon-image));\n display: var(--ag-icon-image-display-menu, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-menu, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-minimize {\n font-family: var(--ag-icon-font-family-minimize, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-minimize, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-minimize, var(--ag-icon-font-color));\n}\n\n.ag-icon-minimize::before {\n content: var(--ag-icon-font-code-minimize, "\\f11f");\n display: var(--ag-icon-font-display-minimize, var(--ag-icon-font-display));\n}\n\n.ag-icon-minimize::after {\n background-image: var(--ag-icon-image-minimize, var(--ag-icon-image));\n display: var(--ag-icon-image-display-minimize, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-minimize, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-next {\n font-family: var(--ag-icon-font-family-next, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-next, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-next, var(--ag-icon-font-color));\n}\n\n.ag-icon-next::before {\n content: var(--ag-icon-font-code-next, "\\f120");\n display: var(--ag-icon-font-display-next, var(--ag-icon-font-display));\n}\n\n.ag-icon-next::after {\n background-image: var(--ag-icon-image-next, var(--ag-icon-image));\n display: var(--ag-icon-image-display-next, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-next, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-none {\n font-family: var(--ag-icon-font-family-none, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-none, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-none, var(--ag-icon-font-color));\n}\n\n.ag-icon-none::before {\n content: var(--ag-icon-font-code-none, "\\f121");\n display: var(--ag-icon-font-display-none, var(--ag-icon-font-display));\n}\n\n.ag-icon-none::after {\n background-image: var(--ag-icon-image-none, var(--ag-icon-image));\n display: var(--ag-icon-image-display-none, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-none, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-not-allowed {\n font-family: var(--ag-icon-font-family-not-allowed, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-not-allowed, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-not-allowed, var(--ag-icon-font-color));\n}\n\n.ag-icon-not-allowed::before {\n content: var(--ag-icon-font-code-not-allowed, "\\f122");\n display: var(--ag-icon-font-display-not-allowed, var(--ag-icon-font-display));\n}\n\n.ag-icon-not-allowed::after {\n background-image: var(--ag-icon-image-not-allowed, var(--ag-icon-image));\n display: var(--ag-icon-image-display-not-allowed, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-not-allowed, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-paste {\n font-family: var(--ag-icon-font-family-paste, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-paste, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-paste, var(--ag-icon-font-color));\n}\n\n.ag-icon-paste::before {\n content: var(--ag-icon-font-code-paste, "\\f123");\n display: var(--ag-icon-font-display-paste, var(--ag-icon-font-display));\n}\n\n.ag-icon-paste::after {\n background-image: var(--ag-icon-image-paste, var(--ag-icon-image));\n display: var(--ag-icon-image-display-paste, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-paste, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-pin {\n font-family: var(--ag-icon-font-family-pin, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-pin, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-pin, var(--ag-icon-font-color));\n}\n\n.ag-icon-pin::before {\n content: var(--ag-icon-font-code-pin, "\\f124");\n display: var(--ag-icon-font-display-pin, var(--ag-icon-font-display));\n}\n\n.ag-icon-pin::after {\n background-image: var(--ag-icon-image-pin, var(--ag-icon-image));\n display: var(--ag-icon-image-display-pin, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-pin, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-pivot {\n font-family: var(--ag-icon-font-family-pivot, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-pivot, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-pivot, var(--ag-icon-font-color));\n}\n\n.ag-icon-pivot::before {\n content: var(--ag-icon-font-code-pivot, "\\f125");\n display: var(--ag-icon-font-display-pivot, var(--ag-icon-font-display));\n}\n\n.ag-icon-pivot::after {\n background-image: var(--ag-icon-image-pivot, var(--ag-icon-image));\n display: var(--ag-icon-image-display-pivot, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-pivot, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-previous {\n font-family: var(--ag-icon-font-family-previous, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-previous, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-previous, var(--ag-icon-font-color));\n}\n\n.ag-icon-previous::before {\n content: var(--ag-icon-font-code-previous, "\\f126");\n display: var(--ag-icon-font-display-previous, var(--ag-icon-font-display));\n}\n\n.ag-icon-previous::after {\n background-image: var(--ag-icon-image-previous, var(--ag-icon-image));\n display: var(--ag-icon-image-display-previous, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-previous, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-radio-button-off {\n font-family: var(--ag-icon-font-family-radio-button-off, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-radio-button-off, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-radio-button-off, var(--ag-icon-font-color));\n}\n\n.ag-icon-radio-button-off::before {\n content: var(--ag-icon-font-code-radio-button-off, "\\f127");\n display: var(--ag-icon-font-display-radio-button-off, var(--ag-icon-font-display));\n}\n\n.ag-icon-radio-button-off::after {\n background-image: var(--ag-icon-image-radio-button-off, var(--ag-icon-image));\n display: var(--ag-icon-image-display-radio-button-off, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-radio-button-off, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-radio-button-on {\n font-family: var(--ag-icon-font-family-radio-button-on, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-radio-button-on, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-radio-button-on, var(--ag-icon-font-color));\n}\n\n.ag-icon-radio-button-on::before {\n content: var(--ag-icon-font-code-radio-button-on, "\\f128");\n display: var(--ag-icon-font-display-radio-button-on, var(--ag-icon-font-display));\n}\n\n.ag-icon-radio-button-on::after {\n background-image: var(--ag-icon-image-radio-button-on, var(--ag-icon-image));\n display: var(--ag-icon-image-display-radio-button-on, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-radio-button-on, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-right {\n font-family: var(--ag-icon-font-family-right, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-right, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-right, var(--ag-icon-font-color));\n}\n\n.ag-icon-right::before {\n content: var(--ag-icon-font-code-right, "\\f129");\n display: var(--ag-icon-font-display-right, var(--ag-icon-font-display));\n}\n\n.ag-icon-right::after {\n background-image: var(--ag-icon-image-right, var(--ag-icon-image));\n display: var(--ag-icon-image-display-right, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-right, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-save {\n font-family: var(--ag-icon-font-family-save, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-save, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-save, var(--ag-icon-font-color));\n}\n\n.ag-icon-save::before {\n content: var(--ag-icon-font-code-save, "\\f12a");\n display: var(--ag-icon-font-display-save, var(--ag-icon-font-display));\n}\n\n.ag-icon-save::after {\n background-image: var(--ag-icon-image-save, var(--ag-icon-image));\n display: var(--ag-icon-image-display-save, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-save, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-small-down {\n font-family: var(--ag-icon-font-family-small-down, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-small-down, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-small-down, var(--ag-icon-font-color));\n}\n\n.ag-icon-small-down::before {\n content: var(--ag-icon-font-code-small-down, "\\f12b");\n display: var(--ag-icon-font-display-small-down, var(--ag-icon-font-display));\n}\n\n.ag-icon-small-down::after {\n background-image: var(--ag-icon-image-small-down, var(--ag-icon-image));\n display: var(--ag-icon-image-display-small-down, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-small-down, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-small-left {\n font-family: var(--ag-icon-font-family-small-left, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-small-left, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-small-left, var(--ag-icon-font-color));\n}\n\n.ag-icon-small-left::before {\n content: var(--ag-icon-font-code-small-left, "\\f12c");\n display: var(--ag-icon-font-display-small-left, var(--ag-icon-font-display));\n}\n\n.ag-icon-small-left::after {\n background-image: var(--ag-icon-image-small-left, var(--ag-icon-image));\n display: var(--ag-icon-image-display-small-left, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-small-left, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-small-right {\n font-family: var(--ag-icon-font-family-small-right, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-small-right, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-small-right, var(--ag-icon-font-color));\n}\n\n.ag-icon-small-right::before {\n content: var(--ag-icon-font-code-small-right, "\\f12d");\n display: var(--ag-icon-font-display-small-right, var(--ag-icon-font-display));\n}\n\n.ag-icon-small-right::after {\n background-image: var(--ag-icon-image-small-right, var(--ag-icon-image));\n display: var(--ag-icon-image-display-small-right, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-small-right, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-small-up {\n font-family: var(--ag-icon-font-family-small-up, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-small-up, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-small-up, var(--ag-icon-font-color));\n}\n\n.ag-icon-small-up::before {\n content: var(--ag-icon-font-code-small-up, "\\f12e");\n display: var(--ag-icon-font-display-small-up, var(--ag-icon-font-display));\n}\n\n.ag-icon-small-up::after {\n background-image: var(--ag-icon-image-small-up, var(--ag-icon-image));\n display: var(--ag-icon-image-display-small-up, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-small-up, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-tick {\n font-family: var(--ag-icon-font-family-tick, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-tick, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-tick, var(--ag-icon-font-color));\n}\n\n.ag-icon-tick::before {\n content: var(--ag-icon-font-code-tick, "\\f12f");\n display: var(--ag-icon-font-display-tick, var(--ag-icon-font-display));\n}\n\n.ag-icon-tick::after {\n background-image: var(--ag-icon-image-tick, var(--ag-icon-image));\n display: var(--ag-icon-image-display-tick, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-tick, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-tree-closed {\n font-family: var(--ag-icon-font-family-tree-closed, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-tree-closed, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-tree-closed, var(--ag-icon-font-color));\n}\n\n.ag-icon-tree-closed::before {\n content: var(--ag-icon-font-code-tree-closed, "\\f130");\n display: var(--ag-icon-font-display-tree-closed, var(--ag-icon-font-display));\n}\n\n.ag-icon-tree-closed::after {\n background-image: var(--ag-icon-image-tree-closed, var(--ag-icon-image));\n display: var(--ag-icon-image-display-tree-closed, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-tree-closed, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-tree-indeterminate {\n font-family: var(--ag-icon-font-family-tree-indeterminate, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-tree-indeterminate, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-tree-indeterminate, var(--ag-icon-font-color));\n}\n\n.ag-icon-tree-indeterminate::before {\n content: var(--ag-icon-font-code-tree-indeterminate, "\\f131");\n display: var(--ag-icon-font-display-tree-indeterminate, var(--ag-icon-font-display));\n}\n\n.ag-icon-tree-indeterminate::after {\n background-image: var(--ag-icon-image-tree-indeterminate, var(--ag-icon-image));\n display: var(--ag-icon-image-display-tree-indeterminate, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-tree-indeterminate, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-tree-open {\n font-family: var(--ag-icon-font-family-tree-open, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-tree-open, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-tree-open, var(--ag-icon-font-color));\n}\n\n.ag-icon-tree-open::before {\n content: var(--ag-icon-font-code-tree-open, "\\f132");\n display: var(--ag-icon-font-display-tree-open, var(--ag-icon-font-display));\n}\n\n.ag-icon-tree-open::after {\n background-image: var(--ag-icon-image-tree-open, var(--ag-icon-image));\n display: var(--ag-icon-image-display-tree-open, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-tree-open, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-unlinked {\n font-family: var(--ag-icon-font-family-unlinked, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-unlinked, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-unlinked, var(--ag-icon-font-color));\n}\n\n.ag-icon-unlinked::before {\n content: var(--ag-icon-font-code-unlinked, "\\f133");\n display: var(--ag-icon-font-display-unlinked, var(--ag-icon-font-display));\n}\n\n.ag-icon-unlinked::after {\n background-image: var(--ag-icon-image-unlinked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-unlinked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-unlinked, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-up {\n font-family: var(--ag-icon-font-family-up, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-up, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-up, var(--ag-icon-font-color));\n}\n\n.ag-icon-up::before {\n content: var(--ag-icon-font-code-up, "\\f134");\n display: var(--ag-icon-font-display-up, var(--ag-icon-font-display));\n}\n\n.ag-icon-up::after {\n background-image: var(--ag-icon-image-up, var(--ag-icon-image));\n display: var(--ag-icon-image-display-up, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-up, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-down {\n font-family: var(--ag-icon-font-family-down, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-down, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-down, var(--ag-icon-font-color));\n}\n\n.ag-icon-down::before {\n content: var(--ag-icon-font-code-down, "\\f135");\n display: var(--ag-icon-font-display-down, var(--ag-icon-font-display));\n}\n\n.ag-icon-down::after {\n background-image: var(--ag-icon-image-down, var(--ag-icon-image));\n display: var(--ag-icon-image-display-down, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-down, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-plus {\n font-family: var(--ag-icon-font-family-plus, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-plus, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-plus, var(--ag-icon-font-color));\n}\n\n.ag-icon-plus::before {\n content: var(--ag-icon-font-code-plus, "\\f136");\n display: var(--ag-icon-font-display-plus, var(--ag-icon-font-display));\n}\n\n.ag-icon-plus::after {\n background-image: var(--ag-icon-image-plus, var(--ag-icon-image));\n display: var(--ag-icon-image-display-plus, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-plus, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-minus {\n font-family: var(--ag-icon-font-family-minus, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-minus, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-minus, var(--ag-icon-font-color));\n}\n\n.ag-icon-minus::before {\n content: var(--ag-icon-font-code-minus, "\\f137");\n display: var(--ag-icon-font-display-minus, var(--ag-icon-font-display));\n}\n\n.ag-icon-minus::after {\n background-image: var(--ag-icon-image-minus, var(--ag-icon-image));\n display: var(--ag-icon-image-display-minus, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-minus, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-menu-alt {\n font-family: var(--ag-icon-font-family-menu-alt, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-menu-alt, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-menu-alt, var(--ag-icon-font-color));\n}\n\n.ag-icon-menu-alt::before {\n content: var(--ag-icon-font-code-menu-alt, "\\f138");\n display: var(--ag-icon-font-display-menu-alt, var(--ag-icon-font-display));\n}\n\n.ag-icon-menu-alt::after {\n background-image: var(--ag-icon-image-menu-alt, var(--ag-icon-image));\n display: var(--ag-icon-image-display-menu-alt, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-menu-alt, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-settings {\n font-family: var(--ag-icon-font-family-settings, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-settings, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-settings, var(--ag-icon-font-color));\n}\n\n.ag-icon-settings::before {\n content: var(--ag-icon-font-code-settings, "\\f139");\n display: var(--ag-icon-font-display-settings, var(--ag-icon-font-display));\n}\n\n.ag-icon-settings::after {\n background-image: var(--ag-icon-image-settings, var(--ag-icon-image));\n display: var(--ag-icon-image-display-settings, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-settings, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-column-arrow {\n font-family: var(--ag-icon-font-family-column-arrow, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-column-arrow, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-column-arrow, var(--ag-icon-font-color));\n}\n\n.ag-icon-column-arrow::before {\n content: var(--ag-icon-font-code-column-arrow, "\\f13a");\n display: var(--ag-icon-font-display-column-arrow, var(--ag-icon-font-display));\n}\n\n.ag-icon-column-arrow::after {\n background-image: var(--ag-icon-image-column-arrow, var(--ag-icon-image));\n display: var(--ag-icon-image-display-column-arrow, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-column-arrow, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-un-pin {\n font-family: var(--ag-icon-font-family-un-pin, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-un-pin, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-un-pin, var(--ag-icon-font-color));\n}\n\n.ag-icon-un-pin::before {\n content: var(--ag-icon-font-code-un-pin, "\\f13b");\n display: var(--ag-icon-font-display-un-pin, var(--ag-icon-font-display));\n}\n\n.ag-icon-un-pin::after {\n background-image: var(--ag-icon-image-un-pin, var(--ag-icon-image));\n display: var(--ag-icon-image-display-un-pin, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-un-pin, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-pinned-bottom {\n font-family: var(--ag-icon-font-family-pinned-bottom, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-pinned-bottom, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-pinned-bottom, var(--ag-icon-font-color));\n}\n\n.ag-icon-pinned-bottom::before {\n content: var(--ag-icon-font-code-pinned-bottom, "\\f13e");\n display: var(--ag-icon-font-display-pinned-bottom, var(--ag-icon-font-display));\n}\n\n.ag-icon-pinned-bottom::after {\n background-image: var(--ag-icon-image-pinned-bottom, var(--ag-icon-image));\n display: var(--ag-icon-image-display-pinned-bottom, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-pinned-bottom, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-pinned-top {\n font-family: var(--ag-icon-font-family-pinned-top, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-pinned-top, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-pinned-top, var(--ag-icon-font-color));\n}\n\n.ag-icon-pinned-top::before {\n content: var(--ag-icon-font-code-pinned-top, "\\f13f");\n display: var(--ag-icon-font-display-pinned-top, var(--ag-icon-font-display));\n}\n\n.ag-icon-pinned-top::after {\n background-image: var(--ag-icon-image-pinned-top, var(--ag-icon-image));\n display: var(--ag-icon-image-display-pinned-top, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-pinned-top, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-chevron-up {\n font-family: var(--ag-icon-font-family-chevron-up, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-chevron-up, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-chevron-up, var(--ag-icon-font-color));\n}\n\n.ag-icon-chevron-up::before {\n content: var(--ag-icon-font-code-chevron-up, "\\f140");\n display: var(--ag-icon-font-display-chevron-up, var(--ag-icon-font-display));\n}\n\n.ag-icon-chevron-up::after {\n background-image: var(--ag-icon-image-chevron-up, var(--ag-icon-image));\n display: var(--ag-icon-image-display-chevron-up, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-chevron-up, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-chevron-down {\n font-family: var(--ag-icon-font-family-chevron-down, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-chevron-down, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-chevron-down, var(--ag-icon-font-color));\n}\n\n.ag-icon-chevron-down::before {\n content: var(--ag-icon-font-code-chevron-down, "\\f141");\n display: var(--ag-icon-font-display-chevron-down, var(--ag-icon-font-display));\n}\n\n.ag-icon-chevron-down::after {\n background-image: var(--ag-icon-image-chevron-down, var(--ag-icon-image));\n display: var(--ag-icon-image-display-chevron-down, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-chevron-down, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-chevron-left {\n font-family: var(--ag-icon-font-family-chevron-left, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-chevron-left, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-chevron-left, var(--ag-icon-font-color));\n}\n\n.ag-icon-chevron-left::before {\n content: var(--ag-icon-font-code-chevron-left, "\\f142");\n display: var(--ag-icon-font-display-chevron-left, var(--ag-icon-font-display));\n}\n\n.ag-icon-chevron-left::after {\n background-image: var(--ag-icon-image-chevron-left, var(--ag-icon-image));\n display: var(--ag-icon-image-display-chevron-left, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-chevron-left, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-chevron-right {\n font-family: var(--ag-icon-font-family-chevron-right, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-chevron-right, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-chevron-right, var(--ag-icon-font-color));\n}\n\n.ag-icon-chevron-right::before {\n content: var(--ag-icon-font-code-chevron-right, "\\f143");\n display: var(--ag-icon-font-display-chevron-right, var(--ag-icon-font-display));\n}\n\n.ag-icon-chevron-right::after {\n background-image: var(--ag-icon-image-chevron-right, var(--ag-icon-image));\n display: var(--ag-icon-image-display-chevron-right, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-chevron-right, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-filter-add {\n font-family: var(--ag-icon-font-family-filter-add, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-filter-add, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-filter-add, var(--ag-icon-font-color));\n}\n\n.ag-icon-filter-add::before {\n content: var(--ag-icon-font-code-filter-add, "\\f144");\n display: var(--ag-icon-font-display-filter-add, var(--ag-icon-font-display));\n}\n\n.ag-icon-filter-add::after {\n background-image: var(--ag-icon-image-filter-add, var(--ag-icon-image));\n display: var(--ag-icon-image-display-filter-add, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-filter-add, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-edit {\n font-family: var(--ag-icon-font-family-edit, var(--ag-icon-font-family));\n font-weight: var(--ag-icon-font-weight-edit, var(--ag-icon-font-weight));\n color: var(--ag-icon-font-color-edit, var(--ag-icon-font-color));\n}\n\n.ag-icon-edit::before {\n content: var(--ag-icon-font-code-edit, "\\f145");\n display: var(--ag-icon-font-display-edit, var(--ag-icon-font-display));\n}\n\n.ag-icon-edit::after {\n background-image: var(--ag-icon-image-edit, var(--ag-icon-image));\n display: var(--ag-icon-image-display-edit, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-edit, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-icon-row-drag::before {\n content: var(--ag-icon-font-code-grip);\n}\n\n.ag-left-arrow::before {\n content: var(--ag-icon-font-code-left);\n}\n\n.ag-right-arrow::before {\n content: var(--ag-icon-font-code-right);\n}\n\n[class*=ag-theme-] {\n --ag-foreground-color: #000;\n --ag-data-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-header-foreground-color: var(--ag-secondary-foreground-color);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.5);\n --ag-background-color: #fff;\n --ag-header-background-color: transparent;\n --ag-tooltip-background-color: transparent;\n --ag-tooltip-error-background-color: color-mix(\n in srgb,\n var(--ag-background-color),\n var(--ag-invalid-color) 10%\n );\n --ag-tooltip-error-text-color: var(--ag-invalid-color);\n --ag-tooltip-error-border-color: color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 25%);\n --ag-subheader-background-color: transparent;\n --ag-subheader-toolbar-background-color: transparent;\n --ag-control-panel-background-color: transparent;\n --ag-side-button-selected-background-color: var(--ag-control-panel-background-color);\n --ag-selected-row-background-color: #bbb;\n --ag-data-background-color: var(--ag-background-color);\n --ag-odd-row-background-color: var(--ag-data-background-color);\n --ag-modal-overlay-background-color: rgba(255, 255, 255, 0.66);\n --ag-menu-background-color: var(--ag-background-color);\n --ag-menu-border-color: var(--ag-border-color);\n --ag-panel-background-color: var(--ag-background-color);\n --ag-panel-border-color: var(--ag-border-color);\n --ag-row-hover-color: transparent;\n --ag-column-hover-color: transparent;\n --ag-range-selection-border-color: var(--ag-foreground-color);\n --ag-row-drag-indicator-color: var(--ag-range-selection-border-color);\n --ag-row-drag-indicator-width: 2px;\n --ag-column-drag-indicator-color: var(--ag-range-selection-border-color);\n --ag-column-drag-indicator-width: 2px;\n --ag-range-selection-border-style: solid;\n --ag-range-selection-background-color: rgba(0, 0, 0, 0.2);\n --ag-range-selection-background-color-2: var(--ag-range-selection-background-color);\n --ag-range-selection-background-color-3: var(--ag-range-selection-background-color);\n --ag-range-selection-background-color-4: var(--ag-range-selection-background-color);\n --ag-range-selection-highlight-color: var(--ag-range-selection-border-color);\n --ag-range-header-highlight-color: color-mix(\n in srgb,\n var(--ag-header-background-color),\n var(--ag-foreground-color) 8%\n );\n --ag-selected-tab-underline-color: var(--ag-range-selection-border-color);\n --ag-selected-tab-underline-width: 0;\n --ag-selected-tab-underline-transition-speed: 0s;\n --ag-range-selection-chart-category-background-color: rgba(0, 255, 132, 0.1);\n --ag-range-selection-chart-background-color: rgba(0, 88, 255, 0.1);\n --ag-header-cell-hover-background-color: transparent;\n --ag-header-cell-moving-background-color: var(--ag-background-color);\n --ag-value-change-value-highlight-background-color: rgba(22, 160, 133, 0.5);\n --ag-value-change-delta-up-color: #43a047;\n --ag-value-change-delta-down-color: #e53935;\n --ag-row-loading-skeleton-effect-color: rgba(66, 66, 66, 0.2);\n --ag-chip-background-color: transparent;\n --ag-chip-border-color: var(--ag-chip-background-color);\n --ag-borders: solid 1px;\n --ag-border-color: rgba(0, 0, 0, 0.25);\n --ag-borders-critical: var(--ag-borders);\n --ag-borders-secondary: var(--ag-borders);\n --ag-secondary-border-color: var(--ag-border-color);\n --ag-row-border-style: solid;\n --ag-row-border-color: var(--ag-secondary-border-color);\n --ag-row-border-width: 1px;\n --ag-cell-horizontal-border: solid transparent;\n --ag-borders-input: var(--ag-borders-secondary);\n --ag-input-border-color: var(--ag-secondary-border-color);\n --ag-borders-input-invalid: solid 2px;\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-full-row-invalid-background-color: color-mix(\n in srgb,\n var(--ag-background-color),\n var(--ag-invalid-color) 25%\n );\n --ag-borders-side-button: var(--ag-borders);\n --ag-border-radius: 0px;\n --ag-wrapper-border-radius: var(--ag-border-radius);\n --ag-row-border-color: var(--ag-secondary-border-color);\n --ag-header-column-separator-display: none;\n --ag-header-column-separator-height: 100%;\n --ag-header-column-separator-width: 1px;\n --ag-header-column-separator-color: var(--ag-secondary-border-color);\n --ag-header-column-resize-handle-display: none;\n --ag-header-column-resize-handle-height: 50%;\n --ag-header-column-resize-handle-width: 1px;\n --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\n --ag-invalid-color: red;\n --ag-input-disabled-border-color: var(--ag-input-border-color);\n --ag-input-disabled-background-color: transparent;\n --ag-checkbox-background-color: transparent;\n --ag-checkbox-border-radius: var(--ag-border-radius);\n --ag-checkbox-checked-color: var(--ag-foreground-color);\n --ag-checkbox-unchecked-color: var(--ag-foreground-color);\n --ag-checkbox-indeterminate-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-off-border-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-off-background-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-on-border-color: var(--ag-checkbox-checked-color);\n --ag-toggle-button-on-background-color: var(--ag-checkbox-checked-color);\n --ag-toggle-button-switch-background-color: var(--ag-background-color);\n --ag-toggle-button-switch-border-color: var(--ag-toggle-button-off-border-color);\n --ag-toggle-button-border-width: 1px;\n --ag-toggle-button-height: var(--ag-icon-size);\n --ag-toggle-button-width: calc(var(--ag-toggle-button-height) * 2);\n --ag-input-focus-box-shadow: none;\n --ag-input-error-focus-box-shadow: none;\n --ag-input-focus-border-color: none;\n --ag-minichart-selected-chart-color: var(--ag-checkbox-checked-color);\n --ag-minichart-selected-page-color: var(--ag-checkbox-checked-color);\n --ag-grid-size: 4px;\n --ag-icon-size: 12px;\n --ag-icon-font-weight: normal;\n --ag-icon-font-color: var(--ag-foreground-color);\n --ag-icon-image-display: block;\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: var(--ag-grid-size);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-cell-widget-spacing: var(--ag-cell-horizontal-padding);\n --ag-row-height: calc(var(--ag-grid-size) * 6 + 1px);\n --ag-header-height: var(--ag-row-height);\n --ag-pagination-panel-height: var(--ag-header-height);\n --ag-list-item-height: calc(var(--ag-grid-size) * 5);\n --ag-column-select-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\n --ag-set-filter-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\n --ag-advanced-filter-builder-indent-size: calc(var(--ag-grid-size) * 2 + var(--ag-icon-size));\n --ag-row-group-indent-size: calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size));\n --ag-row-numbers-selected-color: #bbb;\n --ag-filter-tool-panel-group-indent: 16px;\n --ag-tab-min-width: 220px;\n --ag-chart-menu-panel-width: var(--ag-tab-min-width);\n --ag-menu-min-width: 181px;\n --ag-side-bar-panel-width: 200px;\n --ag-side-bar-panel-animation-duration: 0s;\n --ag-font-family: "Helvetica Neue", sans-serif;\n --ag-font-size: 14px;\n --ag-card-radius: var(--ag-border-radius);\n --ag-card-shadow: none;\n --ag-popup-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-background-color: #ffa500;\n --ag-cell-batch-edit-background-color: rgb(220 181 139 / 16%);\n --ag-cell-batch-edit-text-color: #422f00;\n --ag-row-batch-edit-background-color: var(--ag-cell-batch-edit-background-color);\n --ag-row-batch-edit-text-color: var(--ag-cell-batch-edit-text-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-background-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-background-color: var(--ag-background-color);\n --ag-filter-panel-card-subtle-color: var(--ag-foreground-color);\n --ag-filter-panel-card-subtle-hover-color: var(--ag-foreground-color);\n --ag-formula-token-1-color: #3269c6;\n --ag-formula-token-1-background-color: rgb(50 105 198 / 16%);\n --ag-formula-token-1-border-color: var(--ag-formula-token-1-color);\n --ag-formula-token-2-color: #c0343f;\n --ag-formula-token-2-background-color: rgb(192 52 63 / 16%);\n --ag-formula-token-2-border-color: var(--ag-formula-token-2-color);\n --ag-formula-token-3-color: #8156b8;\n --ag-formula-token-3-background-color: rgb(129 86 184 / 16%);\n --ag-formula-token-3-border-color: var(--ag-formula-token-3-color);\n --ag-formula-token-4-color: #007c1f;\n --ag-formula-token-4-background-color: rgb(0 124 31 / 16%);\n --ag-formula-token-4-border-color: var(--ag-formula-token-4-color);\n --ag-formula-token-5-color: #b03e85;\n --ag-formula-token-5-background-color: rgb(176 62 133 / 16%);\n --ag-formula-token-5-border-color: var(--ag-formula-token-5-color);\n --ag-formula-token-6-color: #b74900;\n --ag-formula-token-6-background-color: rgb(183 73 0 / 16%);\n --ag-formula-token-6-border-color: var(--ag-formula-token-6-color);\n --ag-formula-token-7-color: #247492;\n --ag-formula-token-7-background-color: rgb(36 116 146 / 16%);\n --ag-formula-token-7-border-color: var(--ag-formula-token-7-color);\n}\n\n.ag-root-wrapper,\n.ag-dnd-ghost {\n background-color: var(--ag-background-color);\n}\n\n.ag-sticky-top,\n.ag-sticky-bottom {\n background-color: var(--ag-data-background-color);\n}\n\n.ag-sticky-bottom .ag-pinned-left-sticky-bottom,\n.ag-sticky-bottom .ag-sticky-bottom-container,\n.ag-sticky-bottom .ag-pinned-right-sticky-bottom {\n border-top: var(--ag-row-border-style) var(--ag-row-border-color) var(--ag-row-border-width);\n}\n\n.ag-root-wrapper,\n.ag-popup {\n --ag-indentation-level: 0;\n}\n\n[class*=ag-theme-] {\n -webkit-font-smoothing: antialiased;\n font-family: var(--ag-font-family);\n font-size: var(--ag-font-size);\n line-height: normal;\n color: var(--ag-foreground-color);\n}\n\nag-grid,\nag-grid-angular,\nag-grid-ng2,\nag-grid-polymer,\nag-grid-aurelia {\n display: block;\n}\n\n.ag-aria-description-container {\n z-index: 9999;\n border: 0px;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n width: 1px;\n position: absolute;\n overflow: hidden;\n padding: 0px;\n white-space: nowrap;\n}\n\n.ag-hidden {\n display: none !important;\n}\n\n.ag-invisible {\n visibility: hidden !important;\n}\n\n.ag-drag-handle {\n cursor: grab;\n}\n\n.ag-column-drop-wrapper {\n display: flex;\n}\n\n.ag-column-drop-horizontal-half-width {\n display: inline-block;\n width: 50% !important;\n}\n\n.ag-unselectable {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-selectable {\n -moz-user-select: text;\n -webkit-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n\n.ag-tab {\n position: relative;\n}\n\n.ag-tab-guard {\n position: absolute;\n width: 0;\n height: 0;\n display: block;\n}\n\n.ag-virtual-list-viewport .ag-tab-guard {\n position: sticky;\n}\n\n.ag-tab-guard-top {\n top: 1px;\n}\n\n.ag-tab-guard-bottom {\n bottom: 1px;\n}\n\n.ag-select-agg-func-popup {\n position: absolute;\n}\n\n.ag-input-wrapper,\n.ag-picker-field-wrapper {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n line-height: normal;\n position: relative;\n}\n\n.ag-shake-left-to-right {\n animation-direction: alternate;\n animation-duration: 0.2s;\n animation-iteration-count: infinite;\n animation-name: ag-shake-left-to-right;\n}\n\n@keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n.ag-root-wrapper {\n cursor: default;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: normal;\n}\n.ag-root-wrapper.ag-layout-normal {\n height: 100%;\n}\n\n.ag-watermark {\n position: absolute;\n bottom: 20px;\n right: 25px;\n opacity: 0.7;\n transition: opacity 1s ease-out 3s;\n color: #9b9b9b;\n}\n.ag-watermark::before {\n content: "";\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjA5IiBoZWlnaHQ9IjM2IiB2aWV3Qm94PSIwIDAgMjA5IDM2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMTkyLjk5MyAyMy42NTgyVjE1LjcxMTdIMTc5LjQ1MkwxNzEuNTA1IDIzLjY1ODJIMTkyLjk5M1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTIwOC4yNSAzLjk1MDgxSDE5MS4yNzZMMTgzLjI2NiAxMS44OTczSDIwOC4yNVYzLjk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTYzLjYyMiAzMS42MDQ4TDE2Ny42OTEgMjcuNTM2MUgxODEuNDIzVjM1LjQ4MjdIMTYzLjYyMlYzMS42MDQ4WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTY2LjYxIDE5Ljc4MDNIMTc1LjM4M0wxODMuMzkzIDExLjgzMzdIMTY2LjYxVjE5Ljc4MDNaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xNTcuMDExIDMxLjYwNDdIMTYzLjYyMkwxNzEuNTA1IDIzLjY1ODJIMTU3LjAxMVYzMS42MDQ3WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTkxLjI3NiAzLjk1MDgxTDE4Ny4yMDggOC4wMTk0MUgxNjEuMjdWMC4wNzI4NzZIMTkxLjI3NlYzLjk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjAuODM5MSAzMC4yMDYxSDguMzc4OTJMNi4yMTc0NSAzNS41NDYySDAuNzUwMjQ0TDEyLjI1NjggOC41OTE1NUgxNy4wMjQ3TDI4LjUzMTMgMzUuNTQ2MkgyMy4wMDA1TDIwLjgzOTEgMzAuMjA2MVpNMTkuMTIyNyAyNS45NDY4TDE0LjYwOSAxNC45NDg4TDEwLjA5NTQgMjUuOTQ2OEgxOS4xMjI3WiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMTA0LjQzNyAxOC41MDg5QzEwNi4wMjYgMTYuMTU2NyAxMTAuMDMxIDE1LjkwMjQgMTExLjY4NCAxNS45MDI0VjIwLjQ3OTZDMTA5LjY1IDIwLjQ3OTYgMTA3LjYxNSAyMC41NDMyIDEwNi40MDcgMjEuNDMzMkMxMDUuMiAyMi4zMjMyIDEwNC41NjQgMjMuNTMxMSAxMDQuNTY0IDI0Ljk5MzJWMzUuNTQ2Mkg5OS42MDUxVjE1LjkwMjRIMTA0LjM3M0wxMDQuNDM3IDE4LjUwODlaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xMTkuMzc2IDE1LjkwMjRIMTE0LjQxOFYzNS41NDYySDExOS4zNzZWMTUuOTAyNFoiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTExOS4zNzYgNy4xMjkzOUgxMTQuNDE4VjEyLjk3OEgxMTkuMzc2VjcuMTI5MzlaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0xNDMuOTc5IDcuMTI5MzlWMzUuNTQ2MkgxMzkuMjExTDEzOS4wODQgMzIuNTU4M0MxMzguMzg0IDMzLjU3NTUgMTM3LjQ5NCAzNC40MDE5IDEzNi40MTQgMzUuMDM3NkMxMzUuMzMzIDM1LjYwOTggMTMzLjk5OCAzNS45Mjc2IDEzMi40NzIgMzUuOTI3NkMxMzEuMTM3IDM1LjkyNzYgMTI5Ljg2NiAzNS42NzMzIDEyOC43ODUgMzUuMjI4M0MxMjcuNjQxIDM0LjcxOTcgMTI2LjYyMyAzNC4wODQgMTI1Ljc5NyAzMy4xOTRDMTI0Ljk3MSAzMi4zMDQgMTI0LjI3MSAzMS4yMjMzIDEyMy44MjYgMzAuMDE1NEMxMjMuMzE4IDI4LjgwNzUgMTIzLjEyNyAyNy40MDkgMTIzLjEyNyAyNS44ODMyQzEyMy4xMjcgMjQuMzU3NSAxMjMuMzgxIDIyLjk1ODkgMTIzLjgyNiAyMS42ODc0QzEyNC4zMzUgMjAuNDE2IDEyNC45NzEgMTkuMzM1MyAxMjUuNzk3IDE4LjQ0NTNDMTI2LjYyMyAxNy41NTUyIDEyNy42NDEgMTYuODU2IDEyOC43ODUgMTYuMzQ3NEMxMjkuOTI5IDE1LjgzODggMTMxLjEzNyAxNS41ODQ1IDEzMi40NzIgMTUuNTg0NUMxMzMuOTk4IDE1LjU4NDUgMTM1LjI2OSAxNS44Mzg4IDEzNi4zNSAxNi40MTA5QzEzNy40MzEgMTYuOTgzMSAxMzguMzIxIDE3Ljc0NTkgMTM5LjAyIDE4LjgyNjdWNy4xOTI5NUgxNDMuOTc5VjcuMTI5MzlaTTEzMy41NTMgMzEuNjY4M0MxMzUuMjA2IDMxLjY2ODMgMTM2LjQ3NyAzMS4wOTYyIDEzNy40OTQgMzAuMDE1NEMxMzguNTExIDI4LjkzNDcgMTM5LjAyIDI3LjQ3MjUgMTM5LjAyIDI1LjY5MjVDMTM5LjAyIDIzLjkxMjUgMTM4LjUxMSAyMi41MTM5IDEzNy40OTQgMjEuMzY5NkMxMzYuNDc3IDIwLjI4ODggMTM1LjIwNiAxOS43MTY3IDEzMy41NTMgMTkuNzE2N0MxMzEuOTYzIDE5LjcxNjcgMTMwLjYyOCAyMC4yODg4IDEyOS42NzUgMjEuMzY5NkMxMjguNjU4IDIyLjQ1MDMgMTI4LjE0OSAyMy45MTI1IDEyOC4xNDkgMjUuNjkyNUMxMjguMTQ5IDI3LjQ3MjUgMTI4LjY1OCAyOC44NzExIDEyOS42NzUgMjkuOTUxOEMxMzAuNjkyIDMxLjA5NjEgMTMxLjk2MyAzMS42NjgzIDEzMy41NTMgMzEuNjY4M1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTU3LjIwMjQgMjAuMzUyNUg0NC45MzNWMjQuNjExOEg1MS45MjU5QzUxLjczNTIgMjYuNzczMyA1MC45MDg4IDI4LjQyNjEgNDkuNTEwMiAyOS43NjExQzQ4LjExMTYgMzEuMDMyNiA0Ni4zMzE1IDMxLjY2ODMgNDQuMDQyOSAzMS42NjgzQzQyLjc3MTUgMzEuNjY4MyA0MS41NjM2IDMxLjQxNCA0MC41NDY1IDMwLjk2OUMzOS40NjU3IDMwLjUyNCAzOC41NzU3IDI5Ljg4ODMgMzcuODEyOSAyOC45OTgzQzM3LjA1IDI4LjE3MTggMzYuNDc3OCAyNy4xNTQ3IDM2LjAzMjggMjUuOTQ2OEMzNS41ODc4IDI0LjczODkgMzUuMzk3MSAyMy40Njc1IDM1LjM5NzEgMjIuMDA1M0MzNS4zOTcxIDIwLjU0MzIgMzUuNTg3OCAxOS4yNzE3IDM2LjAzMjggMTguMDYzOEMzNi40MTQzIDE2Ljg1NiAzNy4wNSAxNS45MDI0IDM3LjgxMjkgMTUuMDEyNEMzOC41NzU3IDE0LjE4NTkgMzkuNDY1NyAxMy41NTAyIDQwLjU0NjUgMTMuMDQxNkM0MS42MjcyIDEyLjU5NjYgNDIuNzcxNSAxMi4zNDIzIDQ0LjEwNjUgMTIuMzQyM0M0Ni43NzY2IDEyLjM0MjMgNDguODEwOSAxMi45NzggNTAuMjA5NSAxNC4yNDk1TDUzLjUxNTIgMTAuOTQzOEM1MS4wMzU5IDkuMDM2NTkgNDcuODU3MyA4LjAxOTQxIDQ0LjEwNjUgOC4wMTk0MUM0Mi4wMDg2IDguMDE5NDEgNDAuMTAxNSA4LjMzNzI5IDM4LjM4NSA5LjAzNjU5QzM2LjY2ODYgOS43MzU4OCAzNS4yMDY0IDEwLjYyNTkgMzMuOTk4NSAxMS44MzM3QzMyLjc5MDYgMTMuMDQxNiAzMS44MzcxIDE0LjUwMzggMzEuMjAxNCAxNi4yMjAzQzMwLjU2NTYgMTcuOTM2NyAzMC4yNDc4IDE5Ljg0MzggMzAuMjQ3OCAyMS44NzgyQzMwLjI0NzggMjMuOTEyNSAzMC41NjU2IDI1LjgxOTcgMzEuMjY0OSAyNy41MzYxQzMxLjk2NDIgMjkuMjUyNiAzMi44NTQyIDMwLjcxNDcgMzQuMDYyMSAzMS45MjI2QzM1LjI3IDMzLjEzMDUgMzYuNzMyMSAzNC4wODQxIDM4LjQ0ODYgMzQuNzE5OEM0MC4xNjUgMzUuNDE5MSA0Mi4wNzIyIDM1LjczNyA0NC4xMDY1IDM1LjczN0M0Ni4xNDA4IDM1LjczNyA0Ny45ODQ0IDM1LjQxOTEgNDkuNjM3MyAzNC43MTk4QzUxLjI5MDIgMzQuMDIwNSA1Mi42ODg4IDMzLjEzMDUgNTMuODMzMSAzMS45MjI2QzU0Ljk3NzQgMzAuNzE0NyA1NS44Njc0IDI5LjI1MjYgNTYuNTAzMSAyNy41MzYxQzU3LjEzODggMjUuODE5NyA1Ny40NTY3IDIzLjkxMjUgNTcuNDU2NyAyMS44NzgyVjIxLjA1MTdDNTcuMjY2IDIwLjkyNDYgNTcuMjAyNCAyMC42MDY3IDU3LjIwMjQgMjAuMzUyNVoiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTk1Ljk4MTUgMjAuMzUyNUg4My43MTIxVjI0LjYxMThIOTAuNzA1QzkwLjUxNDMgMjYuNzczMyA4OS42ODc5IDI4LjQyNjEgODguMjg5MyAyOS43NjExQzg2Ljg5MDcgMzEuMDMyNiA4NS4xMTA2IDMxLjY2ODMgODIuODIyIDMxLjY2ODNDODEuNTUwNiAzMS42NjgzIDgwLjM0MjcgMzEuNDE0IDc5LjMyNTYgMzAuOTY5Qzc4LjI0NDggMzAuNTI0IDc3LjM1NDggMjkuODg4MyA3Ni41OTIgMjguOTk4M0M3NS44MjkxIDI4LjE3MTggNzUuMjU3IDI3LjE1NDcgNzQuODExOSAyNS45NDY4Qzc0LjM2NjkgMjQuNzM4OSA3NC4xNzYyIDIzLjQ2NzUgNzQuMTc2MiAyMi4wMDUzQzc0LjE3NjIgMjAuNTQzMiA3NC4zNjY5IDE5LjI3MTcgNzQuODExOSAxOC4wNjM4Qzc1LjE5MzQgMTYuODU2IDc1LjgyOTEgMTUuOTAyNCA3Ni41OTIgMTUuMDEyNEM3Ny4zNTQ4IDE0LjE4NTkgNzguMjQ0OCAxMy41NTAyIDc5LjMyNTYgMTMuMDQxNkM4MC40MDYzIDEyLjU5NjYgODEuNTUwNiAxMi4zNDIzIDgyLjg4NTYgMTIuMzQyM0M4NS41NTU3IDEyLjM0MjMgODcuNTkgMTIuOTc4IDg4Ljk4ODYgMTQuMjQ5NUw5Mi4yOTQzIDEwLjk0MzhDODkuODE1IDkuMDM2NTkgODYuNjM2NCA4LjAxOTQxIDgyLjg4NTYgOC4wMTk0MUM4MC43ODc4IDguMDE5NDEgNzguODgwNiA4LjMzNzI5IDc3LjE2NDEgOS4wMzY1OUM3NS40NDc3IDkuNzM1ODggNzMuOTg1NSAxMC42MjU5IDcyLjc3NzYgMTEuODMzN0M3MS41Njk4IDEzLjA0MTYgNzAuNjE2MiAxNC41MDM4IDY5Ljk4MDUgMTYuMjIwM0M2OS4zNDQ3IDE3LjkzNjcgNjkuMDI2OSAxOS44NDM4IDY5LjAyNjkgMjEuODc4MkM2OS4wMjY5IDIzLjkxMjUgNjkuMzQ0NyAyNS44MTk3IDcwLjA0NCAyNy41MzYxQzcwLjc0MzMgMjkuMjUyNiA3MS42MzM0IDMwLjcxNDcgNzIuODQxMiAzMS45MjI2Qzc0LjA0OTEgMzMuMTMwNSA3NS41MTEyIDM0LjA4NDEgNzcuMjI3NyAzNC43MTk4Qzc4Ljk0NDEgMzUuNDE5MSA4MC44NTEzIDM1LjczNyA4Mi44ODU2IDM1LjczN0M4NC45MiAzNS43MzcgODYuNzYzNiAzNS40MTkxIDg4LjQxNjQgMzQuNzE5OEM5MC4wNjkzIDM0LjAyMDUgOTEuNDY3OSAzMy4xMzA1IDkyLjYxMjIgMzEuOTIyNkM5My43NTY1IDMwLjcxNDcgOTQuNjQ2NSAyOS4yNTI2IDk1LjI4MjIgMjcuNTM2MUM5NS45MTggMjUuODE5NyA5Ni4yMzU4IDIzLjkxMjUgOTYuMjM1OCAyMS44NzgyVjIxLjA1MTdDOTYuMDQ1MSAyMC45MjQ2IDk1Ljk4MTUgMjAuNjA2NyA5NS45ODE1IDIwLjM1MjVaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);\n background-repeat: no-repeat;\n background-size: 170px 40px;\n display: block;\n height: 40px;\n width: 170px;\n}\n\n.ag-watermark-text {\n opacity: 0.5;\n font-weight: bold;\n font-family: Impact, sans-serif;\n font-size: 19px;\n padding-left: 0.7rem;\n}\n\n.ag-root-wrapper-body {\n display: flex;\n flex-direction: row;\n}\n.ag-root-wrapper-body.ag-layout-normal {\n flex: 1 1 auto;\n height: 0;\n min-height: 0;\n}\n\n.ag-root {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.ag-root.ag-layout-normal, .ag-root.ag-layout-auto-height {\n overflow: hidden;\n flex: 1 1 auto;\n width: 0;\n}\n.ag-root.ag-layout-normal {\n height: 100%;\n}\n\n.ag-header-viewport,\n.ag-floating-top-viewport,\n.ag-body-viewport,\n.ag-center-cols-viewport,\n.ag-floating-bottom-viewport,\n.ag-body-horizontal-scroll-viewport,\n.ag-body-vertical-scroll-viewport,\n.ag-virtual-list-viewport,\n.ag-sticky-top-viewport,\n.ag-sticky-bottom-viewport {\n position: relative;\n height: 100%;\n min-width: 0px;\n overflow: hidden;\n flex: 1 1 auto;\n}\n\n.ag-body-viewport,\n.ag-center-cols-viewport,\n.ag-header-viewport,\n.ag-floating-top-viewport,\n.ag-floating-bottom-viewport,\n.ag-sticky-top-viewport,\n.ag-sticky-bottom-viewport {\n overflow-x: auto;\n -ms-overflow-style: none !important;\n scrollbar-width: none !important;\n}\n.ag-body-viewport::-webkit-scrollbar,\n.ag-center-cols-viewport::-webkit-scrollbar,\n.ag-header-viewport::-webkit-scrollbar,\n.ag-floating-top-viewport::-webkit-scrollbar,\n.ag-floating-bottom-viewport::-webkit-scrollbar,\n.ag-sticky-top-viewport::-webkit-scrollbar,\n.ag-sticky-bottom-viewport::-webkit-scrollbar {\n display: none !important;\n}\n\n.ag-body-viewport {\n display: flex;\n overflow-x: hidden;\n}\n.ag-body-viewport.ag-layout-normal {\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.ag-viewport {\n position: relative;\n}\n\n.ag-spanning-container {\n position: absolute;\n top: 0;\n z-index: 1;\n}\n\n.ag-sticky-top-container,\n.ag-sticky-bottom-container,\n.ag-floating-top-container,\n.ag-floating-bottom-container {\n min-height: 1px;\n}\n\n.ag-sticky-top,\n.ag-sticky-bottom {\n z-index: 1;\n}\n\n.ag-center-cols-viewport {\n min-height: 100%;\n width: 100%;\n}\n\n.ag-body-horizontal-scroll-viewport {\n overflow-x: scroll;\n}\n\n.ag-body-vertical-scroll-viewport {\n overflow-y: scroll;\n}\n\n.ag-virtual-list-viewport {\n overflow: auto;\n width: 100%;\n}\n\n.ag-header-container,\n.ag-floating-top-container,\n.ag-body-container,\n.ag-pinned-right-cols-container,\n.ag-center-cols-container,\n.ag-pinned-left-cols-container,\n.ag-floating-bottom-container,\n.ag-body-horizontal-scroll-container,\n.ag-body-vertical-scroll-container,\n.ag-full-width-container,\n.ag-floating-bottom-full-width-container,\n.ag-virtual-list-container,\n.ag-sticky-top-container,\n.ag-sticky-bottom-container,\n.ag-pinned-left-sticky-bottom,\n.ag-pinned-right-sticky-bottom {\n position: relative;\n}\n\n.ag-header-container,\n.ag-floating-top-container,\n.ag-pinned-left-floating-top,\n.ag-pinned-right-floating-top,\n.ag-floating-bottom-container,\n.ag-pinned-left-floating-bottom,\n.ag-pinned-right-floating-bottom,\n.ag-sticky-top-container,\n.ag-sticky-bottom-container {\n height: 100%;\n white-space: nowrap;\n}\n\n.ag-center-cols-container {\n display: block;\n}\n\n.ag-pinned-right-cols-container {\n display: block;\n}\n\n.ag-body-horizontal-scroll-container {\n height: 100%;\n}\n\n.ag-body-vertical-scroll-container {\n width: 100%;\n}\n\n.ag-full-width-container,\n.ag-floating-top-full-width-container,\n.ag-floating-bottom-full-width-container,\n.ag-sticky-top-full-width-container,\n.ag-sticky-bottom-full-width-container {\n position: absolute;\n top: 0px;\n pointer-events: none;\n}\n.ag-ltr .ag-full-width-container,\n.ag-ltr .ag-floating-top-full-width-container,\n.ag-ltr .ag-floating-bottom-full-width-container,\n.ag-ltr .ag-sticky-top-full-width-container,\n.ag-ltr .ag-sticky-bottom-full-width-container {\n left: 0;\n}\n.ag-rtl .ag-full-width-container,\n.ag-rtl .ag-floating-top-full-width-container,\n.ag-rtl .ag-floating-bottom-full-width-container,\n.ag-rtl .ag-sticky-top-full-width-container,\n.ag-rtl .ag-sticky-bottom-full-width-container {\n right: 0;\n}\n\n.ag-full-width-container {\n width: 100%;\n}\n\n.ag-floating-bottom-full-width-container,\n.ag-floating-top-full-width-container {\n display: inline-block;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n\n.ag-virtual-list-container {\n overflow: hidden;\n}\n\n.ag-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n flex-direction: row !important;\n min-height: 0;\n}\n\n.ag-body-horizontal-scroll,\n.ag-body-vertical-scroll {\n min-height: 0;\n min-width: 0;\n display: flex;\n position: relative;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible,\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\n position: absolute;\n bottom: 0;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar {\n opacity: 0;\n transition: opacity 400ms;\n visibility: hidden;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling, .ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active {\n visibility: visible;\n opacity: 1;\n}\n\n.ag-body-horizontal-scroll {\n width: 100%;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible {\n left: 0;\n right: 0;\n}\n\n.ag-body-vertical-scroll {\n height: 100%;\n}\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\n top: 0;\n z-index: 10;\n}\n.ag-ltr .ag-body-vertical-scroll.ag-scrollbar-invisible {\n right: 0;\n}\n.ag-rtl .ag-body-vertical-scroll.ag-scrollbar-invisible {\n left: 0;\n}\n\n.ag-force-vertical-scroll {\n overflow-y: scroll !important;\n}\n\n.ag-horizontal-left-spacer,\n.ag-horizontal-right-spacer {\n height: 100%;\n min-width: 0;\n overflow-x: scroll;\n}\n.ag-horizontal-left-spacer.ag-scroller-corner,\n.ag-horizontal-right-spacer.ag-scroller-corner {\n overflow-x: hidden;\n}\n\n.ag-header,\n.ag-pinned-left-header,\n.ag-pinned-right-header {\n display: inline-block;\n overflow: hidden;\n position: relative;\n}\n\n.ag-header-cell-sortable .ag-header-cell-label,\n.ag-header-group-cell-selectable .ag-header-cell-comp-wrapper {\n cursor: pointer;\n}\n\n.ag-header {\n display: flex;\n width: 100%;\n white-space: nowrap;\n}\n\n.ag-pinned-left-header {\n height: 100%;\n}\n\n.ag-pinned-right-header {\n height: 100%;\n}\n\n.ag-header-row {\n position: absolute;\n}\n\n.ag-header-row:not(.ag-header-row-column-group) {\n overflow: hidden;\n}\n\n.ag-header.ag-header-allow-overflow .ag-header-row {\n overflow: visible;\n}\n\n.ag-header-cell {\n display: inline-flex;\n align-items: center;\n position: absolute;\n height: 100%;\n overflow: hidden;\n}\n\n.ag-header-cell.ag-header-active .ag-header-cell-menu-button,\n.ag-header-cell-filter-button {\n opacity: 1;\n}\n\n.ag-header-cell-menu-button:not(.ag-header-menu-always-show) {\n transition: opacity 0.2s;\n opacity: 0;\n}\n\n.ag-header-group-cell-label,\n.ag-header-cell-label {\n display: flex;\n flex: 1 1 auto;\n align-self: stretch;\n align-items: center;\n overflow: hidden;\n}\n\n.ag-header-cell-label {\n text-overflow: ellipsis;\n}\n\n.ag-header-group-cell-label.ag-sticky-label {\n position: sticky;\n flex: none;\n max-width: 100%;\n overflow: visible;\n}\n\n.ag-header-group-text {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-header-cell-text {\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n\n.ag-header-group-cell .ag-header-cell-comp-wrapper {\n display: flex;\n}\n\n.ag-header-cell:not(.ag-header-cell-auto-height) .ag-header-cell-comp-wrapper {\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.ag-header-cell-comp-wrapper {\n width: 100%;\n}\n\n.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper {\n white-space: normal;\n}\n\n.ag-header-cell-comp-wrapper-limited-height > div {\n overflow: hidden;\n}\n\n.ag-right-aligned-header .ag-header-cell-label {\n flex-direction: row-reverse;\n}\n\n.ag-header-cell-resize {\n position: absolute;\n z-index: 2;\n height: 100%;\n width: 8px;\n top: 0;\n cursor: ew-resize;\n}\n.ag-ltr .ag-header-cell-resize {\n right: -3px;\n}\n.ag-rtl .ag-header-cell-resize {\n left: -3px;\n}\n\n.ag-pinned-left-header .ag-header-cell-resize {\n right: -3px;\n}\n\n.ag-pinned-right-header .ag-header-cell-resize {\n left: -3px;\n}\n\n.ag-header-select-all {\n display: flex;\n}\n\n.ag-header-cell-menu-button,\n.ag-header-cell-filter-button,\n.ag-side-button-button,\n.ag-panel-title-bar-button,\n.ag-floating-filter-button-button {\n cursor: pointer;\n}\n\n.ag-column-moving .ag-cell {\n transition: left 0.2s;\n}\n.ag-column-moving .ag-header-cell {\n transition: left 0.2s;\n}\n.ag-column-moving .ag-spanned-cell-wrapper {\n transition: left 0.2s;\n}\n.ag-column-moving .ag-header-group-cell {\n transition: left 0.2s, width 0.2s;\n}\n\n.ag-delay-render .ag-cell {\n visibility: hidden;\n}\n.ag-delay-render .ag-row {\n visibility: hidden;\n}\n.ag-delay-render .ag-spanned-cell-wrapper {\n visibility: hidden;\n}\n.ag-delay-render .ag-header-cell {\n visibility: hidden;\n}\n.ag-delay-render .ag-header-group-cell {\n visibility: hidden;\n}\n\n.ag-column-panel {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 1 1 auto;\n}\n\n.ag-column-select {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 3 1 0px;\n}\n\n.ag-column-select-header {\n position: relative;\n display: flex;\n flex: none;\n}\n\n.ag-column-select-header-icon {\n position: relative;\n}\n\n.ag-column-select-header-filter-wrapper {\n flex: 1 1 auto;\n}\n\n.ag-column-select-header-filter {\n width: 100%;\n}\n\n.ag-column-select-list {\n flex: 1 1 0px;\n overflow: hidden;\n}\n\n.ag-column-drop {\n position: relative;\n display: inline-flex;\n align-items: center;\n overflow: auto;\n width: 100%;\n}\n\n.ag-column-drop-list {\n display: flex;\n align-items: center;\n}\n\n.ag-column-drop-cell {\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.ag-column-drop-cell-text {\n overflow: hidden;\n flex: 1 1 auto;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ag-column-drop-vertical {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n align-items: stretch;\n flex: 1 1 0px;\n}\n\n.ag-column-drop-vertical-title-bar {\n display: flex;\n align-items: center;\n flex: none;\n}\n\n.ag-column-drop-vertical-list {\n position: relative;\n align-items: stretch;\n flex-grow: 1;\n flex-direction: column;\n overflow-x: auto;\n}\n.ag-column-drop-vertical-list > * {\n flex: none;\n}\n\n.ag-column-drop-empty .ag-column-drop-vertical-list {\n overflow: hidden;\n}\n\n.ag-column-drop-vertical-empty-message {\n display: block;\n}\n\n.ag-column-drop.ag-column-drop-horizontal {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.ag-column-drop-cell-button {\n cursor: pointer;\n}\n\n.ag-filter-toolpanel {\n flex: 1 1 0px;\n min-width: 0;\n}\n\n.ag-filter-toolpanel-header {\n position: relative;\n}\n\n.ag-filter-toolpanel-header,\n.ag-filter-toolpanel-search {\n display: flex;\n align-items: center;\n}\n.ag-filter-toolpanel-header > *,\n.ag-filter-toolpanel-search > * {\n display: flex;\n align-items: center;\n}\n\n.ag-filter-apply-panel {\n display: flex;\n justify-content: flex-end;\n overflow: hidden;\n}\n\n.ag-row-animation .ag-row {\n transition: transform 0.4s, top 0.4s, opacity 0.2s;\n}\n\n.ag-row-animation .ag-row.ag-after-created {\n transition: transform 0.4s, top 0.4s, height 0.4s, opacity 0.2s;\n}\n\n.ag-row-animation.ag-prevent-animation .ag-row,\n.ag-row-animation.ag-prevent-animation .ag-row.ag-after-created {\n transition: none !important;\n}\n\n.ag-row-no-animation .ag-row {\n transition: none;\n}\n\n.ag-row {\n white-space: nowrap;\n width: 100%;\n}\n\n.ag-row-loading {\n display: flex;\n align-items: center;\n}\n\n.ag-row-position-absolute {\n position: absolute;\n}\n\n.ag-row-position-relative {\n position: relative;\n}\n\n.ag-full-width-row {\n overflow: hidden;\n pointer-events: all;\n}\n\n.ag-row-inline-editing {\n z-index: 1;\n}\n\n.ag-row-dragging {\n z-index: 2;\n}\n\n.ag-stub-cell {\n display: flex;\n align-items: center;\n}\n\n.ag-cell {\n display: inline-block;\n position: absolute;\n white-space: nowrap;\n height: 100%;\n}\n\n.ag-cell-value {\n flex: 1 1 auto;\n}\n\n.ag-cell-value:not(.ag-allow-overflow),\n.ag-group-value {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-cell-wrapper {\n display: flex;\n align-items: center;\n}\n.ag-cell-wrapper.ag-row-group {\n align-items: flex-start;\n}\n\n.ag-cell-wrap-text {\n white-space: normal;\n word-break: break-word;\n}\n\n.ag-cell-wrap-text:not(.ag-cell-auto-height) .ag-cell-wrapper {\n align-items: normal;\n height: 100%;\n}\n.ag-cell-wrap-text:not(.ag-cell-auto-height) .ag-cell-wrapper .ag-cell-value {\n height: 100%;\n}\n\n.ag-sparkline-wrapper {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n line-height: initial;\n}\n\n.ag-full-width-row .ag-cell-wrapper.ag-row-group {\n height: 100%;\n align-items: center;\n}\n\n.ag-cell-inline-editing {\n z-index: 1;\n}\n.ag-cell-inline-editing .ag-cell-wrapper,\n.ag-cell-inline-editing .ag-cell-edit-wrapper,\n.ag-cell-inline-editing .ag-cell-editor,\n.ag-cell-inline-editing .ag-cell-editor .ag-wrapper,\n.ag-cell-inline-editing .ag-cell-editor.ag-cell-editor.ag-cell-editor input {\n height: 100%;\n min-height: 100%;\n width: 100%;\n line-height: normal;\n}\n\n.ag-row.ag-row-editing-invalid .ag-cell-inline-editing {\n opacity: 0.8;\n}\n\n.ag-cell .ag-icon {\n display: inline-block;\n vertical-align: middle;\n}\n\n.ag-set-filter-item {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.ag-set-filter-item-checkbox {\n display: flex;\n width: 100%;\n height: 100%;\n}\n\n.ag-set-filter-group-icons {\n display: block;\n}\n.ag-set-filter-group-icons > * {\n cursor: pointer;\n}\n\n.ag-filter-body-wrapper {\n display: flex;\n flex-direction: column;\n}\n\n.ag-filter-filter {\n flex: 1 1 0px;\n}\n\n.ag-filter-condition {\n display: flex;\n justify-content: center;\n}\n\n.ag-floating-filter-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n height: 100%;\n}\n\n.ag-floating-filter-full-body {\n display: flex;\n flex: 1 1 auto;\n height: 100%;\n width: 100%;\n align-items: center;\n overflow: hidden;\n}\n\n.ag-floating-filter-full-body > div {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-input {\n align-items: center;\n display: flex;\n width: 100%;\n}\n.ag-floating-filter-input > * {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-button {\n display: flex;\n flex: none;\n}\n\n.ag-date-floating-filter-wrapper {\n display: flex;\n}\n\n.ag-set-floating-filter-input input[disabled] {\n pointer-events: none;\n}\n\n.ag-dnd-ghost {\n display: inline-flex;\n align-items: center;\n cursor: move;\n white-space: nowrap;\n}\n\n.ag-overlay {\n height: 100%;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 2;\n}\n\n.ag-overlay-panel {\n display: flex;\n height: 100%;\n width: 100%;\n}\n\n.ag-overlay-wrapper {\n display: flex;\n flex: none;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.ag-overlay-loading-wrapper,\n.ag-overlay-exporting-wrapper,\n.ag-overlay-modal-wrapper {\n pointer-events: all;\n}\n\n.ag-popup-child {\n z-index: 5;\n top: 0;\n}\n\n.ag-popup-editor {\n position: absolute;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-large-text-input {\n display: block;\n}\n\n.ag-virtual-list-item {\n position: absolute;\n width: 100%;\n}\n\n.ag-floating-top,\n.ag-floating-bottom {\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\n position: relative;\n display: flex;\n}\n\n.ag-pinned-left-floating-top,\n.ag-pinned-right-floating-top,\n.ag-pinned-left-floating-bottom,\n.ag-pinned-right-floating-bottom {\n overflow: hidden;\n position: relative;\n min-width: 0px;\n}\n\n.ag-sticky-top,\n.ag-sticky-bottom {\n position: absolute;\n display: flex;\n width: 100%;\n overflow: hidden;\n height: 0px;\n}\n\n.ag-sticky-bottom {\n box-sizing: content-box !important;\n}\n.ag-sticky-bottom .ag-pinned-left-sticky-bottom,\n.ag-sticky-bottom .ag-sticky-bottom-container,\n.ag-sticky-bottom .ag-pinned-right-sticky-bottom {\n box-sizing: border-box;\n}\n\n.ag-pinned-left-sticky-top,\n.ag-pinned-right-sticky-top {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n\n.ag-sticky-top-full-width-container,\n.ag-sticky-bottom-full-width-container {\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n\n.ag-dialog,\n.ag-panel {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: hidden;\n}\n\n.ag-panel-title-bar {\n display: flex;\n flex: none;\n align-items: center;\n cursor: default;\n}\n\n.ag-panel-title-bar-title {\n flex: 1 1 auto;\n}\n\n.ag-panel-title-bar-buttons {\n display: flex;\n}\n\n.ag-panel-title-bar-button {\n cursor: pointer;\n}\n\n.ag-panel-content-wrapper {\n display: flex;\n flex: 1 1 auto;\n position: relative;\n overflow: hidden;\n}\n\n.ag-dialog {\n position: absolute;\n}\n\n.ag-resizer {\n position: absolute;\n pointer-events: none;\n z-index: 1;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-resizer.ag-resizer-topLeft {\n top: 0;\n left: 0;\n height: 5px;\n width: 5px;\n cursor: nwse-resize;\n}\n.ag-resizer.ag-resizer-top {\n top: 0;\n left: 5px;\n right: 5px;\n height: 5px;\n cursor: ns-resize;\n}\n.ag-resizer.ag-resizer-topRight {\n top: 0;\n right: 0;\n height: 5px;\n width: 5px;\n cursor: nesw-resize;\n}\n.ag-resizer.ag-resizer-right {\n top: 5px;\n right: 0;\n bottom: 5px;\n width: 5px;\n cursor: ew-resize;\n}\n.ag-resizer.ag-resizer-bottomRight {\n bottom: 0;\n right: 0;\n height: 5px;\n width: 5px;\n cursor: nwse-resize;\n}\n.ag-resizer.ag-resizer-bottom {\n bottom: 0;\n left: 5px;\n right: 5px;\n height: 5px;\n cursor: ns-resize;\n}\n.ag-resizer.ag-resizer-bottomLeft {\n bottom: 0;\n left: 0;\n height: 5px;\n width: 5px;\n cursor: nesw-resize;\n}\n.ag-resizer.ag-resizer-left {\n left: 0;\n top: 5px;\n bottom: 5px;\n width: 5px;\n cursor: ew-resize;\n}\n\n.ag-tooltip {\n position: absolute;\n z-index: 99999;\n}\n\n.ag-tooltip-custom {\n position: absolute;\n z-index: 99999;\n}\n\n.ag-tooltip:not(.ag-tooltip-interactive),\n.ag-tooltip-custom:not(.ag-tooltip-interactive) {\n pointer-events: none;\n}\n\n.ag-value-slide-out {\n margin-right: 5px;\n opacity: 1;\n transition: opacity 3s, margin-right 3s;\n transition-timing-function: linear;\n}\n\n.ag-value-slide-out-end {\n margin-right: 10px;\n opacity: 0;\n}\n\n.ag-opacity-zero {\n opacity: 0 !important;\n}\n\n.ag-menu {\n max-height: 100%;\n overflow-y: auto;\n position: absolute;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-menu-column-select-wrapper {\n height: 265px;\n overflow: auto;\n}\n.ag-menu-column-select-wrapper .ag-column-select {\n height: 100%;\n}\n\n.ag-dialog .ag-panel-content-wrapper .ag-column-select {\n user-select: none;\n}\n\n.ag-menu-list {\n display: table;\n width: 100%;\n}\n\n.ag-menu-option,\n.ag-menu-separator {\n display: table-row;\n}\n\n.ag-menu-option-part,\n.ag-menu-separator-part {\n display: table-cell;\n vertical-align: middle;\n}\n\n.ag-menu-option-text {\n white-space: nowrap;\n}\n\n.ag-menu-option-custom {\n display: contents;\n}\n\n.ag-compact-menu-option {\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n}\n\n.ag-compact-menu-option-text {\n white-space: nowrap;\n flex: 1 1 auto;\n}\n\n.ag-context-menu-loading-icon {\n position: absolute;\n pointer-events: none;\n}\n\n.ag-pill-container {\n display: flex;\n gap: 0.25rem;\n flex-wrap: nowrap;\n}\n\n.ag-pill {\n display: flex;\n white-space: nowrap;\n padding: 0 0.25rem;\n align-items: center;\n}\n\n.ag-pill .ag-pill-button {\n border: none;\n padding: 0;\n}\n\n.ag-rich-select {\n cursor: default;\n outline: none;\n height: 100%;\n}\n\n.ag-rich-select-value {\n display: flex;\n align-items: center;\n height: 100%;\n}\n.ag-rich-select-value .ag-picker-field-display {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ag-rich-select-value .ag-picker-field-display.ag-display-as-placeholder {\n opacity: 0.5;\n}\n\n.ag-rich-select-list {\n position: relative;\n}\n.ag-rich-select-list .ag-rich-select-loading {\n display: flex;\n min-height: 2rem;\n}\n.ag-rich-select-list .ag-rich-select-loading .ag-loading-text {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-rich-select-row {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n height: 100%;\n}\n\n.ag-rich-select-field-input {\n flex: 1 1 auto;\n}\n.ag-rich-select-field-input .ag-input-field-input {\n padding: 0 !important;\n border: none !important;\n box-shadow: none !important;\n text-overflow: ellipsis;\n}\n.ag-rich-select-field-input .ag-input-field-input::placeholder {\n opacity: 0.8;\n}\n\n.ag-rich-select-typing-multi .ag-picker-field-display {\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n}\n.ag-rich-select-typing-multi .ag-rich-select-pill-display {\n display: flex;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n align-items: center;\n overflow: hidden;\n}\n.ag-rich-select-typing-multi .ag-rich-select-pill-display .ag-pill-container {\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n}\n.ag-rich-select-typing-multi .ag-rich-select-field-input {\n flex: 0 0 auto;\n min-width: 0;\n max-width: 100%;\n}\n.ag-rich-select-typing-multi .ag-rich-select-field-input .ag-input-wrapper {\n flex: 0 0 auto;\n max-width: 100%;\n}\n.ag-rich-select-typing-multi .ag-rich-select-field-input .ag-input-field-input {\n width: auto;\n min-width: 1ch;\n max-width: 100%;\n}\n\n.ag-autocomplete {\n align-items: center;\n display: flex;\n}\n.ag-autocomplete > * {\n flex: 1 1 auto;\n}\n\n.ag-autocomplete-list-popup {\n position: absolute;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-autocomplete-list {\n position: relative;\n}\n\n.ag-autocomplete-virtual-list-item {\n display: flex;\n}\n\n.ag-autocomplete-row {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n overflow: hidden;\n}\n\n.ag-autocomplete-row-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-paging-panel {\n align-items: center;\n display: flex;\n justify-content: flex-end;\n}\n\n.ag-paging-page-summary-panel {\n display: flex;\n align-items: center;\n}\n\n.ag-paging-button {\n position: relative;\n}\n\n.ag-disabled .ag-paging-page-summary-panel {\n pointer-events: none;\n}\n\n.ag-tool-panel-wrapper {\n overflow: hidden;\n cursor: default;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-column-select-column,\n.ag-column-select-column-group,\n.ag-select-agg-func-item {\n position: relative;\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n height: 100%;\n}\n.ag-column-select-column > *,\n.ag-column-select-column-group > *,\n.ag-select-agg-func-item > * {\n flex: none;\n}\n\n.ag-select-agg-func-item,\n.ag-column-select-column-label {\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ag-column-select-checkbox {\n display: flex;\n}\n\n.ag-tool-panel-horizontal-resize {\n cursor: ew-resize;\n height: 100%;\n position: absolute;\n top: 0;\n width: 5px;\n z-index: 1;\n}\n\n.ag-ltr .ag-side-bar-left .ag-tool-panel-horizontal-resize {\n right: -3px;\n}\n.ag-rtl .ag-side-bar-left .ag-tool-panel-horizontal-resize {\n left: -3px;\n}\n\n.ag-ltr .ag-side-bar-right .ag-tool-panel-horizontal-resize {\n left: -3px;\n}\n.ag-rtl .ag-side-bar-right .ag-tool-panel-horizontal-resize {\n right: -3px;\n}\n\n.ag-details-row {\n width: 100%;\n}\n\n.ag-details-row-fixed-height {\n height: 100%;\n}\n\n.ag-details-grid {\n width: 100%;\n}\n\n.ag-details-grid-fixed-height {\n height: 100%;\n}\n\n.ag-header-group-cell {\n display: flex;\n align-items: center;\n height: 100%;\n position: absolute;\n contain: paint;\n}\n\n.ag-header-group-cell-no-group.ag-header-span-height {\n display: none;\n}\n\n.ag-cell-label-container {\n display: flex;\n justify-content: space-between;\n flex-direction: row-reverse;\n align-items: center;\n height: 100%;\n width: 100%;\n}\n\n.ag-header-group-cell-label,\n.ag-cell-label-container {\n padding: 5px 0px;\n}\n\n.ag-right-aligned-header .ag-cell-label-container {\n flex-direction: row;\n}\n.ag-right-aligned-header .ag-header-cell-text {\n text-align: end;\n}\n\n.ag-side-bar {\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ag-side-bar-left {\n order: -1;\n flex-direction: row;\n}\n\n.ag-side-button-button {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n outline: none;\n cursor: pointer;\n}\n\n.ag-side-button-label {\n writing-mode: vertical-lr;\n}\n\n.ag-status-bar {\n display: flex;\n justify-content: space-between;\n overflow: hidden;\n}\n\n.ag-status-panel,\n.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value {\n display: inline-flex;\n}\n\n.ag-status-name-value {\n white-space: nowrap;\n}\n\n.ag-status-bar-left {\n display: inline-flex;\n}\n\n.ag-status-bar-center {\n display: inline-flex;\n}\n\n.ag-status-bar-right {\n display: inline-flex;\n}\n\n.ag-row-number-cell {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n user-select: none;\n}\n.ag-ltr .ag-row-number-cell {\n text-align: right;\n}\n.ag-rtl .ag-row-number-cell {\n text-align: left;\n}\n\n.ag-row-numbers-resizer {\n position: absolute;\n bottom: -2px;\n left: 0;\n height: 4px;\n width: 100%;\n cursor: ns-resize;\n}\n\n.ag-floating-bottom .ag-row-numbers-resizer {\n bottom: unset;\n top: -2px;\n}\n\n.ag-icon {\n display: block;\n speak: none;\n}\n\n.ag-group {\n position: relative;\n width: 100%;\n}\n\n.ag-group-title-bar {\n display: flex;\n align-items: center;\n}\n\n.ag-group-title {\n display: inline;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ag-group-title-bar .ag-group-title {\n cursor: default;\n}\n\n.ag-group-toolbar {\n display: flex;\n align-items: center;\n}\n\n.ag-group-container {\n display: flex;\n}\n\n.ag-disabled .ag-group-container {\n pointer-events: none;\n}\n\n.ag-group-container-horizontal {\n flex-direction: row;\n flex-wrap: wrap;\n}\n\n.ag-group-container-vertical {\n flex-direction: column;\n}\n\n.ag-column-group-icons {\n display: block;\n}\n.ag-column-group-icons > * {\n cursor: pointer;\n}\n\n.ag-group-item-alignment-stretch .ag-group-item {\n align-items: stretch;\n}\n\n.ag-group-item-alignment-start .ag-group-item {\n align-items: flex-start;\n}\n\n.ag-group-item-alignment-end .ag-group-item {\n align-items: flex-end;\n}\n\n.ag-toggle-button-icon {\n transition: right 0.3s;\n position: absolute;\n top: -1px;\n}\n\n.ag-input-field,\n.ag-select {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ag-input-field-input {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-input .ag-input-field-input[type=date],\n.ag-floating-filter-input .ag-input-field-input[type=datetime-local] {\n width: 1px;\n}\n\n.ag-range-field {\n display: flex;\n align-items: center;\n}\n\n.ag-angle-select {\n display: flex;\n align-items: center;\n}\n\n.ag-angle-select-wrapper {\n display: flex;\n}\n\n.ag-angle-select-parent-circle {\n display: block;\n position: relative;\n}\n\n.ag-angle-select-child-circle {\n position: absolute;\n}\n\n.ag-slider-wrapper {\n display: flex;\n}\n.ag-slider-wrapper .ag-input-field {\n flex: 1 1 auto;\n}\n\n.ag-picker-field-display {\n flex: 1 1 auto;\n}\n\n.ag-picker-field {\n display: flex;\n align-items: center;\n}\n\n.ag-picker-field-icon {\n display: flex;\n border: 0;\n padding: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.ag-picker-field-wrapper {\n overflow: hidden;\n}\n\n.ag-label-align-right .ag-label {\n order: 1;\n}\n.ag-label-align-right > * {\n flex: none;\n}\n\n.ag-label-align-top {\n flex-direction: column;\n align-items: flex-start;\n}\n.ag-label-align-top > * {\n align-self: stretch;\n}\n\n.ag-label-ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n\n.ag-color-panel {\n width: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n}\n\n.ag-spectrum-color {\n flex: 1 1 auto;\n position: relative;\n overflow: visible;\n cursor: default;\n}\n\n.ag-spectrum-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.ag-spectrum-val {\n cursor: pointer;\n}\n\n.ag-spectrum-dragger {\n position: absolute;\n pointer-events: none;\n cursor: pointer;\n}\n\n.ag-spectrum-hue,\n.ag-spectrum-alpha {\n cursor: default;\n}\n\n.ag-spectrum-hue-background {\n background: linear-gradient(to left, #ff0000 3%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\n width: 100%;\n height: 100%;\n}\n\n.ag-spectrum-alpha {\n --ag-spectrum-alpha-background-checked: url("data:image/svg+xml;utf8,");\n}\n\n.ag-spectrum-alpha-background {\n background: linear-gradient(to right, var(--ag-internal-spectrum-alpha-color-from), var(--ag-internal-spectrum-alpha-color-to)), var(--ag-spectrum-alpha-background-checked) top left/4px 4px;\n width: 100%;\n height: 100%;\n}\n\n.ag-spectrum-tool {\n cursor: pointer;\n position: relative;\n}\n\n.ag-spectrum-slider {\n position: absolute;\n pointer-events: none;\n}\n\n.ag-spectrum-alpha .ag-spectrum-slider {\n background: linear-gradient(to bottom, var(--ag-internal-spectrum-alpha-color), var(--ag-internal-spectrum-alpha-color)) white;\n}\n\n.ag-recent-colors {\n display: flex;\n}\n\n.ag-recent-color {\n cursor: pointer;\n}\n\n.ag-pill-select {\n display: flex;\n flex-direction: column;\n}\n.ag-pill-select .ag-column-drop {\n flex: unset;\n}\n\n.ag-content-editable-field {\n display: flex;\n align-items: center;\n}\n\n.ag-content-editable-field-input {\n cursor: text;\n display: block;\n flex: 1 1 auto;\n outline: none;\n white-space: nowrap;\n line-height: normal;\n overflow: auto;\n overflow-y: hidden;\n -ms-overflow-style: none !important;\n scrollbar-width: none !important;\n}\n.ag-content-editable-field-input::-webkit-scrollbar {\n display: none !important;\n}\n\n.ag-ltr {\n direction: ltr;\n}\n.ag-ltr .ag-body,\n.ag-ltr .ag-floating-top,\n.ag-ltr .ag-floating-bottom,\n.ag-ltr .ag-header,\n.ag-ltr .ag-sticky-top,\n.ag-ltr .ag-sticky-bottom,\n.ag-ltr .ag-body-viewport,\n.ag-ltr .ag-body-horizontal-scroll {\n flex-direction: row;\n}\n\n.ag-rtl {\n direction: rtl;\n}\n.ag-rtl .ag-body,\n.ag-rtl .ag-floating-top,\n.ag-rtl .ag-floating-bottom,\n.ag-rtl .ag-header,\n.ag-rtl .ag-sticky-top,\n.ag-rtl .ag-sticky-bottom,\n.ag-rtl .ag-body-viewport,\n.ag-rtl .ag-body-horizontal-scroll {\n flex-direction: row-reverse;\n}\n.ag-rtl .ag-icon-contracted,\n.ag-rtl .ag-icon-expanded,\n.ag-rtl .ag-icon-tree-closed {\n display: block;\n transform: rotate(180deg);\n}\n\n.ag-body .ag-body-viewport {\n -webkit-overflow-scrolling: touch;\n}\n\n.ag-measurement-container {\n width: 0;\n overflow: hidden;\n visibility: hidden;\n}\n.ag-measurement-container div {\n position: absolute;\n}\n\n.ag-layout-print.ag-body {\n display: block;\n height: unset;\n}\n.ag-layout-print.ag-root-wrapper {\n display: inline-block;\n}\n.ag-layout-print .ag-body-vertical-scroll {\n display: none;\n}\n.ag-layout-print .ag-body-horizontal-scroll {\n display: none;\n}\n.ag-layout-print.ag-force-vertical-scroll {\n overflow-y: visible !important;\n}\n\n@media print {\n .ag-root-wrapper.ag-layout-print {\n display: table;\n container-type: normal;\n }\n .ag-root-wrapper.ag-layout-print .ag-root-wrapper-body,\n .ag-root-wrapper.ag-layout-print .ag-root,\n .ag-root-wrapper.ag-layout-print .ag-body-viewport,\n .ag-root-wrapper.ag-layout-print .ag-center-cols-container,\n .ag-root-wrapper.ag-layout-print .ag-center-cols-viewport,\n .ag-root-wrapper.ag-layout-print .ag-body-horizontal-scroll-viewport,\n .ag-root-wrapper.ag-layout-print .ag-virtual-list-viewport {\n height: auto !important;\n overflow: hidden !important;\n display: block !important;\n }\n .ag-root-wrapper.ag-layout-print .ag-row,\n .ag-root-wrapper.ag-layout-print .ag-cell {\n break-inside: avoid;\n }\n}\n[class^=ag-],\n[class^=ag-]:focus,\n[class^=ag-]:after,\n[class^=ag-]:before {\n box-sizing: border-box;\n outline: none;\n}\n\n[class^=ag-]::-ms-clear {\n display: none;\n}\n\n.ag-checkbox .ag-input-wrapper,\n.ag-radio-button .ag-input-wrapper {\n overflow: visible;\n}\n\n.ag-range-field .ag-input-wrapper {\n height: 100%;\n}\n\n.ag-toggle-button {\n flex: none;\n width: unset;\n min-width: unset;\n}\n\n.ag-button {\n border-radius: 0px;\n color: var(--ag-foreground-color);\n}\n\n.ag-button:hover {\n background-color: transparent;\n}\n\n.ag-ltr .ag-label-align-right .ag-label {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-label-align-right .ag-label {\n margin-right: var(--ag-grid-size);\n}\n\ninput[class^=ag-] {\n margin: 0;\n background-color: var(--ag-background-color);\n}\n\ntextarea[class^=ag-],\nselect[class^=ag-] {\n background-color: var(--ag-background-color);\n}\n\ninput[class^=ag-]:not([type]),\ninput[class^=ag-][type=text],\ninput[class^=ag-][type=number],\ninput[class^=ag-][type=tel],\ninput[class^=ag-][type=date],\ninput[class^=ag-][type=datetime-local],\ntextarea[class^=ag-] {\n font-size: inherit;\n line-height: inherit;\n color: inherit;\n font-family: inherit;\n border: var(--ag-borders-input) var(--ag-input-border-color);\n}\ninput[class^=ag-]:not([type]):disabled,\ninput[class^=ag-][type=text]:disabled,\ninput[class^=ag-][type=number]:disabled,\ninput[class^=ag-][type=tel]:disabled,\ninput[class^=ag-][type=date]:disabled,\ninput[class^=ag-][type=datetime-local]:disabled,\ntextarea[class^=ag-]:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\ninput[class^=ag-]:not([type]):focus,\ninput[class^=ag-][type=text]:focus,\ninput[class^=ag-][type=number]:focus,\ninput[class^=ag-][type=tel]:focus,\ninput[class^=ag-][type=date]:focus,\ninput[class^=ag-][type=datetime-local]:focus,\ntextarea[class^=ag-]:focus {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-input-focus-border-color);\n}\ninput[class^=ag-]:not([type]):focus.invalid, input[class^=ag-]:not([type]):focus:invalid,\ninput[class^=ag-][type=text]:focus.invalid,\ninput[class^=ag-][type=text]:focus:invalid,\ninput[class^=ag-][type=number]:focus.invalid,\ninput[class^=ag-][type=number]:focus:invalid,\ninput[class^=ag-][type=tel]:focus.invalid,\ninput[class^=ag-][type=tel]:focus:invalid,\ninput[class^=ag-][type=date]:focus.invalid,\ninput[class^=ag-][type=date]:focus:invalid,\ninput[class^=ag-][type=datetime-local]:focus.invalid,\ninput[class^=ag-][type=datetime-local]:focus:invalid,\ntextarea[class^=ag-]:focus.invalid,\ntextarea[class^=ag-]:focus:invalid {\n box-shadow: var(--ag-input-error-focus-box-shadow);\n border-color: var(--ag-invalid-color);\n}\ninput[class^=ag-]:not([type]):invalid,\ninput[class^=ag-][type=text]:invalid,\ninput[class^=ag-][type=number]:invalid,\ninput[class^=ag-][type=tel]:invalid,\ninput[class^=ag-][type=date]:invalid,\ninput[class^=ag-][type=datetime-local]:invalid,\ntextarea[class^=ag-]:invalid {\n border: var(--ag-borders-input-invalid) var(--ag-input-border-color-invalid);\n}\n\ninput[class^=ag-][type=number]:not(.ag-number-field-input-stepper) {\n -moz-appearance: textfield;\n}\ninput[class^=ag-][type=number]:not(.ag-number-field-input-stepper)::-webkit-outer-spin-button, input[class^=ag-][type=number]:not(.ag-number-field-input-stepper)::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[class^=ag-][type=range] {\n padding: 0;\n}\n\ninput[class^=ag-][type=button]:focus,\nbutton[class^=ag-]:focus {\n box-shadow: var(--ag-input-focus-box-shadow);\n}\ninput[class^=ag-][type=button]:focus:invalid, input[class^=ag-][type=button]:focus.invalid,\nbutton[class^=ag-]:focus:invalid,\nbutton[class^=ag-]:focus.invalid {\n box-shadow: var(--ag-input-error-focus-box-shadow);\n}\n\n.ag-drag-handle {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-list-item,\n.ag-virtual-list-item {\n height: var(--ag-list-item-height);\n}\n\n.ag-virtual-list-item:focus-visible {\n outline: none;\n}\n.ag-virtual-list-item:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-select-list {\n background-color: var(--ag-background-color);\n overflow-y: auto;\n overflow-x: hidden;\n border-radius: var(--ag-border-radius);\n border: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-list-item {\n display: flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ag-list-item.ag-active-item {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-select-list-item {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}\n.ag-ltr .ag-select-list-item {\n padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-rtl .ag-select-list-item {\n padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-select-list-item span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ag-row-drag,\n.ag-selection-checkbox,\n.ag-group-expanded,\n.ag-group-contracted {\n color: var(--ag-secondary-foreground-color);\n}\n.ag-ltr .ag-row-drag,\n.ag-ltr .ag-selection-checkbox,\n.ag-ltr .ag-group-expanded,\n.ag-ltr .ag-group-contracted {\n margin-right: var(--ag-cell-widget-spacing);\n}\n.ag-rtl .ag-row-drag,\n.ag-rtl .ag-selection-checkbox,\n.ag-rtl .ag-group-expanded,\n.ag-rtl .ag-group-contracted {\n margin-left: var(--ag-cell-widget-spacing);\n}\n\n.ag-drag-handle-disabled {\n opacity: 0.35;\n pointer-events: none;\n}\n\n.ag-cell-wrapper > *:not(.ag-cell-value):not(.ag-group-value) {\n --ag-internal-calculated-line-height: var(\n --ag-line-height,\n calc(var(--ag-row-height) - var(--ag-row-border-width))\n );\n --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width) - 2px);\n height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\n display: flex;\n align-items: center;\n flex: none;\n}\n\n.ag-group-expanded,\n.ag-group-contracted {\n cursor: pointer;\n}\n\n.ag-group-title-bar-icon {\n cursor: pointer;\n flex: none;\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-ltr .ag-group-child-count {\n margin-left: 2px;\n}\n.ag-rtl .ag-group-child-count {\n margin-right: 2px;\n}\n\n.ag-group-title-bar {\n background-color: var(--ag-subheader-background-color);\n padding: var(--ag-grid-size);\n}\n\n.ag-group-toolbar {\n padding: var(--ag-grid-size);\n background-color: var(--ag-subheader-toolbar-background-color);\n}\n\n.ag-disabled-group-title-bar,\n.ag-disabled-group-container {\n opacity: 0.5;\n}\n\n.group-item {\n margin: calc(var(--ag-grid-size) * 0.5) 0;\n}\n\n.ag-label {\n white-space: nowrap;\n}\n.ag-ltr .ag-label {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-label {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-label-align-top .ag-label {\n margin-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n\n.ag-angle-select[disabled] {\n color: var(--ag-disabled-foreground-color);\n pointer-events: none;\n}\n.ag-angle-select[disabled] .ag-angle-select-field {\n opacity: 0.4;\n}\n\n.ag-ltr .ag-slider-field,\n.ag-ltr .ag-angle-select-field {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-slider-field,\n.ag-rtl .ag-angle-select-field {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-angle-select-parent-circle {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border: solid 1px;\n border-color: var(--ag-border-color);\n background-color: var(--ag-background-color);\n}\n\n.ag-angle-select-child-circle {\n top: 4px;\n left: 12px;\n width: 6px;\n height: 6px;\n margin-left: -3px;\n margin-top: -4px;\n border-radius: 3px;\n background-color: var(--ag-secondary-foreground-color);\n}\n\n.ag-picker-field-wrapper {\n border: var(--ag-borders);\n border-color: var(--ag-border-color);\n border-radius: 5px;\n background-color: var(--ag-background-color);\n}\n.ag-picker-field-wrapper:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-picker-field-wrapper.ag-picker-has-focus, .ag-picker-field-wrapper:focus-within {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-input-focus-border-color);\n}\n.ag-picker-field-wrapper.ag-picker-has-focus.invalid, .ag-picker-field-wrapper:focus-within.invalid {\n box-shadow: var(--ag-input-error-focus-box-shadow);\n}\n.ag-picker-field-wrapper.invalid {\n border: var(--ag-borders-input-invalid) var(--ag-input-border-color-invalid);\n}\n\n.ag-picker-field-button {\n background-color: var(--ag-background-color);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-dialog.ag-color-dialog {\n border-radius: 5px;\n}\n\n.ag-color-picker .ag-picker-field-wrapper {\n padding-left: var(--ag-grid-size);\n padding-right: var(--ag-grid-size);\n}\n.ag-color-picker .ag-picker-field-display {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: var(--ag-list-item-height);\n}\n\n.ag-ltr .ag-color-picker-color,\n.ag-ltr .ag-color-picker-value {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-color-picker-color,\n.ag-rtl .ag-color-picker-value {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-color-panel {\n padding: var(--ag-grid-size);\n}\n\n.ag-spectrum-color {\n background-color: rgb(255, 0, 0);\n border-radius: 2px;\n}\n\n.ag-spectrum-tools {\n padding: 10px;\n}\n\n.ag-spectrum-sat {\n background-image: linear-gradient(to right, white, rgba(204, 154, 129, 0));\n}\n\n.ag-spectrum-val {\n background-image: linear-gradient(to top, black, rgba(204, 154, 129, 0));\n}\n\n.ag-spectrum-dragger {\n border-radius: 12px;\n height: 12px;\n width: 12px;\n border: 2px solid white;\n background: black;\n box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.24);\n}\n\n.ag-spectrum-hue-background {\n border-radius: 2px;\n}\n\n.ag-spectrum-alpha-background {\n border-radius: 2px;\n}\n\n.ag-spectrum-tool {\n margin-bottom: 10px;\n height: 11px;\n border-radius: 2px;\n}\n\n.ag-spectrum-slider {\n margin-top: -12px;\n width: 13px;\n height: 13px;\n border-radius: 13px;\n border: 2px solid white;\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n}\n\n.ag-recent-colors {\n margin-top: 10px;\n}\n\n.ag-recent-color {\n margin: 0 3px;\n}\n.ag-recent-color:first-child {\n margin-left: 0;\n}\n.ag-recent-color:last-child {\n margin-right: 0;\n}\n\n.ag-spectrum-color:focus-visible:not(:disabled):not([readonly]),\n.ag-spectrum-slider:focus-visible:not(:disabled):not([readonly]),\n.ag-recent-color:focus-visible:not(:disabled):not([readonly]) {\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n\n.ag-ltr .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\n padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\n padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-color-input .ag-color-input-color {\n position: absolute;\n}\n.ag-ltr .ag-color-input .ag-color-input-color {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-color-input .ag-color-input-color {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-color-picker-color,\n.ag-color-input-color {\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n border-radius: 2px;\n}\n\n.ag-dnd-ghost {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n overflow: hidden;\n text-overflow: ellipsis;\n border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-header-height);\n line-height: var(--ag-header-height);\n margin: 0;\n padding: 0 calc(var(--ag-grid-size) * 2);\n transform: translateY(calc(var(--ag-grid-size) * 2));\n}\n\n.ag-dnd-ghost-not-allowed {\n border-color: color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 50%);\n}\n\n.ag-dnd-ghost-icon {\n margin-right: var(--ag-grid-size);\n color: var(--ag-foreground-color);\n}\n\n.ag-popup-child:not(.ag-tooltip-custom) {\n box-shadow: var(--ag-popup-shadow);\n}\n\n.ag-select .ag-picker-field-wrapper {\n min-height: var(--ag-list-item-height);\n cursor: default;\n}\n.ag-ltr .ag-select .ag-picker-field-wrapper {\n padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-rtl .ag-select .ag-picker-field-wrapper {\n padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-ltr .ag-select .ag-picker-field-wrapper {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-select .ag-picker-field-wrapper {\n padding-left: var(--ag-grid-size);\n}\n.ag-select.ag-disabled .ag-picker-field-wrapper:focus {\n box-shadow: none;\n}\n.ag-select:not(.ag-cell-editor, .ag-label-align-top) {\n min-height: var(--ag-list-item-height);\n}\n.ag-select .ag-picker-field-display {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ag-select .ag-picker-field-icon {\n display: flex;\n align-items: center;\n}\n.ag-select.ag-disabled {\n opacity: 0.5;\n}\n\n.ag-rich-select-value,\n.ag-rich-select-list {\n background-color: var(--ag-background-color);\n}\n\n.ag-rich-select-list {\n width: 100%;\n height: auto;\n border-radius: var(--ag-border-radius);\n border: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rich-select-list .ag-rich-select-loading {\n padding: var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);\n}\n\n.ag-rich-select-value {\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n padding-top: 0;\n padding-bottom: 0;\n}\n.ag-ltr .ag-rich-select-value {\n padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-rtl .ag-rich-select-value {\n padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-ltr .ag-rich-select-value {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-rich-select-value {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-ltr .ag-rich-select-field-input {\n left: calc(var(--ag-cell-horizontal-padding));\n}\n.ag-rtl .ag-rich-select-field-input {\n right: calc(var(--ag-cell-horizontal-padding));\n}\n\n.ag-ltr .ag-rich-select-typing-multi .ag-rich-select-field-input {\n margin-left: 0.25rem;\n}\n.ag-rtl .ag-rich-select-typing-multi .ag-rich-select-field-input {\n margin-right: 0.25rem;\n}\n.ag-ltr .ag-rich-select-typing-multi .ag-rich-select-deselect-button {\n margin-left: auto;\n}\n.ag-rtl .ag-rich-select-typing-multi .ag-rich-select-deselect-button {\n margin-right: auto;\n}\n.ag-ltr .ag-rich-select-typing-multi .ag-rich-select-deselect-button.ag-hidden + .ag-picker-field-icon {\n margin-left: auto;\n}\n.ag-rtl .ag-rich-select-typing-multi .ag-rich-select-deselect-button.ag-hidden + .ag-picker-field-icon {\n margin-right: auto;\n}\n\n.ag-popup-editor .ag-rich-select-value {\n height: var(--ag-row-height);\n min-width: 200px;\n}\n\n.ag-rich-select-virtual-list-item {\n cursor: default;\n height: var(--ag-list-item-height);\n}\n.ag-rich-select-virtual-list-item:focus-visible::after {\n content: none;\n}\n\n.ag-ltr .ag-rich-select-row {\n padding-left: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n.ag-rtl .ag-rich-select-row {\n padding-right: calc(var(--ag-cell-horizontal-padding) / 2);\n}\n\n.ag-rich-select-row-selected {\n background-color: var(--ag-selected-row-background-color);\n}\n\n.ag-rich-select-row:hover,\n.ag-rich-select-row-highlighted {\n background-image: linear-gradient(var(--ag-row-hover-color), var(--ag-row-hover-color));\n}\n\n.ag-rich-select-row-text-highlight {\n font-weight: bold;\n}\n\n.ag-autocomplete {\n width: 100%;\n}\n\n.ag-autocomplete-list {\n width: 100%;\n min-width: 200px;\n height: calc(var(--ag-row-height) * 6.5);\n}\n\n.ag-autocomplete-virtual-list-item {\n cursor: default;\n height: var(--ag-list-item-height);\n}\n.ag-autocomplete-virtual-list-item:focus-visible::after {\n content: none;\n}\n.ag-autocomplete-virtual-list-item:hover {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-autocomplete-row-label {\n margin: 0px var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-autocomplete-row-selected {\n background-color: var(--ag-selected-row-background-color);\n}\n\n.ag-pill {\n border: 1px solid var(--ag-chip-border-color);\n border-radius: var(--ag-border-radius);\n background-color: var(--ag-chip-background-color);\n}\n\n.ag-ltr .ag-pill .ag-pill-button {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-pill .ag-pill-button {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-pill:focus-visible {\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-pill .ag-pill-button:hover {\n cursor: pointer;\n}\n\n.ag-content-editable-field-input {\n background-color: var(--ag-background-color);\n border: var(--ag-borders-input) var(--ag-input-border-color);\n border-radius: var(--ag-border-radius);\n color: var(--ag-foreground-color);\n}\n.ag-ltr .ag-content-editable-field-input {\n padding-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-content-editable-field-input {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-cell-editor .ag-wrapper.ag-content-editable-field-input {\n --ag-internal-calculated-line-height: var(\n --ag-line-height,\n calc(var(--ag-row-height) - var(--ag-row-border-width))\n );\n --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width) - 2px);\n line-height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\n}\n\n.ag-content-editable-field-input:focus,\n.ag-content-editable-field-input:focus-within {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-input-focus-border-color);\n}\n\n:where(.ag-content-editable-field.ag-disabled .ag-content-editable-field-input) {\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-content-editable-field-input.invalid {\n border-color: var(--ag-invalid-color);\n}\n\n.ag-formula-token {\n line-height: var(--ag-line-height, 1.6);\n}\n\n.ag-formula-token-color-1 {\n color: var(--ag-formula-token-1-color);\n}\n\n.ag-formula-token-color-2 {\n color: var(--ag-formula-token-2-color);\n}\n\n.ag-formula-token-color-3 {\n color: var(--ag-formula-token-3-color);\n}\n\n.ag-formula-token-color-4 {\n color: var(--ag-formula-token-4-color);\n}\n\n.ag-formula-token-color-5 {\n color: var(--ag-formula-token-5-color);\n}\n\n.ag-formula-token-color-6 {\n color: var(--ag-formula-token-6-color);\n}\n\n.ag-formula-token-color-7 {\n color: var(--ag-formula-token-7-color);\n}\n\n.ag-formula-range-color-1 {\n --ag-range-selection-border-color: var(--ag-formula-token-1-color);\n --ag-range-selection-background-color: var(--ag-formula-token-1-background-color);\n}\n\n.ag-formula-range-color-2 {\n --ag-range-selection-border-color: var(--ag-formula-token-2-color);\n --ag-range-selection-background-color: var(--ag-formula-token-2-background-color);\n}\n\n.ag-formula-range-color-3 {\n --ag-range-selection-border-color: var(--ag-formula-token-3-color);\n --ag-range-selection-background-color: var(--ag-formula-token-3-background-color);\n}\n\n.ag-formula-range-color-4 {\n --ag-range-selection-border-color: var(--ag-formula-token-4-color);\n --ag-range-selection-background-color: var(--ag-formula-token-4-background-color);\n}\n\n.ag-formula-range-color-5 {\n --ag-range-selection-border-color: var(--ag-formula-token-5-color);\n --ag-range-selection-background-color: var(--ag-formula-token-5-background-color);\n}\n\n.ag-formula-range-color-6 {\n --ag-range-selection-border-color: var(--ag-formula-token-6-color);\n --ag-range-selection-background-color: var(--ag-formula-token-6-background-color);\n}\n\n.ag-formula-range-color-7 {\n --ag-range-selection-border-color: var(--ag-formula-token-7-color);\n --ag-range-selection-background-color: var(--ag-formula-token-7-background-color);\n}\n\n.ag-range-handle.ag-formula-range-color-1,\n.ag-fill-handle.ag-formula-range-color-1 {\n background-color: var(--ag-formula-token-1-color);\n}\n\n.ag-range-handle.ag-formula-range-color-2,\n.ag-fill-handle.ag-formula-range-color-2 {\n background-color: var(--ag-formula-token-2-color);\n}\n\n.ag-range-handle.ag-formula-range-color-3,\n.ag-fill-handle.ag-formula-range-color-3 {\n background-color: var(--ag-formula-token-3-color);\n}\n\n.ag-range-handle.ag-formula-range-color-4,\n.ag-fill-handle.ag-formula-range-color-4 {\n background-color: var(--ag-formula-token-4-color);\n}\n\n.ag-range-handle.ag-formula-range-color-5,\n.ag-fill-handle.ag-formula-range-color-5 {\n background-color: var(--ag-formula-token-5-color);\n}\n\n.ag-range-handle.ag-formula-range-color-6,\n.ag-fill-handle.ag-formula-range-color-6 {\n background-color: var(--ag-formula-token-6-color);\n}\n\n.ag-dragging-range-handle .ag-dialog,\n.ag-dragging-fill-handle .ag-dialog {\n opacity: 0.7;\n pointer-events: none;\n}\n\n.ag-dialog {\n border-radius: var(--ag-border-radius);\n border: var(--ag-borders) var(--ag-border-color);\n box-shadow: var(--ag-popup-shadow);\n}\n\n.ag-panel {\n background-color: var(--ag-panel-background-color);\n border-color: var(--ag-panel-border-color);\n}\n\n.ag-panel-title-bar {\n color: var(--ag-header-foreground-color);\n height: var(--ag-header-height);\n padding: var(--ag-grid-size) var(--ag-cell-horizontal-padding);\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-ltr .ag-panel-title-bar-button {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-panel-title-bar-button {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-tooltip {\n background-color: var(--ag-tooltip-background-color);\n color: var(--ag-foreground-color);\n padding: var(--ag-grid-size);\n border: var(--ag-borders) var(--ag-border-color);\n border-radius: var(--ag-card-radius);\n white-space: normal;\n}\n.ag-tooltip.ag-cell-editor-tooltip, .ag-tooltip.ag-cell-formula-tooltip {\n background-color: var(--ag-tooltip-error-background-color);\n color: var(--ag-tooltip-error-text-color);\n border: var(--ag-borders) var(--ag-tooltip-error-border-color);\n font-weight: 500;\n}\n\n.ag-tooltip.ag-tooltip-animate,\n.ag-tooltip-custom.ag-tooltip-animate {\n transition: opacity 1s;\n}\n.ag-tooltip.ag-tooltip-animate.ag-tooltip-hiding,\n.ag-tooltip-custom.ag-tooltip-animate.ag-tooltip-hiding {\n opacity: 0;\n}\n\n.ag-ltr .ag-column-select-column,\n.ag-ltr .ag-column-select-column-group {\n padding-left: calc(var(--ag-indentation-level) * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-column,\n.ag-rtl .ag-column-select-column-group {\n padding-right: calc(var(--ag-indentation-level) * var(--ag-column-select-indent-size));\n}\n\n.ag-column-select-header-icon {\n cursor: pointer;\n}\n\n.ag-column-select-header-icon:focus-visible {\n outline: none;\n}\n.ag-column-select-header-icon:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 0px;\n left: 0px;\n display: block;\n width: calc(100% - 0px);\n height: calc(100% - 0px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-ltr .ag-column-group-icons:not(:last-child),\n.ag-ltr .ag-column-select-header-icon:not(:last-child),\n.ag-ltr .ag-column-select-header-checkbox:not(:last-child),\n.ag-ltr .ag-column-select-header-filter-wrapper:not(:last-child),\n.ag-ltr .ag-column-select-checkbox:not(:last-child),\n.ag-ltr .ag-column-select-column-drag-handle:not(:last-child),\n.ag-ltr .ag-column-select-column-group-drag-handle:not(:last-child),\n.ag-ltr .ag-column-select-column-label:not(:last-child) {\n margin-right: var(--ag-widget-horizontal-spacing);\n}\n.ag-rtl .ag-column-group-icons:not(:last-child),\n.ag-rtl .ag-column-select-header-icon:not(:last-child),\n.ag-rtl .ag-column-select-header-checkbox:not(:last-child),\n.ag-rtl .ag-column-select-header-filter-wrapper:not(:last-child),\n.ag-rtl .ag-column-select-checkbox:not(:last-child),\n.ag-rtl .ag-column-select-column-drag-handle:not(:last-child),\n.ag-rtl .ag-column-select-column-group-drag-handle:not(:last-child),\n.ag-rtl .ag-column-select-column-label:not(:last-child) {\n margin-left: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-column-select-virtual-list-item:focus-visible {\n outline: none;\n}\n.ag-column-select-virtual-list-item:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-select-column-group:not(:last-child),\n.ag-column-select-column:not(:last-child) {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-column-select-column-readonly,\n.ag-column-select-column-group-readonly {\n color: var(--ag-disabled-foreground-color);\n pointer-events: none;\n}\n\n.ag-ltr .ag-column-select-add-group-indent {\n margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-column-select-add-group-indent {\n margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n\n.ag-column-select-virtual-list-viewport {\n padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) 0px;\n}\n\n.ag-column-select-virtual-list-item {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-checkbox-edit {\n padding-left: var(--ag-cell-horizontal-padding);\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-pill-select .ag-column-drop {\n border-bottom: 0;\n min-height: unset;\n}\n.ag-pill-select .ag-column-drop-list {\n padding: 0;\n}\n.ag-pill-select .ag-select {\n padding-top: var(--ag-grid-size);\n}\n.ag-pill-select .ag-picker-field-wrapper {\n background-color: transparent;\n border: 0;\n}\n.ag-pill-select .ag-picker-field-display {\n cursor: pointer;\n}\n\n.ag-rtl {\n text-align: right;\n}\n\n.ag-root-wrapper {\n border-radius: var(--ag-wrapper-border-radius);\n border: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-row > .ag-cell-wrapper.ag-row-group {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * var(--ag-indentation-level));\n}\n\n.ag-cell-wrapper.ag-row-group,\n.ag-cell-wrapper.ag-row-group-leaf-indent,\n.ag-cell-wrapper.ag-pivot-leaf-group {\n padding-left: calc(var(--ag-indentation-level) * var(--ag-row-group-indent-size));\n}\n\n.ag-cell-wrapper > .ag-group-checkbox-spacing {\n width: var(--ag-icon-size);\n margin-right: var(--ag-cell-widget-spacing);\n}\n\n.ag-ltr .ag-row-group-leaf-indent {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-group-leaf-indent {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n\n.ag-value-change-delta {\n padding-right: 2px;\n}\n\n.ag-value-change-delta-up {\n color: var(--ag-value-change-delta-up-color);\n}\n\n.ag-value-change-delta-down {\n color: var(--ag-value-change-delta-down-color);\n}\n\n.ag-value-change-value {\n background-color: transparent;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n transition: background-color 1s;\n}\n\n.ag-value-change-value-highlight {\n background-color: var(--ag-value-change-value-highlight-background-color);\n transition: background-color 0.1s;\n}\n\n.ag-cell-data-changed {\n background-color: var(--ag-value-change-value-highlight-background-color) !important;\n}\n\n.ag-cell-data-changed-animation {\n background-color: transparent;\n}\n\n.ag-cell-highlight {\n background-color: var(--ag-range-selection-highlight-color) !important;\n}\n\n.ag-row,\n.ag-spanned-row {\n color: var(--ag-data-color);\n}\n\n.ag-row {\n height: var(--ag-row-height);\n background-color: var(--ag-data-background-color);\n border-bottom: var(--ag-row-border-style) var(--ag-row-border-color) var(--ag-row-border-width);\n}\n.ag-row.ag-row-editing-invalid {\n background-color: var(--ag-full-row-invalid-background-color);\n}\n\n.ag-spanned-cell-wrapper {\n background-color: var(--ag-data-background-color);\n position: absolute;\n}\n\n.ag-spanned-cell-wrapper > .ag-spanned-cell {\n display: block;\n position: relative;\n}\n\n.ag-row-highlight-above::after,\n.ag-row-highlight-inside::after,\n.ag-row-highlight-below::after {\n content: "";\n position: absolute;\n width: calc(100% - 1px);\n height: var(--ag-row-drag-indicator-width);\n background-color: var(--ag-row-drag-indicator-color);\n border-radius: calc(var(--ag-row-drag-indicator-width) / 2);\n left: 1px;\n pointer-events: none;\n}\n\n.ag-row-highlight-above::after {\n top: 0;\n}\n\n.ag-row-highlight-below::after {\n bottom: 0;\n}\n\n.ag-row-highlight-indent::after {\n display: block;\n width: auto;\n left: calc(2 * (var(--ag-cell-widget-spacing) + var(--ag-icon-size)) + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level) * var(--ag-row-group-indent-size));\n right: 1px;\n}\n\n.ag-row-highlight-inside::after {\n display: block;\n width: auto;\n height: auto;\n inset: 0;\n background-color: var(--ag-selected-row-background-color);\n border: 1px solid var(--ag-range-selection-border-color);\n}\n\n.ag-body,\n.ag-floating-top,\n.ag-floating-bottom {\n background-color: var(--ag-data-background-color);\n}\n\n.ag-row-odd {\n background-color: var(--ag-odd-row-background-color);\n}\n\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner) {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-right-spacer:not(.ag-scroller-corner) {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-row-selected::before {\n content: "";\n background-color: var(--ag-selected-row-background-color);\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.ag-row-hover:not(.ag-full-width-row)::before,\n.ag-row-hover.ag-full-width-row.ag-row-group::before {\n content: "";\n background-color: var(--ag-row-hover-color);\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n.ag-row.ag-full-width-row.ag-row-group > * {\n position: relative;\n}\n\n.ag-row-hover.ag-row-selected::before {\n background-color: var(--ag-row-hover-color);\n background-image: linear-gradient(var(--ag-selected-row-background-color), var(--ag-selected-row-background-color));\n}\n\n.ag-column-hover {\n background-color: var(--ag-column-hover-color);\n}\n\n.ag-header-range-highlight {\n background-color: var(--ag-range-header-highlight-color);\n}\n\n.ag-ltr .ag-right-aligned-cell {\n text-align: right;\n}\n.ag-rtl .ag-right-aligned-cell {\n text-align: left;\n}\n\n.ag-ltr .ag-right-aligned-cell .ag-cell-value,\n.ag-ltr .ag-right-aligned-cell .ag-group-value {\n margin-left: auto;\n}\n.ag-rtl .ag-right-aligned-cell .ag-cell-value,\n.ag-rtl .ag-right-aligned-cell .ag-group-value {\n margin-right: auto;\n}\n\n.ag-ltr .ag-right-aligned-cell .ag-skeleton-effect {\n margin-left: auto;\n}\n.ag-rtl .ag-right-aligned-cell .ag-skeleton-effect {\n margin-right: auto;\n}\n\n.ag-cell,\n.ag-full-width-row .ag-cell-wrapper.ag-row-group {\n --ag-internal-calculated-line-height: var(\n --ag-line-height,\n calc(var(--ag-row-height) - var(--ag-row-border-width))\n );\n --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width) - 2px);\n border: 1px solid transparent;\n line-height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\n padding-left: calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size) * var(--ag-indentation-level));\n padding-right: calc(var(--ag-cell-horizontal-padding) - 1px);\n -webkit-font-smoothing: subpixel-antialiased;\n}\n\n.ag-row > .ag-cell-wrapper {\n padding-left: calc(var(--ag-cell-horizontal-padding) - 1px);\n padding-right: calc(var(--ag-cell-horizontal-padding) - 1px);\n}\n\n.ag-row-dragging {\n cursor: move;\n opacity: 0.5;\n}\n\n.ag-cell-inline-editing {\n border: 1px solid var(--ag-border-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: 0;\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-popup-editor .ag-large-text,\n.ag-autocomplete-list-popup {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n background-color: var(--ag-control-panel-background-color);\n padding: 0;\n}\n\n.ag-large-text-input {\n height: auto;\n padding: var(--ag-cell-horizontal-padding);\n}\n\n.ag-rtl .ag-large-text-input textarea {\n resize: none;\n}\n\n.ag-details-row {\n padding: calc(var(--ag-grid-size) * 5);\n background-color: var(--ag-data-background-color);\n}\n\n.ag-layout-auto-height .ag-center-cols-viewport,\n.ag-layout-auto-height .ag-center-cols-container,\n.ag-layout-print .ag-center-cols-viewport,\n.ag-layout-print .ag-center-cols-container {\n min-height: 50px;\n}\n\n.ag-overlay-loading-wrapper,\n.ag-overlay-exporting-wrapper,\n.ag-overlay-modal-wrapper {\n background-color: var(--ag-modal-overlay-background-color);\n}\n\n.ag-overlay-loading-center,\n.ag-overlay-exporting-center {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n display: flex;\n}\n\n.ag-skeleton-container {\n width: 100%;\n height: 100%;\n align-content: center;\n}\n\n.ag-skeleton-effect {\n background-color: var(--ag-row-loading-skeleton-effect-color);\n width: 100%;\n height: 1em;\n border-radius: 0.25rem;\n animation: ag-skeleton-loading 1.5s ease-in-out 0.5s infinite;\n}\n\n@keyframes ag-skeleton-loading {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n}\n.ag-loading {\n display: flex;\n height: 100%;\n align-items: center;\n}\n.ag-ltr .ag-loading {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-loading {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-loading-icon {\n padding-right: var(--ag-cell-widget-spacing);\n}\n.ag-rtl .ag-loading-icon {\n padding-left: var(--ag-cell-widget-spacing);\n}\n\n.ag-icon-loading {\n animation-name: spin;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.ag-floating-top:not(.ag-invisible) {\n border-bottom: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-floating-bottom:not(.ag-invisible) {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-find-cell {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-find-match {\n color: var(--ag-find-match-color);\n background-color: var(--ag-find-match-background-color);\n}\n\n.ag-find-active-match {\n color: var(--ag-find-active-match-color);\n background-color: var(--ag-find-active-match-background-color);\n}\n\n.ag-ltr .ag-cell {\n border-right: var(--ag-cell-horizontal-border);\n}\n.ag-rtl .ag-cell {\n border-left: var(--ag-cell-horizontal-border);\n}\n.ag-ltr .ag-cell {\n border-right-width: 1px;\n}\n.ag-rtl .ag-cell {\n border-left-width: 1px;\n}\n\n.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left):not(.ag-cell-range-single-cell) {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right):not(.ag-cell-range-single-cell) {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-cell-range-selected:not(.ag-cell-focus),\n.ag-cell-range-selected.ag-cell-range-chart,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing) {\n background-color: var(--ag-range-selection-background-color);\n}\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart,\n.ag-cell-range-selected.ag-cell-range-chart.ag-cell-range-chart,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart {\n background-color: var(--ag-range-selection-chart-background-color) !important;\n}\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart.ag-cell-range-chart-category,\n.ag-cell-range-selected.ag-cell-range-chart.ag-cell-range-chart.ag-cell-range-chart-category,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart.ag-cell-range-chart-category {\n background-color: var(--ag-range-selection-chart-category-background-color) !important;\n}\n\n.ag-cell-range-selected-1:not(.ag-cell-focus),\n.ag-cell-range-selected-1.ag-cell-range-chart,\n.ag-cell-range-selected-1.ag-formula-range,\n.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing) {\n background-color: var(--ag-range-selection-background-color);\n}\n\n.ag-cell-range-selected-2:not(.ag-cell-focus),\n.ag-cell-range-selected-2.ag-cell-range-chart,\n.ag-cell-range-selected-2.ag-formula-range,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-2 {\n background-color: var(--ag-range-selection-background-color-2);\n}\n\n.ag-cell-range-selected-3:not(.ag-cell-focus),\n.ag-cell-range-selected-3.ag-cell-range-chart,\n.ag-cell-range-selected-3.ag-formula-range,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-3 {\n background-color: var(--ag-range-selection-background-color-3);\n}\n\n.ag-cell-range-selected-4:not(.ag-cell-focus),\n.ag-cell-range-selected-4.ag-cell-range-chart,\n.ag-cell-range-selected-4.ag-formula-range,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-4 {\n background-color: var(--ag-range-selection-background-color-4);\n}\n\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-top {\n border-top-color: var(--ag-range-selection-border-color);\n border-top-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-right {\n border-right-color: var(--ag-range-selection-border-color);\n border-right-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-bottom {\n border-bottom-color: var(--ag-range-selection-border-color);\n border-bottom-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-left {\n border-left-color: var(--ag-range-selection-border-color);\n border-left-style: var(--ag-range-selection-border-style);\n}\n\n.ag-ltr .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\n.ag-ltr .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\n.ag-ltr .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\n.ag-ltr .ag-cell-range-single-cell,\n.ag-ltr .ag-cell-range-single-cell.ag-cell-range-handle,\n.ag-rtl .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\n.ag-rtl .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\n.ag-rtl .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\n.ag-rtl .ag-cell-range-single-cell,\n.ag-rtl .ag-cell-range-single-cell.ag-cell-range-handle {\n border: 1px solid;\n border-color: var(--ag-range-selection-border-color);\n border-style: var(--ag-range-selection-border-style);\n outline: initial;\n}\n\n.ag-cell.ag-selection-fill-top,\n.ag-cell.ag-selection-fill-top.ag-cell-range-selected {\n border-top: 1px dashed;\n border-top-color: var(--ag-range-selection-border-color);\n}\n\n.ag-ltr .ag-cell.ag-selection-fill-right,\n.ag-ltr .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\n border-right: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n.ag-rtl .ag-cell.ag-selection-fill-right,\n.ag-rtl .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\n border-left: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n\n.ag-cell.ag-selection-fill-bottom,\n.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected {\n border-bottom: 1px dashed;\n border-bottom-color: var(--ag-range-selection-border-color);\n}\n\n.ag-ltr .ag-cell.ag-selection-fill-left,\n.ag-ltr .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\n border-left: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n.ag-rtl .ag-cell.ag-selection-fill-left,\n.ag-rtl .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\n border-right: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n\n.ag-fill-handle,\n.ag-range-handle {\n position: absolute;\n width: 6px;\n height: 6px;\n bottom: -1px;\n background-color: var(--ag-range-selection-border-color);\n}\n.ag-ltr .ag-fill-handle,\n.ag-ltr .ag-range-handle {\n right: -1px;\n}\n.ag-rtl .ag-fill-handle,\n.ag-rtl .ag-range-handle {\n left: -1px;\n}\n\n.ag-fill-handle {\n cursor: crosshair;\n}\n\n.ag-range-handle {\n cursor: nwse-resize;\n}\n\n.ag-cell-inline-editing {\n border-color: var(--ag-input-focus-border-color) !important;\n}\n.ag-cell-inline-editing.ag-cell-editing-error {\n border-color: var(--ag-invalid-color) !important;\n}\n\n.ag-menu {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n background-color: var(--ag-menu-background-color);\n border-color: var(--ag-menu-border-color);\n padding: 0;\n}\n\n.ag-menu.ag-tabs {\n min-width: var(--ag-tab-min-width);\n}\n\n.ag-menu-list {\n cursor: default;\n padding: var(--ag-grid-size) 0;\n}\n\n.ag-menu-separator {\n height: calc(var(--ag-grid-size) * 2 + 1px);\n}\n\n.ag-menu-separator-part::after {\n content: "";\n display: block;\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-menu-option {\n position: relative;\n}\n\n.ag-menu-option:focus-visible {\n outline: none;\n}\n.ag-menu-option:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-menu-option-active,\n.ag-compact-menu-option-active {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-menu-option-part,\n.ag-compact-menu-option-part {\n line-height: var(--ag-icon-size);\n padding: calc(var(--ag-grid-size) + 2px) 0;\n}\n\n.ag-menu-option-disabled,\n.ag-compact-menu-option-disabled {\n opacity: 0.5;\n}\n\n.ag-menu-option-icon,\n.ag-compact-menu-option-icon {\n width: var(--ag-icon-size);\n}\n.ag-ltr .ag-menu-option-icon,\n.ag-ltr .ag-compact-menu-option-icon {\n padding-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-menu-option-icon,\n.ag-rtl .ag-compact-menu-option-icon {\n padding-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-menu-option-text,\n.ag-compact-menu-option-text {\n padding-left: calc(var(--ag-grid-size) * 2);\n padding-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-ltr .ag-menu-option-shortcut,\n.ag-ltr .ag-compact-menu-option-shortcut {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-menu-option-shortcut,\n.ag-rtl .ag-compact-menu-option-shortcut {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-ltr .ag-menu-option-popup-pointer,\n.ag-ltr .ag-compact-menu-option-popup-pointer {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-menu-option-popup-pointer,\n.ag-rtl .ag-compact-menu-option-popup-pointer {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-tabs-header {\n display: flex;\n}\n\n.ag-tabs-header-wrapper {\n display: flex;\n}\n.ag-tabs-header-wrapper .ag-tabs-header {\n flex: 1;\n}\n\n.ag-tabs-close-button-wrapper {\n border: 0;\n border-right: var(--ag-borders) var(--ag-border-color);\n padding: var(--ag-grid-size);\n}\n\n.ag-tabs-close-button {\n border: 0;\n background-color: unset;\n cursor: pointer;\n padding: 0;\n}\n\n.ag-tab {\n border-bottom: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-bottom var(--ag-selected-tab-underline-transition-speed);\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.ag-tab:focus-visible {\n outline: none;\n}\n.ag-tab:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-tab-selected {\n border-bottom-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-menu-header {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-filter-separator {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-filter-select .ag-picker-field-wrapper {\n width: 0;\n}\n\n.ag-filter-condition-operator {\n height: 17px;\n}\n\n.ag-ltr .ag-filter-condition-operator-or {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-filter-condition-operator-or {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-set-filter-select-all {\n padding-top: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-set-filter-list,\n.ag-filter-no-matches {\n height: calc(var(--ag-list-item-height) * 6);\n}\n\n.ag-set-filter-tree-list {\n height: calc(var(--ag-list-item-height) * 10);\n}\n\n.ag-set-filter-filter {\n margin-top: var(--ag-widget-container-vertical-padding);\n margin-left: var(--ag-widget-container-horizontal-padding);\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-filter-to {\n margin-top: var(--ag-widget-vertical-spacing);\n}\n\n.ag-mini-filter {\n margin: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-set-filter {\n --ag-indentation-level: 0;\n}\n\n.ag-ltr .ag-set-filter-item {\n padding-left: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-item {\n padding-right: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-add-group-indent {\n margin-left: calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding));\n}\n.ag-rtl .ag-set-filter-add-group-indent {\n margin-right: calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding));\n}\n\n.ag-ltr .ag-set-filter-group-icons {\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n.ag-rtl .ag-set-filter-group-icons {\n margin-left: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-filter-menu .ag-set-filter-list {\n min-width: 200px;\n}\n\n.ag-filter-virtual-list-item:focus-visible {\n outline: none;\n}\n.ag-filter-virtual-list-item:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-filter-apply-panel {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-filter-apply-panel-button {\n line-height: 1.5;\n}\n.ag-ltr .ag-filter-apply-panel-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-filter-apply-panel-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-simple-filter-body-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--ag-widget-vertical-spacing);\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: var(--ag-widget-container-vertical-padding);\n overflow-y: auto;\n min-height: calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));\n}\n.ag-simple-filter-body-wrapper .ag-resizer-wrapper {\n margin: 0;\n}\n\n.ag-menu:not(.ag-tabs) .ag-filter .ag-filter-body-wrapper,\n.ag-menu:not(.ag-tabs) .ag-filter > *:not(.ag-filter-wrapper) {\n min-width: calc(var(--ag-menu-min-width) - 2px);\n}\n\n.ag-filter-no-matches {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-multi-filter-menu-item {\n margin: var(--ag-grid-size) 0;\n}\n\n.ag-multi-filter-group-title-bar {\n padding: calc(var(--ag-grid-size) * 2) var(--ag-grid-size);\n background-color: transparent;\n}\n\n.ag-group-filter-field-select-wrapper {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n}\n.ag-group-filter-field-select-wrapper > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-multi-filter-group-title-bar:focus-visible {\n outline: none;\n}\n.ag-multi-filter-group-title-bar:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-side-bar {\n position: relative;\n}\n\n.ag-tool-panel-wrapper {\n width: var(--ag-horizontal-size, var(--ag-side-bar-panel-width));\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-tool-panel-content {\n display: flex;\n height: 100%;\n overflow: hidden auto;\n}\n\n.ag-tool-panel-wrapper.ag-tool-panel-animating {\n display: block !important;\n transition: width var(--ag-side-bar-panel-animation-duration) ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ag-tool-panel-wrapper.ag-tool-panel-animating {\n transition: none;\n }\n}\n.ag-tool-panel-external {\n display: flex;\n flex-direction: row;\n}\n\n:where(.ag-tool-panel-external) .ag-tool-panel-wrapper {\n flex-grow: 1;\n}\n\n.ag-side-buttons {\n padding-top: calc(var(--ag-grid-size) * 4);\n width: calc(var(--ag-icon-size) + 4px);\n position: relative;\n overflow: hidden;\n}\n\nbutton.ag-side-button-button {\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n background: transparent;\n padding: calc(var(--ag-grid-size) * 2) 0 calc(var(--ag-grid-size) * 2) 0;\n width: 100%;\n margin: 0;\n min-height: calc(var(--ag-grid-size) * 18);\n background-position-y: center;\n background-position-x: center;\n background-repeat: no-repeat;\n border: none;\n border-top: var(--ag-borders-side-button) var(--ag-border-color);\n border-bottom: var(--ag-borders-side-button) var(--ag-border-color);\n}\nbutton.ag-side-button-button:focus {\n box-shadow: none;\n}\n\n.ag-side-button-button:focus-visible {\n outline: none;\n}\n.ag-side-button-button:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-selected button.ag-side-button-button {\n background-color: var(--ag-side-button-selected-background-color);\n}\n\n.ag-side-button-icon-wrapper {\n margin-bottom: 3px;\n}\n\n.ag-ltr .ag-side-bar-left,\n.ag-rtl .ag-side-bar-right {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-side-bar-left .ag-tool-panel-wrapper,\n.ag-rtl .ag-side-bar-right .ag-tool-panel-wrapper {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-side-bar-left .ag-side-button-button,\n.ag-rtl .ag-side-bar-right .ag-side-button-button {\n border-right: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-right var(--ag-selected-tab-underline-transition-speed);\n}\n.ag-ltr .ag-side-bar-left .ag-selected .ag-side-button-button,\n.ag-rtl .ag-side-bar-right .ag-selected .ag-side-button-button {\n border-right-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-rtl .ag-side-bar-left,\n.ag-ltr .ag-side-bar-right {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-side-bar-left .ag-tool-panel-wrapper,\n.ag-ltr .ag-side-bar-right .ag-tool-panel-wrapper {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-side-bar-left .ag-side-button-button,\n.ag-ltr .ag-side-bar-right .ag-side-button-button {\n border-left: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-left var(--ag-selected-tab-underline-transition-speed);\n}\n.ag-rtl .ag-side-bar-left .ag-selected .ag-side-button-button,\n.ag-ltr .ag-side-bar-right .ag-selected .ag-side-button-button {\n border-left-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-filter-toolpanel-header {\n height: calc(var(--ag-grid-size) * 6);\n}\n\n.ag-filter-toolpanel-header,\n.ag-filter-toolpanel-search {\n padding: 0 var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-header:focus-visible {\n outline: none;\n}\n.ag-filter-toolpanel-header:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-filter-toolpanel-group:not(.ag-has-filter) > .ag-group-title-bar .ag-filter-toolpanel-group-instance-header-icon {\n display: none;\n}\n\n.ag-filter-toolpanel-group-level-0-header {\n height: calc(var(--ag-grid-size) * 8);\n}\n\n.ag-filter-toolpanel-group-item {\n margin-top: calc(var(--ag-grid-size) * 0.5);\n margin-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n\n.ag-filter-toolpanel-search {\n height: var(--ag-header-height);\n}\n\n.ag-filter-toolpanel-search-input {\n flex-grow: 1;\n height: calc(var(--ag-grid-size) * 4);\n}\n.ag-ltr .ag-filter-toolpanel-search-input {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-search-input {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-group-level-0 {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-ltr .ag-filter-toolpanel-expand,\n.ag-ltr .ag-filter-toolpanel-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-expand,\n.ag-rtl .ag-filter-toolpanel-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n\n.ag-ltr .ag-filter-toolpanel-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * var(--ag-indentation-level, 0) + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * var(--ag-indentation-level, 0) + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-instance-filter {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n border-top: var(--ag-borders) var(--ag-border-color);\n margin-top: var(--ag-grid-size);\n}\n\n.ag-ltr .ag-filter-toolpanel-group-instance-header-icon,\n.ag-ltr .ag-filter-toolpanel-instance-header-icon {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-group-instance-header-icon,\n.ag-rtl .ag-filter-toolpanel-instance-header-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-set-filter-group-icons {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-filter-panel {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.ag-filter-panel .ag-simple-filter-body-wrapper {\n padding: var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0;\n}\n.ag-filter-panel .ag-mini-filter {\n margin-top: var(--ag-widget-vertical-spacing);\n margin-left: var(--ag-widget-container-horizontal-padding);\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n.ag-filter-panel .ag-standard-button {\n transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out;\n}\n.ag-filter-panel .ag-simple-filter-body-wrapper > *:last-child,\n.ag-filter-panel .ag-set-filter-body-wrapper {\n margin-bottom: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-filter-panel-container {\n flex: 1;\n overflow: auto;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;\n}\n\n.ag-filter-panel-container > *:not(:last-child) {\n margin-bottom: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-filter-card {\n border: 1px solid var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n background-color: var(--ag-background-color);\n}\n.ag-ltr .ag-filter-card .ag-set-filter-item {\n padding-left: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\n padding-right: var(--ag-widget-container-horizontal-padding);\n}\n.ag-rtl .ag-filter-card .ag-set-filter-item {\n padding-right: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level) * var(--ag-set-filter-indent-size));\n padding-left: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-filter-card-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-top: var(--ag-widget-vertical-spacing);\n}\n.ag-ltr .ag-filter-card-header > *:not(:last-child) {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-card-header > *:not(:last-child) {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-filter-card-heading {\n flex: 1;\n overflow: hidden;\n padding-top: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n}\n.ag-ltr .ag-filter-card-heading {\n padding-left: var(--ag-widget-horizontal-spacing);\n}\n.ag-rtl .ag-filter-card-heading {\n padding-right: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-filter-card-expand {\n display: flex;\n flex-direction: row;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n}\n\n.ag-filter-card-title {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-filter-card-expand-icon {\n display: flex;\n flex: 1;\n justify-content: end;\n}\n\n.ag-filter-card-editing-icon {\n margin: 0 var(--ag-grid-size);\n}\n\n.ag-filter-card-summary,\n.ag-filter-card-expand-icon .ag-icon,\n.ag-filter-card-delete-icon .ag-icon,\n.ag-filter-card-editing-icon .ag-icon {\n color: var(--ag-filter-panel-card-subtle-color);\n}\n\n.ag-filter-card-expand-icon .ag-icon,\n.ag-filter-card-delete-icon .ag-icon {\n transition: color 0.25s ease-in-out;\n}\n\n.ag-filter-card-expand-icon:hover .ag-icon,\n.ag-filter-card-delete-icon:hover .ag-icon {\n color: var(--ag-filter-panel-card-subtle-hover-color);\n}\n\n.ag-filter-card-heading:hover .ag-filter-card-expand-icon .ag-icon {\n color: var(--ag-filter-panel-card-subtle-hover-color);\n}\n\n.ag-filter-card-expand,\n.ag-filter-card-delete {\n border-radius: var(--ag-button-border-radius);\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n}\n\n.ag-filter-panel .ag-standard-button {\n cursor: pointer;\n}\n\n.ag-filter-card-summary,\n.ag-filter-type-select {\n margin-left: var(--ag-widget-container-horizontal-padding);\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-ltr .ag-filter-card-delete {\n margin-right: var(--ag-widget-horizontal-spacing);\n}\n.ag-rtl .ag-filter-card-delete {\n margin-left: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-filter-card-summary {\n margin-bottom: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-filter-type-select {\n padding-top: var(--ag-widget-vertical-spacing);\n}\n\n.ag-filter-card-add {\n padding: 0;\n border: 0;\n}\n\n.ag-filter-add-button {\n display: flex;\n flex-direction: row;\n width: 100%;\n align-items: center;\n line-height: 1.5;\n}\n\n.ag-ltr .ag-filter-add-button-label {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-add-button-label {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-filter-add-select {\n border: 0;\n}\n.ag-ltr .ag-filter-add-select .ag-text-field-input {\n padding-left: calc(var(--ag-grid-size) * 1.5 + 12px) !important;\n}\n.ag-rtl .ag-filter-add-select .ag-text-field-input {\n padding-right: calc(var(--ag-grid-size) * 1.5 + 12px) !important;\n}\n.ag-filter-add-select .ag-rich-select-value {\n padding: calc((1.5 * var(--ag-font-size) + 4 * var(--ag-grid-size) - var(--ag-input-height)) / 2) var(--ag-grid-size);\n border: 0;\n}\n\n.ag-pivot-mode-panel {\n min-height: var(--ag-header-height);\n height: var(--ag-header-height);\n display: flex;\n}\n\n.ag-pivot-mode-select {\n display: flex;\n align-items: center;\n}\n.ag-ltr .ag-pivot-mode-select {\n margin-left: var(--ag-widget-container-horizontal-padding);\n}\n.ag-rtl .ag-pivot-mode-select {\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-column-select-header:focus-visible {\n outline: none;\n}\n.ag-column-select-header:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-select-header {\n height: var(--ag-header-height);\n align-items: center;\n padding: 0 var(--ag-widget-container-horizontal-padding);\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-column-panel-column-select {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-column-panel-column-select:not(.ag-last-visible-child) {\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-column-panel-buttons {\n display: flex;\n justify-content: flex-end;\n overflow: hidden;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;\n flex-wrap: wrap;\n gap: var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);\n}\n.ag-column-panel-buttons .ag-standard-button {\n transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out;\n}\n\n.ag-column-panel-buttons:last-child {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-column-panel-buttons-button {\n line-height: 1.5;\n}\n\n.ag-column-panel .ag-standard-button.ag-column-panel-buttons-apply-button:not(:disabled) {\n color: var(--ag-column-panel-apply-button-color);\n background-color: var(--ag-column-panel-apply-button-background-color);\n}\n\n.ag-column-group-icons,\n.ag-column-select-header-icon {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-select-list .ag-list-item-hovered::after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n}\n.ag-column-select-list .ag-item-highlight-top::after {\n top: 0;\n}\n.ag-column-select-list .ag-item-highlight-bottom::after {\n bottom: 0;\n}\n\n.ag-header,\n.ag-advanced-filter-header {\n background-color: var(--ag-header-background-color);\n border-bottom: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-header-row {\n color: var(--ag-header-foreground-color);\n height: var(--ag-header-height);\n}\n\n.ag-pinned-right-header {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-pinned-left-header {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-header-cell:not(.ag-right-aligned-header) .ag-header-col-ref {\n margin-right: var(--ag-grid-size);\n color: var(--ag-subtle-text-color);\n}\n.ag-ltr .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon,\n.ag-ltr .ag-header-cell:not(.ag-right-aligned-header) .ag-header-menu-icon {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon,\n.ag-rtl .ag-header-cell:not(.ag-right-aligned-header) .ag-header-menu-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-header-cell.ag-right-aligned-header .ag-header-col-ref {\n margin-left: var(--ag-grid-size);\n color: var(--ag-subtle-text-color);\n}\n.ag-ltr .ag-header-cell.ag-right-aligned-header .ag-header-label-icon,\n.ag-ltr .ag-header-cell.ag-right-aligned-header .ag-header-menu-icon {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-header-cell.ag-right-aligned-header .ag-header-label-icon,\n.ag-rtl .ag-header-cell.ag-right-aligned-header .ag-header-menu-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-header-cell,\n.ag-header-group-cell {\n padding-left: var(--ag-cell-horizontal-padding);\n padding-right: var(--ag-cell-horizontal-padding);\n}\n.ag-header-cell.ag-header-cell-moving,\n.ag-header-group-cell.ag-header-cell-moving {\n background-color: var(--ag-header-cell-moving-background-color);\n}\n\n.ag-ltr .ag-header-group-cell-label.ag-sticky-label {\n left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-header-group-cell-label.ag-sticky-label {\n right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-header-cell:focus-visible {\n outline: none;\n}\n.ag-header-cell:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-header-group-cell:focus-visible {\n outline: none;\n}\n.ag-header-group-cell:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-advanced-filter-header-cell:focus-visible {\n outline: none;\n}\n.ag-advanced-filter-header-cell:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-header-icon {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-header-expand-icon {\n cursor: pointer;\n}\n.ag-ltr .ag-header-expand-icon {\n margin-left: 4px;\n}\n.ag-rtl .ag-header-expand-icon {\n margin-right: 4px;\n}\n\n.ag-header-row:not(:first-child) .ag-header-cell:not(.ag-header-span-height.ag-header-span-total, .ag-header-parent-hidden),\n.ag-header-row:not(:first-child) .ag-header-group-cell.ag-header-group-cell-with-group {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover):not(.ag-header-cell-moving):hover, .ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover).ag-column-resizing,\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:not(.ag-column-hover):not(.ag-header-cell-moving):hover,\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:not(.ag-column-hover).ag-column-resizing,\n.ag-header-group-cell:first-of-type:not(.ag-header-cell-moving):hover,\n.ag-header-group-cell:first-of-type.ag-column-resizing,\n.ag-header-cell:not(.ag-column-hover):first-of-type:not(.ag-header-cell-moving):hover,\n.ag-header-cell:not(.ag-column-hover):first-of-type.ag-column-resizing {\n background-color: var(--ag-header-cell-hover-background-color);\n}\n\n.ag-header-cell::before,\n.ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\n content: "";\n position: absolute;\n z-index: 1;\n display: var(--ag-header-column-separator-display);\n width: var(--ag-header-column-separator-width);\n height: var(--ag-header-column-separator-height);\n top: calc(50% - var(--ag-header-column-separator-height) * 0.5);\n background-color: var(--ag-header-column-separator-color);\n}\n.ag-ltr .ag-header-cell::before,\n.ag-ltr .ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\n right: 0;\n}\n.ag-rtl .ag-header-cell::before,\n.ag-rtl .ag-header-group-cell:not(.ag-header-span-height.ag-header-group-cell-no-group)::before {\n left: 0;\n}\n\n.ag-header-highlight-before::after,\n.ag-header-highlight-after::after {\n content: "";\n position: absolute;\n height: 100%;\n width: var(--ag-column-drag-indicator-width);\n border-radius: calc(var(--ag-column-drag-indicator-width) / 2);\n background-color: var(--ag-column-drag-indicator-color);\n}\n\n.ag-header-highlight-before::after {\n left: 0px;\n}\n\n.ag-header-highlight-after::after {\n right: 0px;\n}\n\n.ag-pinned-left-header .ag-header-highlight-after::after {\n right: 1px;\n}\n\n.ag-header-cell-resize {\n display: flex;\n align-items: center;\n}\n\n.ag-header-cell-resize::after {\n content: "";\n position: absolute;\n z-index: 1;\n display: var(--ag-header-column-resize-handle-display);\n width: var(--ag-header-column-resize-handle-width);\n height: var(--ag-header-column-resize-handle-height);\n top: calc(50% - var(--ag-header-column-resize-handle-height) * 0.5);\n background-color: var(--ag-header-column-resize-handle-color);\n}\n.ag-header-cell.ag-header-span-height .ag-header-cell-resize::after {\n height: calc(100% - var(--ag-grid-size) * 4);\n top: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-ltr .ag-header-viewport .ag-header-cell-resize::after {\n left: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n.ag-rtl .ag-header-viewport .ag-header-cell-resize::after {\n right: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n\n.ag-pinned-left-header .ag-header-cell-resize::after {\n left: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n\n.ag-pinned-right-header .ag-header-cell-resize::after {\n left: 50%;\n}\n\n.ag-ltr .ag-header-select-all {\n margin-right: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-header-select-all {\n margin-left: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-floating-filter-button {\n margin-left: var(--ag-cell-widget-spacing);\n}\n.ag-rtl .ag-floating-filter-button {\n margin-right: var(--ag-cell-widget-spacing);\n}\n\n.ag-floating-filter-button-button {\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n appearance: none;\n background: transparent;\n border: none;\n height: var(--ag-icon-size);\n padding: 0;\n width: var(--ag-icon-size);\n}\n\n.ag-filter-loading {\n background-color: var(--ag-control-panel-background-color);\n height: 100%;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n position: absolute;\n width: 100%;\n z-index: 1;\n align-items: unset;\n}\n\n.ag-paging-panel {\n border-top: 1px solid;\n border-top-color: var(--ag-border-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-pagination-panel-height);\n}\n.ag-paging-panel > * {\n margin: 0 var(--ag-cell-horizontal-padding);\n}\n.ag-paging-panel > .ag-paging-page-size .ag-wrapper {\n min-width: calc(var(--ag-grid-size) * 10);\n}\n\n.ag-paging-button {\n cursor: pointer;\n}\n\n.ag-paging-button.ag-disabled {\n cursor: default;\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-paging-button:focus-visible {\n outline: none;\n}\n.ag-paging-button:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 0px;\n left: 0px;\n display: block;\n width: calc(100% - 0px);\n height: calc(100% - 0px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-paging-button,\n.ag-paging-description {\n margin: 0 var(--ag-grid-size);\n line-height: 0;\n}\n\n.ag-status-bar {\n border-top: var(--ag-borders) var(--ag-border-color);\n color: var(--ag-disabled-foreground-color);\n padding-right: calc(var(--ag-grid-size) * 4);\n padding-left: calc(var(--ag-grid-size) * 4);\n line-height: 1.5;\n}\n\n.ag-status-name-value-value {\n color: var(--ag-foreground-color);\n}\n\n.ag-status-bar-center {\n text-align: center;\n}\n\n.ag-status-name-value {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n padding-top: calc(var(--ag-grid-size) * 2);\n padding-bottom: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-column-drop-cell {\n background: var(--ag-chip-background-color);\n border-radius: calc(var(--ag-grid-size) * 4);\n height: calc(var(--ag-grid-size) * 4);\n padding: 0 calc(var(--ag-grid-size) * 0.5);\n border: 1px solid var(--ag-chip-border-color);\n}\n\n.ag-column-drop-cell:focus-visible {\n outline: none;\n}\n.ag-column-drop-cell:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 2px;\n left: 2px;\n display: block;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-drop-cell-text {\n margin: 0 var(--ag-grid-size);\n}\n\n.ag-column-drop-cell-button {\n min-width: calc(var(--ag-grid-size) * 4);\n margin: 0 calc(var(--ag-grid-size) * 0.5);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-drop-cell-drag-handle {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-column-drop-cell-ghost {\n opacity: 0.5;\n}\n\n.ag-column-drop-horizontal {\n background-color: var(--ag-header-background-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-header-height);\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-column-drop-horizontal {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-column-drop-horizontal {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-column-drop-horizontal-half-width:not(:last-child) {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-column-drop-horizontal-half-width:not(:last-child) {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-column-drop-horizontal-cell-separator {\n margin: 0 var(--ag-grid-size);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-drop-horizontal-empty-message {\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-ltr .ag-column-drop-horizontal-icon {\n margin-right: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-column-drop-horizontal-icon {\n margin-left: var(--ag-cell-horizontal-padding);\n}\n\n.ag-column-drop-vertical-list {\n padding-bottom: var(--ag-grid-size);\n padding-right: var(--ag-grid-size);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical-cell {\n margin-top: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical {\n min-height: 50px;\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-column-drop-vertical.ag-last-column-drop {\n border-bottom: none;\n}\n\n.ag-column-drop-vertical-icon {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical-empty-message {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n overflow: hidden;\n color: var(--ag-disabled-foreground-color);\n margin-top: var(--ag-grid-size);\n}\n\n.ag-select-agg-func-popup {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n background: var(--ag-background-color);\n height: calc(var(--ag-grid-size) * 5 * 3.5);\n padding: 0;\n}\n\n.ag-select-agg-func-virtual-list-item {\n cursor: default;\n}\n.ag-ltr .ag-select-agg-func-virtual-list-item {\n padding-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-select-agg-func-virtual-list-item {\n padding-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-select-agg-func-virtual-list-item:hover {\n background-color: var(--ag-selected-row-background-color);\n}\n\n.ag-select-agg-func-virtual-list-item:focus-visible {\n outline: none;\n}\n.ag-select-agg-func-virtual-list-item:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-sort-indicator-container {\n display: flex;\n}\n\n.ag-ltr .ag-sort-indicator-icon {\n padding-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-sort-indicator-icon {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-chart {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n}\n\n.ag-chart-components-wrapper {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n}\n\n.ag-chart-canvas-wrapper {\n position: relative;\n flex: 1 1 auto;\n}\n\n.ag-chart-menu {\n position: absolute;\n top: 16px;\n display: flex;\n flex-direction: column;\n}\n.ag-ltr .ag-chart-menu {\n right: 20px;\n}\n.ag-rtl .ag-chart-menu {\n left: 20px;\n}\n\n.ag-chart-docked-container {\n position: relative;\n min-width: var(--ag-chart-menu-panel-width);\n}\n\n.ag-chart-menu-hidden ~ .ag-chart-docked-container {\n display: none;\n}\n\n.ag-chart-tabbed-menu {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.ag-chart-tabbed-menu-header {\n flex: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}\n\n.ag-chart-tabbed-menu-body {\n display: flex;\n flex: 1 1 auto;\n align-items: stretch;\n overflow: hidden;\n}\n\n.ag-chart-tab {\n width: 100%;\n overflow: hidden;\n overflow-y: auto;\n}\n\n.ag-chart-settings {\n overflow-x: hidden;\n}\n\n.ag-chart-settings-wrapper {\n position: relative;\n flex-direction: column;\n width: 100%;\n height: 100%;\n display: flex;\n overflow: hidden;\n}\n\n.ag-chart-settings-nav-bar {\n display: flex;\n align-items: center;\n width: 100%;\n height: 30px;\n padding: 0 10px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-chart-settings-card-selector {\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex: 1 1 auto;\n height: 100%;\n padding: 0 10px;\n}\n\n.ag-chart-settings-card-item {\n cursor: pointer;\n width: 10px;\n height: 10px;\n background-color: #000;\n position: relative;\n}\n.ag-chart-settings-card-item.ag-not-selected {\n opacity: 0.2;\n}\n.ag-chart-settings-card-item::before {\n content: " ";\n display: block;\n position: absolute;\n background-color: transparent;\n left: 50%;\n top: 50%;\n margin-left: -10px;\n margin-top: -10px;\n width: 20px;\n height: 20px;\n}\n\n.ag-chart-settings-prev,\n.ag-chart-settings-next {\n position: relative;\n flex: none;\n}\n.ag-chart-settings-prev:focus-within,\n.ag-chart-settings-next:focus-within {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-radius: 1px;\n}\n\n.ag-chart-settings-prev-button,\n.ag-chart-settings-next-button {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n opacity: 0;\n}\n\n.ag-chart-settings-mini-charts-container {\n position: relative;\n flex: 1 1 auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.ag-chart-settings-mini-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n width: 100%;\n min-height: 100%;\n overflow: hidden;\n}\n.ag-chart-settings-mini-wrapper.ag-animating {\n transition: left 0.3s;\n transition-timing-function: ease-in-out;\n}\n\n.ag-chart-mini-thumbnail {\n cursor: pointer;\n}\n\n.ag-chart-mini-thumbnail-canvas {\n display: block;\n}\n\n.ag-chart-data-wrapper,\n.ag-chart-format-wrapper,\n.ag-chart-advanced-settings-wrapper {\n display: flex;\n flex-direction: column;\n position: relative;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n padding-bottom: 16px;\n}\n\n.ag-chart-data-wrapper,\n.ag-chart-advanced-settings-wrapper {\n height: 100%;\n overflow-y: auto;\n}\n\n.ag-chart-advanced-settings {\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-chart-advanced-settings-wrapper,\n.ag-chart-advanced-settings {\n width: 100%;\n}\n\n.ag-chart-advanced-settings-wrapper {\n padding-bottom: 0;\n}\n\n.ag-chart-data-section,\n.ag-chart-format-section,\n.ag-chart-advanced-settings-section {\n display: flex;\n margin: 0;\n}\n\n.ag-chart-advanced-settings-section {\n padding-top: var(--ag-grid-size);\n padding-bottom: var(--ag-grid-size);\n}\n.ag-chart-advanced-settings-section:not(:last-child) {\n border-bottom: 1px solid var(--ag-secondary-border-color);\n}\n\n.ag-chart-empty-text {\n display: flex;\n top: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n background-color: var(--ag-background-color);\n}\n\n.ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\n display: flex;\n flex-direction: row;\n top: 8px;\n gap: 20px;\n width: auto;\n}\n.ag-ltr .ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\n right: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\n justify-content: right;\n}\n.ag-rtl .ag-chart .ag-chart-menu-wrapper .ag-chart-menu {\n left: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\n justify-content: left;\n}\n\n.ag-charts-font-size-color {\n display: flex;\n align-self: stretch;\n justify-content: space-between;\n}\n\n.ag-charts-data-group-item {\n position: relative;\n}\n\n.ag-charts-data-group-item:not(:last-child) {\n margin-bottom: var(--ag-grid-size);\n}\n\n.ag-chart-menu {\n border-radius: var(--ag-card-radius);\n background: var(--ag-background-color);\n}\n\n.ag-chart-menu-icon {\n opacity: 0.5;\n margin: 2px 0;\n cursor: pointer;\n border-radius: var(--ag-card-radius);\n color: var(--ag-secondary-foreground-color);\n}\n.ag-chart-menu-icon:hover {\n opacity: 1;\n}\n\n.ag-chart-menu-toolbar-button {\n border: 0;\n background-color: unset;\n padding: 0 2px;\n border-radius: 1px;\n}\n\n.ag-chart-mini-thumbnail {\n border: 1px solid var(--ag-secondary-border-color);\n border-radius: 5px;\n padding: 1px;\n}\n.ag-chart-mini-thumbnail.ag-selected {\n border-color: var(--ag-minichart-selected-chart-color);\n border-width: 2px;\n padding: unset;\n}\n.ag-chart-mini-thumbnail:focus-visible {\n outline: none;\n border-color: var(--ag-minichart-selected-chart-color);\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n\n.ag-chart-settings-card-item {\n background: var(--ag-foreground-color);\n width: 8px;\n height: 8px;\n border-radius: 4px;\n}\n.ag-chart-settings-card-item.ag-selected {\n background-color: var(--ag-minichart-selected-page-color);\n}\n\n.ag-chart-data-column-drag-handle {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-charts-settings-group-title-bar,\n.ag-charts-data-group-title-bar,\n.ag-charts-format-top-level-group-title-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n position: relative;\n}\n\n.ag-charts-advanced-settings-top-level-group-title-bar {\n position: relative;\n background-color: unset;\n}\n\n.ag-charts-data-group-title-bar:focus-visible {\n outline: none;\n}\n.ag-charts-data-group-title-bar:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-charts-format-top-level-group-title-bar:focus-visible {\n outline: none;\n}\n.ag-charts-format-top-level-group-title-bar:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-charts-data-group-title-bar .ag-charts-data-group-title,\n.ag-charts-format-top-level-group-title-bar .ag-charts-format-top-level-group-title {\n cursor: pointer;\n}\n\n.ag-charts-data-group-container {\n padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) var(--ag-widget-container-horizontal-padding);\n}\n.ag-charts-data-group-container .ag-charts-data-group-item:not(.ag-charts-format-sub-level-group):not(.ag-pill-select):not(.ag-select) {\n height: var(--ag-list-item-height);\n}\n.ag-charts-data-group-container .ag-charts-data-group-item.ag-picker-field {\n margin-top: var(--ag-grid-size);\n}\n.ag-charts-data-group-container .ag-list-item-hovered::after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n}\n.ag-charts-data-group-container .ag-item-highlight-top::after {\n top: 0;\n}\n.ag-charts-data-group-container .ag-item-highlight-bottom::after {\n bottom: 0;\n}\n\n.ag-charts-format-top-level-group-container,\n.ag-charts-advanced-settings-top-level-group-container {\n padding: var(--ag-grid-size);\n}\n.ag-ltr .ag-charts-format-top-level-group-container,\n.ag-ltr .ag-charts-advanced-settings-top-level-group-container {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-charts-format-top-level-group-container,\n.ag-rtl .ag-charts-advanced-settings-top-level-group-container {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-charts-format-top-level-group-item,\n.ag-charts-advanced-settings-top-level-group-item {\n margin: var(--ag-grid-size) 0;\n}\n\n.ag-charts-format-sub-level-group-container {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n}\n.ag-charts-format-sub-level-group-container > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-charts-format-sub-level-no-header-group-container > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-charts-format-sub-level-group-container .ag-charts-format-sub-level-group-item.ag-font-panel-no-header {\n margin: 0;\n}\n\n.ag-charts-settings-group-container {\n padding: var(--ag-grid-size);\n row-gap: 8px;\n display: grid;\n grid-template-columns: 60px 1fr 60px 1fr 60px;\n}\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+1) {\n grid-column: 1;\n}\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+2) {\n grid-column: 3;\n}\n.ag-charts-settings-group-container .ag-chart-mini-thumbnail:nth-child(3n+3) {\n grid-column: 5;\n}\n\n.ag-chart-menu-panel {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-ltr .ag-chart-menu-panel {\n border-left: solid 1px var(--ag-border-color);\n}\n.ag-rtl .ag-chart-menu-panel {\n border-right: solid 1px var(--ag-border-color);\n}\n\n.ag-date-time-list-page-title-bar {\n display: flex;\n}\n\n.ag-date-time-list-page-title {\n flex-grow: 1;\n text-align: center;\n}\n\n.ag-date-time-list-page-column-labels-row,\n.ag-date-time-list-page-entries-row {\n display: flex;\n}\n\n.ag-date-time-list-page-column-label,\n.ag-date-time-list-page-entry {\n flex-basis: 0;\n flex-grow: 1;\n}\n\n.ag-date-time-list-page-entry {\n cursor: pointer;\n text-align: center;\n}\n\n.ag-date-time-list-page-column-label {\n text-align: center;\n}\n\n.ag-advanced-filter-header {\n position: relative;\n display: flex;\n align-items: center;\n padding-left: var(--ag-cell-horizontal-padding);\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-advanced-filter {\n display: flex;\n align-items: center;\n width: 100%;\n}\n\n.ag-advanced-filter-buttons {\n display: contents;\n}\n\n.ag-advanced-filter-builder-button {\n display: flex;\n align-items: center;\n border: 0;\n background-color: unset;\n color: var(--ag-foreground-color);\n font-size: var(--ag-font-size);\n font-weight: 600;\n line-height: normal;\n white-space: nowrap;\n}\n.ag-ltr .ag-advanced-filter-builder-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-advanced-filter-builder-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-advanced-filter-builder-button:hover:not(:disabled) {\n background-color: var(--ag-row-hover-color);\n}\n.ag-advanced-filter-builder-button:not(:disabled) {\n cursor: pointer;\n}\n\n.ag-advanced-filter-builder-button-label {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-advanced-filter-builder {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n width: 100%;\n background-color: var(--ag-control-panel-background-color);\n display: flex;\n flex-direction: column;\n}\n\n.ag-advanced-filter-builder-list {\n flex: 1;\n overflow: auto;\n}\n.ag-advanced-filter-builder-list .ag-list-item-hovered::after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n}\n.ag-advanced-filter-builder-list .ag-item-highlight-top::after {\n top: 0;\n}\n.ag-advanced-filter-builder-list .ag-item-highlight-bottom::after {\n bottom: 0;\n}\n\n.ag-advanced-filter-builder-button-panel {\n display: flex;\n justify-content: flex-end;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-advanced-filter-builder .ag-advanced-filter-builder-button-panel .ag-advanced-filter-builder-apply-button,\n.ag-advanced-filter-builder .ag-advanced-filter-builder-button-panel .ag-advanced-filter-builder-cancel-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-advanced-filter-builder-item-wrapper {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: space-between;\n overflow: hidden;\n padding-left: calc(var(--ag-icon-size) / 2);\n padding-right: var(--ag-icon-size);\n}\n\n.ag-virtual-list-viewport .ag-advanced-filter-builder-item-wrapper .ag-tab-guard {\n position: absolute;\n}\n\n.ag-advanced-filter-builder-item-tree-lines > * {\n width: var(--ag-advanced-filter-builder-indent-size);\n}\n\n.ag-advanced-filter-builder-item-tree-lines .ag-advanced-filter-builder-item-tree-line-root {\n width: var(--ag-icon-size);\n}\n.ag-advanced-filter-builder-item-tree-lines .ag-advanced-filter-builder-item-tree-line-root::before {\n top: 50%;\n height: 50%;\n}\n\n.ag-advanced-filter-builder-item-tree-line-horizontal,\n.ag-advanced-filter-builder-item-tree-line-vertical,\n.ag-advanced-filter-builder-item-tree-line-vertical-top,\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom {\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n}\n.ag-advanced-filter-builder-item-tree-line-horizontal::before, .ag-advanced-filter-builder-item-tree-line-horizontal::after,\n.ag-advanced-filter-builder-item-tree-line-vertical::before,\n.ag-advanced-filter-builder-item-tree-line-vertical::after,\n.ag-advanced-filter-builder-item-tree-line-vertical-top::before,\n.ag-advanced-filter-builder-item-tree-line-vertical-top::after,\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::before,\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::after {\n content: "";\n position: absolute;\n height: 100%;\n}\n\n.ag-advanced-filter-builder-item-tree-line-horizontal::after {\n height: 50%;\n width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size));\n top: 0;\n left: calc(var(--ag-icon-size) / 2);\n border-bottom: 1px solid;\n border-color: var(--ag-border-color);\n}\n\n.ag-advanced-filter-builder-item-tree-line-vertical::before {\n width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size) / 2);\n top: 0;\n left: calc(var(--ag-icon-size) / 2);\n border-left: 1px solid;\n border-color: var(--ag-border-color);\n}\n\n.ag-advanced-filter-builder-item-tree-line-vertical-top::before {\n height: 50%;\n width: calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size) / 2);\n top: 0;\n left: calc(var(--ag-icon-size) / 2);\n border-left: 1px solid;\n border-color: var(--ag-border-color);\n}\n\n.ag-advanced-filter-builder-item-tree-line-vertical-bottom::before {\n height: calc((100% - 1.5 * var(--ag-icon-size)) / 2);\n width: calc(var(--ag-icon-size) / 2);\n top: calc((100% + 1.5 * var(--ag-icon-size)) / 2);\n left: calc(var(--ag-icon-size) / 2);\n border-left: 1px solid;\n border-color: var(--ag-border-color);\n}\n\n.ag-advanced-filter-builder-item-condition {\n padding-top: var(--ag-grid-size);\n padding-bottom: var(--ag-grid-size);\n}\n\n.ag-advanced-filter-builder-item,\n.ag-advanced-filter-builder-item-condition,\n.ag-advanced-filter-builder-pill-wrapper,\n.ag-advanced-filter-builder-pill,\n.ag-advanced-filter-builder-item-buttons,\n.ag-advanced-filter-builder-item-tree-lines {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.ag-advanced-filter-builder-pill-wrapper {\n margin: 0px var(--ag-grid-size);\n}\n\n.ag-advanced-filter-builder-pill {\n position: relative;\n border-radius: var(--ag-border-radius);\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n min-height: calc(100% - var(--ag-grid-size) * 3);\n min-width: calc(var(--ag-grid-size) * 2);\n}\n.ag-advanced-filter-builder-pill .ag-picker-field-display {\n margin-right: var(--ag-grid-size);\n}\n.ag-advanced-filter-builder-pill .ag-advanced-filter-builder-value-number {\n font-family: monospace;\n font-weight: 700;\n}\n.ag-advanced-filter-builder-pill .ag-advanced-filter-builder-value-empty {\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-advanced-filter-builder-pill:focus-visible {\n outline: none;\n}\n.ag-advanced-filter-builder-pill:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: -4px;\n left: -4px;\n display: block;\n width: calc(100% - -8px);\n height: calc(100% - -8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-advanced-filter-builder-item-button:focus-visible {\n outline: none;\n}\n.ag-advanced-filter-builder-item-button:focus-visible::after {\n content: "";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: -4px;\n left: -4px;\n display: block;\n width: calc(100% - -8px);\n height: calc(100% - -8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-advanced-filter-builder-pill-display {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 500;\n}\n\n.ag-advanced-filter-builder-join-pill {\n color: var(--ag-foreground-color);\n background-color: var(--ag-advanced-filter-join-pill-color);\n cursor: pointer;\n}\n\n.ag-advanced-filter-builder-column-pill {\n color: var(--ag-foreground-color);\n background-color: var(--ag-advanced-filter-column-pill-color);\n cursor: pointer;\n}\n\n.ag-advanced-filter-builder-option-pill {\n color: var(--ag-foreground-color);\n background-color: var(--ag-advanced-filter-option-pill-color);\n cursor: pointer;\n}\n\n.ag-advanced-filter-builder-value-pill {\n color: var(--ag-foreground-color);\n background-color: var(--ag-advanced-filter-value-pill-color);\n cursor: text;\n max-width: 140px;\n}\n.ag-advanced-filter-builder-value-pill .ag-advanced-filter-builder-pill-display {\n display: block;\n}\n\n.ag-advanced-filter-builder-item-buttons > * {\n margin: 0 calc(var(--ag-grid-size) * 0.5);\n}\n\n.ag-advanced-filter-builder-item-button {\n position: relative;\n cursor: pointer;\n color: var(--ag-secondary-foreground-color);\n opacity: 50%;\n}\n\n.ag-advanced-filter-builder-item-button-disabled {\n color: var(--ag-disabled-foreground-color);\n cursor: default;\n}\n\n.ag-advanced-filter-builder-virtual-list-container {\n top: var(--ag-grid-size);\n}\n\n.ag-advanced-filter-builder-virtual-list-item {\n display: flex;\n cursor: default;\n height: var(--ag-list-item-height);\n}\n.ag-advanced-filter-builder-virtual-list-item:hover {\n background-color: var(--ag-row-hover-color);\n}\n.ag-advanced-filter-builder-virtual-list-item:hover .ag-advanced-filter-builder-item-button {\n opacity: 100%;\n}\n\n.ag-advanced-filter-builder-virtual-list-item-highlight .ag-advanced-filter-builder-item-button:focus-visible,\n.ag-advanced-filter-builder-validation .ag-advanced-filter-builder-invalid {\n opacity: 100%;\n}\n\n.ag-advanced-filter-builder-invalid {\n margin: 0 var(--ag-grid-size);\n color: var(--ag-invalid-color);\n cursor: default;\n}\n\n.ag-row-number-cell {\n background-color: var(--ag-header-background-color);\n color: var(--ag-header-foreground-color);\n font-size: var(--ag-font-size);\n font-family: var(--ag-font-family);\n}\n\n.ag-row-number-header.ag-row-number-selection-enabled {\n cursor: cell;\n}\n\n.ag-row-number-range-highlight {\n background-color: var(--ag-range-header-highlight-color);\n}\n\n.ag-row-number-range-selected {\n background-color: var(--ag-row-numbers-selected-color);\n}\n\n.ag-ltr .ag-row-number-header,\n.ag-ltr .ag-cell.ag-row-number-cell:not(.ag-cell-last-left-pinned) {\n border-right: var(--ag-pinned-column-border);\n}\n.ag-ltr .ag-cell.ag-row-number-cell.ag-row-number-selection-enabled {\n cursor: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjU7Ij4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEuNTc4NCwwLDAsMS44NjQyOSwtNC40MTM0OSwtNy4yMTIxMikiPgogICAgICAgIDxwYXRoIGQ9Ik0zLjQ0NSw4LjkxMUwzLjQ0NSw3LjQwOUw5Ljc1LDcuNDA5TDkuNzUsNi4wMTRMMTIuMjg1LDguMTZMOS43NSwxMC4zMDZMOS43NSw4LjkxMUwzLjQ0NSw4LjkxMVoiIHN0eWxlPSJzdHJva2U6d2hpdGU7c3Ryb2tlLXdpZHRoOjAuNDFweDsiLz4KICAgIDwvZz4KPC9zdmc+Cg=="), auto;\n}\n\n.ag-rtl .ag-row-number-header,\n.ag-rtl .ag-cell.ag-row-number-cell:not(.ag-cell-first-right-pinned) {\n border-left: var(--ag-pinned-column-border);\n}\n.ag-rtl .ag-cell.ag-row-number-cell.ag-row-number-selection-enabled {\n cursor: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjU7Ij4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEuNTc4NCwwLDAsMS44NjQyOSwtNC40MTM0OSwtNy4yMTIxMikiPgogICAgICAgIDxwYXRoIGQ9Ik01Ljk3OSw4LjkxMUw1Ljk3OSwxMC4zMDZMMy40NDUsOC4xNkw1Ljk3OSw2LjAxNEw1Ljk3OSw3LjQwOUwxMi4yODUsNy40MDlMMTIuMjg1LDguOTExTDUuOTc5LDguOTExWiIgc3R5bGU9InN0cm9rZTp3aGl0ZTtzdHJva2Utd2lkdGg6MC40MXB4OyIvPgogICAgPC9nPgo8L3N2Zz4K"), auto;\n}\n\n.ag-cell-batch-edit {\n background-color: var(--ag-cell-batch-edit-background-color);\n color: var(--ag-cell-batch-edit-text-color);\n}\n\n.ag-cell.ag-cell-inline-editing {\n background-color: var(--ag-background-color);\n background-image: linear-gradient(0deg, var(--ag-input-background-color), var(--ag-input-background-color));\n}\n\n.ag-row-batch-edit {\n background-color: var(--ag-row-batch-edit-background-color);\n color: var(--ag-row-batch-edit-text-color);\n}\n\n.ag-input-field-input {\n width: 100%;\n min-width: 0;\n}\n\n.ag-checkbox-input-wrapper {\n font-family: var(--ag-icon-font-family);\n font-weight: var(--ag-icon-font-weight);\n color: var(--ag-icon-font-color);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-checkbox-background-color);\n border-radius: var(--ag-checkbox-border-radius);\n display: inline-block;\n vertical-align: middle;\n flex: none;\n}\n.ag-checkbox-input-wrapper input,\n.ag-checkbox-input-wrapper input {\n -webkit-appearance: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n}\n.ag-checkbox-input-wrapper:focus-within, .ag-checkbox-input-wrapper:active {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within, .ag-cell-editing-error .ag-checkbox-input-wrapper:active {\n box-shadow: var(--ag-input-error-focus-box-shadow);\n}\n.ag-checkbox-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-checkbox-input-wrapper::after {\n content: var(--ag-icon-font-code-checkbox-unchecked, "\\f108");\n font-family: inherit;\n color: var(--ag-checkbox-unchecked-color);\n display: var(--ag-icon-font-display-checkbox-unchecked, var(--ag-icon-font-display));\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-checkbox-input-wrapper.ag-checked::after {\n content: var(--ag-icon-font-code-checkbox-checked, "\\f106");\n color: var(--ag-checkbox-checked-color);\n display: var(--ag-icon-font-display-checkbox-checked, var(--ag-icon-font-display));\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-checkbox-input-wrapper.ag-indeterminate::after {\n content: var(--ag-icon-font-code-checkbox-indeterminate, "\\f107");\n color: var(--ag-checkbox-indeterminate-color);\n display: var(--ag-icon-font-display-checkbox-indeterminate, var(--ag-icon-font-display));\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-checkbox-input-wrapper::before {\n content: "";\n background: transparent center/contain no-repeat;\n position: absolute;\n inset: 0;\n background-image: var(--ag-icon-image-checkbox-unchecked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-unchecked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-unchecked, var(--ag-icon-image-opacity, 0.9));\n}\n.ag-checkbox-input-wrapper.ag-checked::before {\n background-image: var(--ag-icon-image-checkbox-checked, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-checked, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-checked, var(--ag-icon-image-opacity, 0.9));\n}\n.ag-checkbox-input-wrapper.ag-indeterminate::before {\n background-image: var(--ag-icon-image-checkbox-indeterminate, var(--ag-icon-image));\n display: var(--ag-icon-image-display-checkbox-indeterminate, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-checkbox-indeterminate, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-toggle-button-input-wrapper {\n box-sizing: border-box;\n width: var(--ag-toggle-button-width);\n min-width: var(--ag-toggle-button-width);\n max-width: var(--ag-toggle-button-width);\n height: var(--ag-toggle-button-height);\n background-color: var(--ag-toggle-button-off-background-color);\n border-radius: calc(var(--ag-toggle-button-height) * 0.5);\n position: relative;\n flex: none;\n border: var(--ag-toggle-button-border-width) solid;\n border-color: var(--ag-toggle-button-off-border-color);\n}\n.ag-toggle-button-input-wrapper input {\n opacity: 0;\n height: 100%;\n width: 100%;\n}\n.ag-toggle-button-input-wrapper:focus-within {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-toggle-button-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-toggle-button-input-wrapper.ag-checked {\n background-color: var(--ag-toggle-button-on-background-color);\n border-color: var(--ag-toggle-button-on-border-color);\n}\n.ag-toggle-button-input-wrapper::before {\n content: " ";\n position: absolute;\n top: calc(0px - var(--ag-toggle-button-border-width));\n left: calc(0px - var(--ag-toggle-button-border-width));\n display: block;\n box-sizing: border-box;\n height: var(--ag-toggle-button-height);\n width: var(--ag-toggle-button-height);\n background-color: var(--ag-toggle-button-switch-background-color);\n border-radius: 100%;\n transition: left 100ms;\n border: var(--ag-toggle-button-border-width) solid;\n border-color: var(--ag-toggle-button-switch-border-color);\n}\n.ag-toggle-button-input-wrapper.ag-checked::before {\n left: calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-border-width));\n border-color: var(--ag-toggle-button-on-border-color);\n}\n\n.ag-radio-button-input-wrapper {\n font-family: var(--ag-icon-font-family);\n font-weight: var(--ag-icon-font-weight);\n color: var(--ag-icon-font-color);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-checkbox-background-color);\n border-radius: var(--ag-checkbox-border-radius);\n display: inline-block;\n vertical-align: middle;\n flex: none;\n border-radius: var(--ag-icon-size);\n}\n.ag-radio-button-input-wrapper input,\n.ag-radio-button-input-wrapper input {\n -webkit-appearance: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n}\n.ag-radio-button-input-wrapper:focus-within, .ag-radio-button-input-wrapper:active {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-cell-editing-error .ag-radio-button-input-wrapper:focus-within, .ag-cell-editing-error .ag-radio-button-input-wrapper:active {\n box-shadow: var(--ag-input-error-focus-box-shadow);\n}\n.ag-radio-button-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-radio-button-input-wrapper::after {\n content: var(--ag-icon-font-code-radio-button-off, "\\f127");\n color: var(--ag-checkbox-unchecked-color);\n display: var(--ag-icon-font-display-radio-button-off, var(--ag-icon-font-display));\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-radio-button-input-wrapper.ag-checked::after {\n content: var(--ag-icon-font-code-radio-button-on, "\\f128");\n color: var(--ag-checkbox-checked-color);\n display: var(--ag-icon-font-display-radio-button-on, var(--ag-icon-font-display));\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-radio-button-input-wrapper::before {\n content: "";\n background: transparent center/contain no-repeat;\n position: absolute;\n inset: 0;\n background-image: var(--ag-icon-image-radio-button-off, var(--ag-icon-image));\n display: var(--ag-icon-image-display-radio-button-off, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-radio-button-off, var(--ag-icon-image-opacity, 0.9));\n}\n.ag-radio-button-input-wrapper.ag-checked::before {\n background-image: var(--ag-icon-image-radio-button-on, var(--ag-icon-image));\n display: var(--ag-icon-image-display-radio-button-on, var(--ag-icon-image-display));\n opacity: var(--ag-icon-image-opacity-radio-button-on, var(--ag-icon-image-opacity, 0.9));\n}\n\n.ag-range-field-input {\n -webkit-appearance: none;\n width: 100%;\n height: 100%;\n background: none;\n overflow: visible;\n}\n.ag-range-field-input::-webkit-slider-runnable-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n}\n.ag-range-field-input::-moz-range-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n}\n.ag-range-field-input::-ms-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n color: transparent;\n width: calc(100% - 2px);\n}\n.ag-range-field-input::-webkit-slider-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n transform: translateY(calc(var(--ag-icon-size) * -0.5 + 1.5px));\n}\n.ag-range-field-input::-ms-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n}\n.ag-range-field-input::-moz-ag-range-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n}\n.ag-range-field-input:focus {\n outline: none;\n}\n.ag-range-field-input:focus::-webkit-slider-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\n.ag-range-field-input:focus::-ms-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\n.ag-range-field-input:focus::-moz-ag-range-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\n.ag-range-field-input:active::-webkit-slider-runnable-track {\n background-color: var(--ag-input-focus-border-color);\n}\n.ag-range-field-input:active::-moz-ag-range-track {\n background-color: var(--ag-input-focus-border-color);\n}\n.ag-range-field-input:active::-ms-track {\n background-color: var(--ag-input-focus-border-color);\n}\n.ag-range-field-input:disabled {\n opacity: 0.5;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-alpine-no-font.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '.ag-theme-alpine,\n.ag-theme-alpine-dark,\n.ag-theme-alpine-auto-dark {\n --ag-alpine-active-color: #2196f3;\n --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\n --ag-row-hover-color: rgba(33, 150, 243, 0.1);\n --ag-column-hover-color: rgba(33, 150, 243, 0.1);\n --ag-input-focus-border-color: rgba(33, 150, 243, 0.4);\n --ag-range-selection-background-color: rgba(33, 150, 243, 0.2);\n --ag-range-selection-background-color-2: rgba(33, 150, 243, 0.36);\n --ag-range-selection-background-color-3: rgba(33, 150, 243, 0.49);\n --ag-range-selection-background-color-4: rgba(33, 150, 243, 0.59);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-alpine-active-color) 50%);\n --ag-background-color: #fff;\n --ag-foreground-color: #181d1f;\n --ag-border-color: #babfc7;\n --ag-secondary-border-color: #dde2eb;\n --ag-header-background-color: #f8f8f8;\n --ag-tooltip-background-color: #f8f8f8;\n --ag-odd-row-background-color: #fcfcfc;\n --ag-control-panel-background-color: #f8f8f8;\n --ag-subheader-background-color: #fff;\n --ag-invalid-color: #e02525;\n --ag-checkbox-unchecked-color: #999;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-checkbox-checked-color: var(--ag-alpine-active-color);\n --ag-range-selection-border-color: var(--ag-alpine-active-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-input-focus-box-shadow: 0 0 2px 0.1rem var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.1rem var(--ag-invalid-color);\n --ag-panel-background-color: var(--ag-header-background-color);\n --ag-menu-background-color: var(--ag-header-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-alpine-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-alpine-active-color);\n --ag-column-drag-indicator-color: var(--ag-alpine-active-color);\n --ag-disabled-foreground-color: rgba(24, 29, 31, 0.5);\n --ag-chip-background-color: rgba(24, 29, 31, 0.07);\n --ag-input-disabled-border-color: rgba(186, 191, 199, 0.3);\n --ag-input-disabled-background-color: rgba(186, 191, 199, 0.15);\n --ag-borders: solid 1px;\n --ag-border-radius: 3px;\n --ag-borders-side-button: none;\n --ag-side-button-selected-background-color: transparent;\n --ag-header-column-resize-handle-display: block;\n --ag-header-column-resize-handle-width: 2px;\n --ag-header-column-resize-handle-height: 30%;\n --ag-grid-size: 6px;\n --ag-icon-size: 16px;\n --ag-row-height: calc(var(--ag-grid-size) * 7);\n --ag-header-height: calc(var(--ag-grid-size) * 8);\n --ag-list-item-height: calc(var(--ag-grid-size) * 4);\n --ag-column-select-indent-size: var(--ag-icon-size);\n --ag-set-filter-indent-size: var(--ag-icon-size);\n --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-toggle-button-height: 18px;\n --ag-toggle-button-width: 28px;\n --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 13px;\n --ag-icon-font-family: agGridAlpine;\n --ag-selected-tab-underline-color: var(--ag-alpine-active-color);\n --ag-selected-tab-underline-width: 2px;\n --ag-selected-tab-underline-transition-speed: 0.3s;\n --ag-tab-min-width: 240px;\n --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\n --ag-popup-shadow: var(--ag-card-shadow);\n --ag-side-bar-panel-width: 250px;\n}\n\n.ag-theme-alpine-dark {\n --ag-background-color: #181d1f;\n --ag-foreground-color: #fff;\n --ag-border-color: #68686e;\n --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\n --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\n --ag-header-background-color: #222628;\n --ag-tooltip-background-color: #222628;\n --ag-odd-row-background-color: #222628;\n --ag-control-panel-background-color: #222628;\n --ag-subheader-background-color: #000;\n --ag-input-disabled-background-color: #282c2f;\n --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5),\n 0 0 4px 3px color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\n --ag-chip-background-color: rgba(255, 255, 255, 0.07);\n --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\n --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-alpine-auto-dark {\n --ag-background-color: #181d1f;\n --ag-foreground-color: #fff;\n --ag-border-color: #68686e;\n --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\n --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\n --ag-header-background-color: #222628;\n --ag-tooltip-background-color: #222628;\n --ag-odd-row-background-color: #222628;\n --ag-control-panel-background-color: #222628;\n --ag-subheader-background-color: #000;\n --ag-input-disabled-background-color: #282c2f;\n --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5),\n 0 0 4px 3px color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\n --ag-chip-background-color: rgba(255, 255, 255, 0.07);\n --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\n --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-alpine .ag-filter-toolpanel-header,\n.ag-theme-alpine .ag-filter-toolpanel-search,\n.ag-theme-alpine .ag-status-bar,\n.ag-theme-alpine .ag-header-row,\n.ag-theme-alpine .ag-row-number-cell,\n.ag-theme-alpine .ag-panel-title-bar-title,\n.ag-theme-alpine .ag-multi-filter-group-title-bar,\n.ag-theme-alpine .ag-filter-card-title,\n.ag-theme-alpine-dark .ag-filter-toolpanel-header,\n.ag-theme-alpine-dark .ag-filter-toolpanel-search,\n.ag-theme-alpine-dark .ag-status-bar,\n.ag-theme-alpine-dark .ag-header-row,\n.ag-theme-alpine-dark .ag-row-number-cell,\n.ag-theme-alpine-dark .ag-panel-title-bar-title,\n.ag-theme-alpine-dark .ag-multi-filter-group-title-bar,\n.ag-theme-alpine-dark .ag-filter-card-title,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-alpine-auto-dark .ag-status-bar,\n.ag-theme-alpine-auto-dark .ag-header-row,\n.ag-theme-alpine-auto-dark .ag-row-number-cell,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-title,\n.ag-theme-alpine-auto-dark .ag-multi-filter-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-filter-card-title {\n font-weight: 700;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-alpine .ag-row,\n.ag-theme-alpine-dark .ag-row,\n.ag-theme-alpine-auto-dark .ag-row {\n font-size: calc(var(--ag-font-size) + 1px);\n}\n.ag-theme-alpine input[class^=ag-]:not([type]),\n.ag-theme-alpine input[class^=ag-][type=text],\n.ag-theme-alpine input[class^=ag-][type=number],\n.ag-theme-alpine input[class^=ag-][type=tel],\n.ag-theme-alpine input[class^=ag-][type=date],\n.ag-theme-alpine input[class^=ag-][type=datetime-local],\n.ag-theme-alpine textarea[class^=ag-],\n.ag-theme-alpine-dark input[class^=ag-]:not([type]),\n.ag-theme-alpine-dark input[class^=ag-][type=text],\n.ag-theme-alpine-dark input[class^=ag-][type=number],\n.ag-theme-alpine-dark input[class^=ag-][type=tel],\n.ag-theme-alpine-dark input[class^=ag-][type=date],\n.ag-theme-alpine-dark input[class^=ag-][type=datetime-local],\n.ag-theme-alpine-dark textarea[class^=ag-],\n.ag-theme-alpine-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-alpine-auto-dark input[class^=ag-][type=text],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=number],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=tel],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=date],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-alpine-auto-dark textarea[class^=ag-] {\n min-height: calc(var(--ag-grid-size) * 4);\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-alpine .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-ltr textarea[class^=ag-], .ag-theme-alpine-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-ltr textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-rtl textarea[class^=ag-], .ag-theme-alpine-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-rtl textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-tab,\n.ag-theme-alpine-dark .ag-tab,\n.ag-theme-alpine-auto-dark .ag-tab {\n padding: calc(var(--ag-grid-size) * 1.5);\n transition: color 0.4s;\n flex: 1 1 auto;\n}\n.ag-theme-alpine .ag-tab-selected,\n.ag-theme-alpine-dark .ag-tab-selected,\n.ag-theme-alpine-auto-dark .ag-tab-selected {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-menu,\n.ag-theme-alpine-dark .ag-menu,\n.ag-theme-alpine-auto-dark .ag-menu {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-alpine-dark .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-alpine-auto-dark .ag-panel-content-wrapper .ag-column-select {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-menu-header,\n.ag-theme-alpine-dark .ag-menu-header,\n.ag-theme-alpine-auto-dark .ag-menu-header {\n background-color: var(--ag-control-panel-background-color);\n padding-top: 1px;\n}\n.ag-theme-alpine .ag-tabs-header,\n.ag-theme-alpine-dark .ag-tabs-header,\n.ag-theme-alpine-auto-dark .ag-tabs-header {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n.ag-theme-alpine .ag-charts-settings-group-title-bar,\n.ag-theme-alpine .ag-charts-data-group-title-bar,\n.ag-theme-alpine .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-settings-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-data-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar {\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n line-height: calc(var(--ag-icon-size) + var(--ag-grid-size) - 2px);\n}\n.ag-theme-alpine .ag-chart-mini-thumbnail,\n.ag-theme-alpine-dark .ag-chart-mini-thumbnail,\n.ag-theme-alpine-auto-dark .ag-chart-mini-thumbnail {\n background-color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-chart-settings-nav-bar,\n.ag-theme-alpine-dark .ag-chart-settings-nav-bar,\n.ag-theme-alpine-auto-dark .ag-chart-settings-nav-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-alpine .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-ltr .ag-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-rtl .ag-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-toolbar,\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-toolbar,\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-toolbar {\n margin-top: var(--ag-grid-size);\n}\n.ag-theme-alpine .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar {\n padding-left: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar {\n padding-right: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-charts-format-sub-level-group,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n padding-left: var(--ag-grid-size);\n margin-bottom: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding-top: 0;\n padding-bottom: 0;\n background: none;\n font-weight: 700;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-container,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-container {\n padding-bottom: 0;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-item:last-child {\n margin-bottom: 0;\n}\n.ag-theme-alpine.ag-dnd-ghost,\n.ag-theme-alpine-dark.ag-dnd-ghost,\n.ag-theme-alpine-auto-dark.ag-dnd-ghost {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 700;\n}\n.ag-theme-alpine .ag-side-buttons,\n.ag-theme-alpine-dark .ag-side-buttons,\n.ag-theme-alpine-auto-dark .ag-side-buttons {\n width: calc(var(--ag-grid-size) * 5);\n}\n.ag-theme-alpine .ag-standard-button,\n.ag-theme-alpine-dark .ag-standard-button,\n.ag-theme-alpine-auto-dark .ag-standard-button {\n font-family: inherit;\n appearance: none;\n -webkit-appearance: none;\n border-radius: var(--ag-border-radius);\n border: 1px solid;\n border-color: var(--ag-alpine-active-color);\n color: var(--ag-alpine-active-color);\n background-color: var(--ag-background-color);\n font-weight: 600;\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-standard-button:hover,\n.ag-theme-alpine-dark .ag-standard-button:hover,\n.ag-theme-alpine-auto-dark .ag-standard-button:hover {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-row-hover-color);\n}\n.ag-theme-alpine .ag-standard-button:active,\n.ag-theme-alpine-dark .ag-standard-button:active,\n.ag-theme-alpine-auto-dark .ag-standard-button:active {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-alpine-active-color);\n color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-standard-button:disabled,\n.ag-theme-alpine-dark .ag-standard-button:disabled,\n.ag-theme-alpine-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-alpine .ag-column-drop-vertical,\n.ag-theme-alpine-dark .ag-column-drop-vertical,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical {\n min-height: 75px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-title-bar,\n.ag-theme-alpine-dark .ag-column-drop-vertical-title-bar,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-title-bar {\n padding: calc(var(--ag-grid-size) * 2);\n padding-bottom: 0px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-empty-message,\n.ag-theme-alpine-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-empty-message {\n display: flex;\n align-items: center;\n border: dashed 1px;\n border-color: var(--ag-border-color);\n margin: calc(var(--ag-grid-size) * 2);\n padding: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-column-drop-empty-message,\n.ag-theme-alpine-dark .ag-column-drop-empty-message,\n.ag-theme-alpine-auto-dark .ag-column-drop-empty-message {\n color: var(--ag-foreground-color);\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-pill-select .ag-column-drop,\n.ag-theme-alpine-dark .ag-pill-select .ag-column-drop,\n.ag-theme-alpine-auto-dark .ag-pill-select .ag-column-drop {\n min-height: unset;\n}\n.ag-theme-alpine .ag-status-bar,\n.ag-theme-alpine-dark .ag-status-bar,\n.ag-theme-alpine-auto-dark .ag-status-bar {\n font-weight: normal;\n}\n.ag-theme-alpine .ag-status-name-value-value,\n.ag-theme-alpine-dark .ag-status-name-value-value,\n.ag-theme-alpine-auto-dark .ag-status-name-value-value {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-paging-number,\n.ag-theme-alpine .ag-paging-row-summary-panel-number,\n.ag-theme-alpine-dark .ag-paging-number,\n.ag-theme-alpine-dark .ag-paging-row-summary-panel-number,\n.ag-theme-alpine-auto-dark .ag-paging-number,\n.ag-theme-alpine-auto-dark .ag-paging-row-summary-panel-number {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-column-drop-cell-button,\n.ag-theme-alpine-dark .ag-column-drop-cell-button,\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button {\n opacity: 0.5;\n}\n.ag-theme-alpine .ag-column-drop-cell-button:hover,\n.ag-theme-alpine-dark .ag-column-drop-cell-button:hover,\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button:hover {\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-alpine-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-alpine .ag-header-cell-menu-button:hover,\n.ag-theme-alpine .ag-header-cell-filter-button:hover,\n.ag-theme-alpine .ag-side-button-button:hover,\n.ag-theme-alpine .ag-tab:hover,\n.ag-theme-alpine .ag-panel-title-bar-button:hover,\n.ag-theme-alpine .ag-header-expand-icon:hover,\n.ag-theme-alpine .ag-column-group-icons:hover,\n.ag-theme-alpine .ag-set-filter-group-icons:hover,\n.ag-theme-alpine .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine .ag-chart-settings-prev:hover,\n.ag-theme-alpine .ag-chart-settings-next:hover,\n.ag-theme-alpine .ag-group-title-bar-icon:hover,\n.ag-theme-alpine .ag-column-select-header-icon:hover,\n.ag-theme-alpine .ag-floating-filter-button-button:hover,\n.ag-theme-alpine .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine .ag-chart-menu-icon:hover,\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover,\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover,\n.ag-theme-alpine-dark .ag-side-button-button:hover,\n.ag-theme-alpine-dark .ag-tab:hover,\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover,\n.ag-theme-alpine-dark .ag-header-expand-icon:hover,\n.ag-theme-alpine-dark .ag-column-group-icons:hover,\n.ag-theme-alpine-dark .ag-set-filter-group-icons:hover,\n.ag-theme-alpine-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine-dark .ag-chart-settings-prev:hover,\n.ag-theme-alpine-dark .ag-chart-settings-next:hover,\n.ag-theme-alpine-dark .ag-group-title-bar-icon:hover,\n.ag-theme-alpine-dark .ag-column-select-header-icon:hover,\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover,\n.ag-theme-alpine-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine-dark .ag-chart-menu-icon:hover,\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover,\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover,\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover,\n.ag-theme-alpine-auto-dark .ag-tab:hover,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover,\n.ag-theme-alpine-auto-dark .ag-header-expand-icon:hover,\n.ag-theme-alpine-auto-dark .ag-column-group-icons:hover,\n.ag-theme-alpine-auto-dark .ag-set-filter-group-icons:hover,\n.ag-theme-alpine-auto-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine-auto-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-prev:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-next:hover,\n.ag-theme-alpine-auto-dark .ag-group-title-bar-icon:hover,\n.ag-theme-alpine-auto-dark .ag-column-select-header-icon:hover,\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine-auto-dark .ag-chart-menu-icon:hover {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine .ag-floating-filter-button-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover .ag-icon {\n color: inherit;\n}\n.ag-theme-alpine .ag-filter-active .ag-icon-filter,\n.ag-theme-alpine-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-alpine-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-alpine-dark .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\n opacity: 0.35;\n}\n.ag-theme-alpine .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-ltr .ag-panel-title-bar-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-rtl .ag-panel-title-bar-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-group-container {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-group-container {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-filter-toolpanel-instance-filter,\n.ag-theme-alpine-dark .ag-filter-toolpanel-instance-filter,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-instance-filter {\n border: none;\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n margin-left: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\n border-right: dashed 1px;\n border-right-color: var(--ag-border-color);\n margin-right: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-set-filter-list,\n.ag-theme-alpine-dark .ag-set-filter-list,\n.ag-theme-alpine-auto-dark .ag-set-filter-list {\n padding-top: calc(var(--ag-grid-size) * 0.5);\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-alpine .ag-filter-add-button .ag-icon,\n.ag-theme-alpine-dark .ag-filter-add-button .ag-icon,\n.ag-theme-alpine-auto-dark .ag-filter-add-button .ag-icon {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine .ag-layout-print .ag-center-cols-container,\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-alpine .ag-date-time-list-page-entry-is-current,\n.ag-theme-alpine-dark .ag-date-time-list-page-entry-is-current,\n.ag-theme-alpine-auto-dark .ag-date-time-list-page-entry-is-current {\n background-color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-advanced-filter-builder-button,\n.ag-theme-alpine-dark .ag-advanced-filter-builder-button,\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-button {\n padding: var(--ag-grid-size);\n font-weight: 600;\n}\n.ag-theme-alpine .ag-list-item-hovered::after,\n.ag-theme-alpine-dark .ag-list-item-hovered::after,\n.ag-theme-alpine-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-pill .ag-pill-button:hover,\n.ag-theme-alpine-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-alpine-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine .ag-disabled .ag-icon,\n.ag-theme-alpine .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine [disabled] .ag-icon,\n.ag-theme-alpine-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine-dark .ag-disabled .ag-icon,\n.ag-theme-alpine-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine-dark [disabled] .ag-icon,\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine-auto-dark .ag-disabled .ag-icon,\n.ag-theme-alpine-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-alpine.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridAlpine";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABggAAsAAAAAMhAAABfNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKuCStUgE2AiQDgnALgToABCAFhEYHhlQbPytlBGwcAPTYmQ3Z/39J4GQMMXfuK6EqRbRgZStLKfHti42sdSMMSzt8ncPoZYkG0xVMVCoPK4h6JNm9WHhsaEzj0edan0MTU1OnzAbfuP/Ea//rIg4bSsnz9GPfzvuii9guKmsWEiqWmE7LeAmEaNLuDD441/vawCVpe4j4geyXs7NzE1aTlTpyn4ATHiLTnS00yFIAuSkyfboqAfADv83/g9cEBYvUxgBjoYjNtRD/jLoXzNjmCguLDV863FoMsN/TJ7rqu2yjNr++SF+4F4t6sbiWSe/utyXXIRlFxlKbAcNjbaoHCpWampr8/0G793Otk0Ia6+lhWBUU/odPV7n1bn3wVBkKrbtnF5Xj9qfmn3yl5/8+e1i4lDHb73vdMciYBEs8IXwlAn5as9deCshTfC0LhRKdmp2dS3bocpt8mpvQ3n3ay6ftfkpSZMjeFj4Bu1YBy7ovfIVnYSplK4ysbqum3N/N3EGUPWOtd7Bj99YuI0MDJWOR6IXH+q9jVhTQ0TSnb96qHEZvX/j2AYuo5N4F8sHL7RsvH6N/mUUrdirEcqg3GJX2098fRVC05bGeVP1DDQxFtfbaTRalhymrbe6og2Gbjl+GpBIsVxA6cbvoqAVJ6QnfEUVbERtuupCM6JXdwphulBcsoHbyeGRdhLKzA04bxnCtU/MYW/Gdwp30gR5yVMYLR5ijVImd3zwZP0P6QhzFOhVfmia8ChLC5ZEbU5hXGrFi3TbKbBZpJrppDx/dc4abhr7EyRuGGcm0okgWxU2GRlizCspC8SwpG3khIMJp1JFW0cCSy/gswwlzErbhpjJ+E7XXYFuov5NHetnlTb145oeTDO8NhCOXUnHP45RMGGP3Fk68fFWL3MFOEVHYCy4SHgr2rpxSjoV3fG8jE7Je/PLvzWf/iiHJsT9N3Lpyslwvj8uroi4HtPk9If9eeK3Q0Hbfg9yaCZ/WktdOjH5Ojcuo3PWmEXG7x11bUFEeYjqR2jfjBOr7kswlqfFa/XTSw9l1XIapJIXXfUOapNGMUKUTsExCe23EuEbpvrIXDLNZ1UpvKjY+1xKrD/PkSJ6NjaIjKcoodlqYW8ZHWvm2CWRchDtxTu7+YhTNqatx3ZSwora4PTqifCG1AsIpeWppFBu2bEDdGVUjj2taM9YIG408dP5dZOPlnkeilLiQ2Cvfkw07P0YJM8q6SZKbLsKdV+4SzqwD7DLUOUAzI3TRferjVLXmPPLOD1dYFUJoC9cb6MTw7NZVSk4k5WCfGIXi9lQyqKfsYJ4asueeuG3AnEMD0lfZReyHhbiqlVFl+69wFBpjjr6kRMwbEZnJvh3sNtOo4PCGNcNqQz8pd3RXHmn71KHysvIJr7Nvv3zBRDEAVLAqJJO1/2r2DP+NZIf8ASdrG/VM+peA6QXJJ1fBMKhBZbS6rfQjvDyMULKFQ/2BHoKOqvnhkz/Z/fefEd/e+hJNSCa6MNNwVF4fiBC1b4bcGXEmV/kpBPWUDOYxsVLjlrs66AjORpDU+PwNo8XOwcnFzcPLxy8gKCQsIiomLiEpJS0jKyevoKikrKKqpq6hqSWtraOLcOvpGxgaGaOYiamZuYWlSAylAclZfNj/+ZsOakN30jJHta8VRUC2m/1t2dy6i+gUPUDtub5nwcgaHQYX0CZwER0El9AecBntBVfQVnAVnQTX0GZwHe0HN9B2cAsdALfRPnAHHQF30U5wD+0A99Ex8BBtAY/QbvAYbQNP0FHwFJ0Az9Au8BwdAi/QcfDysFMQjcukDg6SgIOkABoQBjQhHGhBbEAbIoAORAJdiAJ6IAYwA2ICMyEWMAtiB2ZDHMAciBOYC3EB8yBuYD7EAyyAeIFeiA/og/iBhZAAsAgSBBZDQsASSBhYCokAyyBRYDkkBqyAxIGVkASwCpIEVkNSwBpIGlgLyQDrIFlgPSQHbIDkgX5IARiAFIFBSAkYgpSBYUgFGIFUgVFIDRiD1IFxSAOYgDRt12ULyCQEmYIg0xCgCunZYZN9cGU5AAc5BAc5Agc5Bgc5AQc5BVCDzIA6ZM7pyQU4yCU4yBU4yDU4yA04yC04yB0YtOH0Vr5j4VYfdKck+fJ/H8BobKnQvx8gKBMURfsqJjinAq2gMYES2ptqBErltNmlUgpBvkLQPCkl8VWblHLOqS6omoJ6lHK7s24+k0aLl3s3mjgphsuli5ouoirDWMGSQh0qqzzqcTjclmh8uWwwTqWf+oSslBuHx9A+y/JLkY0EUS/EmLRxxkM+S0xdgpHYciXgoXGX6arrSmfqWvYL9U6HXJKCuZP5WDKZg/zKvb+B1cxPsecO0BGDlH0y49gk6yGYNhFmxGinSXZqPW+1sjBO/Lws9ur39sfI2gtQP/dwp3M43X34/HgQ4OqZzh2MU7r0w/qoX/WNVAhXHgvhxuUuWcjRCjsW2on3pgEjY2UwfH6aT51BSpY4jgl1PUjIZ81HIYxCWn8bSsedPWNLGVLsUE+ombIf7tZxnoaltQ1nSF29k6vp+Ic2nOrQmTZ9hg6ViorNcCcVPrtTq2x+p2bp3K9gbgrFNkbthFlxL0pJGNQBGyp2qu/OAV87fo66Wh8sklrCiYu/ZYwoRPo+26jYUSx0miznw48yCxGlFkaIw3aEdQgwqU8LYZXWqzEh69gkwyvrICdkinuiEzG9cToBIjizfu/VJpHVjcjCFFzLM3tyYCYayyJVZNbrks4xCl5YVI1Ex/SvEz62WP9O76Lw2jbvHBuDOjzh84WE8NnsJornCZquNs2VoR2FegygZ1yfzO3o0J1EdWgNqkf7uyXkvV7njRswY3h0Rp2dhBka957lt2u1MRAYa9YBXaP3Mpy5maTGQScH8pujrdp3ZUgzGJeo9H4oc/VNLqdvsDnK2efazJPOvWCIluLx40CYwDD/yjGgUDs3xafX9c1ZdWbjo3qCmGGoUwre6u6dWEprtOHw9WRkRlKu1GXUscrmURT12TjL9MhqcQCAhxGn0y1D2kivw/8IoY4KYWuZYsXkg82Mv7ZrnD3ddm7GEG6wPZHrL01hMBfnybmZ6tnyOMrSKCEut6JS6+Y19PbBX2Vz2V2rWuf3eubJaTVvzwe9jHi6Li2MQqUIs4baxi1iACeCHace2HHhhjIbJjIytEDIfn1jzsUTFyEOdyABlxLIBOyqzBxjNvM2PLaOedJzo/OFOVGy0/iVcOOWa9JW2HwCHh+gt5jvEBjx0X7j958iu63t1EEJj4XKTxZqfxOH9nTNFnL2qcy65Bg6Yeh+AVS0hvDRhcVer3CdXjmRqsNm2vPtK38oNsoIwdSMswGYKWk+WIHo2FiyMyep50zl27OA17pQI/njsfYwjzwMNuvw46Kej32KRE++o2YMFvKBZHakX4ajkrNiWWj1WOgXzNKqQ7xzQixdwx7wORTkRrGpYsi2k87GJ4KbvNLMMSedK4elaygvzC/spL3Ls89jTzO6Z54mvi46M/cyvpDdN/86/V0hNW2ws9OF85tU9J7JBnehvHfi5Izeu1ImyPQwyoy2x4F3vMectnAXCknqzhTSgqrv8jCEvANovHeqsWiIPAFo4Y8MxkM4iPd0Tud0bs0zdWoa7Blvpca+elkRNBqam07Os268jgPrMSv/eKn8mgj2E05pYyQNT5TeKHKrIikK+SmzTmnmwQ0x+adHVEFwpj71ch4X7+zI87U/m4HOc3A4eVuJM79qnf/de9c+MifzqqbOSABB9U7M6wNFSxweDHAy0JvYfotm3Uv+qcGKnGbfZ8SXUgp0Sp3WJ/nEV0rB6ra2MkMuPkEU7b2tesD2BatbNI+JyqCOruHC80IHKx1p+0Zqsy35Ctier904Kh3rHiPjtNt1eDLDUanbCG+E1dkhlp9PJ6sNMuky3JNYfdRVy2DIToeOrfaWpotKwrBwBd7p1sZQMxgYe4DVzbOVVpWhOEIxkIVv6/Z7KUrDpBOFYKIqKtCy25uZso5WOq7pHlF/tfMaNSrbncuQTobWlzlLIbYKRKf2tL7HFsM1qkZtAv/MaC9TphiWwlxF16fO8i85QDJJ582NMIaiwJvgtQG8yeZd2xmjaXNel0kkCwrlVg9HRilPK8FIio4vWofoqZ98kZ221RVeqau+832Bvk1aRS9E7Zluh1+maRxbE9ez4d67CqK9vVcmy5ChK2qi2ME7PBqGn2uXl99j739aHk3AMgT//b/zHwCc6SZ2Ntop+p63khOvauRP/2K6WP6SGcGJMYk38PyVd/85Z+KCoH4hme/i/OuQPI2T9pE2rHTlpuL8pVwfNYKn8SV6ezrtJhdZIy4LelTP796c4Iu63KXTfuy2iRSE0Fq/o9mc44SSuXf/vDBxYZHRXbh4pEenW/Ic83hEENDC4VVLF4iSu3/eH6/aKvW3qvgRPmFFW2fbrvhJxu53sSdeV8vvGTBdo4PFxvEk3j4v2BPEefNcXBp2dpDOk43a0eEG1zDa4mHizqY9B6m/p9qeHQY4RWvkBUF5QmFeUMG3if3cecKCoG9LuLt1adrIutCk4dMAdsUWSj8l8Vb5Tllbq1QoIfDgMtnRd8pxF6d8HfHdceGS6fTExDu3h4YSk6r9Xd4+23zkzfXkur81/Vsr68Mv1/r7tUVFBgbhYXc4fXdu3zkafujQ7l9wtiuIwZWN/bob/Cbeyf3lp5vcyBC1mwZFb2BW+QbVzoFLb8cFvJHLL7jgKsEkL5rSHrgCV9Jbuz7oJuEC62ofSB7A84CMzKiozLTmFkiO4WRgvEA49VN5ac3W5pjjJM9yz7WeZZ7C9b+ruOXkhN13tXU7STOmvAjLBdLW/jnzPQ5Ttpbla9/1xdBdb9YgNsxQD2uzXov6sGp/GvOkn/OFUmeZjL2d2nOMymbRGQ7U+y+sKbupDeu3/WpuJbWm9jNfCgdhle23DOsmQwW9z2JDSNI3jtYWZlkjUQzG57etu0N3e13gEywvoNdTahPIRizBNGtLB+1cLsvv0SpTcp+1HA6bB2y/LJxPfzwdGcH3x9f64WXaCfcr+/y1uL8oorAut8oz29m/7JRhOvC1/h4O/fGce90BunsB53UB3ecRkqciWZEUB4zKQ9e9Exh7DcWXQWD1YjRdJTdm2U3dyahbt3H3pnUMlGbl+jo0E83sncRumtJWm1slJG5Kr7vcZr2bZcsKkG2X1gd8amRKc6ZZwzYisLJBz+7f+sP87CEhkeC8fKkuuqrBPpnvJYzOuf6IKM3xq5CCLqaq3i45JDg+saTA9GF02lp2REGRShiXGsfV9wZ4x/H5sd4BZJN8hX96HinB/CWSxBBuFiuiUKP3bkBYEuODb7p09qp7QRE7ovmFQ763S65q0EUftnkLvv1xyC45+BOdlzEs7DTONQhPtLnUfYHImN7o0VTRQg290v10AV4JrlwmH/VmCu4/x15g8PatSCkimlAleqGJ356fqHwa4dYHDEMuChIFEqgf2nRaiSrLEynfNu2DR2rRILTp7TE7rSzCHycscsXs/AJrx/fLy/rgMf29HCYMPudyTnCHk4eD8wMD8yqFzYKFT+Ke4HD1/CQsqXYoKoLYq862+fI6wEkQJLS4v3pVltxrc6KyzDBBguBkfCanSsz+IlS4/hO16sFpkUKRsUQiRUb2BZZMpm0UisxFIWoR/CaD5SK5Uo7imSI5iE4r7ik8NndWAJjpvqP/JEfVBwXC9w5/bE3c7Or98eEqmdym9lJ/tk+Cd3y8d4JPdnA5d2BqisMtT7BBOlg1PFj7YcWRmX9S/rl51BVcdWsZlwVirT7lfuqKdV+wEqfDlP1KDFKU+/ebckKSWu9olzcWFewbCRM5PnFwiD/9bWxseYmRIcstJPn2Ro3mu++I7/es3ntC+VKny620JrPZNcUMkyqrNk3VQcrXc8w/p6dhrY1+WwyfH2OC2NMxCR3D3za/HqQ8H+vfBwc+M1oxdfG3Nl15/dCKZu3v8kfjeWongWHpGNGyjcePFXvJq1uI4/mEEV1/CBgHZs2EDrEmTdsbLsH/DJU7RG8E8TWGkNeAohcbmxpIjUfsYHAseF/TjstN2yTbd8DhP0cnVK3/55+bW3+5LMcjw12tds/wyHkobHzwff85Hg8l9Y2LP9qcI8wUCDKFOQvCfu5MQY5woTQ0PF+JqYyKqmwJHOkW/o+LfmunzSk6Uv9Z1jgQivD9cucZln3GMfRY0IrITwTfa6mJ9IB/EtntS4WE77PfJ0gmbAPn9euoqJBgR8fISCAi5Xly+PNwv3S1gSTl4caNQRRDEcZoH4aICsOCx8zP4Q3lpKebSiqaVR2S9RHBw20aXOajnuO4E1aZlxsXNzzsf+48mE/badHOYR1UXd2JDmNfSui3LMSmp9mV1Kt5h8FzjWdZUtrV4y3f4vk0Qcjgs+YhPHYbFnv6nOjcGUy8DRcPN7NFPHEKGvB8Xa1KVTqPnj9tjMrYIRUrnIenYPHQONA/rLCwsjjWgrN1KSwh8eUX3NpiCSxcLIDl98wv/Kj8jNxqoaaGGBwYHCTgMq209H5CItngg1yd7qXyxN7Vlg8fpKSEF1qrz67UFxVsXNbeuSr2MrXaAGNjbW0bbyeHuLEMjcpLYmO/PR1fX2dFXLuKHz9OhIakpf3JnPuacrCqTWNVZcIorqmuBjMBjXZPuzWLmnc1sfaODWoDZgeLpRsqkQothPUI6jzBH3k+evt20XMRAz4yGvX4//yTws+jYc1fB09un7Lo7X+65PHdBV96AospXUaPnuToxTRGNingZ75BxUqlVV19SmTYrr2GH3yZTln19j+/t5UFaQX1deZVRCtgIGeTy+uUkbv3uomPXctBc9aj67dY8wKuXfN//Nh6/HGMoi1W3NJlt1NP0u/kdHWKxV0+O61hh9N/5fSh09cYQH+G+P73nluRlSMBACTKzna/jSxsynM0aNQVVNHUISVwfNOWyWPZvkSFXHH2RQ3A/7/JFuQ3do8+5P+mL4FUE9VqMpmpCuz62jxTvrhMWdJVrTG4FZf/Q/4iy3BGeekmzgRsqCNN7/UDYulTZ7LJZdOENMI5wkvppmyYBKQCuyAGOjy3QpAsKetBhhAb2yqaqSO2rl1hs5H10NOQBJdpleplSVekXZxi53IwGNhf70cchYMsvxNR+6Qq/vtmyuD3hx99k08Le2lKQZYBtCyz7y6r4kuGPy/A4LfbCmiUyxWX9bfcxt+Qk2qyoNnftPUfPxUa4bL376J2iJiKbwH4G3jeCbeZ0DRornUwWVIwwpUNEnRzJ8SAAt6IgzkImZKoKIzeABvYDAiQDM2ABCxQRcgAqNDJkNfNh5khNr+MjIABc8wYm/+GyCAlGf5iFPAgFd3ZCr8k+i8pR8LfGGqyUrwU+zr/UUpkah9Hx09N2y8kFKvo2+7alik8qfZtLzy2P5nWZKXEbRZ+QaenQTU/349djaf75Hic2fBLov+SciT8jcs3riYrGleI6f+4YAXfNab28fSgmfhFMmKDKYK+7a7byjKFJ01136594ZGLn0aJJksp4xeR5f4LutichgZ+fr5Pr6vXNSdnhI79JwCoZOTxOZ0whwUsYQVr2MD2NzTmAMdfl/43vxVESVZUTTdMy3Zczw/CKE7SLC/Kqm7arh/GaV7WbT/O637e74/iJM2I80JIpY0tq7pxrQ+3bt+5e+/+GjPeCkEwWI1MKyvC5zK3xS3sprS0Hr9hrJwlh2npBiv6doXRvXZ8Mfsi+s+FsUTyqChjJKv4/lTnSlqVB8eJxeR4tLWsF0Qdqewck4p1in7hOF+XTriUuSvT3FVd2NZLvMyczbjZGo/0W7yiKcmWYc69VR/TBzpLD0+KLoLEvAzCNS+UEbpI2OsqRbI8vuvE1kcKm9Fe4hhvuBiR6sZRKowv4UUXxIR7YjU2JT6jX2YD44nzHGmZ48S6yYJT5FreyoW+GTZdVWUy3PdvCsOjpcQw6KLYCXdlfO1rPJ/pQNok97DryM2z5TDTG/Mc71UQiRTb4sCckTaVfAkscqplqcLDN15Y7bVMaFT1r1M5ECtMKPWq0g136bj+NEJvOlblcSd4ynkXGncShws1Hw6kpalX8tp0hP0qd4SvWGO9X6CPChYCCCAoRGAgOEMBBx4SDPAKHVzAfIIKGa4wQQ+3GQAAAAA=);\n font-weight: normal;\n font-style: normal;\n}\n.ag-theme-alpine,\n.ag-theme-alpine-dark,\n.ag-theme-alpine-auto-dark {\n --ag-alpine-active-color: #2196f3;\n --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\n --ag-row-hover-color: rgba(33, 150, 243, 0.1);\n --ag-column-hover-color: rgba(33, 150, 243, 0.1);\n --ag-input-focus-border-color: rgba(33, 150, 243, 0.4);\n --ag-range-selection-background-color: rgba(33, 150, 243, 0.2);\n --ag-range-selection-background-color-2: rgba(33, 150, 243, 0.36);\n --ag-range-selection-background-color-3: rgba(33, 150, 243, 0.49);\n --ag-range-selection-background-color-4: rgba(33, 150, 243, 0.59);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-alpine-active-color) 50%);\n --ag-background-color: #fff;\n --ag-foreground-color: #181d1f;\n --ag-border-color: #babfc7;\n --ag-secondary-border-color: #dde2eb;\n --ag-header-background-color: #f8f8f8;\n --ag-tooltip-background-color: #f8f8f8;\n --ag-odd-row-background-color: #fcfcfc;\n --ag-control-panel-background-color: #f8f8f8;\n --ag-subheader-background-color: #fff;\n --ag-invalid-color: #e02525;\n --ag-checkbox-unchecked-color: #999;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-checkbox-checked-color: var(--ag-alpine-active-color);\n --ag-range-selection-border-color: var(--ag-alpine-active-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-input-focus-box-shadow: 0 0 2px 0.1rem var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.1rem var(--ag-invalid-color);\n --ag-panel-background-color: var(--ag-header-background-color);\n --ag-menu-background-color: var(--ag-header-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-alpine-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-alpine-active-color);\n --ag-column-drag-indicator-color: var(--ag-alpine-active-color);\n --ag-disabled-foreground-color: rgba(24, 29, 31, 0.5);\n --ag-chip-background-color: rgba(24, 29, 31, 0.07);\n --ag-input-disabled-border-color: rgba(186, 191, 199, 0.3);\n --ag-input-disabled-background-color: rgba(186, 191, 199, 0.15);\n --ag-borders: solid 1px;\n --ag-border-radius: 3px;\n --ag-borders-side-button: none;\n --ag-side-button-selected-background-color: transparent;\n --ag-header-column-resize-handle-display: block;\n --ag-header-column-resize-handle-width: 2px;\n --ag-header-column-resize-handle-height: 30%;\n --ag-grid-size: 6px;\n --ag-icon-size: 16px;\n --ag-row-height: calc(var(--ag-grid-size) * 7);\n --ag-header-height: calc(var(--ag-grid-size) * 8);\n --ag-list-item-height: calc(var(--ag-grid-size) * 4);\n --ag-column-select-indent-size: var(--ag-icon-size);\n --ag-set-filter-indent-size: var(--ag-icon-size);\n --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-toggle-button-height: 18px;\n --ag-toggle-button-width: 28px;\n --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 13px;\n --ag-icon-font-family: agGridAlpine;\n --ag-selected-tab-underline-color: var(--ag-alpine-active-color);\n --ag-selected-tab-underline-width: 2px;\n --ag-selected-tab-underline-transition-speed: 0.3s;\n --ag-tab-min-width: 240px;\n --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\n --ag-popup-shadow: var(--ag-card-shadow);\n --ag-side-bar-panel-width: 250px;\n}\n\n.ag-theme-alpine-dark {\n --ag-background-color: #181d1f;\n --ag-foreground-color: #fff;\n --ag-border-color: #68686e;\n --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\n --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\n --ag-header-background-color: #222628;\n --ag-tooltip-background-color: #222628;\n --ag-odd-row-background-color: #222628;\n --ag-control-panel-background-color: #222628;\n --ag-subheader-background-color: #000;\n --ag-input-disabled-background-color: #282c2f;\n --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5),\n 0 0 4px 3px color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\n --ag-chip-background-color: rgba(255, 255, 255, 0.07);\n --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\n --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-alpine-auto-dark {\n --ag-background-color: #181d1f;\n --ag-foreground-color: #fff;\n --ag-border-color: #68686e;\n --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\n --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\n --ag-header-background-color: #222628;\n --ag-tooltip-background-color: #222628;\n --ag-odd-row-background-color: #222628;\n --ag-control-panel-background-color: #222628;\n --ag-subheader-background-color: #000;\n --ag-input-disabled-background-color: #282c2f;\n --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5), 0 0 4px 3px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5),\n 0 0 4px 3px color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\n --ag-chip-background-color: rgba(255, 255, 255, 0.07);\n --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\n --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-alpine .ag-filter-toolpanel-header,\n.ag-theme-alpine .ag-filter-toolpanel-search,\n.ag-theme-alpine .ag-status-bar,\n.ag-theme-alpine .ag-header-row,\n.ag-theme-alpine .ag-row-number-cell,\n.ag-theme-alpine .ag-panel-title-bar-title,\n.ag-theme-alpine .ag-multi-filter-group-title-bar,\n.ag-theme-alpine .ag-filter-card-title,\n.ag-theme-alpine-dark .ag-filter-toolpanel-header,\n.ag-theme-alpine-dark .ag-filter-toolpanel-search,\n.ag-theme-alpine-dark .ag-status-bar,\n.ag-theme-alpine-dark .ag-header-row,\n.ag-theme-alpine-dark .ag-row-number-cell,\n.ag-theme-alpine-dark .ag-panel-title-bar-title,\n.ag-theme-alpine-dark .ag-multi-filter-group-title-bar,\n.ag-theme-alpine-dark .ag-filter-card-title,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-alpine-auto-dark .ag-status-bar,\n.ag-theme-alpine-auto-dark .ag-header-row,\n.ag-theme-alpine-auto-dark .ag-row-number-cell,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-title,\n.ag-theme-alpine-auto-dark .ag-multi-filter-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-filter-card-title {\n font-weight: 700;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-alpine .ag-row,\n.ag-theme-alpine-dark .ag-row,\n.ag-theme-alpine-auto-dark .ag-row {\n font-size: calc(var(--ag-font-size) + 1px);\n}\n.ag-theme-alpine input[class^=ag-]:not([type]),\n.ag-theme-alpine input[class^=ag-][type=text],\n.ag-theme-alpine input[class^=ag-][type=number],\n.ag-theme-alpine input[class^=ag-][type=tel],\n.ag-theme-alpine input[class^=ag-][type=date],\n.ag-theme-alpine input[class^=ag-][type=datetime-local],\n.ag-theme-alpine textarea[class^=ag-],\n.ag-theme-alpine-dark input[class^=ag-]:not([type]),\n.ag-theme-alpine-dark input[class^=ag-][type=text],\n.ag-theme-alpine-dark input[class^=ag-][type=number],\n.ag-theme-alpine-dark input[class^=ag-][type=tel],\n.ag-theme-alpine-dark input[class^=ag-][type=date],\n.ag-theme-alpine-dark input[class^=ag-][type=datetime-local],\n.ag-theme-alpine-dark textarea[class^=ag-],\n.ag-theme-alpine-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-alpine-auto-dark input[class^=ag-][type=text],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=number],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=tel],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=date],\n.ag-theme-alpine-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-alpine-auto-dark textarea[class^=ag-] {\n min-height: calc(var(--ag-grid-size) * 4);\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-alpine .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-ltr textarea[class^=ag-], .ag-theme-alpine-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-ltr textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-rtl textarea[class^=ag-], .ag-theme-alpine-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-rtl textarea[class^=ag-], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-tab,\n.ag-theme-alpine-dark .ag-tab,\n.ag-theme-alpine-auto-dark .ag-tab {\n padding: calc(var(--ag-grid-size) * 1.5);\n transition: color 0.4s;\n flex: 1 1 auto;\n}\n.ag-theme-alpine .ag-tab-selected,\n.ag-theme-alpine-dark .ag-tab-selected,\n.ag-theme-alpine-auto-dark .ag-tab-selected {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-menu,\n.ag-theme-alpine-dark .ag-menu,\n.ag-theme-alpine-auto-dark .ag-menu {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-alpine-dark .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-alpine-auto-dark .ag-panel-content-wrapper .ag-column-select {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-menu-header,\n.ag-theme-alpine-dark .ag-menu-header,\n.ag-theme-alpine-auto-dark .ag-menu-header {\n background-color: var(--ag-control-panel-background-color);\n padding-top: 1px;\n}\n.ag-theme-alpine .ag-tabs-header,\n.ag-theme-alpine-dark .ag-tabs-header,\n.ag-theme-alpine-auto-dark .ag-tabs-header {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n.ag-theme-alpine .ag-charts-settings-group-title-bar,\n.ag-theme-alpine .ag-charts-data-group-title-bar,\n.ag-theme-alpine .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-settings-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-data-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar {\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n line-height: calc(var(--ag-icon-size) + var(--ag-grid-size) - 2px);\n}\n.ag-theme-alpine .ag-chart-mini-thumbnail,\n.ag-theme-alpine-dark .ag-chart-mini-thumbnail,\n.ag-theme-alpine-auto-dark .ag-chart-mini-thumbnail {\n background-color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-chart-settings-nav-bar,\n.ag-theme-alpine-dark .ag-chart-settings-nav-bar,\n.ag-theme-alpine-auto-dark .ag-chart-settings-nav-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-alpine .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-ltr .ag-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-auto-dark .ag-rtl .ag-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine .ag-charts-advanced-settings-top-level-group-toolbar,\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine-dark .ag-charts-advanced-settings-top-level-group-toolbar,\n.ag-theme-alpine-auto-dark .ag-charts-format-top-level-group-toolbar,\n.ag-theme-alpine-auto-dark .ag-charts-advanced-settings-top-level-group-toolbar {\n margin-top: var(--ag-grid-size);\n}\n.ag-theme-alpine .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-ltr .ag-charts-advanced-settings-top-level-group-toolbar {\n padding-left: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-auto-dark .ag-rtl .ag-charts-advanced-settings-top-level-group-toolbar {\n padding-right: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-charts-format-sub-level-group,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n padding-left: var(--ag-grid-size);\n margin-bottom: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding-top: 0;\n padding-bottom: 0;\n background: none;\n font-weight: 700;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-container,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-container {\n padding-bottom: 0;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-alpine-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-alpine-auto-dark .ag-charts-format-sub-level-group-item:last-child {\n margin-bottom: 0;\n}\n.ag-theme-alpine.ag-dnd-ghost,\n.ag-theme-alpine-dark.ag-dnd-ghost,\n.ag-theme-alpine-auto-dark.ag-dnd-ghost {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 700;\n}\n.ag-theme-alpine .ag-side-buttons,\n.ag-theme-alpine-dark .ag-side-buttons,\n.ag-theme-alpine-auto-dark .ag-side-buttons {\n width: calc(var(--ag-grid-size) * 5);\n}\n.ag-theme-alpine .ag-standard-button,\n.ag-theme-alpine-dark .ag-standard-button,\n.ag-theme-alpine-auto-dark .ag-standard-button {\n font-family: inherit;\n appearance: none;\n -webkit-appearance: none;\n border-radius: var(--ag-border-radius);\n border: 1px solid;\n border-color: var(--ag-alpine-active-color);\n color: var(--ag-alpine-active-color);\n background-color: var(--ag-background-color);\n font-weight: 600;\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-standard-button:hover,\n.ag-theme-alpine-dark .ag-standard-button:hover,\n.ag-theme-alpine-auto-dark .ag-standard-button:hover {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-row-hover-color);\n}\n.ag-theme-alpine .ag-standard-button:active,\n.ag-theme-alpine-dark .ag-standard-button:active,\n.ag-theme-alpine-auto-dark .ag-standard-button:active {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-alpine-active-color);\n color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-standard-button:disabled,\n.ag-theme-alpine-dark .ag-standard-button:disabled,\n.ag-theme-alpine-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-alpine .ag-column-drop-vertical,\n.ag-theme-alpine-dark .ag-column-drop-vertical,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical {\n min-height: 75px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-title-bar,\n.ag-theme-alpine-dark .ag-column-drop-vertical-title-bar,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-title-bar {\n padding: calc(var(--ag-grid-size) * 2);\n padding-bottom: 0px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-empty-message,\n.ag-theme-alpine-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-alpine-auto-dark .ag-column-drop-vertical-empty-message {\n display: flex;\n align-items: center;\n border: dashed 1px;\n border-color: var(--ag-border-color);\n margin: calc(var(--ag-grid-size) * 2);\n padding: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-column-drop-empty-message,\n.ag-theme-alpine-dark .ag-column-drop-empty-message,\n.ag-theme-alpine-auto-dark .ag-column-drop-empty-message {\n color: var(--ag-foreground-color);\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-pill-select .ag-column-drop,\n.ag-theme-alpine-dark .ag-pill-select .ag-column-drop,\n.ag-theme-alpine-auto-dark .ag-pill-select .ag-column-drop {\n min-height: unset;\n}\n.ag-theme-alpine .ag-status-bar,\n.ag-theme-alpine-dark .ag-status-bar,\n.ag-theme-alpine-auto-dark .ag-status-bar {\n font-weight: normal;\n}\n.ag-theme-alpine .ag-status-name-value-value,\n.ag-theme-alpine-dark .ag-status-name-value-value,\n.ag-theme-alpine-auto-dark .ag-status-name-value-value {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-paging-number,\n.ag-theme-alpine .ag-paging-row-summary-panel-number,\n.ag-theme-alpine-dark .ag-paging-number,\n.ag-theme-alpine-dark .ag-paging-row-summary-panel-number,\n.ag-theme-alpine-auto-dark .ag-paging-number,\n.ag-theme-alpine-auto-dark .ag-paging-row-summary-panel-number {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-column-drop-cell-button,\n.ag-theme-alpine-dark .ag-column-drop-cell-button,\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button {\n opacity: 0.5;\n}\n.ag-theme-alpine .ag-column-drop-cell-button:hover,\n.ag-theme-alpine-dark .ag-column-drop-cell-button:hover,\n.ag-theme-alpine-auto-dark .ag-column-drop-cell-button:hover {\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-alpine-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-alpine-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-alpine .ag-header-cell-menu-button:hover,\n.ag-theme-alpine .ag-header-cell-filter-button:hover,\n.ag-theme-alpine .ag-side-button-button:hover,\n.ag-theme-alpine .ag-tab:hover,\n.ag-theme-alpine .ag-panel-title-bar-button:hover,\n.ag-theme-alpine .ag-header-expand-icon:hover,\n.ag-theme-alpine .ag-column-group-icons:hover,\n.ag-theme-alpine .ag-set-filter-group-icons:hover,\n.ag-theme-alpine .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine .ag-chart-settings-prev:hover,\n.ag-theme-alpine .ag-chart-settings-next:hover,\n.ag-theme-alpine .ag-group-title-bar-icon:hover,\n.ag-theme-alpine .ag-column-select-header-icon:hover,\n.ag-theme-alpine .ag-floating-filter-button-button:hover,\n.ag-theme-alpine .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine .ag-chart-menu-icon:hover,\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover,\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover,\n.ag-theme-alpine-dark .ag-side-button-button:hover,\n.ag-theme-alpine-dark .ag-tab:hover,\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover,\n.ag-theme-alpine-dark .ag-header-expand-icon:hover,\n.ag-theme-alpine-dark .ag-column-group-icons:hover,\n.ag-theme-alpine-dark .ag-set-filter-group-icons:hover,\n.ag-theme-alpine-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine-dark .ag-chart-settings-prev:hover,\n.ag-theme-alpine-dark .ag-chart-settings-next:hover,\n.ag-theme-alpine-dark .ag-group-title-bar-icon:hover,\n.ag-theme-alpine-dark .ag-column-select-header-icon:hover,\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover,\n.ag-theme-alpine-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine-dark .ag-chart-menu-icon:hover,\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover,\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover,\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover,\n.ag-theme-alpine-auto-dark .ag-tab:hover,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover,\n.ag-theme-alpine-auto-dark .ag-header-expand-icon:hover,\n.ag-theme-alpine-auto-dark .ag-column-group-icons:hover,\n.ag-theme-alpine-auto-dark .ag-set-filter-group-icons:hover,\n.ag-theme-alpine-auto-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine-auto-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-prev:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-next:hover,\n.ag-theme-alpine-auto-dark .ag-group-title-bar-icon:hover,\n.ag-theme-alpine-auto-dark .ag-column-select-header-icon:hover,\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine-auto-dark .ag-chart-menu-icon:hover {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine .ag-floating-filter-button-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-header-cell-menu-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-header-cell-filter-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-side-button-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-panel-title-bar-button:hover .ag-icon,\n.ag-theme-alpine-auto-dark .ag-floating-filter-button-button:hover .ag-icon {\n color: inherit;\n}\n.ag-theme-alpine .ag-filter-active .ag-icon-filter,\n.ag-theme-alpine-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-alpine-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-alpine-dark .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-alpine-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\n opacity: 0.35;\n}\n.ag-theme-alpine .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-ltr .ag-panel-title-bar-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-auto-dark .ag-rtl .ag-panel-title-bar-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-group-container {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-group-container {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-filter-toolpanel-instance-filter,\n.ag-theme-alpine-dark .ag-filter-toolpanel-instance-filter,\n.ag-theme-alpine-auto-dark .ag-filter-toolpanel-instance-filter {\n border: none;\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n margin-left: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\n border-right: dashed 1px;\n border-right-color: var(--ag-border-color);\n margin-right: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-set-filter-list,\n.ag-theme-alpine-dark .ag-set-filter-list,\n.ag-theme-alpine-auto-dark .ag-set-filter-list {\n padding-top: calc(var(--ag-grid-size) * 0.5);\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-alpine .ag-filter-add-button .ag-icon,\n.ag-theme-alpine-dark .ag-filter-add-button .ag-icon,\n.ag-theme-alpine-auto-dark .ag-filter-add-button .ag-icon {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine .ag-layout-print .ag-center-cols-container,\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-alpine-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-alpine-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-alpine .ag-date-time-list-page-entry-is-current,\n.ag-theme-alpine-dark .ag-date-time-list-page-entry-is-current,\n.ag-theme-alpine-auto-dark .ag-date-time-list-page-entry-is-current {\n background-color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-advanced-filter-builder-button,\n.ag-theme-alpine-dark .ag-advanced-filter-builder-button,\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-button {\n padding: var(--ag-grid-size);\n font-weight: 600;\n}\n.ag-theme-alpine .ag-list-item-hovered::after,\n.ag-theme-alpine-dark .ag-list-item-hovered::after,\n.ag-theme-alpine-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-pill .ag-pill-button:hover,\n.ag-theme-alpine-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-alpine-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine .ag-disabled .ag-icon,\n.ag-theme-alpine .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine [disabled] .ag-icon,\n.ag-theme-alpine-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine-dark .ag-disabled .ag-icon,\n.ag-theme-alpine-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine-dark [disabled] .ag-icon,\n.ag-theme-alpine-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-alpine-auto-dark .ag-disabled .ag-icon,\n.ag-theme-alpine-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-alpine-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-balham-no-font.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '.ag-theme-balham,\n.ag-theme-balham-dark,\n.ag-theme-balham-auto-dark {\n --ag-balham-active-color: #0091ea;\n --ag-foreground-color: #000;\n --ag-background-color: #fff;\n --ag-header-background-color: #f5f7f7;\n --ag-tooltip-background-color: #cbd0d3;\n --ag-subheader-background-color: #e2e9eb;\n --ag-control-panel-background-color: #f5f7f7;\n --ag-border-color: #bdc3c7;\n --ag-odd-row-background-color: #fcfdfe;\n --ag-row-hover-color: #ecf0f1;\n --ag-column-hover-color: #ecf0f1;\n --ag-input-border-color: #95a5a6;\n --ag-invalid-color: #e02525;\n --ag-input-disabled-background-color: #ebebeb;\n --ag-checkbox-unchecked-color: #7f8c8d;\n --ag-input-focus-border-color: #719ece;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-input-focus-box-shadow: 0 0 2px 1px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 1px var(--ag-invalid-color);\n --ag-range-selection-border-color: var(--ag-balham-active-color);\n --ag-checkbox-checked-color: var(--ag-balham-active-color);\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-panel-background-color: var(--ag-header-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-balham-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-balham-active-color);\n --ag-column-drag-indicator-color: var(--ag-balham-active-color);\n --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\n --ag-subheader-toolbar-background-color: rgba(226, 233, 235, 0.5);\n --ag-row-border-color: rgba(189, 195, 199, 0.58);\n --ag-chip-background-color: rgba(0, 0, 0, 0.1);\n --ag-range-selection-background-color: rgba(0, 145, 234, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 145, 234, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 145, 234, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 145, 234, 0.59);\n --ag-selected-row-background-color: rgba(0, 145, 234, 0.28);\n --ag-header-column-separator-color: rgba(189, 195, 199, 0.5);\n --ag-input-disabled-border-color: rgba(149, 165, 166, 0.3);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-balham-active-color) 50%);\n --ag-header-column-separator-display: block;\n --ag-header-column-separator-height: 50%;\n --ag-grid-size: 4px;\n --ag-icon-size: 16px;\n --ag-row-height: calc(var(--ag-grid-size) * 7);\n --ag-header-height: calc(var(--ag-grid-size) * 8);\n --ag-list-item-height: calc(var(--ag-grid-size) * 6);\n --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-input-height: calc(var(--ag-grid-size) * 4);\n --ag-chart-menu-panel-width: 240px;\n --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 12px;\n --ag-icon-font-family: agGridBalham;\n --ag-border-radius: 2px;\n --ag-checkbox-border-radius: 3px;\n --ag-card-shadow: none;\n}\n\n.ag-theme-balham-dark {\n --ag-balham-active-color: #00b0ff;\n --ag-foreground-color: #f5f5f5;\n --ag-background-color: #2d3436;\n --ag-header-background-color: #1c1c1c;\n --ag-tooltip-background-color: #1c1f20;\n --ag-subheader-background-color: #111;\n --ag-control-panel-background-color: #202020;\n --ag-border-color: #424242;\n --ag-odd-row-background-color: #262c2e;\n --ag-row-hover-color: #3d4749;\n --ag-column-hover-color: #3d4749;\n --ag-input-border-color: #f0f0f0;\n --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\n --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\n --ag-checkbox-unchecked-color: #ecf0f1;\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\n --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\n --ag-row-border-color: #5c5c5c;\n --ag-chip-background-color: rgba(245, 245, 245, 0.08);\n --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\n --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\n --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\n --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\n --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\n --ag-toggle-button-off-background-color: transparent;\n --ag-toggle-button-off-border-color: var(--ag-foreground-color);\n --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\n --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\n --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 4px 1.5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-balham-auto-dark {\n --ag-balham-active-color: #00b0ff;\n --ag-foreground-color: #f5f5f5;\n --ag-background-color: #2d3436;\n --ag-header-background-color: #1c1c1c;\n --ag-tooltip-background-color: #1c1f20;\n --ag-subheader-background-color: #111;\n --ag-control-panel-background-color: #202020;\n --ag-border-color: #424242;\n --ag-odd-row-background-color: #262c2e;\n --ag-row-hover-color: #3d4749;\n --ag-column-hover-color: #3d4749;\n --ag-input-border-color: #f0f0f0;\n --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\n --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\n --ag-checkbox-unchecked-color: #ecf0f1;\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\n --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\n --ag-row-border-color: #5c5c5c;\n --ag-chip-background-color: rgba(245, 245, 245, 0.08);\n --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\n --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\n --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\n --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\n --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\n --ag-toggle-button-off-background-color: transparent;\n --ag-toggle-button-off-border-color: var(--ag-foreground-color);\n --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\n --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\n --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 4px 1.5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-balham .ag-filter-toolpanel-header,\n.ag-theme-balham .ag-filter-toolpanel-search,\n.ag-theme-balham .ag-status-bar,\n.ag-theme-balham .ag-header-row,\n.ag-theme-balham .ag-row-number-cell,\n.ag-theme-balham .ag-multi-filter-group-title-bar,\n.ag-theme-balham-dark .ag-filter-toolpanel-header,\n.ag-theme-balham-dark .ag-filter-toolpanel-search,\n.ag-theme-balham-dark .ag-status-bar,\n.ag-theme-balham-dark .ag-header-row,\n.ag-theme-balham-dark .ag-row-number-cell,\n.ag-theme-balham-dark .ag-multi-filter-group-title-bar,\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-balham-auto-dark .ag-status-bar,\n.ag-theme-balham-auto-dark .ag-header-row,\n.ag-theme-balham-auto-dark .ag-row-number-cell,\n.ag-theme-balham-auto-dark .ag-multi-filter-group-title-bar {\n font-weight: 600;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-balham .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham .ag-ltr input[class^=ag-][type=text], .ag-theme-balham .ag-ltr input[class^=ag-][type=number], .ag-theme-balham .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham .ag-ltr input[class^=ag-][type=date], .ag-theme-balham .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-ltr textarea[class^=ag-], .ag-theme-balham-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-ltr textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham .ag-rtl input[class^=ag-][type=text], .ag-theme-balham .ag-rtl input[class^=ag-][type=number], .ag-theme-balham .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham .ag-rtl input[class^=ag-][type=date], .ag-theme-balham .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-rtl textarea[class^=ag-], .ag-theme-balham-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-rtl textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-column-drop-vertical-empty-message,\n.ag-theme-balham .ag-status-bar,\n.ag-theme-balham-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-balham-dark .ag-status-bar,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-balham-auto-dark .ag-status-bar {\n font-weight: 600;\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham.ag-dnd-ghost,\n.ag-theme-balham-dark.ag-dnd-ghost,\n.ag-theme-balham-auto-dark.ag-dnd-ghost {\n font-size: var(--ag-font-size);\n font-weight: 600;\n}\n.ag-theme-balham .ag-tab,\n.ag-theme-balham-dark .ag-tab,\n.ag-theme-balham-auto-dark .ag-tab {\n border: 1px solid transparent;\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n margin: var(--ag-grid-size);\n margin-bottom: -1px;\n}\n.ag-theme-balham .ag-tab-selected,\n.ag-theme-balham-dark .ag-tab-selected,\n.ag-theme-balham-auto-dark .ag-tab-selected {\n background-color: var(--ag-background-color);\n border-color: var(--ag-border-color);\n border-bottom-color: transparent;\n}\n.ag-theme-balham .ag-tabs-header,\n.ag-theme-balham-dark .ag-tabs-header,\n.ag-theme-balham-auto-dark .ag-tabs-header {\n border-bottom: 1px solid var(--ag-border-color);\n}\n.ag-theme-balham .ag-column-drop-cell,\n.ag-theme-balham-dark .ag-column-drop-cell,\n.ag-theme-balham-auto-dark .ag-column-drop-cell {\n height: calc(var(--ag-grid-size) * 6);\n}\n.ag-theme-balham .ag-column-drop-vertical-title,\n.ag-theme-balham-dark .ag-column-drop-vertical-title,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-title {\n color: var(--ag-foreground-color);\n}\n.ag-theme-balham .ag-column-drop-vertical-cell,\n.ag-theme-balham-dark .ag-column-drop-vertical-cell,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical-cell-text,\n.ag-theme-balham-dark .ag-column-drop-vertical-cell-text,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell-text {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical-icon,\n.ag-theme-balham-dark .ag-column-drop-vertical-icon,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-icon {\n color: var(--ag-secondary-foreground-color);\n}\n.ag-theme-balham .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\n padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\n padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-column-drop-horizontal,\n.ag-theme-balham-dark .ag-column-drop-horizontal,\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal {\n height: var(--ag-header-height);\n}\n.ag-theme-balham .ag-column-drop-empty,\n.ag-theme-balham-dark .ag-column-drop-empty,\n.ag-theme-balham-auto-dark .ag-column-drop-empty {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham .ag-column-drop-horizontal-cell-text,\n.ag-theme-balham-dark .ag-column-drop-horizontal-cell-text,\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal-cell-text {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical,\n.ag-theme-balham-dark .ag-column-drop-vertical,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical {\n padding-top: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-balham-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-balham .ag-menu-header,\n.ag-theme-balham-dark .ag-menu-header,\n.ag-theme-balham-auto-dark .ag-menu-header {\n background-color: var(--ag-header-background-color);\n}\n.ag-theme-balham .ag-overlay-loading-center,\n.ag-theme-balham .ag-overlay-exporting-center,\n.ag-theme-balham-dark .ag-overlay-loading-center,\n.ag-theme-balham-dark .ag-overlay-exporting-center,\n.ag-theme-balham-auto-dark .ag-overlay-loading-center,\n.ag-theme-balham-auto-dark .ag-overlay-exporting-center {\n background-color: var(--ag-background-color);\n border: 1px solid var(--ag-border-color);\n color: var(--ag-foreground-color);\n padding: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-balham .ag-tooltip,\n.ag-theme-balham-dark .ag-tooltip,\n.ag-theme-balham-auto-dark .ag-tooltip {\n border: none;\n}\n.ag-theme-balham .ag-panel-title-bar-button-icon,\n.ag-theme-balham-dark .ag-panel-title-bar-button-icon,\n.ag-theme-balham-auto-dark .ag-panel-title-bar-button-icon {\n font-size: calc(var(--ag-icon-size) + var(--ag-grid-size));\n}\n.ag-theme-balham .ag-panel,\n.ag-theme-balham-dark .ag-panel,\n.ag-theme-balham-auto-dark .ag-panel {\n background-color: var(--ag-header-background-color);\n}\n.ag-theme-balham .ag-chart-data-section,\n.ag-theme-balham .ag-chart-format-section,\n.ag-theme-balham .ag-chart-advanced-settings-section,\n.ag-theme-balham-dark .ag-chart-data-section,\n.ag-theme-balham-dark .ag-chart-format-section,\n.ag-theme-balham-dark .ag-chart-advanced-settings-section,\n.ag-theme-balham-auto-dark .ag-chart-data-section,\n.ag-theme-balham-auto-dark .ag-chart-format-section,\n.ag-theme-balham-auto-dark .ag-chart-advanced-settings-section {\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-balham .ag-group-toolbar,\n.ag-theme-balham-dark .ag-group-toolbar,\n.ag-theme-balham-auto-dark .ag-group-toolbar {\n background-color: var(--ag-subheader-toolbar-background-color);\n}\n.ag-theme-balham .ag-chart-tab,\n.ag-theme-balham-dark .ag-chart-tab,\n.ag-theme-balham-auto-dark .ag-chart-tab {\n padding-top: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-balham .ag-charts-format-sub-level-group-item,\n.ag-theme-balham-dark .ag-charts-format-sub-level-group-item,\n.ag-theme-balham-auto-dark .ag-charts-format-sub-level-group-item {\n margin-bottom: calc(var(--ag-grid-size) * 1.5);\n}\n.ag-theme-balham .ag-filter-active .ag-icon-filter,\n.ag-theme-balham-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-balham-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\n.ag-theme-balham-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\n.ag-theme-balham-auto-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\n min-height: calc(var(--ag-icon-size) + 4px);\n}\n.ag-theme-balham .ag-list-item-hovered::after,\n.ag-theme-balham-dark .ag-list-item-hovered::after,\n.ag-theme-balham-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-pill .ag-pill-button:hover,\n.ag-theme-balham-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-balham-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham .ag-disabled .ag-icon,\n.ag-theme-balham .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham [disabled] .ag-icon,\n.ag-theme-balham-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham-dark .ag-disabled .ag-icon,\n.ag-theme-balham-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham-dark [disabled] .ag-icon,\n.ag-theme-balham-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham-auto-dark .ag-disabled .ag-icon,\n.ag-theme-balham-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled,\n.ag-theme-balham-dark .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled,\n.ag-theme-balham-auto-dark .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled {\n color: unset;\n background-color: unset;\n}\n.ag-theme-balham .ag-filter-card-title,\n.ag-theme-balham-dark .ag-filter-card-title,\n.ag-theme-balham-auto-dark .ag-filter-card-title {\n font-weight: 600;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-balham.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridBalham";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABrcAAsAAAAAN4gAABqMAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKw3S3SwE2AiQDglwLgTAABCAFhEYHhhsb6y9VBoWNAwDF6P6IqOIERFEf9qR69v+n5MYYUoGaPRSsRLkLDn1h4nEsTPOkD3q8Y+vATyTL9CvDCrJEtHG0760OxKRjMjTzG/bzPumSXkjosEOS0OR54Bj5LjrpDrSyVgU84gFN5fu8c9WfNp3JElOmSZsi7QGyEff8KU9On9D7A7/N/3PvpS4ISAo4DEwwiYWIFwvBRgV1ba5Yob3JonVzFeqi8vr2Whe4al+kc1Hu7+u2ZwAQ5O34kbIJlEJr1k1oyVCbJdP6cOfIqtDl1Kl6Rk68karzGb7wtSRrhiQnrkgHABBc3deZf6Kn1Zlh4VLGjH3PL7vOFuDESH624MoAuyV/1ArgerQmnBQ4aWUpvcw0qiYql5fWFvsiwI/WflksWqgMOpGStcXdQ3bmHWYLnr4lxBK/QUhfyKahHu0SlqCRKM1qp5TO/M+llskNAIRFTc78/5O7+z/QXa6Yg+3SYcq/nOsAQAFLQAWUlPBuSKqgOrc5QEd2b0r3TdXKTQ0ih6sOb1beOLGtbwgh2xNedOqo6OVDC2PZzC6PsZln7KNwbRAGNZmN8dHvUQAqbWOU9RkU6Dz46Q1GEXV+Aaw3Fxz39D7o3RjSUlOAfkL5seo064Off9lXdUOJ8h6iEDZ3P2lipWk3bxfjqGnT9I/TcU2MYDBJijq9ammy2LS1Ls7mRFG29Co1mH6pXqO0vm9LZUYQOkNGRa3yLOnGuMp7Y6GUIKIkYqbSH3VZV+uD0gqNocmXfMV09IAWOS5m85KK9vWjIhlGphzv6qOJODjPBRIjJQxSxymxfa3jlk29NmS4mDFyrcDpkm1lt4sd2nqsdXhMdoTFNS1SvCnDSRsIgyOwwU3fRc9pYxJijDeyzIruQHARYRbJN46r67ToXOaRLzHDZITG5gZW5K5pldRVy5f6n7/q4UrCOlqtTWX20AxVZJdqsq0e38cWuB7zMt/8Oner/0ht8nx63scwCiZBFczTZG24QT6e3+VDpsi2wq16e5akQ45wf85FdffI0lp/pkOLM+6gtCLVpp1pakYXy6zPcLp90aeS/kPsDHcnZNHqs/DwU7HPRt+hdc8L+nmoIqmejrW6lNx2jagztrpXlvNeztOg8ROZF7qKqJnN1smZtz7XXWipQg+1LNYq6rr1ni/e5iyDVKOIVqOW7ZqMFxRUQmqawCwD88KxIvbCuEJYFlX8pG1CZArFRIxjl6hwM8+5BrlXslvCw/RM9sJOiRrnbdOaZu1VNJ3bt1CSl4A7IJRH6C2SSpFp6LZOKNzzyheHOlpU9tb4bAh+Gc4mjrTKRtCs+FW3v9pg0nDzLsjUc4vpaaHgt5EjkrEtUOOvpSatO1cNvfNXYwu9a8i+PkGHVVTXzNR0Yr+jKo7vWofLkxz7l5RI/m11VCh8WXvgb/j9go+dgheAQlqgfsXWg3yEf21EYj2Ak+LEX/p9vKwVlIAiMAaKoXC0rxa01GVqjKpV+hjiClCNUhAbnnvnR/bgoHH3vfQhaauvninQ7teOW3QIRmiYm+fKgvOGIE+V1gdmuJTnWiK5So1CVddAtWgtzz+MHTp16dajV59+AwYNGTZi1JhxEyZNmTajw6w58xYs6rdk2YpVa/p1WLehw6Y1W1S9tu3YtWffAUJz6MixE6fOnLuAgoq6gzf950+sOy4vm76BYCWRZgZ9UaSFFeUVqnbVQPFdZS7A+AdtgmuaADe0Dm5pCdzRMrinafBA++CRJsETrYJnmgWvtAbeaAW80xb4QPPgI82BT7QDvtAU+EqL4BvNgO+0DX7QHvhJC+AXbYDftAv+NBxAQBEAIQCMAAhMKQRlyiAYUw7BmQoIwVRCSKYKQjHVEJqpgTBMLYRl6iAcUw+5MA2QK9MI4ZkmiMA0Q0SmBSIxrRCZaYMoTDtEZTogGtMJ0ZkuiMF0Q0ymB2IxvRCb6YM4TD/EZQYgns0bPmQQQoYgZBhCRiBkFGJzRYAICBEgQoAYARIESLEayLBpIUe0oUCAEtuOCtEPNVYPDWIMWpgiSGePG3qEFgYEGBFgQoAZARYEWGGKIRtTAtlFDBwIcCLAGwE+CPBFgB8C/HFYxeFXzD/wHypnqO3V46TIX8H+V80gQPcVmEOdpwAiKm1pPhwVh/rgX8xggmJLpTHE3A4R36dWiAJU8XhRwKB+WCKL9MOjGRQBk8nnh4BukciDQoZQSHtHXzLmSXEN0oSebA8exgwbIQ9lsxn46mvCaYFeIhwfImDzZGIahRSJjFI0Co6HRQjJdPoPe+9x3EvkwfDA/XBhoLcEZ0ipVJxOo0pFhKoyODgtFIpIIjMBCMpKuGcosTmKliqkPJwCwkftrPSQ4azZZ+/flz8ubLt3T/dbybkHD3yejN7+8OHwP4uabg2x3YN59q23h/5eev6u79NR2+4Me8BsulfMRJiwQYkXf1B0ULpFMsSKrZwRfI4HDEEymkdVL5MjeTAcuDQQtoG5I7yF0K1orm220XjwC7GrYWmOYUBIfXH90j3pbd292gqr56BOlZnjTIu902eDYY5duWOm19r4SjBtzQ4a1Zm+daceAbl+Pw+7sIEjvuG7cGXdrXPM93u4vWfrrHYHkh3wJQJlFUjIQi8QSAhp6k2L2Bn2T0gE2WZoyPQPzwqYgAR7RiLuSHRaxD+YMMXGGVafrpr7baKYcQwncRbN4gyS2pCFcyyTS4HLgOxoIdgy8LEA0fbxhvJBHfV4oIXzzDQFXrKMzyVJOAqL4//n6Z0jkXT0Li3dP15wnRy7h/Ikh0ucedvnYX6/bAIFtrble8I/il/ifGEnxdgW/IYax55az4Esqw58Az1Pdv4X2zlvuO0XqCnAcqzdH1X2Qn1yJk8p8pzteJaHFckRwvOmjkaruktSyRYljlbSP3f4FOLj1diWxQrPk4Os7PtQZ8JqdQTI5OHzfDlb55htulI1hHqEY8OBFTV7nuVgVjsDtc/lgZirUnF6pqA0Ex4yDkdwTAcVIdWtmj438NCvRHSCCsXUk4E07TBOQLZdrLoSkSQVlVR+KLqD0bRYmK0V3KBaLiPHVYKCo1waNeirSi8yz9RY/ax1/rBx6Nzcx+V3vrXLq4ZTwh/TYXu4thIlV0eMqtSgEVO5UdBoimMKws6V26fMGcsGk4IaAvmnBQsWSz9klP+HghtqSlhow1dbSBzbl0qqy5oHwej6F19r+Ey8QkiwU4jO9g88gM/lJVML57PVchrZMdoaZf12j/Ni5WCNY0nCl83aYSBpCnWDrnr3GKldmmW0M3YRAUwjTXNRO8Fu4bB8phnHnMJyVpaBd1nx+Ry2PFBsjkM063Kl8Ot04BLAvGFi8FXyxsVWLht8VSsWac9VD9Tw4vtfINuDyO1ue3b4Bl74/PZcEC/mYFye2DH+un0HLd+/nAvhK1Qsbcc5MhdD7+t/bEE8m7QMKciP15161jaSqSoYaQPKhYZa3Dq+9WLyyWmVXs5WHdq0y4wVdCFeWd+oerJ0Ll0+qNIoW3syaWFHFEUcbgXq5ebDWdtEuukU3FeLZod6YAvRvknIZkd6QH6iCYKGRhgTStA3hGCEqT6zRdyZSFNuUsnmoOnsSqzoCU62aCFCA2l7lgIIDuNAHC5AVAZJU0j46Itvn8bk1sebSvmbmXa5+/gqkny0MX9NouO+eEw7b3z6YMWRlXRGN5qqfaGpTDWUOWg+uMKh7OpDPpbH14GVa49gYwXMN0Mj+m6OXnrUXuYZIuBysZR6oURkLzQ8/MHp9+jI8mjzrFwYaUZn1iHRaRxfUtvQ0wq/oh+mhLLYiG6tuaEU5Kh9sKuJig7/kWebSS+rB+a5/4eWZFYFhzmzF5SE2nPSrLWvgeLr1s0IN9ffVqP2n1knD7pxBw96pmXQPPKKY7WNicoOTsEOx6K3IPCqzgZswAZrCALMAGMDcm6p8LbAFBN9cYeW13JFEZ4DEX1Fif5CsmTWjMJ2Tr9CJLecFMoXNUz11ZSUBF60hkv75kPSTWGLzcSkgB1L1jxDSovE3eHHydJ6kmRabtuXF+JNM5earBV8RiUzVr7cmovO958uYqFoli47lsLZiDDNbfahBIrRc5pZEAwYBiQyAAP9yA9sKAloZiUl6/LEpRsXxi/Ss78ZtEM7dlGHv9SMO2rf9HhiZd38fvOZ8dx6yp78yhNwAjK5NvgNA+Vk6VbAvTTSlgIvUV6wpaDdSXBHVBzNd2n2UvSLjyhZ+7BGInszaHKbvX55q0Z6lqXkhrKFvfwl5Qab2yFS3H9++eGuqiTRk5uj5SrJbctvQVv/weUeWzIlCTWONwwpAvmjOL8U09v66/yz3Qsfd+BUa/qPeZB3uYZMPUvEzpBvfixRdIcJx0yJuKPvSGAO/wuGeCqeDIYFhB2mcyNQT4UjMs3Z8z9z1sbja1zokzU0LXL3Y6byts5efKvULkGCkPd7kP0qCi/gIZfo+bwtoMhbQs0esAXnPCCX+iXUgoMzk5XKZDo2hBRdmZysnHneCkZ7IUkIqqbAaHR79mJsMl/rL2desr+WfyByrIPz0MnxA+iGfqNxAOP4H/54/2nuzs94QvXLT2O6J3gOGI2uWmaUrjTpaXzU08Rx1qf/fhDcRJNqofOe2UyuRadLms1s9iMN91oXL75+G/D12a5XCNCueaO8DpAmonsLWu6IVvabT/2v2vn4vZe/Z+/IeFkyPR0NeRF67YPs1iVd/ZNspb/fi73OXFnuIr1aea6ppeO7x4Y3YfZcpfngEBH3pwAs2jRhRFe9sm1aRoTR/4qI+0+bIEGn5y7/kyu4IItlBlx5d+nWpWfituJnx7a2tnaHHA7uIklYJovc3ZfIsr+IazfDcl56pB9QkjxumtCsqm+LmwdSTn2qcl5FvRTOYBMtHQnt0ye9Rc4+1N/fr7GSvNCCQ94i+DGA4oS4/TsDtw5q+osjPF8P+CY5JuRrbGq1TZPv9gtX22zqfI2b0i2Ps1tUJqXSpLIcAmjKpLSoDsKZIV1wUBkUsHns2evem+F73KbIe7g5ybXF9dxcZanq6a8eqAbdPHVuVFSuukHtmxulxupGP/wWyod8J18k/26I3PtUh7zdufP6df/Nm6fPkLya8bcNFgNok3qE5qSeb9KH3u937GgpKUHROEMnH7yzo/N43JEjzb12qQJMoJDaXjTD2SdGjfGSmtAQpNoL0NCw5gOXS/6J7oGEIw19YRaVyhKmDVNaLKpwzF9FB6m/BNuDDTvT6Wf6/CGeH6Y0W1RhG4xbgpKD4INva/oy7M6/E8urZ8xPPomETAxRh0wIGeb+XU3LTt/y/rOmrhG5xwiN93yCzNjxwGOl/I7Qc6J6YHuySPFTNSbwig3m49vY9YYqLdfrtMbvUrlfQYF0DmfrCY5UIhLLOdf6+KxmzqxJM1948PL5nB1eH4ftgkjhH2J+A6VWtJ09WZ/1uw+fjY86kCgW7+ngt8U2qy4pSYkKRPWsmgwmVaK7K5m+iXthrETTFclgbuc74RqXkVwfGr2gcdP7wUCVWak026WYlfaUqM4wuVZYNru8QWiSqxjYBtBVhgW8TgiVXW3TtV3V+XKb90VIvjg09fZuofM3QWNo9Np64KdP7A3SMV12p7OwLm1K89Q0sZHLU3yKHWkcue227ScGN8qDl5E5Na/u8np+s0QoGVowJ79+6FIqg+vH5cOah0NKuOiNBsXbcdGTUP5o9EDmvKUBBdcR+cHWt4Vu0mJJCzzIswryhEnR1pho+0DEwv17vva197aTcRv/Sy8oQ4IKrXFZhiJBmXC03B5DtqQaSvX60tggcUL6ksjBtMIyRG6unLbesA1N8/c/nSAOii3Tx5QaAkWJ6erHm6JUqq4pFDWZ3BgV1mJYtY8F37sBRrSYljk1YLJiOtvJKTRmx6jzDfgawvZtqQPjpCMrDNMcPskPJYdYpfOqFFmXLWf20ReNiCmqUlxRTBUesQCyi0bcv4P0UbjNvKsKTV4QaO70MCPxQcX5GfV1HpXkcrCBU8qcWGdNMDSvCjQ5NQSvrj74BitWURb8YmNG9g9qzhXV1/Hg/+15F9tFfUQf9PcTLoJsMLqMlxqivWkIeipxvQfelmpt5bsIV01cDBFTQ7gBH8p+iDtHnAPVHNftxok+AoJXvWpsb0ypMQjhLhbsQhoa/iD+qG6HgFfyMlYZU5azeUO7Y4o7l99gMJTnikyNPOxUIPCS+s5xSn59G3BotmzJtjeOKV1eS65N21bKUGX4uqdMeS1eeGnG8e46ZlmWpDRjH8/hEDZyHRuWxZaXaXnoLsdbvzunBWPadiRm3RmvAv5YYoCY4dPZSYr73p2MlKgHiAF1nC1tLJ48NixH6j9QSh9edKKPH6Emk9NpteZu17ZiBqC5LXUanS4nAcsbnXDjHfboEVaQPXP1ZfQRX/xMa45OTPbyBU+euB+7n8wi3yScUSd8gwPiXvxfwXd3zRjErrVGT92Hj2WVKUcFZWcMt+jOBxYIx4gSiU7jViQPyQ9M9Y2fVtI0NJ7IRsxhScpRKxjZDFtgRlBWTkSmqp2SqbSFK+0KC91GtxauMqlSwzde+UK1UE1ZDd8nBKTSdHh5/SzPSVEO2aINf+Kq9usJSHN1fT3BXOMVL00sbMuhNN8Z4ZU+Vvbff88hRCDnn37Y/Hv+780PT/NdivkSxTmFZL6iL6L7PXlL/ZYqdgbM8X0ynfScTCv7QPLiXYQsSXZOmgxW15o1DJk+a3lnS8+UkqLVBwyEzyO5PP3sHykpE8uoFEmgPrtjyoYN1vHb9NfKqFWnXB9bW8dW8JlSaXWpmF7JW7+hch3rtwde7+7eHbWa+s8xw19TXzFGKsV49cnN4974+Hb2Rc5m0mbLs5HLZoYqU0wqZ9UyMv0ANnLLW5147X18mDyF3jBn1jeQSnHNJf6vSx/5nuNmGY3tsxtmITf3hZ6IWd0w93LDTPOcueCb1DNhTHBhUFNTUGHwGLdAg33ywqAxwe4M3fK42vLYkpiYktjy1w58aUlMuf41EOWnD9L3wliNB338rP39SNKhdy3LwXBeX1BQY+P0TItunJekCxmDen5foCUwL1ABCsuODszwdjhabkJNLQ7HOhtEJ07gcid6LkQnLCCXK8g03jBt2smT7YuXJCQAyZ8jDQKz0oHytDwqr6V1+PDnPWe71pOWMhj2/DmPu7TbJwdponc5ccWeJT7abne3YhKrZS7bUSlMbXmpHanKTF93hh78vOAvu9qb7ln42rz65bWvnTq6YEeJfgT0fjGbpcWScQRDWbWqWHrGEoC1FpryriRzhFkhcFdtrTAG91rovP75vUTvtscp1+fO5xN8+HBWloTpolOjlT6WJWNaHWaTnqFB3CeWBPpdr+fvtafMtKWcvUBcOGczzbSb9s2XEqEmK/3srrqaeXnui8aLZxtAm7J3niQu1G61eeXtIFroYPPYJ5KXHSSWBPP/pRvz2d3A9meDRPNaE3fcec7Je1JdTe7auWsXCZe55eXXMjKZ6IKxra0fXadWRXm6r1utccX8pvOv6kuKpvS0dH5nUjF4k+Hw4fXrp3Rk6wMlFOrEspSUP86mv3E9KPn9d/aTJ8lYfW7uO68Hv7HWVa7fwKuki0urq6oA142XpT/9NJ+YX56kulNgFAC+jnT/OI+YBzvJPwA6j+xdIV39/c9CnqFgF/VQ8NOHjwIcx0L0+3XMaOszjzWPu4O7+/u7/XGeWbdQux45RaVcQHsLgONocLyqeNuNyGOd/HxFUW7Rm7TmxPdjjGMmGScdgNofIpIyJCd53pLI303JfMXIkWBfqvxhMa8wXLVixpGiYrPZp+VtcojvlOn+CUmmlOzs+VO8uNBttSI3hRKAuYOB/6vUL3Cs2DHPBLyZCgAAaAcm3HZ1YE9cYCh2OAYsQRocZKYe7DkAwve0OeqwMhIiMM4CdB1G3RYyx1rRDr8cwOBVTMdeam7SGHMVyTLGtR/TBzFAMzAieGCfCPR1DhYpsQLzFp0p4+WeacNfMY0JvCkqNIVDqfbFFmC1jqnYbMSGYLbI7MxW7I+KrrsSf9AOFLqmYVMt2azOpaLaWMIhl4ptc2YneOdocbPI0Z390R2YDy8nsRFrwhlNNP3v8O5gT3GZdTzX8JHBwnoAkFH4n5fnebC/yJfA8RLgVzmEXAjA8Ak9g7qmf7GYfhtExeu4Q1ZghvXi+0NCzw95pHOFbf/+YIaDML3FAINALk/ocHmEg01kFOg3LBAsEgXgTwn2HU4FFoQNp4EHDCPMDDERWmaBAKYBBggFBwQkMM8ZjgIHNhPsKXgfoUDw5eFUEMMDQoPgl8OZkI9QvhsLgpFRs3H4is6+oh9x+qZh9hjJ1dy3+U8xOeH2af3Iur8vYoqoZNvNvk3L8Kzat32Uqf0UtjvyXtoQ5YeMrkfV8PLw0Hs+r41MKxy+orOv6MdnAPmbbuTZu9sWOdbJk//ThiT40ITbp/Ujp/8Xz9yjo5KVN/uDnJYn+VlDuW93apQp4j+1Ik7iQyKPfMhWf8h4jvUooYaXh3BLPa9jbbSw85zHzarWipq+AjkUUEIFNTRw9FOk4xTO/qD4l17ygijJiqrphmnZjuv5t/vj+QrCKE7SLC/Kqm7arh/GaV7WbT9OnGAwSRabw+XxBUKRWCKVyRVKlUvXYlmMwxBpQHXCFcYo25RjMgXu3SVaeuqpDLIhX5oRo15aUTK/G9l15/lk74k2HFtSipNjVLpmpc7MpT014iV2waXCY/0y5onTsRHWiEbJFkbCvjRRUspNWnIza1G1XNLOx82QAmon9tOQhrrkMY15pFS98xfEZTcUkxZDdKEcosyhyDXQwlOvlXdcsa+1F7SOh2bCnZvcgYqJeG6ulMXqYWE6YdEOvZctpDIIWymHlctUF9HLKPpupNvMqsKd9P0F0RCX0Q2jFgkXOk6ThmKdlS03MTSGaJNPcK2RqJWczczGUUXwcyoZYHCNWdAISptEqganpNO24rvekauZO1Disx3FZLuNVJ46HWNalXBsRlqiQfPmcBqj67A8oTZJOgPGZOG4DTu3Q2sLsk4BYYAIBAoOBBi2kMCABQ8j/MIGdtBNMEOAPSzQw2EF);\n font-weight: normal;\n font-style: normal;\n}\n.ag-theme-balham,\n.ag-theme-balham-dark,\n.ag-theme-balham-auto-dark {\n --ag-balham-active-color: #0091ea;\n --ag-foreground-color: #000;\n --ag-background-color: #fff;\n --ag-header-background-color: #f5f7f7;\n --ag-tooltip-background-color: #cbd0d3;\n --ag-subheader-background-color: #e2e9eb;\n --ag-control-panel-background-color: #f5f7f7;\n --ag-border-color: #bdc3c7;\n --ag-odd-row-background-color: #fcfdfe;\n --ag-row-hover-color: #ecf0f1;\n --ag-column-hover-color: #ecf0f1;\n --ag-input-border-color: #95a5a6;\n --ag-invalid-color: #e02525;\n --ag-input-disabled-background-color: #ebebeb;\n --ag-checkbox-unchecked-color: #7f8c8d;\n --ag-input-focus-border-color: #719ece;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-input-focus-box-shadow: 0 0 2px 1px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 2px 1px var(--ag-invalid-color);\n --ag-range-selection-border-color: var(--ag-balham-active-color);\n --ag-checkbox-checked-color: var(--ag-balham-active-color);\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-panel-background-color: var(--ag-header-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-balham-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-balham-active-color);\n --ag-column-drag-indicator-color: var(--ag-balham-active-color);\n --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\n --ag-subheader-toolbar-background-color: rgba(226, 233, 235, 0.5);\n --ag-row-border-color: rgba(189, 195, 199, 0.58);\n --ag-chip-background-color: rgba(0, 0, 0, 0.1);\n --ag-range-selection-background-color: rgba(0, 145, 234, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 145, 234, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 145, 234, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 145, 234, 0.59);\n --ag-selected-row-background-color: rgba(0, 145, 234, 0.28);\n --ag-header-column-separator-color: rgba(189, 195, 199, 0.5);\n --ag-input-disabled-border-color: rgba(149, 165, 166, 0.3);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-balham-active-color) 50%);\n --ag-header-column-separator-display: block;\n --ag-header-column-separator-height: 50%;\n --ag-grid-size: 4px;\n --ag-icon-size: 16px;\n --ag-row-height: calc(var(--ag-grid-size) * 7);\n --ag-header-height: calc(var(--ag-grid-size) * 8);\n --ag-list-item-height: calc(var(--ag-grid-size) * 6);\n --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-input-height: calc(var(--ag-grid-size) * 4);\n --ag-chart-menu-panel-width: 240px;\n --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 12px;\n --ag-icon-font-family: agGridBalham;\n --ag-border-radius: 2px;\n --ag-checkbox-border-radius: 3px;\n --ag-card-shadow: none;\n}\n\n.ag-theme-balham-dark {\n --ag-balham-active-color: #00b0ff;\n --ag-foreground-color: #f5f5f5;\n --ag-background-color: #2d3436;\n --ag-header-background-color: #1c1c1c;\n --ag-tooltip-background-color: #1c1f20;\n --ag-subheader-background-color: #111;\n --ag-control-panel-background-color: #202020;\n --ag-border-color: #424242;\n --ag-odd-row-background-color: #262c2e;\n --ag-row-hover-color: #3d4749;\n --ag-column-hover-color: #3d4749;\n --ag-input-border-color: #f0f0f0;\n --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\n --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\n --ag-checkbox-unchecked-color: #ecf0f1;\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\n --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\n --ag-row-border-color: #5c5c5c;\n --ag-chip-background-color: rgba(245, 245, 245, 0.08);\n --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\n --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\n --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\n --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\n --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\n --ag-toggle-button-off-background-color: transparent;\n --ag-toggle-button-off-border-color: var(--ag-foreground-color);\n --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\n --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\n --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 4px 1.5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-balham-auto-dark {\n --ag-balham-active-color: #00b0ff;\n --ag-foreground-color: #f5f5f5;\n --ag-background-color: #2d3436;\n --ag-header-background-color: #1c1c1c;\n --ag-tooltip-background-color: #1c1f20;\n --ag-subheader-background-color: #111;\n --ag-control-panel-background-color: #202020;\n --ag-border-color: #424242;\n --ag-odd-row-background-color: #262c2e;\n --ag-row-hover-color: #3d4749;\n --ag-column-hover-color: #3d4749;\n --ag-input-border-color: #f0f0f0;\n --ag-input-disabled-background-color: rgba(48, 46, 46, 0.3);\n --ag-modal-overlay-background-color: rgba(45, 52, 54, 0.66);\n --ag-checkbox-unchecked-color: #ecf0f1;\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-disabled-foreground-color: rgba(245, 245, 245, 0.38);\n --ag-subheader-toolbar-background-color: rgba(17, 17, 17, 0.5);\n --ag-row-border-color: #5c5c5c;\n --ag-chip-background-color: rgba(245, 245, 245, 0.08);\n --ag-range-selection-background-color: rgba(0, 176, 255, 0.2);\n --ag-range-selection-background-color-2: rgba(0, 176, 255, 0.36);\n --ag-range-selection-background-color-3: rgba(0, 176, 255, 0.49);\n --ag-range-selection-background-color-4: rgba(0, 176, 255, 0.59);\n --ag-selected-row-background-color: rgba(0, 176, 255, 0.28);\n --ag-header-column-separator-color: rgba(66, 66, 66, 0.5);\n --ag-input-disabled-border-color: rgba(240, 240, 240, 0.3);\n --ag-header-foreground-color: rgba(245, 245, 245, 0.64);\n --ag-toggle-button-off-background-color: transparent;\n --ag-toggle-button-off-border-color: var(--ag-foreground-color);\n --ag-range-selection-chart-category-background-color: rgba(26, 177, 74, 0.5);\n --ag-range-selection-chart-background-color: rgba(45, 166, 255, 0.5);\n --ag-input-focus-box-shadow: 0 0 4px 1.5px var(--ag-input-focus-border-color);\n --ag-input-error-focus-box-shadow: 0 0 4px 1.5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-balham .ag-filter-toolpanel-header,\n.ag-theme-balham .ag-filter-toolpanel-search,\n.ag-theme-balham .ag-status-bar,\n.ag-theme-balham .ag-header-row,\n.ag-theme-balham .ag-row-number-cell,\n.ag-theme-balham .ag-multi-filter-group-title-bar,\n.ag-theme-balham-dark .ag-filter-toolpanel-header,\n.ag-theme-balham-dark .ag-filter-toolpanel-search,\n.ag-theme-balham-dark .ag-status-bar,\n.ag-theme-balham-dark .ag-header-row,\n.ag-theme-balham-dark .ag-row-number-cell,\n.ag-theme-balham-dark .ag-multi-filter-group-title-bar,\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-balham-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-balham-auto-dark .ag-status-bar,\n.ag-theme-balham-auto-dark .ag-header-row,\n.ag-theme-balham-auto-dark .ag-row-number-cell,\n.ag-theme-balham-auto-dark .ag-multi-filter-group-title-bar {\n font-weight: 600;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-balham .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham .ag-ltr input[class^=ag-][type=text], .ag-theme-balham .ag-ltr input[class^=ag-][type=number], .ag-theme-balham .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham .ag-ltr input[class^=ag-][type=date], .ag-theme-balham .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-ltr textarea[class^=ag-], .ag-theme-balham-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-ltr textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham .ag-rtl input[class^=ag-][type=text], .ag-theme-balham .ag-rtl input[class^=ag-][type=number], .ag-theme-balham .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham .ag-rtl input[class^=ag-][type=date], .ag-theme-balham .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham .ag-rtl textarea[class^=ag-], .ag-theme-balham-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-dark .ag-rtl textarea[class^=ag-], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-balham-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-balham-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-column-drop-vertical-empty-message,\n.ag-theme-balham .ag-status-bar,\n.ag-theme-balham-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-balham-dark .ag-status-bar,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-balham-auto-dark .ag-status-bar {\n font-weight: 600;\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham.ag-dnd-ghost,\n.ag-theme-balham-dark.ag-dnd-ghost,\n.ag-theme-balham-auto-dark.ag-dnd-ghost {\n font-size: var(--ag-font-size);\n font-weight: 600;\n}\n.ag-theme-balham .ag-tab,\n.ag-theme-balham-dark .ag-tab,\n.ag-theme-balham-auto-dark .ag-tab {\n border: 1px solid transparent;\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n margin: var(--ag-grid-size);\n margin-bottom: -1px;\n}\n.ag-theme-balham .ag-tab-selected,\n.ag-theme-balham-dark .ag-tab-selected,\n.ag-theme-balham-auto-dark .ag-tab-selected {\n background-color: var(--ag-background-color);\n border-color: var(--ag-border-color);\n border-bottom-color: transparent;\n}\n.ag-theme-balham .ag-tabs-header,\n.ag-theme-balham-dark .ag-tabs-header,\n.ag-theme-balham-auto-dark .ag-tabs-header {\n border-bottom: 1px solid var(--ag-border-color);\n}\n.ag-theme-balham .ag-column-drop-cell,\n.ag-theme-balham-dark .ag-column-drop-cell,\n.ag-theme-balham-auto-dark .ag-column-drop-cell {\n height: calc(var(--ag-grid-size) * 6);\n}\n.ag-theme-balham .ag-column-drop-vertical-title,\n.ag-theme-balham-dark .ag-column-drop-vertical-title,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-title {\n color: var(--ag-foreground-color);\n}\n.ag-theme-balham .ag-column-drop-vertical-cell,\n.ag-theme-balham-dark .ag-column-drop-vertical-cell,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical-cell-text,\n.ag-theme-balham-dark .ag-column-drop-vertical-cell-text,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-cell-text {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical-icon,\n.ag-theme-balham-dark .ag-column-drop-vertical-icon,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical-icon {\n color: var(--ag-secondary-foreground-color);\n}\n.ag-theme-balham .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\n padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-balham-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\n padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-balham .ag-column-drop-horizontal,\n.ag-theme-balham-dark .ag-column-drop-horizontal,\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal {\n height: var(--ag-header-height);\n}\n.ag-theme-balham .ag-column-drop-empty,\n.ag-theme-balham-dark .ag-column-drop-empty,\n.ag-theme-balham-auto-dark .ag-column-drop-empty {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham .ag-column-drop-horizontal-cell-text,\n.ag-theme-balham-dark .ag-column-drop-horizontal-cell-text,\n.ag-theme-balham-auto-dark .ag-column-drop-horizontal-cell-text {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-drop-vertical,\n.ag-theme-balham-dark .ag-column-drop-vertical,\n.ag-theme-balham-auto-dark .ag-column-drop-vertical {\n padding-top: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-balham .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-balham-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-balham-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-balham .ag-menu-header,\n.ag-theme-balham-dark .ag-menu-header,\n.ag-theme-balham-auto-dark .ag-menu-header {\n background-color: var(--ag-header-background-color);\n}\n.ag-theme-balham .ag-overlay-loading-center,\n.ag-theme-balham .ag-overlay-exporting-center,\n.ag-theme-balham-dark .ag-overlay-loading-center,\n.ag-theme-balham-dark .ag-overlay-exporting-center,\n.ag-theme-balham-auto-dark .ag-overlay-loading-center,\n.ag-theme-balham-auto-dark .ag-overlay-exporting-center {\n background-color: var(--ag-background-color);\n border: 1px solid var(--ag-border-color);\n color: var(--ag-foreground-color);\n padding: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-balham .ag-tooltip,\n.ag-theme-balham-dark .ag-tooltip,\n.ag-theme-balham-auto-dark .ag-tooltip {\n border: none;\n}\n.ag-theme-balham .ag-panel-title-bar-button-icon,\n.ag-theme-balham-dark .ag-panel-title-bar-button-icon,\n.ag-theme-balham-auto-dark .ag-panel-title-bar-button-icon {\n font-size: calc(var(--ag-icon-size) + var(--ag-grid-size));\n}\n.ag-theme-balham .ag-panel,\n.ag-theme-balham-dark .ag-panel,\n.ag-theme-balham-auto-dark .ag-panel {\n background-color: var(--ag-header-background-color);\n}\n.ag-theme-balham .ag-chart-data-section,\n.ag-theme-balham .ag-chart-format-section,\n.ag-theme-balham .ag-chart-advanced-settings-section,\n.ag-theme-balham-dark .ag-chart-data-section,\n.ag-theme-balham-dark .ag-chart-format-section,\n.ag-theme-balham-dark .ag-chart-advanced-settings-section,\n.ag-theme-balham-auto-dark .ag-chart-data-section,\n.ag-theme-balham-auto-dark .ag-chart-format-section,\n.ag-theme-balham-auto-dark .ag-chart-advanced-settings-section {\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-balham .ag-group-toolbar,\n.ag-theme-balham-dark .ag-group-toolbar,\n.ag-theme-balham-auto-dark .ag-group-toolbar {\n background-color: var(--ag-subheader-toolbar-background-color);\n}\n.ag-theme-balham .ag-chart-tab,\n.ag-theme-balham-dark .ag-chart-tab,\n.ag-theme-balham-auto-dark .ag-chart-tab {\n padding-top: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-balham .ag-charts-format-sub-level-group-item,\n.ag-theme-balham-dark .ag-charts-format-sub-level-group-item,\n.ag-theme-balham-auto-dark .ag-charts-format-sub-level-group-item {\n margin-bottom: calc(var(--ag-grid-size) * 1.5);\n}\n.ag-theme-balham .ag-filter-active .ag-icon-filter,\n.ag-theme-balham-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-balham-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\n.ag-theme-balham-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input,\n.ag-theme-balham-auto-dark .ag-color-input input[class^=ag-][type=text].ag-input-field-input {\n min-height: calc(var(--ag-icon-size) + 4px);\n}\n.ag-theme-balham .ag-list-item-hovered::after,\n.ag-theme-balham-dark .ag-list-item-hovered::after,\n.ag-theme-balham-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-pill .ag-pill-button:hover,\n.ag-theme-balham-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-balham-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-balham-active-color);\n}\n.ag-theme-balham .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham .ag-disabled .ag-icon,\n.ag-theme-balham .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham [disabled] .ag-icon,\n.ag-theme-balham-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham-dark .ag-disabled .ag-icon,\n.ag-theme-balham-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham-dark [disabled] .ag-icon,\n.ag-theme-balham-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-balham-auto-dark .ag-disabled .ag-icon,\n.ag-theme-balham-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-balham-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-balham .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled,\n.ag-theme-balham-dark .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled,\n.ag-theme-balham-auto-dark .ag-filter-panel .ag-standard-button.ag-filter-panel-buttons-apply-button:disabled {\n color: unset;\n background-color: unset;\n}\n.ag-theme-balham .ag-filter-card-title,\n.ag-theme-balham-dark .ag-filter-card-title,\n.ag-theme-balham-auto-dark .ag-filter-card-title {\n font-weight: 600;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-material-no-font.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '.ag-theme-material,\n.ag-theme-material-dark,\n.ag-theme-material-auto-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #ff4081;\n --ag-foreground-color: rgba(0, 0, 0, 0.87);\n --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\n --ag-background-color: #fff;\n --ag-header-background-color: #fff;\n --ag-tooltip-background-color: #fff;\n --ag-subheader-background-color: #eee;\n --ag-subheader-toolbar-background-color: rgba(238, 238, 238, 0.5);\n --ag-header-cell-hover-background-color: #f2f2f2;\n --ag-chip-background-color: #e2e2e2;\n --ag-range-selection-background-color: rgba(122, 134, 203, 0.1);\n --ag-range-selection-background-color-2: rgba(122, 134, 203, 0.19);\n --ag-range-selection-background-color-3: rgba(122, 134, 203, 0.27);\n --ag-range-selection-background-color-4: rgba(122, 134, 203, 0.34);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-material-accent-color) 50%);\n --ag-range-selection-highlight-color: #fce4ec;\n --ag-row-hover-color: #fafafa;\n --ag-column-hover-color: #fafafa;\n --ag-control-panel-background-color: #fafafa;\n --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\n --ag-checkbox-unchecked-color: #333;\n --ag-value-change-value-highlight-background-color: #00acc1;\n --ag-side-button-selected-background-color: transparent;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-filter-panel-apply-button-color: var(--ag-material-primary-color);\n --ag-filter-panel-apply-button-background-color: transparent;\n --ag-column-panel-apply-button-color: var(--ag-material-primary-color);\n --ag-column-panel-apply-button-background-color: transparent;\n --ag-range-selection-border-color: var(--ag-material-primary-color);\n --ag-checkbox-checked-color: var(--ag-material-accent-color);\n --ag-borders: none;\n --ag-borders-critical: solid 1px;\n --ag-border-color: #e2e2e2;\n --ag-grid-size: 8px;\n --ag-icon-size: 18px;\n --ag-header-height: calc(var(--ag-grid-size) * 7);\n --ag-row-height: calc(var(--ag-grid-size) * 6);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-list-item-height: calc(var(--ag-grid-size) * 4);\n --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\n --ag-filter-tool-panel-sub-level-row-height: calc(var(--ag-grid-size) * 4);\n --ag-checkbox-border-radius: 2px;\n --ag-toggle-button-switch-border-width: 2px;\n --ag-toggle-button-height: var(--ag-icon-size);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.75);\n --ag-font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 13px;\n --ag-icon-font-family: agGridMaterial;\n --ag-selected-tab-underline-color: var(--ag-material-primary-color);\n --ag-selected-tab-underline-width: 2px;\n --ag-input-focus-border-color: var(--ag-material-primary-color);\n --ag-input-focus-box-shadow: 0 0 0 5px rgba(32, 33, 36, 0.122);\n --ag-input-error-focus-box-shadow: 0 0 0 5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n --ag-card-radius: 2px;\n --ag-invalid-color: #e02525;\n}\n\n.ag-theme-material-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #bb86fcff;\n --ag-range-selection-border-color: var(--ag-material-accent-color);\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-background-color: #121212ff;\n --ag-foreground-color: #ffffffff;\n --ag-data-color: #f5f5f5ff;\n --ag-header-cell-hover-background-color: #000000ff;\n --ag-advanced-filter-join-pill-color: #7a3a37ff;\n --ag-advanced-filter-column-pill-color: #355f2dff;\n --ag-advanced-filter-option-pill-color: #5a3168ff;\n --ag-advanced-filter-value-pill-color: #374c86ff;\n --ag-input-disabled-border-color: #3a434eff;\n --ag-input-disabled-background-color: #68686e12;\n --ag-selected-row-background-color: #bb86fc33;\n --ag-row-hover-color: #bb86fc33;\n --ag-column-hover-color: #f5f5f50d;\n --ag-range-selection-background-color: #bb86fc1a;\n --ag-range-selection-background-color-2: #bb86fc30;\n --ag-range-selection-background-color-3: #bb86fc45;\n --ag-range-selection-background-color-4: #bb86fc57;\n --ag-border-color: #383838ff;\n --ag-secondary-border-color: #383838ff;\n --ag-header-background-color: #121212ff;\n --ag-tooltip-background-color: #212b38ff;\n --ag-odd-row-background-color: #121212ff;\n --ag-control-panel-background-color: #2c2c2cff;\n --ag-subheader-background-color: #ffffff0d;\n --ag-subheader-toolbar-background-color: #2c2c2cff;\n --ag-invalid-color: #e02525ff;\n --ag-checkbox-unchecked-color: #797e87ff;\n --ag-checkbox-background-color: #121212ff;\n --ag-secondary-foreground-color: #f5f5f5ff;\n --ag-input-border-color: #383838ff;\n --ag-input-border-color-invalid: #e02525ff;\n --ag-disabled-foreground-color: #f5f5f580;\n --ag-chip-background-color: #22262812;\n --ag-side-button-selected-background-color: #2c2c2cff;\n --ag-selected-tab-underline-color: #3f51b5ff;\n --ag-modal-overlay-background-color: #121212a8;\n --ag-value-change-delta-up-color: #43a047a8;\n --ag-value-change-delta-down-color: #e53935ff;\n --ag-menu-background-color: #2c2c2cff;\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-material-auto-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #bb86fcff;\n --ag-range-selection-border-color: var(--ag-material-accent-color);\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-background-color: #121212ff;\n --ag-foreground-color: #ffffffff;\n --ag-data-color: #f5f5f5ff;\n --ag-header-cell-hover-background-color: #000000ff;\n --ag-advanced-filter-join-pill-color: #7a3a37ff;\n --ag-advanced-filter-column-pill-color: #355f2dff;\n --ag-advanced-filter-option-pill-color: #5a3168ff;\n --ag-advanced-filter-value-pill-color: #374c86ff;\n --ag-input-disabled-border-color: #3a434eff;\n --ag-input-disabled-background-color: #68686e12;\n --ag-selected-row-background-color: #bb86fc33;\n --ag-row-hover-color: #bb86fc33;\n --ag-column-hover-color: #f5f5f50d;\n --ag-range-selection-background-color: #bb86fc1a;\n --ag-range-selection-background-color-2: #bb86fc30;\n --ag-range-selection-background-color-3: #bb86fc45;\n --ag-range-selection-background-color-4: #bb86fc57;\n --ag-border-color: #383838ff;\n --ag-secondary-border-color: #383838ff;\n --ag-header-background-color: #121212ff;\n --ag-tooltip-background-color: #212b38ff;\n --ag-odd-row-background-color: #121212ff;\n --ag-control-panel-background-color: #2c2c2cff;\n --ag-subheader-background-color: #ffffff0d;\n --ag-subheader-toolbar-background-color: #2c2c2cff;\n --ag-invalid-color: #e02525ff;\n --ag-checkbox-unchecked-color: #797e87ff;\n --ag-checkbox-background-color: #121212ff;\n --ag-secondary-foreground-color: #f5f5f5ff;\n --ag-input-border-color: #383838ff;\n --ag-input-border-color-invalid: #e02525ff;\n --ag-disabled-foreground-color: #f5f5f580;\n --ag-chip-background-color: #22262812;\n --ag-side-button-selected-background-color: #2c2c2cff;\n --ag-selected-tab-underline-color: #3f51b5ff;\n --ag-modal-overlay-background-color: #121212a8;\n --ag-value-change-delta-up-color: #43a047a8;\n --ag-value-change-delta-down-color: #e53935ff;\n --ag-menu-background-color: #2c2c2cff;\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-material .ag-filter-toolpanel-header,\n.ag-theme-material .ag-filter-toolpanel-search,\n.ag-theme-material .ag-status-bar,\n.ag-theme-material .ag-header-row,\n.ag-theme-material .ag-row-number-cell,\n.ag-theme-material .ag-panel-title-bar-title,\n.ag-theme-material .ag-multi-filter-group-title-bar,\n.ag-theme-material-dark .ag-filter-toolpanel-header,\n.ag-theme-material-dark .ag-filter-toolpanel-search,\n.ag-theme-material-dark .ag-status-bar,\n.ag-theme-material-dark .ag-header-row,\n.ag-theme-material-dark .ag-row-number-cell,\n.ag-theme-material-dark .ag-panel-title-bar-title,\n.ag-theme-material-dark .ag-multi-filter-group-title-bar,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-material-auto-dark .ag-status-bar,\n.ag-theme-material-auto-dark .ag-header-row,\n.ag-theme-material-auto-dark .ag-row-number-cell,\n.ag-theme-material-auto-dark .ag-panel-title-bar-title,\n.ag-theme-material-auto-dark .ag-multi-filter-group-title-bar {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-material .ag-tab,\n.ag-theme-material-dark .ag-tab,\n.ag-theme-material-auto-dark .ag-tab {\n height: calc(var(--ag-grid-size) * 4.5);\n flex: 1 1 auto;\n}\n.ag-theme-material .ag-tabs-header,\n.ag-theme-material .ag-column-drop-horizontal,\n.ag-theme-material-dark .ag-tabs-header,\n.ag-theme-material-dark .ag-column-drop-horizontal,\n.ag-theme-material-auto-dark .ag-tabs-header,\n.ag-theme-material-auto-dark .ag-column-drop-horizontal {\n background-color: var(--ag-subheader-background-color);\n}\n.ag-theme-material .ag-tabs-body,\n.ag-theme-material-dark .ag-tabs-body,\n.ag-theme-material-auto-dark .ag-tabs-body {\n padding: calc(var(--ag-grid-size) * 0.5) 0;\n}\n.ag-theme-material .ag-tabs-body .ag-menu-list,\n.ag-theme-material-dark .ag-tabs-body .ag-menu-list,\n.ag-theme-material-auto-dark .ag-tabs-body .ag-menu-list {\n padding-top: 0;\n padding-bottom: 0;\n}\n.ag-theme-material .ag-header-cell,\n.ag-theme-material .ag-header-group-cell,\n.ag-theme-material-dark .ag-header-cell,\n.ag-theme-material-dark .ag-header-group-cell,\n.ag-theme-material-auto-dark .ag-header-cell,\n.ag-theme-material-auto-dark .ag-header-group-cell {\n transition: background-color 0.5s;\n}\n.ag-theme-material .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing {\n bottom: 0;\n}\n.ag-theme-material .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-cell-inline-editing {\n padding: var(--ag-grid-size);\n height: calc(var(--ag-row-height) + var(--ag-grid-size) * 3);\n border-color: var(--ag-border-color) !important;\n}\n.ag-theme-material .ag-has-focus .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-has-focus .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-has-focus .ag-cell-inline-editing {\n border-color: var(--ag-input-focus-border-color) !important;\n}\n.ag-theme-material .ag-column-drop-vertical,\n.ag-theme-material-dark .ag-column-drop-vertical,\n.ag-theme-material-auto-dark .ag-column-drop-vertical {\n border-bottom: solid 1px;\n border-bottom-color: var(--ag-border-color);\n padding-top: var(--ag-grid-size);\n}\n.ag-theme-material .ag-column-drop-vertical.ag-last-column-drop,\n.ag-theme-material-dark .ag-column-drop-vertical.ag-last-column-drop,\n.ag-theme-material-auto-dark .ag-column-drop-vertical.ag-last-column-drop {\n border-bottom: none;\n}\n.ag-theme-material .ag-column-drop-vertical-cell,\n.ag-theme-material-dark .ag-column-drop-vertical-cell,\n.ag-theme-material-auto-dark .ag-column-drop-vertical-cell {\n margin-left: 0;\n}\n.ag-theme-material .ag-column-drop-vertical-empty-message,\n.ag-theme-material-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-material-auto-dark .ag-column-drop-vertical-empty-message {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-material .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\n padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\n padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-status-bar,\n.ag-theme-material-dark .ag-status-bar,\n.ag-theme-material-auto-dark .ag-status-bar {\n border: solid 1px;\n border-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-panel-column-select,\n.ag-theme-material-dark .ag-column-panel-column-select,\n.ag-theme-material-auto-dark .ag-column-panel-column-select {\n border-top: solid 1px;\n border-top-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-select,\n.ag-theme-material .ag-column-select-header,\n.ag-theme-material-dark .ag-column-select,\n.ag-theme-material-dark .ag-column-select-header,\n.ag-theme-material-auto-dark .ag-column-select,\n.ag-theme-material-auto-dark .ag-column-select-header {\n border-bottom: solid 1px;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-select-header,\n.ag-theme-material-dark .ag-column-select-header,\n.ag-theme-material-auto-dark .ag-column-select-header {\n height: var(--ag-header-height);\n}\n.ag-theme-material .ag-group-title-bar,\n.ag-theme-material-dark .ag-group-title-bar,\n.ag-theme-material-auto-dark .ag-group-title-bar {\n padding: calc(var(--ag-grid-size) * 0.75) var(--ag-grid-size);\n}\n.ag-theme-material .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-material-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-material-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding: calc(var(--ag-grid-size) * 0.5) var(--ag-grid-size);\n}\n.ag-theme-material .ag-chart-data-section,\n.ag-theme-material .ag-chart-format-section,\n.ag-theme-material .ag-chart-advanced-settings-section,\n.ag-theme-material-dark .ag-chart-data-section,\n.ag-theme-material-dark .ag-chart-format-section,\n.ag-theme-material-dark .ag-chart-advanced-settings-section,\n.ag-theme-material-auto-dark .ag-chart-data-section,\n.ag-theme-material-auto-dark .ag-chart-format-section,\n.ag-theme-material-auto-dark .ag-chart-advanced-settings-section {\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-material input[class^=ag-]:not([type]),\n.ag-theme-material input[class^=ag-][type=text],\n.ag-theme-material input[class^=ag-][type=number],\n.ag-theme-material input[class^=ag-][type=tel],\n.ag-theme-material input[class^=ag-][type=date],\n.ag-theme-material input[class^=ag-][type=datetime-local],\n.ag-theme-material textarea[class^=ag-],\n.ag-theme-material-dark input[class^=ag-]:not([type]),\n.ag-theme-material-dark input[class^=ag-][type=text],\n.ag-theme-material-dark input[class^=ag-][type=number],\n.ag-theme-material-dark input[class^=ag-][type=tel],\n.ag-theme-material-dark input[class^=ag-][type=date],\n.ag-theme-material-dark input[class^=ag-][type=datetime-local],\n.ag-theme-material-dark textarea[class^=ag-],\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-material-auto-dark input[class^=ag-][type=text],\n.ag-theme-material-auto-dark input[class^=ag-][type=number],\n.ag-theme-material-auto-dark input[class^=ag-][type=tel],\n.ag-theme-material-auto-dark input[class^=ag-][type=date],\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-material-auto-dark textarea[class^=ag-] {\n background: transparent;\n color: var(--ag-foreground-color);\n font-family: inherit;\n font-size: inherit;\n padding-bottom: var(--ag-grid-size);\n border-width: 0;\n border-radius: 0;\n border-bottom: 2px solid;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material textarea[class^=ag-]:not(textarea),\n.ag-theme-material-dark input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material-dark textarea[class^=ag-]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material-auto-dark textarea[class^=ag-]:not(textarea) {\n height: calc(var(--ag-grid-size) * 5);\n}\n.ag-theme-material input[class^=ag-]:not([type]):focus,\n.ag-theme-material input[class^=ag-][type=text]:focus,\n.ag-theme-material input[class^=ag-][type=number]:focus,\n.ag-theme-material input[class^=ag-][type=tel]:focus,\n.ag-theme-material input[class^=ag-][type=date]:focus,\n.ag-theme-material input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material textarea[class^=ag-]:focus,\n.ag-theme-material-dark input[class^=ag-]:not([type]):focus,\n.ag-theme-material-dark input[class^=ag-][type=text]:focus,\n.ag-theme-material-dark input[class^=ag-][type=number]:focus,\n.ag-theme-material-dark input[class^=ag-][type=tel]:focus,\n.ag-theme-material-dark input[class^=ag-][type=date]:focus,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material-dark textarea[class^=ag-]:focus,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material-auto-dark textarea[class^=ag-]:focus {\n border-bottom: 2px solid;\n border-bottom-color: var(--ag-material-primary-color);\n outline: none;\n box-shadow: none;\n}\n.ag-theme-material input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material input[class^=ag-][type=text]::placeholder,\n.ag-theme-material input[class^=ag-][type=number]::placeholder,\n.ag-theme-material input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material input[class^=ag-][type=date]::placeholder,\n.ag-theme-material input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material textarea[class^=ag-]::placeholder,\n.ag-theme-material-dark input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=text]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=number]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=date]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material-dark textarea[class^=ag-]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material-auto-dark textarea[class^=ag-]::placeholder {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):disabled,\n.ag-theme-material input[class^=ag-][type=text]:disabled,\n.ag-theme-material input[class^=ag-][type=number]:disabled,\n.ag-theme-material input[class^=ag-][type=tel]:disabled,\n.ag-theme-material input[class^=ag-][type=date]:disabled,\n.ag-theme-material input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material textarea[class^=ag-]:disabled,\n.ag-theme-material-dark input[class^=ag-]:not([type]):disabled,\n.ag-theme-material-dark input[class^=ag-][type=text]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=number]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=tel]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=date]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material-dark textarea[class^=ag-]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material-auto-dark textarea[class^=ag-]:disabled {\n border-bottom: 1px solid;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):invalid,\n.ag-theme-material input[class^=ag-][type=text]:invalid,\n.ag-theme-material input[class^=ag-][type=number]:invalid,\n.ag-theme-material input[class^=ag-][type=tel]:invalid,\n.ag-theme-material input[class^=ag-][type=date]:invalid,\n.ag-theme-material input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material textarea[class^=ag-]:invalid,\n.ag-theme-material-dark input[class^=ag-]:not([type]):invalid,\n.ag-theme-material-dark input[class^=ag-][type=text]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=number]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=tel]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=date]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material-dark textarea[class^=ag-]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material-auto-dark textarea[class^=ag-]:invalid {\n border-width: 0;\n border-bottom: 1px solid;\n border-bottom-color: var(--ag-invalid-color);\n color: var(--ag-invalid-color);\n}\n.ag-theme-material .ag-standard-button,\n.ag-theme-material-dark .ag-standard-button,\n.ag-theme-material-auto-dark .ag-standard-button {\n appearance: none;\n background-color: transparent;\n border: 0;\n color: var(--ag-material-primary-color);\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n padding: 0;\n text-transform: uppercase;\n}\n.ag-theme-material .ag-standard-button:disabled,\n.ag-theme-material-dark .ag-standard-button:disabled,\n.ag-theme-material-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-material.ag-dnd-ghost,\n.ag-theme-material-dark.ag-dnd-ghost,\n.ag-theme-material-auto-dark.ag-dnd-ghost {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n}\n.ag-theme-material .ag-filter-toolpanel-header,\n.ag-theme-material-dark .ag-filter-toolpanel-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header {\n height: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-material .ag-filter-toolpanel-group-level-0-header,\n.ag-theme-material-dark .ag-filter-toolpanel-group-level-0-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-group-level-0-header {\n height: calc(var(--ag-grid-size) * 7);\n}\n.ag-theme-material .ag-filter-card-title,\n.ag-theme-material-dark .ag-filter-card-title,\n.ag-theme-material-auto-dark .ag-filter-card-title {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n}\n.ag-theme-material .ag-filter-panel .ag-standard-button,\n.ag-theme-material-dark .ag-filter-panel .ag-standard-button,\n.ag-theme-material-auto-dark .ag-filter-panel .ag-standard-button {\n padding: var(--ag-grid-size);\n}\n.ag-theme-material .ag-filter-add-button,\n.ag-theme-material-dark .ag-filter-add-button,\n.ag-theme-material-auto-dark .ag-filter-add-button {\n border-bottom: 2px solid var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-filter-add-button .ag-icon,\n.ag-theme-material-dark .ag-filter-add-button .ag-icon,\n.ag-theme-material-auto-dark .ag-filter-add-button .ag-icon {\n color: var(--ag-material-active-color);\n}\n.ag-theme-material .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-builder-button {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-builder-button {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material .ag-layout-print .ag-center-cols-container,\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-material .ag-picker-field-wrapper:focus-within,\n.ag-theme-material-dark .ag-picker-field-wrapper:focus-within,\n.ag-theme-material-auto-dark .ag-picker-field-wrapper:focus-within {\n box-shadow: 0 0 0 1px var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-rich-select-list,\n.ag-theme-material-dark .ag-rich-select-list,\n.ag-theme-material-auto-dark .ag-rich-select-list {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\n}\n.ag-theme-material .ag-advanced-filter-builder-button-label,\n.ag-theme-material-dark .ag-advanced-filter-builder-button-label,\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-button-label {\n text-transform: uppercase;\n}\n.ag-theme-material .ag-filter-active .ag-icon-filter,\n.ag-theme-material-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-material-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-material-accent-color);\n}\n.ag-theme-material .ag-list-item-hovered::after,\n.ag-theme-material-dark .ag-list-item-hovered::after,\n.ag-theme-material-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-pill .ag-pill-button:hover,\n.ag-theme-material-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-material-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-header-highlight-before::after,\n.ag-theme-material .ag-header-highlight-after::after,\n.ag-theme-material-dark .ag-header-highlight-before::after,\n.ag-theme-material-dark .ag-header-highlight-after::after,\n.ag-theme-material-auto-dark .ag-header-highlight-before::after,\n.ag-theme-material-auto-dark .ag-header-highlight-after::after {\n background-color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material .ag-disabled .ag-icon,\n.ag-theme-material .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material [disabled] .ag-icon,\n.ag-theme-material-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material-dark .ag-disabled .ag-icon,\n.ag-theme-material-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material-dark [disabled] .ag-icon,\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material-auto-dark .ag-disabled .ag-icon,\n.ag-theme-material-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-material.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridMaterial";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABZQAAsAAAAAL8gAABX+AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKs2CqQQE2AiQDgmgLgTYABCAFhF4HhkIbrClVBDYOAAp8YUL2/9cEKSNmyMulLaJuYkm1oqKy9FiOakGnfexb/SBrV3TNoHbYatUmH9MLTy4P+YJwCS85tzc52B+FmWjKRO1GOISDbcYzN+5PGP6zy1BKImIs3ScKAKnECAAsIAldJTq+2pzPqzO/LTlRwkcItiVbxjtToIC0DH2dcO40dB6OALjc/Vgiz08PthpCAU1sU4QJRXka4Jh/8NvqAUZToogJ3wysplzR9eRjNbp7BrAR4VaChc7xjWtvEzbLypO9KLbw7uCCywBogACCg5Dp1mt/g4HBaeIRGAUS6xDKbUBvE6tRaQDTd6bgnIO0PGbJEn7t+N613sxBYWZzW2LHz1d9EPYgk/nEKz4XaAuJzdrjMgoDlvj+4JymNrVjuLoiEOoS0AFhahs7hsCJYH9qfrNT2+xhwSljtvxS6iSD4EiwxBPCVyKAwK15j9dTUGxQDiZB/Z/Osj3dBZAmOAkXFZbYVTMjGf6f0dryojwrYyU7zltFIdlBBsORjh1AKirgLi9tqp6LJmV7L0VTxa1lxO0vmNqj+c9Y04ddB1rNqMiQ0EiZfc2x63o5CqBp3Sl1fPkpqsv3wysMovhFC7A/aGH5Pb4LNhxENSsUsA8gOahq0jvf3233t1GH+Zcat/u5B82QpmzaplOSosSI+jNxBp1gsUmqHDPYos3h0sI+zuWVInWhCZIIs3qnQZppp1RmAGWywtkRzCLXnDqdb7k1dikliFL8mK0VXdp5NW1vaYHGYggJ5xcd792joIGLuQKneoe6MZGMTro8e18XTcTDBc7RMupCL1JMUtpd6cZGdtLQ4GJWwbDAmRJZ6oNiRckg7AnY3BKKGwqq2dsynLSGsnguaIDxYe8pJTYhpgsKTnF6V1BcRJhE6/vMuJyqWcdiD3yyoiQpIGNyLSouvKSokr61i0rLs68a4FqEVSwIpzK7WA2lqF3d4Fps336buA7TYl/8Pd+8jgZld3pqLhOmrDjW3mmFXiFev1t/yRbRdvFFnYZGmvEUd5/zMXWDo9GufKoimx3upJKKekmZTWrDFMuob3CmPaVOJeYZvYPDMY7GVpLCkz9RJmnUFcXUdgSTznP3ON+RoumdpzJl+VJdVy6Sep1buUCeJnTEE2petDmXqwrsgW6oe1q9qQPxi7Aqp66zu2iXJyxXe1FFg+ZtGi3P8ihfMoxACIs8e8iLtTBswW55lR61TmHrGEYXsdou3MZNYEWPlDJ2DG6nHVkL2z4qmHaN2xR7j2Du3JiRAgdgH7ZsoTiJUGXy6pYZQesdL3xyoKKR0ljGncF6Ybhp4lBRLRQy835p0r+ExU+5pmHVVHOz7smmBb2FtkjDNYOUH2ZGLTuzagfdV8YUal8ffUmF7LciTZsNRZX+MipF+4Y9vkDS9k+nhYZXfkigePAFf5Nvv3BXVEGFIi3Cn8HJC/EA/4VF5C9wpzx8oT8Knt4QqIASWAZlKNb6aqFCRH0ZUVS9NdQVoI1RUSueeuNbxJxW3PXcuyhSkrsF5Sg8bNYuECEv66a5VkfRlot6Skm9RQakeKqOSEObQkXk5DEFRf/8HWNFVU1dh05duvXo1affgEFDho0YNWbchIpJU6bNmNVtzrwFi5YsW7FqTcW6DZuITlu27di1Zx+lOXDoyLETp86cQyHF9+Az/+evnng+bxmhhYvDRNoZzD2RNp2o0UawkzZQ3qnxAKysyBl4TFbBE3ICnpJ98IwcgOdkA7wgN+AlWQOvyBF4TbbAW3IM3pFD8J6cgw9kB3wk2+ATuQRfyDr4SvbAN7IJvpML8INcg59kF/wip+A3uQJ/NrmFgChREBAUDASFgFKFoJQaBKPUITilASEoTQhJaUEoShtCUzoQhtIFYSndkBOlB3Km9EIulD4IR+mH8JQBiEAZhIiUIYhEGYbIlBGIQhmFqJQxiEYZh+iUCYhBmYSYlCmIRZmG2JQZiEOZhbiUDsQj5iDEPIRYgBCLEGIJYtZV+UChCoCgQiCoCAgqBoJKgKBSIKgMCCoHgipA6UBKlFYVEFQNBNWAUoK0ZrupDshM9UBQAxDUCAQ1AUHNQFALKGXISqlANlRc7UBQBxDUCwjqDQT1AYL6AkH9AFDFnc1s/vNP7USzwb3CW9sASsFaIumPAwL1GHgT87qmFbI1g87EzNpYKjGUo5CEHSWyCsi8OcjaJ5XXbwm+JPNDi4MjkjIMk7FEA/mYxuuC7QPtqfChA1vOZ0PEciax399Cn5HjZPAVsGg6oBQiQZzzPJHEcTLBoS+FPLOEInFcFq6weQcKGqINdABr4EeO4+af4EwqdxpAyBcqgAbx7BfzPk76PMXqRQKyhgyCYaBVq1CRsqiQBUcrkqM81xbS7PHyMHaPYMgEkNebVR5VX6dR4O48hNmrI9ShWZwPS6Gc6/SVUcFfP8+hRYOjZMjibPa4Cm6AONTj66to5QFifpgyLpxbhgiU6w0UPIM40coquRElOypr6jKT1HK2hSlSmF11TGWbMb6v5MUq7Oz+3W11N31USkPdP63gxP9XyIo3VvBFvZmOl62piq2xVMwk5TB/swUUUphuC082YJPbfBS3Z8+3cZv91tPMgnDCykfYVoI43bRt8/AFji+UeW5+RJjrimf0V+Am8JTgC7vBkwQ4zgxjgMG+KIKpBIZh5Ga7WGZTkTQKHwBU1Lwtu09RF+9V9F9tUVGnVWMNolyzabOht2dqYFAj/sAnEC5t1txWduxpfMYFCIEhx0KhmODT68didrgK3FnZp+oOwbABXBfFXN+6gL31buUABldzziUvGPRSOVH1ZGhNWufQWRrM5TeVMgGNxXtdaI3BYCNLSw2Fg14Edpm6R+/7VHbPnks4wfkKVmAu+C43XeSpC2fSOT5FJy1baGyjOV29hRcX7u4rZW42T+BBh2zsGrxOmOCR3id5zNny/MgRW63o7ryYUS3L3sfDnQ0AF2i4UeV8Rs51QjYRGJjgp6uGtDfn4p2rPwwPBXaDsvr///ndT639aMd2wYAd12F40+Hty98KxfzD0NDr2Q3htoYGSHBftYt31fg/87/HAL1BdijUG+Pn/rOZXzf9MxIOVtDqIT5el9aO2glwQcWwpiE6a+XKL2SBcpiWVLwUQ+msdhsPEBMVgWSPmw9yvFs0A1n028/iZCPnrDbuHEl1br5m9ai/fqfsUPj5cTO/wn27YsvuLCrHapfuzguyJ/f/72f/LgobUsjGKgRj5aLxwkBDJGDRqDRWJXEBYbV5FYNoFeUhyjvL08fsP7k5v5slZb/Vcx/+OsNfTfL+F/zPclO805bDBuywi8QOjDy/XyIzifeWiqQ0UGIGZHT+xCm04k6kIqfSUnjaOo/XFuNbAAVC4sdQURLl9Ey50melH6zcNNtXLQ8IL+z4BCSRaUOI6iWXYs77uUvBTbOHmetm5dQiYdaNOf1svo5pmSOlTSVJc6XumHhsbn5K3G9f4zwtslw0nIg1K+6dblKdvLF48Yk6JBebJaL+00WVrxsweDCDTGf40z/VfgHw2+9u7gPHldqF9JeToi/6Lb0w3alQ4fPGOZHK+MYjmA1f0hSeQOMNW3ceH5wBlsrD/RwFO02dHByhI97cZmYOZ0+IjNp8RkGhxXiTZHmH+Zw3oANXjvoajQulyYIuTttBNgNJIEC5Z5EYATzrb8XYjuJSPRB8Oa/n/WrRqvirEtsMCfD0+fohY0i5u+U+OVugokl8dHCyklg9PXQqebkWd0hZJGlupC6rHIVx95LiyKrcvhT25/Hripv3vGLhnLR26XxDL5kpjLzJ5FtY6e8q0Je5yh80b+p7rLWp0REivyrxYgmrGH8z4hlyWBImrbs0qjDcQPPGAv4ei6klo2kYgSQC/YqRbAo5JYeS6pyBi9XDyvXbKs4tnqoUXvh3mSaRk1mbS0zbfcfHIr6g2oFJpXf5iDR+m5fyCjf8cASLS39uADMq9fq/0b9/0g8JhRBzajnoOcBNs3anKidpx8384d/Xyxd+dWWSXpdmMDjWufiAN4HPjIxxDXvz4sogps8btbyQUbjPXy7R9pb6al1laDtBXBjEH/SgER8ghEhuY8LI5qDOVmFYOvMJjfhjJzWTnUQ88h2Reo2RbIc8+UUzrlly6axd+qSro0MX8KH/iFYLhxiiSafRNjz55dmYbon33jblDgRpycQVztXqPeFy7C/e8B/r5E/xrqxgQ65VLi5wLZPbuHafA5nMSYe7iAKLh9xpcB+xCBZ7YTye0rVB+/dOzldnAt7Z5+Q1CVVxcVUJNd+SdbYq7j35b8cMY4pzZwWK1cA58RphbNV2xfZX/HWCdXrz+r/WQ/wZvZ1X2KSXnddkmFfw3WEidjRaXt7jR2p1Xr7ePxoSKgtVZzfbxSVFqqTa9vD6rkqlrKvD41NTHqvr40ePP0396KNjr8VurJ+DD+GGvjkGmBJjzqxYG+oBdOuYzZA9wugBFZsAZ94pb95S/0qzGUIIt0wIsPgo37St8DkLED4LWEkci48AU/mc/xyi9uiG9Pyo674gbvKnJsl66W7O57iApoCogMaAuNV/JvfQF+Pu323YdBg3bROYQVrESVWzDsc9J51JTVF/9XBorAfrCVTXZH+Kbbfj5pR1MUTXL6J9NBKf4mK3HU5dnzm50Wkunk7PTBT7Y05bVsneOJCLKE4q19/i+iDc+VsXyjaLjbQex9VJ+d94URxtywayXFw+eETpTD4WrAnS0oOBttl+g9DOks6eorddIF6rpEePhNvY9VDkEGp01GoMi4veCYFWCodo4zuvGJyYEfoGEV9sd82d6XYq+5Rttu1JFqM9h+sjDNbhz8o+6cZiXMvJWVys8gY22eRPx8ut+MAmH5dsWvH+sZYVLulEMuuP5NL00u4J9IENMcKBLMxrEW26dZZyjO5Mjy3eUbQ59qClDdGHSIFjw83EgjfYRwhnSA1L2awA5oBEKCyJbirge3G9Vre681rQWlmekLMnuwmnyM/myGyZcTuyJSMcVoDvfzxulpvAyHj/OfhVF6SXle+J2XfweaBP7DEw/ngBJlb7cr34XqqjVT14HodYeTY0JyQkp8SsMyWiNQTPeNrJ7nzK3iwYqMyYCENUIoNIhphQE/zOvn1LOOR0zDMjakKBTZErRUoFtq4AT+hyfzf10/JkLjJM18lrJmlbiJTXZFJdm1RThJ+H86uNvYDX33r9oDCEQeJnCn1GhDGMYCuxxOr4+Ko1Zg2JUg9kmDFolY/mb1D3isG84DOWqpa3hZDNDZL8fEnDSdnJwy4jx9GnGpJ9FRkZcQewnmo2iAywzbzxtxtQw3gdA2AeM4lMac6gV3beISePlxeU53pTVR4qDMnNDRGGlic2Ib2TkwykSUjdZRKz4iBqb/OnD/4t+Hf6ExawOla2IAn4kg8iB1mYGfudoAPdrtqOQllse3ujn9fLr0JCdLrlTVoxuryMirWblnXAJiUovUPveZ/ivVBvMUZxxqKLcd+N/Tc8PzYsNwbdm3AzM1g/9ia88f/l6ch5c1QfpKlfYi916pA/vvb6xgr/Er/2dr8S/4oXZp1tb38vucL/haK9Vf2+1oq4Uja7NK5ikYw3X8quiFtMHRKM7zhrsrLWHNpsZw6Jf122uZyqd3bm4JPX7EqHhajdJl+Br8j3xgZ9he7NzcoxnlZO7QwKSPleQ/n9h6WPIEsjR/pqLfzoo8Gf9EajAsY8BagAho/dem51Bs18HO7fv/+6IaFxHOWLpLTalMTBT61VV4hENvzm3bsu8FdlJN61zwdhzmUZxWJvdE1VpUCAYTHXroPDlLsy/SLmDdatu5iOsT6KtJ8+Dp2aYsfRLPQXCkaM9TfkNXCAaRbPC84+w261mCdDeZevpV27gnJlYi622y0tkFugSWJv04ZdWaXr6dcvN0OUp95FTw0UF6DhIcVA29vsSHb8LCVjw39kYAMvpdeB4qgDR6Yj9EcbolM/lV+RkxfXr9f29fb1acGYQNVSJxL9N89TEyL+VPID91YAtbk4itXzGqGY+XuujjgPOef4tRHxBu1T2V/4eaf/ypsTfgF+bZDje7bXjlGukf2z69uYNLyX7/Tu1ZX7KRebfTCR48UlamD+J12AhmqiathTZT+gjpjNOn+d2SyRU2tGXKiuRYOD6JXT6L1/LhUoIdIIxuV58UiAfoWlgKWJI5ZD/l/OzQf7XRUifz1zctmCpcFTC7ZQN6GWChSWI/PjtHoiE+sUKjp/4L20Oti259WIdEwikjSIGuLXVyKyvzojmoG7d2NGRyljo5yNZ3ncQwr3w4O4wcMMxUUuVxF6mAI7vf+f/93IoV28jQ2ELAApn8tM7CzZe0RYxJTA9DmaSNNh4iKbCA2ma/sE3nChXYTbJluZV/k2wtt0GI/EjqRKFbloKV6fqGY27D90K2fh5RdTRbBDwtWVz+EfKjuWTbOOauMiBpiQU3WxW1y95AxCGgUJG2v7Ib5SVZaRShKqauoJDtB0vBc8A/5EGSdtLisRDltge5Gh4XTDzqJ8ZU+Cctyb4CSfBd/L1rWK4CU9mXefIKqL3fxvj18Gf2jYWDUx5Tcbe4IegDLb727tCjn9U/TeCuq3qUMIkpuj+e0w8Y2s0PxjW/35IwnRuhtsQ98AbexM0G+t3gGP2sYDqsa+ZMhL1gAi7B4YtegUaVCCDeiqRY/JBkuwYu47dMF6IIBiYQsKDMMhEBWq8A8IFh0GikVHiQa98Dqdw7I4IEVo4Dx+fSWYxfkFwmuJ7iMoSoT0DUNNMDoa6Zv4hVIiU3fb35z0XyOhzN5J1w3LrkzhTtV3XnjsXjEppsRdFn5Eq/1MNd9fX/tJH73lcQ3Ca4nuY7iyog/pG3NDFZcexOhYq+WvEAq+60zdbX9jbLyWJFuqoOuG5SZYpnA3W1F90AuPQr6yLAwhRcAzmdX+I9pQ97MCfr6/jk7Om+reWrFeCq4FUOSz38jIBqFodBZWxs8VfGD+4LfwPTheECVZUTXdMC3bcb3r7f54+kEYxUma5UVZ1U3b9cM4zcu67YcHzzz3wkuvvPbGW++898FHn3z2xVfffPfDT7/89sdf//xvBCsIBtDItAUlPC+bcGwD61ILA7+ZbNlOFlNrLxA9WWG0TwMvzLaI7upoPpEcKsoYCRTPTg1XMooe2EwsJseDJWX7zagjlT2bpAJW0TU287K1xaVs2jNt2lebst0Wv156p5wM1ju6XfzRlARltinKWz7SFdNtx0nRJlTMbSiuucnsoE2aXrdSUMn9bqcEFynsjH0Rx7jCZpxUdxy1pJlQEu5TqoGUeA6nzbmzuIkotTkm1hOZfTNshqrKZNj746M4aiXCTJvSJ9wrj4WGcTynnaiE2od5jtqZchdBb8XNnKkgUid3jw/IGWmnbucDTb5rabNY4Y7b3Eluw52qNRoqB1RK03ruVt232KHD1bQInRlYlcc9qayc91rDmcThQs0HO1HR1FzMBw5hztUexR+uAecaHFHXQSCQihiZKywnmXkyWDB/VbY08VZNAQAA);\n font-weight: normal;\n font-style: normal;\n}\n.ag-theme-material,\n.ag-theme-material-dark,\n.ag-theme-material-auto-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #ff4081;\n --ag-foreground-color: rgba(0, 0, 0, 0.87);\n --ag-secondary-foreground-color: rgba(0, 0, 0, 0.54);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.38);\n --ag-background-color: #fff;\n --ag-header-background-color: #fff;\n --ag-tooltip-background-color: #fff;\n --ag-subheader-background-color: #eee;\n --ag-subheader-toolbar-background-color: rgba(238, 238, 238, 0.5);\n --ag-header-cell-hover-background-color: #f2f2f2;\n --ag-chip-background-color: #e2e2e2;\n --ag-range-selection-background-color: rgba(122, 134, 203, 0.1);\n --ag-range-selection-background-color-2: rgba(122, 134, 203, 0.19);\n --ag-range-selection-background-color-3: rgba(122, 134, 203, 0.27);\n --ag-range-selection-background-color-4: rgba(122, 134, 203, 0.34);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-material-accent-color) 50%);\n --ag-range-selection-highlight-color: #fce4ec;\n --ag-row-hover-color: #fafafa;\n --ag-column-hover-color: #fafafa;\n --ag-control-panel-background-color: #fafafa;\n --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\n --ag-checkbox-unchecked-color: #333;\n --ag-value-change-value-highlight-background-color: #00acc1;\n --ag-side-button-selected-background-color: transparent;\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-filter-panel-apply-button-color: var(--ag-material-primary-color);\n --ag-filter-panel-apply-button-background-color: transparent;\n --ag-column-panel-apply-button-color: var(--ag-material-primary-color);\n --ag-column-panel-apply-button-background-color: transparent;\n --ag-range-selection-border-color: var(--ag-material-primary-color);\n --ag-checkbox-checked-color: var(--ag-material-accent-color);\n --ag-borders: none;\n --ag-borders-critical: solid 1px;\n --ag-border-color: #e2e2e2;\n --ag-grid-size: 8px;\n --ag-icon-size: 18px;\n --ag-header-height: calc(var(--ag-grid-size) * 7);\n --ag-row-height: calc(var(--ag-grid-size) * 6);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-list-item-height: calc(var(--ag-grid-size) * 4);\n --ag-row-group-indent-size: calc(var(--ag-grid-size) * 3 + var(--ag-icon-size));\n --ag-filter-tool-panel-sub-level-row-height: calc(var(--ag-grid-size) * 4);\n --ag-checkbox-border-radius: 2px;\n --ag-toggle-button-switch-border-width: 2px;\n --ag-toggle-button-height: var(--ag-icon-size);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.75);\n --ag-font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell,\n "Helvetica Neue", sans-serif;\n --ag-font-size: 13px;\n --ag-icon-font-family: agGridMaterial;\n --ag-selected-tab-underline-color: var(--ag-material-primary-color);\n --ag-selected-tab-underline-width: 2px;\n --ag-input-focus-border-color: var(--ag-material-primary-color);\n --ag-input-focus-box-shadow: 0 0 0 5px rgba(32, 33, 36, 0.122);\n --ag-input-error-focus-box-shadow: 0 0 0 5px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 0.5%);\n --ag-card-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),\n 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n --ag-card-radius: 2px;\n --ag-invalid-color: #e02525;\n}\n\n.ag-theme-material-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #bb86fcff;\n --ag-range-selection-border-color: var(--ag-material-accent-color);\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-background-color: #121212ff;\n --ag-foreground-color: #ffffffff;\n --ag-data-color: #f5f5f5ff;\n --ag-header-cell-hover-background-color: #000000ff;\n --ag-advanced-filter-join-pill-color: #7a3a37ff;\n --ag-advanced-filter-column-pill-color: #355f2dff;\n --ag-advanced-filter-option-pill-color: #5a3168ff;\n --ag-advanced-filter-value-pill-color: #374c86ff;\n --ag-input-disabled-border-color: #3a434eff;\n --ag-input-disabled-background-color: #68686e12;\n --ag-selected-row-background-color: #bb86fc33;\n --ag-row-hover-color: #bb86fc33;\n --ag-column-hover-color: #f5f5f50d;\n --ag-range-selection-background-color: #bb86fc1a;\n --ag-range-selection-background-color-2: #bb86fc30;\n --ag-range-selection-background-color-3: #bb86fc45;\n --ag-range-selection-background-color-4: #bb86fc57;\n --ag-border-color: #383838ff;\n --ag-secondary-border-color: #383838ff;\n --ag-header-background-color: #121212ff;\n --ag-tooltip-background-color: #212b38ff;\n --ag-odd-row-background-color: #121212ff;\n --ag-control-panel-background-color: #2c2c2cff;\n --ag-subheader-background-color: #ffffff0d;\n --ag-subheader-toolbar-background-color: #2c2c2cff;\n --ag-invalid-color: #e02525ff;\n --ag-checkbox-unchecked-color: #797e87ff;\n --ag-checkbox-background-color: #121212ff;\n --ag-secondary-foreground-color: #f5f5f5ff;\n --ag-input-border-color: #383838ff;\n --ag-input-border-color-invalid: #e02525ff;\n --ag-disabled-foreground-color: #f5f5f580;\n --ag-chip-background-color: #22262812;\n --ag-side-button-selected-background-color: #2c2c2cff;\n --ag-selected-tab-underline-color: #3f51b5ff;\n --ag-modal-overlay-background-color: #121212a8;\n --ag-value-change-delta-up-color: #43a047a8;\n --ag-value-change-delta-down-color: #e53935ff;\n --ag-menu-background-color: #2c2c2cff;\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-material-auto-dark {\n --ag-material-primary-color: #3f51b5;\n --ag-material-accent-color: #bb86fcff;\n --ag-range-selection-border-color: var(--ag-material-accent-color);\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-background-color: #121212ff;\n --ag-foreground-color: #ffffffff;\n --ag-data-color: #f5f5f5ff;\n --ag-header-cell-hover-background-color: #000000ff;\n --ag-advanced-filter-join-pill-color: #7a3a37ff;\n --ag-advanced-filter-column-pill-color: #355f2dff;\n --ag-advanced-filter-option-pill-color: #5a3168ff;\n --ag-advanced-filter-value-pill-color: #374c86ff;\n --ag-input-disabled-border-color: #3a434eff;\n --ag-input-disabled-background-color: #68686e12;\n --ag-selected-row-background-color: #bb86fc33;\n --ag-row-hover-color: #bb86fc33;\n --ag-column-hover-color: #f5f5f50d;\n --ag-range-selection-background-color: #bb86fc1a;\n --ag-range-selection-background-color-2: #bb86fc30;\n --ag-range-selection-background-color-3: #bb86fc45;\n --ag-range-selection-background-color-4: #bb86fc57;\n --ag-border-color: #383838ff;\n --ag-secondary-border-color: #383838ff;\n --ag-header-background-color: #121212ff;\n --ag-tooltip-background-color: #212b38ff;\n --ag-odd-row-background-color: #121212ff;\n --ag-control-panel-background-color: #2c2c2cff;\n --ag-subheader-background-color: #ffffff0d;\n --ag-subheader-toolbar-background-color: #2c2c2cff;\n --ag-invalid-color: #e02525ff;\n --ag-checkbox-unchecked-color: #797e87ff;\n --ag-checkbox-background-color: #121212ff;\n --ag-secondary-foreground-color: #f5f5f5ff;\n --ag-input-border-color: #383838ff;\n --ag-input-border-color-invalid: #e02525ff;\n --ag-disabled-foreground-color: #f5f5f580;\n --ag-chip-background-color: #22262812;\n --ag-side-button-selected-background-color: #2c2c2cff;\n --ag-selected-tab-underline-color: #3f51b5ff;\n --ag-modal-overlay-background-color: #121212a8;\n --ag-value-change-delta-up-color: #43a047a8;\n --ag-value-change-delta-down-color: #e53935ff;\n --ag-menu-background-color: #2c2c2cff;\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-material .ag-filter-toolpanel-header,\n.ag-theme-material .ag-filter-toolpanel-search,\n.ag-theme-material .ag-status-bar,\n.ag-theme-material .ag-header-row,\n.ag-theme-material .ag-row-number-cell,\n.ag-theme-material .ag-panel-title-bar-title,\n.ag-theme-material .ag-multi-filter-group-title-bar,\n.ag-theme-material-dark .ag-filter-toolpanel-header,\n.ag-theme-material-dark .ag-filter-toolpanel-search,\n.ag-theme-material-dark .ag-status-bar,\n.ag-theme-material-dark .ag-header-row,\n.ag-theme-material-dark .ag-row-number-cell,\n.ag-theme-material-dark .ag-panel-title-bar-title,\n.ag-theme-material-dark .ag-multi-filter-group-title-bar,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-material-auto-dark .ag-status-bar,\n.ag-theme-material-auto-dark .ag-header-row,\n.ag-theme-material-auto-dark .ag-row-number-cell,\n.ag-theme-material-auto-dark .ag-panel-title-bar-title,\n.ag-theme-material-auto-dark .ag-multi-filter-group-title-bar {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-material .ag-tab,\n.ag-theme-material-dark .ag-tab,\n.ag-theme-material-auto-dark .ag-tab {\n height: calc(var(--ag-grid-size) * 4.5);\n flex: 1 1 auto;\n}\n.ag-theme-material .ag-tabs-header,\n.ag-theme-material .ag-column-drop-horizontal,\n.ag-theme-material-dark .ag-tabs-header,\n.ag-theme-material-dark .ag-column-drop-horizontal,\n.ag-theme-material-auto-dark .ag-tabs-header,\n.ag-theme-material-auto-dark .ag-column-drop-horizontal {\n background-color: var(--ag-subheader-background-color);\n}\n.ag-theme-material .ag-tabs-body,\n.ag-theme-material-dark .ag-tabs-body,\n.ag-theme-material-auto-dark .ag-tabs-body {\n padding: calc(var(--ag-grid-size) * 0.5) 0;\n}\n.ag-theme-material .ag-tabs-body .ag-menu-list,\n.ag-theme-material-dark .ag-tabs-body .ag-menu-list,\n.ag-theme-material-auto-dark .ag-tabs-body .ag-menu-list {\n padding-top: 0;\n padding-bottom: 0;\n}\n.ag-theme-material .ag-header-cell,\n.ag-theme-material .ag-header-group-cell,\n.ag-theme-material-dark .ag-header-cell,\n.ag-theme-material-dark .ag-header-group-cell,\n.ag-theme-material-auto-dark .ag-header-cell,\n.ag-theme-material-auto-dark .ag-header-group-cell {\n transition: background-color 0.5s;\n}\n.ag-theme-material .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-row-last:not(.ag-row-first) .ag-cell-inline-editing {\n bottom: 0;\n}\n.ag-theme-material .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-cell-inline-editing {\n padding: var(--ag-grid-size);\n height: calc(var(--ag-row-height) + var(--ag-grid-size) * 3);\n border-color: var(--ag-border-color) !important;\n}\n.ag-theme-material .ag-has-focus .ag-cell-inline-editing,\n.ag-theme-material-dark .ag-has-focus .ag-cell-inline-editing,\n.ag-theme-material-auto-dark .ag-has-focus .ag-cell-inline-editing {\n border-color: var(--ag-input-focus-border-color) !important;\n}\n.ag-theme-material .ag-column-drop-vertical,\n.ag-theme-material-dark .ag-column-drop-vertical,\n.ag-theme-material-auto-dark .ag-column-drop-vertical {\n border-bottom: solid 1px;\n border-bottom-color: var(--ag-border-color);\n padding-top: var(--ag-grid-size);\n}\n.ag-theme-material .ag-column-drop-vertical.ag-last-column-drop,\n.ag-theme-material-dark .ag-column-drop-vertical.ag-last-column-drop,\n.ag-theme-material-auto-dark .ag-column-drop-vertical.ag-last-column-drop {\n border-bottom: none;\n}\n.ag-theme-material .ag-column-drop-vertical-cell,\n.ag-theme-material-dark .ag-column-drop-vertical-cell,\n.ag-theme-material-auto-dark .ag-column-drop-vertical-cell {\n margin-left: 0;\n}\n.ag-theme-material .ag-column-drop-vertical-empty-message,\n.ag-theme-material-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-material-auto-dark .ag-column-drop-vertical-empty-message {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-material .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-ltr .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-ltr .ag-column-drop-vertical-empty-message {\n padding-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-dark .ag-rtl .ag-column-drop-vertical-empty-message, .ag-theme-material-auto-dark .ag-rtl .ag-column-drop-vertical-empty-message {\n padding-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-status-bar,\n.ag-theme-material-dark .ag-status-bar,\n.ag-theme-material-auto-dark .ag-status-bar {\n border: solid 1px;\n border-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-panel-column-select,\n.ag-theme-material-dark .ag-column-panel-column-select,\n.ag-theme-material-auto-dark .ag-column-panel-column-select {\n border-top: solid 1px;\n border-top-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-select,\n.ag-theme-material .ag-column-select-header,\n.ag-theme-material-dark .ag-column-select,\n.ag-theme-material-dark .ag-column-select-header,\n.ag-theme-material-auto-dark .ag-column-select,\n.ag-theme-material-auto-dark .ag-column-select-header {\n border-bottom: solid 1px;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material .ag-column-select-header,\n.ag-theme-material-dark .ag-column-select-header,\n.ag-theme-material-auto-dark .ag-column-select-header {\n height: var(--ag-header-height);\n}\n.ag-theme-material .ag-group-title-bar,\n.ag-theme-material-dark .ag-group-title-bar,\n.ag-theme-material-auto-dark .ag-group-title-bar {\n padding: calc(var(--ag-grid-size) * 0.75) var(--ag-grid-size);\n}\n.ag-theme-material .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-material-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-material-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding: calc(var(--ag-grid-size) * 0.5) var(--ag-grid-size);\n}\n.ag-theme-material .ag-chart-data-section,\n.ag-theme-material .ag-chart-format-section,\n.ag-theme-material .ag-chart-advanced-settings-section,\n.ag-theme-material-dark .ag-chart-data-section,\n.ag-theme-material-dark .ag-chart-format-section,\n.ag-theme-material-dark .ag-chart-advanced-settings-section,\n.ag-theme-material-auto-dark .ag-chart-data-section,\n.ag-theme-material-auto-dark .ag-chart-format-section,\n.ag-theme-material-auto-dark .ag-chart-advanced-settings-section {\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-material input[class^=ag-]:not([type]),\n.ag-theme-material input[class^=ag-][type=text],\n.ag-theme-material input[class^=ag-][type=number],\n.ag-theme-material input[class^=ag-][type=tel],\n.ag-theme-material input[class^=ag-][type=date],\n.ag-theme-material input[class^=ag-][type=datetime-local],\n.ag-theme-material textarea[class^=ag-],\n.ag-theme-material-dark input[class^=ag-]:not([type]),\n.ag-theme-material-dark input[class^=ag-][type=text],\n.ag-theme-material-dark input[class^=ag-][type=number],\n.ag-theme-material-dark input[class^=ag-][type=tel],\n.ag-theme-material-dark input[class^=ag-][type=date],\n.ag-theme-material-dark input[class^=ag-][type=datetime-local],\n.ag-theme-material-dark textarea[class^=ag-],\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-material-auto-dark input[class^=ag-][type=text],\n.ag-theme-material-auto-dark input[class^=ag-][type=number],\n.ag-theme-material-auto-dark input[class^=ag-][type=tel],\n.ag-theme-material-auto-dark input[class^=ag-][type=date],\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-material-auto-dark textarea[class^=ag-] {\n background: transparent;\n color: var(--ag-foreground-color);\n font-family: inherit;\n font-size: inherit;\n padding-bottom: var(--ag-grid-size);\n border-width: 0;\n border-radius: 0;\n border-bottom: 2px solid;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material textarea[class^=ag-]:not(textarea),\n.ag-theme-material-dark input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material-dark textarea[class^=ag-]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:not(textarea),\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:not(textarea),\n.ag-theme-material-auto-dark textarea[class^=ag-]:not(textarea) {\n height: calc(var(--ag-grid-size) * 5);\n}\n.ag-theme-material input[class^=ag-]:not([type]):focus,\n.ag-theme-material input[class^=ag-][type=text]:focus,\n.ag-theme-material input[class^=ag-][type=number]:focus,\n.ag-theme-material input[class^=ag-][type=tel]:focus,\n.ag-theme-material input[class^=ag-][type=date]:focus,\n.ag-theme-material input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material textarea[class^=ag-]:focus,\n.ag-theme-material-dark input[class^=ag-]:not([type]):focus,\n.ag-theme-material-dark input[class^=ag-][type=text]:focus,\n.ag-theme-material-dark input[class^=ag-][type=number]:focus,\n.ag-theme-material-dark input[class^=ag-][type=tel]:focus,\n.ag-theme-material-dark input[class^=ag-][type=date]:focus,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material-dark textarea[class^=ag-]:focus,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:focus,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:focus,\n.ag-theme-material-auto-dark textarea[class^=ag-]:focus {\n border-bottom: 2px solid;\n border-bottom-color: var(--ag-material-primary-color);\n outline: none;\n box-shadow: none;\n}\n.ag-theme-material input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material input[class^=ag-][type=text]::placeholder,\n.ag-theme-material input[class^=ag-][type=number]::placeholder,\n.ag-theme-material input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material input[class^=ag-][type=date]::placeholder,\n.ag-theme-material input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material textarea[class^=ag-]::placeholder,\n.ag-theme-material-dark input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=text]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=number]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=date]::placeholder,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material-dark textarea[class^=ag-]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type])::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]::placeholder,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]::placeholder,\n.ag-theme-material-auto-dark textarea[class^=ag-]::placeholder {\n color: var(--ag-disabled-foreground-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):disabled,\n.ag-theme-material input[class^=ag-][type=text]:disabled,\n.ag-theme-material input[class^=ag-][type=number]:disabled,\n.ag-theme-material input[class^=ag-][type=tel]:disabled,\n.ag-theme-material input[class^=ag-][type=date]:disabled,\n.ag-theme-material input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material textarea[class^=ag-]:disabled,\n.ag-theme-material-dark input[class^=ag-]:not([type]):disabled,\n.ag-theme-material-dark input[class^=ag-][type=text]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=number]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=tel]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=date]:disabled,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material-dark textarea[class^=ag-]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:disabled,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:disabled,\n.ag-theme-material-auto-dark textarea[class^=ag-]:disabled {\n border-bottom: 1px solid;\n border-bottom-color: var(--ag-border-color);\n}\n.ag-theme-material input[class^=ag-]:not([type]):invalid,\n.ag-theme-material input[class^=ag-][type=text]:invalid,\n.ag-theme-material input[class^=ag-][type=number]:invalid,\n.ag-theme-material input[class^=ag-][type=tel]:invalid,\n.ag-theme-material input[class^=ag-][type=date]:invalid,\n.ag-theme-material input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material textarea[class^=ag-]:invalid,\n.ag-theme-material-dark input[class^=ag-]:not([type]):invalid,\n.ag-theme-material-dark input[class^=ag-][type=text]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=number]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=tel]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=date]:invalid,\n.ag-theme-material-dark input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material-dark textarea[class^=ag-]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-]:not([type]):invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=text]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=number]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=tel]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=date]:invalid,\n.ag-theme-material-auto-dark input[class^=ag-][type=datetime-local]:invalid,\n.ag-theme-material-auto-dark textarea[class^=ag-]:invalid {\n border-width: 0;\n border-bottom: 1px solid;\n border-bottom-color: var(--ag-invalid-color);\n color: var(--ag-invalid-color);\n}\n.ag-theme-material .ag-standard-button,\n.ag-theme-material-dark .ag-standard-button,\n.ag-theme-material-auto-dark .ag-standard-button {\n appearance: none;\n background-color: transparent;\n border: 0;\n color: var(--ag-material-primary-color);\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n padding: 0;\n text-transform: uppercase;\n}\n.ag-theme-material .ag-standard-button:disabled,\n.ag-theme-material-dark .ag-standard-button:disabled,\n.ag-theme-material-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-material.ag-dnd-ghost,\n.ag-theme-material-dark.ag-dnd-ghost,\n.ag-theme-material-auto-dark.ag-dnd-ghost {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n}\n.ag-theme-material .ag-filter-toolpanel-header,\n.ag-theme-material-dark .ag-filter-toolpanel-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-header {\n height: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-material .ag-filter-toolpanel-group-level-0-header,\n.ag-theme-material-dark .ag-filter-toolpanel-group-level-0-header,\n.ag-theme-material-auto-dark .ag-filter-toolpanel-group-level-0-header {\n height: calc(var(--ag-grid-size) * 7);\n}\n.ag-theme-material .ag-filter-card-title,\n.ag-theme-material-dark .ag-filter-card-title,\n.ag-theme-material-auto-dark .ag-filter-card-title {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 600;\n}\n.ag-theme-material .ag-filter-panel .ag-standard-button,\n.ag-theme-material-dark .ag-filter-panel .ag-standard-button,\n.ag-theme-material-auto-dark .ag-filter-panel .ag-standard-button {\n padding: var(--ag-grid-size);\n}\n.ag-theme-material .ag-filter-add-button,\n.ag-theme-material-dark .ag-filter-add-button,\n.ag-theme-material-auto-dark .ag-filter-add-button {\n border-bottom: 2px solid var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-filter-add-button .ag-icon,\n.ag-theme-material-dark .ag-filter-add-button .ag-icon,\n.ag-theme-material-auto-dark .ag-filter-add-button .ag-icon {\n color: var(--ag-material-active-color);\n}\n.ag-theme-material .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-ltr .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-ltr .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-ltr .ag-advanced-filter-builder-button {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-dark .ag-rtl .ag-advanced-filter-builder-button, .ag-theme-material-auto-dark .ag-rtl .ag-filter-apply-panel-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-apply-button, .ag-theme-material-auto-dark .ag-rtl .ag-advanced-filter-builder-button {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material .ag-layout-print .ag-center-cols-container,\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-material-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-material-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-material .ag-picker-field-wrapper:focus-within,\n.ag-theme-material-dark .ag-picker-field-wrapper:focus-within,\n.ag-theme-material-auto-dark .ag-picker-field-wrapper:focus-within {\n box-shadow: 0 0 0 1px var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-rich-select-list,\n.ag-theme-material-dark .ag-rich-select-list,\n.ag-theme-material-auto-dark .ag-rich-select-list {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\n}\n.ag-theme-material .ag-advanced-filter-builder-button-label,\n.ag-theme-material-dark .ag-advanced-filter-builder-button-label,\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-button-label {\n text-transform: uppercase;\n}\n.ag-theme-material .ag-filter-active .ag-icon-filter,\n.ag-theme-material-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-material-auto-dark .ag-filter-active .ag-icon-filter {\n color: var(--ag-material-accent-color);\n}\n.ag-theme-material .ag-list-item-hovered::after,\n.ag-theme-material-dark .ag-list-item-hovered::after,\n.ag-theme-material-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-pill .ag-pill-button:hover,\n.ag-theme-material-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-material-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-header-highlight-before::after,\n.ag-theme-material .ag-header-highlight-after::after,\n.ag-theme-material-dark .ag-header-highlight-before::after,\n.ag-theme-material-dark .ag-header-highlight-after::after,\n.ag-theme-material-auto-dark .ag-header-highlight-before::after,\n.ag-theme-material-auto-dark .ag-header-highlight-after::after {\n background-color: var(--ag-material-primary-color);\n}\n.ag-theme-material .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material .ag-disabled .ag-icon,\n.ag-theme-material .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material [disabled] .ag-icon,\n.ag-theme-material-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material-dark .ag-disabled .ag-icon,\n.ag-theme-material-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material-dark [disabled] .ag-icon,\n.ag-theme-material-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-material-auto-dark .ag-disabled .ag-icon,\n.ag-theme-material-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-material-auto-dark [disabled] .ag-icon {\n color: var(--ag-disabled-foreground-color);\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-quartz-no-font.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '.ag-theme-quartz,\n.ag-theme-quartz-dark,\n.ag-theme-quartz-auto-dark {\n --ag-active-color: #2196f3;\n --ag-background-color: #fff;\n --ag-foreground-color: #181d1f;\n --ag-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 15%);\n --ag-secondary-border-color: var(--ag-border-color);\n --ag-header-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 2%);\n --ag-tooltip-background-color: var(--ag-header-background-color);\n --ag-control-panel-background-color: var(--ag-header-background-color);\n --ag-subheader-background-color: transparent;\n --ag-invalid-color: #e02525;\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 30%);\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\n --ag-icon-font-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 90%);\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\n --ag-selected-row-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 8%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 12%);\n --ag-column-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\n --ag-input-focus-border-color: var(--ag-active-color);\n --ag-range-selection-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-input-focus-box-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color) 47%);\n --ag-input-error-focus-box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 50%);\n --ag-range-selection-background-color-2: color-mix(in srgb, transparent, var(--ag-active-color) 36%);\n --ag-range-selection-background-color-3: color-mix(in srgb, transparent, var(--ag-active-color) 49%);\n --ag-range-selection-background-color-4: color-mix(in srgb, transparent, var(--ag-active-color) 59%);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-active-color) 50%);\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-checkbox-checked-color: var(--ag-active-color);\n --ag-range-selection-border-color: var(--ag-active-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-disabled-foreground-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 50%);\n --ag-chip-background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 7%);\n --ag-chip-border-color: color-mix(in srgb, var(--ag-header-background-color), var(--ag-foreground-color) 13%);\n --ag-input-disabled-border-color: var(--ag-border-color);\n --ag-input-disabled-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 6%);\n --ag-modal-overlay-background-color: color-mix(in srgb, transparent, var(--ag-background-color) 66%);\n --ag-chart-menu-label-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 80%);\n --ag-chart-menu-pill-select-button-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\n --ag-filter-panel-card-subtle-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\n --ag-column-drag-indicator-color: var(--ag-active-color);\n --ag-borders: solid 1px;\n --ag-border-radius: 4px;\n --ag-wrapper-border-radius: 8px;\n --ag-borders-side-button: none;\n --ag-side-button-selected-background-color: transparent;\n --ag-header-column-resize-handle-display: block;\n --ag-header-column-resize-handle-width: 2px;\n --ag-header-column-resize-handle-height: 30%;\n --ag-grid-size: 8px;\n --ag-icon-size: 16px;\n --ag-header-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 4.25);\n --ag-row-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 3.5);\n --ag-list-item-height: calc(\n var(--ag-icon-size) + var(--ag-widget-vertical-spacing)\n );\n --ag-column-select-indent-size: var(--ag-icon-size);\n --ag-set-filter-indent-size: var(--ag-icon-size);\n --ag-filter-tool-panel-group-indent: var(--ag-grid-size);\n --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 2);\n --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1);\n --ag-toggle-button-height: 18px;\n --ag-toggle-button-width: 28px;\n --ag-toggle-button-border-width: 2px;\n --ag-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,\n Cantarell, "Helvetica Neue", sans-serif;\n --ag-font-size: 14px;\n --ag-icon-font-family: agGridQuartz;\n --ag-tab-min-width: 290px;\n --ag-chart-menu-panel-width: 260px;\n --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\n --ag-popup-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.15);\n --ag-side-bar-panel-width: 250px;\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-active-color);\n}\n\n.ag-theme-quartz-dark {\n --ag-background-color: color-mix(in srgb, #fff, #182230 97%);\n --ag-foreground-color: #fff;\n --ag-border-color: rgba(255, 255, 255, 0.16);\n --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-header-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-tooltip-background-color: color-mix(in srgb, #fff, #182230 96%);\n --ag-control-panel-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-input-disabled-background-color: #68686e12;\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-selected-row-background-color: var(--ag-row-hover-color);\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-quartz-auto-dark {\n --ag-background-color: color-mix(in srgb, #fff, #182230 97%);\n --ag-foreground-color: #fff;\n --ag-border-color: rgba(255, 255, 255, 0.16);\n --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-header-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-tooltip-background-color: color-mix(in srgb, #fff, #182230 96%);\n --ag-control-panel-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-input-disabled-background-color: #68686e12;\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-selected-row-background-color: var(--ag-row-hover-color);\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-quartz .ag-filter-toolpanel-header,\n.ag-theme-quartz .ag-filter-toolpanel-search,\n.ag-theme-quartz .ag-status-bar,\n.ag-theme-quartz .ag-header-row,\n.ag-theme-quartz .ag-row-number-cell,\n.ag-theme-quartz .ag-panel-title-bar-title,\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\n.ag-theme-quartz .ag-filter-card-title,\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-dark .ag-status-bar,\n.ag-theme-quartz-dark .ag-header-row,\n.ag-theme-quartz-dark .ag-row-number-cell,\n.ag-theme-quartz-dark .ag-panel-title-bar-title,\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-dark .ag-filter-card-title,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-auto-dark .ag-status-bar,\n.ag-theme-quartz-auto-dark .ag-header-row,\n.ag-theme-quartz-auto-dark .ag-row-number-cell,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-title,\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-filter-card-title {\n font-weight: 500;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-quartz input[class^=ag-]:not([type]),\n.ag-theme-quartz input[class^=ag-][type=text],\n.ag-theme-quartz input[class^=ag-][type=number],\n.ag-theme-quartz input[class^=ag-][type=tel],\n.ag-theme-quartz input[class^=ag-][type=date],\n.ag-theme-quartz input[class^=ag-][type=datetime-local],\n.ag-theme-quartz textarea[class^=ag-],\n.ag-theme-quartz-dark input[class^=ag-]:not([type]),\n.ag-theme-quartz-dark input[class^=ag-][type=text],\n.ag-theme-quartz-dark input[class^=ag-][type=number],\n.ag-theme-quartz-dark input[class^=ag-][type=tel],\n.ag-theme-quartz-dark input[class^=ag-][type=date],\n.ag-theme-quartz-dark input[class^=ag-][type=datetime-local],\n.ag-theme-quartz-dark textarea[class^=ag-],\n.ag-theme-quartz-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-quartz-auto-dark input[class^=ag-][type=text],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=number],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=tel],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=date],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-quartz-auto-dark textarea[class^=ag-] {\n min-height: calc(var(--ag-grid-size) * 4);\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-quartz .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-ltr textarea[class^=ag-], .ag-theme-quartz-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-ltr textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-rtl textarea[class^=ag-], .ag-theme-quartz-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-rtl textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-picker-field-wrapper,\n.ag-theme-quartz-dark .ag-picker-field-wrapper,\n.ag-theme-quartz-auto-dark .ag-picker-field-wrapper {\n min-height: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-quartz .ag-tab,\n.ag-theme-quartz-dark .ag-tab,\n.ag-theme-quartz-auto-dark .ag-tab {\n padding: var(--ag-grid-size);\n border-left: var(--ag-borders) transparent;\n border-right: var(--ag-borders) transparent;\n flex: 1 1 auto;\n}\n.ag-theme-quartz .ag-tab-selected,\n.ag-theme-quartz-dark .ag-tab-selected,\n.ag-theme-quartz-auto-dark .ag-tab-selected {\n background-color: var(--ag-background-color);\n}\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:first-of-type) {\n border-left-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:first-of-type) {\n border-right-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:last-of-type) {\n border-right-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:last-of-type) {\n border-left-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected),\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected),\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected) {\n opacity: 0.7;\n}\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected):hover,\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected):hover,\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected):hover {\n opacity: 1;\n}\n.ag-theme-quartz .ag-menu,\n.ag-theme-quartz-dark .ag-menu,\n.ag-theme-quartz-auto-dark .ag-menu {\n color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\n}\n.ag-theme-quartz .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-quartz-dark .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-quartz-auto-dark .ag-panel-content-wrapper .ag-column-select {\n background-color: var(--ag-control-panel-background-color);\n color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\n}\n.ag-theme-quartz .ag-menu-header,\n.ag-theme-quartz-dark .ag-menu-header,\n.ag-theme-quartz-auto-dark .ag-menu-header {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-menu-option,\n.ag-theme-quartz-dark .ag-menu-option,\n.ag-theme-quartz-auto-dark .ag-menu-option {\n font-weight: 500;\n cursor: pointer;\n}\n.ag-theme-quartz .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon {\n text-align: right;\n}\n\n.ag-theme-quartz .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon {\n text-align: left;\n}\n\n.ag-theme-quartz .ag-tabs-header,\n.ag-theme-quartz-dark .ag-tabs-header,\n.ag-theme-quartz-auto-dark .ag-tabs-header {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n display: flex;\n background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\n}\n.ag-theme-quartz .ag-side-bar,\n.ag-theme-quartz-dark .ag-side-bar,\n.ag-theme-quartz-auto-dark .ag-side-bar {\n background-color: var(--ag-control-panel-background-color);\n min-width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-theme-quartz .ag-side-buttons,\n.ag-theme-quartz-dark .ag-side-buttons,\n.ag-theme-quartz-auto-dark .ag-side-buttons {\n padding: 0;\n align-self: stretch;\n width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n background: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-side-button,\n.ag-theme-quartz-dark .ag-side-button,\n.ag-theme-quartz-auto-dark .ag-side-button {\n border-top: var(--ag-borders) transparent;\n border-bottom: var(--ag-borders) transparent;\n}\n@media (max-resolution: 1.5x) {\n .ag-theme-quartz .ag-side-button-label,\n .ag-theme-quartz-dark .ag-side-button-label,\n .ag-theme-quartz-auto-dark .ag-side-button-label {\n font-family: "Segoe UI", var(--ag-font-family);\n transform: rotate(0.05deg);\n }\n}\n.ag-theme-quartz .ag-side-button.ag-selected,\n.ag-theme-quartz-dark .ag-side-button.ag-selected,\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected {\n border-bottom-color: var(--ag-border-color);\n background-color: var(--ag-background-color);\n}\n.ag-theme-quartz .ag-side-button.ag-selected:not(:first-of-type),\n.ag-theme-quartz-dark .ag-side-button.ag-selected:not(:first-of-type),\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected:not(:first-of-type) {\n border-top-color: var(--ag-border-color);\n}\n.ag-theme-quartz .ag-column-panel-column-select,\n.ag-theme-quartz-dark .ag-column-panel-column-select,\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select {\n border-top: none;\n}\n.ag-theme-quartz .ag-column-panel-column-select:not(.ag-last-visible-child),\n.ag-theme-quartz-dark .ag-column-panel-column-select:not(.ag-last-visible-child),\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select:not(.ag-last-visible-child) {\n border-bottom: 1px solid var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-filter-toolpanel-search,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search {\n height: initial;\n margin-top: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-filter-toolpanel-search-input,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search-input,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search-input {\n margin: 0;\n}\n.ag-theme-quartz .ag-filter-apply-panel,\n.ag-theme-quartz-dark .ag-filter-apply-panel,\n.ag-theme-quartz-auto-dark .ag-filter-apply-panel {\n border: none;\n padding-top: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-chart-tabbed-menu-body,\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body,\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body {\n position: relative;\n}\n.ag-theme-quartz .ag-chart-tabbed-menu-body::after,\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body::after,\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body::after {\n content: "";\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n right: 0;\n height: 16px;\n background: linear-gradient(var(--ag-control-panel-background-color), transparent);\n}\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\n border-top: none;\n font-weight: 500;\n}\n.ag-theme-quartz .ag-chart-mini-thumbnail,\n.ag-theme-quartz-dark .ag-chart-mini-thumbnail,\n.ag-theme-quartz-auto-dark .ag-chart-mini-thumbnail {\n background-color: var(--ag-background-color);\n margin-top: 0;\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-chart-settings-nav-bar,\n.ag-theme-quartz-dark .ag-chart-settings-nav-bar,\n.ag-theme-quartz-auto-dark .ag-chart-settings-nav-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\n background: none;\n font-weight: 500;\n}\n.ag-theme-quartz .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar) {\n color: var(--ag-chart-menu-label-color);\n}\n.ag-theme-quartz .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz .ag-chart-format-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label-align-top .ag-label {\n margin-top: calc(var(--ag-widget-vertical-spacing) * 0.5);\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label {\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-chart-data-section label,\n.ag-theme-quartz .ag-chart-format-section label,\n.ag-theme-quartz-dark .ag-chart-data-section label,\n.ag-theme-quartz-dark .ag-chart-format-section label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section label {\n display: inline-block;\n}\n.ag-theme-quartz .ag-chart-format-wrapper,\n.ag-theme-quartz .ag-chart-data-wrapper,\n.ag-theme-quartz .ag-charts-format-top-level-group,\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz .ag-charts-format-top-level-group-item,\n.ag-theme-quartz .ag-charts-format-sub-level-group,\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-container,\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-chart-format-wrapper,\n.ag-theme-quartz-dark .ag-chart-data-wrapper,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-item,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-chart-format-wrapper,\n.ag-theme-quartz-auto-dark .ag-chart-data-wrapper,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\n padding: 0;\n margin: 0;\n}\n.ag-theme-quartz .ag-charts-format-top-level-group,\n.ag-theme-quartz .ag-charts-data-group,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-dark .ag-charts-data-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-data-group {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz .ag-charts-settings-group .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group .ag-charts-settings-group-container {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding: var(--ag-widget-vertical-spacing) 0;\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container {\n padding-top: var(--ag-widget-vertical-spacing);\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-charts-data-group-item,\n.ag-theme-quartz-dark .ag-charts-data-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-item {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-chart-settings-mini-wrapper,\n.ag-theme-quartz-dark .ag-chart-settings-mini-wrapper,\n.ag-theme-quartz-auto-dark .ag-chart-settings-mini-wrapper {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-chart-advanced-settings-section,\n.ag-theme-quartz-dark .ag-chart-advanced-settings-section,\n.ag-theme-quartz-auto-dark .ag-chart-advanced-settings-section {\n padding-top: var(--ag-widget-container-vertical-padding);\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-container {\n margin: 0;\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-item,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-item {\n margin-top: calc(var(--ag-widget-vertical-spacing) * 2);\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-spectrum-color,\n.ag-theme-quartz .ag-spectrum-fill,\n.ag-theme-quartz-dark .ag-spectrum-color,\n.ag-theme-quartz-dark .ag-spectrum-fill,\n.ag-theme-quartz-auto-dark .ag-spectrum-color,\n.ag-theme-quartz-auto-dark .ag-spectrum-fill {\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-quartz .ag-spectrum-dragger,\n.ag-theme-quartz-dark .ag-spectrum-dragger,\n.ag-theme-quartz-auto-dark .ag-spectrum-dragger {\n border-radius: 18px;\n height: 18px;\n width: 18px;\n border: 3px solid white;\n}\n.ag-theme-quartz .ag-spectrum-tools,\n.ag-theme-quartz-dark .ag-spectrum-tools,\n.ag-theme-quartz-auto-dark .ag-spectrum-tools {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n}\n.ag-theme-quartz .ag-spectrum-tool,\n.ag-theme-quartz-dark .ag-spectrum-tool,\n.ag-theme-quartz-auto-dark .ag-spectrum-tool {\n height: 12px;\n}\n.ag-theme-quartz .ag-spectrum-hue-background,\n.ag-theme-quartz .ag-spectrum-alpha-background,\n.ag-theme-quartz-dark .ag-spectrum-hue-background,\n.ag-theme-quartz-dark .ag-spectrum-alpha-background,\n.ag-theme-quartz-auto-dark .ag-spectrum-hue-background,\n.ag-theme-quartz-auto-dark .ag-spectrum-alpha-background {\n border-radius: 12px;\n}\n.ag-theme-quartz .ag-spectrum-slider,\n.ag-theme-quartz-dark .ag-spectrum-slider,\n.ag-theme-quartz-auto-dark .ag-spectrum-slider {\n margin-top: -15px;\n width: 18px;\n height: 18px;\n border-radius: 18px;\n border: 3px solid rgb(248, 248, 248);\n}\n.ag-theme-quartz .ag-recent-colors,\n.ag-theme-quartz-dark .ag-recent-colors,\n.ag-theme-quartz-auto-dark .ag-recent-colors {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n margin-bottom: 2px;\n}\n.ag-theme-quartz .ag-color-input-color,\n.ag-theme-quartz .ag-color-picker-color,\n.ag-theme-quartz .ag-recent-color,\n.ag-theme-quartz-dark .ag-color-input-color,\n.ag-theme-quartz-dark .ag-color-picker-color,\n.ag-theme-quartz-dark .ag-recent-color,\n.ag-theme-quartz-auto-dark .ag-color-input-color,\n.ag-theme-quartz-auto-dark .ag-color-picker-color,\n.ag-theme-quartz-auto-dark .ag-recent-color {\n border-radius: 4px;\n}\n.ag-theme-quartz .ag-recent-color,\n.ag-theme-quartz-dark .ag-recent-color,\n.ag-theme-quartz-auto-dark .ag-recent-color {\n border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz.ag-dnd-ghost,\n.ag-theme-quartz-dark.ag-dnd-ghost,\n.ag-theme-quartz-auto-dark.ag-dnd-ghost {\n font-weight: 500;\n}\n.ag-theme-quartz .ag-standard-button,\n.ag-theme-quartz-dark .ag-standard-button,\n.ag-theme-quartz-auto-dark .ag-standard-button {\n font-family: inherit;\n appearance: none;\n -webkit-appearance: none;\n border-radius: var(--ag-border-radius);\n border: solid 1px var(--ag-input-border-color);\n background-color: var(--ag-background-color);\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n cursor: pointer;\n}\n.ag-theme-quartz .ag-standard-button:hover,\n.ag-theme-quartz-dark .ag-standard-button:hover,\n.ag-theme-quartz-auto-dark .ag-standard-button:hover {\n background-color: var(--ag-row-hover-color);\n}\n.ag-theme-quartz .ag-standard-button:active,\n.ag-theme-quartz-dark .ag-standard-button:active,\n.ag-theme-quartz-auto-dark .ag-standard-button:active {\n border-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-standard-button:disabled,\n.ag-theme-quartz-dark .ag-standard-button:disabled,\n.ag-theme-quartz-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-quartz .ag-column-drop-cell,\n.ag-theme-quartz-dark .ag-column-drop-cell,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell {\n border-radius: calc(var(--ag-grid-size) * 3);\n height: calc(var(--ag-grid-size) * 3);\n padding: 0 var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-column-drop-cell-button,\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\n min-width: 0;\n margin: 0;\n}\n.ag-theme-quartz .ag-column-drop-cell-drag-handle,\n.ag-theme-quartz-dark .ag-column-drop-cell-drag-handle,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-drag-handle {\n margin-left: 0;\n}\n.ag-theme-quartz .ag-column-drop-vertical,\n.ag-theme-quartz-dark .ag-column-drop-vertical,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical {\n min-height: 75px;\n}\n.ag-theme-quartz .ag-column-drop-vertical-title-bar,\n.ag-theme-quartz-dark .ag-column-drop-vertical-title-bar,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-title-bar {\n padding: var(--ag-widget-container-vertical-padding) calc(var(--ag-grid-size) * 2) 0;\n}\n.ag-theme-quartz .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-drop-vertical-icon {\n margin-left: 0;\n margin-right: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-drop-vertical-icon {\n margin-right: 0;\n margin-left: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-theme-quartz .ag-column-drop-vertical-empty-message,\n.ag-theme-quartz-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-empty-message {\n display: flex;\n align-items: center;\n justify-content: center;\n border: dashed 1px;\n border-color: var(--ag-border-color);\n margin: calc(var(--ag-grid-size) * 1.5) calc(var(--ag-grid-size) * 2);\n padding: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-quartz .ag-column-drop-empty-message,\n.ag-theme-quartz-dark .ag-column-drop-empty-message,\n.ag-theme-quartz-auto-dark .ag-column-drop-empty-message {\n color: var(--ag-foreground-color);\n}\n.ag-theme-quartz .ag-pill-select .ag-column-drop,\n.ag-theme-quartz-dark .ag-pill-select .ag-column-drop,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-column-drop {\n min-height: unset;\n}\n.ag-theme-quartz .ag-pill-select .ag-picker-field-display,\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-display,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-display {\n font-weight: 500;\n color: var(--ag-chart-menu-pill-select-button-color);\n}\n.ag-theme-quartz .ag-pill-select .ag-picker-field-icon .ag-icon,\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-icon .ag-icon,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-icon .ag-icon {\n color: var(--ag-chart-menu-pill-select-button-color);\n}\n.ag-theme-quartz .ag-status-bar,\n.ag-theme-quartz-dark .ag-status-bar,\n.ag-theme-quartz-auto-dark .ag-status-bar {\n font-weight: normal;\n}\n.ag-theme-quartz .ag-status-name-value,\n.ag-theme-quartz-dark .ag-status-name-value,\n.ag-theme-quartz-auto-dark .ag-status-name-value {\n padding: var(--ag-widget-container-vertical-padding) 0;\n}\n.ag-theme-quartz .ag-status-name-value-value,\n.ag-theme-quartz .ag-paging-number,\n.ag-theme-quartz .ag-paging-row-summary-panel-number,\n.ag-theme-quartz-dark .ag-status-name-value-value,\n.ag-theme-quartz-dark .ag-paging-number,\n.ag-theme-quartz-dark .ag-paging-row-summary-panel-number,\n.ag-theme-quartz-auto-dark .ag-status-name-value-value,\n.ag-theme-quartz-auto-dark .ag-paging-number,\n.ag-theme-quartz-auto-dark .ag-paging-row-summary-panel-number {\n font-weight: 500;\n}\n.ag-theme-quartz .ag-column-drop-cell-button,\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\n opacity: 0.75;\n}\n.ag-theme-quartz .ag-column-drop-cell-button:hover,\n.ag-theme-quartz-dark .ag-column-drop-cell-button:hover,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button:hover {\n opacity: 1;\n}\n.ag-theme-quartz .ag-header-cell-menu-button,\n.ag-theme-quartz .ag-header-cell-filter-button,\n.ag-theme-quartz .ag-panel-title-bar-button,\n.ag-theme-quartz .ag-header-expand-icon,\n.ag-theme-quartz .ag-column-group-icons,\n.ag-theme-quartz .ag-set-filter-group-icons,\n.ag-theme-quartz .ag-group-expanded .ag-icon,\n.ag-theme-quartz .ag-group-contracted .ag-icon,\n.ag-theme-quartz .ag-chart-settings-prev,\n.ag-theme-quartz .ag-chart-settings-next,\n.ag-theme-quartz .ag-group-title-bar-icon,\n.ag-theme-quartz .ag-column-select-header-icon,\n.ag-theme-quartz .ag-floating-filter-button-button,\n.ag-theme-quartz .ag-filter-toolpanel-expand,\n.ag-theme-quartz .ag-panel-title-bar-button-icon,\n.ag-theme-quartz .ag-chart-menu-icon,\n.ag-theme-quartz-dark .ag-header-cell-menu-button,\n.ag-theme-quartz-dark .ag-header-cell-filter-button,\n.ag-theme-quartz-dark .ag-panel-title-bar-button,\n.ag-theme-quartz-dark .ag-header-expand-icon,\n.ag-theme-quartz-dark .ag-column-group-icons,\n.ag-theme-quartz-dark .ag-set-filter-group-icons,\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon,\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon,\n.ag-theme-quartz-dark .ag-chart-settings-prev,\n.ag-theme-quartz-dark .ag-chart-settings-next,\n.ag-theme-quartz-dark .ag-group-title-bar-icon,\n.ag-theme-quartz-dark .ag-column-select-header-icon,\n.ag-theme-quartz-dark .ag-floating-filter-button-button,\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand,\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon,\n.ag-theme-quartz-dark .ag-chart-menu-icon,\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button,\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button,\n.ag-theme-quartz-auto-dark .ag-header-expand-icon,\n.ag-theme-quartz-auto-dark .ag-column-group-icons,\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons,\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon,\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon,\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev,\n.ag-theme-quartz-auto-dark .ag-chart-settings-next,\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon,\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon,\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\n --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n}\n.ag-theme-quartz .ag-header-cell-menu-button:hover,\n.ag-theme-quartz .ag-header-cell-filter-button:hover,\n.ag-theme-quartz .ag-panel-title-bar-button:hover,\n.ag-theme-quartz .ag-header-expand-icon:hover,\n.ag-theme-quartz .ag-column-group-icons:hover,\n.ag-theme-quartz .ag-set-filter-group-icons:hover,\n.ag-theme-quartz .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz .ag-chart-settings-prev:hover,\n.ag-theme-quartz .ag-chart-settings-next:hover,\n.ag-theme-quartz .ag-group-title-bar-icon:hover,\n.ag-theme-quartz .ag-column-select-header-icon:hover,\n.ag-theme-quartz .ag-floating-filter-button-button:hover,\n.ag-theme-quartz .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz .ag-chart-menu-icon:hover,\n.ag-theme-quartz-dark .ag-header-cell-menu-button:hover,\n.ag-theme-quartz-dark .ag-header-cell-filter-button:hover,\n.ag-theme-quartz-dark .ag-panel-title-bar-button:hover,\n.ag-theme-quartz-dark .ag-header-expand-icon:hover,\n.ag-theme-quartz-dark .ag-column-group-icons:hover,\n.ag-theme-quartz-dark .ag-set-filter-group-icons:hover,\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz-dark .ag-chart-settings-prev:hover,\n.ag-theme-quartz-dark .ag-chart-settings-next:hover,\n.ag-theme-quartz-dark .ag-group-title-bar-icon:hover,\n.ag-theme-quartz-dark .ag-column-select-header-icon:hover,\n.ag-theme-quartz-dark .ag-floating-filter-button-button:hover,\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz-dark .ag-chart-menu-icon:hover,\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button:hover,\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button:hover,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button:hover,\n.ag-theme-quartz-auto-dark .ag-header-expand-icon:hover,\n.ag-theme-quartz-auto-dark .ag-column-group-icons:hover,\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons:hover,\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-next:hover,\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon:hover,\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon:hover,\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button:hover,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon:hover {\n border-radius: 1px;\n background-color: var(--ag-quartz-icon-hover-color);\n box-shadow: 0 0 0 4px var(--ag-quartz-icon-hover-color);\n}\n.ag-theme-quartz .ag-filter-active,\n.ag-theme-quartz .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz .ag-filter-toolpanel-instance-header-icon,\n.ag-theme-quartz-dark .ag-filter-active,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-header-icon,\n.ag-theme-quartz-auto-dark .ag-filter-active,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-header-icon {\n position: relative;\n}\n.ag-theme-quartz .ag-filter-active::after,\n.ag-theme-quartz .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz .ag-filter-toolpanel-instance-header-icon::after,\n.ag-theme-quartz-dark .ag-filter-active::after,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-header-icon::after,\n.ag-theme-quartz-auto-dark .ag-filter-active::after,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-header-icon::after {\n content: "";\n position: absolute;\n width: 6px;\n height: 6px;\n top: -1px;\n right: -1px;\n border-radius: 50%;\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-filter-active,\n.ag-theme-quartz-dark .ag-filter-active,\n.ag-theme-quartz-auto-dark .ag-filter-active {\n --ag-quartz-icon-active-color: color-mix(in srgb, transparent, var(--ag-active-color) 14%);\n --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 28%);\n border-radius: 1px;\n background-color: var(--ag-quartz-icon-active-color);\n box-shadow: 0 0 0 4px var(--ag-quartz-icon-active-color);\n}\n.ag-theme-quartz .ag-filter-active .ag-icon-filter,\n.ag-theme-quartz-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-quartz-auto-dark .ag-filter-active .ag-icon-filter {\n clip-path: path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");\n}\n.ag-theme-quartz .ag-chart-menu,\n.ag-theme-quartz-dark .ag-chart-menu,\n.ag-theme-quartz-auto-dark .ag-chart-menu {\n --ag-icon-size: 20px;\n background-color: color-mix(in srgb, transparent, var(--ag-background-color) 30%);\n padding: 4px 2px;\n}\n.ag-theme-quartz .ag-chart-menu-icon,\n.ag-theme-quartz-dark .ag-chart-menu-icon,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\n opacity: 0.8;\n}\n.ag-theme-quartz .ag-drag-handle,\n.ag-theme-quartz-dark .ag-drag-handle,\n.ag-theme-quartz-auto-dark .ag-drag-handle {\n color: var(--ag-icon-font-color);\n}\n.ag-theme-quartz .ag-menu-option-icon,\n.ag-theme-quartz .ag-compact-menu-option-icon,\n.ag-theme-quartz-dark .ag-menu-option-icon,\n.ag-theme-quartz-dark .ag-compact-menu-option-icon,\n.ag-theme-quartz-auto-dark .ag-menu-option-icon,\n.ag-theme-quartz-auto-dark .ag-compact-menu-option-icon {\n width: var(--ag-icon-size);\n cursor: pointer;\n}\n.ag-theme-quartz .ag-ltr .ag-menu-option-icon, .ag-theme-quartz .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-compact-menu-option-icon {\n padding-left: calc(var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-menu-option-icon, .ag-theme-quartz .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-compact-menu-option-icon {\n padding-right: calc(var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-quartz-dark .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\n opacity: 0.35;\n}\n.ag-theme-quartz .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-ltr .ag-panel-title-bar-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-rtl .ag-panel-title-bar-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\n padding: calc(var(--ag-grid-size) * 1.5) var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-body {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-body {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-filter-toolpanel-instance-filter,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-filter,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-filter {\n border: none;\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\n margin-left: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\n margin-right: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-quartz .ag-filter-toolpanel-group-level-0,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-level-0,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-level-0 {\n border-top: none;\n}\n.ag-theme-quartz .ag-filter-toolpanel-header,\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header {\n height: initial;\n padding-top: var(--ag-grid-size);\n padding-bottom: var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-filter-toolpanel-group-item,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-item,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-item {\n margin: 0;\n}\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz .ag-layout-print .ag-center-cols-container,\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-quartz .ag-date-time-list-page-entry-is-current,\n.ag-theme-quartz-dark .ag-date-time-list-page-entry-is-current,\n.ag-theme-quartz-auto-dark .ag-date-time-list-page-entry-is-current {\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-advanced-filter-builder-button,\n.ag-theme-quartz-dark .ag-advanced-filter-builder-button,\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-button {\n padding: var(--ag-grid-size);\n font-weight: 600;\n}\n.ag-theme-quartz .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz .ag-disabled .ag-icon,\n.ag-theme-quartz .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz [disabled] .ag-icon,\n.ag-theme-quartz-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz-dark .ag-disabled .ag-icon,\n.ag-theme-quartz-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz-dark [disabled] .ag-icon,\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz-auto-dark .ag-disabled .ag-icon,\n.ag-theme-quartz-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz-auto-dark [disabled] .ag-icon {\n opacity: 0.6;\n}\n.ag-theme-quartz .ag-icon-grip,\n.ag-theme-quartz-dark .ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-icon-grip {\n opacity: 0.7;\n}\n.ag-theme-quartz .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-quartz-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-quartz .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-add-select .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-add-select .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-add-select .ag-input-wrapper::before {\n position: absolute;\n display: block;\n width: 12px;\n height: 12px;\n background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");\n background-position: 50% 50%;\n background-size: contain;\n opacity: 40%;\n content: "";\n filter: var(--ag-icon-filter);\n}\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select .ag-input-wrapper::before {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select .ag-input-wrapper::before {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select input.ag-number-field-input {\n padding-left: 26px;\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select input.ag-number-field-input {\n padding-right: 26px;\n}\n\n.ag-theme-quartz .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-add-group-indent {\n margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-add-group-indent {\n margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-text-field-input[disabled],\n.ag-theme-quartz .ag-menu-option-disabled,\n.ag-theme-quartz-dark .ag-text-field-input[disabled],\n.ag-theme-quartz-dark .ag-menu-option-disabled,\n.ag-theme-quartz-auto-dark .ag-text-field-input[disabled],\n.ag-theme-quartz-auto-dark .ag-menu-option-disabled {\n cursor: not-allowed;\n}\n.ag-theme-quartz .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\n.ag-theme-quartz-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\n.ag-theme-quartz-auto-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled {\n --ag-checkbox-checked-color: var(--ag-checkbox-unchecked-color);\n}\n.ag-theme-quartz .ag-checkbox-input,\n.ag-theme-quartz .ag-toggle-button-input,\n.ag-theme-quartz .ag-radio-button-input,\n.ag-theme-quartz input[class^=ag-][type=range],\n.ag-theme-quartz-dark .ag-checkbox-input,\n.ag-theme-quartz-dark .ag-toggle-button-input,\n.ag-theme-quartz-dark .ag-radio-button-input,\n.ag-theme-quartz-dark input[class^=ag-][type=range],\n.ag-theme-quartz-auto-dark .ag-checkbox-input,\n.ag-theme-quartz-auto-dark .ag-toggle-button-input,\n.ag-theme-quartz-auto-dark .ag-radio-button-input,\n.ag-theme-quartz-auto-dark input[class^=ag-][type=range] {\n cursor: pointer;\n}\n.ag-theme-quartz .ag-details-row,\n.ag-theme-quartz-dark .ag-details-row,\n.ag-theme-quartz-auto-dark .ag-details-row {\n padding: calc(var(--ag-grid-size) * 3.75);\n}\n.ag-theme-quartz .ag-list-item-hovered::after,\n.ag-theme-quartz-dark .ag-list-item-hovered::after,\n.ag-theme-quartz-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-pill .ag-pill-button:hover,\n.ag-theme-quartz-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-quartz-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-active-color);\n}\n\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before {\n opacity: 66%;\n filter: invert(100%);\n}\n.ag-theme-quartz-dark .ag-chart-menu {\n background-color: color-mix(in srgb, rgba(24, 39, 50, 0.3), var(--ag-background-color) 30%);\n}\n.ag-theme-quartz-dark .ag-text-field-input::placeholder {\n color: var(--ag-data-color);\n opacity: 0.8;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/ag-theme-quartz.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridQuartz";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAAB60AAsAAAAAP9AAAB5kAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYK02DDKgE2AiQDgnALgToABCAFhEYHhlUbGDZVRoWNAxCE6WSJokyNVmT/f0mQlxh6/aA2IaNSNSSMnFiPpCFrpxM4K2otB+uVtaIChHJqIvHDENnTdjLimnVXso4TytrTJzK4pg/me9l/YydzYHHZUEoe/n/tf/vemffdUS3liyhimoYMWTONUCiBEgj1rEV/Ps+9r/et+feYGhwbKIIByglQsVguFajUU8Bc6vSDVEIwvGxhQJFLtCEtQ2/vNjUAhue32YNvIvjF/0kD+mOjuHBJiFhF6aKMlUuMra2hbnfnSte6K4W1lzBXJX9zibf9f1FyUeqFXiEMufb6HcLgvJBHHMR871Sllk9WUWBoOTCmNGMQhNhF1s/dxncbCywH32oQBABKPMP/4ONvm6pmuvZk1rDIKWNuj+d82xpMQjITCuCDoFwi4H9V01W86y5NTmllGNP3ZJsIEKIEfEASRN09UzB9pjuvvGce3eXWdFNK77N4dBHdmVLbMLmOacOSYc2WOcOecUq2UFgnyp8tvnAVMiEtgVbEqzq3Qvxp3Rok89J7f80caG99C/bAiwpChJiEMMkNsv3qO5FAi6w2cmJqYUP+8Y3XT3WgZbdMcFwwPX5w74bks4VuGJfwX0Jtizy/N79/pfqZHub8wldS/ebV1/JWTStGFpTXNhUiGebJXMhhIzw+Kow1Wp3Vx3Cx4BriBBMY7FUEVWCyPj07hjTMCLSjjXjp9iJ4cXOjtAYk5WqtyiAIE0/zHeW3d4ymMZoax5hylBHhW73RzQRXSOOUUNFlTXgHARsVeftSI8aBgBRLlEUf0YLqBlHcg1Mn5ulxGECa1zFIIFe9DPZTzxyJICgoPs6gZ4FQt31fAFGzaFNCBQfqfY4OkMwQmk11bGbRObSxGmIALe+rQ3GqsKa9Gx+mSU4dQKNLsLj5JLEOJLVbUlPrvVXQEWIGvwoagTW8hECk63NwE/pNegiVBO19+fvxO/7xo0Tb08ubS2WpOm1Ou1J72k9gtoXyPf4qXw23W0/TE2qmIGqePZKStASraUzvycGhxdVSLPoyZDNUB1xagP0Acq3XKqNOXrAtnO7AamiZGA69W2viqHLEswsRLpvw7JC0TSR9eiOQxTG1uXgOA5mrkZLA2AriEAUvOhPH5dHZkzpQ9LS+QyWUXwTDWFp6e1Gc2BNRo6JEdlF5bnbEozzK0Q14T9ATnV6siC4K4sirtu+W1Sf14g3UeLrzjqH+9c2n6Jm2qo2FsWRFrPgoThTXRxMfVQQvztMX8OaUAHQDxFxDb4daQrpI0Erq0y7c+bBJaQBKDNoaSGR4ZN0WsR7XQOD9MMK/w+MZ3BAQSRUaEQ8OKahltEb6uGEUFRpJ+9ySelSFsl/QGCqpFT+zBtqogEtzIEQ1iKNA9BsUJKWu+1dyJJrx9AYG8sd8GXwpDnz6J5cyQMYUIHsVK3cnb/uPVIwKH9grtZF+Fdj0AKiBAlycKcr5cvP0dDaofd9FFLHu46F9QxseiZZy68lPTNbrLrlx6yVSyczsRM6DTmFlQAKqsil05HHKU5ETKPYEDWrg5TI1B46FkCgsDk8g+mf2YVSoNLR09AyMTMwsrGzsHJxc3Dy8fBR+AUEhYUYRUTFxCUkpaRlZOXkFRXolZRVVNXU0RkNTS1tH1z4LpAaQPbzhzx9fW1ya2ptYmVFZ3pyb3eYuTG/tzq/v7FtdbUD53nsVuPTRBnCjceBma8CtFoHbLQF3mgLutgfcawK43wrwoBngUavA45aBJ20CT5sDnjULPG8beNkk8KoF4HXTwJu2gLftAu+aB963DnxoB/h49kEQo1gSBiwFA5YGNEAwaIRg0QTBoRmCRwuEgFYIEW0QEtohZHRAKOiEUNEFoUE3hBY9EDr0QujRB2FAP4QRAxAmDEKYMQRhwTCEFSMQNoxC2DEG4cAhCCcOQ7hwBMKNoxAeHIPwoh3Cl+MQOQGRkxA5BZHTEOiDiBgZAzwKDPAYMMDjwABPAAM8CQzwFDDA08AAzwADPAsM8BwwwPPAAC8AA7wIDPASGHrjZWDOeQUY4FVggNeAAV4HBngDGOBNOJcSonUuNYg2Q8Y7wADvAgO8BwzwPjDAB8AAHwIDfAQUTMfB13b+wG+0PwNd37NyHissKde4UwgUUmNwqY/Aon/vkN88uAmfAbkGfo4B8ovk+AjEx2oSoACDojFdV2rGpfWbber8hlTuUk5tptE2hRfFHQyEb0uOjojmRtADtjDYgavYTZIwNJIJ0Z6cHx0sCaaHD4s8jko58QxFsBCpCmwOTmUh/SRkM18oYtAD7Dr2Q0a4Zx9QKILJ8mexdStGY+SMMDRRKBayoiLp0KZwCAlnoFw+P5LFixJjdJ8mBqNKdnOxu0O4jCjS8Oyd0ulbaf7rNCvNsMSlVH3Yo+lAuQG5MjYh//wtgQBOxVvFygozrpmYk/R2l4ilVHppV4d3mgjyspFM+61xYQ+DuudwKuHE7DdFRPViyCsQ45WDMdtNptebRYJiDjuQL6FDJVdgelrTlkZEddl3l/j0crn2TZJr17fSjk4CnIhBw0jyhW9PuO1Ude0efnFjW8jbh03SrSieKnrug9sUtDTUBLbABthnNpgtcItcOwuqPqeASn7cA7uv0sDycqZn1NYFgGauWoxGHgA1VpLPhO3OsKBIOvaQqJ6wiAs5iTuYWvk6/DFePsDDJYausJ7LdYZr4+gqJnZe89JYmaMQUDTiUqVm3JXIrz8Zke3U8iXqkIcdSjVqHyWtDb9w9dmOg5nG56znz+VCGPN61Yg//8ULxczR/v6fpFSo7rwiZe4ObU/Mh8w9whXBE0yaRn4x08UbPGRK+EFXVPNWF0+MvvyGyxsG1F91/Qx+FExPiEcsX7QIw1716ptL2Z2Hvua6Mun6z8LlF7sOfyNeyBusXzTJt+Vknj9odCfI1MNRCwkt5taAOmeM+Z3CQ/MrXgkFHS4WjsRlpsEbFx/gPFwbXMDJo5soMf7QUKok1BoRWUdsW06g+VPMenLrOlVw3gPW4ds38BuuT9YdSivNUI19MjmQWeLTdctblukuo1mElw1o1VGjXoeoKibSkO8cBsKxHYsPn6O/d/PaFuqJBZwhfteZ2KPVy5B9xefRtfjmtRPUSFmhkJbk4kMNa2hkU4vd3KT35YrRZuP6GKFFM5WcsATfBQveE/UN/EWpAens6nY5xtsMU90AubaCRFGqN9wR39SFvimGFBohOwR1XTCFuMfhBNe2FYZslyF+xLKIIcNuLlGUeMgMmzSyDMO2DZNDpEjrYb2oT0yTJG/YEMecyQvFgelQ1SEeVcS6tiqrlkh3WQzhDUihoK89x6YpKGH2bovYGp6GM2QOzUoo781G3UeMUWvEbeeaerLP4sjc/Vz+TNkXzcp4Ll9ORht9nrZhinUImsHyHAbQ4A8RMWq1xr1UgpPGACnCE0yU5nnyQrIa4Qjnt1yqUkgy30tAPYFTwkMmQQcB3RORpsBBsmHHnIQjhyBRtYhGf5az+eL8zNlHghm1PqzeZH2PL2rvv58DuCDhdfjFacloc9qCkT3mj0kkpzNDiM+Xdo0oVqc3ymWeSbHQyzNvLhc0vQQZmkLyBdVvejxDo7Fy+/PF1/MVFuHPGdDBwnkTVXaWzn1yR80zrffRrZLBrfbEWF/4zz9FJcdxuDTzZl69u6O7Z2SqEc2RGTiNZ1WceQafPydeL0Jv2DulV7e3To30BLs+nSdkuMubfv3+rqN9YxOh9pKZj27JWWLO1yKfWZ92oQPWYU8+aWa1QB92oMuY6eQCsBp3w4yZGp1rR8M3O8Aai1CQd1hzWIND1521NWKUB3EhHRMzPcZvRKV78QDgxx0O8tDE2qApzmkruTr16YQdif6meHy/wWwszR3YgVKjVKeDzKZ/zEeC0l9M4AS5cXUADc5OAoC91SSGZFcHfJYpL96Cx6f74cDMRC2+kQRYqRTZqVneWObu6gEtqG687Aj7IwNrmy0cEx0zaIIbnL8h6fdq3pERt8DBSNKEHYtEp0wyHK61yUqXieJ47PInGWYoCKAppOT2wlpK4wY0rbfAOsvP8iLoqRzd/PqcTdyuuwDM7WgetmWDeGlt01RuOmhfiU063Wi1DDrSJGLOkyGLLB1FB8O7WPYSy1UMojV8M5IWC1tq+tRcHy1XJk6ylZiV7AdlnP6wH2EWHIQf1qvIJeMPeUACiSmz54pids7HxmjaiZS3JCmrgQCvsb7s/M1nAOTVGllYtMC6QculGXwvQNOjt1/k3QD3L6/NHD6jor8XF5TJxTfho7xR1Z2Qh3wNO1wbY4qERIq8VbT0aDZhZ1pncM4W5GoI2B1nk1QhOpFaZlx6pRgMZaNQKUmmxtxfsltRGCkddHTk/FnZbqcqruF60jB+LlfjxTtQZ6TVE0oXF3dlO9Py6fVVHOkK9mfaX6QcRZHWPnHunbFGZXtRy0fenIoDryUHDKHESouLclaXPVLHD3sdb/XTSV5e/sln9pqUU9scDak4sJnr7Gxp3D8hqFRGm9tAUz+y079Eo81Wo/m2kvZqccBitX3Mr1rppGvHBCgjjcdmMIshYvP9ELLQypjYFxydHAAaDVwbvAj7D/sW6w6e+azXHEx4cnYQDWmmh51l5lqZMnlEj5NhaSbwoseaqK6JjjPx5m408msdoABjtXUAXwuwHyB9AoKNygLOFgsCVfBex9PdT9qHoV2bX26ryAFPuC5DsiJyI7ZXQFcmihWONbELDzjooSouNj2bhj0hz/C6GeHlIa9Ib9yJeymc0GPeUi6heRoNBEivm9puVQb/PwJ7Kx089i5nllUydzZXA9Glpo28AyNtD3NnrYoaozjdElW2Ti5ON55Qmk7fuHmBX0ZV19NmYB+lrRb8oky7xFCFlBrfyIiVVXPhZDwVTlhfBbVadyh4QyxTjrgGhZvBI4WjhodelA1j875QJh68aOuuNBtYm5Gi/ro1g6phfOhC9xHdfPG9C7bnNSz75IkkT7yAS2g8klsT9ZMLBlw0PENy4INtQiqp1qgiWxYymbwxE+vcpzJbfFZ5iP2PuDi0eapoavPn+5YCZDvJD27f55tdRZMc5CY3/6/cj4bO//fyN3PcMg18ICr5gJST27bh/kflhIcCPDvlsLZtq4hpa21lWqq6LwPw125rOQh7pUG4hSFA8XSbLcyW2vVZiMJ+OX6Zt8GeAuHyRBIjuVzcv19N3L93HXJhDvT6hoZev0g7UHX+EjMEwBwrMAI5+oT12qTh0h+2DZ+McURh31vV/PTAHCr2g+LBOH/YldrwsiBGJPzh7Q3F/OJm/bRKtq9ZvphcGN8OGYtjDP2RLPiWBFLqK2fiDTHH1+YmzBfdY8HfHkc0qbPgjq9g5CP+bJrk3m+uYRfBPr6UOHfi2DESc8pxtxvY+fuppMu94mvEg0cdRT8ukdMX42bC2Shf0Y/Z+6YyLv25ecN9Kke8OkkfkENRHD3BG3ZftUIkSrUNU6IwOyJY4KbEb9Xm0e42nzix/etQ9MPpIHlsEPVFvd6RkVdyh3zQrtfbXY2s3WofyWR9K5rbq7aPeIFQtx5xoEdRB/YlGZMl6BnVXA+qLjxD3JgTmWpoNAVyB749pE3Tl7v4oPQN1eHDudUrc2EoBcq/TlZVwbnKFCWct7IqH969AHzMBNzgc0IoCJ1xkrqhbvMW/aZDu5Y1i4ifVR4nZaaMTmGfKaRc02wc6gISXQrzwNE3ukc7e4I23OAPpcC9iTkT4XG4srW7v3xj7I0vd69tMccbbxUVDAb301iuaS8q6kviJnWXFLueoE9cpt2lxH1FRe1PIgAs+YDAHJhn/XqCsIdpwzQYhlImihOUygoSI3NzP39YGRnNpKfQ4e8hjTRaKnvRRzduOCIdYduFB8UHhZGvreSAnM5f9bEDhoFYPWjMZnIsr5X2hnz4ZcexLz8MgY3RehCkW8Ec5xukp+MkcebY01KD5FJsQv78tdLP0+H64ycWnThcDxth6eThrg3FmcaDXcc3hlYD1nKYlJOTk+AjCo/44yOZj5SD4JsYCe35aIQ4MTcCxZ5W9ihPx0I9j/9NKeLGXEj1005+hapCO5MQUZhkP0/SKeF3fnb28pPxTovBtCf/EJgTI9lsDhvH3BhRnIVNYi4MR4/MUZ0ITH8yWlVhW7c7/SIFq8KSsUps+se/pN4+MBzxVW19G+VZkEId9pKyrucFPPf9U798z7pYfUAuHmhFwjlRf7+1y4+275reEFNUNUybu+Y3bqS1pDaUuVLP2xF64kIojzc5W7lb/WDjTjTk5LW96Y0/0JlGhHGp8f0B1tRdKB718eRbO6rtrFOM1OmKvC/DrkkYweW6T75iv3Un/Nys12NdMW5uLODs8Q/JY9H8ualPOev6QvvWcZLvqYJop8IN780NlIs8GlxDaoihvOlzLSukVXx9EW3VycamuHhCr2+G/PXXdEqJJFubUsQo4Lo5BfSiFG22pISqa8xejq0c5CfEFzg/EOEaj4bQkK/VXVHxesnvZECkSkAcmAv98slTYolDjkvEJPYp7VVO+eDY2p4+Qe6rfHLXUp+9au/abE7BMNP+S+9s63zrzTO650HDSjozN39Naf2xtZnIySA0KIOrrzA1TOt7FjysZYSDGImVYMuYv7uqmtla22Yw/y2kHAh0BrB+aUquQp0+W63Irzndu7ExSn33YYk34+E35Yzx2S95Citno3g0Y7v4CfcTPODVR31ke8fgko/ZONXKK2NrtewynlVILGlMmapYbJrSJqzcIs5q3NjbW7PzvdhhdXquYmnK+qQkoNspWzFlKzBPDlZETQPWPOzzrHHG7PWdhSSGp0q0Hh9DRSMCA6t9TTE5FYfV7HT2Lunew8MVOTFNWsiSrBmh3dbG6xJzeCWRPdChH71H3qaNaJIt0LwoIanOF8kbSspPSMhfJN2FRfsbPKymMISW6RIg71/Ehfws9JfenxHXO9/EyFFKZ8X5Abqn70DAqXwHmH8KmTDhb8uemxwZwf2PFBIou221raIZMAAUrwtJjYl0Twr3nc4ajbgNvNl5PqY6Lw7E3lQRGClezB9Pnc/rZRHmRHrhUnix2F5t1uiF7MUlBIaXFFcpixGn3IlIp+5AkYLqRqIPehWdo1rpZAYgH6DCGmn/Uh2h7o8gV7PX2UhDINFF4PL+QiIubixLlDVmZNovW4aP+jyIC3MhHuCt5ftl6NJ0GRMRmaFl0czEYsl8rah0ofrnaUqkiTXD7uDyJ0yqNJVpgp+JVx00M6FEOk8jMi4YqE1ZkpAqw6wFbSGfcl8+kEhaZiF456tzArGQd/mtaxvFMdJm8/g7Cj2eTmLy+xFQ2mxIdzCrZyVvCEC6oK+ue5pumKZMGpTKZ7MRcof/93Qc+7p1KeLabHvqpQ7U2UEs5FCt0zY25qX22G/2fpZ2oVOIC5mClkyNDJkkMYlr/22M5CKCHBsD9/8ibuE5g0mdk98i3+aJk/gBssf/IsDsgeMkRo6O2qUmPeE+l23z+TyYkjmuPMHMJ7Xuqd+iDfxu4RToL9krvvXo0S1z51boeULu9CdP5bW1toTbGarEDZmF1Z6fOwfg5dMAh6vRpM1UWxcWJOYlJOQlFriku5iX0Id2vdZlmutmVaQtW5ZWMfvnqU/96N0BP83+Oe0nUDHrMWZ2RR1gQ/fFdCFfeilu4qqOuySd4I3r5vMtbA6cDk9o75Shfhg/SV8n/15WZ0xKh19QcukDKOHPTx/npSca7dLAY6/mvbrwDHUhMpMJ93MUEm+/Q2BkfrD21lpmVbXdZJQhbhB6syl8nJ8nvRhL0UccFHaF9DRnyeAaWRbqQA2IC21fXg2cLWvuCela+mOEAc6pjYD10elwLOJG7shqQLa0uZfG/55P6z2YJQU1sjuIE40JS4/Wh/VAHWGYI/8w6gJ0JHeCpAbXIh+eEb4nlU6d0w2SgdgBgmSyDoruo05kaEj7XUPHCxjSnzV0x9RKd04kH7pTeMeDOBAQpRpdE3i1Um3OWYY0z7DMgCuXvlM4d1l2M7LJsqmc0V2YplbMaQzJr/6TA2nOXjan8HzFcvp4TmtkHLRWtqElaw2yeAnDurBrf6U5vHtJd2GY3bqoCSnYYcg17Ija9O67m6Jak5t2FVOYlPSz74XmnqYqjlmmr9dvGtOmbVte+5O9HQUDP3RXWUS1e+wRoKNfnh71CPfE5wPROgfqRLz9/YTcIccnp/wSPFNTdrMlrLbW3t/vRVyI+Ed06iKZiAtzI+Dro6F5XAwoNvnZ+favMn3Ow+TbJyftnw8HbMTPXs4zWyjwde5Vy01Xwbgcf3DfAzrkxDJ9fSSGA+PIXLdK/EVrrGALyXRExN4BI51tMsFipY0D31w4NDjgf69rOPSd9evaaltElupu228P/V1L8F+DFk+UhWdGwBUOvEcGfIyRX4Q+FNOwSbyKTP6EWTVTBUQScdJB0cEkOv3XTMlDnTNyHtj1rTYBqB3D+u2rylLNKpU5texZarmLZlUvPyt/TZU3lelokNeyTGaVmlpaTFKr7LZ0P/eWFqlJZr1dE/wqAXUia2tCj1VTY5Yo5a5SvxMshFbRXImJyTZV3lp2h1rylq1X3lj/vceIpSFTJUwDh8axyvw8n7xr8wZB2JtzsMo82M4XC1UpRmOKSrOi4MeAd/jbyTsBP63I16iMySnG13VyksCrhH9W5KsroLJ1Tt2tf7dH0ZcELvMSxE94adwn4rmBlj89uN/Rwv9GKfb5NVcGImzPUmR9peePy9y54qfcNN5TcQJ3W/TaV3sv08Mz6GKGey94+eA8I5xh3lu3sHafmSFmrAXja4gbeRwc9Hr5rjjj+Ypv9FcwZLU5WXzqe0n4pKHxQxx1BJ/mrJhfd8oLBh/LMFkNyJIeDDnx5a71/+z6UjWPGi19tnvlwpbw3mQsHHh8sAuMjJIywoSkes1MvYXghhhZsQFZgrMRjqm/v/TGtNS3XpSFR4FyHBC7I0Ycax5HYAT+jUhfPTzzCIEB5diBytGFRLnzE1fAb9nfFgjW7r+OqpwZYVukW5hnXKGK9peuQdbAXM2dvHp6XJZs2Elpl7ZTdq6auRV11WbOIjY3oC7fu9o0zZ4O7wy8LLDZrBbb5kc83Wz6bF1mZuoAfSDVvnkz2Pl/Nurz6UUUtKbI3aIBaSU097A70EuhqGtmpBOgDbftg3xg0pjggDqOyT1QVPo+5IhaDeUCUP/OGujHVXo9dOMWadCCpCu/2UXcoyUIkSYchRK68m9N6SjqZ+kOSCtC07QBWp12U3+55VPofRH4FhpmeWb+gzoqMmlKt0IPhBZER3FlH/SdyULMSCdA1GP3yJ1QaGLWlYsNomUxSRuoKiWkvgniMi0nCTJAja/oysWQO8qr/1+XRWh1JaJkEAKWt4ii9hYIaqNZOyPQC8xE6J/KXxt4fudfxWJ4zu9BIZAPgFQW/NWVXQUyG/VP+vQjmv4sMSUBoH9DmKF8f1HM/PHjH03h+7jB/9dJ/v45JMTVmXg+8TJoSXqgDk6XXzpyEpnYI+NK5IkWe2EArWz1nFYjSZzWQFamLTWiDztvZfAogiiDAcHqfXUaSfVBqU3rJ6Wh9edpDLM/lIXW/6eJzsnvd5OE094CqI/i3UcG0fs3rHMA+blKsi+/UJJnKl4Oz1Vv7IiEAoquON2K1NavqlVRCTfFO1O8qhC4iMKfaPVwVo1vT09VmvBguelAfRTvPjIkfr1/w43K4WytCNaqzv6FTzTBwcZUvByeCbUjEPFZQdHZp9uXndqN/aq5XRUf1cJN8U4VE9KQUl5DrPc+0abqcO7gxbenfKiKVB0sFfPPUpdF/D/Cc0CVyrQcttPl9mivzw8gwoQyLqTSxjofhFGcpFlelFXdtF0/jNO8rNt+nNf9vN+v0erS9RmGzKzsnNy8/ILCouKSUqPJbLGWlS8wwO9OK9S1YA3qmYYgwpfUg2T78Dl1AA6vBkMLZDEM7BlE1xFE+3Xia7nrQff4YzeeHCpK4wkUt1VdmYgWn1sOLGX0J50y+ihyQ2lqmVTAKrq+5XgbWOGUeja1PZu1z9oe4PUhNy4ZgXqom+ANyxQgnXt7d1j5cMPcwHGStF+Lj4NaOMf+xZymHysdBk+Mk44Cg/NUjxu4+sbfsd8g5bGgpNSAmHBGrCWEwBfIQby6iD0sToPoW9a1rPcPl6esylRyVa1+xNFAfH3WfoIWp6mhMFA6vtABc8FnYLTh43ckItWxqDNTQSxt4ATYpqviCJOf83JEGmeShHY7eTHkNGjUi42HgbhGfdqoOsBymo8tlMq0h5kQl7T42ByhK0+sys205CrHqXJkKwOYkuP8gMXObvAmvwBjw6dj/tWW4FwfnVcDpjZi0Kjxhg2Zi0nGGmeCOZsvczJXUzYmm2hupjWVuXcA);\n font-weight: normal;\n font-style: normal;\n}\n.ag-theme-quartz,\n.ag-theme-quartz-dark,\n.ag-theme-quartz-auto-dark {\n --ag-active-color: #2196f3;\n --ag-background-color: #fff;\n --ag-foreground-color: #181d1f;\n --ag-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 15%);\n --ag-secondary-border-color: var(--ag-border-color);\n --ag-header-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 2%);\n --ag-tooltip-background-color: var(--ag-header-background-color);\n --ag-control-panel-background-color: var(--ag-header-background-color);\n --ag-subheader-background-color: transparent;\n --ag-invalid-color: #e02525;\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 30%);\n --ag-advanced-filter-join-pill-color: #f08e8d;\n --ag-advanced-filter-column-pill-color: #a6e194;\n --ag-advanced-filter-option-pill-color: #f3c08b;\n --ag-advanced-filter-value-pill-color: #85c0e4;\n --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\n --ag-icon-font-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 90%);\n --ag-find-match-color: var(--ag-foreground-color);\n --ag-find-match-background-color: #ffff00;\n --ag-find-active-match-color: var(--ag-foreground-color);\n --ag-find-active-match-background-color: #ffa500;\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 3%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 20%);\n --ag-selected-row-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 8%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 12%);\n --ag-column-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\n --ag-input-focus-border-color: var(--ag-active-color);\n --ag-range-selection-background-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-input-focus-box-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color) 47%);\n --ag-input-error-focus-box-shadow: 0 0 0 3px\n color-mix(in srgb, var(--ag-background-color), var(--ag-invalid-color) 50%);\n --ag-range-selection-background-color-2: color-mix(in srgb, transparent, var(--ag-active-color) 36%);\n --ag-range-selection-background-color-3: color-mix(in srgb, transparent, var(--ag-active-color) 49%);\n --ag-range-selection-background-color-4: color-mix(in srgb, transparent, var(--ag-active-color) 59%);\n --ag-row-numbers-selected-color: color-mix(in srgb, transparent, var(--ag-active-color) 50%);\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-checkbox-checked-color: var(--ag-active-color);\n --ag-range-selection-border-color: var(--ag-active-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-disabled-foreground-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 50%);\n --ag-chip-background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 7%);\n --ag-chip-border-color: color-mix(in srgb, var(--ag-header-background-color), var(--ag-foreground-color) 13%);\n --ag-input-disabled-border-color: var(--ag-border-color);\n --ag-input-disabled-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 6%);\n --ag-modal-overlay-background-color: color-mix(in srgb, transparent, var(--ag-background-color) 66%);\n --ag-chart-menu-label-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 80%);\n --ag-chart-menu-pill-select-button-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\n --ag-filter-panel-card-subtle-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 70%);\n --ag-column-drag-indicator-color: var(--ag-active-color);\n --ag-borders: solid 1px;\n --ag-border-radius: 4px;\n --ag-wrapper-border-radius: 8px;\n --ag-borders-side-button: none;\n --ag-side-button-selected-background-color: transparent;\n --ag-header-column-resize-handle-display: block;\n --ag-header-column-resize-handle-width: 2px;\n --ag-header-column-resize-handle-height: 30%;\n --ag-grid-size: 8px;\n --ag-icon-size: 16px;\n --ag-header-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 4.25);\n --ag-row-height: calc(var(--ag-font-size) + var(--ag-grid-size) * 3.5);\n --ag-list-item-height: calc(\n var(--ag-icon-size) + var(--ag-widget-vertical-spacing)\n );\n --ag-column-select-indent-size: var(--ag-icon-size);\n --ag-set-filter-indent-size: var(--ag-icon-size);\n --ag-filter-tool-panel-group-indent: var(--ag-grid-size);\n --ag-advanced-filter-builder-indent-size: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 2);\n --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1);\n --ag-toggle-button-height: 18px;\n --ag-toggle-button-width: 28px;\n --ag-toggle-button-border-width: 2px;\n --ag-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,\n Cantarell, "Helvetica Neue", sans-serif;\n --ag-font-size: 14px;\n --ag-icon-font-family: agGridQuartz;\n --ag-tab-min-width: 290px;\n --ag-chart-menu-panel-width: 260px;\n --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\n --ag-popup-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.15);\n --ag-side-bar-panel-width: 250px;\n --ag-filter-panel-apply-button-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-background-color: var(--ag-active-color);\n --ag-column-panel-apply-button-color: var(--ag-background-color);\n --ag-column-panel-apply-button-background-color: var(--ag-active-color);\n}\n\n.ag-theme-quartz-dark {\n --ag-background-color: color-mix(in srgb, #fff, #182230 97%);\n --ag-foreground-color: #fff;\n --ag-border-color: rgba(255, 255, 255, 0.16);\n --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-header-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-tooltip-background-color: color-mix(in srgb, #fff, #182230 96%);\n --ag-control-panel-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-input-disabled-background-color: #68686e12;\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-selected-row-background-color: var(--ag-row-hover-color);\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n .ag-theme-quartz-auto-dark {\n --ag-background-color: color-mix(in srgb, #fff, #182230 97%);\n --ag-foreground-color: #fff;\n --ag-border-color: rgba(255, 255, 255, 0.16);\n --ag-secondary-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-header-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-tooltip-background-color: color-mix(in srgb, #fff, #182230 96%);\n --ag-control-panel-background-color: color-mix(in srgb, #fff, #182230 93%);\n --ag-input-disabled-background-color: #68686e12;\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-disabled-border-color: rgba(255, 255, 255, 0.07);\n --ag-checkbox-unchecked-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 40%);\n --ag-row-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 20%);\n --ag-selected-row-background-color: var(--ag-row-hover-color);\n --ag-panel-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-panel-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-menu-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 10%);\n --ag-menu-border-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n --ag-advanced-filter-join-pill-color: #7a3a37;\n --ag-advanced-filter-column-pill-color: #355f2d;\n --ag-advanced-filter-option-pill-color: #5a3168;\n --ag-advanced-filter-value-pill-color: #374c86;\n --ag-find-match-color: var(--ag-background-color);\n --ag-find-active-match-color: var(--ag-background-color);\n --ag-filter-panel-apply-button-color: var(--ag-foreground-color);\n --ag-column-panel-apply-button-color: var(--ag-foreground-color);\n --ag-popup-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);\n --ag-row-loading-skeleton-effect-color: rgba(202, 203, 204, 0.4);\n --ag-cell-batch-edit-text-color: #f3d0b3;\n --ag-formula-token-1-color: #4da3e5;\n --ag-formula-token-1-background-color: rgb(77 163 229 / 16%);\n --ag-formula-token-2-color: #f55864;\n --ag-formula-token-2-background-color: rgb(245 88 100 / 16%);\n --ag-formula-token-3-color: #b688f2;\n --ag-formula-token-3-background-color: rgb(182 136 242 / 16%);\n --ag-formula-token-4-color: #24bb4a;\n --ag-formula-token-4-background-color: rgb(36 187 74 / 16%);\n --ag-formula-token-5-color: #e772ba;\n --ag-formula-token-5-background-color: rgb(231 114 186 / 16%);\n --ag-formula-token-6-color: #f69b5f;\n --ag-formula-token-6-background-color: rgb(246 155 95 / 16%);\n --ag-formula-token-7-color: #a3e6ff;\n --ag-formula-token-7-background-color: rgb(163 230 255 / 16%);\n color-scheme: dark;\n }\n}\n.ag-theme-quartz .ag-filter-toolpanel-header,\n.ag-theme-quartz .ag-filter-toolpanel-search,\n.ag-theme-quartz .ag-status-bar,\n.ag-theme-quartz .ag-header-row,\n.ag-theme-quartz .ag-row-number-cell,\n.ag-theme-quartz .ag-panel-title-bar-title,\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\n.ag-theme-quartz .ag-filter-card-title,\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-dark .ag-status-bar,\n.ag-theme-quartz-dark .ag-header-row,\n.ag-theme-quartz-dark .ag-row-number-cell,\n.ag-theme-quartz-dark .ag-panel-title-bar-title,\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-dark .ag-filter-card-title,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-auto-dark .ag-status-bar,\n.ag-theme-quartz-auto-dark .ag-header-row,\n.ag-theme-quartz-auto-dark .ag-row-number-cell,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-title,\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-filter-card-title {\n font-weight: 500;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-quartz input[class^=ag-]:not([type]),\n.ag-theme-quartz input[class^=ag-][type=text],\n.ag-theme-quartz input[class^=ag-][type=number],\n.ag-theme-quartz input[class^=ag-][type=tel],\n.ag-theme-quartz input[class^=ag-][type=date],\n.ag-theme-quartz input[class^=ag-][type=datetime-local],\n.ag-theme-quartz textarea[class^=ag-],\n.ag-theme-quartz-dark input[class^=ag-]:not([type]),\n.ag-theme-quartz-dark input[class^=ag-][type=text],\n.ag-theme-quartz-dark input[class^=ag-][type=number],\n.ag-theme-quartz-dark input[class^=ag-][type=tel],\n.ag-theme-quartz-dark input[class^=ag-][type=date],\n.ag-theme-quartz-dark input[class^=ag-][type=datetime-local],\n.ag-theme-quartz-dark textarea[class^=ag-],\n.ag-theme-quartz-auto-dark input[class^=ag-]:not([type]),\n.ag-theme-quartz-auto-dark input[class^=ag-][type=text],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=number],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=tel],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=date],\n.ag-theme-quartz-auto-dark input[class^=ag-][type=datetime-local],\n.ag-theme-quartz-auto-dark textarea[class^=ag-] {\n min-height: calc(var(--ag-grid-size) * 4);\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-quartz .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-ltr textarea[class^=ag-], .ag-theme-quartz-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-ltr textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz .ag-rtl textarea[class^=ag-], .ag-theme-quartz-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-dark .ag-rtl textarea[class^=ag-], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-quartz-auto-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-quartz-auto-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-picker-field-wrapper,\n.ag-theme-quartz-dark .ag-picker-field-wrapper,\n.ag-theme-quartz-auto-dark .ag-picker-field-wrapper {\n min-height: calc(var(--ag-grid-size) * 4);\n}\n.ag-theme-quartz .ag-tab,\n.ag-theme-quartz-dark .ag-tab,\n.ag-theme-quartz-auto-dark .ag-tab {\n padding: var(--ag-grid-size);\n border-left: var(--ag-borders) transparent;\n border-right: var(--ag-borders) transparent;\n flex: 1 1 auto;\n}\n.ag-theme-quartz .ag-tab-selected,\n.ag-theme-quartz-dark .ag-tab-selected,\n.ag-theme-quartz-auto-dark .ag-tab-selected {\n background-color: var(--ag-background-color);\n}\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:first-of-type) {\n border-left-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:first-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:first-of-type) {\n border-right-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-ltr .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-ltr .ag-tab-selected:not(:last-of-type) {\n border-right-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-dark .ag-rtl .ag-tab-selected:not(:last-of-type), .ag-theme-quartz-auto-dark .ag-rtl .ag-tab-selected:not(:last-of-type) {\n border-left-color: var(--ag-border-color);\n}\n\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected),\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected),\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected) {\n opacity: 0.7;\n}\n.ag-theme-quartz .ag-tab:not(.ag-tab-selected):hover,\n.ag-theme-quartz-dark .ag-tab:not(.ag-tab-selected):hover,\n.ag-theme-quartz-auto-dark .ag-tab:not(.ag-tab-selected):hover {\n opacity: 1;\n}\n.ag-theme-quartz .ag-menu,\n.ag-theme-quartz-dark .ag-menu,\n.ag-theme-quartz-auto-dark .ag-menu {\n color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\n}\n.ag-theme-quartz .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-quartz-dark .ag-panel-content-wrapper .ag-column-select,\n.ag-theme-quartz-auto-dark .ag-panel-content-wrapper .ag-column-select {\n background-color: var(--ag-control-panel-background-color);\n color: color-mix(in srgb, transparent, var(--ag-foreground-color) 95%);\n}\n.ag-theme-quartz .ag-menu-header,\n.ag-theme-quartz-dark .ag-menu-header,\n.ag-theme-quartz-auto-dark .ag-menu-header {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-menu-option,\n.ag-theme-quartz-dark .ag-menu-option,\n.ag-theme-quartz-auto-dark .ag-menu-option {\n font-weight: 500;\n cursor: pointer;\n}\n.ag-theme-quartz .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-popup-pointer .ag-icon {\n text-align: right;\n}\n\n.ag-theme-quartz .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-popup-pointer .ag-icon {\n text-align: left;\n}\n\n.ag-theme-quartz .ag-tabs-header,\n.ag-theme-quartz-dark .ag-tabs-header,\n.ag-theme-quartz-auto-dark .ag-tabs-header {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n display: flex;\n background-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 5%);\n}\n.ag-theme-quartz .ag-side-bar,\n.ag-theme-quartz-dark .ag-side-bar,\n.ag-theme-quartz-auto-dark .ag-side-bar {\n background-color: var(--ag-control-panel-background-color);\n min-width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-theme-quartz .ag-side-buttons,\n.ag-theme-quartz-dark .ag-side-buttons,\n.ag-theme-quartz-auto-dark .ag-side-buttons {\n padding: 0;\n align-self: stretch;\n width: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n background: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-side-button,\n.ag-theme-quartz-dark .ag-side-button,\n.ag-theme-quartz-auto-dark .ag-side-button {\n border-top: var(--ag-borders) transparent;\n border-bottom: var(--ag-borders) transparent;\n}\n@media (max-resolution: 1.5x) {\n .ag-theme-quartz .ag-side-button-label,\n .ag-theme-quartz-dark .ag-side-button-label,\n .ag-theme-quartz-auto-dark .ag-side-button-label {\n font-family: "Segoe UI", var(--ag-font-family);\n transform: rotate(0.05deg);\n }\n}\n.ag-theme-quartz .ag-side-button.ag-selected,\n.ag-theme-quartz-dark .ag-side-button.ag-selected,\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected {\n border-bottom-color: var(--ag-border-color);\n background-color: var(--ag-background-color);\n}\n.ag-theme-quartz .ag-side-button.ag-selected:not(:first-of-type),\n.ag-theme-quartz-dark .ag-side-button.ag-selected:not(:first-of-type),\n.ag-theme-quartz-auto-dark .ag-side-button.ag-selected:not(:first-of-type) {\n border-top-color: var(--ag-border-color);\n}\n.ag-theme-quartz .ag-column-panel-column-select,\n.ag-theme-quartz-dark .ag-column-panel-column-select,\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select {\n border-top: none;\n}\n.ag-theme-quartz .ag-column-panel-column-select:not(.ag-last-visible-child),\n.ag-theme-quartz-dark .ag-column-panel-column-select:not(.ag-last-visible-child),\n.ag-theme-quartz-auto-dark .ag-column-panel-column-select:not(.ag-last-visible-child) {\n border-bottom: 1px solid var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-filter-toolpanel-search,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search {\n height: initial;\n margin-top: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-filter-toolpanel-search-input,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search-input,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search-input {\n margin: 0;\n}\n.ag-theme-quartz .ag-filter-apply-panel,\n.ag-theme-quartz-dark .ag-filter-apply-panel,\n.ag-theme-quartz-auto-dark .ag-filter-apply-panel {\n border: none;\n padding-top: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-chart-tabbed-menu-body,\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body,\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body {\n position: relative;\n}\n.ag-theme-quartz .ag-chart-tabbed-menu-body::after,\n.ag-theme-quartz-dark .ag-chart-tabbed-menu-body::after,\n.ag-theme-quartz-auto-dark .ag-chart-tabbed-menu-body::after {\n content: "";\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n right: 0;\n height: 16px;\n background: linear-gradient(var(--ag-control-panel-background-color), transparent);\n}\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\n border-top: none;\n font-weight: 500;\n}\n.ag-theme-quartz .ag-chart-mini-thumbnail,\n.ag-theme-quartz-dark .ag-chart-mini-thumbnail,\n.ag-theme-quartz-auto-dark .ag-chart-mini-thumbnail {\n background-color: var(--ag-background-color);\n margin-top: 0;\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-chart-settings-nav-bar,\n.ag-theme-quartz-dark .ag-chart-settings-nav-bar,\n.ag-theme-quartz-auto-dark .ag-chart-settings-nav-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\n background: none;\n font-weight: 500;\n}\n.ag-theme-quartz .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label:not(.ag-group-title-bar),\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label:not(.ag-group-title-bar) {\n color: var(--ag-chart-menu-label-color);\n}\n.ag-theme-quartz .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz .ag-chart-format-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-format-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-label-align-top .ag-label {\n margin-top: calc(var(--ag-widget-vertical-spacing) * 0.5);\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section .ag-slider.ag-label-align-top .ag-label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section .ag-slider.ag-label-align-top .ag-label {\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-chart-data-section label,\n.ag-theme-quartz .ag-chart-format-section label,\n.ag-theme-quartz-dark .ag-chart-data-section label,\n.ag-theme-quartz-dark .ag-chart-format-section label,\n.ag-theme-quartz-auto-dark .ag-chart-data-section label,\n.ag-theme-quartz-auto-dark .ag-chart-format-section label {\n display: inline-block;\n}\n.ag-theme-quartz .ag-chart-format-wrapper,\n.ag-theme-quartz .ag-chart-data-wrapper,\n.ag-theme-quartz .ag-charts-format-top-level-group,\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz .ag-charts-format-top-level-group-item,\n.ag-theme-quartz .ag-charts-format-sub-level-group,\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-container,\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-chart-format-wrapper,\n.ag-theme-quartz-dark .ag-chart-data-wrapper,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-item,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-chart-format-wrapper,\n.ag-theme-quartz-auto-dark .ag-chart-data-wrapper,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-item:last-child,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-container {\n padding: 0;\n margin: 0;\n}\n.ag-theme-quartz .ag-charts-format-top-level-group,\n.ag-theme-quartz .ag-charts-data-group,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-dark .ag-charts-data-group,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group,\n.ag-theme-quartz-auto-dark .ag-charts-data-group {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-data-group-title-bar,\n.ag-theme-quartz .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-settings-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group-title-bar {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz .ag-charts-settings-group .ag-charts-settings-group-container,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz-dark .ag-charts-settings-group .ag-charts-settings-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group .ag-charts-format-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-data-group .ag-charts-data-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-settings-group .ag-charts-settings-group-container {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-title-bar {\n padding: var(--ag-widget-vertical-spacing) 0;\n}\n.ag-theme-quartz .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container {\n padding-top: var(--ag-widget-vertical-spacing);\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz-dark .ag-charts-format-sub-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-format-top-level-group-container > *,\n.ag-theme-quartz-auto-dark .ag-charts-format-sub-level-group-container > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n.ag-theme-quartz .ag-charts-data-group-item,\n.ag-theme-quartz-dark .ag-charts-data-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-data-group-item {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-chart-settings-mini-wrapper,\n.ag-theme-quartz-dark .ag-chart-settings-mini-wrapper,\n.ag-theme-quartz-auto-dark .ag-chart-settings-mini-wrapper {\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-chart-advanced-settings-section,\n.ag-theme-quartz-dark .ag-chart-advanced-settings-section,\n.ag-theme-quartz-auto-dark .ag-chart-advanced-settings-section {\n padding-top: var(--ag-widget-container-vertical-padding);\n padding-bottom: var(--ag-widget-container-vertical-padding);\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group .ag-charts-advanced-settings-top-level-group-container {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-container,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-container {\n margin: 0;\n}\n.ag-theme-quartz .ag-charts-advanced-settings-top-level-group-item,\n.ag-theme-quartz-dark .ag-charts-advanced-settings-top-level-group-item,\n.ag-theme-quartz-auto-dark .ag-charts-advanced-settings-top-level-group-item {\n margin-top: calc(var(--ag-widget-vertical-spacing) * 2);\n margin-bottom: 0;\n}\n.ag-theme-quartz .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-ltr .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-dark .ag-rtl .ag-group-title-bar-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-spectrum-color,\n.ag-theme-quartz .ag-spectrum-fill,\n.ag-theme-quartz-dark .ag-spectrum-color,\n.ag-theme-quartz-dark .ag-spectrum-fill,\n.ag-theme-quartz-auto-dark .ag-spectrum-color,\n.ag-theme-quartz-auto-dark .ag-spectrum-fill {\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-quartz .ag-spectrum-dragger,\n.ag-theme-quartz-dark .ag-spectrum-dragger,\n.ag-theme-quartz-auto-dark .ag-spectrum-dragger {\n border-radius: 18px;\n height: 18px;\n width: 18px;\n border: 3px solid white;\n}\n.ag-theme-quartz .ag-spectrum-tools,\n.ag-theme-quartz-dark .ag-spectrum-tools,\n.ag-theme-quartz-auto-dark .ag-spectrum-tools {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n}\n.ag-theme-quartz .ag-spectrum-tool,\n.ag-theme-quartz-dark .ag-spectrum-tool,\n.ag-theme-quartz-auto-dark .ag-spectrum-tool {\n height: 12px;\n}\n.ag-theme-quartz .ag-spectrum-hue-background,\n.ag-theme-quartz .ag-spectrum-alpha-background,\n.ag-theme-quartz-dark .ag-spectrum-hue-background,\n.ag-theme-quartz-dark .ag-spectrum-alpha-background,\n.ag-theme-quartz-auto-dark .ag-spectrum-hue-background,\n.ag-theme-quartz-auto-dark .ag-spectrum-alpha-background {\n border-radius: 12px;\n}\n.ag-theme-quartz .ag-spectrum-slider,\n.ag-theme-quartz-dark .ag-spectrum-slider,\n.ag-theme-quartz-auto-dark .ag-spectrum-slider {\n margin-top: -15px;\n width: 18px;\n height: 18px;\n border-radius: 18px;\n border: 3px solid rgb(248, 248, 248);\n}\n.ag-theme-quartz .ag-recent-colors,\n.ag-theme-quartz-dark .ag-recent-colors,\n.ag-theme-quartz-auto-dark .ag-recent-colors {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n margin-bottom: 2px;\n}\n.ag-theme-quartz .ag-color-input-color,\n.ag-theme-quartz .ag-color-picker-color,\n.ag-theme-quartz .ag-recent-color,\n.ag-theme-quartz-dark .ag-color-input-color,\n.ag-theme-quartz-dark .ag-color-picker-color,\n.ag-theme-quartz-dark .ag-recent-color,\n.ag-theme-quartz-auto-dark .ag-color-input-color,\n.ag-theme-quartz-auto-dark .ag-color-picker-color,\n.ag-theme-quartz-auto-dark .ag-recent-color {\n border-radius: 4px;\n}\n.ag-theme-quartz .ag-recent-color,\n.ag-theme-quartz-dark .ag-recent-color,\n.ag-theme-quartz-auto-dark .ag-recent-color {\n border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-quartz.ag-dnd-ghost,\n.ag-theme-quartz-dark.ag-dnd-ghost,\n.ag-theme-quartz-auto-dark.ag-dnd-ghost {\n font-weight: 500;\n}\n.ag-theme-quartz .ag-standard-button,\n.ag-theme-quartz-dark .ag-standard-button,\n.ag-theme-quartz-auto-dark .ag-standard-button {\n font-family: inherit;\n appearance: none;\n -webkit-appearance: none;\n border-radius: var(--ag-border-radius);\n border: solid 1px var(--ag-input-border-color);\n background-color: var(--ag-background-color);\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n cursor: pointer;\n}\n.ag-theme-quartz .ag-standard-button:hover,\n.ag-theme-quartz-dark .ag-standard-button:hover,\n.ag-theme-quartz-auto-dark .ag-standard-button:hover {\n background-color: var(--ag-row-hover-color);\n}\n.ag-theme-quartz .ag-standard-button:active,\n.ag-theme-quartz-dark .ag-standard-button:active,\n.ag-theme-quartz-auto-dark .ag-standard-button:active {\n border-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-standard-button:disabled,\n.ag-theme-quartz-dark .ag-standard-button:disabled,\n.ag-theme-quartz-auto-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-quartz .ag-column-drop-cell,\n.ag-theme-quartz-dark .ag-column-drop-cell,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell {\n border-radius: calc(var(--ag-grid-size) * 3);\n height: calc(var(--ag-grid-size) * 3);\n padding: 0 var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-column-drop-cell-button,\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\n min-width: 0;\n margin: 0;\n}\n.ag-theme-quartz .ag-column-drop-cell-drag-handle,\n.ag-theme-quartz-dark .ag-column-drop-cell-drag-handle,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-drag-handle {\n margin-left: 0;\n}\n.ag-theme-quartz .ag-column-drop-vertical,\n.ag-theme-quartz-dark .ag-column-drop-vertical,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical {\n min-height: 75px;\n}\n.ag-theme-quartz .ag-column-drop-vertical-title-bar,\n.ag-theme-quartz-dark .ag-column-drop-vertical-title-bar,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-title-bar {\n padding: var(--ag-widget-container-vertical-padding) calc(var(--ag-grid-size) * 2) 0;\n}\n.ag-theme-quartz .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-ltr .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-drop-vertical-icon {\n margin-left: 0;\n margin-right: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-dark .ag-rtl .ag-column-drop-vertical-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-drop-vertical-icon {\n margin-right: 0;\n margin-left: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-theme-quartz .ag-column-drop-vertical-empty-message,\n.ag-theme-quartz-dark .ag-column-drop-vertical-empty-message,\n.ag-theme-quartz-auto-dark .ag-column-drop-vertical-empty-message {\n display: flex;\n align-items: center;\n justify-content: center;\n border: dashed 1px;\n border-color: var(--ag-border-color);\n margin: calc(var(--ag-grid-size) * 1.5) calc(var(--ag-grid-size) * 2);\n padding: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-quartz .ag-column-drop-empty-message,\n.ag-theme-quartz-dark .ag-column-drop-empty-message,\n.ag-theme-quartz-auto-dark .ag-column-drop-empty-message {\n color: var(--ag-foreground-color);\n}\n.ag-theme-quartz .ag-pill-select .ag-column-drop,\n.ag-theme-quartz-dark .ag-pill-select .ag-column-drop,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-column-drop {\n min-height: unset;\n}\n.ag-theme-quartz .ag-pill-select .ag-picker-field-display,\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-display,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-display {\n font-weight: 500;\n color: var(--ag-chart-menu-pill-select-button-color);\n}\n.ag-theme-quartz .ag-pill-select .ag-picker-field-icon .ag-icon,\n.ag-theme-quartz-dark .ag-pill-select .ag-picker-field-icon .ag-icon,\n.ag-theme-quartz-auto-dark .ag-pill-select .ag-picker-field-icon .ag-icon {\n color: var(--ag-chart-menu-pill-select-button-color);\n}\n.ag-theme-quartz .ag-status-bar,\n.ag-theme-quartz-dark .ag-status-bar,\n.ag-theme-quartz-auto-dark .ag-status-bar {\n font-weight: normal;\n}\n.ag-theme-quartz .ag-status-name-value,\n.ag-theme-quartz-dark .ag-status-name-value,\n.ag-theme-quartz-auto-dark .ag-status-name-value {\n padding: var(--ag-widget-container-vertical-padding) 0;\n}\n.ag-theme-quartz .ag-status-name-value-value,\n.ag-theme-quartz .ag-paging-number,\n.ag-theme-quartz .ag-paging-row-summary-panel-number,\n.ag-theme-quartz-dark .ag-status-name-value-value,\n.ag-theme-quartz-dark .ag-paging-number,\n.ag-theme-quartz-dark .ag-paging-row-summary-panel-number,\n.ag-theme-quartz-auto-dark .ag-status-name-value-value,\n.ag-theme-quartz-auto-dark .ag-paging-number,\n.ag-theme-quartz-auto-dark .ag-paging-row-summary-panel-number {\n font-weight: 500;\n}\n.ag-theme-quartz .ag-column-drop-cell-button,\n.ag-theme-quartz-dark .ag-column-drop-cell-button,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button {\n opacity: 0.75;\n}\n.ag-theme-quartz .ag-column-drop-cell-button:hover,\n.ag-theme-quartz-dark .ag-column-drop-cell-button:hover,\n.ag-theme-quartz-auto-dark .ag-column-drop-cell-button:hover {\n opacity: 1;\n}\n.ag-theme-quartz .ag-header-cell-menu-button,\n.ag-theme-quartz .ag-header-cell-filter-button,\n.ag-theme-quartz .ag-panel-title-bar-button,\n.ag-theme-quartz .ag-header-expand-icon,\n.ag-theme-quartz .ag-column-group-icons,\n.ag-theme-quartz .ag-set-filter-group-icons,\n.ag-theme-quartz .ag-group-expanded .ag-icon,\n.ag-theme-quartz .ag-group-contracted .ag-icon,\n.ag-theme-quartz .ag-chart-settings-prev,\n.ag-theme-quartz .ag-chart-settings-next,\n.ag-theme-quartz .ag-group-title-bar-icon,\n.ag-theme-quartz .ag-column-select-header-icon,\n.ag-theme-quartz .ag-floating-filter-button-button,\n.ag-theme-quartz .ag-filter-toolpanel-expand,\n.ag-theme-quartz .ag-panel-title-bar-button-icon,\n.ag-theme-quartz .ag-chart-menu-icon,\n.ag-theme-quartz-dark .ag-header-cell-menu-button,\n.ag-theme-quartz-dark .ag-header-cell-filter-button,\n.ag-theme-quartz-dark .ag-panel-title-bar-button,\n.ag-theme-quartz-dark .ag-header-expand-icon,\n.ag-theme-quartz-dark .ag-column-group-icons,\n.ag-theme-quartz-dark .ag-set-filter-group-icons,\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon,\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon,\n.ag-theme-quartz-dark .ag-chart-settings-prev,\n.ag-theme-quartz-dark .ag-chart-settings-next,\n.ag-theme-quartz-dark .ag-group-title-bar-icon,\n.ag-theme-quartz-dark .ag-column-select-header-icon,\n.ag-theme-quartz-dark .ag-floating-filter-button-button,\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand,\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon,\n.ag-theme-quartz-dark .ag-chart-menu-icon,\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button,\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button,\n.ag-theme-quartz-auto-dark .ag-header-expand-icon,\n.ag-theme-quartz-auto-dark .ag-column-group-icons,\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons,\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon,\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon,\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev,\n.ag-theme-quartz-auto-dark .ag-chart-settings-next,\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon,\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon,\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\n --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-foreground-color) 10%);\n}\n.ag-theme-quartz .ag-header-cell-menu-button:hover,\n.ag-theme-quartz .ag-header-cell-filter-button:hover,\n.ag-theme-quartz .ag-panel-title-bar-button:hover,\n.ag-theme-quartz .ag-header-expand-icon:hover,\n.ag-theme-quartz .ag-column-group-icons:hover,\n.ag-theme-quartz .ag-set-filter-group-icons:hover,\n.ag-theme-quartz .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz .ag-chart-settings-prev:hover,\n.ag-theme-quartz .ag-chart-settings-next:hover,\n.ag-theme-quartz .ag-group-title-bar-icon:hover,\n.ag-theme-quartz .ag-column-select-header-icon:hover,\n.ag-theme-quartz .ag-floating-filter-button-button:hover,\n.ag-theme-quartz .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz .ag-chart-menu-icon:hover,\n.ag-theme-quartz-dark .ag-header-cell-menu-button:hover,\n.ag-theme-quartz-dark .ag-header-cell-filter-button:hover,\n.ag-theme-quartz-dark .ag-panel-title-bar-button:hover,\n.ag-theme-quartz-dark .ag-header-expand-icon:hover,\n.ag-theme-quartz-dark .ag-column-group-icons:hover,\n.ag-theme-quartz-dark .ag-set-filter-group-icons:hover,\n.ag-theme-quartz-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz-dark .ag-chart-settings-prev:hover,\n.ag-theme-quartz-dark .ag-chart-settings-next:hover,\n.ag-theme-quartz-dark .ag-group-title-bar-icon:hover,\n.ag-theme-quartz-dark .ag-column-select-header-icon:hover,\n.ag-theme-quartz-dark .ag-floating-filter-button-button:hover,\n.ag-theme-quartz-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz-dark .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz-dark .ag-chart-menu-icon:hover,\n.ag-theme-quartz-auto-dark .ag-header-cell-menu-button:hover,\n.ag-theme-quartz-auto-dark .ag-header-cell-filter-button:hover,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button:hover,\n.ag-theme-quartz-auto-dark .ag-header-expand-icon:hover,\n.ag-theme-quartz-auto-dark .ag-column-group-icons:hover,\n.ag-theme-quartz-auto-dark .ag-set-filter-group-icons:hover,\n.ag-theme-quartz-auto-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-quartz-auto-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-prev:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-next:hover,\n.ag-theme-quartz-auto-dark .ag-group-title-bar-icon:hover,\n.ag-theme-quartz-auto-dark .ag-column-select-header-icon:hover,\n.ag-theme-quartz-auto-dark .ag-floating-filter-button-button:hover,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-quartz-auto-dark .ag-panel-title-bar-button-icon:hover,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon:hover {\n border-radius: 1px;\n background-color: var(--ag-quartz-icon-hover-color);\n box-shadow: 0 0 0 4px var(--ag-quartz-icon-hover-color);\n}\n.ag-theme-quartz .ag-filter-active,\n.ag-theme-quartz .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz .ag-filter-toolpanel-instance-header-icon,\n.ag-theme-quartz-dark .ag-filter-active,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-header-icon,\n.ag-theme-quartz-auto-dark .ag-filter-active,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-instance-header-icon,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-header-icon {\n position: relative;\n}\n.ag-theme-quartz .ag-filter-active::after,\n.ag-theme-quartz .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz .ag-filter-toolpanel-instance-header-icon::after,\n.ag-theme-quartz-dark .ag-filter-active::after,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-header-icon::after,\n.ag-theme-quartz-auto-dark .ag-filter-active::after,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-instance-header-icon::after,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-header-icon::after {\n content: "";\n position: absolute;\n width: 6px;\n height: 6px;\n top: -1px;\n right: -1px;\n border-radius: 50%;\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-filter-active,\n.ag-theme-quartz-dark .ag-filter-active,\n.ag-theme-quartz-auto-dark .ag-filter-active {\n --ag-quartz-icon-active-color: color-mix(in srgb, transparent, var(--ag-active-color) 14%);\n --ag-quartz-icon-hover-color: color-mix(in srgb, transparent, var(--ag-active-color) 28%);\n border-radius: 1px;\n background-color: var(--ag-quartz-icon-active-color);\n box-shadow: 0 0 0 4px var(--ag-quartz-icon-active-color);\n}\n.ag-theme-quartz .ag-filter-active .ag-icon-filter,\n.ag-theme-quartz-dark .ag-filter-active .ag-icon-filter,\n.ag-theme-quartz-auto-dark .ag-filter-active .ag-icon-filter {\n clip-path: path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");\n}\n.ag-theme-quartz .ag-chart-menu,\n.ag-theme-quartz-dark .ag-chart-menu,\n.ag-theme-quartz-auto-dark .ag-chart-menu {\n --ag-icon-size: 20px;\n background-color: color-mix(in srgb, transparent, var(--ag-background-color) 30%);\n padding: 4px 2px;\n}\n.ag-theme-quartz .ag-chart-menu-icon,\n.ag-theme-quartz-dark .ag-chart-menu-icon,\n.ag-theme-quartz-auto-dark .ag-chart-menu-icon {\n opacity: 0.8;\n}\n.ag-theme-quartz .ag-drag-handle,\n.ag-theme-quartz-dark .ag-drag-handle,\n.ag-theme-quartz-auto-dark .ag-drag-handle {\n color: var(--ag-icon-font-color);\n}\n.ag-theme-quartz .ag-menu-option-icon,\n.ag-theme-quartz .ag-compact-menu-option-icon,\n.ag-theme-quartz-dark .ag-menu-option-icon,\n.ag-theme-quartz-dark .ag-compact-menu-option-icon,\n.ag-theme-quartz-auto-dark .ag-menu-option-icon,\n.ag-theme-quartz-auto-dark .ag-compact-menu-option-icon {\n width: var(--ag-icon-size);\n cursor: pointer;\n}\n.ag-theme-quartz .ag-ltr .ag-menu-option-icon, .ag-theme-quartz .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-dark .ag-ltr .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-ltr .ag-compact-menu-option-icon {\n padding-left: calc(var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-menu-option-icon, .ag-theme-quartz .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-dark .ag-rtl .ag-compact-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-menu-option-icon, .ag-theme-quartz-auto-dark .ag-rtl .ag-compact-menu-option-icon {\n padding-right: calc(var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-quartz-dark .ag-chart-settings-card-item.ag-not-selected:hover,\n.ag-theme-quartz-auto-dark .ag-chart-settings-card-item.ag-not-selected:hover {\n opacity: 0.35;\n}\n.ag-theme-quartz .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-ltr .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-ltr .ag-panel-title-bar-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-dark .ag-rtl .ag-panel-title-bar-button, .ag-theme-quartz-auto-dark .ag-rtl .ag-panel-title-bar-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-dark .ag-multi-filter-group-title-bar,\n.ag-theme-quartz-auto-dark .ag-multi-filter-group-title-bar {\n padding: calc(var(--ag-grid-size) * 1.5) var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-body {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-body, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-body {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-filter-toolpanel-instance-filter,\n.ag-theme-quartz-dark .ag-filter-toolpanel-instance-filter,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-instance-filter {\n border: none;\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-quartz .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\n margin-left: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\n margin-right: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-quartz .ag-filter-toolpanel-group-level-0,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-level-0,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-level-0 {\n border-top: none;\n}\n.ag-theme-quartz .ag-filter-toolpanel-header,\n.ag-theme-quartz-dark .ag-filter-toolpanel-header,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-header {\n height: initial;\n padding-top: var(--ag-grid-size);\n padding-bottom: var(--ag-grid-size);\n}\n.ag-theme-quartz .ag-filter-toolpanel-group-item,\n.ag-theme-quartz-dark .ag-filter-toolpanel-group-item,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-group-item {\n margin: 0;\n}\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz .ag-layout-print .ag-center-cols-container,\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz-dark .ag-layout-print .ag-center-cols-container,\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-viewport,\n.ag-theme-quartz-auto-dark .ag-layout-auto-height .ag-center-cols-container,\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-viewport,\n.ag-theme-quartz-auto-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-quartz .ag-date-time-list-page-entry-is-current,\n.ag-theme-quartz-dark .ag-date-time-list-page-entry-is-current,\n.ag-theme-quartz-auto-dark .ag-date-time-list-page-entry-is-current {\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-advanced-filter-builder-button,\n.ag-theme-quartz-dark .ag-advanced-filter-builder-button,\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-button {\n padding: var(--ag-grid-size);\n font-weight: 600;\n}\n.ag-theme-quartz .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz .ag-disabled .ag-icon,\n.ag-theme-quartz .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz [disabled] .ag-icon,\n.ag-theme-quartz-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz-dark .ag-disabled .ag-icon,\n.ag-theme-quartz-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz-dark [disabled] .ag-icon,\n.ag-theme-quartz-auto-dark .ag-advanced-filter-builder-item-button-disabled .ag-icon,\n.ag-theme-quartz-auto-dark .ag-disabled .ag-icon,\n.ag-theme-quartz-auto-dark .ag-column-select-column-group-readonly .ag-icon,\n.ag-theme-quartz-auto-dark [disabled] .ag-icon {\n opacity: 0.6;\n}\n.ag-theme-quartz .ag-icon-grip,\n.ag-theme-quartz-dark .ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-icon-grip {\n opacity: 0.7;\n}\n.ag-theme-quartz .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-quartz-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz-dark .ag-column-select-column-readonly .ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly.ag-icon-grip,\n.ag-theme-quartz-auto-dark .ag-column-select-column-readonly .ag-icon-grip {\n opacity: 0.35;\n}\n.ag-theme-quartz .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz .ag-filter-add-select .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-add-select .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-filter .ag-input-wrapper::before,\n.ag-theme-quartz-auto-dark .ag-filter-add-select .ag-input-wrapper::before {\n position: absolute;\n display: block;\n width: 12px;\n height: 12px;\n background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");\n background-position: 50% 50%;\n background-size: contain;\n opacity: 40%;\n content: "";\n filter: var(--ag-icon-filter);\n}\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-ltr .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select .ag-input-wrapper::before {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz .ag-rtl .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter .ag-input-wrapper::before, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select .ag-input-wrapper::before {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz .ag-ltr .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-dark .ag-ltr .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-ltr .ag-filter-add-select input.ag-number-field-input {\n padding-left: 26px;\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz .ag-rtl .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-dark .ag-rtl .ag-filter-add-select input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-header-filter-wrapper input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-toolpanel-search input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-mini-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-filter input.ag-number-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select input.ag-text-field-input, .ag-theme-quartz-auto-dark .ag-rtl .ag-filter-add-select input.ag-number-field-input {\n padding-right: 26px;\n}\n\n.ag-theme-quartz .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-ltr .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-ltr .ag-column-select-add-group-indent {\n margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-dark .ag-rtl .ag-column-select-add-group-indent, .ag-theme-quartz-auto-dark .ag-rtl .ag-column-select-add-group-indent {\n margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 1.5);\n}\n\n.ag-theme-quartz .ag-text-field-input[disabled],\n.ag-theme-quartz .ag-menu-option-disabled,\n.ag-theme-quartz-dark .ag-text-field-input[disabled],\n.ag-theme-quartz-dark .ag-menu-option-disabled,\n.ag-theme-quartz-auto-dark .ag-text-field-input[disabled],\n.ag-theme-quartz-auto-dark .ag-menu-option-disabled {\n cursor: not-allowed;\n}\n.ag-theme-quartz .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\n.ag-theme-quartz-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled,\n.ag-theme-quartz-auto-dark .ag-checkbox-input-wrapper.ag-checked.ag-disabled {\n --ag-checkbox-checked-color: var(--ag-checkbox-unchecked-color);\n}\n.ag-theme-quartz .ag-checkbox-input,\n.ag-theme-quartz .ag-toggle-button-input,\n.ag-theme-quartz .ag-radio-button-input,\n.ag-theme-quartz input[class^=ag-][type=range],\n.ag-theme-quartz-dark .ag-checkbox-input,\n.ag-theme-quartz-dark .ag-toggle-button-input,\n.ag-theme-quartz-dark .ag-radio-button-input,\n.ag-theme-quartz-dark input[class^=ag-][type=range],\n.ag-theme-quartz-auto-dark .ag-checkbox-input,\n.ag-theme-quartz-auto-dark .ag-toggle-button-input,\n.ag-theme-quartz-auto-dark .ag-radio-button-input,\n.ag-theme-quartz-auto-dark input[class^=ag-][type=range] {\n cursor: pointer;\n}\n.ag-theme-quartz .ag-details-row,\n.ag-theme-quartz-dark .ag-details-row,\n.ag-theme-quartz-auto-dark .ag-details-row {\n padding: calc(var(--ag-grid-size) * 3.75);\n}\n.ag-theme-quartz .ag-list-item-hovered::after,\n.ag-theme-quartz-dark .ag-list-item-hovered::after,\n.ag-theme-quartz-auto-dark .ag-list-item-hovered::after {\n background-color: var(--ag-active-color);\n}\n.ag-theme-quartz .ag-pill .ag-pill-button:hover,\n.ag-theme-quartz-dark .ag-pill .ag-pill-button:hover,\n.ag-theme-quartz-auto-dark .ag-pill .ag-pill-button:hover {\n color: var(--ag-active-color);\n}\n\n.ag-theme-quartz-dark .ag-column-select-header-filter-wrapper .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-toolpanel-search .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-mini-filter .ag-input-wrapper::before,\n.ag-theme-quartz-dark .ag-filter-filter .ag-input-wrapper::before {\n opacity: 66%;\n filter: invert(100%);\n}\n.ag-theme-quartz-dark .ag-chart-menu {\n background-color: color-mix(in srgb, rgba(24, 39, 50, 0.3), var(--ag-background-color) 30%);\n}\n.ag-theme-quartz-dark .ag-text-field-input::placeholder {\n color: var(--ag-data-color);\n opacity: 0.8;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/agGridAlpineFont.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridAlpine";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABggAAsAAAAAMhAAABfNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKuCStUgE2AiQDgnALgToABCAFhEYHhlQbPytlBGwcAPTYmQ3Z/39J4GQMMXfuK6EqRbRgZStLKfHti42sdSMMSzt8ncPoZYkG0xVMVCoPK4h6JNm9WHhsaEzj0edan0MTU1OnzAbfuP/Ea//rIg4bSsnz9GPfzvuii9guKmsWEiqWmE7LeAmEaNLuDD441/vawCVpe4j4geyXs7NzE1aTlTpyn4ATHiLTnS00yFIAuSkyfboqAfADv83/g9cEBYvUxgBjoYjNtRD/jLoXzNjmCguLDV863FoMsN/TJ7rqu2yjNr++SF+4F4t6sbiWSe/utyXXIRlFxlKbAcNjbaoHCpWampr8/0G793Otk0Ia6+lhWBUU/odPV7n1bn3wVBkKrbtnF5Xj9qfmn3yl5/8+e1i4lDHb73vdMciYBEs8IXwlAn5as9deCshTfC0LhRKdmp2dS3bocpt8mpvQ3n3ay6ftfkpSZMjeFj4Bu1YBy7ovfIVnYSplK4ysbqum3N/N3EGUPWOtd7Bj99YuI0MDJWOR6IXH+q9jVhTQ0TSnb96qHEZvX/j2AYuo5N4F8sHL7RsvH6N/mUUrdirEcqg3GJX2098fRVC05bGeVP1DDQxFtfbaTRalhymrbe6og2Gbjl+GpBIsVxA6cbvoqAVJ6QnfEUVbERtuupCM6JXdwphulBcsoHbyeGRdhLKzA04bxnCtU/MYW/Gdwp30gR5yVMYLR5ijVImd3zwZP0P6QhzFOhVfmia8ChLC5ZEbU5hXGrFi3TbKbBZpJrppDx/dc4abhr7EyRuGGcm0okgWxU2GRlizCspC8SwpG3khIMJp1JFW0cCSy/gswwlzErbhpjJ+E7XXYFuov5NHetnlTb145oeTDO8NhCOXUnHP45RMGGP3Fk68fFWL3MFOEVHYCy4SHgr2rpxSjoV3fG8jE7Je/PLvzWf/iiHJsT9N3Lpyslwvj8uroi4HtPk9If9eeK3Q0Hbfg9yaCZ/WktdOjH5Ojcuo3PWmEXG7x11bUFEeYjqR2jfjBOr7kswlqfFa/XTSw9l1XIapJIXXfUOapNGMUKUTsExCe23EuEbpvrIXDLNZ1UpvKjY+1xKrD/PkSJ6NjaIjKcoodlqYW8ZHWvm2CWRchDtxTu7+YhTNqatx3ZSwora4PTqifCG1AsIpeWppFBu2bEDdGVUjj2taM9YIG408dP5dZOPlnkeilLiQ2Cvfkw07P0YJM8q6SZKbLsKdV+4SzqwD7DLUOUAzI3TRferjVLXmPPLOD1dYFUJoC9cb6MTw7NZVSk4k5WCfGIXi9lQyqKfsYJ4asueeuG3AnEMD0lfZReyHhbiqlVFl+69wFBpjjr6kRMwbEZnJvh3sNtOo4PCGNcNqQz8pd3RXHmn71KHysvIJr7Nvv3zBRDEAVLAqJJO1/2r2DP+NZIf8ASdrG/VM+peA6QXJJ1fBMKhBZbS6rfQjvDyMULKFQ/2BHoKOqvnhkz/Z/fefEd/e+hJNSCa6MNNwVF4fiBC1b4bcGXEmV/kpBPWUDOYxsVLjlrs66AjORpDU+PwNo8XOwcnFzcPLxy8gKCQsIiomLiEpJS0jKyevoKikrKKqpq6hqSWtraOLcOvpGxgaGaOYiamZuYWlSAylAclZfNj/+ZsOakN30jJHta8VRUC2m/1t2dy6i+gUPUDtub5nwcgaHQYX0CZwER0El9AecBntBVfQVnAVnQTX0GZwHe0HN9B2cAsdALfRPnAHHQF30U5wD+0A99Ex8BBtAY/QbvAYbQNP0FHwFJ0Az9Au8BwdAi/QcfDysFMQjcukDg6SgIOkABoQBjQhHGhBbEAbIoAORAJdiAJ6IAYwA2ICMyEWMAtiB2ZDHMAciBOYC3EB8yBuYD7EAyyAeIFeiA/og/iBhZAAsAgSBBZDQsASSBhYCokAyyBRYDkkBqyAxIGVkASwCpIEVkNSwBpIGlgLyQDrIFlgPSQHbIDkgX5IARiAFIFBSAkYgpSBYUgFGIFUgVFIDRiD1IFxSAOYgDRt12ULyCQEmYIg0xCgCunZYZN9cGU5AAc5BAc5Agc5Bgc5AQc5BVCDzIA6ZM7pyQU4yCU4yBU4yDU4yA04yC04yB0YtOH0Vr5j4VYfdKck+fJ/H8BobKnQvx8gKBMURfsqJjinAq2gMYES2ptqBErltNmlUgpBvkLQPCkl8VWblHLOqS6omoJ6lHK7s24+k0aLl3s3mjgphsuli5ouoirDWMGSQh0qqzzqcTjclmh8uWwwTqWf+oSslBuHx9A+y/JLkY0EUS/EmLRxxkM+S0xdgpHYciXgoXGX6arrSmfqWvYL9U6HXJKCuZP5WDKZg/zKvb+B1cxPsecO0BGDlH0y49gk6yGYNhFmxGinSXZqPW+1sjBO/Lws9ur39sfI2gtQP/dwp3M43X34/HgQ4OqZzh2MU7r0w/qoX/WNVAhXHgvhxuUuWcjRCjsW2on3pgEjY2UwfH6aT51BSpY4jgl1PUjIZ81HIYxCWn8bSsedPWNLGVLsUE+ombIf7tZxnoaltQ1nSF29k6vp+Ic2nOrQmTZ9hg6ViorNcCcVPrtTq2x+p2bp3K9gbgrFNkbthFlxL0pJGNQBGyp2qu/OAV87fo66Wh8sklrCiYu/ZYwoRPo+26jYUSx0miznw48yCxGlFkaIw3aEdQgwqU8LYZXWqzEh69gkwyvrICdkinuiEzG9cToBIjizfu/VJpHVjcjCFFzLM3tyYCYayyJVZNbrks4xCl5YVI1Ex/SvEz62WP9O76Lw2jbvHBuDOjzh84WE8NnsJornCZquNs2VoR2FegygZ1yfzO3o0J1EdWgNqkf7uyXkvV7njRswY3h0Rp2dhBka957lt2u1MRAYa9YBXaP3Mpy5maTGQScH8pujrdp3ZUgzGJeo9H4oc/VNLqdvsDnK2efazJPOvWCIluLx40CYwDD/yjGgUDs3xafX9c1ZdWbjo3qCmGGoUwre6u6dWEprtOHw9WRkRlKu1GXUscrmURT12TjL9MhqcQCAhxGn0y1D2kivw/8IoY4KYWuZYsXkg82Mv7ZrnD3ddm7GEG6wPZHrL01hMBfnybmZ6tnyOMrSKCEut6JS6+Y19PbBX2Vz2V2rWuf3eubJaTVvzwe9jHi6Li2MQqUIs4baxi1iACeCHace2HHhhjIbJjIytEDIfn1jzsUTFyEOdyABlxLIBOyqzBxjNvM2PLaOedJzo/OFOVGy0/iVcOOWa9JW2HwCHh+gt5jvEBjx0X7j958iu63t1EEJj4XKTxZqfxOH9nTNFnL2qcy65Bg6Yeh+AVS0hvDRhcVer3CdXjmRqsNm2vPtK38oNsoIwdSMswGYKWk+WIHo2FiyMyep50zl27OA17pQI/njsfYwjzwMNuvw46Kej32KRE++o2YMFvKBZHakX4ajkrNiWWj1WOgXzNKqQ7xzQixdwx7wORTkRrGpYsi2k87GJ4KbvNLMMSedK4elaygvzC/spL3Ls89jTzO6Z54mvi46M/cyvpDdN/86/V0hNW2ws9OF85tU9J7JBnehvHfi5Izeu1ImyPQwyoy2x4F3vMectnAXCknqzhTSgqrv8jCEvANovHeqsWiIPAFo4Y8MxkM4iPd0Tud0bs0zdWoa7Blvpca+elkRNBqam07Os268jgPrMSv/eKn8mgj2E05pYyQNT5TeKHKrIikK+SmzTmnmwQ0x+adHVEFwpj71ch4X7+zI87U/m4HOc3A4eVuJM79qnf/de9c+MifzqqbOSABB9U7M6wNFSxweDHAy0JvYfotm3Uv+qcGKnGbfZ8SXUgp0Sp3WJ/nEV0rB6ra2MkMuPkEU7b2tesD2BatbNI+JyqCOruHC80IHKx1p+0Zqsy35Ctier904Kh3rHiPjtNt1eDLDUanbCG+E1dkhlp9PJ6sNMuky3JNYfdRVy2DIToeOrfaWpotKwrBwBd7p1sZQMxgYe4DVzbOVVpWhOEIxkIVv6/Z7KUrDpBOFYKIqKtCy25uZso5WOq7pHlF/tfMaNSrbncuQTobWlzlLIbYKRKf2tL7HFsM1qkZtAv/MaC9TphiWwlxF16fO8i85QDJJ582NMIaiwJvgtQG8yeZd2xmjaXNel0kkCwrlVg9HRilPK8FIio4vWofoqZ98kZ221RVeqau+832Bvk1aRS9E7Zluh1+maRxbE9ez4d67CqK9vVcmy5ChK2qi2ME7PBqGn2uXl99j739aHk3AMgT//b/zHwCc6SZ2Ntop+p63khOvauRP/2K6WP6SGcGJMYk38PyVd/85Z+KCoH4hme/i/OuQPI2T9pE2rHTlpuL8pVwfNYKn8SV6ezrtJhdZIy4LelTP796c4Iu63KXTfuy2iRSE0Fq/o9mc44SSuXf/vDBxYZHRXbh4pEenW/Ic83hEENDC4VVLF4iSu3/eH6/aKvW3qvgRPmFFW2fbrvhJxu53sSdeV8vvGTBdo4PFxvEk3j4v2BPEefNcXBp2dpDOk43a0eEG1zDa4mHizqY9B6m/p9qeHQY4RWvkBUF5QmFeUMG3if3cecKCoG9LuLt1adrIutCk4dMAdsUWSj8l8Vb5Tllbq1QoIfDgMtnRd8pxF6d8HfHdceGS6fTExDu3h4YSk6r9Xd4+23zkzfXkur81/Vsr68Mv1/r7tUVFBgbhYXc4fXdu3zkafujQ7l9wtiuIwZWN/bob/Cbeyf3lp5vcyBC1mwZFb2BW+QbVzoFLb8cFvJHLL7jgKsEkL5rSHrgCV9Jbuz7oJuEC62ofSB7A84CMzKiozLTmFkiO4WRgvEA49VN5ac3W5pjjJM9yz7WeZZ7C9b+ruOXkhN13tXU7STOmvAjLBdLW/jnzPQ5Ttpbla9/1xdBdb9YgNsxQD2uzXov6sGp/GvOkn/OFUmeZjL2d2nOMymbRGQ7U+y+sKbupDeu3/WpuJbWm9jNfCgdhle23DOsmQwW9z2JDSNI3jtYWZlkjUQzG57etu0N3e13gEywvoNdTahPIRizBNGtLB+1cLsvv0SpTcp+1HA6bB2y/LJxPfzwdGcH3x9f64WXaCfcr+/y1uL8oorAut8oz29m/7JRhOvC1/h4O/fGce90BunsB53UB3ecRkqciWZEUB4zKQ9e9Exh7DcWXQWD1YjRdJTdm2U3dyahbt3H3pnUMlGbl+jo0E83sncRumtJWm1slJG5Kr7vcZr2bZcsKkG2X1gd8amRKc6ZZwzYisLJBz+7f+sP87CEhkeC8fKkuuqrBPpnvJYzOuf6IKM3xq5CCLqaq3i45JDg+saTA9GF02lp2REGRShiXGsfV9wZ4x/H5sd4BZJN8hX96HinB/CWSxBBuFiuiUKP3bkBYEuODb7p09qp7QRE7ovmFQ763S65q0EUftnkLvv1xyC45+BOdlzEs7DTONQhPtLnUfYHImN7o0VTRQg290v10AV4JrlwmH/VmCu4/x15g8PatSCkimlAleqGJ356fqHwa4dYHDEMuChIFEqgf2nRaiSrLEynfNu2DR2rRILTp7TE7rSzCHycscsXs/AJrx/fLy/rgMf29HCYMPudyTnCHk4eD8wMD8yqFzYKFT+Ke4HD1/CQsqXYoKoLYq862+fI6wEkQJLS4v3pVltxrc6KyzDBBguBkfCanSsz+IlS4/hO16sFpkUKRsUQiRUb2BZZMpm0UisxFIWoR/CaD5SK5Uo7imSI5iE4r7ik8NndWAJjpvqP/JEfVBwXC9w5/bE3c7Or98eEqmdym9lJ/tk+Cd3y8d4JPdnA5d2BqisMtT7BBOlg1PFj7YcWRmX9S/rl51BVcdWsZlwVirT7lfuqKdV+wEqfDlP1KDFKU+/ebckKSWu9olzcWFewbCRM5PnFwiD/9bWxseYmRIcstJPn2Ro3mu++I7/es3ntC+VKny620JrPZNcUMkyqrNk3VQcrXc8w/p6dhrY1+WwyfH2OC2NMxCR3D3za/HqQ8H+vfBwc+M1oxdfG3Nl15/dCKZu3v8kfjeWongWHpGNGyjcePFXvJq1uI4/mEEV1/CBgHZs2EDrEmTdsbLsH/DJU7RG8E8TWGkNeAohcbmxpIjUfsYHAseF/TjstN2yTbd8DhP0cnVK3/55+bW3+5LMcjw12tds/wyHkobHzwff85Hg8l9Y2LP9qcI8wUCDKFOQvCfu5MQY5woTQ0PF+JqYyKqmwJHOkW/o+LfmunzSk6Uv9Z1jgQivD9cucZln3GMfRY0IrITwTfa6mJ9IB/EtntS4WE77PfJ0gmbAPn9euoqJBgR8fISCAi5Xly+PNwv3S1gSTl4caNQRRDEcZoH4aICsOCx8zP4Q3lpKebSiqaVR2S9RHBw20aXOajnuO4E1aZlxsXNzzsf+48mE/badHOYR1UXd2JDmNfSui3LMSmp9mV1Kt5h8FzjWdZUtrV4y3f4vk0Qcjgs+YhPHYbFnv6nOjcGUy8DRcPN7NFPHEKGvB8Xa1KVTqPnj9tjMrYIRUrnIenYPHQONA/rLCwsjjWgrN1KSwh8eUX3NpiCSxcLIDl98wv/Kj8jNxqoaaGGBwYHCTgMq209H5CItngg1yd7qXyxN7Vlg8fpKSEF1qrz67UFxVsXNbeuSr2MrXaAGNjbW0bbyeHuLEMjcpLYmO/PR1fX2dFXLuKHz9OhIakpf3JnPuacrCqTWNVZcIorqmuBjMBjXZPuzWLmnc1sfaODWoDZgeLpRsqkQothPUI6jzBH3k+evt20XMRAz4yGvX4//yTws+jYc1fB09un7Lo7X+65PHdBV96AospXUaPnuToxTRGNingZ75BxUqlVV19SmTYrr2GH3yZTln19j+/t5UFaQX1deZVRCtgIGeTy+uUkbv3uomPXctBc9aj67dY8wKuXfN//Nh6/HGMoi1W3NJlt1NP0u/kdHWKxV0+O61hh9N/5fSh09cYQH+G+P73nluRlSMBACTKzna/jSxsynM0aNQVVNHUISVwfNOWyWPZvkSFXHH2RQ3A/7/JFuQ3do8+5P+mL4FUE9VqMpmpCuz62jxTvrhMWdJVrTG4FZf/Q/4iy3BGeekmzgRsqCNN7/UDYulTZ7LJZdOENMI5wkvppmyYBKQCuyAGOjy3QpAsKetBhhAb2yqaqSO2rl1hs5H10NOQBJdpleplSVekXZxi53IwGNhf70cchYMsvxNR+6Qq/vtmyuD3hx99k08Le2lKQZYBtCyz7y6r4kuGPy/A4LfbCmiUyxWX9bfcxt+Qk2qyoNnftPUfPxUa4bL376J2iJiKbwH4G3jeCbeZ0DRornUwWVIwwpUNEnRzJ8SAAt6IgzkImZKoKIzeABvYDAiQDM2ABCxQRcgAqNDJkNfNh5khNr+MjIABc8wYm/+GyCAlGf5iFPAgFd3ZCr8k+i8pR8LfGGqyUrwU+zr/UUpkah9Hx09N2y8kFKvo2+7alik8qfZtLzy2P5nWZKXEbRZ+QaenQTU/349djaf75Hic2fBLov+SciT8jcs3riYrGleI6f+4YAXfNab28fSgmfhFMmKDKYK+7a7byjKFJ01136594ZGLn0aJJksp4xeR5f4LutichgZ+fr5Pr6vXNSdnhI79JwCoZOTxOZ0whwUsYQVr2MD2NzTmAMdfl/43vxVESVZUTTdMy3Zczw/CKE7SLC/Kqm7arh/GaV7WbT/O637e74/iJM2I80JIpY0tq7pxrQ+3bt+5e+/+GjPeCkEwWI1MKyvC5zK3xS3sprS0Hr9hrJwlh2npBiv6doXRvXZ8Mfsi+s+FsUTyqChjJKv4/lTnSlqVB8eJxeR4tLWsF0Qdqewck4p1in7hOF+XTriUuSvT3FVd2NZLvMyczbjZGo/0W7yiKcmWYc69VR/TBzpLD0+KLoLEvAzCNS+UEbpI2OsqRbI8vuvE1kcKm9Fe4hhvuBiR6sZRKowv4UUXxIR7YjU2JT6jX2YD44nzHGmZ48S6yYJT5FreyoW+GTZdVWUy3PdvCsOjpcQw6KLYCXdlfO1rPJ/pQNok97DryM2z5TDTG/Mc71UQiRTb4sCckTaVfAkscqplqcLDN15Y7bVMaFT1r1M5ECtMKPWq0g136bj+NEJvOlblcSd4ynkXGncShws1Hw6kpalX8tp0hP0qd4SvWGO9X6CPChYCCCAoRGAgOEMBBx4SDPAKHVzAfIIKGa4wQQ+3GQAAAAA=);\n font-weight: normal;\n font-style: normal;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/agGridBalhamFont.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridBalham";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABrcAAsAAAAAN4gAABqMAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKw3S3SwE2AiQDglwLgTAABCAFhEYHhhsb6y9VBoWNAwDF6P6IqOIERFEf9qR69v+n5MYYUoGaPRSsRLkLDn1h4nEsTPOkD3q8Y+vATyTL9CvDCrJEtHG0760OxKRjMjTzG/bzPumSXkjosEOS0OR54Bj5LjrpDrSyVgU84gFN5fu8c9WfNp3JElOmSZsi7QGyEff8KU9On9D7A7/N/3PvpS4ISAo4DEwwiYWIFwvBRgV1ba5Yob3JonVzFeqi8vr2Whe4al+kc1Hu7+u2ZwAQ5O34kbIJlEJr1k1oyVCbJdP6cOfIqtDl1Kl6Rk68karzGb7wtSRrhiQnrkgHABBc3deZf6Kn1Zlh4VLGjH3PL7vOFuDESH624MoAuyV/1ArgerQmnBQ4aWUpvcw0qiYql5fWFvsiwI/WflksWqgMOpGStcXdQ3bmHWYLnr4lxBK/QUhfyKahHu0SlqCRKM1qp5TO/M+llskNAIRFTc78/5O7+z/QXa6Yg+3SYcq/nOsAQAFLQAWUlPBuSKqgOrc5QEd2b0r3TdXKTQ0ih6sOb1beOLGtbwgh2xNedOqo6OVDC2PZzC6PsZln7KNwbRAGNZmN8dHvUQAqbWOU9RkU6Dz46Q1GEXV+Aaw3Fxz39D7o3RjSUlOAfkL5seo064Off9lXdUOJ8h6iEDZ3P2lipWk3bxfjqGnT9I/TcU2MYDBJijq9ammy2LS1Ls7mRFG29Co1mH6pXqO0vm9LZUYQOkNGRa3yLOnGuMp7Y6GUIKIkYqbSH3VZV+uD0gqNocmXfMV09IAWOS5m85KK9vWjIhlGphzv6qOJODjPBRIjJQxSxymxfa3jlk29NmS4mDFyrcDpkm1lt4sd2nqsdXhMdoTFNS1SvCnDSRsIgyOwwU3fRc9pYxJijDeyzIruQHARYRbJN46r67ToXOaRLzHDZITG5gZW5K5pldRVy5f6n7/q4UrCOlqtTWX20AxVZJdqsq0e38cWuB7zMt/8Oner/0ht8nx63scwCiZBFczTZG24QT6e3+VDpsi2wq16e5akQ45wf85FdffI0lp/pkOLM+6gtCLVpp1pakYXy6zPcLp90aeS/kPsDHcnZNHqs/DwU7HPRt+hdc8L+nmoIqmejrW6lNx2jagztrpXlvNeztOg8ROZF7qKqJnN1smZtz7XXWipQg+1LNYq6rr1ni/e5iyDVKOIVqOW7ZqMFxRUQmqawCwD88KxIvbCuEJYFlX8pG1CZArFRIxjl6hwM8+5BrlXslvCw/RM9sJOiRrnbdOaZu1VNJ3bt1CSl4A7IJRH6C2SSpFp6LZOKNzzyheHOlpU9tb4bAh+Gc4mjrTKRtCs+FW3v9pg0nDzLsjUc4vpaaHgt5EjkrEtUOOvpSatO1cNvfNXYwu9a8i+PkGHVVTXzNR0Yr+jKo7vWofLkxz7l5RI/m11VCh8WXvgb/j9go+dgheAQlqgfsXWg3yEf21EYj2Ak+LEX/p9vKwVlIAiMAaKoXC0rxa01GVqjKpV+hjiClCNUhAbnnvnR/bgoHH3vfQhaauvninQ7teOW3QIRmiYm+fKgvOGIE+V1gdmuJTnWiK5So1CVddAtWgtzz+MHTp16dajV59+AwYNGTZi1JhxEyZNmTajw6w58xYs6rdk2YpVa/p1WLehw6Y1W1S9tu3YtWffAUJz6MixE6fOnLuAgoq6gzf950+sOy4vm76BYCWRZgZ9UaSFFeUVqnbVQPFdZS7A+AdtgmuaADe0Dm5pCdzRMrinafBA++CRJsETrYJnmgWvtAbeaAW80xb4QPPgI82BT7QDvtAU+EqL4BvNgO+0DX7QHvhJC+AXbYDftAv+NBxAQBEAIQCMAAhMKQRlyiAYUw7BmQoIwVRCSKYKQjHVEJqpgTBMLYRl6iAcUw+5MA2QK9MI4ZkmiMA0Q0SmBSIxrRCZaYMoTDtEZTogGtMJ0ZkuiMF0Q0ymB2IxvRCb6YM4TD/EZQYgns0bPmQQQoYgZBhCRiBkFGJzRYAICBEgQoAYARIESLEayLBpIUe0oUCAEtuOCtEPNVYPDWIMWpgiSGePG3qEFgYEGBFgQoAZARYEWGGKIRtTAtlFDBwIcCLAGwE+CPBFgB8C/HFYxeFXzD/wHypnqO3V46TIX8H+V80gQPcVmEOdpwAiKm1pPhwVh/rgX8xggmJLpTHE3A4R36dWiAJU8XhRwKB+WCKL9MOjGRQBk8nnh4BukciDQoZQSHtHXzLmSXEN0oSebA8exgwbIQ9lsxn46mvCaYFeIhwfImDzZGIahRSJjFI0Co6HRQjJdPoPe+9x3EvkwfDA/XBhoLcEZ0ipVJxOo0pFhKoyODgtFIpIIjMBCMpKuGcosTmKliqkPJwCwkftrPSQ4azZZ+/flz8ubLt3T/dbybkHD3yejN7+8OHwP4uabg2x3YN59q23h/5eev6u79NR2+4Me8BsulfMRJiwQYkXf1B0ULpFMsSKrZwRfI4HDEEymkdVL5MjeTAcuDQQtoG5I7yF0K1orm220XjwC7GrYWmOYUBIfXH90j3pbd292gqr56BOlZnjTIu902eDYY5duWOm19r4SjBtzQ4a1Zm+daceAbl+Pw+7sIEjvuG7cGXdrXPM93u4vWfrrHYHkh3wJQJlFUjIQi8QSAhp6k2L2Bn2T0gE2WZoyPQPzwqYgAR7RiLuSHRaxD+YMMXGGVafrpr7baKYcQwncRbN4gyS2pCFcyyTS4HLgOxoIdgy8LEA0fbxhvJBHfV4oIXzzDQFXrKMzyVJOAqL4//n6Z0jkXT0Li3dP15wnRy7h/Ikh0ucedvnYX6/bAIFtrble8I/il/ifGEnxdgW/IYax55az4Esqw58Az1Pdv4X2zlvuO0XqCnAcqzdH1X2Qn1yJk8p8pzteJaHFckRwvOmjkaruktSyRYljlbSP3f4FOLj1diWxQrPk4Os7PtQZ8JqdQTI5OHzfDlb55htulI1hHqEY8OBFTV7nuVgVjsDtc/lgZirUnF6pqA0Ex4yDkdwTAcVIdWtmj438NCvRHSCCsXUk4E07TBOQLZdrLoSkSQVlVR+KLqD0bRYmK0V3KBaLiPHVYKCo1waNeirSi8yz9RY/ax1/rBx6Nzcx+V3vrXLq4ZTwh/TYXu4thIlV0eMqtSgEVO5UdBoimMKws6V26fMGcsGk4IaAvmnBQsWSz9klP+HghtqSlhow1dbSBzbl0qqy5oHwej6F19r+Ey8QkiwU4jO9g88gM/lJVML57PVchrZMdoaZf12j/Ni5WCNY0nCl83aYSBpCnWDrnr3GKldmmW0M3YRAUwjTXNRO8Fu4bB8phnHnMJyVpaBd1nx+Ry2PFBsjkM063Kl8Ot04BLAvGFi8FXyxsVWLht8VSsWac9VD9Tw4vtfINuDyO1ue3b4Bl74/PZcEC/mYFye2DH+un0HLd+/nAvhK1Qsbcc5MhdD7+t/bEE8m7QMKciP15161jaSqSoYaQPKhYZa3Dq+9WLyyWmVXs5WHdq0y4wVdCFeWd+oerJ0Ll0+qNIoW3syaWFHFEUcbgXq5ebDWdtEuukU3FeLZod6YAvRvknIZkd6QH6iCYKGRhgTStA3hGCEqT6zRdyZSFNuUsnmoOnsSqzoCU62aCFCA2l7lgIIDuNAHC5AVAZJU0j46Itvn8bk1sebSvmbmXa5+/gqkny0MX9NouO+eEw7b3z6YMWRlXRGN5qqfaGpTDWUOWg+uMKh7OpDPpbH14GVa49gYwXMN0Mj+m6OXnrUXuYZIuBysZR6oURkLzQ8/MHp9+jI8mjzrFwYaUZn1iHRaRxfUtvQ0wq/oh+mhLLYiG6tuaEU5Kh9sKuJig7/kWebSS+rB+a5/4eWZFYFhzmzF5SE2nPSrLWvgeLr1s0IN9ffVqP2n1knD7pxBw96pmXQPPKKY7WNicoOTsEOx6K3IPCqzgZswAZrCALMAGMDcm6p8LbAFBN9cYeW13JFEZ4DEX1Fif5CsmTWjMJ2Tr9CJLecFMoXNUz11ZSUBF60hkv75kPSTWGLzcSkgB1L1jxDSovE3eHHydJ6kmRabtuXF+JNM5earBV8RiUzVr7cmovO958uYqFoli47lsLZiDDNbfahBIrRc5pZEAwYBiQyAAP9yA9sKAloZiUl6/LEpRsXxi/Ss78ZtEM7dlGHv9SMO2rf9HhiZd38fvOZ8dx6yp78yhNwAjK5NvgNA+Vk6VbAvTTSlgIvUV6wpaDdSXBHVBzNd2n2UvSLjyhZ+7BGInszaHKbvX55q0Z6lqXkhrKFvfwl5Qab2yFS3H9++eGuqiTRk5uj5SrJbctvQVv/weUeWzIlCTWONwwpAvmjOL8U09v66/yz3Qsfd+BUa/qPeZB3uYZMPUvEzpBvfixRdIcJx0yJuKPvSGAO/wuGeCqeDIYFhB2mcyNQT4UjMs3Z8z9z1sbja1zokzU0LXL3Y6byts5efKvULkGCkPd7kP0qCi/gIZfo+bwtoMhbQs0esAXnPCCX+iXUgoMzk5XKZDo2hBRdmZysnHneCkZ7IUkIqqbAaHR79mJsMl/rL2desr+WfyByrIPz0MnxA+iGfqNxAOP4H/54/2nuzs94QvXLT2O6J3gOGI2uWmaUrjTpaXzU08Rx1qf/fhDcRJNqofOe2UyuRadLms1s9iMN91oXL75+G/D12a5XCNCueaO8DpAmonsLWu6IVvabT/2v2vn4vZe/Z+/IeFkyPR0NeRF67YPs1iVd/ZNspb/fi73OXFnuIr1aea6ppeO7x4Y3YfZcpfngEBH3pwAs2jRhRFe9sm1aRoTR/4qI+0+bIEGn5y7/kyu4IItlBlx5d+nWpWfituJnx7a2tnaHHA7uIklYJovc3ZfIsr+IazfDcl56pB9QkjxumtCsqm+LmwdSTn2qcl5FvRTOYBMtHQnt0ye9Rc4+1N/fr7GSvNCCQ94i+DGA4oS4/TsDtw5q+osjPF8P+CY5JuRrbGq1TZPv9gtX22zqfI2b0i2Ps1tUJqXSpLIcAmjKpLSoDsKZIV1wUBkUsHns2evem+F73KbIe7g5ybXF9dxcZanq6a8eqAbdPHVuVFSuukHtmxulxupGP/wWyod8J18k/26I3PtUh7zdufP6df/Nm6fPkLya8bcNFgNok3qE5qSeb9KH3u937GgpKUHROEMnH7yzo/N43JEjzb12qQJMoJDaXjTD2SdGjfGSmtAQpNoL0NCw5gOXS/6J7oGEIw19YRaVyhKmDVNaLKpwzF9FB6m/BNuDDTvT6Wf6/CGeH6Y0W1RhG4xbgpKD4INva/oy7M6/E8urZ8xPPomETAxRh0wIGeb+XU3LTt/y/rOmrhG5xwiN93yCzNjxwGOl/I7Qc6J6YHuySPFTNSbwig3m49vY9YYqLdfrtMbvUrlfQYF0DmfrCY5UIhLLOdf6+KxmzqxJM1948PL5nB1eH4ftgkjhH2J+A6VWtJ09WZ/1uw+fjY86kCgW7+ngt8U2qy4pSYkKRPWsmgwmVaK7K5m+iXthrETTFclgbuc74RqXkVwfGr2gcdP7wUCVWak026WYlfaUqM4wuVZYNru8QWiSqxjYBtBVhgW8TgiVXW3TtV3V+XKb90VIvjg09fZuofM3QWNo9Np64KdP7A3SMV12p7OwLm1K89Q0sZHLU3yKHWkcue227ScGN8qDl5E5Na/u8np+s0QoGVowJ79+6FIqg+vH5cOah0NKuOiNBsXbcdGTUP5o9EDmvKUBBdcR+cHWt4Vu0mJJCzzIswryhEnR1pho+0DEwv17vva197aTcRv/Sy8oQ4IKrXFZhiJBmXC03B5DtqQaSvX60tggcUL6ksjBtMIyRG6unLbesA1N8/c/nSAOii3Tx5QaAkWJ6erHm6JUqq4pFDWZ3BgV1mJYtY8F37sBRrSYljk1YLJiOtvJKTRmx6jzDfgawvZtqQPjpCMrDNMcPskPJYdYpfOqFFmXLWf20ReNiCmqUlxRTBUesQCyi0bcv4P0UbjNvKsKTV4QaO70MCPxQcX5GfV1HpXkcrCBU8qcWGdNMDSvCjQ5NQSvrj74BitWURb8YmNG9g9qzhXV1/Hg/+15F9tFfUQf9PcTLoJsMLqMlxqivWkIeipxvQfelmpt5bsIV01cDBFTQ7gBH8p+iDtHnAPVHNftxok+AoJXvWpsb0ypMQjhLhbsQhoa/iD+qG6HgFfyMlYZU5azeUO7Y4o7l99gMJTnikyNPOxUIPCS+s5xSn59G3BotmzJtjeOKV1eS65N21bKUGX4uqdMeS1eeGnG8e46ZlmWpDRjH8/hEDZyHRuWxZaXaXnoLsdbvzunBWPadiRm3RmvAv5YYoCY4dPZSYr73p2MlKgHiAF1nC1tLJ48NixH6j9QSh9edKKPH6Emk9NpteZu17ZiBqC5LXUanS4nAcsbnXDjHfboEVaQPXP1ZfQRX/xMa45OTPbyBU+euB+7n8wi3yScUSd8gwPiXvxfwXd3zRjErrVGT92Hj2WVKUcFZWcMt+jOBxYIx4gSiU7jViQPyQ9M9Y2fVtI0NJ7IRsxhScpRKxjZDFtgRlBWTkSmqp2SqbSFK+0KC91GtxauMqlSwzde+UK1UE1ZDd8nBKTSdHh5/SzPSVEO2aINf+Kq9usJSHN1fT3BXOMVL00sbMuhNN8Z4ZU+Vvbff88hRCDnn37Y/Hv+780PT/NdivkSxTmFZL6iL6L7PXlL/ZYqdgbM8X0ynfScTCv7QPLiXYQsSXZOmgxW15o1DJk+a3lnS8+UkqLVBwyEzyO5PP3sHykpE8uoFEmgPrtjyoYN1vHb9NfKqFWnXB9bW8dW8JlSaXWpmF7JW7+hch3rtwde7+7eHbWa+s8xw19TXzFGKsV49cnN4974+Hb2Rc5m0mbLs5HLZoYqU0wqZ9UyMv0ANnLLW5147X18mDyF3jBn1jeQSnHNJf6vSx/5nuNmGY3tsxtmITf3hZ6IWd0w93LDTPOcueCb1DNhTHBhUFNTUGHwGLdAg33ywqAxwe4M3fK42vLYkpiYktjy1w58aUlMuf41EOWnD9L3wliNB338rP39SNKhdy3LwXBeX1BQY+P0TItunJekCxmDen5foCUwL1ABCsuODszwdjhabkJNLQ7HOhtEJ07gcid6LkQnLCCXK8g03jBt2smT7YuXJCQAyZ8jDQKz0oHytDwqr6V1+PDnPWe71pOWMhj2/DmPu7TbJwdponc5ccWeJT7abne3YhKrZS7bUSlMbXmpHanKTF93hh78vOAvu9qb7ln42rz65bWvnTq6YEeJfgT0fjGbpcWScQRDWbWqWHrGEoC1FpryriRzhFkhcFdtrTAG91rovP75vUTvtscp1+fO5xN8+HBWloTpolOjlT6WJWNaHWaTnqFB3CeWBPpdr+fvtafMtKWcvUBcOGczzbSb9s2XEqEmK/3srrqaeXnui8aLZxtAm7J3niQu1G61eeXtIFroYPPYJ5KXHSSWBPP/pRvz2d3A9meDRPNaE3fcec7Je1JdTe7auWsXCZe55eXXMjKZ6IKxra0fXadWRXm6r1utccX8pvOv6kuKpvS0dH5nUjF4k+Hw4fXrp3Rk6wMlFOrEspSUP86mv3E9KPn9d/aTJ8lYfW7uO68Hv7HWVa7fwKuki0urq6oA142XpT/9NJ+YX56kulNgFAC+jnT/OI+YBzvJPwA6j+xdIV39/c9CnqFgF/VQ8NOHjwIcx0L0+3XMaOszjzWPu4O7+/u7/XGeWbdQux45RaVcQHsLgONocLyqeNuNyGOd/HxFUW7Rm7TmxPdjjGMmGScdgNofIpIyJCd53pLI303JfMXIkWBfqvxhMa8wXLVixpGiYrPZp+VtcojvlOn+CUmmlOzs+VO8uNBttSI3hRKAuYOB/6vUL3Cs2DHPBLyZCgAAaAcm3HZ1YE9cYCh2OAYsQRocZKYe7DkAwve0OeqwMhIiMM4CdB1G3RYyx1rRDr8cwOBVTMdeam7SGHMVyTLGtR/TBzFAMzAieGCfCPR1DhYpsQLzFp0p4+WeacNfMY0JvCkqNIVDqfbFFmC1jqnYbMSGYLbI7MxW7I+KrrsSf9AOFLqmYVMt2azOpaLaWMIhl4ptc2YneOdocbPI0Z390R2YDy8nsRFrwhlNNP3v8O5gT3GZdTzX8JHBwnoAkFH4n5fnebC/yJfA8RLgVzmEXAjA8Ak9g7qmf7GYfhtExeu4Q1ZghvXi+0NCzw95pHOFbf/+YIaDML3FAINALk/ocHmEg01kFOg3LBAsEgXgTwn2HU4FFoQNp4EHDCPMDDERWmaBAKYBBggFBwQkMM8ZjgIHNhPsKXgfoUDw5eFUEMMDQoPgl8OZkI9QvhsLgpFRs3H4is6+oh9x+qZh9hjJ1dy3+U8xOeH2af3Iur8vYoqoZNvNvk3L8Kzat32Uqf0UtjvyXtoQ5YeMrkfV8PLw0Hs+r41MKxy+orOv6MdnAPmbbuTZu9sWOdbJk//ThiT40ITbp/Ujp/8Xz9yjo5KVN/uDnJYn+VlDuW93apQp4j+1Ik7iQyKPfMhWf8h4jvUooYaXh3BLPa9jbbSw85zHzarWipq+AjkUUEIFNTRw9FOk4xTO/qD4l17ygijJiqrphmnZjuv5t/vj+QrCKE7SLC/Kqm7arh/GaV7WbT9OnGAwSRabw+XxBUKRWCKVyRVKlUvXYlmMwxBpQHXCFcYo25RjMgXu3SVaeuqpDLIhX5oRo15aUTK/G9l15/lk74k2HFtSipNjVLpmpc7MpT014iV2waXCY/0y5onTsRHWiEbJFkbCvjRRUspNWnIza1G1XNLOx82QAmon9tOQhrrkMY15pFS98xfEZTcUkxZDdKEcosyhyDXQwlOvlXdcsa+1F7SOh2bCnZvcgYqJeG6ulMXqYWE6YdEOvZctpDIIWymHlctUF9HLKPpupNvMqsKd9P0F0RCX0Q2jFgkXOk6ThmKdlS03MTSGaJNPcK2RqJWczczGUUXwcyoZYHCNWdAISptEqganpNO24rvekauZO1Disx3FZLuNVJ46HWNalXBsRlqiQfPmcBqj67A8oTZJOgPGZOG4DTu3Q2sLsk4BYYAIBAoOBBi2kMCABQ8j/MIGdtBNMEOAPSzQw2EF);\n font-weight: normal;\n font-style: normal;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/agGridClassicFont.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridClassic";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABggAAsAAAAANFQAABfOAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKvHCxdgE2AiQDgmwLgTgABCAFhFIHhkgbXy1VRoWNA0AeO1Mi+/9LAjeGqDWN+kVALVojjqZTSCyfeAMnfSI7weG177KhblZ5djMmYYI1InxViwy2uYX7nP35bOdCi82GUhJB9/LOvd9qASxpvQKHNPqFA1gptkDx+eb+805mkkzwE3JeZgL0gBeozLq6pwpQqArds6pkVGWF6aoGwPC0zX9wn2njcZS6ApHTNYKxRhyhhHGEFYhuumDaW7v/h26uAgx081RcJSwyZJ0s5BeRG/tjqsWMCsbGQv/rzB3542++n0BnJ9BZZXsqGrkmvWXq/ITf8GttJ1qjMxGgA+wWPAN14tqfmh+ut9nDYqeMWeueX3YMMkeCJZ4QvhIBP819afOvgDjF17IwLNGpySSbzcyb/N8sz87P7uU4y2mOiwSKfjZH/3KUApKrO1RlYyorNGjVCiMLNtY6zL8D0CzzYcz1PfXGxvXJijMOEVGIiPzmrfFmFNBs1zVlT6Z1uM+ffPQOxjHk2gXWk5fnr7/6BPyiGROsX/DPoO4LuOZ94Ku/DskPrig5fcMUds2+GadUDyrbon3XQoSllBbzCSUeKRCKKDT+YvehWEJNZoREOgh6laYoZXK9/capsmkNTWMYXxDnUdy62Jpenkzz8WsqGiQ5SFQT6qQ3dF2PMDuyQRUoKUjrV5nNHmJoEWoSuVXZhUFcVZMnsjk/M0BVlRJyd9gQvdIwqobM78nQffv6/dAv1ASKSUnw1Vn0zrt3WBLJVC6UDNC9xeDlh5qEyB4mkCr7gc9eZC+yhKQaT664Upw9jxGqpAXM3TxB41p2qeolnwzp1RWw5l3bF9fcYvIw03btyPbt4uaEDmkXXyQbmk5wB1E611uS2Axv0Tahz6Kqz/yw/yP/MDI9nl5YTNJJMSkn8zVYlSbDCsK9B14Rqvrtuk39kqVGJeU8diHD9UqchnCjGw62R9y5I1/0WmyhV/t9NU3f9wu+U65uqMtXvBHOr3Aauhwfnvc11/Gjdpi1fUk+T+qxCZlLpuwjNzTZ9EFVQkvRc/n4Qk6nKiwJpJ5JtJtEwsXDc93SO9F62/rQaZFUaHr1jxedSCvb1izGNG7Vvunh7AkVRUqmwCrbe97EJNbSpAavM6n0tN2xcfwZnKcqCF2yS5jDVU9RKx2XhNcYyVo6mqIs0olZnWytKW7PIx/gIrkF/AxeFKB6EUrRpOu1yTs//mNv+cQ5R4CRNNZGgz0z3LvugslnnN6mVXwSYnsuYXYES1RHtbBiH7Y16EMsIP2JZXT4JDdt061WLx+/WPOhzoz4z+HgqBb0dfYTLm8eRRneZCqTq4f+xXSw6m/ydeqg+qocCt/osi8/sVUUoKLWgLyk0w/FS3ietQjfgKu1Ipiz/inw4vpBHagBq6AWqnXx6LIIWvWuokzeB8P8D2jFKZgtr3vPFxFlzRNv+iCEcYgq7DQ5adkxeAIrrmmhM+F0oOwmRr63vcEbeKGxqpYuQkFpdJzBnJ7fHYerR68+/QYMGjJsxKgx4yZMmjJtxqw58xYsWrJsxao16zZs2rJtx6698g/GfVsOUP0OHTl24tQZRnXuwqUr127cuoNSD3IEn/N//s6ZNBOdUhGgfLIehU34x2SjHVdbXSwO1ArUfkb/TbCWk3PgDtkBd8kZcI8cB/fJCfCAHAAPyRXwiOyCx+QUeEIOgWfkNHhOToIX5Dx4SY6AV+QweE0ugrdkD7wjx8B7chB8IBfAR3IZfCJHwWdyFnwhl8DXna9CQIFKCAIkDAESAVAPQYEGCAY0QnCgCUIAzRASaIFQQCvkArRBrkA75AZ0QO5AJ+QBdEGeQDeEBnogDNALYYE+CAf0Q3hgACIAgxARGIJIwDBEBkYgCjAKUYExiAaMQ3RgAmIAkxATmIJYwDTEBmYgDjALcYE5iAfMQ3xgARIAi5AQWIJEwDIkBlYgCbAKSYE1SAasQ3JgA1IAm5AS2IJUlljWILYhlj7ZQKCyBVAD6aywyR6CSA4QIEcIkBMEyBkC5AIBcgVQC9mAOsguqMgDAuQJAfINAfIDAfILAfIHAfIPDqNxrczZ57umcaD1AEhL1UqblbSka0L9kGG/cLCKE9rLEIxh3EhhUyMka8ZDpsr4DEjOWXlOknoUvYyKKTlcxpy1ZEbNU8YuZwOm2d9PR9qDvUw0uR5Rb9IoY13VtTnT7D5qbpxOrTgGN1Z8U7zb8VFrcMTVLqkxgtNRTDOOTka5Hql3V1PX3LHeHs6dQVf/dWhjQ0SO4RqU7Edni4u9NjOiEcMV58xsyyHm82SO+aTxWdEbMIwnYVLWNhg1Uba/b7qNKReMcs38t5EwtI2YbqxPzYXfYWuC8gzY7o0LT0LtJKhdFen79fyL9RPtzUiev67Si0+RarvuNjc6tcZLHx29i51Lt0rAgUI/oYTDuHtjD5Kt1guofmKP3H0dQO8lbgc3DQEwafUeYicCGArreeZvbh0ucOqpyCmKlaHbljma8xoFHmzpHMuzhSYc7NzDbc9h2t2xknIMYbDidH1W3b2IJzmX7pHp7p0LKCPP396QVa0lb9d4Z3tKtIxoME4Q9NGy3eAc0Oq8Fsv6tKT3SvezZne6x8Dm5WtcWf6HlSb6BGNerjVnN5IP3EfYeav22jgy8Mz8vProme5waIkgQIAxyBzWEs3AoJvM0Mw+nCHBC63BitByiVtlYQc8LYyo+2iyfKD4aTzCQ4DXTTFZJV8lZHBMVlotUI2oVtuCnZ37ThH3xB4kPRUUahGo/Uhubiv98TB0fSZ3Hwf1UiBjMkG16h+aoYVGtNfZ15Gut6utoqCmWij0ZjJM3m9XBRNhESvHfYly1PPEUVDghUIX01YXloOtnSP5+UPOM0lkHKs0xc73nLYPIOZ5Ot0ucT8cVcd3yz0n3FP7nL0nF6n7/vv5OQ8t1h9uiQ7nrEkkI1jJTV9ww6Z1msRtz2WiuEOmvTEkX6HMN7pzl2oc13Q9eFARdg4+C9OQv7+8RZIGr+F8/AejbxXLx8THGNQHlz/gvVfT9LmYJoLa4t+Yp/zufxd5V0z49I9Fr0WfbYs/sVv5MY0bY95lGKc9EU2YB4o+Nx5gDLEf/8JO/XzsZ3tmSeMYoyDPWgN9ORf/USYIgvzClNe5JmBiE2wiAwMCZFZlg64+CfrnAyJ6XBqrtRR0skzw/xm1nJcxzHS09jpL4n/ofcvd1N5P0f1fhG49v/1dv5J7pRUnD5Lu66LTTV8LIoy3vP512MzXX7Ue8pQqvKCYJf+2XyR+s/h15ymngINClMqad68zfuUVr5I/8Kxfd4vikejydK1glCBglCOYERVgcr4CYzJABOZA0Wmg1ioq/hT/UkvQfxkQNpqB8zOvmCLoV/Q/YVHxnafR2g8Ncy9q424Us10WZiVpfDBR+UM5onsXH111hyXETYbtYocf/I7f5SmoQz43JFnyrU0y2UkEEwaH4sfUzLWgMaAchA7YNCtYg+FMkUlguMiYV6wv959g/xQQ5P/h4t8cGc6i6fjEY42LZlsZhNI4dIEOqtRl5lqJlVDO2E4gM9hMrA6shFLpnaIvwU2StVxMlLjIYlvL6qBNQF8f8bm5t+rqZHh6ybIy9kSp35qwV+2xpWSx4ekou9SXuaOoKc/qzq3Jjuvz3eKxoagnRc6tTI8nsz7M+q9Dp7AhULkvNq7hu/YJciJkgyy25owudV9frpop2ycUpLNNneRZYrpt2QIDtsXgWmW5qHVnd54yt6U8Z6jI6RDbbYdCtVQUJL9TeoTT1fgS1OufnskOZ8xJo/xrRr+yDpqBkm4HYydaeOIK13mV6stkbzMsCpNX/+JHPKhh3Lx1aedjPUhe+PTUlIvQGYZdx0/v3rbnzIkXkXgZtPpVRARlg52+Wukv5alC69DZGDYnYsh0p2NYUhPhkbbtizGSrS5zih6uVmVl3kPN+Ml16h2N+gOB3tRSz/Zttq9VbH2RN5/ApQyTiY60N+fooSrbATOV1ZaieMJfWTdJvmAkjq/tvrllTgvqJwTqs/Ux7IiLcwxtyVebpPRTYXEWhk4wSM1Aebl/GDvl558qrLzK9oWdi25Xpi0C/UMGe6lUEvFZcgKxOFEFQYmJzBoSiUuMFrEEoUpFJErZSBWrEolg08wtW/QFeYTWp9zTQ28D/JWfwy8CsDSPYMR8g7asT7rrZ4Xx/jcGK+BdmjBokoeciL4Pu/A96JpdUPMgMZw1+H2HMSUoZZF/v7A5pQU5zqxhDZAmJVza3Z9GPhUCjRIbYi7XhDdNVQyfyDpHI79qQmIFY8hLnpORA0FjvUPOfbVfs/fSm/J6tzVbLE60h3vZ4QCmoGo6p92hP/f1wlXR6skfppN3hTtgcgLVrOzr9Ea3ZNevcuN5IoO92EHcT04I29IVeM1xzGEsllE/DBamswXTwMmQPxarXiqdXal5+4YX/tT9aeCjUCzZvXvXbomkoH118a7Vd4mL7AZRVuJH1kom+yubuZL1kb3Ss6rruZKIrPsSUAl/hqsCvsBFtIZBp8BCMEUHhnOSVrVVDaI2vW14Tnbr81K3+QUpPgj/+HmaL+xa/LQlHk0ekiffVLgqrg3eHbdazfn5ROL4cWd5LWfPnN0+fsuWxneaQDYQA3ag+n0jsPZ1qjpF+e46FLgKF7V2KGsKRO3uQzHZnzpG9s7jp9461F9g8Y85FTfQfoNA3omndMSB2Yy7XHjekdKnVAduxXJpYm7wfTIMV1TA8FkhEHXjdVFhxfQFk3YS0CKUhxrQqPjfVWzafS34eWV1PeGWZ5gw4AFhuvWO77IBN6gBRTx36yQa+1QFhDDGcileLX4148r5ZMbuiMH2wsE6XeBc/+Yd/oFMGn2A/wUXxafRv7Z4xntfWEvxtzJ+RLWDEdRndMrsP6porX6Tx6ieDqT4eaV3iej0zWcoTWMbh9jDHcwhgFbjU6nwJjEFN5nT1pMPZDEjLo/w9G6lGMFW38i5R6LuYlduxgrD+RpehMbg62siDLPnafgThHnVWWVoxmB+3TXoNWh4fO4AqzzofFOk5XzkQUtk00GIgFYlVqniGKlobIJboG0OBUfA5mp/q29Pj16flwuts8Yvf47cOJtanTClsTSBPpEMs3+NTZuY1nJdfcqTPNIXVihLseojayiNTCozUjdXWxO5mORJHkymHEE/qEYF7sIBBfGPznkq+guqTZ6RoFu4tLTotiBOGPHrwfC59xMIuZj3hM0Vl+cGvWRrMqLH6tbE8fjSUXFL8pW0FEaS96DM4DSvXE8N/1bjU1582p/l8ruGxFHirBt07SOv9jGYHQw6SfuLWJvS7etcMEabLMLislkFIXmkyaSs6NtLn/ISUutmJsxXT+++/DZN1GVF5UUXkaaTcqI0vPiCG3TNY8/94vQiflVxpCRrYzzRt/8QbxXQSbzTOAllOu1OQOKXiJSKtg7cDdS4Gkz46MJcZMeJ4/hVfWRzgF/F2/o6iqvge+smtybTgiCkBMdUblWnnZ24surBlG6lmnZYpeqapvUjjuFtuDoPMfx7SvEo4O8+zIUNHSts7erS6w+4m1cFurvHdII5c0yIEklAN1TV1ZmWcUSOKBCjseDyjY9caZJKNwQO8qMSGDxNvQ2RwjKxDJFRbAvr7LCUIrWZZgQAeLGpKnltDkyhmBSOi5jq6qrQDau5m2AVYV1y1YYqOOAcwOttFEy9sM4mo8gQMRw5Ulu9hscgUP0GBW6QSu1g/Q8FkkMbNlRU2A28h99b9q+XNuTlZWfNDLpIlOOPJBIn2Wypslh6Z0seP5aApo9aCEYnuWeiIQKWEhfhxVXxWaNvg0UkZ+3/LZYis4W/SvLokeSL3Eq/Bkjn+X1z847iyZxLqOg+V+3VHMGguHeGDDQttL4+NA3NvOR0TlvfkBaawb2YyeUYDQZ3BNeoX9RMdKtLJksT0mPpUmNuTHZUVFZMnlF6Hm/6WpksXkgX3ayfFRW9KLlGGSOWLlwLOGVMt8VscWP46MBwVdR0ucDHj9kxO4rdKX247nVHYrIx185us/IzPi9lnrQTEwBMIh3odPRr7EXbDNJncxw96qgW+1DpVclAXDIXNoClbpuurVOY6ThhwshcJcNxuFTfhRaqXRqZ+ywmb9KXnvLZ7kyIznsWndt4Vu0s9VigVxvVjdyV88rPfFd9FpM7xFSm1kmimTNFJqezYqoGwEKJrXvSrN/VFZ3KW+DiyDgYhw3YsjzOUQSXlJivEte8FmG1GuBms0IJFN+VCjOg3oy9KQrginJOSjAm//qIEQJBRfmRIwcOXD8iwCVm3AySrxgQg1b7H+hrtdtDpUJL/YyGTR4l08hKbntXEFILWVsLurmNoygayoWy6bSNWpQKTR5yRtU4LS2ksOp8HE6uM/J5dkn3Wmjv5CBCxNX/919mbR4vVw/WfkcNqrTMW656NwkCNo1DDUo0P816LnoB/Fh94od+OGJH7Qje76NeFfvcFSyP48o8wsPh/+hVwpezReEL9ap/51BtaA8V0OpK/GC/HYFBpfk5noL9HjHvAsXPCfxYfoAZ8Sli/HbjPiP8oKLC0d7W3u4A32MQB3K9CW78Ku1DNdsLX4qPoEiJjsdufRdC6ZMu3H+ZaqPGh04j6z1aZPVZ/2UeN/Hw9VA0dBqI56xp8w7KsM/4Z/4z/gTiQM6tBZOz/qR0ljaEPGmgmGwH9147dwJdu0IrJjiFXO7r22M0MwuNSO5lOsLQdnere3bVz1OzN8kMRn0H0uE9zWVUvH4v2jv0MsnGfXj33njUXhSM+rZ66zpJvc0r7+sSzmvQm7SRdPlelVZAjljRiDQnF8ijA2o5tfAWezIciPfvvya0Bi4xzj/avl9ya+YRGjgNhHlTkB60hzil3LCM8hqq/U2naHTsYoU3C65JaUsa6GmpFRXPvflyXzlfJuPv8d3DP1VdDXL+J2s/H20UVEI30kJLNzkDPRgRdiyfeBoB6OsN9BZ7mrEa0rtrZcF7y3NFZsGdo+MB0NU06AOCVujhkOcw4ZS6grNQNPUYOkeUNvGPLRa8o7yDHp1ghbT/v+AW9b2+xaeMT4ttpVElHgzdBKB43jvd5yix/TRlHZlTYqNWSFsuUWkmWiAtrjvU4Y0Vh6TsuWW2uhxsuiaRO5oUyBa7ZrOiSotNdoi8AbzqIMifvRSxjW6DFRqIAyJ9D7qDgAnR/6AVRmFzPvliYgHj/uNN/4Vy1Xj+m4xOaZfX+NNDZwEZVpoC48dp/dzf8CMKE/+NctPKfxKdf32Cxdvyl5/NrfDw5nQc/CdBp9+joHCkIyo6Y5/zmsobRKl2lTlSx7JN6jnOSLMNcv4tBryPIrUGiHFfLojC9QunvFV+5Qyr/E5Uw/7hGlZ5QUzNEvD7W5bL6Y12X+ztW9ApefMNLgfN9VNvLOl/4OQJi+fqKfoqvgCBtYAt6luROvci0hQNU1t8EgqEQEVk+gEj1Vkkvj4+NotClaH2Qbsv9vYtPPCUZnnzDS7XLyjLnEGu+g/nbL28EhbP1ZNs6QtRXmmJuIWqb6VK3Z16kVQ1RR4xtRV+6mWSPKScbjHyox8wsa7OClF8fUzPq5HVldHi/AR5aDRAfr+iDNOyXe6vIDc/Hv/Nr49mWI4XRElWVE03TMt2XM8PwihO0iwvyqp+NW3XD+M0L+u2H6c7nhKfIAVCkVgilckVyiqqauoamlraOrruuR9btHaOwWnxhCPNTJfU18kMdLFIQ20hmZHRaCAMzVmzbHoSzG9N13LZDfb0aCEeLQhw61EL7La1ZpSadmEoEJfRb6zB4/cjt5hmhlBYGwE7MBRvQ8OUUt+krm+yDIZWQ7gm7qT8qLWn2incoExBp3O/CkeNDz26w1mPkwwc+zh0TDkOnkyRQYBGRsHjwEXHgbT16CatvvrW32HQAuaJpTZTFOEqAySEOZKUOgS6gB1GDQWhHz0Oo+9IJpGh85TThjtaOlTWWYSwpKZZP6qHQ/buLIOkO5il9q6/tHTBFTNJzmE1kZMb02Iue+Y+dsIAnqxOMjoQG8SQ03BLZ04T200jTUUFIk61pIU/sQygGmXczz4u85kh2LImEWpnTCgUZwHxO7azK8fFipnXeMfuyktYd3Lm58+31NYOwHpRWjnFCpQor0ihuqikjLIqqLP6VbW6qrJVWUV1U51q1P0hAAA=);\n font-weight: normal;\n font-style: normal;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/agGridMaterialFont.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridMaterial";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABZQAAsAAAAAL8gAABX+AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYKs2CqQQE2AiQDgmgLgTYABCAFhF4HhkIbrClVBDYOAAp8YUL2/9cEKSNmyMulLaJuYkm1oqKy9FiOakGnfexb/SBrV3TNoHbYatUmH9MLTy4P+YJwCS85tzc52B+FmWjKRO1GOISDbcYzN+5PGP6zy1BKImIs3ScKAKnECAAsIAldJTq+2pzPqzO/LTlRwkcItiVbxjtToIC0DH2dcO40dB6OALjc/Vgiz08PthpCAU1sU4QJRXka4Jh/8NvqAUZToogJ3wysplzR9eRjNbp7BrAR4VaChc7xjWtvEzbLypO9KLbw7uCCywBogACCg5Dp1mt/g4HBaeIRGAUS6xDKbUBvE6tRaQDTd6bgnIO0PGbJEn7t+N613sxBYWZzW2LHz1d9EPYgk/nEKz4XaAuJzdrjMgoDlvj+4JymNrVjuLoiEOoS0AFhahs7hsCJYH9qfrNT2+xhwSljtvxS6iSD4EiwxBPCVyKAwK15j9dTUGxQDiZB/Z/Osj3dBZAmOAkXFZbYVTMjGf6f0dryojwrYyU7zltFIdlBBsORjh1AKirgLi9tqp6LJmV7L0VTxa1lxO0vmNqj+c9Y04ddB1rNqMiQ0EiZfc2x63o5CqBp3Sl1fPkpqsv3wysMovhFC7A/aGH5Pb4LNhxENSsUsA8gOahq0jvf3233t1GH+Zcat/u5B82QpmzaplOSosSI+jNxBp1gsUmqHDPYos3h0sI+zuWVInWhCZIIs3qnQZppp1RmAGWywtkRzCLXnDqdb7k1dikliFL8mK0VXdp5NW1vaYHGYggJ5xcd792joIGLuQKneoe6MZGMTro8e18XTcTDBc7RMupCL1JMUtpd6cZGdtLQ4GJWwbDAmRJZ6oNiRckg7AnY3BKKGwqq2dsynLSGsnguaIDxYe8pJTYhpgsKTnF6V1BcRJhE6/vMuJyqWcdiD3yyoiQpIGNyLSouvKSokr61i0rLs68a4FqEVSwIpzK7WA2lqF3d4Fps336buA7TYl/8Pd+8jgZld3pqLhOmrDjW3mmFXiFev1t/yRbRdvFFnYZGmvEUd5/zMXWDo9GufKoimx3upJKKekmZTWrDFMuob3CmPaVOJeYZvYPDMY7GVpLCkz9RJmnUFcXUdgSTznP3ON+RoumdpzJl+VJdVy6Sep1buUCeJnTEE2petDmXqwrsgW6oe1q9qQPxi7Aqp66zu2iXJyxXe1FFg+ZtGi3P8ihfMoxACIs8e8iLtTBswW55lR61TmHrGEYXsdou3MZNYEWPlDJ2DG6nHVkL2z4qmHaN2xR7j2Du3JiRAgdgH7ZsoTiJUGXy6pYZQesdL3xyoKKR0ljGncF6Ybhp4lBRLRQy835p0r+ExU+5pmHVVHOz7smmBb2FtkjDNYOUH2ZGLTuzagfdV8YUal8ffUmF7LciTZsNRZX+MipF+4Y9vkDS9k+nhYZXfkigePAFf5Nvv3BXVEGFIi3Cn8HJC/EA/4VF5C9wpzx8oT8Knt4QqIASWAZlKNb6aqFCRH0ZUVS9NdQVoI1RUSueeuNbxJxW3PXcuyhSkrsF5Sg8bNYuECEv66a5VkfRlot6Skm9RQakeKqOSEObQkXk5DEFRf/8HWNFVU1dh05duvXo1affgEFDho0YNWbchIpJU6bNmNVtzrwFi5YsW7FqTcW6DZuITlu27di1Zx+lOXDoyLETp86cQyHF9+Az/+evnng+bxmhhYvDRNoZzD2RNp2o0UawkzZQ3qnxAKysyBl4TFbBE3ICnpJ98IwcgOdkA7wgN+AlWQOvyBF4TbbAW3IM3pFD8J6cgw9kB3wk2+ATuQRfyDr4SvbAN7IJvpML8INcg59kF/wip+A3uQJ/NrmFgChREBAUDASFgFKFoJQaBKPUITilASEoTQhJaUEoShtCUzoQhtIFYSndkBOlB3Km9EIulD4IR+mH8JQBiEAZhIiUIYhEGYbIlBGIQhmFqJQxiEYZh+iUCYhBmYSYlCmIRZmG2JQZiEOZhbiUDsQj5iDEPIRYgBCLEGIJYtZV+UChCoCgQiCoCAgqBoJKgKBSIKgMCCoHgipA6UBKlFYVEFQNBNWAUoK0ZrupDshM9UBQAxDUCAQ1AUHNQFALKGXISqlANlRc7UBQBxDUCwjqDQT1AYL6AkH9AFDFnc1s/vNP7USzwb3CW9sASsFaIumPAwL1GHgT87qmFbI1g87EzNpYKjGUo5CEHSWyCsi8OcjaJ5XXbwm+JPNDi4MjkjIMk7FEA/mYxuuC7QPtqfChA1vOZ0PEciax399Cn5HjZPAVsGg6oBQiQZzzPJHEcTLBoS+FPLOEInFcFq6weQcKGqINdABr4EeO4+af4EwqdxpAyBcqgAbx7BfzPk76PMXqRQKyhgyCYaBVq1CRsqiQBUcrkqM81xbS7PHyMHaPYMgEkNebVR5VX6dR4O48hNmrI9ShWZwPS6Gc6/SVUcFfP8+hRYOjZMjibPa4Cm6AONTj66to5QFifpgyLpxbhgiU6w0UPIM40coquRElOypr6jKT1HK2hSlSmF11TGWbMb6v5MUq7Oz+3W11N31USkPdP63gxP9XyIo3VvBFvZmOl62piq2xVMwk5TB/swUUUphuC082YJPbfBS3Z8+3cZv91tPMgnDCykfYVoI43bRt8/AFji+UeW5+RJjrimf0V+Am8JTgC7vBkwQ4zgxjgMG+KIKpBIZh5Ga7WGZTkTQKHwBU1Lwtu09RF+9V9F9tUVGnVWMNolyzabOht2dqYFAj/sAnEC5t1txWduxpfMYFCIEhx0KhmODT68didrgK3FnZp+oOwbABXBfFXN+6gL31buUABldzziUvGPRSOVH1ZGhNWufQWRrM5TeVMgGNxXtdaI3BYCNLSw2Fg14Edpm6R+/7VHbPnks4wfkKVmAu+C43XeSpC2fSOT5FJy1baGyjOV29hRcX7u4rZW42T+BBh2zsGrxOmOCR3id5zNny/MgRW63o7ryYUS3L3sfDnQ0AF2i4UeV8Rs51QjYRGJjgp6uGtDfn4p2rPwwPBXaDsvr///ndT639aMd2wYAd12F40+Hty98KxfzD0NDr2Q3htoYGSHBftYt31fg/87/HAL1BdijUG+Pn/rOZXzf9MxIOVtDqIT5el9aO2glwQcWwpiE6a+XKL2SBcpiWVLwUQ+msdhsPEBMVgWSPmw9yvFs0A1n028/iZCPnrDbuHEl1br5m9ai/fqfsUPj5cTO/wn27YsvuLCrHapfuzguyJ/f/72f/LgobUsjGKgRj5aLxwkBDJGDRqDRWJXEBYbV5FYNoFeUhyjvL08fsP7k5v5slZb/Vcx/+OsNfTfL+F/zPclO805bDBuywi8QOjDy/XyIzifeWiqQ0UGIGZHT+xCm04k6kIqfSUnjaOo/XFuNbAAVC4sdQURLl9Ey50melH6zcNNtXLQ8IL+z4BCSRaUOI6iWXYs77uUvBTbOHmetm5dQiYdaNOf1svo5pmSOlTSVJc6XumHhsbn5K3G9f4zwtslw0nIg1K+6dblKdvLF48Yk6JBebJaL+00WVrxsweDCDTGf40z/VfgHw2+9u7gPHldqF9JeToi/6Lb0w3alQ4fPGOZHK+MYjmA1f0hSeQOMNW3ceH5wBlsrD/RwFO02dHByhI97cZmYOZ0+IjNp8RkGhxXiTZHmH+Zw3oANXjvoajQulyYIuTttBNgNJIEC5Z5EYATzrb8XYjuJSPRB8Oa/n/WrRqvirEtsMCfD0+fohY0i5u+U+OVugokl8dHCyklg9PXQqebkWd0hZJGlupC6rHIVx95LiyKrcvhT25/Hripv3vGLhnLR26XxDL5kpjLzJ5FtY6e8q0Je5yh80b+p7rLWp0REivyrxYgmrGH8z4hlyWBImrbs0qjDcQPPGAv4ei6klo2kYgSQC/YqRbAo5JYeS6pyBi9XDyvXbKs4tnqoUXvh3mSaRk1mbS0zbfcfHIr6g2oFJpXf5iDR+m5fyCjf8cASLS39uADMq9fq/0b9/0g8JhRBzajnoOcBNs3anKidpx8384d/Xyxd+dWWSXpdmMDjWufiAN4HPjIxxDXvz4sogps8btbyQUbjPXy7R9pb6al1laDtBXBjEH/SgER8ghEhuY8LI5qDOVmFYOvMJjfhjJzWTnUQ88h2Reo2RbIc8+UUzrlly6axd+qSro0MX8KH/iFYLhxiiSafRNjz55dmYbon33jblDgRpycQVztXqPeFy7C/e8B/r5E/xrqxgQ65VLi5wLZPbuHafA5nMSYe7iAKLh9xpcB+xCBZ7YTye0rVB+/dOzldnAt7Z5+Q1CVVxcVUJNd+SdbYq7j35b8cMY4pzZwWK1cA58RphbNV2xfZX/HWCdXrz+r/WQ/wZvZ1X2KSXnddkmFfw3WEidjRaXt7jR2p1Xr7ePxoSKgtVZzfbxSVFqqTa9vD6rkqlrKvD41NTHqvr40ePP0396KNjr8VurJ+DD+GGvjkGmBJjzqxYG+oBdOuYzZA9wugBFZsAZ94pb95S/0qzGUIIt0wIsPgo37St8DkLED4LWEkci48AU/mc/xyi9uiG9Pyo674gbvKnJsl66W7O57iApoCogMaAuNV/JvfQF+Pu323YdBg3bROYQVrESVWzDsc9J51JTVF/9XBorAfrCVTXZH+Kbbfj5pR1MUTXL6J9NBKf4mK3HU5dnzm50Wkunk7PTBT7Y05bVsneOJCLKE4q19/i+iDc+VsXyjaLjbQex9VJ+d94URxtywayXFw+eETpTD4WrAnS0oOBttl+g9DOks6eorddIF6rpEePhNvY9VDkEGp01GoMi4veCYFWCodo4zuvGJyYEfoGEV9sd82d6XYq+5Rttu1JFqM9h+sjDNbhz8o+6cZiXMvJWVys8gY22eRPx8ut+MAmH5dsWvH+sZYVLulEMuuP5NL00u4J9IENMcKBLMxrEW26dZZyjO5Mjy3eUbQ59qClDdGHSIFjw83EgjfYRwhnSA1L2awA5oBEKCyJbirge3G9Vre681rQWlmekLMnuwmnyM/myGyZcTuyJSMcVoDvfzxulpvAyHj/OfhVF6SXle+J2XfweaBP7DEw/ngBJlb7cr34XqqjVT14HodYeTY0JyQkp8SsMyWiNQTPeNrJ7nzK3iwYqMyYCENUIoNIhphQE/zOvn1LOOR0zDMjakKBTZErRUoFtq4AT+hyfzf10/JkLjJM18lrJmlbiJTXZFJdm1RThJ+H86uNvYDX33r9oDCEQeJnCn1GhDGMYCuxxOr4+Ko1Zg2JUg9kmDFolY/mb1D3isG84DOWqpa3hZDNDZL8fEnDSdnJwy4jx9GnGpJ9FRkZcQewnmo2iAywzbzxtxtQw3gdA2AeM4lMac6gV3beISePlxeU53pTVR4qDMnNDRGGlic2Ib2TkwykSUjdZRKz4iBqb/OnD/4t+Hf6ExawOla2IAn4kg8iB1mYGfudoAPdrtqOQllse3ujn9fLr0JCdLrlTVoxuryMirWblnXAJiUovUPveZ/ivVBvMUZxxqKLcd+N/Tc8PzYsNwbdm3AzM1g/9ia88f/l6ch5c1QfpKlfYi916pA/vvb6xgr/Er/2dr8S/4oXZp1tb38vucL/haK9Vf2+1oq4Uja7NK5ikYw3X8quiFtMHRKM7zhrsrLWHNpsZw6Jf122uZyqd3bm4JPX7EqHhajdJl+Br8j3xgZ9he7NzcoxnlZO7QwKSPleQ/n9h6WPIEsjR/pqLfzoo8Gf9EajAsY8BagAho/dem51Bs18HO7fv/+6IaFxHOWLpLTalMTBT61VV4hENvzm3bsu8FdlJN61zwdhzmUZxWJvdE1VpUCAYTHXroPDlLsy/SLmDdatu5iOsT6KtJ8+Dp2aYsfRLPQXCkaM9TfkNXCAaRbPC84+w261mCdDeZevpV27gnJlYi622y0tkFugSWJv04ZdWaXr6dcvN0OUp95FTw0UF6DhIcVA29vsSHb8LCVjw39kYAMvpdeB4qgDR6Yj9EcbolM/lV+RkxfXr9f29fb1acGYQNVSJxL9N89TEyL+VPID91YAtbk4itXzGqGY+XuujjgPOef4tRHxBu1T2V/4eaf/ypsTfgF+bZDje7bXjlGukf2z69uYNLyX7/Tu1ZX7KRebfTCR48UlamD+J12AhmqiathTZT+gjpjNOn+d2SyRU2tGXKiuRYOD6JXT6L1/LhUoIdIIxuV58UiAfoWlgKWJI5ZD/l/OzQf7XRUifz1zctmCpcFTC7ZQN6GWChSWI/PjtHoiE+sUKjp/4L20Oti259WIdEwikjSIGuLXVyKyvzojmoG7d2NGRyljo5yNZ3ncQwr3w4O4wcMMxUUuVxF6mAI7vf+f/93IoV28jQ2ELAApn8tM7CzZe0RYxJTA9DmaSNNh4iKbCA2ma/sE3nChXYTbJluZV/k2wtt0GI/EjqRKFbloKV6fqGY27D90K2fh5RdTRbBDwtWVz+EfKjuWTbOOauMiBpiQU3WxW1y95AxCGgUJG2v7Ib5SVZaRShKqauoJDtB0vBc8A/5EGSdtLisRDltge5Gh4XTDzqJ8ZU+Cctyb4CSfBd/L1rWK4CU9mXefIKqL3fxvj18Gf2jYWDUx5Tcbe4IegDLb727tCjn9U/TeCuq3qUMIkpuj+e0w8Y2s0PxjW/35IwnRuhtsQ98AbexM0G+t3gGP2sYDqsa+ZMhL1gAi7B4YtegUaVCCDeiqRY/JBkuwYu47dMF6IIBiYQsKDMMhEBWq8A8IFh0GikVHiQa98Dqdw7I4IEVo4Dx+fSWYxfkFwmuJ7iMoSoT0DUNNMDoa6Zv4hVIiU3fb35z0XyOhzN5J1w3LrkzhTtV3XnjsXjEppsRdFn5Eq/1MNd9fX/tJH73lcQ3Ca4nuY7iyog/pG3NDFZcexOhYq+WvEAq+60zdbX9jbLyWJFuqoOuG5SZYpnA3W1F90AuPQr6yLAwhRcAzmdX+I9pQ97MCfr6/jk7Om+reWrFeCq4FUOSz38jIBqFodBZWxs8VfGD+4LfwPTheECVZUTXdMC3bcb3r7f54+kEYxUma5UVZ1U3b9cM4zcu67YcHzzz3wkuvvPbGW++898FHn3z2xVfffPfDT7/89sdf//xvBCsIBtDItAUlPC+bcGwD61ILA7+ZbNlOFlNrLxA9WWG0TwMvzLaI7upoPpEcKsoYCRTPTg1XMooe2EwsJseDJWX7zagjlT2bpAJW0TU287K1xaVs2jNt2lebst0Wv156p5wM1ju6XfzRlARltinKWz7SFdNtx0nRJlTMbSiuucnsoE2aXrdSUMn9bqcEFynsjH0Rx7jCZpxUdxy1pJlQEu5TqoGUeA6nzbmzuIkotTkm1hOZfTNshqrKZNj746M4aiXCTJvSJ9wrj4WGcTynnaiE2od5jtqZchdBb8XNnKkgUid3jw/IGWmnbucDTb5rabNY4Y7b3Eluw52qNRoqB1RK03ruVt232KHD1bQInRlYlcc9qayc91rDmcThQs0HO1HR1FzMBw5hztUexR+uAecaHFHXQSCQihiZKywnmXkyWDB/VbY08VZNAQAA);\n font-weight: normal;\n font-style: normal;\n}\n'; document.head.appendChild(s2); } })(); // community-modules/styles/agGridQuartzFont.css (function() { if (typeof document !== "undefined") { var s2 = document.createElement("style"); s2.setAttribute("data-ag-scope", "legacy"); s2.textContent = '@font-face {\n font-family: "agGridQuartz";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAAB60AAsAAAAAP9AAAB5kAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHItkBmAAjSYK02DDKgE2AiQDgnALgToABCAFhEYHhlUbGDZVRoWNAxCE6WSJokyNVmT/f0mQlxh6/aA2IaNSNSSMnFiPpCFrpxM4K2otB+uVtaIChHJqIvHDENnTdjLimnVXso4TytrTJzK4pg/me9l/YydzYHHZUEoe/n/tf/vemffdUS3liyhimoYMWTONUCiBEgj1rEV/Ps+9r/et+feYGhwbKIIByglQsVguFajUU8Bc6vSDVEIwvGxhQJFLtCEtQ2/vNjUAhue32YNvIvjF/0kD+mOjuHBJiFhF6aKMlUuMra2hbnfnSte6K4W1lzBXJX9zibf9f1FyUeqFXiEMufb6HcLgvJBHHMR871Sllk9WUWBoOTCmNGMQhNhF1s/dxncbCywH32oQBABKPMP/4ONvm6pmuvZk1rDIKWNuj+d82xpMQjITCuCDoFwi4H9V01W86y5NTmllGNP3ZJsIEKIEfEASRN09UzB9pjuvvGce3eXWdFNK77N4dBHdmVLbMLmOacOSYc2WOcOecUq2UFgnyp8tvnAVMiEtgVbEqzq3Qvxp3Rok89J7f80caG99C/bAiwpChJiEMMkNsv3qO5FAi6w2cmJqYUP+8Y3XT3WgZbdMcFwwPX5w74bks4VuGJfwX0Jtizy/N79/pfqZHub8wldS/ebV1/JWTStGFpTXNhUiGebJXMhhIzw+Kow1Wp3Vx3Cx4BriBBMY7FUEVWCyPj07hjTMCLSjjXjp9iJ4cXOjtAYk5WqtyiAIE0/zHeW3d4ymMZoax5hylBHhW73RzQRXSOOUUNFlTXgHARsVeftSI8aBgBRLlEUf0YLqBlHcg1Mn5ulxGECa1zFIIFe9DPZTzxyJICgoPs6gZ4FQt31fAFGzaFNCBQfqfY4OkMwQmk11bGbRObSxGmIALe+rQ3GqsKa9Gx+mSU4dQKNLsLj5JLEOJLVbUlPrvVXQEWIGvwoagTW8hECk63NwE/pNegiVBO19+fvxO/7xo0Tb08ubS2WpOm1Ou1J72k9gtoXyPf4qXw23W0/TE2qmIGqePZKStASraUzvycGhxdVSLPoyZDNUB1xagP0Acq3XKqNOXrAtnO7AamiZGA69W2viqHLEswsRLpvw7JC0TSR9eiOQxTG1uXgOA5mrkZLA2AriEAUvOhPH5dHZkzpQ9LS+QyWUXwTDWFp6e1Gc2BNRo6JEdlF5bnbEozzK0Q14T9ATnV6siC4K4sirtu+W1Sf14g3UeLrzjqH+9c2n6Jm2qo2FsWRFrPgoThTXRxMfVQQvztMX8OaUAHQDxFxDb4daQrpI0Erq0y7c+bBJaQBKDNoaSGR4ZN0WsR7XQOD9MMK/w+MZ3BAQSRUaEQ8OKahltEb6uGEUFRpJ+9ySelSFsl/QGCqpFT+zBtqogEtzIEQ1iKNA9BsUJKWu+1dyJJrx9AYG8sd8GXwpDnz6J5cyQMYUIHsVK3cnb/uPVIwKH9grtZF+Fdj0AKiBAlycKcr5cvP0dDaofd9FFLHu46F9QxseiZZy68lPTNbrLrlx6yVSyczsRM6DTmFlQAKqsil05HHKU5ETKPYEDWrg5TI1B46FkCgsDk8g+mf2YVSoNLR09AyMTMwsrGzsHJxc3Dy8fBR+AUEhYUYRUTFxCUkpaRlZOXkFRXolZRVVNXU0RkNTS1tH1z4LpAaQPbzhzx9fW1ya2ptYmVFZ3pyb3eYuTG/tzq/v7FtdbUD53nsVuPTRBnCjceBma8CtFoHbLQF3mgLutgfcawK43wrwoBngUavA45aBJ20CT5sDnjULPG8beNkk8KoF4HXTwJu2gLftAu+aB963DnxoB/h49kEQo1gSBiwFA5YGNEAwaIRg0QTBoRmCRwuEgFYIEW0QEtohZHRAKOiEUNEFoUE3hBY9EDr0QujRB2FAP4QRAxAmDEKYMQRhwTCEFSMQNoxC2DEG4cAhCCcOQ7hwBMKNoxAeHIPwoh3Cl+MQOQGRkxA5BZHTEOiDiBgZAzwKDPAYMMDjwABPAAM8CQzwFDDA08AAzwADPAsM8BwwwPPAAC8AA7wIDPASGHrjZWDOeQUY4FVggNeAAV4HBngDGOBNOJcSonUuNYg2Q8Y7wADvAgO8BwzwPjDAB8AAHwIDfAQUTMfB13b+wG+0PwNd37NyHissKde4UwgUUmNwqY/Aon/vkN88uAmfAbkGfo4B8ovk+AjEx2oSoACDojFdV2rGpfWbber8hlTuUk5tptE2hRfFHQyEb0uOjojmRtADtjDYgavYTZIwNJIJ0Z6cHx0sCaaHD4s8jko58QxFsBCpCmwOTmUh/SRkM18oYtAD7Dr2Q0a4Zx9QKILJ8mexdStGY+SMMDRRKBayoiLp0KZwCAlnoFw+P5LFixJjdJ8mBqNKdnOxu0O4jCjS8Oyd0ulbaf7rNCvNsMSlVH3Yo+lAuQG5MjYh//wtgQBOxVvFygozrpmYk/R2l4ilVHppV4d3mgjyspFM+61xYQ+DuudwKuHE7DdFRPViyCsQ45WDMdtNptebRYJiDjuQL6FDJVdgelrTlkZEddl3l/j0crn2TZJr17fSjk4CnIhBw0jyhW9PuO1Ude0efnFjW8jbh03SrSieKnrug9sUtDTUBLbABthnNpgtcItcOwuqPqeASn7cA7uv0sDycqZn1NYFgGauWoxGHgA1VpLPhO3OsKBIOvaQqJ6wiAs5iTuYWvk6/DFePsDDJYausJ7LdYZr4+gqJnZe89JYmaMQUDTiUqVm3JXIrz8Zke3U8iXqkIcdSjVqHyWtDb9w9dmOg5nG56znz+VCGPN61Yg//8ULxczR/v6fpFSo7rwiZe4ObU/Mh8w9whXBE0yaRn4x08UbPGRK+EFXVPNWF0+MvvyGyxsG1F91/Qx+FExPiEcsX7QIw1716ptL2Z2Hvua6Mun6z8LlF7sOfyNeyBusXzTJt+Vknj9odCfI1MNRCwkt5taAOmeM+Z3CQ/MrXgkFHS4WjsRlpsEbFx/gPFwbXMDJo5soMf7QUKok1BoRWUdsW06g+VPMenLrOlVw3gPW4ds38BuuT9YdSivNUI19MjmQWeLTdctblukuo1mElw1o1VGjXoeoKibSkO8cBsKxHYsPn6O/d/PaFuqJBZwhfteZ2KPVy5B9xefRtfjmtRPUSFmhkJbk4kMNa2hkU4vd3KT35YrRZuP6GKFFM5WcsATfBQveE/UN/EWpAens6nY5xtsMU90AubaCRFGqN9wR39SFvimGFBohOwR1XTCFuMfhBNe2FYZslyF+xLKIIcNuLlGUeMgMmzSyDMO2DZNDpEjrYb2oT0yTJG/YEMecyQvFgelQ1SEeVcS6tiqrlkh3WQzhDUihoK89x6YpKGH2bovYGp6GM2QOzUoo781G3UeMUWvEbeeaerLP4sjc/Vz+TNkXzcp4Ll9ORht9nrZhinUImsHyHAbQ4A8RMWq1xr1UgpPGACnCE0yU5nnyQrIa4Qjnt1yqUkgy30tAPYFTwkMmQQcB3RORpsBBsmHHnIQjhyBRtYhGf5az+eL8zNlHghm1PqzeZH2PL2rvv58DuCDhdfjFacloc9qCkT3mj0kkpzNDiM+Xdo0oVqc3ymWeSbHQyzNvLhc0vQQZmkLyBdVvejxDo7Fy+/PF1/MVFuHPGdDBwnkTVXaWzn1yR80zrffRrZLBrfbEWF/4zz9FJcdxuDTzZl69u6O7Z2SqEc2RGTiNZ1WceQafPydeL0Jv2DulV7e3To30BLs+nSdkuMubfv3+rqN9YxOh9pKZj27JWWLO1yKfWZ92oQPWYU8+aWa1QB92oMuY6eQCsBp3w4yZGp1rR8M3O8Aai1CQd1hzWIND1521NWKUB3EhHRMzPcZvRKV78QDgxx0O8tDE2qApzmkruTr16YQdif6meHy/wWwszR3YgVKjVKeDzKZ/zEeC0l9M4AS5cXUADc5OAoC91SSGZFcHfJYpL96Cx6f74cDMRC2+kQRYqRTZqVneWObu6gEtqG687Aj7IwNrmy0cEx0zaIIbnL8h6fdq3pERt8DBSNKEHYtEp0wyHK61yUqXieJ47PInGWYoCKAppOT2wlpK4wY0rbfAOsvP8iLoqRzd/PqcTdyuuwDM7WgetmWDeGlt01RuOmhfiU063Wi1DDrSJGLOkyGLLB1FB8O7WPYSy1UMojV8M5IWC1tq+tRcHy1XJk6ylZiV7AdlnP6wH2EWHIQf1qvIJeMPeUACiSmz54pids7HxmjaiZS3JCmrgQCvsb7s/M1nAOTVGllYtMC6QculGXwvQNOjt1/k3QD3L6/NHD6jor8XF5TJxTfho7xR1Z2Qh3wNO1wbY4qERIq8VbT0aDZhZ1pncM4W5GoI2B1nk1QhOpFaZlx6pRgMZaNQKUmmxtxfsltRGCkddHTk/FnZbqcqruF60jB+LlfjxTtQZ6TVE0oXF3dlO9Py6fVVHOkK9mfaX6QcRZHWPnHunbFGZXtRy0fenIoDryUHDKHESouLclaXPVLHD3sdb/XTSV5e/sln9pqUU9scDak4sJnr7Gxp3D8hqFRGm9tAUz+y079Eo81Wo/m2kvZqccBitX3Mr1rppGvHBCgjjcdmMIshYvP9ELLQypjYFxydHAAaDVwbvAj7D/sW6w6e+azXHEx4cnYQDWmmh51l5lqZMnlEj5NhaSbwoseaqK6JjjPx5m408msdoABjtXUAXwuwHyB9AoKNygLOFgsCVfBex9PdT9qHoV2bX26ryAFPuC5DsiJyI7ZXQFcmihWONbELDzjooSouNj2bhj0hz/C6GeHlIa9Ib9yJeymc0GPeUi6heRoNBEivm9puVQb/PwJ7Kx089i5nllUydzZXA9Glpo28AyNtD3NnrYoaozjdElW2Ti5ON55Qmk7fuHmBX0ZV19NmYB+lrRb8oky7xFCFlBrfyIiVVXPhZDwVTlhfBbVadyh4QyxTjrgGhZvBI4WjhodelA1j875QJh68aOuuNBtYm5Gi/ro1g6phfOhC9xHdfPG9C7bnNSz75IkkT7yAS2g8klsT9ZMLBlw0PENy4INtQiqp1qgiWxYymbwxE+vcpzJbfFZ5iP2PuDi0eapoavPn+5YCZDvJD27f55tdRZMc5CY3/6/cj4bO//fyN3PcMg18ICr5gJST27bh/kflhIcCPDvlsLZtq4hpa21lWqq6LwPw125rOQh7pUG4hSFA8XSbLcyW2vVZiMJ+OX6Zt8GeAuHyRBIjuVzcv19N3L93HXJhDvT6hoZev0g7UHX+EjMEwBwrMAI5+oT12qTh0h+2DZ+McURh31vV/PTAHCr2g+LBOH/YldrwsiBGJPzh7Q3F/OJm/bRKtq9ZvphcGN8OGYtjDP2RLPiWBFLqK2fiDTHH1+YmzBfdY8HfHkc0qbPgjq9g5CP+bJrk3m+uYRfBPr6UOHfi2DESc8pxtxvY+fuppMu94mvEg0cdRT8ukdMX42bC2Shf0Y/Z+6YyLv25ecN9Kke8OkkfkENRHD3BG3ZftUIkSrUNU6IwOyJY4KbEb9Xm0e42nzix/etQ9MPpIHlsEPVFvd6RkVdyh3zQrtfbXY2s3WofyWR9K5rbq7aPeIFQtx5xoEdRB/YlGZMl6BnVXA+qLjxD3JgTmWpoNAVyB749pE3Tl7v4oPQN1eHDudUrc2EoBcq/TlZVwbnKFCWct7IqH969AHzMBNzgc0IoCJ1xkrqhbvMW/aZDu5Y1i4ifVR4nZaaMTmGfKaRc02wc6gISXQrzwNE3ukc7e4I23OAPpcC9iTkT4XG4srW7v3xj7I0vd69tMccbbxUVDAb301iuaS8q6kviJnWXFLueoE9cpt2lxH1FRe1PIgAs+YDAHJhn/XqCsIdpwzQYhlImihOUygoSI3NzP39YGRnNpKfQ4e8hjTRaKnvRRzduOCIdYduFB8UHhZGvreSAnM5f9bEDhoFYPWjMZnIsr5X2hnz4ZcexLz8MgY3RehCkW8Ec5xukp+MkcebY01KD5FJsQv78tdLP0+H64ycWnThcDxth6eThrg3FmcaDXcc3hlYD1nKYlJOTk+AjCo/44yOZj5SD4JsYCe35aIQ4MTcCxZ5W9ihPx0I9j/9NKeLGXEj1005+hapCO5MQUZhkP0/SKeF3fnb28pPxTovBtCf/EJgTI9lsDhvH3BhRnIVNYi4MR4/MUZ0ITH8yWlVhW7c7/SIFq8KSsUps+se/pN4+MBzxVW19G+VZkEId9pKyrucFPPf9U798z7pYfUAuHmhFwjlRf7+1y4+275reEFNUNUybu+Y3bqS1pDaUuVLP2xF64kIojzc5W7lb/WDjTjTk5LW96Y0/0JlGhHGp8f0B1tRdKB718eRbO6rtrFOM1OmKvC/DrkkYweW6T75iv3Un/Nys12NdMW5uLODs8Q/JY9H8ualPOev6QvvWcZLvqYJop8IN780NlIs8GlxDaoihvOlzLSukVXx9EW3VycamuHhCr2+G/PXXdEqJJFubUsQo4Lo5BfSiFG22pISqa8xejq0c5CfEFzg/EOEaj4bQkK/VXVHxesnvZECkSkAcmAv98slTYolDjkvEJPYp7VVO+eDY2p4+Qe6rfHLXUp+9au/abE7BMNP+S+9s63zrzTO650HDSjozN39Naf2xtZnIySA0KIOrrzA1TOt7FjysZYSDGImVYMuYv7uqmtla22Yw/y2kHAh0BrB+aUquQp0+W63Irzndu7ExSn33YYk34+E35Yzx2S95Citno3g0Y7v4CfcTPODVR31ke8fgko/ZONXKK2NrtewynlVILGlMmapYbJrSJqzcIs5q3NjbW7PzvdhhdXquYmnK+qQkoNspWzFlKzBPDlZETQPWPOzzrHHG7PWdhSSGp0q0Hh9DRSMCA6t9TTE5FYfV7HT2Lunew8MVOTFNWsiSrBmh3dbG6xJzeCWRPdChH71H3qaNaJIt0LwoIanOF8kbSspPSMhfJN2FRfsbPKymMISW6RIg71/Ehfws9JfenxHXO9/EyFFKZ8X5Abqn70DAqXwHmH8KmTDhb8uemxwZwf2PFBIou221raIZMAAUrwtJjYl0Twr3nc4ajbgNvNl5PqY6Lw7E3lQRGClezB9Pnc/rZRHmRHrhUnix2F5t1uiF7MUlBIaXFFcpixGn3IlIp+5AkYLqRqIPehWdo1rpZAYgH6DCGmn/Uh2h7o8gV7PX2UhDINFF4PL+QiIubixLlDVmZNovW4aP+jyIC3MhHuCt5ftl6NJ0GRMRmaFl0czEYsl8rah0ofrnaUqkiTXD7uDyJ0yqNJVpgp+JVx00M6FEOk8jMi4YqE1ZkpAqw6wFbSGfcl8+kEhaZiF456tzArGQd/mtaxvFMdJm8/g7Cj2eTmLy+xFQ2mxIdzCrZyVvCEC6oK+ue5pumKZMGpTKZ7MRcof/93Qc+7p1KeLabHvqpQ7U2UEs5FCt0zY25qX22G/2fpZ2oVOIC5mClkyNDJkkMYlr/22M5CKCHBsD9/8ibuE5g0mdk98i3+aJk/gBssf/IsDsgeMkRo6O2qUmPeE+l23z+TyYkjmuPMHMJ7Xuqd+iDfxu4RToL9krvvXo0S1z51boeULu9CdP5bW1toTbGarEDZmF1Z6fOwfg5dMAh6vRpM1UWxcWJOYlJOQlFriku5iX0Id2vdZlmutmVaQtW5ZWMfvnqU/96N0BP83+Oe0nUDHrMWZ2RR1gQ/fFdCFfeilu4qqOuySd4I3r5vMtbA6cDk9o75Shfhg/SV8n/15WZ0xKh19QcukDKOHPTx/npSca7dLAY6/mvbrwDHUhMpMJ93MUEm+/Q2BkfrD21lpmVbXdZJQhbhB6syl8nJ8nvRhL0UccFHaF9DRnyeAaWRbqQA2IC21fXg2cLWvuCela+mOEAc6pjYD10elwLOJG7shqQLa0uZfG/55P6z2YJQU1sjuIE40JS4/Wh/VAHWGYI/8w6gJ0JHeCpAbXIh+eEb4nlU6d0w2SgdgBgmSyDoruo05kaEj7XUPHCxjSnzV0x9RKd04kH7pTeMeDOBAQpRpdE3i1Um3OWYY0z7DMgCuXvlM4d1l2M7LJsqmc0V2YplbMaQzJr/6TA2nOXjan8HzFcvp4TmtkHLRWtqElaw2yeAnDurBrf6U5vHtJd2GY3bqoCSnYYcg17Ija9O67m6Jak5t2FVOYlPSz74XmnqYqjlmmr9dvGtOmbVte+5O9HQUDP3RXWUS1e+wRoKNfnh71CPfE5wPROgfqRLz9/YTcIccnp/wSPFNTdrMlrLbW3t/vRVyI+Ed06iKZiAtzI+Dro6F5XAwoNvnZ+favMn3Ow+TbJyftnw8HbMTPXs4zWyjwde5Vy01Xwbgcf3DfAzrkxDJ9fSSGA+PIXLdK/EVrrGALyXRExN4BI51tMsFipY0D31w4NDjgf69rOPSd9evaaltElupu228P/V1L8F+DFk+UhWdGwBUOvEcGfIyRX4Q+FNOwSbyKTP6EWTVTBUQScdJB0cEkOv3XTMlDnTNyHtj1rTYBqB3D+u2rylLNKpU5texZarmLZlUvPyt/TZU3lelokNeyTGaVmlpaTFKr7LZ0P/eWFqlJZr1dE/wqAXUia2tCj1VTY5Yo5a5SvxMshFbRXImJyTZV3lp2h1rylq1X3lj/vceIpSFTJUwDh8axyvw8n7xr8wZB2JtzsMo82M4XC1UpRmOKSrOi4MeAd/jbyTsBP63I16iMySnG13VyksCrhH9W5KsroLJ1Tt2tf7dH0ZcELvMSxE94adwn4rmBlj89uN/Rwv9GKfb5NVcGImzPUmR9peePy9y54qfcNN5TcQJ3W/TaV3sv08Mz6GKGey94+eA8I5xh3lu3sHafmSFmrAXja4gbeRwc9Hr5rjjj+Ypv9FcwZLU5WXzqe0n4pKHxQxx1BJ/mrJhfd8oLBh/LMFkNyJIeDDnx5a71/+z6UjWPGi19tnvlwpbw3mQsHHh8sAuMjJIywoSkes1MvYXghhhZsQFZgrMRjqm/v/TGtNS3XpSFR4FyHBC7I0Ycax5HYAT+jUhfPTzzCIEB5diBytGFRLnzE1fAb9nfFgjW7r+OqpwZYVukW5hnXKGK9peuQdbAXM2dvHp6XJZs2Elpl7ZTdq6auRV11WbOIjY3oC7fu9o0zZ4O7wy8LLDZrBbb5kc83Wz6bF1mZuoAfSDVvnkz2Pl/Nurz6UUUtKbI3aIBaSU097A70EuhqGtmpBOgDbftg3xg0pjggDqOyT1QVPo+5IhaDeUCUP/OGujHVXo9dOMWadCCpCu/2UXcoyUIkSYchRK68m9N6SjqZ+kOSCtC07QBWp12U3+55VPofRH4FhpmeWb+gzoqMmlKt0IPhBZER3FlH/SdyULMSCdA1GP3yJ1QaGLWlYsNomUxSRuoKiWkvgniMi0nCTJAja/oysWQO8qr/1+XRWh1JaJkEAKWt4ii9hYIaqNZOyPQC8xE6J/KXxt4fudfxWJ4zu9BIZAPgFQW/NWVXQUyG/VP+vQjmv4sMSUBoH9DmKF8f1HM/PHjH03h+7jB/9dJ/v45JMTVmXg+8TJoSXqgDk6XXzpyEpnYI+NK5IkWe2EArWz1nFYjSZzWQFamLTWiDztvZfAogiiDAcHqfXUaSfVBqU3rJ6Wh9edpDLM/lIXW/6eJzsnvd5OE094CqI/i3UcG0fs3rHMA+blKsi+/UJJnKl4Oz1Vv7IiEAoquON2K1NavqlVRCTfFO1O8qhC4iMKfaPVwVo1vT09VmvBguelAfRTvPjIkfr1/w43K4WytCNaqzv6FTzTBwcZUvByeCbUjEPFZQdHZp9uXndqN/aq5XRUf1cJN8U4VE9KQUl5DrPc+0abqcO7gxbenfKiKVB0sFfPPUpdF/D/Cc0CVyrQcttPl9mivzw8gwoQyLqTSxjofhFGcpFlelFXdtF0/jNO8rNt+nNf9vN+v0erS9RmGzKzsnNy8/ILCouKSUqPJbLGWlS8wwO9OK9S1YA3qmYYgwpfUg2T78Dl1AA6vBkMLZDEM7BlE1xFE+3Xia7nrQff4YzeeHCpK4wkUt1VdmYgWn1sOLGX0J50y+ihyQ2lqmVTAKrq+5XgbWOGUeja1PZu1z9oe4PUhNy4ZgXqom+ANyxQgnXt7d1j5cMPcwHGStF+Lj4NaOMf+xZymHysdBk+Mk44Cg/NUjxu4+sbfsd8g5bGgpNSAmHBGrCWEwBfIQby6iD0sToPoW9a1rPcPl6esylRyVa1+xNFAfH3WfoIWp6mhMFA6vtABc8FnYLTh43ckItWxqDNTQSxt4ATYpqviCJOf83JEGmeShHY7eTHkNGjUi42HgbhGfdqoOsBymo8tlMq0h5kQl7T42ByhK0+sys205CrHqXJkKwOYkuP8gMXObvAmvwBjw6dj/tWW4FwfnVcDpjZi0Kjxhg2Zi0nGGmeCOZsvczJXUzYmm2hupjWVuXcA);\n font-weight: normal;\n font-style: normal;\n}\n'; document.head.appendChild(s2); } })(); // packages/ag-grid-community/dist/package/main.esm.mjs function _last(arr) { if (!arr?.length) { return; } return arr[arr.length - 1]; } function _areEqual(a, b, comparator) { if (a === b) { return true; } if (!a || !b) { return a == null && b == null; } const len = a.length; if (len !== b.length) { return false; } for (let i = 0; i < len; i++) { if (a[i] !== b[i] && !comparator?.(a[i], b[i])) { return false; } } return true; } function _forAll(array, callback) { if (!array) { return; } for (const value of array) { if (callback(value)) { return true; } } } function _removeFromArray(array, object) { const index = array.indexOf(object); if (index >= 0) { array.splice(index, 1); } } function _removeAllFromArray(array, elementsToRemove) { let i = 0; let j = 0; for (; i < array.length; i++) { if (!elementsToRemove.includes(array[i])) { array[j] = array[i]; j++; } } while (j < array.length) { array.pop(); } } function _moveInArray(array, objectsToMove, toIndex) { for (let i = 0; i < objectsToMove.length; i++) { _removeFromArray(array, objectsToMove[i]); } for (let i = objectsToMove.length - 1; i >= 0; i--) { array.splice(toIndex, 0, objectsToMove[i]); } } function _flatten(arrays) { return [].concat.apply([], arrays); } var _makeNull = (value) => { if (value == null || value === "") { return null; } return value; }; function _exists(value) { return value != null && value !== ""; } function _missing(value) { return !_exists(value); } var _toStringOrNull = (value) => { return value != null && typeof value.toString === "function" ? value.toString() : null; }; var _jsonEquals = (val1, val2) => { const val1Json = val1 ? JSON.stringify(val1) : null; const val2Json = val2 ? JSON.stringify(val2) : null; return val1Json === val2Json; }; var _defaultComparator = (valueA, valueB, accentedCompare = false) => { if (valueA == null) { return valueB == null ? 0 : -1; } if (valueB == null) { return 1; } if (typeof valueA === "object" && valueA.toNumber) { valueA = valueA.toNumber(); } if (typeof valueB === "object" && valueB.toNumber) { valueB = valueB.toNumber(); } if (!accentedCompare || typeof valueA !== "string") { if (valueA > valueB) { return 1; } if (valueA < valueB) { return -1; } return 0; } return valueA.localeCompare(valueB); }; var LocalEventService = class { constructor() { this.allSyncListeners = /* @__PURE__ */ new Map(); this.allAsyncListeners = /* @__PURE__ */ new Map(); this.globalSyncListeners = /* @__PURE__ */ new Set(); this.globalAsyncListeners = /* @__PURE__ */ new Set(); this.asyncFunctionsQueue = []; this.scheduled = false; this.firedEvents = {}; } setFrameworkOverrides(frameworkOverrides) { this.frameworkOverrides = frameworkOverrides; } getListeners(eventType, async, autoCreateListenerCollection) { const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners; let listeners = listenerMap.get(eventType); if (!listeners && autoCreateListenerCollection) { listeners = /* @__PURE__ */ new Set(); listenerMap.set(eventType, listeners); } return listeners; } noRegisteredListenersExist() { return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0; } addEventListener(eventType, listener, async = false) { this.getListeners(eventType, async, true).add(listener); } removeEventListener(eventType, listener, async = false) { const listeners = this.getListeners(eventType, async, false); if (!listeners) { return; } listeners.delete(listener); if (listeners.size === 0) { (async ? this.allAsyncListeners : this.allSyncListeners).delete(eventType); } } addGlobalListener(listener, async = false) { this.getGlobalListeners(async).add(listener); } removeGlobalListener(listener, async = false) { this.getGlobalListeners(async).delete(listener); } dispatchEvent(event) { this.dispatchToListeners(event, true); this.dispatchToListeners(event, false); this.firedEvents[event.type] = true; } dispatchEventOnce(event) { if (!this.firedEvents[event.type]) { this.dispatchEvent(event); } } dispatchToListeners(event, async) { const eventType = event.type; if (async && "event" in event) { const browserEvent = event.event; if (browserEvent instanceof Event) { event.eventPath = browserEvent.composedPath(); } } const { frameworkOverrides } = this; const runCallback = (func) => { const callback = frameworkOverrides ? () => frameworkOverrides.wrapIncoming(func) : func; if (async) { this.dispatchAsync(callback); } else { callback(); } }; const originalListeners = this.getListeners(eventType, async, false); if ((originalListeners?.size ?? 0) > 0) { const listeners = new Set(originalListeners); for (const listener of listeners) { if (!originalListeners?.has(listener)) { continue; } runCallback(() => listener(event)); } } const globalListenersSrc = this.getGlobalListeners(async); if (globalListenersSrc.size > 0) { const globalListeners = new Set(globalListenersSrc); for (const listener of globalListeners) { runCallback(() => listener(eventType, event)); } } } getGlobalListeners(async) { return async ? this.globalAsyncListeners : this.globalSyncListeners; } // this gets called inside the grid's thread, for each event that it // wants to set async. the grid then batches the events into one setTimeout() // because setTimeout() is an expensive operation. ideally we would have // each event in it's own setTimeout(), but we batch for performance. dispatchAsync(func) { this.asyncFunctionsQueue.push(func); if (!this.scheduled) { const flush = () => { window.setTimeout(this.flushAsyncQueue.bind(this), 0); }; const frameworkOverrides = this.frameworkOverrides; if (frameworkOverrides) { frameworkOverrides.wrapIncoming(flush); } else { flush(); } this.scheduled = true; } } // this happens in the next VM turn only, and empties the queue of events flushAsyncQueue() { this.scheduled = false; const queueCopy = this.asyncFunctionsQueue.slice(); this.asyncFunctionsQueue = []; for (const func of queueCopy) { func(); } } }; var reUnescapedHtml = /[&<>"']/g; var HTML_ESCAPES = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; function _toString(toEscape) { return toEscape?.toString().toString() ?? null; } function _escapeString(toEscape) { return _toString(toEscape)?.replace(reUnescapedHtml, (chr) => HTML_ESCAPES[chr]) ?? null; } function _isExpressionString(value) { return typeof value === "string" && value.startsWith("=") && value.length > 1; } function _camelCaseToHumanText(camelCase) { if (!camelCase || camelCase == null) { return null; } const rex = /([a-z])([A-Z])/g; const rexCaps = /([A-Z]+)([A-Z])([a-z])/g; const words = camelCase.replace(rex, "$1 $2").replace(rexCaps, "$1 $2$3").replace(/\./g, " ").split(" "); return words.map((word) => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : "")).join(" "); } function _getRootNode(beans) { return beans.eRootDiv.getRootNode(); } function _getActiveDomElement(beans) { return _getRootNode(beans).activeElement; } function _getDocument(beans) { const { gos, eRootDiv } = beans; let result = null; const optionsGetDocument = gos.get("getDocument"); if (optionsGetDocument && _exists(optionsGetDocument)) { result = optionsGetDocument(); } else if (eRootDiv) { result = eRootDiv.ownerDocument; } if (result && _exists(result)) { return result; } return document; } function _isNothingFocused(beans) { const activeEl = _getActiveDomElement(beans); return activeEl === null || activeEl === _getDocument(beans).body; } function _getWindow(beans) { const eDocument = _getDocument(beans); return eDocument.defaultView || window; } function _getPageBody(beans) { let rootNode = null; let targetEl = null; try { rootNode = _getDocument(beans).fullscreenElement; } catch (e) { } finally { if (!rootNode) { rootNode = _getRootNode(beans); } const body = rootNode.querySelector("body"); if (body) { targetEl = body; } else if (rootNode instanceof ShadowRoot) { targetEl = rootNode; } else if (rootNode instanceof Document) { targetEl = rootNode?.documentElement; } else { targetEl = rootNode; } } return targetEl; } function _getBodyWidth(beans) { const body = _getPageBody(beans); return body?.clientWidth ?? (window.innerWidth || -1); } function _getBodyHeight(beans) { const body = _getPageBody(beans); return body?.clientHeight ?? (window.innerHeight || -1); } function _toggleAriaAttribute(element, attribute, value) { if (value == null || typeof value === "string" && value == "") { _removeAriaAttribute(element, attribute); } else { _setAriaAttribute(element, attribute, value); } } function _setAriaAttribute(element, attribute, value) { element.setAttribute(_ariaAttributeName(attribute), value.toString()); } function _removeAriaAttribute(element, attribute) { element.removeAttribute(_ariaAttributeName(attribute)); } function _ariaAttributeName(attribute) { return `aria-${attribute}`; } function _setAriaRole(element, role) { if (role) { element.setAttribute("role", role); } else { element.removeAttribute("role"); } } function _getAriaSortState(directionOrDef) { const direction = directionOrDef?.direction; if (direction === "asc") { return "ascending"; } else if (direction === "desc") { return "descending"; } else if (direction === "mixed") { return "other"; } return "none"; } function _getAriaPosInSet(element) { return Number.parseInt(element.getAttribute("aria-posinset"), 10); } function _getAriaLabel(element) { return element.getAttribute("aria-label"); } function _setAriaLabel(element, label) { _toggleAriaAttribute(element, "label", label); } function _setAriaLabelledBy(element, labelledBy) { _toggleAriaAttribute(element, "labelledby", labelledBy); } function _setAriaDescribedBy(element, describedby) { _toggleAriaAttribute(element, "describedby", describedby); } function _setAriaLive(element, live) { _toggleAriaAttribute(element, "live", live); } function _setAriaAtomic(element, atomic) { _toggleAriaAttribute(element, "atomic", atomic); } function _setAriaRelevant(element, relevant) { _toggleAriaAttribute(element, "relevant", relevant); } function _setAriaInvalid(element, invalid) { _toggleAriaAttribute(element, "invalid", invalid); } function _setAriaLevel(element, level) { _toggleAriaAttribute(element, "level", level); } function _setAriaDisabled(element, disabled) { _toggleAriaAttribute(element, "disabled", disabled); } function _setAriaHidden(element, hidden) { _toggleAriaAttribute(element, "hidden", hidden); } function _setAriaActiveDescendant(element, descendantId) { _toggleAriaAttribute(element, "activedescendant", descendantId); } function _setAriaExpanded(element, expanded) { _setAriaAttribute(element, "expanded", expanded); } function _removeAriaExpanded(element) { _removeAriaAttribute(element, "expanded"); } function _setAriaSetSize(element, setsize) { _setAriaAttribute(element, "setsize", setsize); } function _setAriaPosInSet(element, position) { _setAriaAttribute(element, "posinset", position); } function _setAriaMultiSelectable(element, multiSelectable) { _setAriaAttribute(element, "multiselectable", multiSelectable); } function _setAriaRowCount(element, rowCount) { _setAriaAttribute(element, "rowcount", rowCount); } function _setAriaRowIndex(element, rowIndex) { _setAriaAttribute(element, "rowindex", rowIndex); } function _setAriaRowSpan(element, spanCount) { _setAriaAttribute(element, "rowspan", spanCount); } function _setAriaColCount(element, colCount) { _setAriaAttribute(element, "colcount", colCount); } function _setAriaColIndex(element, colIndex) { _setAriaAttribute(element, "colindex", colIndex); } function _setAriaColSpan(element, colSpan) { _setAriaAttribute(element, "colspan", colSpan); } function _setAriaSort(element, sort) { _setAriaAttribute(element, "sort", sort); } function _removeAriaSort(element) { _removeAriaAttribute(element, "sort"); } function _setAriaSelected(element, selected) { _toggleAriaAttribute(element, "selected", selected); } function _setAriaChecked(element, checked) { _setAriaAttribute(element, "checked", checked === void 0 ? "mixed" : checked); } function _setAriaControls(controllerElement, controlledId) { _toggleAriaAttribute(controllerElement, "controls", controlledId); } function _setAriaControlsAndLabel(controllerElement, controlledElement) { _setAriaControls(controllerElement, controlledElement.id); _setAriaLabelledBy(controlledElement, controllerElement.id); } function _setAriaOwns(ownerElement, ownedId) { _toggleAriaAttribute(ownerElement, "owns", ownedId); } function _setAriaHasPopup(element, hasPopup) { _toggleAriaAttribute(element, "haspopup", hasPopup === false ? null : hasPopup); } function _getAriaCheckboxStateName(translate, state) { return state === void 0 ? translate("ariaIndeterminate", "indeterminate") : state === true ? translate("ariaChecked", "checked") : translate("ariaUnchecked", "unchecked"); } function _setAriaOrientation(element, orientation) { if (orientation) { _setAriaAttribute(element, "orientation", orientation); } else { _removeAriaAttribute(element, "orientation"); } } function _radioCssClass(element, elementClass, otherElementClass) { const parent = element.parentElement; let sibling = parent && parent.firstChild; while (sibling) { if (elementClass) { sibling.classList.toggle(elementClass, sibling === element); } if (otherElementClass) { sibling.classList.toggle(otherElementClass, sibling !== element); } sibling = sibling.nextSibling; } } var FOCUSABLE_SELECTOR = "[tabindex], input, select, button, textarea, [href]"; var FOCUSABLE_EXCLUDE = "[disabled], .ag-disabled:not(.ag-button), .ag-disabled *"; function _isFocusableFormField(element) { if (!element) { return false; } const isFocusable = element.matches("input, select, button, textarea"); if (!isFocusable) { return false; } const isNotFocusable = element.matches(FOCUSABLE_EXCLUDE); if (!isNotFocusable) { return false; } return _isVisible(element); } function _setDisplayed(element, displayed, options = {}) { const { skipAriaHidden } = options; element.classList.toggle("ag-hidden", !displayed); if (!skipAriaHidden) { _setAriaHidden(element, !displayed); } } function _setVisible(element, visible, options = {}) { const { skipAriaHidden } = options; element.classList.toggle("ag-invisible", !visible); if (!skipAriaHidden) { _setAriaHidden(element, !visible); } } function _setDisabled(element, disabled) { const attributeName = "disabled"; const addOrRemoveDisabledAttribute = disabled ? (e) => e.setAttribute(attributeName, "") : (e) => e.removeAttribute(attributeName); addOrRemoveDisabledAttribute(element); const inputs = element.querySelectorAll("input") ?? []; for (const input of inputs) { addOrRemoveDisabledAttribute(input); } } function _isElementChildOfClass(element, cls, maxNest) { let counter = 0; while (element) { if (element.classList.contains(cls)) { return true; } element = element.parentElement; if (typeof maxNest == "number") { if (++counter > maxNest) { break; } } else if (element === maxNest) { break; } } return false; } function _getElementSize(el) { const { height, width, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth, paddingTop, paddingRight, paddingBottom, paddingLeft, marginTop, marginRight, marginBottom, marginLeft, boxSizing } = window.getComputedStyle(el); const pf = Number.parseFloat; return { height: pf(height || "0"), width: pf(width || "0"), borderTopWidth: pf(borderTopWidth || "0"), borderRightWidth: pf(borderRightWidth || "0"), borderBottomWidth: pf(borderBottomWidth || "0"), borderLeftWidth: pf(borderLeftWidth || "0"), paddingTop: pf(paddingTop || "0"), paddingRight: pf(paddingRight || "0"), paddingBottom: pf(paddingBottom || "0"), paddingLeft: pf(paddingLeft || "0"), marginTop: pf(marginTop || "0"), marginRight: pf(marginRight || "0"), marginBottom: pf(marginBottom || "0"), marginLeft: pf(marginLeft || "0"), boxSizing }; } function _getInnerHeight(el) { const size = _getElementSize(el); if (size.boxSizing === "border-box") { return size.height - size.paddingTop - size.paddingBottom - size.borderTopWidth - size.borderBottomWidth; } return size.height; } function _getInnerWidth(el) { const size = _getElementSize(el); if (size.boxSizing === "border-box") { return size.width - size.paddingLeft - size.paddingRight - size.borderLeftWidth - size.borderRightWidth; } return size.width; } function _getAbsoluteHeight(el) { const { height, marginBottom, marginTop } = _getElementSize(el); return Math.floor(height + marginBottom + marginTop); } function _getAbsoluteWidth(el) { const { width, marginLeft, marginRight } = _getElementSize(el); return Math.floor(width + marginLeft + marginRight); } function _getElementRectWithOffset(el) { const offsetElementRect = el.getBoundingClientRect(); const { borderTopWidth, borderLeftWidth, borderRightWidth, borderBottomWidth } = _getElementSize(el); return { top: offsetElementRect.top + (borderTopWidth || 0), left: offsetElementRect.left + (borderLeftWidth || 0), right: offsetElementRect.right + (borderRightWidth || 0), bottom: offsetElementRect.bottom + (borderBottomWidth || 0) }; } function _getScrollLeft(element, rtl) { let scrollLeft = element.scrollLeft; if (rtl) { scrollLeft = Math.abs(scrollLeft); } return scrollLeft; } function _setScrollLeft(element, value, rtl) { if (rtl) { value *= -1; } element.scrollLeft = value; } function _clearElement(el) { while (el?.firstChild) { el.firstChild.remove(); } } function _removeFromParent(node) { if (node?.parentNode) { node.remove(); } } function _isInDOM(element) { return !!element.offsetParent; } function _isVisible(element) { if (element.checkVisibility) { return element.checkVisibility({ checkVisibilityCSS: true }); } const isHidden = !_isInDOM(element) || window.getComputedStyle(element).visibility !== "visible"; return !isHidden; } function _loadTemplate(template) { const tempDiv = document.createElement("div"); tempDiv.innerHTML = (template || "").trim(); return tempDiv.firstChild; } function _ensureDomOrder(eContainer, eChild, eChildBefore) { if (eChildBefore && eChildBefore.nextSibling === eChild) { return; } if (!eContainer.firstChild) { eContainer.appendChild(eChild); } else if (eChildBefore) { if (eChildBefore.nextSibling) { eContainer.insertBefore(eChild, eChildBefore.nextSibling); } else { eContainer.appendChild(eChild); } } else if (eContainer.firstChild && eContainer.firstChild !== eChild) { eContainer.prepend(eChild); } } function _setDomChildOrder(eContainer, orderedChildren) { for (let i = 0; i < orderedChildren.length; i++) { const correctCellAtIndex = orderedChildren[i]; const actualCellAtIndex = eContainer.children[i]; if (actualCellAtIndex !== correctCellAtIndex) { eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex); } } } function _camelCaseToHyphenated(camelCase) { return camelCase.replace(/[A-Z]/g, (s2) => `-${s2.toLocaleLowerCase()}`); } function _addStylesToElement(eElement, styles) { if (!styles) { return; } for (const key of Object.keys(styles)) { const value = styles[key]; if (!key?.length || value == null) { continue; } const parsedKey = _camelCaseToHyphenated(key); const valueAsString = value.toString(); const parsedValue = valueAsString.replace(/\s*!important/g, ""); const priority = parsedValue.length != valueAsString.length ? "important" : void 0; eElement.style.setProperty(parsedKey, parsedValue, priority); } } function _isElementOverflowingCallback(getElement2) { return () => { const element = getElement2(); if (!element) { return true; } return _isHorizontalScrollShowing(element) || _isVerticalScrollShowing(element); }; } function _isHorizontalScrollShowing(element) { return element.clientWidth < element.scrollWidth; } function _isVerticalScrollShowing(element) { return element.clientHeight < element.scrollHeight; } function _setElementWidth(element, width) { if (width === "flex") { element.style.removeProperty("width"); element.style.removeProperty("minWidth"); element.style.removeProperty("maxWidth"); element.style.flex = "1 1 auto"; } else { _setFixedWidth(element, width); } } function _setFixedWidth(element, width) { width = _formatSize(width); element.style.width = width; element.style.maxWidth = width; element.style.minWidth = width; } function _setFixedHeight(element, height) { height = _formatSize(height); element.style.height = height; element.style.maxHeight = height; element.style.minHeight = height; } function _formatSize(size) { return typeof size === "number" ? `${size}px` : size; } function _isNodeOrElement(o) { return o instanceof Node || o instanceof HTMLElement; } function _addOrRemoveAttribute(element, name, value) { if (value == null || value === "") { element.removeAttribute(name); } else { element.setAttribute(name, value.toString()); } } function _placeCaretAtEnd(beans, contentElement) { if (!contentElement.isContentEditable) { return; } const selection = _getWindow(beans).getSelection(); if (!selection) { return; } const range = _getDocument(beans).createRange(); range.selectNodeContents(contentElement); range.collapse(false); selection.removeAllRanges(); selection.addRange(range); } function _observeResize(beans, element, callback) { const win = _getWindow(beans); const ResizeObserverImpl = win.ResizeObserver; const resizeObserver = ResizeObserverImpl ? new ResizeObserverImpl(callback) : null; resizeObserver?.observe(element); return () => resizeObserver?.disconnect(); } function _requestAnimationFrame(beans, callback) { const win = _getWindow(beans); if (win.requestAnimationFrame) { win.requestAnimationFrame(callback); } else if (win.webkitRequestAnimationFrame) { win.webkitRequestAnimationFrame(callback); } else { win.setTimeout(callback, 0); } } var DataRefAttribute = "data-ref"; var whitespaceNode; function getWhitespaceNode() { whitespaceNode ?? (whitespaceNode = document.createTextNode(" ")); return whitespaceNode.cloneNode(); } function _createAgElement(params) { const { attrs, children, cls, ref, role, tag } = params; const element = document.createElement(tag); if (cls) { element.className = cls; } if (ref) { element.setAttribute(DataRefAttribute, ref); } if (role) { element.setAttribute("role", role); } if (attrs) { for (const key of Object.keys(attrs)) { element.setAttribute(key, attrs[key]); } } if (children) { if (typeof children === "string") { element.textContent = children; } else { let addFirstWhitespace = true; for (const child of children) { if (child) { if (typeof child === "string") { element.appendChild(document.createTextNode(child)); addFirstWhitespace = false; } else if (typeof child === "function") { element.appendChild(child()); } else { if (addFirstWhitespace) { element.appendChild(getWhitespaceNode()); addFirstWhitespace = false; } element.append(_createAgElement(child)); element.appendChild(getWhitespaceNode()); } } } } } return element; } var PASSIVE_EVENTS = ["touchstart", "touchend", "touchmove", "touchcancel", "scroll"]; var NON_PASSIVE_EVENTS = ["wheel"]; var supports = {}; var _isEventSupported = /* @__PURE__ */ (() => { const tags = { select: "input", change: "input", submit: "form", reset: "form", error: "img", load: "img", abort: "img" }; const eventChecker = (eventName) => { if (typeof supports[eventName] === "boolean") { return supports[eventName]; } const el = document.createElement(tags[eventName] || "div"); eventName = "on" + eventName; return supports[eventName] = eventName in el; }; return eventChecker; })(); function _isElementInEventPath(element, event) { if (!event || !element) { return false; } return _getEventPath(event).indexOf(element) >= 0; } function _createEventPath(event) { const res = []; let pointer = event.target; while (pointer) { res.push(pointer); pointer = pointer.parentElement; } return res; } function _getEventPath(event) { const eventNoType = event; if (eventNoType.path) { return eventNoType.path; } if (eventNoType.composedPath) { return eventNoType.composedPath(); } return _createEventPath(eventNoType); } function _addSafePassiveEventListener(eElement, event, listener) { const passive = getPassiveStateForEvent(event); let options; if (passive != null) { options = { passive }; } eElement.addEventListener(event, listener, options); } var getPassiveStateForEvent = (event) => { const isPassive = PASSIVE_EVENTS.includes(event); const isNonPassive = NON_PASSIVE_EVENTS.includes(event); if (isPassive) { return true; } if (isNonPassive) { return false; } }; function _areEventsNear(e1, e2, pixelCount) { if (pixelCount === 0) { return false; } const diffX = Math.abs(e1.clientX - e2.clientX); const diffY = Math.abs(e1.clientY - e2.clientY); return Math.max(diffX, diffY) <= pixelCount; } var _getFirstActiveTouch = (touch, touchList) => { const identifier = touch.identifier; for (let i = 0, len = touchList.length; i < len; ++i) { const item = touchList[i]; if (item.identifier === identifier) { return item; } } return null; }; function _isEventFromThisInstance(beans, event) { return beans.gos.isElementInThisInstance(event.target); } function _anchorElementToMouseMoveEvent(element, mouseMoveEvent, beans) { const eRect = element.getBoundingClientRect(); const height = eRect.height; const browserWidth = _getBodyWidth(beans) - 2; const browserHeight = _getBodyHeight(beans) - 2; const offsetParent = element.offsetParent; if (!offsetParent) { return; } const offsetParentSize = _getElementRectWithOffset(element.offsetParent); const { clientY, clientX } = mouseMoveEvent; let top = clientY - offsetParentSize.top - height / 2; let left = clientX - offsetParentSize.left - 10; const eDocument = _getDocument(beans); const win = eDocument.defaultView || window; const windowScrollY = win.pageYOffset || eDocument.documentElement.scrollTop; const windowScrollX = win.pageXOffset || eDocument.documentElement.scrollLeft; if (browserWidth > 0 && left + element.clientWidth > browserWidth + windowScrollX) { left = browserWidth + windowScrollX - element.clientWidth; } if (left < 0) { left = 0; } if (browserHeight > 0 && top + element.clientHeight > browserHeight + windowScrollY) { top = browserHeight + windowScrollY - element.clientHeight; } if (top < 0) { top = 0; } element.style.left = `${left}px`; element.style.top = `${top}px`; } var addTempEventHandlers = (list, ...handlers) => { for (const handler of handlers) { const [target, type, eventListener, options] = handler; target.addEventListener(type, eventListener, options); list.push(handler); } }; var clearTempEventHandlers = (list) => { if (list) { for (const [target, type, listener, options] of list) { target.removeEventListener(type, listener, options); } list.length = 0; } }; var preventEventDefault = (event) => { if (event.cancelable) { event.preventDefault(); } }; function defaultLocaleTextFunc(_key, defaultValue) { return defaultValue; } function _getLocaleTextFunc(localeSvc) { return localeSvc?.getLocaleTextFunc() ?? defaultLocaleTextFunc; } function _translate(bean, localeValues, key, variableValues) { const defaultValue = localeValues[key]; return bean.getLocaleTextFunc()( key, typeof defaultValue === "function" ? defaultValue(variableValues) : defaultValue, variableValues ); } function _getLocaleTextFromFunc(getLocaleText) { return (key, defaultValue, variableValues) => { return getLocaleText({ key, defaultValue, variableValues }); }; } function _getLocaleTextFromMap(localeText) { return (key, defaultValue, variableValues) => { let localisedText = localeText?.[key]; if (localisedText && variableValues?.length) { let found = 0; while (true) { if (found >= variableValues.length) { break; } const idx = localisedText.indexOf("${variable}"); if (idx === -1) { break; } localisedText = localisedText.replace("${variable}", variableValues[found++]); } } return localisedText ?? defaultValue; }; } var AgBeanStub = class { constructor() { this.destroyFunctions = []; this.destroyed = false; this.__v_skip = true; this.propertyListenerId = 0; this.lastChangeSetIdLookup = {}; this.isAlive = () => !this.destroyed; } preWireBeans(beans) { this.beans = beans; this.stubContext = beans.context; this.eventSvc = beans.eventSvc; this.gos = beans.gos; } // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed // points to a bean or component that was not properly disposed of. // constructor() { // setTimeout(()=> { // if (this.isAlive()) { // let prototype: any = Object.getPrototypeOf(this); // const constructor: any = prototype.constructor; // const constructorString = constructor.toString(); // const beanName = constructorString.substring(9, constructorString.indexOf("(")); // console.log('is alive ' + beanName); // } // }, 5000); // } destroy() { const { destroyFunctions } = this; for (let i = 0; i < destroyFunctions.length; i++) { destroyFunctions[i](); } destroyFunctions.length = 0; this.destroyed = true; this.dispatchLocalEvent({ type: "destroyed" }); } /** Add a local event listener against this BeanStub */ addEventListener(eventType, listener, async) { if (!this.localEventService) { this.localEventService = new LocalEventService(); } this.localEventService.addEventListener(eventType, listener, async); } /** Remove a local event listener from this BeanStub */ removeEventListener(eventType, listener, async) { this.localEventService?.removeEventListener(eventType, listener, async); } dispatchLocalEvent(event) { this.localEventService?.dispatchEvent(event); } addManagedElementListeners(object, handlers) { return this._setupListeners(object, handlers); } addManagedEventListeners(handlers) { return this._setupListeners(this.eventSvc, handlers); } addManagedListeners(object, handlers) { return this._setupListeners(object, handlers); } _setupListeners(object, handlers) { const destroyFuncs = []; for (const k of Object.keys(handlers)) { const handler = handlers[k]; if (handler) { destroyFuncs.push(this._setupListener(object, k, handler)); } } return destroyFuncs; } _setupListener(object, event, listener) { if (this.destroyed) { return () => null; } let destroyFunc; if (isAgEventEmitter(object)) { object.__addEventListener(event, listener); destroyFunc = () => { object.__removeEventListener(event, listener); return null; }; } else { const objIsEventService = isEventService(object); if (object instanceof HTMLElement) { _addSafePassiveEventListener(object, event, listener); } else if (objIsEventService) { object.addListener(event, listener); } else { object.addEventListener(event, listener); } destroyFunc = objIsEventService ? () => { object.removeListener(event, listener); return null; } : () => { object.removeEventListener(event, listener); return null; }; } this.destroyFunctions.push(destroyFunc); return () => { destroyFunc(); this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc); return null; }; } /** * Setup a managed property listener for the given property. * However, stores the destroy function in the beanStub so that if this bean * is a component the destroy function will be called when the component is destroyed * as opposed to being cleaned up only when the properties service is destroyed. */ setupPropertyListener(event, listener) { const { gos } = this; gos.addPropertyEventListener(event, listener); const destroyFunc = () => { gos.removePropertyEventListener(event, listener); return null; }; this.destroyFunctions.push(destroyFunc); return () => { destroyFunc(); this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc); return null; }; } /** * Setup a managed property listener for the given GridOption property. * @param event GridOption property to listen to changes for. * @param listener Listener to run when property value changes */ addManagedPropertyListener(event, listener) { if (this.destroyed) { return () => null; } return this.setupPropertyListener(event, listener); } /** * Setup managed property listeners for the given set of GridOption properties. * The listener will be run if any of the property changes but will only run once if * multiple of the properties change within the same framework lifecycle event. * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired. * @param events Array of GridOption properties to listen for changes too. * @param listener Shared listener to run if any of the properties change */ addManagedPropertyListeners(events, listener) { if (this.destroyed) { return; } const eventsKey = events.join("-") + this.propertyListenerId++; const wrappedListener = (event) => { if (event.changeSet) { if (event.changeSet && event.changeSet.id === this.lastChangeSetIdLookup[eventsKey]) { return; } this.lastChangeSetIdLookup[eventsKey] = event.changeSet.id; } const propertiesChangeEvent = { type: "propertyChanged", changeSet: event.changeSet, source: event.source }; listener(propertiesChangeEvent); }; for (const event of events) { this.setupPropertyListener(event, wrappedListener); } } getLocaleTextFunc() { return _getLocaleTextFunc(this.beans.localeSvc); } addDestroyFunc(func) { if (this.isAlive()) { this.destroyFunctions.push(func); } else { func(); } } /** doesn't throw an error if `bean` is undefined */ createOptionalManagedBean(bean, context) { return bean ? this.createManagedBean(bean, context) : void 0; } createManagedBean(bean, context) { const res = this.createBean(bean, context); this.addDestroyFunc(this.destroyBean.bind(this, bean, context)); return res; } createBean(bean, context, afterPreCreateCallback) { return (context || this.stubContext).createBean(bean, afterPreCreateCallback); } /** * Destroys a bean and returns undefined to support destruction and clean up in a single line. * this.dateComp = this.context.destroyBean(this.dateComp); */ destroyBean(bean, context) { return (context || this.stubContext).destroyBean(bean); } /** * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line. * this.dateComps = this.context.destroyBeans(this.dateComps); */ destroyBeans(beans, context) { return (context || this.stubContext).destroyBeans(beans); } }; function isAgEventEmitter(object) { return object.__addEventListener !== void 0; } function isEventService(object) { return object.eventServiceType === "global"; } var BeanStub = class extends AgBeanStub { }; var doOnceSet = /* @__PURE__ */ new Set(); var _doOnce = (func, key) => { if (!doOnceSet.has(key)) { doOnceSet.add(key); func(); } }; _doOnce._set = doOnceSet; var batchedCallsSetTimeout = { pending: false, funcs: [] }; var batchedCallsRaf = { pending: false, funcs: [] }; function _batchCall(func, mode = "setTimeout", beans) { const batch = mode === "raf" ? batchedCallsRaf : batchedCallsSetTimeout; batch.funcs.push(func); if (batch.pending) { return; } batch.pending = true; const runBatch = () => { const funcsCopy = batch.funcs.slice(); batch.funcs.length = 0; batch.pending = false; for (const func2 of funcsCopy) { func2(); } }; if (mode === "raf") { _requestAnimationFrame(beans, runBatch); } else { window.setTimeout(runBatch, 0); } } function _debounce(bean, func, delay) { let timeout; return function(...args) { const context = this; window.clearTimeout(timeout); timeout = window.setTimeout(function() { if (bean.isAlive()) { func.apply(context, args); } }, delay); return timeout; }; } function _throttle(func, wait) { let previousCall = 0; return function(...args) { const context = this; const currentCall = Date.now(); if (currentCall - previousCall < wait) { return; } previousCall = currentCall; func.apply(context, args); }; } function _waitUntil(bean, condition, callback, timeout = 100) { const timeStamp = Date.now(); let interval = null; let executed = false; const clearWait = () => { if (interval != null) { window.clearInterval(interval); interval = null; } }; bean.addDestroyFunc(clearWait); const internalCallback = () => { const reachedTimeout = Date.now() - timeStamp > timeout; if (condition() || reachedTimeout) { callback(); executed = true; clearWait(); } }; internalCallback(); if (!executed) { interval = window.setInterval(internalCallback, 10); } } var SKIP_JS_BUILTINS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); function _iterateObject(object, callback) { if (object == null) { return; } if (Array.isArray(object)) { for (let i = 0; i < object.length; i++) { callback(i.toString(), object[i]); } return; } for (const key of Object.keys(object).filter((key2) => !SKIP_JS_BUILTINS.has(key2))) { callback(key, object[key]); } } function _mergeDeep(dest, source, copyUndefined = true, makeCopyOfSimpleObjects = false) { if (!_exists(source)) { return; } _iterateObject(source, (key, sourceValue) => { let destValue = dest[key]; if (destValue === sourceValue) { return; } if (makeCopyOfSimpleObjects) { const objectIsDueToBeCopied = destValue == null && sourceValue != null; if (objectIsDueToBeCopied) { const doNotCopyAsSourceIsSimpleObject = typeof sourceValue === "object" && sourceValue.constructor === Object; if (doNotCopyAsSourceIsSimpleObject) { destValue = {}; dest[key] = destValue; } } } if (_isNonNullObject(sourceValue) && _isNonNullObject(destValue) && !Array.isArray(destValue)) { _mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects); } else if (copyUndefined || sourceValue !== void 0) { dest[key] = sourceValue; } }); } function _isNonNullObject(value) { return typeof value === "object" && value !== null; } var _GlobalGridOptions = class _GlobalGridOptions2 { /** * @param providedOptions * @returns Shallow copy of the provided options with global options merged in. */ static applyGlobalGridOptions(providedOptions) { if (!_GlobalGridOptions2.gridOptions) { return { ...providedOptions }; } let mergedGridOps = {}; _mergeDeep(mergedGridOps, _GlobalGridOptions2.gridOptions, true, true); if (_GlobalGridOptions2.mergeStrategy === "deep") { _mergeDeep(mergedGridOps, providedOptions, true, true); } else { mergedGridOps = { ...mergedGridOps, ...providedOptions }; } if (_GlobalGridOptions2.gridOptions.context) { mergedGridOps.context = _GlobalGridOptions2.gridOptions.context; } if (providedOptions.context) { if (_GlobalGridOptions2.mergeStrategy === "deep" && mergedGridOps.context) { _mergeDeep(providedOptions.context, mergedGridOps.context, true, true); } mergedGridOps.context = providedOptions.context; } return mergedGridOps; } /** * Apply global grid option for a specific option key. * If the merge strategy is 'deep' and both global and provided values are objects, they will be merged deeply. * Otherwise, the provided value is returned as is. * @param optionKey - The key of the grid option to apply. * @param providedValue - The value provided to the grid instance. * @returns The merged value if applicable, otherwise the provided value. */ static applyGlobalGridOption(optionKey, providedValue) { if (_GlobalGridOptions2.mergeStrategy === "deep") { const globalValue = _getGlobalGridOption(optionKey); if (globalValue && typeof globalValue === "object" && typeof providedValue === "object") { return _GlobalGridOptions2.applyGlobalGridOptions({ [optionKey]: providedValue })[optionKey]; } } return providedValue; } }; _GlobalGridOptions.gridOptions = void 0; _GlobalGridOptions.mergeStrategy = "shallow"; var GlobalGridOptions = _GlobalGridOptions; function provideGlobalGridOptions(gridOptions, mergeStrategy = "shallow") { GlobalGridOptions.gridOptions = gridOptions; GlobalGridOptions.mergeStrategy = mergeStrategy; } function _getGlobalGridOption(gridOption) { return GlobalGridOptions.gridOptions?.[gridOption]; } var GRID_OPTION_DEFAULTS = { suppressContextMenu: false, preventDefaultOnContextMenu: false, allowContextMenuWithControlKey: false, suppressMenuHide: true, enableBrowserTooltips: false, tooltipTrigger: "hover", tooltipShowDelay: 2e3, tooltipSwitchShowDelay: 200, tooltipHideDelay: 1e4, tooltipMouseTrack: false, tooltipShowMode: "standard", tooltipInteraction: false, copyHeadersToClipboard: false, copyGroupHeadersToClipboard: false, clipboardDelimiter: " ", suppressCopyRowsToClipboard: false, suppressCopySingleCellRanges: false, suppressLastEmptyLineOnPaste: false, suppressClipboardPaste: false, suppressClipboardApi: false, suppressCutToClipboard: false, maintainColumnOrder: false, enableStrictPivotColumnOrder: false, suppressFieldDotNotation: false, allowDragFromColumnsToolPanel: false, suppressMovableColumns: false, suppressColumnMoveAnimation: false, suppressMoveWhenColumnDragging: false, suppressDragLeaveHidesColumns: false, suppressRowGroupHidesColumns: false, suppressAutoSize: false, autoSizePadding: 20, skipHeaderOnAutoSize: false, singleClickEdit: false, suppressClickEdit: false, readOnlyEdit: false, stopEditingWhenCellsLoseFocus: false, enterNavigatesVertically: false, enterNavigatesVerticallyAfterEdit: false, enableCellEditingOnBackspace: false, undoRedoCellEditing: false, undoRedoCellEditingLimit: 10, suppressCsvExport: false, suppressExcelExport: false, cacheQuickFilter: false, includeHiddenColumnsInQuickFilter: false, excludeChildrenWhenTreeDataFiltering: false, enableAdvancedFilter: false, includeHiddenColumnsInAdvancedFilter: false, enableCharts: false, masterDetail: false, keepDetailRows: false, keepDetailRowsCount: 10, detailRowAutoHeight: false, tabIndex: 0, rowBuffer: 10, valueCache: false, valueCacheNeverExpires: false, enableCellExpressions: false, suppressTouch: false, suppressFocusAfterRefresh: false, suppressBrowserResizeObserver: false, suppressPropertyNamesCheck: false, suppressChangeDetection: false, debug: false, suppressLoadingOverlay: false, suppressNoRowsOverlay: false, pagination: false, paginationPageSize: 100, paginationPageSizeSelector: true, paginationAutoPageSize: false, paginateChildRows: false, suppressPaginationPanel: false, pivotMode: false, pivotPanelShow: "never", pivotDefaultExpanded: 0, pivotSuppressAutoColumn: false, suppressExpandablePivotGroups: false, functionsReadOnly: false, suppressAggFuncInHeader: false, alwaysAggregateAtRootLevel: false, aggregateOnlyChangedColumns: false, suppressAggFilteredOnly: false, removePivotHeaderRowWhenSingleValueColumn: false, animateRows: true, cellFlashDuration: 500, cellFadeDuration: 1e3, allowShowChangeAfterFilter: false, domLayout: "normal", ensureDomOrder: false, enableRtl: false, suppressColumnVirtualisation: false, suppressMaxRenderedRowRestriction: false, suppressRowVirtualisation: false, rowDragManaged: false, refreshAfterGroupEdit: false, rowDragInsertDelay: 500, suppressRowDrag: false, suppressMoveWhenRowDragging: false, rowDragEntireRow: false, rowDragMultiRow: false, embedFullWidthRows: false, groupDisplayType: "singleColumn", groupDefaultExpanded: 0, groupMaintainOrder: false, groupSelectsChildren: false, groupSuppressBlankHeader: false, groupSelectsFiltered: false, showOpenedGroup: false, groupRemoveSingleChildren: false, groupRemoveLowestSingleChildren: false, groupHideOpenParents: false, groupHideColumnsUntilExpanded: false, groupAllowUnbalanced: false, rowGroupPanelShow: "never", suppressMakeColumnVisibleAfterUnGroup: false, treeData: false, rowGroupPanelSuppressSort: false, suppressGroupRowsSticky: false, rowModelType: "clientSide", asyncTransactionWaitMillis: 50, suppressModelUpdateAfterUpdateTransaction: false, cacheOverflowSize: 1, infiniteInitialRowCount: 1, serverSideInitialRowCount: 1, cacheBlockSize: 100, maxBlocksInCache: -1, maxConcurrentDatasourceRequests: 2, blockLoadDebounceMillis: 0, purgeClosedRowNodes: false, serverSideSortAllLevels: false, serverSideOnlyRefreshFilteredGroups: false, serverSidePivotResultFieldSeparator: "_", viewportRowModelPageSize: 5, viewportRowModelBufferSize: 5, alwaysShowHorizontalScroll: false, alwaysShowVerticalScroll: false, debounceVerticalScrollbar: false, suppressHorizontalScroll: false, suppressScrollOnNewData: false, suppressScrollWhenPopupsAreOpen: false, suppressAnimationFrame: false, suppressMiddleClickScrolls: false, suppressPreventDefaultOnMouseWheel: false, rowMultiSelectWithClick: false, suppressRowDeselection: false, suppressRowClickSelection: false, suppressCellFocus: false, suppressHeaderFocus: false, suppressMultiRangeSelection: false, enableCellTextSelection: false, enableRangeSelection: false, enableRangeHandle: false, enableFillHandle: false, fillHandleDirection: "xy", suppressClearOnFillReduction: false, accentedSort: false, unSortIcon: false, suppressMultiSort: false, alwaysMultiSort: false, suppressMaintainUnsortedOrder: false, suppressRowHoverHighlight: false, suppressRowTransform: false, columnHoverHighlight: false, deltaSort: false, enableGroupEdit: false, groupLockGroupColumns: 0, serverSideEnableClientSideSort: false, suppressServerSideFullWidthLoadingRow: false, pivotMaxGeneratedColumns: -1, columnMenu: "new", reactiveCustomComponents: true, suppressSetFilterByDefault: false, enableFilterHandlers: false }; var BASE_URL = "https://www.ag-grid.com"; function _logIfDebug(gos, message, ...args) { if (gos.get("debug")) { console.log("AG Grid: " + message, ...args); } } function _warnOnce(msg, ...args) { _doOnce(() => _consoleWarn(msg, ...args), msg + args?.join("")); } function _errorOnce(msg, ...args) { _doOnce(() => _consoleError(msg, ...args), msg + args?.join("")); } function _consoleError(msg, ...args) { console.error("AG Grid: " + msg, ...args); } function _consoleWarn(msg, ...args) { console.warn("AG Grid: " + msg, ...args); } var allRegisteredModules = /* @__PURE__ */ new Set(); var globalModulesMap = {}; var gridModulesMap = {}; var currentModuleVersion; var userHasRegistered = false; var areGridScopedModules = false; var isUmd = false; function isValidModuleVersion(module2) { const [moduleMajor, moduleMinor] = module2.version.split(".") || []; const [currentModuleMajor, currentModuleMinor] = currentModuleVersion.split(".") || []; return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor; } function runVersionChecks(module2) { if (!currentModuleVersion) { currentModuleVersion = module2.version; } const errorMsg = (details) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${details} Please update all modules to the same version.`; if (!module2.version) { _errorOnce(errorMsg(`'${module2.moduleName}' is incompatible.`)); } else if (!isValidModuleVersion(module2)) { _errorOnce( errorMsg( `'${module2.moduleName}' is version ${module2.version} but the other modules are version ${currentModuleVersion}.` ) ); } const result = module2.validate?.(); if (result && !result.isValid) { _errorOnce(`${result.message}`); } } function _registerModule(module2, gridId, isInternalRegistration = false) { if (!isInternalRegistration) { userHasRegistered = true; } runVersionChecks(module2); const rowModels = module2.rowModels ?? ["all"]; allRegisteredModules.add(module2); let moduleStore; if (gridId !== void 0) { areGridScopedModules = true; if (gridModulesMap[gridId] === void 0) { gridModulesMap[gridId] = {}; } moduleStore = gridModulesMap[gridId]; } else { moduleStore = globalModulesMap; } for (const rowModel of rowModels) { if (moduleStore[rowModel] === void 0) { moduleStore[rowModel] = {}; } moduleStore[rowModel][module2.moduleName] = module2; } if (module2.dependsOn) { for (const dependency of module2.dependsOn) { _registerModule(dependency, gridId, isInternalRegistration); } } } function _unRegisterGridModules(gridId) { delete gridModulesMap[gridId]; } function _isModuleRegistered(moduleName4, gridId, rowModel) { const isRegisteredForRowModel = (model) => !!globalModulesMap[model]?.[moduleName4] || !!gridModulesMap[gridId]?.[model]?.[moduleName4]; return isRegisteredForRowModel(rowModel) || isRegisteredForRowModel("all"); } function _areModulesGridScoped() { return areGridScopedModules; } function _getRegisteredModules(gridId, rowModel) { const gridModules = gridModulesMap[gridId] ?? {}; return [ ...Object.values(globalModulesMap["all"] ?? {}), ...Object.values(gridModules["all"] ?? {}), ...Object.values(globalModulesMap[rowModel] ?? {}), ...Object.values(gridModules[rowModel] ?? {}) ]; } function _getAllRegisteredModules() { return new Set(allRegisteredModules); } function _getGridRegisteredModules(gridId, rowModel) { const gridModules = gridModulesMap[gridId] ?? {}; return [...Object.values(gridModules["all"] ?? {}), ...Object.values(gridModules[rowModel] ?? {})]; } function _hasUserRegistered() { return userHasRegistered; } function _isUmd() { return isUmd; } function _setUmd() { isUmd = true; } var ModuleRegistry = class { /** * @deprecated v33 Use `registerModules([module])` instead. */ static register(module2) { _registerModule(module2, void 0); } /** * Globally register the given modules for all grids. * @param modules - modules to register */ static registerModules(modules) { for (const module2 of modules) { _registerModule(module2, void 0); } } }; function _findEnterpriseCoreModule(modules) { for (const module2 of modules) { if ("setLicenseKey" in module2) { return module2; } if (module2.dependsOn) { const found = _findEnterpriseCoreModule(module2.dependsOn); if (found) { return found; } } } return void 0; } var VERSION = "35.2.1"; var MAX_URL_LENGTH = 2e3; var MIN_PARAM_LENGTH = 100; var VERSION_PARAM_NAME = "_version_"; var getConsoleMessage = null; var baseDocLink = `${BASE_URL}/javascript-data-grid`; function provideValidationServiceLogger(logger) { getConsoleMessage = logger; } function setValidationDocLink(docLink) { baseDocLink = docLink; } function getErrorParts(id, args, defaultMessage) { return getConsoleMessage?.(id, args) ?? [minifiedLog(id, args, defaultMessage)]; } function getMsgOrDefault(logger, id, args, isWarning, defaultMessage) { logger(`${isWarning ? "warning" : "error"} #${id}`, ...getErrorParts(id, args, defaultMessage)); } function stringifyObject(inputObj) { if (!inputObj) { return String(inputObj); } const object = {}; for (const prop of Object.keys(inputObj)) { if (typeof inputObj[prop] !== "object" && typeof inputObj[prop] !== "function") { object[prop] = inputObj[prop]; } } return JSON.stringify(object); } function stringifyValue(value) { let output = value; if (value instanceof Error) { output = value.toString(); } else if (typeof value === "object") { output = stringifyObject(value); } return output; } function toStringWithNullUndefined(str) { return str === void 0 ? "undefined" : str === null ? "null" : str; } function getParamsUrl(baseUrl, params) { return `${baseUrl}?${params.toString()}`; } function truncateUrl(baseUrl, params, maxLength) { const sortedParams = Array.from(params.entries()).sort((a, b) => b[1].length - a[1].length); let url = getParamsUrl(baseUrl, params); for (const [key, value] of sortedParams) { if (key === VERSION_PARAM_NAME) { continue; } const excessLength = url.length - maxLength; if (excessLength <= 0) { break; } const ellipse = "..."; const truncateAmount = excessLength + ellipse.length; const truncatedValue = value.length - truncateAmount > MIN_PARAM_LENGTH ? value.slice(0, value.length - truncateAmount) + ellipse : value.slice(0, MIN_PARAM_LENGTH) + ellipse; params.set(key, truncatedValue); url = getParamsUrl(baseUrl, params); } return url; } function getErrorLink(errorNum, args) { const params = new URLSearchParams(); params.append(VERSION_PARAM_NAME, VERSION); if (args) { for (const key of Object.keys(args)) { params.append(key, stringifyValue(args[key])); } } const baseUrl = `${baseDocLink}/errors/${errorNum}`; const url = getParamsUrl(baseUrl, params); return url.length <= MAX_URL_LENGTH ? url : truncateUrl(baseUrl, params, MAX_URL_LENGTH); } var minifiedLog = (errorNum, args, defaultMessage) => { const errorLink = getErrorLink(errorNum, args); const prefix = `${defaultMessage ? defaultMessage + " \n" : ""}Visit ${errorLink}`; if (_isUmd()) { return prefix; } return `${prefix}${defaultMessage ? "" : " \n Alternatively register the ValidationModule to see the full message in the console."}`; }; function _warn(...args) { getMsgOrDefault(_warnOnce, args[0], args[1], true); } function _error(...args) { getMsgOrDefault(_errorOnce, args[0], args[1], false); } function _logPreInitErr(id, args, defaultMessage) { getMsgOrDefault(_errorOnce, id, args, false, defaultMessage); } function _logPreInitWarn(id, args, defaultMessage) { getMsgOrDefault(_warnOnce, id, args, true, defaultMessage); } function getErrMsg(defaultMessage, args) { const id = args[0]; return `error #${id} ` + getErrorParts(id, args[1], defaultMessage).join(" "); } function _errMsg(...args) { return getErrMsg(void 0, args); } function _preInitErrMsg(...args) { return getErrMsg("\n", args); } function isRowModelType(gos, rowModelType) { return gos.get("rowModelType") === rowModelType; } function _isClientSideRowModel(gos, rowModel) { return isRowModelType(gos, "clientSide"); } function _isServerSideRowModel(gos, rowModel) { return isRowModelType(gos, "serverSide"); } function _isDomLayout(gos, domLayout) { return gos.get("domLayout") === domLayout; } function _isRowSelection(gos) { return _getRowSelectionMode(gos) !== void 0; } function _isGetRowHeightFunction(gos) { return typeof gos.get("getRowHeight") === "function"; } function _shouldMaintainColumnOrder(gos, isPivotColumns) { if (isPivotColumns) { return !gos.get("enableStrictPivotColumnOrder"); } return gos.get("maintainColumnOrder"); } function _isRowNumbers({ gos, formula }) { const rowNumbers = gos.get("rowNumbers"); return rowNumbers || !!formula?.active && rowNumbers !== false; } function _getRowHeightForNode(beans, rowNode, allowEstimate = false, defaultRowHeight) { const { gos, environment } = beans; if (defaultRowHeight == null) { defaultRowHeight = environment.getDefaultRowHeight(); } if (_isGetRowHeightFunction(gos)) { if (allowEstimate) { return { height: defaultRowHeight, estimated: true }; } const params = { node: rowNode, data: rowNode.data }; const height = gos.getCallback("getRowHeight")(params); if (isNumeric(height)) { if (height === 0) { _warn(23); } return { height: Math.max(1, height), estimated: false }; } } if (rowNode.detail && gos.get("masterDetail")) { return getMasterDetailRowHeight(gos); } const gridOptionsRowHeight = gos.get("rowHeight"); const rowHeight = gridOptionsRowHeight && isNumeric(gridOptionsRowHeight) ? gridOptionsRowHeight : defaultRowHeight; return { height: rowHeight, estimated: false }; } function getMasterDetailRowHeight(gos) { if (gos.get("detailRowAutoHeight")) { return { height: 1, estimated: false }; } const defaultRowHeight = gos.get("detailRowHeight"); if (isNumeric(defaultRowHeight)) { return { height: defaultRowHeight, estimated: false }; } return { height: 300, estimated: false }; } function _getRowHeightAsNumber(beans) { const { environment, gos } = beans; const gridOptionsRowHeight = gos.get("rowHeight"); if (!gridOptionsRowHeight || _missing(gridOptionsRowHeight)) { return environment.getDefaultRowHeight(); } const rowHeight = environment.refreshRowHeightVariable(); if (rowHeight !== -1) { return rowHeight; } _warn(24); return environment.getDefaultRowHeight(); } function isNumeric(value) { return !isNaN(value) && typeof value === "number" && isFinite(value); } function _getDomData(gos, element, key) { const domData = element[gos.getDomDataKey()]; return domData ? domData[key] : void 0; } function _setDomData(gos, element, key, value) { const domDataKey = gos.getDomDataKey(); let domData = element[domDataKey]; if (_missing(domData)) { domData = {}; element[domDataKey] = domData; } domData[key] = value; } function _isAnimateRows(gos) { if (gos.get("ensureDomOrder")) { return false; } return gos.get("animateRows"); } function _isGroupRowsSticky(gos) { return !(gos.get("paginateChildRows") || gos.get("groupHideOpenParents") || _isDomLayout(gos, "print")); } function _isColumnsSortingCoupledToGroup(gos) { const autoGroupColumnDef = gos.get("autoGroupColumnDef"); return !autoGroupColumnDef?.comparator && !gos.get("treeData"); } function _getGroupAggFiltering(gos) { const userValue = gos.get("groupAggFiltering"); if (typeof userValue === "function") { return gos.getCallback("groupAggFiltering"); } if (userValue === true) { return () => true; } return void 0; } function _getGrandTotalRow(gos) { return gos.get("grandTotalRow"); } function _getGroupTotalRowCallback(gos) { const userValue = gos.get("groupTotalRow"); if (typeof userValue === "function") { return gos.getCallback("groupTotalRow"); } return () => userValue ?? void 0; } function _isGroupMultiAutoColumn(gos) { const isHideOpenParents = !!gos.get("groupHideOpenParents"); if (isHideOpenParents) { return true; } return gos.get("groupDisplayType") === "multipleColumns"; } function _isGroupHideColumnsUntilExpanded(gos) { return _isGroupMultiAutoColumn(gos) && gos.get("groupHideColumnsUntilExpanded") && _isClientSideRowModel(gos); } function _isGroupUseEntireRow(gos, pivotMode) { if (pivotMode) { return false; } return gos.get("groupDisplayType") === "groupRows"; } function _isFullWidthGroupRow(gos, node, pivotMode) { return !!node.group && !node.footer && _isGroupUseEntireRow(gos, pivotMode); } function _getRowIdCallback(gos) { const getRowId = gos.getCallback("getRowId"); if (getRowId === void 0) { return getRowId; } return (params) => { let id = getRowId(params); if (typeof id !== "string") { _doOnce(() => _warn(25, { id }), "getRowIdString"); id = String(id); } return id; }; } function _canSkipShowingRowGroup(gos, node) { const isSkippingGroups = gos.get("groupHideParentOfSingleChild"); if (isSkippingGroups === true) { return true; } if (isSkippingGroups === "leafGroupsOnly" && node.leafGroup) { return true; } if (gos.get("groupRemoveSingleChildren")) { return true; } if (gos.get("groupRemoveLowestSingleChildren") && node.leafGroup) { return true; } return false; } function _getMaxConcurrentDatasourceRequests(gos) { const res = gos.get("maxConcurrentDatasourceRequests"); return res > 0 ? res : void 0; } function _shouldUpdateColVisibilityAfterGroup(gos, isGrouped) { const preventVisibilityChanges = gos.get("suppressGroupChangesColumnVisibility"); if (preventVisibilityChanges === true) { return false; } if (isGrouped && preventVisibilityChanges === "suppressHideOnGroup") { return false; } if (!isGrouped && preventVisibilityChanges === "suppressShowOnUngroup") { return false; } const legacySuppressOnGroup = gos.get("suppressRowGroupHidesColumns"); if (isGrouped && legacySuppressOnGroup === true) { return false; } const legacySuppressOnUngroup = gos.get("suppressMakeColumnVisibleAfterUnGroup"); if (!isGrouped && legacySuppressOnUngroup === true) { return false; } return true; } function _getCheckboxes(selection) { return selection?.checkboxes ?? true; } function _getHeaderCheckbox(selection) { return selection?.mode === "multiRow" && (selection.headerCheckbox ?? true); } function _getCheckboxLocation(rowSelection) { if (typeof rowSelection !== "object") { return void 0; } return rowSelection.checkboxLocation ?? "selectionColumn"; } function _getHideDisabledCheckboxes(selection) { return selection?.hideDisabledCheckboxes ?? false; } function _isUsingNewRowSelectionAPI(gos) { const rowSelection = gos.get("rowSelection"); return typeof rowSelection !== "string"; } function _isUsingNewCellSelectionAPI(gos) { return gos.get("cellSelection") !== void 0; } function _getSuppressMultiRanges(gos) { const selection = gos.get("cellSelection"); const useNewAPI = selection !== void 0; if (!useNewAPI) { return gos.get("suppressMultiRangeSelection"); } return typeof selection !== "boolean" ? selection?.suppressMultiRanges ?? false : false; } function _isCellSelectionEnabled(gos) { const selection = gos.get("cellSelection"); const useNewAPI = selection !== void 0; return useNewAPI ? !!selection : gos.get("enableRangeSelection"); } function _getFillHandle(gos) { const selection = gos.get("cellSelection"); const useNewAPI = selection !== void 0; if (!useNewAPI) { return { mode: "fill", setFillValue: gos.get("fillOperation"), direction: gos.get("fillHandleDirection"), suppressClearOnFillReduction: gos.get("suppressClearOnFillReduction") }; } return typeof selection !== "boolean" && selection.handle?.mode === "fill" ? selection.handle : void 0; } function _getEnableColumnSelection(gos) { const cellSelection = gos.get("cellSelection") ?? false; return (typeof cellSelection === "object" && cellSelection.enableColumnSelection) ?? false; } function _getEnableClickSelection(gos) { const selection = gos.get("rowSelection") ?? "single"; if (typeof selection === "string") { const suppressRowClickSelection = gos.get("suppressRowClickSelection"); const suppressRowDeselection = gos.get("suppressRowDeselection"); if (suppressRowClickSelection && suppressRowDeselection) { return false; } else if (suppressRowClickSelection) { return "enableDeselection"; } else if (suppressRowDeselection) { return "enableSelection"; } else { return true; } } return selection.mode === "singleRow" || selection.mode === "multiRow" ? selection.enableClickSelection ?? false : false; } function _getEnableSelection(gos) { const enableClickSelection = _getEnableClickSelection(gos); return enableClickSelection === true || enableClickSelection === "enableSelection"; } function _getEnableDeselection(gos) { const enableClickSelection = _getEnableClickSelection(gos); return enableClickSelection === true || enableClickSelection === "enableDeselection"; } function _getIsRowSelectable(gos) { const selection = gos.get("rowSelection"); if (typeof selection === "string") { return gos.get("isRowSelectable"); } return selection?.isRowSelectable; } function _getRowSelectionMode(arg) { const selection = "beanName" in arg && arg.beanName === "gos" ? arg.get("rowSelection") : arg.rowSelection; if (typeof selection === "string") { switch (selection) { case "multiple": return "multiRow"; case "single": return "singleRow"; default: return; } } switch (selection?.mode) { case "multiRow": case "singleRow": return selection.mode; default: return; } } function _isMultiRowSelection(arg) { const mode = _getRowSelectionMode(arg); return mode === "multiRow"; } function _getEnableSelectionWithoutKeys(gos) { const selection = gos.get("rowSelection"); if (typeof selection === "string") { return gos.get("rowMultiSelectWithClick"); } return selection?.enableSelectionWithoutKeys ?? false; } function _getGroupSelection(gos) { const selection = gos.get("rowSelection"); if (typeof selection === "string") { const groupSelectsChildren = gos.get("groupSelectsChildren"); const groupSelectsFiltered = gos.get("groupSelectsFiltered"); if (groupSelectsChildren && groupSelectsFiltered) { return "filteredDescendants"; } else if (groupSelectsChildren) { return "descendants"; } else { return "self"; } } return selection?.mode === "multiRow" ? selection.groupSelects : void 0; } function _getSelectAll(gos, defaultValue = true) { const rowSelection = gos.get("rowSelection"); if (typeof rowSelection !== "object") { return defaultValue ? "all" : void 0; } return rowSelection.mode === "multiRow" ? rowSelection.selectAll : "all"; } function _getCtrlASelectsRows(gos) { const rowSelection = gos.get("rowSelection"); if (typeof rowSelection === "string") { return false; } return rowSelection?.mode === "multiRow" ? rowSelection.ctrlASelectsRows ?? false : false; } function _getGroupSelectsDescendants(gos) { const groupSelection = _getGroupSelection(gos); return groupSelection === "descendants" || groupSelection === "filteredDescendants"; } function _getMasterSelects(gos) { const rowSelection = gos.get("rowSelection"); return typeof rowSelection === "object" && rowSelection.masterSelects || "self"; } function _isSetFilterByDefault(gos) { return gos.isModuleRegistered("SetFilter") && !gos.get("suppressSetFilterByDefault"); } function _isLegacyMenuEnabled(gos) { return gos.get("columnMenu") === "legacy"; } function _isColumnMenuAnchoringEnabled(gos) { return !_isLegacyMenuEnabled(gos); } function _getCallbackForEvent(eventName) { if (!eventName || eventName.length < 2) { return eventName; } return "on" + eventName[0].toUpperCase() + eventName.substring(1); } function _combineAttributesAndGridOptions(gridOptions, component, gridOptionsKeys) { if (typeof gridOptions !== "object") { gridOptions = {}; } const mergedOptions = { ...gridOptions }; for (const key of gridOptionsKeys) { const value = component[key]; if (typeof value !== "undefined") { mergedOptions[key] = value; } } return mergedOptions; } function _processOnChange(changes, api) { if (!changes) { return; } const gridChanges = {}; let hasChanges = false; for (const key of Object.keys(changes)) { gridChanges[key] = changes[key]; hasChanges = true; } if (!hasChanges) { return; } const internalUpdateEvent = { type: "gridOptionsChanged", options: gridChanges }; api.dispatchEvent(internalUpdateEvent); const event = { type: "componentStateChanged", ...gridChanges }; api.dispatchEvent(event); } function _addGridCommonParams(gos, params) { return gos.addCommon(params); } function _getGridOption(providedGridOptions, gridOption) { return providedGridOptions[gridOption] ?? providedGridOptions[`gridOptions`]?.[gridOption] ?? _getGlobalGridOption(gridOption) ?? GRID_OPTION_DEFAULTS[gridOption]; } function _interpretAsRightClick({ gos }, event) { return event.button === 2 || event.ctrlKey && gos.get("allowContextMenuWithControlKey"); } var COL_DEF_DEFAULTS = { resizable: true, sortable: true }; var instanceIdSequence = 0; function getNextColInstanceId() { return instanceIdSequence++; } function isColumn(col) { return col instanceof AgColumn; } var DEFAULT_SORTING_ORDER = ["asc", "desc", null]; var DEFAULT_ABSOLUTE_SORTING_ORDER = [ { type: "absolute", direction: "asc" }, { type: "absolute", direction: "desc" }, null ]; var AgColumn = class extends BeanStub { constructor(colDef, userProvidedColDef, colId, primary) { super(); this.colDef = colDef; this.userProvidedColDef = userProvidedColDef; this.colId = colId; this.primary = primary; this.isColumn = true; this.instanceId = getNextColInstanceId(); this.autoHeaderHeight = null; this.sortDef = _getSortDefFromInput(); this._wasSortExplicitlyRemoved = false; this.moving = false; this.resizing = false; this.menuVisible = false; this.formulaRef = null; this.lastLeftPinned = false; this.firstRightPinned = false; this.filterActive = false; this.colEventSvc = new LocalEventService(); this.tooltipEnabled = false; this.rowGroupActive = false; this.pivotActive = false; this.aggregationActive = false; this.flex = null; this.colIdSanitised = _escapeString(colId); } destroy() { super.destroy(); this.beans.rowSpanSvc?.deregister(this); } getInstanceId() { return this.instanceId; } initState() { const { colDef, beans: { sortSvc, pinnedCols, colFlex } } = this; sortSvc?.initCol(this); const hide = colDef.hide; if (hide !== void 0) { this.visible = !hide; } else { this.visible = !colDef.initialHide; } pinnedCols?.initCol(this); colFlex?.initCol(this); } // gets called when user provides an alternative colDef, eg setColDef(colDef, userProvidedColDef, source) { const colSpanChanged = colDef.spanRows !== this.colDef.spanRows; this.colDef = colDef; this.userProvidedColDef = userProvidedColDef; this.initMinAndMaxWidths(); this.initDotNotation(); this.initTooltip(); if (colSpanChanged) { this.beans.rowSpanSvc?.deregister(this); this.initRowSpan(); } this.dispatchColEvent("colDefChanged", source); } getUserProvidedColDef() { return this.userProvidedColDef; } getParent() { return this.parent; } getOriginalParent() { return this.originalParent; } // this is done after constructor as it uses gridOptionsService postConstruct() { this.initState(); this.initMinAndMaxWidths(); this.resetActualWidth("gridInitializing"); this.initDotNotation(); this.initTooltip(); this.initRowSpan(); this.addPivotListener(); } initDotNotation() { const { gos, colDef: { field, tooltipField } } = this; const suppressDotNotation = gos.get("suppressFieldDotNotation"); this.fieldContainsDots = _exists(field) && field.includes(".") && !suppressDotNotation; this.tooltipFieldContainsDots = _exists(tooltipField) && tooltipField.includes(".") && !suppressDotNotation; } initMinAndMaxWidths() { const colDef = this.colDef; this.minWidth = colDef.minWidth ?? this.beans.environment.getDefaultColumnMinWidth(); this.maxWidth = colDef.maxWidth ?? Number.MAX_SAFE_INTEGER; } initTooltip() { this.beans.tooltipSvc?.initCol(this); } initRowSpan() { if (this.colDef.spanRows) { this.beans.rowSpanSvc?.register(this); } } addPivotListener() { const pivotColDefSvc = this.beans.pivotColDefSvc; const pivotValueColumn = this.colDef.pivotValueColumn; if (!pivotColDefSvc || !pivotValueColumn) { return; } this.addManagedListeners(pivotValueColumn, { colDefChanged: (evt) => { const colDef = pivotColDefSvc.recreateColDef(this.colDef); this.setColDef(colDef, colDef, evt.source); } }); } resetActualWidth(source) { const initialWidth = this.calculateColInitialWidth(this.colDef); this.setActualWidth(initialWidth, source, true); } calculateColInitialWidth(colDef) { const width = colDef.width ?? colDef.initialWidth ?? 200; return Math.max(Math.min(width, this.maxWidth), this.minWidth); } isEmptyGroup() { return false; } isRowGroupDisplayed(colId) { return this.beans.showRowGroupCols?.isRowGroupDisplayed(this, colId) ?? false; } isPrimary() { return this.primary; } isFilterAllowed() { const filterDefined = !!this.colDef.filter; return filterDefined; } isFieldContainsDots() { return this.fieldContainsDots; } isTooltipEnabled() { return this.tooltipEnabled; } isTooltipFieldContainsDots() { return this.tooltipFieldContainsDots; } getHighlighted() { return this.highlighted; } __addEventListener(eventType, listener) { this.colEventSvc.addEventListener(eventType, listener); } __removeEventListener(eventType, listener) { this.colEventSvc.removeEventListener(eventType, listener); } /** * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods. */ addEventListener(eventType, userListener) { this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.( this.frameworkEventListenerService, this.colEventSvc ); const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener; this.colEventSvc.addEventListener(eventType, listener); } /** * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods. */ removeEventListener(eventType, userListener) { const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener; this.colEventSvc.removeEventListener(eventType, listener); } createColumnFunctionCallbackParams(rowNode) { return _addGridCommonParams(this.gos, { node: rowNode, data: rowNode.data, column: this, colDef: this.colDef }); } isSuppressNavigable(rowNode) { return this.beans.cellNavigation?.isSuppressNavigable(this, rowNode) ?? false; } isCellEditable(rowNode) { return this.beans.editSvc?.isCellEditable({ rowNode, column: this }) ?? false; } isSuppressFillHandle() { return !!this.colDef.suppressFillHandle; } isAutoHeight() { return !!this.colDef.autoHeight; } isAutoHeaderHeight() { return !!this.colDef.autoHeaderHeight; } isRowDrag(rowNode) { return this.isColumnFunc(rowNode, this.colDef.rowDrag); } isDndSource(rowNode) { return this.isColumnFunc(rowNode, this.colDef.dndSource); } isCellCheckboxSelection(rowNode) { return this.beans.selectionSvc?.isCellCheckboxSelection(this, rowNode) ?? false; } isSuppressPaste(rowNode) { return this.isColumnFunc(rowNode, this.colDef?.suppressPaste ?? null); } isResizable() { return !!this.getColDefValue("resizable"); } /** Get value from ColDef or default if it exists. */ getColDefValue(key) { return this.colDef[key] ?? COL_DEF_DEFAULTS[key]; } isColumnFunc(rowNode, value) { if (typeof value === "boolean") { return value; } if (typeof value === "function") { const params = this.createColumnFunctionCallbackParams(rowNode); const editableFunc = value; return editableFunc(params); } return false; } createColumnEvent(type, source) { return _addGridCommonParams(this.gos, { type, column: this, columns: [this], source }); } isMoving() { return this.moving; } getSort() { return this.sortDef.direction; } /** * Returns null if no sort direction applied */ getSortDef() { if (!this.sortDef.direction) { return null; } return this.sortDef; } getColDefAllowedSortTypes() { const res = []; const { sort, initialSort } = this.colDef; const colDefSortType = sort === null ? sort : _normalizeSortType(sort?.type); const colDefInitialSortType = initialSort === null ? initialSort : _normalizeSortType(initialSort?.type); if (colDefSortType) { res.push(colDefSortType); } if (colDefInitialSortType) { res.push(colDefInitialSortType); } return res; } getSortingOrder() { const defaultSortingOrder = this.getColDefAllowedSortTypes().includes("absolute") ? DEFAULT_ABSOLUTE_SORTING_ORDER : DEFAULT_SORTING_ORDER; return (this.colDef.sortingOrder ?? this.gos.get("sortingOrder") ?? defaultSortingOrder).map( (objOrDirection) => _getSortDefFromInput(objOrDirection) ); } getAvailableSortTypes() { const explicitSortTypesFromSortingOrder = this.getSortingOrder().reduce((acc, so) => { if (so.direction) { acc.push(so.type); } return acc; }, this.getColDefAllowedSortTypes()); return new Set(explicitSortTypesFromSortingOrder); } get wasSortExplicitlyRemoved() { return this._wasSortExplicitlyRemoved; } setSortDef(sortDef, initial = false) { if (!initial) { this._wasSortExplicitlyRemoved = !sortDef.direction; } this.sortDef = sortDef; } isSortable() { return !!this.getColDefValue("sortable"); } /** @deprecated v32 use col.getSort() === 'asc */ isSortAscending() { return this.getSort() === "asc"; } /** @deprecated v32 use col.getSort() === 'desc */ isSortDescending() { return this.getSort() === "desc"; } /** @deprecated v32 use col.getSort() === undefined */ isSortNone() { return _missing(this.getSort()); } /** @deprecated v32 use col.getSort() !== undefined */ isSorting() { return _exists(this.getSort()); } getSortIndex() { return this.sortIndex; } isMenuVisible() { return this.menuVisible; } getAggFunc() { return this.aggFunc; } getLeft() { return this.left; } getOldLeft() { return this.oldLeft; } getRight() { return this.left + this.actualWidth; } setLeft(left, source) { this.oldLeft = this.left; if (this.left !== left) { this.left = left; this.dispatchColEvent("leftChanged", source); } } isFilterActive() { return this.filterActive; } /** @deprecated v33 Use `api.isColumnHovered(column)` instead. */ isHovered() { _warn(261); return !!this.beans.colHover?.isHovered(this); } setFirstRightPinned(firstRightPinned, source) { if (this.firstRightPinned !== firstRightPinned) { this.firstRightPinned = firstRightPinned; this.dispatchColEvent("firstRightPinnedChanged", source); } } setLastLeftPinned(lastLeftPinned, source) { if (this.lastLeftPinned !== lastLeftPinned) { this.lastLeftPinned = lastLeftPinned; this.dispatchColEvent("lastLeftPinnedChanged", source); } } isFirstRightPinned() { return this.firstRightPinned; } isLastLeftPinned() { return this.lastLeftPinned; } isPinned() { return this.pinned === "left" || this.pinned === "right"; } isPinnedLeft() { return this.pinned === "left"; } isPinnedRight() { return this.pinned === "right"; } getPinned() { return this.pinned; } setVisible(visible, source) { const newValue = visible === true; if (this.visible !== newValue) { this.visible = newValue; this.dispatchColEvent("visibleChanged", source); } this.dispatchStateUpdatedEvent("hide"); } isVisible() { return this.visible; } isSpanHeaderHeight() { const colDef = this.getColDef(); return !colDef.suppressSpanHeaderHeight; } /** * Returns the first parent that is not a padding group. */ getFirstRealParent() { let parent = this.getOriginalParent(); while (parent?.isPadding()) { parent = parent.getOriginalParent(); } return parent; } getColumnGroupPaddingInfo() { let parent = this.getParent(); if (!parent?.isPadding()) { return { numberOfParents: 0, isSpanningTotal: false }; } const numberOfParents = parent.getPaddingLevel() + 1; let isSpanningTotal = true; while (parent) { if (!parent.isPadding()) { isSpanningTotal = false; break; } parent = parent.getParent(); } return { numberOfParents, isSpanningTotal }; } getColDef() { return this.colDef; } getDefinition() { return this.colDef; } getColumnGroupShow() { return this.colDef.columnGroupShow; } getColId() { return this.colId; } getId() { return this.colId; } getUniqueId() { return this.colId; } getActualWidth() { return this.actualWidth; } getAutoHeaderHeight() { return this.autoHeaderHeight; } /** Returns true if the header height has changed */ setAutoHeaderHeight(height) { const changed = height !== this.autoHeaderHeight; this.autoHeaderHeight = height; return changed; } createBaseColDefParams(rowNode) { const params = _addGridCommonParams(this.gos, { node: rowNode, data: rowNode.data, colDef: this.colDef, column: this }); return params; } getColSpan(rowNode) { if (_missing(this.colDef.colSpan)) { return 1; } const params = this.createBaseColDefParams(rowNode); const colSpan = this.colDef.colSpan(params); return Math.max(colSpan, 1); } getRowSpan(rowNode) { if (_missing(this.colDef.rowSpan)) { return 1; } const params = this.createBaseColDefParams(rowNode); const rowSpan = this.colDef.rowSpan(params); return Math.max(rowSpan, 1); } setActualWidth(actualWidth, source, silent = false) { actualWidth = Math.max(actualWidth, this.minWidth); actualWidth = Math.min(actualWidth, this.maxWidth); if (this.actualWidth !== actualWidth) { this.actualWidth = actualWidth; if (this.flex != null && source !== "flex" && source !== "gridInitializing") { this.flex = null; } if (!silent) { this.fireColumnWidthChangedEvent(source); } } this.dispatchStateUpdatedEvent("width"); } fireColumnWidthChangedEvent(source) { this.dispatchColEvent("widthChanged", source); } isGreaterThanMax(width) { return width > this.maxWidth; } getMinWidth() { return this.minWidth; } getMaxWidth() { return this.maxWidth; } getFlex() { return this.flex; } isRowGroupActive() { return this.rowGroupActive; } isPivotActive() { return this.pivotActive; } isAnyFunctionActive() { return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive(); } isAnyFunctionAllowed() { return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue(); } isValueActive() { return this.aggregationActive; } isAllowPivot() { return this.colDef.enablePivot === true; } isAllowValue() { return this.colDef.enableValue === true; } isAllowRowGroup() { return this.colDef.enableRowGroup === true; } isAllowFormula() { return this.colDef.allowFormula === true; } dispatchColEvent(type, source, additionalEventAttributes) { const colEvent = this.createColumnEvent(type, source); if (additionalEventAttributes) { _mergeDeep(colEvent, additionalEventAttributes); } this.colEventSvc.dispatchEvent(colEvent); } dispatchStateUpdatedEvent(key) { this.colEventSvc.dispatchEvent({ type: "columnStateUpdated", key }); } }; function _getSortDefFromInput(input) { if (_isSortDefValid(input)) { return { direction: input.direction, type: input.type }; } return { direction: _normalizeSortDirection(input), type: _normalizeSortType(input) }; } function _isSortDirectionValid(maybeSortDir) { return maybeSortDir === "asc" || maybeSortDir === "desc" || maybeSortDir === null; } function _isSortTypeValid(maybeSortType) { return maybeSortType === "default" || maybeSortType === "absolute"; } function _isSortDefValid(maybeSortDef) { if (!maybeSortDef || typeof maybeSortDef !== "object") { return false; } const maybeSortDefT = maybeSortDef; return _isSortTypeValid(maybeSortDefT.type) && _isSortDirectionValid(maybeSortDefT.direction); } function _areSortDefsEqual(sortDef1, sortDef2) { if (!sortDef1) { return sortDef2 ? sortDef2.direction === null : true; } if (!sortDef2) { return sortDef1 ? sortDef1.direction === null : true; } return sortDef1.type === sortDef2.type && sortDef1.direction === sortDef2.direction; } function _normalizeSortDirection(sortDirectionLike) { return _isSortDirectionValid(sortDirectionLike) ? sortDirectionLike : null; } function _normalizeSortType(sortTypeLike) { return _isSortTypeValid(sortTypeLike) ? sortTypeLike : "default"; } function _getDisplaySortForColumn(column, beans, getSortDefOverride) { const overrideSortDef = getSortDefOverride?.(); const sortDef = overrideSortDef ?? beans.sortSvc.getDisplaySortForColumn(column); const type = _normalizeSortType(sortDef?.type); const direction = _normalizeSortDirection(sortDef?.direction); const allowedSortTypes = column.getAvailableSortTypes(); const isDefaultSortAllowed = allowedSortTypes.has("default"); const isAbsoluteSortAllowed = allowedSortTypes.has("absolute"); const isAbsoluteSort = type === "absolute"; const isDefaultSort = type === "default"; const isAscending = direction === "asc"; const isDescending = direction === "desc"; return { isDefaultSortAllowed, isAbsoluteSortAllowed, isAbsoluteSort, isDefaultSort, isAscending, isDescending, direction }; } function isProvidedColumnGroup(col) { return col instanceof AgProvidedColumnGroup; } var AgProvidedColumnGroup = class extends BeanStub { constructor(colGroupDef, groupId, padding, level) { super(); this.colGroupDef = colGroupDef; this.groupId = groupId; this.padding = padding; this.level = level; this.isColumn = false; this.expandable = false; this.instanceId = getNextColInstanceId(); this.expandableListenerRemoveCallback = null; this.expanded = !!colGroupDef?.openByDefault; } destroy() { if (this.expandableListenerRemoveCallback) { this.reset(null, void 0); } super.destroy(); } reset(colGroupDef, level) { this.colGroupDef = colGroupDef; this.level = level; this.originalParent = null; if (this.expandableListenerRemoveCallback) { this.expandableListenerRemoveCallback(); } this.children = void 0; this.expandable = void 0; } getInstanceId() { return this.instanceId; } getOriginalParent() { return this.originalParent; } getLevel() { return this.level; } isVisible() { if (this.children) { return this.children.some((child) => child.isVisible()); } return false; } isPadding() { return this.padding; } setExpanded(expanded) { this.expanded = expanded === void 0 ? false : expanded; this.dispatchLocalEvent({ type: "expandedChanged" }); } isExpandable() { return this.expandable; } isExpanded() { return this.expanded; } getGroupId() { return this.groupId; } getId() { return this.getGroupId(); } setChildren(children) { this.children = children; } getChildren() { return this.children; } getColGroupDef() { return this.colGroupDef; } getLeafColumns() { const result = []; this.addLeafColumns(result); return result; } forEachLeafColumn(callback) { if (!this.children) { return; } for (const child of this.children) { if (isColumn(child)) { callback(child); } else if (isProvidedColumnGroup(child)) { child.forEachLeafColumn(callback); } } } addLeafColumns(leafColumns) { if (!this.children) { return; } for (const child of this.children) { if (isColumn(child)) { leafColumns.push(child); } else if (isProvidedColumnGroup(child)) { child.addLeafColumns(leafColumns); } } } getColumnGroupShow() { const colGroupDef = this.colGroupDef; if (!colGroupDef) { return; } return colGroupDef.columnGroupShow; } // need to check that this group has at least one col showing when both expanded and contracted. // if not, then we don't allow expanding and contracting on this group setupExpandable() { this.setExpandable(); if (this.expandableListenerRemoveCallback) { this.expandableListenerRemoveCallback(); } const listener = this.onColumnVisibilityChanged.bind(this); for (const col of this.getLeafColumns()) { col.__addEventListener("visibleChanged", listener); } this.expandableListenerRemoveCallback = () => { for (const col of this.getLeafColumns()) { col.__removeEventListener("visibleChanged", listener); } this.expandableListenerRemoveCallback = null; }; } setExpandable() { if (this.isPadding()) { return; } let atLeastOneShowingWhenOpen = false; let atLeastOneShowingWhenClosed = false; let atLeastOneChangeable = false; const children = this.findChildrenRemovingPadding(); for (let i = 0, j = children.length; i < j; i++) { const abstractColumn = children[i]; if (!abstractColumn.isVisible()) { continue; } const headerGroupShow = abstractColumn.getColumnGroupShow(); if (headerGroupShow === "open") { atLeastOneShowingWhenOpen = true; atLeastOneChangeable = true; } else if (headerGroupShow === "closed") { atLeastOneShowingWhenClosed = true; atLeastOneChangeable = true; } else { atLeastOneShowingWhenOpen = true; atLeastOneShowingWhenClosed = true; } } const expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable; if (this.expandable !== expandable) { this.expandable = expandable; this.dispatchLocalEvent({ type: "expandableChanged" }); } } findChildrenRemovingPadding() { const res = []; const process = (items) => { for (const item of items) { const skipBecausePadding = isProvidedColumnGroup(item) && item.isPadding(); if (skipBecausePadding) { process(item.children); } else { res.push(item); } } }; process(this.children); return res; } onColumnVisibilityChanged() { this.setExpandable(); } }; var DefaultColumnTypes = { numericColumn: { headerClass: "ag-right-aligned-header", cellClass: "ag-right-aligned-cell" }, rightAligned: { headerClass: "ag-right-aligned-header", cellClass: "ag-right-aligned-cell" } }; function createMergedColGroupDef(beans, colGroupDef, groupId) { const colGroupDefMerged = {}; const gos = beans.gos; Object.assign(colGroupDefMerged, gos.get("defaultColGroupDef")); Object.assign(colGroupDefMerged, colGroupDef); gos.validateColDef(colGroupDefMerged, groupId); return colGroupDefMerged; } var ColumnKeyCreator = class { constructor() { this.existingKeys = {}; } addExistingKeys(keys) { for (let i = 0; i < keys.length; i++) { this.existingKeys[keys[i]] = true; } } getUniqueKey(colId, colField) { colId = _toStringOrNull(colId); let count = 0; while (true) { let idToTry = colId ?? colField; if (idToTry) { if (count !== 0) { idToTry += "_" + count; } } else { idToTry = count; } if (!this.existingKeys[idToTry]) { const usedId = String(idToTry); if (colId && count > 0) { _warn(273, { providedId: colId, usedId }); } this.existingKeys[usedId] = true; return usedId; } count++; } } }; var depthFirstCallback = (child, parent) => { if (isProvidedColumnGroup(child)) { child.setupExpandable(); } child.originalParent = parent; }; function _createColumnTreeWithIds(beans, defs = null, primaryColumns, existingTree, source) { const { existingCols, existingGroups } = extractExistingTreeData(existingTree); const colIdMap = new Map(existingCols.map((col) => [col.getId(), col])); const colGroupIdMap = new Map(existingGroups.map((group) => [group.getId(), group])); let maxDepth = 0; const recursivelyProcessColDef = (def, level) => { maxDepth = Math.max(maxDepth, level); if (isColumnGroupDef(def)) { if (!beans.colGroupSvc) { return null; } const groupId = def.groupId; const group = colGroupIdMap.get(groupId); const colGroupDef = createMergedColGroupDef(beans, def, groupId); const newGroup = new AgProvidedColumnGroup(colGroupDef, groupId, false, level); beans.context.createBean(newGroup); if (group) { newGroup.setExpanded(group.isExpanded()); } newGroup.setChildren(def.children.map((child) => recursivelyProcessColDef(child, level + 1))); return newGroup; } const colId = def.colId; let column = colIdMap.get(colId); const colDefMerged = _addColumnDefaultAndTypes(beans, def, column?.getColId() ?? colId); if (!column) { column = new AgColumn(colDefMerged, def, colId, primaryColumns); beans.context.createBean(column); } else { column.setColDef(colDefMerged, def, source); _updateColumnState(beans, column, colDefMerged, source); } beans.dataTypeSvc?.addColumnListeners(column); return column; }; const root = defs?.map((def) => recursivelyProcessColDef(def, 0)) ?? []; let counter = 0; const keyCreator = { getUniqueKey: (_colId, _field) => String(++counter) }; const columnTree = beans.colGroupSvc ? beans.colGroupSvc.balanceColumnTree(root, 0, maxDepth, keyCreator) : root; depthFirstOriginalTreeSearch(null, columnTree, depthFirstCallback); return { columnTree, treeDepth: maxDepth }; } function _createColumnTree(beans, defs = null, primaryColumns, existingTree, source) { const columnKeyCreator = new ColumnKeyCreator(); const { existingCols, existingGroups, existingColKeys } = extractExistingTreeData(existingTree); columnKeyCreator.addExistingKeys(existingColKeys); const unbalancedTree = _recursivelyCreateColumns( beans, defs, 0, primaryColumns, existingCols, columnKeyCreator, existingGroups, source ); const { colGroupSvc } = beans; const treeDepth = colGroupSvc?.findMaxDepth(unbalancedTree, 0) ?? 0; const columnTree = colGroupSvc ? colGroupSvc.balanceColumnTree(unbalancedTree, 0, treeDepth, columnKeyCreator) : unbalancedTree; depthFirstOriginalTreeSearch(null, columnTree, depthFirstCallback); return { columnTree, treeDepth }; } function extractExistingTreeData(existingTree) { const existingCols = []; const existingGroups = []; const existingColKeys = []; if (existingTree) { depthFirstOriginalTreeSearch(null, existingTree, (item) => { if (isProvidedColumnGroup(item)) { const group = item; existingGroups.push(group); } else { const col = item; existingColKeys.push(col.getId()); existingCols.push(col); } }); } return { existingCols, existingGroups, existingColKeys }; } function _recursivelyCreateColumns(beans, defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups, source) { if (!defs) { return []; } const { colGroupSvc } = beans; const result = new Array(defs.length); for (let i = 0; i < result.length; i++) { const def = defs[i]; if (colGroupSvc && isColumnGroupDef(def)) { result[i] = colGroupSvc.createProvidedColumnGroup( primaryColumns, def, level, existingColsCopy, columnKeyCreator, existingGroups, source ); } else { result[i] = createColumn(beans, primaryColumns, def, existingColsCopy, columnKeyCreator, source); } } return result; } function createColumn(beans, primaryColumns, colDef, existingColsCopy, columnKeyCreator, source) { const existingColAndIndex = findExistingColumn(colDef, existingColsCopy); if (existingColAndIndex) { existingColsCopy?.splice(existingColAndIndex.idx, 1); } let column = existingColAndIndex?.column; if (!column) { const colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field); const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, colId); column = new AgColumn(colDefMerged, colDef, colId, primaryColumns); beans.context.createBean(column); } else { const colDefMerged = _addColumnDefaultAndTypes(beans, colDef, column.getColId()); column.setColDef(colDefMerged, colDef, source); _updateColumnState(beans, column, colDefMerged, source); } beans.dataTypeSvc?.addColumnListeners(column); return column; } function updateSomeColumnState(beans, column, hide, sort, sortIndex, pinned, flex, source) { const { sortSvc, pinnedCols, colFlex } = beans; if (hide !== void 0) { column.setVisible(!hide, source); } if (sortSvc) { sortSvc.updateColSort(column, sort, source); if (sortIndex !== void 0) { sortSvc.setColSortIndex(column, sortIndex); } } if (pinned !== void 0) { pinnedCols?.setColPinned(column, pinned); } if (flex !== void 0) { colFlex?.setColFlex(column, flex); } } function _updateColumnState(beans, column, colDef, source) { updateSomeColumnState( beans, column, colDef.hide, colDef.sort, colDef.sortIndex, colDef.pinned, colDef.flex, source ); const colFlex = column.getFlex(); if (colFlex != null && colFlex > 0) { return; } if (colDef.width != null) { column.setActualWidth(colDef.width, source); } else { const widthBeforeUpdate = column.getActualWidth(); column.setActualWidth(widthBeforeUpdate, source); } } function findExistingColumn(newColDef, existingColsCopy) { if (!existingColsCopy) { return void 0; } for (let i = 0; i < existingColsCopy.length; i++) { const def = existingColsCopy[i].getUserProvidedColDef(); if (!def) { continue; } const newHasId = newColDef.colId != null; if (newHasId) { if (existingColsCopy[i].getId() === newColDef.colId) { return { idx: i, column: existingColsCopy[i] }; } continue; } const newHasField = newColDef.field != null; if (newHasField) { if (def.field === newColDef.field) { return { idx: i, column: existingColsCopy[i] }; } continue; } if (def === newColDef) { return { idx: i, column: existingColsCopy[i] }; } } return void 0; } function _addColumnDefaultAndTypes(beans, colDef, colId, isAutoCol) { const { gos, dataTypeSvc } = beans; const res = {}; const defaultColDef = gos.get("defaultColDef"); _mergeDeep(res, defaultColDef, false, true); const columnType = updateColDefAndGetColumnType(beans, res, colDef, colId); if (columnType) { assignColumnTypes(beans, columnType, res); } const cellDataType = res.cellDataType; _mergeDeep(res, colDef, false, true); if (cellDataType !== void 0) { res.cellDataType = cellDataType; } const autoGroupColDef = gos.get("autoGroupColumnDef"); const isSortingCoupled = _isColumnsSortingCoupledToGroup(gos); if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) { _mergeDeep( res, { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort }, false, true ); } dataTypeSvc?.postProcess(res); dataTypeSvc?.validateColDef(res, colDef, defaultColDef, colId); gos.validateColDef(res, colId, isAutoCol); return res; } function updateColDefAndGetColumnType(beans, colDef, userColDef, colId) { const dataTypeDefinitionColumnType = beans.dataTypeSvc?.updateColDefAndGetColumnType(colDef, userColDef, colId); const columnTypes = userColDef.type ?? dataTypeDefinitionColumnType ?? colDef.type; colDef.type = columnTypes; return columnTypes ? convertColumnTypes(columnTypes) : void 0; } function assignColumnTypes(beans, typeKeys, colDefMerged) { if (!typeKeys.length) { return; } const allColumnTypes = Object.assign({}, DefaultColumnTypes); const userTypes = beans.gos.get("columnTypes") || {}; for (const key of Object.keys(userTypes)) { const value = userTypes[key]; if (key in allColumnTypes) { _warn(34, { key }); } else { const colType = value; if (colType.type) { _warn(35); } allColumnTypes[key] = value; } } for (const t of typeKeys) { const typeColDef = allColumnTypes[t.trim()]; if (typeColDef) { _mergeDeep(colDefMerged, typeColDef, false, true); } else { _warn(36, { t }); } } } function isColumnGroupDef(abstractColDef) { return abstractColDef.children !== void 0; } function depthFirstOriginalTreeSearch(parent, tree, callback) { if (!tree) { return; } for (let i = 0; i < tree.length; i++) { const child = tree[i]; if (isProvidedColumnGroup(child)) { depthFirstOriginalTreeSearch(child, child.getChildren(), callback); } callback(child, parent); } } var GROUP_AUTO_COLUMN_ID = "ag-Grid-AutoColumn"; var SELECTION_COLUMN_ID = "ag-Grid-SelectionColumn"; var ROW_NUMBERS_COLUMN_ID = "ag-Grid-RowNumbersColumn"; var GROUP_HIERARCHY_COLUMN_ID_PREFIX = "ag-Grid-HierarchyColumn"; function _getColumnsFromTree(rootColumns) { const result = []; const recursiveFindColumns = (childColumns) => { for (let i = 0; i < childColumns.length; i++) { const child = childColumns[i]; if (isColumn(child)) { result.push(child); } else if (isProvidedColumnGroup(child)) { recursiveFindColumns(child.getChildren()); } } }; recursiveFindColumns(rootColumns); return result; } function getWidthOfColsInList(columnList) { return columnList.reduce((width, col) => width + col.getActualWidth(), 0); } function _destroyColumnTree(beans, oldTree, newTree) { const oldObjectsById = {}; if (!oldTree) { return; } depthFirstOriginalTreeSearch(null, oldTree, (child) => { oldObjectsById[child.getInstanceId()] = child; }); if (newTree) { depthFirstOriginalTreeSearch(null, newTree, (child) => { oldObjectsById[child.getInstanceId()] = null; }); } const colsToDestroy = Object.values(oldObjectsById).filter((item) => item != null); beans.context.destroyBeans(colsToDestroy); } function isColumnGroupAutoCol(col) { const colId = col.getId(); return colId.startsWith(GROUP_AUTO_COLUMN_ID); } function isColumnSelectionCol(col) { const id = typeof col === "string" ? col : "getColId" in col ? col.getColId() : col.colId; return id?.startsWith(SELECTION_COLUMN_ID) ?? false; } function isRowNumberCol(col) { const id = typeof col === "string" ? col : "getColId" in col ? col.getColId() : col.colId; return id?.startsWith(ROW_NUMBERS_COLUMN_ID) ?? false; } function isSpecialCol(col) { return isColumnSelectionCol(col) || isRowNumberCol(col); } function convertColumnTypes(type) { let typeKeys = []; if (type instanceof Array) { typeKeys = type; } else if (typeof type === "string") { typeKeys = type.split(","); } return typeKeys; } function _areColIdsEqual(colsA, colsB) { return _areEqual(colsA, colsB, (a, b) => a.getColId() === b.getColId()); } function _updateColsMap(cols) { cols.map = {}; for (const col of cols.list) { cols.map[col.getId()] = col; } } function _convertColumnEventSourceType(source) { return source === "optionsUpdated" ? "gridOptionsChanged" : source; } function _columnsMatch(column, key) { return column === key || column.colId == key || column.getColDef() === key; } var getValueFactory = (stateItem, defaultState) => (key1, key2) => { const obj = { value1: void 0, value2: void 0 }; let calculated = false; if (stateItem) { if (stateItem[key1] !== void 0) { obj.value1 = stateItem[key1]; calculated = true; } if (_exists(key2) && stateItem[key2] !== void 0) { obj.value2 = stateItem[key2]; calculated = true; } } if (!calculated && defaultState) { if (defaultState[key1] !== void 0) { obj.value1 = defaultState[key1]; } if (_exists(key2) && defaultState[key2] !== void 0) { obj.value2 = defaultState[key2]; } } return obj; }; function _getColumnStateFromColDef(colDef, colId) { const state = { ...colDef, sort: void 0, colId }; const sortDef = _getSortDefFromColDef(colDef); if (sortDef) { state.sort = sortDef.direction; state.sortType = sortDef.type; } return state; } function _getSortDefFromColDef(colDef) { const { sort, initialSort } = colDef; const sortIsValid = _isSortDefValid(sort) || _isSortDirectionValid(sort); const initialSortIsValid = _isSortDefValid(initialSort) || _isSortDirectionValid(initialSort); if (sortIsValid) { return _getSortDefFromInput(sort); } if (initialSortIsValid) { return _getSortDefFromInput(initialSort); } return null; } function createUniqueColumnGroupId(groupId, instanceId) { return groupId + "_" + instanceId; } function isColumnGroup(col) { return col instanceof AgColumnGroup; } var AgColumnGroup = class extends BeanStub { constructor(providedColumnGroup, groupId, partId, pinned) { super(); this.providedColumnGroup = providedColumnGroup; this.groupId = groupId; this.partId = partId; this.pinned = pinned; this.isColumn = false; this.displayedChildren = []; this.autoHeaderHeight = null; this.parent = null; this.colIdSanitised = _escapeString(this.getUniqueId()); } // as the user is adding and removing columns, the groups are recalculated. // this reset clears out all children, ready for children to be added again reset() { this.parent = null; this.children = null; this.displayedChildren = null; } getParent() { return this.parent; } getUniqueId() { return createUniqueColumnGroupId(this.groupId, this.partId); } isEmptyGroup() { return this.displayedChildren.length === 0; } isMoving() { const allLeafColumns = this.getProvidedColumnGroup().getLeafColumns(); if (!allLeafColumns || allLeafColumns.length === 0) { return false; } return allLeafColumns.every((col) => col.isMoving()); } checkLeft() { for (const child of this.displayedChildren) { if (isColumnGroup(child)) { child.checkLeft(); } } if (this.displayedChildren.length > 0) { if (this.gos.get("enableRtl")) { const lastChild = _last(this.displayedChildren); const lastChildLeft = lastChild.getLeft(); this.setLeft(lastChildLeft); } else { const firstChildLeft = this.displayedChildren[0].getLeft(); this.setLeft(firstChildLeft); } } else { this.setLeft(null); } } getLeft() { return this.left; } getOldLeft() { return this.oldLeft; } setLeft(left) { this.oldLeft = this.left; if (this.left !== left) { this.left = left; this.dispatchLocalEvent({ type: "leftChanged" }); } } getPinned() { return this.pinned; } getGroupId() { return this.groupId; } getPartId() { return this.partId; } getActualWidth() { let groupActualWidth = 0; for (const child of this.displayedChildren ?? []) { groupActualWidth += child.getActualWidth(); } return groupActualWidth; } isResizable() { if (!this.displayedChildren) { return false; } let result = false; for (const child of this.displayedChildren) { if (child.isResizable()) { result = true; } } return result; } getMinWidth() { let result = 0; for (const groupChild of this.displayedChildren) { result += groupChild.getMinWidth(); } return result; } addChild(child) { if (!this.children) { this.children = []; } this.children.push(child); } getDisplayedChildren() { return this.displayedChildren; } getLeafColumns() { const result = []; this.addLeafColumns(result); return result; } getDisplayedLeafColumns() { const result = []; this.addDisplayedLeafColumns(result); return result; } getDefinition() { return this.providedColumnGroup.getColGroupDef(); } getColGroupDef() { return this.providedColumnGroup.getColGroupDef(); } isPadding() { return this.providedColumnGroup.isPadding(); } isExpandable() { return this.providedColumnGroup.isExpandable(); } isExpanded() { return this.providedColumnGroup.isExpanded(); } setExpanded(expanded) { this.providedColumnGroup.setExpanded(expanded); } isAutoHeaderHeight() { return !!this.getColGroupDef()?.autoHeaderHeight; } getAutoHeaderHeight() { return this.autoHeaderHeight; } /** Returns true if the header height has changed */ setAutoHeaderHeight(height) { const changed = height !== this.autoHeaderHeight; this.autoHeaderHeight = height; return changed; } addDisplayedLeafColumns(leafColumns) { for (const child of this.displayedChildren ?? []) { if (isColumn(child)) { leafColumns.push(child); } else if (isColumnGroup(child)) { child.addDisplayedLeafColumns(leafColumns); } } } addLeafColumns(leafColumns) { for (const child of this.children ?? []) { if (isColumn(child)) { leafColumns.push(child); } else if (isColumnGroup(child)) { child.addLeafColumns(leafColumns); } } } getChildren() { return this.children; } getColumnGroupShow() { return this.providedColumnGroup.getColumnGroupShow(); } getProvidedColumnGroup() { return this.providedColumnGroup; } getPaddingLevel() { const parent = this.getParent(); if (!this.isPadding() || !parent?.isPadding()) { return 0; } return 1 + parent.getPaddingLevel(); } calculateDisplayedColumns() { this.displayedChildren = []; let parentWithExpansion = this; while (parentWithExpansion?.isPadding()) { parentWithExpansion = parentWithExpansion.getParent(); } const isExpandable = parentWithExpansion ? parentWithExpansion.getProvidedColumnGroup().isExpandable() : false; if (!isExpandable) { this.displayedChildren = this.children; this.dispatchLocalEvent({ type: "displayedChildrenChanged" }); return; } for (const child of this.children ?? []) { const emptyGroup = isColumnGroup(child) && !child.displayedChildren?.length; if (emptyGroup) { continue; } const headerGroupShow = child.getColumnGroupShow(); switch (headerGroupShow) { case "open": if (parentWithExpansion.getProvidedColumnGroup().isExpanded()) { this.displayedChildren.push(child); } break; case "closed": if (!parentWithExpansion.getProvidedColumnGroup().isExpanded()) { this.displayedChildren.push(child); } break; default: this.displayedChildren.push(child); break; } } this.dispatchLocalEvent({ type: "displayedChildrenChanged" }); } }; var KeyCode = { BACKSPACE: "Backspace", TAB: "Tab", ENTER: "Enter", ESCAPE: "Escape", SPACE: " ", LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", DOWN: "ArrowDown", DELETE: "Delete", F2: "F2", PAGE_UP: "PageUp", PAGE_DOWN: "PageDown", PAGE_HOME: "Home", PAGE_END: "End", // these should be used with `event.code` instead of `event.key` // as `event.key` changes when non-latin keyboards are used A: "KeyA", C: "KeyC", D: "KeyD", V: "KeyV", X: "KeyX", Y: "KeyY", Z: "KeyZ" }; var A_KEYCODE = 65; var C_KEYCODE = 67; var V_KEYCODE = 86; var D_KEYCODE = 68; var Z_KEYCODE = 90; var Y_KEYCODE = 89; function _normaliseQwertyAzerty(keyboardEvent) { const { keyCode } = keyboardEvent; let code; switch (keyCode) { case A_KEYCODE: code = KeyCode.A; break; case C_KEYCODE: code = KeyCode.C; break; case V_KEYCODE: code = KeyCode.V; break; case D_KEYCODE: code = KeyCode.D; break; case Z_KEYCODE: code = KeyCode.Z; break; case Y_KEYCODE: code = KeyCode.Y; break; default: code = keyboardEvent.code; } return code; } function _isPromise(fn) { return typeof fn.then === "function"; } function _wrapInterval(action, timeout) { return new AgPromise((resolve) => { resolve(window.setInterval(action, timeout)); }); } var AgPromise = class _AgPromise { constructor(callback) { this.status = 0; this.resolution = null; this.waiters = []; callback( (value) => this.onDone(value), (params) => this.onReject(params) ); } static all(promises) { return promises.length ? new _AgPromise((resolve) => { let remainingToResolve = promises.length; const combinedValues = new Array(remainingToResolve); promises.forEach((promise, index) => { promise.then((value) => { combinedValues[index] = value; remainingToResolve--; if (remainingToResolve === 0) { resolve(combinedValues); } }); }); }) : _AgPromise.resolve(); } static resolve(value = null) { return new _AgPromise((resolve) => resolve(value)); } then(func) { return new _AgPromise((resolve) => { if (this.status === 1) { resolve(func(this.resolution)); } else { this.waiters.push((value) => resolve(func(value))); } }); } onDone(value) { this.status = 1; this.resolution = value; for (const waiter of this.waiters) { waiter(value); } } onReject(_) { } }; var BaseDragAndDropService = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "dragAndDrop"; this.dragSourceAndParamsList = []; this.dragItem = null; this.dragInitialSourcePointerOffsetX = 0; this.dragInitialSourcePointerOffsetY = 0; this.lastMouseEvent = null; this.lastDraggingEvent = null; this.dragSource = null; this.dragImageCompPromise = null; this.dragImageComp = null; this.dragImageLastIcon = void 0; this.dragImageLastLabel = void 0; this.dropTargets = []; this.externalDropZoneCount = 0; this.lastDropTarget = null; } addDragSource(dragSource, allowTouch = false) { const entry = { capturePointer: true, dragSource, eElement: dragSource.eElement, dragStartPixels: dragSource.dragStartPixels, onDragStart: (mouseEvent) => this.onDragStart(dragSource, mouseEvent), onDragStop: this.onDragStop.bind(this), onDragging: this.onDragging.bind(this), onDragCancel: this.onDragCancel.bind(this), includeTouch: allowTouch }; this.dragSourceAndParamsList.push(entry); this.beans.dragSvc.addDragSource(entry); } setDragImageCompIcon(iconName, shake = false) { const component = this.dragImageComp; if (component && (shake || this.dragImageLastIcon !== iconName)) { this.dragImageLastIcon = iconName; component.setIcon(iconName, shake); } } removeDragSource(dragSource) { const { dragSourceAndParamsList, beans } = this; for (let i = 0, len = dragSourceAndParamsList.length; i < len; i++) { if (dragSourceAndParamsList[i].dragSource === dragSource) { const sourceAndParams = dragSourceAndParamsList[i]; beans.dragSvc?.removeDragSource(sourceAndParams); dragSourceAndParamsList.splice(i, 1); break; } } } destroy() { const { dragSourceAndParamsList, dropTargets, beans } = this; const dragSvc = beans.dragSvc; for (const sourceAndParams of dragSourceAndParamsList) { dragSvc?.removeDragSource(sourceAndParams); } dragSourceAndParamsList.length = 0; dropTargets.length = 0; this.externalDropZoneCount = 0; this.clearDragAndDropProperties(); super.destroy(); } nudge() { const lastMouseEvent = this.lastMouseEvent; if (lastMouseEvent) { this.onDragging(lastMouseEvent, true); } } onDragStart(dragSource, mouseEvent) { this.lastMouseEvent = mouseEvent; this.dragSource = dragSource; this.dragItem = dragSource.getDragItem(); const rect = dragSource.eElement.getBoundingClientRect(); this.dragInitialSourcePointerOffsetX = mouseEvent.clientX - rect.left; this.dragInitialSourcePointerOffsetY = mouseEvent.clientY - rect.top; dragSource.onDragStarted?.(); this.createAndUpdateDragImageComp(dragSource); } onDragStop(mouseEvent) { const { dragSource, lastDropTarget } = this; dragSource?.onDragStopped?.(); if (lastDropTarget) { const dragEndEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, false); lastDropTarget.onDragStop?.(dragEndEvent); } this.clearDragAndDropProperties(); } onDragCancel() { const { dragSource, lastDropTarget, lastMouseEvent } = this; dragSource?.onDragCancelled?.(); if (lastDropTarget && lastMouseEvent) { const dragCancelEvent = this.dropTargetEvent(lastDropTarget, lastMouseEvent, false); lastDropTarget.onDragCancel?.(dragCancelEvent); } this.clearDragAndDropProperties(); } onDragging(mouseEvent, fromNudge = false) { this.positionDragImageComp(mouseEvent); const dropTarget = this.findCurrentDropTarget(mouseEvent); const { lastDropTarget, dragSource, dragItem } = this; let needUpdate = false; if (dropTarget !== lastDropTarget) { needUpdate = true; if (lastDropTarget) { const dragLeaveEvent = this.dropTargetEvent(lastDropTarget, mouseEvent, fromNudge); lastDropTarget.onDragLeave?.(dragLeaveEvent); } if (lastDropTarget !== null && !dropTarget) { this.handleExit(dragSource, dragItem); } else if (lastDropTarget === null && dropTarget) { this.handleEnter(dragSource, dragItem); } if (dropTarget) { const dragEnterEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge); dropTarget.onDragEnter?.(dragEnterEvent); } this.lastDropTarget = dropTarget; } else if (dropTarget) { const dragMoveEvent = this.dropTargetEvent(dropTarget, mouseEvent, fromNudge); dropTarget.onDragging?.(dragMoveEvent); if (dragMoveEvent?.changed) { needUpdate = true; } } this.lastMouseEvent = mouseEvent; if (needUpdate) { this.updateDragImageComp(); } } clearDragAndDropProperties() { this.removeDragImageComp(this.dragImageComp); this.dragImageCompPromise = null; this.dragImageLastIcon = void 0; this.dragImageLastLabel = void 0; this.lastMouseEvent = null; this.lastDraggingEvent = null; this.lastDropTarget = null; this.dragItem = null; this.dragInitialSourcePointerOffsetX = 0; this.dragInitialSourcePointerOffsetY = 0; this.dragSource = null; } getAllContainersFromDropTarget(dropTarget) { const primaryContainer = dropTarget.getContainer(); const secondaryContainers = dropTarget.getSecondaryContainers?.(); const secondaryContainersLen = secondaryContainers?.length; if (!secondaryContainersLen) { return [[primaryContainer]]; } const containers = new Array(secondaryContainersLen + 1); containers[0] = [primaryContainer]; for (let i = 0; i < secondaryContainersLen; ++i) { containers[i + 1] = secondaryContainers[i]; } return containers; } // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers isMouseOnDropTarget(mouseEvent, dropTarget) { const allContainersFromDropTarget = this.getAllContainersFromDropTarget(dropTarget); let mouseOverTarget = false; const allContainersIntersect = (mouseEvent2, containers) => { for (const container of containers) { const { width, height, left, right, top, bottom } = container.getBoundingClientRect(); if (width === 0 || height === 0) { return false; } const horizontalFit = mouseEvent2.clientX >= left && mouseEvent2.clientX < right; const verticalFit = mouseEvent2.clientY >= top && mouseEvent2.clientY < bottom; if (!horizontalFit || !verticalFit) { return false; } } return true; }; for (const currentContainers of allContainersFromDropTarget) { if (allContainersIntersect(mouseEvent, currentContainers)) { mouseOverTarget = true; break; } } const { eElement, type } = this.dragSource; if (dropTarget.targetContainsSource && !dropTarget.getContainer().contains(eElement)) { return false; } return mouseOverTarget && dropTarget.isInterestedIn(type, eElement); } findCurrentDropTarget(mouseEvent) { const validDropTargets = []; const dropTargets = this.dropTargets; for (let i = 0, len2 = dropTargets.length; i < len2; ++i) { const target = dropTargets[i]; if (this.isMouseOnDropTarget(mouseEvent, target)) { validDropTargets.push(target); } } const len = validDropTargets.length; if (len === 0) { return null; } if (len === 1) { return validDropTargets[0]; } const rootNode = _getRootNode(this.beans); const elementStack = rootNode.elementsFromPoint(mouseEvent.clientX, mouseEvent.clientY); for (let i = 0, stackLen = elementStack.length; i < stackLen; ++i) { const el = elementStack[i]; for (let targetIndex = 0, targetsLen = validDropTargets.length; targetIndex < targetsLen; targetIndex++) { const dropTarget = validDropTargets[targetIndex]; const containerGroups = this.getAllContainersFromDropTarget(dropTarget); let matched = false; for (let groupIdx = 0, groupLen = containerGroups.length; groupIdx < groupLen && !matched; groupIdx++) { const group = containerGroups[groupIdx]; for (let elIdx = 0, elLen = group.length; elIdx < elLen; elIdx++) { if (group[elIdx] === el) { matched = true; break; } } } if (matched) { return dropTarget; } } } return null; } addDropTarget(dropTarget) { this.dropTargets.push(dropTarget); if (dropTarget.external) { this.externalDropZoneCount++; } } removeDropTarget(dropTarget) { const container = dropTarget.getContainer(); const dropTargets = this.dropTargets; let writeIndex = 0; for (let readIndex = 0, len = dropTargets.length; readIndex < len; ++readIndex) { const target = dropTargets[readIndex]; if (target.getContainer() === container) { if (target.external) { --this.externalDropZoneCount; } continue; } if (writeIndex !== readIndex) { dropTargets[writeIndex] = target; } ++writeIndex; } dropTargets.length = writeIndex; } hasExternalDropZones() { return this.externalDropZoneCount > 0; } findExternalZone(container) { const dropTargets = this.dropTargets; for (let i = 0, len = dropTargets.length; i < len; ++i) { const zone = dropTargets[i]; if (zone.external && zone.getContainer() === container) { return zone; } } return null; } dropTargetEvent(dropTarget, mouseEvent, fromNudge) { const { dragSource, dragItem, lastDraggingEvent, lastMouseEvent, dragInitialSourcePointerOffsetX, dragInitialSourcePointerOffsetY } = this; const dropZoneTarget = dropTarget.getContainer(); const rect = dropZoneTarget.getBoundingClientRect(); const { clientX, clientY } = mouseEvent; const xDir = clientX - (lastMouseEvent?.clientX || 0); const yDir = clientY - (lastMouseEvent?.clientY || 0); const draggingEvent = this.createEvent({ event: mouseEvent, x: clientX - rect.left, // relative x y: clientY - rect.top, // relative y vDirection: yDir > 0 ? "down" : yDir < 0 ? "up" : null, hDirection: xDir < 0 ? "left" : xDir > 0 ? "right" : null, initialSourcePointerOffsetX: dragInitialSourcePointerOffsetX, initialSourcePointerOffsetY: dragInitialSourcePointerOffsetY, dragSource, fromNudge, dragItem, dropZoneTarget, dropTarget: lastDraggingEvent?.dropTarget ?? null, // updated by rowDragFeature changed: !!lastDraggingEvent?.changed }); this.lastDraggingEvent = draggingEvent; return draggingEvent; } positionDragImageComp(event) { const gui = this.dragImageComp?.getGui(); if (gui) { _anchorElementToMouseMoveEvent(gui, event, this.beans); } } removeDragImageComp(comp) { if (this.dragImageComp === comp) { this.dragImageComp = null; } if (comp) { comp.getGui()?.remove(); this.destroyBean(comp); } } createAndUpdateDragImageComp(dragSource) { const promise = this.createDragImageComp(dragSource) ?? null; this.dragImageCompPromise = promise; promise?.then((dragImageComp) => { const lastMouseEvent = this.lastMouseEvent; if (promise !== this.dragImageCompPromise || !lastMouseEvent || !this.isAlive()) { this.destroyBean(dragImageComp); return; } this.dragImageCompPromise = null; this.dragImageLastIcon = void 0; this.dragImageLastLabel = void 0; const oldDragImageComp = this.dragImageComp; if (oldDragImageComp !== dragImageComp) { this.dragImageComp = dragImageComp; this.removeDragImageComp(oldDragImageComp); } if (dragImageComp) { this.appendDragImageComp(dragImageComp); this.updateDragImageComp(); this.positionDragImageComp(lastMouseEvent); } }); } appendDragImageComp(component) { const eGui = component.getGui(); const style = eGui.style; style.position = "absolute"; style.zIndex = "9999"; if (this.beans.dragSvc?.hasPointerCapture()) { style.pointerEvents = "none"; } this.gos.setInstanceDomData(eGui); this.beans.environment.applyThemeClasses(eGui); style.top = "20px"; style.left = "20px"; const targetEl = _getPageBody(this.beans); if (!targetEl) { this.warnNoBody(); } else { targetEl.appendChild(eGui); } } updateDragImageComp() { const { dragImageComp, dragSource, lastDropTarget, lastDraggingEvent, dragImageLastLabel } = this; if (!dragImageComp) { return; } this.setDragImageCompIcon(lastDropTarget?.getIconName?.(lastDraggingEvent) ?? null); let label = dragSource?.dragItemName; if (typeof label === "function") { label = label(lastDraggingEvent); } label || (label = ""); if (dragImageLastLabel !== label) { this.dragImageLastLabel = label; dragImageComp.setLabel(label); } } }; function isColumnFilterComp(filter) { return typeof filter === "object" && !!filter.component; } function doesImplementIComponent(candidate) { if (!candidate) { return false; } return candidate.prototype && "getGui" in candidate.prototype; } function _getUserCompKeys(frameworkOverrides, defObject, type, params) { const { name } = type; let compName; let jsComp; let fwComp; let paramsFromSelector; let popupFromSelector; let popupPositionFromSelector; if (defObject) { const defObjectAny = defObject; const selectorFunc = defObjectAny[name + "Selector"]; const selectorRes = selectorFunc ? selectorFunc(params) : null; const assignComp = (providedJsComp) => { if (typeof providedJsComp === "string") { compName = providedJsComp; } else if (providedJsComp != null && providedJsComp !== true) { const isFwkComp = frameworkOverrides.isFrameworkComponent(providedJsComp); if (isFwkComp) { fwComp = providedJsComp; } else { jsComp = providedJsComp; } } }; if (selectorRes) { assignComp(selectorRes.component); paramsFromSelector = selectorRes.params; popupFromSelector = selectorRes.popup; popupPositionFromSelector = selectorRes.popupPosition; } else { assignComp(defObjectAny[name]); } } return { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector }; } var UserComponentFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "userCompFactory"; } wireBeans(beans) { this.agCompUtils = beans.agCompUtils; this.registry = beans.registry; this.frameworkCompWrapper = beans.frameworkCompWrapper; this.gridOptions = beans.gridOptions; } getCompDetailsFromGridOptions(type, defaultName, params, mandatory = false) { return this.getCompDetails(this.gridOptions, type, defaultName, params, mandatory); } getCompDetails(defObject, type, defaultName, params, mandatory = false) { const { name, cellRenderer } = type; let { compName, jsComp, fwComp, paramsFromSelector, popupFromSelector, popupPositionFromSelector } = _getUserCompKeys(this.beans.frameworkOverrides, defObject, type, params); let defaultCompParams; let defaultCompProcessParams; const lookupFromRegistry = (key) => { const item = this.registry.getUserComponent(name, key); if (item) { jsComp = !item.componentFromFramework ? item.component : void 0; fwComp = item.componentFromFramework ? item.component : void 0; defaultCompParams = item.params; defaultCompProcessParams = item.processParams; } }; if (compName != null) { lookupFromRegistry(compName); } if (jsComp == null && fwComp == null && defaultName != null) { lookupFromRegistry(defaultName); } if (jsComp && cellRenderer && !doesImplementIComponent(jsComp)) { jsComp = this.agCompUtils?.adaptFunction(type, jsComp); } if (!jsComp && !fwComp) { const { validation } = this.beans; if (mandatory && (compName !== defaultName || !defaultName)) { if (compName) { if (!validation?.isProvidedUserComp(compName)) { _error(50, { compName }); } } else if (defaultName) { if (!validation) { _error(260, { ...this.gos.getModuleErrorParams(), propName: name, compName: defaultName }); } } else { _error(216, { name }); } } else if (defaultName && !validation) { _error(146, { comp: defaultName }); } return; } const paramsMerged = this.mergeParams( defObject, type, params, paramsFromSelector, defaultCompParams, defaultCompProcessParams ); const componentFromFramework = jsComp == null; const componentClass = jsComp ?? fwComp; return { componentFromFramework, componentClass, params: paramsMerged, type, popupFromSelector, popupPositionFromSelector, newAgStackInstance: () => this.newAgStackInstance(componentClass, componentFromFramework, paramsMerged, type) }; } newAgStackInstance(ComponentClass, componentFromFramework, params, type) { const jsComponent = !componentFromFramework; let instance; if (jsComponent) { instance = new ComponentClass(); } else { instance = this.frameworkCompWrapper.wrap( ComponentClass, type.mandatoryMethods, type.optionalMethods, type ); } this.createBean(instance); const deferredInit = instance.init?.(params); if (deferredInit == null) { return AgPromise.resolve(instance); } return deferredInit.then(() => instance); } /** * merges params with application provided params * used by Floating Filter */ mergeParams(defObject, type, paramsFromGrid, paramsFromSelector = null, defaultCompParams, defaultCompProcessParams) { const params = { ...paramsFromGrid, ...defaultCompParams }; const defObjectAny = defObject; const userParams = defObjectAny?.[type.name + "Params"]; if (typeof userParams === "function") { const userParamsFromFunc = userParams(paramsFromGrid); _mergeDeep(params, userParamsFromFunc); } else if (typeof userParams === "object") { _mergeDeep(params, userParams); } _mergeDeep(params, paramsFromSelector); return defaultCompProcessParams ? defaultCompProcessParams(params) : params; } }; var DateComponent = { name: "dateComponent", mandatoryMethods: ["getDate", "setDate"], optionalMethods: ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled", "refresh"] }; var DragAndDropImageComponent = { name: "dragAndDropImageComponent", mandatoryMethods: ["setIcon", "setLabel"] }; var HeaderComponent = { name: "headerComponent", optionalMethods: ["refresh"] }; var InnerHeaderComponent = { name: "innerHeaderComponent" }; var InnerHeaderGroupComponent = { name: "innerHeaderGroupComponent" }; var HeaderGroupComponent = { name: "headerGroupComponent" }; var InnerCellRendererComponent = { name: "innerRenderer", cellRenderer: true, optionalMethods: ["afterGuiAttached"] }; var CellRendererComponent = { name: "cellRenderer", optionalMethods: ["refresh", "afterGuiAttached"], cellRenderer: true }; var EditorRendererComponent = { name: "cellRenderer", optionalMethods: ["refresh", "afterGuiAttached"] }; var LoadingCellRendererComponent = { name: "loadingCellRenderer", cellRenderer: true }; var CellEditorComponent = { name: "cellEditor", mandatoryMethods: ["getValue"], optionalMethods: [ "isPopup", "isCancelBeforeStart", "isCancelAfterEnd", "getPopupPosition", "focusIn", "focusOut", "afterGuiAttached", "refresh" ] }; var TooltipComponent = { name: "tooltipComponent" }; var FilterComponent = { name: "filter", mandatoryMethods: ["isFilterActive", "doesFilterPass", "getModel", "setModel"], optionalMethods: [ "afterGuiAttached", "afterGuiDetached", "onNewRowsLoaded", "getModelAsString", "onFloatingFilterChanged", "onAnyFilterChanged", "refresh" ] }; var FloatingFilterComponent = { name: "floatingFilterComponent", mandatoryMethods: ["onParentModelChanged"], optionalMethods: ["afterGuiAttached", "refresh"] }; var FullWidth = { name: "fullWidthCellRenderer", optionalMethods: ["refresh", "afterGuiAttached"], cellRenderer: true }; var FullWidthLoading = { name: "loadingCellRenderer", cellRenderer: true }; var FullWidthGroup = { name: "groupRowRenderer", optionalMethods: ["afterGuiAttached"], cellRenderer: true }; var FullWidthDetail = { name: "detailCellRenderer", optionalMethods: ["refresh"], cellRenderer: true }; function _getDragAndDropImageCompDetails(userCompFactory, params) { return userCompFactory.getCompDetailsFromGridOptions(DragAndDropImageComponent, "agDragAndDropImage", params, true); } function _getInnerCellRendererDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, InnerCellRendererComponent, void 0, params); } function _getHeaderCompDetails(userCompFactory, colDef, params) { return userCompFactory.getCompDetails(colDef, HeaderComponent, "agColumnHeader", params); } function _getInnerHeaderCompDetails(userCompFactory, headerCompParams, params) { return userCompFactory.getCompDetails(headerCompParams, InnerHeaderComponent, void 0, params); } function _getHeaderGroupCompDetails(userCompFactory, params) { const colGroupDef = params.columnGroup.getColGroupDef(); return userCompFactory.getCompDetails(colGroupDef, HeaderGroupComponent, "agColumnGroupHeader", params); } function _getInnerHeaderGroupCompDetails(userCompFactory, headerGroupCompParams, params) { return userCompFactory.getCompDetails(headerGroupCompParams, InnerHeaderGroupComponent, void 0, params); } function _getFullWidthCellRendererDetails(userCompFactory, params) { return userCompFactory.getCompDetailsFromGridOptions(FullWidth, void 0, params, true); } function _getFullWidthLoadingCellRendererDetails(userCompFactory, params) { return userCompFactory.getCompDetailsFromGridOptions(FullWidthLoading, "agLoadingCellRenderer", params, true); } function _getFullWidthGroupCellRendererDetails(userCompFactory, params) { return userCompFactory.getCompDetailsFromGridOptions(FullWidthGroup, "agGroupRowRenderer", params, true); } function _getFullWidthDetailCellRendererDetails(userCompFactory, params) { return userCompFactory.getCompDetailsFromGridOptions(FullWidthDetail, "agDetailCellRenderer", params, true); } function _getCellRendererDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, CellRendererComponent, void 0, params); } function _getEditorRendererDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails( def, EditorRendererComponent, void 0, params ); } function _getLoadingCellRendererDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, LoadingCellRendererComponent, "agSkeletonCellRenderer", params, true); } function _getCellEditorDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, CellEditorComponent, "agCellEditor", params, true); } function _getFilterDetails(userCompFactory, def, params, defaultFilter) { const filter = def.filter; if (isColumnFilterComp(filter)) { def = { filter: filter.component, filterParams: def.filterParams }; } return userCompFactory.getCompDetails(def, FilterComponent, defaultFilter, params, true); } function _getDateCompDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, DateComponent, "agDateInput", params, true); } function _getTooltipCompDetails(userCompFactory, params) { return userCompFactory.getCompDetails(params.colDef, TooltipComponent, "agTooltipComponent", params, true); } function _getFloatingFilterCompDetails(userCompFactory, def, params, defaultFloatingFilter) { return userCompFactory.getCompDetails(def, FloatingFilterComponent, defaultFloatingFilter, params); } function _getFilterCompKeys(frameworkOverrides, def) { return _getUserCompKeys(frameworkOverrides, def, FilterComponent); } function _mergeFilterParamsWithApplicationProvidedParams(userCompFactory, defObject, paramsFromGrid) { return userCompFactory.mergeParams(defObject, FilterComponent, paramsFromGrid); } var DragSourceType = /* @__PURE__ */ ((DragSourceType2) => { DragSourceType2[DragSourceType2["ToolPanel"] = 0] = "ToolPanel"; DragSourceType2[DragSourceType2["HeaderCell"] = 1] = "HeaderCell"; DragSourceType2[DragSourceType2["RowDrag"] = 2] = "RowDrag"; DragSourceType2[DragSourceType2["ChartPanel"] = 3] = "ChartPanel"; DragSourceType2[DragSourceType2["AdvancedFilterBuilder"] = 4] = "AdvancedFilterBuilder"; return DragSourceType2; })(DragSourceType || {}); var DragAndDropService = class extends BaseDragAndDropService { createEvent(event) { return _addGridCommonParams(this.gos, event); } createDragImageComp(dragSource) { const { gos, beans } = this; const userCompDetails = _getDragAndDropImageCompDetails( beans.userCompFactory, _addGridCommonParams(gos, { dragSource }) ); return userCompDetails?.newAgStackInstance(); } handleEnter(dragSource, dragItem) { dragSource?.onGridEnter?.(dragItem); } handleExit(dragSource, dragItem) { dragSource?.onGridExit?.(dragItem); } warnNoBody() { _warn(54); } isDropZoneWithinThisGrid(draggingEvent) { return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(draggingEvent.dropZoneTarget); } registerGridDropTarget(elementFn, ctrl) { const dropTarget = { getContainer: elementFn, isInterestedIn: (type) => type === 1 || type === 0, getIconName: () => "notAllowed" }; this.addDropTarget(dropTarget); ctrl.addDestroyFunc(() => this.removeDropTarget(dropTarget)); } }; function isCombinedFilterModel(model) { return !!model.operator; } var RESIZE_CONTAINER_STYLE = "ag-resizer-wrapper"; var makeDiv = (dataRefPrefix, classSuffix) => ({ tag: "div", ref: `${dataRefPrefix}Resizer`, cls: `ag-resizer ag-resizer-${classSuffix}` }); var RESIZE_TEMPLATE = { tag: "div", cls: RESIZE_CONTAINER_STYLE, children: [ makeDiv("eTopLeft", "topLeft"), makeDiv("eTop", "top"), makeDiv("eTopRight", "topRight"), makeDiv("eRight", "right"), makeDiv("eBottomRight", "bottomRight"), makeDiv("eBottom", "bottom"), makeDiv("eBottomLeft", "bottomLeft"), makeDiv("eLeft", "left") ] }; var AgPositionableFeature = class extends AgBeanStub { constructor(element, config) { super(); this.element = element; this.dragStartPosition = { x: 0, y: 0 }; this.position = { x: 0, y: 0 }; this.lastSize = { width: -1, height: -1 }; this.positioned = false; this.resizersAdded = false; this.resizeListeners = []; this.boundaryEl = null; this.isResizing = false; this.isMoving = false; this.resizable = {}; this.movable = false; this.currentResizer = null; this.config = { popup: false, ...config }; } wireBeans(beans) { this.popupSvc = beans.popupSvc; this.dragSvc = beans.dragSvc; } center(postProcessCallback) { const { clientHeight, clientWidth } = this.offsetParent; const x = clientWidth / 2 - this.getWidth() / 2; const y = clientHeight / 2 - this.getHeight() / 2; this.offsetElement(x, y, postProcessCallback); } initialisePosition(postProcessCallback) { if (this.positioned) { return; } const { centered, forcePopupParentAsOffsetParent, minWidth, width, minHeight, height, x, y } = this.config; if (!this.offsetParent) { this.setOffsetParent(); } let computedMinHeight = 0; let computedMinWidth = 0; const isElementVisible = _isVisible(this.element); if (isElementVisible) { const boundaryEl = this.findBoundaryElement(); const offsetParentComputedStyles = window.getComputedStyle(boundaryEl); if (offsetParentComputedStyles.minWidth != null) { const paddingWidth = boundaryEl.offsetWidth - this.element.offsetWidth; computedMinWidth = Number.parseInt(offsetParentComputedStyles.minWidth, 10) - paddingWidth; } if (offsetParentComputedStyles.minHeight != null) { const paddingHeight = boundaryEl.offsetHeight - this.element.offsetHeight; computedMinHeight = Number.parseInt(offsetParentComputedStyles.minHeight, 10) - paddingHeight; } } this.minHeight = minHeight || computedMinHeight; this.minWidth = minWidth || computedMinWidth; if (width) { this.setWidth(width); } if (height) { this.setHeight(height); } if (!width || !height) { this.refreshSize(); } if (centered) { this.center(postProcessCallback); } else if (x || y) { this.offsetElement(x, y, postProcessCallback); } else if (isElementVisible && forcePopupParentAsOffsetParent) { let boundaryEl = this.boundaryEl; let initialisedDuringPositioning = true; if (!boundaryEl) { boundaryEl = this.findBoundaryElement(); initialisedDuringPositioning = false; } if (boundaryEl) { const top = Number.parseFloat(boundaryEl.style.top); const left = Number.parseFloat(boundaryEl.style.left); if (initialisedDuringPositioning) { this.offsetElement(Number.isNaN(left) ? 0 : left, Number.isNaN(top) ? 0 : top, postProcessCallback); } else { this.setPosition(left, top); } } } this.positioned = !!this.offsetParent; } isPositioned() { return this.positioned; } getPosition() { return this.position; } setMovable(movable, moveElement) { if (!this.config.popup || movable === this.movable) { return; } this.movable = movable; const params = this.moveElementDragListener || { eElement: moveElement, onDragStart: this.onMoveStart.bind(this), onDragging: this.onMove.bind(this), onDragStop: this.onMoveEnd.bind(this) }; if (movable) { this.dragSvc?.addDragSource(params); this.moveElementDragListener = params; } else { this.dragSvc?.removeDragSource(params); this.moveElementDragListener = void 0; } } setResizable(resizable) { this.clearResizeListeners(); if (resizable) { this.addResizers(); } else { this.removeResizers(); } if (typeof resizable === "boolean") { if (resizable === false) { return; } resizable = { topLeft: resizable, top: resizable, topRight: resizable, right: resizable, bottomRight: resizable, bottom: resizable, bottomLeft: resizable, left: resizable }; } for (const side of Object.keys(resizable)) { const isSideResizable = !!resizable[side]; const resizerEl = this.getResizerElement(side); const params = { dragStartPixels: 0, eElement: resizerEl, onDragStart: (e) => this.onResizeStart(e, side), onDragging: this.onResize.bind(this), onDragStop: (e) => this.onResizeEnd(e, side) }; if (isSideResizable || !this.isAlive() && !isSideResizable) { if (isSideResizable) { this.dragSvc?.addDragSource(params); this.resizeListeners.push(params); resizerEl.style.pointerEvents = "all"; } else { resizerEl.style.pointerEvents = "none"; } this.resizable[side] = isSideResizable; } } } removeSizeFromEl() { this.element.style.removeProperty("height"); this.element.style.removeProperty("width"); this.element.style.removeProperty("flex"); } restoreLastSize() { this.element.style.flex = "0 0 auto"; const { height, width } = this.lastSize; if (width !== -1) { this.element.style.width = `${width}px`; } if (height !== -1) { this.element.style.height = `${height}px`; } } getHeight() { return this.element.offsetHeight; } setHeight(height) { const { popup } = this.config; const eGui = this.element; let isPercent = false; if (typeof height === "string" && height.includes("%")) { _setFixedHeight(eGui, height); height = _getAbsoluteHeight(eGui); isPercent = true; } else { height = Math.max(this.minHeight, height); if (this.positioned) { const availableHeight = this.getAvailableHeight(); if (availableHeight && height > availableHeight) { height = availableHeight; } } } if (this.getHeight() === height) { return; } if (isPercent) { eGui.style.maxHeight = "unset"; eGui.style.minHeight = "unset"; } else if (popup) { _setFixedHeight(eGui, height); } else { eGui.style.height = `${height}px`; eGui.style.flex = "0 0 auto"; this.lastSize.height = typeof height === "number" ? height : Number.parseFloat(height); } } getAvailableHeight() { const { popup, forcePopupParentAsOffsetParent } = this.config; if (!this.positioned) { this.initialisePosition(); } const { clientHeight } = this.offsetParent; if (!clientHeight) { return null; } const elRect = this.element.getBoundingClientRect(); const offsetParentRect = this.offsetParent.getBoundingClientRect(); const yPosition = popup ? this.position.y : elRect.top; const parentTop = popup ? 0 : offsetParentRect.top; let additionalHeight = 0; if (forcePopupParentAsOffsetParent) { const parentEl = this.element.parentElement; if (parentEl) { const { bottom } = parentEl.getBoundingClientRect(); additionalHeight = bottom - elRect.bottom; } } const availableHeight = clientHeight + parentTop - yPosition - additionalHeight; return availableHeight; } getWidth() { return this.element.offsetWidth; } setWidth(width) { const eGui = this.element; const { popup } = this.config; let isPercent = false; if (typeof width === "string" && width.includes("%")) { _setFixedWidth(eGui, width); width = _getAbsoluteWidth(eGui); isPercent = true; } else if (this.positioned) { width = Math.max(this.minWidth, width); const { clientWidth } = this.offsetParent; const xPosition = popup ? this.position.x : this.element.getBoundingClientRect().left; if (clientWidth && width + xPosition > clientWidth) { width = clientWidth - xPosition; } } if (this.getWidth() === width) { return; } if (isPercent) { eGui.style.maxWidth = "unset"; eGui.style.minWidth = "unset"; } else if (this.config.popup) { _setFixedWidth(eGui, width); } else { eGui.style.width = `${width}px`; eGui.style.flex = " unset"; this.lastSize.width = typeof width === "number" ? width : Number.parseFloat(width); } } offsetElement(x = 0, y = 0, postProcessCallback) { const { forcePopupParentAsOffsetParent } = this.config; const ePopup = forcePopupParentAsOffsetParent ? this.boundaryEl : this.element; if (!ePopup) { return; } this.popupSvc?.positionPopup({ ePopup, keepWithinBounds: true, skipObserver: this.movable || this.isResizable(), updatePosition: () => ({ x, y }), postProcessCallback }); this.setPosition(Number.parseFloat(ePopup.style.left), Number.parseFloat(ePopup.style.top)); } constrainSizeToAvailableHeight(constrain) { if (!this.config.forcePopupParentAsOffsetParent) { return; } const applyMaxHeightToElement = () => { const availableHeight = this.getAvailableHeight(); this.element.style.setProperty("max-height", `${availableHeight}px`); }; if (constrain && this.popupSvc) { this.resizeObserverSubscriber?.(); this.resizeObserverSubscriber = _observeResize( this.beans, this.popupSvc?.getPopupParent(), applyMaxHeightToElement ); } else { this.element.style.removeProperty("max-height"); if (this.resizeObserverSubscriber) { this.resizeObserverSubscriber(); this.resizeObserverSubscriber = void 0; } } } setPosition(x, y) { this.position.x = x; this.position.y = y; } updateDragStartPosition(x, y) { this.dragStartPosition = { x, y }; } calculateMouseMovement(params) { const { e, isLeft, isTop, anywhereWithin, topBuffer } = params; const xDiff = e.clientX - this.dragStartPosition.x; const yDiff = e.clientY - this.dragStartPosition.y; const movementX = this.shouldSkipX(e, !!isLeft, !!anywhereWithin, xDiff) ? 0 : xDiff; const movementY = this.shouldSkipY(e, !!isTop, topBuffer, yDiff) ? 0 : yDiff; return { movementX, movementY }; } shouldSkipX(e, isLeft, anywhereWithin, diff) { const elRect = this.element.getBoundingClientRect(); const parentRect = this.offsetParent.getBoundingClientRect(); const boundaryElRect = this.boundaryEl.getBoundingClientRect(); const xPosition = this.config.popup ? this.position.x : elRect.left; let skipX = xPosition <= 0 && parentRect.left >= e.clientX || parentRect.right <= e.clientX && parentRect.right <= boundaryElRect.right; if (skipX) { return true; } if (isLeft) { skipX = // skip if we are moving to the left and the cursor // is positioned to the right of the left side anchor diff < 0 && e.clientX > xPosition + parentRect.left || // skip if we are moving to the right and the cursor // is positioned to the left of the dialog diff > 0 && e.clientX < xPosition + parentRect.left; } else if (anywhereWithin) { skipX = diff < 0 && e.clientX > boundaryElRect.right || diff > 0 && e.clientX < xPosition + parentRect.left; } else { skipX = // if the movement is bound to the right side of the dialog // we skip if we are moving to the left and the cursor // is to the right of the dialog diff < 0 && e.clientX > boundaryElRect.right || // or skip if we are moving to the right and the cursor // is to the left of the right side anchor diff > 0 && e.clientX < boundaryElRect.right; } return skipX; } shouldSkipY(e, isTop, topBuffer = 0, diff) { const elRect = this.element.getBoundingClientRect(); const parentRect = this.offsetParent.getBoundingClientRect(); const boundaryElRect = this.boundaryEl.getBoundingClientRect(); const yPosition = this.config.popup ? this.position.y : elRect.top; let skipY = yPosition <= 0 && parentRect.top >= e.clientY || parentRect.bottom <= e.clientY && parentRect.bottom <= boundaryElRect.bottom; if (skipY) { return true; } if (isTop) { skipY = // skip if we are moving to towards top and the cursor is // below the top anchor + topBuffer // note: topBuffer is used when moving the dialog using the title bar diff < 0 && e.clientY > yPosition + parentRect.top + topBuffer || // skip if we are moving to the bottom and the cursor is // above the top anchor diff > 0 && e.clientY < yPosition + parentRect.top; } else { skipY = // skip if we are moving towards the top and the cursor // is below the bottom anchor diff < 0 && e.clientY > boundaryElRect.bottom || // skip if we are moving towards the bottom and the cursor // is above the bottom anchor diff > 0 && e.clientY < boundaryElRect.bottom; } return skipY; } createResizeMap() { const getElement2 = (ref) => ({ element: this.element.querySelector(`[data-ref=${ref}Resizer]`) }); this.resizerMap = { topLeft: getElement2("eTopLeft"), top: getElement2("eTop"), topRight: getElement2("eTopRight"), right: getElement2("eRight"), bottomRight: getElement2("eBottomRight"), bottom: getElement2("eBottom"), bottomLeft: getElement2("eBottomLeft"), left: getElement2("eLeft") }; } addResizers() { if (this.resizersAdded) { return; } const eGui = this.element; if (!eGui) { return; } eGui.appendChild(_createAgElement(RESIZE_TEMPLATE)); this.createResizeMap(); this.resizersAdded = true; } removeResizers() { this.resizerMap = void 0; const resizerEl = this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`); resizerEl?.remove(); this.resizersAdded = false; } getResizerElement(side) { return this.resizerMap[side].element; } onResizeStart(e, side) { this.boundaryEl = this.findBoundaryElement(); if (!this.positioned) { this.initialisePosition(); } this.currentResizer = { isTop: !!side.match(/top/i), isRight: !!side.match(/right/i), isBottom: !!side.match(/bottom/i), isLeft: !!side.match(/left/i) }; this.element.classList.add("ag-resizing"); this.resizerMap[side].element.classList.add("ag-active"); const { popup, forcePopupParentAsOffsetParent } = this.config; if (!popup && !forcePopupParentAsOffsetParent) { this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop); } this.isResizing = true; this.updateDragStartPosition(e.clientX, e.clientY); } getSiblings() { const element = this.element; const parent = element.parentElement; if (!parent) { return null; } return Array.prototype.slice.call(parent.children).filter((el) => !el.classList.contains("ag-hidden")); } getMinSizeOfSiblings() { const siblings = this.getSiblings() || []; let height = 0; let width = 0; for (const currentEl of siblings) { const isFlex = !!currentEl.style.flex && currentEl.style.flex !== "0 0 auto"; if (currentEl === this.element) { continue; } let nextHeight = this.minHeight || 0; let nextWidth = this.minWidth || 0; if (isFlex) { const computedStyle = window.getComputedStyle(currentEl); if (computedStyle.minHeight) { nextHeight = Number.parseInt(computedStyle.minHeight, 10); } if (computedStyle.minWidth) { nextWidth = Number.parseInt(computedStyle.minWidth, 10); } } else { nextHeight = currentEl.offsetHeight; nextWidth = currentEl.offsetWidth; } height += nextHeight; width += nextWidth; } return { height, width }; } applySizeToSiblings(vertical) { let containerToFlex = null; const siblings = this.getSiblings(); if (!siblings) { return; } for (let i = 0; i < siblings.length; i++) { const el = siblings[i]; if (el === containerToFlex) { continue; } if (vertical) { el.style.height = `${el.offsetHeight}px`; } else { el.style.width = `${el.offsetWidth}px`; } el.style.flex = "0 0 auto"; if (el === this.element) { containerToFlex = siblings[i + 1]; } } if (containerToFlex) { containerToFlex.style.removeProperty("height"); containerToFlex.style.removeProperty("min-height"); containerToFlex.style.removeProperty("max-height"); containerToFlex.style.flex = "1 1 auto"; } } isResizable() { return Object.values(this.resizable).some((value) => value); } onResize(e) { if (!this.isResizing || !this.currentResizer) { return; } const { popup, forcePopupParentAsOffsetParent } = this.config; const { isTop, isRight, isBottom, isLeft } = this.currentResizer; const isHorizontal = isRight || isLeft; const isVertical = isBottom || isTop; const { movementX, movementY } = this.calculateMouseMovement({ e, isLeft, isTop }); const xPosition = this.position.x; const yPosition = this.position.y; let offsetLeft = 0; let offsetTop = 0; if (isHorizontal && movementX) { const direction = isLeft ? -1 : 1; const oldWidth = this.getWidth(); const newWidth = oldWidth + movementX * direction; let skipWidth = false; if (isLeft) { offsetLeft = oldWidth - newWidth; if (xPosition + offsetLeft <= 0 || newWidth <= this.minWidth) { skipWidth = true; offsetLeft = 0; } } if (!skipWidth) { this.setWidth(newWidth); } } if (isVertical && movementY) { const direction = isTop ? -1 : 1; const oldHeight = this.getHeight(); const newHeight = oldHeight + movementY * direction; let skipHeight = false; if (isTop) { offsetTop = oldHeight - newHeight; if (yPosition + offsetTop <= 0 || newHeight <= this.minHeight) { skipHeight = true; offsetTop = 0; } } else if ( // do not let the size of all siblings be higher than the parent container !this.config.popup && !this.config.forcePopupParentAsOffsetParent && oldHeight < newHeight && this.getMinSizeOfSiblings().height + newHeight > this.element.parentElement.offsetHeight ) { skipHeight = true; } if (!skipHeight) { this.setHeight(newHeight); } } this.updateDragStartPosition(e.clientX, e.clientY); if ((popup || forcePopupParentAsOffsetParent) && offsetLeft || offsetTop) { this.offsetElement(xPosition + offsetLeft, yPosition + offsetTop); } } onResizeEnd(e, side) { this.isResizing = false; this.currentResizer = null; this.boundaryEl = null; this.element.classList.remove("ag-resizing"); this.resizerMap[side].element.classList.remove("ag-active"); this.dispatchLocalEvent({ type: "resize" }); } refreshSize() { const eGui = this.element; if (this.config.popup) { if (!this.config.width) { this.setWidth(eGui.offsetWidth); } if (!this.config.height) { this.setHeight(eGui.offsetHeight); } } } onMoveStart(e) { this.boundaryEl = this.findBoundaryElement(); if (!this.positioned) { this.initialisePosition(); } this.isMoving = true; this.element.classList.add("ag-moving"); this.updateDragStartPosition(e.clientX, e.clientY); } onMove(e) { if (!this.isMoving) { return; } const { x, y } = this.position; let topBuffer; if (this.config.calculateTopBuffer) { topBuffer = this.config.calculateTopBuffer(); } const { movementX, movementY } = this.calculateMouseMovement({ e, isTop: true, anywhereWithin: true, topBuffer }); this.offsetElement(x + movementX, y + movementY); this.updateDragStartPosition(e.clientX, e.clientY); } onMoveEnd() { this.isMoving = false; this.boundaryEl = null; this.element.classList.remove("ag-moving"); } setOffsetParent() { if (this.config.forcePopupParentAsOffsetParent && this.popupSvc) { this.offsetParent = this.popupSvc.getPopupParent(); } else { this.offsetParent = this.element.offsetParent; } } findBoundaryElement() { let el = this.element; while (el) { if (window.getComputedStyle(el).position !== "static") { return el; } el = el.parentElement; } return this.element; } clearResizeListeners() { while (this.resizeListeners.length) { const params = this.resizeListeners.pop(); this.dragSvc?.removeDragSource(params); } } destroy() { super.destroy(); if (this.moveElementDragListener) { this.dragSvc?.removeDragSource(this.moveElementDragListener); } this.constrainSizeToAvailableHeight(false); this.clearResizeListeners(); this.removeResizers(); } }; var PositionableFeature = class extends AgPositionableFeature { }; var RefPlaceholder = null; function _isComponent(item) { return typeof item?.getGui === "function"; } var CssClassManager = class { constructor(getGui) { this.cssClassStates = {}; this.getGui = getGui; } toggleCss(className, addOrRemove) { if (!className) { return; } if (className.includes(" ")) { const list = (className || "").split(" "); if (list.length > 1) { for (const cls of list) { this.toggleCss(cls, addOrRemove); } return; } } const updateNeeded = this.cssClassStates[className] !== addOrRemove; if (updateNeeded && className.length) { this.getGui()?.classList.toggle(className, addOrRemove); this.cssClassStates[className] = addOrRemove; } } }; var compIdSequence = 0; var AgComponentStub = class extends AgBeanStub { constructor(templateOrParams, componentSelectors) { super(); this.suppressDataRefValidation = false; this.displayed = true; this.visible = true; this.compId = compIdSequence++; this.cssManager = new CssClassManager(() => this.eGui); this.componentSelectors = new Map((componentSelectors ?? []).map((comp) => [comp.selector, comp])); if (templateOrParams) { this.setTemplate(templateOrParams); } } preConstruct() { this.wireTemplate(this.getGui()); this.addGlobalCss(); } wireTemplate(element, paramsMap) { if (element && this.gos) { this.applyElementsToComponent(element); this.createChildComponentsFromTags(element, paramsMap); } } getCompId() { return this.compId; } getDataRefAttribute(element) { if (element.getAttribute) { return element.getAttribute(DataRefAttribute); } return null; } applyElementsToComponent(element, elementRef, paramsMap, newComponent = null) { if (elementRef === void 0) { elementRef = this.getDataRefAttribute(element); } if (elementRef) { const current = this[elementRef]; if (current === RefPlaceholder) { this[elementRef] = newComponent ?? element; } else { const usedAsParamRef = paramsMap?.[elementRef]; if (!this.suppressDataRefValidation && !usedAsParamRef) { throw new Error(`data-ref: ${elementRef} on ${this.constructor.name} with ${current}`); } } } } // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag createChildComponentsFromTags(parentNode, paramsMap) { const childNodeList = []; for (const childNode of parentNode.childNodes ?? []) { childNodeList.push(childNode); } for (const childNode of childNodeList) { if (!(childNode instanceof HTMLElement)) { continue; } const childComp = this.createComponentFromElement( childNode, (childComp2) => { const childGui = childComp2.getGui(); if (childGui) { for (const attr of childNode.attributes ?? []) { childGui.setAttribute(attr.name, attr.value); } } }, paramsMap ); if (childComp) { if (childComp.addItems && childNode.children.length) { this.createChildComponentsFromTags(childNode, paramsMap); const items = Array.prototype.slice.call(childNode.children); childComp.addItems(items); } this.swapComponentForNode(childComp, parentNode, childNode); } else if (childNode.childNodes) { this.createChildComponentsFromTags(childNode, paramsMap); } } } createComponentFromElement(element, afterPreCreateCallback, paramsMap) { const key = element.nodeName; const elementRef = this.getDataRefAttribute(element); const isAgGridComponent = key.indexOf("AG-") === 0; const componentSelector = isAgGridComponent ? this.componentSelectors.get(key) : null; let newComponent = null; if (componentSelector) { const componentParams = paramsMap && elementRef ? paramsMap[elementRef] : void 0; newComponent = new componentSelector.component(componentParams); newComponent.setParentComponent( this ); this.createBean(newComponent, null, afterPreCreateCallback); } else if (isAgGridComponent) { throw new Error(`selector: ${key}`); } this.applyElementsToComponent(element, elementRef, paramsMap, newComponent); return newComponent; } swapComponentForNode(newComponent, parentNode, childNode) { const eComponent = newComponent.getGui(); parentNode.replaceChild(eComponent, childNode); parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent); this.addDestroyFunc(this.destroyBean.bind(this, newComponent)); } activateTabIndex(elements, overrideTabIndex) { const tabIndex = overrideTabIndex ?? this.gos.get("tabIndex"); if (!elements) { elements = []; } if (!elements.length) { elements.push(this.getGui()); } for (const el of elements) { el.setAttribute("tabindex", tabIndex.toString()); } } setTemplate(templateOrParams, componentSelectors, paramsMap) { let eGui; if (typeof templateOrParams === "string" || templateOrParams == null) { eGui = _loadTemplate(templateOrParams); } else { eGui = _createAgElement(templateOrParams); } this.setTemplateFromElement(eGui, componentSelectors, paramsMap); } setTemplateFromElement(element, components, paramsMap, suppressDataRefValidation = false) { this.eGui = element; this.suppressDataRefValidation = suppressDataRefValidation; if (components) { for (let i = 0; i < components.length; i++) { const component = components[i]; this.componentSelectors.set(component.selector, component); } } this.wireTemplate(element, paramsMap); } getGui() { return this.eGui; } getFocusableElement() { return this.eGui; } getAriaElement() { return this.getFocusableElement(); } setParentComponent(component) { this.parentComponent = component; } getParentComponent() { return this.parentComponent; } // this method is for older code, that wants to provide the gui element, // it is not intended for this to be in ag-Stack setGui(eGui) { this.eGui = eGui; } queryForHtmlElement(cssSelector) { return this.eGui.querySelector(cssSelector); } getContainerAndElement(newChild, container) { let parent = container; if (newChild == null) { return null; } if (!parent) { parent = this.eGui; } if (_isNodeOrElement(newChild)) { return { element: newChild, parent }; } return { element: newChild.getGui(), parent }; } prependChild(newChild, container) { const { element, parent } = this.getContainerAndElement(newChild, container) || {}; if (!element || !parent) { return; } parent.prepend(element); } appendChild(newChild, container) { const { element, parent } = this.getContainerAndElement(newChild, container) || {}; if (!element || !parent) { return; } parent.appendChild(element); } isDisplayed() { return this.displayed; } setVisible(visible, options = {}) { if (visible !== this.visible) { this.visible = visible; const { skipAriaHidden } = options; _setVisible(this.eGui, visible, { skipAriaHidden }); } } setDisplayed(displayed, options = {}) { if (displayed !== this.displayed) { this.displayed = displayed; const { skipAriaHidden } = options; _setDisplayed(this.eGui, displayed, { skipAriaHidden }); const event = { type: "displayChanged", visible: this.displayed }; this.dispatchLocalEvent(event); } } destroy() { if (this.parentComponent) { this.parentComponent = void 0; } super.destroy(); } addGuiEventListener(event, listener, options) { this.eGui.addEventListener(event, listener, options); this.addDestroyFunc(() => this.eGui.removeEventListener(event, listener)); } addCss(className) { this.cssManager.toggleCss(className, true); } removeCss(className) { this.cssManager.toggleCss(className, false); } toggleCss(className, addOrRemove) { this.cssManager.toggleCss(className, addOrRemove); } registerCSS(css) { if (this.css === globalCssAdded) { this.css = [css]; this.addGlobalCss(); } else { this.css || (this.css = []); this.css.push(css); } } addGlobalCss() { if (Array.isArray(this.css)) { const debugId = "component-" + Object.getPrototypeOf(this)?.constructor?.name; for (const css of this.css ?? []) { this.beans.environment.addGlobalCSS(css, debugId); } } this.css = globalCssAdded; } }; var globalCssAdded = Symbol(); var Component = class extends AgComponentStub { }; var isSafari; var isFirefox; var isMacOs; var isIOS; var invisibleScrollbar; var browserScrollbarWidth; var maxDivHeight; function _isBrowserSafari() { if (isSafari === void 0) { isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); } return isSafari; } function _isBrowserFirefox() { if (isFirefox === void 0) { isFirefox = /(firefox)/i.test(navigator.userAgent); } return isFirefox; } function _isMacOsUserAgent() { if (isMacOs === void 0) { isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform); } return isMacOs; } function _isIOSUserAgent() { if (isIOS === void 0) { isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1; } return isIOS; } function _getTabIndex(el) { if (!el) { return null; } const numberTabIndex = el.tabIndex; const tabIndex = el.getAttribute("tabIndex"); if (numberTabIndex === -1 && (tabIndex === null || tabIndex === "" && !_isBrowserFirefox())) { return null; } return numberTabIndex.toString(); } function _getMaxDivHeight() { if (maxDivHeight !== void 0) { return maxDivHeight; } if (!document.body) { return -1; } let res = 1e6; const testUpTo = _isBrowserFirefox() ? 6e6 : 1e9; const div = document.createElement("div"); document.body.appendChild(div); while (true) { const test = res * 2; div.style.height = test + "px"; if (test > testUpTo || div.clientHeight !== test) { break; } else { res = test; } } div.remove(); maxDivHeight = res; return res; } function _getScrollbarWidth() { if (browserScrollbarWidth == null) { initScrollbarWidthAndVisibility(); } return browserScrollbarWidth; } function initScrollbarWidthAndVisibility() { const body = document.body; const div = document.createElement("div"); div.style.width = div.style.height = "100px"; div.style.opacity = "0"; div.style.overflow = "scroll"; div.style.msOverflowStyle = "scrollbar"; div.style.position = "absolute"; body.appendChild(div); let width = div.offsetWidth - div.clientWidth; if (width === 0 && div.clientWidth === 0) { width = null; } if (div.parentNode) { div.remove(); } if (width != null) { browserScrollbarWidth = width; invisibleScrollbar = width === 0; } } function _isInvisibleScrollbar() { if (invisibleScrollbar == null) { initScrollbarWidthAndVisibility(); } return invisibleScrollbar; } var keyboardModeActive = false; var instanceCount = 0; function addKeyboardModeEvents(doc) { if (instanceCount > 0) { return; } doc.addEventListener("keydown", toggleKeyboardMode); doc.addEventListener("mousedown", toggleKeyboardMode); } function removeKeyboardModeEvents(doc) { if (instanceCount > 0) { return; } doc.removeEventListener("keydown", toggleKeyboardMode); doc.removeEventListener("mousedown", toggleKeyboardMode); } function toggleKeyboardMode(event) { const isKeyboardActive = keyboardModeActive; const isKeyboardEvent = event.type === "keydown"; if (isKeyboardEvent) { if (event.ctrlKey || event.metaKey || event.altKey) { return; } } if (isKeyboardActive === isKeyboardEvent) { return; } keyboardModeActive = isKeyboardEvent; } function _registerKeyboardFocusEvents(beans) { const eDocument = _getDocument(beans); addKeyboardModeEvents(eDocument); instanceCount++; return () => { instanceCount--; removeKeyboardModeEvents(eDocument); }; } function _isKeyboardMode() { return keyboardModeActive; } function _findFocusableElements(rootNode, exclude, onlyUnmanaged = false) { const focusableString = FOCUSABLE_SELECTOR; let excludeString = FOCUSABLE_EXCLUDE; if (exclude) { excludeString += ", " + exclude; } if (onlyUnmanaged) { excludeString += ', [tabindex="-1"]'; } const nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString)).filter((node) => { return _isVisible(node); }); const excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString)); if (!excludeNodes.length) { return nodes; } const diff = (a, b) => a.filter((element) => b.indexOf(element) === -1); return diff(nodes, excludeNodes); } function _focusInto(rootNode, up = false, onlyUnmanaged = false, excludeTabGuards = false) { const focusableElements = _findFocusableElements( rootNode, excludeTabGuards ? ".ag-tab-guard" : null, onlyUnmanaged ); const toFocus = up ? _last(focusableElements) : focusableElements[0]; if (toFocus) { toFocus.focus({ preventScroll: true }); return true; } return false; } function _findNextFocusableElement(beans, rootNode, onlyManaged, backwards) { const focusable = _findFocusableElements(rootNode, onlyManaged ? ':not([tabindex="-1"])' : null); const activeEl = _getActiveDomElement(beans); let currentIndex; if (onlyManaged) { currentIndex = focusable.findIndex((el) => el.contains(activeEl)); } else { currentIndex = focusable.indexOf(activeEl); } const nextIndex = currentIndex + (backwards ? -1 : 1); if (nextIndex < 0 || nextIndex >= focusable.length) { return null; } return focusable[nextIndex]; } function _findTabbableParent(node, limit = 5) { let counter = 0; while (node && _getTabIndex(node) === null && ++counter <= limit) { node = node.parentElement; } if (_getTabIndex(node) === null) { return null; } return node; } var FOCUS_MANAGED_CLASS = "ag-focus-managed"; var AgManagedFocusFeature = class extends AgBeanStub { constructor(eFocusable, stopPropagationCallbacks = { isStopPropagation: () => false, stopPropagation: () => { } }, callbacks = {}) { super(); this.eFocusable = eFocusable; this.stopPropagationCallbacks = stopPropagationCallbacks; this.callbacks = callbacks; this.callbacks = { shouldStopEventPropagation: () => false, onTabKeyDown: (e) => { if (e.defaultPrevented) { return; } const nextRoot = _findNextFocusableElement(this.beans, this.eFocusable, false, e.shiftKey); if (!nextRoot) { return; } nextRoot.focus(); e.preventDefault(); }, ...callbacks }; } postConstruct() { const { eFocusable, callbacks: { onFocusIn, onFocusOut } } = this; eFocusable.classList.add(FOCUS_MANAGED_CLASS); this.addKeyDownListeners(eFocusable); if (onFocusIn) { this.addManagedElementListeners(eFocusable, { focusin: onFocusIn }); } if (onFocusOut) { this.addManagedElementListeners(eFocusable, { focusout: onFocusOut }); } } addKeyDownListeners(eGui) { this.addManagedElementListeners(eGui, { keydown: (e) => { if (e.defaultPrevented || this.stopPropagationCallbacks.isStopPropagation(e)) { return; } const { callbacks } = this; if (callbacks.shouldStopEventPropagation(e)) { this.stopPropagationCallbacks.stopPropagation(e); return; } if (e.key === KeyCode.TAB) { callbacks.onTabKeyDown(e); } else if (callbacks.handleKeyDown) { callbacks.handleKeyDown(e); } } }); } }; var AG_GRID_STOP_PROPAGATION = "__ag_Grid_Stop_Propagation"; function _stopPropagationForAgGrid(event) { event[AG_GRID_STOP_PROPAGATION] = true; } function _isStopPropagationForAgGrid(event) { return event[AG_GRID_STOP_PROPAGATION] === true; } var STOP_PROPAGATION_CALLBACKS = { isStopPropagation: _isStopPropagationForAgGrid, stopPropagation: _stopPropagationForAgGrid }; var ManagedFocusFeature = class extends AgManagedFocusFeature { constructor(eFocusable, callbacks) { super(eFocusable, STOP_PROPAGATION_CALLBACKS, callbacks); } }; var FILTER_LOCALE_TEXT = { applyFilter: "Apply", clearFilter: "Clear", resetFilter: "Reset", cancelFilter: "Cancel", textFilter: "Text Filter", numberFilter: "Number Filter", bigintFilter: "BigInt Filter", dateFilter: "Date Filter", setFilter: "Set Filter", filterOoo: "Filter...", empty: "Choose one", equals: "Equals", notEqual: "Does not equal", lessThan: "Less than", greaterThan: "Greater than", inRange: "Between", inRangeStart: "From", inRangeEnd: "To", lessThanOrEqual: "Less than or equal to", greaterThanOrEqual: "Greater than or equal to", contains: "Contains", notContains: "Does not contain", startsWith: "Begins with", endsWith: "Ends with", blank: "Blank", notBlank: "Not blank", before: "Before", after: "After", andCondition: "AND", orCondition: "OR", dateFormatOoo: "yyyy-mm-dd", filterSummaryInactive: "is (All)", filterSummaryContains: "contains", filterSummaryNotContains: "does not contain", filterSummaryTextEquals: "equals", filterSummaryTextNotEqual: "does not equal", filterSummaryStartsWith: "begins with", filterSummaryEndsWith: "ends with", filterSummaryBlank: "is blank", filterSummaryNotBlank: "is not blank", filterSummaryEquals: "=", filterSummaryNotEqual: "!=", filterSummaryGreaterThan: ">", filterSummaryGreaterThanOrEqual: ">=", filterSummaryLessThan: "<", filterSummaryLessThanOrEqual: "<=", filterSummaryInRange: "between", yesterday: "Yesterday", today: "Today", tomorrow: "Tomorrow", last7Days: "Last 7 Days", lastWeek: "Last Week", thisWeek: "This Week", nextWeek: "Next Week", last30Days: "Last 30 Days", lastMonth: "Last Month", thisMonth: "This Month", nextMonth: "Next Month", last90Days: "Last 90 Days", lastQuarter: "Last Quarter", thisQuarter: "This Quarter", nextQuarter: "Next Quarter", lastYear: "Last Year", thisYear: "This Year", yearToDate: "Year To Date", nextYear: "Next Year", last6Months: "Last 6 Months", last12Months: "Last 12 Months", last24Months: "Last 24 Months", filterSummaryInRangeValues: (variableValues) => `(${variableValues[0]}, ${variableValues[1]})`, filterSummaryTextQuote: (variableValues) => `"${variableValues[0]}"`, minDateValidation: (variableValues) => `Date must be after ${variableValues[0]}`, maxDateValidation: (variableValues) => `Date must be before ${variableValues[0]}`, strictMinValueValidation: (variableValues) => `Must be greater than ${variableValues[0]}`, strictMaxValueValidation: (variableValues) => `Must be less than ${variableValues[0]}` }; function translateForFilter(bean, key, variableValues) { return _translate(bean, FILTER_LOCALE_TEXT, key, variableValues); } function getDebounceMs(params, debounceDefault) { const { debounceMs } = params; if (_isUseApplyButton(params)) { if (debounceMs != null) { _warn(71); } return 0; } return debounceMs ?? debounceDefault; } function _isUseApplyButton(params) { return (params.buttons?.indexOf("apply") ?? -1) >= 0; } function getPlaceholderText(bean, filterPlaceholder, defaultPlaceholder, filterOptionKey) { let placeholder = translateForFilter(bean, defaultPlaceholder); if (typeof filterPlaceholder === "function") { const filterOption = translateForFilter(bean, filterOptionKey); placeholder = filterPlaceholder({ filterOptionKey, filterOption, placeholder }); } else if (typeof filterPlaceholder === "string") { placeholder = filterPlaceholder; } return placeholder; } var ProvidedFilter = class extends Component { constructor(filterNameKey, cssIdentifier) { super(); this.filterNameKey = filterNameKey; this.cssIdentifier = cssIdentifier; this.applyActive = false; this.debouncePending = false; this.defaultDebounceMs = 0; } postConstruct() { const element = { tag: "div", cls: `ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`, children: [this.createBodyTemplate()] }; this.setTemplate(element, this.getAgComponents()); this.createManagedBean( new ManagedFocusFeature(this.getFocusableElement(), { handleKeyDown: this.handleKeyDown.bind(this) }) ); this.positionableFeature = this.createBean( new PositionableFeature(this.getPositionableElement(), { forcePopupParentAsOffsetParent: true }) ); } handleKeyDown(_e) { } init(legacyParams) { const params = legacyParams; this.setParams(params); this.setModelIntoUi(params.state.model, true).then(() => this.updateUiVisibility()); } areStatesEqual(stateA, stateB) { return stateA === stateB; } refresh(legacyNewParams) { const newParams = legacyNewParams; const oldParams = this.params; this.params = newParams; const { source, state: newState, additionalEventAttributes } = newParams; if (source === "colDef") { this.updateParams(newParams, oldParams); } const oldState = this.state; this.state = newState; const fromAction = additionalEventAttributes?.fromAction; if (fromAction && fromAction !== "apply" || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) { this.setModelIntoUi(newState.model); } return true; } /** Called on init only. Override in subclasses */ setParams(params) { this.params = params; this.state = params.state; this.commonUpdateParams(params); } /** Called on refresh only. Override in subclasses */ updateParams(newParams, oldParams) { this.commonUpdateParams(newParams, oldParams); } commonUpdateParams(newParams, _oldParams) { this.applyActive = _isUseApplyButton(newParams); this.setupApplyDebounced(); } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ doesFilterPass(params) { _warn(283); const { getHandler, model, column } = this.params; return getHandler().doesFilterPass({ ...params, model, handlerParams: this.beans.colFilter.getHandlerParams(column) }); } getFilterTitle() { return this.translate(this.filterNameKey); } /** * @deprecated v34 Filters are active when they have a model. Use `api.getColumnFilterModel()` instead. */ isFilterActive() { _warn(284); return this.params.model != null; } setupApplyDebounced() { const debounceMs = getDebounceMs(this.params, this.defaultDebounceMs); const debounceFunc = _debounce(this, this.checkApplyDebounce.bind(this), debounceMs); this.applyDebounced = () => { this.debouncePending = true; debounceFunc(); }; } checkApplyDebounce() { if (this.debouncePending) { this.debouncePending = false; this.doApplyModel(); } } /** * @deprecated v34 Use (`api.getColumnFilterModel()`) instead. */ getModel() { _warn(285); return this.params.model; } /** * @deprecated v34 Use (`api.setColumnFilterModel()`) instead. */ setModel(model) { _warn(286); const { beans, params } = this; return beans.colFilter.setModelForColumnLegacy(params.column, model); } /** * Applies changes made in the UI to the filter, and returns true if the model has changed. */ applyModel(_source = "api") { return this.doApplyModel(); } canApply(_model) { return true; } doApplyModel(additionalEventAttributes) { const { params, state: { valid = true, model } } = this; if (!valid) { return false; } const changed = !this.areModelsEqual(params.model, model); if (changed) { params.onAction("apply", additionalEventAttributes); } return changed; } /** * @deprecated v34 Internal method - should only be called by the grid. */ onNewRowsLoaded() { } /** * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can * be adjusted by using the apply parameter. */ onUiChanged(apply, afterFloatingFilter = false) { this.updateUiVisibility(); const model = this.getModelFromUi(); const state = { model, state: this.getState(), valid: this.canApply(model) }; this.state = state; const { params, gos, eventSvc, applyActive } = this; params.onStateChange(state); params.onUiChange(this.getUiChangeEventParams()); if (!gos.get("enableFilterHandlers")) { eventSvc.dispatchEvent({ type: "filterModified", column: params.column, filterInstance: this }); } if (!state.valid) { return; } apply ?? (apply = applyActive ? void 0 : "debounce"); if (apply === "immediately") { this.doApplyModel({ afterFloatingFilter, afterDataChange: false }); } else if (apply === "debounce") { this.applyDebounced(); } } getState() { return void 0; } getUiChangeEventParams() { return void 0; } afterGuiAttached(params) { this.lastContainerType = params?.container; this.refreshFilterResizer(params?.container); } refreshFilterResizer(containerType) { const { positionableFeature, gos } = this; if (!positionableFeature) { return; } const isResizable = containerType === "floatingFilter" || containerType === "columnFilter"; if (isResizable) { positionableFeature.restoreLastSize(); positionableFeature.setResizable( gos.get("enableRtl") ? { bottom: true, bottomLeft: true, left: true } : { bottom: true, bottomRight: true, right: true } ); } else { positionableFeature.removeSizeFromEl(); positionableFeature.setResizable(false); } positionableFeature.constrainSizeToAvailableHeight(isResizable); } afterGuiDetached() { this.checkApplyDebounce(); this.positionableFeature?.constrainSizeToAvailableHeight(false); } destroy() { this.positionableFeature = this.destroyBean(this.positionableFeature); super.destroy(); } translate(key, variableValues) { return translateForFilter(this, key, variableValues); } // override to control positionable feature getPositionableElement() { return this.getGui(); } areModelsEqual(a, b) { if (a === b || a == null && b == null) { return true; } if (a == null || b == null) { return false; } return this.areNonNullModelsEqual(a, b); } }; var STRUCTURED_SCHEMA_FEATURES = [ "aggregation", "filter", "sort", "pivot", "columnVisibility", "columnSizing", "rowGroup" ]; var AgPopupComponent = class extends AgComponentStub { isPopup() { return true; } setParentComponent(container) { container.addCss("ag-has-popup"); super.setParentComponent(container); } destroy() { const parentComp = this.parentComponent; const hasParent = parentComp?.isAlive(); if (hasParent) { parentComp.getGui().classList.remove("ag-has-popup"); } super.destroy(); } }; var AgAbstractCellEditor = class extends AgPopupComponent { constructor() { super(...arguments); this.errorMessages = null; } init(params) { this.params = params; this.initialiseEditor(params); this.eEditor.onValueChange(() => params.validate()); } destroy() { this.eEditor.destroy(); this.errorMessages = null; super.destroy(); } }; function _getClientSideRowModel(beans) { const rowModel = beans.rowModel; return rowModel.getType() === "clientSide" ? rowModel : void 0; } function _getInfiniteRowModel(beans) { const rowModel = beans.rowModel; return rowModel.getType() === "infinite" ? rowModel : void 0; } function _getServerSideRowModel(beans) { const rowModel = beans.rowModel; return rowModel.getType() === "serverSide" ? rowModel : void 0; } function _getViewportRowModel(beans) { const rowModel = beans.rowModel; return rowModel.getType() === "viewport" ? rowModel : void 0; } var ROW_ID_PREFIX_ROW_GROUP = "row-group-"; var ROW_ID_PREFIX_TOP_PINNED = "t-"; var ROW_ID_PREFIX_BOTTOM_PINNED = "b-"; var OBJECT_ID_SEQUENCE = 0; var RowNode = class { constructor(beans) { this.id = void 0; this.destroyed = false; this._groupData = void 0; this.master = false; this.detail = void 0; this.rowIndex = null; this.field = null; this.rowGroupColumn = null; this.key = null; this.sourceRowIndex = -1; this._leafs = void 0; this.childrenAfterGroup = null; this.childrenAfterFilter = null; this.childrenAfterAggFilter = null; this.childrenAfterSort = null; this.allChildrenCount = null; this.childrenMapped = null; this.treeParent = null; this.treeNodeFlags = 0; this._expanded = void 0; this.displayed = false; this.rowTop = null; this.oldRowTop = null; this.selectable = true; this.__objectId = OBJECT_ID_SEQUENCE++; this.alreadyRendered = false; this.formulaRowIndex = null; this.hovered = false; this.__selected = false; this.beans = beans; } /** * If using row grouping, contains the group values for this group. * When using CSRM, this field is lazily loaded via the GroupStage when required. */ get groupData() { const groupData = this._groupData; if (groupData !== void 0) { return groupData; } if (this.footer) { return this.sibling?.groupData; } return this.beans.groupStage?.loadGroupData(this) ?? null; } set groupData(value) { this._groupData = value; } /** @inheritDoc */ get primaryRow() { let node = this.footer && this.sibling ? this.sibling : this; const { pinnedSibling } = node; if (pinnedSibling && node.rowPinned) { node = pinnedSibling; if (node.footer && node.sibling) { node = node.sibling; } } return node; } /** CSRM only - do not use this property internally, this is exposed to the end user only. Use `_leafs` instead. */ get allLeafChildren() { const leafs = this._leafs; return leafs === void 0 ? this.beans.groupStage?.loadLeafs?.(this) ?? null : leafs; } set allLeafChildren(value) { this._leafs = value; } /** `true` if group or master row is expanded. */ get expanded() { const expansionSvc = this.beans.expansionSvc; return expansionSvc ? expansionSvc.isExpanded(this) : this.level === -1 ? true : !!this._expanded; } set expanded(value) { this._expanded = value; } /** * Replaces the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed. */ setData(data) { this.setDataCommon(data, false); } // similar to setRowData, however it is expected that the data is the same data item. this // is intended to be used with Redux type stores, where the whole data can be changed. we are // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving // dataChanged event, refreshes the cells rather than rip them all out (so user can show transitions). /** * Updates the data on the `rowNode`. When this method is called, the grid refreshes the entire rendered row if it is displayed. */ updateData(data) { this.setDataCommon(data, true); } setDataCommon(data, update) { const { valueCache, eventSvc } = this.beans; const oldData = this.data; this.data = data; valueCache?.onDataChanged(); this.updateDataOnDetailNode(); this.resetQuickFilterAggregateText(); const event = this.createDataChangedEvent(data, oldData, update); this.__localEventService?.dispatchEvent(event); if (this.sibling) { this.sibling.data = data; const event2 = this.sibling.createDataChangedEvent(data, oldData, update); this.sibling.__localEventService?.dispatchEvent(event2); } eventSvc.dispatchEvent({ type: "rowNodeDataChanged", node: this }); const pinnedSibling = this.pinnedSibling; if (pinnedSibling) { pinnedSibling.data = data; pinnedSibling.__localEventService?.dispatchEvent( pinnedSibling.createDataChangedEvent(data, oldData, update) ); eventSvc.dispatchEvent({ type: "rowNodeDataChanged", node: pinnedSibling }); } } // when we are doing master / detail, the detail node is lazy created, but then kept around. // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data // in sync, otherwise expand/collapse of the detail would still show the old values. updateDataOnDetailNode() { const detailNode = this.detailNode; if (detailNode) { detailNode.data = this.data; } } createDataChangedEvent(newData, oldData, update) { return { type: "dataChanged", node: this, oldData, newData, update }; } getRowIndexString() { if (this.rowIndex == null) { _error(13); return null; } if (this.rowPinned === "top") { return ROW_ID_PREFIX_TOP_PINNED + this.rowIndex; } if (this.rowPinned === "bottom") { return ROW_ID_PREFIX_BOTTOM_PINNED + this.rowIndex; } return this.rowIndex.toString(); } setDataAndId(data, id) { const { selectionSvc } = this.beans; const oldNode = selectionSvc?.createDaemonNode?.(this); const oldData = this.data; this.data = data; this.updateDataOnDetailNode(); this.setId(id); if (selectionSvc) { selectionSvc.updateRowSelectable(this); selectionSvc.syncInRowNode(this, oldNode); } const event = this.createDataChangedEvent(data, oldData, false); this.__localEventService?.dispatchEvent(event); } setId(id) { const getRowIdFunc = _getRowIdCallback(this.beans.gos); if (getRowIdFunc) { if (this.data) { const parentKeys = this.parent?.getRoute() ?? []; this.id = getRowIdFunc({ data: this.data, parentKeys: parentKeys.length > 0 ? parentKeys : void 0, level: this.level, rowPinned: this.rowPinned }); if (this.id.startsWith(ROW_ID_PREFIX_ROW_GROUP)) { _error(14, { groupPrefix: ROW_ID_PREFIX_ROW_GROUP }); } } else { this.id = void 0; } } else { this.id = id; } } setRowTop(rowTop) { this.oldRowTop = this.rowTop; if (this.rowTop === rowTop) { return; } this.rowTop = rowTop; this.dispatchRowEvent("topChanged"); const displayed = rowTop !== null; if (this.displayed !== displayed) { this.displayed = displayed; this.dispatchRowEvent("displayedChanged"); } } clearRowTopAndRowIndex() { this.oldRowTop = null; this.setRowTop(null); this.setRowIndex(null); } setHovered(hovered) { this.hovered = hovered; } isHovered() { return this.hovered; } /** * Sets the row height. * Call if you want to change the height initially assigned to the row. * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */ setRowHeight(rowHeight, estimated = false) { this.rowHeight = rowHeight; this.rowHeightEstimated = estimated; this.dispatchRowEvent("heightChanged"); } setExpanded(expanded, e, forceSync) { this.beans.expansionSvc?.setExpanded(this, expanded, e, forceSync); } /** * Sets the value on the `rowNode` for the specified column and refreshes the rendered cell. * * In **Read Only** mode, this fires `onCellEditRequest` instead of writing directly. * * In **Pivot Mode**, pivot columns on leaf rows resolve to their underlying value column. * * The `eventSource` parameter controls how the value is written: * * - `(default)` — Closes the active editor, writes to the pending batch if batching, otherwise writes to committed data. * - `'edit'` — Writes directly into the active editor if present (via `refresh()` or recreation); falls back to pending batch or committed data. * - `'batch'` — Leaves the active editor open, writes to the pending batch if batching, otherwise writes to committed data. * - `'data'` — Leaves the active editor open, skips the pending batch, always writes to committed data. * * With `'edit'`, the active editor receives the new value via `refresh()` if implemented; * otherwise the editor is recreated with focus preserved. * * @param colKey The column to update (field name, `colId`, or `Column` object) * @param newValue The new value to set * @param eventSource Controls how the value is written * @returns `true` if the value changed, `false` otherwise */ setDataValue(colKey, newValue, eventSource) { const { colModel, valueSvc, gos, editSvc } = this.beans; if (colKey == null) { return false; } let column = colModel.getCol(colKey) ?? colModel.getColDefCol(colKey); if (!column) { return false; } if (!this.group) { const colDef = column.getColDef(); if (colDef.pivotValueColumn) { column = colDef.pivotValueColumn; } } const oldValue = valueSvc.getValueForDisplay({ column, node: this, from: "data" }).value; if (gos.get("readOnlyEdit")) { const { beans: { eventSvc }, data, rowIndex, rowPinned } = this; eventSvc.dispatchEvent({ type: "cellEditRequest", event: null, rowIndex, rowPinned, column, colDef: column.colDef, data, node: this, oldValue, newValue, value: newValue, source: eventSource }); return false; } if (eventSource !== "data" && editSvc && !editSvc.committing) { const result = editSvc.setDataValue({ rowNode: this, column }, newValue, eventSource); if (result != null) { return result; } } const valueChanged = valueSvc.setValue(this, column, newValue, eventSource); this.dispatchCellChangedEvent(column, newValue, oldValue); if (valueChanged) { this.pinnedSibling?.dispatchCellChangedEvent(column, newValue, oldValue); } return valueChanged; } getDataValue(colKey, from = "data") { const { colModel, valueSvc, formula } = this.beans; if (colKey == null) { return void 0; } const column = colModel.getCol(colKey) ?? colModel.getColDefCol(colKey); if (!column) { return void 0; } const dataRaw = from === "data-raw"; const resolvedFrom = dataRaw || from === "value" ? "data" : from; let value = valueSvc.getValue(column, this, resolvedFrom, dataRaw); if (!dataRaw) { if (formula && column.isAllowFormula() && formula.isFormula(value)) { value = formula.resolveValue(column, this); } if (from !== "data" && column.getAggFunc() && typeof value === "object" && value != null) { if (typeof value.toNumber === "function") { return value.toNumber(); } if ("value" in value) { return value.value; } } } return value; } updateHasChildren() { let newValue = this.group && !this.footer || !!this.childrenAfterGroup?.length; const { rowChildrenSvc } = this.beans; if (rowChildrenSvc) { newValue = rowChildrenSvc.getHasChildrenValue(this); } if (newValue !== this.__hasChildren) { this.__hasChildren = !!newValue; this.dispatchRowEvent("hasChildrenChanged"); } } hasChildren() { if (this.__hasChildren == null) { this.updateHasChildren(); } return this.__hasChildren; } dispatchCellChangedEvent(column, newValue, oldValue) { const cellChangedEvent = { type: "cellChanged", node: this, column, newValue, oldValue }; this.__localEventService?.dispatchEvent(cellChangedEvent); } /** * The first time `quickFilter` runs, the grid creates a one-off string representation of the row. * This string is then used for the quick filter instead of hitting each column separately. * When you edit, using grid editing, this string gets cleared down. * However, if you edit without using grid editing, you need to clear this string down for the row to be updated with the new values. * Otherwise, new values would not work with the `quickFilter`. */ resetQuickFilterAggregateText() { this.quickFilterAggregateText = null; } /** Returns: * - `true` if the node can be expanded, i.e it is a group or master row. * - `false` if the node cannot be expanded */ isExpandable() { return this.beans.expansionSvc?.isExpandable(this) ?? false; } /** Returns: * - `true` if node is selected, * - `false` if the node isn't selected * - `undefined` if it's partially selected (group where not all children are selected). */ isSelected() { if (this.footer) { return this.sibling.isSelected(); } const pinnedSibling = this.rowPinned && this.pinnedSibling; if (pinnedSibling) { return pinnedSibling.isSelected(); } return this.__selected; } /** Perform a depth-first search of this node and its children. */ depthFirstSearch(callback) { const childrenAfterGroup = this.childrenAfterGroup; if (childrenAfterGroup) { for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) { childrenAfterGroup[i].depthFirstSearch(callback); } } callback(this); } getAggregatedChildren(colKey, recursive) { const beans = this.beans; return beans.aggChildrenSvc?.getAggregatedChildren(this, beans.colModel.getCol(colKey), recursive) ?? []; } dispatchRowEvent(type) { this.__localEventService?.dispatchEvent({ type, node: this }); } /** * Select (or deselect) the node. * @param newValue -`true` for selection, `false` for deselection. * @param clearSelection - If selecting, then passing `true` selects the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact. * @param source - Source property that appears in the `selectionChanged` event. */ setSelected(newValue, clearSelection = false, source = "api") { this.beans.selectionSvc?.setNodesSelected({ nodes: [this], newValue, clearSelection, source }); } /** * Returns: * - `true` if node is either pinned to the `top` or `bottom` * - `false` if the node isn't pinned */ isRowPinned() { return !!this.rowPinned; } __addEventListener(eventType, listener) { const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService()); localEventService.addEventListener(eventType, listener); } __removeEventListener(eventType, listener) { this.removeLocalListener(eventType, listener); } /** * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods. */ addEventListener(eventType, userListener) { this.beans.validation?.checkRowEvents(eventType); const localEventService = this.__localEventService ?? (this.__localEventService = new LocalEventService()); this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.( this.frameworkEventListenerService, localEventService ); const listener = this.frameworkEventListenerService?.wrap(eventType, userListener) ?? userListener; localEventService.addEventListener(eventType, listener); } /** * PUBLIC USE ONLY: for internal use within AG Grid use the `__addEventListener` and `__removeEventListener` methods. */ removeEventListener(eventType, userListener) { const listener = this.frameworkEventListenerService?.unwrap(eventType, userListener) ?? userListener; this.removeLocalListener(eventType, listener); } removeLocalListener(eventType, listener) { const localEventService = this.__localEventService; if (localEventService) { localEventService.removeEventListener(eventType, listener); if (localEventService.noRegisteredListenersExist()) { this.__localEventService = null; } } } /** * @deprecated v32.2.0 Check `node.detail` then user provided callback `isFullWidthRow` instead. * * Returns: * - `true` if the node is a full width cell * - `false` if the node is not a full width cell */ isFullWidthCell() { _warn(61); if (this.detail) { return true; } const isFullWidthCellFunc = this.beans.gos.getCallback("isFullWidthRow"); return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this }) : false; } /** * Returns the route of keys to the row node. Returns undefined if the node has no key. */ getRoute() { if (this.level === -1) { return []; } if (this.key == null) { return void 0; } const res = []; let pointer = this; while (pointer?.key != null) { res.push(pointer.key); pointer = pointer.parent; } return res.reverse(); } setRowIndex(rowIndex) { if (this.rowIndex !== rowIndex) { this.rowIndex = rowIndex; this.dispatchRowEvent("rowIndexChanged"); } } setAllChildrenCount(allChildrenCount) { if (this.allChildrenCount !== allChildrenCount) { this.allChildrenCount = allChildrenCount; this.dispatchRowEvent("allChildrenCountChanged"); } } setUiLevel(uiLevel) { if (this.uiLevel !== uiLevel) { this.uiLevel = uiLevel; this.dispatchRowEvent("uiLevelChanged"); } } getFirstChild() { const childStore = this.childStore; if (childStore) { return childStore.getFirstNode(); } return this.childrenAfterSort?.[0] ?? null; } /** Called internally to destroy this node */ _destroy(fadeOut) { if (this.destroyed) { return false; } this.destroyed = true; const pinnedSibling = this.pinnedSibling; if (pinnedSibling?.rowPinned && !this.rowPinned) { this.beans.pinnedRowModel?.pinRow(pinnedSibling, null); } if (fadeOut) { this.clearRowTopAndRowIndex(); } else { this.setRowTop(null); this.setRowIndex(null); } if (!this.footer) { const detailNode = this.detailNode; if (detailNode) { detailNode._destroy(fadeOut); } const sibling = this.sibling; if (sibling) { sibling._destroy(fadeOut); } } return true; } }; function _createGlobalRowEvent(rowNode, gos, type) { return _addGridCommonParams(gos, { type, node: rowNode, data: rowNode.data, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned }); } var IGNORED_SIBLING_PROPERTIES = /* @__PURE__ */ new Set([ "__autoHeights", "__checkAutoHeightsDebounced", "__localEventService", "__objectId", "_groupData", "_leafs", "childStore", "groupValue", "oldRowTop", "sticky", "treeNodeFlags", "treeParent" ]); var _createRowNodeSibling = (rowNode, beans) => { const sibling = new RowNode(beans); for (const key of Object.keys(rowNode)) { if (IGNORED_SIBLING_PROPERTIES.has(key)) { continue; } sibling[key] = rowNode[key]; } sibling.oldRowTop = null; return sibling; }; var _prevOrNextDisplayedRow = (rowModel, direction, initial) => { if (!initial) { return void 0; } let rowIndex = initial.rowIndex; if (rowIndex == null) { return void 0; } rowIndex += direction; const rowCount = rowModel.getRowCount(); while (rowIndex >= 0 && rowIndex < rowCount) { const row = rowModel.getRow(rowIndex); if (!row || !row.footer && !row.detail) { return row; } rowIndex += direction; } return void 0; }; var PinnedRows = class { constructor(beans, floating) { this.beans = beans; this.floating = floating; this.all = /* @__PURE__ */ new Set(); this.visible = /* @__PURE__ */ new Set(); this.order = []; this.queued = /* @__PURE__ */ new Set(); } size() { return this.visible.size; } add(node) { const { all, visible, order } = this; if (all.has(node)) { return; } all.add(node); visible.add(node); order.push(node); this.sort(); } delete(item) { this.all.delete(item); this.visible.delete(item); this.queued.delete(item.id); _removeFromArray(this.order, item); } has(item) { return this.visible.has(item); } forEach(fn) { this.order.forEach(fn); } getByIndex(i) { return this.order[i]; } getById(id) { for (const node of this.visible) { if (node.id == id) { return node; } } } clear() { const { all, visible, order, queued } = this; all.clear(); queued.clear(); visible.clear(); order.length = 0; } sort() { const { sortSvc, rowNodeSorter, gos } = this.beans; const sortOptions = sortSvc?.getSortOptions() ?? []; const order = this.order; const grandTotalNode = _removeGrandTotalRow(order); order.sort( (a, b) => rowNodeSorter?.compareRowNodes(sortOptions, a, b) || (a.pinnedSibling?.rowIndex ?? 0) - (b.pinnedSibling?.rowIndex ?? 0) ); if (!grandTotalNode) { return; } const grandTotalRow = _getGrandTotalRow(gos); if (grandTotalRow === "bottom" || grandTotalRow === "pinnedBottom") { this.order.push(grandTotalNode); } else { this.order.unshift(grandTotalNode); } } hide(shouldHide) { const { all, visible } = this; const sizeBefore = visible.size; all.forEach((node) => shouldHide(node) ? visible.delete(node) : visible.add(node)); this.order = Array.from(visible); this.sort(); return sizeBefore != visible.size; } queue(id) { this.queued.add(id); } unqueue(id) { this.queued.delete(id); } forEachQueued(fn) { this.queued.forEach(fn); } }; function _isDisplayedAfterFilterCSRM(node) { if (node.level === -1) { return true; } const parent = node.parent; if (parent?.childrenAfterSort?.some((child) => child == node)) { return _isDisplayedAfterFilterCSRM(parent); } return false; } function _shouldHidePinnedRows(beans, node) { const { gos, rowModel, filterManager } = beans; if (_isServerSideRowModel(gos, rowModel)) { return !rowModel.getRowNode(node.id); } if (filterManager?.isAnyFilterPresent()) { return !_isDisplayedAfterFilterCSRM(node); } if (gos.get("pivotMode")) { return !node.group; } return false; } function _isNodeGrandTotal(node) { return !!node.footer && node.level === -1; } function _isPinnedNodeGrandTotal(node) { return !!node.pinnedSibling && _isNodeGrandTotal(node.pinnedSibling); } function _removeGrandTotalRow(order) { const index = order.findIndex(_isPinnedNodeGrandTotal); if (index > -1) { return order.splice(index, 1)?.[0]; } } var ManualPinnedRowModel = class extends BeanStub { constructor() { super(...arguments); this.csrm = null; } postConstruct() { const { gos, beans } = this; this.top = new PinnedRows(beans, "top"); this.bottom = new PinnedRows(beans, "bottom"); this.csrm = _getClientSideRowModel(beans) ?? null; const shouldHide = (node) => _shouldHidePinnedRows(beans, node.pinnedSibling); const runIsRowPinned = () => { const isRowPinned = gos.get("isRowPinned"); if (isRowPinned && gos.get("enableRowPinning")) { beans.rowModel.forEachNode((node) => this.pinRow(node, isRowPinned(node)), true); } this.refreshRowPositions(); this.dispatchRowPinnedEvents(); }; this.addManagedEventListeners({ stylesChanged: this.onGridStylesChanges.bind(this), modelUpdated: ({ keepRenderedRows }) => { this.tryToEmptyQueues(); this.pinGrandTotalRow(); let visibilityChanged = false; this.forContainers((container) => { visibilityChanged || (visibilityChanged = container.hide(shouldHide)); }); const positionsChanged = this.refreshRowPositions(); if (!keepRenderedRows || positionsChanged || visibilityChanged) { this.dispatchRowPinnedEvents(); } }, columnRowGroupChanged: () => { this.forContainers(removeGroupRows); this.refreshRowPositions(); }, rowNodeDataChanged: ({ node }) => { const isRowPinnable = gos.get("isRowPinnable"); const pinnable = isRowPinnable?.(node) ?? true; if (!pinnable) { this.pinRow(node, null); } }, firstDataRendered: runIsRowPinned }); this.addManagedPropertyListener("pivotMode", () => { this.forContainers((container) => container.hide(shouldHide)); this.dispatchRowPinnedEvents(); }); this.addManagedPropertyListener("grandTotalRow", ({ currentValue }) => { this._grandTotalPinned = currentValue === "pinnedBottom" ? "bottom" : currentValue === "pinnedTop" ? "top" : null; }); this.addManagedPropertyListener("isRowPinned", runIsRowPinned); } destroy() { this.reset(false); super.destroy(); } reset(dispatch = true) { this.forContainers((container) => { const nodesToUnpin = []; container.forEach((n) => nodesToUnpin.push(n)); nodesToUnpin.forEach((n) => this.pinRow(n, null)); container.clear(); }); if (dispatch) { this.dispatchRowPinnedEvents(); } } pinRow(rowNode, float, column) { if (float != null && rowNode.destroyed) { return; } if (rowNode.footer) { const level = rowNode.level; if (level > -1) { return; } if (level === -1) { this._grandTotalPinned = float; this.csrm?.reMapRows(); return; } } const currentFloat = rowNode.rowPinned ?? rowNode.pinnedSibling?.rowPinned; const switching = currentFloat != null && float != null && float != currentFloat; if (switching) { const pinned = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling; const source = rowNode.rowPinned ? rowNode.pinnedSibling : rowNode; this.pinRow(pinned, null, column); this.pinRow(source, float, column); return; } const spannedRows = column && getSpannedRows(this.beans, rowNode, column); if (spannedRows) { spannedRows.forEach((node) => this.pinRow(node, float)); return; } if (float == null) { const node = rowNode.rowPinned ? rowNode : rowNode.pinnedSibling; const found = this.findPinnedRowNode(node); if (!found) { return; } found.delete(node); const source = node.pinnedSibling; _destroyRowNodeSibling(node); this.refreshRowPositions(float); this.dispatchRowPinnedEvents(source); } else { const sibling = _createPinnedSibling(this.beans, rowNode, float); const container = this.getContainer(float); container.add(sibling); if (_shouldHidePinnedRows(this.beans, rowNode)) { container.hide((node) => _shouldHidePinnedRows(this.beans, node.pinnedSibling)); } this.refreshRowPositions(float); this.dispatchRowPinnedEvents(rowNode); } } isManual() { return true; } isEmpty(floating) { return this.getContainer(floating).size() === 0; } isRowsToRender(floating) { return !this.isEmpty(floating); } ensureRowHeightsValid() { let anyChange = false; let rowTop = 0; const updateRowHeight = (rowNode) => { if (rowNode.rowHeightEstimated) { const rowHeight = _getRowHeightForNode(this.beans, rowNode); rowNode.setRowTop(rowTop); rowNode.setRowHeight(rowHeight.height); rowTop += rowHeight.height; anyChange = true; } }; this.bottom.forEach(updateRowHeight); rowTop = 0; this.top.forEach(updateRowHeight); this.eventSvc.dispatchEvent({ type: "pinnedHeightChanged" }); return anyChange; } getPinnedTopTotalHeight() { return getTotalHeight(this.top); } getPinnedBottomTotalHeight() { return getTotalHeight(this.bottom); } getPinnedTopRowCount() { return this.top.size(); } getPinnedBottomRowCount() { return this.bottom.size(); } getPinnedTopRow(index) { return this.top.getByIndex(index); } getPinnedBottomRow(index) { return this.bottom.getByIndex(index); } getPinnedRowById(id, floating) { return this.getContainer(floating).getById(id); } forEachPinnedRow(floating, callback) { this.getContainer(floating).forEach(callback); } getPinnedState() { const buildState = (floating) => { const list = []; this.forEachPinnedRow(floating, (node) => { const id = node.pinnedSibling?.id; if (id != null) { list.push(id); } }); return list; }; return { top: buildState("top"), bottom: buildState("bottom") }; } setPinnedState(state) { this.forContainers((pinned, floating) => { for (const id of state[floating]) { const node = this.beans.rowModel.getRowNode(id); if (node) { this.pinRow(node, floating); } else { pinned.queue(id); } } }); } getGrandTotalPinned() { return this._grandTotalPinned; } setGrandTotalPinned(value) { this._grandTotalPinned = value; } tryToEmptyQueues() { this.forContainers((pinned, container) => { const nodesToPin = /* @__PURE__ */ new Set(); pinned.forEachQueued((id) => { const node = this.beans.rowModel.getRowNode(id); if (node) { nodesToPin.add(node); } }); for (const node of nodesToPin) { pinned.unqueue(node.id); this.pinRow(node, container); } }); } pinGrandTotalRow() { const { csrm, beans, _grandTotalPinned: float } = this; if (!csrm) { return; } const sibling = csrm.rootNode?.sibling; if (!sibling) { return; } const pinnedSibling = sibling.pinnedSibling; const container = pinnedSibling && this.findPinnedRowNode(pinnedSibling); if (!float) { if (!container) { return; } _destroyRowNodeSibling(pinnedSibling); container.delete(pinnedSibling); } else { if (container && container.floating !== float) { _destroyRowNodeSibling(pinnedSibling); container.delete(pinnedSibling); } if (!container || container.floating !== float) { const newPinnedSibling = _createPinnedSibling(beans, sibling, float); this.getContainer(float).add(newPinnedSibling); } } } onGridStylesChanges(e) { if (e.rowHeightChanged) { this.forContainers( (container) => container.forEach((rowNode) => rowNode.setRowHeight(rowNode.rowHeight, true)) ); } } getContainer(floating) { return floating === "top" ? this.top : this.bottom; } findPinnedRowNode(node) { if (this.top.has(node)) { return this.top; } if (this.bottom.has(node)) { return this.bottom; } } refreshRowPositions(floating) { const refreshAll = (pinned) => refreshRowPositions(this.beans, pinned); if (floating) { return refreshAll(this.getContainer(floating)); } let changed = false; this.forContainers((container) => { const updated = refreshAll(container); changed || (changed = updated); }); return changed; } forContainers(fn) { fn(this.top, "top"); fn(this.bottom, "bottom"); } dispatchRowPinnedEvents(node) { this.eventSvc.dispatchEvent({ type: "pinnedRowsChanged" }); node?.dispatchRowEvent("rowPinned"); } }; function refreshRowPositions(beans, container) { let rowTop = 0; let changed = false; container.forEach((node, index) => { changed || (changed = node.rowTop !== rowTop); node.setRowTop(rowTop); if (node.rowHeightEstimated || node.rowHeight == null) { const rowHeight = _getRowHeightForNode(beans, node).height; changed || (changed = node.rowHeight !== rowHeight); node.setRowHeight(rowHeight); } node.setRowIndex(index); rowTop += node.rowHeight; }); return changed; } function _createPinnedSibling(beans, rowNode, floating) { if (rowNode.pinnedSibling) { return rowNode.pinnedSibling; } const sibling = _createRowNodeSibling(rowNode, beans); sibling.setRowTop(null); sibling.setRowIndex(null); sibling.rowPinned = floating; const prefix = floating === "top" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED; sibling.id = `${prefix}${floating}-${rowNode.id}`; sibling.pinnedSibling = rowNode; rowNode.pinnedSibling = sibling; return sibling; } function _destroyRowNodeSibling(rowNode) { if (!rowNode.pinnedSibling) { return; } rowNode.rowPinned = null; rowNode._destroy(false); const mainNode = rowNode.pinnedSibling; rowNode.pinnedSibling = void 0; if (mainNode) { mainNode.pinnedSibling = void 0; mainNode.rowPinned = null; } } function removeGroupRows(set2) { const rowsToRemove = /* @__PURE__ */ new Set(); set2.forEach((node) => { if (node.group) { rowsToRemove.add(node); } }); rowsToRemove.forEach((node) => set2.delete(node)); } function getSpannedRows(beans, rowNode, column) { const { rowSpanSvc } = beans; const isCellSpanning = (column && rowSpanSvc?.isCellSpanning(column, rowNode)) ?? false; if (column && isCellSpanning) { return rowSpanSvc?.getCellSpan(column, rowNode)?.spannedNodes; } } function getTotalHeight(container) { const size = container.size(); if (size === 0) { return 0; } const node = container.getByIndex(size - 1); if (node === void 0) { return 0; } return node.rowTop + node.rowHeight; } var StaticPinnedRowModel = class extends BeanStub { constructor() { super(...arguments); this.nextId = 0; this.pinnedTopRows = { cache: {}, order: [] }; this.pinnedBottomRows = { cache: {}, order: [] }; } postConstruct() { const gos = this.gos; this.setPinnedRowData(gos.get("pinnedTopRowData"), "top"); this.setPinnedRowData(gos.get("pinnedBottomRowData"), "bottom"); this.addManagedPropertyListener("pinnedTopRowData", (e) => this.setPinnedRowData(e.currentValue, "top")); this.addManagedPropertyListener("pinnedBottomRowData", (e) => this.setPinnedRowData(e.currentValue, "bottom")); this.addManagedEventListeners({ stylesChanged: this.onGridStylesChanges.bind(this) }); } reset() { } isEmpty(floating) { return this.getCache(floating).order.length === 0; } isRowsToRender(floating) { return !this.isEmpty(floating); } isManual() { return false; } pinRow(_node, _container) { } onGridStylesChanges(e) { if (e.rowHeightChanged) { const estimateRowHeight = (rowNode) => { rowNode.setRowHeight(rowNode.rowHeight, true); }; forEach(this.pinnedBottomRows, estimateRowHeight); forEach(this.pinnedTopRows, estimateRowHeight); } } ensureRowHeightsValid() { let anyChange = false; let rowTop = 0; const updateRowHeight = (rowNode) => { if (rowNode.rowHeightEstimated) { const rowHeight = _getRowHeightForNode(this.beans, rowNode); rowNode.setRowTop(rowTop); rowNode.setRowHeight(rowHeight.height); rowTop += rowHeight.height; anyChange = true; } }; forEach(this.pinnedBottomRows, updateRowHeight); rowTop = 0; forEach(this.pinnedTopRows, updateRowHeight); this.eventSvc.dispatchEvent({ type: "pinnedHeightChanged" }); return anyChange; } setPinnedRowData(rowData, floating) { this.updateNodesFromRowData(rowData, floating); this.eventSvc.dispatchEvent({ type: "pinnedRowDataChanged" }); } /** * Updates existing RowNode instances and creates new ones if necessary * * Setting data as `undefined` will clear row nodes */ updateNodesFromRowData(allData, floating) { const nodes = this.getCache(floating); if (allData === void 0) { nodes.order.length = 0; nodes.cache = {}; return; } const getRowId = _getRowIdCallback(this.gos); const idPrefix = floating === "top" ? ROW_ID_PREFIX_TOP_PINNED : ROW_ID_PREFIX_BOTTOM_PINNED; const nodesToRemove = new Set(nodes.order); const newOrder = []; const dataIds = /* @__PURE__ */ new Set(); let nextRowTop = 0; let i = -1; for (const data of allData) { const id = getRowId?.({ data, level: 0, rowPinned: floating }) ?? idPrefix + this.nextId++; if (dataIds.has(id)) { _warn(96, { id, data }); continue; } i++; dataIds.add(id); newOrder.push(id); const existingNode = getById(nodes, id); if (existingNode !== void 0) { if (existingNode.data !== data) { existingNode.updateData(data); } nextRowTop += this.setRowTopAndRowIndex(existingNode, nextRowTop, i); nodesToRemove.delete(id); } else { const rowNode = new RowNode(this.beans); rowNode.id = id; rowNode.data = data; rowNode.rowPinned = floating; nextRowTop += this.setRowTopAndRowIndex(rowNode, nextRowTop, i); nodes.cache[id] = rowNode; nodes.order.push(id); } } for (const id of nodesToRemove) { getById(nodes, id)?.clearRowTopAndRowIndex(); delete nodes.cache[id]; } nodes.order = newOrder; } setRowTopAndRowIndex(rowNode, rowTop, rowIndex) { rowNode.setRowTop(rowTop); rowNode.setRowHeight(_getRowHeightForNode(this.beans, rowNode).height); rowNode.setRowIndex(rowIndex); return rowNode.rowHeight; } getPinnedTopTotalHeight() { return getTotalHeight2(this.pinnedTopRows); } getPinnedBottomTotalHeight() { return getTotalHeight2(this.pinnedBottomRows); } getPinnedTopRowCount() { return getSize(this.pinnedTopRows); } getPinnedBottomRowCount() { return getSize(this.pinnedBottomRows); } getPinnedTopRow(index) { return getByIndex(this.pinnedTopRows, index); } getPinnedBottomRow(index) { return getByIndex(this.pinnedBottomRows, index); } getPinnedRowById(id, floating) { return getById(this.getCache(floating), id); } forEachPinnedRow(floating, callback) { return forEach(this.getCache(floating), callback); } getCache(floating) { return floating === "top" ? this.pinnedTopRows : this.pinnedBottomRows; } getPinnedState() { return { top: [], bottom: [] }; } setPinnedState() { } getGrandTotalPinned() { return; } setGrandTotalPinned() { } }; function getTotalHeight2(rowNodes) { const size = getSize(rowNodes); if (size === 0) { return 0; } const node = getByIndex(rowNodes, size - 1); if (node === void 0) { return 0; } return node.rowTop + node.rowHeight; } function getById(cache, id) { return cache.cache[id]; } function getByIndex(cache, i) { return getById(cache, cache.order[i]); } function forEach(cache, callback) { cache.order.forEach((id, index) => { const node = getById(cache, id); if (node) { callback(node, index); } }); } function getSize(cache) { return cache.order.length; } var PinnedRowModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pinnedRowModel"; } postConstruct() { const { gos } = this; const initialiseRowModel = () => { const enableRowPinning = gos.get("enableRowPinning"); const grandTotalRow = _getGrandTotalRow(gos); const isGrandTotalRowPinned = grandTotalRow === "pinnedBottom" || grandTotalRow === "pinnedTop"; const useManualPinnedRowModel = !!enableRowPinning || isGrandTotalRowPinned; const shouldDestroy = useManualPinnedRowModel ? this.inner instanceof StaticPinnedRowModel : this.inner instanceof ManualPinnedRowModel; if (this.inner && shouldDestroy) { this.destroyBean(this.inner); } if (shouldDestroy || !this.inner) { this.inner = this.createManagedBean( useManualPinnedRowModel ? new ManualPinnedRowModel() : new StaticPinnedRowModel() ); } }; this.addManagedPropertyListeners(["enableRowPinning", "grandTotalRow"], initialiseRowModel); initialiseRowModel(); } reset() { return this.inner.reset(); } isEmpty(container) { return this.inner.isEmpty(container); } isManual() { return this.inner.isManual(); } isRowsToRender(container) { return this.inner.isRowsToRender(container); } pinRow(node, container, column) { return this.inner.pinRow(node, container, column); } ensureRowHeightsValid() { return this.inner.ensureRowHeightsValid(); } getPinnedRowById(id, container) { return this.inner.getPinnedRowById(id, container); } getPinnedTopTotalHeight() { return this.inner.getPinnedTopTotalHeight(); } getPinnedBottomTotalHeight() { return this.inner.getPinnedBottomTotalHeight(); } getPinnedTopRowCount() { return this.inner.getPinnedTopRowCount(); } getPinnedBottomRowCount() { return this.inner.getPinnedBottomRowCount(); } getPinnedTopRow(index) { return this.inner.getPinnedTopRow(index); } getPinnedBottomRow(index) { return this.inner.getPinnedBottomRow(index); } forEachPinnedRow(container, callback) { return this.inner.forEachPinnedRow(container, callback); } getPinnedState() { return this.inner.getPinnedState(); } setPinnedState(state) { return this.inner.setPinnedState(state); } setGrandTotalPinned(value) { return this.inner.setGrandTotalPinned(value); } getGrandTotalPinned() { return this.inner.getGrandTotalPinned(); } }; var ServerSideTransactionResultStatus = /* @__PURE__ */ ((ServerSideTransactionResultStatus2) => { ServerSideTransactionResultStatus2["Applied"] = "Applied"; ServerSideTransactionResultStatus2["StoreNotFound"] = "StoreNotFound"; ServerSideTransactionResultStatus2["StoreLoading"] = "StoreLoading"; ServerSideTransactionResultStatus2["StoreWaitingToLoad"] = "StoreWaitingToLoad"; ServerSideTransactionResultStatus2["StoreLoadingFailed"] = "StoreLoadingFailed"; ServerSideTransactionResultStatus2["StoreWrongType"] = "StoreWrongType"; ServerSideTransactionResultStatus2["Cancelled"] = "Cancelled"; ServerSideTransactionResultStatus2["StoreNotStarted"] = "StoreNotStarted"; return ServerSideTransactionResultStatus2; })(ServerSideTransactionResultStatus || {}); var DOUBLE_TAP_MILLISECONDS = 500; var LONG_PRESS_MILLISECONDS = 550; var handledTouchEvents; var addHandledTouchEvent = (event) => { if (!handledTouchEvents) { handledTouchEvents = /* @__PURE__ */ new WeakSet(); } else if (handledTouchEvents.has(event)) { return false; } handledTouchEvents.add(event); return true; }; var TouchListener = class { constructor(eElement, preventClick = false) { this.eElement = eElement; this.preventClick = preventClick; this.startListener = null; this.handlers = []; this.eventSvc = void 0; this.touchStart = null; this.lastTapTime = null; this.longPressTimer = 0; this.moved = false; } addEventListener(eventType, listener) { let eventSvc = this.eventSvc; if (!eventSvc) { if (eventSvc === null) { return; } this.eventSvc = eventSvc = new LocalEventService(); const startListener = this.onTouchStart.bind(this); this.startListener = startListener; this.eElement.addEventListener("touchstart", startListener, { passive: true }); } eventSvc.addEventListener(eventType, listener); } removeEventListener(eventType, listener) { this.eventSvc?.removeEventListener(eventType, listener); } onTouchStart(touchEvent) { if (this.touchStart || !addHandledTouchEvent(touchEvent)) { return; } const touchStart = touchEvent.touches[0]; this.touchStart = touchStart; const handlers = this.handlers; if (!handlers.length) { const eElement = this.eElement; const doc = eElement.ownerDocument; const touchMove = this.onTouchMove.bind(this); const touchEnd = this.onTouchEnd.bind(this); const touchCancel = this.onTouchCancel.bind(this); const passiveTrue = { passive: true }; const passiveFalse = { passive: false }; addTempEventHandlers( handlers, [eElement, "touchmove", touchMove, passiveTrue], [doc, "touchcancel", touchCancel, passiveTrue], // we set passive=false, as we want to prevent default on this event [doc, "touchend", touchEnd, passiveFalse], [doc, "contextmenu", preventEventDefault, passiveFalse] ); } this.clearLongPress(); this.longPressTimer = window.setTimeout(() => { this.longPressTimer = 0; if (this.touchStart === touchStart && !this.moved) { this.moved = true; this.eventSvc?.dispatchEvent({ type: "longTap", touchStart, touchEvent }); } }, LONG_PRESS_MILLISECONDS); } onTouchMove(touchEvent) { const { moved, touchStart } = this; if (!moved && touchStart) { const touch = _getFirstActiveTouch(touchStart, touchEvent.touches); const eventIsFarAway = touch && !_areEventsNear(touch, touchStart, 4); if (eventIsFarAway) { this.clearLongPress(); this.moved = true; } } } onTouchEnd(touchEvent) { const touchStart = this.touchStart; if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) { return; } if (!this.moved) { this.eventSvc?.dispatchEvent({ type: "tap", touchStart }); this.checkDoubleTap(touchStart); } if (this.preventClick) { preventEventDefault(touchEvent); } this.cancel(); } onTouchCancel(touchEvent) { const touchStart = this.touchStart; if (!touchStart || !_getFirstActiveTouch(touchStart, touchEvent.changedTouches)) { return; } this.lastTapTime = null; this.cancel(); } checkDoubleTap(touchStart) { let now = Date.now(); const lastTapTime = this.lastTapTime; if (lastTapTime) { const interval = now - lastTapTime; if (interval > DOUBLE_TAP_MILLISECONDS) { this.eventSvc?.dispatchEvent({ type: "doubleTap", touchStart }); now = null; } } this.lastTapTime = now; } cancel() { this.clearLongPress(); clearTempEventHandlers(this.handlers); this.touchStart = null; } clearLongPress() { window.clearTimeout(this.longPressTimer); this.longPressTimer = 0; this.moved = false; } destroy() { const startListener = this.startListener; if (startListener) { this.startListener = null; this.eElement.removeEventListener("touchstart", startListener); } this.cancel(); this.eElement = null; this.eventSvc = null; } }; var CellRangeType = /* @__PURE__ */ ((CellRangeType2) => { CellRangeType2[CellRangeType2["VALUE"] = 0] = "VALUE"; CellRangeType2[CellRangeType2["DIMENSION"] = 1] = "DIMENSION"; return CellRangeType2; })(CellRangeType || {}); var contextId = 1; var AgContext = class { constructor(params) { this.beans = {}; this.createdBeans = []; this.destroyed = false; this.instanceId = contextId++; if (!params?.beanClasses) { return; } this.beanDestroyComparator = params.beanDestroyComparator; this.init(params); } init(params) { this.id = params.id; this.beans.context = this; this.destroyCallback = params.destroyCallback; for (const beanName of Object.keys(params.providedBeanInstances)) { this.beans[beanName] = params.providedBeanInstances[beanName]; } for (const BeanClass of params.beanClasses) { const instance = new BeanClass(); if (instance.beanName) { this.beans[instance.beanName] = instance; } else { console.error(`Bean ${BeanClass.name} is missing beanName`); } this.createdBeans.push(instance); } for (const beanFunc of params.derivedBeans ?? []) { const { beanName, bean } = beanFunc(this); this.beans[beanName] = bean; this.createdBeans.push(bean); } if (params.beanInitComparator) { this.createdBeans.sort(params.beanInitComparator); } this.initBeans(this.createdBeans); } getBeanInstances() { return Object.values(this.beans); } createBean(bean, afterPreCreateCallback) { this.initBeans([bean], afterPreCreateCallback); return bean; } initBeans(beanInstances, afterPreCreateCallback) { const beans = this.beans; for (const instance of beanInstances) { instance.preWireBeans?.(beans); instance.wireBeans?.(beans); } for (const instance of beanInstances) { instance.preConstruct?.(); } if (afterPreCreateCallback) { beanInstances.forEach(afterPreCreateCallback); } for (const instance of beanInstances) { instance.postConstruct?.(); } } getBeans() { return this.beans; } getBean(name) { return this.beans[name]; } getId() { return this.id; } destroy() { if (this.destroyed) { return; } this.destroyed = true; const beanInstances = this.getBeanInstances(); if (this.beanDestroyComparator) { beanInstances.sort(this.beanDestroyComparator); } this.destroyBeans(beanInstances); this.beans = {}; this.createdBeans = []; this.destroyCallback?.(); } /** * Destroys a bean and returns undefined to support destruction and clean up in a single line. * this.dateComp = this.context.destroyBean(this.dateComp); */ destroyBean(bean) { bean?.destroy?.(); } /** * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line. * this.dateComps = this.context.destroyBeans(this.dateComps); */ destroyBeans(beans) { if (beans) { for (let i = 0; i < beans.length; i++) { this.destroyBean(beans[i]); } } return []; } isDestroyed() { return this.destroyed; } }; function createGridApi(context) { return { beanName: "gridApi", bean: context.getBean("apiFunctionSvc").api }; } var orderedCoreBeans = [ // Validate license first "licenseManager", // core beans only "environment", "eventSvc", "gos", "paginationAutoPageSizeSvc", "apiFunctionSvc", "gridApi", "registry", "agCompUtils", "userCompFactory", "rowContainerHeight", "horizontalResizeSvc", "localeSvc", "pinnedRowModel", "dragSvc", "colGroupSvc", "visibleCols", "popupSvc", "selectionSvc", "colFilter", "quickFilter", "filterManager", "colModel", "headerNavigation", "pageBounds", "pagination", "pageBoundsListener", "rowSpanSvc", "stickyRowSvc", "rowRenderer", "expressionSvc", "alignedGridsSvc", "navigation", "valueCache", "valueSvc", "autoWidthCalc", "filterMenuFactory", "dragAndDrop", "focusSvc", "cellNavigation", "cellStyles", "scrollVisibleSvc", "sortSvc", "colHover", "colAnimation", "autoColSvc", "selectionColSvc", "changeDetectionSvc", "animationFrameSvc", "undoRedo", "colDefFactory", "rowStyleSvc", "rowNodeBlockLoader", "rowNodeSorter", "ctrlsSvc", "pinnedCols", "dataTypeSvc", "syncSvc", "overlays", "stateSvc", "expansionSvc", "apiEventSvc", "ariaAnnounce", "menuSvc", "colMoves", "colAutosize", "colFlex", "colResize", "pivotColsSvc", "valueColsSvc", "rowGroupColsSvc", "colNames", "colViewport", "pivotResultCols", "showRowGroupCols", "validation" // Have validations run last ]; var beanNamePosition = Object.fromEntries( orderedCoreBeans.map((beanName, index) => [beanName, index]) ); function gridBeanInitComparator(bean1, bean2) { const index1 = (bean1.beanName ? beanNamePosition[bean1.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER; const index2 = (bean2.beanName ? beanNamePosition[bean2.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER; return index1 - index2; } function gridBeanDestroyComparator(bean1, bean2) { if (bean1?.beanName === "gridDestroySvc") { return -1; } if (bean2?.beanName === "gridDestroySvc") { return 1; } return 0; } function _createCellId(cellPosition) { const { rowIndex, rowPinned, column } = cellPosition; return `${rowIndex}.${rowPinned == null ? "null" : rowPinned}.${column.getId()}`; } function _areCellsEqual(cellA, cellB) { const colsMatch = cellA.column === cellB.column; const floatingMatch = cellA.rowPinned === cellB.rowPinned; const indexMatch = cellA.rowIndex === cellB.rowIndex; return colsMatch && floatingMatch && indexMatch; } function _isRowBefore(rowA, rowB) { switch (rowA.rowPinned) { case "top": if (rowB.rowPinned !== "top") { return true; } break; case "bottom": if (rowB.rowPinned !== "bottom") { return false; } break; default: if (_exists(rowB.rowPinned)) { return rowB.rowPinned !== "top"; } break; } return rowA.rowIndex < rowB.rowIndex; } function _isSameRow(rowA, rowB) { if (!rowA && !rowB) { return true; } if (!rowA || !rowB) { return false; } return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned; } function _getFirstRow(beans) { let rowIndex = 0; let rowPinned; const { pinnedRowModel, rowModel, pageBounds } = beans; if (pinnedRowModel?.getPinnedTopRowCount()) { rowPinned = "top"; } else if (rowModel.getRowCount()) { rowPinned = null; rowIndex = pageBounds.getFirstRow(); } else if (pinnedRowModel?.getPinnedBottomRowCount()) { rowPinned = "bottom"; } return rowPinned === void 0 ? null : { rowIndex, rowPinned }; } function _getLastRow(beans) { let rowIndex; let rowPinned = null; const { pinnedRowModel, pageBounds } = beans; const pinnedBottomCount = pinnedRowModel?.getPinnedBottomRowCount(); const pinnedTopCount = pinnedRowModel?.getPinnedTopRowCount(); if (pinnedBottomCount) { rowPinned = "bottom"; rowIndex = pinnedBottomCount - 1; } else if (beans.rowModel.getRowCount()) { rowIndex = pageBounds.getLastRow(); } else if (pinnedTopCount) { rowPinned = "top"; rowIndex = pinnedTopCount - 1; } return rowIndex === void 0 ? null : { rowIndex, rowPinned }; } function _getRowNode(beans, gridRow) { switch (gridRow.rowPinned) { case "top": return beans.pinnedRowModel?.getPinnedTopRow(gridRow.rowIndex); case "bottom": return beans.pinnedRowModel?.getPinnedBottomRow(gridRow.rowIndex); default: return beans.rowModel.getRow(gridRow.rowIndex); } } function _getCellByPosition(beans, cellPosition) { const spannedCellCtrl = beans.spannedRowRenderer?.getCellByPosition(cellPosition); if (spannedCellCtrl) { return spannedCellCtrl; } const rowCtrl = beans.rowRenderer.getRowByPosition(cellPosition); if (!rowCtrl) { return null; } return rowCtrl.getCellCtrl(cellPosition.column); } function _getRowById(beans, rowId, rowPinned) { const { rowModel: rm, pinnedRowModel: prm } = beans; let node; node ?? (node = rm?.getRowNode(rowId)); if (rowPinned) { node ?? (node = prm?.getPinnedRowById(rowId, rowPinned)); } else { node ?? (node = prm?.getPinnedRowById(rowId, "top")); node ?? (node = prm?.getPinnedRowById(rowId, "bottom")); } return node; } function _getRowAbove(beans, rowPosition, checkSticky = false) { const { rowIndex: index, rowPinned: pinned } = rowPosition; const { pageBounds, pinnedRowModel, rowModel } = beans; if (index === 0) { if (pinned === "top") { return null; } if (pinned === "bottom" && rowModel.isRowsToRender()) { return { rowIndex: pageBounds.getLastRow(), rowPinned: null }; } return pinnedRowModel?.isRowsToRender("top") ? { rowIndex: pinnedRowModel.getPinnedTopRowCount() - 1, rowPinned: "top" } : null; } if (checkSticky) { const rowNode = pinned ? void 0 : rowModel.getRow(index); return getNextStickyPosition(beans, rowNode, true) ?? { rowIndex: index - 1, rowPinned: pinned }; } return { rowIndex: index - 1, rowPinned: pinned }; } function _getAbsoluteRowIndex(beans, rowPosition) { const { pinnedRowModel, rowModel } = beans; const pinnedTopRowCount = pinnedRowModel?.getPinnedTopRowCount() ?? 0; const unpinnedRowCount = rowModel.getRowCount(); const { rowPinned, rowIndex } = rowPosition; if (rowPinned === "top") { return rowIndex; } if (rowPinned === "bottom") { return pinnedTopRowCount + unpinnedRowCount + rowIndex; } return pinnedTopRowCount + rowIndex; } function _getRowBelow(beans, rowPosition, checkSticky = false) { const { rowIndex: index, rowPinned: pinned } = rowPosition; const { pageBounds, pinnedRowModel, rowModel } = beans; if (isLastRowInContainer(beans, rowPosition)) { if (pinned === "bottom") { return null; } if (pinned === "top" && rowModel.isRowsToRender()) { return { rowIndex: pageBounds.getFirstRow(), rowPinned: null }; } return pinnedRowModel?.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null; } if (checkSticky) { const rowNode = pinned ? void 0 : rowModel.getRow(index); return getNextStickyPosition(beans, rowNode) ?? { rowIndex: index + 1, rowPinned: pinned }; } return { rowIndex: index + 1, rowPinned: pinned }; } function getNextStickyPosition(beans, rowNode, up = false) { const { gos, rowRenderer } = beans; if (!rowNode?.sticky || !_isGroupRowsSticky(gos)) { return; } const stickyTopCtrls = rowRenderer.getStickyTopRowCtrls(); const stickyBottomCtrls = rowRenderer.getStickyBottomRowCtrls(); const isStickyTop = !stickyBottomCtrls.some((ctrl) => ctrl.rowNode.rowIndex === rowNode.rowIndex); const stickyRowCtrls = isStickyTop ? stickyTopCtrls : stickyBottomCtrls; const increment = (up ? -1 : 1) * (isStickyTop ? -1 : 1); let nextCtrl; for (let i = 0; i < stickyRowCtrls.length; i++) { if (stickyRowCtrls[i].rowNode.rowIndex === rowNode.rowIndex) { nextCtrl = stickyRowCtrls[i + increment]; break; } } return nextCtrl ? { rowIndex: nextCtrl.rowNode.rowIndex, rowPinned: null } : void 0; } function isLastRowInContainer(beans, rowPosition) { const { rowPinned, rowIndex } = rowPosition; const { pinnedRowModel, pageBounds } = beans; if (rowPinned === "top") { const lastTopIndex = (pinnedRowModel?.getPinnedTopRowCount() ?? 0) - 1; return lastTopIndex <= rowIndex; } if (rowPinned === "bottom") { const lastBottomIndex = (pinnedRowModel?.getPinnedBottomRowCount() ?? 0) - 1; return lastBottomIndex <= rowIndex; } const lastBodyIndex = pageBounds.getLastRow(); return lastBodyIndex <= rowIndex; } function _addFocusableContainerListener(beans, comp, eGui) { comp.addManagedElementListeners(eGui, { keydown: (e) => { if (!e.defaultPrevented && !_shouldSkipFocusableContainerListener(e) && e.key === KeyCode.TAB) { const backwards = e.shiftKey; if (!_findNextFocusableElement(beans, eGui, false, backwards)) { if (_focusNextGridCoreContainer(beans, backwards)) { e.preventDefault(); } } } } }); } function _focusGridInnerElement(beans, fromBottom) { return beans.ctrlsSvc.get("gridCtrl").focusInnerElement(fromBottom); } function _isHeaderFocusSuppressed(beans) { return beans.gos.get("suppressHeaderFocus") || !!beans.overlays?.exclusive; } function _isCellFocusSuppressed(beans) { return beans.gos.get("suppressCellFocus") || !!beans.overlays?.exclusive; } function _focusNextGridCoreContainer(beans, backwards, forceOut = false) { const gridCtrl = beans.ctrlsSvc.get("gridCtrl"); const focusResult = gridCtrl.focusNextInnerContainer(backwards); if (focusResult === true) { return true; } if (focusResult === false) { return focusResult; } if (forceOut || !backwards && !gridCtrl.isDetailGrid() && gridCtrl.isFocusInsideGridBody()) { gridCtrl.forceFocusOutOfContainer(backwards); } return false; } function _attemptToRestoreCellFocus(beans, focusedCell) { const focusSvc = beans.focusSvc; const currentFocusedCell = focusSvc.getFocusedCell(); if (currentFocusedCell && focusedCell && _areCellsEqual(currentFocusedCell, focusedCell)) { const { rowIndex, rowPinned, column } = focusedCell; if (_isNothingFocused(beans)) { focusSvc.setFocusedCell({ rowIndex, column, rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: !_isKeyboardMode() }); } } } function _getDefaultTabTargetForContainer(container, getGridBodyTabTarget) { const containerName = container.getFocusableContainerName(); if (containerName === "gridBody") { return getGridBodyTabTarget(); } return _runWithContainerFocusAllowed( container, () => _findFocusableElements(container.getGui(), ".ag-tab-guard").length > 0 ) ? containerName : null; } function _runWithContainerFocusAllowed(container, callback) { container.setAllowFocus?.(true); try { return callback(); } finally { container.setAllowFocus?.(false); } } var AG_GRID_SKIP_FOCUSABLE_CONTAINER = "__ag_Grid_Skip_Focusable_Container"; function _skipFocusableContainerListenerForAgGrid(event) { event[AG_GRID_SKIP_FOCUSABLE_CONTAINER] = true; } function _shouldSkipFocusableContainerListener(event) { return event[AG_GRID_SKIP_FOCUSABLE_CONTAINER] === true; } function getHeaderRowCount(colModel) { if (!colModel.cols) { return -1; } return colModel.cols.treeDepth + 1; } function getFocusHeaderRowCount(beans) { return beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0; } function getGroupRowsHeight(beans) { const heights = []; const headerRowContainerCtrls = beans.ctrlsSvc.getHeaderRowContainerCtrls(); for (const headerRowContainerCtrl of headerRowContainerCtrls) { if (!headerRowContainerCtrl) { continue; } const groupRowCount = headerRowContainerCtrl.getGroupRowCount() || 0; for (let i = 0; i < groupRowCount; i++) { const headerRowCtrl = headerRowContainerCtrl.getGroupRowCtrlAtIndex(i); const currentHeightAtPos = heights[i]; if (headerRowCtrl) { const newHeight = getColumnGroupHeaderRowHeight(beans, headerRowCtrl); if (currentHeightAtPos == null || newHeight > currentHeightAtPos) { heights[i] = newHeight; } } } } return heights; } function getColumnGroupHeaderRowHeight(beans, headerRowCtrl) { const defaultHeight = beans.colModel.isPivotMode() ? getPivotGroupHeaderHeight(beans) : getGroupHeaderHeight(beans); let maxDisplayedHeight = defaultHeight; const headerRowCellCtrls = headerRowCtrl.getHeaderCellCtrls(); for (const headerCellCtrl of headerRowCellCtrls) { const { column } = headerCellCtrl; const height = column.getAutoHeaderHeight(); if (height != null && height > maxDisplayedHeight && column.isAutoHeaderHeight()) { maxDisplayedHeight = height; } } return maxDisplayedHeight; } function getColumnHeaderRowHeight(beans) { const defaultHeight = beans.colModel.isPivotMode() ? getPivotHeaderHeight(beans) : getHeaderHeight(beans); let maxDisplayedHeight = defaultHeight; beans.colModel.forAllCols((col) => { const height = col.getAutoHeaderHeight(); if (height != null && height > maxDisplayedHeight && col.isAutoHeaderHeight()) { maxDisplayedHeight = height; } }); return maxDisplayedHeight; } function getHeaderHeight(beans) { return beans.gos.get("headerHeight") ?? beans.environment.getDefaultHeaderHeight(); } function getFloatingFiltersHeight(beans) { return beans.gos.get("floatingFiltersHeight") ?? getHeaderHeight(beans); } function getGroupHeaderHeight(beans) { return beans.gos.get("groupHeaderHeight") ?? getHeaderHeight(beans); } function getPivotHeaderHeight(beans) { return beans.gos.get("pivotHeaderHeight") ?? getHeaderHeight(beans); } function getPivotGroupHeaderHeight(beans) { return beans.gos.get("pivotGroupHeaderHeight") ?? getGroupHeaderHeight(beans); } function isHeaderPositionEqual(headerPosA, headerPosB) { return headerPosA.headerRowIndex === headerPosB.headerRowIndex && headerPosA.column === headerPosB.column; } function isHeaderPosition(position) { return position?.headerRowIndex != null; } var GridHeaderCtrl = class extends BeanStub { setComp(comp, eGui, eFocusableElement) { this.comp = comp; this.eGui = eGui; const { beans } = this; const { headerNavigation, touchSvc, ctrlsSvc } = beans; if (headerNavigation) { this.createManagedBean( new ManagedFocusFeature(eFocusableElement, { onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this), onFocusOut: this.onFocusOut.bind(this) }) ); } this.addManagedEventListeners({ columnPivotModeChanged: this.onPivotModeChanged.bind(this, beans), displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this, beans) }); this.onPivotModeChanged(beans); this.setupHeaderHeight(); const listener = this.onHeaderContextMenu.bind(this); this.addManagedElementListeners(this.eGui, { contextmenu: listener }); touchSvc?.mockHeaderContextMenu(this, listener); ctrlsSvc.register("gridHeaderCtrl", this); } setupHeaderHeight() { const listener = this.setHeaderHeight.bind(this); listener(); this.addManagedPropertyListeners( [ "headerHeight", "pivotHeaderHeight", "groupHeaderHeight", "pivotGroupHeaderHeight", "floatingFiltersHeight" ], listener ); this.addManagedEventListeners({ headerRowsChanged: listener, columnHeaderHeightChanged: listener, // add this to the animation frame to avoid a feedback loop columnGroupHeaderHeightChanged: () => _requestAnimationFrame(this.beans, () => listener()), stylesChanged: listener, advancedFilterEnabledChanged: listener }); } setHeaderHeight() { const { beans } = this; let totalHeaderHeight = 0; const groupHeight = getGroupRowsHeight(beans).reduce((prev, curr) => prev + curr, 0); const headerHeight = getColumnHeaderRowHeight(beans); if (beans.filterManager?.hasFloatingFilters()) { totalHeaderHeight += getFloatingFiltersHeight(beans); } totalHeaderHeight += groupHeight; totalHeaderHeight += headerHeight; const headerBorderWidth = beans.environment.getHeaderRowBorderWidth(); const totalHeaderHeightWithBorder = totalHeaderHeight + headerBorderWidth; if (this.headerHeightWithBorder !== totalHeaderHeightWithBorder) { this.headerHeightWithBorder = totalHeaderHeightWithBorder; const px = `${totalHeaderHeightWithBorder}px`; this.comp.setHeightAndMinHeight(px); } if (this.headerHeight !== totalHeaderHeight) { this.headerHeight = totalHeaderHeight; this.eventSvc.dispatchEvent({ type: "headerHeightChanged" }); } } onPivotModeChanged(beans) { const pivotMode = beans.colModel.isPivotMode(); this.comp.toggleCss("ag-pivot-on", pivotMode); this.comp.toggleCss("ag-pivot-off", !pivotMode); } onDisplayedColumnsChanged(beans) { const columns = beans.visibleCols.allCols; const shouldAllowOverflow = columns.some((col) => col.isSpanHeaderHeight()); this.comp.toggleCss("ag-header-allow-overflow", shouldAllowOverflow); } onTabKeyDown(e) { const isRtl = this.gos.get("enableRtl"); const backwards = e.shiftKey; const direction = backwards !== isRtl ? "LEFT" : "RIGHT"; const { beans } = this; const { headerNavigation, focusSvc } = beans; if (headerNavigation.navigateHorizontally(direction, true, e) || !backwards && focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards, true)) { e.preventDefault(); } } handleKeyDown(e) { let direction = null; const { headerNavigation } = this.beans; switch (e.key) { case KeyCode.LEFT: direction = "LEFT"; case KeyCode.RIGHT: { if (!_exists(direction)) { direction = "RIGHT"; } if (headerNavigation.navigateHorizontally(direction, false, e)) { e.preventDefault(); } break; } case KeyCode.UP: direction = "UP"; case KeyCode.DOWN: { if (!_exists(direction)) { direction = "DOWN"; } if (headerNavigation.navigateVertically(direction, e)) { e.preventDefault(); } break; } default: return; } } onFocusOut(e) { const { relatedTarget } = e; const { eGui, beans } = this; if (!relatedTarget && eGui.contains(_getActiveDomElement(beans))) { return; } if (!eGui.contains(relatedTarget)) { beans.focusSvc.focusedHeader = null; } } onHeaderContextMenu(mouseEvent, touch, touchEvent) { const { menuSvc, ctrlsSvc } = this.beans; if (!mouseEvent && !touchEvent || !menuSvc?.isHeaderContextMenuEnabled()) { return; } const { target } = mouseEvent ?? touch; if (target === this.eGui || target === ctrlsSvc.getHeaderRowContainerCtrl()?.eViewport) { menuSvc.showHeaderContextMenu(void 0, mouseEvent, touchEvent); } } }; var AbstractHeaderCellComp = class extends Component { constructor(template, ctrl) { super(template); this.ctrl = ctrl; } getCtrl() { return this.ctrl; } }; var HeaderCellElement = { tag: "div", cls: "ag-header-cell", role: "columnheader", children: [ { tag: "div", ref: "eResize", cls: "ag-header-cell-resize", role: "presentation" }, { tag: "div", ref: "eHeaderCompWrapper", cls: "ag-header-cell-comp-wrapper", role: "presentation" } ] }; var HeaderCellComp = class extends AbstractHeaderCellComp { constructor(ctrl) { super(HeaderCellElement, ctrl); this.eResize = RefPlaceholder; this.eHeaderCompWrapper = RefPlaceholder; this.headerCompVersion = 0; } postConstruct() { const eGui = this.getGui(); const refreshSelectAllGui = () => { const selectAllGui = this.ctrl.getSelectAllGui(); if (selectAllGui) { this.eResize.insertAdjacentElement("afterend", selectAllGui); this.addDestroyFunc(() => selectAllGui.remove()); } }; const compProxy = { setWidth: (width) => eGui.style.width = width, toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on), setUserStyles: (styles) => _addStylesToElement(eGui, styles), setAriaSort: (sort) => sort ? _setAriaSort(eGui, sort) : _removeAriaSort(eGui), setUserCompDetails: (compDetails) => this.setUserCompDetails(compDetails), getUserCompInstance: () => this.headerComp, refreshSelectAllGui, removeSelectAllGui: () => this.ctrl.getSelectAllGui()?.remove() }; this.ctrl.setComp(compProxy, this.getGui(), this.eResize, this.eHeaderCompWrapper, void 0); refreshSelectAllGui(); } destroy() { this.destroyHeaderComp(); super.destroy(); } destroyHeaderComp() { if (this.headerComp) { this.headerCompGui?.remove(); this.headerComp = this.destroyBean(this.headerComp); this.headerCompGui = void 0; } } setUserCompDetails(compDetails) { this.headerCompVersion++; const versionCopy = this.headerCompVersion; compDetails.newAgStackInstance().then((comp) => this.afterCompCreated(versionCopy, comp)); } afterCompCreated(version, headerComp) { if (version != this.headerCompVersion || !this.isAlive()) { this.destroyBean(headerComp); return; } this.destroyHeaderComp(); this.headerComp = headerComp; this.headerCompGui = headerComp.getGui(); this.eHeaderCompWrapper.appendChild(this.headerCompGui); this.ctrl.setDragSource(this.getGui()); } }; var HeaderGroupCellCompElement = { tag: "div", cls: "ag-header-group-cell", role: "columnheader", children: [ { tag: "div", ref: "eHeaderCompWrapper", cls: "ag-header-cell-comp-wrapper", role: "presentation" }, { tag: "div", ref: "eResize", cls: "ag-header-cell-resize", role: "presentation" } ] }; var HeaderGroupCellComp = class extends AbstractHeaderCellComp { constructor(ctrl) { super(HeaderGroupCellCompElement, ctrl); this.eResize = RefPlaceholder; this.eHeaderCompWrapper = RefPlaceholder; } postConstruct() { const eGui = this.getGui(); const setAttribute = (key, value) => value != void 0 ? eGui.setAttribute(key, value) : eGui.removeAttribute(key); const compProxy = { toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on), setUserStyles: (styles) => _addStylesToElement(eGui, styles), setHeaderWrapperHidden: (hidden) => { if (hidden) { this.eHeaderCompWrapper.style.setProperty("display", "none"); } else { this.eHeaderCompWrapper.style.removeProperty("display"); } }, setHeaderWrapperMaxHeight: (value) => { if (value != null) { this.eHeaderCompWrapper.style.setProperty("max-height", `${value}px`); } else { this.eHeaderCompWrapper.style.removeProperty("max-height"); } this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height", value != null); }, setResizableDisplayed: (displayed) => _setDisplayed(this.eResize, displayed), setWidth: (width) => eGui.style.width = width, setAriaExpanded: (expanded) => setAttribute("aria-expanded", expanded), setUserCompDetails: (details) => this.setUserCompDetails(details), getUserCompInstance: () => this.headerGroupComp }; this.ctrl.setComp(compProxy, eGui, this.eResize, this.eHeaderCompWrapper, void 0); } setUserCompDetails(details) { details.newAgStackInstance().then((comp) => this.afterHeaderCompCreated(comp)); } afterHeaderCompCreated(headerGroupComp) { const destroyFunc = () => this.destroyBean(headerGroupComp); if (!this.isAlive()) { destroyFunc(); return; } const eGui = this.getGui(); const eHeaderGroupGui = headerGroupComp.getGui(); this.eHeaderCompWrapper.appendChild(eHeaderGroupGui); this.addDestroyFunc(destroyFunc); this.headerGroupComp = headerGroupComp; this.ctrl.setDragSource(eGui); } }; var HeaderFilterCellCompElement = { tag: "div", cls: "ag-header-cell ag-floating-filter", role: "gridcell", children: [ { tag: "div", ref: "eFloatingFilterBody", role: "presentation" }, { tag: "div", ref: "eButtonWrapper", cls: "ag-floating-filter-button ag-hidden", role: "presentation", children: [ { tag: "button", ref: "eButtonShowMainFilter", cls: "ag-button ag-floating-filter-button-button", attrs: { type: "button", tabindex: "-1" } } ] } ] }; var HeaderFilterCellComp = class extends AbstractHeaderCellComp { constructor(ctrl) { super(HeaderFilterCellCompElement, ctrl); this.eFloatingFilterBody = RefPlaceholder; this.eButtonWrapper = RefPlaceholder; this.eButtonShowMainFilter = RefPlaceholder; } postConstruct() { const eGui = this.getGui(); const compProxy = { toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on), setUserStyles: (styles) => _addStylesToElement(eGui, styles), addOrRemoveBodyCssClass: (cssClassName, on) => this.eFloatingFilterBody.classList.toggle(cssClassName, on), setButtonWrapperDisplayed: (displayed) => _setDisplayed(this.eButtonWrapper, displayed), setCompDetails: (compDetails) => this.setCompDetails(compDetails), getFloatingFilterComp: () => this.compPromise, setWidth: (width) => eGui.style.width = width, setMenuIcon: (eIcon) => this.eButtonShowMainFilter.appendChild(eIcon) }; this.ctrl.setComp(compProxy, eGui, this.eButtonShowMainFilter, this.eFloatingFilterBody, void 0); } setCompDetails(compDetails) { if (!compDetails) { this.destroyFloatingFilterComp(); this.compPromise = null; return; } this.compPromise = compDetails.newAgStackInstance(); this.compPromise.then((comp) => this.afterCompCreated(comp)); } destroy() { this.destroyFloatingFilterComp(); super.destroy(); } destroyFloatingFilterComp() { this.floatingFilterComp?.getGui().remove(); this.floatingFilterComp = this.destroyBean(this.floatingFilterComp); } afterCompCreated(comp) { if (!comp) { return; } if (!this.isAlive()) { this.destroyBean(comp); return; } this.destroyFloatingFilterComp(); this.floatingFilterComp = comp; this.eFloatingFilterBody.appendChild(comp.getGui()); comp.afterGuiAttached?.(); } }; var HeaderRowComp = class extends Component { constructor(ctrl) { super({ tag: "div", cls: ctrl.headerRowClass, role: "row" }); this.ctrl = ctrl; this.headerComps = {}; } postConstruct() { const eGui = this.getGui(); eGui.setAttribute("tabindex", String(this.gos.get("tabIndex"))); _setAriaRowIndex(this.getGui(), this.ctrl.getAriaRowIndex()); const compProxy = { setHeight: (height) => this.getGui().style.height = height, setTop: (top) => this.getGui().style.top = top, setHeaderCtrls: (ctrls, forceOrder) => this.setHeaderCtrls(ctrls, forceOrder), setWidth: (width) => this.getGui().style.width = width, setRowIndex: (rowIndex) => _setAriaRowIndex(this.getGui(), rowIndex) }; this.ctrl.setComp(compProxy, void 0); } destroy() { this.setHeaderCtrls([], false); super.destroy(); } setHeaderCtrls(ctrls, forceOrder) { if (!this.isAlive()) { return; } const oldComps = this.headerComps; this.headerComps = {}; for (const ctrl of ctrls) { const id = ctrl.instanceId; let comp = oldComps[id]; delete oldComps[id]; if (comp == null) { comp = this.createHeaderComp(ctrl); this.getGui().appendChild(comp.getGui()); } this.headerComps[id] = comp; } Object.values(oldComps).forEach((comp) => { comp.getGui().remove(); this.destroyBean(comp); }); if (forceOrder) { const comps = Object.values(this.headerComps); comps.sort( (a, b) => { const leftA = a.getCtrl().column.getLeft(); const leftB = b.getCtrl().column.getLeft(); return leftA - leftB; } ); const elementsInOrder = comps.map((c) => c.getGui()); _setDomChildOrder(this.getGui(), elementsInOrder); } } createHeaderComp(headerCtrl) { let result; switch (this.ctrl.type) { case "group": result = new HeaderGroupCellComp(headerCtrl); break; case "filter": result = new HeaderFilterCellComp(headerCtrl); break; default: result = new HeaderCellComp(headerCtrl); break; } this.createBean(result); result.setParentComponent(this); return result; } }; var CenterWidthFeature = class extends BeanStub { constructor(callback, addSpacer = false) { super(); this.callback = callback; this.addSpacer = addSpacer; } postConstruct() { const listener = this.setWidth.bind(this); this.addManagedPropertyListener("domLayout", listener); this.addManagedEventListeners({ columnContainerWidthChanged: listener, displayedColumnsChanged: listener, leftPinnedWidthChanged: listener }); if (this.addSpacer) { this.addManagedEventListeners({ rightPinnedWidthChanged: listener, scrollVisibilityChanged: listener, scrollbarWidthChanged: listener }); } this.setWidth(); } setWidth() { const printLayout = _isDomLayout(this.gos, "print"); const { visibleCols, scrollVisibleSvc } = this.beans; const centerWidth = visibleCols.bodyWidth; const leftWidth = visibleCols.getColsLeftWidth(); const rightWidth = visibleCols.getDisplayedColumnsRightWidth(); let totalWidth; if (printLayout) { totalWidth = centerWidth + leftWidth + rightWidth; } else { totalWidth = centerWidth; if (this.addSpacer) { const relevantWidth = this.gos.get("enableRtl") ? leftWidth : rightWidth; if (relevantWidth === 0 && scrollVisibleSvc.verticalScrollShowing) { totalWidth += scrollVisibleSvc.getScrollbarWidth(); } } } this.callback(totalWidth); } }; var EmptyBean = class extends BeanStub { }; function setupCompBean(ctrl, ctx, compBean) { if (compBean) { ctrl.addDestroyFunc(() => ctx.destroyBean(compBean)); } return compBean ?? ctrl; } var SetLeftFeature = class extends BeanStub { constructor(columnOrGroup, eCell, beans, colsSpanning) { super(); this.columnOrGroup = columnOrGroup; this.eCell = eCell; this.colsSpanning = colsSpanning; this.columnOrGroup = columnOrGroup; this.ariaEl = eCell.querySelector("[role=columnheader]") || eCell; this.beans = beans; } setColsSpanning(colsSpanning) { this.colsSpanning = colsSpanning; this.onLeftChanged(); } getColumnOrGroup() { const { beans, colsSpanning } = this; if (beans.gos.get("enableRtl") && colsSpanning) { return _last(colsSpanning); } return this.columnOrGroup; } postConstruct() { const onLeftChanged = this.onLeftChanged.bind(this); this.addManagedListeners(this.columnOrGroup, { leftChanged: onLeftChanged }); this.setLeftFirstTime(); this.addManagedEventListeners({ displayedColumnsWidthChanged: onLeftChanged }); this.addManagedPropertyListener("domLayout", onLeftChanged); } setLeftFirstTime() { const { gos, colAnimation } = this.beans; const suppressMoveAnimation = gos.get("suppressColumnMoveAnimation"); const oldLeftExists = _exists(this.columnOrGroup.getOldLeft()); const animateColumnMove = colAnimation?.isActive() && oldLeftExists && !suppressMoveAnimation; if (animateColumnMove) { this.animateInLeft(); } else { this.onLeftChanged(); } } animateInLeft() { const colOrGroup = this.getColumnOrGroup(); const oldActualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getOldLeft()); const actualLeft = this.modifyLeftForPrintLayout(colOrGroup, colOrGroup.getLeft()); this.setLeft(oldActualLeft); this.actualLeft = actualLeft; this.beans.colAnimation.executeNextVMTurn(() => { if (this.actualLeft === actualLeft) { this.setLeft(actualLeft); } }); } onLeftChanged() { const colOrGroup = this.getColumnOrGroup(); const left = colOrGroup.getLeft(); this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left); this.setLeft(this.actualLeft); } modifyLeftForPrintLayout(colOrGroup, leftPosition) { const { gos, visibleCols } = this.beans; const printLayout = _isDomLayout(gos, "print"); if (!printLayout) { return leftPosition; } if (colOrGroup.getPinned() === "left") { return leftPosition; } const leftWidth = visibleCols.getColsLeftWidth(); if (colOrGroup.getPinned() === "right") { const bodyWidth = visibleCols.bodyWidth; return leftWidth + bodyWidth + leftPosition; } return leftWidth + leftPosition; } setLeft(value) { if (_exists(value)) { this.eCell.style.left = `${value}px`; } if (isColumnGroup(this.columnOrGroup)) { const children = this.columnOrGroup.getLeafColumns(); if (!children.length) { return; } if (children.length > 1) { _setAriaColSpan(this.ariaEl, children.length); } } } }; var CSS_FIRST_COLUMN = "ag-column-first"; var CSS_LAST_COLUMN = "ag-column-last"; function _getHeaderClassesFromColDef(abstractColDef, gos, column, columnGroup) { if (_missing(abstractColDef)) { return []; } return getColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, gos, column, columnGroup); } function _getToolPanelClassesFromColDef(abstractColDef, gos, column, columnGroup) { if (_missing(abstractColDef)) { return []; } return getColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, gos, column, columnGroup); } function refreshFirstAndLastStyles(comp, column, presentedColsService) { comp.toggleCss(CSS_FIRST_COLUMN, presentedColsService.isColAtEdge(column, "first")); comp.toggleCss(CSS_LAST_COLUMN, presentedColsService.isColAtEdge(column, "last")); } function getClassParams(abstractColDef, gos, column, columnGroup) { return _addGridCommonParams(gos, { // bad naming, as colDef here can be a group or a column, // however most people won't appreciate the difference, // so keeping it as colDef to avoid confusion. colDef: abstractColDef, column, columnGroup }); } function getColumnClassesFromCollDef(classesOrFunc, abstractColDef, gos, column, columnGroup) { if (_missing(classesOrFunc)) { return []; } let classToUse; if (typeof classesOrFunc === "function") { const params = getClassParams(abstractColDef, gos, column, columnGroup); classToUse = classesOrFunc(params); } else { classToUse = classesOrFunc; } if (typeof classToUse === "string") { return [classToUse]; } if (Array.isArray(classToUse)) { return [...classToUse]; } return []; } var instanceIdSequence2 = 0; var DOM_DATA_KEY_HEADER_CTRL = "headerCtrl"; var AbstractHeaderCellCtrl = class extends BeanStub { constructor(column, rowCtrl) { super(); this.column = column; this.rowCtrl = rowCtrl; this.resizeToggleTimeout = 0; this.resizeMultiplier = 1; this.resizeFeature = null; this.lastFocusEvent = null; this.dragSource = null; this.reAttemptToFocus = false; this.instanceId = column.getUniqueId() + "-" + instanceIdSequence2++; } postConstruct() { const refreshTabIndex = this.refreshTabIndex.bind(this); this.addManagedPropertyListeners(["suppressHeaderFocus"], refreshTabIndex); this.addManagedEventListeners({ overlayExclusiveChanged: refreshTabIndex }); } setComp(comp, eGui, eResize, eHeaderCompWrapper, compBean) { eGui.setAttribute("col-id", this.column.colIdSanitised); this.wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBean); if (this.reAttemptToFocus) { this.reAttemptToFocus = false; this.focus(this.lastFocusEvent ?? void 0); } } shouldStopEventPropagation(event) { const { headerRowIndex, column } = this.beans.focusSvc.focusedHeader; const colDef = column.getDefinition(); const colDefFunc = colDef?.suppressHeaderKeyboardEvent; if (!_exists(colDefFunc)) { return false; } const params = _addGridCommonParams(this.gos, { colDef, column, headerRowIndex, event }); return !!colDefFunc(params); } getWrapperHasFocus() { const activeEl = _getActiveDomElement(this.beans); return activeEl === this.eGui; } setGui(eGui, compBean) { this.eGui = eGui; this.addDomData(compBean); compBean.addManagedListeners(this.beans.eventSvc, { displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this) }); compBean.addManagedElementListeners(this.eGui, { focus: this.onGuiFocus.bind(this) }); this.onDisplayedColumnsChanged(); this.refreshTabIndex(); } refreshHeaderStyles() { const colDef = this.column.getDefinition(); if (!colDef) { return; } const { headerStyle } = colDef; let styles; if (typeof headerStyle === "function") { const cellStyleParams = this.getHeaderClassParams(); styles = headerStyle(cellStyleParams); } else { styles = headerStyle; } if (styles) { this.comp.setUserStyles(styles); } } onGuiFocus() { this.eventSvc.dispatchEvent({ type: "headerFocused", column: this.column }); } setupAutoHeight(params) { const { wrapperElement, checkMeasuringCallback, compBean } = params; const { beans } = this; const measureHeight = (timesCalled) => { if (!this.isAlive() || !compBean.isAlive()) { return; } const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(this.eGui); const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth; const wrapperHeight = wrapperElement.offsetHeight; const autoHeight = wrapperHeight + extraHeight; if (timesCalled < 5) { const doc = _getDocument(beans); const notYetInDom = !doc?.contains(wrapperElement); const possiblyNoContentYet = autoHeight == 0; if (notYetInDom || possiblyNoContentYet) { _batchCall(() => measureHeight(timesCalled + 1), "raf", beans); return; } } this.setColHeaderHeight(this.column, autoHeight); }; let isMeasuring = false; let stopResizeObserver; const checkMeasuring = () => { const newValue = this.column.isAutoHeaderHeight(); if (newValue && !isMeasuring) { startMeasuring(); } if (!newValue && isMeasuring) { stopMeasuring(); } }; const startMeasuring = () => { isMeasuring = true; this.comp.toggleCss("ag-header-cell-auto-height", true); measureHeight(0); stopResizeObserver = _observeResize(this.beans, wrapperElement, () => measureHeight(0)); }; const stopMeasuring = () => { isMeasuring = false; if (stopResizeObserver) { stopResizeObserver(); } this.comp.toggleCss("ag-header-cell-auto-height", false); stopResizeObserver = void 0; }; checkMeasuring(); compBean.addDestroyFunc(() => stopMeasuring()); compBean.addManagedListeners(this.column, { widthChanged: () => isMeasuring && measureHeight(0) }); compBean.addManagedEventListeners({ sortChanged: () => { if (isMeasuring) { window.setTimeout(() => measureHeight(0)); } } }); if (checkMeasuringCallback) { checkMeasuringCallback(checkMeasuring); } } onDisplayedColumnsChanged() { const { comp, column, beans, eGui } = this; if (!comp || !column || !eGui) { return; } refreshFirstAndLastStyles(comp, column, beans.visibleCols); _setAriaColIndex(eGui, beans.visibleCols.getAriaColIndex(column)); } addResizeAndMoveKeyboardListeners(compBean) { compBean.addManagedListeners(this.eGui, { keydown: this.onGuiKeyDown.bind(this), keyup: this.onGuiKeyUp.bind(this) }); } refreshTabIndex() { const suppressHeaderFocus = _isHeaderFocusSuppressed(this.beans); if (this.eGui) { _addOrRemoveAttribute(this.eGui, "tabindex", suppressHeaderFocus ? null : "-1"); } } onGuiKeyDown(e) { const activeEl = _getActiveDomElement(this.beans); const isLeftOrRight = e.key === KeyCode.LEFT || e.key === KeyCode.RIGHT; if (this.isResizing) { e.preventDefault(); e.stopImmediatePropagation(); } if ( // if elements within the header are focused, we don't process the event activeEl !== this.eGui || // if shiftKey, ctrlKey, metaKey and altKey are not pressed, it's cell navigation so we don't process the event !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey ) { return; } if (this.isResizing || isLeftOrRight) { e.preventDefault(); e.stopImmediatePropagation(); } const isCopy = (e.ctrlKey || e.metaKey) && _normaliseQwertyAzerty(e) === KeyCode.C; if (isCopy) { return this.beans.clipboardSvc?.copyToClipboard(); } if (!isLeftOrRight) { return; } const isLeft = e.key === KeyCode.LEFT !== this.gos.get("enableRtl"); const direction = isLeft ? "left" : "right"; if (e.altKey) { this.isResizing = true; this.resizeMultiplier += 1; const diff = this.getViewportAdjustedResizeDiff(e); this.resizeHeader(diff, e.shiftKey); this.resizeFeature?.toggleColumnResizing(true); } else { this.moveHeader(direction); } } moveHeader(hDirection) { this.beans.colMoves?.moveHeader(hDirection, this.eGui, this.column, this.rowCtrl.pinned, this); } getViewportAdjustedResizeDiff(e) { const diff = this.getResizeDiff(e); const { pinnedCols } = this.beans; return pinnedCols ? pinnedCols.getHeaderResizeDiff(diff, this.column) : diff; } getResizeDiff(e) { const { gos, column } = this; let isLeft = e.key === KeyCode.LEFT !== gos.get("enableRtl"); const pinned = column.getPinned(); const isRtl = gos.get("enableRtl"); if (pinned) { if (isRtl !== (pinned === "right")) { isLeft = !isLeft; } } return (isLeft ? -1 : 1) * this.resizeMultiplier; } onGuiKeyUp() { if (!this.isResizing) { return; } if (this.resizeToggleTimeout) { window.clearTimeout(this.resizeToggleTimeout); this.resizeToggleTimeout = 0; } this.isResizing = false; this.resizeMultiplier = 1; this.resizeToggleTimeout = window.setTimeout(() => { this.resizeFeature?.toggleColumnResizing(false); }, 150); } handleKeyDown(e) { const wrapperHasFocus = this.getWrapperHasFocus(); switch (e.key) { case KeyCode.PAGE_DOWN: case KeyCode.PAGE_UP: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: if (wrapperHasFocus) { e.preventDefault(); } } } addDomData(compBean) { const key = DOM_DATA_KEY_HEADER_CTRL; const { eGui, gos } = this; _setDomData(gos, eGui, key, this); compBean.addDestroyFunc(() => _setDomData(gos, eGui, key, null)); } focus(event) { if (!this.isAlive()) { return false; } const { eGui } = this; if (!eGui) { this.reAttemptToFocus = true; } else { this.lastFocusEvent = event || null; eGui.focus(); } return true; } focusThis() { this.beans.focusSvc.focusedHeader = { headerRowIndex: this.rowCtrl.rowIndex, column: this.column }; } removeDragSource() { if (this.dragSource) { this.beans.dragAndDrop?.removeDragSource(this.dragSource); this.dragSource = null; } } handleContextMenuMouseEvent(mouseEvent, touchEvent, column) { const event = mouseEvent ?? touchEvent; const { menuSvc, gos } = this.beans; if (gos.get("preventDefaultOnContextMenu")) { event.preventDefault(); } if (menuSvc?.isHeaderContextMenuEnabled(column)) { menuSvc.showHeaderContextMenu(column, mouseEvent, touchEvent); } this.dispatchColumnMouseEvent("columnHeaderContextMenu", column); } dispatchColumnMouseEvent(eventType, column) { this.eventSvc.dispatchEvent({ type: eventType, column }); } setColHeaderHeight(col, height) { if (!col.setAutoHeaderHeight(height)) { return; } const { eventSvc } = this; if (col.isColumn) { eventSvc.dispatchEvent({ type: "columnHeaderHeightChanged", column: col, columns: [col], source: "autosizeColumnHeaderHeight" }); } else { eventSvc.dispatchEvent({ type: "columnGroupHeaderHeightChanged", columnGroup: col, source: "autosizeColumnGroupHeaderHeight" }); } } clearComponent() { this.removeDragSource(); this.resizeFeature = null; this.comp = null; this.eGui = null; } destroy() { super.destroy(); this.column = null; this.lastFocusEvent = null; this.rowCtrl = null; } }; var HeaderCellCtrl = class extends AbstractHeaderCellCtrl { constructor() { super(...arguments); this.refreshFunctions = {}; this.userHeaderClasses = /* @__PURE__ */ new Set(); this.ariaDescriptionProperties = /* @__PURE__ */ new Map(); } wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBeanInput) { this.comp = comp; const { rowCtrl, column, beans } = this; const { colResize, context, colHover, rangeSvc } = beans; const compBean = setupCompBean(this, context, compBeanInput); this.setGui(eGui, compBean); this.updateState(); this.setupWidth(compBean); this.setupMovingCss(compBean); this.setupMenuClass(compBean); this.setupSortableClass(compBean); this.setupWrapTextClass(); this.refreshSpanHeaderHeight(); this.setupAutoHeight({ wrapperElement: eHeaderCompWrapper, checkMeasuringCallback: (checkMeasuring) => this.setRefreshFunction("measuring", checkMeasuring), compBean }); this.addColumnHoverListener(compBean); this.setupFilterClass(compBean); this.setupStylesFromColDef(); this.setupClassesFromColDef(); this.setupTooltip(); this.addActiveHeaderMouseListeners(compBean); this.setupSelectAll(compBean); this.setupUserComp(); this.refreshAria(); if (colResize) { this.resizeFeature = compBean.createManagedBean( colResize.createResizeFeature(rowCtrl.pinned, column, eResize, comp, this) ); } else { _setDisplayed(eResize, false); } colHover?.createHoverFeature(compBean, [column], eGui); rangeSvc?.createRangeHighlightFeature(compBean, column, comp); compBean.createManagedBean(new SetLeftFeature(column, eGui, beans)); compBean.createManagedBean( new ManagedFocusFeature(eGui, { shouldStopEventPropagation: (e) => this.shouldStopEventPropagation(e), onTabKeyDown: () => null, handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this), onFocusOut: this.onFocusOut.bind(this) }) ); this.addResizeAndMoveKeyboardListeners(compBean); compBean.addManagedPropertyListeners( ["suppressMovableColumns", "suppressMenuHide", "suppressAggFuncInHeader", "enableAdvancedFilter"], () => this.refresh() ); compBean.addManagedListeners(column, { colDefChanged: () => this.refresh(), formulaRefChanged: () => this.refresh(), headerHighlightChanged: this.onHeaderHighlightChanged.bind(this) }); const listener = () => this.checkDisplayName(); compBean.addManagedEventListeners({ columnValueChanged: listener, columnRowGroupChanged: listener, columnPivotChanged: listener, headerHeightChanged: this.onHeaderHeightChanged.bind(this) }); compBean.addDestroyFunc(() => { this.refreshFunctions = {}; this.selectAllFeature = null; this.dragSourceElement = void 0; this.userCompDetails = null; this.userHeaderClasses.clear(); this.ariaDescriptionProperties.clear(); this.clearComponent(); }); } resizeHeader(delta, shiftKey) { this.beans.colResize?.resizeHeader(this.column, delta, shiftKey); } getHeaderClassParams() { const { column, beans } = this; const colDef = column.colDef; return _addGridCommonParams(beans.gos, { colDef, column, floatingFilter: false }); } setupUserComp() { const compDetails = this.lookupUserCompDetails(); if (compDetails) { this.setCompDetails(compDetails); } } setCompDetails(compDetails) { this.userCompDetails = compDetails; this.comp.setUserCompDetails(compDetails); } lookupUserCompDetails() { const params = this.createParams(); const colDef = this.column.getColDef(); return _getHeaderCompDetails(this.beans.userCompFactory, colDef, params); } createParams() { const { menuSvc, sortSvc, colFilter, gos } = this.beans; const params = _addGridCommonParams(gos, { column: this.column, displayName: this.displayName, enableSorting: this.column.isSortable(), enableMenu: this.menuEnabled, enableFilterButton: this.openFilterEnabled && !!menuSvc?.isHeaderFilterButtonEnabled(this.column), enableFilterIcon: !!colFilter && (!this.openFilterEnabled || _isLegacyMenuEnabled(this.gos)), showColumnMenu: (buttonElement, onClosedCallback) => { menuSvc?.showColumnMenu({ column: this.column, buttonElement, positionBy: "button", onClosedCallback }); }, showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => { menuSvc?.showColumnMenu({ column: this.column, mouseEvent, positionBy: "mouse", onClosedCallback }); }, showFilter: (buttonElement) => { menuSvc?.showFilterMenu({ column: this.column, buttonElement, containerType: "columnFilter", positionBy: "button" }); }, progressSort: (multiSort) => { sortSvc?.progressSort(this.column, !!multiSort, "uiColumnSorted"); }, setSort: (sort, multiSort) => { sortSvc?.setSortForColumn(this.column, _getSortDefFromInput(sort), !!multiSort, "uiColumnSorted"); }, eGridHeader: this.eGui, setTooltip: (value, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); this.setupTooltip(value, shouldDisplayTooltip); } }); return params; } setupSelectAll(compBean) { const { selectionSvc } = this.beans; if (!selectionSvc) { return; } this.selectAllFeature = compBean.createOptionalManagedBean(selectionSvc.createSelectAllFeature(this.column)); this.selectAllFeature?.setComp(this); compBean.addManagedPropertyListener("rowSelection", () => { const selectAllFeature = selectionSvc.createSelectAllFeature(this.column); if (selectAllFeature && !this.selectAllFeature) { this.selectAllFeature = compBean.createManagedBean(selectAllFeature); this.selectAllFeature?.setComp(this); this.comp.refreshSelectAllGui(); } else if (this.selectAllFeature && !selectAllFeature) { this.comp.removeSelectAllGui(); this.selectAllFeature = this.destroyBean(this.selectAllFeature); } }); } getSelectAllGui() { return this.selectAllFeature?.getCheckboxGui(); } handleKeyDown(e) { super.handleKeyDown(e); if (e.key === KeyCode.SPACE) { this.selectAllFeature?.onSpaceKeyDown(e); } else if (e.key === KeyCode.ENTER) { this.onEnterKeyDown(e); } else if (e.key === KeyCode.DOWN && e.altKey) { this.showMenuOnKeyPress(e, false); } } onEnterKeyDown(e) { const { column, gos, sortable, beans } = this; let actioned = false; if (e.ctrlKey || e.metaKey) { actioned = this.showMenuOnKeyPress(e, true); } if (!actioned) { if (!e.altKey && _getEnableColumnSelection(gos)) { beans.rangeSvc?.handleColumnSelection(column, e); } else if (sortable) { beans.sortSvc?.progressSort(column, e.shiftKey, "uiColumnSorted"); } } } showMenuOnKeyPress(e, isFilterShortcut) { const headerComp = this.comp.getUserCompInstance(); if (!isHeaderComp(headerComp)) { return false; } if (headerComp.onMenuKeyboardShortcut(isFilterShortcut)) { e.preventDefault(); return true; } return false; } onFocusIn(e) { if (!this.eGui.contains(e.relatedTarget)) { this.focusThis(); this.announceAriaDescription(); } if (_isKeyboardMode()) { this.setActiveHeader(true); } } onFocusOut(e) { if (this.eGui.contains(e.relatedTarget)) { return; } this.setActiveHeader(false); } setupTooltip(value, shouldDisplayTooltip) { this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderTooltip( this.tooltipFeature, this, value, shouldDisplayTooltip ); } setupStylesFromColDef() { this.setRefreshFunction("headerStyles", this.refreshHeaderStyles.bind(this)); this.refreshHeaderStyles(); } setupClassesFromColDef() { const refreshHeaderClasses = () => { const colDef = this.column.getColDef(); const classes = _getHeaderClassesFromColDef(colDef, this.gos, this.column, null); const oldClasses = this.userHeaderClasses; this.userHeaderClasses = new Set(classes); for (const c of classes) { if (oldClasses.has(c)) { oldClasses.delete(c); } else { this.comp.toggleCss(c, true); } } for (const c of oldClasses) { this.comp.toggleCss(c, false); } }; this.setRefreshFunction("headerClasses", refreshHeaderClasses); refreshHeaderClasses(); } setDragSource(eSource) { this.dragSourceElement = eSource; this.removeDragSource(); if (!eSource || !this.draggable) { return; } this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eSource, this.column, this.displayName) ?? null; } updateState() { const { menuSvc } = this.beans; this.menuEnabled = !!menuSvc?.isColumnMenuInHeaderEnabled(this.column); this.openFilterEnabled = !!menuSvc?.isFilterMenuInHeaderEnabled(this.column); this.sortable = this.column.isSortable(); this.displayName = this.calculateDisplayName(); this.draggable = this.workOutDraggable(); } setRefreshFunction(name, func) { this.refreshFunctions[name] = func; } refresh() { this.updateState(); this.refreshHeaderComp(); this.refreshAria(); for (const f of Object.values(this.refreshFunctions)) { f(); } } refreshHeaderComp() { const newCompDetails = this.lookupUserCompDetails(); if (!newCompDetails) { return; } const compInstance = this.comp.getUserCompInstance(); const attemptRefresh = compInstance != null && this.userCompDetails.componentClass == newCompDetails.componentClass; const headerCompRefreshed = attemptRefresh ? this.attemptHeaderCompRefresh(newCompDetails.params) : false; if (headerCompRefreshed) { this.setDragSource(this.dragSourceElement); } else { this.setCompDetails(newCompDetails); } } attemptHeaderCompRefresh(params) { const headerComp = this.comp.getUserCompInstance(); if (!headerComp) { return false; } if (!headerComp.refresh) { return false; } const res = headerComp.refresh(params); return res; } calculateDisplayName() { return this.beans.colNames.getDisplayNameForColumn(this.column, "header", true); } checkDisplayName() { if (this.displayName !== this.calculateDisplayName()) { this.refresh(); } } workOutDraggable() { const colDef = this.column.getColDef(); const isSuppressMovableColumns = this.gos.get("suppressMovableColumns"); const colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition; return !!colCanMove || !!colDef.enableRowGroup || !!colDef.enablePivot; } setupWidth(compBean) { const listener = () => { const columnWidth = this.column.getActualWidth(); this.comp.setWidth(`${columnWidth}px`); }; compBean.addManagedListeners(this.column, { widthChanged: listener }); listener(); } setupMovingCss(compBean) { const listener = () => { this.comp.toggleCss("ag-header-cell-moving", this.column.isMoving()); }; compBean.addManagedListeners(this.column, { movingChanged: listener }); listener(); } setupMenuClass(compBean) { const listener = () => { this.comp?.toggleCss("ag-column-menu-visible", this.column.isMenuVisible()); }; compBean.addManagedListeners(this.column, { menuVisibleChanged: listener }); listener(); } setupSortableClass(compBean) { const updateSortableCssClass = () => { this.comp.toggleCss("ag-header-cell-sortable", !!this.sortable); }; updateSortableCssClass(); this.setRefreshFunction("updateSortable", updateSortableCssClass); compBean.addManagedEventListeners({ sortChanged: this.refreshAriaSort.bind(this) }); } setupFilterClass(compBean) { const listener = () => { const isFilterActive = this.column.isFilterActive(); this.comp.toggleCss("ag-header-cell-filtered", isFilterActive); this.refreshAria(); }; compBean.addManagedListeners(this.column, { filterActiveChanged: listener }); listener(); } setupWrapTextClass() { const listener = () => { const wrapText = !!this.column.getColDef().wrapHeaderText; this.comp.toggleCss("ag-header-cell-wrap-text", wrapText); }; listener(); this.setRefreshFunction("wrapText", listener); } onHeaderHighlightChanged() { const highlighted = this.column.getHighlighted(); const beforeOn = highlighted === 0; const afterOn = highlighted === 1; this.comp.toggleCss("ag-header-highlight-before", beforeOn); this.comp.toggleCss("ag-header-highlight-after", afterOn); } onDisplayedColumnsChanged() { super.onDisplayedColumnsChanged(); if (!this.isAlive()) { return; } this.onHeaderHeightChanged(); } onHeaderHeightChanged() { this.refreshSpanHeaderHeight(); } refreshSpanHeaderHeight() { const { eGui, column, comp, beans } = this; const groupHeaderHeight = getGroupRowsHeight(this.beans); const isZeroGroupHeight = groupHeaderHeight.reduce((total, next) => total + next, 0) === 0; comp.toggleCss("ag-header-parent-hidden", isZeroGroupHeight); if (!column.isSpanHeaderHeight()) { eGui.style.removeProperty("top"); eGui.style.removeProperty("height"); comp.toggleCss("ag-header-span-height", false); comp.toggleCss("ag-header-span-total", false); return; } const { numberOfParents, isSpanningTotal } = this.column.getColumnGroupPaddingInfo(); comp.toggleCss("ag-header-span-height", numberOfParents > 0); const headerHeight = getColumnHeaderRowHeight(beans); if (numberOfParents === 0) { comp.toggleCss("ag-header-span-total", false); eGui.style.setProperty("top", `0px`); eGui.style.setProperty("height", `${headerHeight}px`); return; } comp.toggleCss("ag-header-span-total", isSpanningTotal); const indexToStartSpanning = (this.column.getFirstRealParent()?.getLevel() ?? -1) + 1; const rowsToSpan = groupHeaderHeight.length - indexToStartSpanning; let extraHeight = 0; for (let i = 0; i < rowsToSpan; i++) { extraHeight += groupHeaderHeight[groupHeaderHeight.length - 1 - i]; } eGui.style.setProperty("top", `${-extraHeight}px`); eGui.style.setProperty("height", `${headerHeight + extraHeight}px`); } refreshAriaSort() { let description = null; const { beans, column, comp, sortable } = this; if (sortable) { const translate = this.getLocaleTextFunc(); const sortDef = beans.sortSvc?.getDisplaySortForColumn(column) ?? null; comp.setAriaSort(_getAriaSortState(sortDef)); description = translate("ariaSortableColumn", "Press ENTER to sort"); } else { comp.setAriaSort(); } this.setAriaDescriptionProperty("sort", description); } refreshAriaMenu() { let description = null; if (this.menuEnabled) { const translate = this.getLocaleTextFunc(); description = translate("ariaMenuColumn", "Press ALT DOWN to open column menu"); } this.setAriaDescriptionProperty("menu", description); } refreshAriaFilterButton() { let description = null; const { openFilterEnabled, gos } = this; if (openFilterEnabled && !_isLegacyMenuEnabled(gos)) { const translate = this.getLocaleTextFunc(); description = translate("ariaFilterColumn", "Press CTRL ENTER to open filter"); } this.setAriaDescriptionProperty("filterButton", description); } refreshAriaFiltered() { let description = null; if (this.column.isFilterActive()) { const translate = this.getLocaleTextFunc(); description = translate("ariaColumnFiltered", "Column Filtered"); } this.setAriaDescriptionProperty("filter", description); } refreshAriaCellSelection() { let description = null; const { gos, column } = this; const enableColumnSelection = _getEnableColumnSelection(gos); if (enableColumnSelection && !isRowNumberCol(column)) { const translate = this.getLocaleTextFunc(); description = translate( "ariaColumnCellSelection", "Press Enter to toggle selection for all visible cells in this column" ); } this.setAriaDescriptionProperty("cellSelection", description); } setAriaDescriptionProperty(property, value) { const props = this.ariaDescriptionProperties; if (value != null) { props.set(property, value); } else { props.delete(property); } } announceAriaDescription() { const { beans, eGui, ariaDescriptionProperties } = this; if (!eGui.contains(_getActiveDomElement(beans))) { return; } const ariaDescription = Array.from(ariaDescriptionProperties.keys()).sort((a, b) => a === "filter" ? -1 : b.charCodeAt(0) - a.charCodeAt(0)).map((key) => ariaDescriptionProperties.get(key)).join(". "); beans.ariaAnnounce?.announceValue(ariaDescription, "columnHeader"); } refreshAria() { this.refreshAriaSort(); this.refreshAriaMenu(); this.refreshAriaFilterButton(); this.refreshAriaFiltered(); this.refreshAriaCellSelection(); } addColumnHoverListener(compBean) { this.beans.colHover?.addHeaderColumnHoverListener(compBean, this.comp, this.column); } addActiveHeaderMouseListeners(compBean) { const listener = (e) => this.handleMouseOverChange(e.type === "mouseenter"); const clickListener = () => { this.setActiveHeader(true); this.dispatchColumnMouseEvent("columnHeaderClicked", this.column); }; const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, this.column); compBean.addManagedListeners(this.eGui, { mouseenter: listener, mouseleave: listener, click: clickListener, contextmenu: contextMenuListener }); } handleMouseOverChange(isMouseOver) { this.setActiveHeader(isMouseOver); this.eventSvc.dispatchEvent({ type: isMouseOver ? "columnHeaderMouseOver" : "columnHeaderMouseLeave", column: this.column }); } setActiveHeader(active) { this.comp.toggleCss("ag-header-active", active); } getAnchorElementForMenu(isFilter) { const headerComp = this.comp.getUserCompInstance(); if (isHeaderComp(headerComp)) { return headerComp.getAnchorElementForMenu(isFilter); } return this.eGui; } destroy() { this.tooltipFeature = this.destroyBean(this.tooltipFeature); super.destroy(); } }; function isHeaderComp(headerComp) { return typeof headerComp?.getAnchorElementForMenu === "function" && typeof headerComp.onMenuKeyboardShortcut === "function"; } var instanceIdSequence3 = 0; var HeaderRowCtrl = class extends BeanStub { constructor(rowIndex, pinned, type) { super(); this.rowIndex = rowIndex; this.pinned = pinned; this.type = type; this.instanceId = instanceIdSequence3++; this.comp = null; this.allCtrls = []; let typeClass = "ag-header-row-column"; if (type === "group") { typeClass = "ag-header-row-group"; } else if (type === "filter") { typeClass = "ag-header-row-filter"; } this.headerRowClass = `ag-header-row ${typeClass}`; } setRowIndex(rowIndex) { this.rowIndex = rowIndex; this.comp?.setRowIndex(this.getAriaRowIndex()); this.onRowHeightChanged(); } postConstruct() { this.isPrintLayout = _isDomLayout(this.gos, "print"); this.isEnsureDomOrder = this.gos.get("ensureDomOrder"); } /** Checks that every header cell that is currently visible has been rendered. * Can only be false under some circumstances when using React */ areCellsRendered() { if (!this.comp) { return false; } return this.allCtrls.every((ctrl) => ctrl.eGui != null); } /** * * @param comp Proxy to the actual component * @param initCompState Should the component be initialised with the current state of the controller. Default: true */ setComp(comp, compBean, initCompState = true) { this.comp = comp; compBean = setupCompBean(this, this.beans.context, compBean); if (initCompState) { this.setRowIndex(this.rowIndex); this.onVirtualColumnsChanged(); } this.setWidth(); this.addEventListeners(compBean); } getAriaRowIndex() { return this.rowIndex + 1; } addEventListeners(compBean) { const onHeightChanged = this.onRowHeightChanged.bind(this); const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this); compBean.addManagedEventListeners({ columnResized: this.setWidth.bind(this), displayedColumnsChanged: onDisplayedColumnsChanged, virtualColumnsChanged: (params) => this.onVirtualColumnsChanged(params.afterScroll), columnGroupHeaderHeightChanged: onHeightChanged, columnHeaderHeightChanged: onHeightChanged, stylesChanged: onHeightChanged, advancedFilterEnabledChanged: onHeightChanged }); compBean.addManagedPropertyListener("domLayout", onDisplayedColumnsChanged); compBean.addManagedPropertyListener("ensureDomOrder", (e) => this.isEnsureDomOrder = e.currentValue); compBean.addManagedPropertyListeners( [ "headerHeight", "pivotHeaderHeight", "groupHeaderHeight", "pivotGroupHeaderHeight", "floatingFiltersHeight" ], onHeightChanged ); } onDisplayedColumnsChanged() { this.isPrintLayout = _isDomLayout(this.gos, "print"); this.onVirtualColumnsChanged(); this.setWidth(); this.onRowHeightChanged(); } setWidth() { if (!this.comp) { return; } const width = this.getWidthForRow(); this.comp.setWidth(`${width}px`); } getWidthForRow() { const { visibleCols } = this.beans; if (this.isPrintLayout) { const pinned = this.pinned != null; if (pinned) { return 0; } return visibleCols.getContainerWidth("right") + visibleCols.getContainerWidth("left") + visibleCols.getContainerWidth(null); } return visibleCols.getContainerWidth(this.pinned); } onRowHeightChanged() { if (!this.comp) { return; } const { topOffset, rowHeight } = this.getTopAndHeight(); this.comp.setTop(topOffset + "px"); this.comp.setHeight(rowHeight + "px"); } getTopAndHeight() { let topOffset = 0; const groupHeadersHeight = getGroupRowsHeight(this.beans); for (let i = 0; i < groupHeadersHeight.length; i++) { if (i === this.rowIndex && this.type === "group") { return { topOffset, rowHeight: groupHeadersHeight[i] }; } topOffset += groupHeadersHeight[i]; } const headerHeight = getColumnHeaderRowHeight(this.beans); if (this.type === "column") { return { topOffset, rowHeight: headerHeight }; } topOffset += headerHeight; const filterHeight = getFloatingFiltersHeight(this.beans); return { topOffset, rowHeight: filterHeight }; } onVirtualColumnsChanged(afterScroll = false) { if (!this.comp) { return; } const ctrlsToDisplay = this.getUpdatedHeaderCtrls(); const forceOrder = this.isEnsureDomOrder || this.isPrintLayout; this.comp.setHeaderCtrls(ctrlsToDisplay, forceOrder, afterScroll); } /** * Recycles the header cell ctrls and creates new ones for the columns in the viewport * @returns The updated header cell ctrls */ getUpdatedHeaderCtrls() { const oldCtrls = this.ctrlsById; this.ctrlsById = /* @__PURE__ */ new Map(); const columns = this.getColumnsInViewport(); for (const child of columns) { this.recycleAndCreateHeaderCtrls(child, this.ctrlsById, oldCtrls); } const isFocusedAndDisplayed = (ctrl) => { const { focusSvc, visibleCols } = this.beans; const isFocused = focusSvc.isHeaderWrapperFocused(ctrl); if (!isFocused) { return false; } const isDisplayed = visibleCols.isVisible(ctrl.column); return isDisplayed; }; if (oldCtrls) { for (const [id, oldCtrl] of oldCtrls) { const keepCtrl = isFocusedAndDisplayed(oldCtrl); if (keepCtrl) { this.ctrlsById.set(id, oldCtrl); } else { this.destroyBean(oldCtrl); } } } this.allCtrls = Array.from(this.ctrlsById.values()); return this.allCtrls; } /** Get the current header cell ctrls */ getHeaderCellCtrls() { return this.allCtrls; } recycleAndCreateHeaderCtrls(headerColumn, currCtrls, oldCtrls) { if (headerColumn.isEmptyGroup()) { return; } const idOfChild = headerColumn.getUniqueId(); let headerCtrl; if (oldCtrls) { headerCtrl = oldCtrls.get(idOfChild); oldCtrls.delete(idOfChild); } const forOldColumn = headerCtrl && headerCtrl.column != headerColumn; if (forOldColumn) { this.destroyBean(headerCtrl); headerCtrl = void 0; } if (headerCtrl == null) { switch (this.type) { case "filter": { headerCtrl = this.createBean( this.beans.registry.createDynamicBean( "headerFilterCellCtrl", true, headerColumn, this ) ); break; } case "group": headerCtrl = this.createBean( this.beans.registry.createDynamicBean( "headerGroupCellCtrl", true, headerColumn, this ) ); break; default: headerCtrl = this.createBean(new HeaderCellCtrl(headerColumn, this)); break; } } currCtrls.set(idOfChild, headerCtrl); } getColumnsInViewport() { if (!this.isPrintLayout) { return this.getComponentsToRender(); } if (this.pinned) { return []; } const viewportColumns = []; for (const pinned of ["left", null, "right"]) { viewportColumns.push(...this.getComponentsToRender(pinned)); } return viewportColumns; } getComponentsToRender(pinned = this.pinned) { if (this.type === "group") { return this.beans.colViewport.getHeadersToRender(pinned, this.rowIndex); } return this.beans.colViewport.getColumnHeadersToRender(pinned); } focusHeader(column, event) { const ctrl = this.allCtrls.find((ctrl2) => ctrl2.column == column); if (!ctrl) { return false; } const focused = ctrl.focus(event); return focused; } destroy() { this.allCtrls = this.destroyBeans(this.allCtrls); this.ctrlsById = void 0; this.comp = null; super.destroy(); } }; var HeaderRowContainerCtrl = class extends BeanStub { constructor(pinned) { super(); this.pinned = pinned; this.hidden = false; this.includeFloatingFilter = false; this.groupsRowCtrls = []; } setComp(comp, eGui) { this.comp = comp; this.eViewport = eGui; const { pinnedCols, ctrlsSvc, colModel, colMoves } = this.beans; this.setupCenterWidth(); pinnedCols?.setupHeaderPinnedWidth(this); this.setupDragAndDrop(colMoves, this.eViewport); const onDisplayedColsChanged = this.refresh.bind(this, true); this.addManagedEventListeners({ displayedColumnsChanged: onDisplayedColsChanged, advancedFilterEnabledChanged: onDisplayedColsChanged }); const headerType = `${typeof this.pinned === "string" ? this.pinned : "center"}Header`; ctrlsSvc.register(headerType, this); if (colModel.ready) { this.refresh(); } } getAllCtrls() { const res = [...this.groupsRowCtrls]; if (this.columnsRowCtrl) { res.push(this.columnsRowCtrl); } if (this.filtersRowCtrl) { res.push(this.filtersRowCtrl); } return res; } refresh(keepColumns = false) { const { focusSvc, filterManager, visibleCols } = this.beans; let sequence = 0; const focusedHeaderPosition = focusSvc.getFocusHeaderToUseAfterRefresh(); const refreshColumnGroups = () => { const groupRowCount = visibleCols.headerGroupRowCount; sequence = groupRowCount; if (!keepColumns) { this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls); } const currentGroupCount = this.groupsRowCtrls.length; if (currentGroupCount === groupRowCount) { return; } if (currentGroupCount > groupRowCount) { for (let i = groupRowCount; i < currentGroupCount; i++) { this.destroyBean(this.groupsRowCtrls[i]); } this.groupsRowCtrls.length = groupRowCount; return; } for (let i = currentGroupCount; i < groupRowCount; i++) { const ctrl = this.createBean(new HeaderRowCtrl(i, this.pinned, "group")); this.groupsRowCtrls.push(ctrl); } }; const refreshColumns = () => { const rowIndex = sequence++; if (this.hidden) { this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl); return; } if (this.columnsRowCtrl == null || !keepColumns) { this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl); this.columnsRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, "column")); } else if (this.columnsRowCtrl.rowIndex !== rowIndex) { this.columnsRowCtrl.setRowIndex(rowIndex); } }; const refreshFilters = () => { this.includeFloatingFilter = !!filterManager?.hasFloatingFilters() && !this.hidden; const destroyPreviousComp = () => { this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl); }; if (!this.includeFloatingFilter) { destroyPreviousComp(); return; } if (!keepColumns) { destroyPreviousComp(); } const rowIndex = sequence++; if (this.filtersRowCtrl) { const rowIndexMismatch = this.filtersRowCtrl.rowIndex !== rowIndex; if (rowIndexMismatch) { this.filtersRowCtrl.setRowIndex(rowIndex); } } else { this.filtersRowCtrl = this.createBean(new HeaderRowCtrl(rowIndex, this.pinned, "filter")); } }; const oldCtrls = this.getAllCtrls(); refreshColumnGroups(); refreshColumns(); refreshFilters(); const allCtrls = this.getAllCtrls(); this.comp.setCtrls(allCtrls); this.restoreFocusOnHeader(focusSvc, focusedHeaderPosition); if (oldCtrls.length !== allCtrls.length) { this.beans.eventSvc.dispatchEvent({ type: "headerRowsChanged" }); } } getHeaderCtrlForColumn(column) { const findCtrl = (ctrl) => ctrl?.getHeaderCellCtrls().find((ctrl2) => ctrl2.column === column); if (isColumn(column)) { return findCtrl(this.columnsRowCtrl); } if (this.groupsRowCtrls.length === 0) { return; } for (let i = 0; i < this.groupsRowCtrls.length; i++) { const ctrl = findCtrl(this.groupsRowCtrls[i]); if (ctrl) { return ctrl; } } } getHtmlElementForColumnHeader(column) { return this.getHeaderCtrlForColumn(column)?.eGui ?? null; } getRowType(rowIndex) { return this.getAllCtrls()[rowIndex]?.type; } focusHeader(rowIndex, column, event) { const allCtrls = this.getAllCtrls(); const ctrl = allCtrls[rowIndex]; if (!ctrl) { return false; } return ctrl.focusHeader(column, event); } getGroupRowCount() { return this.groupsRowCtrls.length; } getGroupRowCtrlAtIndex(index) { return this.groupsRowCtrls[index]; } getRowCount() { return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0); } setHorizontalScroll(offset) { this.comp.setViewportScrollLeft(offset); } onScrollCallback(fn) { this.addManagedElementListeners(this.eViewport, { scroll: fn }); } destroy() { this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl); this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl); this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls); super.destroy(); } setupDragAndDrop(colMoves, dropContainer) { const bodyDropTarget = colMoves?.createBodyDropTarget(this.pinned, dropContainer); if (bodyDropTarget) { this.createManagedBean(bodyDropTarget); } } restoreFocusOnHeader(focusSvc, position) { if (!position) { return; } const { column } = position; if (column.getPinned() != this.pinned) { return; } focusSvc.focusHeaderPosition({ headerPosition: position, scroll: false }); } setupCenterWidth() { if (this.pinned != null) { return; } this.createManagedBean(new CenterWidthFeature((width) => this.comp.setCenterWidth(`${width}px`), true)); } }; var PinnedLeftElement = { tag: "div", cls: "ag-pinned-left-header", role: "rowgroup" }; var PinnedRightElement = { tag: "div", cls: "ag-pinned-right-header", role: "rowgroup" }; var CenterElement = { tag: "div", cls: "ag-header-viewport", role: "rowgroup", attrs: { tabindex: "-1" }, children: [{ tag: "div", ref: "eCenterContainer", cls: "ag-header-container", role: "presentation" }] }; var HeaderRowContainerComp = class extends Component { constructor(pinned) { super(); this.eCenterContainer = RefPlaceholder; this.headerRowComps = {}; this.rowCompsList = []; this.pinned = pinned; } postConstruct() { this.selectAndSetTemplate(); const compProxy = { setDisplayed: (displayed) => this.setDisplayed(displayed), setCtrls: (ctrls) => this.setCtrls(ctrls), // only gets called for center section setCenterWidth: (width) => this.eCenterContainer.style.width = width, setViewportScrollLeft: (left) => this.getGui().scrollLeft = left, // only gets called for pinned sections setPinnedContainerWidth: (width) => { const eGui = this.getGui(); eGui.style.width = width; eGui.style.maxWidth = width; eGui.style.minWidth = width; } }; const ctrl = this.createManagedBean(new HeaderRowContainerCtrl(this.pinned)); ctrl.setComp(compProxy, this.getGui()); } selectAndSetTemplate() { const pinnedLeft = this.pinned == "left"; const pinnedRight = this.pinned == "right"; const template = pinnedLeft ? PinnedLeftElement : pinnedRight ? PinnedRightElement : CenterElement; this.setTemplate(template); this.eRowContainer = this.eCenterContainer !== RefPlaceholder ? this.eCenterContainer : this.getGui(); } destroy() { this.setCtrls([]); super.destroy(); } destroyRowComp(rowComp) { this.destroyBean(rowComp); rowComp.getGui().remove(); } setCtrls(ctrls) { const oldRowComps = this.headerRowComps; this.headerRowComps = {}; this.rowCompsList = []; let prevGui; const appendEnsuringDomOrder = (rowComp) => { const eGui = rowComp.getGui(); const notAlreadyIn = eGui.parentElement != this.eRowContainer; if (notAlreadyIn) { this.eRowContainer.appendChild(eGui); } if (prevGui) { _ensureDomOrder(this.eRowContainer, eGui, prevGui); } prevGui = eGui; }; for (const ctrl of ctrls) { const ctrlId = ctrl.instanceId; const existingComp = oldRowComps[ctrlId]; delete oldRowComps[ctrlId]; const rowComp = existingComp ? existingComp : this.createBean(new HeaderRowComp(ctrl)); this.headerRowComps[ctrlId] = rowComp; this.rowCompsList.push(rowComp); appendEnsuringDomOrder(rowComp); } for (const c of Object.values(oldRowComps)) { this.destroyRowComp(c); } } }; var GridHeaderElement = { tag: "div", cls: "ag-header", role: "presentation" }; var GridHeaderComp = class extends Component { constructor() { super(GridHeaderElement); } postConstruct() { const compProxy = { toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on), setHeightAndMinHeight: (height) => { this.getGui().style.height = height; this.getGui().style.minHeight = height; } }; const ctrl = this.createManagedBean(new GridHeaderCtrl()); ctrl.setComp(compProxy, this.getGui(), this.getFocusableElement()); const addContainer = (container) => { this.createManagedBean(container); this.appendChild(container); }; addContainer(new HeaderRowContainerComp("left")); addContainer(new HeaderRowContainerComp(null)); addContainer(new HeaderRowContainerComp("right")); } }; var GridHeaderSelector = { selector: "AG-HEADER-ROOT", component: GridHeaderComp }; var LayoutCssClasses = { AUTO_HEIGHT: "ag-layout-auto-height", NORMAL: "ag-layout-normal", PRINT: "ag-layout-print" }; var LayoutFeature = class extends BeanStub { constructor(view) { super(); this.view = view; } postConstruct() { this.addManagedPropertyListener("domLayout", this.updateLayoutClasses.bind(this)); this.updateLayoutClasses(); } updateLayoutClasses() { const domLayout = this.gos.get("domLayout"); const params = { autoHeight: domLayout === "autoHeight", normal: domLayout === "normal", print: domLayout === "print" }; const cssClass = params.autoHeight ? LayoutCssClasses.AUTO_HEIGHT : params.print ? LayoutCssClasses.PRINT : LayoutCssClasses.NORMAL; this.view.updateLayoutClasses(cssClass, params); } }; var AbstractFakeScrollComp = class extends Component { constructor(template, direction) { super(); this.direction = direction; this.eViewport = RefPlaceholder; this.eContainer = RefPlaceholder; this.hideTimeout = 0; this.setTemplate(template); } postConstruct() { this.addManagedEventListeners({ scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this) }); this.onScrollVisibilityChanged(); this.toggleCss("ag-apple-scrollbar", _isMacOsUserAgent() || _isIOSUserAgent()); } destroy() { super.destroy(); window.clearTimeout(this.hideTimeout); } initialiseInvisibleScrollbar() { if (this.invisibleScrollbar !== void 0) { return; } this.invisibleScrollbar = _isInvisibleScrollbar(); if (this.invisibleScrollbar) { this.hideAndShowInvisibleScrollAsNeeded(); this.addActiveListenerToggles(); } } addActiveListenerToggles() { const eGui = this.getGui(); const onActivate = () => this.toggleCss("ag-scrollbar-active", true); const onDeactivate = () => this.toggleCss("ag-scrollbar-active", false); this.addManagedListeners(eGui, { mouseenter: onActivate, mousedown: onActivate, touchstart: onActivate, mouseleave: onDeactivate, touchend: onDeactivate }); } onScrollVisibilityChanged() { if (this.invisibleScrollbar === void 0) { this.initialiseInvisibleScrollbar(); } _requestAnimationFrame(this.beans, () => this.setScrollVisible()); } hideAndShowInvisibleScrollAsNeeded() { this.addManagedEventListeners({ bodyScroll: (params) => { if (params.direction === this.direction) { if (this.hideTimeout) { window.clearTimeout(this.hideTimeout); this.hideTimeout = 0; } this.toggleCss("ag-scrollbar-scrolling", true); } }, bodyScrollEnd: () => { this.hideTimeout = window.setTimeout(() => { this.toggleCss("ag-scrollbar-scrolling", false); this.hideTimeout = 0; }, 400); } }); } attemptSettingScrollPosition(value) { const viewport = this.eViewport; _waitUntil( this, () => _isVisible(viewport), () => this.setScrollPosition(value), 100 ); } onScrollCallback(fn) { this.addManagedElementListeners(this.eViewport, { scroll: fn }); } }; var FakeHScrollElement = { tag: "div", cls: "ag-body-horizontal-scroll", attrs: { "aria-hidden": "true" }, children: [ { tag: "div", ref: "eLeftSpacer", cls: "ag-horizontal-left-spacer" }, { tag: "div", ref: "eViewport", cls: "ag-body-horizontal-scroll-viewport", children: [{ tag: "div", ref: "eContainer", cls: "ag-body-horizontal-scroll-container" }] }, { tag: "div", ref: "eRightSpacer", cls: "ag-horizontal-right-spacer" } ] }; var FakeHScrollComp = class extends AbstractFakeScrollComp { constructor() { super(FakeHScrollElement, "horizontal"); this.eLeftSpacer = RefPlaceholder; this.eRightSpacer = RefPlaceholder; this.setScrollVisibleDebounce = 0; } wireBeans(beans) { this.visibleCols = beans.visibleCols; this.scrollVisibleSvc = beans.scrollVisibleSvc; } postConstruct() { super.postConstruct(); const spacerWidthsListener = this.setFakeHScrollSpacerWidths.bind(this); this.addManagedEventListeners({ displayedColumnsChanged: spacerWidthsListener, displayedColumnsWidthChanged: spacerWidthsListener, pinnedRowDataChanged: this.refreshCompBottom.bind(this) }); this.addManagedPropertyListener("domLayout", spacerWidthsListener); this.beans.ctrlsSvc.register("fakeHScrollComp", this); this.createManagedBean(new CenterWidthFeature((width) => this.eContainer.style.width = `${width}px`)); this.addManagedPropertyListeners(["suppressHorizontalScroll"], this.onScrollVisibilityChanged.bind(this)); } destroy() { window.clearTimeout(this.setScrollVisibleDebounce); super.destroy(); } initialiseInvisibleScrollbar() { if (this.invisibleScrollbar !== void 0) { return; } this.enableRtl = this.gos.get("enableRtl"); super.initialiseInvisibleScrollbar(); if (this.invisibleScrollbar) { this.refreshCompBottom(); } } refreshCompBottom() { if (!this.invisibleScrollbar) { return; } const bottomPinnedHeight = this.beans.pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0; this.getGui().style.bottom = `${bottomPinnedHeight}px`; } onScrollVisibilityChanged() { super.onScrollVisibilityChanged(); this.setFakeHScrollSpacerWidths(); } setFakeHScrollSpacerWidths() { const vScrollShowing = this.scrollVisibleSvc.verticalScrollShowing; let rightSpacing = this.visibleCols.getDisplayedColumnsRightWidth(); const scrollOnRight = !this.enableRtl && vScrollShowing; const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth(); if (scrollOnRight) { rightSpacing += scrollbarWidth; } _setFixedWidth(this.eRightSpacer, rightSpacing); this.eRightSpacer.classList.toggle("ag-scroller-corner", rightSpacing <= scrollbarWidth); let leftSpacing = this.visibleCols.getColsLeftWidth(); const scrollOnLeft = this.enableRtl && vScrollShowing; if (scrollOnLeft) { leftSpacing += scrollbarWidth; } _setFixedWidth(this.eLeftSpacer, leftSpacing); this.eLeftSpacer.classList.toggle("ag-scroller-corner", leftSpacing <= scrollbarWidth); } setScrollVisible() { const hScrollShowing = this.scrollVisibleSvc.horizontalScrollShowing; const invisibleScrollbar2 = this.invisibleScrollbar; const isSuppressHorizontalScroll = this.gos.get("suppressHorizontalScroll"); const scrollbarWidth = hScrollShowing ? this.scrollVisibleSvc.getScrollbarWidth() || 0 : 0; const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth; const scrollContainerSize = !isSuppressHorizontalScroll ? adjustedScrollbarWidth : 0; const apply = () => { this.setScrollVisibleDebounce = 0; this.toggleCss("ag-scrollbar-invisible", invisibleScrollbar2); _setFixedHeight(this.getGui(), scrollContainerSize); _setFixedHeight(this.eViewport, scrollContainerSize); _setFixedHeight(this.eContainer, scrollContainerSize); if (!scrollContainerSize) { this.eContainer.style.setProperty("min-height", "1px"); } this.setVisible(hScrollShowing, { skipAriaHidden: true }); }; window.clearTimeout(this.setScrollVisibleDebounce); if (!hScrollShowing) { apply(); } else { this.setScrollVisibleDebounce = window.setTimeout(apply, 100); } } getScrollPosition() { return _getScrollLeft(this.eViewport, this.enableRtl); } setScrollPosition(value) { if (!_isVisible(this.eViewport)) { this.attemptSettingScrollPosition(value); } _setScrollLeft(this.eViewport, value, this.enableRtl); } }; var FakeHScrollSelector = { selector: "AG-FAKE-HORIZONTAL-SCROLL", component: FakeHScrollComp }; var SetHeightFeature = class extends BeanStub { constructor(eContainer, eViewport) { super(); this.eContainer = eContainer; this.eViewport = eViewport; } postConstruct() { this.addManagedEventListeners({ rowContainerHeightChanged: this.onHeightChanged.bind(this, this.beans.rowContainerHeight) }); } onHeightChanged(maxDivHeightScaler) { const height = maxDivHeightScaler.uiContainerHeight; const heightString = height != null ? `${height}px` : ``; this.eContainer.style.height = heightString; if (this.eViewport) { this.eViewport.style.height = heightString; } } }; var FakeVScrollElement = { tag: "div", cls: "ag-body-vertical-scroll", attrs: { "aria-hidden": "true" }, children: [ { tag: "div", ref: "eViewport", cls: "ag-body-vertical-scroll-viewport", children: [{ tag: "div", ref: "eContainer", cls: "ag-body-vertical-scroll-container" }] } ] }; var FakeVScrollComp = class extends AbstractFakeScrollComp { constructor() { super(FakeVScrollElement, "vertical"); } postConstruct() { super.postConstruct(); this.createManagedBean(new SetHeightFeature(this.eContainer)); const { ctrlsSvc } = this.beans; ctrlsSvc.register("fakeVScrollComp", this); this.addManagedEventListeners({ rowContainerHeightChanged: this.onRowContainerHeightChanged.bind(this, ctrlsSvc) }); } setScrollVisible() { const { scrollVisibleSvc } = this.beans; const vScrollShowing = scrollVisibleSvc.verticalScrollShowing; const invisibleScrollbar2 = this.invisibleScrollbar; const scrollbarWidth = vScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0; const adjustedScrollbarWidth = scrollbarWidth === 0 && invisibleScrollbar2 ? 16 : scrollbarWidth; this.toggleCss("ag-scrollbar-invisible", invisibleScrollbar2); _setFixedWidth(this.getGui(), adjustedScrollbarWidth); _setFixedWidth(this.eViewport, adjustedScrollbarWidth); _setFixedWidth(this.eContainer, adjustedScrollbarWidth); this.setDisplayed(vScrollShowing, { skipAriaHidden: true }); } onRowContainerHeightChanged(ctrlsSvc) { const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl(); const gridBodyViewportEl = gridBodyCtrl.eBodyViewport; const eViewportScrollTop = this.getScrollPosition(); const gridBodyViewportScrollTop = gridBodyViewportEl.scrollTop; if (eViewportScrollTop != gridBodyViewportScrollTop) { this.setScrollPosition(gridBodyViewportScrollTop, true); } } getScrollPosition() { return this.eViewport.scrollTop; } setScrollPosition(value, force) { if (!force && !_isVisible(this.eViewport)) { this.attemptSettingScrollPosition(value); } this.eViewport.scrollTop = value; } }; var FakeVScrollSelector = { selector: "AG-FAKE-VERTICAL-SCROLL", component: FakeVScrollComp }; var Direction = /* @__PURE__ */ ((Direction2) => { Direction2[Direction2["Vertical"] = 0] = "Vertical"; Direction2[Direction2["Horizontal"] = 1] = "Horizontal"; return Direction2; })(Direction || {}); var VIEWPORT = "Viewport"; var FAKE_V_SCROLLBAR = "fakeVScrollComp"; var HORIZONTAL_SOURCES = [ "fakeHScrollComp", "centerHeader", "topCenter", "bottomCenter", "stickyTopCenter", "stickyBottomCenter" ]; var SCROLL_DEBOUNCE_TIMEOUT = 100; var SCROLL_END_TIMEOUT = 150; var GridBodyScrollFeature = class extends BeanStub { constructor(eBodyViewport) { super(); this.clearRetryListenerFncs = []; this.lastScrollSource = [null, null]; this.scrollLeft = -1; this.nextScrollTop = -1; this.scrollTop = -1; this.lastOffsetHeight = -1; this.lastScrollTop = -1; this.lastIsHorizontalScrollShowing = false; this.scrollTimer = 0; this.isScrollActive = false; this.isVerticalPositionInvalidated = true; this.isHorizontalPositionInvalidated = true; this.eBodyViewport = eBodyViewport; this.resetLastHScrollDebounced = _debounce( this, () => this.lastScrollSource[ 1 /* Horizontal */ ] = null, SCROLL_END_TIMEOUT ); this.resetLastVScrollDebounced = _debounce( this, () => this.lastScrollSource[ 0 /* Vertical */ ] = null, SCROLL_END_TIMEOUT ); } wireBeans(beans) { this.ctrlsSvc = beans.ctrlsSvc; this.animationFrameSvc = beans.animationFrameSvc; this.visibleCols = beans.visibleCols; } destroy() { super.destroy(); this.clearRetryListenerFncs = []; window.clearTimeout(this.scrollTimer); } postConstruct() { this.enableRtl = this.gos.get("enableRtl"); const invalidateVerticalScroll = this.invalidateVerticalScroll.bind(this); const invalidateHorizontalScroll = this.invalidateHorizontalScroll.bind(this); this.addManagedEventListeners({ displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this), bodyHeightChanged: invalidateVerticalScroll, // We only invalidate horizontal scrolling when the viewport switches // between scrollable and non-scrollable, avoiding unnecessary // invalidation on every gridSizeChanged event. If more properties // require invalidation, read/write DOM cycles may be needed. scrollGapChanged: invalidateHorizontalScroll }); this.addManagedElementListeners(this.eBodyViewport, { scroll: invalidateVerticalScroll }); this.ctrlsSvc.whenReady(this, (p) => { this.centerRowsCtrl = p.center; this.fakeVScrollComp = p.fakeVScrollComp; this.fakeHScrollComp = p.fakeHScrollComp; this.onDisplayedColumnsWidthChanged(); this.addScrollListener(); }); } invalidateHorizontalScroll() { this.isHorizontalPositionInvalidated = true; } invalidateVerticalScroll() { this.isVerticalPositionInvalidated = true; } addScrollListener() { this.addHorizontalScrollListeners(); this.addVerticalScrollListeners(); } addHorizontalScrollListeners() { this.addManagedElementListeners(this.centerRowsCtrl.eViewport, { scroll: this.onHScroll.bind(this, VIEWPORT) }); for (const source of HORIZONTAL_SOURCES) { const scrollPartner = this.ctrlsSvc.get(source); this.registerScrollPartner(scrollPartner, this.onHScroll.bind(this, source)); } } addVerticalScrollListeners() { const isDebounce = this.gos.get("debounceVerticalScrollbar"); const onVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, VIEWPORT), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, VIEWPORT); const onFakeVScroll = isDebounce ? _debounce(this, this.onVScroll.bind(this, FAKE_V_SCROLLBAR), SCROLL_DEBOUNCE_TIMEOUT) : this.onVScroll.bind(this, FAKE_V_SCROLLBAR); this.addManagedElementListeners(this.eBodyViewport, { scroll: onVScroll }); this.registerScrollPartner(this.fakeVScrollComp, onFakeVScroll); } registerScrollPartner(comp, callback) { comp.onScrollCallback(callback); } onDisplayedColumnsWidthChanged() { if (this.enableRtl) { this.horizontallyScrollHeaderCenterAndFloatingCenter(); } } horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft) { const notYetInitialised = this.centerRowsCtrl == null; if (notYetInitialised) { return; } if (scrollLeft === void 0) { scrollLeft = this.centerRowsCtrl.getCenterViewportScrollLeft(); } this.setScrollLeftForAllContainersExceptCurrent(Math.abs(scrollLeft)); } setScrollLeftForAllContainersExceptCurrent(scrollLeft) { for (const container of [...HORIZONTAL_SOURCES, VIEWPORT]) { if (this.lastScrollSource[ 1 /* Horizontal */ ] === container) { continue; } const viewport = this.getViewportForSource(container); _setScrollLeft(viewport, scrollLeft, this.enableRtl); } } getViewportForSource(source) { if (source === VIEWPORT) { return this.centerRowsCtrl.eViewport; } return this.ctrlsSvc.get(source).eViewport; } isControllingScroll(source, direction) { if (this.lastScrollSource[direction] == null) { if (direction === 0) { this.lastScrollSource[0] = source; } else { this.lastScrollSource[1] = source; } return true; } return this.lastScrollSource[direction] === source; } onHScroll(source) { if (!this.isControllingScroll( source, 1 /* Horizontal */ )) { return; } const centerContainerViewport = this.centerRowsCtrl.eViewport; const { scrollLeft } = centerContainerViewport; if (this.shouldBlockScrollUpdate(1, scrollLeft, true)) { return; } const newScrollLeft = _getScrollLeft(this.getViewportForSource(source), this.enableRtl); this.doHorizontalScroll(newScrollLeft); this.resetLastHScrollDebounced(); } onVScroll(source) { if (!this.isControllingScroll( source, 0 /* Vertical */ )) { return; } const requestedScrollTop = source === VIEWPORT ? this.eBodyViewport.scrollTop : this.fakeVScrollComp.getScrollPosition(); let scrollTop = requestedScrollTop; if (this.shouldBlockScrollUpdate(0, scrollTop, true)) { return; } if (source === VIEWPORT) { this.fakeVScrollComp.setScrollPosition(scrollTop); } else { this.eBodyViewport.scrollTop = requestedScrollTop; scrollTop = this.eBodyViewport.scrollTop; this.invalidateVerticalScroll(); if (scrollTop !== requestedScrollTop) { this.fakeVScrollComp.setScrollPosition(scrollTop, true); } } const { animationFrameSvc } = this; animationFrameSvc?.setScrollTop(scrollTop); this.nextScrollTop = scrollTop; if (animationFrameSvc?.active) { animationFrameSvc.schedule(); } else { this.scrollGridIfNeeded(true); } this.resetLastVScrollDebounced(); } doHorizontalScroll(scrollLeft) { const fakeScrollLeft = this.fakeHScrollComp.getScrollPosition(); if (this.scrollLeft === scrollLeft && scrollLeft === fakeScrollLeft) { return; } this.scrollLeft = scrollLeft; this.fireScrollEvent( 1 /* Horizontal */ ); this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft); this.centerRowsCtrl.onHorizontalViewportChanged(true); } isScrolling() { return this.isScrollActive; } fireScrollEvent(direction) { const bodyScrollEvent = { type: "bodyScroll", direction: direction === 1 ? "horizontal" : "vertical", left: this.scrollLeft, top: this.scrollTop }; this.isScrollActive = true; this.eventSvc.dispatchEvent(bodyScrollEvent); window.clearTimeout(this.scrollTimer); this.scrollTimer = window.setTimeout(() => { this.scrollTimer = 0; this.isScrollActive = false; this.eventSvc.dispatchEvent({ ...bodyScrollEvent, type: "bodyScrollEnd" }); }, SCROLL_END_TIMEOUT); } shouldBlockScrollUpdate(direction, scrollTo, touchOnly = false) { if (touchOnly && !_isIOSUserAgent()) { return false; } if (direction === 0) { return this.shouldBlockVerticalScroll(scrollTo); } return this.shouldBlockHorizontalScroll(scrollTo); } shouldBlockVerticalScroll(scrollTo) { const clientHeight = _getInnerHeight(this.eBodyViewport); const { scrollHeight } = this.eBodyViewport; return !!(scrollTo < 0 || scrollTo + clientHeight > scrollHeight); } shouldBlockHorizontalScroll(scrollTo) { const clientWidth = this.centerRowsCtrl.getCenterWidth(); const { scrollWidth } = this.centerRowsCtrl.eViewport; if (this.enableRtl) { if (scrollTo > 0) { return true; } } else if (scrollTo < 0) { return true; } return Math.abs(scrollTo) + clientWidth > scrollWidth; } redrawRowsAfterScroll() { this.fireScrollEvent( 0 /* Vertical */ ); } // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again. // (which happens with some implementations of tabbing). this can result in horizontal scroll getting // reset back to the left, however no scroll event is fired. so we need to get header to also scroll // back to the left to be kept in sync. // adding and removing the grid from the DOM both resets the scroll position and // triggers a resize event, so notify listeners if the scroll position has changed checkScrollLeft() { const scrollLeft = this.scrollLeft; let hasHorizontalScrollersOutOfSync = false; for (const source of HORIZONTAL_SOURCES) { const viewport = this.getViewportForSource(source); if (viewport.scrollLeft !== scrollLeft) { hasHorizontalScrollersOutOfSync = true; break; } } if (hasHorizontalScrollersOutOfSync) { this.onHScroll(VIEWPORT); } } scrollGridIfNeeded(suppressedAnimationFrame = false) { const frameNeeded = this.scrollTop != this.nextScrollTop; if (frameNeeded) { this.scrollTop = this.nextScrollTop; if (suppressedAnimationFrame) { this.invalidateVerticalScroll(); } this.redrawRowsAfterScroll(); } return frameNeeded; } // called by scrollHorizontally method and alignedGridsService setHorizontalScrollPosition(hScrollPosition, fromAlignedGridsService = false) { const minScrollLeft = 0; const maxScrollLeft = this.centerRowsCtrl.eViewport.scrollWidth - this.centerRowsCtrl.getCenterWidth(); if (!fromAlignedGridsService && this.shouldBlockScrollUpdate(1, hScrollPosition)) { if (this.enableRtl) { hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft; } else { hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft); } } _setScrollLeft(this.centerRowsCtrl.eViewport, Math.abs(hScrollPosition), this.enableRtl); this.doHorizontalScroll(hScrollPosition); } setVerticalScrollPosition(vScrollPosition) { this.invalidateVerticalScroll(); this.eBodyViewport.scrollTop = vScrollPosition; } getVScrollPosition() { if (!this.isVerticalPositionInvalidated) { const { lastOffsetHeight, lastScrollTop } = this; return { top: lastScrollTop, bottom: lastScrollTop + lastOffsetHeight }; } this.isVerticalPositionInvalidated = false; const { scrollTop, offsetHeight } = this.eBodyViewport; this.lastScrollTop = scrollTop; this.lastOffsetHeight = offsetHeight; return { top: scrollTop, bottom: scrollTop + offsetHeight }; } /** Get an approximate scroll position that returns the last real value read. * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles. * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable. */ getApproximateVScollPosition() { if (this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0) { return { top: this.scrollTop, bottom: this.scrollTop + this.lastOffsetHeight }; } return this.getVScrollPosition(); } getHScrollPosition() { return this.centerRowsCtrl.getHScrollPosition(); } isHorizontalScrollShowing() { if (this.isHorizontalPositionInvalidated) { this.lastIsHorizontalScrollShowing = this.centerRowsCtrl.isHorizontalScrollShowing(); this.isHorizontalPositionInvalidated = false; } return this.lastIsHorizontalScrollShowing; } // called by the headerRootComp and moveColumnController scrollHorizontally(pixels) { const oldScrollPosition = this.centerRowsCtrl.eViewport.scrollLeft; this.setHorizontalScrollPosition(oldScrollPosition + pixels); return this.centerRowsCtrl.eViewport.scrollLeft - oldScrollPosition; } // gets called by rowRenderer when new data loaded, as it will want to scroll to the top scrollToTop() { this.setVerticalScrollPosition(0); } // Valid values for position are bottom, middle and top ensureNodeVisible(comparator, position = null) { const { rowModel } = this.beans; const rowCount = rowModel.getRowCount(); let indexToSelect = -1; for (let i = 0; i < rowCount; i++) { const node = rowModel.getRow(i); if (typeof comparator === "function") { const predicate = comparator; if (node && predicate(node)) { indexToSelect = i; break; } } else if (comparator === node || comparator === node.data) { indexToSelect = i; break; } } if (indexToSelect >= 0) { this.ensureIndexVisible(indexToSelect, position); } } // Valid values for position are bottom, middle and top // position should be {'top','middle','bottom', or undefined/null}. // if undefined/null, then the grid will to the minimal amount of scrolling, // eg if grid needs to scroll up, it scrolls until row is on top, // if grid needs to scroll down, it scrolls until row is on bottom, // if row is already in view, grid does not scroll ensureIndexVisible(index, position, retry = 0) { if (_isDomLayout(this.gos, "print")) { return; } const { rowModel } = this.beans; const rowCount = rowModel.getRowCount(); if (typeof index !== "number" || index < 0 || index >= rowCount) { _warn(88, { index }); return; } this.clearRetryListeners(); const { frameworkOverrides, pageBounds, rowContainerHeight: heightScaler, rowRenderer } = this.beans; frameworkOverrides.wrapIncoming(() => { const gridBodyCtrl = this.ctrlsSvc.getGridBodyCtrl(); const rowNode = rowModel.getRow(index); let rowGotShiftedDuringOperation; let stickyHeightsChanged; let attempt = 0; this.invalidateVerticalScroll(); do { const { stickyTopHeight, stickyBottomHeight } = gridBodyCtrl; const startingRowTop = rowNode.rowTop; const startingRowHeight = rowNode.rowHeight; const paginationOffset = pageBounds.getPixelOffset(); const rowTopPixel = rowNode.rowTop - paginationOffset; const rowBottomPixel = rowTopPixel + rowNode.rowHeight; const scrollPosition = this.getVScrollPosition(); const heightOffset = heightScaler.divStretchOffset; const vScrollTop = scrollPosition.top + heightOffset; const vScrollBottom = scrollPosition.bottom + heightOffset; const viewportHeight = vScrollBottom - vScrollTop; const pxTop = heightScaler.getScrollPositionForPixel(rowTopPixel); const pxBottom = heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight); const pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel); const rowAboveViewport = vScrollTop + stickyTopHeight > rowTopPixel; const rowBelowViewport = vScrollBottom - stickyBottomHeight < rowBottomPixel; let newScrollPosition = null; if (position === "top") { newScrollPosition = pxTop - stickyTopHeight; } else if (position === "bottom") { newScrollPosition = pxBottom + stickyBottomHeight; } else if (position === "middle") { newScrollPosition = pxMiddle; } else if (rowAboveViewport) { newScrollPosition = pxTop - stickyTopHeight; } else if (rowBelowViewport) { if (pxBottom - pxTop > viewportHeight) { newScrollPosition = pxTop - stickyTopHeight; } else { newScrollPosition = pxBottom + stickyBottomHeight; } } if (newScrollPosition !== null) { this.setVerticalScrollPosition(newScrollPosition); rowRenderer.redraw({ afterScroll: true }); } rowGotShiftedDuringOperation = startingRowTop !== rowNode.rowTop || startingRowHeight !== rowNode.rowHeight; stickyHeightsChanged = stickyTopHeight !== gridBodyCtrl.stickyTopHeight || stickyBottomHeight !== gridBodyCtrl.stickyBottomHeight; attempt++; } while ((rowGotShiftedDuringOperation || stickyHeightsChanged) && attempt < 10); this.animationFrameSvc?.flushAllFrames(); if (retry < 10 && (rowNode?.stub || !this.beans.rowAutoHeight?.areRowsMeasured())) { const scrollTop = this.getVScrollPosition().top; this.clearRetryListenerFncs = this.addManagedEventListeners({ bodyScroll: () => { const newScrollTop = this.getVScrollPosition().top; if (scrollTop === newScrollTop) { return; } this.clearRetryListeners(); }, modelUpdated: () => { this.clearRetryListeners(); if (index >= rowModel.getRowCount()) { return; } this.ensureIndexVisible(index, position, retry + 1); } }); } }); } clearRetryListeners() { for (const callback of this.clearRetryListenerFncs) { callback(); } this.clearRetryListenerFncs = []; } ensureColumnVisible(key, position = "auto") { const { colModel, frameworkOverrides } = this.beans; const column = colModel.getCol(key); if (!column) { return; } if (column.isPinned()) { return; } if (!this.visibleCols.isColDisplayed(column)) { return; } const newHorizontalScroll = this.getPositionedHorizontalScroll(column, position); frameworkOverrides.wrapIncoming(() => { if (newHorizontalScroll !== null) { this.centerRowsCtrl.setCenterViewportScrollLeft(newHorizontalScroll); } this.centerRowsCtrl.onHorizontalViewportChanged(); this.animationFrameSvc?.flushAllFrames(); }); } getPositionedHorizontalScroll(column, position) { const { columnBeforeStart, columnAfterEnd } = this.isColumnOutsideViewport(column); const viewportTooSmallForColumn = this.centerRowsCtrl.getCenterWidth() < column.getActualWidth(); const viewportWidth = this.centerRowsCtrl.getCenterWidth(); const isRtl = this.enableRtl; let alignColToStart = (isRtl ? columnBeforeStart : columnAfterEnd) || viewportTooSmallForColumn; let alignColToEnd = isRtl ? columnAfterEnd : columnBeforeStart; if (position !== "auto") { alignColToStart = position === "start"; alignColToEnd = position === "end"; } const isMiddle = position === "middle"; if (alignColToStart || alignColToEnd || isMiddle) { const { colLeft, colMiddle, colRight } = this.getColumnBounds(column); if (isMiddle) { return colMiddle - viewportWidth / 2; } if (alignColToStart) { return isRtl ? colRight : colLeft; } return isRtl ? colLeft - viewportWidth : colRight - viewportWidth; } return null; } isColumnOutsideViewport(column) { const { start: viewportStart, end: viewportEnd } = this.getViewportBounds(); const { colLeft, colRight } = this.getColumnBounds(column); const isRtl = this.enableRtl; const columnBeforeStart = isRtl ? viewportStart > colRight : viewportEnd < colRight; const columnAfterEnd = isRtl ? viewportEnd < colLeft : viewportStart > colLeft; return { columnBeforeStart, columnAfterEnd }; } getColumnBounds(column) { const isRtl = this.enableRtl; const bodyWidth = this.visibleCols.bodyWidth; const colWidth = column.getActualWidth(); const colLeft = column.getLeft(); const multiplier = isRtl ? -1 : 1; const colLeftPixel = isRtl ? bodyWidth - colLeft : colLeft; const colRightPixel = colLeftPixel + colWidth * multiplier; const colMidPixel = colLeftPixel + colWidth / 2 * multiplier; return { colLeft: colLeftPixel, colMiddle: colMidPixel, colRight: colRightPixel }; } getViewportBounds() { const viewportWidth = this.centerRowsCtrl.getCenterWidth(); const scrollPosition = this.centerRowsCtrl.getCenterViewportScrollLeft(); const viewportStartPixel = scrollPosition; const viewportEndPixel = viewportWidth + scrollPosition; return { start: viewportStartPixel, end: viewportEndPixel, width: viewportWidth }; } }; var AXES = { horizontal: { overflow: (el) => el.scrollWidth - el.clientWidth, scrollSize: (el) => el.scrollWidth, clientSize: (el) => el.clientWidth, opposite: "vertical" }, vertical: { overflow: (el) => el.scrollHeight - el.clientHeight, scrollSize: (el) => el.scrollHeight, clientSize: (el) => el.clientHeight, opposite: "horizontal" } }; function _shouldShowHorizontalScroll(horizontalElement, verticalScrollElement, scrollbarWidth = _getScrollbarWidth() || 0, primaryScrollbarElement, oppositeScrollbarElement) { return shouldShowScroll( horizontalElement, verticalScrollElement, "horizontal", scrollbarWidth, primaryScrollbarElement, oppositeScrollbarElement ); } function _shouldShowVerticalScroll(verticalElement, horizontalScrollElement, scrollbarWidth = _getScrollbarWidth() || 0, primaryScrollbarElement, oppositeScrollbarElement) { return shouldShowScroll( verticalElement, horizontalScrollElement, "vertical", scrollbarWidth, primaryScrollbarElement, oppositeScrollbarElement ); } function shouldShowScroll(primaryElement, oppositeElement, axis, scrollbarWidth, primaryScrollbarElement, oppositeScrollbarElement) { const primary = AXES[axis]; const opposite = AXES[primary.opposite]; const primaryScrollbarShowing = primaryScrollbarElement ? _isVisible(primaryScrollbarElement) : true; const oppositeScrollbarShowing = oppositeScrollbarElement ? _isVisible(oppositeScrollbarElement) : true; const primaryOverflow = primary.overflow(primaryElement); if (primaryOverflow <= 0) { return false; } if (!oppositeElement || scrollbarWidth === 0) { return true; } const oppositeOverflow = opposite.overflow(oppositeElement); if (oppositeOverflow <= 0) { return true; } if (primaryOverflow <= scrollbarWidth) { if (primaryScrollbarShowing && oppositeScrollbarShowing && isScrollbarCausedByOppositeAxis({ candidateOverflow: oppositeOverflow, candidateScrollSize: opposite.scrollSize(oppositeElement), candidateClientSize: opposite.clientSize(oppositeElement), scrollbarWidth })) { return false; } const sizeWithoutOppositeScrollbar = primary.clientSize(primaryElement) + scrollbarWidth; return primary.scrollSize(primaryElement) <= sizeWithoutOppositeScrollbar; } return true; } function isScrollbarCausedByOppositeAxis({ candidateOverflow, candidateScrollSize, candidateClientSize, scrollbarWidth }) { if (candidateOverflow <= 0 || candidateOverflow > scrollbarWidth) { return false; } const sizeWithoutOppositeScrollbar = candidateClientSize + scrollbarWidth; return candidateScrollSize > candidateClientSize && candidateScrollSize <= sizeWithoutOppositeScrollbar; } var ViewportSizeFeature = class extends BeanStub { constructor(centerContainerCtrl) { super(); this.centerContainerCtrl = centerContainerCtrl; } wireBeans(beans) { this.scrollVisibleSvc = beans.scrollVisibleSvc; } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCtrl = p.gridBodyCtrl; this.listenForResize(); }); this.addManagedEventListeners({ scrollbarWidthChanged: this.onScrollbarWidthChanged.bind(this) }); this.addManagedPropertyListeners(["alwaysShowHorizontalScroll", "alwaysShowVerticalScroll"], () => { this.checkViewportAndScrolls(); }); } listenForResize() { const { beans, centerContainerCtrl, gridBodyCtrl } = this; const listener = () => { _requestAnimationFrame(beans, () => { this.onCenterViewportResized(); }); }; centerContainerCtrl.registerViewportResizeListener(listener); gridBodyCtrl.registerBodyViewportResizeListener(listener); } onScrollbarWidthChanged() { this.checkViewportAndScrolls(); } onCenterViewportResized() { this.scrollVisibleSvc.updateScrollGap(); if (this.centerContainerCtrl.isViewportInTheDOMTree()) { const { pinnedCols, colFlex } = this.beans; pinnedCols?.keepPinnedColumnsNarrowerThanViewport(); this.checkViewportAndScrolls(); const newWidth = this.centerContainerCtrl.getCenterWidth(); if (newWidth !== this.centerWidth) { this.centerWidth = newWidth; colFlex?.refreshFlexedColumns({ viewportWidth: this.centerWidth, updateBodyWidths: true, fireResizedEvent: true }); } } else { this.bodyHeight = 0; } } // gets called every time the viewport size changes. we use this to check visibility of scrollbars // in the grid panel, and also to check size and position of viewport for row and column virtualisation. checkViewportAndScrolls() { this.updateScrollVisibleService(); this.checkBodyHeight(); this.onHorizontalViewportChanged(); this.gridBodyCtrl.scrollFeature.checkScrollLeft(); } getBodyHeight() { return this.bodyHeight; } checkBodyHeight() { const eBodyViewport = this.gridBodyCtrl.eBodyViewport; const bodyHeight = _getInnerHeight(eBodyViewport); if (this.bodyHeight !== bodyHeight) { this.bodyHeight = bodyHeight; this.eventSvc.dispatchEvent({ type: "bodyHeightChanged" }); } } updateScrollVisibleService() { this.updateScrollVisibleServiceImpl(); setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500); } updateScrollVisibleServiceImpl() { if (!this.isAlive()) { return; } const params = { horizontalScrollShowing: this.centerContainerCtrl.isHorizontalScrollShowing(), verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing() }; this.scrollVisibleSvc.setScrollsVisible(params); } // this gets called whenever a change in the viewport, so we can inform column controller it has to work // out the virtual columns again. gets called from following locations: // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged onHorizontalViewportChanged() { const { centerContainerCtrl, beans } = this; const scrollWidth = centerContainerCtrl.getCenterWidth(); const scrollPosition = centerContainerCtrl.getViewportScrollLeft(); beans.colViewport.setScrollPosition(scrollWidth, scrollPosition); } }; function _isEventFromPrintableCharacter(event) { if (event.altKey || event.ctrlKey || event.metaKey) { return false; } const printableCharacter = event.key?.length === 1; return printableCharacter; } function _suppressCellMouseEvent(gos, column, node, event) { const suppressMouseEventHandling = column.getColDef().cellRendererParams?.suppressMouseEventHandling; return suppressMouseEvent(gos, column, node, event, suppressMouseEventHandling); } function _suppressFullWidthMouseEvent(gos, cellRendererParams, node, event) { const suppressMouseEventHandling = cellRendererParams?.suppressMouseEventHandling; return suppressMouseEvent(gos, void 0, node, event, suppressMouseEventHandling); } function suppressMouseEvent(gos, column, node, event, suppressMouseEventHandling) { if (!suppressMouseEventHandling) { return false; } return suppressMouseEventHandling( _addGridCommonParams(gos, { column, node, event }) ); } function _getCtrlForEventTarget(gos, eventTarget, type) { let sourceElement = eventTarget; while (sourceElement) { const renderedComp = _getDomData(gos, sourceElement, type); if (renderedComp) { return renderedComp; } sourceElement = sourceElement.parentElement; } return null; } var DOM_DATA_KEY_CELL_CTRL = "cellCtrl"; function _getCellCtrlForEventTarget(gos, eventTarget) { return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_CELL_CTRL); } var DOM_DATA_KEY_ROW_CTRL = "renderedRow"; function _getRowCtrlForEventTarget(gos, eventTarget) { return _getCtrlForEventTarget(gos, eventTarget, DOM_DATA_KEY_ROW_CTRL); } function _isUserSuppressingKeyboardEvent(gos, keyboardEvent, rowNode, column, editing) { const colDefFunc = column ? column.getColDef().suppressKeyboardEvent : void 0; if (!colDefFunc) { return false; } const params = _addGridCommonParams(gos, { event: keyboardEvent, editing, column, node: rowNode, data: rowNode.data, colDef: column.getColDef() }); if (colDefFunc) { const colDefFuncResult = colDefFunc(params); if (colDefFuncResult) { return true; } } return false; } function _selectAllCells(beans) { const { pinnedRowModel, rowModel, rangeSvc, visibleCols } = beans; if (!rangeSvc || visibleCols.allCols.length === 0) { return; } const isEmptyPinnedTop = pinnedRowModel?.isEmpty("top") ?? true; const isEmptyPinnedBottom = pinnedRowModel?.isEmpty("bottom") ?? true; const floatingStart = isEmptyPinnedTop ? null : "top"; let floatingEnd; let rowEnd; if (isEmptyPinnedBottom) { floatingEnd = null; rowEnd = rowModel.getRowCount() - 1; } else { floatingEnd = "bottom"; rowEnd = pinnedRowModel?.getPinnedBottomRowCount() ?? 0 - 1; } rangeSvc.setCellRange({ rowStartIndex: 0, rowStartPinned: floatingStart, rowEndIndex: rowEnd, rowEndPinned: floatingEnd }); } var RowContainerEventsFeature = class extends BeanStub { constructor(element) { super(); this.element = element; } postConstruct() { this.addKeyboardListeners(); this.addMouseListeners(); this.beans.touchSvc?.mockRowContextMenu(this); this.editSvc = this.beans.editSvc; } addKeyboardListeners() { const eventName = "keydown"; const listener = this.processKeyboardEvent.bind(this, eventName); this.addManagedElementListeners(this.element, { [eventName]: listener }); } addMouseListeners() { let mouseDownEvent = "mousedown"; if (_isEventSupported("pointerdown")) { mouseDownEvent = "pointerdown"; } else if (_isEventSupported("touchstart")) { mouseDownEvent = "touchstart"; } const eventNames = ["dblclick", "contextmenu", "mouseover", "mouseout", "click", mouseDownEvent]; for (const eventName of eventNames) { const listener = this.processMouseEvent.bind(this, eventName); this.addManagedElementListeners(this.element, { [eventName]: listener }); } } processMouseEvent(eventName, mouseEvent) { if (!_isEventFromThisInstance(this.beans, mouseEvent) || _isStopPropagationForAgGrid(mouseEvent)) { return; } const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(mouseEvent.target); if (eventName === "contextmenu") { if (cellCtrl?.column) { cellCtrl.dispatchCellContextMenuEvent(mouseEvent); } this.beans.contextMenuSvc?.handleContextMenuMouseEvent(mouseEvent, void 0, rowCtrl, cellCtrl); } else { if (cellCtrl) { cellCtrl.onMouseEvent(eventName, mouseEvent); } if (rowCtrl) { rowCtrl.onMouseEvent(eventName, mouseEvent); } } } getControlsForEventTarget(target) { const { gos } = this; return { cellCtrl: _getCellCtrlForEventTarget(gos, target), rowCtrl: _getRowCtrlForEventTarget(gos, target) }; } processKeyboardEvent(eventName, keyboardEvent) { const { cellCtrl, rowCtrl } = this.getControlsForEventTarget(keyboardEvent.target); if (keyboardEvent.defaultPrevented) { return; } if (cellCtrl) { this.processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent); } else if (rowCtrl?.isFullWidth()) { this.processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent); } } processCellKeyboardEvent(cellCtrl, eventName, keyboardEvent) { const editing = this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false; const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent( this.gos, keyboardEvent, cellCtrl.rowNode, cellCtrl.column, editing ); if (gridProcessingAllowed) { if (eventName === "keydown") { const wasScrollKey = !editing && this.beans.navigation?.handlePageScrollingKey(keyboardEvent); if (!wasScrollKey) { cellCtrl.onKeyDown(keyboardEvent); } this.doGridOperations(keyboardEvent, editing); if (_isEventFromPrintableCharacter(keyboardEvent)) { cellCtrl.processCharacter(keyboardEvent); } } } if (eventName === "keydown") { this.eventSvc.dispatchEvent(cellCtrl.createEvent(keyboardEvent, "cellKeyDown")); } } processFullWidthRowKeyboardEvent(rowCtrl, eventName, keyboardEvent) { const { rowNode } = rowCtrl; const { focusSvc, navigation } = this.beans; const focusedCell = focusSvc.getFocusedCell(); const column = focusedCell?.column; const gridProcessingAllowed = !_isUserSuppressingKeyboardEvent(this.gos, keyboardEvent, rowNode, column, false); if (gridProcessingAllowed) { const key = keyboardEvent.key; if (eventName === "keydown") { switch (key) { case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: case KeyCode.PAGE_UP: case KeyCode.PAGE_DOWN: navigation?.handlePageScrollingKey(keyboardEvent, true); break; case KeyCode.LEFT: case KeyCode.RIGHT: if (!this.gos.get("embedFullWidthRows")) { break; } case KeyCode.UP: case KeyCode.DOWN: rowCtrl.onKeyboardNavigate(keyboardEvent); break; case KeyCode.TAB: rowCtrl.onTabKeyDown(keyboardEvent); break; default: } } } if (eventName === "keydown") { this.eventSvc.dispatchEvent(rowCtrl.createRowEvent("cellKeyDown", keyboardEvent)); } } doGridOperations(keyboardEvent, editing) { if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) { return; } if (editing) { return; } if (!_isEventFromThisInstance(this.beans, keyboardEvent)) { return; } const keyCode = _normaliseQwertyAzerty(keyboardEvent); const { clipboardSvc, undoRedo } = this.beans; if (keyCode === KeyCode.A) { return this.onCtrlAndA(keyboardEvent); } if (keyCode === KeyCode.C) { return this.onCtrlAndC(clipboardSvc, keyboardEvent); } if (keyCode === KeyCode.D) { return this.onCtrlAndD(clipboardSvc, keyboardEvent); } if (keyCode === KeyCode.V) { return this.onCtrlAndV(clipboardSvc, keyboardEvent); } if (keyCode === KeyCode.X) { return this.onCtrlAndX(clipboardSvc, keyboardEvent); } if (keyCode === KeyCode.Y) { return this.onCtrlAndY(undoRedo); } if (keyCode === KeyCode.Z) { return this.onCtrlAndZ(undoRedo, keyboardEvent); } } onCtrlAndA(event) { const { beans: { rowModel, rangeSvc, selectionSvc }, gos } = this; if (rangeSvc && _isCellSelectionEnabled(gos) && !_getCtrlASelectsRows(gos) && rowModel.isRowsToRender()) { _selectAllCells(this.beans); } else if (selectionSvc) { selectionSvc.selectAllRowNodes({ source: "keyboardSelectAll", selectAll: _getSelectAll(gos) }); } event.preventDefault(); } onCtrlAndC(clipboardSvc, event) { if (!clipboardSvc || this.gos.get("enableCellTextSelection")) { return; } const { cellCtrl } = this.getControlsForEventTarget(event.target); if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { return; } event.preventDefault(); clipboardSvc.copyToClipboard(); } onCtrlAndX(clipboardSvc, event) { if (!clipboardSvc || this.gos.get("enableCellTextSelection") || this.gos.get("suppressCutToClipboard")) { return; } const { cellCtrl } = this.getControlsForEventTarget(event.target); if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { return; } event.preventDefault(); clipboardSvc.cutToClipboard(void 0, "ui"); } onCtrlAndV(clipboardSvc, event) { const { cellCtrl } = this.getControlsForEventTarget(event.target); if (this.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { return; } if (clipboardSvc && !this.gos.get("suppressClipboardPaste")) { clipboardSvc.pasteFromClipboard(); } } onCtrlAndD(clipboardSvc, event) { if (clipboardSvc && !this.gos.get("suppressClipboardPaste")) { clipboardSvc.copyRangeDown(); } event.preventDefault(); } onCtrlAndZ(undoRedo, event) { if (!this.gos.get("undoRedoCellEditing") || !undoRedo) { return; } event.preventDefault(); if (event.shiftKey) { undoRedo.redo("ui"); } else { undoRedo.undo("ui"); } } onCtrlAndY(undoRedo) { undoRedo?.redo("ui"); } }; var getTopRowCtrls = (r) => r.topRowCtrls; var getStickyTopRowCtrls = (r) => r.getStickyTopRowCtrls(); var getStickyBottomRowCtrls = (r) => r.getStickyBottomRowCtrls(); var getBottomRowCtrls = (r) => r.bottomRowCtrls; var getCentreRowCtrls = (r) => r.allRowCtrls; var getSpannedTopRowCtrls = (r) => r.getCtrls("top"); var getSpannedCenterRowCtrls = (r) => r.getCtrls("center"); var getSpannedBottomRowCtrls = (r) => r.getCtrls("bottom"); var ContainerCssClasses = { center: { type: "center", name: "center-cols", getRowCtrls: getCentreRowCtrls, getSpannedRowCtrls: getSpannedCenterRowCtrls }, left: { type: "left", name: "pinned-left-cols", pinnedType: "left", getRowCtrls: getCentreRowCtrls, getSpannedRowCtrls: getSpannedCenterRowCtrls }, right: { type: "right", name: "pinned-right-cols", pinnedType: "right", getRowCtrls: getCentreRowCtrls, getSpannedRowCtrls: getSpannedCenterRowCtrls }, fullWidth: { type: "fullWidth", name: "full-width", fullWidth: true, getRowCtrls: getCentreRowCtrls }, topCenter: { type: "center", name: "floating-top", getRowCtrls: getTopRowCtrls, getSpannedRowCtrls: getSpannedTopRowCtrls }, topLeft: { type: "left", name: "pinned-left-floating", container: "ag-pinned-left-floating-top", pinnedType: "left", getRowCtrls: getTopRowCtrls, getSpannedRowCtrls: getSpannedTopRowCtrls }, topRight: { type: "right", name: "pinned-right-floating", container: "ag-pinned-right-floating-top", pinnedType: "right", getRowCtrls: getTopRowCtrls, getSpannedRowCtrls: getSpannedTopRowCtrls }, topFullWidth: { type: "fullWidth", name: "floating-top-full-width", fullWidth: true, getRowCtrls: getTopRowCtrls }, stickyTopCenter: { type: "center", name: "sticky-top", getRowCtrls: getStickyTopRowCtrls }, stickyTopLeft: { type: "left", name: "pinned-left-sticky-top", container: "ag-pinned-left-sticky-top", pinnedType: "left", getRowCtrls: getStickyTopRowCtrls }, stickyTopRight: { type: "right", name: "pinned-right-sticky-top", container: "ag-pinned-right-sticky-top", pinnedType: "right", getRowCtrls: getStickyTopRowCtrls }, stickyTopFullWidth: { type: "fullWidth", name: "sticky-top-full-width", fullWidth: true, getRowCtrls: getStickyTopRowCtrls }, stickyBottomCenter: { type: "center", name: "sticky-bottom", getRowCtrls: getStickyBottomRowCtrls }, stickyBottomLeft: { type: "left", name: "pinned-left-sticky-bottom", container: "ag-pinned-left-sticky-bottom", pinnedType: "left", getRowCtrls: getStickyBottomRowCtrls }, stickyBottomRight: { type: "right", name: "pinned-right-sticky-bottom", container: "ag-pinned-right-sticky-bottom", pinnedType: "right", getRowCtrls: getStickyBottomRowCtrls }, stickyBottomFullWidth: { type: "fullWidth", name: "sticky-bottom-full-width", fullWidth: true, getRowCtrls: getStickyBottomRowCtrls }, bottomCenter: { type: "center", name: "floating-bottom", getRowCtrls: getBottomRowCtrls, getSpannedRowCtrls: getSpannedBottomRowCtrls }, bottomLeft: { type: "left", name: "pinned-left-floating-bottom", container: "ag-pinned-left-floating-bottom", pinnedType: "left", getRowCtrls: getBottomRowCtrls, getSpannedRowCtrls: getSpannedBottomRowCtrls }, bottomRight: { type: "right", name: "pinned-right-floating-bottom", container: "ag-pinned-right-floating-bottom", pinnedType: "right", getRowCtrls: getBottomRowCtrls, getSpannedRowCtrls: getSpannedBottomRowCtrls }, bottomFullWidth: { type: "fullWidth", name: "floating-bottom-full-width", fullWidth: true, getRowCtrls: getBottomRowCtrls } }; function _getRowViewportClass(name) { const options = _getRowContainerOptions(name); return `ag-${options.name}-viewport`; } function _getRowContainerClass(name) { const options = _getRowContainerOptions(name); return options.container ?? `ag-${options.name}-container`; } function _getRowSpanContainerClass(name) { const options = _getRowContainerOptions(name); return `ag-${options.name}-spanned-cells-container`; } function _getRowContainerOptions(name) { return ContainerCssClasses[name]; } var allTopNoFW = ["topCenter", "topLeft", "topRight"]; var allBottomNoFW = ["bottomCenter", "bottomLeft", "bottomRight"]; var allMiddleNoFW = ["center", "left", "right"]; var allMiddle = ["center", "left", "right", "fullWidth"]; var allCenter = ["stickyTopCenter", "stickyBottomCenter", "center", "topCenter", "bottomCenter"]; var allLeft = ["left", "bottomLeft", "topLeft", "stickyTopLeft", "stickyBottomLeft"]; var allRight = ["right", "bottomRight", "topRight", "stickyTopRight", "stickyBottomRight"]; var allStickyTopNoFW = ["stickyTopCenter", "stickyTopLeft", "stickyTopRight"]; var allStickyBottomNoFW = ["stickyBottomCenter", "stickyBottomLeft", "stickyBottomRight"]; var allStickyContainers = [ ...allStickyTopNoFW, "stickyTopFullWidth", ...allStickyBottomNoFW, "stickyBottomFullWidth" ]; var allNoFW = [ ...allTopNoFW, ...allBottomNoFW, ...allMiddleNoFW, ...allStickyTopNoFW, ...allStickyBottomNoFW ]; var RowContainerCtrl = class extends BeanStub { constructor(name) { super(); this.name = name; this.visible = true; this.EMPTY_CTRLS = []; this.options = _getRowContainerOptions(name); } postConstruct() { this.enableRtl = this.gos.get("enableRtl"); this.forContainers(["center"], () => { this.viewportSizeFeature = this.createManagedBean(new ViewportSizeFeature(this)); this.addManagedEventListeners({ stickyTopOffsetChanged: this.onStickyTopOffsetChanged.bind(this) }); }); } onStickyTopOffsetChanged(event) { this.comp.setOffsetTop(`${event.offset}px`); } registerWithCtrlsService() { if (this.options.fullWidth) { return; } this.beans.ctrlsSvc.register(this.name, this); } forContainers(names, callback) { if (names.indexOf(this.name) >= 0) { callback(); } } setComp(view, eContainer, eSpannedContainer, eViewport) { this.comp = view; this.eContainer = eContainer; this.eSpannedContainer = eSpannedContainer; this.eViewport = eViewport; this.createManagedBean(new RowContainerEventsFeature(this.eViewport ?? this.eContainer)); this.addPreventScrollWhileDragging(); this.listenOnDomOrder(); const { pinnedCols, rangeSvc } = this.beans; const pinnedWidthChanged = () => this.onPinnedWidthChanged(); this.forContainers(allLeft, () => { this.pinnedWidthFeature = this.createOptionalManagedBean( pinnedCols?.createPinnedWidthFeature(true, this.eContainer, this.eSpannedContainer) ); this.addManagedEventListeners({ leftPinnedWidthChanged: pinnedWidthChanged }); }); this.forContainers(allRight, () => { this.pinnedWidthFeature = this.createOptionalManagedBean( pinnedCols?.createPinnedWidthFeature(false, this.eContainer, this.eSpannedContainer) ); this.addManagedEventListeners({ rightPinnedWidthChanged: pinnedWidthChanged }); }); this.forContainers( allMiddle, () => this.createManagedBean( new SetHeightFeature(this.eContainer, this.name === "center" ? eViewport : void 0) ) ); if (rangeSvc) { this.forContainers( allNoFW, () => this.createManagedBean(rangeSvc.createDragListenerFeature(this.eContainer)) ); } this.forContainers( allCenter, () => this.createManagedBean(new CenterWidthFeature((width) => this.comp.setContainerWidth(`${width}px`))) ); this.visible = this.isContainerVisible(); this.addListeners(); this.registerWithCtrlsService(); } onScrollCallback(fn) { this.addManagedElementListeners(this.eViewport, { scroll: fn }); } addListeners() { const { spannedRowRenderer, gos } = this.beans; const onDisplayedColumnsChanged = this.onDisplayedColumnsChanged.bind(this); this.addManagedEventListeners({ displayedColumnsChanged: onDisplayedColumnsChanged, displayedColumnsWidthChanged: onDisplayedColumnsChanged, displayedRowsChanged: (params) => this.onDisplayedRowsChanged(params.afterScroll) }); onDisplayedColumnsChanged(); this.onDisplayedRowsChanged(); if (spannedRowRenderer && this.options.getSpannedRowCtrls && gos.get("enableCellSpan")) { this.addManagedListeners(spannedRowRenderer, { spannedRowsUpdated: () => { const spannedCtrls = this.options.getSpannedRowCtrls(spannedRowRenderer); if (!spannedCtrls) { return; } this.comp.setSpannedRowCtrls(spannedCtrls, false); } }); } } listenOnDomOrder() { const isStickContainer = allStickyContainers.indexOf(this.name) >= 0; if (isStickContainer) { this.comp.setDomOrder(true); return; } const listener = () => { const isEnsureDomOrder = this.gos.get("ensureDomOrder"); const isPrintLayout = _isDomLayout(this.gos, "print"); this.comp.setDomOrder(isEnsureDomOrder || isPrintLayout); }; this.addManagedPropertyListener("domLayout", listener); listener(); } onDisplayedColumnsChanged() { this.forContainers(["center"], () => this.onHorizontalViewportChanged()); } // this methods prevents the grid views from being scrolled while the dragService is being used // eg. the view should not scroll up and down while dragging rows using the rowDragComp. addPreventScrollWhileDragging() { const { dragSvc } = this.beans; if (!dragSvc) { return; } const preventScroll = (e) => { if (dragSvc.dragging) { if (e.cancelable) { e.preventDefault(); } } }; this.eContainer.addEventListener("touchmove", preventScroll, { passive: false }); this.addDestroyFunc(() => this.eContainer.removeEventListener("touchmove", preventScroll)); } // this gets called whenever a change in the viewport, so we can inform column controller it has to work // out the virtual columns again. gets called from following locations: // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged onHorizontalViewportChanged(afterScroll = false) { const scrollWidth = this.getCenterWidth(); const scrollPosition = this.getCenterViewportScrollLeft(); this.beans.colViewport.setScrollPosition(scrollWidth, scrollPosition, afterScroll); } hasHorizontalScrollGap() { return this.eContainer.clientWidth - this.eViewport.clientWidth < 0; } hasVerticalScrollGap() { return this.eContainer.clientHeight - this.eViewport.clientHeight < 0; } getCenterWidth() { return _getInnerWidth(this.eViewport); } getCenterViewportScrollLeft() { return _getScrollLeft(this.eViewport, this.enableRtl); } registerViewportResizeListener(listener) { const unsubscribeFromResize = _observeResize(this.beans, this.eViewport, listener); this.addDestroyFunc(() => unsubscribeFromResize()); } isViewportInTheDOMTree() { return _isInDOM(this.eViewport); } getViewportScrollLeft() { return _getScrollLeft(this.eViewport, this.enableRtl); } isHorizontalScrollShowing() { const { beans, gos, eViewport } = this; const isAlwaysShowHorizontalScroll = gos.get("alwaysShowHorizontalScroll"); const { ctrlsSvc } = beans; const verticalScrollElement = ctrlsSvc.getGridBodyCtrl()?.eBodyViewport; const hScrollEl = ctrlsSvc.get("fakeHScrollComp")?.getGui(); const vScrollEl = ctrlsSvc.get("fakeVScrollComp")?.getGui(); return isAlwaysShowHorizontalScroll || _shouldShowHorizontalScroll(eViewport, verticalScrollElement, void 0, hScrollEl, vScrollEl); } setHorizontalScroll(offset) { this.comp.setHorizontalScroll(offset); } getHScrollPosition() { const res = { left: this.eViewport.scrollLeft, right: this.eViewport.scrollLeft + this.eViewport.offsetWidth }; return res; } setCenterViewportScrollLeft(value) { _setScrollLeft(this.eViewport, value, this.enableRtl); } isContainerVisible() { const pinned = this.options.pinnedType != null; return !pinned || !!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0; } onPinnedWidthChanged() { const visible = this.isContainerVisible(); if (this.visible != visible) { this.visible = visible; this.onDisplayedRowsChanged(); } } onDisplayedRowsChanged(afterScroll = false) { const rows = this.options.getRowCtrls(this.beans.rowRenderer); if (!this.visible || rows.length === 0) { this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS }); return; } const printLayout = _isDomLayout(this.gos, "print"); const embedFullWidthRows = this.gos.get("embedFullWidthRows"); const embedFW = embedFullWidthRows || printLayout; const rowsThisContainer = rows.filter((rowCtrl) => { const fullWidthRow = rowCtrl.isFullWidth(); const match = this.options.fullWidth ? !embedFW && fullWidthRow : embedFW || !fullWidthRow; return match; }); this.comp.setRowCtrls({ rowCtrls: rowsThisContainer, useFlushSync: afterScroll }); } }; var CSS_CLASS_FORCE_VERTICAL_SCROLL = "ag-force-vertical-scroll"; var CSS_CLASS_CELL_SELECTABLE = "ag-selectable"; var CSS_CLASS_COLUMN_MOVING = "ag-column-moving"; var GridBodyCtrl = class extends BeanStub { constructor() { super(...arguments); this.stickyTopHeight = 0; this.stickyBottomHeight = 0; } wireBeans(beans) { this.ctrlsSvc = beans.ctrlsSvc; this.colModel = beans.colModel; this.scrollVisibleSvc = beans.scrollVisibleSvc; this.pinnedRowModel = beans.pinnedRowModel; this.filterManager = beans.filterManager; this.rowGroupColsSvc = beans.rowGroupColsSvc; } setComp(comp, eGridBody, eBodyViewport, eTop, eBottom, eStickyTop, eStickyBottom) { this.comp = comp; this.eGridBody = eGridBody; this.eBodyViewport = eBodyViewport; this.eTop = eTop; this.eBottom = eBottom; this.eStickyTop = eStickyTop; this.eStickyBottom = eStickyBottom; this.eCenterColsViewport = eBodyViewport.querySelector(`.${_getRowViewportClass("center")}`); this.eFullWidthContainer = eBodyViewport.querySelector(`.${_getRowContainerClass("fullWidth")}`); this.setCellTextSelection(this.gos.get("enableCellTextSelection")); this.addManagedPropertyListener( "enableCellTextSelection", (props) => this.setCellTextSelection(props.currentValue) ); this.createManagedBean(new LayoutFeature(this.comp)); this.scrollFeature = this.createManagedBean(new GridBodyScrollFeature(eBodyViewport)); this.beans.rowDragSvc?.setupRowDrag(eBodyViewport, this); this.setupRowAnimationCssClass(); this.addEventListeners(); this.addFocusListeners([eTop, eBodyViewport, eBottom, eStickyTop, eStickyBottom]); this.setGridRootRole(); this.onGridColumnsChanged(); this.addBodyViewportListener(); this.setFloatingHeights(); this.disableBrowserDragging(); this.addStopEditingWhenGridLosesFocus(); this.updateScrollingClasses(); this.filterManager?.setupAdvFilterHeaderComp(eTop); this.ctrlsSvc.register("gridBodyCtrl", this); } addEventListeners() { const setFloatingHeights = this.setFloatingHeights.bind(this); const setGridRootRole = this.setGridRootRole.bind(this); const toggleRowResizeStyle = this.toggleRowResizeStyles.bind(this); this.addManagedEventListeners({ gridColumnsChanged: this.onGridColumnsChanged.bind(this), scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this), scrollGapChanged: this.updateScrollingClasses.bind(this), pinnedRowDataChanged: setFloatingHeights, pinnedHeightChanged: setFloatingHeights, pinnedRowsChanged: setFloatingHeights, headerHeightChanged: this.setStickyTopOffsetTop.bind(this), columnRowGroupChanged: setGridRootRole, columnPivotChanged: setGridRootRole, rowResizeStarted: toggleRowResizeStyle, rowResizeEnded: toggleRowResizeStyle }); this.addManagedPropertyListener("treeData", setGridRootRole); } toggleRowResizeStyles(params) { const isResizingRow = params.type === "rowResizeStarted"; this.eBodyViewport.classList.toggle("ag-prevent-animation", isResizingRow); } onGridColumnsChanged() { const columns = this.beans.colModel.getCols(); this.comp.setColumnCount(columns.length); } onScrollVisibilityChanged() { const { scrollVisibleSvc } = this; const visible = scrollVisibleSvc.verticalScrollShowing; this.setVerticalScrollPaddingVisible(visible); this.setStickyWidth(visible); this.setStickyBottomOffsetBottom(); const scrollbarWidth = visible ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0; const pad = _isInvisibleScrollbar() ? 16 : 0; const width = `calc(100% + ${scrollbarWidth + pad}px)`; _requestAnimationFrame(this.beans, () => this.comp.setBodyViewportWidth(width)); this.updateScrollingClasses(); } setGridRootRole() { const { rowGroupColsSvc, colModel, gos } = this; let isTreeGrid = gos.get("treeData"); if (!isTreeGrid) { const isPivotActive = colModel.isPivotMode(); const rowGroupColumnLen = !rowGroupColsSvc ? 0 : rowGroupColsSvc.columns.length; const columnsNeededForGrouping = isPivotActive ? 2 : 1; isTreeGrid = rowGroupColumnLen >= columnsNeededForGrouping; } this.comp.setGridRootRole(isTreeGrid ? "treegrid" : "grid"); } addFocusListeners(elements) { for (const element of elements) { this.addManagedElementListeners(element, { focusin: (e) => { const { target } = e; const isFocusedElementNested = _isElementChildOfClass(target, "ag-root", element); element.classList.toggle("ag-has-focus", !isFocusedElementNested); }, focusout: (e) => { const { target, relatedTarget } = e; const gridContainRelatedTarget = element.contains(relatedTarget); const isNestedRelatedTarget = _isElementChildOfClass( relatedTarget, "ag-root", element ); const isNestedTarget = _isElementChildOfClass(target, "ag-root", element); if (isNestedTarget) { return; } if (!gridContainRelatedTarget || isNestedRelatedTarget) { element.classList.remove("ag-has-focus"); } } }); } } // used by ColumnAnimationService setColumnMovingCss(moving) { this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING, moving); } setCellTextSelection(selectable = false) { this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE, selectable); } updateScrollingClasses() { const { eGridBody: { classList }, scrollVisibleSvc } = this; classList.toggle("ag-body-vertical-content-no-gap", !scrollVisibleSvc.verticalScrollGap); classList.toggle("ag-body-horizontal-content-no-gap", !scrollVisibleSvc.horizontalScrollGap); } // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer) // and then that will start the browser native drag n' drop, which messes up with our own drag and drop. disableBrowserDragging() { this.addManagedElementListeners(this.eGridBody, { dragstart: (event) => { if (event.target instanceof HTMLImageElement) { event.preventDefault(); return false; } } }); } addStopEditingWhenGridLosesFocus() { this.beans.editSvc?.addStopEditingWhenGridLosesFocus([ this.eBodyViewport, this.eBottom, this.eTop, this.eStickyTop, this.eStickyBottom ]); } updateRowCount() { const headerCount = (this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.filterManager?.getHeaderRowCount() ?? 0); const { rowModel } = this.beans; const rowCount = rowModel.isLastRowIndexKnown() ? rowModel.getRowCount() : -1; const total = rowCount === -1 ? -1 : headerCount + rowCount; this.comp.setRowCount(total); } registerBodyViewportResizeListener(listener) { this.comp.registerBodyViewportResizeListener(listener); } setVerticalScrollPaddingVisible(visible) { const overflowY = visible ? "scroll" : "hidden"; this.comp.setPinnedTopBottomOverflowY(overflowY); } isVerticalScrollShowing() { const { gos, comp, ctrlsSvc } = this; const show = gos.get("alwaysShowVerticalScroll"); const cssClass = show ? CSS_CLASS_FORCE_VERTICAL_SCROLL : null; const allowVerticalScroll = _isDomLayout(gos, "normal"); comp.setAlwaysVerticalScrollClass(cssClass, show); const horizontalScrollElement = ctrlsSvc.get("center")?.eViewport; const hScrollEl = ctrlsSvc.get("fakeHScrollComp")?.getGui(); const vScrollEl = ctrlsSvc.get("fakeVScrollComp")?.getGui(); return show || allowVerticalScroll && _shouldShowVerticalScroll(this.eBodyViewport, horizontalScrollElement, void 0, vScrollEl, hScrollEl); } setupRowAnimationCssClass() { const { rowContainerHeight, environment } = this.beans; let initialSizeMeasurementComplete = environment.sizesMeasured; const updateAnimationClass = () => { const animateRows = initialSizeMeasurementComplete && _isAnimateRows(this.gos) && !rowContainerHeight.stretching; const animateRowsCssClass = animateRows ? "ag-row-animation" : "ag-row-no-animation"; this.comp.setRowAnimationCssOnBodyViewport(animateRowsCssClass, animateRows); }; updateAnimationClass(); this.addManagedEventListeners({ heightScaleChanged: updateAnimationClass }); this.addManagedPropertyListener("animateRows", updateAnimationClass); this.addManagedEventListeners({ stylesChanged: () => { if (!initialSizeMeasurementComplete && environment.sizesMeasured) { initialSizeMeasurementComplete = true; updateAnimationClass(); } } }); } addBodyViewportListener() { const { eBodyViewport, eStickyTop, eStickyBottom, eTop, eBottom, beans: { popupSvc, touchSvc } } = this; const listener = this.onBodyViewportContextMenu.bind(this); this.addManagedElementListeners(eBodyViewport, { contextmenu: listener }); touchSvc?.mockBodyContextMenu(this, listener); this.addManagedElementListeners(eBodyViewport, { wheel: this.onBodyViewportWheel.bind(this, popupSvc) }); const onStickyWheel = this.onStickyWheel.bind(this); for (const container of [eStickyTop, eStickyBottom, eTop, eBottom]) { this.addManagedElementListeners(container, { wheel: onStickyWheel }); } const onHorizontalWheel = this.onHorizontalWheel.bind(this); for (const container of ["left", "right", "topLeft", "topRight", "bottomLeft", "bottomRight"]) { this.addManagedElementListeners(this.ctrlsSvc.get(container).eContainer, { wheel: onHorizontalWheel }); } this.addFullWidthContainerWheelListener(); } addFullWidthContainerWheelListener() { this.addManagedElementListeners(this.eFullWidthContainer, { wheel: (e) => this.onFullWidthContainerWheel(e) }); } onFullWidthContainerWheel(e) { const { deltaX, deltaY, shiftKey } = e; const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY); if (isHorizontalScroll && _isEventFromThisInstance(this.beans, e)) { this.scrollGridBodyToMatchEvent(e); } } onStickyWheel(e) { const { deltaY } = e; const scrolled = this.scrollVertically(deltaY); if (scrolled > 0) { e.preventDefault(); } } onHorizontalWheel(e) { const { deltaX, deltaY, shiftKey } = e; const isHorizontalScroll = shiftKey || Math.abs(deltaX) > Math.abs(deltaY); if (!isHorizontalScroll) { return; } this.scrollGridBodyToMatchEvent(e); } scrollGridBodyToMatchEvent(e) { const { deltaX, deltaY } = e; e.preventDefault(); this.eCenterColsViewport.scrollBy({ left: deltaX || deltaY }); } onBodyViewportContextMenu(mouseEvent, touch, touchEvent) { if (!mouseEvent && !touchEvent) { return; } if (this.gos.get("preventDefaultOnContextMenu")) { const event = mouseEvent || touchEvent; event.preventDefault(); } const { target } = mouseEvent || touch; if (target === this.eBodyViewport || target === this.ctrlsSvc.get("center").eViewport) { this.beans.contextMenuSvc?.showContextMenu({ mouseEvent, touchEvent, value: null, anchorToElement: this.eGridBody, source: "ui" }); } } onBodyViewportWheel(popupSvc, e) { if (!this.gos.get("suppressScrollWhenPopupsAreOpen")) { return; } if (popupSvc?.hasAnchoredPopup()) { e.preventDefault(); } } // called by rowDragFeature scrollVertically(pixels) { const oldScrollPosition = this.eBodyViewport.scrollTop; this.scrollFeature.setVerticalScrollPosition(oldScrollPosition + pixels); return this.eBodyViewport.scrollTop - oldScrollPosition; } setFloatingHeights() { const { pinnedRowModel, beans: { environment } } = this; const floatingTopHeight = pinnedRowModel?.getPinnedTopTotalHeight(); const floatingBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight(); const pinnedBorderWidth = environment.getPinnedRowBorderWidth(); const rowBorderWidth = environment.getRowBorderWidth(); const additionalHeight = pinnedBorderWidth - rowBorderWidth; const normalisedFloatingTopHeight = !floatingTopHeight ? 0 : additionalHeight + floatingTopHeight; const normalisedFloatingBottomHeight = !floatingBottomHeight ? 0 : additionalHeight + floatingBottomHeight; this.comp.setTopHeight(normalisedFloatingTopHeight); this.comp.setBottomHeight(normalisedFloatingBottomHeight); this.comp.setTopInvisible(normalisedFloatingTopHeight <= 0); this.comp.setBottomInvisible(normalisedFloatingBottomHeight <= 0); this.setStickyTopOffsetTop(); this.setStickyBottomOffsetBottom(); } setStickyTopHeight(height = 0) { this.comp.setStickyTopHeight(`${height}px`); this.stickyTopHeight = height; } setStickyBottomHeight(height = 0) { this.comp.setStickyBottomHeight(`${height}px`); this.stickyBottomHeight = height; } setStickyWidth(vScrollVisible) { if (!vScrollVisible) { this.comp.setStickyTopWidth("100%"); this.comp.setStickyBottomWidth("100%"); } else { const scrollbarWidth = this.scrollVisibleSvc.getScrollbarWidth(); this.comp.setStickyTopWidth(`calc(100% - ${scrollbarWidth}px)`); this.comp.setStickyBottomWidth(`calc(100% - ${scrollbarWidth}px)`); } } setStickyTopOffsetTop() { const headerCtrl = this.ctrlsSvc.get("gridHeaderCtrl"); const headerHeight = headerCtrl.headerHeight + (this.filterManager?.getHeaderHeight() ?? 0); const pinnedTopHeight = this.pinnedRowModel?.getPinnedTopTotalHeight() ?? 0; let height = 0; if (headerHeight > 0) { height += headerHeight; } if (pinnedTopHeight > 0) { height += pinnedTopHeight; } if (height > 0) { height += 1; } this.comp.setStickyTopTop(`${height}px`); } setStickyBottomOffsetBottom() { const { pinnedRowModel, scrollVisibleSvc, comp } = this; const pinnedBottomHeight = pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0; const hScrollShowing = scrollVisibleSvc.horizontalScrollShowing; const scrollbarWidth = hScrollShowing ? scrollVisibleSvc.getScrollbarWidth() || 0 : 0; const height = pinnedBottomHeight + scrollbarWidth; comp.setStickyBottomBottom(`${height}px`); } }; function _createElement(params) { return _createAgElement(params); } var CellComp = class extends Component { constructor(beans, cellCtrl, printLayout, eRow, editingCell) { super(); this.cellCtrl = cellCtrl; this.rowResizerElement = null; this.rendererVersion = 0; this.editorVersion = 0; this.beans = beans; this.gos = beans.gos; this.column = cellCtrl.column; this.rowNode = cellCtrl.rowNode; this.eRow = eRow; const cellDiv = _createElement({ tag: "div", role: cellCtrl.getCellAriaRole(), attrs: { "comp-id": `${this.getCompId()}`, "col-id": cellCtrl.column.colIdSanitised } }); this.eCell = cellDiv; let wrapperDiv; if (cellCtrl.isCellSpanning()) { wrapperDiv = _createElement({ tag: "div", cls: "ag-spanned-cell-wrapper", role: "presentation" }); wrapperDiv.appendChild(cellDiv); this.setTemplateFromElement(wrapperDiv); } else { this.setTemplateFromElement(cellDiv); } this.cellCssManager = new CssClassManager(() => cellDiv); this.forceWrapper = cellCtrl.isForceWrapper(); this.refreshWrapper(false); const compProxy = { toggleCss: (cssClassName, on) => this.cellCssManager.toggleCss(cssClassName, on), setUserStyles: (styles) => _addStylesToElement(cellDiv, styles), getFocusableElement: () => cellDiv, setIncludeSelection: (include) => this.includeSelection = include, setIncludeRowDrag: (include) => this.includeRowDrag = include, setIncludeDndSource: (include) => this.includeDndSource = include, setRowResizerElement: (element) => this.setRowResizerElement(element), setRenderDetails: (compDetails, valueToDisplay, force) => this.setRenderDetails(compDetails, valueToDisplay, force), setEditDetails: (compDetails, popup, position) => this.setEditDetails(compDetails, popup, position), getCellEditor: () => this.cellEditor || null, getCellRenderer: () => this.cellRenderer || null, getParentOfValue: () => this.getParentOfValue(), refreshEditStyles: (editing, isPopup) => this.refreshEditStyles(editing, isPopup) }; cellCtrl.setComp(compProxy, cellDiv, wrapperDiv, this.eCellWrapper, printLayout, editingCell, void 0); } getParentOfValue() { return this.eCellValue ?? this.eCellWrapper ?? this.eCell; } setRowResizerElement(element) { if (this.rowResizerElement) { _removeFromParent(this.rowResizerElement); } this.rowResizerElement = element; if (element) { this.eCell.appendChild(element); } } setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance) { const isInlineEditing = this.cellEditor && !this.cellEditorPopupWrapper; if (isInlineEditing) { return; } this.firstRender = this.firstRender == null; const controlWrapperChanged = this.refreshWrapper(false); this.refreshEditStyles(false); if (compDetails) { const neverRefresh = forceNewCellRendererInstance || controlWrapperChanged; const cellRendererRefreshSuccessful = neverRefresh ? false : this.refreshCellRenderer(compDetails); if (!cellRendererRefreshSuccessful) { this.destroyRenderer(); this.createCellRendererInstance(compDetails); } } else { this.destroyRenderer(); this.insertValueWithoutCellRenderer(valueToDisplay); } this.rowDraggingComp?.refreshVisibility(); if (this.rowResizerElement && !this.rowResizerElement.parentElement) { this.eCell.appendChild(this.rowResizerElement); } } setEditDetails(compDetails, popup, position) { if (compDetails) { this.createCellEditorInstance(compDetails, popup, position); } else { this.destroyEditor(); } } removeControls() { const context = this.beans.context; this.checkboxSelectionComp = context.destroyBean(this.checkboxSelectionComp); this.dndSourceComp = context.destroyBean(this.dndSourceComp); this.rowDraggingComp = context.destroyBean(this.rowDraggingComp); } // returns true if wrapper was changed refreshWrapper(editing) { const providingControls = this.includeRowDrag || this.includeDndSource || this.includeSelection; const usingWrapper = providingControls || this.forceWrapper; const putWrapperIn = usingWrapper && this.eCellWrapper == null; if (putWrapperIn) { this.eCellWrapper = _createElement({ tag: "div", cls: "ag-cell-wrapper", role: "presentation" }); this.eCell.appendChild(this.eCellWrapper); } const takeWrapperOut = !usingWrapper && this.eCellWrapper != null; if (takeWrapperOut) { _removeFromParent(this.eCellWrapper); this.eCellWrapper = void 0; } this.cellCssManager.toggleCss("ag-cell-value", !usingWrapper); const usingCellValue = !editing && usingWrapper; const putCellValueIn = usingCellValue && this.eCellValue == null; if (putCellValueIn) { const cls = this.cellCtrl.getCellValueClass(); this.eCellValue = _createElement({ tag: "span", cls, role: "presentation" }); this.eCellWrapper.appendChild(this.eCellValue); } const takeCellValueOut = !usingCellValue && this.eCellValue != null; if (takeCellValueOut) { _removeFromParent(this.eCellValue); this.eCellValue = void 0; } const templateChanged = putWrapperIn || takeWrapperOut || putCellValueIn || takeCellValueOut; if (templateChanged) { this.removeControls(); } if (!editing && providingControls) { this.addControls(); } return templateChanged; } addControls() { const { cellCtrl, eCellWrapper, eCellValue, includeRowDrag, includeDndSource, includeSelection } = this; const insertBefore = (comp) => { if (comp) { eCellWrapper.insertBefore(comp.getGui(), eCellValue); } }; if (includeRowDrag && this.rowDraggingComp == null) { this.rowDraggingComp = cellCtrl.createRowDragComp(); insertBefore(this.rowDraggingComp); } if (includeDndSource && this.dndSourceComp == null) { this.dndSourceComp = cellCtrl.createDndSource(); insertBefore(this.dndSourceComp); } if (includeSelection && this.checkboxSelectionComp == null) { this.checkboxSelectionComp = cellCtrl.createSelectionCheckbox(); insertBefore(this.checkboxSelectionComp); } } createCellEditorInstance(compDetails, popup, position) { const versionCopy = this.editorVersion; const cellEditorPromise = compDetails.newAgStackInstance(); const { params } = compDetails; cellEditorPromise.then((c) => this.afterCellEditorCreated(versionCopy, c, params, popup, position)); const cellEditorAsync = _missing(this.cellEditor); if (cellEditorAsync && params.cellStartedEdit) { this.cellCtrl.focusCell(true); } } insertValueWithoutCellRenderer(valueToDisplay) { const eParent = this.getParentOfValue(); _clearElement(eParent); const escapedValue = _toString(valueToDisplay); if (escapedValue != null) { eParent.textContent = escapedValue; } } destroyRenderer() { const { context } = this.beans; this.cellRenderer = context.destroyBean(this.cellRenderer); _removeFromParent(this.cellRendererGui); this.cellRendererGui = null; this.rendererVersion++; } destroyEditor() { const { context } = this.beans; const recoverFocus = this.cellEditorPopupWrapper?.getGui().contains(_getActiveDomElement(this.beans)) || this.cellCtrl.hasBrowserFocus(); if (recoverFocus) { this.eCell.focus({ preventScroll: true }); } this.hideEditorPopup?.(); this.hideEditorPopup = void 0; this.cellEditor = context.destroyBean(this.cellEditor); this.cellEditorPopupWrapper = context.destroyBean(this.cellEditorPopupWrapper); _removeFromParent(this.cellEditorGui); this.cellCtrl.disableEditorTooltipFeature(); this.cellEditorGui = null; this.editorVersion++; } refreshCellRenderer(compClassAndParams) { if (this.cellRenderer?.refresh == null) { return false; } if (this.cellRendererClass !== compClassAndParams.componentClass) { return false; } const result = this.cellRenderer.refresh(compClassAndParams.params); return result === true || result === void 0; } createCellRendererInstance(compDetails) { const displayComponentVersionCopy = this.rendererVersion; const createCellRendererFunc = (details) => (_) => { const staleTask = this.rendererVersion !== displayComponentVersionCopy || !this.isAlive(); if (staleTask) { return; } const componentPromise = details.newAgStackInstance(); const callback = this.afterCellRendererCreated.bind( this, displayComponentVersionCopy, details.componentClass ); componentPromise?.then(callback); }; const { animationFrameSvc } = this.beans; let createTask; if (animationFrameSvc?.active && this.firstRender) { createTask = (details, isDeferred = false) => { animationFrameSvc.createTask( createCellRendererFunc(details), this.rowNode.rowIndex, "p2", details.componentFromFramework, isDeferred ); }; } else { createTask = (details) => createCellRendererFunc(details)(); } if (compDetails.params?.deferRender && !this.cellCtrl.rowNode.group) { const { loadingComp, onReady } = this.cellCtrl.getDeferLoadingCellRenderer(); if (loadingComp) { createTask(loadingComp); onReady.then(() => createTask(compDetails, true)); } } else { createTask(compDetails); } } afterCellRendererCreated(cellRendererVersion, cellRendererClass, cellRenderer) { const staleTask = !this.isAlive() || cellRendererVersion !== this.rendererVersion; if (staleTask) { this.beans.context.destroyBean(cellRenderer); return; } this.cellRenderer = cellRenderer; this.cellRendererClass = cellRendererClass; const cellGui = cellRenderer.getGui(); this.cellRendererGui = cellGui; if (cellGui != null) { const eParent = this.getParentOfValue(); _clearElement(eParent); eParent.appendChild(cellGui); } } afterCellEditorCreated(requestVersion, cellEditor, params, popup, position) { const staleComp = requestVersion !== this.editorVersion; const { context } = this.beans; if (staleComp) { context.destroyBean(cellEditor); return; } const editingCancelledByUserComp = cellEditor.isCancelBeforeStart?.(); if (editingCancelledByUserComp) { context.destroyBean(cellEditor); this.cellCtrl.stopEditing(true); return; } if (!cellEditor.getGui) { _warn(97, { colId: this.column.getId() }); context.destroyBean(cellEditor); return; } this.cellEditor = cellEditor; this.cellEditorGui = cellEditor.getGui(); const cellEditorInPopup = popup || cellEditor.isPopup?.(); if (cellEditorInPopup) { this.addPopupCellEditor(params, position); } else { this.addInCellEditor(); } this.refreshEditStyles(true, cellEditorInPopup); cellEditor.afterGuiAttached?.(); this.cellCtrl.enableEditorTooltipFeature(cellEditor); this.cellCtrl.cellEditorAttached(); } refreshEditStyles(editing, isPopup) { const { cellCssManager } = this; cellCssManager.toggleCss("ag-cell-inline-editing", editing && !isPopup); cellCssManager.toggleCss("ag-cell-popup-editing", editing && !!isPopup); cellCssManager.toggleCss("ag-cell-not-inline-editing", !editing || !!isPopup); } addInCellEditor() { const { eCell } = this; if (eCell.contains(_getActiveDomElement(this.beans))) { eCell.focus(); } this.destroyRenderer(); this.refreshWrapper(true); _clearElement(this.getParentOfValue()); if (this.cellEditorGui) { const eParent = this.getParentOfValue(); eParent.appendChild(this.cellEditorGui); } } addPopupCellEditor(params, position) { const { gos, context, popupSvc, editSvc } = this.beans; if (gos.get("editType") === "fullRow") { _warn(98); } const cellEditorPopupWrapper = this.cellEditorPopupWrapper = context.createBean( editSvc.createPopupEditorWrapper(params) ); const { cellEditor, cellEditorGui, eCell, rowNode, column, cellCtrl } = this; const ePopupGui = cellEditorPopupWrapper.getGui(); if (cellEditorGui) { ePopupGui.appendChild(cellEditorGui); } const useModelPopup = gos.get("stopEditingWhenCellsLoseFocus"); const positionToUse = position != null ? position : cellEditor.getPopupPosition?.() ?? "over"; const isRtl = gos.get("enableRtl"); const positionParams = { ePopup: ePopupGui, additionalParams: { column, rowNode }, type: "popupCellEditor", eventSource: eCell, position: positionToUse, alignSide: isRtl ? "right" : "left", keepWithinBounds: true }; const positionCallback = popupSvc.positionPopupByComponent.bind(popupSvc, positionParams); const addPopupRes = popupSvc.addPopup({ modal: useModelPopup, eChild: ePopupGui, closeOnEsc: true, closedCallback: (e) => { cellCtrl.onPopupEditorClosed(e); }, anchorToElement: eCell, positionCallback, ariaOwns: eCell }); if (addPopupRes) { this.hideEditorPopup = addPopupRes.hideFunc; } } detach() { this.getGui().remove(); } // if the row is also getting destroyed, then we don't need to remove from dom, // as the row will also get removed, so no need to take out the cells from the row // if the row is going (removing is an expensive operation, so only need to remove // the top part) // // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. destroy() { this.destroyRenderer(); this.destroyEditor(); this.removeControls(); super.destroy(); } }; var RowComp = class extends Component { constructor(ctrl, beans, containerType) { super(); this.cellComps = /* @__PURE__ */ new Map(); this.beans = beans; this.rowCtrl = ctrl; const rowDiv = _createElement({ tag: "div", role: "row", attrs: { "comp-id": `${this.getCompId()}` } }); this.setInitialStyle(rowDiv, containerType); this.setTemplateFromElement(rowDiv); const style = rowDiv.style; this.domOrder = this.rowCtrl.getDomOrder(); const compProxy = { setDomOrder: (domOrder) => this.domOrder = domOrder, setCellCtrls: (cellCtrls) => this.setCellCtrls(cellCtrls), showFullWidth: (compDetails) => this.showFullWidth(compDetails), getFullWidthCellRenderer: () => this.fullWidthCellRenderer, getFullWidthCellRendererParams: () => this.fullWidthCellRendererParams, toggleCss: (name, on) => this.toggleCss(name, on), setUserStyles: (styles) => _addStylesToElement(rowDiv, styles), setTop: (top) => style.top = top, setTransform: (transform) => style.transform = transform, setRowIndex: (rowIndex) => rowDiv.setAttribute("row-index", rowIndex), setRowId: (rowId) => rowDiv.setAttribute("row-id", rowId), setRowBusinessKey: (businessKey) => rowDiv.setAttribute("row-business-key", businessKey), refreshFullWidth: (getUpdatedParams) => { const params = getUpdatedParams(); this.fullWidthCellRendererParams = params; return this.fullWidthCellRenderer?.refresh?.(params) ?? false; } }; ctrl.setComp(compProxy, this.getGui(), containerType, void 0); this.addDestroyFunc(() => { ctrl.unsetComp(containerType); }); } setInitialStyle(container, containerType) { const transform = this.rowCtrl.getInitialTransform(containerType); if (transform) { container.style.setProperty("transform", transform); } else { const top = this.rowCtrl.getInitialRowTop(containerType); if (top) { container.style.setProperty("top", top); } } } showFullWidth(compDetails) { const callback = (cellRenderer) => { if (this.isAlive()) { const eGui = cellRenderer.getGui(); this.getGui().appendChild(eGui); this.rowCtrl.setupDetailRowAutoHeight(eGui); this.setFullWidthRowComp(cellRenderer, compDetails.params); } else { this.beans.context.destroyBean(cellRenderer); } }; const res = compDetails.newAgStackInstance(); res.then(callback); } setCellCtrls(cellCtrls) { const cellsToRemove = new Map(this.cellComps); for (const cellCtrl of cellCtrls) { const key = cellCtrl.instanceId; if (!this.cellComps.has(key)) { this.newCellComp(cellCtrl); } else { cellsToRemove.delete(key); } } this.destroyCells(cellsToRemove); this.ensureDomOrder(cellCtrls); } ensureDomOrder(cellCtrls) { if (!this.domOrder) { return; } const elementsInOrder = []; for (const cellCtrl of cellCtrls) { const cellComp = this.cellComps.get(cellCtrl.instanceId); if (cellComp) { elementsInOrder.push(cellComp.getGui()); } } _setDomChildOrder(this.getGui(), elementsInOrder); } newCellComp(cellCtrl) { const editing = this.beans.editSvc?.isEditing(cellCtrl, { withOpenEditor: true }) ?? false; const cellComp = new CellComp(this.beans, cellCtrl, this.rowCtrl.printLayout, this.getGui(), editing); this.cellComps.set(cellCtrl.instanceId, cellComp); this.getGui().appendChild(cellComp.getGui()); } destroy() { super.destroy(); this.destroyCells(this.cellComps); } setFullWidthRowComp(fullWidthRowComponent, params) { this.fullWidthCellRenderer = fullWidthRowComponent; this.fullWidthCellRendererParams = params; this.addDestroyFunc(() => { this.fullWidthCellRenderer = this.beans.context.destroyBean(this.fullWidthCellRenderer); this.fullWidthCellRendererParams = void 0; }); } destroyCells(cellComps) { for (const cellComp of cellComps.values()) { if (!cellComp) { continue; } const instanceId = cellComp.cellCtrl.instanceId; if (this.cellComps.get(instanceId) !== cellComp) { continue; } cellComp.detach(); cellComp.destroy(); this.cellComps.delete(instanceId); } } }; function getElementParams(name, options, beans) { const isCellSpanning = !!beans.gos.get("enableCellSpan") && !!options.getSpannedRowCtrls; const eContainerElement = { tag: "div", ref: "eContainer", cls: _getRowContainerClass(name), role: "rowgroup" }; if (options.type === "center" || isCellSpanning) { const eSpannedContainerElement = { tag: "div", ref: "eSpannedContainer", cls: `ag-spanning-container ${_getRowSpanContainerClass(name)}`, role: "presentation" }; eContainerElement.role = "presentation"; return { tag: "div", ref: "eViewport", cls: `ag-viewport ${_getRowViewportClass(name)}`, role: "rowgroup", children: [eContainerElement, isCellSpanning ? eSpannedContainerElement : null] }; } return eContainerElement; } var RowContainerComp = class extends Component { constructor(params) { super(); this.eViewport = RefPlaceholder; this.eContainer = RefPlaceholder; this.eSpannedContainer = RefPlaceholder; this.rowCompsNoSpan = {}; this.rowCompsWithSpan = {}; this.name = params?.name; this.options = _getRowContainerOptions(this.name); } postConstruct() { this.setTemplate(getElementParams(this.name, this.options, this.beans)); const compProxy = { setHorizontalScroll: (offset) => this.eViewport.scrollLeft = offset, setViewportHeight: (height) => this.eViewport.style.height = height, setRowCtrls: ({ rowCtrls }) => this.setRowCtrls(rowCtrls), setSpannedRowCtrls: (rowCtrls) => this.setRowCtrls(rowCtrls, true), setDomOrder: (domOrder) => { this.domOrder = domOrder; }, setContainerWidth: (width) => { this.eContainer.style.width = width; if (this.eSpannedContainer) { this.eSpannedContainer.style.width = width; } }, setOffsetTop: (offset) => { const top = `translateY(${offset})`; this.eContainer.style.transform = top; if (this.eSpannedContainer) { this.eSpannedContainer.style.transform = top; } } }; const ctrl = this.createManagedBean(new RowContainerCtrl(this.name)); ctrl.setComp(compProxy, this.eContainer, this.eSpannedContainer, this.eViewport); } destroy() { this.setRowCtrls([]); this.setRowCtrls([], true); super.destroy(); this.lastPlacedElement = null; } setRowCtrls(rowCtrls, spanContainer) { const { beans, options } = this; const container = spanContainer ? this.eSpannedContainer : this.eContainer; const oldRows = spanContainer ? { ...this.rowCompsWithSpan } : { ...this.rowCompsNoSpan }; const newComps = {}; if (spanContainer) { this.rowCompsWithSpan = newComps; } else { this.rowCompsNoSpan = newComps; } this.lastPlacedElement = null; const orderedRows = []; for (const rowCtrl of rowCtrls) { const instanceId = rowCtrl.instanceId; const existingRowComp = oldRows[instanceId]; let rowComp; if (existingRowComp) { rowComp = existingRowComp; delete oldRows[instanceId]; } else { if (!rowCtrl.rowNode.displayed) { continue; } rowComp = new RowComp(rowCtrl, beans, options.type); } newComps[instanceId] = rowComp; orderedRows.push([rowComp, !existingRowComp]); } this.removeOldRows(Object.values(oldRows)); this.addRowNodes(orderedRows, container); } addRowNodes(rows, container) { const { domOrder } = this; for (const [rowComp, isNew] of rows) { const eGui = rowComp.getGui(); if (!domOrder) { if (isNew) { container.appendChild(eGui); } } else { this.ensureDomOrder(eGui, container); } } } removeOldRows(rowComps) { for (const oldRowComp of rowComps) { oldRowComp.getGui().remove(); oldRowComp.destroy(); } } ensureDomOrder(eRow, container) { _ensureDomOrder(container, eRow, this.lastPlacedElement); this.lastPlacedElement = eRow; } }; var RowContainerSelector = { selector: "AG-ROW-CONTAINER", component: RowContainerComp }; function makeRowContainers(paramsMap, names) { return names.map((name) => { const refName = `e${name[0].toUpperCase() + name.substring(1)}RowContainer`; paramsMap[refName] = { name }; return { tag: "ag-row-container", ref: refName, attrs: { name } }; }); } function getGridBodyTemplate(includeOverlay) { const paramsMap = {}; const elementParams = { tag: "div", ref: "eGridRoot", cls: "ag-root ag-unselectable", children: [ { tag: "ag-header-root" }, { tag: "div", ref: "eTop", cls: "ag-floating-top", role: "presentation", children: makeRowContainers(paramsMap, ["topLeft", "topCenter", "topRight", "topFullWidth"]) }, { tag: "div", ref: "eBody", cls: "ag-body", role: "presentation", children: [ { tag: "div", ref: "eBodyViewport", cls: "ag-body-viewport", role: "presentation", children: makeRowContainers(paramsMap, ["left", "center", "right", "fullWidth"]) }, { tag: "ag-fake-vertical-scroll" } ] }, { tag: "div", ref: "eStickyTop", cls: "ag-sticky-top", role: "presentation", children: makeRowContainers(paramsMap, [ "stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth" ]) }, { tag: "div", ref: "eStickyBottom", cls: "ag-sticky-bottom", role: "presentation", children: makeRowContainers(paramsMap, [ "stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth" ]) }, { tag: "div", ref: "eBottom", cls: "ag-floating-bottom", role: "presentation", children: makeRowContainers(paramsMap, [ "bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth" ]) }, { tag: "ag-fake-horizontal-scroll" }, includeOverlay ? { tag: "ag-overlay-wrapper" } : null ] }; return { paramsMap, elementParams }; } var GridBodyComp = class extends Component { constructor() { super(...arguments); this.eGridRoot = RefPlaceholder; this.eBodyViewport = RefPlaceholder; this.eStickyTop = RefPlaceholder; this.eStickyBottom = RefPlaceholder; this.eTop = RefPlaceholder; this.eBottom = RefPlaceholder; this.eBody = RefPlaceholder; } postConstruct() { const { overlays, rangeSvc } = this.beans; const overlaySelector = overlays?.getOverlayWrapperSelector(); const { paramsMap, elementParams } = getGridBodyTemplate(!!overlaySelector); this.setTemplate( elementParams, [ ...overlaySelector ? [overlaySelector] : [], FakeHScrollSelector, FakeVScrollSelector, GridHeaderSelector, RowContainerSelector ], paramsMap ); const setHeight = (height, element) => { const heightString = `${height}px`; element.style.minHeight = heightString; element.style.height = heightString; }; const compProxy = { setRowAnimationCssOnBodyViewport: (cssClass, animate) => this.setRowAnimationCssOnBodyViewport(cssClass, animate), setColumnCount: (count) => _setAriaColCount(this.getGui(), count), setRowCount: (count) => _setAriaRowCount(this.getGui(), count), setTopHeight: (height) => setHeight(height, this.eTop), setBottomHeight: (height) => setHeight(height, this.eBottom), setTopInvisible: (invisible) => this.eTop.classList.toggle("ag-invisible", invisible), setBottomInvisible: (invisible) => this.eBottom.classList.toggle("ag-invisible", invisible), setStickyTopHeight: (height) => this.eStickyTop.style.height = height, setStickyTopTop: (top) => this.eStickyTop.style.top = top, setStickyTopWidth: (width) => this.eStickyTop.style.width = width, setStickyBottomHeight: (height) => { this.eStickyBottom.style.height = height; this.eStickyBottom.classList.toggle("ag-invisible", height === "0px"); }, setStickyBottomBottom: (bottom) => this.eStickyBottom.style.bottom = bottom, setStickyBottomWidth: (width) => this.eStickyBottom.style.width = width, setColumnMovingCss: (cssClass, flag) => this.toggleCss(cssClass, flag), updateLayoutClasses: (cssClass, params) => { const classLists = [this.eBodyViewport.classList, this.eBody.classList]; for (const classList of classLists) { classList.toggle(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); classList.toggle(LayoutCssClasses.NORMAL, params.normal); classList.toggle(LayoutCssClasses.PRINT, params.print); } this.toggleCss(LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); this.toggleCss(LayoutCssClasses.NORMAL, params.normal); this.toggleCss(LayoutCssClasses.PRINT, params.print); }, setAlwaysVerticalScrollClass: (cssClass, on) => this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL, on), registerBodyViewportResizeListener: (listener) => { const unsubscribeFromResize = _observeResize(this.beans, this.eBodyViewport, listener); this.addDestroyFunc(() => unsubscribeFromResize()); }, setPinnedTopBottomOverflowY: (overflow) => this.eTop.style.overflowY = this.eBottom.style.overflowY = overflow, setCellSelectableCss: (cssClass, selectable) => { for (const ct of [this.eTop, this.eBodyViewport, this.eBottom]) { ct.classList.toggle(cssClass, selectable); } }, setBodyViewportWidth: (width) => this.eBodyViewport.style.width = width, setGridRootRole: (role) => _setAriaRole(this.eGridRoot, role) }; this.ctrl = this.createManagedBean(new GridBodyCtrl()); this.ctrl.setComp( compProxy, this.getGui(), this.eBodyViewport, this.eTop, this.eBottom, this.eStickyTop, this.eStickyBottom ); if (rangeSvc && _isCellSelectionEnabled(this.gos) || _isMultiRowSelection(this.gos)) { _setAriaMultiSelectable(this.getGui(), true); } } setRowAnimationCssOnBodyViewport(cssClass, animateRows) { const bodyViewportClassList = this.eBodyViewport.classList; bodyViewportClassList.toggle("ag-row-animation", animateRows); bodyViewportClassList.toggle("ag-row-no-animation", !animateRows); } getFocusableContainerName() { return "gridBody"; } }; var GridBodySelector = { selector: "AG-GRID-BODY", component: GridBodyComp }; var TabGuardClassNames = { TAB_GUARD: "ag-tab-guard", TAB_GUARD_TOP: "ag-tab-guard-top", TAB_GUARD_BOTTOM: "ag-tab-guard-bottom" }; var AgTabGuardCtrl = class extends AgBeanStub { constructor(params, stopPropagationCallbacks) { super(); this.stopPropagationCallbacks = stopPropagationCallbacks; this.skipTabGuardFocus = false; this.forcingFocusOut = false; this.allowFocus = false; const { comp, eTopGuard, eBottomGuard, focusTrapActive, forceFocusOutWhenTabGuardsAreEmpty, isFocusableContainer, focusInnerElement, onFocusIn, onFocusOut, shouldStopEventPropagation, onTabKeyDown, handleKeyDown, isEmpty, eFocusableElement } = params; this.comp = comp; this.eTopGuard = eTopGuard; this.eBottomGuard = eBottomGuard; this.providedFocusInnerElement = focusInnerElement; this.eFocusableElement = eFocusableElement; this.focusTrapActive = !!focusTrapActive; this.forceFocusOutWhenTabGuardsAreEmpty = !!forceFocusOutWhenTabGuardsAreEmpty; this.isFocusableContainer = !!isFocusableContainer; this.providedFocusIn = onFocusIn; this.providedFocusOut = onFocusOut; this.providedShouldStopEventPropagation = shouldStopEventPropagation; this.providedOnTabKeyDown = onTabKeyDown; this.providedHandleKeyDown = handleKeyDown; this.providedIsEmpty = isEmpty; } postConstruct() { this.createManagedBean( new AgManagedFocusFeature(this.eFocusableElement, this.stopPropagationCallbacks, { shouldStopEventPropagation: () => this.shouldStopEventPropagation(), onTabKeyDown: (e) => this.onTabKeyDown(e), handleKeyDown: (e) => this.handleKeyDown(e), onFocusIn: (e) => this.onFocusIn(e), onFocusOut: (e) => this.onFocusOut(e) }) ); this.activateTabGuards(); for (const guard of [this.eTopGuard, this.eBottomGuard]) { this.addManagedElementListeners(guard, { focus: this.onFocus.bind(this) }); } } handleKeyDown(e) { if (this.providedHandleKeyDown) { this.providedHandleKeyDown(e); } } tabGuardsAreActive() { return !!this.eTopGuard && this.eTopGuard.hasAttribute("tabIndex"); } shouldStopEventPropagation() { if (this.providedShouldStopEventPropagation) { return this.providedShouldStopEventPropagation(); } return false; } activateTabGuards() { if (this.forcingFocusOut) { return; } const tabIndex = this.gos.get("tabIndex"); this.comp.setTabIndex(tabIndex.toString()); } deactivateTabGuards() { this.comp.setTabIndex(); } onFocus(e) { if (this.isFocusableContainer && !this.eFocusableElement.contains(e.relatedTarget)) { if (!this.allowFocus) { this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard); return; } } if (this.skipTabGuardFocus) { this.skipTabGuardFocus = false; return; } if (this.forceFocusOutWhenTabGuardsAreEmpty) { const isEmpty = this.providedIsEmpty ? this.providedIsEmpty() : _findFocusableElements(this.eFocusableElement, ".ag-tab-guard").length === 0; if (isEmpty) { this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard); return; } } if (this.isFocusableContainer && this.eFocusableElement.contains(e.relatedTarget)) { return; } const fromBottom = e.target === this.eBottomGuard; const hasFocusedInnerElement = this.providedFocusInnerElement ? this.providedFocusInnerElement(fromBottom) : this.focusInnerElement(fromBottom); if (!hasFocusedInnerElement && this.forceFocusOutWhenTabGuardsAreEmpty) { this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard); } } findNextElementOutsideAndFocus(up) { const eDocument = _getDocument(this.beans); const focusableEls = _findFocusableElements(eDocument.body, null, true); const index = focusableEls.indexOf(up ? this.eTopGuard : this.eBottomGuard); if (index === -1) { return; } let start; let end; if (up) { start = 0; end = index; } else { start = index + 1; end = focusableEls.length; } const focusableRange = focusableEls.slice(start, end); const targetTabIndex = this.gos.get("tabIndex"); focusableRange.sort((a, b) => { const indexA = Number.parseInt(a.getAttribute("tabindex") || "0"); const indexB = Number.parseInt(b.getAttribute("tabindex") || "0"); if (indexB === targetTabIndex) { return 1; } if (indexA === targetTabIndex) { return -1; } if (indexA === 0) { return 1; } if (indexB === 0) { return -1; } return indexA - indexB; }); focusableRange[up ? focusableRange.length - 1 : 0]?.focus(); } onFocusIn(e) { if (this.focusTrapActive || this.forcingFocusOut) { return; } if (this.providedFocusIn) { this.providedFocusIn(e); } if (!this.isFocusableContainer) { this.deactivateTabGuards(); } } onFocusOut(e) { if (this.focusTrapActive) { return; } if (this.providedFocusOut) { this.providedFocusOut(e); } if (!this.eFocusableElement.contains(e.relatedTarget)) { this.activateTabGuards(); } } onTabKeyDown(e) { if (this.providedOnTabKeyDown) { this.providedOnTabKeyDown(e); return; } if (this.focusTrapActive) { return; } if (e.defaultPrevented) { return; } const tabGuardsAreActive = this.tabGuardsAreActive(); if (tabGuardsAreActive) { this.deactivateTabGuards(); } const nextRoot = this.getNextFocusableElement(e.shiftKey); if (tabGuardsAreActive) { setTimeout(() => this.activateTabGuards(), 0); } if (!nextRoot) { return; } nextRoot.focus(); e.preventDefault(); } focusInnerElement(fromBottom = false) { const focusable = _findFocusableElements(this.eFocusableElement); if (this.tabGuardsAreActive()) { focusable.splice(0, 1); focusable.splice(-1, 1); } if (!focusable.length) { return false; } focusable[fromBottom ? focusable.length - 1 : 0].focus({ preventScroll: true }); return true; } getNextFocusableElement(backwards) { return _findNextFocusableElement(this.beans, this.eFocusableElement, false, backwards); } forceFocusOutOfContainer(up = false) { if (this.forcingFocusOut) { return; } const tabGuardToFocus = up ? this.eTopGuard : this.eBottomGuard; this.activateTabGuards(); this.skipTabGuardFocus = true; this.forcingFocusOut = true; tabGuardToFocus.focus(); window.setTimeout(() => { this.forcingFocusOut = false; this.activateTabGuards(); }); } isTabGuard(element, bottom) { return element === this.eTopGuard && !bottom || element === this.eBottomGuard && (bottom ?? true); } setAllowFocus(allowFocus) { this.allowFocus = allowFocus; } }; var AgTabGuardFeature = class extends AgBeanStub { constructor(comp, stopPropagationCallbacks) { super(); this.comp = comp; this.stopPropagationCallbacks = stopPropagationCallbacks; } initialiseTabGuard(params) { this.eTopGuard = this.createTabGuard("top"); this.eBottomGuard = this.createTabGuard("bottom"); this.eFocusableElement = this.comp.getFocusableElement(); const { eTopGuard, eBottomGuard, eFocusableElement, stopPropagationCallbacks } = this; const tabGuards = [eTopGuard, eBottomGuard]; const compProxy = { setTabIndex: (tabIndex) => { for (const tabGuard of tabGuards) { if (tabIndex == null) { tabGuard.removeAttribute("tabindex"); } else { tabGuard.setAttribute("tabindex", tabIndex); } } } }; this.addTabGuards(eTopGuard, eBottomGuard); const { focusTrapActive = false, onFocusIn, onFocusOut, focusInnerElement, handleKeyDown, onTabKeyDown, shouldStopEventPropagation, isEmpty, forceFocusOutWhenTabGuardsAreEmpty, isFocusableContainer } = params; this.tabGuardCtrl = this.createManagedBean( new AgTabGuardCtrl( { comp: compProxy, focusTrapActive, eTopGuard, eBottomGuard, eFocusableElement, onFocusIn, onFocusOut, focusInnerElement, handleKeyDown, onTabKeyDown, shouldStopEventPropagation, isEmpty, forceFocusOutWhenTabGuardsAreEmpty, isFocusableContainer }, stopPropagationCallbacks ) ); } getTabGuardCtrl() { return this.tabGuardCtrl; } createTabGuard(side) { const tabGuard = _getDocument(this.beans).createElement("div"); const cls = side === "top" ? TabGuardClassNames.TAB_GUARD_TOP : TabGuardClassNames.TAB_GUARD_BOTTOM; tabGuard.classList.add(TabGuardClassNames.TAB_GUARD, cls); _setAriaRole(tabGuard, "presentation"); return tabGuard; } addTabGuards(topTabGuard, bottomTabGuard) { const eFocusableElement = this.eFocusableElement; eFocusableElement.prepend(topTabGuard); eFocusableElement.append(bottomTabGuard); } removeAllChildrenExceptTabGuards() { const tabGuards = [this.eTopGuard, this.eBottomGuard]; _clearElement(this.comp.getFocusableElement()); this.addTabGuards(...tabGuards); } forceFocusOutOfContainer(up = false) { this.tabGuardCtrl.forceFocusOutOfContainer(up); } appendChild(appendChild, newChild, container) { if (!_isNodeOrElement(newChild)) { newChild = newChild.getGui(); } const { eBottomGuard: bottomTabGuard } = this; if (bottomTabGuard) { bottomTabGuard.before(newChild); } else { appendChild(newChild, container); } } destroy() { const { eTopGuard, eBottomGuard } = this; _removeFromParent(eTopGuard); _removeFromParent(eBottomGuard); super.destroy(); } }; var AgTabGuardComp = class extends AgComponentStub { initialiseTabGuard(params, stopPropagationCallbacks) { this.tabGuardFeature = this.createManagedBean(new AgTabGuardFeature(this, stopPropagationCallbacks)); this.tabGuardFeature.initialiseTabGuard(params); } forceFocusOutOfContainer(up = false) { this.tabGuardFeature.forceFocusOutOfContainer(up); } appendChild(newChild, container) { this.tabGuardFeature.appendChild(super.appendChild.bind(this), newChild, container); } }; var TabGuardComp = class extends AgTabGuardComp { initialiseTabGuard(params) { super.initialiseTabGuard(params, STOP_PROPAGATION_CALLBACKS); } }; var focusContainer = (comp, up) => { return _runWithContainerFocusAllowed(comp, () => _focusInto(comp.getGui(), up, false, true)); }; var getGridContainerName = (container) => { return container?.getFocusableContainerName() ?? "external"; }; var getDefaultTabToNextGridContainerTargetName = (target) => { if (target == null) { return "external"; } return typeof target === "string" ? target : "gridBody"; }; var GridCtrl = class extends BeanStub { constructor() { super(...arguments); this.additionalFocusableContainers = /* @__PURE__ */ new Set(); } setComp(view, eGridDiv, eGui) { this.view = view; this.eGridHostDiv = eGridDiv; this.eGui = eGui; this.eGui.setAttribute("grid-id", this.beans.context.getId()); const { dragAndDrop, ctrlsSvc } = this.beans; dragAndDrop?.registerGridDropTarget(() => this.eGui, this); this.createManagedBean(new LayoutFeature(this.view)); this.view.setRtlClass(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr"); const unsubscribeFromResize = _observeResize(this.beans, this.eGridHostDiv, this.onGridSizeChanged.bind(this)); this.addDestroyFunc(() => unsubscribeFromResize()); ctrlsSvc.register("gridCtrl", this); } isDetailGrid() { const el = _findTabbableParent(this.getGui()); return el?.getAttribute("row-id")?.startsWith("detail") || false; } getOptionalSelectors() { const beans = this.beans; return { paginationSelector: beans.pagination?.getPaginationSelector(), gridHeaderDropZonesSelector: beans.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"), sideBarSelector: beans.sideBar?.getSelector(), statusBarSelector: beans.registry?.getSelector("AG-STATUS-BAR"), watermarkSelector: beans.licenseManager?.getWatermarkSelector() }; } onGridSizeChanged() { this.eventSvc.dispatchEvent({ type: "gridSizeChanged", clientWidth: this.eGridHostDiv.clientWidth, clientHeight: this.eGridHostDiv.clientHeight }); } destroyGridUi() { this.view.destroyGridUi(); } getGui() { return this.eGui; } setResizeCursor(direction) { const { view } = this; if (direction === false) { view.setCursor(null); } else { view.setCursor(direction === 1 ? "ew-resize" : "ns-resize"); } } disableUserSelect(on) { this.view.setUserSelect(on ? "none" : null); } focusNextInnerContainer(backwards) { const focusableContainers = this.getFocusableContainers(); const { indexWithFocus, nextIndex } = this.getNextFocusableIndex(focusableContainers, backwards); const resolvedNextIndex = indexWithFocus === -1 ? backwards ? focusableContainers.length - 1 : 0 : nextIndex; const { gos, beans: { focusSvc, navigation } } = this; const userCallbackFunction = gos.getCallback("tabToNextGridContainer"); if (userCallbackFunction) { const defaultTarget = focusSvc.getDefaultTabToNextGridContainerTarget({ backwards, focusableContainers, nextIndex: resolvedNextIndex }); const nextContainerName = getGridContainerName(focusableContainers[resolvedNextIndex]); const nextContainer = defaultTarget == null && nextContainerName === "gridBody" ? "gridBody" : getDefaultTabToNextGridContainerTargetName(defaultTarget); const userResult = userCallbackFunction({ backwards, previousContainer: getGridContainerName(focusableContainers[indexWithFocus]), nextContainer, defaultTarget }); if (userResult !== void 0) { if (typeof userResult === "boolean") { return userResult; } if (typeof userResult === "string") { if (userResult === "gridBody") { return this.focusGridBodyDefault(backwards) || void 0; } const targetContainer = focusableContainers.find( (container) => container.getFocusableContainerName() === userResult ); if (!targetContainer) { _consoleWarn(`tabToNextGridContainer - ${userResult} container not found`); return void 0; } return focusContainer(targetContainer, backwards) ? true : void 0; } if (isHeaderPosition(userResult)) { return focusSvc.focusHeaderPosition({ headerPosition: userResult }) || void 0; } navigation?.ensureCellVisible(userResult); focusSvc.setFocusedCell({ ...userResult, forceBrowserFocus: true }); return focusSvc.isCellFocused(userResult) || void 0; } } return this.focusNextInnerContainerDefault({ backwards, focusableContainers, indexWithFocus, nextIndex: resolvedNextIndex }) || void 0; } focusInnerElement(fromBottom) { const { gos, beans, beans: { focusSvc, visibleCols } } = this; const userCallbackFunction = gos.getCallback("focusGridInnerElement"); if (userCallbackFunction?.({ fromBottom: !!fromBottom })) { return true; } const focusableContainers = this.getFocusableContainers(); if (fromBottom) { if (this.focusNextInnerContainerDefault({ backwards: true, focusableContainers, indexWithFocus: focusableContainers.length, nextIndex: focusableContainers.length - 1 })) { return true; } return focusSvc.focusGridView({ column: _last(visibleCols.allCols), backwards: true }); } const allColumns = visibleCols.allCols; if (gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(beans)) { if (focusSvc.focusGridView({ column: allColumns[0], backwards: fromBottom })) { return true; } for (let i = 1; i < focusableContainers.length; i++) { if (_focusInto(focusableContainers[i].getGui(), fromBottom)) { return true; } } return false; } return focusSvc.focusFirstHeader(); } forceFocusOutOfContainer(up = false) { this.view.forceFocusOutOfContainer(up); } isFocusInsideGridBody() { const focusableContainers = this.getFocusableContainers(); const { indexWithFocus } = this.getNextFocusableIndex(focusableContainers); return focusableContainers[indexWithFocus]?.getFocusableContainerName() === "gridBody"; } addFocusableContainer(container) { this.additionalFocusableContainers.add(container); } removeFocusableContainer(container) { this.additionalFocusableContainers.delete(container); } allowFocusForNextCoreContainer(up) { const coreContainers = this.view.getFocusableContainers(); const { indexWithFocus, nextIndex } = this.getNextFocusableIndex(coreContainers, up); if (!this.focusNextInnerContainerDefault({ backwards: !!up, focusableContainers: coreContainers, indexWithFocus, nextIndex })) { this.forceFocusOutOfContainer(up); } } isFocusable() { const beans = this.beans; return !_isCellFocusSuppressed(beans) || !_isHeaderFocusSuppressed(beans) || !!beans.sideBar?.comp?.isDisplayed(); } getNextFocusableIndex(focusableContainers, backwards) { const activeEl = _getActiveDomElement(this.beans); const indexWithFocus = focusableContainers.findIndex((container) => container.getGui().contains(activeEl)); return { indexWithFocus, nextIndex: indexWithFocus + (backwards ? -1 : 1) }; } focusGridBodyDefault(backwards) { const { gos, beans, beans: { focusSvc, visibleCols: { allCols } } } = this; if (backwards) { return focusSvc.focusGridView({ column: _last(allCols), backwards: true }); } if (gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(beans)) { return focusSvc.focusGridView({ column: allCols[0] }); } return focusSvc.focusFirstHeader(); } focusNextInnerContainerDefault(params) { const { backwards, focusableContainers, indexWithFocus } = params; const step = backwards ? -1 : 1; for (let index = params.nextIndex; index >= 0 && index < focusableContainers.length; index += step) { const container = focusableContainers[index]; const containerName = container.getFocusableContainerName(); if (containerName === "gridBody") { const enteringGridBody = indexWithFocus === -1 || (backwards ? indexWithFocus > index : indexWithFocus < index); if (enteringGridBody) { if (this.focusGridBodyDefault(backwards)) { return true; } continue; } } if (focusContainer(container, backwards)) { return true; } } return false; } getFocusableContainers() { return [...this.view.getFocusableContainers(), ...this.additionalFocusableContainers]; } destroy() { this.additionalFocusableContainers.clear(); super.destroy(); } }; var GridComp = class extends TabGuardComp { constructor(eGridDiv) { super(); this.gridBody = RefPlaceholder; this.gridHeaderDropZones = RefPlaceholder; this.sideBar = RefPlaceholder; this.statusBar = RefPlaceholder; this.pagination = RefPlaceholder; this.rootWrapperBody = RefPlaceholder; this.eGridDiv = eGridDiv; } postConstruct() { const compProxy = { destroyGridUi: () => this.destroyBean(this), setRtlClass: (cssClass) => this.addCss(cssClass), forceFocusOutOfContainer: this.forceFocusOutOfContainer.bind(this), updateLayoutClasses: this.updateLayoutClasses.bind(this), getFocusableContainers: this.getFocusableContainers.bind(this), setUserSelect: (value) => { this.getGui().style.userSelect = value != null ? value : ""; this.getGui().style.webkitUserSelect = value != null ? value : ""; }, setCursor: (value) => { this.getGui().style.cursor = value != null ? value : ""; } }; const ctrl = this.createManagedBean(new GridCtrl()); const comps = ctrl.getOptionalSelectors(); const template = this.createTemplate(comps); const requiredComps = [GridBodySelector, ...Object.values(comps).filter((c) => !!c)]; this.setTemplate(template, requiredComps); ctrl.setComp(compProxy, this.eGridDiv, this.getGui()); this.insertGridIntoDom(); this.initialiseTabGuard({ // we want to override the default behaviour to do nothing for onTabKeyDown onTabKeyDown: () => void 0, focusInnerElement: (fromBottom) => ctrl.focusInnerElement(fromBottom), forceFocusOutWhenTabGuardsAreEmpty: true, isEmpty: () => !ctrl.isFocusable() }); } insertGridIntoDom() { const eGui = this.getGui(); this.eGridDiv.appendChild(eGui); this.addDestroyFunc(() => { eGui.remove(); _logIfDebug(this.gos, "Grid removed from DOM"); }); } updateLayoutClasses(cssClass, params) { const eRootWrapperBodyClassList = this.rootWrapperBody.classList; const { AUTO_HEIGHT, NORMAL, PRINT } = LayoutCssClasses; const { autoHeight, normal, print } = params; eRootWrapperBodyClassList.toggle(AUTO_HEIGHT, autoHeight); eRootWrapperBodyClassList.toggle(NORMAL, normal); eRootWrapperBodyClassList.toggle(PRINT, print); this.toggleCss(AUTO_HEIGHT, autoHeight); this.toggleCss(NORMAL, normal); this.toggleCss(PRINT, print); } createTemplate(params) { const dropZones = params.gridHeaderDropZonesSelector ? { tag: "ag-grid-header-drop-zones", ref: "gridHeaderDropZones" } : null; const sideBar = params.sideBarSelector ? { tag: "ag-side-bar", ref: "sideBar" } : null; const statusBar = params.statusBarSelector ? { tag: "ag-status-bar", ref: "statusBar" } : null; const watermark = params.watermarkSelector ? { tag: "ag-watermark" } : null; const pagination = params.paginationSelector ? { tag: "ag-pagination", ref: "pagination" } : null; return { tag: "div", cls: "ag-root-wrapper", role: "presentation", children: [ dropZones, { tag: "div", ref: "rootWrapperBody", cls: "ag-root-wrapper-body", role: "presentation", children: [{ tag: "ag-grid-body", ref: "gridBody" }, sideBar] }, statusBar, pagination, watermark ] }; } getFocusableElement() { return this.rootWrapperBody; } forceFocusOutOfContainer(up = false) { if (!up && this.pagination?.isDisplayed()) { this.pagination.forceFocusOutOfContainer(up); return; } super.forceFocusOutOfContainer(up); } getFocusableContainers() { const focusableContainers = [ ...this.gridHeaderDropZones?.getFocusableContainers?.() ?? [], this.gridBody ]; for (const comp of [this.sideBar, this.statusBar, this.pagination]) { if (comp) { focusableContainers.push(comp); } } return focusableContainers.filter((el) => _isVisible(el.getGui())); } }; var mod = (moduleName4, input) => { for (const key of Object.keys(input)) { input[key] = moduleName4; } return input; }; var gridApiFunctionsMap = { dispatchEvent: "CommunityCore", // this is always registered ...mod("CommunityCore", { destroy: 0, getGridId: 0, getGridOption: 0, isDestroyed: 0, setGridOption: 0, updateGridOptions: 0, isModuleRegistered: 0 }), ...mod("GridState", { getState: 0, setState: 0 }), ...mod("SharedRowSelection", { setNodesSelected: 0, selectAll: 0, deselectAll: 0, selectAllFiltered: 0, deselectAllFiltered: 0, selectAllOnCurrentPage: 0, deselectAllOnCurrentPage: 0, getSelectedNodes: 0, getSelectedRows: 0 }), ...mod("RowApi", { redrawRows: 0, setRowNodeExpanded: 0, getRowNode: 0, addRenderedRowListener: 0, getRenderedNodes: 0, forEachNode: 0, getFirstDisplayedRowIndex: 0, getLastDisplayedRowIndex: 0, getDisplayedRowAtIndex: 0, getDisplayedRowCount: 0 }), ...mod("ScrollApi", { getVerticalPixelRange: 0, getHorizontalPixelRange: 0, ensureColumnVisible: 0, ensureIndexVisible: 0, ensureNodeVisible: 0 }), ...mod("KeyboardNavigation", { getFocusedCell: 0, clearFocusedCell: 0, setFocusedCell: 0, tabToNextCell: 0, tabToPreviousCell: 0, setFocusedHeader: 0 }), ...mod("EventApi", { addEventListener: 0, addGlobalListener: 0, removeEventListener: 0, removeGlobalListener: 0 }), ...mod("ValueCache", { expireValueCache: 0 }), ...mod("CellApi", { getCellValue: 0 }), ...mod("SharedMenu", { showColumnMenu: 0, hidePopupMenu: 0 }), ...mod("Sort", { onSortChanged: 0 }), ...mod("PinnedRow", { getPinnedTopRowCount: 0, getPinnedBottomRowCount: 0, getPinnedTopRow: 0, getPinnedBottomRow: 0, forEachPinnedRow: 0 }), ...mod("Overlay", { showLoadingOverlay: 0, showNoRowsOverlay: 0, hideOverlay: 0 }), ...mod("RenderApi", { setGridAriaProperty: 0, refreshCells: 0, refreshHeader: 0, isAnimationFrameQueueEmpty: 0, flushAllAnimationFrames: 0, getSizesForCurrentTheme: 0, getCellRendererInstances: 0 }), ...mod("HighlightChanges", { flashCells: 0 }), ...mod("RowDrag", { addRowDropZone: 0, removeRowDropZone: 0, getRowDropZoneParams: 0, getRowDropPositionIndicator: 0, setRowDropPositionIndicator: 0 }), ...mod("ColumnApi", { getColumnDefs: 0, getColumnDef: 0, getDisplayNameForColumn: 0, getColumn: 0, getColumns: 0, applyColumnState: 0, getColumnState: 0, resetColumnState: 0, isPinning: 0, isPinningLeft: 0, isPinningRight: 0, getDisplayedColAfter: 0, getDisplayedColBefore: 0, setColumnsVisible: 0, setColumnsPinned: 0, getAllGridColumns: 0, getDisplayedLeftColumns: 0, getDisplayedCenterColumns: 0, getDisplayedRightColumns: 0, getAllDisplayedColumns: 0, getAllDisplayedVirtualColumns: 0 }), ...mod("ColumnAutoSize", { sizeColumnsToFit: 0, autoSizeColumns: 0, autoSizeAllColumns: 0 }), ...mod("ColumnGroup", { setColumnGroupOpened: 0, getColumnGroup: 0, getProvidedColumnGroup: 0, getDisplayNameForColumnGroup: 0, getColumnGroupState: 0, setColumnGroupState: 0, resetColumnGroupState: 0, getLeftDisplayedColumnGroups: 0, getCenterDisplayedColumnGroups: 0, getRightDisplayedColumnGroups: 0, getAllDisplayedColumnGroups: 0 }), ...mod("ColumnMove", { moveColumnByIndex: 0, moveColumns: 0 }), ...mod("ColumnResize", { setColumnWidths: 0 }), ...mod("ColumnHover", { isColumnHovered: 0 }), ...mod("EditCore", { getCellEditorInstances: 0, getEditingCells: 0, getEditRowValues: 0, stopEditing: 0, startEditingCell: 0, isEditing: 0, validateEdit: 0 }), ...mod("BatchEdit", { startBatchEdit: 0, cancelBatchEdit: 0, commitBatchEdit: 0, isBatchEditing: 0 }), ...mod("UndoRedoEdit", { undoCellEditing: 0, redoCellEditing: 0, getCurrentUndoSize: 0, getCurrentRedoSize: 0 }), ...mod("FilterCore", { isAnyFilterPresent: 0, onFilterChanged: 0 }), ...mod("ColumnFilter", { isColumnFilterPresent: 0, getColumnFilterInstance: 0, destroyFilter: 0, setFilterModel: 0, getFilterModel: 0, getColumnFilterModel: 0, setColumnFilterModel: 0, showColumnFilter: 0, hideColumnFilter: 0, getColumnFilterHandler: 0, doFilterAction: 0 }), ...mod("QuickFilter", { isQuickFilterPresent: 0, getQuickFilter: 0, resetQuickFilter: 0 }), ...mod("Find", { findGetActiveMatch: 0, findGetTotalMatches: 0, findGoTo: 0, findNext: 0, findPrevious: 0, findGetNumMatches: 0, findGetParts: 0, findClearActive: 0, findRefresh: 0 }), ...mod("Pagination", { paginationIsLastPageFound: 0, paginationGetPageSize: 0, paginationGetCurrentPage: 0, paginationGetTotalPages: 0, paginationGetRowCount: 0, paginationGoToNextPage: 0, paginationGoToPreviousPage: 0, paginationGoToFirstPage: 0, paginationGoToLastPage: 0, paginationGoToPage: 0 }), ...mod("CsrmSsrmSharedApi", { expandAll: 0, collapseAll: 0, resetRowGroupExpansion: 0 }), ...mod("SsrmInfiniteSharedApi", { setRowCount: 0, getCacheBlockState: 0, isLastRowIndexKnown: 0 }), ...mod("ClientSideRowModelApi", { onGroupExpandedOrCollapsed: 0, refreshClientSideRowModel: 0, isRowDataEmpty: 0, forEachLeafNode: 0, forEachNodeAfterFilter: 0, forEachNodeAfterFilterAndSort: 0, applyTransaction: 0, applyTransactionAsync: 0, flushAsyncTransactions: 0, getBestCostNodeSelection: 0, onRowHeightChanged: 0, resetRowHeights: 0 }), ...mod("CsvExport", { getDataAsCsv: 0, exportDataAsCsv: 0 }), ...mod("InfiniteRowModel", { refreshInfiniteCache: 0, purgeInfiniteCache: 0, getInfiniteRowCount: 0 }), ...mod("AdvancedFilter", { getAdvancedFilterModel: 0, setAdvancedFilterModel: 0, showAdvancedFilterBuilder: 0, hideAdvancedFilterBuilder: 0 }), ...mod("IntegratedCharts", { getChartModels: 0, getChartRef: 0, getChartImageDataURL: 0, downloadChart: 0, openChartToolPanel: 0, closeChartToolPanel: 0, createRangeChart: 0, createPivotChart: 0, createCrossFilterChart: 0, updateChart: 0, restoreChart: 0 }), ...mod("Clipboard", { copyToClipboard: 0, cutToClipboard: 0, copySelectedRowsToClipboard: 0, copySelectedRangeToClipboard: 0, copySelectedRangeDown: 0, pasteFromClipboard: 0 }), ...mod("ExcelExport", { getDataAsExcel: 0, exportDataAsExcel: 0, getSheetDataForExcel: 0, getMultipleSheetsAsExcel: 0, exportMultipleSheetsAsExcel: 0 }), ...mod("SharedMasterDetail", { addDetailGridInfo: 0, removeDetailGridInfo: 0, getDetailGridInfo: 0, forEachDetailGridInfo: 0 }), ...mod("ContextMenu", { showContextMenu: 0 }), ...mod("ColumnMenu", { showColumnChooser: 0, hideColumnChooser: 0 }), ...mod("CellSelection", { getCellRanges: 0, addCellRange: 0, clearRangeSelection: 0, clearCellSelection: 0 }), ...mod("SharedRowGrouping", { setRowGroupColumns: 0, removeRowGroupColumns: 0, addRowGroupColumns: 0, getRowGroupColumns: 0, moveRowGroupColumn: 0 }), ...mod("SharedAggregation", { addAggFuncs: 0, clearAggFuncs: 0, setColumnAggFunc: 0 }), ...mod("SharedPivot", { isPivotMode: 0, getPivotResultColumn: 0, setValueColumns: 0, getValueColumns: 0, removeValueColumns: 0, addValueColumns: 0, setPivotColumns: 0, removePivotColumns: 0, addPivotColumns: 0, getPivotColumns: 0, setPivotResultColumns: 0, getPivotResultColumns: 0 }), ...mod("ServerSideRowModelApi", { getServerSideSelectionState: 0, setServerSideSelectionState: 0, applyServerSideTransaction: 0, applyServerSideTransactionAsync: 0, applyServerSideRowData: 0, retryServerSideLoads: 0, flushServerSideAsyncTransactions: 0, refreshServerSide: 0, getServerSideGroupLevelState: 0, onRowHeightChanged: 0, resetRowHeights: 0 }), ...mod("SideBar", { isSideBarVisible: 0, setSideBarVisible: 0, setSideBarPosition: 0, openToolPanel: 0, closeToolPanel: 0, getOpenedToolPanel: 0, refreshToolPanel: 0, isToolPanelShowing: 0, getToolPanelInstance: 0, getSideBar: 0 }), ...mod("StatusBar", { getStatusPanel: 0 }), ...mod("AiToolkit", { getStructuredSchema: 0 }) }; var defaultFns = { isDestroyed: () => true, destroy() { }, preConstruct() { }, postConstruct() { }, preWireBeans() { }, wireBeans() { } }; var dispatchEvent = (beans, event) => beans.eventSvc.dispatchEvent(event); var GridApiClass = class { }; Reflect.defineProperty(GridApiClass, "name", { value: "GridApi" }); var ApiFunctionService = class extends BeanStub { constructor() { super(); this.beanName = "apiFunctionSvc"; this.api = new GridApiClass(); this.fns = { ...defaultFns, // dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance dispatchEvent }; this.preDestroyLink = ""; const { api } = this; for (const key of Object.keys(gridApiFunctionsMap)) { api[key] = this.makeApi(key)[key]; } } postConstruct() { this.preDestroyLink = this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed"); } addFunction(functionName, func) { const { fns, beans } = this; if (fns !== defaultFns) { fns[functionName] = beans?.validation?.validateApiFunction(functionName, func) ?? func; } } makeApi(apiName) { return { [apiName]: (...args) => { const { beans, fns: { [apiName]: fn } } = this; return fn ? fn(beans, ...args) : this.apiNotFound(apiName); } }; } apiNotFound(fnName) { const { beans, gos, preDestroyLink } = this; if (!beans) { _warn(26, { fnName, preDestroyLink }); } else { const module2 = gridApiFunctionsMap[fnName]; if (gos.assertModuleRegistered(module2, `api.${fnName}`)) { _warn(27, { fnName, module: module2 }); } } } destroy() { super.destroy(); this.fns = defaultFns; this.beans = null; } }; function getGridId(beans) { return beans.context.getId(); } function destroy(beans) { beans.gridDestroySvc.destroy(); } function isDestroyed(beans) { return beans.gridDestroySvc.destroyCalled; } function getGridOption(beans, key) { return beans.gos.get(key); } function setGridOption(beans, key, value) { updateGridOptions(beans, { [key]: value }); } function updateGridOptions(beans, options) { beans.gos.updateGridOptions({ options }); } function isModuleRegistered(beans, moduleName4) { const withoutSuffix = moduleName4.replace(/Module$/, ""); return beans.gos.isModuleRegistered(withoutSuffix); } function _createIcon(iconName, beans, column) { const iconContents = _createIconNoSpan(iconName, beans, column); if (iconContents) { const { className } = iconContents; if (typeof className === "string" && className.includes("ag-icon") || typeof className === "object" && className["ag-icon"]) { return iconContents; } } const eResult = _createElement({ tag: "span" }); eResult.appendChild(iconContents); return eResult; } function _createIconNoSpan(iconName, beans, column) { let userProvidedIcon = null; if (iconName === "smallDown") { _warn(262); } else if (iconName === "smallLeft") { _warn(263); } else if (iconName === "smallRight") { _warn(264); } const icons2 = column?.getColDef().icons; if (icons2) { userProvidedIcon = icons2[iconName]; } if (beans.gos && !userProvidedIcon) { const optionsIcons = beans.gos.get("icons"); if (optionsIcons) { userProvidedIcon = optionsIcons[iconName]; } } if (userProvidedIcon) { let rendererResult; if (typeof userProvidedIcon === "function") { rendererResult = userProvidedIcon(); } else if (typeof userProvidedIcon === "string") { rendererResult = userProvidedIcon; } else { _warn(38, { iconName }); return void 0; } if (typeof rendererResult === "string") { return _loadTemplate(rendererResult); } if (_isNodeOrElement(rendererResult)) { return rendererResult; } _warn(133, { iconName }); return void 0; } else { const iconValue = beans.registry.getIcon(iconName); if (!iconValue) { beans.validation?.validateIcon(iconName); } return _createElement({ tag: "span", cls: `ag-icon ag-icon-${iconValue ?? iconName}`, role: "presentation", attrs: { unselectable: "on" } }); } } var DndSourceElement = { tag: "div", cls: "ag-drag-handle ag-row-drag", attrs: { draggable: "true" } }; var DndSourceComp = class extends Component { constructor(rowNode, column, eCell) { super(DndSourceElement); this.rowNode = rowNode; this.column = column; this.eCell = eCell; } postConstruct() { const eGui = this.getGui(); eGui.appendChild(_createIconNoSpan("rowDrag", this.beans, null)); this.addGuiEventListener("mousedown", (e) => { e.stopPropagation(); }); this.addDragSource(); this.checkVisibility(); } addDragSource() { this.addGuiEventListener("dragstart", this.onDragStart.bind(this)); } onDragStart(dragEvent) { const { rowNode, column, eCell, gos } = this; const providedOnRowDrag = column.getColDef().dndSourceOnRowDrag; const dataTransfer = dragEvent.dataTransfer; dataTransfer.setDragImage(eCell, 0, 0); if (providedOnRowDrag) { const params = _addGridCommonParams(gos, { rowNode, dragEvent }); providedOnRowDrag(params); } else { try { const jsonData = JSON.stringify(rowNode.data); dataTransfer.setData("application/json", jsonData); dataTransfer.setData("text/plain", jsonData); } catch (e) { } } } checkVisibility() { const visible = this.column.isDndSource(this.rowNode); this.setDisplayed(visible); } }; var dragAndDropImageComponent_default = ".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}"; var DragAndDropElement = { tag: "div", children: [ { tag: "div", ref: "eGhost", cls: "ag-dnd-ghost ag-unselectable", children: [ { tag: "span", ref: "eIcon", cls: "ag-dnd-ghost-icon ag-shake-left-to-right" }, { tag: "div", ref: "eLabel", cls: "ag-dnd-ghost-label" } ] } ] }; var DragAndDropImageComponent2 = class extends Component { constructor() { super(); this.dragSource = null; this.eIcon = RefPlaceholder; this.eLabel = RefPlaceholder; this.eGhost = RefPlaceholder; this.registerCSS(dragAndDropImageComponent_default); } postConstruct() { const create = (iconName) => _createIcon(iconName, this.beans, null); this.dropIconMap = { pinned: create("columnMovePin"), hide: create("columnMoveHide"), move: create("columnMoveMove"), left: create("columnMoveLeft"), right: create("columnMoveRight"), group: create("columnMoveGroup"), aggregate: create("columnMoveValue"), pivot: create("columnMovePivot"), notAllowed: create("dropNotAllowed") }; } init(params) { this.dragSource = params.dragSource; this.setTemplate(DragAndDropElement); this.beans.environment.applyThemeClasses(this.eGhost); } destroy() { this.dragSource = null; super.destroy(); } setIcon(iconName, shake) { const { eGhost, eIcon, dragSource, dropIconMap, gos } = this; _clearElement(eIcon); let eIconChild = null; if (!iconName) { iconName = dragSource?.getDefaultIconName ? dragSource.getDefaultIconName() : "notAllowed"; } eIconChild = dropIconMap[iconName]; eGhost.classList.toggle("ag-dnd-ghost-not-allowed", iconName === "notAllowed"); eIcon.classList.toggle("ag-shake-left-to-right", shake); if (eIconChild === dropIconMap["hide"] && gos.get("suppressDragLeaveHidesColumns")) { return; } if (eIconChild) { eIcon.appendChild(eIconChild); } } setLabel(label) { this.eLabel.textContent = label; } }; function addRowDropZone(beans, params) { beans.rowDragSvc?.rowDragFeature?.addRowDropZone(params); } function removeRowDropZone(beans, params) { const activeDropTarget = beans.dragAndDrop?.findExternalZone(params.getContainer()); if (activeDropTarget) { beans.dragAndDrop?.removeDropTarget(activeDropTarget); } } function getRowDropZoneParams(beans, events) { return beans.rowDragSvc?.rowDragFeature?.getRowDropZone(events); } function getRowDropPositionIndicator(beans) { const rowDropHighlightSvc = beans.rowDropHighlightSvc; return rowDropHighlightSvc ? { row: rowDropHighlightSvc.row, dropIndicatorPosition: rowDropHighlightSvc.position } : { row: null, dropIndicatorPosition: "none" }; } function setRowDropPositionIndicator(beans, params) { const rowDropHighlightSvc = beans.rowDropHighlightSvc; if (!rowDropHighlightSvc) { return; } const rowNode = params?.row; let position = params?.dropIndicatorPosition; if (position !== "above" && position !== "below" && position !== "inside") { position = "none"; } const rowIndex = rowNode?.rowIndex; if (rowIndex === null || rowIndex === void 0 || position === "none") { rowDropHighlightSvc.clear(); } else { rowDropHighlightSvc.set(rowNode, position); } } var tryPointerCapture = (eElement, pointerId) => { if (pointerId != null && eElement?.setPointerCapture) { try { eElement.setPointerCapture(pointerId); return eElement.hasPointerCapture(pointerId); } catch { } } return false; }; var capturePointer = (eElement, mouseEvent) => { if (typeof PointerEvent === "undefined" || !(mouseEvent instanceof PointerEvent)) { return null; } const pointerId = mouseEvent.pointerId; if (!tryPointerCapture(eElement, pointerId)) { return null; } const capture = { eElement, pointerId, onLost(pointerEvent) { pointerLostHandler(capture, pointerEvent); } }; eElement.addEventListener("lostpointercapture", capture.onLost); return capture; }; var releasePointerCapture = (capture) => { if (!capture) { return; } removeLostHandler(capture); const { eElement, pointerId } = capture; if (!eElement) { return; } try { eElement.releasePointerCapture(pointerId); } catch { } capture.eElement = null; }; var removeLostHandler = (capture) => { const { eElement, onLost } = capture; if (eElement && onLost) { eElement.removeEventListener("lostpointercapture", onLost); capture.onLost = null; } }; var pointerLostHandler = (capture, pointerEvent) => { removeLostHandler(capture); const { eElement, pointerId } = capture; if (eElement && pointerEvent.pointerId === pointerId) { tryPointerCapture(eElement, pointerId); } }; var activePointerDrags; var handledDragEvents; var PASSIVE_TRUE = { passive: true }; var PASSIVE_FALSE = { passive: false }; var addHandledDragEvent = (event) => { if (!handledDragEvents) { handledDragEvents = /* @__PURE__ */ new WeakSet(); } else if (handledDragEvents.has(event)) { return false; } handledDragEvents.add(event); return true; }; var BaseDragService = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "dragSvc"; this.dragging = false; this.drag = null; this.dragSources = []; } get startTarget() { return this.drag?.start.target ?? null; } /** True if there is at least one active pointer drag in any BaseDragService instance in the page */ isPointer() { return !!activePointerDrags?.has(_getRootNode(this.beans)); } hasPointerCapture() { const capture = this.drag?.pointerCapture; return !!(capture && this.beans.eRootDiv.hasPointerCapture?.(capture.pointerId)); } destroy() { if (this.drag) { this.cancelDrag(); } const dragSources = this.dragSources; for (const entry of dragSources) { destroyDragSourceEntry(entry); } dragSources.length = 0; super.destroy(); } removeDragSource(params) { const dragSources = this.dragSources; for (let i = 0, len = dragSources.length; i < len; ++i) { const entry = dragSources[i]; if (entry.params === params) { dragSources.splice(i, 1); destroyDragSourceEntry(entry); break; } } } addDragSource(params) { if (!this.isAlive()) { return; } const { eElement, includeTouch } = params; const handlers = []; let oldTouchAction; if (includeTouch) { const style = eElement.style; if (style) { oldTouchAction = style.touchAction; style.touchAction = "none"; } } const dragSource = { handlers, params, oldTouchAction }; this.dragSources.push(dragSource); const pointerDownListener = (event) => this.onPointerDown(params, event); const mouseListener = (event) => this.onMouseDown(params, event); addTempEventHandlers( handlers, [eElement, "pointerdown", pointerDownListener, PASSIVE_FALSE], [eElement, "mousedown", mouseListener] ); const suppressTouch = this.gos.get("suppressTouch"); if (includeTouch && !suppressTouch) { const touchListener = (touchEvent) => this.onTouchStart(params, touchEvent); addTempEventHandlers(handlers, [eElement, "touchstart", touchListener, PASSIVE_FALSE]); } } cancelDrag(eElement) { const drag = this.drag; eElement ?? (eElement = drag?.eElement); if (eElement) { this.eventSvc.dispatchEvent({ type: "dragCancelled", target: eElement }); } drag?.params.onDragCancel?.(); this.destroyDrag(); } shouldPreventMouseEvent(mouseEvent) { const type = mouseEvent.type; const isMouseMove = type === "mousemove" || type === "pointermove"; return isMouseMove && mouseEvent.cancelable && _isEventFromThisInstance(this.beans, mouseEvent) && !_isFocusableFormField(getEventTargetElement(mouseEvent)); } initDrag(drag, ...handlers) { this.drag = drag; const beans = this.beans; const onScroll = (event) => this.onScroll(event); const keydownEvent = (ev) => this.onKeyDown(ev); const rootEl = _getRootNode(beans); const eDocument = _getDocument(beans); addTempEventHandlers( drag.handlers, [rootEl, "contextmenu", preventEventDefault], [rootEl, "keydown", keydownEvent], [eDocument, "scroll", onScroll, { capture: true }], [eDocument.defaultView || window, "scroll", onScroll], ...handlers ); } destroyDrag() { this.dragging = false; const drag = this.drag; if (drag) { const rootEl = drag.rootEl; if (activePointerDrags?.get(rootEl) === drag) { activePointerDrags.delete(rootEl); } this.drag = null; releasePointerCapture(drag.pointerCapture); clearTempEventHandlers(drag.handlers); } } // Pointer Events path (preferred when supported) onPointerDown(params, pointerEvent) { if (this.isPointer()) { return; } const beans = this.beans; if (handledDragEvents?.has(pointerEvent)) { return; } const pointerType = pointerEvent.pointerType; if (pointerType === "touch") { if (beans.gos.get("suppressTouch") || !params.includeTouch) { return; } if (params.stopPropagationForTouch) { pointerEvent.stopPropagation(); } if (_isFocusableFormField(getEventTargetElement(pointerEvent))) { return; } } if (!pointerEvent.isPrimary) { return; } if (pointerType === "mouse" && pointerEvent.button !== 0) { return; } this.destroyDrag(); const rootEl = _getRootNode(beans); const eElement = params.eElement; const pointerId = pointerEvent.pointerId; const pointerDrag = new Dragging(rootEl, params, pointerEvent, pointerId); activePointerDrags ?? (activePointerDrags = /* @__PURE__ */ new WeakMap()); activePointerDrags.set(rootEl, pointerDrag); const onPointerMove = (ev) => { if (ev.pointerId === pointerId) { this.onMouseOrPointerMove(ev); } }; const onUp = (ev) => { if (ev.pointerId === pointerId) { this.onMouseOrPointerUp(ev); } }; const onCancel = (ev) => { if (ev.pointerId === pointerId && addHandledDragEvent(ev)) { this.cancelDrag(); } }; const dragPreventEventDefault = (e) => this.draggingPreventDefault(e); this.initDrag( pointerDrag, [rootEl, "pointerup", onUp], [rootEl, "pointercancel", onCancel], [rootEl, "pointermove", onPointerMove, PASSIVE_FALSE], [rootEl, "touchmove", dragPreventEventDefault, PASSIVE_FALSE], [eElement, "mousemove", dragPreventEventDefault, PASSIVE_FALSE] ); if (params.dragStartPixels === 0) { this.onMouseOrPointerMove(pointerEvent); } else { addHandledDragEvent(pointerEvent); } } // gets called whenever mouse down on any drag source onTouchStart(params, touchEvent) { const suppressTouch = this.gos.get("suppressTouch"); if (suppressTouch || !params.includeTouch) { return; } if (!addHandledDragEvent(touchEvent)) { return; } if (_isFocusableFormField(getEventTargetElement(touchEvent))) { return; } if (params.stopPropagationForTouch) { touchEvent.stopPropagation(); } if (this.isPointer()) { if (this.dragging) { preventEventDefault(touchEvent); } return; } this.destroyDrag(); const beans = this.beans; const rootEl = _getRootNode(beans); const touchDrag = new Dragging(rootEl, params, touchEvent.touches[0]); const touchMoveEvent = (e) => this.onTouchMove(e); const touchEndEvent = (e) => this.onTouchUp(e); const touchCancelEvent = (e) => this.onTouchCancel(e); const dragPreventEventDefault = (e) => this.draggingPreventDefault(e); const rootNode = _getRootNode(beans); const target = touchEvent.target ?? params.eElement; this.initDrag( touchDrag, [target, "touchmove", touchMoveEvent, PASSIVE_TRUE], [target, "touchend", touchEndEvent, PASSIVE_TRUE], [target, "touchcancel", touchCancelEvent, PASSIVE_TRUE], [rootNode, "touchmove", dragPreventEventDefault, PASSIVE_FALSE], [rootNode, "touchend", touchEndEvent, PASSIVE_FALSE], [rootNode, "touchcancel", touchCancelEvent, PASSIVE_FALSE] ); if (params.dragStartPixels === 0) { this.onMove(touchDrag.start); } } /** preventEventDefault on the event while dragging only and if the event is cancellable */ draggingPreventDefault(e) { if (this.dragging) { preventEventDefault(e); } } // gets called whenever mouse down on any drag source onMouseDown(params, mouseEvent) { if (mouseEvent.button !== 0) { return; } if (handledDragEvents?.has(mouseEvent)) { return; } if (this.isPointer()) { return; } const beans = this.beans; this.destroyDrag(); const mouseDrag = new Dragging(_getRootNode(beans), params, mouseEvent); const mouseMoveEvent = (event) => this.onMouseOrPointerMove(event); const mouseUpEvent = (event) => this.onMouseOrPointerUp(event); const target = _getRootNode(beans); this.initDrag(mouseDrag, [target, "mousemove", mouseMoveEvent], [target, "mouseup", mouseUpEvent]); if (params.dragStartPixels === 0) { this.onMouseOrPointerMove(mouseEvent); } else { addHandledDragEvent(mouseEvent); } } onScroll(event) { if (!addHandledDragEvent(event)) { return; } const drag = this.drag; const lastDrag = drag?.lastDrag; if (lastDrag && this.dragging) { drag.params?.onDragging?.(lastDrag); } } /** only gets called after a mouse down - as this is only added after mouseDown and is removed when mouseUp happens */ onMouseOrPointerMove(mouseEvent) { if (!addHandledDragEvent(mouseEvent)) { return; } if (_isBrowserSafari()) { _getDocument(this.beans).getSelection()?.removeAllRanges(); } if (this.shouldPreventMouseEvent(mouseEvent)) { preventEventDefault(mouseEvent); } this.onMove(mouseEvent); } onTouchCancel(touchEvent) { const drag = this.drag; if (!drag || !addHandledDragEvent(touchEvent)) { return; } if (!_getFirstActiveTouch(drag.start, touchEvent.changedTouches)) { return; } this.cancelDrag(); } onTouchMove(touchEvent) { const drag = this.drag; if (!drag || !addHandledDragEvent(touchEvent)) { return; } const touch = _getFirstActiveTouch(drag.start, touchEvent.touches); if (touch) { this.onMove(touch); this.draggingPreventDefault(touchEvent); } } onMove(currentEvent) { const drag = this.drag; if (!drag) { return; } drag.lastDrag = currentEvent; const dragSource = drag.params; if (!this.dragging) { const start = drag.start; const dragStartPixels = dragSource.dragStartPixels; const requiredPixelDiff = dragStartPixels ?? 4; if (_areEventsNear(currentEvent, start, requiredPixelDiff)) { return; } this.dragging = true; if (dragSource.capturePointer) { drag.pointerCapture = capturePointer(this.beans.eRootDiv, currentEvent); } this.eventSvc.dispatchEvent({ type: "dragStarted", target: dragSource.eElement }); dragSource.onDragStart?.(start); if (this.drag !== drag) { return; } dragSource.onDragging?.(start); if (this.drag !== drag) { return; } } dragSource.onDragging?.(currentEvent); } onTouchUp(touchEvent) { const drag = this.drag; if (drag && addHandledDragEvent(touchEvent)) { this.onUp(_getFirstActiveTouch(drag.start, touchEvent.changedTouches)); } } onMouseOrPointerUp(mouseEvent) { if (addHandledDragEvent(mouseEvent)) { this.onUp(mouseEvent); } } onUp(eventOrTouch) { const drag = this.drag; if (!drag) { return; } if (!eventOrTouch) { eventOrTouch = drag.lastDrag; } if (eventOrTouch && this.dragging) { this.dragging = false; drag.params.onDragStop?.(eventOrTouch); this.eventSvc.dispatchEvent({ type: "dragStopped", target: drag.params.eElement }); } this.destroyDrag(); } // shared keydown handler to cancel current drag with ESC onKeyDown(event) { if (event.key === KeyCode.ESCAPE) { this.cancelDrag(); } } }; var destroyDragSourceEntry = (dragSource) => { clearTempEventHandlers(dragSource.handlers); const oldTouchAction = dragSource.oldTouchAction; if (oldTouchAction != null) { const style = dragSource.params.eElement.style; if (style) { style.touchAction = oldTouchAction; } } }; var Dragging = class { constructor(rootEl, params, start, pointerId = null) { this.rootEl = rootEl; this.params = params; this.start = start; this.pointerId = pointerId; this.handlers = []; this.lastDrag = null; this.pointerCapture = null; this.eElement = params.eElement; } }; var getEventTargetElement = (event) => { const target = event.target; return target instanceof Element ? target : null; }; var DragService = class extends BaseDragService { shouldPreventMouseEvent(mouseEvent) { const isEnableCellTextSelect = this.gos.get("enableCellTextSelection"); return isEnableCellTextSelect && super.shouldPreventMouseEvent(mouseEvent); } }; var HorizontalResizeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "horizontalResizeSvc"; } addResizeBar(params) { const dragSource = { dragStartPixels: params.dragStartPixels || 0, eElement: params.eResizeBar, onDragStart: this.onDragStart.bind(this, params), onDragStop: this.onDragStop.bind(this, params), onDragging: this.onDragging.bind(this, params), onDragCancel: this.onDragStop.bind(this, params), includeTouch: true, stopPropagationForTouch: true }; const { dragSvc } = this.beans; dragSvc.addDragSource(dragSource); const finishedWithResizeFunc = () => dragSvc.removeDragSource(dragSource); return finishedWithResizeFunc; } onDragStart(params, mouseEvent) { this.dragStartX = mouseEvent.clientX; this.setResizeIcons(); const shiftKey = mouseEvent instanceof MouseEvent && mouseEvent.shiftKey === true; params.onResizeStart(shiftKey); } setResizeIcons() { const ctrl = this.beans.ctrlsSvc.get("gridCtrl"); ctrl.setResizeCursor( 1 /* Horizontal */ ); ctrl.disableUserSelect(true); } onDragStop(params) { params.onResizeEnd(this.resizeAmount); this.resetIcons(); } resetIcons() { const ctrl = this.beans.ctrlsSvc.get("gridCtrl"); ctrl.setResizeCursor(false); ctrl.disableUserSelect(false); } onDragging(params, mouseEvent) { this.resizeAmount = mouseEvent.clientX - this.dragStartX; params.onResizing(this.resizeAmount); } }; var RowDragElement = { tag: "div", cls: "ag-drag-handle ag-row-drag", attrs: { "aria-hidden": "true" } }; var SKIP_ARIA_HIDDEN = { skipAriaHidden: true }; var RowDragComp = class extends Component { constructor(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible = false) { super(); this.cellValueFn = cellValueFn; this.rowNode = rowNode; this.column = column; this.customGui = customGui; this.dragStartPixels = dragStartPixels; this.alwaysVisible = alwaysVisible; this.dragSource = null; this.disabled = false; } isCustomGui() { return this.customGui != null; } postConstruct() { const { beans, customGui } = this; if (customGui) { this.setDragElement(customGui, this.dragStartPixels); } else { this.setTemplate(RowDragElement); this.getGui().appendChild(_createIconNoSpan("rowDrag", beans, null)); this.addDragSource(); } if (!this.alwaysVisible) { this.initCellDrag(); } } initCellDrag() { const { beans, rowNode } = this; const refreshVisibility = this.refreshVisibility.bind(this); this.addManagedListeners(beans.eventSvc, { rowDragVisibilityChanged: refreshVisibility }); this.addManagedListeners(rowNode, { dataChanged: refreshVisibility, cellChanged: refreshVisibility }); this.refreshVisibility(); } setDragElement(dragElement, dragStartPixels) { this.setTemplateFromElement(dragElement, void 0, void 0, true); this.addDragSource(dragStartPixels); } refreshVisibility() { if (this.alwaysVisible) { return; } const { beans, column, rowNode } = this; const { gos, dragAndDrop, rowDragSvc } = beans; const visibility = rowDragSvc?.visibility; const hide = visibility === "suppress" || visibility === "hidden" && !dragAndDrop?.hasExternalDropZones(); let displayed = !hide; let visible = displayed; if (displayed && !this.isCustomGui() && column) { const rowDragProp = column.getColDef().rowDrag; if (rowDragProp === false) { displayed = false; } else { const shownSometimes = typeof rowDragProp === "function"; visible = column.isRowDrag(rowNode); displayed = shownSometimes || visible; } } if (displayed && visible && rowNode.footer && gos.get("rowDragManaged")) { visible = false; displayed = true; } visible && (visible = displayed); if (!displayed) { this.setDisplayed(displayed, SKIP_ARIA_HIDDEN); } if (!visible) { this.setVisible(visible, SKIP_ARIA_HIDDEN); } this.setDisabled(!visible || visibility === "disabled" && !dragAndDrop?.hasExternalDropZones()); if (displayed) { this.setDisplayed(displayed, SKIP_ARIA_HIDDEN); } if (visible) { this.setVisible(visible, SKIP_ARIA_HIDDEN); } } setDisabled(disabled) { if (disabled !== this.disabled) { this.disabled = disabled; this.getGui()?.classList?.toggle("ag-drag-handle-disabled", disabled); } } getSelectedNodes() { const rowNode = this.rowNode; const isRowDragMultiRow = this.gos.get("rowDragMultiRow"); if (!isRowDragMultiRow) { return [rowNode]; } const selection = this.beans.selectionSvc?.getSelectedNodes() ?? []; return selection.indexOf(rowNode) !== -1 ? selection : [rowNode]; } getDragItem() { const { column, rowNode } = this; return { rowNode, rowNodes: this.getSelectedNodes(), columns: column ? [column] : void 0, defaultTextValue: this.cellValueFn() }; } addDragSource(dragStartPixels = 4) { if (this.dragSource) { this.removeDragSource(); } if (this.gos.get("rowDragManaged") && this.rowNode.footer) { return; } const eGui = this.getGui(); if (this.gos.get("enableCellTextSelection")) { this.removeMouseDownListener(); const listeners = _isEventSupported("pointerdown") ? { pointerdown: preventEventDefault } : { mousedown: preventEventDefault }; this.mouseDownListener = this.addManagedElementListeners(eGui, listeners)[0]; } const translate = this.getLocaleTextFunc(); this.dragSource = { type: 2, eElement: eGui, dragItemName: (draggingEvent) => this.getDragItemName(draggingEvent, translate), getDragItem: () => this.getDragItem(), dragStartPixels, dragSourceDomDataKey: this.gos.getDomDataKey() }; this.beans.dragAndDrop.addDragSource(this.dragSource, true); } getDragItemName(draggingEvent, translate) { const dragItem = draggingEvent?.dragItem || this.getDragItem(); const dragItemCount = (draggingEvent?.dropTarget?.rows.length ?? dragItem.rowNodes?.length) || 1; const rowDragTextGetter = this.column?.getColDef()?.rowDragText ?? this.gos.get("rowDragText"); if (rowDragTextGetter) { return rowDragTextGetter(dragItem, dragItemCount); } if (dragItemCount !== 1) { return `${dragItemCount} ${translate("rowDragRows", "rows")}`; } const value = this.cellValueFn(); if (value) { return value; } return `1 ${translate("rowDragRow", "rows")}`; } destroy() { this.removeDragSource(); this.removeMouseDownListener(); super.destroy(); } removeDragSource() { if (!this.dragSource) { return; } this.beans.dragAndDrop.removeDragSource(this.dragSource); this.dragSource = null; } removeMouseDownListener() { if (!this.mouseDownListener) { return; } this.mouseDownListener(); this.mouseDownListener = void 0; } }; var AutoScrollService = class { constructor(params) { this.tickingInterval = null; this.onScrollCallback = null; this.scrollContainer = params.scrollContainer; this.scrollHorizontally = params.scrollAxis.includes("x"); this.scrollVertically = params.scrollAxis.includes("y"); this.scrollByTick = params.scrollByTick ?? 20; if (params.onScrollCallback) { this.onScrollCallback = params.onScrollCallback; } if (this.scrollVertically) { this.getVerticalPosition = params.getVerticalPosition; this.setVerticalPosition = params.setVerticalPosition; } if (this.scrollHorizontally) { this.getHorizontalPosition = params.getHorizontalPosition; this.setHorizontalPosition = params.setHorizontalPosition; } this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (() => false); this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (() => false); } /** True while auto-scrolling */ get scrolling() { return this.tickingInterval !== null; } check(mouseEvent, forceSkipVerticalScroll = false) { const skipVerticalScroll = !this.scrollVertically || forceSkipVerticalScroll || this.shouldSkipVerticalScroll(); const skipHorizontalScroll = !this.scrollHorizontally || this.shouldSkipHorizontalScroll(); if (skipVerticalScroll && skipHorizontalScroll) { return; } const rect = this.scrollContainer.getBoundingClientRect(); const scrollTick = this.scrollByTick; this.tickLeft = !skipHorizontalScroll && mouseEvent.clientX < rect.left + scrollTick; this.tickRight = !skipHorizontalScroll && mouseEvent.clientX > rect.right - scrollTick; this.tickUp = !skipVerticalScroll && mouseEvent.clientY < rect.top + scrollTick; this.tickDown = !skipVerticalScroll && mouseEvent.clientY > rect.bottom - scrollTick; if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) { this.ensureTickingStarted(); } else { this.ensureCleared(); } } ensureTickingStarted() { if (this.tickingInterval === null) { this.tickingInterval = window.setInterval(this.doTick.bind(this), 100); this.tickCount = 0; } } doTick() { this.tickCount++; const tickAmount = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40; if (this.scrollVertically) { const vScrollPosition = this.getVerticalPosition(); if (this.tickUp) { this.setVerticalPosition(vScrollPosition - tickAmount); } if (this.tickDown) { this.setVerticalPosition(vScrollPosition + tickAmount); } } if (this.scrollHorizontally) { const hScrollPosition = this.getHorizontalPosition(); if (this.tickLeft) { this.setHorizontalPosition(hScrollPosition - tickAmount); } if (this.tickRight) { this.setHorizontalPosition(hScrollPosition + tickAmount); } } if (this.onScrollCallback) { this.onScrollCallback(); } } ensureCleared() { if (this.tickingInterval) { window.clearInterval(this.tickingInterval); this.tickingInterval = null; } } }; var ChangedRowNodes = class { constructor() { this.reordered = false; this.removals = []; this.updates = /* @__PURE__ */ new Set(); this.adds = /* @__PURE__ */ new Set(); } }; var _csrmFirstLeaf = (node) => { let childrenAfterGroup = node.childrenAfterGroup; while (childrenAfterGroup?.length) { const child = childrenAfterGroup[0]; if (child.sourceRowIndex >= 0) { return child; } childrenAfterGroup = child.childrenAfterGroup; } }; var _csrmReorderAllLeafs = (allLeafs, leafsToMove, target, above) => { if (!leafsToMove.size || !allLeafs) { return false; } let orderChanged = false; const allLeafsLen = allLeafs.length ?? 0; let targetPositionIdx = -1; if (target) { targetPositionIdx = target.sourceRowIndex; target = targetPositionIdx < 0 ? _csrmFirstLeaf(target) : null; if (target) { targetPositionIdx = target.sourceRowIndex; } } if (targetPositionIdx < 0 || targetPositionIdx >= allLeafsLen) { targetPositionIdx = allLeafsLen; } else if (!above) { ++targetPositionIdx; } let firstAffectedLeafIdx = targetPositionIdx; let lastAffectedLeafIndex = Math.min(targetPositionIdx, allLeafsLen - 1); for (const row of leafsToMove) { const sourceRowIndex = row.sourceRowIndex; if (sourceRowIndex < firstAffectedLeafIdx) { firstAffectedLeafIdx = sourceRowIndex; } if (sourceRowIndex > lastAffectedLeafIndex) { lastAffectedLeafIndex = sourceRowIndex; } } let writeIdxLeft = firstAffectedLeafIdx; for (let readIdx = firstAffectedLeafIdx; readIdx < targetPositionIdx; ++readIdx) { const row = allLeafs[readIdx]; if (leafsToMove.has(row)) { continue; } if (row.sourceRowIndex !== writeIdxLeft) { row.sourceRowIndex = writeIdxLeft; allLeafs[writeIdxLeft] = row; orderChanged = true; } ++writeIdxLeft; } let writeIdxRight = lastAffectedLeafIndex; for (let readIdx = lastAffectedLeafIndex; readIdx >= targetPositionIdx; --readIdx) { const row = allLeafs[readIdx]; if (leafsToMove.has(row)) { continue; } if (row.sourceRowIndex !== writeIdxRight) { row.sourceRowIndex = writeIdxRight; allLeafs[writeIdxRight] = row; orderChanged = true; } --writeIdxRight; } for (const row of leafsToMove) { if (row.sourceRowIndex !== writeIdxLeft) { row.sourceRowIndex = writeIdxLeft; allLeafs[writeIdxLeft] = row; orderChanged = true; } ++writeIdxLeft; } return orderChanged; }; function _getCellPositionForEvent(gos, event) { return _getCellCtrlForEventTarget(gos, event.target)?.getFocusedCellPosition() ?? null; } function _getNormalisedMousePosition(beans, event) { const gridPanelHasScrolls = _isDomLayout(beans.gos, "normal"); const e = event; let x; let y; if (e.clientX != null || e.clientY != null) { x = e.clientX; y = e.clientY; } else { x = e.x; y = e.y; } const { pageFirstPixel } = beans.pageBounds.getCurrentPagePixelRange(); y += pageFirstPixel; if (gridPanelHasScrolls) { const scrollFeature = beans.ctrlsSvc.getScrollFeature(); const vRange = scrollFeature.getVScrollPosition(); const hRange = scrollFeature.getHScrollPosition(); x += hRange.left; y += vRange.top; } return { x, y }; } var POINTER_INSIDE_THRESHOLD = 0.25; var RowDragFeature = class extends BeanStub { constructor(eContainer) { super(); this.eContainer = eContainer; this.lastDraggingEvent = null; this.autoScroll = null; this.autoScrollChanged = false; this.autoScrollChanging = false; this.autoScrollOldV = null; } postConstruct() { const beans = this.beans; beans.ctrlsSvc.whenReady(this, (p) => { const getScrollY = () => p.gridBodyCtrl.scrollFeature.getVScrollPosition().top; const autoScroll = new AutoScrollService({ scrollContainer: p.gridBodyCtrl.eBodyViewport, scrollAxis: "y", getVerticalPosition: getScrollY, setVerticalPosition: (position) => p.gridBodyCtrl.scrollFeature.setVerticalScrollPosition(position), onScrollCallback: () => { const newVScroll = getScrollY(); if (this.autoScrollOldV !== newVScroll) { this.autoScrollOldV = newVScroll; this.autoScrollChanging = true; return; } const changed = this.autoScrollChanging; this.autoScrollChanged = changed; this.autoScrollChanging = false; if (changed) { beans.dragAndDrop?.nudge(); this.autoScrollChanged = false; } } }); this.autoScroll = autoScroll; this.clearAutoScroll(); }); } destroy() { super.destroy(); this.clearAutoScroll(); this.autoScroll = null; this.lastDraggingEvent = null; this.eContainer = null; } getContainer() { return this.eContainer; } isInterestedIn(type) { return type === 2; } getIconName(draggingEvent) { if (draggingEvent?.dropTarget?.allowed === false) { return "notAllowed"; } if (this.beans.rowDragSvc.visibility !== "visible") { return "notAllowed"; } return "move"; } getRowNodes(draggingEvent) { if (!this.isFromThisGrid(draggingEvent)) { return draggingEvent.dragItem.rowNodes || []; } const currentNode = draggingEvent.dragItem.rowNode; if (this.gos.get("rowDragMultiRow")) { const selectedNodes = this.beans.selectionSvc?.getSelectedNodes(); if (selectedNodes && selectedNodes.indexOf(currentNode) >= 0) { return selectedNodes.slice().sort(compareRowIndex); } } return [currentNode]; } onDragEnter(draggingEvent) { this.dragging(draggingEvent, true); } onDragging(draggingEvent) { this.dragging(draggingEvent, false); } dragging(draggingEvent, enter) { const { lastDraggingEvent, beans } = this; if (enter) { const rowNodes = this.getRowNodes(draggingEvent); draggingEvent.dragItem.rowNodes = rowNodes; setRowNodesDragging(rowNodes, true); } this.lastDraggingEvent = draggingEvent; const fromNudge = draggingEvent.fromNudge; const rowsDrop = this.makeRowsDrop(lastDraggingEvent, draggingEvent, fromNudge, false); beans.rowDropHighlightSvc?.fromDrag(draggingEvent); if (enter) { this.dispatchGridEvent("rowDragEnter", draggingEvent); } this.dispatchGridEvent("rowDragMove", draggingEvent); const autoScroll = this.autoScroll; if (rowsDrop?.rowDragManaged && rowsDrop.moved && rowsDrop.allowed && rowsDrop.sameGrid && !rowsDrop.suppressMoveWhenRowDragging && // Avoid flickering by only dropping while auto-scrolling is not happening (!fromNudge && !autoScroll?.scrolling || this.autoScrollChanged)) { this.dropRows(rowsDrop); } autoScroll?.check(draggingEvent.event); } isFromThisGrid(draggingEvent) { return draggingEvent.dragSource.dragSourceDomDataKey === this.gos.getDomDataKey(); } makeRowsDrop(lastDraggingEvent, draggingEvent, fromNudge, dropping) { const { beans, gos } = this; const rowsDrop = this.newRowsDrop(draggingEvent, dropping); const rowModel = beans.rowModel; draggingEvent.dropTarget = rowsDrop; draggingEvent.changed = false; if (!rowsDrop) { return null; } let { sameGrid, rootNode, source, target } = rowsDrop; target ?? (target = rowModel.getRow(rowModel.getRowCount() - 1) ?? null); const groupEditSvc = this.beans.groupEditSvc; const canSetParent = !!groupEditSvc?.canSetParent(rowsDrop); let newParent = null; if (target?.footer) { const found = _prevOrNextDisplayedRow(rowModel, -1, target) ?? _prevOrNextDisplayedRow(rowModel, 1, target); if (canSetParent) { newParent = target.sibling ?? rootNode; } target = found ?? null; } if (target?.detail) { target = target.parent; } rowsDrop.moved && (rowsDrop.moved = source !== target); let yDelta = 0.5; if (target) { if (sameGrid && rowsDrop.moved && (newParent || !canSetParent)) { yDelta = source.rowIndex > target.rowIndex ? -0.5 : 0.5; } else { yDelta = (rowsDrop.y - target.rowTop - target.rowHeight / 2) / target.rowHeight || 0; } } if (!canSetParent && sameGrid && target && rowsDrop.moved && _isClientSideRowModel(gos)) { const newTarget = deltaDraggingTarget(rowModel, rowsDrop); if (newTarget) { yDelta = source.rowIndex > newTarget.rowIndex ? -0.5 : 0.5; target = newTarget; rowsDrop.moved && (rowsDrop.moved = source !== target); } } rowsDrop.target = target; rowsDrop.newParent = newParent; rowsDrop.pointerPos = computePointerPos(target, rowsDrop.y); rowsDrop.yDelta = yDelta; groupEditSvc?.fixRowsDrop(rowsDrop, canSetParent, fromNudge, yDelta); this.validateRowsDrop(rowsDrop, canSetParent, dropping); draggingEvent.changed || (draggingEvent.changed = rowsDropChanged(lastDraggingEvent?.dropTarget, rowsDrop)); return rowsDrop; } newRowsDrop(draggingEvent, dropping) { const { beans, gos } = this; const rootNode = beans.rowModel.rootNode; const rowDragManaged = _isClientSideRowModel(gos) ? gos.get("rowDragManaged") : false; const suppressMoveWhenRowDragging = gos.get("suppressMoveWhenRowDragging"); const sameGrid = this.isFromThisGrid(draggingEvent); let { rowNode: source, rowNodes: rows } = draggingEvent.dragItem; rows || (rows = source ? [source] : []); source || (source = rows[0]); if (!source || !rootNode) { return null; } const withinGrid = this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent); let allowed = true; if (rowDragManaged && (!rows.length || beans.rowDragSvc.visibility !== "visible" || (suppressMoveWhenRowDragging || !sameGrid) && !withinGrid)) { allowed = false; } const y = _getNormalisedMousePosition(beans, draggingEvent).y; const overNode = this.getOverNode(y); return { api: beans.gridApi, context: beans.gridOptions.context, draggingEvent, rowDragManaged, suppressMoveWhenRowDragging, sameGrid, withinGrid, treeData: false, rootNode, moved: source !== overNode, y, overNode, overIndex: overNode?.rowIndex ?? -1, pointerPos: "none", position: "none", source, target: overNode ?? null, newParent: null, rows, allowed, highlight: !dropping && rowDragManaged && suppressMoveWhenRowDragging && (withinGrid || !sameGrid), yDelta: 0, inside: false, droppedManaged: false }; } validateRowsDrop(rowsDrop, canSetParent, dropping) { const { source, target, yDelta, inside, moved, rowDragManaged, suppressMoveWhenRowDragging } = rowsDrop; rowsDrop.moved && (rowsDrop.moved = source !== target); const { position, fallbackPosition } = this.computeDropPosition(moved, inside, yDelta); rowsDrop.position = position; if (!canSetParent) { rowsDrop.newParent = null; } this.enforceSuppressMoveWhenRowDragging(rowsDrop, suppressMoveWhenRowDragging, "initial"); const isRowValidDropPosition = (!rowDragManaged || rowsDrop.allowed) && this.gos.get("isRowValidDropPosition"); if (isRowValidDropPosition) { this.applyDropValidator(rowsDrop, canSetParent, dropping, rowDragManaged, isRowValidDropPosition); } if (rowDragManaged) { rowsDrop.rows = this.filterRows(rowsDrop); } this.beans.groupEditSvc?.clearNewSameParent(rowsDrop, canSetParent); this.enforceSuppressMoveWhenRowDragging(rowsDrop, suppressMoveWhenRowDragging, "final"); if (rowsDrop.position === "inside" && (!rowsDrop.allowed || !rowsDrop.newParent)) { rowsDrop.position = fallbackPosition; } } computeDropPosition(moved, inside, yDelta) { const fallbackPosition = yDelta < 0 ? "above" : "below"; if (!moved) { return { position: "none", fallbackPosition }; } return { position: inside ? "inside" : fallbackPosition, fallbackPosition }; } enforceSuppressMoveWhenRowDragging(rowsDrop, suppress, stage) { if (!suppress) { return; } if (stage === "initial") { if (!rowsDrop.moved) { rowsDrop.allowed = false; } return; } if (!rowsDrop.rows.length || rowsDrop.position === "none") { rowsDrop.allowed = false; } } applyDropValidator(rowsDrop, canSetParent, dropping, rowDragManaged, validator) { this.beans.groupEditSvc?.clearNewSameParent(rowsDrop, canSetParent); const result = validator(rowsDrop); if (!result) { rowsDrop.allowed = false; return; } if (typeof result !== "object") { return; } if (result.rows !== void 0) { rowsDrop.rows = result.rows ?? []; } if (canSetParent && result.newParent !== void 0) { rowsDrop.newParent = result.newParent; } if (result.target !== void 0) { rowsDrop.target = result.target; } if (result.position) { rowsDrop.position = result.position; } if (result.allowed !== void 0) { rowsDrop.allowed = result.allowed; } else if (!rowDragManaged) { rowsDrop.allowed = true; } const draggingEvent = rowsDrop.draggingEvent; if (result.changed && draggingEvent) { draggingEvent.changed = true; } if (!dropping && result.highlight !== void 0) { rowsDrop.highlight = result.highlight; } } addRowDropZone(params) { if (!params.getContainer()) { _warn(55); return; } const dragAndDrop = this.beans.dragAndDrop; if (dragAndDrop.findExternalZone(params.getContainer())) { _warn(56); return; } const processedParams = params.fromGrid ? params : { getContainer: params.getContainer, onDragEnter: params.onDragEnter && ((e) => params.onDragEnter(this.rowDragEvent("rowDragEnter", e))), onDragLeave: params.onDragLeave && ((e) => params.onDragLeave(this.rowDragEvent("rowDragLeave", e))), onDragging: params.onDragging && ((e) => params.onDragging(this.rowDragEvent("rowDragMove", e))), onDragStop: params.onDragStop && ((e) => params.onDragStop(this.rowDragEvent("rowDragEnd", e))), onDragCancel: params.onDragCancel && ((e) => params.onDragCancel(this.rowDragEvent("rowDragCancel", e))) }; const dropTarget = { isInterestedIn: (type) => type === 2, getIconName: () => "move", external: true, ...processedParams }; dragAndDrop.addDropTarget(dropTarget); this.addDestroyFunc(() => dragAndDrop.removeDropTarget(dropTarget)); } getRowDropZone(events) { const result = { getContainer: this.getContainer.bind(this), onDragEnter: (e) => { this.onDragEnter(e); events?.onDragEnter?.(this.rowDragEvent("rowDragEnter", e)); }, onDragLeave: (e) => { this.onDragLeave(e); events?.onDragLeave?.(this.rowDragEvent("rowDragLeave", e)); }, onDragging: (e) => { this.onDragging(e); events?.onDragging?.(this.rowDragEvent("rowDragMove", e)); }, onDragStop: (e) => { this.onDragStop(e); events?.onDragStop?.(this.rowDragEvent("rowDragEnd", e)); }, onDragCancel: (e) => { this.onDragCancel(e); events?.onDragCancel?.(this.rowDragEvent("rowDragCancel", e)); }, fromGrid: true }; return result; } getOverNode(y) { const { pageBounds, rowModel } = this.beans; const mouseIsPastLastRow = y > pageBounds.getCurrentPagePixelRange().pageLastPixel; const overIndex = mouseIsPastLastRow ? -1 : rowModel.getRowIndexAtPixel(y); return overIndex >= 0 ? rowModel.getRow(overIndex) : void 0; } rowDragEvent(type, draggingEvent) { const beans = this.beans; const { dragItem, dropTarget: rowsDrop, event, vDirection } = draggingEvent; const withRowsDrop = rowsDrop?.rootNode === beans.rowModel.rootNode; const y = withRowsDrop ? rowsDrop.y : _getNormalisedMousePosition(beans, draggingEvent).y; const overNode = withRowsDrop ? rowsDrop.overNode : this.getOverNode(y); const overIndex = withRowsDrop ? rowsDrop.overIndex : overNode?.rowIndex ?? -1; return { api: beans.gridApi, context: beans.gridOptions.context, type, event, node: dragItem.rowNode, nodes: dragItem.rowNodes, overIndex, overNode, y, vDirection, rowsDrop }; } dispatchGridEvent(type, draggingEvent) { const event = this.rowDragEvent(type, draggingEvent); this.eventSvc.dispatchEvent(event); } onDragLeave(draggingEvent) { this.dispatchGridEvent("rowDragLeave", draggingEvent); this.stopDragging(draggingEvent, false); } onDragStop(draggingEvent) { const previousRowsDrop = this.lastDraggingEvent?.dropTarget ?? null; const rowsDrop = this.makeRowsDrop(this.lastDraggingEvent, draggingEvent, false, true); this.dispatchGridEvent("rowDragEnd", draggingEvent); if (rowsDrop?.allowed && rowsDrop.rowDragManaged && (!previousRowsDrop?.droppedManaged || rowsDropChanged(previousRowsDrop, rowsDrop))) { this.dropRows(rowsDrop); } this.stopDragging(draggingEvent, true); } onDragCancel(draggingEvent) { this.dispatchGridEvent("rowDragCancel", draggingEvent); this.stopDragging(draggingEvent, true); } stopDragging(draggingEvent, final) { this.clearAutoScroll(); this.beans.groupEditSvc?.stopDragging(final); this.beans.rowDropHighlightSvc?.fromDrag(null); setRowNodesDragging(draggingEvent.dragItem.rowNodes, false); this.lastDraggingEvent = null; } clearAutoScroll() { this.autoScroll?.ensureCleared(); this.autoScrollChanged = false; this.autoScrollChanging = false; this.autoScrollOldV = null; } /** Drag and drop. Returns false if at least a row was moved, otherwise true */ dropRows(rowsDrop) { rowsDrop.droppedManaged = true; return rowsDrop.sameGrid ? this.csrmMoveRows(rowsDrop) : this.csrmAddRows(rowsDrop); } csrmAddRows({ position, target, rows }) { const getRowIdFunc = _getRowIdCallback(this.gos); const clientSideRowModel = this.beans.rowModel; const add = rows.filter( ({ data, rowPinned }) => !clientSideRowModel.getRowNode(getRowIdFunc?.({ data, level: 0, rowPinned }) ?? data.id) ).map(({ data }) => data); if (add.length === 0) { return false; } let addIndex; if (target) { const leaf = target.sourceRowIndex >= 0 ? target : _csrmFirstLeaf(target); if (leaf) { addIndex = leaf.sourceRowIndex + (position === "above" ? 0 : 1); } } clientSideRowModel.updateRowData({ add, addIndex }); return true; } filterRows(rowsDrop) { const { groupEditSvc } = this.beans; const { rows, sameGrid } = rowsDrop; let filtered; for (let i = 0, len = rows.length; i < len; ++i) { let valid = true; const row = rows[i]; if (!row || row.footer || sameGrid && row.destroyed && !row.group || !this.csrmGetLeaf(row)) { valid = false; } if (valid && groupEditSvc && !groupEditSvc.canDropRow(row, rowsDrop)) { valid = false; } if (valid) { filtered?.push(row); } else { filtered ?? (filtered = rows.slice(0, i)); } } return filtered ?? rows; } csrmMoveRows(rowsDrop) { const groupEditSvc = this.beans.groupEditSvc; if (groupEditSvc?.isGroupingDrop(rowsDrop)) { return groupEditSvc.dropGroupEdit(rowsDrop); } return this.csrmMoveRowsReorder(rowsDrop); } csrmMoveRowsReorder({ position, target, rows, newParent, rootNode }) { let changed = false; const leafs = /* @__PURE__ */ new Set(); for (const row of rows) { if (newParent && row.parent !== newParent) { row.treeParent = newParent; changed = true; } const leafRow = this.csrmGetLeaf(row); if (leafRow) { leafs.add(leafRow); } } if (!changed && leafs.size === 0) { return false; } const focusSvc = this.beans.focusSvc; const cellPosition = focusSvc.getFocusedCell(); const cellCtrl = cellPosition && _getCellByPosition(this.beans, cellPosition); if (leafs.size && _csrmReorderAllLeafs(rootNode._leafs, leafs, target, position === "above")) { changed = true; } if (!changed) { return false; } const clientSideRowModel = this.beans.rowModel; const changedRowNodes = new ChangedRowNodes(); changedRowNodes.reordered = true; clientSideRowModel.refreshModel({ step: "group", keepRenderedRows: true, animate: !this.gos.get("suppressAnimationFrame"), changedRowNodes }); if (cellCtrl) { cellCtrl.focusCell(); } else { focusSvc.clearFocusedCell(); } return true; } csrmGetLeaf(row) { if (row.sourceRowIndex >= 0) { return row.destroyed ? void 0 : row; } const groupEditSvc = this.beans.groupEditSvc; if (groupEditSvc) { return groupEditSvc.csrmFirstLeaf(row); } return _csrmFirstLeaf(row); } }; var rowsDropChanged = (a, b) => a !== b && (!a || a.sameGrid !== b.sameGrid || a.allowed !== b.allowed || a.position !== b.position || a.target !== b.target || a.source !== b.source || a.newParent !== b.newParent || !_areEqual(a.rows, b.rows)); var compareRowIndex = ({ rowIndex: a }, { rowIndex: b }) => a !== null && b !== null ? a - b : 0; var setRowNodesDragging = (rowNodes, dragging) => { for (let i = 0, len = rowNodes?.length || 0; i < len; ++i) { const rowNode = rowNodes[i]; if (rowNode.dragging !== dragging) { rowNode.dragging = dragging; rowNode.dispatchRowEvent("draggingChanged"); } } }; var deltaDraggingTarget = (rowModel, rowsDrop) => { let bestTarget = null; let current = rowsDrop.target; if (current && rowsDrop.rows.indexOf(current) < 0) { return null; } const source = rowsDrop.source; if (!current || !source) { return null; } let count = current.rowIndex - source.rowIndex; const increment = count < 0 ? -1 : 1; count = rowsDrop.suppressMoveWhenRowDragging ? Math.abs(count) : 1; const rowsSet = new Set(rowsDrop.rows); do { const candidate = _prevOrNextDisplayedRow(rowModel, increment, current); if (!candidate) { break; } if (!rowsSet.has(candidate)) { bestTarget = candidate; --count; } current = candidate; } while (count > 0); return bestTarget; }; var computePointerPos = (overNode, pointerY) => { const rowTop = overNode?.rowTop; const rowHeight = overNode?.rowHeight ?? 0; if (rowTop == null || !rowHeight || rowHeight <= 0) { return "none"; } const offset = pointerY - rowTop; const thresholdPx = rowHeight * POINTER_INSIDE_THRESHOLD; if (offset <= thresholdPx) { return "above"; } if (offset >= rowHeight - thresholdPx) { return "below"; } return "inside"; }; var RowDragService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowDragSvc"; this.rowDragFeature = null; this.visibility = "suppress"; } setupRowDrag(element, ctrl) { const rowDragFeature = ctrl.createManagedBean(new RowDragFeature(element)); const dragAndDrop = this.beans.dragAndDrop; dragAndDrop.addDropTarget(rowDragFeature); ctrl.addDestroyFunc(() => dragAndDrop.removeDropTarget(rowDragFeature)); this.rowDragFeature = rowDragFeature; const refreshVisibility = () => this.refreshVisibility(); this.addManagedPropertyListeners( ["rowDragManaged", "suppressRowDrag", "refreshAfterGroupEdit"], refreshVisibility ); this.addManagedEventListeners({ newColumnsLoaded: refreshVisibility, columnRowGroupChanged: refreshVisibility, columnPivotModeChanged: refreshVisibility, sortChanged: refreshVisibility, filterChanged: refreshVisibility }); this.visibility = this.computeVisibility(); } createRowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible) { return new RowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, alwaysVisible); } createRowDragCompForRow(rowNode, element) { if (_isCellSelectionEnabled(this.gos)) { return void 0; } const translate = this.getLocaleTextFunc(); return this.createRowDragComp( () => `1 ${translate("rowDragRow", "row")}`, rowNode, void 0, element, void 0, true ); } createRowDragCompForCell(rowNode, column, cellValueFn, element, dragStartPixels, alwaysVisible) { const gos = this.gos; if (gos.get("rowDragManaged")) { if (!_isClientSideRowModel(gos) || gos.get("pagination")) { return void 0; } } const rowDragComp = this.createRowDragComp( cellValueFn, rowNode, column, element, dragStartPixels, alwaysVisible ); return rowDragComp; } cancelRowDrag() { if (this.rowDragFeature?.lastDraggingEvent) { this.beans.dragSvc?.cancelDrag(); } } computeVisibility() { const beans = this.beans; const gos = beans.gos; if (gos.get("suppressRowDrag")) { return "suppress"; } const rowDragManaged = gos.get("rowDragManaged"); if (!rowDragManaged) { return "visible"; } const pivoting = beans.colModel.isPivotMode(); if ((pivoting || beans.rowGroupColsSvc?.columns?.length) && !gos.get("refreshAfterGroupEdit")) { return "hidden"; } if (pivoting) { return "disabled"; } if (beans.filterManager?.isAnyFilterPresent()) { return "disabled"; } if (beans.sortSvc?.isSortActive()) { return "disabled"; } return "visible"; } refreshVisibility() { const previousVisibility = this.visibility; const newVisibility = this.computeVisibility(); if (previousVisibility !== newVisibility) { this.visibility = newVisibility; this.eventSvc?.dispatchEvent({ type: "rowDragVisibilityChanged" }); } } }; var RowDropHighlightService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowDropHighlightSvc"; this.uiLevel = 0; this.dragging = false; this.row = null; this.position = "none"; } postConstruct() { this.addManagedEventListeners({ modelUpdated: this.onModelUpdated.bind(this) }); } onModelUpdated() { const row = this.row; const oldDragging = this.dragging; if (!row || row?.rowIndex === null || this.position === "none") { this.clear(); } else { this.set(row, this.position); } this.dragging = oldDragging; } destroy() { this.clear(); super.destroy(); } clear() { const last = this.row; this.dragging = false; if (last) { this.uiLevel = 0; this.position = "none"; this.row = null; last.dispatchRowEvent("rowHighlightChanged"); } } set(row, dropIndicatorPosition) { const nodeChanged = row !== this.row; const uiLevel = row.uiLevel; const highlightChanged = dropIndicatorPosition !== this.position; const uiLevelChanged = uiLevel !== this.uiLevel; this.dragging = false; if (nodeChanged || highlightChanged || uiLevelChanged) { if (nodeChanged) { this.clear(); } this.uiLevel = uiLevel; this.position = dropIndicatorPosition; this.row = row; row.dispatchRowEvent("rowHighlightChanged"); } } fromDrag(draggingEvent) { const rowsDrop = draggingEvent?.dropTarget; if (rowsDrop) { const { highlight, target, position } = rowsDrop; if (highlight && target && position !== "none") { this.set(target, position); this.dragging = true; return; } } if (this.dragging) { this.clear(); } } }; var DragModule = { moduleName: "Drag", version: VERSION, beans: [DragService] }; var DragAndDropModule = { moduleName: "DragAndDrop", version: VERSION, dynamicBeans: { dndSourceComp: DndSourceComp }, icons: { // drag handle used to pick up draggable rows rowDrag: "grip" } }; var SharedDragAndDropModule = { moduleName: "SharedDragAndDrop", version: VERSION, beans: [DragAndDropService], dependsOn: [DragModule], userComponents: { agDragAndDropImage: DragAndDropImageComponent2 }, icons: { // shown on drag and drop image component icon while dragging column to the side of the grid to pin columnMovePin: "pin", // shown on drag and drop image component icon while dragging over part of the page that is not a drop zone columnMoveHide: "eye-slash", // shown on drag and drop image component icon while dragging columns to reorder columnMoveMove: "arrows", // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling columnMoveLeft: "left", // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling columnMoveRight: "right", // shown on drag and drop image component icon while dragging over Row Groups drop zone columnMoveGroup: "group", // shown on drag and drop image component icon while dragging over Values drop zone columnMoveValue: "aggregation", // shown on drag and drop image component icon while dragging over pivot drop zone columnMovePivot: "pivot", // shown on drag and drop image component icon while dragging over drop zone that doesn't support it, e.g. // string column over aggregation drop zone dropNotAllowed: "not-allowed", // drag handle used to pick up draggable rows rowDrag: "grip" } }; var RowDragModule = { moduleName: "RowDrag", version: VERSION, beans: [RowDropHighlightService, RowDragService], apiFunctions: { addRowDropZone, removeRowDropZone, getRowDropZoneParams, getRowDropPositionIndicator, setRowDropPositionIndicator }, dependsOn: [SharedDragAndDropModule] }; var HorizontalResizeModule = { moduleName: "HorizontalResize", version: VERSION, beans: [HorizontalResizeService], dependsOn: [DragModule] }; var column_moving_default = ":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}"; var ColumnAnimationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colAnimation"; this.executeNextFuncs = []; this.executeLaterFuncs = []; this.active = false; this.activeNext = false; this.suppressAnimation = false; this.animationThreadCount = 0; } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => this.gridBodyCtrl = p.gridBodyCtrl); } isActive() { return this.active && !this.suppressAnimation; } setSuppressAnimation(suppress) { this.suppressAnimation = suppress; } start() { if (this.active) { return; } const { gos } = this; if (gos.get("suppressColumnMoveAnimation")) { return; } if (gos.get("enableRtl")) { return; } this.ensureAnimationCssClassPresent(); this.active = true; this.activeNext = true; } finish() { if (!this.active) { return; } this.flush( () => this.activeNext = false, () => this.active = false ); } executeNextVMTurn(func) { if (this.activeNext) { this.executeNextFuncs.push(func); } else { func(); } } executeLaterVMTurn(func) { if (this.active) { this.executeLaterFuncs.push(func); } else { func(); } } ensureAnimationCssClassPresent() { this.animationThreadCount++; const animationThreadCountCopy = this.animationThreadCount; const { gridBodyCtrl } = this; gridBodyCtrl.setColumnMovingCss(true); this.executeLaterFuncs.push(() => { if (this.animationThreadCount === animationThreadCountCopy) { gridBodyCtrl.setColumnMovingCss(false); } }); } flush(callbackNext, callbackLater) { const { executeNextFuncs, executeLaterFuncs } = this; if (executeNextFuncs.length === 0 && executeLaterFuncs.length === 0) { callbackNext(); callbackLater(); return; } const runFuncs = (queue) => { while (queue.length) { const func = queue.pop(); if (func) { func(); } } }; this.beans.frameworkOverrides.wrapIncoming(() => { window.setTimeout(() => { callbackNext(); runFuncs(executeNextFuncs); }, 0); window.setTimeout(() => { callbackLater(); runFuncs(executeLaterFuncs); }, 200); }); } }; function moveColumnByIndex(beans, fromIndex, toIndex) { beans.colMoves?.moveColumnByIndex(fromIndex, toIndex, "api"); } function moveColumns(beans, columnsToMoveKeys, toIndex) { beans.colMoves?.moveColumns(columnsToMoveKeys, toIndex, "api"); } var BodyDropPivotTarget = class extends BeanStub { constructor(pinned) { super(); this.pinned = pinned; this.columnsToAggregate = []; this.columnsToGroup = []; this.columnsToPivot = []; } /** Callback for when drag enters */ onDragEnter(draggingEvent) { this.clearColumnsList(); if (this.gos.get("functionsReadOnly")) { return; } const dragColumns = draggingEvent.dragItem.columns; if (!dragColumns) { return; } for (const column of dragColumns) { if (!column.isPrimary()) { continue; } if (column.isAnyFunctionActive()) { continue; } if (column.isAllowValue()) { this.columnsToAggregate.push(column); } else if (column.isAllowRowGroup()) { this.columnsToGroup.push(column); } else if (column.isAllowPivot()) { this.columnsToPivot.push(column); } } } getIconName() { const totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length; if (totalColumns > 0) { return this.pinned ? "pinned" : "move"; } return null; } /** Callback for when drag leaves */ // eslint-disable-next-line @typescript-eslint/no-unused-vars onDragLeave(draggingEvent) { this.clearColumnsList(); } clearColumnsList() { this.columnsToAggregate.length = 0; this.columnsToGroup.length = 0; this.columnsToPivot.length = 0; } /** Callback for when dragging */ // eslint-disable-next-line @typescript-eslint/no-unused-vars onDragging(draggingEvent) { } /** Callback for when drag stops */ // eslint-disable-next-line @typescript-eslint/no-unused-vars onDragStop(draggingEvent) { const { valueColsSvc, rowGroupColsSvc, pivotColsSvc } = this.beans; if (this.columnsToAggregate.length > 0) { valueColsSvc?.addColumns(this.columnsToAggregate, "toolPanelDragAndDrop"); } if (this.columnsToGroup.length > 0) { rowGroupColsSvc?.addColumns(this.columnsToGroup, "toolPanelDragAndDrop"); } if (this.columnsToPivot.length > 0) { pivotColsSvc?.addColumns(this.columnsToPivot, "toolPanelDragAndDrop"); } } onDragCancel() { this.clearColumnsList(); } }; function sortColsLikeCols(colsList, cols) { if (!cols || cols.length <= 1) { return; } const notAllColsPresent = cols.filter((c) => colsList.indexOf(c) < 0).length > 0; if (notAllColsPresent) { return; } cols.sort((a, b) => { const indexA = colsList.indexOf(a); const indexB = colsList.indexOf(b); return indexA - indexB; }); } function getColsToMove(allMovingColumns) { const newCols = [...allMovingColumns]; for (const col of allMovingColumns) { let movingGroup = null; let parent = col.getParent(); while (parent != null && parent.getDisplayedLeafColumns().length === 1) { movingGroup = parent; parent = parent.getParent(); } if (movingGroup != null) { const isMarryChildren = !!movingGroup.getColGroupDef()?.marryChildren; const columnsToMove = isMarryChildren ? ( // when marry children is true, we also have to move hidden // columns within the group, so grab them from the `providedColumnGroup` movingGroup.getProvidedColumnGroup().getLeafColumns() ) : movingGroup.getLeafColumns(); for (const newCol of columnsToMove) { if (!newCols.includes(newCol)) { newCols.push(newCol); } } } } return newCols; } function getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols) { const displayedCols = visibleCols.allCols; let lowestFragMove = null; let targetOrder = null; for (let i = 0; i < validMoves.length; i++) { const move = validMoves[i]; const order = colMoves.getProposedColumnOrder(allMovingColumnsOrdered, move); if (!colMoves.doesOrderPassRules(order)) { continue; } const displayedOrder = order.filter((col) => displayedCols.includes(col)); if (targetOrder === null) { targetOrder = displayedOrder; } else if (!_areEqual(displayedOrder, targetOrder)) { break; } const fragCount = groupFragCount(order); if (lowestFragMove === null || fragCount < lowestFragMove.fragCount) { lowestFragMove = { move, fragCount }; } } return lowestFragMove; } function getBestColumnMoveIndexFromXPosition(params) { const { isFromHeader, fromLeft, xPosition, fromEnter, fakeEvent, pinned, gos, colModel, colMoves, visibleCols } = params; let { allMovingColumns } = params; if (isFromHeader) { allMovingColumns = getColsToMove(allMovingColumns); } const allMovingColumnsOrdered = allMovingColumns.slice(); sortColsLikeCols(colModel.getCols(), allMovingColumnsOrdered); const validMoves = calculateValidMoves({ movingCols: allMovingColumnsOrdered, draggingRight: fromLeft, xPosition, pinned, gos, colModel, visibleCols }); const oldIndex = calculateOldIndex(allMovingColumnsOrdered, colModel); if (validMoves.length === 0) { return; } const firstValidMove = validMoves[0]; const constrainDirection = oldIndex !== null && (isFromHeader || !fromEnter); if (constrainDirection && !fakeEvent) { if (!fromLeft && firstValidMove >= oldIndex) { return; } if (fromLeft && firstValidMove <= oldIndex) { return; } } const lowestFragMove = getLowestFragMove(validMoves, allMovingColumnsOrdered, colMoves, visibleCols); if (!lowestFragMove) { return; } const toIndex = lowestFragMove.move; if (toIndex > colModel.getCols().length - allMovingColumnsOrdered.length) { return; } return { columns: allMovingColumnsOrdered, toIndex }; } function attemptMoveColumns(params) { const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(params) || {}; const { finished, colMoves } = params; if (!columns || toIndex == null) { return null; } colMoves.moveColumns(columns, toIndex, "uiColumnMoved", finished); return finished ? null : { columns, toIndex }; } function calculateOldIndex(movingCols, colModel) { const gridCols = colModel.getCols(); const indexes = movingCols.map((col) => gridCols.indexOf(col)).sort((a, b) => a - b); const firstIndex = indexes[0]; const lastIndex = _last(indexes); const spread = lastIndex - firstIndex; const gapsExist = spread !== indexes.length - 1; return gapsExist ? null : firstIndex; } function groupFragCount(columns) { function parents(col) { const result = []; let parent = col.getOriginalParent(); while (parent != null) { result.push(parent); parent = parent.getOriginalParent(); } return result; } let count = 0; for (let i = 0; i < columns.length - 1; i++) { let a = parents(columns[i]); let b = parents(columns[i + 1]); [a, b] = a.length > b.length ? [a, b] : [b, a]; for (const parent of a) { if (b.indexOf(parent) === -1) { count++; } } } return count; } function getDisplayedColumns(visibleCols, type) { switch (type) { case "left": return visibleCols.leftCols; case "right": return visibleCols.rightCols; default: return visibleCols.centerCols; } } function calculateValidMoves(params) { const { movingCols, draggingRight, xPosition, pinned, gos, colModel, visibleCols } = params; const isMoveBlocked2 = gos.get("suppressMovableColumns") || movingCols.some((col) => col.getColDef().suppressMovable); if (isMoveBlocked2) { return []; } const allDisplayedCols = getDisplayedColumns(visibleCols, pinned); const allGridCols = colModel.getCols(); const movingDisplayedCols = allDisplayedCols.filter((col) => movingCols.includes(col)); const otherDisplayedCols = allDisplayedCols.filter((col) => !movingCols.includes(col)); const otherGridCols = allGridCols.filter((col) => !movingCols.includes(col)); let displayIndex = 0; let availableWidth = xPosition; if (draggingRight) { let widthOfMovingDisplayedCols = 0; for (const col of movingDisplayedCols) { widthOfMovingDisplayedCols += col.getActualWidth(); } availableWidth -= widthOfMovingDisplayedCols; } if (availableWidth > 0) { for (let i = 0; i < otherDisplayedCols.length; i++) { const col = otherDisplayedCols[i]; availableWidth -= col.getActualWidth(); if (availableWidth < 0) { break; } displayIndex++; } if (draggingRight) { displayIndex++; } } let firstValidMove; if (displayIndex > 0) { const leftColumn = otherDisplayedCols[displayIndex - 1]; firstValidMove = otherGridCols.indexOf(leftColumn) + 1; } else { firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]); if (firstValidMove === -1) { firstValidMove = 0; } } const validMoves = [firstValidMove]; const numberComparator = (a, b) => a - b; if (draggingRight) { let pointer = firstValidMove + 1; const lastIndex = allGridCols.length - 1; while (pointer <= lastIndex) { validMoves.push(pointer); pointer++; } validMoves.sort(numberComparator); } else { let pointer = firstValidMove; const lastIndex = allGridCols.length - 1; let displacedCol = allGridCols[pointer]; while (pointer <= lastIndex && allDisplayedCols.indexOf(displacedCol) < 0) { pointer++; validMoves.push(pointer); displacedCol = allGridCols[pointer]; } pointer = firstValidMove - 1; const firstDisplayIndex = 0; while (pointer >= firstDisplayIndex) { validMoves.push(pointer); pointer--; } validMoves.sort(numberComparator).reverse(); } return validMoves; } function normaliseX(params) { const { pinned, fromKeyboard, gos, ctrlsSvc, useHeaderRow, skipScrollPadding } = params; let eViewport = ctrlsSvc.getHeaderRowContainerCtrl(pinned)?.eViewport; let { x } = params; if (!eViewport) { return 0; } if (fromKeyboard) { x -= eViewport.getBoundingClientRect().left; } if (gos.get("enableRtl")) { if (useHeaderRow) { eViewport = eViewport.querySelector(".ag-header-row"); } x = eViewport.clientWidth - x; } if (pinned == null && !skipScrollPadding) { x += ctrlsSvc.get("center").getCenterViewportScrollLeft(); } return x; } function setColumnsMoving(columns, isMoving) { for (const column of columns) { column.moving = isMoving; column.dispatchColEvent("movingChanged", "uiColumnMoved"); } } var MOVE_FAIL_THRESHOLD = 7; var SCROLL_MOVE_WIDTH = 100; var SCROLL_GAP_NEEDED_BEFORE_MOVE = SCROLL_MOVE_WIDTH / 2; var SCROLL_ACCELERATION_RATE = 5; var SCROLL_TIME_INTERVAL = 100; var MoveColumnFeature = class extends BeanStub { constructor(pinned) { super(); this.pinned = pinned; this.needToMoveLeft = false; this.needToMoveRight = false; this.lastMovedInfo = null; this.isCenterContainer = !_exists(pinned); } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCon = p.gridBodyCtrl; }); } getIconName() { const { pinned, lastDraggingEvent } = this; const { dragItem } = lastDraggingEvent || {}; const columns = dragItem?.columns ?? []; for (const col of columns) { const colPinned = col.getPinned(); if (col.getColDef().lockPinned) { if (colPinned == pinned) { return "move"; } continue; } const initialPinnedState = dragItem?.containerType; if (initialPinnedState === pinned || !pinned) { return "move"; } if (pinned && (!colPinned || initialPinnedState !== pinned)) { return "pinned"; } } return "notAllowed"; } onDragEnter(draggingEvent) { const dragItem = draggingEvent.dragItem; const columns = dragItem.columns; const dragCameFromToolPanel = draggingEvent.dragSource.type === 0; if (dragCameFromToolPanel) { this.setColumnsVisible(columns, true, "uiColumnDragged"); } else { const visibleState = dragItem.visibleState; const visibleColumns = (columns || []).filter( (column) => visibleState[column.getId()] && !column.isVisible() ); this.setColumnsVisible(visibleColumns, true, "uiColumnDragged"); } if (!this.gos.get("suppressMoveWhenColumnDragging")) { this.attemptToPinColumns(columns, this.pinned); } this.onDragging(draggingEvent, true, true); } onDragging(draggingEvent = this.lastDraggingEvent, fromEnter = false, fakeEvent = false, finished = false) { const { gos, ctrlsSvc } = this.beans; const isSuppressMoveWhenDragging = gos.get("suppressMoveWhenColumnDragging"); if (finished && !isSuppressMoveWhenDragging) { this.finishColumnMoving(); return; } this.lastDraggingEvent = draggingEvent; if (!draggingEvent || !finished && _missing(draggingEvent.hDirection)) { return; } const mouseX = normaliseX({ x: draggingEvent.x, pinned: this.pinned, gos, ctrlsSvc }); if (!fromEnter) { this.checkCenterForScrolling(mouseX); } if (isSuppressMoveWhenDragging) { this.handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished); } else { this.handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished); } } onDragLeave() { this.ensureIntervalCleared(); this.clearHighlighted(); this.updateDragItemContainerType(); this.lastMovedInfo = null; } onDragStop() { this.onDragging(this.lastDraggingEvent, false, true, true); this.ensureIntervalCleared(); this.lastMovedInfo = null; } onDragCancel() { this.clearHighlighted(); this.ensureIntervalCleared(); this.lastMovedInfo = null; } setColumnsVisible(columns, visible, source) { if (!columns?.length) { return; } const allowedCols = columns.filter((c) => !c.getColDef().lockVisible); if (!allowedCols.length) { return; } this.beans.colModel.setColsVisible(allowedCols, visible, source); } finishColumnMoving() { this.clearHighlighted(); const lastMovedInfo = this.lastMovedInfo; if (!lastMovedInfo) { return; } const { columns, toIndex } = lastMovedInfo; this.beans.colMoves.moveColumns(columns, toIndex, "uiColumnMoved", true); } updateDragItemContainerType() { const { lastDraggingEvent } = this; if (this.gos.get("suppressMoveWhenColumnDragging") || !lastDraggingEvent) { return; } const dragItem = lastDraggingEvent.dragItem; if (!dragItem) { return; } dragItem.containerType = this.pinned; } handleColumnDragWhileSuppressingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) { const allMovingColumns = this.getAllMovingColumns(draggingEvent, true); if (finished) { const isAttemptingToPin = this.isAttemptingToPin(allMovingColumns); if (isAttemptingToPin) { this.attemptToPinColumns(allMovingColumns, void 0, true); } const { fromLeft, xPosition } = this.getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) || {}; if (fromLeft == null || xPosition == null) { this.finishColumnMoving(); return; } this.moveColumnsAfterHighlight({ allMovingColumns, xPosition, fromEnter, fakeEvent, fromLeft }); } else { if (!this.beans.dragAndDrop.isDropZoneWithinThisGrid(draggingEvent)) { return; } this.highlightHoveredColumn(allMovingColumns, mouseX); } } handleColumnDragWhileAllowingMovement(draggingEvent, fromEnter, fakeEvent, mouseX, finished) { const allMovingColumns = this.getAllMovingColumns(draggingEvent); const fromLeft = this.normaliseDirection(draggingEvent.hDirection) === "right"; const isFromHeader = draggingEvent.dragSource.type === 1; const params = this.getMoveColumnParams({ allMovingColumns, isFromHeader, xPosition: mouseX, fromLeft, fromEnter, fakeEvent }); const lastMovedInfo = attemptMoveColumns({ ...params, finished }); if (lastMovedInfo) { this.lastMovedInfo = lastMovedInfo; } } getAllMovingColumns(draggingEvent, useSplit = false) { const dragItem = draggingEvent.dragSource.getDragItem(); let columns = null; if (useSplit) { columns = dragItem.columnsInSplit; if (!columns) { columns = dragItem.columns; } } else { columns = dragItem.columns; } const conditionCallback = (col) => col.getColDef().lockPinned ? col.getPinned() == this.pinned : true; if (!columns) { return []; } return columns.filter(conditionCallback); } getMoveColumnParams(params) { const { allMovingColumns, isFromHeader, xPosition, fromLeft, fromEnter, fakeEvent } = params; const { gos, colModel, colMoves, visibleCols } = this.beans; return { allMovingColumns, isFromHeader, fromLeft, xPosition, pinned: this.pinned, fromEnter, fakeEvent, gos, colModel, colMoves, visibleCols }; } highlightHoveredColumn(movingColumns, mouseX) { const { gos, colModel } = this.beans; const isRtl = gos.get("enableRtl"); const consideredColumns = colModel.getCols().filter((col) => col.isVisible() && col.getPinned() === this.pinned); let start = null; let width = null; let targetColumn = null; for (const col of consideredColumns) { width = col.getActualWidth(); start = this.getNormalisedColumnLeft(col, 0, isRtl); if (start != null) { const end = start + width; if (start <= mouseX && end >= mouseX) { targetColumn = col; break; } } start = null; width = null; } if (!targetColumn) { for (let i = consideredColumns.length - 1; i >= 0; i--) { const currentColumn = consideredColumns[i]; const parent = consideredColumns[i].getParent(); if (!parent) { targetColumn = currentColumn; break; } const leafDisplayedCols = parent?.getDisplayedLeafColumns(); if (leafDisplayedCols.length) { targetColumn = _last(leafDisplayedCols); break; } } if (!targetColumn) { return; } start = this.getNormalisedColumnLeft(targetColumn, 0, isRtl); width = targetColumn.getActualWidth(); } else if (movingColumns.indexOf(targetColumn) !== -1) { targetColumn = null; } if (targetColumn == null || start == null || width == null) { if (this.lastHighlightedColumn?.column !== targetColumn) { this.clearHighlighted(); } return; } let position; if (mouseX - start < width / 2) { const targetIndex = consideredColumns.indexOf(targetColumn); if (targetIndex === 0) { position = 0; } else { position = 1; targetColumn = consideredColumns[targetIndex - 1]; } } else { position = 1; } if (this.lastHighlightedColumn?.column !== targetColumn || this.lastHighlightedColumn?.position !== position) { this.clearHighlighted(); } setColumnHighlighted(targetColumn, position); this.lastHighlightedColumn = { column: targetColumn, position }; } getNormalisedXPositionInfo(allMovingColumns, isAttemptingToPin) { const { gos, visibleCols } = this.beans; const isRtl = gos.get("enableRtl"); const { firstMovingCol, column, position } = this.getColumnMoveAndTargetInfo( allMovingColumns, isAttemptingToPin, isRtl ); if (!firstMovingCol || !column || position == null) { return; } const visibleColumns = visibleCols.allCols; const movingColIndex = visibleColumns.indexOf(firstMovingCol); const targetIndex = visibleColumns.indexOf(column); const isBefore = position === 0; const fromLeft = movingColIndex < targetIndex || movingColIndex === targetIndex && !isBefore; let diff = 0; if (isBefore) { if (fromLeft) { diff -= 1; } } else if (!fromLeft) { diff += 1; } if (targetIndex + diff === movingColIndex) { return; } const targetColumn = visibleColumns[targetIndex + diff]; if (!targetColumn) { return; } const xPosition = this.getNormalisedColumnLeft(targetColumn, 20, isRtl); return { fromLeft, xPosition }; } getColumnMoveAndTargetInfo(allMovingColumns, isAttemptingToPin, isRtl) { const lastHighlightedColumn = this.lastHighlightedColumn || {}; const { firstMovingCol, lastMovingCol } = findFirstAndLastMovingColumns(allMovingColumns); if (!firstMovingCol || !lastMovingCol || lastHighlightedColumn.column || !isAttemptingToPin) { return { firstMovingCol, ...lastHighlightedColumn }; } const pinned = this.getPinDirection(); const isLeft = pinned === "left"; return { firstMovingCol, position: isLeft ? 1 : 0, column: isLeft !== isRtl ? firstMovingCol : lastMovingCol }; } normaliseDirection(hDirection) { if (this.gos.get("enableRtl")) { switch (hDirection) { case "left": return "right"; case "right": return "left"; } } return hDirection; } getNormalisedColumnLeft(col, padding, isRtl) { const { gos, ctrlsSvc } = this.beans; const left = col.getLeft(); if (left == null) { return null; } const width = col.getActualWidth(); return normaliseX({ x: isRtl ? left + width - padding : left + padding, pinned: col.getPinned(), useHeaderRow: isRtl, skipScrollPadding: true, gos, ctrlsSvc }); } isAttemptingToPin(columns) { const isMovingHorizontally = this.needToMoveLeft || this.needToMoveRight; const isFailedMoreThanThreshold = this.failedMoveAttempts > MOVE_FAIL_THRESHOLD; return isMovingHorizontally && isFailedMoreThanThreshold || columns.some((col) => col.getPinned() !== this.pinned); } moveColumnsAfterHighlight(params) { const { allMovingColumns, xPosition, fromEnter, fakeEvent, fromLeft } = params; const columnMoveParams = this.getMoveColumnParams({ allMovingColumns, isFromHeader: true, xPosition, fromLeft, fromEnter, fakeEvent }); const { columns, toIndex } = getBestColumnMoveIndexFromXPosition(columnMoveParams) || {}; if (columns && toIndex != null) { this.lastMovedInfo = { columns, toIndex }; } this.finishColumnMoving(); } clearHighlighted() { const { lastHighlightedColumn } = this; if (!lastHighlightedColumn) { return; } setColumnHighlighted(lastHighlightedColumn.column, null); this.lastHighlightedColumn = null; } checkCenterForScrolling(xAdjustedForScroll) { if (!this.isCenterContainer) { return; } const centerCtrl = this.beans.ctrlsSvc.get("center"); const firstVisiblePixel = centerCtrl.getCenterViewportScrollLeft(); const lastVisiblePixel = firstVisiblePixel + centerCtrl.getCenterWidth(); let needToMoveRight; let needToMoveLeft; if (this.gos.get("enableRtl")) { needToMoveRight = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE; needToMoveLeft = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE; } else { needToMoveLeft = xAdjustedForScroll < firstVisiblePixel + SCROLL_GAP_NEEDED_BEFORE_MOVE; needToMoveRight = xAdjustedForScroll > lastVisiblePixel - SCROLL_GAP_NEEDED_BEFORE_MOVE; } this.needToMoveRight = needToMoveRight; this.needToMoveLeft = needToMoveLeft; if (needToMoveLeft || needToMoveRight) { this.ensureIntervalStarted(); } else { this.ensureIntervalCleared(); } } ensureIntervalStarted() { if (this.movingIntervalId) { return; } this.intervalCount = 0; this.failedMoveAttempts = 0; this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), SCROLL_TIME_INTERVAL); this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft ? "left" : "right", true); } ensureIntervalCleared() { if (!this.movingIntervalId) { return; } window.clearInterval(this.movingIntervalId); this.movingIntervalId = null; this.failedMoveAttempts = 0; this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()); } moveInterval() { let pixelsToMove; this.intervalCount++; pixelsToMove = 10 + this.intervalCount * SCROLL_ACCELERATION_RATE; if (pixelsToMove > SCROLL_MOVE_WIDTH) { pixelsToMove = SCROLL_MOVE_WIDTH; } let pixelsMoved = null; const scrollFeature = this.gridBodyCon.scrollFeature; if (this.needToMoveLeft) { pixelsMoved = scrollFeature.scrollHorizontally(-pixelsToMove); } else if (this.needToMoveRight) { pixelsMoved = scrollFeature.scrollHorizontally(pixelsToMove); } if (pixelsMoved !== 0) { this.onDragging(this.lastDraggingEvent); this.failedMoveAttempts = 0; } else { this.failedMoveAttempts++; const { pinnedCols, dragAndDrop, gos } = this.beans; if (this.failedMoveAttempts <= MOVE_FAIL_THRESHOLD + 1 || !pinnedCols) { return; } dragAndDrop.setDragImageCompIcon("pinned"); if (!gos.get("suppressMoveWhenColumnDragging")) { const columns = this.lastDraggingEvent?.dragItem.columns; this.attemptToPinColumns(columns, void 0, true); } } } getPinDirection() { if (this.needToMoveLeft || this.pinned === "left") { return "left"; } if (this.needToMoveRight || this.pinned === "right") { return "right"; } } attemptToPinColumns(columns, pinned, fromMoving = false) { const allowedCols = (columns || []).filter((c) => !c.getColDef().lockPinned); if (!allowedCols.length) { return 0; } if (fromMoving) { pinned = this.getPinDirection(); } const { pinnedCols, dragAndDrop } = this.beans; pinnedCols?.setColsPinned(allowedCols, pinned, "uiColumnDragged"); if (fromMoving) { dragAndDrop.nudge(); } return allowedCols.length; } destroy() { super.destroy(); this.lastDraggingEvent = null; this.clearHighlighted(); this.lastMovedInfo = null; } }; function setColumnHighlighted(column, highlighted) { if (column.highlighted === highlighted) { return; } column.highlighted = highlighted; column.dispatchColEvent("headerHighlightChanged", "uiColumnMoved"); } function findFirstAndLastMovingColumns(allMovingColumns) { const moveLen = allMovingColumns.length; let firstMovingCol; let lastMovingCol; for (let i = 0; i < moveLen; i++) { if (!firstMovingCol) { const leftCol = allMovingColumns[i]; if (leftCol.getLeft() != null) { firstMovingCol = leftCol; } } if (!lastMovingCol) { const rightCol = allMovingColumns[moveLen - 1 - i]; if (rightCol.getLeft() != null) { lastMovingCol = rightCol; } } if (firstMovingCol && lastMovingCol) { break; } } return { firstMovingCol, lastMovingCol }; } var BodyDropTarget = class extends BeanStub { constructor(pinned, eContainer) { super(); this.pinned = pinned; this.eContainer = eContainer; } postConstruct() { const { ctrlsSvc, dragAndDrop } = this.beans; const pinned = this.pinned; ctrlsSvc.whenReady(this, (p) => { let eSecondaryContainers; const eBodyViewport = p.gridBodyCtrl.eBodyViewport; switch (pinned) { case "left": eSecondaryContainers = [ [eBodyViewport, p.left.eContainer], [p.bottomLeft.eContainer], [p.topLeft.eContainer] ]; break; case "right": eSecondaryContainers = [ [eBodyViewport, p.right.eContainer], [p.bottomRight.eContainer], [p.topRight.eContainer] ]; break; default: eSecondaryContainers = [ [eBodyViewport, p.center.eViewport], [p.bottomCenter.eViewport], [p.topCenter.eViewport] ]; break; } this.eSecondaryContainers = eSecondaryContainers; }); this.moveColumnFeature = this.createManagedBean(new MoveColumnFeature(pinned)); this.bodyDropPivotTarget = this.createManagedBean(new BodyDropPivotTarget(pinned)); dragAndDrop.addDropTarget(this); this.addDestroyFunc(() => dragAndDrop.removeDropTarget(this)); } isInterestedIn(type) { return type === 1 || type === 0 && this.gos.get("allowDragFromColumnsToolPanel"); } getSecondaryContainers() { return this.eSecondaryContainers; } getContainer() { return this.eContainer; } getIconName() { return this.currentDropListener.getIconName(); } // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when // dropped into the grid's body. isDropColumnInPivotMode(draggingEvent) { return this.beans.colModel.isPivotMode() && draggingEvent.dragSource.type === 0; } onDragEnter(draggingEvent) { this.currentDropListener = this.isDropColumnInPivotMode(draggingEvent) ? this.bodyDropPivotTarget : this.moveColumnFeature; this.currentDropListener.onDragEnter(draggingEvent); } onDragLeave(params) { this.currentDropListener.onDragLeave(params); } onDragging(params) { this.currentDropListener.onDragging(params); } onDragStop(params) { this.currentDropListener.onDragStop(params); } onDragCancel() { this.currentDropListener.onDragCancel(); } }; function placeLockedColumns(cols, gos) { const left = []; const normal = []; const right = []; cols.forEach((col) => { const position = col.getColDef().lockPosition; if (position === "right") { right.push(col); } else if (position === "left" || position === true) { left.push(col); } else { normal.push(col); } }); const isRtl = gos.get("enableRtl"); if (isRtl) { return [...right, ...normal, ...left]; } return [...left, ...normal, ...right]; } function doesMovePassMarryChildren(allColumnsCopy, gridBalancedTree) { let rulePassed = true; depthFirstOriginalTreeSearch(null, gridBalancedTree, (child) => { if (!isProvidedColumnGroup(child)) { return; } const columnGroup = child; const colGroupDef = columnGroup.getColGroupDef(); const marryChildren = colGroupDef?.marryChildren; if (!marryChildren) { return; } const newIndexes = []; for (const col of columnGroup.getLeafColumns()) { const newColIndex = allColumnsCopy.indexOf(col); newIndexes.push(newColIndex); } const maxIndex = Math.max.apply(Math, newIndexes); const minIndex = Math.min.apply(Math, newIndexes); const spread = maxIndex - minIndex; const maxSpread = columnGroup.getLeafColumns().length - 1; if (spread > maxSpread) { rulePassed = false; } }); return rulePassed; } var ColumnMoveService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colMoves"; } moveColumnByIndex(fromIndex, toIndex, source) { const gridColumns = this.beans.colModel.getCols(); if (!gridColumns) { return; } const column = gridColumns[fromIndex]; this.moveColumns([column], toIndex, source); } moveColumns(columnsToMoveKeys, toIndex, source, finished = true) { const { colModel, colAnimation, visibleCols, eventSvc } = this.beans; const gridColumns = colModel.getCols(); if (!gridColumns) { return; } if (toIndex > gridColumns.length - columnsToMoveKeys.length) { _warn(30, { toIndex }); return; } colAnimation?.start(); const movedColumns = colModel.getColsForKeys(columnsToMoveKeys); if (this.doesMovePassRules(movedColumns, toIndex)) { _moveInArray(colModel.getCols(), movedColumns, toIndex); visibleCols.refresh(source); eventSvc.dispatchEvent({ type: "columnMoved", columns: movedColumns, column: movedColumns.length === 1 ? movedColumns[0] : null, toIndex, finished, source }); } colAnimation?.finish(); } doesMovePassRules(columnsToMove, toIndex) { const proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex); return this.doesOrderPassRules(proposedColumnOrder); } doesOrderPassRules(gridOrder) { const { colModel, gos } = this.beans; if (!doesMovePassMarryChildren(gridOrder, colModel.getColTree())) { return false; } const doesMovePassLockedPositions = (proposedColumnOrder) => { const lockPositionToPlacement = (position) => { if (!position) { return 0; } return position === "left" || position === true ? -1 : 1; }; const isRtl = gos.get("enableRtl"); let lastPlacement = isRtl ? 1 : -1; let rulePassed = true; for (const col of proposedColumnOrder) { const placement = lockPositionToPlacement(col.getColDef().lockPosition); if (isRtl) { if (placement > lastPlacement) { rulePassed = false; } } else if (placement < lastPlacement) { rulePassed = false; } lastPlacement = placement; } return rulePassed; }; if (!doesMovePassLockedPositions(gridOrder)) { return false; } return true; } getProposedColumnOrder(columnsToMove, toIndex) { const gridColumns = this.beans.colModel.getCols(); const proposedColumnOrder = gridColumns.slice(); _moveInArray(proposedColumnOrder, columnsToMove, toIndex); return proposedColumnOrder; } createBodyDropTarget(pinned, dropContainer) { return new BodyDropTarget(pinned, dropContainer); } moveHeader(hDirection, eGui, column, pinned, bean) { const { ctrlsSvc, gos, colModel, visibleCols, focusSvc } = this.beans; const rect = eGui.getBoundingClientRect(); const left = rect.left; const isGroup = isColumnGroup(column); const width = isGroup ? rect.width : column.getActualWidth(); const isLeft = hDirection === "left" !== gos.get("enableRtl"); const xPosition = normaliseX({ x: isLeft ? left - 20 : left + width + 20, pinned, fromKeyboard: true, gos, ctrlsSvc }); const headerPosition = focusSvc.focusedHeader; attemptMoveColumns({ allMovingColumns: isGroup ? column.getLeafColumns() : [column], isFromHeader: true, fromLeft: hDirection === "right", xPosition, pinned, fromEnter: false, fakeEvent: false, gos, colModel, colMoves: this, visibleCols, finished: true }); let targetColumn; if (isGroup) { const displayedLeafColumns = column.getDisplayedLeafColumns(); targetColumn = isLeft ? displayedLeafColumns[0] : _last(displayedLeafColumns); } else { targetColumn = column; } ctrlsSvc.getScrollFeature().ensureColumnVisible(targetColumn, "auto"); if ((!bean.isAlive() || gos.get("ensureDomOrder")) && headerPosition) { let restoreFocusColumn; if (isGroup) { const groupId = column.getGroupId(); const leafCols = column.getLeafColumns(); if (!leafCols.length) { return; } const parent = leafCols[0].getParent(); if (!parent) { return; } restoreFocusColumn = findGroupWidthId(parent, groupId); } else { restoreFocusColumn = column; } if (restoreFocusColumn) { focusSvc.focusHeaderPosition({ headerPosition: { ...headerPosition, column: restoreFocusColumn } }); } } } setDragSourceForHeader(eSource, column, displayName) { const { gos, colModel, dragAndDrop, visibleCols } = this.beans; let hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); const isGroup = isColumnGroup(column); const columns = isGroup ? column.getProvidedColumnGroup().getLeafColumns() : [column]; const getDragItem = isGroup ? () => createDragItemForGroup(column, visibleCols.allCols) : () => createDragItem(column); const dragSource = { type: 1, eElement: eSource, getDefaultIconName: () => hideColumnOnExit ? "hide" : "notAllowed", getDragItem, dragItemName: displayName, onDragStarted: () => { hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); setColumnsMoving(columns, true); }, onDragStopped: () => setColumnsMoving(columns, false), onDragCancelled: () => setColumnsMoving(columns, false), onGridEnter: (dragItem) => { if (hideColumnOnExit) { const { columns: columns2 = [], visibleState } = dragItem ?? {}; const hasVisibleState = isGroup ? (col) => !visibleState || visibleState[col.getColId()] : () => true; const unlockedColumns = columns2.filter( (col) => !col.getColDef().lockVisible && hasVisibleState(col) ); colModel.setColsVisible(unlockedColumns, true, "uiColumnMoved"); } }, onGridExit: (dragItem) => { if (hideColumnOnExit) { const unlockedColumns = dragItem?.columns?.filter((col) => !col.getColDef().lockVisible) || []; colModel.setColsVisible(unlockedColumns, false, "uiColumnMoved"); } } }; dragAndDrop.addDragSource(dragSource, true); return dragSource; } }; function findGroupWidthId(columnGroup, id) { while (columnGroup) { if (columnGroup.getGroupId() === id) { return columnGroup; } columnGroup = columnGroup.getParent(); } return void 0; } function createDragItem(column) { const visibleState = {}; visibleState[column.getId()] = column.isVisible(); return { columns: [column], visibleState, containerType: column.pinned }; } function createDragItemForGroup(columnGroup, allCols) { const allColumnsOriginalOrder = columnGroup.getProvidedColumnGroup().getLeafColumns(); const visibleState = {}; for (const column of allColumnsOriginalOrder) { visibleState[column.getId()] = column.isVisible(); } const allColumnsCurrentOrder = []; for (const column of allCols) { if (allColumnsOriginalOrder.indexOf(column) >= 0) { allColumnsCurrentOrder.push(column); _removeFromArray(allColumnsOriginalOrder, column); } } for (const column of allColumnsOriginalOrder) { allColumnsCurrentOrder.push(column); } const columnsInSplit = []; const columnGroupColumns = columnGroup.getLeafColumns(); for (const col of allColumnsCurrentOrder) { if (columnGroupColumns.indexOf(col) !== -1) { columnsInSplit.push(col); } } return { columns: allColumnsCurrentOrder, columnsInSplit, visibleState, containerType: columnsInSplit[0]?.pinned }; } var ColumnMoveModule = { moduleName: "ColumnMove", version: VERSION, beans: [ColumnMoveService, ColumnAnimationService], apiFunctions: { moveColumnByIndex, moveColumns }, dependsOn: [SharedDragAndDropModule], css: [column_moving_default] }; var AutoWidthCalculator = class extends BeanStub { constructor() { super(...arguments); this.beanName = "autoWidthCalc"; } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.centerRowContainerCtrl = p.center; }); } // this is the trick: we create a dummy container and clone all the cells // into the dummy, then check the dummy's width. then destroy the dummy // as we don't need it any more. // drawback: only the cells visible on the screen are considered getPreferredWidthForColumn(column, skipHeader) { const eHeaderCell = this.getHeaderCellForColumn(column); if (!eHeaderCell) { return -1; } const elements = this.beans.rowRenderer.getAllCellsNotSpanningForColumn(column); if (!skipHeader) { elements.push(eHeaderCell); } return this.getPreferredWidthForElements(elements); } getPreferredWidthForColumnGroup(columnGroup) { const eHeaderCell = this.getHeaderCellForColumn(columnGroup); if (!eHeaderCell) { return -1; } return this.getPreferredWidthForElements([eHeaderCell]); } getPreferredWidthForElements(elements, extraPadding) { const eDummyContainer = document.createElement("form"); eDummyContainer.style.position = "fixed"; const eBodyContainer = this.centerRowContainerCtrl.eContainer; for (const el of elements) { this.cloneItemIntoDummy(el, eDummyContainer); } eBodyContainer.appendChild(eDummyContainer); const dummyContainerWidth = Math.ceil(eDummyContainer.getBoundingClientRect().width); eDummyContainer.remove(); extraPadding = extraPadding ?? this.gos.get("autoSizePadding"); return dummyContainerWidth + extraPadding; } getHeaderCellForColumn(column) { let element = null; for (const container of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()) { const res = container.getHtmlElementForColumnHeader(column); if (res != null) { element = res; } } return element; } cloneItemIntoDummy(eCell, eDummyContainer) { const eCellClone = eCell.cloneNode(true); eCellClone.style.width = ""; eCellClone.style.position = "static"; eCellClone.style.left = ""; const eCloneParent = document.createElement("div"); const eCloneParentClassList = eCloneParent.classList; const isHeader = ["ag-header-cell", "ag-header-group-cell"].some((cls) => eCellClone.classList.contains(cls)); if (isHeader) { eCloneParentClassList.add("ag-header", "ag-header-row"); eCloneParent.style.position = "static"; } else { eCloneParentClassList.add("ag-row"); } let pointer = eCell.parentElement; while (pointer) { const isRow = ["ag-header-row", "ag-row"].some((cls) => pointer.classList.contains(cls)); if (isRow) { for (let i = 0; i < pointer.classList.length; i++) { const item = pointer.classList[i]; if (item != "ag-row-position-absolute") { eCloneParentClassList.add(item); } } break; } pointer = pointer.parentElement; } eCloneParent.appendChild(eCellClone); eDummyContainer.appendChild(eCloneParent); } }; var AutoWidthModule = { moduleName: "AutoWidth", version: VERSION, beans: [AutoWidthCalculator] }; function setColumnWidths(beans, columnWidths, finished = true, source = "api") { beans.colResize?.setColumnWidths(columnWidths, false, finished, source); } function getCommonValue(cols, valueGetter) { if (!cols || cols.length == 0) { return void 0; } const firstValue = valueGetter(cols[0]); for (let i = 1; i < cols.length; i++) { if (firstValue !== valueGetter(cols[i])) { return void 0; } } return firstValue; } function dispatchColumnPinnedEvent(eventSvc, changedColumns, source) { if (!changedColumns.length) { return; } const column = changedColumns.length === 1 ? changedColumns[0] : null; const pinned = getCommonValue(changedColumns, (col) => col.getPinned()); eventSvc.dispatchEvent({ type: "columnPinned", // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned' pinned: pinned != null ? pinned : null, columns: changedColumns, column, source }); } function dispatchColumnVisibleEvent(eventSvc, changedColumns, source) { if (!changedColumns.length) { return; } const column = changedColumns.length === 1 ? changedColumns[0] : null; const visible = getCommonValue(changedColumns, (col) => col.isVisible()); eventSvc.dispatchEvent({ type: "columnVisible", visible, columns: changedColumns, column, source }); } function dispatchColumnChangedEvent(eventSvc, type, columns, source) { eventSvc.dispatchEvent({ type, columns, column: columns && columns.length == 1 ? columns[0] : null, source }); } function dispatchColumnResizedEvent(eventSvc, columns, finished, source, flexColumns = null) { if (columns?.length) { eventSvc.dispatchEvent({ type: "columnResized", columns, column: columns.length === 1 ? columns[0] : null, flexColumns, finished, source }); } } var GroupResizeFeature = class extends BeanStub { constructor(comp, eResize, pinned, columnGroup) { super(); this.comp = comp; this.eResize = eResize; this.pinned = pinned; this.columnGroup = columnGroup; } postConstruct() { if (!this.columnGroup.isResizable()) { this.comp.setResizableDisplayed(false); return; } const { horizontalResizeSvc, gos, colAutosize } = this.beans; const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({ eResizeBar: this.eResize, onResizeStart: this.onResizeStart.bind(this), onResizing: this.onResizing.bind(this, false), onResizeEnd: this.onResizing.bind(this, true) }); this.addDestroyFunc(finishedWithResizeFunc); if (!gos.get("suppressAutoSize") && colAutosize) { this.addDestroyFunc( colAutosize.addColumnGroupResize( this.eResize, this.columnGroup, () => this.resizeLeafColumnsToFit("uiColumnResized") ) ); } } onResizeStart(shiftKey) { const { columnsToResize, resizeStartWidth, resizeRatios, groupAfterColumns, groupAfterStartWidth, groupAfterRatios } = this.getInitialValues(shiftKey); this.resizeCols = columnsToResize; this.resizeStartWidth = resizeStartWidth; this.resizeRatios = resizeRatios; this.resizeTakeFromCols = groupAfterColumns; this.resizeTakeFromStartWidth = groupAfterStartWidth; this.resizeTakeFromRatios = groupAfterRatios; this.toggleColumnResizing(true); } onResizing(finished, resizeAmount, source = "uiColumnResized") { const resizeAmountNormalised = this.normaliseDragChange(resizeAmount); const width = this.resizeStartWidth + resizeAmountNormalised; this.resizeColumnsFromLocalValues(width, source, finished); } getInitialValues(shiftKey) { const getInitialSizeOfColumns = (columns) => columns.reduce((totalWidth, column) => totalWidth + column.getActualWidth(), 0); const getSizeRatiosOfColumns = (columns, initialSizeOfColumns) => columns.map((column) => column.getActualWidth() / initialSizeOfColumns); const columnsToResize = this.getColumnsToResize(); const resizeStartWidth = getInitialSizeOfColumns(columnsToResize); const resizeRatios = getSizeRatiosOfColumns(columnsToResize, resizeStartWidth); const columnSizeAndRatios = { columnsToResize, resizeStartWidth, resizeRatios }; let groupAfter = null; if (shiftKey) { groupAfter = this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup, "After") ?? null; } if (groupAfter) { const takeFromLeafCols = groupAfter.getDisplayedLeafColumns(); const groupAfterColumns = columnSizeAndRatios.groupAfterColumns = takeFromLeafCols.filter( (col) => col.isResizable() ); const groupAfterStartWidth = columnSizeAndRatios.groupAfterStartWidth = getInitialSizeOfColumns(groupAfterColumns); columnSizeAndRatios.groupAfterRatios = getSizeRatiosOfColumns(groupAfterColumns, groupAfterStartWidth); } else { columnSizeAndRatios.groupAfterColumns = void 0; columnSizeAndRatios.groupAfterStartWidth = void 0; columnSizeAndRatios.groupAfterRatios = void 0; } return columnSizeAndRatios; } resizeLeafColumnsToFit(source) { const preferredSize = this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup); const initialValues = this.getInitialValues(); if (preferredSize > initialValues.resizeStartWidth) { this.resizeColumns(initialValues, preferredSize, source, true); } } resizeColumnsFromLocalValues(totalWidth, source, finished = true) { if (!this.resizeCols || !this.resizeRatios) { return; } const initialValues = { columnsToResize: this.resizeCols, resizeStartWidth: this.resizeStartWidth, resizeRatios: this.resizeRatios, groupAfterColumns: this.resizeTakeFromCols, groupAfterStartWidth: this.resizeTakeFromStartWidth, groupAfterRatios: this.resizeTakeFromRatios }; this.resizeColumns(initialValues, totalWidth, source, finished); } resizeColumns(initialValues, totalWidth, source, finished = true) { const { columnsToResize, resizeStartWidth, resizeRatios, groupAfterColumns, groupAfterStartWidth, groupAfterRatios } = initialValues; const resizeSets = []; resizeSets.push({ columns: columnsToResize, ratios: resizeRatios, width: totalWidth }); if (groupAfterColumns) { const diff = totalWidth - resizeStartWidth; resizeSets.push({ columns: groupAfterColumns, ratios: groupAfterRatios, width: groupAfterStartWidth - diff }); } this.beans.colResize?.resizeColumnSets({ resizeSets, finished, source }); if (finished) { this.toggleColumnResizing(false); } } toggleColumnResizing(resizing) { this.comp.toggleCss("ag-column-resizing", resizing); } getColumnsToResize() { const leafCols = this.columnGroup.getDisplayedLeafColumns(); return leafCols.filter((col) => col.isResizable()); } // optionally inverts the drag, depending on pinned and RTL // note - this method is duplicated in RenderedHeaderCell - should refactor out? normaliseDragChange(dragChange) { let result = dragChange; if (this.gos.get("enableRtl")) { if (this.pinned !== "left") { result *= -1; } } else if (this.pinned === "right") { result *= -1; } return result; } destroy() { super.destroy(); this.resizeCols = void 0; this.resizeRatios = void 0; this.resizeTakeFromCols = void 0; this.resizeTakeFromRatios = void 0; } }; var ResizeFeature = class extends BeanStub { constructor(pinned, column, eResize, comp, ctrl) { super(); this.pinned = pinned; this.column = column; this.eResize = eResize; this.comp = comp; this.ctrl = ctrl; } postConstruct() { const destroyResizeFuncs = []; let canResize; let canAutosize; const addResize = () => { _setDisplayed(this.eResize, canResize); if (!canResize) { return; } const { horizontalResizeSvc, colAutosize } = this.beans; const finishedWithResizeFunc = horizontalResizeSvc.addResizeBar({ eResizeBar: this.eResize, onResizeStart: this.onResizeStart.bind(this), onResizing: this.onResizing.bind(this, false), onResizeEnd: this.onResizing.bind(this, true) }); destroyResizeFuncs.push(finishedWithResizeFunc); if (canAutosize && colAutosize) { destroyResizeFuncs.push(colAutosize.addColumnAutosizeListeners(this.eResize, this.column)); } }; const removeResize = () => { for (const f of destroyResizeFuncs) { f(); } destroyResizeFuncs.length = 0; }; const refresh = () => { const resize = this.column.isResizable(); const autoSize = !this.gos.get("suppressAutoSize") && !this.column.getColDef().suppressAutoSize; const propertyChange = resize !== canResize || autoSize !== canAutosize; if (propertyChange) { canResize = resize; canAutosize = autoSize; removeResize(); addResize(); } }; refresh(); this.addDestroyFunc(removeResize); this.ctrl.setRefreshFunction("resize", refresh); } onResizing(finished, resizeAmount) { const { column: key, lastResizeAmount, resizeStartWidth, beans } = this; const resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount); const newWidth = resizeStartWidth + resizeAmountNormalised; const columnWidths = [{ key, newWidth }]; const { pinnedCols, ctrlsSvc, colResize } = beans; if (this.column.getPinned()) { const leftWidth = pinnedCols?.leftWidth ?? 0; const rightWidth = pinnedCols?.rightWidth ?? 0; const bodyWidth = _getInnerWidth(ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50; if (leftWidth + rightWidth + (resizeAmountNormalised - lastResizeAmount) > bodyWidth) { return; } } this.lastResizeAmount = resizeAmountNormalised; colResize?.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, "uiColumnResized"); if (finished) { this.toggleColumnResizing(false); } } onResizeStart(shiftKey) { this.resizeStartWidth = this.column.getActualWidth(); this.lastResizeAmount = 0; this.resizeWithShiftKey = shiftKey; this.toggleColumnResizing(true); } toggleColumnResizing(resizing) { this.column.resizing = resizing; this.comp.toggleCss("ag-column-resizing", resizing); } // optionally inverts the drag, depending on pinned and RTL // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out? normaliseResizeAmount(dragChange) { let result = dragChange; const notPinningLeft = this.pinned !== "left"; const pinningRight = this.pinned === "right"; if (this.gos.get("enableRtl")) { if (notPinningLeft) { result *= -1; } } else if (pinningRight) { result *= -1; } return result; } }; var ColumnResizeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colResize"; } setColumnWidths(columnWidths, shiftKey, finished, source) { const sets = []; const { colModel, gos, visibleCols } = this.beans; for (const columnWidth of columnWidths) { const col = colModel.getColDefCol(columnWidth.key) || colModel.getCol(columnWidth.key); if (!col) { continue; } sets.push({ width: columnWidth.newWidth, ratios: [1], columns: [col] }); const defaultIsShift = gos.get("colResizeDefault") === "shift"; if (defaultIsShift) { shiftKey = !shiftKey; } if (shiftKey) { const otherCol = visibleCols.getColAfter(col); if (!otherCol) { continue; } const widthDiff = col.getActualWidth() - columnWidth.newWidth; const otherColWidth = otherCol.getActualWidth() + widthDiff; sets.push({ width: otherColWidth, ratios: [1], columns: [otherCol] }); } } if (sets.length === 0) { return; } this.resizeColumnSets({ resizeSets: sets, finished, source }); } // method takes sets of columns and resizes them. either all sets will be resized, or nothing // be resized. this is used for example when user tries to resize a group and holds shift key, // then both the current group (grows), and the adjacent group (shrinks), will get resized, // so that's two sets for this method. resizeColumnSets(params) { const { resizeSets, finished, source } = params; const passMinMaxCheck = !resizeSets || resizeSets.every((columnResizeSet) => checkMinAndMaxWidthsForSet(columnResizeSet)); if (!passMinMaxCheck) { if (finished) { const columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null; dispatchColumnResizedEvent(this.eventSvc, columns, finished, source); } return; } const changedCols = []; const allResizedCols = []; for (const set2 of resizeSets) { const { width, columns, ratios } = set2; const newWidths = {}; const finishedCols = {}; for (const col of columns) { allResizedCols.push(col); } let finishedColsGrew = true; let loopCount = 0; while (finishedColsGrew) { loopCount++; if (loopCount > 1e3) { _error(31); break; } finishedColsGrew = false; const subsetCols = []; let subsetRatioTotal = 0; let pixelsToDistribute = width; columns.forEach((col, index) => { const thisColFinished = finishedCols[col.getId()]; if (thisColFinished) { pixelsToDistribute -= newWidths[col.getId()]; } else { subsetCols.push(col); const ratioThisCol = ratios[index]; subsetRatioTotal += ratioThisCol; } }); const ratioScale = 1 / subsetRatioTotal; subsetCols.forEach((col, index) => { const lastCol = index === subsetCols.length - 1; let colNewWidth; if (lastCol) { colNewWidth = pixelsToDistribute; } else { colNewWidth = Math.round(ratios[index] * width * ratioScale); pixelsToDistribute -= colNewWidth; } const minWidth = col.getMinWidth(); const maxWidth = col.getMaxWidth(); if (colNewWidth < minWidth) { colNewWidth = minWidth; finishedCols[col.getId()] = true; finishedColsGrew = true; } else if (maxWidth > 0 && colNewWidth > maxWidth) { colNewWidth = maxWidth; finishedCols[col.getId()] = true; finishedColsGrew = true; } newWidths[col.getId()] = colNewWidth; }); } for (const col of columns) { const newWidth = newWidths[col.getId()]; const actualWidth = col.getActualWidth(); if (actualWidth !== newWidth) { col.setActualWidth(newWidth, source); changedCols.push(col); } } } const atLeastOneColChanged = changedCols.length > 0; let flexedCols = []; if (atLeastOneColChanged) { const { colFlex, visibleCols, colViewport } = this.beans; flexedCols = colFlex?.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true }) ?? []; visibleCols.setLeftValues(source); visibleCols.updateBodyWidths(); colViewport.checkViewportColumns(); } const colsForEvent = allResizedCols.concat(flexedCols); if (atLeastOneColChanged || finished) { dispatchColumnResizedEvent(this.eventSvc, colsForEvent, finished, source, flexedCols); } } resizeHeader(column, delta, shiftKey) { if (!column.isResizable()) { return; } const actualWidth = column.getActualWidth(); const minWidth = column.getMinWidth(); const maxWidth = column.getMaxWidth(); const newWidth = Math.min(Math.max(actualWidth + delta, minWidth), maxWidth); this.setColumnWidths([{ key: column, newWidth }], shiftKey, true, "uiColumnResized"); } createResizeFeature(pinned, column, eResize, comp, ctrl) { return new ResizeFeature(pinned, column, eResize, comp, ctrl); } createGroupResizeFeature(comp, eResize, pinned, columnGroup) { return new GroupResizeFeature(comp, eResize, pinned, columnGroup); } }; function checkMinAndMaxWidthsForSet(columnResizeSet) { const { columns, width } = columnResizeSet; let minWidthAccumulated = 0; let maxWidthAccumulated = 0; let maxWidthActive = true; for (const col of columns) { const minWidth = col.getMinWidth(); minWidthAccumulated += minWidth || 0; const maxWidth = col.getMaxWidth(); if (maxWidth > 0) { maxWidthAccumulated += maxWidth; } else { maxWidthActive = false; } } const minWidthPasses = width >= minWidthAccumulated; const maxWidthPasses = !maxWidthActive || width <= maxWidthAccumulated; return minWidthPasses && maxWidthPasses; } var ColumnResizeModule = { moduleName: "ColumnResize", version: VERSION, beans: [ColumnResizeService], apiFunctions: { setColumnWidths }, dependsOn: [HorizontalResizeModule, AutoWidthModule] }; var GroupWidthFeature = class extends BeanStub { constructor(comp, columnGroup) { super(); this.removeChildListenersFuncs = []; this.columnGroup = columnGroup; this.comp = comp; } postConstruct() { this.addListenersToChildrenColumns(); this.addManagedListeners(this.columnGroup, { displayedChildrenChanged: this.onDisplayedChildrenChanged.bind(this) }); this.onWidthChanged(); this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this)); } addListenersToChildrenColumns() { this.removeListenersOnChildrenColumns(); const widthChangedListener = this.onWidthChanged.bind(this); for (const column of this.columnGroup.getLeafColumns()) { column.__addEventListener("widthChanged", widthChangedListener); column.__addEventListener("visibleChanged", widthChangedListener); this.removeChildListenersFuncs.push(() => { column.__removeEventListener("widthChanged", widthChangedListener); column.__removeEventListener("visibleChanged", widthChangedListener); }); } } removeListenersOnChildrenColumns() { for (const func of this.removeChildListenersFuncs) { func(); } this.removeChildListenersFuncs = []; } onDisplayedChildrenChanged() { this.addListenersToChildrenColumns(); this.onWidthChanged(); } onWidthChanged() { const columnWidth = this.columnGroup.getActualWidth(); this.comp.setWidth(`${columnWidth}px`); this.comp.toggleCss("ag-hidden", columnWidth === 0); } }; var HeaderGroupCellCtrl = class extends AbstractHeaderCellCtrl { constructor() { super(...arguments); this.onSuppressColMoveChange = () => { if (!this.isAlive() || this.isSuppressMoving()) { this.removeDragSource(); } else if (!this.dragSource) { this.setDragSource(this.eGui); } }; } wireComp(comp, eGui, eResize, eHeaderCompWrapper, compBean) { const { column, beans } = this; const { context, colNames, colHover, rangeSvc, colResize } = beans; this.comp = comp; compBean = setupCompBean(this, context, compBean); this.setGui(eGui, compBean); this.displayName = colNames.getDisplayNameForColumnGroup(column, "header"); this.refreshHeaderStyles(); this.addClasses(); this.setupMovingCss(compBean); this.setupExpandable(compBean); this.setupTooltip(); this.refreshAnnouncement(); this.setupAutoHeight({ wrapperElement: eHeaderCompWrapper, compBean }); this.setupUserComp(); this.addHeaderMouseListeners(compBean, eHeaderCompWrapper); this.addManagedPropertyListener("groupHeaderHeight", this.refreshMaxHeaderHeight.bind(this)); this.refreshMaxHeaderHeight(); const pinned = this.rowCtrl.pinned; const leafCols = column.getProvidedColumnGroup().getLeafColumns(); colHover?.createHoverFeature(compBean, leafCols, eGui); rangeSvc?.createRangeHighlightFeature(compBean, column, comp); compBean.createManagedBean(new SetLeftFeature(column, eGui, beans)); compBean.createManagedBean(new GroupWidthFeature(comp, column)); if (colResize) { this.resizeFeature = compBean.createManagedBean( colResize.createGroupResizeFeature(comp, eResize, pinned, column) ); } else { comp.setResizableDisplayed(false); } compBean.createManagedBean( new ManagedFocusFeature(eGui, { shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), onTabKeyDown: () => void 0, handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this) }) ); this.addHighlightListeners(compBean, leafCols); this.addManagedEventListeners({ cellSelectionChanged: () => this.refreshAnnouncement() }); compBean.addManagedPropertyListener("suppressMovableColumns", this.onSuppressColMoveChange); this.addResizeAndMoveKeyboardListeners(compBean); compBean.addDestroyFunc(() => this.clearComponent()); } getHeaderClassParams() { const { column, beans } = this; const colDef = column.getDefinition(); return _addGridCommonParams(beans.gos, { colDef, columnGroup: column, floatingFilter: false }); } refreshMaxHeaderHeight() { const { gos, comp } = this; const groupHeaderHeight = gos.get("groupHeaderHeight"); if (groupHeaderHeight != null) { if (groupHeaderHeight === 0) { comp.setHeaderWrapperHidden(true); } else { comp.setHeaderWrapperMaxHeight(groupHeaderHeight); } } else { comp.setHeaderWrapperHidden(false); comp.setHeaderWrapperMaxHeight(null); } } addHighlightListeners(compBean, columns) { if (!this.beans.gos.get("suppressMoveWhenColumnDragging")) { return; } for (const column of columns) { compBean.addManagedListeners(column, { headerHighlightChanged: this.onLeafColumnHighlightChanged.bind(this, column) }); } } onLeafColumnHighlightChanged(column) { const displayedColumns = this.column.getDisplayedLeafColumns(); const isFirst = displayedColumns[0] === column; const isLast = _last(displayedColumns) === column; if (!isFirst && !isLast) { return; } const highlighted = column.getHighlighted(); const isColumnMoveAtThisLevel = !!this.rowCtrl.getHeaderCellCtrls().find((ctrl) => { return ctrl.column.isMoving(); }); let beforeOn = false; let afterOn = false; if (isColumnMoveAtThisLevel) { const isRtl = this.beans.gos.get("enableRtl"); const isHighlightAfter = highlighted === 1; const isHighlightBefore = highlighted === 0; if (isFirst) { if (isRtl) { afterOn = isHighlightAfter; } else { beforeOn = isHighlightBefore; } } if (isLast) { if (isRtl) { beforeOn = isHighlightBefore; } else { afterOn = isHighlightAfter; } } } this.comp.toggleCss("ag-header-highlight-before", beforeOn); this.comp.toggleCss("ag-header-highlight-after", afterOn); } resizeHeader(delta, shiftKey) { const { resizeFeature } = this; if (!resizeFeature) { return; } const initialValues = resizeFeature.getInitialValues(shiftKey); resizeFeature.resizeColumns(initialValues, initialValues.resizeStartWidth + delta, "uiColumnResized", true); } resizeLeafColumnsToFit(source) { this.resizeFeature?.resizeLeafColumnsToFit(source); } setupUserComp() { const { colGroupSvc, userCompFactory, gos, enterpriseMenuFactory } = this.beans; const columnGroup = this.column; const providedColumnGroup = columnGroup.getProvidedColumnGroup(); const params = _addGridCommonParams(gos, { displayName: this.displayName, columnGroup, setExpanded: (expanded) => { colGroupSvc.setColumnGroupOpened(providedColumnGroup, expanded, "gridInitializing"); }, setTooltip: (value, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); this.setupTooltip(value, shouldDisplayTooltip); }, showColumnMenu: (buttonElement, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterButtonClick( providedColumnGroup, buttonElement, "columnMenu", onClosedCallback ), showColumnMenuAfterMouseClick: (mouseEvent, onClosedCallback) => enterpriseMenuFactory?.showMenuAfterMouseEvent( providedColumnGroup, mouseEvent, "columnMenu", onClosedCallback ), eGridHeader: this.eGui }); const compDetails = _getHeaderGroupCompDetails(userCompFactory, params); if (compDetails) { this.comp.setUserCompDetails(compDetails); } } addHeaderMouseListeners(compBean, eHeaderCompWrapper) { const { column, comp, beans: { rangeSvc }, gos } = this; const listener = (e) => this.handleMouseOverChange(e.type === "mouseenter"); const clickListener = () => this.dispatchColumnMouseEvent("columnHeaderClicked", column.getProvidedColumnGroup()); const contextMenuListener = (event) => this.handleContextMenuMouseEvent(event, void 0, column.getProvidedColumnGroup()); compBean.addManagedListeners(this.eGui, { mouseenter: listener, mouseleave: listener, click: clickListener, contextmenu: contextMenuListener }); comp.toggleCss("ag-header-group-cell-selectable", _getEnableColumnSelection(gos)); const mouseListener = rangeSvc?.createHeaderGroupCellMouseListenerFeature(this.column, eHeaderCompWrapper); if (mouseListener) { this.createManagedBean(mouseListener); } } handleMouseOverChange(isMouseOver) { this.eventSvc.dispatchEvent({ type: isMouseOver ? "columnHeaderMouseOver" : "columnHeaderMouseLeave", column: this.column.getProvidedColumnGroup() }); } setupTooltip(value, shouldDisplayTooltip) { this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderGroupTooltip( this.tooltipFeature, this, value, shouldDisplayTooltip ); } setupExpandable(compBean) { const providedColGroup = this.column.getProvidedColumnGroup(); this.refreshExpanded(); const listener = this.refreshExpanded.bind(this); compBean.addManagedListeners(providedColGroup, { expandedChanged: listener, expandableChanged: listener }); } refreshExpanded() { const { column } = this; this.expandable = column.isExpandable(); const expanded = column.isExpanded(); if (this.expandable) { this.comp.setAriaExpanded(expanded ? "true" : "false"); } else { this.comp.setAriaExpanded(void 0); } this.refreshHeaderStyles(); } addClasses() { const { column } = this; const colGroupDef = column.getColGroupDef(); const classes = _getHeaderClassesFromColDef(colGroupDef, this.gos, null, column); if (column.isPadding()) { classes.push("ag-header-group-cell-no-group"); const leafCols = column.getLeafColumns(); if (leafCols.every((col) => col.isSpanHeaderHeight())) { classes.push("ag-header-span-height"); } } else { classes.push("ag-header-group-cell-with-group"); if (colGroupDef?.wrapHeaderText) { classes.push("ag-header-cell-wrap-text"); } } for (const c of classes) { this.comp.toggleCss(c, true); } } setupMovingCss(compBean) { const { column } = this; const providedColumnGroup = column.getProvidedColumnGroup(); const leafColumns = providedColumnGroup.getLeafColumns(); const listener = () => this.comp.toggleCss("ag-header-cell-moving", column.isMoving()); for (const col of leafColumns) { compBean.addManagedListeners(col, { movingChanged: listener }); } listener(); } onFocusIn(e) { if (!this.eGui.contains(e.relatedTarget)) { this.focusThis(); this.announceAriaDescription(); } } handleKeyDown(e) { super.handleKeyDown(e); const wrapperHasFocus = this.getWrapperHasFocus(); if (!wrapperHasFocus) { return; } const { column, expandable, gos, beans } = this; const enableColumnSelection = _getEnableColumnSelection(gos); if (e.key != KeyCode.ENTER) { return; } if (enableColumnSelection && !e.altKey) { beans.rangeSvc?.handleColumnSelection(column, e); } else if (expandable) { const newExpandedValue = !column.isExpanded(); beans.colGroupSvc.setColumnGroupOpened( column.getProvidedColumnGroup(), newExpandedValue, "uiColumnExpanded" ); } } refreshAnnouncement() { let description; const { gos } = this; const enableColumnSelection = _getEnableColumnSelection(gos); if (enableColumnSelection) { const translate = this.getLocaleTextFunc(); description = translate( "ariaColumnGroupCellSelection", "Press Enter to toggle selection for all visible cells in this column group" ); } this.ariaAnnouncement = description; } announceAriaDescription() { const { beans, eGui, ariaAnnouncement } = this; if (!ariaAnnouncement || !eGui.contains(_getActiveDomElement(beans))) { return; } beans.ariaAnnounce?.announceValue(ariaAnnouncement, "columnHeader"); } // unlike columns, this will only get called once, as we don't react on props on column groups // (we will always destroy and recreate this comp if something changes) setDragSource(eHeaderGroup) { if (!this.isAlive() || this.isSuppressMoving()) { return; } this.removeDragSource(); if (!eHeaderGroup) { return; } this.dragSource = this.beans.colMoves?.setDragSourceForHeader(eHeaderGroup, this.column, this.displayName) ?? null; } isSuppressMoving() { return this.gos.get("suppressMovableColumns") || this.column.getLeafColumns().some((column) => column.getColDef().suppressMovable || column.getColDef().lockPosition); } destroy() { this.tooltipFeature = this.destroyBean(this.tooltipFeature); super.destroy(); } }; function setColumnGroupOpened(beans, group, newValue) { beans.colGroupSvc?.setColumnGroupOpened(group, newValue, "api"); } function getColumnGroup(beans, name, instanceId) { return beans.colGroupSvc?.getColumnGroup(name, instanceId) ?? null; } function getProvidedColumnGroup(beans, name) { return beans.colGroupSvc?.getProvidedColGroup(name) ?? null; } function getDisplayNameForColumnGroup(beans, columnGroup, location) { return beans.colNames.getDisplayNameForColumnGroup(columnGroup, location) || ""; } function getColumnGroupState(beans) { return beans.colGroupSvc?.getColumnGroupState() ?? []; } function setColumnGroupState(beans, stateItems) { beans.colGroupSvc?.setColumnGroupState(stateItems, "api"); } function resetColumnGroupState(beans) { beans.colGroupSvc?.resetColumnGroupState("api"); } function getLeftDisplayedColumnGroups(beans) { return beans.visibleCols.treeLeft; } function getCenterDisplayedColumnGroups(beans) { return beans.visibleCols.treeCenter; } function getRightDisplayedColumnGroups(beans) { return beans.visibleCols.treeRight; } function getAllDisplayedColumnGroups(beans) { return beans.visibleCols.getAllTrees(); } var GroupInstanceIdCreator = class { constructor() { this.existingIds = {}; } getInstanceIdForKey(key) { const lastResult = this.existingIds[key]; let result; if (typeof lastResult !== "number") { result = 0; } else { result = lastResult + 1; } this.existingIds[key] = result; return result; } }; function _removeAllFromUnorderedArray(array, toRemove) { for (let i = 0; i < toRemove.length; i++) { const index = array.indexOf(toRemove[i]); if (index >= 0) { array[index] = array[array.length - 1]; array.pop(); } } } var VisibleColsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "visibleCols"; this.colsAndGroupsMap = {}; this.leftCols = []; this.rightCols = []; this.centerCols = []; this.allCols = []; this.headerGroupRowCount = 0; this.bodyWidth = 0; this.leftWidth = 0; this.rightWidth = 0; this.isBodyWidthDirty = true; } refresh(source, skipTreeBuild = false) { const { colFlex, colModel, colGroupSvc, colViewport, selectionColSvc } = this.beans; if (!skipTreeBuild) { this.buildTrees(colModel, colGroupSvc); } colGroupSvc?.updateOpenClosedVisibility(); this.leftCols = pickDisplayedCols(this.treeLeft); this.centerCols = pickDisplayedCols(this.treeCenter); this.rightCols = pickDisplayedCols(this.treeRight); selectionColSvc?.refreshVisibility(this.leftCols, this.centerCols, this.rightCols); this.joinColsAriaOrder(colModel); this.joinCols(); this.headerGroupRowCount = this.getHeaderRowCount(); this.setLeftValues(source); this.autoHeightCols = this.allCols.filter((col) => col.isAutoHeight()); colFlex?.refreshFlexedColumns(); this.updateBodyWidths(); this.setFirstRightAndLastLeftPinned(colModel, this.leftCols, this.rightCols, source); colViewport.checkViewportColumns(false); this.eventSvc.dispatchEvent({ type: "displayedColumnsChanged", source }); } getHeaderRowCount() { if (!this.gos.get("hidePaddedHeaderRows")) { return this.beans.colModel.cols.treeDepth; } let headerGroupRowCount = 0; for (const col of this.allCols) { let parent = col.getParent(); while (parent) { if (!parent.isPadding()) { const level = parent.getProvidedColumnGroup().getLevel() + 1; if (level > headerGroupRowCount) { headerGroupRowCount = level; } break; } parent = parent.getParent(); } } return headerGroupRowCount; } // after setColumnWidth or updateGroupsAndPresentedCols updateBodyWidths() { const newBodyWidth = getWidthOfColsInList(this.centerCols); const newLeftWidth = getWidthOfColsInList(this.leftCols); const newRightWidth = getWidthOfColsInList(this.rightCols); this.isBodyWidthDirty = this.bodyWidth !== newBodyWidth; const atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth; if (atLeastOneChanged) { this.bodyWidth = newBodyWidth; this.leftWidth = newLeftWidth; this.rightWidth = newRightWidth; this.eventSvc.dispatchEvent({ type: "columnContainerWidthChanged" }); this.eventSvc.dispatchEvent({ type: "displayedColumnsWidthChanged" }); } } // sets the left pixel position of each column setLeftValues(source) { this.setLeftValuesOfCols(source); this.setLeftValuesOfGroups(); } setFirstRightAndLastLeftPinned(colModel, leftCols, rightCols, source) { let lastLeft; let firstRight; if (this.gos.get("enableRtl")) { lastLeft = leftCols ? leftCols[0] : null; firstRight = rightCols ? _last(rightCols) : null; } else { lastLeft = leftCols ? _last(leftCols) : null; firstRight = rightCols ? rightCols[0] : null; } for (const col of colModel.getCols()) { col.setLastLeftPinned(col === lastLeft, source); col.setFirstRightPinned(col === firstRight, source); } } buildTrees(colModel, columnGroupSvc) { const cols = colModel.getColsToShow(); const leftCols = cols.filter((col) => col.getPinned() == "left"); const rightCols = cols.filter((col) => col.getPinned() == "right"); const centerCols = cols.filter((col) => col.getPinned() != "left" && col.getPinned() != "right"); const idCreator = new GroupInstanceIdCreator(); const createGroups = (params) => { return columnGroupSvc ? columnGroupSvc.createColumnGroups(params) : params.columns; }; this.treeLeft = createGroups({ columns: leftCols, idCreator, pinned: "left", oldDisplayedGroups: this.treeLeft }); this.treeRight = createGroups({ columns: rightCols, idCreator, pinned: "right", oldDisplayedGroups: this.treeRight }); this.treeCenter = createGroups({ columns: centerCols, idCreator, pinned: null, oldDisplayedGroups: this.treeCenter }); this.updateColsAndGroupsMap(); } clear() { this.leftCols = []; this.rightCols = []; this.centerCols = []; this.allCols = []; this.ariaOrderColumns = []; } joinColsAriaOrder(colModel) { const allColumns = colModel.getCols(); const pinnedLeft = []; const center = []; const pinnedRight = []; for (const col of allColumns) { const pinned = col.getPinned(); if (!pinned) { center.push(col); } else if (pinned === true || pinned === "left") { pinnedLeft.push(col); } else { pinnedRight.push(col); } } this.ariaOrderColumns = pinnedLeft.concat(center).concat(pinnedRight); } getAriaColIndex(colOrGroup) { let col; if (isColumnGroup(colOrGroup)) { col = colOrGroup.getLeafColumns()[0]; } else { col = colOrGroup; } return this.ariaOrderColumns.indexOf(col) + 1; } setLeftValuesOfGroups() { for (const columns of [this.treeLeft, this.treeRight, this.treeCenter]) { for (const column of columns) { if (isColumnGroup(column)) { const columnGroup = column; columnGroup.checkLeft(); } } } } setLeftValuesOfCols(source) { const { colModel } = this.beans; const primaryCols = colModel.getColDefCols(); if (!primaryCols) { return; } const allColumns = colModel.getCols().slice(0); const doingRtl = this.gos.get("enableRtl"); for (const columns of [this.leftCols, this.rightCols, this.centerCols]) { if (doingRtl) { let left = getWidthOfColsInList(columns); for (const column of columns) { left -= column.getActualWidth(); column.setLeft(left, source); } } else { let left = 0; for (const column of columns) { column.setLeft(left, source); left += column.getActualWidth(); } } _removeAllFromUnorderedArray(allColumns, columns); } for (const column of allColumns) { column.setLeft(null, source); } } joinCols() { if (this.gos.get("enableRtl")) { this.allCols = this.rightCols.concat(this.centerCols).concat(this.leftCols); } else { this.allCols = this.leftCols.concat(this.centerCols).concat(this.rightCols); } } getAllTrees() { if (this.treeLeft && this.treeRight && this.treeCenter) { return this.treeLeft.concat(this.treeCenter).concat(this.treeRight); } return null; } // gridPanel -> ensureColumnVisible isColDisplayed(column) { return this.allCols.indexOf(column) >= 0; } getLeftColsForRow(rowNode) { const { leftCols, beans: { colModel } } = this; const colSpanActive = colModel.colSpanActive; if (!colSpanActive) { return leftCols; } return this.getColsForRow(rowNode, leftCols); } getRightColsForRow(rowNode) { const { rightCols, beans: { colModel } } = this; const colSpanActive = colModel.colSpanActive; if (!colSpanActive) { return rightCols; } return this.getColsForRow(rowNode, rightCols); } getColsForRow(rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) { const result = []; let lastConsideredCol = null; for (let i = 0; i < displayedColumns.length; i++) { const col = displayedColumns[i]; const maxAllowedColSpan = displayedColumns.length - i; const colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan); const columnsToCheckFilter = [col]; if (colSpan > 1) { const colsToRemove = colSpan - 1; for (let j = 1; j <= colsToRemove; j++) { columnsToCheckFilter.push(displayedColumns[i + j]); } i += colsToRemove; } let filterPasses; if (filterCallback) { filterPasses = false; for (const colForFilter of columnsToCheckFilter) { if (filterCallback(colForFilter)) { filterPasses = true; } } } else { filterPasses = true; } if (filterPasses) { if (result.length === 0 && lastConsideredCol) { const gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false; if (gapBeforeColumn) { result.push(lastConsideredCol); } } result.push(col); } lastConsideredCol = col; } return result; } getContainerWidth(pinned) { switch (pinned) { case "left": return this.leftWidth; case "right": return this.rightWidth; default: return this.bodyWidth; } } getColBefore(col) { const allDisplayedColumns = this.allCols; const oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex > 0) { return allDisplayedColumns[oldIndex - 1]; } return null; } isPinningLeft() { return this.leftCols.length > 0; } isPinningRight() { return this.rightCols.length > 0; } updateColsAndGroupsMap() { this.colsAndGroupsMap = {}; const func = (child) => { this.colsAndGroupsMap[child.getUniqueId()] = child; }; depthFirstAllColumnTreeSearch(this.treeCenter, false, func); depthFirstAllColumnTreeSearch(this.treeLeft, false, func); depthFirstAllColumnTreeSearch(this.treeRight, false, func); } isVisible(item) { const fromMap = this.colsAndGroupsMap[item.getUniqueId()]; return fromMap === item; } getFirstColumn() { const isRtl = this.gos.get("enableRtl"); const queryOrder = ["leftCols", "centerCols", "rightCols"]; if (isRtl) { queryOrder.reverse(); } for (let i = 0; i < queryOrder.length; i++) { const container = this[queryOrder[i]]; if (container.length) { return isRtl ? _last(container) : container[0]; } } return null; } // used by: // + rowRenderer -> for navigation getColAfter(col) { const allDisplayedColumns = this.allCols; const oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex < allDisplayedColumns.length - 1) { return allDisplayedColumns[oldIndex + 1]; } return null; } // used by: // + angularGrid -> setting pinned body width // note: this should be cached getColsLeftWidth() { return getWidthOfColsInList(this.leftCols); } // note: this should be cached getDisplayedColumnsRightWidth() { return getWidthOfColsInList(this.rightCols); } isColAtEdge(col, edge) { const allColumns = this.allCols; if (!allColumns.length) { return false; } const isFirst = edge === "first"; let columnToCompare; if (isColumnGroup(col)) { const leafColumns = col.getDisplayedLeafColumns(); if (!leafColumns.length) { return false; } columnToCompare = isFirst ? leafColumns[0] : _last(leafColumns); } else { columnToCompare = col; } return (isFirst ? allColumns[0] : _last(allColumns)) === columnToCompare; } }; function depthFirstAllColumnTreeSearch(tree, useDisplayedChildren, callback) { if (!tree) { return; } for (let i = 0; i < tree.length; i++) { const child = tree[i]; if (isColumnGroup(child)) { const childTree = useDisplayedChildren ? child.getDisplayedChildren() : child.getChildren(); depthFirstAllColumnTreeSearch(childTree, useDisplayedChildren, callback); } callback(child); } } function pickDisplayedCols(tree) { const res = []; depthFirstAllColumnTreeSearch(tree, true, (child) => { if (isColumn(child)) { res.push(child); } }); return res; } var ColumnGroupService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colGroupSvc"; } getColumnGroupState() { const columnGroupState = []; const gridBalancedTree = this.beans.colModel.getColTree(); depthFirstOriginalTreeSearch(null, gridBalancedTree, (node) => { if (isProvidedColumnGroup(node)) { columnGroupState.push({ groupId: node.getGroupId(), open: node.isExpanded() }); } }); return columnGroupState; } resetColumnGroupState(source) { const primaryColumnTree = this.beans.colModel.getColDefColTree(); if (!primaryColumnTree) { return; } const stateItems = []; depthFirstOriginalTreeSearch(null, primaryColumnTree, (child) => { if (isProvidedColumnGroup(child)) { const colGroupDef = child.getColGroupDef(); const groupState = { groupId: child.getGroupId(), open: !colGroupDef ? void 0 : colGroupDef.openByDefault }; stateItems.push(groupState); } }); this.setColumnGroupState(stateItems, source); } setColumnGroupState(stateItems, source) { const { colModel, colAnimation, visibleCols, eventSvc } = this.beans; const gridBalancedTree = colModel.getColTree(); if (!gridBalancedTree.length) { return; } colAnimation?.start(); const impactedGroups = []; for (const stateItem of stateItems) { const groupKey = stateItem.groupId; const newValue = stateItem.open; const providedColumnGroup = this.getProvidedColGroup(groupKey); if (!providedColumnGroup) { continue; } if (providedColumnGroup.isExpanded() === newValue) { continue; } providedColumnGroup.setExpanded(newValue); impactedGroups.push(providedColumnGroup); } visibleCols.refresh(source, true); if (impactedGroups.length) { eventSvc.dispatchEvent({ type: "columnGroupOpened", columnGroup: impactedGroups.length === 1 ? impactedGroups[0] : void 0, columnGroups: impactedGroups }); } colAnimation?.finish(); } // called by headerRenderer - when a header is opened or closed setColumnGroupOpened(key, newValue, source) { let keyAsString; if (isProvidedColumnGroup(key)) { keyAsString = key.getId(); } else { keyAsString = key || ""; } this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source); } getProvidedColGroup(key) { let res = null; depthFirstOriginalTreeSearch(null, this.beans.colModel.getColTree(), (node) => { if (isProvidedColumnGroup(node)) { if (node.getId() === key) { res = node; } } }); return res; } getGroupAtDirection(columnGroup, direction) { const requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel(); const colGroupLeafColumns = columnGroup.getDisplayedLeafColumns(); const col = direction === "After" ? _last(colGroupLeafColumns) : colGroupLeafColumns[0]; const getDisplayColMethod = `getCol${direction}`; while (true) { const column = this.beans.visibleCols[getDisplayColMethod](col); if (!column) { return null; } const groupPointer = this.getColGroupAtLevel(column, requiredLevel); if (groupPointer !== columnGroup) { return groupPointer; } } } getColGroupAtLevel(column, level) { let groupPointer = column.getParent(); let originalGroupLevel; let groupPointerLevel; while (true) { const groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup(); originalGroupLevel = groupPointerProvidedColumnGroup.getLevel(); groupPointerLevel = groupPointer.getPaddingLevel(); if (originalGroupLevel + groupPointerLevel <= level) { break; } groupPointer = groupPointer.getParent(); } return groupPointer; } updateOpenClosedVisibility() { const allColumnGroups = this.beans.visibleCols.getAllTrees(); depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => { if (isColumnGroup(child)) { child.calculateDisplayedColumns(); } }); } // returns the group with matching colId and instanceId. If instanceId is missing, // matches only on the colId. getColumnGroup(colId, partId) { if (!colId) { return null; } if (isColumnGroup(colId)) { return colId; } const allColumnGroups = this.beans.visibleCols.getAllTrees(); const checkPartId = typeof partId === "number"; let result = null; depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => { if (isColumnGroup(child)) { const columnGroup = child; let matched; if (checkPartId) { matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId(); } else { matched = colId === columnGroup.getGroupId(); } if (matched) { result = columnGroup; } } }); return result; } createColumnGroups(params) { const { columns, idCreator, pinned, oldDisplayedGroups, isStandaloneStructure } = params; const oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups); const topLevelResultCols = []; let groupsOrColsAtCurrentLevel = columns; while (groupsOrColsAtCurrentLevel.length) { const currentlyIterating = groupsOrColsAtCurrentLevel; groupsOrColsAtCurrentLevel = []; let lastGroupedColIdx = 0; const createGroupToIndex = (to) => { const from = lastGroupedColIdx; lastGroupedColIdx = to; const previousNode = currentlyIterating[from]; const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode; const previousNodeParent = previousNodeProvided.getOriginalParent(); if (previousNodeParent == null) { for (let i = from; i < to; i++) { topLevelResultCols.push(currentlyIterating[i]); } return; } const newGroup = this.createColumnGroup( previousNodeParent, idCreator, oldColumnsMapped, pinned, isStandaloneStructure ); for (let i = from; i < to; i++) { newGroup.addChild(currentlyIterating[i]); } groupsOrColsAtCurrentLevel.push(newGroup); }; for (let i = 1; i < currentlyIterating.length; i++) { const thisNode = currentlyIterating[i]; const thisNodeProvided = isColumnGroup(thisNode) ? thisNode.getProvidedColumnGroup() : thisNode; const thisNodeParent = thisNodeProvided.getOriginalParent(); const previousNode = currentlyIterating[lastGroupedColIdx]; const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode; const previousNodeParent = previousNodeProvided.getOriginalParent(); if (thisNodeParent !== previousNodeParent) { createGroupToIndex(i); } } if (lastGroupedColIdx < currentlyIterating.length) { createGroupToIndex(currentlyIterating.length); } } if (!isStandaloneStructure) { this.setupParentsIntoCols(topLevelResultCols, null); } return topLevelResultCols; } createProvidedColumnGroup(primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups, source) { const groupId = columnKeyCreator.getUniqueKey(colGroupDef.groupId || null, null); const colGroupDefMerged = createMergedColGroupDef(this.beans, colGroupDef, groupId); const providedGroup = new AgProvidedColumnGroup(colGroupDefMerged, groupId, false, level); this.createBean(providedGroup); const existingGroupAndIndex = this.findExistingGroup(colGroupDef, existingGroups); if (existingGroupAndIndex) { existingGroups.splice(existingGroupAndIndex.idx, 1); } const existingGroup = existingGroupAndIndex?.group; if (existingGroup) { providedGroup.setExpanded(existingGroup.isExpanded()); } const children = _recursivelyCreateColumns( this.beans, colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, existingGroups, source ); providedGroup.setChildren(children); return providedGroup; } balanceColumnTree(unbalancedTree, currentDepth, columnDepth, columnKeyCreator) { const result = []; for (let i = 0; i < unbalancedTree.length; i++) { const child = unbalancedTree[i]; if (isProvidedColumnGroup(child)) { const originalGroup = child; const newChildren = this.balanceColumnTree( originalGroup.getChildren(), currentDepth + 1, columnDepth, columnKeyCreator ); originalGroup.setChildren(newChildren); result.push(originalGroup); } else { let firstPaddedGroup; let currentPaddedGroup; for (let j = currentDepth; j < columnDepth; j++) { const newColId = columnKeyCreator.getUniqueKey(null, null); const colGroupDefMerged = createMergedColGroupDef(this.beans, null, newColId); const paddedGroup = new AgProvidedColumnGroup(colGroupDefMerged, newColId, true, j); this.createBean(paddedGroup); if (currentPaddedGroup) { currentPaddedGroup.setChildren([paddedGroup]); } currentPaddedGroup = paddedGroup; if (!firstPaddedGroup) { firstPaddedGroup = currentPaddedGroup; } } if (firstPaddedGroup && currentPaddedGroup) { result.push(firstPaddedGroup); const hasGroups = unbalancedTree.some((leaf) => isProvidedColumnGroup(leaf)); if (hasGroups) { currentPaddedGroup.setChildren([child]); continue; } else { currentPaddedGroup.setChildren(unbalancedTree); break; } } result.push(child); } } return result; } findDepth(balancedColumnTree) { let depth = 0; let pointer = balancedColumnTree; while (pointer?.[0] && isProvidedColumnGroup(pointer[0])) { depth++; pointer = pointer[0].getChildren(); } return depth; } findMaxDepth(treeChildren, depth) { let maxDepthThisLevel = depth; for (let i = 0; i < treeChildren.length; i++) { const abstractColumn = treeChildren[i]; if (isProvidedColumnGroup(abstractColumn)) { const originalGroup = abstractColumn; const newDepth = this.findMaxDepth(originalGroup.getChildren(), depth + 1); if (maxDepthThisLevel < newDepth) { maxDepthThisLevel = newDepth; } } } return maxDepthThisLevel; } /** * Inserts dummy group columns in the hierarchy above auto-generated columns * in order to ensure auto-generated columns are leaf nodes (and therefore are * displayed correctly) */ balanceTreeForAutoCols(autoCols, depth) { const tree = []; for (const col of autoCols) { let nextChild = col; for (let i = depth - 1; i >= 0; i--) { const autoGroup = new AgProvidedColumnGroup(null, `FAKE_PATH_${col.getId()}_${i}`, true, i); this.createBean(autoGroup); autoGroup.setChildren([nextChild]); nextChild.originalParent = autoGroup; nextChild = autoGroup; } if (depth === 0) { col.originalParent = null; } tree.push(nextChild); } return tree; } findExistingGroup(newGroupDef, existingGroups) { const newHasId = newGroupDef.groupId != null; if (!newHasId) { return void 0; } for (let i = 0; i < existingGroups.length; i++) { const existingGroup = existingGroups[i]; const existingDef = existingGroup.getColGroupDef(); if (!existingDef) { continue; } if (existingGroup.getId() === newGroupDef.groupId) { return { idx: i, group: existingGroup }; } } return void 0; } createColumnGroup(providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned, isStandaloneStructure) { const groupId = providedGroup.getGroupId(); const instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId); const uniqueId = createUniqueColumnGroupId(groupId, instanceId); let columnGroup = oldColumnsMapped[uniqueId]; if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) { columnGroup = null; } if (_exists(columnGroup)) { columnGroup.reset(); } else { columnGroup = new AgColumnGroup(providedGroup, groupId, instanceId, pinned); if (!isStandaloneStructure) { this.createBean(columnGroup); } } return columnGroup; } // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup mapOldGroupsById(displayedGroups) { const result = {}; const recursive = (columnsOrGroups) => { for (const columnOrGroup of columnsOrGroups) { if (isColumnGroup(columnOrGroup)) { const columnGroup = columnOrGroup; result[columnOrGroup.getUniqueId()] = columnGroup; recursive(columnGroup.getChildren()); } } }; if (displayedGroups) { recursive(displayedGroups); } return result; } setupParentsIntoCols(columnsOrGroups, parent) { for (const columnsOrGroup of columnsOrGroups ?? []) { if (columnsOrGroup.parent !== parent) { this.beans.colViewport.colsWithinViewportHash = ""; } columnsOrGroup.parent = parent; if (isColumnGroup(columnsOrGroup)) { const columnGroup = columnsOrGroup; this.setupParentsIntoCols(columnGroup.getChildren(), columnGroup); } } } }; var ColumnGroupModule = { moduleName: "ColumnGroup", version: VERSION, dynamicBeans: { headerGroupCellCtrl: HeaderGroupCellCtrl }, beans: [ColumnGroupService], apiFunctions: { getAllDisplayedColumnGroups, getCenterDisplayedColumnGroups, getColumnGroup, getColumnGroupState, getDisplayNameForColumnGroup, getLeftDisplayedColumnGroups, getProvidedColumnGroup, getRightDisplayedColumnGroups, resetColumnGroupState, setColumnGroupOpened, setColumnGroupState } }; function _applyColumnState(beans, params, source) { const { colModel, rowGroupColsSvc, pivotColsSvc, autoColSvc, selectionColSvc, colAnimation, visibleCols, pivotResultCols, environment, valueColsSvc, eventSvc, gos } = beans; const providedCols = colModel.getColDefCols() ?? []; const selectionCols = selectionColSvc?.getColumns(); if (!providedCols.length && !selectionCols?.length) { return false; } if (params?.state && !params.state.forEach) { _warn(32); return false; } const syncColumnWithStateItem = (column, stateItem, rowGroupIndexes, pivotIndexes, autoCol) => { if (!column) { return; } const getValue = getValueFactory(stateItem, params.defaultState); const flex = getValue("flex").value1; const maybeSortDirection = getValue("sort").value1; const maybeSortType = getValue("sortType").value1; const isSortUpdate = _isSortDirectionValid(maybeSortDirection) || _isSortTypeValid(maybeSortType); const type = _normalizeSortType(maybeSortType); const direction = _normalizeSortDirection(maybeSortDirection); const newSortDef = isSortUpdate ? { type, direction } : void 0; updateSomeColumnState( beans, column, getValue("hide").value1, newSortDef, getValue("sortIndex").value1, getValue("pinned").value1, flex, source ); if (flex == null) { const width = getValue("width").value1; if (width != null) { const minColWidth = column.getColDef().minWidth ?? environment.getDefaultColumnMinWidth(); if (minColWidth != null && width >= minColWidth) { column.setActualWidth(width, source); } } } if (autoCol || !column.isPrimary()) { return; } valueColsSvc?.syncColumnWithState(column, source, getValue); rowGroupColsSvc?.syncColumnWithState(column, source, getValue, rowGroupIndexes); pivotColsSvc?.syncColumnWithState(column, source, getValue, pivotIndexes); }; const applyStates = (states, existingColumns, getById2) => { const dispatchEventsFunc = _compareColumnStatesAndDispatchEvents(beans, source); const columnsWithNoState = existingColumns.slice(); const rowGroupIndexes = {}; const pivotIndexes = {}; const autoColStates = []; const selectionColStates = []; const unmatchedAndAutoStates2 = []; let unmatchedCount2 = 0; const previousRowGroupCols = rowGroupColsSvc?.columns.slice() ?? []; const previousPivotCols = pivotColsSvc?.columns.slice() ?? []; for (const state of states) { const colId = state.colId; const isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID); if (isAutoGroupColumn) { autoColStates.push(state); unmatchedAndAutoStates2.push(state); continue; } if (isColumnSelectionCol(colId)) { selectionColStates.push(state); unmatchedAndAutoStates2.push(state); continue; } const column = getById2(colId); if (!column) { unmatchedAndAutoStates2.push(state); unmatchedCount2 += 1; } else { syncColumnWithStateItem(column, state, rowGroupIndexes, pivotIndexes, false); _removeFromArray(columnsWithNoState, column); } } const applyDefaultsFunc = (col) => syncColumnWithStateItem(col, null, rowGroupIndexes, pivotIndexes, false); columnsWithNoState.forEach(applyDefaultsFunc); rowGroupColsSvc?.sortColumns(comparatorByIndex.bind(rowGroupColsSvc, rowGroupIndexes, previousRowGroupCols)); pivotColsSvc?.sortColumns(comparatorByIndex.bind(pivotColsSvc, pivotIndexes, previousPivotCols)); colModel.refreshCols(false, source); const syncColStates = (getCol, colStates, columns = []) => { for (const stateItem of colStates) { const col = getCol(stateItem.colId); _removeFromArray(columns, col); syncColumnWithStateItem(col, stateItem, null, null, true); } columns.forEach(applyDefaultsFunc); }; syncColStates( (colId) => autoColSvc?.getColumn(colId) ?? null, autoColStates, autoColSvc?.getColumns()?.slice() ); syncColStates( (colId) => selectionColSvc?.getColumn(colId) ?? null, selectionColStates, selectionColSvc?.getColumns()?.slice() ); orderLiveColsLikeState(params, colModel, gos); visibleCols.refresh(source); eventSvc.dispatchEvent({ type: "columnEverythingChanged", source }); dispatchEventsFunc(); return { unmatchedAndAutoStates: unmatchedAndAutoStates2, unmatchedCount: unmatchedCount2 }; }; colAnimation?.start(); let { unmatchedAndAutoStates, unmatchedCount } = applyStates( params.state || [], providedCols, (id) => colModel.getColDefCol(id) ); if (unmatchedAndAutoStates.length > 0 || _exists(params.defaultState)) { const pivotResultColsList = pivotResultCols?.getPivotResultCols()?.list ?? []; unmatchedCount = applyStates( unmatchedAndAutoStates, pivotResultColsList, (id) => pivotResultCols?.getPivotResultCol(id) ?? null ).unmatchedCount; } colAnimation?.finish(); return unmatchedCount === 0; } function _resetColumnState(beans, source) { const { colModel, autoColSvc, selectionColSvc, eventSvc, gos } = beans; const primaryCols = colModel.getColDefCols(); if (!primaryCols?.length) { return; } const primaryColumnTree = colModel.getColDefColTree(); const primaryColumns = _getColumnsFromTree(primaryColumnTree); const columnStates = []; let letRowGroupIndex = 1e3; let letPivotIndex = 1e3; const addColState = (col) => { const stateItem = getColumnStateFromColDef(col); if (_missing(stateItem.rowGroupIndex) && stateItem.rowGroup) { stateItem.rowGroupIndex = letRowGroupIndex++; } if (_missing(stateItem.pivotIndex) && stateItem.pivot) { stateItem.pivotIndex = letPivotIndex++; } columnStates.push(stateItem); }; autoColSvc?.getColumns()?.forEach(addColState); selectionColSvc?.getColumns()?.forEach(addColState); primaryColumns?.forEach(addColState); _applyColumnState(beans, { state: columnStates }, source); const autoCols = autoColSvc?.getColumns() ?? []; const selectionCols = selectionColSvc?.getColumns() ?? []; const orderedCols = [...selectionCols, ...autoCols, ...primaryCols]; const orderedColState = orderedCols.map((col) => ({ colId: col.colId })); _applyColumnState(beans, { state: orderedColState, applyOrder: true }, source); eventSvc.dispatchEvent(_addGridCommonParams(gos, { type: "columnsReset", source })); } function _compareColumnStatesAndDispatchEvents(beans, source) { const { rowGroupColsSvc, pivotColsSvc, valueColsSvc, colModel, sortSvc, eventSvc } = beans; const startState = { rowGroupColumns: rowGroupColsSvc?.columns.slice() ?? [], pivotColumns: pivotColsSvc?.columns.slice() ?? [], valueColumns: valueColsSvc?.columns.slice() ?? [] }; const columnStateBefore = _getColumnState(beans); const columnStateBeforeMap = {}; for (const col of columnStateBefore) { columnStateBeforeMap[col.colId] = col; } return () => { const dispatchWhenListsDifferent = (eventType, colsBefore, colsAfter, idMapper) => { const beforeList = colsBefore.map(idMapper); const afterList = colsAfter.map(idMapper); const unchanged = _areEqual(beforeList, afterList); if (unchanged) { return; } const changes = new Set(colsBefore); for (const id of colsAfter) { if (!changes.delete(id)) { changes.add(id); } } const changesArr = [...changes]; eventSvc.dispatchEvent({ type: eventType, columns: changesArr, column: changesArr.length === 1 ? changesArr[0] : null, source }); }; const getChangedColumns = (changedPredicate) => { const changedColumns2 = []; colModel.forAllCols((column) => { const colStateBefore = columnStateBeforeMap[column.getColId()]; if (colStateBefore && changedPredicate(colStateBefore, column)) { changedColumns2.push(column); } }); return changedColumns2; }; const columnIdMapper = (c) => c.getColId(); dispatchWhenListsDifferent( "columnRowGroupChanged", startState.rowGroupColumns, rowGroupColsSvc?.columns ?? [], columnIdMapper ); dispatchWhenListsDifferent( "columnPivotChanged", startState.pivotColumns, pivotColsSvc?.columns ?? [], columnIdMapper ); const valueChangePredicate = (cs, c) => { const oldActive = cs.aggFunc != null; const activeChanged = oldActive != c.isValueActive(); const aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc(); return activeChanged || aggFuncChanged; }; const changedValues = getChangedColumns(valueChangePredicate); if (changedValues.length > 0) { dispatchColumnChangedEvent(eventSvc, "columnValueChanged", changedValues, source); } const resizeChangePredicate = (cs, c) => cs.width != c.getActualWidth(); dispatchColumnResizedEvent(eventSvc, getChangedColumns(resizeChangePredicate), true, source); const pinnedChangePredicate = (cs, c) => cs.pinned != c.getPinned(); dispatchColumnPinnedEvent(eventSvc, getChangedColumns(pinnedChangePredicate), source); const visibilityChangePredicate = (cs, c) => cs.hide == c.isVisible(); dispatchColumnVisibleEvent(eventSvc, getChangedColumns(visibilityChangePredicate), source); const sortChangePredicate = (cs, c) => !_areSortDefsEqual(c.getSortDef(), { type: _normalizeSortType(cs.sortType), direction: _normalizeSortDirection(cs.sort) }) || cs.sortIndex != c.getSortIndex(); const changedColumns = getChangedColumns(sortChangePredicate); if (changedColumns.length > 0) { sortSvc?.dispatchSortChangedEvents(source, changedColumns); } const colStateAfter = _getColumnState(beans); normaliseColumnMovedEventForColumnState(columnStateBefore, colStateAfter, source, colModel, eventSvc); }; } function _getColumnState(beans) { const { colModel, rowGroupColsSvc, pivotColsSvc } = beans; const primaryCols = colModel.getColDefCols(); if (_missing(primaryCols) || !colModel.isAlive()) { return []; } const rowGroupColumns = rowGroupColsSvc?.columns; const pivotColumns = pivotColsSvc?.columns; const res = []; const createStateItemFromColumn = (column) => { const rowGroupIndex = column.isRowGroupActive() && rowGroupColumns ? rowGroupColumns.indexOf(column) : null; const pivotIndex = column.isPivotActive() && pivotColumns ? pivotColumns.indexOf(column) : null; const aggFunc = column.isValueActive() ? column.getAggFunc() : null; const sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null; res.push({ colId: column.getColId(), width: column.getActualWidth(), hide: !column.isVisible(), pinned: column.getPinned(), sort: column.getSort(), sortType: column.getSortDef()?.type, sortIndex, aggFunc, rowGroup: column.isRowGroupActive(), rowGroupIndex, pivot: column.isPivotActive(), pivotIndex, flex: column.getFlex() ?? null }); }; colModel.forAllCols((col) => createStateItemFromColumn(col)); const colIdToGridIndexMap = new Map( colModel.getCols().map((col, index) => [col.getColId(), index]) ); res.sort((itemA, itemB) => { const posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1; const posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1; return posA - posB; }); return res; } function getColumnStateFromColDef(column) { const getValueOrNull = (a, b) => a != null ? a : b != null ? b : null; const colDef = column.getColDef(); const sortDefFromColDef = _getSortDefFromInput(getValueOrNull(colDef.sort, colDef.initialSort)); const sort = sortDefFromColDef.direction; const sortType = sortDefFromColDef.type; const sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex); const hide = getValueOrNull(colDef.hide, colDef.initialHide); const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned); const width = getValueOrNull(colDef.width, colDef.initialWidth); const flex = getValueOrNull(colDef.flex, colDef.initialFlex); let rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex); let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup); if (rowGroupIndex == null && !rowGroup) { rowGroupIndex = null; rowGroup = null; } let pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex); let pivot = getValueOrNull(colDef.pivot, colDef.initialPivot); if (pivotIndex == null && !pivot) { pivotIndex = null; pivot = null; } const aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc); return { colId: column.getColId(), sort, sortType, sortIndex, hide, pinned, width, flex, rowGroup, rowGroupIndex, pivot, pivotIndex, aggFunc }; } function orderLiveColsLikeState(params, colModel, gos) { if (!params.applyOrder || !params.state) { return; } const colIds = []; for (const item of params.state) { if (item.colId != null) { colIds.push(item.colId); } } sortColsLikeKeys(colModel.cols, colIds, colModel, gos); } function sortColsLikeKeys(cols, colIds, colModel, gos) { if (cols == null) { return; } let newOrder = []; const processedColIds = {}; for (const colId of colIds) { if (processedColIds[colId]) { continue; } const col = cols.map[colId]; if (col) { newOrder.push(col); processedColIds[colId] = true; } } let autoGroupInsertIndex = 0; for (const col of cols.list) { const colId = col.getColId(); const alreadyProcessed = processedColIds[colId] != null; if (alreadyProcessed) { continue; } const isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID); if (isAutoGroupCol) { newOrder.splice(autoGroupInsertIndex++, 0, col); } else { newOrder.push(col); } } newOrder = placeLockedColumns(newOrder, gos); if (!doesMovePassMarryChildren(newOrder, colModel.getColTree())) { _warn(39); return; } cols.list = newOrder; } function normaliseColumnMovedEventForColumnState(colStateBefore, colStateAfter, source, colModel, eventSvc) { const colStateAfterMapped = {}; for (const s2 of colStateAfter) { colStateAfterMapped[s2.colId] = s2; } const colsIntersectIds = {}; for (const s2 of colStateBefore) { if (colStateAfterMapped[s2.colId]) { colsIntersectIds[s2.colId] = true; } } const beforeFiltered = colStateBefore.filter((c) => colsIntersectIds[c.colId]); const afterFiltered = colStateAfter.filter((c) => colsIntersectIds[c.colId]); const movedColumns = []; afterFiltered.forEach((csAfter, index) => { const csBefore = beforeFiltered?.[index]; if (csBefore && csBefore.colId !== csAfter.colId) { const gridCol = colModel.getCol(csBefore.colId); if (gridCol) { movedColumns.push(gridCol); } } }); if (!movedColumns.length) { return; } eventSvc.dispatchEvent({ type: "columnMoved", columns: movedColumns, column: movedColumns.length === 1 ? movedColumns[0] : null, finished: true, source }); } var comparatorByIndex = (indexes, oldList, colA, colB) => { const indexA = indexes[colA.getId()]; const indexB = indexes[colB.getId()]; const aHasIndex = indexA != null; const bHasIndex = indexB != null; if (aHasIndex && bHasIndex) { return indexA - indexB; } if (aHasIndex) { return -1; } if (bHasIndex) { return 1; } const oldIndexA = oldList.indexOf(colA); const oldIndexB = oldList.indexOf(colB); const aHasOldIndex = oldIndexA >= 0; const bHasOldIndex = oldIndexB >= 0; if (aHasOldIndex && bHasOldIndex) { return oldIndexA - oldIndexB; } if (aHasOldIndex) { return -1; } return 1; }; var ColumnModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colModel"; this.pivotMode = false; this.ready = false; this.changeEventsDispatching = false; } postConstruct() { this.pivotMode = this.gos.get("pivotMode"); this.addManagedPropertyListeners( [ "groupDisplayType", "treeData", "treeDataDisplayType", "groupHideOpenParents", "groupHideColumnsUntilExpanded", "rowNumbers", "hidePaddedHeaderRows" ], (event) => this.refreshAll(_convertColumnEventSourceType(event.source)) ); this.addManagedPropertyListeners( ["defaultColDef", "defaultColGroupDef", "columnTypes", "suppressFieldDotNotation"], this.recreateColumnDefs.bind(this) ); this.addManagedPropertyListener( "pivotMode", (event) => this.setPivotMode(this.gos.get("pivotMode"), _convertColumnEventSourceType(event.source)) ); } // called from SyncService, when grid has finished initialising createColsFromColDefs(source) { const { beans } = this; const { valueCache, colAutosize, rowGroupColsSvc, pivotColsSvc, valueColsSvc, visibleCols, eventSvc, groupHierarchyColSvc } = beans; const dispatchEventsFunc = this.colDefs ? _compareColumnStatesAndDispatchEvents(beans, source) : void 0; valueCache?.expire(); const oldCols = this.colDefCols?.list; const oldTree = this.colDefCols?.tree; const newTree = _createColumnTree(beans, this.colDefs, true, oldTree, source); _destroyColumnTree(beans, this.colDefCols?.tree, newTree.columnTree); const tree = newTree.columnTree; const treeDepth = newTree.treeDepth; const list = _getColumnsFromTree(tree); const map = {}; for (const col of list) { map[col.getId()] = col; } this.colDefCols = { tree, treeDepth, list, map }; this.createColumnsForService([groupHierarchyColSvc], this.colDefCols, source); rowGroupColsSvc?.extractCols(source, oldCols); pivotColsSvc?.extractCols(source, oldCols); valueColsSvc?.extractCols(source, oldCols); this.ready = true; this.changeEventsDispatching = true; this.refreshCols(true, source); this.changeEventsDispatching = false; visibleCols.refresh(source); eventSvc.dispatchEvent({ type: "columnEverythingChanged", source }); if (dispatchEventsFunc) { this.changeEventsDispatching = true; dispatchEventsFunc(); this.changeEventsDispatching = false; } eventSvc.dispatchEvent({ type: "newColumnsLoaded", source }); if (source === "gridInitializing") { colAutosize?.applyAutosizeStrategy(); } } // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents') // createColsFromColDefs (recreateColumnDefs, setColumnsDefs), // setPivotMode, applyColumnState, // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList, // pivotResultCols.setPivotResultCols refreshCols(newColDefs, source) { if (!this.colDefCols) { return; } const prevColTree = this.cols?.tree; this.saveColOrder(); const { autoColSvc, selectionColSvc, rowNumbersSvc, quickFilter, pivotResultCols, showRowGroupCols, rowAutoHeight, visibleCols, colViewport, eventSvc, formula } = this.beans; const cols = this.selectCols(pivotResultCols, this.colDefCols); formula?.setFormulasActive(cols); this.createColumnsForService([autoColSvc, selectionColSvc, rowNumbersSvc], cols, source); const shouldSortNewColDefs = _shouldMaintainColumnOrder(this.gos, this.showingPivotResult); if (!newColDefs || shouldSortNewColDefs) { this.restoreColOrder(cols); } this.positionLockedCols(cols); showRowGroupCols?.refresh(); quickFilter?.refreshCols(); this.setColSpanActive(); rowAutoHeight?.setAutoHeightActive(cols); visibleCols.clear(); colViewport.clear(); if (!_areEqual(prevColTree, this.cols.tree)) { eventSvc.dispatchEvent({ type: "gridColumnsChanged" }); } } createColumnsForService(services, cols, source) { for (const service of services) { if (!service) { continue; } service.createColumns( cols, (updateOrder) => { this.lastOrder = updateOrder(this.lastOrder); this.lastPivotOrder = updateOrder(this.lastPivotOrder); }, source ); service.addColumns(cols); } } selectCols(pivotResultColsSvc, colDefCols) { const pivotResultCols = pivotResultColsSvc?.getPivotResultCols() ?? null; this.showingPivotResult = pivotResultCols != null; const { map, list, tree, treeDepth } = pivotResultCols ?? colDefCols; this.cols = { list: list.slice(), map: { ...map }, tree: tree.slice(), treeDepth }; if (pivotResultCols) { const hasSameColumns = pivotResultCols.list.some((col) => this.cols?.map[col.getColId()] !== void 0); if (!hasSameColumns) { this.lastPivotOrder = null; } } return this.cols; } getColsToShow() { if (!this.cols) { return []; } const { beans, showingPivotResult, cols } = this; const { valueColsSvc, selectionColSvc, gos } = beans; const showAutoGroupAndValuesOnly = this.isPivotMode() && !showingPivotResult; const showSelectionColumn = selectionColSvc?.isSelectionColumnEnabled(); const showRowNumbers = _isRowNumbers(beans); const valueColumns = valueColsSvc?.columns; const hideEmptyAutoColGroups = _isGroupHideColumnsUntilExpanded(gos); const res = cols.list.filter((col) => { const isAutoGroupCol = isColumnGroupAutoCol(col); if (showAutoGroupAndValuesOnly) { const isValueCol = valueColumns?.includes(col); return isValueCol || isAutoGroupCol && (!hideEmptyAutoColGroups || col.isVisible()) || showSelectionColumn && isColumnSelectionCol(col) || showRowNumbers && isRowNumberCol(col); } else { return isAutoGroupCol && !hideEmptyAutoColGroups || col.isVisible(); } }); return res; } // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents' refreshAll(source) { if (!this.ready) { return; } this.refreshCols(false, source); this.beans.visibleCols.refresh(source); } setColsVisible(keys, visible = false, source) { _applyColumnState( this.beans, { state: keys.map((key) => ({ colId: typeof key === "string" ? key : key.getColId(), hide: !visible })) }, source ); } /** * Restores provided columns order to the previous order in this.lastPivotOrder / this.lastOrder * If columns are not in the last order: * - Check column groups, and apply column after the last column in the lowest shared group * - If no sibling is found, apply the column at the end of the cols */ restoreColOrder(cols) { const lastOrder = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder; if (!lastOrder) { return; } const preservedOrder = lastOrder.filter((col) => cols.map[col.getId()] != null); if (preservedOrder.length === 0) { return; } if (preservedOrder.length === cols.list.length) { cols.list = preservedOrder; return; } const hasSiblings = (col) => { const ancestor = col.getOriginalParent(); if (!ancestor) { return false; } const children = ancestor.getChildren(); if (children.length > 1) { return true; } return hasSiblings(ancestor); }; if (!preservedOrder.some((col) => hasSiblings(col))) { const preservedOrderSet = new Set(preservedOrder); for (const col of cols.list) { if (!preservedOrderSet.has(col)) { preservedOrder.push(col); } } cols.list = preservedOrder; return; } const colPositionMap = /* @__PURE__ */ new Map(); for (let i = 0; i < preservedOrder.length; i++) { const col = preservedOrder[i]; colPositionMap.set(col, i); } const additionalCols = cols.list.filter((col) => !colPositionMap.has(col)); if (additionalCols.length === 0) { cols.list = preservedOrder; return; } const getPreviousSibling = (col, group) => { const parent = group ? group.getOriginalParent() : col.getOriginalParent(); if (!parent) { return null; } let highestIdx = null; let highestSibling = null; for (const child of parent.getChildren()) { if (child === group || child === col) { continue; } if (child instanceof AgColumn) { const colIdx = colPositionMap.get(child); if (colIdx == null) { continue; } if (highestIdx == null || highestIdx < colIdx) { highestIdx = colIdx; highestSibling = child; } continue; } child.forEachLeafColumn((leafCol) => { const colIdx = colPositionMap.get(leafCol); if (colIdx == null) { return; } if (highestIdx == null || highestIdx < colIdx) { highestIdx = colIdx; highestSibling = leafCol; } }); } if (highestSibling == null) { return getPreviousSibling(col, parent); } return highestSibling; }; const noSiblingsAvailable = []; const previousSiblingPosMap = /* @__PURE__ */ new Map(); for (const col of additionalCols) { const prevSiblingIdx = getPreviousSibling(col, null); if (prevSiblingIdx == null) { noSiblingsAvailable.push(col); continue; } const prev = previousSiblingPosMap.get(prevSiblingIdx); if (prev === void 0) { previousSiblingPosMap.set(prevSiblingIdx, col); } else if (Array.isArray(prev)) { prev.push(col); } else { previousSiblingPosMap.set(prevSiblingIdx, [prev, col]); } } const result = new Array(cols.list.length); let resultPointer = result.length - 1; for (let i = noSiblingsAvailable.length - 1; i >= 0; i--) { result[resultPointer--] = noSiblingsAvailable[i]; } for (let i = preservedOrder.length - 1; i >= 0; i--) { const nextCol = preservedOrder[i]; const extraCols = previousSiblingPosMap.get(nextCol); if (extraCols) { if (Array.isArray(extraCols)) { for (let x = extraCols.length - 1; x >= 0; x--) { const col = extraCols[x]; result[resultPointer--] = col; } } else { result[resultPointer--] = extraCols; } } result[resultPointer--] = nextCol; } cols.list = result; } positionLockedCols(cols) { cols.list = placeLockedColumns(cols.list, this.gos); } saveColOrder() { if (this.showingPivotResult) { this.lastPivotOrder = this.cols?.list ?? null; } else { this.lastOrder = this.cols?.list ?? null; } } getColumnDefs(sorted) { return this.colDefCols && this.beans.colDefFactory?.getColumnDefs( this.colDefCols.list, this.showingPivotResult, this.lastOrder, this.cols?.list ?? [], sorted ); } setColSpanActive() { this.colSpanActive = !!this.cols?.list.some((col) => col.getColDef().colSpan != null); } isPivotMode() { return this.pivotMode; } setPivotMode(pivotMode, source) { if (pivotMode === this.pivotMode) { return; } this.pivotMode = pivotMode; if (!this.ready) { return; } this.refreshCols(false, source); const { visibleCols, eventSvc } = this.beans; visibleCols.refresh(source); eventSvc.dispatchEvent({ type: "columnPivotModeChanged" }); } // + clientSideRowModel isPivotActive() { const pivotColumns = this.beans.pivotColsSvc?.columns; return this.pivotMode && !!pivotColumns?.length; } // called when dataTypes change recreateColumnDefs(e) { if (!this.cols) { return; } this.beans.autoColSvc?.updateColumns(e); const source = _convertColumnEventSourceType(e.source); this.createColsFromColDefs(source); } setColumnDefs(columnDefs, source) { this.colDefs = columnDefs; this.createColsFromColDefs(source); } destroy() { _destroyColumnTree(this.beans, this.colDefCols?.tree); super.destroy(); } getColTree() { return this.cols?.tree ?? []; } // + columnSelectPanel getColDefColTree() { return this.colDefCols?.tree ?? []; } // + clientSideRowController -> sorting, building quick filter text // + headerRenderer -> sorting (clearing icon) getColDefCols() { return this.colDefCols?.list ?? null; } // + moveColumnController getCols() { return this.cols?.list ?? []; } /** * If callback returns true, exit early. */ forAllCols(callback) { const { pivotResultCols, autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans; if (_forAll(this.colDefCols?.list, callback)) { return; } if (_forAll(autoColSvc?.columns?.list, callback)) { return; } if (_forAll(selectionColSvc?.columns?.list, callback)) { return; } if (_forAll(groupHierarchyColSvc?.columns?.list, callback)) { return; } if (_forAll(pivotResultCols?.getPivotResultCols()?.list, callback)) { return; } } getColsForKeys(keys) { if (!keys) { return []; } return keys.map((key) => this.getCol(key)).filter((col) => col != null); } getColDefCol(key) { if (!this.colDefCols?.list) { return null; } return this.getColFromCollection(key, this.colDefCols); } getCol(key) { if (key == null) { return null; } return this.getColFromCollection(key, this.cols); } /** * Get column exclusively by ID. * * Note getCol/getColFromCollection have poor performance when col has been removed. */ getColById(key) { return this.cols?.map[key] ?? null; } getColFromCollection(key, cols) { if (cols == null) { return null; } const { map, list } = cols; if (typeof key == "string" && map[key]) { return map[key]; } for (let i = 0; i < list.length; i++) { if (_columnsMatch(list[i], key)) { return list[i]; } } const { autoColSvc, selectionColSvc, groupHierarchyColSvc } = this.beans; return autoColSvc?.getColumn(key) ?? selectionColSvc?.getColumn(key) ?? groupHierarchyColSvc?.getColumn(key) ?? null; } }; var agAbstractLabel_default = ".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}"; var AgAbstractLabel = class extends AgComponentStub { constructor(config, template, components) { super(template, components); this.labelSeparator = ""; this.labelAlignment = "left"; this.disabled = false; this.label = ""; this.config = config || {}; this.registerCSS(agAbstractLabel_default); } postConstruct() { this.addCss("ag-labeled"); this.eLabel.classList.add("ag-label"); const { labelSeparator, label, labelWidth, labelAlignment, disabled, labelEllipsis } = this.config; if (disabled != null) { this.setDisabled(disabled); } if (labelSeparator != null) { this.setLabelSeparator(labelSeparator); } if (label != null) { this.setLabel(label); } if (labelWidth != null) { this.setLabelWidth(labelWidth); } if (labelEllipsis != null) { this.setLabelEllipsis(labelEllipsis); } this.setLabelAlignment(labelAlignment || this.labelAlignment); this.refreshLabel(); } refreshLabel() { const { label, eLabel } = this; _clearElement(eLabel); if (typeof label === "string") { eLabel.innerText = label + this.labelSeparator; } else if (label) { eLabel.appendChild(label); } if (label === "") { _setDisplayed(eLabel, false); _setAriaRole(eLabel, "presentation"); } else { _setDisplayed(eLabel, true); _setAriaRole(eLabel, null); } } setLabelSeparator(labelSeparator) { if (this.labelSeparator === labelSeparator) { return this; } this.labelSeparator = labelSeparator; if (this.label != null) { this.refreshLabel(); } return this; } getLabelId() { const eLabel = this.eLabel; eLabel.id = eLabel.id || `ag-${this.getCompId()}-label`; return eLabel.id; } getLabel() { return this.label; } setLabel(label) { if (this.label === label) { return this; } this.label = label; this.refreshLabel(); return this; } setLabelAlignment(alignment) { const eGui = this.getGui(); const eGuiClassList = eGui.classList; eGuiClassList.toggle("ag-label-align-left", alignment === "left"); eGuiClassList.toggle("ag-label-align-right", alignment === "right"); eGuiClassList.toggle("ag-label-align-top", alignment === "top"); return this; } setLabelEllipsis(hasEllipsis) { this.eLabel.classList.toggle("ag-label-ellipsis", hasEllipsis); return this; } setLabelWidth(width) { if (this.label == null) { return this; } _setElementWidth(this.eLabel, width); return this; } setDisabled(disabled) { disabled = !!disabled; const element = this.getGui(); _setDisabled(element, disabled); element.classList.toggle("ag-disabled", disabled); this.disabled = disabled; return this; } isDisabled() { return !!this.disabled; } }; var AgAbstractField = class extends AgAbstractLabel { constructor(config, template, components, className) { super(config, template, components); this.className = className; } postConstruct() { super.postConstruct(); const { width, value, onValueChange, ariaLabel } = this.config; if (width != null) { this.setWidth(width); } if (value != null) { this.setValue(value); } if (onValueChange != null) { this.onValueChange(onValueChange); } if (ariaLabel != null) { this.setAriaLabel(ariaLabel); } if (this.className) { this.addCss(this.className); } this.refreshAriaLabelledBy(); } setLabel(label) { super.setLabel(label); this.refreshAriaLabelledBy(); return this; } refreshAriaLabelledBy() { const ariaEl = this.getAriaElement(); const labelId = this.getLabelId(); const label = this.getLabel(); if (label == null || label == "" || _getAriaLabel(ariaEl) !== null) { _setAriaLabelledBy(ariaEl, ""); } else { _setAriaLabelledBy(ariaEl, labelId ?? ""); } } setAriaLabel(label) { _setAriaLabel(this.getAriaElement(), label); this.refreshAriaLabelledBy(); return this; } onValueChange(callbackFn) { this.addManagedListeners(this, { fieldValueChanged: () => callbackFn(this.getValue()) }); return this; } getWidth() { return this.getGui().clientWidth; } setWidth(width) { _setFixedWidth(this.getGui(), width); return this; } getPreviousValue() { return this.previousValue; } getValue() { return this.value; } setValue(value, silent) { if (this.value === value) { return this; } this.previousValue = this.value; this.value = value; if (!silent) { this.dispatchLocalEvent({ type: "fieldValueChanged" }); } return this; } }; function buildTemplate(displayFieldTag) { return { tag: "div", role: "presentation", children: [ { tag: "div", ref: "eLabel", cls: "ag-input-field-label" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-input-wrapper", role: "presentation", children: [{ tag: displayFieldTag, ref: "eInput", cls: "ag-input-field-input" }] } ] }; } var AgAbstractInputField = class extends AgAbstractField { constructor(config, className, inputType = "text", displayFieldTag = "input") { super(config, config?.template ?? buildTemplate(displayFieldTag), [], className); this.inputType = inputType; this.displayFieldTag = displayFieldTag; this.eLabel = RefPlaceholder; this.eWrapper = RefPlaceholder; this.eInput = RefPlaceholder; } postConstruct() { super.postConstruct(); this.setInputType(this.inputType); const { eLabel, eWrapper, eInput, className } = this; eLabel.classList.add(`${className}-label`); eWrapper.classList.add(`${className}-input-wrapper`); eInput.classList.add(`${className}-input`); this.addCss("ag-input-field"); eInput.id = eInput.id || `ag-${this.getCompId()}-input`; const { inputName, inputWidth, inputPlaceholder, autoComplete, tabIndex } = this.config; if (inputName != null) { this.setInputName(inputName); } if (inputWidth != null) { this.setInputWidth(inputWidth); } if (inputPlaceholder != null) { this.setInputPlaceholder(inputPlaceholder); } if (autoComplete != null) { this.setAutoComplete(autoComplete); } this.addInputListeners(); this.activateTabIndex([eInput], tabIndex); } addInputListeners() { this.addManagedElementListeners(this.eInput, { input: (e) => this.setValue(e.target.value) }); } setInputType(inputType) { if (this.displayFieldTag === "input") { this.inputType = inputType; _addOrRemoveAttribute(this.eInput, "type", inputType); } } getInputElement() { return this.eInput; } getWrapperElement() { return this.eWrapper; } setInputWidth(width) { _setElementWidth(this.eWrapper, width); return this; } setInputName(name) { this.getInputElement().setAttribute("name", name); return this; } getFocusableElement() { return this.eInput; } setMaxLength(length) { const eInput = this.eInput; eInput.maxLength = length; return this; } setInputPlaceholder(placeholder) { _addOrRemoveAttribute(this.eInput, "placeholder", placeholder); return this; } setInputAriaLabel(label) { _setAriaLabel(this.eInput, label); this.refreshAriaLabelledBy(); return this; } setDisabled(disabled) { _setDisabled(this.eInput, disabled); return super.setDisabled(disabled); } setAutoComplete(value) { if (value === true) { _addOrRemoveAttribute(this.eInput, "autocomplete", null); } else { const autoCompleteValue = typeof value === "string" ? value : "off"; _addOrRemoveAttribute(this.eInput, "autocomplete", autoCompleteValue); } return this; } }; var AgCheckbox = class extends AgAbstractInputField { constructor(config, className = "ag-checkbox", inputType = "checkbox") { super(config, className, inputType); this.labelAlignment = "right"; this.selected = false; this.readOnly = false; this.passive = false; } postConstruct() { super.postConstruct(); const { readOnly, passive, name } = this.config; if (typeof readOnly === "boolean") { this.setReadOnly(readOnly); } if (typeof passive === "boolean") { this.setPassive(passive); } if (name != null) { this.setName(name); } } addInputListeners() { this.addManagedElementListeners(this.eInput, { click: this.onCheckboxClick.bind(this) }); this.addManagedElementListeners(this.eLabel, { click: this.toggle.bind(this) }); } getNextValue() { return this.selected === void 0 ? true : !this.selected; } setPassive(passive) { this.passive = passive; } isReadOnly() { return this.readOnly; } setReadOnly(readOnly) { this.eWrapper.classList.toggle("ag-disabled", readOnly); this.eInput.disabled = readOnly; this.readOnly = readOnly; } setDisabled(disabled) { this.eWrapper.classList.toggle("ag-disabled", disabled); return super.setDisabled(disabled); } toggle() { if (this.eInput.disabled) { return; } const previousValue = this.isSelected(); const nextValue = this.getNextValue(); if (this.passive) { this.dispatchChange(nextValue, previousValue); } else { this.setValue(nextValue); } } getValue() { return this.isSelected(); } setValue(value, silent) { this.refreshSelectedClass(value); this.setSelected(value, silent); return this; } setName(name) { const input = this.getInputElement(); input.name = name; return this; } isSelected() { return this.selected; } setSelected(selected, silent) { if (this.isSelected() === selected) { return; } this.previousValue = this.isSelected(); selected = this.selected = typeof selected === "boolean" ? selected : void 0; const eInput = this.eInput; eInput.checked = selected; eInput.indeterminate = selected === void 0; if (!silent) { this.dispatchChange(this.selected, this.previousValue); } } dispatchChange(selected, previousValue, event) { this.dispatchLocalEvent({ type: "fieldValueChanged", selected, previousValue, event }); const input = this.getInputElement(); this.eventSvc.dispatchEvent({ type: "checkboxChanged", id: input.id, name: input.name, selected, previousValue }); } onCheckboxClick(e) { if (this.passive || this.eInput.disabled) { return; } const previousValue = this.isSelected(); const selected = this.selected = e.target.checked; this.refreshSelectedClass(selected); this.dispatchChange(selected, previousValue, e); } refreshSelectedClass(value) { const classList = this.eWrapper.classList; classList.toggle("ag-checked", value === true); classList.toggle("ag-indeterminate", value == null); } }; var AgCheckboxSelector = { selector: "AG-CHECKBOX", component: AgCheckbox }; var checkboxCellRenderer_default = ".ag-checkbox-cell{height:100%}"; var CheckboxCellRendererElement = { tag: "div", cls: "ag-cell-wrapper ag-checkbox-cell", role: "presentation", children: [ { tag: "ag-checkbox", ref: "eCheckbox", role: "presentation" } ] }; var CheckboxCellRenderer = class extends Component { constructor() { super(CheckboxCellRendererElement, [AgCheckboxSelector]); this.eCheckbox = RefPlaceholder; this.registerCSS(checkboxCellRenderer_default); } init(params) { this.refresh(params); const { eCheckbox, beans } = this; const inputEl = eCheckbox.getInputElement(); inputEl.setAttribute("tabindex", "-1"); _setAriaLive(inputEl, "polite"); this.addManagedListeners(inputEl, { click: (event) => { _stopPropagationForAgGrid(event); if (eCheckbox.isDisabled()) { return; } const isSelected = eCheckbox.getValue(); this.onCheckboxChanged(isSelected); }, dblclick: (event) => { _stopPropagationForAgGrid(event); } }); this.addManagedElementListeners(params.eGridCell, { keydown: (event) => { if (event.key === KeyCode.SPACE && !eCheckbox.isDisabled()) { if (params.eGridCell === _getActiveDomElement(beans)) { eCheckbox.toggle(); } const isSelected = eCheckbox.getValue(); this.onCheckboxChanged(isSelected); event.preventDefault(); } } }); } refresh(params) { this.params = params; this.updateCheckbox(params); return true; } updateCheckbox(params) { let isSelected; let displayed = true; const { value, column, node } = params; if (node.group && column) { if (typeof value === "boolean") { isSelected = value; } else { const colId = column.getColId(); if (colId.startsWith(GROUP_AUTO_COLUMN_ID)) { isSelected = value == null || value === "" ? void 0 : value === "true"; } else if (node.aggData && node.aggData[colId] !== void 0) { isSelected = value ?? void 0; } else if (node.sourceRowIndex >= 0) { isSelected = value ?? void 0; } else { displayed = false; } } } else { isSelected = value ?? void 0; } const { eCheckbox } = this; if (!displayed) { eCheckbox.setDisplayed(false); return; } eCheckbox.setValue(isSelected); const disabled = params.disabled ?? !column?.isCellEditable(node); eCheckbox.setDisabled(disabled); const translate = this.getLocaleTextFunc(); const stateName = _getAriaCheckboxStateName(translate, isSelected); const ariaLabel = disabled ? stateName : `${translate("ariaToggleCellValue", "Press SPACE to toggle cell value")} (${stateName})`; eCheckbox.setInputAriaLabel(ariaLabel); } onCheckboxChanged(isSelected) { const { params } = this; const { column, node, value: oldValue } = params; const { editSvc } = this.beans; if (!column) { return; } const position = { rowNode: node, column }; editSvc?.dispatchCellEvent(position, null, "cellEditingStarted", { value: oldValue }); const valueChanged = node.setDataValue(column, isSelected, "ui"); editSvc?.dispatchCellEvent(position, null, "cellEditingStopped", { oldValue, newValue: isSelected, valueChanged }); if (!valueChanged) { this.updateCheckbox(params); } } }; var SkeletonCellRendererElement = { tag: "div", cls: "ag-skeleton-container" }; var SkeletonCellRenderer = class extends Component { constructor() { super(SkeletonCellRendererElement); } init(params) { const id = `ag-cell-skeleton-renderer-${this.getCompId()}`; this.getGui().setAttribute("id", id); this.addDestroyFunc(() => _setAriaLabelledBy(params.eParentOfValue)); _setAriaLabelledBy(params.eParentOfValue, id); if (params.deferRender) { this.setupLoading(params); } else if (params.node.failedLoad) { this.setupFailed(); } else { this.setupLoading(params); } } setupFailed() { const localeTextFunc = this.getLocaleTextFunc(); this.getGui().textContent = localeTextFunc("loadingError", "ERR"); const ariaFailed = localeTextFunc("ariaSkeletonCellLoadingFailed", "Row failed to load"); _setAriaLabel(this.getGui(), ariaFailed); } setupLoading(params) { const skeletonEffect = _createElement({ tag: "div", cls: "ag-skeleton-effect" }); const rowIndex = params.node.rowIndex; if (rowIndex != null) { const width = 75 + 25 * (rowIndex % 2 === 0 ? Math.sin(rowIndex) : Math.cos(rowIndex)); skeletonEffect.style.width = `${width}%`; } this.getGui().appendChild(skeletonEffect); const localeTextFunc = this.getLocaleTextFunc(); const ariaLoading = params.deferRender ? localeTextFunc("ariaDeferSkeletonCellLoading", "Cell is loading") : localeTextFunc("ariaSkeletonCellLoading", "Row data is loading"); _setAriaLabel(this.getGui(), ariaLoading); } refresh(_params) { return false; } }; var CheckboxCellRendererModule = { moduleName: "CheckboxCellRenderer", version: VERSION, userComponents: { agCheckboxCellRenderer: CheckboxCellRenderer } }; var SkeletonCellRendererModule = { moduleName: "SkeletonCellRenderer", version: VERSION, userComponents: { agSkeletonCellRenderer: SkeletonCellRenderer } }; function getColumnDef(beans, key) { const column = beans.colModel.getColDefCol(key); if (column) { return column.getColDef(); } return null; } function getColumnDefs(beans) { return beans.colModel.getColumnDefs(true); } function getDisplayNameForColumn(beans, column, location) { return beans.colNames.getDisplayNameForColumn(column, location) || ""; } function getColumn(beans, key) { return beans.colModel.getColDefCol(key); } function getColumns(beans) { return beans.colModel.getColDefCols(); } function applyColumnState(beans, params) { return _applyColumnState(beans, params, "api"); } function getColumnState(beans) { return _getColumnState(beans); } function resetColumnState(beans) { _resetColumnState(beans, "api"); } function isPinning(beans) { return beans.visibleCols.isPinningLeft() || beans.visibleCols.isPinningRight(); } function isPinningLeft(beans) { return beans.visibleCols.isPinningLeft(); } function isPinningRight(beans) { return beans.visibleCols.isPinningRight(); } function getDisplayedColAfter(beans, col) { return beans.visibleCols.getColAfter(col); } function getDisplayedColBefore(beans, col) { return beans.visibleCols.getColBefore(col); } function setColumnsVisible(beans, keys, visible) { beans.colModel.setColsVisible(keys, visible, "api"); } function setColumnsPinned(beans, keys, pinned) { beans.pinnedCols?.setColsPinned(keys, pinned, "api"); } function getAllGridColumns(beans) { return beans.colModel.getCols(); } function getDisplayedLeftColumns(beans) { return beans.visibleCols.leftCols; } function getDisplayedCenterColumns(beans) { return beans.visibleCols.centerCols; } function getDisplayedRightColumns(beans) { return beans.visibleCols.rightCols; } function getAllDisplayedColumns(beans) { return beans.visibleCols.allCols; } function getAllDisplayedVirtualColumns(beans) { return beans.colViewport.getViewportColumns(); } function _deepCloneDefinition(object, keysToSkip) { if (!object) { return; } const obj = object; const res = {}; for (const key of Object.keys(obj)) { if (keysToSkip && keysToSkip.indexOf(key) >= 0 || SKIP_JS_BUILTINS.has(key)) { continue; } const value = obj[key]; const sourceIsSimpleObject = typeof value === "object" && value !== null && value.constructor === Object; if (sourceIsSimpleObject) { res[key] = _deepCloneDefinition(value); } else { res[key] = value; } } return res; } var ColumnDefFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colDefFactory"; } wireBeans(beans) { this.rowGroupColsSvc = beans.rowGroupColsSvc; this.pivotColsSvc = beans.pivotColsSvc; } getColumnDefs(colDefColsList, showingPivotResult, lastOrder, colsList, sorted = false) { const cols = colDefColsList.slice(); if (showingPivotResult) { cols.sort((a, b) => lastOrder.indexOf(a) - lastOrder.indexOf(b)); } else if (lastOrder || sorted) { cols.sort((a, b) => colsList.indexOf(a) - colsList.indexOf(b)); } const rowGroupColumns = this.rowGroupColsSvc?.columns; const pivotColumns = this.pivotColsSvc?.columns; return this.buildColumnDefs(cols, rowGroupColumns, pivotColumns); } buildColumnDefs(cols, rowGroupColumns = [], pivotColumns = []) { const res = []; const colGroupDefs = {}; for (const col of cols) { const colDef = this.createDefFromColumn(col, rowGroupColumns, pivotColumns); let addToResult = true; let childDef = colDef; let pointer = col.getOriginalParent(); let lastPointer = null; while (pointer) { let parentDef = null; if (pointer.isPadding()) { pointer = pointer.getOriginalParent(); continue; } const existingParentDef = colGroupDefs[pointer.getGroupId()]; if (existingParentDef) { existingParentDef.children.push(childDef); addToResult = false; break; } parentDef = this.createDefFromGroup(pointer); if (parentDef) { parentDef.children = [childDef]; colGroupDefs[parentDef.groupId] = parentDef; childDef = parentDef; pointer = pointer.getOriginalParent(); } if (pointer != null && lastPointer === pointer) { addToResult = false; break; } lastPointer = pointer; } if (addToResult) { res.push(childDef); } } return res; } createDefFromGroup(group) { const defCloned = _deepCloneDefinition(group.getColGroupDef(), ["children"]); if (defCloned) { defCloned.groupId = group.getGroupId(); } return defCloned; } createDefFromColumn(col, rowGroupColumns, pivotColumns) { const colDefCloned = _deepCloneDefinition(col.getColDef()); colDefCloned.colId = col.getColId(); colDefCloned.width = col.getActualWidth(); colDefCloned.rowGroup = col.isRowGroupActive(); colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null; colDefCloned.pivot = col.isPivotActive(); colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null; colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null; colDefCloned.hide = col.isVisible() ? void 0 : true; colDefCloned.pinned = col.isPinned() ? col.getPinned() : null; colDefCloned.sort = col.getSortDef(); colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null; return colDefCloned; } }; var ColumnFlexService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colFlex"; this.columnsHidden = false; } refreshFlexedColumns(params = {}) { const source = params.source ?? "flex"; if (params.viewportWidth != null) { this.flexViewportWidth = params.viewportWidth; } const totalSpace = this.flexViewportWidth; const { visibleCols, colDelayRenderSvc } = this.beans; const visibleCenterCols = visibleCols.centerCols; let flexAfterDisplayIndex = -1; if (params.resizingCols) { const allResizingCols = new Set(params.resizingCols); for (let i = visibleCenterCols.length - 1; i >= 0; i--) { if (allResizingCols.has(visibleCenterCols[i])) { flexAfterDisplayIndex = i; break; } } } let hasFlexItems = false; const items = visibleCenterCols.map((col, i) => { const flex = col.getFlex(); const isFlex = flex != null && flex > 0 && i > flexAfterDisplayIndex; hasFlexItems || (hasFlexItems = isFlex); return { col, isFlex, flex: Math.max(0, flex ?? 0), initialSize: col.getActualWidth(), min: col.getMinWidth(), max: col.getMaxWidth(), targetSize: 0 }; }); if (hasFlexItems) { colDelayRenderSvc?.hideColumns("colFlex"); this.columnsHidden = true; } else if (this.columnsHidden) { this.revealColumns(colDelayRenderSvc); } if (!totalSpace || !hasFlexItems) { return []; } let unfrozenItemCount = items.length; let unfrozenFlex = items.reduce((acc, item) => acc + item.flex, 0); let unfrozenSpace = totalSpace; const freeze = (item, width) => { item.frozenSize = width; item.col.setActualWidth(width, source); unfrozenSpace -= width; unfrozenFlex -= item.flex; unfrozenItemCount -= 1; }; const isFrozen = (item) => item.frozenSize != null; for (const item of items) { if (!item.isFlex) { freeze(item, item.initialSize); } } while (unfrozenItemCount > 0) { const spaceToFill = Math.round(unfrozenFlex < 1 ? unfrozenSpace * unfrozenFlex : unfrozenSpace); let lastUnfrozenItem; let actualLeft = 0; let idealRight = 0; for (const item of items) { if (isFrozen(item)) { continue; } lastUnfrozenItem = item; idealRight += spaceToFill * (item.flex / unfrozenFlex); const idealSize = idealRight - actualLeft; const roundedSize = Math.round(idealSize); item.targetSize = roundedSize; actualLeft += roundedSize; } if (lastUnfrozenItem) { lastUnfrozenItem.targetSize += spaceToFill - actualLeft; } let totalViolation = 0; for (const item of items) { if (isFrozen(item)) { continue; } const unclampedSize = item.targetSize; const clampedSize = Math.min(Math.max(unclampedSize, item.min), item.max); totalViolation += clampedSize - unclampedSize; item.violationType = clampedSize === unclampedSize ? void 0 : clampedSize < unclampedSize ? "max" : "min"; item.targetSize = clampedSize; } const freezeType = totalViolation === 0 ? "all" : totalViolation > 0 ? "min" : "max"; for (const item of items) { if (isFrozen(item)) { continue; } if (freezeType === "all" || item.violationType === freezeType) { freeze(item, item.targetSize); } } } if (!params.skipSetLeft) { visibleCols.setLeftValues(source); } if (params.updateBodyWidths) { visibleCols.updateBodyWidths(); } const unconstrainedFlexColumns = items.filter((item) => item.isFlex && !item.violationType).map((item) => item.col); if (params.fireResizedEvent) { const changedColumns = items.filter((item) => item.initialSize !== item.frozenSize).map((item) => item.col); const flexingColumns = items.filter((item) => item.flex).map((item) => item.col); dispatchColumnResizedEvent(this.eventSvc, changedColumns, true, source, flexingColumns); } this.revealColumns(colDelayRenderSvc); return unconstrainedFlexColumns; } revealColumns(colDelayRenderSvc) { if (this.columnsHidden) { colDelayRenderSvc?.revealColumns("colFlex"); this.columnsHidden = false; } } initCol(column) { const { flex, initialFlex } = column.colDef; if (flex !== void 0) { column.flex = flex; } else if (initialFlex !== void 0) { column.flex = initialFlex; } } // this method should only be used by the colModel to // change flex when required by the applyColumnState method. setColFlex(column, flex) { column.flex = flex ?? null; column.dispatchStateUpdatedEvent("flex"); } }; var _parseBigIntOrNull = (value) => { if (typeof value === "bigint") { return value; } let trimmed; if (typeof value === "number") { trimmed = value; } else if (typeof value === "string") { trimmed = value.trim(); if (trimmed === "") { return null; } if (trimmed.endsWith("n")) { trimmed = trimmed.slice(0, -1); } if (!/^[+-]?\d+$/.test(trimmed)) { return null; } } if (trimmed == null) { return null; } try { return BigInt(trimmed); } catch { return null; } }; var DATE_TIME_SEPARATOR = "T"; var DATE_TIME_SEPARATOR_REGEXP = new RegExp(`[${DATE_TIME_SEPARATOR} ]`); var DATE_TIME_REGEXP = new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${DATE_TIME_SEPARATOR}\\d{2}:\\d{2}:\\d{2}\\D?)?`); function _padStartWidthZeros(value, totalStringSize) { return value.toString().padStart(totalStringSize, "0"); } function _serialiseDate(date, includeTime = true, separator = DATE_TIME_SEPARATOR) { if (!date) { return null; } let serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map((part) => _padStartWidthZeros(part, 2)).join("-"); if (includeTime) { serialised += separator + [date.getHours(), date.getMinutes(), date.getSeconds()].map((part) => _padStartWidthZeros(part, 2)).join(":"); } return serialised; } function _getDateParts(d, includeTime = true) { if (!d) { return null; } if (includeTime) { return [ String(d.getFullYear()), String(d.getMonth() + 1), _padStartWidthZeros(d.getDate(), 2), _padStartWidthZeros(d.getHours(), 2), `:${_padStartWidthZeros(d.getMinutes(), 2)}`, `:${_padStartWidthZeros(d.getSeconds(), 2)}` ]; } return [d.getFullYear(), d.getMonth() + 1, _padStartWidthZeros(d.getDate(), 2)].map(String); } var calculateOrdinal = (value) => { if (value > 3 && value < 21) { return "th"; } const remainder = value % 10; switch (remainder) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; } return "th"; }; var MONTHS = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; function _dateToFormattedString(date, format) { if (format == null) { return _serialiseDate(date, false); } const fullYear = _padStartWidthZeros(date.getFullYear(), 4); const replace = { YYYY: () => fullYear.slice(fullYear.length - 4, fullYear.length), YY: () => fullYear.slice(fullYear.length - 2, fullYear.length), Y: () => `${date.getFullYear()}`, MMMM: () => MONTHS[date.getMonth()], MMM: () => MONTHS[date.getMonth()].slice(0, 3), MM: () => _padStartWidthZeros(date.getMonth() + 1, 2), Mo: () => `${date.getMonth() + 1}${calculateOrdinal(date.getMonth() + 1)}`, M: () => `${date.getMonth() + 1}`, Do: () => `${date.getDate()}${calculateOrdinal(date.getDate())}`, DD: () => _padStartWidthZeros(date.getDate(), 2), D: () => `${date.getDate()}`, dddd: () => DAYS[date.getDay()], ddd: () => DAYS[date.getDay()].slice(0, 3), dd: () => DAYS[date.getDay()].slice(0, 2), do: () => `${date.getDay()}${calculateOrdinal(date.getDay())}`, d: () => `${date.getDay()}` }; const regexp = new RegExp(Object.keys(replace).join("|"), "g"); return format.replace(regexp, (match) => { if (match in replace) { return replace[match](); } return match; }); } function _isValidDate(value, bailIfInvalidTime = false) { return !!_parseDateTimeFromString(value, bailIfInvalidTime); } function _isValidDateTime(value) { return _isValidDate(value, true); } function _parseDateTimeFromString(value, bailIfInvalidTime = false, skipValidation) { if (!value) { return null; } if (!skipValidation && !DATE_TIME_REGEXP.test(value)) { return null; } const [dateStr, timeStr] = value.split(DATE_TIME_SEPARATOR_REGEXP); if (!dateStr) { return null; } const fields = dateStr.split("-").map((f) => Number.parseInt(f, 10)); if (fields.filter((f) => !isNaN(f)).length !== 3) { return null; } const [year, month, day] = fields; const date = new Date(year, month - 1, day); if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) { return null; } if (!timeStr && bailIfInvalidTime) { return null; } if (!timeStr || timeStr === "00:00:00") { return date; } const [hours, minutes, seconds] = timeStr.split(":").map((part) => Number.parseInt(part, 10)); if (hours >= 0 && hours < 24) { date.setHours(hours); } else if (bailIfInvalidTime) { return null; } if (minutes >= 0 && minutes < 60) { date.setMinutes(minutes); } else if (bailIfInvalidTime) { return null; } if (seconds >= 0 && seconds < 60) { date.setSeconds(seconds); } else if (bailIfInvalidTime) { return null; } return date; } function _getValueUsingField(data, field, fieldContainsDots) { if (!field || !data) { return; } if (!fieldContainsDots) { return data[field]; } const fields = field.split("."); let currentObject = data; for (let i = 0; i < fields.length; i++) { if (currentObject == null) { return void 0; } currentObject = currentObject[fields[i]]; } return currentObject; } var SORTED_CELL_DATA_TYPES_FOR_MATCHING = [ "dateTimeString", "dateString", "text", "number", "bigint", "boolean", "date" ]; var DataTypeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "dataTypeSvc"; this.dataTypeDefinitions = {}; this.isPendingInference = false; this.isColumnTypeOverrideInDataTypeDefinitions = false; this.columnStateUpdatesPendingInference = {}; this.columnStateUpdateListenerDestroyFuncs = []; this.columnDefinitionPropsPerDataType = { number() { return { cellEditor: "agNumberCellEditor" }; }, bigint({ filterModuleBean }) { if (filterModuleBean) { return { cellEditor: "agTextCellEditor" }; } return { cellEditor: "agTextCellEditor", comparator: { default: bigintComparator, absolute: bigintAbsoluteComparator } }; }, boolean() { return { cellEditor: "agCheckboxCellEditor", cellRenderer: "agCheckboxCellRenderer", getFindText: () => null, suppressKeyboardEvent: ({ node, event, column }) => event.key === KeyCode.SPACE && column.isCellEditable(node) }; }, date({ formatValue }) { return { cellEditor: "agDateCellEditor", keyCreator: formatValue }; }, dateString({ formatValue }) { return { cellEditor: "agDateStringCellEditor", keyCreator: formatValue }; }, dateTime(args) { return this.date(args); }, dateTimeString(args) { return this.dateString(args); }, object({ formatValue, colModel, colId }) { return { cellEditorParams: { useFormatter: true }, comparator: (a, b) => { const column = colModel.getColDefCol(colId); const colDef = column?.getColDef(); if (!column || !colDef) { return 0; } const valA = a == null ? "" : formatValue({ column, node: null, value: a }); const valB = b == null ? "" : formatValue({ column, node: null, value: b }); if (valA === valB) { return 0; } return valA > valB ? 1 : -1; }, keyCreator: formatValue }; }, text() { return {}; } }; } wireBeans(beans) { this.colModel = beans.colModel; } postConstruct() { this.processDataTypeDefinitions(); this.addManagedPropertyListener("dataTypeDefinitions", (event) => { this.processDataTypeDefinitions(); this.colModel.recreateColumnDefs(event); }); } processDataTypeDefinitions() { const defaultDataTypes = this.getDefaultDataTypes(); const newDataTypeDefinitions = {}; const newFormatValueFuncs = {}; const generateFormatValueFunc = (dataTypeDefinition) => { return (params) => { const { column, node, value } = params; let valueFormatter = column.getColDef().valueFormatter; if (valueFormatter === dataTypeDefinition.groupSafeValueFormatter) { valueFormatter = dataTypeDefinition.valueFormatter; } return this.beans.valueSvc.formatValue(column, node, value, valueFormatter); }; }; for (const cellDataType of Object.keys(defaultDataTypes)) { const defaultDataTypeDef = defaultDataTypes[cellDataType]; const mergedDataTypeDefinition = { ...defaultDataTypeDef, groupSafeValueFormatter: createGroupSafeValueFormatter(defaultDataTypeDef, this.gos) }; newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition; newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition); } const userDataTypeDefs = this.gos.get("dataTypeDefinitions") ?? {}; const newDataTypeMatchers = {}; for (const cellDataType of Object.keys(userDataTypeDefs)) { const userDataTypeDef = userDataTypeDefs[cellDataType]; const mergedDataTypeDefinition = this.processDataTypeDefinition( userDataTypeDef, userDataTypeDefs, [cellDataType], defaultDataTypes ); if (mergedDataTypeDefinition) { newDataTypeDefinitions[cellDataType] = mergedDataTypeDefinition; if (userDataTypeDef.dataTypeMatcher) { newDataTypeMatchers[cellDataType] = userDataTypeDef.dataTypeMatcher; } newFormatValueFuncs[cellDataType] = generateFormatValueFunc(mergedDataTypeDefinition); } } const { valueParser: defaultValueParser, valueFormatter: defaultValueFormatter } = defaultDataTypes.object; const { valueParser: userValueParser, valueFormatter: userValueFormatter } = newDataTypeDefinitions.object; this.hasObjectValueParser = userValueParser !== defaultValueParser; this.hasObjectValueFormatter = userValueFormatter !== defaultValueFormatter; this.formatValueFuncs = newFormatValueFuncs; this.dataTypeDefinitions = newDataTypeDefinitions; this.dataTypeMatchers = this.sortKeysInMatchers(newDataTypeMatchers, defaultDataTypes); } /** * Sorts the keys in the matchers object. * Does not mutate the original object, creates a copy of it with sorted keys instead. */ sortKeysInMatchers(matchers, dataTypes) { const sortedMatchers = { ...matchers }; for (const cellDataType of SORTED_CELL_DATA_TYPES_FOR_MATCHING) { delete sortedMatchers[cellDataType]; sortedMatchers[cellDataType] = matchers[cellDataType] ?? dataTypes[cellDataType].dataTypeMatcher; } return sortedMatchers; } processDataTypeDefinition(userDataTypeDef, userDataTypeDefs, alreadyProcessedDataTypes, defaultDataTypes) { let mergedDataTypeDefinition; const extendsCellDataType = userDataTypeDef.extendsDataType; if (userDataTypeDef.columnTypes) { this.isColumnTypeOverrideInDataTypeDefinitions = true; } if (userDataTypeDef.extendsDataType === userDataTypeDef.baseDataType) { let baseDataTypeDefinition = defaultDataTypes[extendsCellDataType]; const overriddenBaseDataTypeDefinition = userDataTypeDefs[extendsCellDataType]; if (baseDataTypeDefinition && overriddenBaseDataTypeDefinition) { baseDataTypeDefinition = overriddenBaseDataTypeDefinition; } if (!validateDataTypeDefinition(userDataTypeDef, baseDataTypeDefinition, extendsCellDataType)) { return void 0; } mergedDataTypeDefinition = mergeDataTypeDefinitions(baseDataTypeDefinition, userDataTypeDef); } else { if (alreadyProcessedDataTypes.includes(extendsCellDataType)) { _warn(44); return void 0; } const extendedDataTypeDefinition = userDataTypeDefs[extendsCellDataType]; if (!validateDataTypeDefinition(userDataTypeDef, extendedDataTypeDefinition, extendsCellDataType)) { return void 0; } const mergedExtendedDataTypeDefinition = this.processDataTypeDefinition( extendedDataTypeDefinition, userDataTypeDefs, [...alreadyProcessedDataTypes, extendsCellDataType], defaultDataTypes ); if (!mergedExtendedDataTypeDefinition) { return void 0; } mergedDataTypeDefinition = mergeDataTypeDefinitions(mergedExtendedDataTypeDefinition, userDataTypeDef); } return { ...mergedDataTypeDefinition, groupSafeValueFormatter: createGroupSafeValueFormatter(mergedDataTypeDefinition, this.gos) }; } updateColDefAndGetColumnType(colDef, userColDef, colId) { let { cellDataType } = userColDef; if (cellDataType === void 0) { cellDataType = colDef.cellDataType; } const { field } = userColDef; if (cellDataType == null || cellDataType === true) { cellDataType = this.canInferCellDataType(colDef, userColDef) ? this.inferCellDataType(field, colId) : false; } this.addFormulaCellEditorToColDef(colDef, userColDef); if (!cellDataType) { colDef.cellDataType = false; return void 0; } const dataTypeDefinition = this.dataTypeDefinitions[cellDataType]; if (!dataTypeDefinition) { _warn(47, { cellDataType }); return void 0; } colDef.cellDataType = cellDataType; if (dataTypeDefinition.groupSafeValueFormatter) { colDef.valueFormatter = dataTypeDefinition.groupSafeValueFormatter; } if (dataTypeDefinition.valueParser) { colDef.valueParser = dataTypeDefinition.valueParser; } if (!dataTypeDefinition.suppressDefaultProperties) { this.setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId); } return dataTypeDefinition.columnTypes; } addFormulaCellEditorToColDef(colDef, userColDef) { const allowFormula = userColDef.allowFormula ?? colDef.allowFormula; if (!allowFormula || userColDef.cellEditor) { return; } colDef.cellEditor = "agFormulaCellEditor"; } addColumnListeners(column) { if (!this.isPendingInference) { return; } const columnStateUpdates = this.columnStateUpdatesPendingInference[column.getColId()]; if (!columnStateUpdates) { return; } const columnListener = (event) => { columnStateUpdates.add(event.key); }; column.__addEventListener("columnStateUpdated", columnListener); this.columnStateUpdateListenerDestroyFuncs.push( () => column.__removeEventListener("columnStateUpdated", columnListener) ); } canInferCellDataType(colDef, userColDef) { const { gos } = this; if (!_isClientSideRowModel(gos)) { return false; } const propsToCheckForInference = { cellRenderer: true, valueGetter: true, valueParser: true, refData: true }; if (doColDefPropsPreventInference(userColDef, propsToCheckForInference)) { return false; } const columnTypes = userColDef.type === null ? colDef.type : userColDef.type; if (columnTypes) { const columnTypeDefs = gos.get("columnTypes") ?? {}; const hasPropsPreventingInference = convertColumnTypes(columnTypes).some((columnType) => { const columnTypeDef = columnTypeDefs[columnType.trim()]; return columnTypeDef && doColDefPropsPreventInference(columnTypeDef, propsToCheckForInference); }); if (hasPropsPreventingInference) { return false; } } return !doColDefPropsPreventInference(colDef, propsToCheckForInference); } inferCellDataType(field, colId) { if (!field) { return void 0; } let value; const initialData = this.getInitialData(); if (initialData) { const fieldContainsDots = field.includes(".") && !this.gos.get("suppressFieldDotNotation"); value = _getValueUsingField(initialData, field, fieldContainsDots); } else { this.initWaitForRowData(colId); } if (value == null) { return void 0; } const matchedType = Object.keys(this.dataTypeMatchers).find( (_cellDataType) => this.dataTypeMatchers[_cellDataType](value) ); return matchedType ?? "object"; } getInitialData() { const rowData = this.gos.get("rowData"); if (rowData?.length) { return rowData[0]; } else if (this.initialData) { return this.initialData; } else { const rowNodes = this.beans.rowModel.rootNode?._leafs; if (rowNodes?.length) { return rowNodes[0].data; } } return null; } initWaitForRowData(colId) { this.columnStateUpdatesPendingInference[colId] = /* @__PURE__ */ new Set(); if (this.isPendingInference) { return; } this.isPendingInference = true; const columnTypeOverridesExist = this.isColumnTypeOverrideInDataTypeDefinitions; const { colAutosize, eventSvc } = this.beans; if (columnTypeOverridesExist && colAutosize) { colAutosize.shouldQueueResizeOperations = true; } const [destroyFunc] = this.addManagedEventListeners({ rowDataUpdateStarted: (event) => { const { firstRowData } = event; if (!firstRowData) { return; } destroyFunc?.(); this.isPendingInference = false; this.processColumnsPendingInference(firstRowData, columnTypeOverridesExist); this.columnStateUpdatesPendingInference = {}; if (columnTypeOverridesExist) { colAutosize?.processResizeOperations(); } eventSvc.dispatchEvent({ type: "dataTypesInferred" }); } }); } processColumnsPendingInference(firstRowData, columnTypeOverridesExist) { this.initialData = firstRowData; const state = []; this.destroyColumnStateUpdateListeners(); const newRowGroupColumnStateWithoutIndex = {}; const newPivotColumnStateWithoutIndex = {}; for (const colId of Object.keys(this.columnStateUpdatesPendingInference)) { const columnStateUpdates = this.columnStateUpdatesPendingInference[colId]; const column = this.colModel.getCol(colId); if (!column) { continue; } const oldColDef = column.getColDef(); if (!this.resetColDefIntoCol(column, "cellDataTypeInferred")) { continue; } const newColDef = column.getColDef(); if (columnTypeOverridesExist && newColDef.type && newColDef.type !== oldColDef.type) { const updatedColumnState = getUpdatedColumnState(column, columnStateUpdates); if (updatedColumnState.rowGroup && updatedColumnState.rowGroupIndex == null) { newRowGroupColumnStateWithoutIndex[colId] = updatedColumnState; } if (updatedColumnState.pivot && updatedColumnState.pivotIndex == null) { newPivotColumnStateWithoutIndex[colId] = updatedColumnState; } state.push(updatedColumnState); } } if (columnTypeOverridesExist) { state.push( ...this.generateColumnStateForRowGroupAndPivotIndexes( newRowGroupColumnStateWithoutIndex, newPivotColumnStateWithoutIndex ) ); } if (state.length) { _applyColumnState(this.beans, { state }, "cellDataTypeInferred"); } this.initialData = null; } generateColumnStateForRowGroupAndPivotIndexes(updatedRowGroupColumnState, updatedPivotColumnState) { const existingColumnStateUpdates = {}; const { rowGroupColsSvc, pivotColsSvc } = this.beans; rowGroupColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedRowGroupColumnState); pivotColsSvc?.restoreColumnOrder(existingColumnStateUpdates, updatedPivotColumnState); return Object.values(existingColumnStateUpdates); } resetColDefIntoCol(column, source) { const userColDef = column.getUserProvidedColDef(); if (!userColDef) { return false; } const newColDef = _addColumnDefaultAndTypes(this.beans, userColDef, column.getColId()); column.setColDef(newColDef, userColDef, source); return true; } getDateStringTypeDefinition(column) { const { dateString } = this.dataTypeDefinitions; if (!column) { return dateString; } return this.getDataTypeDefinition(column) ?? dateString; } getDateParserFunction(column) { return this.getDateStringTypeDefinition(column).dateParser; } getDateFormatterFunction(column) { return this.getDateStringTypeDefinition(column).dateFormatter; } getDateIncludesTimeFlag(cellDataType) { return cellDataType === "dateTime" || cellDataType === "dateTimeString"; } getDataTypeDefinition(column) { const colDef = column.getColDef(); if (!colDef.cellDataType) { return void 0; } return this.dataTypeDefinitions[colDef.cellDataType]; } getBaseDataType(column) { return this.getDataTypeDefinition(column)?.baseDataType; } checkType(column, value) { if (value == null) { return true; } const dataTypeMatcher = this.getDataTypeDefinition(column)?.dataTypeMatcher; if (!dataTypeMatcher) { return true; } if (column.getColDef().allowFormula && this.beans.formula?.isFormula(value)) { return true; } return dataTypeMatcher(value); } validateColDef(colDef, userColDef, defaultColDef, colId) { if (colDef.cellDataType === "object") { const wasInferred = (colDef2) => { return colDef2?.cellDataType == null || colDef2?.cellDataType === true; }; const inferred = wasInferred(userColDef) && wasInferred(defaultColDef); const warning = (property) => _warn(48, { property, inferred, colId }); const { object } = this.dataTypeDefinitions; if (colDef.valueFormatter === object.groupSafeValueFormatter && !this.hasObjectValueFormatter) { warning("Formatter"); } if (colDef.editable && colDef.valueParser === object.valueParser && !this.hasObjectValueParser) { warning("Parser"); } } } postProcess(colDef) { const cellDataType = colDef.cellDataType; if (!cellDataType || typeof cellDataType !== "string") { return; } const { dataTypeDefinitions, beans, formatValueFuncs } = this; const dataTypeDefinition = dataTypeDefinitions[cellDataType]; if (!dataTypeDefinition) { return; } beans.colFilter?.setColDefPropsForDataType(colDef, dataTypeDefinition, formatValueFuncs[cellDataType]); } // noinspection JSUnusedGlobalSymbols getFormatValue(cellDataType) { return this.formatValueFuncs[cellDataType]; } isColPendingInference(colId) { return this.isPendingInference && !!this.columnStateUpdatesPendingInference[colId]; } setColDefPropertiesForBaseDataType(colDef, cellDataType, dataTypeDefinition, colId) { const formatValue = this.formatValueFuncs[cellDataType]; const partialColDef = this.columnDefinitionPropsPerDataType[dataTypeDefinition.baseDataType]({ colDef, cellDataType, colModel: this.colModel, dataTypeDefinition, colId, formatValue, filterModuleBean: this.beans.filterManager }); if (colDef.cellEditor === "agFormulaCellEditor" && partialColDef.cellEditor !== colDef.cellEditor) { partialColDef.cellEditor = colDef.cellEditor; } Object.assign(colDef, partialColDef); } getDateObjectTypeDef(baseDataType) { const translate = this.getLocaleTextFunc(); const includeTime = this.getDateIncludesTimeFlag(baseDataType); return { baseDataType, valueParser: (params) => _parseDateTimeFromString(params.newValue && String(params.newValue)), valueFormatter: (params) => { if (params.value == null) { return ""; } if (!(params.value instanceof Date) || isNaN(params.value.getTime())) { return translate("invalidDate", "Invalid Date"); } return _serialiseDate(params.value, includeTime) ?? ""; }, dataTypeMatcher: (value) => value instanceof Date }; } getDateStringTypeDef(baseDataType) { const includeTime = this.getDateIncludesTimeFlag(baseDataType); return { baseDataType, dateParser: (value) => _parseDateTimeFromString(value) ?? void 0, dateFormatter: (value) => _serialiseDate(value ?? null, includeTime) ?? void 0, valueParser: (params) => _isValidDate(String(params.newValue)) ? params.newValue : null, valueFormatter: (params) => _isValidDate(String(params.value)) ? String(params.value) : "", dataTypeMatcher: (value) => typeof value === "string" && _isValidDate(value) }; } getDefaultDataTypes() { const translate = this.getLocaleTextFunc(); return { number: { baseDataType: "number", // can be empty space with legacy copy valueParser: (params) => params.newValue?.trim?.() === "" ? null : Number(params.newValue), valueFormatter: (params) => { if (params.value == null) { return ""; } if (typeof params.value !== "number" || isNaN(params.value)) { return translate("invalidNumber", "Invalid Number"); } return String(params.value); }, dataTypeMatcher: (value) => typeof value === "number" }, bigint: { baseDataType: "bigint", valueParser: (params) => { const { newValue } = params; if (newValue == null) { return null; } if (typeof newValue === "string" && newValue.trim() === "") { return null; } return _parseBigIntOrNull(newValue); }, valueFormatter: (params) => { if (params.value == null) { return ""; } if (typeof params.value !== "bigint") { return translate("invalidBigInt", "Invalid BigInt"); } return String(params.value); }, dataTypeMatcher: (value) => typeof value === "bigint" }, text: { baseDataType: "text", valueParser: (params) => params.newValue === "" ? null : _toStringOrNull(params.newValue), dataTypeMatcher: (value) => typeof value === "string" }, boolean: { baseDataType: "boolean", valueParser: (params) => { if (params.newValue == null) { return params.newValue; } return params.newValue?.trim?.() === "" ? null : String(params.newValue).toLowerCase() === "true"; }, valueFormatter: (params) => params.value == null ? "" : String(params.value), dataTypeMatcher: (value) => typeof value === "boolean" }, date: this.getDateObjectTypeDef("date"), dateString: this.getDateStringTypeDef("dateString"), dateTime: this.getDateObjectTypeDef("dateTime"), dateTimeString: { ...this.getDateStringTypeDef("dateTimeString"), dataTypeMatcher: (value) => typeof value === "string" && _isValidDateTime(value) }, object: { baseDataType: "object", valueParser: () => null, valueFormatter: (params) => _toStringOrNull(params.value) ?? "" } }; } destroyColumnStateUpdateListeners() { for (const destroyFunc of this.columnStateUpdateListenerDestroyFuncs) { destroyFunc(); } this.columnStateUpdateListenerDestroyFuncs = []; } destroy() { this.dataTypeDefinitions = {}; this.dataTypeMatchers = {}; this.formatValueFuncs = {}; this.columnStateUpdatesPendingInference = {}; this.destroyColumnStateUpdateListeners(); super.destroy(); } }; function mergeDataTypeDefinitions(parentDataTypeDefinition, childDataTypeDefinition) { const mergedDataTypeDefinition = { ...parentDataTypeDefinition, ...childDataTypeDefinition }; if (parentDataTypeDefinition.columnTypes && childDataTypeDefinition.columnTypes && childDataTypeDefinition.appendColumnTypes) { mergedDataTypeDefinition.columnTypes = [ ...convertColumnTypes(parentDataTypeDefinition.columnTypes), ...convertColumnTypes(childDataTypeDefinition.columnTypes) ]; } return mergedDataTypeDefinition; } function validateDataTypeDefinition(dataTypeDefinition, parentDataTypeDefinition, parentCellDataType) { if (!parentDataTypeDefinition) { _warn(45, { parentCellDataType }); return false; } if (parentDataTypeDefinition.baseDataType !== dataTypeDefinition.baseDataType) { _warn(46); return false; } return true; } var isNumberOrBigintType = (v) => typeof v === "bigint" || typeof v === "number"; var isNumberOrBigintBaseDataType = (v) => v === "number" || v === "bigint"; function createGroupSafeValueFormatter(dataTypeDefinition, gos) { if (!dataTypeDefinition.valueFormatter) { return void 0; } return (params) => { const { node, colDef, column, value } = params; if (node?.group) { const aggFunc = (colDef.pivotValueColumn ?? column).getAggFunc(); if (aggFunc) { if (aggFunc === "first" || aggFunc === "last") { return dataTypeDefinition.valueFormatter(params); } const { baseDataType } = dataTypeDefinition; if (isNumberOrBigintBaseDataType(baseDataType) && aggFunc !== "count") { if (isNumberOrBigintType(value)) { return dataTypeDefinition.valueFormatter(params); } if (value == null) { return void 0; } if (typeof value === "object") { if (typeof value.toNumber === "function") { return dataTypeDefinition.valueFormatter({ ...params, value: value.toNumber() }); } if ("value" in value) { return dataTypeDefinition.valueFormatter({ ...params, value: value.value }); } } } return void 0; } } else if (gos.get("groupHideOpenParents") && params.column.isRowGroupActive()) { if (typeof params.value === "string" && !dataTypeDefinition.dataTypeMatcher?.(params.value)) { return void 0; } } return dataTypeDefinition.valueFormatter(params); }; } function doesColDefPropPreventInference(colDef, checkProps, prop, comparisonValue) { if (!checkProps[prop]) { return false; } const value = colDef[prop]; if (value === null) { checkProps[prop] = false; return false; } else { return comparisonValue === void 0 ? !!value : value === comparisonValue; } } function bigintComparator(valueA, valueB) { if (valueA == null) { return valueB == null ? 0 : -1; } if (valueB == null) { return 1; } const bigA = _parseBigIntOrNull(valueA); const bigB = _parseBigIntOrNull(valueB); if (bigA != null && bigB != null) { if (bigA === bigB) { return 0; } return bigA > bigB ? 1 : -1; } return 0; } function bigintAbsoluteComparator(valueA, valueB) { if (valueA == null) { return valueB == null ? 0 : -1; } if (valueB == null) { return 1; } const bigA = toAbsoluteBigInt(valueA); const bigB = toAbsoluteBigInt(valueB); if (bigA != null && bigB != null) { if (bigA === bigB) { return 0; } return bigA > bigB ? 1 : -1; } return 0; } function toAbsoluteBigInt(value) { const bigIntValue = _parseBigIntOrNull(value); if (bigIntValue == null) { return null; } return bigIntValue < 0n ? -bigIntValue : bigIntValue; } function doColDefPropsPreventInference(colDef, propsToCheckForInference) { return [ ["cellRenderer", "agSparklineCellRenderer"], ["valueGetter", void 0], ["valueParser", void 0], ["refData", void 0] ].some( ([prop, comparisonValue]) => doesColDefPropPreventInference(colDef, propsToCheckForInference, prop, comparisonValue) ); } function getUpdatedColumnState(column, columnStateUpdates) { const columnState = getColumnStateFromColDef(column); for (const key of columnStateUpdates) { delete columnState[key]; if (key === "rowGroup") { delete columnState.rowGroupIndex; } else if (key === "pivot") { delete columnState.pivotIndex; } } return columnState; } var DataTypeModule = { moduleName: "DataType", version: VERSION, beans: [DataTypeService], dependsOn: [CheckboxCellRendererModule] }; var ColumnFlexModule = { moduleName: "ColumnFlex", version: VERSION, beans: [ColumnFlexService] }; var ColumnApiModule = { moduleName: "ColumnApi", version: VERSION, beans: [ColumnDefFactory], apiFunctions: { getColumnDef, getDisplayNameForColumn, getColumn, getColumns, applyColumnState, getColumnState, resetColumnState, isPinning, isPinningLeft, isPinningRight, getDisplayedColAfter, getDisplayedColBefore, setColumnsVisible, setColumnsPinned, getAllGridColumns, getDisplayedLeftColumns, getDisplayedCenterColumns, getDisplayedRightColumns, getAllDisplayedColumns, getAllDisplayedVirtualColumns, getColumnDefs } }; var ColumnNameService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colNames"; } getDisplayNameForColumn(column, location, includeAggFunc = false) { if (!column) { return null; } const headerName = this.getHeaderName(column.getColDef(), column, null, null, location); const { aggColNameSvc } = this.beans; if (includeAggFunc && aggColNameSvc) { return aggColNameSvc.getHeaderName(column, headerName); } return headerName; } getDisplayNameForProvidedColumnGroup(columnGroup, providedColumnGroup, location) { const colGroupDef = providedColumnGroup?.getColGroupDef(); if (colGroupDef) { return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location); } return null; } getDisplayNameForColumnGroup(columnGroup, location) { return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location); } // location is where the column is going to appear, ie who is calling us getHeaderName(colDef, column, columnGroup, providedColumnGroup, location) { const headerValueGetter = colDef.headerValueGetter; if (headerValueGetter) { const params = _addGridCommonParams(this.gos, { colDef, column, columnGroup, providedColumnGroup, location }); if (typeof headerValueGetter === "function") { return headerValueGetter(params); } else if (typeof headerValueGetter === "string") { return this.beans.expressionSvc?.evaluate(headerValueGetter, params) ?? null; } return ""; } else if (colDef.headerName != null) { return colDef.headerName; } else if (colDef.field) { return _camelCaseToHumanText(colDef.field); } return ""; } }; var ColumnViewportService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colViewport"; this.colsWithinViewport = []; this.headerColsWithinViewport = []; this.colsWithinViewportHash = ""; this.rowsOfHeadersToRenderLeft = {}; this.rowsOfHeadersToRenderRight = {}; this.rowsOfHeadersToRenderCenter = {}; this.columnsToRenderLeft = []; this.columnsToRenderRight = []; this.columnsToRenderCenter = []; } wireBeans(beans) { this.visibleCols = beans.visibleCols; this.colModel = beans.colModel; } postConstruct() { this.suppressColumnVirtualisation = this.gos.get("suppressColumnVirtualisation"); } getScrollPosition() { return this.scrollPosition; } setScrollPosition(scrollWidth, scrollPosition, afterScroll = false) { const { visibleCols } = this; const bodyWidthDirty = visibleCols.isBodyWidthDirty; const noChange = scrollWidth === this.scrollWidth && scrollPosition === this.scrollPosition && !bodyWidthDirty; if (noChange) { return; } this.scrollWidth = scrollWidth; this.scrollPosition = scrollPosition; visibleCols.isBodyWidthDirty = true; if (this.gos.get("enableRtl")) { const bodyWidth = visibleCols.bodyWidth; this.viewportLeft = bodyWidth - scrollPosition - scrollWidth; this.viewportRight = bodyWidth - scrollPosition; } else { this.viewportLeft = scrollPosition; this.viewportRight = scrollWidth + scrollPosition; } if (this.colModel.ready) { this.checkViewportColumns(afterScroll); } } /** * Returns the columns that are currently rendered in the viewport. */ getColumnHeadersToRender(type) { switch (type) { case "left": return this.columnsToRenderLeft; case "right": return this.columnsToRenderRight; default: return this.columnsToRenderCenter; } } /** * Returns the column groups that are currently rendered in the viewport at a specific header row index. */ getHeadersToRender(type, depth) { let result; switch (type) { case "left": result = this.rowsOfHeadersToRenderLeft[depth]; break; case "right": result = this.rowsOfHeadersToRenderRight[depth]; break; default: result = this.rowsOfHeadersToRenderCenter[depth]; break; } return result ?? []; } extractViewportColumns() { const displayedColumnsCenter = this.visibleCols.centerCols; if (this.isColumnVirtualisationSuppressed()) { this.colsWithinViewport = displayedColumnsCenter; this.headerColsWithinViewport = displayedColumnsCenter; } else { this.colsWithinViewport = displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)); this.headerColsWithinViewport = displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this)); } } isColumnVirtualisationSuppressed() { return this.suppressColumnVirtualisation || this.viewportRight === 0; } clear() { this.rowsOfHeadersToRenderLeft = {}; this.rowsOfHeadersToRenderRight = {}; this.rowsOfHeadersToRenderCenter = {}; this.colsWithinViewportHash = ""; } isColumnInHeaderViewport(col) { if (col.isAutoHeaderHeight() || isAnyParentAutoHeaderHeight(col)) { return true; } return this.isColumnInRowViewport(col); } isColumnInRowViewport(col) { if (col.isAutoHeight()) { return true; } const columnLeft = col.getLeft() || 0; const columnRight = columnLeft + col.getActualWidth(); const leftBounds = this.viewportLeft - 200; const rightBounds = this.viewportRight + 200; const columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds; const columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds; return !columnToMuchLeft && !columnToMuchRight; } // used by Grid API only getViewportColumns() { const { leftCols, rightCols } = this.visibleCols; const res = this.colsWithinViewport.concat(leftCols).concat(rightCols); return res; } // + rowRenderer // if we are not column spanning, this just returns back the virtual centre columns, // however if we are column spanning, then different rows can have different virtual // columns, so we have to work out the list for each individual row. getColsWithinViewport(rowNode) { if (!this.colModel.colSpanActive) { return this.colsWithinViewport; } const emptySpaceBeforeColumn = (col) => { const left = col.getLeft(); return _exists(left) && left > this.viewportLeft; }; const inViewportCallback = this.isColumnVirtualisationSuppressed() ? void 0 : this.isColumnInRowViewport.bind(this); const { visibleCols } = this; const displayedColumnsCenter = visibleCols.centerCols; return visibleCols.getColsForRow(rowNode, displayedColumnsCenter, inViewportCallback, emptySpaceBeforeColumn); } // checks what columns are currently displayed due to column virtualisation. dispatches an event // if the list of columns has changed. // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit() checkViewportColumns(afterScroll = false) { const viewportColumnsChanged = this.extractViewport(); if (viewportColumnsChanged) { this.eventSvc.dispatchEvent({ type: "virtualColumnsChanged", afterScroll }); } } calculateHeaderRows() { const { leftCols, rightCols } = this.visibleCols; this.columnsToRenderLeft = leftCols; this.columnsToRenderRight = rightCols; this.columnsToRenderCenter = this.colsWithinViewport; const workOutGroupsToRender = (cols) => { const groupsToRenderSet = /* @__PURE__ */ new Set(); const groupsToRender = {}; for (const col of cols) { let group = col.getParent(); const skipFillers = col.isSpanHeaderHeight(); while (group) { if (groupsToRenderSet.has(group)) { break; } const skipFillerGroup = skipFillers && group.isPadding(); if (skipFillerGroup) { group = group.getParent(); continue; } const level = group.getProvidedColumnGroup().getLevel(); groupsToRender[level] ?? (groupsToRender[level] = []); groupsToRender[level].push(group); groupsToRenderSet.add(group); group = group.getParent(); } } return groupsToRender; }; this.rowsOfHeadersToRenderLeft = workOutGroupsToRender(leftCols); this.rowsOfHeadersToRenderRight = workOutGroupsToRender(rightCols); this.rowsOfHeadersToRenderCenter = workOutGroupsToRender(this.headerColsWithinViewport); } extractViewport() { const hashColumn = (c) => `${c.getId()}-${c.getPinned() || "normal"}`; this.extractViewportColumns(); const newHash = this.getViewportColumns().map(hashColumn).join("#"); const changed = this.colsWithinViewportHash !== newHash; if (changed) { this.colsWithinViewportHash = newHash; this.calculateHeaderRows(); } return changed; } }; function isAnyParentAutoHeaderHeight(col) { while (col) { if (col.isAutoHeaderHeight()) { return true; } col = col.getParent(); } return false; } var AgComponentUtils = class extends BeanStub { constructor() { super(...arguments); this.beanName = "agCompUtils"; } adaptFunction(type, jsCompFunc) { if (!type.cellRenderer) { return null; } class Adapter { refresh() { return false; } getGui() { return this.eGui; } init(params) { const callbackResult = jsCompFunc(params); const type2 = typeof callbackResult; if (type2 === "string" || type2 === "number" || type2 === "boolean") { this.eGui = _loadTemplate("" + callbackResult + ""); return; } if (callbackResult == null) { this.eGui = _createElement({ tag: "span" }); return; } this.eGui = callbackResult; } } return Adapter; } }; var CellRendererFunctionModule = { moduleName: "CellRendererFunction", version: VERSION, beans: [AgComponentUtils] }; var BaseRegistry = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "registry"; } registerDynamicBeans(dynamicBeans) { if (dynamicBeans) { this.dynamicBeans ?? (this.dynamicBeans = {}); for (const name of Object.keys(dynamicBeans)) { this.dynamicBeans[name] = dynamicBeans[name]; } } } createDynamicBean(name, mandatory, ...args) { if (!this.dynamicBeans) { throw new Error(this.getDynamicError(name, true)); } const BeanClass = this.dynamicBeans[name]; if (BeanClass == null) { if (mandatory) { throw new Error(this.getDynamicError(name, false)); } return void 0; } return new BeanClass(...args); } }; function isComponentMetaFunc(componentMeta) { return typeof componentMeta === "object" && !!componentMeta.getComp; } var Registry = class extends BaseRegistry { constructor() { super(...arguments); this.agGridDefaults = {}; this.agGridDefaultOverrides = {}; this.jsComps = {}; this.selectors = {}; this.icons = {}; } postConstruct() { const comps = this.gos.get("components"); if (comps != null) { for (const key of Object.keys(comps)) { this.jsComps[key] = comps[key]; } } } registerModule(module2) { const { icons: icons2, userComponents, dynamicBeans, selectors } = module2; if (userComponents) { const registerUserComponent = (name, component, params, processParams) => { this.agGridDefaults[name] = component; if (params || processParams) { this.agGridDefaultOverrides[name] = { params, processParams }; } }; for (const name of Object.keys(userComponents)) { let comp = userComponents[name]; if (isComponentMetaFunc(comp)) { comp = comp.getComp(this.beans); } if (typeof comp === "object") { const { classImp, params, processParams } = comp; registerUserComponent(name, classImp, params, processParams); } else { registerUserComponent(name, comp); } } } this.registerDynamicBeans(dynamicBeans); for (const selector of selectors ?? []) { this.selectors[selector.selector] = selector; } if (icons2) { for (const name of Object.keys(icons2)) { this.icons[name] = icons2[name]; } } } getUserComponent(propertyName, name) { const createResult = (component, componentFromFramework, params, processParams) => ({ componentFromFramework, component, params, processParams }); const { frameworkOverrides } = this.beans; const registeredViaFrameworkComp = frameworkOverrides.frameworkComponent(name, this.gos.get("components")); if (registeredViaFrameworkComp != null) { return createResult(registeredViaFrameworkComp, true); } const jsComponent = this.jsComps[name]; if (jsComponent) { const isFwkComp = frameworkOverrides.isFrameworkComponent(jsComponent); return createResult(jsComponent, isFwkComp); } const defaultComponent = this.agGridDefaults[name]; if (defaultComponent) { const overrides = this.agGridDefaultOverrides[name]; return createResult(defaultComponent, false, overrides?.params, overrides?.processParams); } this.beans.validation?.missingUserComponent(propertyName, name, this.agGridDefaults, this.jsComps); return null; } getSelector(name) { return this.selectors[name]; } getIcon(name) { return this.icons[name]; } getDynamicError(name, init) { if (init) { return _errMsg(279, { name }); } return this.beans.validation?.missingDynamicBean(name) ?? _errMsg(256); } }; var NUM_CTRLS = 23; var CtrlsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ctrlsSvc"; this.params = {}; this.ready = false; this.readyCallbacks = []; } postConstruct() { this.addEventListener( "ready", () => { this.updateReady(); if (this.ready) { for (const callback of this.readyCallbacks) { callback(this.params); } this.readyCallbacks.length = 0; } }, this.beans.frameworkOverrides.runWhenReadyAsync?.() ?? false ); } updateReady() { const values = Object.values(this.params); this.ready = values.length === NUM_CTRLS && values.every((ctrl) => { return ctrl?.isAlive() ?? false; }); } whenReady(caller, callback) { if (this.ready) { callback(this.params); } else { this.readyCallbacks.push(callback); } caller.addDestroyFunc(() => { const index = this.readyCallbacks.indexOf(callback); if (index >= 0) { this.readyCallbacks.splice(index, 1); } }); } register(ctrlType, ctrl) { this.params[ctrlType] = ctrl; this.updateReady(); if (this.ready) { this.dispatchLocalEvent({ type: "ready" }); } ctrl.addDestroyFunc(() => { this.updateReady(); }); } get(ctrlType) { return this.params[ctrlType]; } getGridBodyCtrl() { return this.params.gridBodyCtrl; } getHeaderRowContainerCtrls() { const { leftHeader, centerHeader, rightHeader } = this.params; return [leftHeader, rightHeader, centerHeader]; } getHeaderRowContainerCtrl(pinned) { const params = this.params; switch (pinned) { case "left": return params.leftHeader; case "right": return params.rightHeader; default: return params.centerHeader; } } getScrollFeature() { return this.getGridBodyCtrl().scrollFeature; } }; var shared_default = ':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);font-weight:var(--ag-font-weight);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}'; var IS_SSR = typeof window !== "object" || !window?.document?.fonts?.forEach; var FORCE_LEGACY_THEMES = false; var _injectGlobalCSS = (rawCss, styleContainer, debugId, layer, priority, nonce, isParams = false) => { if (IS_SSR || FORCE_LEGACY_THEMES) { return; } let injectedCss = rawCss; if (layer) { injectedCss = `@layer ${CSS.escape(layer).replaceAll("\\.", ".")} { ${rawCss} }`; } let injections = injectionState.map.get(styleContainer); if (!injections) { injections = []; injectionState.map.set(styleContainer, injections); } if (injections.some((i) => i.injectedCss === injectedCss)) { return; } const el = document.createElement("style"); if (nonce) { el.setAttribute("nonce", nonce); } el.dataset.agCss = debugId; el.dataset.agCssVersion = VERSION; el.textContent = injectedCss; const newInjection = { rawCss, injectedCss, el, priority, isParams }; let insertAfter; for (const injection of injections) { if (injection.priority > priority) { break; } insertAfter = injection; } if (insertAfter) { insertAfter.el.after(el); const index = injections.indexOf(insertAfter); injections.splice(index + 1, 0, newInjection); } else { if (styleContainer.nodeName === "STYLE") { styleContainer.after(el); } else { styleContainer.insertBefore(el, styleContainer.querySelector(":not(title, meta)")); } injections.push(newInjection); } }; var _injectCoreAndModuleCSS = (styleContainer, layer, nonce, moduleCss) => { _injectGlobalCSS(shared_default, styleContainer, "shared", layer, 0, nonce); moduleCss?.forEach( (css, debugId) => css.forEach((singleCss) => _injectGlobalCSS(singleCss, styleContainer, debugId, layer, 0, nonce)) ); }; var _useParamsCss = (environment, paramsCss, paramsDebugId, styleContainer, layer, nonce) => { if (IS_SSR || FORCE_LEGACY_THEMES) { return; } const gridState = injectionState.grids.get(environment); if (!gridState) { injectionState.grids.set(environment, { styleContainer, paramsCss }); } else { gridState.paramsCss = paramsCss; } removeStaleParamsCss(styleContainer); if (paramsCss && paramsDebugId) { _injectGlobalCSS(paramsCss, styleContainer, paramsDebugId, layer, 2, nonce, true); } }; var _unregisterInstanceUsingThemingAPI = (environment) => { const styleContainer = injectionState.grids.get(environment)?.styleContainer; if (!styleContainer) { return; } injectionState.grids.delete(environment); const containerStillInUse = Array.from(injectionState.grids.values()).some( (gs) => gs.styleContainer === styleContainer ); if (containerStillInUse) { removeStaleParamsCss(styleContainer); } else { removeStaleParamsCss(styleContainer, true); injectionState.map.delete(styleContainer); } }; var removeStaleParamsCss = (styleContainer, deleteAll = false) => { const neededCss = /* @__PURE__ */ new Set(); for (const gs of injectionState.grids.values()) { if (gs.styleContainer === styleContainer) { neededCss.add(gs.paramsCss); } } const injections = injectionState.map.get(styleContainer) ?? []; for (let i = injections.length - 1; i >= 0; i--) { if (deleteAll || injections[i].isParams && !neededCss.has(injections[i].rawCss)) { injections[i].el.remove(); injections.splice(i, 1); } } }; var getInjectionState = () => { const versionMap = globalThis.agStyleInjectionVersions ?? (globalThis.agStyleInjectionVersions = /* @__PURE__ */ new Map()); let state = versionMap.get(VERSION); if (!state) { state = { map: /* @__PURE__ */ new WeakMap(), grids: /* @__PURE__ */ new Map(), paramsId: 0 }; versionMap.set(VERSION, state); } return state; }; var injectionState = getInjectionState(); var createPart = (args) => { return new PartImpl(args); }; var defaultModeName = "$default"; var partCounter = 0; var PartImpl = class { constructor({ feature, params, modeParams = {}, css, cssImports }) { this.feature = feature; this.css = css; this.cssImports = cssImports; this.modeParams = { // NOTE: it's important that default is defined first, putting it // first in iteration order, because when merging params the default // params override any prior modal params, so modal params in this // part need to come after default params to prevent them from being // immediately overridden. [defaultModeName]: { ...modeParams[defaultModeName] ?? {}, ...params ?? {} }, ...modeParams }; } use(styleContainer, layer, nonce) { let inject = this._inject; if (inject == null) { let { css } = this; if (css) { const className = `ag-theme-${this.feature ?? "part"}-${++partCounter}`; if (typeof css === "function") { css = css(); } css = `:where(.${className}) { ${css} } `; for (const cssImport of this.cssImports ?? []) { css = `@import url(${JSON.stringify(cssImport)}); ${css}`; } inject = { css, class: className }; } else { inject = false; } this._inject = inject; } if (inject && styleContainer) { _injectGlobalCSS(inject.css, styleContainer, inject.class, layer, 1, nonce); } return inject ? inject.class : false; } }; var kebabCase = (str) => str.replace(/[A-Z]|\d+/g, (m) => `-${m}`).toLowerCase(); var paramToVariableName = (paramName) => `--ag-${kebabCase(paramName)}`; var paramToVariableExpression = (paramName) => `var(${paramToVariableName(paramName)})`; var clamp = (value, min, max) => Math.max(min, Math.min(max, value)); var memoize = (fn) => { const values = /* @__PURE__ */ new Map(); return (a) => { const key = a; if (!values.has(key)) { values.set(key, fn(a)); } return values.get(key); }; }; var accentMix = (mix) => ({ ref: "accentColor", mix }); var foregroundMix = (mix) => ({ ref: "foregroundColor", mix }); var foregroundBackgroundMix = (mix) => ({ ref: "foregroundColor", mix, onto: "backgroundColor" }); var foregroundHeaderBackgroundMix = (mix) => ({ ref: "foregroundColor", mix, onto: "headerBackgroundColor" }); var backgroundColor = { ref: "backgroundColor" }; var foregroundColor = { ref: "foregroundColor" }; var accentColor = { ref: "accentColor" }; var defaultLightColorSchemeParams = { backgroundColor: "#fff", foregroundColor: "#181d1f", borderColor: foregroundMix(0.15), chromeBackgroundColor: foregroundBackgroundMix(0.02), browserColorScheme: "light" }; var sharedDefaults = { ...defaultLightColorSchemeParams, textColor: foregroundColor, accentColor: "#2196f3", invalidColor: "#e02525", fontFamily: [ "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", "sans-serif" ], subtleTextColor: { ref: "textColor", mix: 0.5 }, borderWidth: 1, borderRadius: 4, spacing: 8, fontSize: 14, fontWeight: "inherit", focusShadow: { spread: 3, color: accentMix(0.5) }, focusErrorShadow: { spread: 3, color: { ref: "invalidColor", onto: "backgroundColor", mix: 0.5 } }, popupShadow: "0 0 16px #00000026", cardShadow: "0 1px 4px 1px #00000018", dropdownShadow: { ref: "cardShadow" }, listItemHeight: { calc: "max(iconSize, dataFontSize) + widgetVerticalSpacing" }, dragAndDropImageBackgroundColor: backgroundColor, dragAndDropImageBorder: true, dragAndDropImageNotAllowedBorder: { color: { ref: "invalidColor", onto: "dragAndDropImageBackgroundColor", mix: 0.5 } }, dragAndDropImageShadow: { ref: "popupShadow" }, iconSize: 16, iconColor: "inherit", toggleButtonWidth: 28, toggleButtonHeight: 18, toggleButtonOnBackgroundColor: accentColor, toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.3), toggleButtonSwitchBackgroundColor: backgroundColor, toggleButtonSwitchInset: 2, tooltipBackgroundColor: { ref: "chromeBackgroundColor" }, tooltipErrorBackgroundColor: { ref: "invalidColor", onto: "backgroundColor", mix: 0.1 }, tooltipTextColor: { ref: "textColor" }, tooltipErrorTextColor: { ref: "invalidColor" }, tooltipBorder: true, tooltipErrorBorder: { color: { ref: "invalidColor", onto: "backgroundColor", mix: 0.25 } }, panelBackgroundColor: backgroundColor, panelTitleBarHeight: { ref: "headerHeight" }, panelTitleBarBackgroundColor: { ref: "headerBackgroundColor" }, panelTitleBarIconColor: { ref: "headerTextColor" }, panelTitleBarTextColor: { ref: "headerTextColor" }, panelTitleBarFontFamily: { ref: "headerFontFamily" }, panelTitleBarFontSize: { ref: "headerFontSize" }, panelTitleBarFontWeight: { ref: "headerFontWeight" }, panelTitleBarBorder: true, dialogShadow: { ref: "popupShadow" }, dialogBorder: { color: foregroundMix(0.2) }, widgetContainerHorizontalPadding: { calc: "spacing * 1.5" }, widgetContainerVerticalPadding: { calc: "spacing * 1.5" }, widgetHorizontalSpacing: { calc: "spacing * 1.5" }, widgetVerticalSpacing: { ref: "spacing" }, dataFontSize: { ref: "fontSize" }, headerBackgroundColor: { ref: "chromeBackgroundColor" }, headerFontFamily: { ref: "fontFamily" }, headerFontSize: { ref: "fontSize" }, headerFontWeight: 500, headerTextColor: { ref: "textColor" }, headerHeight: { calc: "max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale" }, headerVerticalPaddingScale: 1, menuBorder: { color: foregroundMix(0.2) }, menuBackgroundColor: foregroundBackgroundMix(0.03), menuTextColor: foregroundBackgroundMix(0.95), menuShadow: { ref: "popupShadow" }, menuSeparatorColor: { ref: "borderColor" } }; var paramTypes = [ "colorScheme", "color", "length", "scale", "borderStyle", "border", "shadow", "image", "fontFamily", "fontWeight", "duration" ]; var getParamType = memoize((param) => { param = param.toLowerCase(); return paramTypes.find((type) => param.endsWith(type.toLowerCase())) ?? "length"; }); var literalToCSS = (value) => { if (typeof value === "object" && value?.ref) { return paramToVariableExpression(value.ref); } if (typeof value === "string") { return value; } if (typeof value === "number") { return String(value); } return false; }; var colorValueToCss = (value) => { if (typeof value === "string") { return value; } if (typeof value === "object" && value && "ref" in value) { const colorExpr = paramToVariableExpression(value.ref); if (value.mix == null) { return colorExpr; } const backgroundExpr = value.onto ? paramToVariableExpression(value.onto) : "transparent"; return `color-mix(in srgb, ${backgroundExpr}, ${colorExpr} ${clamp(value.mix * 100, 0, 100)}%)`; } return false; }; var colorSchemeValueToCss = literalToCSS; var lengthValueToCss = (value) => { if (typeof value === "string") { return value; } if (typeof value === "number") { return `${value}px`; } if (typeof value === "object" && value && "calc" in value) { const valueWithSpaces = value.calc.replace(/ ?[*/+] ?/g, " $& "); return `calc(${valueWithSpaces.replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi, (p) => p[0] === "-" ? p : " " + paramToVariableExpression(p) + " ")})`; } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } return false; }; var scaleValueToCss = literalToCSS; var borderValueToCss = (value, param) => { if (typeof value === "string") { return value; } if (value === true) { return borderValueToCss({}, param); } if (value === false) { return param === "columnBorder" ? borderValueToCss({ color: "transparent" }, param) : "none"; } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } return borderStyleValueToCss(value.style ?? "solid") + " " + lengthValueToCss(value.width ?? { ref: "borderWidth" }) + " " + colorValueToCss(value.color ?? { ref: "borderColor" }); }; var shadowValueParamsToCss = (value) => { return [ lengthValueToCss(value.offsetX ?? 0), lengthValueToCss(value.offsetY ?? 0), lengthValueToCss(value.radius ?? 0), lengthValueToCss(value.spread ?? 0), colorValueToCss(value.color ?? { ref: "foregroundColor" }), ...value.inset ? ["inset"] : [] ].join(" "); }; var shadowValueToCss = (value) => { if (typeof value === "string") { return value; } if (value === false) { return "none"; } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } if (Array.isArray(value)) { return value.map(shadowValueParamsToCss).join(", "); } return shadowValueParamsToCss(value); }; var borderStyleValueToCss = literalToCSS; var fontFamilyValueToCss = (value) => { if (typeof value === "string") { return value.includes(",") ? value : quoteUnsafeChars(value); } if (typeof value === "object" && value && "googleFont" in value) { return fontFamilyValueToCss(value.googleFont); } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } if (Array.isArray(value)) { return value.map((font) => { if (typeof font === "object" && "googleFont" in font) { font = font.googleFont; } return quoteUnsafeChars(font); }).join(", "); } return false; }; var quoteUnsafeChars = (font) => ( // don't quote var() expressions or quote safe identifier names, so that // people can specify fonts like sans-serif which are keywords not strings, // or var(--my-var) /^[\w-]+$|\w\(/.test(font) ? font : JSON.stringify(font) ); var fontWeightValueToCss = literalToCSS; var imageValueToCss = (value) => { if (typeof value === "string") { return value; } if (typeof value === "object" && value && "url" in value) { return `url(${JSON.stringify(value.url)})`; } if (typeof value === "object" && value && "svg" in value) { return imageValueToCss({ url: `data:image/svg+xml,${encodeURIComponent(value.svg)}` }); } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } return false; }; var durationValueToCss = (value, param, themeLogger) => { if (typeof value === "string") { return value; } if (typeof value === "number") { if (value >= 10) { themeLogger?.warn(104, { value, param }); } return `${value}s`; } if (typeof value === "object" && value && "ref" in value) { return paramToVariableExpression(value.ref); } return false; }; var paramValidators = { color: colorValueToCss, colorScheme: colorSchemeValueToCss, length: lengthValueToCss, scale: scaleValueToCss, border: borderValueToCss, borderStyle: borderStyleValueToCss, shadow: shadowValueToCss, image: imageValueToCss, fontFamily: fontFamilyValueToCss, fontWeight: fontWeightValueToCss, duration: durationValueToCss }; var paramValueToCss = (param, value, themeLogger) => { const type = getParamType(param); return paramValidators[type](value, param, themeLogger); }; var _asThemeImpl = (theme) => { if (!(theme instanceof ThemeImpl)) { throw new Error("theme is not an object created by createTheme"); } return theme; }; var createSharedTheme = (themeLogger, overridePrefix) => new ThemeImpl({ themeLogger, overridePrefix }); var ThemeImpl = class _ThemeImpl { constructor(params, parts = []) { this.params = params; this.parts = parts; } withPart(part) { if (typeof part === "function") { part = part(); } if (!(part instanceof PartImpl)) { this.params.themeLogger.preInitErr(259, "Invalid part", { part }); return this; } return new _ThemeImpl(this.params, [...this.parts, part]); } withoutPart(feature) { return this.withPart(createPart({ feature })); } withParams(params, mode = defaultModeName) { return this.withPart( createPart({ modeParams: { [mode]: params } }) ); } _startUse({ styleContainer, cssLayer, nonce, loadThemeGoogleFonts, moduleCss }) { if (IS_SSR) { return; } if (FORCE_LEGACY_THEMES) { return; } uninstallLegacyCSS(); _injectCoreAndModuleCSS(styleContainer, cssLayer, nonce, moduleCss); const googleFontsUsed = getGoogleFontsUsed(this); if (googleFontsUsed.length > 0) { for (const googleFont of googleFontsUsed) { if (loadThemeGoogleFonts) { loadGoogleFont(googleFont, nonce); } } } for (const part of this.parts) { part.use(styleContainer, cssLayer, nonce); } } _getCssClass() { if (FORCE_LEGACY_THEMES) { return "ag-theme-quartz"; } return this._cssClassCache ?? (this._cssClassCache = deduplicatePartsByFeature(this.parts).map((part) => part.use(void 0, void 0, void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" ")); } _getParamsClassName() { return this._paramsClassName ?? (this._paramsClassName = `ag-theme-params-${++getInjectionState().paramsId}`); } _getModeParams() { let paramsCache = this._paramsCache; if (!paramsCache) { const mergedModeParams = { // NOTE: defining the default mode here is important, it ensures // that the default mode is first in iteration order, which puts // it first in outputted CSS, allowing other modes to override it [defaultModeName]: { ...sharedDefaults } }; for (const part of deduplicatePartsByFeature(this.parts)) { for (const partMode of Object.keys(part.modeParams)) { const partParams = part.modeParams[partMode]; if (partParams) { const mergedParams = mergedModeParams[partMode] ?? (mergedModeParams[partMode] = {}); const partParamNames = /* @__PURE__ */ new Set(); for (const partParamName of Object.keys(partParams)) { const partParamValue = partParams[partParamName]; if (partParamValue !== void 0) { mergedParams[partParamName] = partParamValue; partParamNames.add(partParamName); } } if (partMode === defaultModeName) { for (const mergedMode of Object.keys(mergedModeParams)) { const mergedParams2 = mergedModeParams[mergedMode]; if (mergedMode !== defaultModeName) { for (const partParamName of partParamNames) { delete mergedParams2[partParamName]; } } } } } } } this._paramsCache = paramsCache = mergedModeParams; } return paramsCache; } _getParamsCss() { if (!this._paramsCssCache) { let variablesCss = ""; let inheritanceCss = ""; const modeParams = this._getModeParams(); const { overridePrefix, themeLogger } = this.params; const cssOverridePrefix = overridePrefix ? `--ag-${overridePrefix}-` : void 0; for (const mode of Object.keys(modeParams)) { const params = modeParams[mode]; if (mode !== defaultModeName) { const escapedMode = typeof CSS === "object" ? CSS.escape(mode) : mode; const wrapPrefix = `:where([data-ag-theme-mode="${escapedMode}"]) & { `; variablesCss += wrapPrefix; inheritanceCss += wrapPrefix; } for (const key of Object.keys(params).sort()) { const value = params[key]; const cssValue = paramValueToCss(key, value, themeLogger); if (cssValue === false) { themeLogger.error(107, { key, value }); } else { const cssName = paramToVariableName(key); const overrideName = cssOverridePrefix ? cssName.replace("--ag-", cssOverridePrefix) : cssName; const inheritedName = cssName.replace("--ag-", "--ag-inherited-"); variablesCss += ` ${cssName}: var(${inheritedName}, ${cssValue}); `; inheritanceCss += ` ${inheritedName}: var(${overrideName}); `; } } if (mode !== defaultModeName) { variablesCss += "}\n"; inheritanceCss += "}\n"; } } const selectorPlaceholder = `:where(.${this._getParamsClassName()})`; let css = `${selectorPlaceholder} { ${variablesCss}} `; css += `:has(> ${selectorPlaceholder}):not(${selectorPlaceholder}) { ${inheritanceCss}} `; this._paramsCssCache = css; } return this._paramsCssCache; } }; var deduplicatePartsByFeature = (parts) => { const lastPartByFeature = /* @__PURE__ */ new Map(); for (const part of parts) { lastPartByFeature.set(part.feature, part); } const result = []; for (const part of parts) { if (!part.feature || lastPartByFeature.get(part.feature) === part) { result.push(part); } } return result; }; var getGoogleFontsUsed = (theme) => { const googleFontsUsed = /* @__PURE__ */ new Set(); const visitParamValue = (paramValue) => { if (Array.isArray(paramValue)) { paramValue.forEach(visitParamValue); } else { const googleFont = paramValue?.googleFont; if (typeof googleFont === "string") { googleFontsUsed.add(googleFont); } } }; const allModeValues = Object.values(theme._getModeParams()); const allValues = allModeValues.flatMap((mv) => Object.values(mv)); allValues.forEach(visitParamValue); return Array.from(googleFontsUsed).sort(); }; var uninstalledLegacyCSS = false; var uninstallLegacyCSS = () => { if (uninstalledLegacyCSS) { return; } uninstalledLegacyCSS = true; for (const style of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]'))) { style.remove(); } }; var loadGoogleFont = async (font, nonce) => { const css = `@import url('https://${googleFontsDomain}/css2?family=${encodeURIComponent(font)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); `; _injectGlobalCSS(css, document.head, `googleFont:${font}`, void 0, 0, nonce); }; var googleFontsDomain = "fonts.googleapis.com"; var LIST_ITEM_HEIGHT = { changeKey: "listItemHeight", type: "length", defaultValue: 24 }; var BaseEnvironment = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "environment"; this.sizeEls = /* @__PURE__ */ new Map(); this.lastKnownValues = /* @__PURE__ */ new Map(); this.sizesMeasured = false; this.globalCSS = []; } wireBeans(beans) { this.eRootDiv = beans.eRootDiv; } postConstruct() { const { gos, eRootDiv } = this; gos.setInstanceDomData(eRootDiv); const themeStyleContainer = gos.get("themeStyleContainer"); const hasShadowRootGlobal = typeof ShadowRoot !== "undefined"; const isShadowRoot = hasShadowRootGlobal && eRootDiv.getRootNode() instanceof ShadowRoot; this.eStyleContainer = (typeof themeStyleContainer === "function" ? themeStyleContainer() : themeStyleContainer) ?? (isShadowRoot ? eRootDiv : document.head); if (!themeStyleContainer && !isShadowRoot && hasShadowRootGlobal) { warnOnAttachToShadowRoot(eRootDiv, this.shadowRootError.bind(this), this.addDestroyFunc.bind(this)); } this.cssLayer = gos.get("themeCssLayer"); this.styleNonce = gos.get("styleNonce"); this.addManagedPropertyListener("theme", () => this.handleThemeChange()); this.handleThemeChange(); this.getSizeEl(LIST_ITEM_HEIGHT); this.initVariables(); this.addDestroyFunc(() => _unregisterInstanceUsingThemingAPI(this)); this.mutationObserver = new MutationObserver(() => { this.fireStylesChangedEvent("theme"); }); this.addDestroyFunc(() => this.mutationObserver.disconnect()); } applyThemeClasses(el, extraClasses = []) { const { theme } = this; const themeClass = theme ? theme._getCssClass() : this.applyLegacyThemeClasses(); for (const className of Array.from(el.classList)) { if (className.startsWith("ag-theme-")) { el.classList.remove(className); } } if (themeClass) { const oldClass = el.className; el.className = `${oldClass}${oldClass ? " " : ""}${themeClass}${extraClasses?.length ? " " + extraClasses.join(" ") : ""}`; } } applyLegacyThemeClasses() { let themeClass = ""; this.mutationObserver.disconnect(); let node = this.eRootDiv; while (node) { let isThemeEl = false; for (const className of Array.from(node.classList)) { if (className.startsWith("ag-theme-")) { isThemeEl = true; themeClass = themeClass ? `${themeClass} ${className}` : className; } } if (isThemeEl) { this.mutationObserver.observe(node, { attributes: true, attributeFilter: ["class"] }); } node = node.parentElement; } return themeClass; } addGlobalCSS(css, debugId) { if (this.theme) { _injectGlobalCSS(css, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce); } else { this.globalCSS.push([css, debugId]); } } getDefaultListItemHeight() { return this.getCSSVariablePixelValue(LIST_ITEM_HEIGHT); } getCSSVariablePixelValue(variable) { const cached = this.lastKnownValues.get(variable); if (cached != null) { return cached; } const measurement = this.measureSizeEl(variable); if (measurement === "detached" || measurement === "no-styles") { if (variable.cacheDefault) { this.lastKnownValues.set(variable, variable.defaultValue); } return variable.defaultValue; } this.lastKnownValues.set(variable, measurement); return measurement; } measureSizeEl(variable) { const sizeEl = this.getSizeEl(variable); if (sizeEl.offsetParent == null) { return "detached"; } const newSize = sizeEl.offsetWidth; if (newSize === NO_VALUE_SENTINEL) { return "no-styles"; } this.sizesMeasured = true; return newSize; } getMeasurementContainer() { let container = this.eMeasurementContainer; if (!container) { container = this.eMeasurementContainer = _createAgElement({ tag: "div", cls: "ag-measurement-container" }); this.eRootDiv.appendChild(container); } return container; } getSizeEl(variable) { let sizeEl = this.sizeEls.get(variable); if (sizeEl) { return sizeEl; } const container = this.getMeasurementContainer(); sizeEl = _createAgElement({ tag: "div" }); const cssName = this.setSizeElStyles(sizeEl, variable); container.appendChild(sizeEl); this.sizeEls.set(variable, sizeEl); const { type, noWarn } = variable; if (type !== "length" && type !== "border") { return sizeEl; } let lastMeasurement = this.measureSizeEl(variable); if (lastMeasurement === "no-styles" && !noWarn) { this.varError(cssName, variable.defaultValue); } const unsubscribe = _observeResize(this.beans, sizeEl, () => { const newMeasurement = this.measureSizeEl(variable); if (newMeasurement === "detached" || newMeasurement === "no-styles") { return; } this.lastKnownValues.set(variable, newMeasurement); if (newMeasurement !== lastMeasurement) { lastMeasurement = newMeasurement; this.fireStylesChangedEvent(variable.changeKey); } }); this.addDestroyFunc(() => unsubscribe()); return sizeEl; } setSizeElStyles(sizeEl, variable) { const { changeKey, type } = variable; let cssName = paramToVariableName(changeKey); if (type === "border") { if (cssName.endsWith("-width")) { cssName = cssName.slice(0, -6); } sizeEl.className = "ag-measurement-element-border"; sizeEl.style.setProperty( "--ag-internal-measurement-border", `var(${cssName}, solid ${NO_VALUE_SENTINEL}px)` ); } else { sizeEl.style.width = `var(${cssName}, ${NO_VALUE_SENTINEL}px)`; } return cssName; } handleThemeChange() { const { gos, theme: oldTheme } = this; const themeProperty = gos.get("theme"); let newTheme; if (themeProperty === "legacy") { newTheme = void 0; } else { const themeOrDefault = themeProperty ?? this.getDefaultTheme(); if (themeOrDefault instanceof ThemeImpl) { newTheme = themeOrDefault; } else { this.themeError(themeOrDefault); } } if (newTheme !== oldTheme) { this.handleNewTheme(newTheme); } this.postProcessThemeChange(newTheme, themeProperty); } handleNewTheme(newTheme) { const { gos, eRootDiv, globalCSS } = this; const additionalCss = this.getAdditionalCss(); if (newTheme) { _injectCoreAndModuleCSS(this.eStyleContainer, this.cssLayer, this.styleNonce, additionalCss); for (const [css, debugId] of globalCSS) { _injectGlobalCSS(css, this.eStyleContainer, debugId, this.cssLayer, 0, this.styleNonce); } globalCSS.length = 0; } this.theme = newTheme; newTheme?._startUse({ loadThemeGoogleFonts: gos.get("loadThemeGoogleFonts"), styleContainer: this.eStyleContainer, cssLayer: this.cssLayer, nonce: this.styleNonce, moduleCss: additionalCss }); _useParamsCss( this, newTheme?._getParamsCss() ?? null, newTheme?._getParamsClassName() ?? null, this.eStyleContainer, this.cssLayer, this.styleNonce ); this.applyThemeClasses(eRootDiv); this.fireStylesChangedEvent("theme"); } fireStylesChangedEvent(change) { this.eventSvc.dispatchEvent({ type: "stylesChanged", [`${change}Changed`]: true }); } }; var NO_VALUE_SENTINEL = 15538; var warnOnAttachToShadowRoot = (el, errorCallback, onDestroy) => { let retries = 60; const interval = setInterval(() => { if (typeof ShadowRoot !== "undefined" && el.getRootNode() instanceof ShadowRoot) { errorCallback(); clearInterval(interval); } if (el.isConnected || --retries < 0) { clearInterval(interval); } }, 1e3); onDestroy(() => clearInterval(interval)); }; var core_default = '.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:"";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:"";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");color:var(--ag-icon-button-active-color)}}'; var coreDefaults = { wrapperBorder: true, rowBorder: true, headerRowBorder: true, footerRowBorder: { ref: "rowBorder" }, columnBorder: { style: "solid", width: 1, color: "transparent" }, headerColumnBorder: false, headerColumnBorderHeight: "100%", pinnedColumnBorder: true, pinnedRowBorder: true, sidePanelBorder: true, sideBarPanelWidth: 250, sideBarPanelAnimationDuration: 0, sideBarBackgroundColor: { ref: "chromeBackgroundColor" }, sideButtonBarBackgroundColor: { ref: "sideBarBackgroundColor" }, sideButtonBarTopPadding: 0, sideButtonSelectedUnderlineWidth: 2, sideButtonSelectedUnderlineColor: "transparent", sideButtonSelectedUnderlineTransitionDuration: 0, sideButtonBackgroundColor: "transparent", sideButtonTextColor: { ref: "textColor" }, sideButtonHoverBackgroundColor: { ref: "sideButtonBackgroundColor" }, sideButtonHoverTextColor: { ref: "sideButtonTextColor" }, sideButtonSelectedBackgroundColor: backgroundColor, sideButtonSelectedTextColor: { ref: "sideButtonTextColor" }, sideButtonBorder: "solid 1px transparent", sideButtonSelectedBorder: true, sideButtonLeftPadding: { ref: "spacing" }, sideButtonRightPadding: { ref: "spacing" }, sideButtonVerticalPadding: { calc: "spacing * 3" }, cellFontFamily: { ref: "fontFamily" }, cellFontSize: { ref: "dataFontSize" }, cellFontWeight: { ref: "fontWeight" }, headerCellHoverBackgroundColor: "transparent", headerCellMovingBackgroundColor: { ref: "headerCellHoverBackgroundColor" }, headerCellBackgroundTransitionDuration: "0.2s", cellTextColor: { ref: "textColor" }, rangeSelectionBorderStyle: "solid", rangeSelectionBorderColor: accentColor, rangeSelectionBackgroundColor: accentMix(0.2), rangeSelectionChartBackgroundColor: "#0058FF1A", rangeSelectionChartCategoryBackgroundColor: "#00FF841A", rangeSelectionHighlightColor: accentMix(0.5), rangeHeaderHighlightColor: foregroundHeaderBackgroundMix(0.08), rowNumbersSelectedColor: accentMix(0.5), rowHoverColor: accentMix(0.08), columnHoverColor: accentMix(0.05), selectedRowBackgroundColor: accentMix(0.12), modalOverlayBackgroundColor: { ref: "backgroundColor", mix: 0.66 }, dataBackgroundColor: backgroundColor, oddRowBackgroundColor: { ref: "dataBackgroundColor" }, wrapperBorderRadius: 8, cellHorizontalPadding: { calc: "spacing * 2 * cellHorizontalPaddingScale" }, cellWidgetSpacing: { calc: "spacing * 1.5" }, cellHorizontalPaddingScale: 1, rowGroupIndentSize: { calc: "cellWidgetSpacing + iconSize" }, valueChangeDeltaUpColor: "#43a047", valueChangeDeltaDownColor: "#e53935", valueChangeValueHighlightBackgroundColor: "#16a08580", rowHeight: { calc: "max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale" }, rowVerticalPaddingScale: 1, paginationPanelHeight: { ref: "rowHeight", calc: "max(rowHeight, 22px)" }, dragHandleColor: foregroundMix(0.7), headerColumnResizeHandleHeight: "30%", headerColumnResizeHandleWidth: 2, headerColumnResizeHandleColor: { ref: "borderColor" }, iconButtonColor: { ref: "iconColor" }, iconButtonBackgroundColor: "transparent", iconButtonBackgroundSpread: 4, iconButtonBorderRadius: 1, iconButtonHoverColor: { ref: "iconButtonColor" }, iconButtonHoverBackgroundColor: foregroundMix(0.1), iconButtonActiveColor: accentColor, iconButtonActiveBackgroundColor: accentMix(0.28), iconButtonActiveIndicatorColor: accentColor, setFilterIndentSize: { ref: "iconSize" }, chartMenuPanelWidth: 260, chartMenuLabelColor: foregroundMix(0.8), cellEditingBorder: { color: accentColor }, cellEditingShadow: { ref: "cardShadow" }, fullRowEditInvalidBackgroundColor: { ref: "invalidColor", onto: "backgroundColor", mix: 0.25 }, columnSelectIndentSize: { ref: "iconSize" }, toolPanelSeparatorBorder: true, columnDropCellBackgroundColor: foregroundMix(0.07), columnDropCellTextColor: { ref: "textColor" }, columnDropCellDragHandleColor: { ref: "textColor" }, columnDropCellBorder: { color: foregroundMix(0.13) }, selectCellBackgroundColor: foregroundMix(0.07), selectCellBorder: { color: foregroundMix(0.13) }, advancedFilterBuilderButtonBarBorder: true, advancedFilterBuilderIndentSize: { calc: "spacing * 2 + iconSize" }, advancedFilterBuilderJoinPillColor: "#f08e8d", advancedFilterBuilderColumnPillColor: "#a6e194", advancedFilterBuilderOptionPillColor: "#f3c08b", advancedFilterBuilderValuePillColor: "#85c0e4", filterPanelApplyButtonColor: backgroundColor, filterPanelApplyButtonBackgroundColor: accentColor, columnPanelApplyButtonColor: backgroundColor, columnPanelApplyButtonBackgroundColor: accentColor, filterPanelCardSubtleColor: { ref: "textColor", mix: 0.7 }, filterPanelCardSubtleHoverColor: { ref: "textColor" }, findMatchColor: foregroundColor, findMatchBackgroundColor: "#ffff00", findActiveMatchColor: foregroundColor, findActiveMatchBackgroundColor: "#ffa500", filterToolPanelGroupIndent: { ref: "spacing" }, rowLoadingSkeletonEffectColor: foregroundMix(0.15), statusBarLabelColor: foregroundColor, statusBarLabelFontWeight: 500, statusBarValueColor: foregroundColor, statusBarValueFontWeight: 500, pinnedSourceRowTextColor: { ref: "textColor" }, pinnedSourceRowBackgroundColor: { ref: "dataBackgroundColor" }, pinnedSourceRowFontWeight: 600, pinnedRowFontWeight: 600, pinnedRowBackgroundColor: { ref: "dataBackgroundColor" }, pinnedRowTextColor: { ref: "textColor" }, rowDragIndicatorColor: { ref: "rangeSelectionBorderColor" }, rowDragIndicatorWidth: 2, columnDragIndicatorColor: { ref: "accentColor" }, columnDragIndicatorWidth: 2 }; var batch_edit_style_default_default = ".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}"; var baseParams = { cellBatchEditBackgroundColor: "rgba(220 181 139 / 16%)", cellBatchEditTextColor: "#422f00", rowBatchEditBackgroundColor: { ref: "cellBatchEditBackgroundColor" }, rowBatchEditTextColor: { ref: "cellBatchEditTextColor" } }; var baseDarkBatchEditParams = { ...baseParams, cellBatchEditTextColor: "#f3d0b3" }; var makeBatchEditStyleBaseTreeShakeable = () => createPart({ feature: "batchEditStyle", params: baseParams, css: batch_edit_style_default_default }); var batchEditStyleBase = /* @__PURE__ */ makeBatchEditStyleBaseTreeShakeable(); var button_style_base_default = ":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}"; var baseParams2 = { buttonTextColor: "inherit", buttonFontWeight: "normal", buttonBackgroundColor: "transparent", buttonBorder: false, buttonBorderRadius: { ref: "borderRadius" }, buttonHorizontalPadding: { calc: "spacing * 2" }, buttonVerticalPadding: { ref: "spacing" }, buttonHoverTextColor: { ref: "buttonTextColor" }, buttonHoverBackgroundColor: { ref: "buttonBackgroundColor" }, buttonHoverBorder: { ref: "buttonBorder" }, buttonActiveTextColor: { ref: "buttonHoverTextColor" }, buttonActiveBackgroundColor: { ref: "buttonHoverBackgroundColor" }, buttonActiveBorder: { ref: "buttonHoverBorder" }, buttonDisabledTextColor: { ref: "inputDisabledTextColor" }, buttonDisabledBackgroundColor: { ref: "inputDisabledBackgroundColor" }, buttonDisabledBorder: { ref: "inputDisabledBorder" } }; var makeButtonStyleBaseTreeShakeable = () => createPart({ feature: "buttonStyle", params: baseParams2, css: button_style_base_default }); var buttonStyleBase = /* @__PURE__ */ makeButtonStyleBaseTreeShakeable(); var makeButtonStyleQuartzTreeShakeable = () => createPart({ feature: "buttonStyle", params: { ...baseParams2, buttonBackgroundColor: backgroundColor, buttonBorder: true, buttonHoverBackgroundColor: { ref: "rowHoverColor" }, buttonActiveBorder: { color: accentColor } }, css: button_style_base_default }); var buttonStyleQuartz = /* @__PURE__ */ makeButtonStyleQuartzTreeShakeable(); var makeButtonStyleAlpineTreeShakeable = () => createPart({ feature: "buttonStyle", params: { ...baseParams2, buttonBackgroundColor: backgroundColor, buttonBorder: { color: accentColor }, buttonFontWeight: 600, buttonTextColor: accentColor, buttonHoverBackgroundColor: { ref: "rowHoverColor" }, buttonActiveBackgroundColor: accentColor, buttonActiveTextColor: backgroundColor }, css: button_style_base_default }); var buttonStyleAlpine = /* @__PURE__ */ makeButtonStyleAlpineTreeShakeable(); var makeButtonStyleBalhamTreeShakeable = () => createPart({ feature: "buttonStyle", params: { ...baseParams2, buttonBorder: { color: foregroundColor, width: 2, style: "outset" }, buttonActiveBorder: { color: foregroundColor, width: 2, style: "inset" }, buttonBackgroundColor: foregroundBackgroundMix(0.07), buttonHoverBackgroundColor: backgroundColor, buttonVerticalPadding: { calc: "spacing * 0.5" } }, css: button_style_base_default }); var buttonStyleBalham = /* @__PURE__ */ makeButtonStyleBalhamTreeShakeable(); var column_drop_style_bordered_default = ".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}"; var column_drop_style_plain_default = ".ag-column-drop-vertical-empty-message{color:var(--ag-subtle-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600;padding-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-empty-message{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing));padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-empty-message{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-icon-size) + var(--ag-spacing) + var(--ag-widget-horizontal-spacing))}"; var makeColumnDropStyleBorderedTreeShakeable = () => { return createPart({ feature: "columnDropStyle", css: column_drop_style_bordered_default }); }; var columnDropStyleBordered = /* @__PURE__ */ makeColumnDropStyleBorderedTreeShakeable(); var makeColumnDropStylePlainTreeShakeable = () => { return createPart({ feature: "columnDropStyle", css: column_drop_style_plain_default }); }; var columnDropStylePlain = /* @__PURE__ */ makeColumnDropStylePlainTreeShakeable(); var baseParams3 = { formulaToken1Color: "#3269c6", formulaToken1BackgroundColor: { ref: "formulaToken1Color", mix: 0.08 }, formulaToken1Border: { color: { ref: "formulaToken1Color" } }, formulaToken2Color: "#c0343f", formulaToken2BackgroundColor: { ref: "formulaToken2Color", mix: 0.06 }, formulaToken2Border: { color: { ref: "formulaToken2Color" } }, formulaToken3Color: "#8156b8", formulaToken3BackgroundColor: { ref: "formulaToken3Color", mix: 0.08 }, formulaToken3Border: { color: { ref: "formulaToken3Color" } }, formulaToken4Color: "#007c1f", formulaToken4BackgroundColor: { ref: "formulaToken4Color", mix: 0.06 }, formulaToken4Border: { color: { ref: "formulaToken4Color" } }, formulaToken5Color: "#b03e85", formulaToken5BackgroundColor: { ref: "formulaToken5Color", mix: 0.08 }, formulaToken5Border: { color: { ref: "formulaToken5Color" } }, formulaToken6Color: "#b74900", formulaToken6BackgroundColor: { ref: "formulaToken6Color", mix: 0.06 }, formulaToken6Border: { color: { ref: "formulaToken6Color" } }, formulaToken7Color: "#247492", formulaToken7BackgroundColor: { ref: "formulaToken7Color", mix: 0.08 }, formulaToken7Border: { color: { ref: "formulaToken7Color" } } }; var makeBatchEditStyleBaseTreeShakeable2 = () => createPart({ feature: "formulaStyle", params: baseParams3 }); var formulaStyleBase = /* @__PURE__ */ makeBatchEditStyleBaseTreeShakeable2(); var gridThemeLogger = { warn: (...args) => { _warn(args[0], args[1]); }, error: (...args) => { _error(args[0], args[1]); }, preInitErr: (...args) => { _logPreInitErr(args[0], args[2], args[1]); } }; var createTheme = () => createSharedTheme(gridThemeLogger).withParams(coreDefaults).withPart(buttonStyleQuartz).withPart(columnDropStyleBordered).withPart(batchEditStyleBase).withPart(formulaStyleBase); var checkbox_style_default_default = '.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}'; var makeCheckboxStyleDefaultTreeShakeable = () => createPart({ feature: "checkboxStyle", params: { checkboxBorderWidth: 1, checkboxBorderRadius: { ref: "borderRadius" }, checkboxUncheckedBackgroundColor: backgroundColor, checkboxUncheckedBorderColor: foregroundBackgroundMix(0.3), checkboxCheckedBackgroundColor: accentColor, checkboxCheckedBorderColor: { ref: "checkboxCheckedBackgroundColor" }, checkboxCheckedShapeImage: { svg: '' }, checkboxCheckedShapeColor: backgroundColor, checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.3), checkboxIndeterminateBorderColor: { ref: "checkboxIndeterminateBackgroundColor" }, checkboxIndeterminateShapeImage: { svg: '' }, checkboxIndeterminateShapeColor: backgroundColor, radioCheckedShapeImage: { svg: '' } }, css: checkbox_style_default_default }); var checkboxStyleDefault = /* @__PURE__ */ makeCheckboxStyleDefaultTreeShakeable(); var makeColorSchemeLightTreeShakeable = () => createPart({ feature: "colorScheme", params: defaultLightColorSchemeParams }); var colorSchemeLight = /* @__PURE__ */ makeColorSchemeLightTreeShakeable(); var makeColorSchemeLightWarmTreeShakeable = () => createPart({ feature: "colorScheme", params: { ...defaultLightColorSchemeParams, foregroundColor: "#000000de", borderColor: "#60300026", chromeBackgroundColor: "#60300005" } }); var colorSchemeLightWarm = /* @__PURE__ */ makeColorSchemeLightWarmTreeShakeable(); var makeColorSchemeLightColdTreeShakeable = () => createPart({ feature: "colorScheme", params: { ...defaultLightColorSchemeParams, foregroundColor: "#000", chromeBackgroundColor: "#f3f8f8" } }); var colorSchemeLightCold = /* @__PURE__ */ makeColorSchemeLightColdTreeShakeable(); var darkParams = () => ({ ...defaultLightColorSchemeParams, ...baseDarkBatchEditParams, backgroundColor: "hsl(217, 0%, 17%)", foregroundColor: "#FFF", chromeBackgroundColor: foregroundBackgroundMix(0.05), rowHoverColor: accentMix(0.15), selectedRowBackgroundColor: accentMix(0.2), menuBackgroundColor: foregroundBackgroundMix(0.1), browserColorScheme: "dark", popupShadow: "0 0px 20px #000A", cardShadow: "0 1px 4px 1px #000A", advancedFilterBuilderJoinPillColor: "#7a3a37", advancedFilterBuilderColumnPillColor: "#355f2d", advancedFilterBuilderOptionPillColor: "#5a3168", advancedFilterBuilderValuePillColor: "#374c86", filterPanelApplyButtonColor: foregroundColor, columnPanelApplyButtonColor: foregroundColor, findMatchColor: backgroundColor, findActiveMatchColor: backgroundColor, checkboxUncheckedBorderColor: foregroundBackgroundMix(0.4), toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.4), rowBatchEditBackgroundColor: foregroundBackgroundMix(0.1), // dark colours for formula editor / formula ranges formulaToken1Color: "#4da3e5", formulaToken2Color: "#f55864", formulaToken3Color: "#b688f2", formulaToken4Color: "#24bb4a", formulaToken5Color: "#e772ba", formulaToken6Color: "#f69b5f", formulaToken7Color: "#a3e6ff" }); var makeColorSchemeDarkTreeShakeable = () => createPart({ feature: "colorScheme", params: darkParams() }); var colorSchemeDark = /* @__PURE__ */ makeColorSchemeDarkTreeShakeable(); var makeColorSchemeDarkWarmTreeShakeable = () => createPart({ feature: "colorScheme", params: { backgroundColor: "hsl(29, 10%, 17%)", foregroundColor: "#FFF", browserColorScheme: "dark" } }); var darkBlueParams = () => ({ ...darkParams(), backgroundColor: "#1f2836" }); var colorSchemeDarkWarm = /* @__PURE__ */ makeColorSchemeDarkWarmTreeShakeable(); var makeColorSchemeDarkBlueTreeShakeable = () => createPart({ feature: "colorScheme", params: darkBlueParams() }); var colorSchemeDarkBlue = /* @__PURE__ */ makeColorSchemeDarkBlueTreeShakeable(); var makeColorSchemeVariableTreeShakeable = () => createPart({ feature: "colorScheme", params: defaultLightColorSchemeParams, modeParams: { light: defaultLightColorSchemeParams, dark: darkParams(), "dark-blue": darkBlueParams() } }); var colorSchemeVariable = /* @__PURE__ */ makeColorSchemeVariableTreeShakeable(); var icon_set_balham_default = `.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M22 12h-2v-2h-8v.092c.056 1.352 3.426 2.598 4.472 4.404.682 1.174.438 2.754-.572 3.72C14.29 19.618 12 20.924 12 22h8v-2h2v4H10c0-1.586-.098-3.304 1.016-4.314 1.904-1.632 4.89-3.108 3.54-4.42-1.918-1.68-4.464-2.936-4.554-5.12L10 8h12z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='m6.414 17 2.294 2.292-1.416 1.416L2.586 16l4.706-4.708 1.416 1.416L6.414 15H15V6.414l-2.292 2.294-1.416-1.416L16 2.586l4.708 4.706-1.416 1.416L17 6.414V15h8.586l-2.294-2.292 1.416-1.416L29.414 16l-4.706 4.708-1.416-1.416L25.586 17H17v8.586l2.292-2.294 1.416 1.416L16 29.414l-4.708-4.706 1.416-1.416L15 25.586V17z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 4C9.378 4 4 9.378 4 16s5.378 12 12 12 12-5.378 12-12S22.622 4 16 4m0 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S6 21.52 6 16 10.48 6 16 6m0 8.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M14 25h-2V7h2zm6 0h-2V7h2zm6 0h-2V7h2zM8 25H6V7h2z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M21.929 27.999h-7.828a5.09 5.09 0 0 1-5.086-5.086v-9.812a5.087 5.087 0 0 1 5.086-5.086h7.828a5.09 5.09 0 0 1 5.086 5.086v9.812a5.087 5.087 0 0 1-5.086 5.086m.16-17.984h-8.088a2.94 2.94 0 0 0-2.938 2.938v10.132a2.94 2.94 0 0 0 2.938 2.938h8.088a2.94 2.94 0 0 0 2.936-2.938V12.953a2.94 2.94 0 0 0-2.936-2.938M7.041 26.013h-2.05a4 4 0 0 1-.006-.228V9.065a5.07 5.07 0 0 1 5.064-5.064h12.812q.069 0 .134.002v2.012H9.915a2.876 2.876 0 0 0-2.874 2.874z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 4 24 24'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m16 14.586 5.292-5.294 1.416 1.416L17.414 16l5.294 5.292-1.416 1.416L16 17.414l-5.292 5.294-1.416-1.416L14.586 16l-5.294-5.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14.703 15.096 6.215 4.719a1 1 0 1 1 1.548-1.267l13.058 15.965A5.001 5.001 0 0 1 28 23.916a5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 4.98 4.98 0 0 1 1.23-3.283l-3.238-3.958-3.272 4.001a4.98 4.98 0 0 1 1.265 3.323 5 5 0 0 1-4.999 4.999 5 5 0 0 1-4.999-4.999 5 5 0 0 1 7.13-4.522zM8.991 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M23 20.8a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1m-5.723-8.852 1.292 1.579 7.205-8.808a1 1 0 0 0-1.548-1.267z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m17 21.379 4.292-4.294 1.416 1.416L16 25.207l-6.708-6.706 1.416-1.416L15 21.379V6.793h2z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M9.304 7.89a15.2 15.2 0 0 1 6.404-1.638c.294-.002.292-.002.584 0 5.956.174 11.328 4.088 13.62 9.748 0 0-1.318 3.178-3.224 5.174a13.6 13.6 0 0 1-2.226 1.874L26.414 25 25 26.414l-2.336-2.336C17.866 26.396 11.776 26.15 7.36 22.96a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.218 2.002-3.718a14.6 14.6 0 0 1 3.442-3.334L5.586 7 7 5.586zm-.3 2.528c-2.038 1.344-3.708 3.246-4.724 5.508L4.248 16c2.46 5.762 9.622 9.064 15.63 7.15q.688-.219 1.342-.516l-.912-.912a6.96 6.96 0 0 1-4.19 1.394c-3.862 0-7-3.136-7-7 0-1.57.52-3.022 1.394-4.19zm14.032 11.204a13.25 13.25 0 0 0 4.684-5.548l.032-.074c-1.984-4.646-6.834-7.798-12.006-7.748-1.712.05-3.386.458-4.922 1.158l1.102 1.102a6.97 6.97 0 0 1 4.192-1.396 7.003 7.003 0 0 1 5.606 11.192zm-11.09-8.262a5.003 5.003 0 0 0 6.928 6.928zm8.342 5.514a5.002 5.002 0 0 0-6.928-6.928z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16.292 6.32c5.956.174 11.328 4.086 13.62 9.746 0 0-1.318 3.18-3.224 5.176-4.862 5.088-13.534 5.97-19.328 1.784a14.9 14.9 0 0 1-4.168-4.612c-.41-.71-.694-1.336-1.104-2.348 0 0 .898-2.216 2.002-3.716 2.678-3.64 7.03-5.896 11.618-6.03.294-.004.292-.004.584 0m-.546 2c-4.896.142-9.458 3.202-11.466 7.672l-.032.074c2.46 5.762 9.622 9.066 15.63 7.152 3.458-1.102 6.342-3.738 7.842-7.076l.032-.076C25.768 11.42 20.918 8.27 15.746 8.32m.254.946c3.754 0 6.8 3.048 6.8 6.8 0 3.754-3.046 6.8-6.8 6.8s-6.8-3.046-6.8-6.8c0-3.752 3.046-6.8 6.8-6.8m5 6.768V16c0-2.76-2.24-5-5-5s-5 2.24-5 5v.066c0 2.76 2.24 5 5 5s5-2.24 5-5z'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M26 8.184c-.066 2.658-4.058 5.154-6.742 7.974a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h20zM8 8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.066-2.658 4.058-5.154 6.742-7.974.198-.23.258-.538.258-.842z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.354 8.708 17.06 16l7.294 7.292-1.416 1.416L14.232 16l8.706-8.708zM9.646 8v16h-2V8z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0M7.006 4c-1.57.02-2.946 1.348-3.004 2.922-.078 6.078-.23 12.16.002 18.234.094 1.484 1.354 2.746 2.84 2.84 6.1.232 12.212.232 18.312 0 1.48-.094 2.746-1.35 2.84-2.84.232-6.1.232-12.212 0-18.312-.094-1.48-1.35-2.746-2.84-2.84C19.11 3.774 13.056 4 7.006 4M14 21h-4v-2h4zm12 0H16v-2h10zm-12-4h-4v-2h4zm12 0H16v-2h10zm-16-4H6v-2h4zm16 0H12v-2h14z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m17.768 16-8.706 8.708-1.416-1.416L14.94 16 7.646 8.708l1.416-1.416zm6.586 8h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='m17.621 11-2 2h12.586v6H15.621l2 2-4.414 4.414L3.793 16l9.414-9.414zm-11 5 6.586 6.586L14.793 21l-4-4h15.414v-2H10.793l4-4-1.586-1.586z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M17.138 13.418a1.03 1.03 0 0 0-.298.658s.125.096.226.178c1.372 1.114 2.033 3.039 1.582 4.796a4.7 4.7 0 0 1-1.205 2.123c-1.145 1.151-2.296 2.294-3.445 3.441-1.241 1.232-3.185 1.691-4.864 1.105-1.546-.54-2.756-1.938-3.048-3.572-.267-1.496.246-3.108 1.319-4.186l.578-.578-.03-.092a10.5 10.5 0 0 1-.452-2.3v-.005c-.776.775-1.621 1.489-2.275 2.396-1.817 2.522-1.643 6.323.706 8.669 1.813 1.811 4.708 2.462 7.171 1.517a6.75 6.75 0 0 0 2.336-1.518l3.427-3.424c1.939-1.954 2.533-5.126 1.294-7.674a6.8 6.8 0 0 0-2.071-2.481l-.003-.002zM21.265 4a6.8 6.8 0 0 0-4.734 1.964l-3.427 3.424c-1.961 1.977-2.52 5.092-1.32 7.619a6.8 6.8 0 0 0 2.098 2.537l.003.002c.32-.32.643-.637.96-.96.167-.172.27-.401.286-.64l-.204-.167c-1.603-1.287-2.215-3.68-1.316-5.616a4.7 4.7 0 0 1 .918-1.32c1.145-1.151 2.296-2.294 3.445-3.441 1.239-1.23 3.178-1.694 4.864-1.105 1.83.639 3.16 2.498 3.12 4.493a4.8 4.8 0 0 1-1.391 3.265l-.578.578.03.092c.235.743.387 1.519.452 2.3v.005c.732-.731 1.521-1.406 2.162-2.244 1.192-1.559 1.643-3.651 1.204-5.575a6.8 6.8 0 0 0-3.98-4.703 6.8 6.8 0 0 0-2.529-.506h-.061z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='m7.54 17.4.1 6.98 6.96.1-2.24-2.24L16 18.6 13.4 16l-3.64 3.64zm16.92-2.8-.1-6.98-6.96-.1 2.24 2.24L16 13.4l2.6 2.6 3.64-3.64z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M26 23H6v-2h20zm0-6H6v-2h20zm0-6H6V9h20z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath fill='%23000' d='M16 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 26 26'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='m14.8 24.26-.1-6.96-6.96-.1 2.24 2.24-3.64 3.64 2.6 2.6 3.64-3.64zm2.4-16.52.1 6.96 6.96.1-2.24-2.24 3.64-3.64-2.6-2.6-3.64 3.64z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142m-1.414 6.07h16.97v2.002H7.515z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='m10.044 21.258 4.478-4.198L16 18.444 9 25l-7-6.556 1.478-1.384 4.478 4.198V7h2.088zm14 3.742h-2.088V10.742l-4.478 4.198L16 13.556 23 7q3.5 3.28 7 6.556l-1.478 1.384-4.478-4.198z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16.186 3.646c8.188.154 14.898 9.796 11.17 17.78-3.298 7.066-13.932 9.374-19.848 3.87-3.9-3.632-5.076-9.896-2.684-14.708 2.082-4.19 6.588-6.974 11.362-6.942m-.298 1.998c-6.922.132-12.578 8.308-9.33 15.052 3.342 6.934 15.246 7.646 18.932 0 3.076-6.386-1.988-15.1-9.602-15.052m7.596 6.422c2.864 5.33-1.744 13.186-8.306 12.536a8.6 8.6 0 0 1-3.232-.998l-1.266-.706L22.778 10.8q.351.633.706 1.266m-9.422 10.276c3.296 1.028 7.246-1.006 8.216-4.418a6.6 6.6 0 0 0-.056-3.742zm2.104-14.696a8.8 8.8 0 0 1 3.936 1.038l1.266.706L9.27 21.488c-3.018-5.41-.99-13.37 6.318-13.834q.289-.01.578-.008m-.31 2c-4.06.154-7.23 4.614-6.03 8.46l8.16-8.16a6.8 6.8 0 0 0-2.13-.3'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M20 6.5c0-1-1-3-4-3s-4 2-4 3H8c-2.21 0-4 1.79-4 4v14c0 2.21 1.79 4 4 4h16c2.21 0 4-1.79 4-4v-14c0-2.21-1.79-4-4-4zm-4 .546c.734 0 1.334.572 1.334 1.272S16.734 9.59 16 9.59s-1.334-.572-1.334-1.272.6-1.272 1.334-1.272M24 26.5H8a2 2 0 0 1-2-2v-14a2 2 0 0 1 2-2h2v4h12v-4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008c-1.358-.022-2.714-.026-4.07-.022v4.034h4.07z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 7.515c-4.683 4.682-4.683 12.288 0 16.97 4.682 4.683 12.288 4.683 16.97 0 4.683-4.682 4.683-12.288 0-16.97-4.682-4.683-12.288-4.683-16.97 0m1.414 1.414c3.903-3.903 10.239-3.903 14.142 0s3.903 10.239 0 14.142-10.239 3.903-14.142 0-3.903-10.239 0-14.142M15 15l-.001-7.485h2.002L17 15l7.485-.001v2.002L17 17l.001 7.485h-2.002L15 17l-7.485.001v-2.002z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m28.207 16-9.414 9.414L14.379 21l2-2H3.793v-6h12.586l-2-2 4.414-4.414zm-11-5 4 4H5.793v2h15.414l-4 4 1.586 1.586L25.379 16l-6.586-6.586z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M21.061 8.708 13.767 16l7.294 7.292-1.416 1.416L10.939 16l8.706-8.708z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='m24.708 19.645-1.416 1.416L16 13.767l-7.292 7.294-1.416-1.416L16 10.939z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='M24.708 10.855 13 22.561l-5.708-5.706 1.416-1.416L13 19.733 23.292 9.439z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m21.061 16-8.706 8.708-1.416-1.416L18.233 16l-7.294-7.292 1.416-1.416z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6 15h20v2H6z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M24.708 12.355 16 21.061l-8.708-8.706 1.416-1.416L16 18.233l7.292-7.294z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M5.35 3.999a.2.2 0 0 0-.14.058c-.388.38-.768.768-1.152 1.152a.21.21 0 0 0-.002.288c7.459 7.506 14.965 14.965 22.447 22.447a.21.21 0 0 0 .288.002q.576-.574 1.151-1.151a.21.21 0 0 0 .002-.288C20.484 19.002 12.979 11.542 5.497 4.06a.2.2 0 0 0-.146-.061zm.611 12.548c-1.933 1.939-2.538 5.119-1.289 7.688a6.79 6.79 0 0 0 4.891 3.672 6.82 6.82 0 0 0 5.893-1.866l1.984-1.984-1.438-1.438-1.986 1.986c-1.486 1.476-3.993 1.81-5.834.629a4.73 4.73 0 0 1-2.024-2.853 4.76 4.76 0 0 1 1.241-4.393l1.986-1.986-1.438-1.438-1.984 1.984zM21.273 3.999a6.78 6.78 0 0 0-4.727 1.963l-1.984 1.984L16 9.384l1.985-1.985a4.74 4.74 0 0 1 2.776-1.338c1.974-.224 4.045.926 4.845 2.834.712 1.699.329 3.778-1.004 5.12L22.616 16l1.439 1.438q1-1 2-2c2.012-2.031 2.557-5.368 1.112-7.982-1.144-2.07-3.432-3.441-5.834-3.459h-.061z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m15 10.621-4.292 4.294-1.416-1.416L16 6.793l6.708 6.706-1.416 1.416L17 10.621v14.586h-2z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M23.182 5a3.82 3.82 0 0 1 2.83 6.383l-.131.137-2.09 2.088a1 1 0 0 1-.084.099 1 1 0 0 1-.098.084L12.533 24.869a3 3 0 0 1-1.245.746l-4.353 1.32-.003.002a1.5 1.5 0 0 1-1.87-1.867l.003-.004 1.32-4.352v-.003l.06-.174c.13-.344.321-.661.565-.936l.126-.135L18.209 8.39a1 1 0 0 1 .18-.181l2.092-2.09.137-.132A3.82 3.82 0 0 1 23.182 5M8.548 20.883a1 1 0 0 0-.25.415l-1.049 3.451 3.457-1.048.114-.042q.17-.076.301-.206l10.458-10.46-2.572-2.572zM23.182 7c-.482 0-.946.19-1.287.531v.001l-1.474 1.475 2.572 2.572 1.474-1.474.121-.133A1.82 1.82 0 0 0 23.182 7'/%3E%3C/svg%3E")}`; var iconSetBalham = /* @__PURE__ */ createPart({ feature: "iconSet", css: icon_set_balham_default }); var icon_set_alpine_default = `.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24 6H8v2l8 8-8 8v2h16v-2H11l8-8-8-8h13z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.515 11.171 2.687 16l4.828 4.829-1.414 1.414L-.142 16l6.243-6.243zm16.97 0 1.414-1.414L32.142 16l-6.243 6.243-1.414-1.414L29.313 16zM16.028 13.2l2.829 2.828-2.829 2.829-2.828-2.829zm-4.857 11.285L16 29.313l4.829-4.828 1.414 1.414L16 32.142l-6.243-6.243zm0-16.97L9.757 6.101 16-.142l6.243 6.243-1.414 1.414L16 2.687z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667A13.32 13.32 0 0 0 2.667 16c0 7.373 5.96 13.333 13.333 13.333S29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M14 7h4v18h-4zM8 17h4v8H8zM20 13h4v12h-4z'/%3E%3C/g%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26 25H6V7h20zM12 11H8v12h4zm6 0h-4v12h4zm6 12V11h-4v12z' style='fill-rule:nonzero' transform='translate(0 -1)'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m12 6 10 10-10 10-2-2 8-8-8-8z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.984 13.894 27.05 2.828l2.122 2.122-11.066 11.066 11.066 11.066-2.122 2.12-11.066-11.066L4.918 29.202l-2.12-2.12 11.066-11.066L2.798 4.95l2.12-2.122z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M13.775 15.198 3.835 2.945a1.501 1.501 0 0 1 2.33-1.89l14.997 18.488A6.003 6.003 0 0 1 29.657 25c0 3.311-2.688 6-6 6s-6-2.689-6-6c0-1.335.437-2.569 1.176-3.566l-3.127-3.855-3.001 3.7A5.97 5.97 0 0 1 14 25c0 3.311-2.689 6-6 6s-6-2.689-6-6a6.003 6.003 0 0 1 8.315-5.536zm9.882 6.702a3.1 3.1 0 0 0-3.1 3.1c0 1.711 1.389 3.1 3.1 3.1s3.1-1.389 3.1-3.1-1.389-3.1-3.1-3.1M8 21.95a3.05 3.05 0 1 0 .001 6.101A3.05 3.05 0 0 0 8 21.95m9.63-11.505 1.932 2.381 8.015-9.881a1.5 1.5 0 0 0-2.329-1.89z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 26 10 16 20 6l2 2-8 8 8 8z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M8.95 10.364 7 8.414 8.414 7l2.32 2.32A13.2 13.2 0 0 1 16.5 8c5.608 0 10.542 3.515 12.381 8.667L29 17l-.119.333a13 13 0 0 1-4.255 5.879l1.466 1.466-1.414 1.414-1.754-1.753A13.2 13.2 0 0 1 16.5 26c-5.608 0-10.542-3.515-12.381-8.667L4 17l.119-.333a13 13 0 0 1 4.83-6.303m1.445 1.445A11.02 11.02 0 0 0 6.148 17c1.646 4.177 5.728 7 10.352 7 1.76 0 3.441-.409 4.94-1.146l-1.878-1.878A5.06 5.06 0 0 1 16.5 22c-2.789 0-5.05-2.239-5.05-5 0-1.158.398-2.223 1.065-3.07zm1.855-.974 1.794 1.795A5.07 5.07 0 0 1 16.5 12c2.789 0 5.05 2.239 5.05 5 0 .9-.24 1.745-.661 2.474l2.305 2.306A11 11 0 0 0 26.852 17c-1.646-4.177-5.728-7-10.352-7-1.495 0-2.933.295-4.25.835'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16.5 23c4.624 0 8.706-2.823 10.352-7-1.646-4.177-5.728-7-10.352-7s-8.706 2.823-10.352 7c1.646 4.177 5.728 7 10.352 7M4.119 15.667C5.958 10.515 10.892 7 16.5 7s10.542 3.515 12.381 8.667L29 16l-.119.333C27.042 21.485 22.108 25 16.5 25S5.958 21.485 4.119 16.333L4 16zM16.5 21c2.789 0 5.049-2.239 5.049-5s-2.26-5-5.049-5-5.049 2.239-5.049 5 2.26 5 5.049 5' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m28 8-8 8v5l-6 6V16L6 8V6h22zM9 8l7 7v7l2-2v-5l7-7z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 7v1H9V7zm0-3v1H5.001V4zm-7 7H5v-1h2zm0-3H5V7h2zM3 5H1V4h2zm11 5v1H9v-1zm-7 4H5v-1h2zm7-1v1H9v-1z' style='fill-rule:nonzero' transform='matrix(2 0 0 2 0 -2)'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333a6.67 6.67 0 0 0-6.667 6.667 6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133 4.136 4.136 0 0 1-4.133 4.133h-5.333v2.533h5.333a6.67 6.67 0 0 0 6.667-6.667 6.67 6.67 0 0 0-6.667-6.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M17 29h-2v-8h2zm-3.586-9L7 26.414 5.586 25 12 18.586zm13 5L25 26.414 18.586 20 20 18.586zM29 17h-8v-2h8zm-18 0H3v-2h8zm2.414-5L12 13.414 5.586 7 7 5.586zm13-5L20 13.414 18.586 12 25 5.586zM17 11h-2V3h2z' style='fill-rule:nonzero' transform='translate(-3.692 -3.692)scale(1.23077)'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M14 30H2V18h2.828v7.05l8.254-8.252 2.12 2.12-8.252 8.254H14zm4-28h12v12h-2.828V6.95l-8.254 8.252-2.12-2.12 8.252-8.254H18z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M20 13H0v-2h20zm0-6H0V5h20zm0-6H0v-2h20z' style='fill-rule:nonzero' transform='translate(6 9)'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M16 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M2 18h12v12h-2.828v-7.05l-8.254 8.252-2.12-2.12 8.252-8.254H2zm28-4H18V2h2.828v7.05L29.082.798l2.12 2.12-8.252 8.254H30z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.94 6 9.06 7.88 17.167 16 9.06 24.12 10.94 26l10-10z' style='fill-rule:nonzero' transform='translate(1)'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cg fill='%23000' fill-rule='nonzero'%3E%3Cpath d='M23.708 14.645 16 6.939l-7.708 7.706 1.416 1.416L16 9.767l6.292 6.294zM23.708 20.355 16 28.061l-7.708-7.706 1.416-1.416L16 25.233l6.292-6.294z'/%3E%3C/g%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.334 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4M16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m10.78 19.777-4.668-4.666s.032-1 .67-1.87c1.366-1.86 4.052-1.96 6.056-1.572l3.158-3.108c-.7-2.342 3.352-5.046 3.352-5.046l9.166 9.168q-.334.447-.67.894c-1.074 1.426-2.538 2.63-4.272 2.338l-3.32 3.218c.046.344.042.03.118 1.152.144 2.13-.64 4.324-2.632 5.34l-.746.364-4.798-4.798-7.292 7.294-1.416-1.416zm8.24-13.672c-.688.568-1.416 1.45-1.024 2.072l.49.722-4.986 4.988c-1.988-.506-4.346-.636-5.156.614l9.02 9.032q.14-.099.272-.21c1.226-1.08.764-3.04.498-4.9l4.79-4.79s1.47.938 2.936-.776l-6.79-6.79q-.026.019-.05.038' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M25.128 2.002c2.56.096 4.772 2.292 4.87 4.87a712 712 0 0 1 0 18.256c-.096 2.56-2.292 4.772-4.87 4.87a712 712 0 0 1-18.256 0c-2.558-.096-4.772-2.29-4.87-4.87a712 712 0 0 1 0-18.256c.096-2.56 2.292-4.772 4.87-4.87a712 712 0 0 1 18.256 0m2.966 7.954H9.892v18.136c5.086.13 10.18.098 15.264-.096 1.48-.094 2.746-1.35 2.84-2.84.192-5.064.226-10.134.098-15.2M3.968 24.1q.015.528.036 1.056c.094 1.484 1.354 2.746 2.84 2.84l1.012.036V24.1zM22 15.414l-.292.294-1.416-1.416L23 11.586l2.708 2.706-1.416 1.416-.292-.294v3.592c-.032 2.604-2.246 4.892-4.872 4.992L15.414 24l.294.292-1.416 1.416L11.586 23l2.706-2.708 1.416 1.416-.322.32c3.372.03 6.578-.164 6.614-3.034zM3.88 18.038c.002 1.346.012 2.694.038 4.04h3.938v-4.04zm.05-6.062a681 681 0 0 0-.044 4.042h3.97v-4.042zm5.962-7.99Q8.449 3.999 7.006 4c-1.57.02-2.946 1.348-3.004 2.922q-.02 1.517-.042 3.034h3.896v-2.02h2.036zm14.244-.016v3.966h3.898q-.017-.546-.038-1.092c-.094-1.48-1.35-2.746-2.84-2.84q-.51-.019-1.02-.034m-8.14-.054q-2.035.022-4.07.048v3.972h4.07zm6.106.008a213 213 0 0 0-4.07-.022v4.034h4.07z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.94 7.88 20.06 6l-10 10 10 10 1.88-1.88L13.833 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M15.708 2.355 8 10.061.292 2.355 1.708.939 8 7.233 14.292.939z' style='fill-rule:nonzero' transform='translate(8 14)'/%3E%3Cpath d='M5 26h22v2H5zM15 4h2v18h-2z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 10.667 16 21.334l8.667-10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M21.333 7.334 10.666 16l10.667 8.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M10.667 24.666 21.334 16 10.667 7.333z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M7.334 21.333 16 10.666l8.667 10.667z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M11.586 22.96 27.718 6.828 29.84 8.95 11.586 27.202 2.4 18.016l2.12-2.122z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m11.94 6-1.88 1.88L18.167 16l-8.107 8.12L11.94 26l10-10z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6 13.5h20v3H6z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M24.12 9.06 16 17.167 7.88 9.06 6 10.94l10 10 10-10z' style='fill-rule:nonzero' transform='translate(0 1)'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333 5.332 16z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M8 24H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 18H6v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zm6 0h-2v-4h2zM8 12H6V8h2zm6 0h-2V8h2zm6 0h-2V8h2zm6 0h-2V8h2z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6.112 15.111 3.272 3.271 1.436-1.402-2.476-2.479c.81-1.25 3.168-1.12 5.156-.614l4.986-4.988-.49-.722c-.392-.622.336-1.504 1.024-2.072l.008-.007.01-.006.032-.025 1.447 1.447 1.432-1.397-2.601-2.602s-4.052 2.704-3.352 5.046l-3.158 3.108c-2.004-.388-4.69-.288-6.056 1.572-.638.87-.67 1.87-.67 1.87m.581 11.582.014.014 5.502-5.501 4.783 4.783.746-.364c1.992-1.016 2.776-3.21 2.632-5.34-.055-.805-.068-.87-.088-.97-.008-.04-.017-.085-.03-.182l3.32-3.218c1.734.292 3.198-.912 4.272-2.338q.337-.447.67-.894l-.001-.001-.007-.007-.007-.007-.007-.007-3.87-3.87 1.585-1.584-1.414-1.414-14.381 14.38-1.237 1.209-5.69 5.687 1.417 1.416zM23.21 10.206l2.65 2.651c-1.465 1.714-2.935.776-2.935.776l-4.79 4.79q.041.291.087.583c.257 1.676.513 3.35-.585 4.317a4 4 0 0 1-.272.21l-3.739-3.744z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='m16.708 10.878 8.708 8.706L24 21l-6.292-6.294V27h-2V14.706L9.416 21 8 19.584q4.348-4.344 8.691-8.69zM25 6H8v2h17z'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M16.708 22.122 8 13.416 9.416 12l6.292 6.294V6h2v12.294L24 12l1.416 1.416-8.691 8.69zM7.416 28h17v-2h-17z'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M19.834 8H8c0 .304.06.612.258.842 2.716 2.854 6.682 5.548 6.742 7.974V21l2-1.5v-2.684c.056-2.267 2.968-4.417 5.49-6.75v3.087c-1.081.974-2.245 1.968-3.232 3.005a1.05 1.05 0 0 0-.258.682v3.66L13 25c0-2.74.066-5.482-.002-8.222a1.05 1.05 0 0 0-.256-.62C10.026 13.304 6.06 10.61 6 8.184V6h13.834z'/%3E%3Cpath fill='currentColor' d='M26 6h2.946v2.002H26v3.313h-2.002V8.002h-2.946V6h2.946V3.04H26z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E")}`; var iconSetAlpine = /* @__PURE__ */ createPart({ feature: "iconSet", css: icon_set_alpine_default }); var icon_set_material_default = `.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M24 5.333H8V8l8.667 8L8 24v2.667h16v-4h-9.333L21.334 16l-6.667-6.667H24z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='M13.333 11.556h5.333V8h3.556L16 1.778 9.778 8h3.556zm-1.777 1.777H8V9.777l-6.222 6.222L8 22.221v-3.556h3.556zM30.222 16 24 9.778v3.556h-3.556v5.333H24v3.556l6.222-6.222zm-11.555 4.444h-5.333V24H9.778L16 30.222 22.222 24h-3.556z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-aasc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13.201 8.08q.65 0 1.135.222.487.222.759.618.27.396.279.919H14.19a.72.72 0 0 0-.293-.536q-.26-.191-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125q.382.086.701.229.32.143.554.35.234.21.362.49.131.284.134.648a1.6 1.6 0 0 1-.273.93q-.27.391-.777.608-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.642q-.29-.428-.305-1.058h1.194q.02.294.17.49.15.195.402.294.253.097.573.097.313 0 .544-.09a.84.84 0 0 0 .362-.255.6.6 0 0 0 .129-.374q0-.195-.117-.33a.9.9 0 0 0-.337-.228 3.4 3.4 0 0 0-.54-.171l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.927q.287-.396.79-.618a2.8 2.8 0 0 1 1.14-.223'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 14H4.489l-.432-1.332H1.948L1.515 14H.19l2.017-5.84h1.592zm-3.551-2.296h1.481l-.718-2.21H2.98zM8.452 8.16q.645 0 1.075.19.43.191.648.531a1.4 1.4 0 0 1 .217.775q0 .343-.137.602-.137.256-.376.422a1.6 1.6 0 0 1-.542.231v.057q.333.015.624.188.294.175.476.489.183.31.183.74 0 .466-.231.831a1.56 1.56 0 0 1-.676.573Q9.265 14 8.609 14H6.114V8.16zM7.35 12.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.29 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.396.64.64 0 0 0-.226-.511q-.223-.195-.633-.194H7.35z' clip-rule='evenodd'/%3E%3Cpath fill='%23000' d='M7.166.377a.75.75 0 0 1 .919.066l3.333 3a.75.75 0 0 1-1.003 1.115L7.609 2.033 5.113 4.53a.75.75 0 0 1-1.06-1.06l3-3z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 2.667C8.627 2.667 2.667 8.627 2.667 16S8.627 29.333 16 29.333 29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M5.333 10.667h5.333V5.334H5.333zm8 16h5.333v-5.333h-5.333zm-8 0h5.333v-5.333H5.333zm0-8h5.333v-5.333H5.333zm8 0h5.333v-5.333h-5.333zm8-13.334v5.333h5.333V5.333zm-8 5.334h5.333V5.334h-5.333zm8 8h5.333v-5.333h-5.333zm0 8h5.333v-5.333h-5.333z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m25.333 8.547-1.88-1.88L16 14.12 8.547 6.667l-1.88 1.88L14.12 16l-7.453 7.453 1.88 1.88L16 17.88l7.453 7.453 1.88-1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m19 3-6 6 2 2 7-7V3m-10 9.5a.503.503 0 0 1-.5-.5c0-.274.226-.5.5-.5s.5.226.5.5-.226.5-.5.5M6 20c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2M6 8c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2m3.64-.36c.23-.5.36-1.05.36-1.64 0-2.194-1.806-4-4-4S2 3.806 2 6s1.806 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.194 0-4 1.806-4 4s1.806 4 4 4 4-1.806 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1z' style='fill-rule:nonzero' transform='translate(4 4)'/%3E%3C/svg%3E")}.ag-icon-desc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E")}.ag-icon-adesc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M10.387 11.47a.75.75 0 0 1 1.06 1.06l-3 3-.113.093a.75.75 0 0 1-.919-.065l-3.333-3a.75.75 0 0 1 1.003-1.116l2.806 2.525zM13.201 3.08q.65 0 1.135.222.487.223.759.619.27.396.279.918H14.19a.72.72 0 0 0-.293-.536q-.26-.192-.705-.192-.302.001-.51.086a.7.7 0 0 0-.32.23.56.56 0 0 0-.108.338.5.5 0 0 0 .065.273.7.7 0 0 0 .204.203q.127.083.295.146.168.06.36.102l.525.125a3.7 3.7 0 0 1 .701.229q.32.143.554.35.234.21.362.492.131.282.134.647a1.6 1.6 0 0 1-.273.93 1.74 1.74 0 0 1-.777.607q-.504.214-1.217.214-.708 0-1.232-.217a1.8 1.8 0 0 1-.816-.641q-.29-.429-.305-1.059h1.194q.02.294.17.49.15.195.402.294.253.098.573.098.313 0 .544-.092a.84.84 0 0 0 .362-.254.6.6 0 0 0 .129-.373.5.5 0 0 0-.117-.33.9.9 0 0 0-.337-.23 3.4 3.4 0 0 0-.54-.17l-.635-.16q-.738-.18-1.166-.562t-.426-1.03a1.53 1.53 0 0 1 .284-.926q.287-.396.79-.62a2.8 2.8 0 0 1 1.14-.222'/%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M5.813 9H4.489l-.432-1.332H1.948L1.515 9H.19l2.017-5.84h1.592zM2.262 6.704h1.481l-.718-2.21H2.98zM8.452 3.16q.645 0 1.075.19.43.192.648.53a1.4 1.4 0 0 1 .217.776q0 .342-.137.602a1.2 1.2 0 0 1-.376.423 1.6 1.6 0 0 1-.542.23v.058q.333.014.624.187.294.175.476.489.183.31.183.74 0 .465-.231.83a1.56 1.56 0 0 1-.676.574Q9.265 9 8.609 9H6.114V3.16zM7.35 7.99h1.006q.517 0 .753-.196a.66.66 0 0 0 .237-.531.8.8 0 0 0-.116-.428.8.8 0 0 0-.334-.291 1.15 1.15 0 0 0-.511-.106H7.349zm0-2.386h.916q.254 0 .45-.09a.75.75 0 0 0 .313-.256.67.67 0 0 0 .118-.397.64.64 0 0 0-.226-.51q-.223-.194-.633-.194H7.35z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='translate(3.934 -.054)scale(.06285)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.1.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M21.106 15.088A5.19 5.19 0 0 0 16 10.814a5.17 5.17 0 0 0-3.668 1.522L9.866 9.868a12.2 12.2 0 0 1 6.133-1.646c5.186 0 9.614 3.225 11.408 7.778a12.34 12.34 0 0 1-5.276 6.133l-2.468-2.466a5.17 5.17 0 0 0 1.449-2.802h-2.123c-.148.508-.42.964-.782 1.33l-1.33-1.33h-2.514l2.196 2.196q-.272.049-.56.05a3.11 3.11 0 0 1-2.99-2.245h-2.123a5.19 5.19 0 0 0 7.3 3.836l2.247 2.247a12.2 12.2 0 0 1-4.434.828c-5.186 0-9.614-3.225-11.408-7.778a12.3 12.3 0 0 1 3.781-5.111l2.924 2.924a5.1 5.1 0 0 0-.404 1.275h4.206l-1.296-1.296a3.1 3.1 0 0 1 2.196-.903c1.404 0 2.587.924 2.976 2.199h2.13z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16 8.222c-5.186 0-9.614 3.225-11.408 7.778 1.794 4.553 6.222 7.778 11.408 7.778S25.614 20.553 27.408 16C25.614 11.447 21.186 8.222 16 8.222m0 12.964c-2.862 0-5.186-2.324-5.186-5.186s2.324-5.186 5.186-5.186 5.186 2.324 5.186 5.186-2.324 5.186-5.186 5.186m0-8.297c-1.721 0-3.111 1.39-3.111 3.111s1.39 3.111 3.111 3.111 3.111-1.39 3.111-3.111-1.39-3.111-3.111-3.111'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M13.333 24h5.333v-2.667h-5.333zM4 8v2.667h24V8zm4 9.333h16v-2.667H8z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M18.667 21.333h8.889A3.555 3.555 0 0 1 24 24.889h-5.333zm8.888-7.111v3.556h-8.889v-3.556zM24 7.111a3.555 3.555 0 0 1 3.556 3.556h-16V7.111zm-8.889 17.778h-3.556v-3.556h3.556zm0-7.111h-3.556v-3.556h3.556zM8 10.667H4.444A3.555 3.555 0 0 1 8 7.111z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227v-2.667z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333c-3.68 0-6.667 2.987-6.667 6.667s2.987 6.667 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333c2.28 0 4.133 1.853 4.133 4.133s-1.853 4.133-4.133 4.133h-5.333v2.533h5.333c3.68 0 6.667-2.987 6.667-6.667s-2.987-6.667-6.667-6.667z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='m17.778 11.708 3.25-3.251 2.516 2.516-3.251 3.25h4.597v3.556h-4.597l3.251 3.25-2.516 2.516-3.25-3.251v4.597h-3.556v-4.597l-3.25 3.251-2.516-2.516 3.251-3.25H7.11v-3.556h4.597l-3.251-3.25 2.516-2.516 3.25 3.251V7.111h3.556zm-3.251 7.847h2.944l2.084-2.084v-2.944l-2.084-2.084h-2.944l-2.084 2.084v2.944z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='M4 4h24v2.667H4z'/%3E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M4 24h24v-2.667H4zm0-6.667h24v-2.667H4zM4 8v2.667h24V8z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 26.667a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 24q0-1.1.784-1.883A2.57 2.57 0 0 1 16 21.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 16q0-1.1.784-1.883A2.57 2.57 0 0 1 16 13.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 8q0-1.1.784-1.883A2.57 2.57 0 0 1 16 5.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='M8 25.333h16V28H8z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='M4 24h16v-2.667H4zM4 8v2.667h24V8zm0 9.333h24v-2.667H4z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M25.333 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4zM16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m11.106 22.093-4.444 4.444-1.259-1.259 4.444-4.444zm5.872-16.63 9.618 9.62-.962.962-.962-.962-7.694 3.847 1.924 1.924-2.74 2.74-7.696-7.696 2.741-2.74 1.924 1.925 3.847-7.696-.962-.962z'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M26.667 30.223H5.334a3.556 3.556 0 0 1-3.556-3.556V5.334a3.556 3.556 0 0 1 3.556-3.556h21.333a3.556 3.556 0 0 1 3.556 3.556v21.333a3.556 3.556 0 0 1-3.556 3.556m-16-8.89H5.334v5.333h5.333zm16-7.11H12.444v12.444h14.223zm-9.15 6.85-2.039 2.037 2.039 2.039-1.257 1.257-3.295-3.296 3.295-3.295q.63.628 1.257 1.257zm-6.85-6.85H5.334v5.333h5.333zm15.74 3.816-1.257 1.256-2.039-2.037-2.037 2.037-1.257-1.256 3.295-3.296zM10.667 5.333H5.334v5.333h5.333zm8.889 0h-7.112v5.333h7.112zm7.111 0h-5.333v5.333h5.333z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M9.333 12.667 16 19.334l6.667-6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M19.333 9.333 12.666 16l6.667 6.667V9.334z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='M12.667 22.667 19.334 16l-6.667-6.667v13.333z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='M9.333 19.333 16 12.666l6.667 6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='m11.727 21.167-5.56-5.56-1.893 1.88 7.453 7.453 16-16-1.88-1.88z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6.667 14.667h18.667v2.667H6.667z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M22.12 11.06 16 17.167 9.88 11.06 8 12.94l8 8 8-8z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M26.667 12H5.334v2.667h21.333zM5.333 20h21.333v-2.667H5.333z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}.ag-icon-column-arrow:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11 4a1 1 0 0 1 1 1v22a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 13a1 1 0 0 1 1-1h23.5a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2 4h18v24H2zm2 2v20h14V6zM26.793 13 23 9.207l1.414-1.414L29.621 13l-5.207 5.207L23 16.793z' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-un-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11'/%3E%3Cpath fill='currentColor' d='M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28zM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972z'/%3E%3C/svg%3E")}.ag-icon-pinned-top:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22M3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536'/%3E%3C/svg%3E")}.ag-icon-pinned-bottom:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22M12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536'/%3E%3C/svg%3E")}.ag-icon-chevron-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3.479 10.521a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1-1.06 1.06l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12.521 5.461a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 1.06-1.06l3.47 3.47 3.47-3.47a.75.75 0 0 1 1.06 0' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.53 12.512a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 0 1 1.06 1.06l-3.47 3.47 3.47 3.47a.75.75 0 0 1 0 1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-chevron-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M5.47 3.47a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06-1.06L8.94 8 5.47 4.53a.75.75 0 0 1 0-1.06' clip-rule='evenodd'/%3E%3C/svg%3E")}.ag-icon-filter-add:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M18.666 24h-5.333v-2.667h5.333zM24 17.333H8v-2.667h16zm3.59-9.344h3.221v2.657h-3.22v3.22h-2.656v-3.22h-3.221V7.989h3.22V4.77h2.657zm-8.582 2.678H4V8h15.008z'/%3E%3C/svg%3E")}.ag-icon-edit:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='currentColor' d='M6.222 25.778h1.611l14.834-14.811-1.611-1.611-14.834 14.81zM4 28v-4.733L22.644 4.656a2.26 2.26 0 0 1 1.567-.634q.423 0 .833.167.412.166.734.478l1.589 1.6q.333.322.483.733t.15.822q0 .423-.161.839-.162.416-.472.728L8.733 28zm17.856-17.833-.8-.811 1.61 1.61z'/%3E%3C/svg%3E")}`; var iconSetMaterial = /* @__PURE__ */ createPart({ feature: "iconSet", css: icon_set_material_default }); var iconOverrides = (args) => { const cssParts = []; if (args.type === "image") { const { icons: icons2, mask } = args; for (const key of Object.keys(icons2)) { const imageCssValue = imageValueToCss(icons2[key]); if (mask) { cssParts.push(`.ag-icon-${key}::before { mask-image: ${imageCssValue}; }`); } else { cssParts.push(`.ag-icon-${key}::before { background-image: ${imageCssValue}; ${unsetMaskIcon} }`); } } } if (args.type === "font") { const { family, weight, color, icons: icons2 } = args; let properties = unsetMaskIcon; if (family) { properties += ` font-family: ${fontFamilyValueToCss(family)};`; } if (weight) { properties += ` font-weight: ${fontWeightValueToCss(weight)};`; } if (color) { properties += ` color: ${colorValueToCss(color)};`; } for (const key of Object.keys(icons2)) { cssParts.push(`.ag-icon-${key}::before { content: ${JSON.stringify(icons2[key])}; ${properties} }`); } } return createPart({ css: cssParts.join(";\n"), cssImports: args.cssImports }); }; var unsetMaskIcon = `background-color: unset; mask-image: unset; -webkit-mask-image: unset;`; var iconNameToSvgFragment = { aggregation: '', arrows: '', asc: '', cancel: '', chart: '', "color-picker": '', columns: '', contracted: '', copy: '', cross: '', csv: '', cut: '', desc: '', down: '', excel: '', expanded: '', eye: '', "eye-slash": '', filter: '', first: '', grip: '', group: '', last: '', left: '', linked: '', loading: '', maximize: '', menu: '', "menu-alt": '', minimize: '', minus: '', next: '', none: '', "not-allowed": '', paste: '', pin: '', pivot: '', plus: '', previous: '', right: '', save: '', settings: '', "small-left": '', "small-right": '', tick: '', "tree-closed": '', "tree-indeterminate": '', "tree-open": '', unlinked: '', up: '' }; var iconNameToFullSvg = { aasc: ``, adesc: ``, "chevron-down": '', "chevron-left": '', "chevron-right": '', "chevron-up": '', "column-arrow": '', edit: '', "filter-add": '', "pinned-bottom": '', "pinned-top": '', "small-down": '', "small-up": '', "un-pin": '' }; var getQuartzIconsCss = (args = {}) => { let result = ""; for (const iconName of [...Object.keys(iconNameToSvgFragment), ...Object.keys(iconNameToFullSvg)]) { const iconSvg = quartzIconSvg(iconName, args.strokeWidth); result += `.ag-icon-${iconName}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(iconSvg)}'); } `; } return result; }; var quartzIconSvg = (name, strokeWidth2 = 1.5) => { const fullSVG = iconNameToFullSvg[name]; if (fullSVG) { return fullSVG; } const svgFragment = iconNameToSvgFragment[name]; if (!svgFragment) { throw new Error(`Missing icon data for ${name}`); } return `` + svgFragment + ""; }; var iconSetQuartz = (args = {}) => { return createPart({ feature: "iconSet", css: () => getQuartzIconsCss(args) }); }; var iconSetQuartzLight = /* @__PURE__ */ iconSetQuartz({ strokeWidth: 1 }); var iconSetQuartzRegular = /* @__PURE__ */ iconSetQuartz(); var iconSetQuartzBold = /* @__PURE__ */ iconSetQuartz({ strokeWidth: 2 }); var input_style_base_default = ':where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:"";display:block;height:12px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}'; var input_style_bordered_default = ".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}"; var input_style_underlined_default = ".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){border-left:none;border-right:none;border-top:none}"; var baseParams4 = { inputBackgroundColor: "transparent", inputBorder: false, inputBorderRadius: 0, inputTextColor: { ref: "textColor" }, inputPlaceholderTextColor: { ref: "inputTextColor", mix: 0.5 }, inputPaddingStart: 0, inputHeight: { calc: "max(iconSize, fontSize) + spacing * 2" }, inputFocusBackgroundColor: { ref: "inputBackgroundColor" }, inputFocusBorder: { ref: "inputBorder" }, inputFocusShadow: "none", inputFocusTextColor: { ref: "inputTextColor" }, inputDisabledBackgroundColor: { ref: "inputBackgroundColor" }, inputDisabledBorder: { ref: "inputBorder" }, inputDisabledTextColor: { ref: "inputTextColor" }, inputInvalidBackgroundColor: { ref: "inputBackgroundColor" }, inputInvalidBorder: { ref: "inputBorder" }, inputInvalidTextColor: { ref: "inputTextColor" }, inputIconColor: { ref: "inputTextColor" }, pickerButtonBorder: false, pickerButtonFocusBorder: { ref: "inputFocusBorder" }, pickerButtonBackgroundColor: { ref: "backgroundColor" }, pickerButtonFocusBackgroundColor: { ref: "backgroundColor" }, pickerListBorder: false, pickerListBackgroundColor: { ref: "backgroundColor" }, colorPickerThumbSize: 18, colorPickerTrackSize: 12, colorPickerThumbBorderWidth: 3, colorPickerTrackBorderRadius: 12, colorPickerColorBorderRadius: 4 }; var makeInputStyleBaseTreeShakeable = () => createPart({ feature: "inputStyle", params: baseParams4, css: input_style_base_default }); var inputStyleBase = /* @__PURE__ */ makeInputStyleBaseTreeShakeable(); var makeInputStyleBorderedTreeShakeable = () => createPart({ feature: "inputStyle", params: { ...baseParams4, inputBackgroundColor: backgroundColor, inputBorder: true, inputBorderRadius: { ref: "borderRadius" }, inputPaddingStart: { ref: "spacing" }, inputFocusBorder: { color: accentColor }, inputFocusShadow: { ref: "focusShadow" }, inputDisabledBackgroundColor: foregroundBackgroundMix(0.06), inputDisabledTextColor: { ref: "textColor", mix: 0.5 }, inputInvalidBorder: { color: { ref: "invalidColor" } }, pickerButtonBorder: true, pickerListBorder: true }, css: () => input_style_base_default + input_style_bordered_default }); var inputStyleBordered = /* @__PURE__ */ makeInputStyleBorderedTreeShakeable(); var makeInputStyleUnderlinedTreeShakeable = () => createPart({ feature: "inputStyle", params: { ...baseParams4, inputBackgroundColor: "transparent", inputBorder: { width: 2, color: foregroundMix(0.3) }, inputPaddingStart: { ref: "spacing" }, inputFocusBorder: "solid 2px var(--ag-accent-color)", inputDisabledTextColor: { ref: "textColor", mix: 0.5 }, inputDisabledBorder: "solid 1px var(--ag-border-color)", inputInvalidBorder: { width: 2, color: { ref: "invalidColor", mix: 0.3 } } }, css: () => input_style_base_default + input_style_underlined_default }); var inputStyleUnderlined = /* @__PURE__ */ makeInputStyleUnderlinedTreeShakeable(); var tab_style_base_default = '.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}'; var tab_style_rolodex_default = ".ag-tab{border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;border-top:var(--ag-tab-selected-border-width) solid transparent;flex:none;&.ag-tab-selected{border-left-color:var(--ag-tab-selected-border-color);border-right-color:var(--ag-tab-selected-border-color);border-top-color:var(--ag-tab-selected-border-color);margin-bottom:-1px;padding-bottom:calc(var(--ag-tab-bottom-padding) + 1px)}}"; var baseParams5 = { tabBarBackgroundColor: "transparent", tabBarHorizontalPadding: 0, tabBarTopPadding: 0, tabBackgroundColor: "transparent", tabTextColor: { ref: "textColor" }, tabHorizontalPadding: { ref: "spacing" }, tabTopPadding: { ref: "spacing" }, tabBottomPadding: { ref: "spacing" }, tabSpacing: "0", tabHoverBackgroundColor: { ref: "tabBackgroundColor" }, tabHoverTextColor: { ref: "tabTextColor" }, tabSelectedBackgroundColor: { ref: "tabBackgroundColor" }, tabSelectedTextColor: { ref: "tabTextColor" }, tabSelectedBorderWidth: { ref: "borderWidth" }, tabSelectedBorderColor: "transparent", tabSelectedUnderlineColor: "transparent", tabSelectedUnderlineWidth: 0, tabSelectedUnderlineTransitionDuration: 0, tabBarBorder: false }; var makeTabStyleBaseTreeShakeable = () => createPart({ feature: "tabStyle", params: baseParams5, css: tab_style_base_default }); var tabStyleBase = /* @__PURE__ */ makeTabStyleBaseTreeShakeable(); var makeTabStyleQuartzTreeShakeable = () => createPart({ feature: "tabStyle", params: { ...baseParams5, tabBarBorder: true, tabBarBackgroundColor: foregroundMix(0.05), tabTextColor: { ref: "textColor", mix: 0.7 }, tabSelectedTextColor: { ref: "textColor" }, tabHoverTextColor: { ref: "textColor" }, tabSelectedBorderColor: { ref: "borderColor" }, tabSelectedBackgroundColor: backgroundColor }, css: tab_style_base_default }); var tabStyleQuartz = /* @__PURE__ */ makeTabStyleQuartzTreeShakeable(); var makeTabStyleMaterialTreeShakeable = () => createPart({ feature: "tabStyle", params: { ...baseParams5, tabBarBackgroundColor: { ref: "chromeBackgroundColor" }, tabSelectedUnderlineColor: { ref: "primaryColor" }, tabSelectedUnderlineWidth: 2, tabSelectedUnderlineTransitionDuration: 0 }, css: tab_style_base_default }); var tabStyleMaterial = /* @__PURE__ */ makeTabStyleMaterialTreeShakeable(); var makeTabStyleAlpineTreeShakeable = () => createPart({ feature: "tabStyle", params: { ...baseParams5, tabBarBorder: true, tabBarBackgroundColor: { ref: "chromeBackgroundColor" }, tabHoverTextColor: accentColor, tabSelectedTextColor: accentColor, tabSelectedUnderlineColor: accentColor, tabSelectedUnderlineWidth: 2, tabSelectedUnderlineTransitionDuration: "0.3s" }, css: tab_style_base_default }); var tabStyleAlpine = /* @__PURE__ */ makeTabStyleAlpineTreeShakeable(); var makeTabStyleRolodexTreeShakeable = () => createPart({ feature: "tabStyle", params: { ...baseParams5, tabBarBackgroundColor: { ref: "chromeBackgroundColor" }, tabBarHorizontalPadding: { ref: "spacing" }, tabBarTopPadding: { ref: "spacing" }, tabBarBorder: true, tabHorizontalPadding: { calc: "spacing * 2" }, tabTopPadding: { ref: "spacing" }, tabBottomPadding: { ref: "spacing" }, tabSpacing: { ref: "spacing" }, tabSelectedBorderColor: { ref: "borderColor" }, tabSelectedBackgroundColor: backgroundColor }, css: () => tab_style_base_default + tab_style_rolodex_default }); var tabStyleRolodex = /* @__PURE__ */ makeTabStyleRolodexTreeShakeable(); var material_adjustments_default = ".ag-dnd-ghost,.ag-filter-toolpanel-header,.ag-filter-toolpanel-search,.ag-multi-filter-group-title-bar,.ag-panel-title-bar-title,.ag-status-bar{color:var(--ag-header-text-color);font-size:calc(var(--ag-font-size) - 1px);font-weight:600}.ag-column-drop-horizontal{background-color:color-mix(in srgb,var(--ag-background-color),var(--ag-foreground-color) 8%)}.ag-cell.ag-cell-inline-editing{background-color:var(--ag-background-color);background-image:linear-gradient(0deg,var(--ag-input-background-color),var(--ag-input-background-color));border:var(--ag-input-border)!important;border-width:1px!important;height:calc(var(--ag-row-height) + var(--ag-spacing)*3);padding:var(--ag-spacing);:where(.ag-row-last:not(.ag-row-first)) &{bottom:0}:where(.ag-has-focus) &{border:var(--ag-input-focus-border)!important;border-width:1px!important}}.ag-advanced-filter-builder-button,.ag-standard-button{text-transform:uppercase}.ag-status-bar{border:solid var(--ag-border-width) var(--ag-border-color)}.ag-list-item-hovered:after{background-color:var(--ag-primary-color)}.ag-pill-button:hover{color:var(--ag-primary-color)}.ag-filter-add-button,.ag-filter-add-button:hover{border-bottom:2px solid var(--ag-primary-color)}"; var themeQuartzParams = () => ({ fontFamily: [ { googleFont: "IBM Plex Sans" }, "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu" ] }); var makeThemeQuartzTreeShakeable = () => createTheme().withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetQuartzRegular).withPart(tabStyleQuartz).withPart(inputStyleBordered).withPart(columnDropStyleBordered).withParams(themeQuartzParams()); var themeQuartz = /* @__PURE__ */ makeThemeQuartzTreeShakeable(); var themeAlpineParams = () => ({ accentColor: "#2196f3", selectedRowBackgroundColor: accentMix(0.3), inputFocusBorder: { color: accentMix(0.4) }, focusShadow: { radius: 2, spread: 1.6, color: accentMix(0.4) }, iconButtonHoverBackgroundColor: "transparent", iconButtonActiveBackgroundColor: "transparent", checkboxUncheckedBorderColor: foregroundBackgroundMix(0.45), checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.45), checkboxIndeterminateBorderColor: foregroundBackgroundMix(0.45), checkboxBorderWidth: 2, checkboxBorderRadius: 2, fontSize: 13, dataFontSize: 14, headerFontWeight: 700, borderRadius: 3, wrapperBorderRadius: 3, tabSelectedUnderlineColor: accentColor, tabSelectedBorderWidth: 0, tabSelectedUnderlineTransitionDuration: 0.3, sideButtonSelectedUnderlineColor: accentColor, sideButtonSelectedUnderlineWidth: 2, sideButtonSelectedUnderlineTransitionDuration: 0.3, sideButtonBorder: false, sideButtonSelectedBorder: false, sideButtonBarTopPadding: { calc: "spacing * 3" }, sideButtonSelectedBackgroundColor: "transparent", sideButtonHoverTextColor: accentColor, iconButtonHoverColor: accentColor, toggleButtonWidth: 28, toggleButtonHeight: 18, toggleButtonSwitchInset: 1, toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.45), colorPickerThumbSize: 13, colorPickerTrackSize: 11, colorPickerThumbBorderWidth: 2, colorPickerTrackBorderRadius: 2, colorPickerColorBorderRadius: 2 }); var makeThemeAlpineTreeShakeable = () => createTheme().withPart(buttonStyleAlpine).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetAlpine).withPart(tabStyleAlpine).withPart(inputStyleBordered).withPart(columnDropStyleBordered).withParams(themeAlpineParams()); var themeAlpine = /* @__PURE__ */ makeThemeAlpineTreeShakeable(); var themeBalhamParams = () => ({ accentColor: "#0091ea", borderColor: foregroundMix(0.2), spacing: 4, widgetVerticalSpacing: { calc: "max(8px, spacing)" }, borderRadius: 2, wrapperBorderRadius: 2, headerColumnResizeHandleColor: "transparent", headerColumnBorder: true, headerColumnBorderHeight: "50%", oddRowBackgroundColor: { ref: "chromeBackgroundColor", mix: 0.5 }, checkboxBorderRadius: 2, checkboxBorderWidth: 1, checkboxUncheckedBackgroundColor: backgroundColor, checkboxUncheckedBorderColor: foregroundBackgroundMix(0.5), checkboxCheckedBackgroundColor: backgroundColor, checkboxCheckedBorderColor: accentColor, checkboxCheckedShapeColor: accentColor, checkboxIndeterminateBackgroundColor: backgroundColor, checkboxIndeterminateBorderColor: foregroundBackgroundMix(0.5), checkboxIndeterminateShapeColor: foregroundBackgroundMix(0.5), focusShadow: { radius: 2, spread: 1, color: accentColor }, headerTextColor: foregroundMix(0.6), iconButtonHoverBackgroundColor: "transparent", iconButtonActiveBackgroundColor: "transparent", fontSize: 12, tabSelectedBackgroundColor: backgroundColor, headerFontWeight: "bold", toggleButtonWidth: 32, toggleButtonHeight: 16, toggleButtonSwitchInset: 1, toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.5), sideButtonBorder: true, sideButtonBarTopPadding: { calc: "spacing * 4" }, popupShadow: "5px 5px 10px rgba(0, 0, 0, 0.3)", statusBarLabelColor: foregroundMix(0.54), statusBarLabelFontWeight: 600, statusBarValueFontWeight: 600, panelTitleBarIconColor: foregroundColor, colorPickerThumbSize: 13, colorPickerTrackSize: 11, colorPickerThumbBorderWidth: 2, colorPickerTrackBorderRadius: 2, colorPickerColorBorderRadius: 2 }); var makeThemeBalhamTreeShakeable = () => createTheme().withPart(buttonStyleBalham).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetBalham).withPart(tabStyleRolodex).withPart(inputStyleBordered).withPart(columnDropStylePlain).withParams(themeBalhamParams()); var themeBalham = /* @__PURE__ */ makeThemeBalhamTreeShakeable(); var makeStyleMaterialTreeShakeable = () => { const sharedParams = { tabSelectedUnderlineColor: { ref: "primaryColor" }, sideButtonSelectedUnderlineColor: { ref: "primaryColor" }, buttonTextColor: { ref: "primaryColor" }, rangeSelectionBackgroundColor: { ref: "primaryColor", mix: 0.2 }, rangeSelectionBorderColor: { ref: "primaryColor" }, rangeSelectionHighlightColor: { ref: "primaryColor", mix: 0.5 }, rangeHeaderHighlightColor: { ref: "foregroundColor", mix: 0.08 }, rowNumbersSelectedColor: { ref: "primaryColor", mix: 0.5 }, inputFocusBorder: { width: 2, color: { ref: "primaryColor" } }, pickerButtonFocusBorder: { width: 1, color: { ref: "primaryColor" } }, cellEditingBorder: { color: { ref: "primaryColor" } }, menuBackgroundColor: { ref: "backgroundColor" }, sideButtonBarBackgroundColor: backgroundColor, sideButtonSelectedBackgroundColor: "transparent", sideButtonBarTopPadding: { calc: "spacing * 4" }, headerColumnResizeHandleColor: "none", headerBackgroundColor: { ref: "backgroundColor" }, rowHoverColor: foregroundMix(0.08), columnHoverColor: foregroundMix(0.08), headerCellHoverBackgroundColor: foregroundMix(0.05), statusBarLabelColor: foregroundMix(0.63), statusBarLabelFontWeight: 600, statusBarValueFontWeight: 600, valueChangeValueHighlightBackgroundColor: "#00acc1", panelTitleBarIconColor: foregroundColor, advancedFilterBuilderButtonBarBorder: false, filterPanelApplyButtonColor: { ref: "buttonTextColor" }, filterPanelApplyButtonBackgroundColor: { ref: "buttonBackgroundColor" }, columnPanelApplyButtonColor: { ref: "buttonTextColor" }, columnPanelApplyButtonBackgroundColor: { ref: "buttonBackgroundColor" }, colorPickerThumbSize: 13, colorPickerTrackSize: 11, colorPickerThumbBorderWidth: 2, colorPickerTrackBorderRadius: 2, colorPickerColorBorderRadius: 2, rowDragIndicatorColor: { ref: "primaryColor" }, columnDragIndicatorColor: { ref: "primaryColor" } }; const lightParams = { ...sharedParams, primaryColor: "#3f51b5", foregroundColor: "#000D", headerTextColor: "#0008", accentColor: "#ff4081", checkboxUncheckedBorderColor: foregroundColor, checkboxIndeterminateBackgroundColor: foregroundColor, toggleButtonOffBackgroundColor: foregroundColor, selectedRowBackgroundColor: "rgba(33, 150, 243, 0.3)" }; const darkParams2 = { ...sharedParams, primaryColor: "#3f51b5", foregroundColor: "#fffD", headerTextColor: "#fff8", accentColor: "#bb86fc", checkboxUncheckedBorderColor: foregroundBackgroundMix(0.5), checkboxIndeterminateBackgroundColor: foregroundBackgroundMix(0.5), toggleButtonOffBackgroundColor: foregroundBackgroundMix(0.5), selectedRowBackgroundColor: "#bb86fc33" }; return createPart({ feature: "styleMaterial", css: material_adjustments_default, params: lightParams, modeParams: { light: lightParams, dark: darkParams2, "dark-blue": darkParams2 } }); }; var styleMaterial = /* @__PURE__ */ makeStyleMaterialTreeShakeable(); var themeMaterialParams = () => ({ rowHeight: { calc: "max(iconSize, cellFontSize) + spacing * 3.75 * rowVerticalPaddingScale" }, headerHeight: { calc: "max(iconSize, dataFontSize) + spacing * 4.75 * headerVerticalPaddingScale" }, widgetVerticalSpacing: { calc: "spacing * 1.75" }, cellHorizontalPadding: { calc: "spacing * 3" }, buttonHorizontalPadding: { ref: "spacing" }, widgetContainerHorizontalPadding: { calc: "spacing * 1.5" }, widgetContainerVerticalPadding: { calc: "spacing * 2" }, fontSize: 13, iconSize: 18, borderRadius: 0, wrapperBorderRadius: 0, wrapperBorder: false, menuBorder: false, dialogBorder: false, panelTitleBarBorder: false, tabSelectedBorderWidth: 0, tabSelectedUnderlineTransitionDuration: 0.3, sidePanelBorder: false, sideButtonSelectedBorder: false, sideButtonSelectedUnderlineWidth: 2, sideButtonSelectedUnderlineTransitionDuration: 0.3, sideButtonBorder: false, buttonBorder: false, buttonDisabledBorder: false, focusShadow: { spread: 4, color: foregroundMix(0.16) }, fontFamily: [ { googleFont: "Roboto" }, "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", "sans-serif" ], inputHeight: { calc: "max(iconSize, fontSize) + spacing * 3" }, pickerButtonBorder: { width: 1, color: "transparent" }, headerFontWeight: 600, headerFontSize: { calc: "fontSize - 1px" }, checkboxBorderWidth: 2, checkboxBorderRadius: 2, toggleButtonWidth: 34, toggleButtonSwitchInset: 1, cardShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)", popupShadow: "5px 5px 10px rgba(0, 0, 0, 0.3)" }); var makeThemeMaterialTreeShakeable = () => /* @__PURE__ */ createTheme().withPart(buttonStyleBase).withPart(checkboxStyleDefault).withPart(colorSchemeVariable).withPart(iconSetMaterial).withPart(tabStyleMaterial).withPart(inputStyleUnderlined).withPart(columnDropStylePlain).withPart(styleMaterial).withParams(themeMaterialParams()); var themeMaterial = /* @__PURE__ */ makeThemeMaterialTreeShakeable(); var cssVariable = (changeKey, type, defaultValue, noWarn, cacheDefault) => ({ changeKey, type, defaultValue, noWarn, cacheDefault }); var CELL_HORIZONTAL_PADDING = cssVariable("cellHorizontalPadding", "length", 16); var INDENTATION_LEVEL = cssVariable("indentationLevel", "length", 0, true, true); var ROW_GROUP_INDENT_SIZE = cssVariable("rowGroupIndentSize", "length", 0); var ROW_HEIGHT = cssVariable("rowHeight", "length", 42); var HEADER_HEIGHT = cssVariable("headerHeight", "length", 48); var ROW_BORDER_WIDTH = cssVariable("rowBorderWidth", "border", 1); var PINNED_BORDER_WIDTH = cssVariable("pinnedRowBorderWidth", "border", 1); var HEADER_ROW_BORDER_WIDTH = cssVariable("headerRowBorderWidth", "border", 1); function _addAdditionalCss(cssMap, modules) { for (const module2 of modules.sort((a, b) => a.moduleName.localeCompare(b.moduleName))) { const moduleCss = module2.css; if (moduleCss) { cssMap.set(`module-${module2.moduleName}`, moduleCss); } } } var Environment = class extends BaseEnvironment { initVariables() { this.addManagedPropertyListener("rowHeight", () => this.refreshRowHeightVariable()); this.getSizeEl(ROW_HEIGHT); this.getSizeEl(HEADER_HEIGHT); this.getSizeEl(ROW_BORDER_WIDTH); this.getSizeEl(PINNED_BORDER_WIDTH); this.refreshRowBorderWidthVariable(); } getPinnedRowBorderWidth() { return this.getCSSVariablePixelValue(PINNED_BORDER_WIDTH); } getRowBorderWidth() { return this.getCSSVariablePixelValue(ROW_BORDER_WIDTH); } getHeaderRowBorderWidth() { return this.getCSSVariablePixelValue(HEADER_ROW_BORDER_WIDTH); } getDefaultRowHeight() { return this.getCSSVariablePixelValue(ROW_HEIGHT); } getDefaultHeaderHeight() { return this.getCSSVariablePixelValue(HEADER_HEIGHT); } getDefaultCellHorizontalPadding() { return this.getCSSVariablePixelValue(CELL_HORIZONTAL_PADDING); } getCellPaddingLeft() { const cellHorizontalPadding = this.getDefaultCellHorizontalPadding(); const indentationLevel = this.getCSSVariablePixelValue(INDENTATION_LEVEL); const rowGroupIndentSize = this.getCSSVariablePixelValue(ROW_GROUP_INDENT_SIZE); return cellHorizontalPadding - 1 + rowGroupIndentSize * indentationLevel; } getCellPadding() { const cellPaddingRight = this.getDefaultCellHorizontalPadding() - 1; return this.getCellPaddingLeft() + cellPaddingRight; } getDefaultColumnMinWidth() { return Math.min(36, this.getDefaultRowHeight()); } refreshRowHeightVariable() { const { eRootDiv } = this; const oldRowHeight = eRootDiv.style.getPropertyValue("--ag-line-height").trim(); const height = this.gos.get("rowHeight"); if (height == null || isNaN(height) || !isFinite(height)) { if (oldRowHeight !== null) { eRootDiv.style.setProperty("--ag-line-height", null); } return -1; } const newRowHeight = `${height}px`; if (oldRowHeight != newRowHeight) { eRootDiv.style.setProperty("--ag-line-height", newRowHeight); return height; } return oldRowHeight != "" ? Number.parseFloat(oldRowHeight) : -1; } fireStylesChangedEvent(change) { if (change === "rowBorderWidth") { this.refreshRowBorderWidthVariable(); } super.fireStylesChangedEvent(change); } refreshRowBorderWidthVariable() { const width = this.getCSSVariablePixelValue(ROW_BORDER_WIDTH); this.eRootDiv.style.setProperty("--ag-internal-row-border-width", `${width}px`); } postProcessThemeChange(newGridTheme, themeGridOption) { if (newGridTheme && getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")) { if (themeGridOption) { _error(106); } else { _error(239); } } } getAdditionalCss() { const additionalCss = /* @__PURE__ */ new Map(); additionalCss.set("core", [core_default]); _addAdditionalCss(additionalCss, Array.from(_getAllRegisteredModules())); return additionalCss; } getDefaultTheme() { return themeQuartz; } varError(cssName, defaultValue) { _warn(9, { variable: { cssName, defaultValue } }); } themeError(theme) { _error(240, { theme }); } shadowRootError() { _error(293); } }; var BaseEventService = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "eventSvc"; this.eventServiceType = "global"; this.globalSvc = new LocalEventService(); } addListener(eventType, listener, async) { this.globalSvc.addEventListener(eventType, listener, async); } removeListener(eventType, listener, async) { this.globalSvc.removeEventListener(eventType, listener, async); } addGlobalListener(listener, async = false) { this.globalSvc.addGlobalListener(listener, async); } removeGlobalListener(listener, async = false) { this.globalSvc.removeGlobalListener(listener, async); } dispatchEvent(event) { this.globalSvc.dispatchEvent(this.gos.addCommon(event)); } dispatchEventOnce(event) { this.globalSvc.dispatchEventOnce(this.gos.addCommon(event)); } }; var EventService = class extends BaseEventService { postConstruct() { const { globalListener, globalSyncListener } = this.beans; if (globalListener) { this.addGlobalListener(globalListener, true); } if (globalSyncListener) { this.addGlobalListener(globalSyncListener, false); } } }; function getHeaderIndexToFocus(beans, column, level) { const columnRowIndex = beans.visibleCols.headerGroupRowCount; if (level >= columnRowIndex) { return { column, headerRowIndex: level }; } let parent = column.getParent(); while (parent && parent.getProvidedColumnGroup().getLevel() > level) { parent = parent.getParent(); } const isColSpanning = column.isSpanHeaderHeight(); if (!parent || isColSpanning && parent.isPadding()) { return { column, headerRowIndex: columnRowIndex }; } return { column: parent, headerRowIndex: parent.getProvidedColumnGroup().getLevel() }; } var HeaderNavigationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "headerNavigation"; this.currentHeaderRowWithoutSpan = -1; } postConstruct() { const beans = this.beans; beans.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCon = p.gridBodyCtrl; }); const eDocument = _getDocument(beans); this.addManagedElementListeners(eDocument, { mousedown: () => { this.currentHeaderRowWithoutSpan = -1; } }); } getHeaderPositionForColumn(colKey, floatingFilter) { let column; const { colModel, colGroupSvc, ctrlsSvc } = this.beans; if (typeof colKey === "string") { column = colModel.getCol(colKey); if (!column) { column = colGroupSvc?.getColumnGroup(colKey) ?? null; } } else { column = colKey; } if (!column) { return null; } const centerHeaderContainer = ctrlsSvc.getHeaderRowContainerCtrl(); const allCtrls = centerHeaderContainer?.getAllCtrls(); const isFloatingFilterVisible = _last(allCtrls || []).type === "filter"; const headerRowCount = getFocusHeaderRowCount(this.beans) - 1; let row = -1; let col = column; while (col) { row++; col = col.getParent(); } let headerRowIndex = row; if (floatingFilter && isFloatingFilterVisible && headerRowIndex === headerRowCount - 1) { headerRowIndex++; } return headerRowIndex === -1 ? null : { headerRowIndex, column }; } /* * This method navigates grid header vertically * @return {boolean} true to preventDefault on the event that caused this navigation. */ navigateVertically(direction, event) { const { focusSvc, visibleCols } = this.beans; const { focusedHeader } = focusSvc; if (!focusedHeader) { return false; } const { headerRowIndex } = focusedHeader; const column = focusedHeader.column; const rowLen = getFocusHeaderRowCount(this.beans); const currentRowType = this.getHeaderRowType(headerRowIndex); const columnHeaderRowIndex = visibleCols.headerGroupRowCount; let { headerRowIndex: nextRow, column: nextFocusColumn, headerRowIndexWithoutSpan } = direction === "UP" ? getColumnVisibleParent(currentRowType, column, headerRowIndex) : getColumnVisibleChild(column, headerRowIndex, columnHeaderRowIndex); let skipColumn = false; if (nextRow < 0) { nextRow = 0; nextFocusColumn = column; skipColumn = true; } if (nextRow >= rowLen) { nextRow = -1; this.currentHeaderRowWithoutSpan = -1; } else if (headerRowIndexWithoutSpan !== void 0) { this.currentHeaderRowWithoutSpan = headerRowIndexWithoutSpan; } if (!skipColumn && !nextFocusColumn) { return false; } return focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: nextRow, column: nextFocusColumn }, allowUserOverride: true, event }); } /* * This method navigates grid header horizontally * @returns {boolean} true to preventDefault on the event that caused this navigation. */ navigateHorizontally(direction, fromTab = false, event) { const { focusSvc, gos } = this.beans; const focusedHeader = { ...focusSvc.focusedHeader }; let nextHeader; let normalisedDirection; if (this.currentHeaderRowWithoutSpan !== -1) { focusedHeader.headerRowIndex = this.currentHeaderRowWithoutSpan; } else { this.currentHeaderRowWithoutSpan = focusedHeader.headerRowIndex; } if (direction === "LEFT" !== gos.get("enableRtl")) { normalisedDirection = "Before"; nextHeader = this.findHeader(focusedHeader, normalisedDirection); } else { normalisedDirection = "After"; nextHeader = this.findHeader(focusedHeader, normalisedDirection); } const userFunc = gos.getCallback("tabToNextHeader"); if (fromTab && userFunc) { const wasFocusedFromUserFunc = focusSvc.focusHeaderPositionFromUserFunc({ userFunc, headerPosition: nextHeader, direction: normalisedDirection }); if (wasFocusedFromUserFunc) { const { headerRowIndex } = focusSvc.focusedHeader || {}; if (headerRowIndex != null && headerRowIndex != focusedHeader.headerRowIndex) { this.currentHeaderRowWithoutSpan = headerRowIndex; } } return wasFocusedFromUserFunc; } if (nextHeader || !fromTab) { return focusSvc.focusHeaderPosition({ headerPosition: nextHeader, direction: normalisedDirection, fromTab, allowUserOverride: true, event }); } return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event); } focusNextHeaderRow(focusedHeader, direction, event) { const beans = this.beans; const currentIndex = focusedHeader.headerRowIndex; let nextFocusedCol = null; let nextRowIndex; const headerRowCount = getFocusHeaderRowCount(beans); const allVisibleCols = this.beans.visibleCols.allCols; if (direction === "Before") { if (currentIndex <= 0) { return false; } nextFocusedCol = _last(allVisibleCols); nextRowIndex = currentIndex - 1; this.currentHeaderRowWithoutSpan -= 1; } else { nextFocusedCol = allVisibleCols[0]; nextRowIndex = currentIndex + 1; if (this.currentHeaderRowWithoutSpan < headerRowCount) { this.currentHeaderRowWithoutSpan += 1; } else { this.currentHeaderRowWithoutSpan = -1; } } let { column, headerRowIndex } = getHeaderIndexToFocus(this.beans, nextFocusedCol, nextRowIndex); if (headerRowIndex >= headerRowCount) { headerRowIndex = -1; } return beans.focusSvc.focusHeaderPosition({ headerPosition: { column, headerRowIndex }, direction, fromTab: true, allowUserOverride: true, event }); } scrollToColumn(column, direction = "After") { if (column.getPinned()) { return; } let columnToScrollTo; if (isColumnGroup(column)) { const columns = column.getDisplayedLeafColumns(); columnToScrollTo = direction === "Before" ? _last(columns) : columns[0]; } else { columnToScrollTo = column; } this.gridBodyCon.scrollFeature.ensureColumnVisible(columnToScrollTo); } findHeader(focusedHeader, direction) { const { colGroupSvc, visibleCols } = this.beans; let currentFocusedColumn = focusedHeader.column; if (currentFocusedColumn instanceof AgColumnGroup) { const leafChildren = currentFocusedColumn.getDisplayedLeafColumns(); currentFocusedColumn = direction === "Before" ? leafChildren[0] : leafChildren[leafChildren.length - 1]; } const nextFocusedCol = direction === "Before" ? visibleCols.getColBefore(currentFocusedColumn) : visibleCols.getColAfter(currentFocusedColumn); if (!nextFocusedCol) { return void 0; } const headerGroupRowIndex = visibleCols.headerGroupRowCount; if (focusedHeader.headerRowIndex >= headerGroupRowIndex) { return { headerRowIndex: focusedHeader.headerRowIndex, column: nextFocusedCol }; } const groupAtLevel = colGroupSvc?.getColGroupAtLevel(nextFocusedCol, focusedHeader.headerRowIndex); if (!groupAtLevel) { const isSpanningCol = nextFocusedCol instanceof AgColumn && nextFocusedCol.isSpanHeaderHeight(); return { headerRowIndex: isSpanningCol ? visibleCols.headerGroupRowCount : focusedHeader.headerRowIndex, column: nextFocusedCol }; } if (groupAtLevel.isPadding() && nextFocusedCol.isSpanHeaderHeight()) { return { headerRowIndex: visibleCols.headerGroupRowCount, column: nextFocusedCol }; } return { headerRowIndex: focusedHeader.headerRowIndex, column: groupAtLevel ?? nextFocusedCol }; } getHeaderRowType(rowIndex) { const centerHeaderContainer = this.beans.ctrlsSvc.getHeaderRowContainerCtrl(); if (centerHeaderContainer) { return centerHeaderContainer.getRowType(rowIndex); } } }; function getColumnVisibleParent(currentRowType, currentColumn, currentIndex) { const optimisticNextIndex = currentIndex - 1; if (currentRowType !== "filter") { const isSpanningCol = currentColumn instanceof AgColumn && currentColumn.isSpanHeaderHeight(); let nextVisibleParent = currentColumn.getParent(); while (nextVisibleParent && // skip if row isn't visible or col is padding and spanned (nextVisibleParent.getProvidedColumnGroup().getLevel() > optimisticNextIndex || isSpanningCol && nextVisibleParent.isPadding())) { nextVisibleParent = nextVisibleParent.getParent(); } if (nextVisibleParent) { if (isSpanningCol) { return { column: nextVisibleParent, headerRowIndex: nextVisibleParent.getProvidedColumnGroup().getLevel(), headerRowIndexWithoutSpan: optimisticNextIndex }; } else { return { column: nextVisibleParent, headerRowIndex: optimisticNextIndex, headerRowIndexWithoutSpan: optimisticNextIndex }; } } } return { column: currentColumn, headerRowIndex: optimisticNextIndex, headerRowIndexWithoutSpan: optimisticNextIndex }; } function getColumnVisibleChild(column, currentIndex, columnHeaderRowIndex) { const optimisticNextIndex = currentIndex + 1; const result = { column, headerRowIndex: optimisticNextIndex, headerRowIndexWithoutSpan: optimisticNextIndex }; if (column instanceof AgColumnGroup) { if (optimisticNextIndex >= columnHeaderRowIndex) { return { column: column.getDisplayedLeafColumns()[0], headerRowIndex: columnHeaderRowIndex, headerRowIndexWithoutSpan: optimisticNextIndex }; } const children = column.getDisplayedChildren(); let firstChild = children[0]; if (firstChild instanceof AgColumnGroup && firstChild.isPadding()) { const firstCol = firstChild.getDisplayedLeafColumns()[0]; if (firstCol.isSpanHeaderHeight()) { firstChild = firstCol; } } result.column = firstChild; const isSpanningCol = firstChild instanceof AgColumn && firstChild.isSpanHeaderHeight(); if (isSpanningCol) { result.headerRowIndex = columnHeaderRowIndex; result.headerRowIndexWithoutSpan = optimisticNextIndex; } } return result; } var FocusService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "focusSvc"; this.focusFallbackTimeout = null; this.needsFocusRestored = false; } wireBeans(beans) { this.colModel = beans.colModel; this.visibleCols = beans.visibleCols; this.rowRenderer = beans.rowRenderer; this.navigation = beans.navigation; this.filterManager = beans.filterManager; this.overlays = beans.overlays; } postConstruct() { const clearFocusedCellListener = this.clearFocusedCell.bind(this); this.addManagedEventListeners({ columnPivotModeChanged: clearFocusedCellListener, newColumnsLoaded: this.onColumnEverythingChanged.bind(this), columnGroupOpened: clearFocusedCellListener, columnRowGroupChanged: clearFocusedCellListener }); this.addDestroyFunc(_registerKeyboardFocusEvents(this.beans)); } attemptToRecoverFocus() { this.needsFocusRestored = true; if (this.focusFallbackTimeout != null) { clearTimeout(this.focusFallbackTimeout); } this.focusFallbackTimeout = window.setTimeout(this.setFocusRecovered.bind(this), 100); } setFocusRecovered() { this.needsFocusRestored = false; if (this.focusFallbackTimeout != null) { clearTimeout(this.focusFallbackTimeout); this.focusFallbackTimeout = null; } } /** * Specifies whether to take focus, as grid either already has focus, or lost it due * to a destroyed cell * @returns true if the grid should re-take focus, otherwise false */ shouldTakeFocus() { if (this.gos.get("suppressFocusAfterRefresh")) { this.setFocusRecovered(); return false; } if (this.needsFocusRestored) { this.setFocusRecovered(); return true; } return this.doesRowOrCellHaveBrowserFocus(); } onColumnEverythingChanged() { if (!this.focusedCell) { return; } const col = this.focusedCell.column; const colFromColumnModel = this.colModel.getCol(col.getId()); if (col !== colFromColumnModel) { this.clearFocusedCell(); } } // we check if the browser is focusing something, and if it is, and // it's the cell we think is focused, then return the cell. so this // methods returns the cell if a) we think it has focus and b) the // browser thinks it has focus. this then returns nothing if we // first focus a cell, then second click outside the grid, as then the // grid cell will still be focused as far as the grid is concerned, // however the browser focus will have moved somewhere else. getFocusCellToUseAfterRefresh() { const { gos, focusedCell } = this; if (gos.get("suppressFocusAfterRefresh") || gos.get("suppressCellFocus") || !focusedCell) { return null; } if (!this.doesRowOrCellHaveBrowserFocus()) { return null; } return focusedCell; } getFocusHeaderToUseAfterRefresh() { if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeader) { return null; } if (!this.isDomDataPresentInHierarchy(_getActiveDomElement(this.beans), DOM_DATA_KEY_HEADER_CTRL)) { return null; } return this.focusedHeader; } /** * Check for both cells and rows, as a row might be destroyed and the dom data removed before the cell if the * row is animating out. */ doesRowOrCellHaveBrowserFocus() { const activeElement = _getActiveDomElement(this.beans); if (this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_CELL_CTRL, true)) { return true; } return this.isDomDataPresentInHierarchy(activeElement, DOM_DATA_KEY_ROW_CTRL, true); } isDomDataPresentInHierarchy(eBrowserCell, key, attemptToRefocusIfDestroyed) { let ePointer = eBrowserCell; while (ePointer) { const data = _getDomData(this.gos, ePointer, key); if (data) { if (data.destroyed && attemptToRefocusIfDestroyed) { this.attemptToRecoverFocus(); return false; } return true; } ePointer = ePointer.parentNode; } return false; } getFocusedCell() { return this.focusedCell; } getFocusEventParams(focusedCellPosition) { const { rowIndex, rowPinned, column } = focusedCellPosition; const params = { rowIndex, rowPinned, column, isFullWidthCell: false }; const rowCtrl = this.rowRenderer.getRowByPosition({ rowIndex, rowPinned }); if (rowCtrl) { params.isFullWidthCell = rowCtrl.isFullWidth(); } return params; } clearFocusedCell() { if (this.focusedCell == null) { return; } const focusEventParams = this.getFocusEventParams(this.focusedCell); this.focusedCell = null; this.eventSvc.dispatchEvent({ type: "cellFocusCleared", ...focusEventParams }); } setFocusedCell(params) { this.setFocusRecovered(); const { column, rowIndex, rowPinned, forceBrowserFocus = false, preventScrollOnBrowserFocus = false, sourceEvent } = params; const gridColumn = this.colModel.getCol(column); if (!gridColumn) { this.focusedCell = null; return; } this.focusedCell = { rowIndex, rowPinned: _makeNull(rowPinned), column: gridColumn }; const focusEventParams = this.getFocusEventParams(this.focusedCell); this.eventSvc.dispatchEvent({ type: "cellFocused", ...focusEventParams, ...this.previousCellFocusParams && { previousParams: this.previousCellFocusParams }, forceBrowserFocus, preventScrollOnBrowserFocus, sourceEvent }); this.previousCellFocusParams = focusEventParams; } isCellFocused(cellPosition) { if (this.focusedCell == null) { return false; } return _areCellsEqual(cellPosition, this.focusedCell); } isHeaderWrapperFocused(headerCtrl) { if (this.focusedHeader == null) { return false; } const { column, rowCtrl: { rowIndex: headerRowIndex, pinned } } = headerCtrl; const { column: focusedColumn, headerRowIndex: focusedHeaderRowIndex } = this.focusedHeader; return column === focusedColumn && headerRowIndex === focusedHeaderRowIndex && pinned == focusedColumn.getPinned(); } focusHeaderPosition(params) { this.setFocusRecovered(); if (_isHeaderFocusSuppressed(this.beans)) { return false; } const { direction, fromTab, allowUserOverride, event, fromCell, rowWithoutSpanValue, scroll = true } = params; let { headerPosition } = params; if (fromCell && this.filterManager?.isAdvFilterHeaderActive()) { return this.focusAdvancedFilter(headerPosition); } if (allowUserOverride) { const currentPosition = this.focusedHeader; const headerRowCount = getFocusHeaderRowCount(this.beans); if (fromTab) { const userFunc = this.gos.getCallback("tabToNextHeader"); if (userFunc) { headerPosition = this.getHeaderPositionFromUserFunc({ userFunc, direction, currentPosition, headerPosition, headerRowCount }); } } else { const userFunc = this.gos.getCallback("navigateToNextHeader"); if (userFunc && event) { const params2 = { key: event.key, previousHeaderPosition: currentPosition, nextHeaderPosition: headerPosition, headerRowCount, event }; const userResult = userFunc(params2); headerPosition = userResult === null ? currentPosition : userResult; } } } if (!headerPosition) { return false; } return this.focusProvidedHeaderPosition({ headerPosition, direction, event, fromCell, rowWithoutSpanValue, scroll }); } focusHeaderPositionFromUserFunc(params) { if (_isHeaderFocusSuppressed(this.beans)) { return false; } const { userFunc, headerPosition, direction, event } = params; const currentPosition = this.focusedHeader; const headerRowCount = getFocusHeaderRowCount(this.beans); const newHeaderPosition = this.getHeaderPositionFromUserFunc({ userFunc, direction, currentPosition, headerPosition, headerRowCount }); return !!newHeaderPosition && this.focusProvidedHeaderPosition({ headerPosition: newHeaderPosition, direction, event }); } getHeaderPositionFromUserFunc(params) { const { userFunc, direction, currentPosition, headerPosition, headerRowCount } = params; const userFuncParams = { backwards: direction === "Before", previousHeaderPosition: currentPosition, nextHeaderPosition: headerPosition, headerRowCount }; const userResult = userFunc(userFuncParams); if (userResult === true) { return currentPosition; } if (userResult === false) { return null; } return userResult; } focusProvidedHeaderPosition(params) { const { headerPosition, direction, fromCell, rowWithoutSpanValue, event, scroll = true } = params; const { column, headerRowIndex } = headerPosition; const { filterManager, ctrlsSvc, headerNavigation } = this.beans; if (this.focusedHeader && isHeaderPositionEqual(params.headerPosition, this.focusedHeader)) { return false; } if (headerRowIndex === -1) { if (filterManager?.isAdvFilterHeaderActive()) { return this.focusAdvancedFilter(headerPosition); } return this.focusGridView({ column, event }); } if (scroll) { headerNavigation?.scrollToColumn(column, direction); } const headerRowContainerCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column.getPinned()); const focusSuccess = headerRowContainerCtrl?.focusHeader(headerPosition.headerRowIndex, column, event) || false; if (headerNavigation && focusSuccess && (rowWithoutSpanValue != null || fromCell)) { headerNavigation.currentHeaderRowWithoutSpan = rowWithoutSpanValue ?? -1; } return focusSuccess; } focusFirstHeader() { if (this.overlays?.exclusive && this.focusOverlay()) { return true; } const firstColumn = this.visibleCols.allCols[0]; if (!firstColumn) { return false; } const headerPosition = getHeaderIndexToFocus(this.beans, firstColumn, 0); return this.focusHeaderPosition({ headerPosition, rowWithoutSpanValue: 0 }); } focusLastHeader(event) { if (this.overlays?.exclusive && this.focusOverlay(true)) { return true; } const headerRowIndex = getFocusHeaderRowCount(this.beans) - 1; const column = _last(this.visibleCols.allCols); return this.focusHeaderPosition({ headerPosition: { headerRowIndex, column }, rowWithoutSpanValue: -1, event }); } focusPreviousFromFirstCell(event) { if (this.filterManager?.isAdvFilterHeaderActive()) { return this.focusAdvancedFilter(null); } return this.focusLastHeader(event); } isAnyCellFocused() { return !!this.focusedCell; } isRowFocused(rowIndex, rowPinnedType) { if (this.focusedCell == null) { return false; } return this.focusedCell.rowIndex === rowIndex && this.focusedCell.rowPinned === _makeNull(rowPinnedType); } focusOverlay(backwards) { const overlayGui = this.overlays?.isVisible() && this.overlays.eWrapper?.getGui(); return !!overlayGui && _focusInto(overlayGui, backwards); } getDefaultTabToNextGridContainerTarget(params) { const { backwards, focusableContainers } = params; const step = backwards ? -1 : 1; let gridBodyTarget; const getGridBodyTabTarget = () => { if (gridBodyTarget === void 0) { gridBodyTarget = this.getGridBodyTabTarget(backwards); } return gridBodyTarget; }; for (let index = params.nextIndex; index >= 0 && index < focusableContainers.length; index += step) { const target = _getDefaultTabTargetForContainer(focusableContainers[index], getGridBodyTabTarget); if (target) { return target; } } return null; } getGridBodyTabTarget(backwards) { if (backwards) { return this.getGridViewTabTarget({ column: _last(this.visibleCols.allCols), backwards: true }); } const firstColumn = this.visibleCols.allCols[0]; if (this.gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(this.beans)) { return this.getGridViewTabTarget({ column: firstColumn }); } if (!firstColumn) { return null; } return getHeaderIndexToFocus(this.beans, firstColumn, 0); } getGridViewTabTarget(params) { const { backwards = false } = params; const column = params.column ?? this.focusedHeader?.column; if (!column) { return null; } if (this.overlays?.exclusive) { return null; } if (_isCellFocusSuppressed(this.beans)) { return backwards && !_isHeaderFocusSuppressed(this.beans) ? { headerRowIndex: getFocusHeaderRowCount(this.beans) - 1, column } : null; } const nextRow = backwards ? _getLastRow(this.beans) : _getFirstRow(this.beans); if (nextRow?.rowIndex == null) { if (this.overlays?.isVisible()) { return null; } if (backwards && !_isHeaderFocusSuppressed(this.beans)) { const lastColumn = _last(this.visibleCols.allCols); if (lastColumn) { return { headerRowIndex: getFocusHeaderRowCount(this.beans) - 1, column: lastColumn }; } } return null; } const rowNode = _getRowNode(this.beans, nextRow); if (!rowNode || column.isSuppressNavigable(rowNode)) { return null; } if (backwards) { const rowCtrl = this.rowRenderer.getRowByPosition(nextRow); if (rowCtrl?.isFullWidth()) { return null; } } return { rowIndex: nextRow.rowIndex, rowPinned: nextRow.rowPinned, column }; } focusGridView(params) { const { backwards = false, canFocusOverlay = true, event } = params; if (this.overlays?.exclusive) { return canFocusOverlay && this.focusOverlay(backwards); } if (_isCellFocusSuppressed(this.beans)) { if (backwards) { if (!_isHeaderFocusSuppressed(this.beans)) { return this.focusLastHeader(); } } if (canFocusOverlay && this.focusOverlay(backwards)) { return true; } if (backwards) { return false; } return _focusNextGridCoreContainer(this.beans, backwards); } const nextRow = backwards ? _getLastRow(this.beans) : _getFirstRow(this.beans); if (nextRow) { const column = params.column ?? this.focusedHeader?.column; const { rowIndex, rowPinned } = nextRow; const rowNode = _getRowNode(this.beans, nextRow); if (!column || !rowNode || rowIndex == null) { return false; } if (column.isSuppressNavigable(rowNode)) { const isRtl = this.gos.get("enableRtl"); let key; if (!event || event.key === KeyCode.TAB) { key = isRtl ? KeyCode.LEFT : KeyCode.RIGHT; } else { key = event.key; } this.beans.navigation?.navigateToNextCell( null, key, { rowIndex, column, rowPinned: rowPinned || null }, true ); return true; } this.navigation?.ensureCellVisible({ rowIndex, column, rowPinned }); if (backwards) { const rowCtrl = this.rowRenderer.getRowByPosition(nextRow); if (rowCtrl?.isFullWidth() && this.navigation?.tryToFocusFullWidthRow(nextRow, backwards)) { return true; } } this.setFocusedCell({ rowIndex, column, rowPinned: _makeNull(rowPinned), forceBrowserFocus: true }); if (!isRowNumberCol(column)) { this.beans.rangeSvc?.setRangeToCell({ rowIndex, rowPinned, column }); } return true; } if (canFocusOverlay && this.focusOverlay(backwards)) { return true; } if (backwards && this.focusLastHeader()) { return true; } return false; } focusAdvancedFilter(position) { this.advFilterFocusColumn = position?.column; return this.beans.advancedFilter?.getCtrl().focusHeaderComp() ?? false; } focusNextFromAdvancedFilter(backwards, forceFirstColumn) { const column = (forceFirstColumn ? void 0 : this.advFilterFocusColumn) ?? this.visibleCols.allCols?.[0]; if (backwards) { return this.focusHeaderPosition({ headerPosition: { column, headerRowIndex: getFocusHeaderRowCount(this.beans) - 1 } }); } return this.focusGridView({ column }); } clearAdvancedFilterColumn() { this.advFilterFocusColumn = void 0; } }; var ScrollVisibleService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "scrollVisibleSvc"; } wireBeans(beans) { this.ctrlsSvc = beans.ctrlsSvc; this.colAnimation = beans.colAnimation; } postConstruct() { const { gos } = this; this.horizontalScrollShowing = gos.get("alwaysShowHorizontalScroll") === true; this.verticalScrollShowing = gos.get("alwaysShowVerticalScroll") === true; this.getScrollbarWidth(); const updateScrollVisible = this.updateScrollVisible.bind(this); this.addManagedEventListeners({ displayedColumnsChanged: updateScrollVisible, displayedColumnsWidthChanged: updateScrollVisible, newColumnsLoaded: updateScrollVisible }); } updateScrollVisible() { const { colAnimation } = this; if (colAnimation?.isActive()) { colAnimation.executeLaterVMTurn(() => { colAnimation.executeLaterVMTurn(() => this.updateScrollVisibleImpl()); }); } else { this.updateScrollVisibleImpl(); } } updateScrollVisibleImpl() { const centerRowCtrl = this.ctrlsSvc.get("center"); if (!centerRowCtrl || this.colAnimation?.isActive()) { return; } const params = { horizontalScrollShowing: centerRowCtrl.isHorizontalScrollShowing(), verticalScrollShowing: this.verticalScrollShowing }; this.setScrollsVisible(params); this.updateScrollGap(); } updateScrollGap() { const centerRowCtrl = this.ctrlsSvc.get("center"); const horizontalGap = centerRowCtrl.hasHorizontalScrollGap(); const verticalGap = centerRowCtrl.hasVerticalScrollGap(); const atLeastOneDifferent = this.horizontalScrollGap !== horizontalGap || this.verticalScrollGap !== verticalGap; if (atLeastOneDifferent) { this.horizontalScrollGap = horizontalGap; this.verticalScrollGap = verticalGap; this.eventSvc.dispatchEvent({ type: "scrollGapChanged" }); } } setScrollsVisible(params) { const atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing || this.verticalScrollShowing !== params.verticalScrollShowing; if (atLeastOneDifferent) { this.horizontalScrollShowing = params.horizontalScrollShowing; this.verticalScrollShowing = params.verticalScrollShowing; this.eventSvc.dispatchEvent({ type: "scrollVisibilityChanged" }); } } // the user might be using some non-standard scrollbar, eg a scrollbar that has zero // width and overlays (like the Safari scrollbar, but presented in Chrome). so we // allow the user to provide the scroll width before we work it out. getScrollbarWidth() { if (this.scrollbarWidth == null) { const gridOptionsScrollbarWidth = this.gos.get("scrollbarWidth"); const useGridOptions = typeof gridOptionsScrollbarWidth === "number" && gridOptionsScrollbarWidth >= 0; const scrollbarWidth = useGridOptions ? gridOptionsScrollbarWidth : _getScrollbarWidth(); if (scrollbarWidth != null) { this.scrollbarWidth = scrollbarWidth; this.eventSvc.dispatchEvent({ type: "scrollbarWidthChanged" }); } } return this.scrollbarWidth; } }; var GridDestroyService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "gridDestroySvc"; this.destroyCalled = false; } destroy() { if (this.destroyCalled) { return; } const { stateSvc, ctrlsSvc, context } = this.beans; this.eventSvc.dispatchEvent({ type: "gridPreDestroyed", state: stateSvc?.getState() ?? {} }); this.destroyCalled = true; ctrlsSvc.get("gridCtrl")?.destroyGridUi(); context.destroy(); super.destroy(); } }; var _PUBLIC_EVENTS = [ "columnEverythingChanged", "newColumnsLoaded", "columnPivotModeChanged", "pivotMaxColumnsExceeded", "columnRowGroupChanged", "expandOrCollapseAll", "columnPivotChanged", "gridColumnsChanged", "columnValueChanged", "columnMoved", "columnVisible", "columnPinned", "columnGroupOpened", "columnResized", "displayedColumnsChanged", "virtualColumnsChanged", "columnHeaderMouseOver", "columnHeaderMouseLeave", "columnHeaderClicked", "columnHeaderContextMenu", "asyncTransactionsFlushed", "rowGroupOpened", "rowDataUpdated", "pinnedRowDataChanged", "pinnedRowsChanged", "rangeSelectionChanged", "cellSelectionChanged", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "toolPanelVisibleChanged", "toolPanelSizeChanged", "modelUpdated", "cutStart", "cutEnd", "pasteStart", "pasteEnd", "fillStart", "fillEnd", "cellSelectionDeleteStart", "cellSelectionDeleteEnd", "rangeDeleteStart", "rangeDeleteEnd", "undoStarted", "undoEnded", "redoStarted", "redoEnded", "cellClicked", "cellDoubleClicked", "cellMouseDown", "cellContextMenu", "cellValueChanged", "cellEditRequest", "rowValueChanged", "headerFocused", "cellFocused", "rowSelected", "selectionChanged", "tooltipShow", "tooltipHide", "cellKeyDown", "cellMouseOver", "cellMouseOut", "filterChanged", "filterModified", "filterUiChanged", "filterOpened", "floatingFilterUiChanged", "advancedFilterBuilderVisibleChanged", "sortChanged", "virtualRowRemoved", "rowClicked", "rowDoubleClicked", "gridReady", "gridPreDestroyed", "gridSizeChanged", "viewportChanged", "firstDataRendered", "dragStarted", "dragStopped", "dragCancelled", "rowEditingStarted", "rowEditingStopped", "cellEditingStarted", "cellEditingStopped", "bodyScroll", "bodyScrollEnd", "paginationChanged", "componentStateChanged", "storeRefreshed", "stateUpdated", "columnMenuVisibleChanged", "contextMenuVisibleChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "rowDragCancel", "findChanged", "rowResizeStarted", "rowResizeEnded", "columnsReset", "bulkEditingStarted", "bulkEditingStopped", "batchEditingStarted", "batchEditingStopped" ]; var _INTERNAL_EVENTS = [ "scrollbarWidthChanged", "keyShortcutChangedCellStart", "keyShortcutChangedCellEnd", "pinnedHeightChanged", "cellFocusCleared", "fullWidthRowFocused", "checkboxChanged", "heightScaleChanged", "suppressMovableColumns", "suppressMenuHide", "suppressFieldDotNotation", "columnPanelItemDragStart", "columnPanelItemDragEnd", "bodyHeightChanged", "columnContainerWidthChanged", "displayedColumnsWidthChanged", "scrollVisibilityChanged", "scrollGapChanged", "columnHoverChanged", "flashCells", "rowDragVisibilityChanged", "paginationPixelOffsetChanged", "displayedRowsChanged", "leftPinnedWidthChanged", "rightPinnedWidthChanged", "rowContainerHeightChanged", "headerHeightChanged", "columnGroupHeaderHeightChanged", "columnHeaderHeightChanged", "stylesChanged", "storeUpdated", "filterDestroyed", "filterHandlerDestroyed", "rowDataUpdateStarted", "rowCountReady", "advancedFilterEnabledChanged", "dataTypesInferred", "fieldValueChanged", "fieldPickerValueSelected", "richSelectListRowSelected", "sideBarUpdated", "alignedGridScroll", "alignedGridColumn", "gridOptionsChanged", "chartTitleEdit", "recalculateRowBounds", "stickyTopOffsetChanged", "overlayExclusiveChanged", "rowNodeDataChanged", "cellEditValuesChanged", "filterSwitched", "filterClosed", "headerRowsChanged", "rowExpansionStateChanged", "showRowGroupColsSetChanged" ]; var _GET_ALL_EVENTS = () => [..._PUBLIC_EVENTS, ..._INTERNAL_EVENTS]; var ALWAYS_SYNC_GLOBAL_EVENTS = /* @__PURE__ */ new Set(["gridPreDestroyed", "fillStart", "pasteStart"]); var _PUBLIC_EVENT_HANDLERS_MAP = _PUBLIC_EVENTS.reduce( (mem, ev) => { mem[ev] = _getCallbackForEvent(ev); return mem; }, {} ); var USER_COMP_MODULES = { agSetColumnFilter: "SetFilter", agSetColumnFloatingFilter: "SetFilter", agMultiColumnFilter: "MultiFilter", agMultiColumnFloatingFilter: "MultiFilter", agGroupColumnFilter: "GroupFilter", agGroupColumnFloatingFilter: "GroupFilter", agGroupCellRenderer: "GroupCellRenderer", agGroupRowRenderer: "GroupCellRenderer", agRichSelect: "RichSelect", agRichSelectCellEditor: "RichSelect", agDetailCellRenderer: "SharedMasterDetail", agSparklineCellRenderer: "Sparklines", agDragAndDropImage: "SharedDragAndDrop", agColumnHeader: "ColumnHeaderComp", agColumnGroupHeader: "ColumnGroupHeaderComp", agSortIndicator: "Sort", agAnimateShowChangeCellRenderer: "HighlightChanges", agAnimateSlideCellRenderer: "HighlightChanges", agLoadingCellRenderer: "LoadingCellRenderer", agSkeletonCellRenderer: "SkeletonCellRenderer", agCheckboxCellRenderer: "CheckboxCellRenderer", agLoadingOverlay: "Overlay", agExportingOverlay: "Overlay", agNoRowsOverlay: "Overlay", agNoMatchingRowsOverlay: "Overlay", agTooltipComponent: "Tooltip", agReadOnlyFloatingFilter: "CustomFilter", agTextColumnFilter: "TextFilter", agNumberColumnFilter: "NumberFilter", agBigIntColumnFilter: "BigIntFilter", agDateColumnFilter: "DateFilter", agDateInput: "DateFilter", agTextColumnFloatingFilter: "TextFilter", agNumberColumnFloatingFilter: "NumberFilter", agBigIntColumnFloatingFilter: "BigIntFilter", agDateColumnFloatingFilter: "DateFilter", agFormulaCellEditor: "Formula", agCellEditor: "TextEditor", agSelectCellEditor: "SelectEditor", agTextCellEditor: "TextEditor", agNumberCellEditor: "NumberEditor", agDateCellEditor: "DateEditor", agDateStringCellEditor: "DateEditor", agCheckboxCellEditor: "CheckboxEditor", agLargeTextCellEditor: "LargeTextEditor", agMenuItem: "MenuItem", agColumnsToolPanel: "ColumnsToolPanel", agFiltersToolPanel: "FiltersToolPanel", agNewFiltersToolPanel: "NewFiltersToolPanel", agAggregationComponent: "StatusBar", agSelectedRowCountComponent: "StatusBar", agTotalRowCountComponent: "StatusBar", agFilteredRowCountComponent: "StatusBar", agTotalAndFilteredRowCountComponent: "StatusBar", agFindCellRenderer: "Find" }; function quote(s2) { return `"${s2}"`; } var COLUMN_DEFINITION_DEPRECATIONS = () => ({ checkboxSelection: { version: "32.2", message: "Use `rowSelection.checkboxes` in `GridOptions` instead." }, headerCheckboxSelection: { version: "32.2", message: "Use `rowSelection.headerCheckbox = true` in `GridOptions` instead." }, headerCheckboxSelectionFilteredOnly: { version: "32.2", message: 'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.' }, headerCheckboxSelectionCurrentPageOnly: { version: "32.2", message: 'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.' }, showDisabledCheckboxes: { version: "32.2", message: "Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead." }, rowGroupingHierarchy: { version: "34.3", message: "Use `colDef.groupHierarchy` instead." } }); var COLUMN_DEFINITION_MOD_VALIDATIONS = { allowFormula: "Formula", aggFunc: "SharedAggregation", autoHeight: "RowAutoHeight", cellClass: "CellStyle", cellClassRules: "CellStyle", cellEditor: ({ cellEditor, editable, groupRowEditable }) => { const editingEnabled = !!editable || !!groupRowEditable; if (!editingEnabled) { return null; } if (typeof cellEditor === "string") { return USER_COMP_MODULES[cellEditor] ?? "CustomEditor"; } return "CustomEditor"; }, cellRenderer: ({ cellRenderer }) => { if (typeof cellRenderer !== "string") { return null; } return USER_COMP_MODULES[cellRenderer]; }, cellStyle: "CellStyle", columnChooserParams: "ColumnMenu", contextMenuItems: "ContextMenu", dndSource: "DragAndDrop", dndSourceOnRowDrag: "DragAndDrop", editable: ({ editable, cellEditor }) => { if (editable && !cellEditor) { return "TextEditor"; } return null; }, groupRowEditable: ({ groupRowEditable, cellEditor }) => { if (!groupRowEditable) { return null; } return cellEditor ? "RowGroupingEdit" : ["RowGroupingEdit", "TextEditor"]; }, groupRowValueSetter: ({ groupRowValueSetter }) => groupRowValueSetter ? "RowGroupingEdit" : null, enableCellChangeFlash: "HighlightChanges", enablePivot: "SharedPivot", enableRowGroup: "SharedRowGrouping", enableValue: "SharedAggregation", filter: ({ filter }) => { if (filter && typeof filter !== "string" && typeof filter !== "boolean") { return "CustomFilter"; } if (typeof filter === "string") { return USER_COMP_MODULES[filter] ?? "ColumnFilter"; } return "ColumnFilter"; }, floatingFilter: "ColumnFilter", getQuickFilterText: "QuickFilter", headerTooltip: "Tooltip", headerTooltipValueGetter: "Tooltip", mainMenuItems: "ColumnMenu", menuTabs: (options) => { const enterpriseMenuTabs = ["columnsMenuTab", "generalMenuTab"]; if (options.menuTabs?.some((tab) => enterpriseMenuTabs.includes(tab))) { return "ColumnMenu"; } return null; }, pivot: "SharedPivot", pivotIndex: "SharedPivot", rowDrag: "RowDrag", rowGroup: "SharedRowGrouping", rowGroupIndex: "SharedRowGrouping", tooltipField: "Tooltip", tooltipValueGetter: "Tooltip", tooltipComponentSelector: "Tooltip", spanRows: "CellSpan", groupHierarchy: "SharedRowGrouping" }; var COLUMN_DEFINITION_VALIDATIONS = () => { const validations = { autoHeight: { supportedRowModels: ["clientSide", "serverSide"], validate: (_colDef, { paginationAutoPageSize }) => { if (paginationAutoPageSize) { return "colDef.autoHeight is not supported with paginationAutoPageSize."; } return null; } }, allowFormula: { supportedRowModels: ["clientSide"] }, cellRendererParams: { validate: (colDef) => { const groupColumn = colDef.rowGroup != null || colDef.rowGroupIndex != null || colDef.cellRenderer === "agGroupCellRenderer"; if (groupColumn && "checkbox" in colDef.cellRendererParams) { return 'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.'; } return null; } }, flex: { validate: (_options, gridOptions) => { if (gridOptions.autoSizeStrategy) { return "colDef.flex is not supported with gridOptions.autoSizeStrategy"; } return null; } }, headerCheckboxSelection: { supportedRowModels: ["clientSide", "serverSide"], validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelection is only supported with rowSelection=multiple" }, headerCheckboxSelectionCurrentPageOnly: { supportedRowModels: ["clientSide"], validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple" }, headerCheckboxSelectionFilteredOnly: { supportedRowModels: ["clientSide"], validate: (_options, { rowSelection }) => rowSelection === "multiple" ? null : "headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple" }, headerValueGetter: { validate: (_options) => { const headerValueGetter = _options.headerValueGetter; if (typeof headerValueGetter === "function" || typeof headerValueGetter === "string") { return null; } return "headerValueGetter must be a function or a valid string expression"; } }, icons: { validate: ({ icons: icons2 }) => { if (icons2) { if (icons2["smallDown"]) { return _errMsg(262); } if (icons2["smallLeft"]) { return _errMsg(263); } if (icons2["smallRight"]) { return _errMsg(264); } } return null; } }, sort: { validate: (_options) => { if (_isSortDefValid(_options.sort) || _isSortDirectionValid(_options.sort)) { return null; } return `sort must be of type (SortDirection | SortDef), currently it is ${typeof _options.sort === "object" ? JSON.stringify(_options.sort) : toStringWithNullUndefined(_options.sort)}`; } }, initialSort: { validate: (_options) => { if (_isSortDefValid(_options.initialSort) || _isSortDirectionValid(_options.initialSort)) { return null; } return `initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof _options.initialSort === "object" ? JSON.stringify(_options.initialSort) : toStringWithNullUndefined(_options.initialSort)}`; } }, sortingOrder: { validate: (_options) => { const sortingOrder = _options.sortingOrder; if (Array.isArray(sortingOrder) && sortingOrder.length > 0) { const invalidItems = sortingOrder.filter((a) => { return !(_isSortDefValid(a) || _isSortDirectionValid(a)); }); if (invalidItems.length > 0) { return `sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${invalidItems.map( (item) => typeof item === "string" || item == null ? toStringWithNullUndefined(item) : JSON.stringify(item) ).join(", ")}]`; } } else if (!Array.isArray(sortingOrder) || !sortingOrder.length) { return `sortingOrder must be an array with at least one element, currently it is [${sortingOrder}]`; } return null; } }, type: { validate: (_options) => { const type = _options.type; if (type instanceof Array) { const invalidArray = type.some((a) => typeof a !== "string"); if (invalidArray) { return "if colDef.type is supplied an array it should be of type 'string[]'"; } return null; } if (typeof type === "string") { return null; } return "colDef.type should be of type 'string' | 'string[]'"; } }, rowSpan: { validate: (_options, { suppressRowTransform }) => { if (!suppressRowTransform) { return "colDef.rowSpan requires suppressRowTransform to be enabled."; } return null; } }, spanRows: { dependencies: { editable: { required: [false, void 0] }, groupRowEditable: { required: [false, void 0] }, rowDrag: { required: [false, void 0] }, colSpan: { required: [void 0] }, rowSpan: { required: [void 0] } }, validate: (_options, { rowSelection, cellSelection, suppressRowTransform, enableCellSpan, rowDragEntireRow, enableCellTextSelection }) => { if (typeof rowSelection === "object") { if (rowSelection?.mode === "singleRow" && rowSelection?.enableClickSelection) { return "colDef.spanRows is not supported with rowSelection.clickSelection"; } } if (cellSelection) { return "colDef.spanRows is not supported with cellSelection."; } if (suppressRowTransform) { return "colDef.spanRows is not supported with suppressRowTransform."; } if (!enableCellSpan) { return "colDef.spanRows requires enableCellSpan to be enabled."; } if (rowDragEntireRow) { return "colDef.spanRows is not supported with rowDragEntireRow."; } if (enableCellTextSelection) { return "colDef.spanRows is not supported with enableCellTextSelection."; } return null; } }, groupHierarchy: { validate(options, { groupHierarchyConfig = {} }, beans) { const GROUP_HIERARCHY_PARTS = /* @__PURE__ */ new Set([ "year", "quarter", "month", "formattedMonth", "day", "hour", "minute", "second" ]); const unrecognisedParts = []; for (const part of options.groupHierarchy ?? []) { if (typeof part === "object") { beans.validation?.validateColDef(part); continue; } if (!GROUP_HIERARCHY_PARTS.has(part) && !(part in groupHierarchyConfig)) { unrecognisedParts.push(quote(part)); } } if (unrecognisedParts.length > 0) { const warning = `The following parts of colDef.groupHierarchy are not recognised: ${unrecognisedParts.join(", ")}.`; const suggestions = `Choose one of ${[...GROUP_HIERARCHY_PARTS].map(quote).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`; return `${warning} ${suggestions}`; } return null; } } }; return validations; }; var colDefPropertyMap = { headerName: void 0, columnGroupShow: void 0, headerStyle: void 0, headerClass: void 0, toolPanelClass: void 0, headerValueGetter: void 0, pivotKeys: void 0, groupId: void 0, colId: void 0, sort: void 0, initialSort: void 0, field: void 0, type: void 0, cellDataType: void 0, tooltipComponent: void 0, tooltipField: void 0, headerTooltip: void 0, headerTooltipValueGetter: void 0, cellClass: void 0, showRowGroup: void 0, filter: void 0, initialAggFunc: void 0, defaultAggFunc: void 0, aggFunc: void 0, groupRowEditable: void 0, groupRowValueSetter: void 0, pinned: void 0, initialPinned: void 0, chartDataType: void 0, cellAriaRole: void 0, cellEditorPopupPosition: void 0, headerGroupComponent: void 0, headerGroupComponentParams: void 0, cellStyle: void 0, cellRenderer: void 0, cellRendererParams: void 0, cellEditor: void 0, cellEditorParams: void 0, filterParams: void 0, pivotValueColumn: void 0, headerComponent: void 0, headerComponentParams: void 0, floatingFilterComponent: void 0, floatingFilterComponentParams: void 0, tooltipComponentParams: void 0, refData: void 0, columnChooserParams: void 0, children: void 0, sortingOrder: void 0, allowedAggFuncs: void 0, menuTabs: void 0, pivotTotalColumnIds: void 0, cellClassRules: void 0, icons: void 0, sortIndex: void 0, initialSortIndex: void 0, flex: void 0, initialFlex: void 0, width: void 0, initialWidth: void 0, minWidth: void 0, maxWidth: void 0, rowGroupIndex: void 0, initialRowGroupIndex: void 0, pivotIndex: void 0, initialPivotIndex: void 0, suppressColumnsToolPanel: void 0, suppressFiltersToolPanel: void 0, openByDefault: void 0, marryChildren: void 0, suppressStickyLabel: void 0, hide: void 0, initialHide: void 0, rowGroup: void 0, initialRowGroup: void 0, pivot: void 0, initialPivot: void 0, checkboxSelection: void 0, showDisabledCheckboxes: void 0, headerCheckboxSelection: void 0, headerCheckboxSelectionFilteredOnly: void 0, headerCheckboxSelectionCurrentPageOnly: void 0, suppressHeaderMenuButton: void 0, suppressMovable: void 0, lockPosition: void 0, lockVisible: void 0, lockPinned: void 0, unSortIcon: void 0, suppressSizeToFit: void 0, suppressAutoSize: void 0, enableRowGroup: void 0, enablePivot: void 0, enableValue: void 0, editable: void 0, suppressPaste: void 0, suppressNavigable: void 0, enableCellChangeFlash: void 0, rowDrag: void 0, dndSource: void 0, autoHeight: void 0, wrapText: void 0, sortable: void 0, resizable: void 0, singleClickEdit: void 0, floatingFilter: void 0, cellEditorPopup: void 0, suppressFillHandle: void 0, wrapHeaderText: void 0, autoHeaderHeight: void 0, dndSourceOnRowDrag: void 0, valueGetter: void 0, valueSetter: void 0, filterValueGetter: void 0, keyCreator: void 0, valueFormatter: void 0, valueParser: void 0, comparator: void 0, equals: void 0, pivotComparator: void 0, suppressKeyboardEvent: void 0, suppressHeaderKeyboardEvent: void 0, colSpan: void 0, rowSpan: void 0, spanRows: void 0, getQuickFilterText: void 0, onCellValueChanged: void 0, onCellClicked: void 0, onCellDoubleClicked: void 0, onCellContextMenu: void 0, rowDragText: void 0, tooltipValueGetter: void 0, tooltipComponentSelector: void 0, cellRendererSelector: void 0, cellEditorSelector: void 0, suppressSpanHeaderHeight: void 0, useValueFormatterForExport: void 0, useValueParserForImport: void 0, mainMenuItems: void 0, contextMenuItems: void 0, suppressFloatingFilterButton: void 0, suppressHeaderFilterButton: void 0, suppressHeaderContextMenu: void 0, loadingCellRenderer: void 0, loadingCellRendererParams: void 0, loadingCellRendererSelector: void 0, context: void 0, dateComponent: void 0, dateComponentParams: void 0, getFindText: void 0, rowGroupingHierarchy: void 0, groupHierarchy: void 0, allowFormula: void 0 }; var ALL_PROPERTIES = () => Object.keys(colDefPropertyMap); var COL_DEF_VALIDATORS = () => ({ objectName: "colDef", allProperties: ALL_PROPERTIES(), docsUrl: "column-properties/", deprecations: COLUMN_DEFINITION_DEPRECATIONS(), validations: COLUMN_DEFINITION_VALIDATIONS() }); var STRING_GRID_OPTIONS = [ "overlayLoadingTemplate", "overlayNoRowsTemplate", "gridId", "quickFilterText", "rowModelType", "editType", "domLayout", "clipboardDelimiter", "rowGroupPanelShow", "multiSortKey", "pivotColumnGroupTotals", "pivotRowTotals", "pivotPanelShow", "fillHandleDirection", "groupDisplayType", "treeDataDisplayType", "treeDataChildrenField", "treeDataParentIdField", "colResizeDefault", "tooltipTrigger", "serverSidePivotResultFieldSeparator", "columnMenu", "tooltipShowMode", "invalidEditValueMode", "grandTotalRow", "themeCssLayer", "findSearchValue", "styleNonce", "renderingMode" ]; var OBJECT_GRID_OPTIONS = [ "components", "rowStyle", "context", "autoGroupColumnDef", "localeText", "icons", "datasource", "dragAndDropImageComponentParams", "serverSideDatasource", "viewportDatasource", "groupRowRendererParams", "aggFuncs", "fullWidthCellRendererParams", "defaultColGroupDef", "defaultColDef", "defaultCsvExportParams", "defaultExcelExportParams", "columnTypes", "rowClassRules", "detailCellRendererParams", "loadingCellRendererParams", "overlayComponentParams", "loadingOverlayComponentParams", "noRowsOverlayComponentParams", "activeOverlayParams", "popupParent", "themeStyleContainer", "statusBar", "chartThemeOverrides", "customChartThemes", "chartToolPanelsDef", "dataTypeDefinitions", "advancedFilterParent", "advancedFilterBuilderParams", "advancedFilterParams", "formulaDataSource", "formulaFuncs", "initialState", "autoSizeStrategy", "selectionColumnDef", "findOptions", "filterHandlers", "groupHierarchyConfig" ]; var ARRAY_GRID_OPTIONS = [ "sortingOrder", "alignedGrids", "rowData", "columnDefs", "excelStyles", "pinnedTopRowData", "pinnedBottomRowData", "chartThemes", "rowClass", "paginationPageSizeSelector", "suppressOverlays" ]; var _NUMBER_GRID_OPTIONS = [ "rowHeight", "detailRowHeight", "rowBuffer", "headerHeight", "groupHeaderHeight", "groupLockGroupColumns", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "groupDefaultExpanded", "pivotDefaultExpanded", "viewportRowModelPageSize", "viewportRowModelBufferSize", "autoSizePadding", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "tooltipShowDelay", "tooltipSwitchShowDelay", "tooltipHideDelay", "cacheOverflowSize", "paginationPageSize", "cacheBlockSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "scrollbarWidth", "asyncTransactionWaitMillis", "blockLoadDebounceMillis", "keepDetailRowsCount", "undoRedoCellEditingLimit", "cellFlashDuration", "cellFadeDuration", "tabIndex", "pivotMaxGeneratedColumns", "rowDragInsertDelay" ]; var OTHER_GRID_OPTIONS = ["theme", "rowSelection"]; var _BOOLEAN_MIXED_GRID_OPTIONS = [ "cellSelection", "sideBar", "rowNumbers", "suppressGroupChangesColumnVisibility", "groupAggFiltering", "suppressStickyTotalRow", "groupHideParentOfSingleChild", "enableRowPinning" ]; var _BOOLEAN_GRID_OPTIONS = [ "loadThemeGoogleFonts", "suppressMakeColumnVisibleAfterUnGroup", "suppressRowClickSelection", "suppressCellFocus", "suppressHeaderFocus", "suppressHorizontalScroll", "groupSelectsChildren", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debug", "enableBrowserTooltips", "enableCellExpressions", "groupSuppressBlankHeader", "suppressMenuHide", "suppressRowDeselection", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "singleClickEdit", "suppressLoadingOverlay", "suppressNoRowsOverlay", "suppressAutoSize", "skipHeaderOnAutoSize", "suppressColumnMoveAnimation", "suppressMoveWhenColumnDragging", "suppressMovableColumns", "suppressFieldDotNotation", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "suppressClearOnFillReduction", "deltaSort", "suppressTouch", "allowContextMenuWithControlKey", "suppressContextMenu", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "suppressCopyRowsToClipboard", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "pivotMode", "suppressAggFuncInHeader", "suppressColumnVirtualisation", "alwaysAggregateAtRootLevel", "suppressFocusAfterRefresh", "functionsReadOnly", "animateRows", "groupSelectsFiltered", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "enableRtl", "enableCellSpan", "suppressClickEdit", "rowDragEntireRow", "rowDragManaged", "refreshAfterGroupEdit", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragMultiRow", "enableGroupEdit", "embedFullWidthRows", "suppressPaginationPanel", "groupHideOpenParents", "groupHideColumnsUntilExpanded", "groupAllowUnbalanced", "pagination", "paginationAutoPageSize", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "purgeClosedRowNodes", "cacheQuickFilter", "includeHiddenColumnsInQuickFilter", "ensureDomOrder", "accentedSort", "suppressChangeDetection", "valueCache", "valueCacheNeverExpires", "aggregateOnlyChangedColumns", "suppressAnimationFrame", "suppressExcelExport", "suppressCsvExport", "includeHiddenColumnsInAdvancedFilter", "suppressMultiRangeSelection", "enterNavigatesVerticallyAfterEdit", "enterNavigatesVertically", "suppressPropertyNamesCheck", "rowMultiSelectWithClick", "suppressRowHoverHighlight", "suppressRowTransform", "suppressClipboardPaste", "suppressLastEmptyLineOnPaste", "enableCharts", "suppressMaintainUnsortedOrder", "enableCellTextSelection", "suppressBrowserResizeObserver", "suppressMaxRenderedRowRestriction", "excludeChildrenWhenTreeDataFiltering", "tooltipMouseTrack", "tooltipInteraction", "keepDetailRows", "paginateChildRows", "preventDefaultOnContextMenu", "undoRedoCellEditing", "allowDragFromColumnsToolPanel", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "debounceVerticalScrollbar", "detailRowAutoHeight", "serverSideSortAllLevels", "serverSideEnableClientSideSort", "serverSideOnlyRefreshFilteredGroups", "suppressAggFilteredOnly", "showOpenedGroup", "suppressClipboardApi", "suppressModelUpdateAfterUpdateTransaction", "stopEditingWhenCellsLoseFocus", "groupMaintainOrder", "columnHoverHighlight", "readOnlyEdit", "suppressRowVirtualisation", "enableCellEditingOnBackspace", "resetRowDataOnUpdate", "removePivotHeaderRowWhenSingleValueColumn", "suppressCopySingleCellRanges", "suppressGroupRowsSticky", "suppressCutToClipboard", "rowGroupPanelSuppressSort", "allowShowChangeAfterFilter", "enableAdvancedFilter", "masterDetail", "treeData", "reactiveCustomComponents", "applyQuickFilterBeforePivotOrAgg", "suppressServerSideFullWidthLoadingRow", "suppressAdvancedFilterEval", "loading", "maintainColumnOrder", "enableStrictPivotColumnOrder", "suppressSetFilterByDefault", "enableFilterHandlers", "suppressStartEditOnTab", "hidePaddedHeaderRows", "ssrmExpandAllAffectsAllRows", "animateColumnResizing" ]; var _FUNCTION_GRID_OPTIONS = [ "doesExternalFilterPass", "processPivotResultColDef", "processPivotResultColGroupDef", "getBusinessKeyForNode", "isRowSelectable", "rowDragText", "groupRowRenderer", "dragAndDropImageComponent", "fullWidthCellRenderer", "loadingCellRenderer", "overlayComponent", "loadingOverlayComponent", "noRowsOverlayComponent", "overlayComponentSelector", "activeOverlay", "detailCellRenderer", "quickFilterParser", "quickFilterMatcher", "getLocaleText", "isExternalFilterPresent", "getRowHeight", "getRowClass", "getRowStyle", "getFullRowEditValidationErrors", "getContextMenuItems", "getMainMenuItems", "processRowPostCreate", "processCellForClipboard", "getGroupRowAgg", "isFullWidthRow", "sendToClipboard", "focusGridInnerElement", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "tabToNextGridContainer", "processCellFromClipboard", "getDocument", "postProcessPopup", "getChildCount", "getDataPath", "isRowMaster", "postSortRows", "processHeaderForClipboard", "processUnpinnedColumns", "processGroupHeaderForClipboard", "paginationNumberFormatter", "processDataFromClipboard", "getServerSideGroupKey", "isServerSideGroup", "createChartContainer", "getChartToolbarItems", "fillOperation", "isApplyServerSideTransaction", "getServerSideGroupLevelParams", "isServerSideGroupOpenByDefault", "isGroupOpenByDefault", "initialGroupOrderComparator", "loadingCellRendererSelector", "getRowId", "chartMenuItems", "groupTotalRow", "alwaysPassFilter", "isRowPinnable", "isRowPinned", "isRowValidDropPosition" ]; var _GET_ALL_GRID_OPTIONS = () => [ ...ARRAY_GRID_OPTIONS, ...OBJECT_GRID_OPTIONS, ...STRING_GRID_OPTIONS, ..._NUMBER_GRID_OPTIONS, ..._FUNCTION_GRID_OPTIONS, ..._BOOLEAN_GRID_OPTIONS, ..._BOOLEAN_MIXED_GRID_OPTIONS, ...OTHER_GRID_OPTIONS ]; var _GET_SHALLOW_GRID_OPTIONS = () => [ ...STRING_GRID_OPTIONS, ..._NUMBER_GRID_OPTIONS, ..._FUNCTION_GRID_OPTIONS, ..._BOOLEAN_GRID_OPTIONS, ..._BOOLEAN_MIXED_GRID_OPTIONS ]; var GRID_OPTION_DEPRECATIONS = () => ({ suppressLoadingOverlay: { version: "32", message: "Use `loading`=false instead." }, enableFillHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." }, enableRangeHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." }, enableRangeSelection: { version: "32.2", message: "Use `cellSelection = true` instead." }, suppressMultiRangeSelection: { version: "32.2", message: "Use `cellSelection.suppressMultiRanges` instead." }, suppressClearOnFillReduction: { version: "32.2", message: "Use `cellSelection.handle.suppressClearOnFillReduction` instead." }, fillHandleDirection: { version: "32.2", message: "Use `cellSelection.handle.direction` instead." }, fillOperation: { version: "32.2", message: "Use `cellSelection.handle.setFillValue` instead." }, suppressRowClickSelection: { version: "32.2", message: "Use `rowSelection.enableClickSelection` instead." }, suppressRowDeselection: { version: "32.2", message: "Use `rowSelection.enableClickSelection` instead." }, rowMultiSelectWithClick: { version: "32.2", message: "Use `rowSelection.enableSelectionWithoutKeys` instead." }, groupSelectsChildren: { version: "32.2", message: 'Use `rowSelection.groupSelects = "descendants"` instead.' }, groupSelectsFiltered: { version: "32.2", message: 'Use `rowSelection.groupSelects = "filteredDescendants"` instead.' }, isRowSelectable: { version: "32.2", message: "Use `selectionOptions.isRowSelectable` instead." }, suppressCopySingleCellRanges: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." }, suppressCopyRowsToClipboard: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." }, onRangeSelectionChanged: { version: "32.2", message: "Use `onCellSelectionChanged` instead." }, onRangeDeleteStart: { version: "32.2", message: "Use `onCellSelectionDeleteStart` instead." }, onRangeDeleteEnd: { version: "32.2", message: "Use `onCellSelectionDeleteEnd` instead." }, suppressBrowserResizeObserver: { version: "32.2", message: "The grid always uses the browser's ResizeObserver, this grid option has no effect." }, onColumnEverythingChanged: { version: "32.2", message: "Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events." }, groupRemoveSingleChildren: { version: "33", message: "Use `groupHideParentOfSingleChild` instead." }, groupRemoveLowestSingleChildren: { version: "33", message: 'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.' }, suppressRowGroupHidesColumns: { version: "33", message: 'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.' }, suppressMakeColumnVisibleAfterUnGroup: { version: "33", message: 'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.' }, unSortIcon: { version: "33", message: "Use `defaultColDef.unSortIcon` instead." }, sortingOrder: { version: "33", message: "Use `defaultColDef.sortingOrder` instead." }, suppressPropertyNamesCheck: { version: "33", message: "`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant." }, suppressAdvancedFilterEval: { version: "34", message: "Advanced filter no longer uses function evaluation, so this option has no effect." } }); function toConstrainedNum(key, value, min) { if (typeof value === "number" || value == null) { if (value == null) { return null; } return value >= min ? null : `${key}: value should be greater than or equal to ${min}`; } return `${key}: value should be a number`; } var GRID_OPTIONS_MODULES = { alignedGrids: "AlignedGrids", allowContextMenuWithControlKey: "ContextMenu", autoSizeStrategy: "ColumnAutoSize", cellSelection: "CellSelection", columnHoverHighlight: "ColumnHover", datasource: "InfiniteRowModel", doesExternalFilterPass: "ExternalFilter", editType: "EditCore", invalidEditValueMode: "EditCore", enableAdvancedFilter: "AdvancedFilter", enableCellSpan: "CellSpan", enableCharts: "IntegratedCharts", enableRangeSelection: "CellSelection", enableRowPinning: "PinnedRow", findSearchValue: "Find", getFullRowEditValidationErrors: "EditCore", getContextMenuItems: "ContextMenu", getLocaleText: "Locale", getMainMenuItems: "ColumnMenu", getRowClass: "RowStyle", getRowStyle: "RowStyle", groupTotalRow: "SharedRowGrouping", grandTotalRow: "ClientSideRowModelHierarchy", initialState: "GridState", isExternalFilterPresent: "ExternalFilter", isRowPinnable: "PinnedRow", isRowPinned: "PinnedRow", localeText: "Locale", masterDetail: "SharedMasterDetail", pagination: "Pagination", pinnedBottomRowData: "PinnedRow", pinnedTopRowData: "PinnedRow", pivotMode: "SharedPivot", pivotPanelShow: "RowGroupingPanel", quickFilterText: "QuickFilter", rowClass: "RowStyle", rowClassRules: "RowStyle", rowData: "ClientSideRowModel", rowDragManaged: "RowDrag", refreshAfterGroupEdit: ["RowGrouping", "TreeData"], rowGroupPanelShow: "RowGroupingPanel", rowNumbers: "RowNumbers", rowSelection: "SharedRowSelection", rowStyle: "RowStyle", serverSideDatasource: "ServerSideRowModel", sideBar: "SideBar", statusBar: "StatusBar", treeData: "SharedTreeData", undoRedoCellEditing: "UndoRedoEdit", valueCache: "ValueCache", viewportDatasource: "ViewportRowModel" }; var GRID_OPTION_VALIDATIONS = () => { const definedValidations = { autoSizePadding: { validate({ autoSizePadding }) { return toConstrainedNum("autoSizePadding", autoSizePadding, 0); } }, cacheBlockSize: { supportedRowModels: ["serverSide", "infinite"], validate({ cacheBlockSize }) { return toConstrainedNum("cacheBlockSize", cacheBlockSize, 1); } }, cacheOverflowSize: { validate({ cacheOverflowSize }) { return toConstrainedNum("cacheOverflowSize", cacheOverflowSize, 1); } }, datasource: { supportedRowModels: ["infinite"] }, domLayout: { validate: (options) => { const domLayout = options.domLayout; const validLayouts = ["autoHeight", "normal", "print"]; if (domLayout && !validLayouts.includes(domLayout)) { return `domLayout must be one of [${validLayouts.join()}], currently it's ${domLayout}`; } return null; } }, enableFillHandle: { dependencies: { enableRangeSelection: { required: [true] } } }, enableRangeHandle: { dependencies: { enableRangeSelection: { required: [true] } } }, enableCellSpan: { supportedRowModels: ["clientSide", "serverSide"] }, enableRangeSelection: { dependencies: { rowDragEntireRow: { required: [false, void 0] } } }, enableRowPinning: { supportedRowModels: ["clientSide"], validate({ enableRowPinning, pinnedTopRowData, pinnedBottomRowData }) { if (enableRowPinning && (pinnedTopRowData || pinnedBottomRowData)) { return "Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`."; } return null; } }, isRowPinnable: { supportedRowModels: ["clientSide"], validate({ enableRowPinning, isRowPinnable, pinnedTopRowData, pinnedBottomRowData }) { if (isRowPinnable && (pinnedTopRowData || pinnedBottomRowData)) { return "Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`."; } if (!enableRowPinning && isRowPinnable) { return "`isRowPinnable` requires `enableRowPinning` to be set."; } return null; } }, isRowPinned: { supportedRowModels: ["clientSide"], validate({ enableRowPinning, isRowPinned, pinnedTopRowData, pinnedBottomRowData }) { if (isRowPinned && (pinnedTopRowData || pinnedBottomRowData)) { return "Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`."; } if (!enableRowPinning && isRowPinned) { return "`isRowPinned` requires `enableRowPinning` to be set."; } return null; } }, groupDefaultExpanded: { supportedRowModels: ["clientSide"] }, groupHideColumnsUntilExpanded: { supportedRowModels: ["clientSide"], validate({ groupHideColumnsUntilExpanded, groupHideOpenParents, groupDisplayType }) { if (groupHideColumnsUntilExpanded && !groupHideOpenParents && groupDisplayType !== "multipleColumns") { return "`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`"; } return null; } }, groupHideOpenParents: { supportedRowModels: ["clientSide", "serverSide"], dependencies: { groupTotalRow: { required: [void 0, "bottom"] }, treeData: { required: [void 0, false], reason: "Tree Data has values at the group level so it doesn't make sense to hide them." } } }, groupHideParentOfSingleChild: { dependencies: { groupHideOpenParents: { required: [void 0, false] } } }, groupRemoveLowestSingleChildren: { dependencies: { groupHideOpenParents: { required: [void 0, false] }, groupRemoveSingleChildren: { required: [void 0, false] } } }, groupRemoveSingleChildren: { dependencies: { groupHideOpenParents: { required: [void 0, false] }, groupRemoveLowestSingleChildren: { required: [void 0, false] } } }, groupSelectsChildren: { dependencies: { rowSelection: { required: ["multiple"] } } }, groupHierarchyConfig: { validate({ groupHierarchyConfig = {} }, gridOptions, beans) { for (const k of Object.keys(groupHierarchyConfig)) { beans.validation?.validateColDef(groupHierarchyConfig[k]); } return null; } }, icons: { validate: ({ icons: icons2 }) => { if (icons2) { if (icons2["smallDown"]) { return _errMsg(262); } if (icons2["smallLeft"]) { return _errMsg(263); } if (icons2["smallRight"]) { return _errMsg(264); } } return null; } }, infiniteInitialRowCount: { validate({ infiniteInitialRowCount }) { return toConstrainedNum("infiniteInitialRowCount", infiniteInitialRowCount, 1); } }, initialGroupOrderComparator: { supportedRowModels: ["clientSide"] }, ssrmExpandAllAffectsAllRows: { validate: (options) => { if (typeof options.ssrmExpandAllAffectsAllRows === "boolean") { if (options.rowModelType !== "serverSide") { return "'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model."; } if (options.ssrmExpandAllAffectsAllRows && typeof options.getRowId !== "function") { return `'getRowId' callback must be provided for Server Side Row Model grouping to work correctly.`; } } return null; } }, keepDetailRowsCount: { validate({ keepDetailRowsCount }) { return toConstrainedNum("keepDetailRowsCount", keepDetailRowsCount, 1); } }, paginationPageSize: { validate({ paginationPageSize }) { return toConstrainedNum("paginationPageSize", paginationPageSize, 1); } }, paginationPageSizeSelector: { validate: (options) => { const values = options.paginationPageSizeSelector; if (typeof values === "boolean" || values == null) { return null; } if (!values.length) { return `'paginationPageSizeSelector' cannot be an empty array. If you want to hide the page size selector, set paginationPageSizeSelector to false.`; } return null; } }, pivotMode: { dependencies: { treeData: { required: [false, void 0], reason: "Pivot Mode is not supported with Tree Data." } } }, quickFilterText: { supportedRowModels: ["clientSide"] }, rowBuffer: { validate({ rowBuffer }) { return toConstrainedNum("rowBuffer", rowBuffer, 0); } }, rowClass: { validate: (options) => { const rowClass = options.rowClass; if (typeof rowClass === "function") { return "rowClass should not be a function, please use getRowClass instead"; } return null; } }, rowData: { supportedRowModels: ["clientSide"] }, rowDragManaged: { supportedRowModels: ["clientSide"], dependencies: { pagination: { required: [false, void 0] } } }, rowSelection: { validate({ rowSelection }) { if (rowSelection && typeof rowSelection === "string") { return 'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.'; } if (rowSelection && typeof rowSelection !== "object") { return "Expected `RowSelectionOptions` object for the `rowSelection` property."; } if (rowSelection && rowSelection.mode !== "multiRow" && rowSelection.mode !== "singleRow") { return `Selection mode "${rowSelection.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`; } return null; } }, rowStyle: { validate: (options) => { const rowStyle = options.rowStyle; if (rowStyle && typeof rowStyle === "function") { return "rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead"; } return null; } }, serverSideDatasource: { supportedRowModels: ["serverSide"] }, serverSideInitialRowCount: { supportedRowModels: ["serverSide"], validate({ serverSideInitialRowCount }) { return toConstrainedNum("serverSideInitialRowCount", serverSideInitialRowCount, 1); } }, serverSideOnlyRefreshFilteredGroups: { supportedRowModels: ["serverSide"] }, serverSideSortAllLevels: { supportedRowModels: ["serverSide"] }, sortingOrder: { validate: (_options) => { const sortingOrder = _options.sortingOrder; if (Array.isArray(sortingOrder) && sortingOrder.length > 0) { const invalidItems = sortingOrder.filter((a) => !_getSortDefFromInput(a)); if (invalidItems.length > 0) { return `sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${invalidItems.map( (item) => typeof item === "string" || item == null ? toStringWithNullUndefined(item) : JSON.stringify(item) )}]`; } } else if (!Array.isArray(sortingOrder) || !sortingOrder.length) { return `sortingOrder must be an array with at least one element, currently it's ${sortingOrder}`; } return null; } }, tooltipHideDelay: { validate: (options) => { if (options.tooltipHideDelay && options.tooltipHideDelay < 0) { return "tooltipHideDelay should not be lower than 0"; } return null; } }, tooltipShowDelay: { validate: (options) => { if (options.tooltipShowDelay && options.tooltipShowDelay < 0) { return "tooltipShowDelay should not be lower than 0"; } return null; } }, tooltipSwitchShowDelay: { validate: (options) => { if (options.tooltipSwitchShowDelay && options.tooltipSwitchShowDelay < 0) { return "tooltipSwitchShowDelay should not be lower than 0"; } return null; } }, treeData: { supportedRowModels: ["clientSide", "serverSide"], validate: (options) => { const rowModel = options.rowModelType ?? "clientSide"; switch (rowModel) { case "clientSide": { const { treeDataChildrenField, treeDataParentIdField, getDataPath, getRowId } = options; if (!treeDataChildrenField && !treeDataParentIdField && !getDataPath) { return "treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model."; } if (treeDataChildrenField) { if (getDataPath) { return "Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time."; } if (treeDataParentIdField) { return "Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."; } } if (treeDataParentIdField) { if (!getRowId) { return "getRowId callback not provided, tree data with parent id cannot be built."; } if (getDataPath) { return "Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."; } } return null; } case "serverSide": { const ssrmWarning = `treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${rowModel} row model.`; return options.isServerSideGroup && options.getServerSideGroupKey ? null : ssrmWarning; } } return null; } }, viewportDatasource: { supportedRowModels: ["viewport"] }, viewportRowModelBufferSize: { validate({ viewportRowModelBufferSize }) { return toConstrainedNum("viewportRowModelBufferSize", viewportRowModelBufferSize, 0); } }, viewportRowModelPageSize: { validate({ viewportRowModelPageSize }) { return toConstrainedNum("viewportRowModelPageSize", viewportRowModelPageSize, 1); } }, rowDragEntireRow: { dependencies: { cellSelection: { required: [void 0] } } }, autoGroupColumnDef: { validate({ autoGroupColumnDef, showOpenedGroup }) { if (autoGroupColumnDef?.field && showOpenedGroup) { return "autoGroupColumnDef.field and showOpenedGroup are not supported when used together."; } if (autoGroupColumnDef?.valueGetter && showOpenedGroup) { return "autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together."; } return null; } }, renderingMode: { validate: (options) => { const renderingMode = options.renderingMode; const validModes = ["default", "legacy"]; if (renderingMode && !validModes.includes(renderingMode)) { return `renderingMode must be one of [${validModes.join()}], currently it's ${renderingMode}`; } return null; } }, autoSizeStrategy: { validate: ({ autoSizeStrategy }) => { if (!autoSizeStrategy) { return null; } const validModes = [ "fitCellContents", "fitGridWidth", "fitProvidedWidth" ]; const type = autoSizeStrategy.type; if (type !== "fitCellContents" && type !== "fitGridWidth" && type !== "fitProvidedWidth") { return `Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${validModes.map((m) => '"' + m + '"').join(", ")}, currently it's ${type}`; } if (type === "fitProvidedWidth" && typeof autoSizeStrategy.width != "number") { return `When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${autoSizeStrategy.width}`; } return null; } } }; const validations = {}; for (const key of _BOOLEAN_GRID_OPTIONS) { validations[key] = { expectedType: "boolean" }; } for (const key of _NUMBER_GRID_OPTIONS) { validations[key] = { expectedType: "number" }; } _mergeDeep(validations, definedValidations); return validations; }; var GRID_OPTIONS_VALIDATORS = () => ({ objectName: "gridOptions", allProperties: [..._GET_ALL_GRID_OPTIONS(), ...Object.values(_PUBLIC_EVENT_HANDLERS_MAP)], propertyExceptions: ["api"], docsUrl: "grid-options/", deprecations: GRID_OPTION_DEPRECATIONS(), validations: GRID_OPTION_VALIDATIONS() }); var changeSetId = 0; var gridInstanceSequence = 0; var GRID_DOM_KEY = "__ag_grid_instance"; var GridOptionsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "gos"; this.domDataKey = "__AG_" + Math.random().toString(); this.instanceId = gridInstanceSequence++; this.gridReadyFired = false; this.queueEvents = []; this.propEventSvc = new LocalEventService(); this.globalEventHandlerFactory = (restrictToSyncOnly) => { return (eventName, event) => { if (!this.isAlive()) { return; } const alwaysSync = ALWAYS_SYNC_GLOBAL_EVENTS.has(eventName); if (alwaysSync && !restrictToSyncOnly || !alwaysSync && restrictToSyncOnly) { return; } if (!isPublicEventHandler(eventName)) { return; } const fireEvent = (name, e) => { const eventHandlerName = _PUBLIC_EVENT_HANDLERS_MAP[name]; const eventHandler = this.gridOptions[eventHandlerName]; if (typeof eventHandler === "function") { this.beans.frameworkOverrides.wrapOutgoing(() => eventHandler(e)); } }; if (this.gridReadyFired) { fireEvent(eventName, event); } else if (eventName === "gridReady") { fireEvent(eventName, event); this.gridReadyFired = true; for (const q of this.queueEvents) { fireEvent(q.eventName, q.event); } this.queueEvents = []; } else { this.queueEvents.push({ eventName, event }); } }; }; } wireBeans(beans) { this.gridOptions = beans.gridOptions; this.validation = beans.validation; this.api = beans.gridApi; this.gridId = beans.context.getId(); } // This is quicker then having code call gridOptionsService.get('context') get gridOptionsContext() { return this.gridOptions["context"]; } postConstruct() { this.validateGridOptions(this.gridOptions); this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this), true); this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(true).bind(this), false); this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides); this.addManagedEventListeners({ gridOptionsChanged: ({ options }) => { this.updateGridOptions({ options, force: true, source: "optionsUpdated" }); } }); } destroy() { super.destroy(); this.queueEvents = []; } /** * Get the raw value of the GridOptions property provided. * @param property */ get(property) { return this.gridOptions[property] ?? GRID_OPTION_DEFAULTS[property]; } /** * Get the GridOption callback but wrapped so that the common params of api and context are automatically applied to the params. * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon */ getCallback(property) { return this.mergeGridCommonParams(this.gridOptions[property]); } /** * Returns `true` if a value has been specified for this GridOption. * @param property GridOption property */ exists(property) { return _exists(this.gridOptions[property]); } /** * Wrap the user callback and attach the api and context to the params object on the way through. * @param callback User provided callback * @returns Wrapped callback where the params object not require api and context */ mergeGridCommonParams(callback) { if (callback) { const wrapped = (callbackParams) => { return callback(this.addCommon(callbackParams)); }; return wrapped; } return callback; } updateGridOptions({ options, force, source = "api" }) { const changeSet = { id: changeSetId++, properties: [] }; const events = []; const { gridOptions, validation } = this; for (const key of Object.keys(options)) { const value = GlobalGridOptions.applyGlobalGridOption(key, options[key]); validation?.warnOnInitialPropertyUpdate(source, key); const shouldForce = force || typeof value === "object" && source === "api"; const previousValue = gridOptions[key]; if (shouldForce || previousValue !== value) { gridOptions[key] = value; const event = { type: key, currentValue: value, previousValue, changeSet, source }; events.push(event); } } this.validateGridOptions(this.gridOptions); changeSet.properties = events.map((event) => event.type); for (const event of events) { _logIfDebug(this, `Updated property ${event.type} from`, event.previousValue, ` to `, event.currentValue); this.propEventSvc.dispatchEvent(event); } } addPropertyEventListener(key, listener) { this.propEventSvc.addEventListener(key, listener); } removePropertyEventListener(key, listener) { this.propEventSvc.removeEventListener(key, listener); } getDomDataKey() { return this.domDataKey; } /** Prefer _addGridCommonParams from gridOptionsUtils for bundle size savings */ addCommon(params) { params.api = this.api; params.context = this.gridOptionsContext; return params; } validateOptions(options, modValidations) { for (const key of Object.keys(options)) { const value = options[key]; if (value == null || value === false) { continue; } let moduleToCheck = modValidations[key]; if (typeof moduleToCheck === "function") { moduleToCheck = moduleToCheck(options, this.gridOptions, this.beans); } if (moduleToCheck) { this.assertModuleRegistered(moduleToCheck, key); } } } validateGridOptions(gridOptions) { this.validateOptions(gridOptions, GRID_OPTIONS_MODULES); this.validation?.processGridOptions(gridOptions); } validateColDef(colDef, colId, skipInferenceCheck) { if (skipInferenceCheck || !this.beans.dataTypeSvc?.isColPendingInference(colId)) { this.validateOptions(colDef, COLUMN_DEFINITION_MOD_VALIDATIONS); this.validation?.validateColDef(colDef); } } assertModuleRegistered(moduleName4, reasonOrId) { const registered = Array.isArray(moduleName4) ? moduleName4.some((modName) => this.isModuleRegistered(modName)) : this.isModuleRegistered(moduleName4); if (!registered) { _error(200, { ...this.getModuleErrorParams(), moduleName: moduleName4, reasonOrId }); } return registered; } getModuleErrorParams() { return { gridId: this.gridId, gridScoped: _areModulesGridScoped(), rowModelType: this.get("rowModelType"), isUmd: _isUmd() }; } isModuleRegistered(moduleName4) { return _isModuleRegistered(moduleName4, this.gridId, this.get("rowModelType")); } setInstanceDomData(element) { element[GRID_DOM_KEY] = this.instanceId; } isElementInThisInstance(element) { let pointer = element; while (pointer) { const instanceId = pointer[GRID_DOM_KEY]; if (_exists(instanceId)) { const eventFromThisGrid = instanceId === this.instanceId; return eventFromThisGrid; } pointer = pointer.parentElement; } return false; } }; function isPublicEventHandler(eventName) { return !!_PUBLIC_EVENT_HANDLERS_MAP[eventName]; } var HeaderCellMouseListenerFeature = class extends BeanStub { constructor(column, eGui) { super(); this.column = column; this.eGui = eGui; this.lastMovingChanged = 0; } postConstruct() { this.addManagedElementListeners(this.eGui, { click: (e) => e && this.onClick(e) }); this.addManagedListeners(this.column, { movingChanged: () => { this.lastMovingChanged = Date.now(); } }); } onClick(event) { const { sortSvc, rangeSvc, gos } = this.beans; const sortFromClick = _getEnableColumnSelection(gos) ? event.altKey : true; if (!sortFromClick) { rangeSvc?.handleColumnSelection(this.column, event); } else if (this.column.isSortable()) { const moving = this.column.isMoving(); const nowTime = Date.now(); const movedRecently = nowTime - this.lastMovingChanged < 50; const columnMoving = moving || movedRecently; if (!columnMoving) { sortSvc?.progressSortFromEvent(this.column, event); } } } }; function getHeaderCompElementParams(includeColumnRefIndicator, includeSortIndicator) { const hiddenAttrs = { "aria-hidden": "true" }; return { tag: "div", cls: "ag-cell-label-container", role: "presentation", children: [ { tag: "span", ref: "eMenu", cls: "ag-header-icon ag-header-cell-menu-button", attrs: hiddenAttrs }, { tag: "span", ref: "eFilterButton", cls: "ag-header-icon ag-header-cell-filter-button", attrs: hiddenAttrs }, { tag: "div", ref: "eLabel", cls: "ag-header-cell-label", role: "presentation", children: [ includeColumnRefIndicator ? { tag: "span", ref: "eColRef", cls: "ag-header-col-ref" } : null, { tag: "span", ref: "eText", cls: "ag-header-cell-text" }, { tag: "span", ref: "eFilter", cls: "ag-header-icon ag-header-label-icon ag-filter-icon", attrs: hiddenAttrs }, includeSortIndicator ? { tag: "ag-sort-indicator", ref: "eSortIndicator" } : null ] } ] }; } var HeaderComp = class extends Component { constructor() { super(...arguments); this.eFilter = RefPlaceholder; this.eFilterButton = RefPlaceholder; this.eSortIndicator = RefPlaceholder; this.eMenu = RefPlaceholder; this.eLabel = RefPlaceholder; this.eText = RefPlaceholder; this.eColRef = RefPlaceholder; this.eSortOrder = RefPlaceholder; this.eSortAsc = RefPlaceholder; this.eSortDesc = RefPlaceholder; this.eSortMixed = RefPlaceholder; this.eSortNone = RefPlaceholder; this.eSortAbsoluteAsc = RefPlaceholder; this.eSortAbsoluteDesc = RefPlaceholder; this.isLoadingInnerComponent = false; } refresh(params) { const oldParams = this.params; this.params = params; if (this.workOutTemplate(params, !!this.beans?.sortSvc) != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || params.enableSorting != this.currentSort || params.column.formulaRef != this.currentRef || this.currentSuppressMenuHide != null && this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || oldParams.enableFilterButton != params.enableFilterButton || oldParams.enableFilterIcon != params.enableFilterIcon) { return false; } if (this.innerHeaderComponent) { const mergedParams = { ...params }; _mergeDeep(mergedParams, params.innerHeaderComponentParams); this.innerHeaderComponent.refresh?.(mergedParams); } else { this.setDisplayName(params); } return true; } workOutTemplate(params, isSorting) { const { formula } = this.beans; const paramsTemplate = params.template; if (paramsTemplate) { return paramsTemplate?.trim ? paramsTemplate.trim() : paramsTemplate; } return getHeaderCompElementParams(!!formula?.active, isSorting); } init(params) { this.params = params; const { sortSvc, touchSvc, rowNumbersSvc, userCompFactory } = this.beans; const sortComp = sortSvc?.getSortIndicatorSelector(); this.currentTemplate = this.workOutTemplate(params, !!sortComp); this.setTemplate(this.currentTemplate, sortComp ? [sortComp] : void 0); if (this.eLabel) { this.mouseListener ?? (this.mouseListener = this.createManagedBean( new HeaderCellMouseListenerFeature(params.column, this.eLabel) )); } touchSvc?.setupForHeader(this); this.setMenu(); this.setupSort(); this.setupColumnRefIndicator(); rowNumbersSvc?.setupForHeader(this); this.setupFilterIcon(); this.setupFilterButton(); this.workOutInnerHeaderComponent(userCompFactory, params); this.setDisplayName(params); } workOutInnerHeaderComponent(userCompFactory, params) { const userCompDetails = _getInnerHeaderCompDetails(userCompFactory, params, params); if (!userCompDetails) { return; } this.isLoadingInnerComponent = true; userCompDetails.newAgStackInstance().then((comp) => { this.isLoadingInnerComponent = false; if (!comp) { return; } if (this.isAlive()) { this.innerHeaderComponent = comp; if (this.eText) { this.eText.appendChild(comp.getGui()); } } else { this.destroyBean(comp); } }); } setDisplayName(params) { const { displayName } = params; const oldDisplayName = this.currentDisplayName; this.currentDisplayName = displayName; if (!this.eText || oldDisplayName === displayName || this.innerHeaderComponent || this.isLoadingInnerComponent) { return; } this.eText.textContent = _toString(displayName); } addInIcon(iconName, eParent, column) { const eIcon = _createIconNoSpan(iconName, this.beans, column); if (eIcon) { eParent.appendChild(eIcon); } } workOutShowMenu() { return this.params.enableMenu && !!this.beans.menuSvc?.isHeaderMenuButtonEnabled(); } shouldSuppressMenuHide() { return !!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled(); } setMenu() { if (!this.eMenu) { return; } this.currentShowMenu = this.workOutShowMenu(); if (!this.currentShowMenu) { _removeFromParent(this.eMenu); this.eMenu = void 0; return; } const { gos, eMenu, params } = this; const isLegacyMenu = _isLegacyMenuEnabled(gos); this.addInIcon(isLegacyMenu ? "menu" : "menuAlt", eMenu, params.column); eMenu.classList.toggle("ag-header-menu-icon", !isLegacyMenu); const currentSuppressMenuHide = this.shouldSuppressMenuHide(); this.currentSuppressMenuHide = currentSuppressMenuHide; this.addManagedElementListeners(eMenu, { click: () => this.showColumnMenu(this.eMenu) }); this.toggleMenuAlwaysShow(currentSuppressMenuHide); } toggleMenuAlwaysShow(alwaysShow) { this.eMenu?.classList.toggle("ag-header-menu-always-show", alwaysShow); } showColumnMenu(element) { const { currentSuppressMenuHide, params } = this; if (!currentSuppressMenuHide) { this.toggleMenuAlwaysShow(true); } params.showColumnMenu(element, () => { if (!currentSuppressMenuHide) { this.toggleMenuAlwaysShow(false); } }); } onMenuKeyboardShortcut(isFilterShortcut) { const { params, gos, beans, eMenu, eFilterButton } = this; const column = params.column; const isLegacyMenuEnabled = _isLegacyMenuEnabled(gos); if (isFilterShortcut && !isLegacyMenuEnabled) { if (beans.menuSvc?.isFilterMenuInHeaderEnabled(column)) { params.showFilter(eFilterButton ?? eMenu ?? this.getGui()); return true; } } else if (params.enableMenu) { this.showColumnMenu(eMenu ?? eFilterButton ?? this.getGui()); return true; } return false; } setupSort() { const { sortSvc } = this.beans; if (!sortSvc) { return; } const { enableSorting, column } = this.params; this.currentSort = enableSorting; if (!this.eSortIndicator) { this.eSortIndicator = this.createBean(sortSvc.createSortIndicator(true)); const { eSortIndicator, eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone, eSortAbsoluteAsc, eSortAbsoluteDesc } = this; eSortIndicator.attachCustomElements( eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone, eSortAbsoluteAsc, eSortAbsoluteDesc ); } this.eSortIndicator.setupSort(column); if (!this.currentSort) { return; } sortSvc.setupHeader(this, column); } setupColumnRefIndicator() { const { eColRef, beans: { editModelSvc }, params } = this; if (!eColRef) { return; } this.currentRef = params.column.formulaRef; eColRef.textContent = this.currentRef; _setDisplayed(eColRef, false); this.addManagedEventListeners({ cellEditingStarted: () => { const editPositions = editModelSvc?.getEditPositions(); const shouldDisplay = !!this.currentRef && !!editPositions?.some((position) => position.column.isAllowFormula()); _setDisplayed(eColRef, shouldDisplay); }, cellEditingStopped: () => { _setDisplayed(eColRef, false); } }); } setupFilterIcon() { const { eFilter, params } = this; if (!eFilter) { return; } const onFilterChangedIcon = () => { const filterPresent = params.column.isFilterActive(); _setDisplayed(eFilter, filterPresent, { skipAriaHidden: true }); }; this.configureFilter(params.enableFilterIcon, eFilter, onFilterChangedIcon, "filterActive"); } setupFilterButton() { const { eFilterButton, params } = this; if (!eFilterButton) { return; } const configured = this.configureFilter( params.enableFilterButton, eFilterButton, this.onFilterChangedButton.bind(this), "filter" ); if (configured) { this.addManagedElementListeners(eFilterButton, { click: () => params.showFilter(eFilterButton) }); } else { this.eFilterButton = void 0; } } configureFilter(enabled, element, filterChangedCallback, icon) { if (!enabled) { _removeFromParent(element); return false; } const column = this.params.column; this.addInIcon(icon, element, column); this.addManagedListeners(column, { filterChanged: filterChangedCallback }); filterChangedCallback(); return true; } onFilterChangedButton() { const filterPresent = this.params.column.isFilterActive(); this.eFilterButton.classList.toggle("ag-filter-active", filterPresent); } getAnchorElementForMenu(isFilter) { const { eFilterButton, eMenu } = this; if (isFilter) { return eFilterButton ?? eMenu ?? this.getGui(); } return eMenu ?? eFilterButton ?? this.getGui(); } destroy() { super.destroy(); this.innerHeaderComponent = this.destroyBean(this.innerHeaderComponent); this.mouseListener = this.destroyBean(this.mouseListener); } }; var GroupStickyLabelFeature = class extends BeanStub { constructor(eLabel, columnGroup) { super(); this.eLabel = eLabel; this.columnGroup = columnGroup; this.isSticky = false; this.left = null; this.right = null; } postConstruct() { const { columnGroup, beans } = this; const { ctrlsSvc } = beans; ctrlsSvc.whenReady(this, () => { const refreshPosition = this.refreshPosition.bind(this); if (columnGroup.getPinned() == null) { this.addManagedEventListeners({ bodyScroll: (event) => { if (event.direction === "horizontal") { this.updateSticky(event.left); } } }); } this.addManagedListeners(columnGroup, { leftChanged: refreshPosition, displayedChildrenChanged: refreshPosition }); this.addManagedEventListeners({ columnResized: refreshPosition }); this.refreshPosition(); }); } refreshPosition() { const { columnGroup, beans } = this; const left = columnGroup.getLeft(); const width = columnGroup.getActualWidth(); if (left == null || width === 0) { this.left = null; this.right = null; this.setSticky(false); return; } this.left = left; this.right = left + width; const scrollPosition = beans.colViewport.getScrollPosition(); if (scrollPosition != null) { this.updateSticky(scrollPosition); } } updateSticky(scrollLeft) { const { beans, left, right } = this; if (left == null || right == null) { this.setSticky(false); return; } const { gos, visibleCols } = beans; const isRtl = gos.get("enableRtl"); const viewportEdge = isRtl ? visibleCols.bodyWidth - scrollLeft : scrollLeft; this.setSticky(left < viewportEdge && right > viewportEdge); } setSticky(value) { const { isSticky, eLabel } = this; if (isSticky === value) { return; } this.isSticky = value; eLabel.classList.toggle("ag-sticky-label", value); } }; var HeaderGroupCompElement = { tag: "div", cls: "ag-header-group-cell-label", role: "presentation", children: [ { tag: "span", ref: "agLabel", cls: "ag-header-group-text", role: "presentation" }, { tag: "span", ref: "agOpened", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded` }, { tag: "span", ref: "agClosed", cls: `ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed` } ] }; var HeaderGroupComp = class extends Component { constructor() { super(HeaderGroupCompElement); this.agOpened = RefPlaceholder; this.agClosed = RefPlaceholder; this.agLabel = RefPlaceholder; this.isLoadingInnerComponent = false; } init(params) { const { userCompFactory, touchSvc } = this.beans; this.params = params; this.checkWarnings(); this.workOutInnerHeaderGroupComponent(userCompFactory, params); this.setupLabel(params); this.addGroupExpandIcon(params); this.setupExpandIcons(); touchSvc?.setupForHeaderGroup(this); } checkWarnings() { const paramsAny = this.params; if (paramsAny.template) { _warn(89); } } workOutInnerHeaderGroupComponent(userCompFactory, params) { const userCompDetails = _getInnerHeaderGroupCompDetails(userCompFactory, params, params); if (!userCompDetails) { return; } this.isLoadingInnerComponent = true; userCompDetails.newAgStackInstance().then((comp) => { this.isLoadingInnerComponent = false; if (!comp) { return; } if (this.isAlive()) { this.innerHeaderGroupComponent = comp; this.agLabel.appendChild(comp.getGui()); } else { this.destroyBean(comp); } }); } setupExpandIcons() { const { agOpened, agClosed, params: { columnGroup }, beans: { colGroupSvc } } = this; this.addInIcon("columnGroupOpened", agOpened); this.addInIcon("columnGroupClosed", agClosed); const expandAction = (event) => { if (_isStopPropagationForAgGrid(event)) { return; } const newExpandedValue = !columnGroup.isExpanded(); colGroupSvc.setColumnGroupOpened( columnGroup.getProvidedColumnGroup(), newExpandedValue, "uiColumnExpanded" ); }; this.addTouchAndClickListeners(agClosed, expandAction); this.addTouchAndClickListeners(agOpened, expandAction); const stopPropagationAction = (event) => { _stopPropagationForAgGrid(event); }; this.addManagedElementListeners(agClosed, { dblclick: stopPropagationAction }); this.addManagedElementListeners(agOpened, { dblclick: stopPropagationAction }); this.addManagedElementListeners(this.getGui(), { dblclick: expandAction }); this.updateIconVisibility(); const providedColumnGroup = columnGroup.getProvidedColumnGroup(); const updateIcon = this.updateIconVisibility.bind(this); this.addManagedListeners(providedColumnGroup, { expandedChanged: updateIcon, expandableChanged: updateIcon }); } addTouchAndClickListeners(eElement, action) { this.beans.touchSvc?.setupForHeaderGroupElement(this, eElement, action); this.addManagedElementListeners(eElement, { click: action }); } updateIconVisibility() { const { agOpened, agClosed, params: { columnGroup } } = this; if (columnGroup.isExpandable()) { const expanded = columnGroup.isExpanded(); _setDisplayed(agOpened, expanded); _setDisplayed(agClosed, !expanded); } else { _setDisplayed(agOpened, false); _setDisplayed(agClosed, false); } } addInIcon(iconName, element) { const eIcon = _createIconNoSpan(iconName, this.beans, null); if (eIcon) { element.appendChild(eIcon); } } addGroupExpandIcon(params) { if (!params.columnGroup.isExpandable()) { const { agOpened, agClosed } = this; _setDisplayed(agOpened, false); _setDisplayed(agClosed, false); } } setupLabel(params) { const { displayName, columnGroup } = params; const { innerHeaderGroupComponent, isLoadingInnerComponent } = this; const hasInnerComponent = innerHeaderGroupComponent || isLoadingInnerComponent; if (_exists(displayName) && !hasInnerComponent) { this.agLabel.textContent = _toString(displayName); } if (!columnGroup.getColGroupDef()?.suppressStickyLabel) { this.createManagedBean(new GroupStickyLabelFeature(this.getGui(), columnGroup)); } } destroy() { super.destroy(); if (this.innerHeaderGroupComponent) { this.destroyBean(this.innerHeaderGroupComponent); this.innerHeaderGroupComponent = void 0; } } }; var ColumnHeaderCompModule = { moduleName: "ColumnHeaderComp", version: VERSION, userComponents: { agColumnHeader: HeaderComp }, icons: { // button to launch legacy column menu menu: "menu", // button to launch new enterprise column menu menuAlt: "menu-alt" } }; var ColumnGroupHeaderCompModule = { moduleName: "ColumnGroupHeaderComp", version: VERSION, userComponents: { agColumnGroupHeader: HeaderGroupComp }, icons: { // header column group shown when expanded (click to contract) columnGroupOpened: "expanded", // header column group shown when contracted (click to expand) columnGroupClosed: "contracted" } }; var AnimationFrameService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "animationFrameSvc"; this.p1 = { list: [], sorted: false }; this.p2 = { list: [], sorted: false }; this.f1 = { list: [], sorted: false }; this.destroyTasks = []; this.ticking = false; this.scrollGoingDown = true; this.lastScrollTop = 0; this.taskCount = 0; } setScrollTop(scrollTop) { this.scrollGoingDown = scrollTop >= this.lastScrollTop; if (scrollTop === 0) { this.scrollGoingDown = true; } this.lastScrollTop = scrollTop; } postConstruct() { this.active = !this.gos.get("suppressAnimationFrame"); this.batchFrameworkComps = this.beans.frameworkOverrides.batchFrameworkComps; } // this method is for our AG Grid sanity only - if animation frames are turned off, // then no place in the code should be looking to add any work to be done in animation // frames. this stops bugs - where some code is asking for a frame to be executed // when it should not. verify() { if (this.active === false) { _warn(92); } } createTask(task, index, list, isFramework, isDeferred = false) { this.verify(); let taskList = list; if (isFramework && this.batchFrameworkComps) { taskList = "f1"; } const taskItem = { task, index, createOrder: ++this.taskCount, deferred: isDeferred }; this.addTaskToList(this[taskList], taskItem); this.schedule(); } addTaskToList(taskList, task) { taskList.list.push(task); taskList.sorted = false; } sortTaskList(taskList) { if (taskList.sorted) { return; } const sortDirection = this.scrollGoingDown ? 1 : -1; taskList.list.sort((a, b) => { if (a.deferred !== b.deferred) { return a.deferred ? -1 : 1; } if (a.index !== b.index) { return sortDirection * (b.index - a.index); } return b.createOrder - a.createOrder; }); taskList.sorted = true; } addDestroyTask(task) { this.verify(); this.destroyTasks.push(task); this.schedule(); } executeFrame(millis) { const { p1, p2, f1, destroyTasks, beans } = this; const { ctrlsSvc, frameworkOverrides } = beans; const p1Tasks = p1.list; const p2Tasks = p2.list; const f1Tasks = f1.list; const frameStart = Date.now(); let duration = 0; const noMaxMillis = millis <= 0; const scrollFeature = ctrlsSvc.getScrollFeature(); while (noMaxMillis || duration < millis) { const gridBodyDidSomething = scrollFeature.scrollGridIfNeeded(); if (!gridBodyDidSomething) { let task; if (p1Tasks.length) { this.sortTaskList(p1); task = p1Tasks.pop().task; } else if (p2Tasks.length) { this.sortTaskList(p2); task = p2Tasks.pop().task; } else if (f1Tasks.length) { frameworkOverrides.wrapOutgoing(() => { while (noMaxMillis || duration < millis) { const gridBodyDidSomething2 = scrollFeature.scrollGridIfNeeded(); if (!gridBodyDidSomething2) { if (f1Tasks.length) { this.sortTaskList(f1); task = f1Tasks.pop().task; task(); } else { break; } } else { break; } duration = Date.now() - frameStart; } }); task = () => { }; } else if (destroyTasks.length) { task = destroyTasks.pop(); } else { break; } task(); } duration = Date.now() - frameStart; } if (p1Tasks.length || p2Tasks.length || f1Tasks.length || destroyTasks.length) { this.requestFrame(); } else { this.ticking = false; } } flushAllFrames() { if (!this.active) { return; } this.executeFrame(-1); } schedule() { if (!this.active) { return; } if (!this.ticking) { this.ticking = true; this.requestFrame(); } } requestFrame() { const callback = this.executeFrame.bind(this, 60); _requestAnimationFrame(this.beans, callback); } isQueueEmpty() { return !this.ticking; } }; var AnimationFrameModule = { moduleName: "AnimationFrame", version: VERSION, beans: [AnimationFrameService] }; var IconService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "iconSvc"; } createIconNoSpan(iconName, params) { return _createIconNoSpan(iconName, this.beans, params?.column); } }; var _shouldOpenHeaderMenuOnLongTap = (enableMenu, isHeaderContextMenuEnabled, isLegacyMenuEnabled) => isHeaderContextMenuEnabled || enableMenu && isLegacyMenuEnabled; var TouchService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "touchSvc"; } mockBodyContextMenu(ctrl, listener) { this.mockContextMenu(ctrl, ctrl.eBodyViewport, listener); } mockHeaderContextMenu(ctrl, listener) { this.mockContextMenu(ctrl, ctrl.eGui, listener); } mockRowContextMenu(ctrl) { if (!_isIOSUserAgent()) { return; } const listener = (mouseListener, touch, touchEvent) => { const { rowCtrl, cellCtrl } = ctrl.getControlsForEventTarget(touchEvent?.target ?? null); if (cellCtrl?.column) { cellCtrl.dispatchCellContextMenuEvent(touchEvent ?? null); } this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0, touchEvent, rowCtrl, cellCtrl); }; this.mockContextMenu(ctrl, ctrl.element, listener); } handleCellDoubleClick(ctrl, mouseEvent) { const isDoubleClickOnIPad = () => { if (!_isIOSUserAgent() || _isEventSupported("dblclick")) { return false; } const nowMillis = Date.now(); const res = nowMillis - ctrl.lastIPadMouseClickEvent < 200; ctrl.lastIPadMouseClickEvent = nowMillis; return res; }; if (isDoubleClickOnIPad()) { ctrl.onCellDoubleClicked(mouseEvent); mouseEvent.preventDefault(); return true; } return false; } setupForHeader(comp) { const { gos, sortSvc, menuSvc } = this.beans; if (gos.get("suppressTouch")) { return; } const { params, eMenu, eFilterButton } = comp; const touchListener = new TouchListener(comp.getGui(), true); comp.addDestroyFunc(() => touchListener.destroy()); const suppressMenuHide = comp.shouldSuppressMenuHide(); const tapMenuButton = suppressMenuHide && _exists(eMenu) && params.enableMenu; const isHeaderContextMenuEnabled = !!menuSvc?.isHeaderContextMenuEnabled(params.column); const shouldOpenMenuOnLongTap = _shouldOpenHeaderMenuOnLongTap( params.enableMenu, isHeaderContextMenuEnabled, _isLegacyMenuEnabled(gos) ); let menuTouchListener = touchListener; if (tapMenuButton) { menuTouchListener = new TouchListener(eMenu, true); comp.addDestroyFunc(() => menuTouchListener.destroy()); } const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart); if (tapMenuButton && params.enableMenu) { comp.addManagedListeners(menuTouchListener, { tap: showMenuFn }); } if (shouldOpenMenuOnLongTap) { comp.addManagedListeners(touchListener, { longTap: showMenuFn }); } if (params.enableSorting) { const tapListener = (event) => { const target = event.touchStart.target; if (suppressMenuHide && (eMenu?.contains(target) || eFilterButton?.contains(target))) { return; } sortSvc?.progressSort(params.column, false, "uiColumnSorted"); }; comp.addManagedListeners(touchListener, { tap: tapListener }); } if (params.enableFilterButton && eFilterButton) { const filterButtonTouchListener = new TouchListener(eFilterButton, true); comp.addManagedListeners(filterButtonTouchListener, { tap: () => params.showFilter(eFilterButton) }); comp.addDestroyFunc(() => filterButtonTouchListener.destroy()); } } setupForHeaderGroup(comp) { const params = comp.params; if (this.beans.menuSvc?.isHeaderContextMenuEnabled( params.columnGroup.getProvidedColumnGroup() )) { const touchListener = new TouchListener(params.eGridHeader, true); const showMenuFn = (event) => params.showColumnMenuAfterMouseClick(event.touchStart); comp.addManagedListeners(touchListener, { longTap: showMenuFn }); comp.addDestroyFunc(() => touchListener.destroy()); } } setupForHeaderGroupElement(comp, eElement, action) { const touchListener = new TouchListener(eElement, true); comp.addManagedListeners(touchListener, { tap: action }); comp.addDestroyFunc(() => touchListener.destroy()); } mockContextMenu(ctrl, element, listener) { if (!_isIOSUserAgent()) { return; } const touchListener = new TouchListener(element); const longTapListener = (event) => { if (!_isEventFromThisInstance(this.beans, event.touchEvent)) { return; } listener(void 0, event.touchStart, event.touchEvent); }; ctrl.addManagedListeners(touchListener, { longTap: longTapListener }); ctrl.addDestroyFunc(() => touchListener.destroy()); } }; var TouchModule = { moduleName: "Touch", version: VERSION, beans: [TouchService] }; var CellNavigationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "cellNavigation"; } wireBeans(beans) { this.rowSpanSvc = beans.rowSpanSvc; } // returns null if no cell to focus on, ie at the end of the grid getNextCellToFocus(key, focusedCell, ctrlPressed = false) { if (ctrlPressed) { return this.getNextCellToFocusWithCtrlPressed(key, focusedCell); } return this.getNextCellToFocusWithoutCtrlPressed(key, focusedCell); } getNextCellToFocusWithCtrlPressed(key, focusedCell) { const upKey = key === KeyCode.UP; const downKey = key === KeyCode.DOWN; const leftKey = key === KeyCode.LEFT; let column; let rowIndex; const { pageBounds, gos, visibleCols, pinnedRowModel } = this.beans; const { rowPinned } = focusedCell; if (upKey || downKey) { if (rowPinned && pinnedRowModel) { if (upKey) { rowIndex = 0; } else { rowIndex = rowPinned === "top" ? pinnedRowModel.getPinnedTopRowCount() - 1 : pinnedRowModel.getPinnedBottomRowCount() - 1; } } else { rowIndex = upKey ? pageBounds.getFirstRow() : pageBounds.getLastRow(); } column = focusedCell.column; } else { const isRtl = gos.get("enableRtl"); rowIndex = focusedCell.rowIndex; const allColumns = leftKey !== isRtl ? visibleCols.allCols : [...visibleCols.allCols].reverse(); column = allColumns.find( (col) => !isRowNumberCol(col) && this.isCellGoodToFocusOn({ rowIndex, rowPinned: null, column: col }) ); } return column ? { rowIndex, rowPinned, column } : null; } getNextCellToFocusWithoutCtrlPressed(key, focusedCell) { let pointer = focusedCell; let finished = false; while (!finished) { switch (key) { case KeyCode.UP: pointer = this.getCellAbove(pointer); break; case KeyCode.DOWN: pointer = this.getCellBelow(pointer); break; case KeyCode.RIGHT: pointer = this.gos.get("enableRtl") ? this.getCellToLeft(pointer) : this.getCellToRight(pointer); break; case KeyCode.LEFT: pointer = this.gos.get("enableRtl") ? this.getCellToRight(pointer) : this.getCellToLeft(pointer); break; default: pointer = null; _warn(8, { key }); break; } if (pointer) { finished = this.isCellGoodToFocusOn(pointer); } else { finished = true; } } return pointer; } isCellGoodToFocusOn(gridCell) { const column = gridCell.column; let rowNode; const { pinnedRowModel, rowModel } = this.beans; switch (gridCell.rowPinned) { case "top": rowNode = pinnedRowModel?.getPinnedTopRow(gridCell.rowIndex); break; case "bottom": rowNode = pinnedRowModel?.getPinnedBottomRow(gridCell.rowIndex); break; default: rowNode = rowModel.getRow(gridCell.rowIndex); break; } if (!rowNode) { return false; } const suppressNavigable = this.isSuppressNavigable(column, rowNode); return !suppressNavigable; } getCellToLeft(lastCell) { if (!lastCell) { return null; } const colToLeft = this.beans.visibleCols.getColBefore(lastCell.column); if (!colToLeft) { return null; } return { rowIndex: lastCell.rowIndex, column: colToLeft, rowPinned: lastCell.rowPinned }; } getCellToRight(lastCell) { if (!lastCell) { return null; } const colToRight = this.beans.visibleCols.getColAfter(lastCell.column); if (!colToRight) { return null; } return { rowIndex: lastCell.rowIndex, column: colToRight, rowPinned: lastCell.rowPinned }; } getCellBelow(lastCell) { if (!lastCell) { return null; } const adjustedLastCell = this.rowSpanSvc?.getCellEnd(lastCell) ?? lastCell; const rowBelow = _getRowBelow(this.beans, adjustedLastCell, true); if (rowBelow) { return { rowIndex: rowBelow.rowIndex, column: lastCell.column, rowPinned: rowBelow.rowPinned }; } return null; } getCellAbove(lastCell) { if (!lastCell) { return null; } const adjustedLastCell = this.rowSpanSvc?.getCellStart(lastCell) ?? lastCell; const rowAbove = _getRowAbove( this.beans, { rowIndex: adjustedLastCell.rowIndex, rowPinned: adjustedLastCell.rowPinned }, true ); if (rowAbove) { return { rowIndex: rowAbove.rowIndex, column: lastCell.column, rowPinned: rowAbove.rowPinned }; } return null; } getNextTabbedCell(gridCell, backwards) { if (backwards) { return this.getNextTabbedCellBackwards(gridCell); } return this.getNextTabbedCellForwards(gridCell); } getNextTabbedCellForwards(gridCell) { const { visibleCols, pagination } = this.beans; const displayedColumns = visibleCols.allCols; let newRowIndex = gridCell.rowIndex; let newFloating = gridCell.rowPinned; let newColumn = visibleCols.getColAfter(gridCell.column); if (!newColumn) { newColumn = displayedColumns[0]; const rowBelow = _getRowBelow(this.beans, gridCell, true); if (_missing(rowBelow)) { return null; } if (!rowBelow.rowPinned && !(pagination?.isRowInPage(rowBelow.rowIndex) ?? true)) { return null; } newRowIndex = rowBelow ? rowBelow.rowIndex : null; newFloating = rowBelow ? rowBelow.rowPinned : null; } return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating }; } getNextTabbedCellBackwards(gridCell) { const { beans } = this; const { visibleCols, pagination } = beans; const displayedColumns = visibleCols.allCols; let newRowIndex = gridCell.rowIndex; let newFloating = gridCell.rowPinned; let newColumn = visibleCols.getColBefore(gridCell.column); if (!newColumn) { newColumn = _last(displayedColumns); const rowAbove = _getRowAbove(beans, { rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned }, true); if (_missing(rowAbove)) { return null; } if (!rowAbove.rowPinned && !(pagination?.isRowInPage(rowAbove.rowIndex) ?? true)) { return null; } newRowIndex = rowAbove ? rowAbove.rowIndex : null; newFloating = rowAbove ? rowAbove.rowPinned : null; } return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating }; } isSuppressNavigable(column, rowNode) { const { suppressNavigable } = column.colDef; if (typeof suppressNavigable === "boolean") { return suppressNavigable; } if (typeof suppressNavigable === "function") { const params = column.createColumnFunctionCallbackParams(rowNode); const userFunc = suppressNavigable; return userFunc(params); } return false; } }; function getFocusedCell(beans) { return beans.focusSvc.getFocusedCell(); } function clearFocusedCell(beans) { return beans.focusSvc.clearFocusedCell(); } function setFocusedCell(beans, rowIndex, colKey, rowPinned) { beans.focusSvc.setFocusedCell({ rowIndex, column: colKey, rowPinned, forceBrowserFocus: true }); } function tabToNextCell(beans, event) { return beans.navigation?.tabToNextCell(false, event) ?? false; } function tabToPreviousCell(beans, event) { return beans.navigation?.tabToNextCell(true, event) ?? false; } function setFocusedHeader(beans, colKey, floatingFilter = false) { const headerPosition = beans.headerNavigation?.getHeaderPositionForColumn(colKey, floatingFilter); if (!headerPosition) { return; } beans.focusSvc.focusHeaderPosition({ headerPosition }); } function _unwrapUserComp(comp) { const compAsAny = comp; const isProxy = compAsAny?.getFrameworkComponentInstance != null; return isProxy ? compAsAny.getFrameworkComponentInstance() : comp; } var EditModelService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "editModelSvc"; this.edits = /* @__PURE__ */ new Map(); this.cellValidations = new EditCellValidationModel(); this.rowValidations = new EditRowValidationModel(); this.suspendEdits = false; } suspend(suspend) { this.suspendEdits = suspend; } removeEdits({ rowNode, column }) { if (!this.hasEdits({ rowNode }) || !rowNode) { return; } const editRow = this.getEditRow(rowNode); if (column) { editRow.delete(column); } else { editRow.clear(); } if (editRow.size === 0) { this.edits.delete(rowNode); } } getEditRow(rowNode, params = {}) { if (this.suspendEdits) { return void 0; } if (this.edits.size === 0) { return void 0; } const edits = rowNode && this.edits.get(rowNode); if (edits) { return edits; } if (params.checkSiblings) { const pinnedSibling = rowNode.pinnedSibling; if (pinnedSibling) { return this.getEditRow(pinnedSibling); } } return void 0; } getEditRowDataValue(rowNode, { checkSiblings } = {}) { if (!rowNode || this.edits.size === 0) { return void 0; } const editRow = this.getEditRow(rowNode); const pinnedSibling = rowNode.pinnedSibling; const siblingRow = checkSiblings && pinnedSibling && this.getEditRow(pinnedSibling); if (!editRow && !siblingRow) { return void 0; } const data = { ...rowNode.data }; const applyEdits = (edits, data2) => edits.forEach(({ editorValue, pendingValue }, column) => { const value = editorValue === void 0 ? pendingValue : editorValue; if (value !== UNEDITED) { data2[column.getColId()] = value; } }); if (editRow) { applyEdits(editRow, data); } if (siblingRow) { applyEdits(siblingRow, data); } return data; } getEdit(position = {}, params) { const { rowNode, column } = position; const edits = this.edits; if (this.suspendEdits || edits.size === 0 || !rowNode || !column) { return void 0; } const edit = edits.get(rowNode)?.get(column); if (edit) { return edit; } if (params?.checkSiblings) { const pinnedSibling = rowNode.pinnedSibling; if (pinnedSibling) { return edits.get(pinnedSibling)?.get(column); } } return void 0; } getEditMap(copy = true) { if (this.suspendEdits || this.edits.size === 0) { return /* @__PURE__ */ new Map(); } if (!copy) { return this.edits; } const map = /* @__PURE__ */ new Map(); this.edits.forEach((editRow, rowNode) => { const newEditRow = /* @__PURE__ */ new Map(); editRow.forEach( ({ editorState: _, ...cellData }, column) => ( // Ensure we copy the cell data to avoid reference issues newEditRow.set(column, { ...cellData }) ) ); map.set(rowNode, newEditRow); }); return map; } setEditMap(newEdits) { this.edits.clear(); newEdits.forEach((editRow, rowNode) => { const newRow = /* @__PURE__ */ new Map(); editRow.forEach( (cellData, column) => ( // Ensure we copy the cell data to avoid reference issues newRow.set(column, { ...cellData }) ) ); this.edits.set(rowNode, newRow); }); } setEdit(position, edit) { const edits = this.edits; if (edits.size === 0 || !edits.has(position.rowNode)) { edits.set(position.rowNode, /* @__PURE__ */ new Map()); } const currentEdit = this.getEdit(position); const updatedEdit = { editorState: { isCancelAfterEnd: void 0, isCancelBeforeStart: void 0 }, ...currentEdit, ...edit }; this.getEditRow(position.rowNode).set(position.column, updatedEdit); return updatedEdit; } clearEditValue(position) { const { rowNode, column } = position; if (!rowNode) { return; } const update = (edit2) => { edit2.editorValue = void 0; edit2.pendingValue = edit2.sourceValue; edit2.state = "changed"; }; if (!column) { this.getEditRow(rowNode)?.forEach(update); return; } const edit = this.getEdit(position); if (edit) { update(edit); } } getState(position) { if (this.suspendEdits) { return void 0; } return this.getEdit(position)?.state; } getEditPositions(editMap) { if (this.suspendEdits || (editMap ?? this.edits).size === 0) { return []; } const positions = []; (editMap ?? this.edits).forEach((editRow, rowNode) => { for (const column of editRow.keys()) { const { editorState: _, ...rest } = editRow.get(column); positions.push({ rowNode, column, ...rest }); } }); return positions; } hasRowEdits(rowNode, params) { if (this.suspendEdits) { return false; } if (this.edits.size === 0) { return false; } const rowEdits = this.getEditRow(rowNode, params); return !!rowEdits; } hasEdits(position = {}, params = {}) { if (this.suspendEdits) { return false; } if (this.edits.size === 0) { return false; } const { rowNode, column } = position; const { withOpenEditor } = params; if (rowNode) { const rowEdits = this.getEditRow(rowNode, params); if (!rowEdits) { return false; } if (column) { if (withOpenEditor) { return this.getEdit(position)?.state === "editing"; } return rowEdits.has(column); } if (rowEdits.size !== 0) { if (withOpenEditor) { return Array.from(rowEdits.values()).some(({ state }) => state === "editing"); } return true; } return false; } if (withOpenEditor) { return this.getEditPositions().some(({ state }) => state === "editing"); } return this.edits.size > 0; } start(position) { const map = this.getEditRow(position.rowNode) ?? /* @__PURE__ */ new Map(); const { rowNode, column } = position; if (column && !map.has(column)) { map.set(column, { editorValue: void 0, pendingValue: UNEDITED, sourceValue: this.beans.valueSvc.getValue(column, rowNode, "data"), state: "editing", editorState: { isCancelAfterEnd: void 0, isCancelBeforeStart: void 0 } }); } this.edits.set(rowNode, map); } stop(position, preserveBatch, cancel) { if (!this.hasEdits(position)) { return; } if (preserveBatch) { const edit = this.getEditRow(position.rowNode)?.get(position.column); if (edit && (edit.pendingValue === UNEDITED || edit.pendingValue === edit.sourceValue)) { this.removeEdits(position); } else if (edit && cancel) { edit.editorValue = void 0; } } else { this.removeEdits(position); } } clear() { for (const pendingRowEdits of this.edits.values()) { pendingRowEdits.clear(); } this.edits.clear(); } getCellValidationModel() { return this.cellValidations; } getRowValidationModel() { return this.rowValidations; } setCellValidationModel(model) { this.cellValidations = model; } setRowValidationModel(model) { this.rowValidations = model; } destroy() { super.destroy(); this.clear(); } }; var EditCellValidationModel = class { constructor() { this.cellValidations = /* @__PURE__ */ new Map(); } getCellValidation(position) { const { rowNode, column } = position || {}; return this.cellValidations?.get(rowNode)?.get(column); } hasCellValidation(position) { if (!position?.rowNode || !position.column) { return this.cellValidations.size > 0; } return !!this.getCellValidation(position); } setCellValidation(position, validation) { const { rowNode, column } = position; if (!this.cellValidations.has(rowNode)) { this.cellValidations.set(rowNode, /* @__PURE__ */ new Map()); } this.cellValidations.get(rowNode).set(column, validation); } clearCellValidation(position) { const { rowNode, column } = position; this.cellValidations.get(rowNode)?.delete(column); } setCellValidationMap(validationMap) { this.cellValidations = validationMap; } getCellValidationMap() { return this.cellValidations; } clearCellValidationMap() { this.cellValidations.clear(); } }; var EditRowValidationModel = class { constructor() { this.rowValidations = /* @__PURE__ */ new Map(); } getRowValidation(position) { const { rowNode } = position || {}; return this.rowValidations.get(rowNode); } hasRowValidation(position) { if (!position?.rowNode) { return this.rowValidations.size > 0; } return !!this.getRowValidation(position); } setRowValidation({ rowNode }, rowValidation) { this.rowValidations.set(rowNode, rowValidation); } clearRowValidation({ rowNode }) { this.rowValidations.delete(rowNode); } setRowValidationMap(validationMap) { this.rowValidations = validationMap; } getRowValidationMap() { return this.rowValidations; } clearRowValidationMap() { this.rowValidations.clear(); } }; function _getRowCtrl(beans, inputs = {}) { const { rowIndex, rowId, rowCtrl, rowPinned } = inputs; if (rowCtrl) { return rowCtrl; } const { rowModel, rowRenderer } = beans; let { rowNode } = inputs; if (!rowNode) { if (rowId) { rowNode = _getRowById(beans, rowId, rowPinned); } else if (rowIndex != null) { rowNode = rowModel.getRow(rowIndex); } } return rowNode ? rowRenderer.getRowCtrlByNode(rowNode) : void 0; } function _getCellCtrl(beans, inputs = {}) { const { cellCtrl, colId, columnId, column } = inputs; if (cellCtrl) { return cellCtrl; } const actualColumn = beans.colModel.getCol(colId ?? columnId ?? _getColId(column)); const rowCtrl = inputs.rowCtrl ?? _getRowCtrl(beans, inputs); const result = rowCtrl?.getCellCtrl(actualColumn) ?? void 0; if (result) { return result; } const rowNode = inputs.rowNode ?? rowCtrl?.rowNode; if (rowNode) { return beans.rowRenderer.getCellCtrls([rowNode], [actualColumn])?.[0]; } return void 0; } function _stopEditing(beans) { const { editSvc } = beans; if (editSvc?.isBatchEditing()) { _syncFromEditors(beans, { persist: true }); _destroyEditors(beans); } else { editSvc?.stopEditing(void 0, { source: "api" }); } } function _addStopEditingWhenGridLosesFocus(bean, beans, viewports) { const { gos, popupSvc } = beans; if (!gos.get("stopEditingWhenCellsLoseFocus")) { return; } const focusOutListener = (event) => { const elementWithFocus = event.relatedTarget; if (_getTabIndex(elementWithFocus) === null) { _stopEditing(beans); return; } let clickInsideGrid = ( // see if click came from inside the viewports viewports.some((viewport) => viewport.contains(elementWithFocus)) && // and also that it's not from a detail grid gos.isElementInThisInstance(elementWithFocus) ); if (!clickInsideGrid) { clickInsideGrid = !!popupSvc && (popupSvc.getActivePopups().some((popup) => popup.contains(elementWithFocus)) || popupSvc.isElementWithinCustomPopup(elementWithFocus)); } if (!clickInsideGrid) { _stopEditing(beans); } }; for (const viewport of viewports) { bean.addManagedElementListeners(viewport, { focusout: focusOutListener }); } } function _getColId(column) { if (!column) { return void 0; } if (typeof column === "string") { return column; } return column.getColId(); } var UNEDITED = Symbol("unedited"); var getCellEditorInstances = (beans, params = {}) => { const ctrls = beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns); const editors = new Array(ctrls.length); let count = 0; for (let i = 0, len = ctrls.length; i < len; ++i) { const ctrl = ctrls[i]; const cellEditor = ctrl.comp?.getCellEditor(); if (cellEditor) { editors[count++] = _unwrapUserComp(cellEditor); } } editors.length = count; return editors; }; function _setupEditors(beans, editingCells, position, key, event, cellStartedEdit) { if (editingCells.length === 0 && position?.rowNode && position?.column) { _setupEditor(beans, position, { key, event, cellStartedEdit }); } const { valueSvc, editSvc, editModelSvc } = beans; const { rowNode, column } = position ?? {}; for (const cellPosition of editingCells) { const { rowNode: cellRowNode, column: cellColumn } = cellPosition; const curCellCtrl = _getCellCtrl(beans, cellPosition); if (!curCellCtrl) { if (cellRowNode && cellColumn) { const oldValue = valueSvc.getValue(cellColumn, cellRowNode, "data"); const isNewValueCell = position?.rowNode === cellRowNode && position?.column === cellColumn; const cellStartValue = isNewValueCell && key || void 0; const newValue = cellStartValue ?? editSvc?.getCellDataValue(cellPosition) ?? valueSvc.getValueForDisplay({ column: cellColumn, node: cellRowNode, from: "edit" })?.value ?? oldValue ?? UNEDITED; editModelSvc?.setEdit(cellPosition, { pendingValue: getNormalisedFormula(beans, newValue, false, cellColumn), sourceValue: oldValue, state: "editing" }); } continue; } const shouldStartEditing2 = cellStartedEdit && rowNode === curCellCtrl.rowNode && curCellCtrl.column === column; _setupEditor( beans, { rowNode, column: curCellCtrl.column }, { key: shouldStartEditing2 ? key : null, event: shouldStartEditing2 ? event : null, cellStartedEdit: shouldStartEditing2 && cellStartedEdit } ); } } function _sourceAndPendingDiffer({ pendingValue, sourceValue }) { if (pendingValue === UNEDITED) { pendingValue = sourceValue; } return pendingValue !== sourceValue; } function _filterChangedEdits(edits) { const result = /* @__PURE__ */ new Map(); for (const [rowNode, editRow] of edits) { const filtered = /* @__PURE__ */ new Map(); for (const [column, editValue] of editRow) { if (_sourceAndPendingDiffer(editValue)) { filtered.set(column, editValue); } } if (filtered.size > 0) { result.set(rowNode, filtered); } } return result; } function _setupEditor(beans, position, params) { const { key, event, cellStartedEdit, silent } = params ?? {}; const { editModelSvc, gos, userCompFactory } = beans; const cellCtrl = _getCellCtrl(beans, position); const editorComp = cellCtrl?.comp?.getCellEditor(); const editorParams = _createEditorParams(beans, position, key, cellStartedEdit && !silent); const previousEdit = editModelSvc?.getEdit(position); const newValue = editorParams.value ?? previousEdit?.sourceValue; if (editorComp) { editModelSvc?.setEdit(position, { editorValue: getNormalisedFormula(beans, newValue, true, position.column), state: "editing" }); editorComp.refresh?.(editorParams); return; } const colDef = position.column.getColDef(); const compDetails = _getCellEditorDetails(userCompFactory, colDef, editorParams); if (!compDetails) { return; } const { popupFromSelector, popupPositionFromSelector } = compDetails; const popup = popupFromSelector ?? !!colDef.cellEditorPopup; const popupLocation = popupPositionFromSelector ?? colDef.cellEditorPopupPosition; checkAndPreventDefault(compDetails.params, event); if (!cellCtrl) { return; } const { rangeFeature, rowCtrl, comp, onEditorAttachedFuncs } = cellCtrl; editModelSvc?.setEdit(position, { editorValue: getNormalisedFormula(beans, newValue, true, position.column), state: "editing", // Reset lifecycle flags for this new editor session. Previous sessions may have left // cellStartedEditing/cellStoppedEditing set on a reused row node. editorState: { cellStartedEditing: void 0, cellStoppedEditing: void 0 } }); cellCtrl.editCompDetails = compDetails; onEditorAttachedFuncs.push(() => rangeFeature?.unsetComp()); comp?.setEditDetails(compDetails, popup, popupLocation, gos.get("reactiveCustomComponents")); rowCtrl?.refreshRow({ suppressFlash: true }); dispatchEditingStarted(beans, position, event, newValue, silent); } function dispatchEditingStarted(beans, position, event, value, silent) { const { editSvc, editModelSvc } = beans; const edit = editModelSvc?.getEdit(position); if (!silent && edit?.state === "editing" && !edit?.editorState?.cellStartedEditing) { editSvc?.dispatchCellEvent(position, event, "cellEditingStarted", { value }); editModelSvc?.setEdit(position, { editorState: { cellStartedEditing: true } }); } } function _valueFromEditor(beans, cellEditor, params) { const noValueResult = { editorValueExists: false }; if (_hasValidationRules(beans)) { const validationErrors = cellEditor.getValidationErrors?.(); if ((validationErrors?.length ?? 0) > 0) { return noValueResult; } } if (params?.isCancelling) { return noValueResult; } if (params?.isStopping) { const isCancelAfterEnd = cellEditor?.isCancelAfterEnd?.(); if (isCancelAfterEnd) { return { ...noValueResult, isCancelAfterEnd }; } } const editorValue = cellEditor.getValue(); return { editorValue, editorValueExists: true }; } function _createEditorParams(beans, position, key, cellStartedEdit) { const { valueSvc, gos, editSvc } = beans; const enableGroupEditing = beans.gos.get("enableGroupEdit"); const cellCtrl = _getCellCtrl(beans, position); const rowIndex = position.rowNode?.rowIndex ?? void 0; const batchEdit = editSvc?.isBatchEditing(); const agColumn = beans.colModel.getCol(position.column.getId()); const { rowNode, column } = position; const editor = cellCtrl.comp?.getCellEditor(); const cellDataValue = editSvc?.getCellDataValue(position); const initialNewValue = cellDataValue === void 0 ? editor ? _valueFromEditor(beans, editor)?.editorValue : void 0 : cellDataValue; const value = initialNewValue === UNEDITED ? valueSvc.getValueForDisplay({ column: agColumn, node: rowNode, from: "edit" })?.value : initialNewValue; let paramsValue = enableGroupEditing ? initialNewValue : value; if (column.isAllowFormula() && beans.formula?.isFormula(paramsValue)) { paramsValue = beans.formula?.normaliseFormula(paramsValue, true) ?? paramsValue; } return _addGridCommonParams(gos, { value: paramsValue, eventKey: key ?? null, column, colDef: column.getColDef(), rowIndex, node: rowNode, data: rowNode.data, cellStartedEdit: !!cellStartedEdit, onKeyDown: cellCtrl?.onKeyDown.bind(cellCtrl), stopEditing: (suppressNavigateAfterEdit) => { editSvc.stopEditing(position, { source: batchEdit ? "ui" : "api", suppressNavigateAfterEdit }); _destroyEditor(beans, position, {}); }, eGridCell: cellCtrl?.eGui, parseValue: (newValue) => valueSvc.parseValue(agColumn, rowNode, newValue, cellCtrl?.value), formatValue: cellCtrl?.formatValue.bind(cellCtrl), validate: () => { editSvc?.validateEdit(); } }); } function _purgeUnchangedEdits(beans, includeEditing) { const { editModelSvc } = beans; editModelSvc?.getEditMap().forEach((editRow, rowNode) => { editRow.forEach((edit, column) => { if (!includeEditing && (edit.state === "editing" || edit.pendingValue === UNEDITED)) { return; } if (!_sourceAndPendingDiffer(edit) && (edit.state !== "editing" || includeEditing)) { editModelSvc?.removeEdits({ rowNode, column }); } }); }); } function _refreshEditorOnColDefChanged(beans, cellCtrl) { const editor = cellCtrl.comp?.getCellEditor(); if (!editor?.refresh) { return; } const { eventKey, cellStartedEdit } = cellCtrl.editCompDetails.params; const { column } = cellCtrl; const editorParams = _createEditorParams(beans, cellCtrl, eventKey, cellStartedEdit); const colDef = column.getColDef(); const compDetails = _getCellEditorDetails(beans.userCompFactory, colDef, editorParams); editor.refresh(checkAndPreventDefault(compDetails.params, eventKey)); } function checkAndPreventDefault(params, event) { if (event instanceof KeyboardEvent && params.column.getColDef().cellEditor === "agNumberCellEditor") { params.suppressPreventDefault = ["-", "+", ".", "e"].includes(event?.key ?? "") || params.suppressPreventDefault; } else { event?.preventDefault?.(); } return params; } function _syncFromEditors(beans, params) { for (const cellId of beans.editModelSvc?.getEditPositions() ?? []) { const cellCtrl = _getCellCtrl(beans, cellId); if (!cellCtrl) { continue; } const editor = cellCtrl.comp?.getCellEditor(); if (!editor) { continue; } const { editorValue, editorValueExists, isCancelAfterEnd } = _valueFromEditor(beans, editor, params); if (isCancelAfterEnd) { const { cellStartedEditing, cellStoppedEditing } = beans.editModelSvc?.getEdit(cellId)?.editorState || {}; beans.editModelSvc?.setEdit(cellId, { editorState: { isCancelAfterEnd, cellStartedEditing, cellStoppedEditing } }); } _syncFromEditor(beans, cellId, editorValue, void 0, !editorValueExists, params); } } function _syncFromEditor(beans, position, editorValue, _source, valueSameAsSource, params) { const { editModelSvc, valueSvc } = beans; if (!editModelSvc) { return; } const { rowNode, column } = position; if (!(rowNode && column)) { return; } let edit = editModelSvc.getEdit(position); if (edit?.sourceValue === void 0) { const pendingValue = edit ? getNormalisedFormula(beans, edit.editorValue, false, column) : UNEDITED; const editValue = { sourceValue: valueSvc.getValue(column, rowNode, "data"), pendingValue }; if (params?.persist) { editValue.state = "changed"; } edit = editModelSvc.setEdit(position, editValue); } editModelSvc.setEdit(position, { editorValue: valueSameAsSource ? getNormalisedFormula(beans, edit.sourceValue, true, column) : editorValue }); if (params?.persist) { _persistEditorValue(beans, position); } } function getNormalisedFormula(beans, value, forEditing, column) { const { formula } = beans; if (column.isAllowFormula() && formula?.isFormula(value)) { return formula?.normaliseFormula(value, forEditing) ?? value; } return value; } function _persistEditorValue(beans, position) { const { editModelSvc } = beans; const edit = editModelSvc?.getEdit(position); const pendingValue = getNormalisedFormula(beans, edit?.editorValue, false, position.column); const editValue = { pendingValue }; if (!edit?.editorState?.cellStoppedEditing && edit?.state !== "editing") { editValue.state = "changed"; } editModelSvc?.setEdit(position, editValue); } function _destroyEditors(beans, edits, params = {}) { if (!edits) { edits = beans.editModelSvc?.getEditPositions(); } if (edits) { for (const cellPosition of edits) { _destroyEditor(beans, cellPosition, params); } } } function _destroyEditor(beans, position, params, cellCtrl = _getCellCtrl(beans, position)) { const editModelSvc = beans.editModelSvc; const edit = editModelSvc?.getEdit(position); let state; if (edit && edit.state !== "editing" && edit.editorState?.cellStoppedEditing) { state = edit.state; } else { state = "changed"; } if (!cellCtrl) { if (edit) { editModelSvc?.setEdit(position, { state }); } return; } const comp = cellCtrl.comp; const cellEditor = comp?.getCellEditor(); if (comp && !cellEditor) { cellCtrl?.refreshCell(); if (edit) { editModelSvc?.setEdit(position, { state }); const args = beans.gos.get("enableGroupEdit") ? _enabledGroupEditStoppedArgs(edit, params?.cancel) : { valueChanged: false, newValue: void 0, oldValue: edit.sourceValue }; dispatchEditingStopped(beans, position, args, params); } return; } if (_hasValidationRules(beans)) { const errorMessages = edit && cellEditor?.getValidationErrors?.(); const cellValidationModel = editModelSvc?.getCellValidationModel(); if (errorMessages?.length) { cellValidationModel?.setCellValidation(position, { errorMessages }); } else { cellValidationModel?.clearCellValidation(position); } } if (edit) { editModelSvc?.setEdit(position, { state }); } comp?.setEditDetails(); comp?.refreshEditStyles(false, false); cellCtrl?.refreshCell({ force: true, suppressFlash: true }); const latest = editModelSvc?.getEdit(position); if (latest && latest.state !== "editing") { const cancel = params?.cancel; const args = beans.gos.get("enableGroupEdit") ? _enabledGroupEditStoppedArgs(latest, cancel) : _cellEditStoppedArgs(latest, edit, cancel); dispatchEditingStopped(beans, position, args, params); } } function _enabledGroupEditStoppedArgs(latest, cancel) { const { sourceValue, pendingValue } = latest; let newValue; if (!cancel && pendingValue !== UNEDITED) { newValue = pendingValue; } return { valueChanged: !cancel && _sourceAndPendingDiffer(latest), newValue, oldValue: sourceValue, value: sourceValue }; } function _cellEditStoppedArgs(latest, edit, cancel) { if (cancel || latest.editorState.isCancelAfterEnd) { return { valueChanged: false, newValue: void 0, oldValue: latest.sourceValue }; } let newValue = latest.editorValue; if (newValue == null || newValue === UNEDITED) { newValue = edit?.pendingValue; } if (newValue === UNEDITED) { newValue = void 0; } return { valueChanged: _sourceAndPendingDiffer(latest), newValue, oldValue: latest.sourceValue }; } function dispatchEditingStopped(beans, position, args, { silent, event } = {}) { const { editSvc, editModelSvc } = beans; const latest = editModelSvc?.getEdit(position); const { editorState } = latest || {}; const { isCancelBeforeStart, cellStartedEditing, cellStoppedEditing } = editorState || {}; if (!silent && !isCancelBeforeStart && cellStartedEditing && !cellStoppedEditing) { editSvc?.dispatchCellEvent(position, event, "cellEditingStopped", args); editModelSvc?.setEdit(position, { editorState: { cellStoppedEditing: true } }); } } function _columnDefsRequireValidation(columnDefs) { if (!columnDefs) { return false; } for (let i = 0, len = columnDefs.length; i < len; ++i) { const colDef = columnDefs[i]; const params = colDef.cellEditorParams; if (!params || !colDef.editable && !colDef.groupRowEditable) { continue; } if (params.minLength !== void 0 || params.maxLength !== void 0 || params.getValidationErrors !== void 0 || params.min !== void 0 || params.max !== void 0) { return true; } } return false; } function _editorsRequireValidation(beans) { const ctrls = beans.rowRenderer.getCellCtrls(); for (let i = 0, len = ctrls.length; i < len; ++i) { const ctrl = ctrls[i]; const cellEditor = ctrl.comp?.getCellEditor(); if (cellEditor) { const editor = _unwrapUserComp(cellEditor); if (editor.getValidationElement || editor.getValidationErrors) { return true; } } } return false; } function _hasValidationRules(beans) { return !!beans.gos.get("getFullRowEditValidationErrors") || _columnDefsRequireValidation(beans.colModel.getColumnDefs()) || _editorsRequireValidation(beans); } function _populateModelValidationErrors(beans, force) { if (!(force || _hasValidationRules(beans))) { return; } const cellValidationModel = new EditCellValidationModel(); const { ariaAnnounce, localeSvc, editModelSvc, gos } = beans; const includeRows = gos.get("editType") === "fullRow"; const translate = _getLocaleTextFunc(localeSvc); const ariaValidationErrorPrefix = translate("ariaValidationErrorPrefix", "Cell Editor Validation"); const rowCtrlSet = /* @__PURE__ */ new Set(); for (const ctrl of beans.rowRenderer.getCellCtrls()) { const cellEditorComp = ctrl.comp?.getCellEditor(); if (!cellEditorComp) { continue; } const editor = _unwrapUserComp(cellEditorComp); const { rowNode, column } = ctrl; const errorMessages = editor.getValidationErrors?.() ?? []; const el = editor.getValidationElement?.(false) || !editor.isPopup?.() && ctrl.eGui; if (el) { const isInvalid = errorMessages != null && errorMessages.length > 0; const invalidMessage = isInvalid ? errorMessages.join(". ") : ""; _setAriaInvalid(el, isInvalid); if (isInvalid) { ariaAnnounce.announceValue(`${ariaValidationErrorPrefix} ${errorMessages}`, "editorValidation"); } if (el instanceof HTMLInputElement) { el.setCustomValidity(invalidMessage); } else { el.classList.toggle("invalid", isInvalid); } } if (errorMessages?.length > 0) { cellValidationModel.setCellValidation( { rowNode, column }, { errorMessages } ); } rowCtrlSet.add(ctrl.rowCtrl); } _syncFromEditors(beans, { persist: false }); editModelSvc?.setCellValidationModel(cellValidationModel); if (includeRows) { const rowValidations = _generateRowValidationErrors(beans); editModelSvc?.setRowValidationModel(rowValidations); } for (const rowCtrl of rowCtrlSet.values()) { rowCtrl.rowEditStyleFeature?.applyRowStyles(); for (const cellCtrl of rowCtrl.getAllCellCtrls()) { cellCtrl.tooltipFeature?.refreshTooltip(true); cellCtrl.editorTooltipFeature?.refreshTooltip(true); cellCtrl.editStyleFeature?.applyCellStyles?.(); } } } var _generateRowValidationErrors = (beans) => { const rowValidationModel = new EditRowValidationModel(); const getFullRowEditValidationErrors = beans.gos.get("getFullRowEditValidationErrors"); const editMap = beans.editModelSvc?.getEditMap(); if (!editMap) { return rowValidationModel; } for (const rowNode of editMap.keys()) { const rowEditMap = editMap.get(rowNode); if (!rowEditMap) { continue; } const editorsState = []; const { rowIndex, rowPinned } = rowNode; for (const column of rowEditMap.keys()) { const editValue = rowEditMap.get(column); if (!editValue) { continue; } const { editorValue, pendingValue, sourceValue } = editValue; const newValue = editorValue ?? (pendingValue === UNEDITED ? void 0 : pendingValue) ?? sourceValue; editorsState.push({ column, colId: column.getColId(), rowIndex, rowPinned, oldValue: sourceValue, newValue }); } const errorMessages = getFullRowEditValidationErrors?.({ editorsState }) ?? []; if (errorMessages.length > 0) { rowValidationModel.setRowValidation( { rowNode }, { errorMessages } ); } } return rowValidationModel; }; function _validateEdit(beans) { _populateModelValidationErrors(beans, true); const map = beans.editModelSvc?.getCellValidationModel().getCellValidationMap(); if (!map) { return null; } const validations = []; map.forEach((rowValidations, rowNode) => { rowValidations.forEach(({ errorMessages }, column) => { validations.push({ column, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned, messages: errorMessages ?? null }); }); }); return validations; } function _isManualPinnedRow(rowNode) { return !!(rowNode.rowPinned && rowNode.pinnedSibling); } function _getNodesInRangeForSelection(rowModel, float, start, end) { const isTop = float === "top"; if (!start) { return _getNodesInRangeForSelection( rowModel, float, isTop ? rowModel.getPinnedTopRow(0) : rowModel.getPinnedBottomRow(0), end ); } if (!end) { const count = isTop ? rowModel.getPinnedTopRowCount() : rowModel.getPinnedBottomRowCount(); return _getNodesInRangeForSelection( rowModel, float, start, isTop ? rowModel.getPinnedTopRow(count - 1) : rowModel.getPinnedBottomRow(count - 1) ); } let started = false; let finished = false; const range = []; rowModel.forEachPinnedRow(float, (node) => { if (node === start && !started) { started = true; range.push(node); return; } if (started && node === end) { finished = true; range.push(node); return; } if (started && !finished) { range.push(node); } }); return range; } function _createCellEvent(beans, domEvent, eventType, { rowNode, column }, value) { const event = _addGridCommonParams(beans.gos, { type: eventType, node: rowNode, data: rowNode.data, value, column, colDef: column.getColDef(), rowPinned: rowNode.rowPinned, event: domEvent, rowIndex: rowNode.rowIndex }); return event; } function _isDeleteKey(key, alwaysReturnFalseOnBackspace = false) { if (key === KeyCode.DELETE) { return true; } if (!alwaysReturnFalseOnBackspace && key === KeyCode.BACKSPACE) { return _isMacOsUserAgent(); } return false; } var CellKeyboardListenerFeature = class extends BeanStub { constructor(cellCtrl, beans, rowNode, rowCtrl) { super(); this.cellCtrl = cellCtrl; this.rowNode = rowNode; this.rowCtrl = rowCtrl; this.beans = beans; } init() { this.eGui = this.cellCtrl.eGui; } onKeyDown(event) { const key = event.key; if (key === KeyCode.ENTER && isRowNumberCol(this.cellCtrl.column) && this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition, event)) { return; } switch (key) { case KeyCode.ENTER: this.onEnterKeyDown(event); break; case KeyCode.F2: this.onF2KeyDown(event); break; case KeyCode.ESCAPE: this.onEscapeKeyDown(event); break; case KeyCode.TAB: this.onTabKeyDown(event); break; case KeyCode.BACKSPACE: case KeyCode.DELETE: this.onBackspaceOrDeleteKeyDown(key, event); break; case KeyCode.DOWN: case KeyCode.UP: case KeyCode.RIGHT: case KeyCode.LEFT: this.onNavigationKeyDown(event, key); break; } } onNavigationKeyDown(event, key) { const { cellCtrl, beans } = this; if (beans.editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { return; } if (event.shiftKey && cellCtrl.isRangeSelectionEnabled()) { this.onShiftRangeSelect(event); } else { const currentCellPosition = cellCtrl.getFocusedCellPosition(); beans.navigation?.navigateToNextCell(event, key, currentCellPosition, true); } event.preventDefault(); } onShiftRangeSelect(event) { const { rangeSvc, navigation } = this.beans; if (!rangeSvc) { return; } const endCell = rangeSvc.extendLatestRangeInDirection(event); if (!endCell) { return; } if (event.key === KeyCode.LEFT || event.key === KeyCode.RIGHT) { navigation?.ensureColumnVisible(endCell.column); } else { navigation?.ensureRowVisible(endCell.rowIndex); } } onTabKeyDown(event) { this.beans.navigation?.onTabKeyDown(this.cellCtrl, event); } onBackspaceOrDeleteKeyDown(key, event) { const { cellCtrl, beans, rowNode } = this; const { gos, rangeSvc, eventSvc, editSvc } = beans; eventSvc.dispatchEvent({ type: "keyShortcutChangedCellStart" }); if (_isDeleteKey(key, gos.get("enableCellEditingOnBackspace")) && !editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { if (rangeSvc && _isCellSelectionEnabled(gos)) { rangeSvc.clearCellRangeCellValues({ dispatchWrapperEvents: true, wrapperEventSource: "deleteKey" }); } else if (cellCtrl.isCellEditable()) { const deleteValue = beans.valueSvc.getDeleteValue(cellCtrl.column, rowNode); rowNode.setDataValue(cellCtrl.column, deleteValue, "cellClear"); } } else if (!editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { beans.editSvc?.startEditing(cellCtrl, { startedEdit: true, event }); } eventSvc.dispatchEvent({ type: "keyShortcutChangedCellEnd" }); } onEnterKeyDown(event) { const { cellCtrl, beans } = this; const { editSvc, navigation } = beans; const cellEditing = editSvc?.isEditing(cellCtrl, { withOpenEditor: true }); const rowNode = cellCtrl.rowNode; const rowEditing = editSvc?.isRowEditing(rowNode, { withOpenEditor: true }); const startEditingAction = (cellCtrl2) => { const started = editSvc?.startEditing(cellCtrl2, { startedEdit: true, event, source: "edit" }); if (started) { event.preventDefault(); } }; if (cellEditing || rowEditing) { if (this.isCtrlEnter(event)) { editSvc?.applyBulkEdit(cellCtrl, beans?.rangeSvc?.getCellRanges() || []); return; } _populateModelValidationErrors(beans); if (editSvc?.checkNavWithValidation(void 0, event) === "block-stop") { return; } if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { editSvc?.stopEditing(cellCtrl, { event, source: "edit" }); } else if (rowEditing && !cellCtrl.isCellEditable()) { editSvc?.stopEditing({ rowNode }, { event, source: "edit" }); } else { startEditingAction(cellCtrl); } } else if (beans.gos.get("enterNavigatesVertically")) { const key = event.shiftKey ? KeyCode.UP : KeyCode.DOWN; navigation?.navigateToNextCell(null, key, cellCtrl.cellPosition, false); } else { if (editSvc?.hasValidationErrors()) { return; } if (editSvc?.hasValidationErrors(cellCtrl)) { editSvc.revertSingleCellEdit(cellCtrl, true); } startEditingAction(cellCtrl); } } isCtrlEnter(e) { return (e.ctrlKey || e.metaKey) && e.key === KeyCode.ENTER; } onF2KeyDown(event) { const { cellCtrl, beans: { editSvc } } = this; const editing = editSvc?.isEditing(); if (editing) { _populateModelValidationErrors(this.beans); if (editSvc?.checkNavWithValidation(void 0, event) === "block-stop") { return; } } editSvc?.startEditing(cellCtrl, { startedEdit: true, event }); } onEscapeKeyDown(event) { const { cellCtrl, beans: { editSvc } } = this; if (editSvc?.checkNavWithValidation(cellCtrl, event) === "block-stop") { editSvc.revertSingleCellEdit(cellCtrl); } setTimeout(() => { editSvc?.stopEditing(cellCtrl, { event, cancel: true }); }); } processCharacter(event) { const eventTarget = event.target; const eventOnChildComponent = eventTarget !== this.eGui; const { beans: { editSvc }, cellCtrl } = this; if (eventOnChildComponent) { return; } if (editSvc?.isEditing(cellCtrl, { withOpenEditor: true })) { return; } const key = event.key; if (key === KeyCode.SPACE) { this.onSpaceKeyDown(event); } else if (editSvc?.isCellEditable(cellCtrl, "ui")) { if (editSvc?.hasValidationErrors() && !editSvc?.hasValidationErrors(cellCtrl)) { return; } editSvc?.startEditing(cellCtrl, { startedEdit: true, event, source: "api", editable: true }); const compDetails = cellCtrl.editCompDetails; const shouldPreventDefault = !compDetails?.params?.suppressPreventDefault; if (shouldPreventDefault) { event.preventDefault(); } } } onSpaceKeyDown(event) { const { gos, editSvc } = this.beans; const { rowNode } = this.cellCtrl; if (!editSvc?.isEditing(this.cellCtrl, { withOpenEditor: true }) && _isRowSelection(gos)) { this.beans.selectionSvc?.handleSelectionEvent(event, rowNode, "spaceKey"); } event.preventDefault(); } }; var CellMouseListenerFeature = class extends BeanStub { constructor(cellCtrl, beans, column) { super(); this.cellCtrl = cellCtrl; this.column = column; this.beans = beans; } onMouseEvent(eventName, mouseEvent) { if (_isStopPropagationForAgGrid(mouseEvent)) { return; } switch (eventName) { case "click": this.onCellClicked(mouseEvent); break; case "pointerdown": case "mousedown": case "touchstart": this.onMouseDown(mouseEvent); break; case "dblclick": this.onCellDoubleClicked(mouseEvent); break; case "mouseout": this.onMouseOut(mouseEvent); break; case "mouseover": this.onMouseOver(mouseEvent); break; } } onCellClicked(event) { if (this.beans.touchSvc?.handleCellDoubleClick(this, event)) { return; } const { eventSvc, rangeSvc, editSvc, editModelSvc, frameworkOverrides, gos } = this.beans; const isMultiKey = event.ctrlKey || event.metaKey; const { cellCtrl } = this; const { column, cellPosition, rowNode } = cellCtrl; const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column, rowNode, event); if (rangeSvc && isMultiKey && !suppressMouseEvent2) { if (rangeSvc.getCellRangeCount(cellPosition) > 1) { rangeSvc.intersectLastRange(true); } } const cellClickedEvent = cellCtrl.createEvent(event, "cellClicked"); cellClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2; eventSvc.dispatchEvent(cellClickedEvent); const colDef = column.getColDef(); if (colDef.onCellClicked) { window.setTimeout(() => { frameworkOverrides.wrapOutgoing(() => { colDef.onCellClicked(cellClickedEvent); }); }, 0); } if (suppressMouseEvent2) { return; } if (editModelSvc?.getState(cellCtrl) !== "editing") { const editing = editSvc?.isEditing(); const isRangeSelectionEnabledWhileEditing = editSvc?.isRangeSelectionEnabledWhileEditing(); const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0; const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0; if (editing && (isRangeSelectionEnabledWhileEditing || cellValidations > 0 || rowValidations > 0)) { return; } if (editSvc?.shouldStartEditing(cellCtrl, event)) { editSvc?.startEditing(cellCtrl, { event }); } else if (editSvc?.shouldStopEditing(cellCtrl, event)) { if (this.beans.gos.get("editType") === "fullRow") { editSvc?.stopEditing(cellCtrl, { event, source: "edit" }); } else { editSvc?.stopEditing(void 0, { event, source: "edit" }); } } } } onCellDoubleClicked(event) { const { column, beans, cellCtrl } = this; const { eventSvc, frameworkOverrides, editSvc, editModelSvc, gos } = beans; const suppressMouseEvent2 = _suppressCellMouseEvent(gos, cellCtrl.column, cellCtrl.rowNode, event); const colDef = column.getColDef(); const cellDoubleClickedEvent = cellCtrl.createEvent( event, "cellDoubleClicked" ); cellDoubleClickedEvent.isEventHandlingSuppressed = suppressMouseEvent2; eventSvc.dispatchEvent(cellDoubleClickedEvent); if (typeof colDef.onCellDoubleClicked === "function") { window.setTimeout(() => { frameworkOverrides.wrapOutgoing(() => { colDef.onCellDoubleClicked(cellDoubleClickedEvent); }); }, 0); } if (suppressMouseEvent2) { return; } if (editSvc?.shouldStartEditing(cellCtrl, event) && editModelSvc?.getState(cellCtrl) !== "editing") { const editing = editSvc?.isEditing(); const isRangeSelectionEnabledWhileEditing = editSvc?.isRangeSelectionEnabledWhileEditing(); const cellValidations = editModelSvc?.getCellValidationModel().getCellValidationMap().size ?? 0; const rowValidations = editModelSvc?.getRowValidationModel().getRowValidationMap().size ?? 0; if (editing && (isRangeSelectionEnabledWhileEditing || cellValidations > 0 || rowValidations > 0)) { return; } editSvc?.startEditing(cellCtrl, { event }); } } onMouseDown(mouseEvent) { const { shiftKey } = mouseEvent; const target = mouseEvent.target; const { cellCtrl, beans } = this; const { eventSvc, rangeSvc, rowNumbersSvc, focusSvc, gos, editSvc } = beans; const { column, rowNode, cellPosition } = cellCtrl; const suppressMouseEvent2 = _suppressCellMouseEvent(gos, column, rowNode, mouseEvent); const fireMouseDownEvent = () => { const cellMouseDownEvent = cellCtrl.createEvent(mouseEvent, "cellMouseDown"); cellMouseDownEvent.isEventHandlingSuppressed = suppressMouseEvent2; eventSvc.dispatchEvent(cellMouseDownEvent); }; if (suppressMouseEvent2) { fireMouseDownEvent(); return; } if (this.isRightClickInExistingRange(mouseEvent)) { return; } const hasRanges = rangeSvc && !rangeSvc.isEmpty(); const containsWidget = this.containsWidget(target); const isRowNumberColumn = isRowNumberCol(column); if (rowNumbersSvc && isRowNumberColumn && !rowNumbersSvc.handleMouseDownOnCell(cellPosition, mouseEvent)) { return; } if (!shiftKey || !hasRanges) { const editing = editSvc?.isEditing(cellCtrl); const isEnableCellTextSelection = gos.get("enableCellTextSelection"); const shouldFocus = isEnableCellTextSelection && mouseEvent.defaultPrevented; const forceBrowserFocus = (_isBrowserSafari() || shouldFocus) && !editing && !_isFocusableFormField(target) && !containsWidget; cellCtrl.focusCell(forceBrowserFocus, mouseEvent); } if (shiftKey && hasRanges && !focusSvc.isCellFocused(cellPosition)) { mouseEvent.preventDefault(); const focusedCell = focusSvc.getFocusedCell(); if (focusedCell) { const { column: column2, rowIndex, rowPinned } = focusedCell; const allowRangesWhileEditing = !!editSvc?.isRangeSelectionEnabledWhileEditing?.(); if (editSvc?.isEditing(focusedCell) && !allowRangesWhileEditing) { editSvc?.stopEditing(focusedCell); } if (!allowRangesWhileEditing) { focusSvc.setFocusedCell({ column: column2, rowIndex, rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: true, sourceEvent: mouseEvent }); } } } if (containsWidget) { return; } rangeSvc?.handleCellMouseDown(mouseEvent, cellPosition); fireMouseDownEvent(); } isRightClickInExistingRange(mouseEvent) { const { rangeSvc } = this.beans; if (rangeSvc) { const cellInRange = rangeSvc.isCellInAnyRange(this.cellCtrl.cellPosition); const isRightClick = _interpretAsRightClick(this.beans, mouseEvent); if (cellInRange && isRightClick) { return true; } } return false; } containsWidget(target) { return _isElementChildOfClass(target, "ag-selection-checkbox", 3) || _isElementChildOfClass(target, "ag-drag-handle", 3); } onMouseOut(mouseEvent) { if (this.mouseStayingInsideCell(mouseEvent)) { return; } const { eventSvc, colHover } = this.beans; eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, "cellMouseOut")); colHover?.clearMouseOver(); } onMouseOver(mouseEvent) { if (this.mouseStayingInsideCell(mouseEvent)) { return; } const { eventSvc, colHover } = this.beans; eventSvc.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, "cellMouseOver")); colHover?.setMouseOver([this.column]); } mouseStayingInsideCell(e) { if (!e.target || !e.relatedTarget) { return false; } const eCell = this.cellCtrl.eGui; const cellContainsTarget = eCell.contains(e.target); const cellContainsRelatedTarget = eCell.contains(e.relatedTarget); return cellContainsTarget && cellContainsRelatedTarget; } }; var CellPositionFeature = class extends BeanStub { constructor(cellCtrl, beans) { super(); this.cellCtrl = cellCtrl; this.beans = beans; this.column = cellCtrl.column; this.rowNode = cellCtrl.rowNode; } setupRowSpan() { this.rowSpan = this.column.getRowSpan(this.rowNode); this.addManagedListeners(this.beans.eventSvc, { newColumnsLoaded: () => this.onNewColumnsLoaded() }); } init() { this.eSetLeft = this.cellCtrl.getRootElement(); this.eContent = this.cellCtrl.eGui; const cellSpan = this.cellCtrl.getCellSpan(); if (!cellSpan) { this.setupColSpan(); this.setupRowSpan(); } this.onLeftChanged(); this.onWidthChanged(); if (!cellSpan) { this._legacyApplyRowSpan(); } if (cellSpan) { const refreshSpanHeight = this.refreshSpanHeight.bind(this, cellSpan); refreshSpanHeight(); this.addManagedListeners(this.beans.eventSvc, { paginationChanged: refreshSpanHeight, recalculateRowBounds: refreshSpanHeight, pinnedHeightChanged: refreshSpanHeight }); } } refreshSpanHeight(cellSpan) { const spanHeight = cellSpan.getCellHeight(); if (spanHeight != null) { this.eContent.style.height = `${spanHeight}px`; } } onNewColumnsLoaded() { const rowSpan = this.column.getRowSpan(this.rowNode); if (this.rowSpan === rowSpan) { return; } this.rowSpan = rowSpan; this._legacyApplyRowSpan(true); } onDisplayColumnsChanged() { const colsSpanning = this.getColSpanningList(); if (!_areEqual(this.colsSpanning, colsSpanning)) { this.colsSpanning = colsSpanning; this.onWidthChanged(); this.onLeftChanged(); } } setupColSpan() { if (this.column.getColDef().colSpan == null) { return; } this.colsSpanning = this.getColSpanningList(); this.addManagedListeners(this.beans.eventSvc, { // because we are col spanning, a reorder of the cols can change what cols we are spanning over displayedColumnsChanged: this.onDisplayColumnsChanged.bind(this), // because we are spanning over multiple cols, we check for width any time any cols width changes. // this is expensive - really we should be explicitly checking only the cols we are spanning over // instead of every col, however it would be tricky code to track the cols we are spanning over, so // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code. displayedColumnsWidthChanged: this.onWidthChanged.bind(this) }); } onWidthChanged() { if (!this.eContent) { return; } const width = this.getCellWidth(); this.eContent.style.width = `${width}px`; } getCellWidth() { if (!this.colsSpanning) { return this.column.getActualWidth(); } return this.colsSpanning.reduce((width, col) => width + col.getActualWidth(), 0); } getColSpanningList() { const { column, rowNode } = this; const colSpan = column.getColSpan(rowNode); const colsSpanning = []; if (colSpan === 1) { colsSpanning.push(column); } else { let pointer = column; const pinned = column.getPinned(); for (let i = 0; pointer && i < colSpan; i++) { colsSpanning.push(pointer); pointer = this.beans.visibleCols.getColAfter(pointer); if (!pointer || _missing(pointer)) { break; } if (pinned !== pointer.getPinned()) { break; } } } return colsSpanning; } onLeftChanged() { if (!this.eSetLeft) { return; } const left = this.modifyLeftForPrintLayout(this.getCellLeft()); this.eSetLeft.style.left = left + "px"; } getCellLeft() { let mostLeftCol; if (this.beans.gos.get("enableRtl") && this.colsSpanning) { mostLeftCol = _last(this.colsSpanning); } else { mostLeftCol = this.column; } return mostLeftCol.getLeft(); } modifyLeftForPrintLayout(leftPosition) { if (!this.cellCtrl.printLayout || this.column.getPinned() === "left") { return leftPosition; } const { visibleCols } = this.beans; const leftWidth = visibleCols.getColsLeftWidth(); if (this.column.getPinned() === "right") { const bodyWidth = visibleCols.bodyWidth; return leftWidth + bodyWidth + (leftPosition || 0); } return leftWidth + (leftPosition || 0); } _legacyApplyRowSpan(force) { if (this.rowSpan === 1 && !force) { return; } const singleRowHeight = _getRowHeightAsNumber(this.beans); const totalRowHeight = singleRowHeight * this.rowSpan; this.eContent.style.height = `${totalRowHeight}px`; this.eContent.style.zIndex = "1"; } // overriding to make public, as we don't dispose this bean via context destroy() { super.destroy(); } }; var CSS_CELL = "ag-cell"; var CSS_AUTO_HEIGHT = "ag-cell-auto-height"; var CSS_NORMAL_HEIGHT = "ag-cell-normal-height"; var CSS_CELL_FOCUS = "ag-cell-focus"; var CSS_CELL_FIRST_RIGHT_PINNED = "ag-cell-first-right-pinned"; var CSS_CELL_LAST_LEFT_PINNED = "ag-cell-last-left-pinned"; var CSS_CELL_NOT_INLINE_EDITING = "ag-cell-not-inline-editing"; var CSS_CELL_WRAP_TEXT = "ag-cell-wrap-text"; var instanceIdSequence4 = 0; var CellCtrl = class extends BeanStub { constructor(column, rowNode, beans, rowCtrl) { super(); this.column = column; this.rowNode = rowNode; this.rowCtrl = rowCtrl; this.rangeFeature = void 0; this.rowResizeFeature = void 0; this.positionFeature = void 0; this.customStyleFeature = void 0; this.editStyleFeature = void 0; this.mouseListener = void 0; this.keyboardListener = void 0; this.suppressRefreshCell = false; this.onCompAttachedFuncs = []; this.onEditorAttachedFuncs = []; this.focusEventWhileNotReady = null; this.hasBeenFocused = false; this.hasEdit = false; this.tooltipFeature = void 0; this.editorTooltipFeature = void 0; this.beans = beans; this.gos = beans.gos; this.editSvc = beans.editSvc; this.hasEdit = !!beans.editSvc; const { colId } = column; this.instanceId = colId + "-" + instanceIdSequence4++; this.createCellPosition(); this.updateAndFormatValue(false); } addFeatures() { const { beans } = this; this.positionFeature = new CellPositionFeature(this, beans); this.customStyleFeature = beans.cellStyles?.createCellCustomStyleFeature(this); this.editStyleFeature = beans.editSvc?.createCellStyleFeature(this); this.mouseListener = new CellMouseListenerFeature(this, beans, this.column); this.keyboardListener = new CellKeyboardListenerFeature(this, beans, this.rowNode, this.rowCtrl); this.enableTooltipFeature(); const { rangeSvc } = beans; const cellSelectionEnabled = rangeSvc && _isCellSelectionEnabled(beans.gos); if (cellSelectionEnabled) { this.rangeFeature = rangeSvc.createCellRangeFeature(this); } if (isRowNumberCol(this.column)) { this.rowResizeFeature = this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this); } } isCellSpanning() { return false; } getCellSpan() { return void 0; } removeFeatures() { const context = this.beans.context; this.positionFeature = context.destroyBean(this.positionFeature); this.editorTooltipFeature = context.destroyBean(this.editorTooltipFeature); this.customStyleFeature = context.destroyBean(this.customStyleFeature); this.editStyleFeature = context.destroyBean(this.editStyleFeature); this.mouseListener = context.destroyBean(this.mouseListener); this.keyboardListener = context.destroyBean(this.keyboardListener); this.rangeFeature = context.destroyBean(this.rangeFeature); this.rowResizeFeature = context.destroyBean(this.rowResizeFeature); this.disableTooltipFeature(); } enableTooltipFeature(value, shouldDisplayTooltip) { this.tooltipFeature = this.beans.tooltipSvc?.enableCellTooltipFeature(this, value, shouldDisplayTooltip); } disableTooltipFeature() { this.tooltipFeature = this.beans.context.destroyBean(this.tooltipFeature); } enableEditorTooltipFeature(editor) { if (this.editorTooltipFeature) { this.disableEditorTooltipFeature(); } this.editorTooltipFeature = this.beans.tooltipSvc?.setupCellEditorTooltip(this, editor); _populateModelValidationErrors(this.beans); } disableEditorTooltipFeature() { this.editorTooltipFeature = this.beans.context.destroyBean(this.editorTooltipFeature); } setComp(comp, eCell, _eWrapper, eCellWrapper, printLayout, startEditing, compBean) { this.comp = comp; this.eGui = eCell; this.printLayout = printLayout; compBean ?? (compBean = this); this.addDomData(compBean); this.addFeatures(); compBean.addDestroyFunc(() => this.removeFeatures()); this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")); this.setupFocus(); this.applyStaticCssClasses(); this.setWrapText(); this.onFirstRightPinnedChanged(); this.onLastLeftPinnedChanged(); this.onColumnHover(); this.setupControlComps(); this.setupAutoHeight(eCellWrapper, compBean); this.refreshFirstAndLastStyles(); this.checkFormulaError(); this.refreshAriaRowIndex(); this.refreshAriaColIndex(); this.positionFeature?.init(); this.customStyleFeature?.setComp(comp); this.editStyleFeature?.setComp(comp); this.tooltipFeature?.refreshTooltip(); this.keyboardListener?.init(); this.rangeFeature?.setComp(comp); this.rowResizeFeature?.refreshRowResizer(); const editable = startEditing ? this.isCellEditable() : void 0; const continuingEdit = !editable && this.hasEdit && this.editSvc?.isEditing(this, { withOpenEditor: true }); if (editable || continuingEdit) { this.editSvc?.startEditing(this, { startedEdit: false, source: "api", silent: true, continueEditing: true, editable }); } else { this.showValue(false, true); } if (this.onCompAttachedFuncs.length) { for (const func of this.onCompAttachedFuncs) { func(); } this.onCompAttachedFuncs = []; } } checkFormulaError() { const isFormulaError = !!this.beans.formula?.getFormulaError(this.column, this.rowNode); this.eGui.classList.toggle("formula-error", isFormulaError); } setupAutoHeight(eCellWrapper, compBean) { this.isAutoHeight = this.beans.rowAutoHeight?.setupCellAutoHeight(this, eCellWrapper, compBean) ?? false; } getCellAriaRole() { return this.column.getColDef().cellAriaRole ?? "gridcell"; } isCellRenderer() { const colDef = this.column.getColDef(); return colDef.cellRenderer != null || colDef.cellRendererSelector != null; } getValueToDisplay() { return this.valueFormatted ?? this.value; } getDeferLoadingCellRenderer() { const { beans, column } = this; const { userCompFactory, ctrlsSvc, eventSvc } = beans; const colDef = column.getColDef(); const params = this.createCellRendererParams(); params.deferRender = true; const loadingDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params); if (ctrlsSvc.getGridBodyCtrl()?.scrollFeature?.isScrolling()) { let resolver; const onReady = new AgPromise((resolve) => { resolver = resolve; }); const [removeBodyScrollEnd] = this.addManagedListeners(eventSvc, { bodyScrollEnd: () => { resolver(); removeBodyScrollEnd(); } }); return { loadingComp: loadingDetails, onReady }; } return { loadingComp: loadingDetails, onReady: AgPromise.resolve() }; } showValue(forceNewCellRendererInstance, skipRangeHandleRefresh) { const { beans, column, rowNode, rangeFeature } = this; const { userCompFactory } = beans; let valueToDisplay = this.getValueToDisplay(); let compDetails; const isSsrmLoading = rowNode.stub && rowNode.groupData?.[column.getId()] == null; const colDef = column.getColDef(); if (isSsrmLoading || this.isCellRenderer()) { const params = this.createCellRendererParams(); if (!isSsrmLoading || isRowNumberCol(column)) { compDetails = _getCellRendererDetails(userCompFactory, colDef, params); } else { compDetails = _getLoadingCellRendererDetails(userCompFactory, colDef, params); } } if (!compDetails && !isSsrmLoading && beans.findSvc?.isMatch(rowNode, column)) { const params = this.createCellRendererParams(); compDetails = _getCellRendererDetails( userCompFactory, { ...column.getColDef(), cellRenderer: "agFindCellRenderer" }, params ); } if (this.hasEdit && this.editSvc.isBatchEditing() && this.editSvc.isRowEditing(rowNode, { checkSiblings: true })) { const result = this.editSvc.prepDetailsDuringBatch(this, { compDetails, valueToDisplay }); if (result) { if (result.compDetails) { compDetails = result.compDetails; } else if (result.valueToDisplay) { valueToDisplay = result.valueToDisplay; } } } this.comp.setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance); this.customRowDragComp?.refreshVisibility(); if (!skipRangeHandleRefresh && rangeFeature) { _requestAnimationFrame(beans, () => rangeFeature?.refreshRangeStyleAndHandle()); } this.rowResizeFeature?.refreshRowResizer(); } setupControlComps() { const colDef = this.column.getColDef(); this.includeSelection = this.isIncludeControl(this.isCheckboxSelection(colDef), true); this.includeRowDrag = this.isIncludeControl(colDef.rowDrag); this.includeDndSource = this.isIncludeControl(colDef.dndSource); this.comp.setIncludeSelection(this.includeSelection); this.comp.setIncludeDndSource(this.includeDndSource); this.comp.setIncludeRowDrag(this.includeRowDrag); } isForceWrapper() { return this.beans.gos.get("enableCellTextSelection") || this.column.isAutoHeight(); } getCellValueClass() { const prefix = "ag-cell-value"; const isCheckboxRenderer = this.column.getColDef().cellRenderer === "agCheckboxCellRenderer"; let suffix = ""; if (isCheckboxRenderer) { suffix = " ag-allow-overflow"; } return `${prefix}${suffix}`; } /** * Wrapper providing general conditions under which control elements (e.g. checkboxes and drag handles) * are rendered for a particular cell. * @param value Whether to render the control in the specific context of the caller * @param allowManuallyPinned Whether manually pinned rows are permitted this form of control element */ // eslint-disable-next-line @typescript-eslint/ban-types isIncludeControl(value, allowManuallyPinned = false) { const rowUnpinned = this.rowNode.rowPinned == null; return (rowUnpinned || allowManuallyPinned && _isManualPinnedRow(this.rowNode)) && !!value; } isCheckboxSelection(colDef) { const { rowSelection, groupDisplayType } = this.beans.gridOptions; const checkboxLocation = _getCheckboxLocation(rowSelection); const isSelectionColumn = isColumnSelectionCol(this.column); if (groupDisplayType === "custom" && checkboxLocation !== "selectionColumn" && isSelectionColumn) { return false; } return colDef.checkboxSelection || isSelectionColumn && typeof rowSelection === "object" && _getCheckboxes(rowSelection); } refreshShouldDestroy() { const colDef = this.column.getColDef(); const selectionChanged = this.includeSelection != this.isIncludeControl(this.isCheckboxSelection(colDef), true); const rowDragChanged = this.includeRowDrag != this.isIncludeControl(colDef.rowDrag); const dndSourceChanged = this.includeDndSource != this.isIncludeControl(colDef.dndSource); const autoHeightChanged = this.isAutoHeight != this.column.isAutoHeight(); return selectionChanged || rowDragChanged || dndSourceChanged || autoHeightChanged; } onPopupEditorClosed(e) { const { editSvc } = this.beans; if (!editSvc?.isEditing(this, { withOpenEditor: true })) { return; } const isKeyboardEvent = e instanceof KeyboardEvent; const isMouseEvent = e instanceof MouseEvent; const isEscape = isKeyboardEvent && e.key === KeyCode.ESCAPE; editSvc.stopEditing(this, { source: editSvc.isBatchEditing() ? "ui" : "api", cancel: isEscape, event: isKeyboardEvent || isMouseEvent ? e : void 0 }); if (isEscape) { this.focusCell(true, e); } } /** * Ends the Cell Editing * @param cancel `True` if the edit process is being canceled. * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`. */ stopEditing(cancel = false) { const { editSvc } = this.beans; return editSvc?.stopEditing(this, { cancel, source: editSvc?.isBatchEditing() ? "ui" : "api" }) ?? false; } createCellRendererParams() { const { value, valueFormatted, column, rowNode, comp, eGui, beans: { valueSvc, gos, editSvc } } = this; const res = _addGridCommonParams(gos, { value, valueFormatted, getValue: () => valueSvc.getValueForDisplay({ column, node: rowNode, from: "edit" }).value, setValue: (value2) => editSvc?.setDataValue({ rowNode, column }, value2) || rowNode.setDataValue(column, value2), formatValue: this.formatValue.bind(this), data: rowNode.data, node: rowNode, pinned: column.getPinned(), colDef: column.getColDef(), column, refreshCell: this.refreshCell.bind(this), eGridCell: eGui, eParentOfValue: comp.getParentOfValue(), registerRowDragger: (rowDraggerElement, dragStartPixels, value2, suppressVisibilityChange) => this.registerRowDragger(rowDraggerElement, dragStartPixels, suppressVisibilityChange), setTooltip: (value2, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); if (this.tooltipFeature) { this.disableTooltipFeature(); } this.enableTooltipFeature(value2, shouldDisplayTooltip); this.tooltipFeature?.refreshTooltip(); } }); return res; } onCellChanged(event) { const eventImpactsThisCell = event.column === this.column; if (eventImpactsThisCell) { this.refreshCell(); } } refreshOrDestroyCell(params) { if (this.refreshShouldDestroy()) { this.rowCtrl?.recreateCell(this); } else { this.refreshCell(params); } if (this.hasEdit && this.editCompDetails) { const { editSvc, comp } = this; if (!comp?.getCellEditor() && editSvc.isEditing(this, { withOpenEditor: true })) { editSvc.startEditing(this, { startedEdit: false, source: "api", silent: true }); } } } // + stop editing {force: true, suppressFlash: true} // + event cellChanged {} // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update} // + rowCtrl: api refreshCells() {animate: true/false} // + rowRenderer: api softRefreshView() {} refreshCell(params) { const { editStyleFeature, customStyleFeature, rowCtrl: { rowEditStyleFeature }, beans: { cellFlashSvc, filterManager }, column, comp, suppressRefreshCell, tooltipFeature } = this; if (suppressRefreshCell) { return; } const { field, valueGetter, showRowGroup, enableCellChangeFlash } = column.getColDef(); const noValueProvided = field == null && valueGetter == null && showRowGroup == null; const newData = params?.newData ?? false; const forceRefresh = noValueProvided || params && (params.force || newData); const isCellCompReady = !!comp; const valuesDifferent = this.updateAndFormatValue(isCellCompReady); const dataNeedsUpdating = forceRefresh || valuesDifferent; if (!isCellCompReady) { return; } if (dataNeedsUpdating) { this.showValue(!!newData, false); const processingFilterChange = filterManager?.isSuppressFlashingCellsBecauseFiltering(); const flashCell = !params?.suppressFlash && !processingFilterChange && enableCellChangeFlash; if (flashCell) { cellFlashSvc?.flashCell(this); } editStyleFeature?.applyCellStyles?.(); customStyleFeature?.applyUserStyles(); customStyleFeature?.applyClassesFromColDef(); rowEditStyleFeature?.applyRowStyles(); this.checkFormulaError(); } tooltipFeature?.refreshTooltip(); customStyleFeature?.applyCellClassRules(); } isCellEditable() { return this.column.isCellEditable(this.rowNode); } formatValue(value) { return this.callValueFormatter(value) ?? value; } callValueFormatter(value) { return this.beans.valueSvc.formatValue(this.column, this.rowNode, value); } updateAndFormatValue(compareValues) { const oldValue = this.value; const oldValueFormatted = this.valueFormatted; const { value, valueFormatted } = this.beans.valueSvc.getValueForDisplay({ column: this.column, node: this.rowNode, includeValueFormatted: true, from: "edit" }); this.value = value; this.valueFormatted = valueFormatted; if (compareValues) { return !this.valuesAreEqual(oldValue, this.value) || this.valueFormatted != oldValueFormatted; } return true; } valuesAreEqual(val1, val2) { const colDef = this.column.getColDef(); return colDef.equals ? colDef.equals(val1, val2) : val1 === val2; } addDomData(compBean) { const element = this.eGui; _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, this); compBean.addDestroyFunc(() => _setDomData(this.beans.gos, element, DOM_DATA_KEY_CELL_CTRL, null)); } createEvent(domEvent, eventType) { const { rowNode, column, value, beans } = this; return _createCellEvent(beans, domEvent, eventType, { rowNode, column }, value); } processCharacter(event) { this.keyboardListener?.processCharacter(event); } onKeyDown(event) { this.keyboardListener?.onKeyDown(event); } onMouseEvent(eventName, mouseEvent) { this.mouseListener?.onMouseEvent(eventName, mouseEvent); } getColSpanningList() { return this.positionFeature?.getColSpanningList() ?? []; } onLeftChanged() { if (!this.comp) { return; } this.positionFeature?.onLeftChanged(); } onDisplayedColumnsChanged() { if (!this.eGui) { return; } this.refreshAriaColIndex(); this.refreshFirstAndLastStyles(); } refreshFirstAndLastStyles() { const { comp, column, beans } = this; refreshFirstAndLastStyles(comp, column, beans.visibleCols); } refreshAriaColIndex() { const colIdx = this.beans.visibleCols.getAriaColIndex(this.column); _setAriaColIndex(this.eGui, colIdx); } onWidthChanged() { return this.positionFeature?.onWidthChanged(); } getRowPosition() { const { rowIndex, rowPinned } = this.cellPosition; return { rowIndex, rowPinned }; } updateRangeBordersIfRangeCount() { if (!this.comp) { return; } this.rangeFeature?.updateRangeBordersIfRangeCount(); } onCellSelectionChanged() { if (!this.comp) { return; } this.rangeFeature?.onCellSelectionChanged(); } isRangeSelectionEnabled() { return this.rangeFeature != null; } focusCell(forceBrowserFocus = false, sourceEvent) { const allowedTarget = this.editSvc?.allowedFocusTargetOnValidation(this); if (allowedTarget && allowedTarget !== this) { return; } this.beans.focusSvc.setFocusedCell({ ...this.getFocusedCellPosition(), forceBrowserFocus, sourceEvent }); } /** * Restores focus to the cell, if it should have it * @param waitForRender if the cell has just setComp, it may not be rendered yet, so we wait for the next render */ restoreFocus(waitForRender = false) { const { beans: { editSvc, focusSvc }, comp } = this; if (!comp || editSvc?.isEditing(this) || !this.isCellFocused() || !focusSvc.shouldTakeFocus()) { return; } const focus = () => { if (!this.isAlive()) { return; } const focusableElement = comp.getFocusableElement(); if (this.isCellFocused()) { focusableElement.focus({ preventScroll: true }); } }; if (waitForRender) { setTimeout(focus, 0); return; } focus(); } onRowIndexChanged() { this.createCellPosition(); this.refreshAriaRowIndex(); this.onCellFocused(); this.restoreFocus(); this.rangeFeature?.onCellSelectionChanged(); this.rowResizeFeature?.refreshRowResizer(); } onSuppressCellFocusChanged(suppressCellFocus) { const element = this.eGui; if (!element) { return; } _addOrRemoveAttribute(element, "tabindex", suppressCellFocus ? void 0 : -1); } onFirstRightPinnedChanged() { if (!this.comp) { return; } const firstRightPinned = this.column.isFirstRightPinned(); this.comp.toggleCss(CSS_CELL_FIRST_RIGHT_PINNED, firstRightPinned); } onLastLeftPinnedChanged() { if (!this.comp) { return; } const lastLeftPinned = this.column.isLastLeftPinned(); this.comp.toggleCss(CSS_CELL_LAST_LEFT_PINNED, lastLeftPinned); } /** * Returns whether cell is focused by the focusSvc, overridden by spannedCellCtrl */ checkCellFocused() { return this.beans.focusSvc.isCellFocused(this.cellPosition); } isCellFocused() { const isFocused = this.checkCellFocused(); this.hasBeenFocused || (this.hasBeenFocused = isFocused); return isFocused; } setupFocus() { this.restoreFocus(true); this.onCellFocused(this.focusEventWhileNotReady ?? void 0); } onCellFocused(event) { const { beans } = this; if (_isCellFocusSuppressed(beans)) { return; } if (!this.comp) { if (event) { this.focusEventWhileNotReady = event; } return; } const cellFocused = this.isCellFocused(); const editing = beans.editSvc?.isEditing(this) ?? false; this.comp.toggleCss(CSS_CELL_FOCUS, cellFocused); if (cellFocused && (event?.forceBrowserFocus || !this.hasBrowserFocus() && this.beans.focusSvc.shouldTakeFocus())) { let focusEl = this.comp.getFocusableElement(); if (editing) { const focusableEls = _findFocusableElements(focusEl, null, true); if (focusableEls.length) { focusEl = focusableEls[0]; } } const preventScroll = event ? event.preventScrollOnBrowserFocus : true; focusEl.focus({ preventScroll }); _placeCaretAtEnd(beans, focusEl); } if (cellFocused && this.focusEventWhileNotReady) { this.focusEventWhileNotReady = null; } if (cellFocused && event) { this.rowCtrl.announceDescription(); } } createCellPosition() { const { rowIndex, rowPinned } = this.rowNode; this.cellPosition = { rowIndex, rowPinned: _makeNull(rowPinned), column: this.column }; } // CSS Classes that only get applied once, they never change applyStaticCssClasses() { const { comp } = this; comp.toggleCss(CSS_CELL, true); comp.toggleCss(CSS_CELL_NOT_INLINE_EDITING, true); const autoHeight = this.column.isAutoHeight() == true; comp.toggleCss(CSS_AUTO_HEIGHT, autoHeight); comp.toggleCss(CSS_NORMAL_HEIGHT, !autoHeight); } onColumnHover() { this.beans.colHover?.onCellColumnHover(this.column, this.comp); } onColDefChanged() { if (!this.comp) { return; } if (this.column.isTooltipEnabled()) { this.disableTooltipFeature(); this.enableTooltipFeature(); } else { this.disableTooltipFeature(); } this.setWrapText(); if (this.editSvc?.isEditing(this)) { this.editSvc?.handleColDefChanged(this); } else { this.refreshOrDestroyCell({ force: true, suppressFlash: true }); } } setWrapText() { const value = this.column.getColDef().wrapText == true; this.comp.toggleCss(CSS_CELL_WRAP_TEXT, value); } dispatchCellContextMenuEvent(event) { const colDef = this.column.getColDef(); const cellContextMenuEvent = this.createEvent(event, "cellContextMenu"); const { beans } = this; beans.eventSvc.dispatchEvent(cellContextMenuEvent); if (colDef.onCellContextMenu) { window.setTimeout(() => { beans.frameworkOverrides.wrapOutgoing(() => { colDef.onCellContextMenu(cellContextMenuEvent); }); }, 0); } } getCellRenderer() { return this.comp?.getCellRenderer() ?? null; } destroy() { this.onCompAttachedFuncs = []; this.onEditorAttachedFuncs = []; if (this.isCellFocused() && this.hasBrowserFocus()) { this.beans.focusSvc.attemptToRecoverFocus(); } super.destroy(); } hasBrowserFocus() { return this.eGui?.contains(_getActiveDomElement(this.beans)) ?? false; } createSelectionCheckbox() { const cbSelectionComponent = this.beans.selectionSvc?.createCheckboxSelectionComponent(); if (!cbSelectionComponent) { return void 0; } this.beans.context.createBean(cbSelectionComponent); cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column }); return cbSelectionComponent; } createDndSource() { const dndSourceComp = this.beans.registry.createDynamicBean( "dndSourceComp", false, this.rowNode, this.column, this.eGui ); if (dndSourceComp) { this.beans.context.createBean(dndSourceComp); } return dndSourceComp; } registerRowDragger(customElement, dragStartPixels, alwaysVisible) { if (this.customRowDragComp) { this.customRowDragComp.setDragElement(customElement, dragStartPixels); return; } const newComp = this.createRowDragComp(customElement, dragStartPixels, alwaysVisible); if (newComp) { this.customRowDragComp = newComp; this.addDestroyFunc(() => { this.beans.context.destroyBean(newComp); this.customRowDragComp = null; }); newComp.refreshVisibility(); } } createRowDragComp(customElement, dragStartPixels, alwaysVisible) { const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForCell( this.rowNode, this.column, () => this.value, customElement, dragStartPixels, alwaysVisible ); if (!rowDragComp) { return void 0; } this.beans.context.createBean(rowDragComp); return rowDragComp; } cellEditorAttached() { for (const func of this.onEditorAttachedFuncs) { func(); } this.onEditorAttachedFuncs = []; } setFocusedCellPosition(_cellPosition) { } getFocusedCellPosition() { return this.cellPosition; } refreshAriaRowIndex() { if (!isRowNumberCol(this.column) || !this.eGui) { return; } const { ariaRowIndex } = this.rowCtrl; if (ariaRowIndex != null) { _setAriaRowIndex(this.eGui, ariaRowIndex); } } /** * Returns the root element of the cell, could be a span container rather than the cell element. * @returns The root element of the cell. */ getRootElement() { return this.eGui; } }; function processClassRules(expressionSvc, previousClassRules, classRules, params, onApplicableClass, onNotApplicableClass) { if (classRules == null && previousClassRules == null) { return; } const classesToApply = {}; const classesToRemove = {}; const forEachSingleClass = (className, callback) => { for (const singleClass of className.split(" ")) { if (singleClass.trim() == "") { continue; } callback(singleClass); } }; if (classRules) { const classNames = Object.keys(classRules); for (let i = 0; i < classNames.length; i++) { const className = classNames[i]; const rule = classRules[className]; let resultOfRule; if (typeof rule === "string") { resultOfRule = expressionSvc ? expressionSvc.evaluate(rule, params) : true; } else if (typeof rule === "function") { resultOfRule = rule(params); } forEachSingleClass(className, (singleClass) => { if (resultOfRule) { classesToApply[singleClass] = true; } else { classesToRemove[singleClass] = true; } }); } } if (previousClassRules && onNotApplicableClass) { for (const className of Object.keys(previousClassRules)) { forEachSingleClass(className, (singleClass) => { if (!classesToApply[singleClass]) { classesToRemove[singleClass] = true; } }); } } if (onNotApplicableClass) { Object.keys(classesToRemove).forEach(onNotApplicableClass); } Object.keys(classesToApply).forEach(onApplicableClass); } function calculateRowLevel(rowNode) { if (rowNode.group) { return rowNode.level; } const parent = rowNode.parent; return parent ? parent.level + 1 : 0; } var RowStyleService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowStyleSvc"; } processClassesFromGridOptions(classes, rowNode) { const gos = this.gos; const process = (rowCls) => { if (typeof rowCls === "string") { classes.push(rowCls); } else if (Array.isArray(rowCls)) { for (const e of rowCls) { classes.push(e); } } }; const rowClass = gos.get("rowClass"); if (rowClass) { process(rowClass); } const rowClassFunc = gos.getCallback("getRowClass"); if (rowClassFunc) { const params = { data: rowNode.data, node: rowNode, rowIndex: rowNode.rowIndex }; const rowClassFuncResult = rowClassFunc(params); process(rowClassFuncResult); } } preProcessRowClassRules(classes, rowNode) { this.processRowClassRules( rowNode, (className) => { classes.push(className); }, () => { } ); } processRowClassRules(rowNode, onApplicableClass, onNotApplicableClass) { const { gos, expressionSvc } = this.beans; const rowClassParams = _addGridCommonParams(gos, { data: rowNode.data, node: rowNode, rowIndex: rowNode.rowIndex }); processClassRules( expressionSvc, void 0, gos.get("rowClassRules"), rowClassParams, onApplicableClass, onNotApplicableClass ); } processStylesFromGridOptions(rowNode) { const gos = this.gos; const rowStyle = gos.get("rowStyle"); const rowStyleFunc = gos.getCallback("getRowStyle"); let rowStyleFuncResult; if (rowStyleFunc) { const params = { data: rowNode.data, node: rowNode, rowIndex: rowNode.rowIndex }; rowStyleFuncResult = rowStyleFunc(params); } if (rowStyleFuncResult || rowStyle) { return Object.assign({}, rowStyle, rowStyleFuncResult); } return void 0; } }; var instanceIdSequence5 = 0; var RowCtrl = class extends BeanStub { constructor(rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout) { super(); this.rowNode = rowNode; this.useAnimationFrameForCreate = useAnimationFrameForCreate; this.printLayout = printLayout; this.focusEventWhileNotReady = null; this.allRowGuis = []; this.active = true; this.centerCellCtrls = { list: [], map: {} }; this.leftCellCtrls = { list: [], map: {} }; this.rightCellCtrls = { list: [], map: {} }; this.slideInAnimation = { left: false, center: false, right: false, fullWidth: false }; this.fadeInAnimation = { left: false, center: false, right: false, fullWidth: false }; this.rowDragComps = []; this.lastMouseDownOnDragger = false; this.emptyStyle = {}; this.updateColumnListsPending = false; this.rowId = null; this.ariaRowIndex = null; this.businessKey = null; this.beans = beans; this.gos = beans.gos; this.paginationPage = beans.pagination?.getCurrentPage() ?? 0; this.suppressRowTransform = this.gos.get("suppressRowTransform"); this.instanceId = rowNode.id + "-" + instanceIdSequence5++; this.rowId = _escapeString(rowNode.id); this.initRowBusinessKey(); this.rowFocused = beans.focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned); this.rowLevel = calculateRowLevel(this.rowNode); this.setRowType(); this.setAnimateFlags(animateIn); this.rowStyles = this.processStylesFromGridOptions(); this.rowEditStyleFeature = beans.editSvc?.createRowStyleFeature(this); this.addListeners(); } initRowBusinessKey() { this.businessKeyForNodeFunc = this.gos.get("getBusinessKeyForNode"); this.updateRowBusinessKey(); } updateRowBusinessKey() { if (typeof this.businessKeyForNodeFunc !== "function") { return; } const businessKey = this.businessKeyForNodeFunc(this.rowNode); this.businessKey = _escapeString(businessKey); } updateGui(containerType, gui) { if (containerType === "left") { this.leftGui = gui; } else if (containerType === "right") { this.rightGui = gui; } else if (containerType === "fullWidth") { this.fullWidthGui = gui; } else { this.centerGui = gui; } } setComp(rowComp, element, containerType, compBean) { const { context, rowRenderer } = this.beans; compBean = setupCompBean(this, context, compBean); const gui = { rowComp, element, containerType, compBean }; this.allRowGuis.push(gui); this.updateGui(containerType, gui); this.initialiseRowComp(gui); const rowNode = this.rowNode; const isSsrmLoadingRow = this.rowType === "FullWidthLoading" || rowNode.stub; const isIrmLoadingRow = !rowNode.data && this.beans.rowModel.getType() === "infinite"; if (!isSsrmLoadingRow && !isIrmLoadingRow && !rowNode.rowPinned) { rowRenderer.dispatchFirstDataRenderedEvent(); } this.setupFocus(); } unsetComp(containerType) { this.allRowGuis = this.allRowGuis.filter((rowGui) => rowGui.containerType !== containerType); this.updateGui(containerType, void 0); } isCacheable() { return this.rowType === "FullWidthDetail" && this.gos.get("keepDetailRows"); } setCached(cached) { const displayValue = cached ? "none" : ""; for (const rg of this.allRowGuis) { rg.element.style.display = displayValue; } } initialiseRowComp(gui) { const gos = this.gos; this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")); this.listenOnDomOrder(gui); this.onRowHeightChanged(gui); this.updateRowIndexes(gui); this.setFocusedClasses(gui); this.setStylesFromGridOptions(false, gui); if (_isRowSelection(gos) && this.rowNode.selectable) { this.onRowSelected(gui); } this.updateColumnLists(!this.useAnimationFrameForCreate); const comp = gui.rowComp; const initialRowClasses = this.getInitialRowClasses(gui.containerType); for (const name of initialRowClasses) { comp.toggleCss(name, true); } this.executeSlideAndFadeAnimations(gui); if (this.rowNode.group) { _setAriaExpanded(gui.element, !!this.rowNode.expanded); } this.setRowCompRowId(comp); this.setRowCompRowBusinessKey(comp); _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, this); gui.compBean.addDestroyFunc(() => _setDomData(gos, gui.element, DOM_DATA_KEY_ROW_CTRL, null)); if (this.useAnimationFrameForCreate) { this.beans.animationFrameSvc.createTask( this.addHoverFunctionality.bind(this, gui), this.rowNode.rowIndex, "p2", false ); } else { this.addHoverFunctionality(gui); } if (this.isFullWidth()) { this.setupFullWidth(gui); } if (gos.get("rowDragEntireRow")) { this.addRowDraggerToRow(gui); } if (this.useAnimationFrameForCreate) { this.beans.animationFrameSvc.addDestroyTask(() => { if (!this.isAlive()) { return; } gui.rowComp.toggleCss("ag-after-created", true); }); } this.executeProcessRowPostCreateFunc(); } setRowCompRowBusinessKey(comp) { if (this.businessKey == null) { return; } comp.setRowBusinessKey(this.businessKey); } setRowCompRowId(comp) { const rowId = _escapeString(this.rowNode.id); this.rowId = rowId; if (rowId == null) { return; } comp.setRowId(rowId); } executeSlideAndFadeAnimations(gui) { const { containerType } = gui; const shouldSlide = this.slideInAnimation[containerType]; if (shouldSlide) { _batchCall(() => { this.onTopChanged(); }); this.slideInAnimation[containerType] = false; } const shouldFade = this.fadeInAnimation[containerType]; if (shouldFade) { _batchCall(() => { gui.rowComp.toggleCss("ag-opacity-zero", false); }); this.fadeInAnimation[containerType] = false; } } addRowDraggerToRow(gui) { const rowDragComp = this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode, gui.element); if (!rowDragComp) { return; } const rowDragBean = this.createBean(rowDragComp, this.beans.context); this.rowDragComps.push(rowDragBean); gui.compBean.addDestroyFunc(() => { this.rowDragComps = this.rowDragComps.filter((r) => r !== rowDragBean); this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, this.beans.context); this.destroyBean(rowDragBean, this.beans.context); }); } setupFullWidth(gui) { const pinned = this.getPinnedForContainer(gui.containerType); const compDetails = this.createFullWidthCompDetails(gui.element, pinned); gui.rowComp.showFullWidth(compDetails); } getFullWidthCellRenderers() { if (this.gos.get("embedFullWidthRows")) { return this.allRowGuis.map((gui) => gui?.rowComp?.getFullWidthCellRenderer()); } return [this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]; } executeProcessRowPostCreateFunc() { const func = this.gos.getCallback("processRowPostCreate"); if (!func || !this.areAllContainersReady()) { return; } const params = { // areAllContainersReady asserts that centerGui is not null eRow: this.centerGui.element, ePinnedLeftRow: this.leftGui ? this.leftGui.element : void 0, ePinnedRightRow: this.rightGui ? this.rightGui.element : void 0, node: this.rowNode, rowIndex: this.rowNode.rowIndex, addRenderedRowListener: this.addEventListener.bind(this) }; func(params); } areAllContainersReady() { const { leftGui, centerGui, rightGui, beans: { visibleCols } } = this; const isLeftReady = !!leftGui || !visibleCols.isPinningLeft(); const isCenterReady = !!centerGui; const isRightReady = !!rightGui || !visibleCols.isPinningRight(); return isLeftReady && isCenterReady && isRightReady; } isNodeFullWidthCell() { if (this.rowNode.detail) { return true; } const isFullWidthCellFunc = this.beans.gos.getCallback("isFullWidthRow"); return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this.rowNode }) : false; } setRowType() { const { rowNode, gos, beans: { colModel } } = this; const isStub = rowNode.stub && !gos.get("suppressServerSideFullWidthLoadingRow") && !gos.get("groupHideOpenParents"); const isFullWidthCell = this.isNodeFullWidthCell(); const isDetailCell = gos.get("masterDetail") && rowNode.detail; const pivotMode = colModel.isPivotMode(); const isFullWidthGroup = _isFullWidthGroupRow(gos, rowNode, pivotMode); if (isStub) { this.rowType = "FullWidthLoading"; } else if (isDetailCell) { this.rowType = "FullWidthDetail"; } else if (isFullWidthCell) { this.rowType = "FullWidth"; } else if (isFullWidthGroup) { this.rowType = "FullWidthGroup"; } else { this.rowType = "Normal"; } } updateColumnLists(suppressAnimationFrame = false, useFlushSync = false) { if (this.isFullWidth()) { return; } const { animationFrameSvc } = this.beans; const noAnimation = !animationFrameSvc?.active || suppressAnimationFrame || this.printLayout; if (noAnimation) { this.updateColumnListsImpl(useFlushSync); return; } if (this.updateColumnListsPending) { return; } animationFrameSvc.createTask( () => { if (!this.active) { return; } this.updateColumnListsImpl(true); }, this.rowNode.rowIndex, "p1", false ); this.updateColumnListsPending = true; } /** * Overridden by SpannedRowCtrl */ getNewCellCtrl(col) { const isCellSpan = this.beans.rowSpanSvc?.isCellSpanning(col, this.rowNode); if (isCellSpan) { return void 0; } return new CellCtrl(col, this.rowNode, this.beans, this); } /** * Overridden by SpannedRowCtrl, if span context changes cell needs rebuilt */ isCorrectCtrlForSpan(cell) { return !this.beans.rowSpanSvc?.isCellSpanning(cell.column, this.rowNode); } createCellCtrls(prev, cols, pinned = null) { const res = { list: [], map: {} }; const addCell = (colInstanceId, cellCtrl, index) => { if (index != null) { res.list.splice(index, 0, cellCtrl); } else { res.list.push(cellCtrl); } res.map[colInstanceId] = cellCtrl; }; const colsFromPrev = []; for (const col of cols) { const colInstanceId = col.getInstanceId(); let cellCtrl = prev.map[colInstanceId]; if (cellCtrl && !this.isCorrectCtrlForSpan(cellCtrl)) { cellCtrl.destroy(); cellCtrl = void 0; } if (!cellCtrl) { cellCtrl = this.getNewCellCtrl(col); } if (!cellCtrl) { continue; } addCell(colInstanceId, cellCtrl); } for (const prevCellCtrl of prev.list) { const colInstanceId = prevCellCtrl.column.getInstanceId(); const cellInResult = res.map[colInstanceId] != null; if (cellInResult) { continue; } const keepCell = !this.isCellEligibleToBeRemoved(prevCellCtrl, pinned); if (keepCell) { colsFromPrev.push([colInstanceId, prevCellCtrl]); } else { prevCellCtrl.destroy(); } } if (colsFromPrev.length) { for (const [colInstanceId, cellCtrl] of colsFromPrev) { const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft()); const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0); addCell(colInstanceId, cellCtrl, normalisedIndex); } } const { focusSvc, visibleCols } = this.beans; const focusedCell = focusSvc.getFocusedCell(); if (focusedCell && focusedCell.column.getPinned() == pinned) { const focusedColInstanceId = focusedCell.column.getInstanceId(); const focusedCellCtrl = res.map[focusedColInstanceId]; if (!focusedCellCtrl && visibleCols.allCols.includes(focusedCell.column)) { const cellCtrl = this.createFocusedCellCtrl(); if (cellCtrl) { const index = res.list.findIndex((ctrl) => ctrl.column.getLeft() > cellCtrl.column.getLeft()); const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0); addCell(focusedColInstanceId, cellCtrl, normalisedIndex); } } } return res; } /** * Creates a new cell ctrl for the focused cell, if this is the correct row ctrl. * @returns a CellCtrl for the focused cell, if required. */ createFocusedCellCtrl() { const { focusSvc, rowSpanSvc } = this.beans; const focusedCell = focusSvc.getFocusedCell(); if (!focusedCell) { return void 0; } const focusedSpan = rowSpanSvc?.getCellSpan(focusedCell.column, this.rowNode); if (focusedSpan) { if (focusedSpan.firstNode !== this.rowNode || !focusedSpan.doesSpanContain(focusedCell)) { return void 0; } } else if (!focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned)) { return void 0; } return this.getNewCellCtrl(focusedCell.column); } updateColumnListsImpl(useFlushSync) { this.updateColumnListsPending = false; this.createAllCellCtrls(); this.setCellCtrls(useFlushSync); } setCellCtrls(useFlushSync) { for (const item of this.allRowGuis) { const cellControls = this.getCellCtrlsForContainer(item.containerType); item.rowComp.setCellCtrls(cellControls, useFlushSync); } } getCellCtrlsForContainer(containerType) { switch (containerType) { case "left": return this.leftCellCtrls.list; case "right": return this.rightCellCtrls.list; case "fullWidth": return []; case "center": return this.centerCellCtrls.list; } } createAllCellCtrls() { const colViewport = this.beans.colViewport; const presentedColsService = this.beans.visibleCols; if (this.printLayout) { this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, presentedColsService.allCols); this.leftCellCtrls = { list: [], map: {} }; this.rightCellCtrls = { list: [], map: {} }; } else { const centerCols = colViewport.getColsWithinViewport(this.rowNode); this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, centerCols); const leftCols = presentedColsService.getLeftColsForRow(this.rowNode); this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, leftCols, "left"); const rightCols = presentedColsService.getRightColsForRow(this.rowNode); this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, rightCols, "right"); } } isCellEligibleToBeRemoved(cellCtrl, nextContainerPinned) { const REMOVE_CELL = true; const KEEP_CELL = false; const { column } = cellCtrl; if (column.getPinned() != nextContainerPinned) { return REMOVE_CELL; } if (!this.isCorrectCtrlForSpan(cellCtrl)) { return REMOVE_CELL; } const { visibleCols, editSvc } = this.beans; const editing = editSvc?.isEditing(cellCtrl); const focused = cellCtrl.isCellFocused(); const mightWantToKeepCell = editing || focused; if (mightWantToKeepCell) { const displayedColumns = visibleCols.allCols; const cellStillDisplayed = displayedColumns.indexOf(column) >= 0; return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL; } return REMOVE_CELL; } getDomOrder() { const isEnsureDomOrder = this.gos.get("ensureDomOrder"); return isEnsureDomOrder || _isDomLayout(this.gos, "print"); } listenOnDomOrder(gui) { const listener = () => { gui.rowComp.setDomOrder(this.getDomOrder()); }; gui.compBean.addManagedPropertyListeners(["domLayout", "ensureDomOrder"], listener); } setAnimateFlags(animateIn) { if (this.rowNode.sticky || !animateIn) { return; } const oldRowTopExists = _exists(this.rowNode.oldRowTop); const { visibleCols } = this.beans; const pinningLeft = visibleCols.isPinningLeft(); const pinningRight = visibleCols.isPinningRight(); if (oldRowTopExists) { const { slideInAnimation } = this; if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) { slideInAnimation.fullWidth = true; return; } slideInAnimation.center = true; slideInAnimation.left = pinningLeft; slideInAnimation.right = pinningRight; } else { const { fadeInAnimation } = this; if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) { fadeInAnimation.fullWidth = true; return; } fadeInAnimation.center = true; fadeInAnimation.left = pinningLeft; fadeInAnimation.right = pinningRight; } } isFullWidth() { return this.rowType !== "Normal"; } refreshFullWidth() { const tryRefresh = (gui, pinned) => { if (!gui) { return true; } return gui.rowComp.refreshFullWidth(() => { const compDetails = this.createFullWidthCompDetails(gui.element, pinned); return compDetails.params; }); }; const fullWidthSuccess = tryRefresh(this.fullWidthGui, null); const centerSuccess = tryRefresh(this.centerGui, null); const leftSuccess = tryRefresh(this.leftGui, "left"); const rightSuccess = tryRefresh(this.rightGui, "right"); const allFullWidthRowsRefreshed = fullWidthSuccess && centerSuccess && leftSuccess && rightSuccess; return allFullWidthRowsRefreshed; } addListeners() { const { beans, gos, rowNode } = this; const { expansionSvc, eventSvc, context, rowSpanSvc } = beans; this.addManagedListeners(this.rowNode, { heightChanged: () => this.onRowHeightChanged(), rowSelected: () => this.onRowSelected(), rowIndexChanged: this.onRowIndexChanged.bind(this), topChanged: this.onTopChanged.bind(this), ...expansionSvc?.getRowExpandedListeners(this) ?? {} }); if (rowNode.detail) { this.addManagedListeners(rowNode.parent, { dataChanged: this.onRowNodeDataChanged.bind(this) }); } this.addManagedListeners(rowNode, { dataChanged: this.onRowNodeDataChanged.bind(this), cellChanged: this.postProcessCss.bind(this), rowHighlightChanged: this.onRowNodeHighlightChanged.bind(this), draggingChanged: this.postProcessRowDragging.bind(this), uiLevelChanged: this.onUiLevelChanged.bind(this), rowPinned: this.onRowPinned.bind(this) }); this.addManagedListeners(eventSvc, { paginationPixelOffsetChanged: this.onPaginationPixelOffsetChanged.bind(this), heightScaleChanged: this.onTopChanged.bind(this), displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), virtualColumnsChanged: this.onVirtualColumnsChanged.bind(this), cellFocused: this.onCellFocusChanged.bind(this), cellFocusCleared: this.onCellFocusChanged.bind(this), paginationChanged: this.onPaginationChanged.bind(this), modelUpdated: this.refreshFirstAndLastRowStyles.bind(this), columnMoved: () => this.updateColumnLists() }); if (rowSpanSvc) { this.addManagedListeners(rowSpanSvc, { spannedCellsUpdated: ({ pinned }) => { if (pinned && !rowNode.rowPinned) { return; } this.updateColumnLists(); } }); } this.addDestroyFunc(() => { this.rowDragComps = this.destroyBeans(this.rowDragComps, context); this.tooltipFeature = this.destroyBean(this.tooltipFeature, context); this.rowEditStyleFeature = this.destroyBean(this.rowEditStyleFeature, context); }); this.addManagedPropertyListeners( ["rowStyle", "getRowStyle", "rowClass", "getRowClass", "rowClassRules"], this.postProcessCss.bind(this) ); this.addManagedPropertyListener("rowDragEntireRow", () => { const useRowDragEntireRow = gos.get("rowDragEntireRow"); if (useRowDragEntireRow) { for (const gui of this.allRowGuis) { this.addRowDraggerToRow(gui); } return; } this.rowDragComps = this.destroyBeans(this.rowDragComps, context); }); this.addListenersForCellComps(); } addListenersForCellComps() { this.addManagedListeners(this.rowNode, { rowIndexChanged: () => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onRowIndexChanged(); } }, cellChanged: (event) => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onCellChanged(event); } } }); } /** Should only ever be triggered on source rows (i.e. not on pinned siblings) */ onRowPinned() { for (const gui of this.allRowGuis) { gui.rowComp.toggleCss("ag-row-pinned-source", !!this.rowNode.pinnedSibling); } } onRowNodeDataChanged(event) { this.refreshRow({ suppressFlash: !event.update, newData: !event.update }); } refreshRow(params) { const fullWidthChanged = this.isFullWidth() !== !!this.isNodeFullWidthCell(); if (fullWidthChanged) { this.beans.rowRenderer.redrawRow(this.rowNode); return; } if (this.isFullWidth()) { const refresh = this.refreshFullWidth(); if (!refresh) { this.beans.rowRenderer.redrawRow(this.rowNode); } return; } for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.refreshCell(params); } for (const gui of this.allRowGuis) { this.setRowCompRowId(gui.rowComp); this.updateRowBusinessKey(); this.setRowCompRowBusinessKey(gui.rowComp); } this.onRowSelected(); this.postProcessCss(); } postProcessCss() { this.setStylesFromGridOptions(true); this.postProcessClassesFromGridOptions(); this.postProcessRowClassRules(); this.rowEditStyleFeature?.applyRowStyles(); this.postProcessRowDragging(); } onRowNodeHighlightChanged() { const rowDropHighlightSvc = this.beans.rowDropHighlightSvc; const highlighted = rowDropHighlightSvc?.row === this.rowNode ? rowDropHighlightSvc.position : "none"; const aboveOn = highlighted === "above"; const insideOn = highlighted === "inside"; const belowOn = highlighted === "below"; const highlightActive = highlighted !== "none"; const dropEdge = aboveOn || belowOn; const uiLevel = this.rowNode.uiLevel; const shouldIndent = dropEdge && uiLevel > 0; const highlightLevel = shouldIndent ? uiLevel.toString() : "0"; for (const gui of this.allRowGuis) { const rowComp = gui.rowComp; rowComp.toggleCss("ag-row-highlight-above", aboveOn); rowComp.toggleCss("ag-row-highlight-inside", insideOn); rowComp.toggleCss("ag-row-highlight-below", belowOn); rowComp.toggleCss("ag-row-highlight-indent", shouldIndent); if (highlightActive) { gui.element.style.setProperty("--ag-row-highlight-level", highlightLevel); } else { gui.element.style.removeProperty("--ag-row-highlight-level"); } } } postProcessRowDragging() { const dragging = this.rowNode.dragging; for (const gui of this.allRowGuis) { gui.rowComp.toggleCss("ag-row-dragging", dragging); } } onDisplayedColumnsChanged() { this.updateColumnLists(true); this.beans.rowAutoHeight?.requestCheckAutoHeight(); } onVirtualColumnsChanged() { this.updateColumnLists(false, true); } getRowPosition() { return { rowPinned: _makeNull(this.rowNode.rowPinned), rowIndex: this.rowNode.rowIndex }; } onKeyboardNavigate(keyboardEvent) { const groupInfo = this.findFullWidthInfoForEvent(keyboardEvent); if (!groupInfo) { return; } const { rowGui, column } = groupInfo; const currentFullWidthContainer = rowGui.element; const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target; if (!isFullWidthContainerFocused) { return; } const node = this.rowNode; const { focusSvc, navigation } = this.beans; const lastFocusedCell = focusSvc.getFocusedCell(); const cellPosition = { rowIndex: node.rowIndex, rowPinned: node.rowPinned, column: lastFocusedCell?.column ?? column }; navigation?.navigateToNextCell(keyboardEvent, keyboardEvent.key, cellPosition, true); keyboardEvent.preventDefault(); } onTabKeyDown(keyboardEvent) { if (keyboardEvent.defaultPrevented || _isStopPropagationForAgGrid(keyboardEvent)) { return; } const currentFullWidthComp = this.allRowGuis.find( (c) => c.element.contains(keyboardEvent.target) ); const currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null; const isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target; const activeEl = _getActiveDomElement(this.beans); let isDetailGridCellFocused = false; if (currentFullWidthContainer && activeEl) { isDetailGridCellFocused = currentFullWidthContainer.contains(activeEl) && activeEl.classList.contains("ag-cell"); } let nextEl = null; if (!isFullWidthContainerFocused && !isDetailGridCellFocused) { nextEl = _findNextFocusableElement(this.beans, currentFullWidthContainer, false, keyboardEvent.shiftKey); } if (this.isFullWidth() && isFullWidthContainerFocused || !nextEl) { this.beans.navigation?.onTabKeyDown(this, keyboardEvent); } } getFullWidthElement() { if (this.fullWidthGui) { return this.fullWidthGui.element; } return null; } getRowYPosition() { const displayedEl = this.allRowGuis.find((el) => _isVisible(el.element))?.element; if (displayedEl) { return displayedEl.getBoundingClientRect().top; } return 0; } onSuppressCellFocusChanged(suppressCellFocus) { const tabIndex = this.isFullWidth() && suppressCellFocus ? void 0 : this.gos.get("tabIndex"); for (const gui of this.allRowGuis) { _addOrRemoveAttribute(gui.element, "tabindex", tabIndex); } } setupFocus() { if (!this.isFullWidth()) { return; } this.restoreFullWidthFocus(true); this.onFullWidthRowFocused(this.focusEventWhileNotReady ?? void 0); } restoreFullWidthFocus(waitForRender = false) { const { focusSvc, editSvc } = this.beans; if (editSvc?.isEditing(this)) { return; } if (!focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned) || !focusSvc.shouldTakeFocus()) { return; } const targetGui = this.getFullWidthRowGuiForFocus(); if (!targetGui) { return; } const focus = () => { if (!this.isAlive()) { return; } if (focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned)) { targetGui.element.focus({ preventScroll: true }); } }; if (waitForRender) { setTimeout(focus, 0); return; } focus(); } getFullWidthRowGuiForFocus(event) { if (this.fullWidthGui) { return this.fullWidthGui; } const focusedCell = this.beans.focusSvc.getFocusedCell(); const column = this.beans.colModel.getCol(event?.column ?? focusedCell?.column); if (!column) { return; } const pinned = column?.pinned; if (pinned === "right") { return this.rightGui; } if (pinned === "left") { return this.leftGui; } return this.centerGui; } setFullWidthRowFocusedClass(targetGui, isFocused) { this.forEachGui(void 0, (gui) => { gui.element.classList.toggle("ag-full-width-focus", isFocused && gui === targetGui); }); } onFullWidthRowFocused(event) { const { focusSvc } = this.beans; const isFocused = this.isFullWidth() && focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned); if (!isFocused) { this.setFullWidthRowFocusedClass(void 0, false); return; } const targetGui = this.getFullWidthRowGuiForFocus(event); if (!targetGui) { if (event) { this.focusEventWhileNotReady = event; } this.setFullWidthRowFocusedClass(void 0, false); return; } this.setFullWidthRowFocusedClass(targetGui, true); this.focusEventWhileNotReady = null; if (event?.forceBrowserFocus) { targetGui.element.focus({ preventScroll: true }); } } recreateCell(cellCtrl) { this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, cellCtrl); this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, cellCtrl); this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, cellCtrl); cellCtrl.destroy(); this.updateColumnLists(); } removeCellCtrl(prev, cellCtrlToRemove) { const res = { list: [], map: {} }; for (const cellCtrl of prev.list) { if (cellCtrl === cellCtrlToRemove) { continue; } res.list.push(cellCtrl); res.map[cellCtrl.column.getInstanceId()] = cellCtrl; } return res; } onMouseEvent(eventName, mouseEvent) { switch (eventName) { case "dblclick": this.onRowDblClick(mouseEvent); break; case "click": this.onRowClick(mouseEvent); break; case "pointerdown": case "touchstart": case "mousedown": this.onRowMouseDown(mouseEvent); break; } } createRowEvent(type, domEvent) { const { rowNode } = this; return _addGridCommonParams(this.gos, { type, node: rowNode, data: rowNode.data, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned, event: domEvent }); } createRowEventWithSource(type, domEvent) { const event = this.createRowEvent(type, domEvent); event.source = this; return event; } onRowDblClick(mouseEvent) { if (_isStopPropagationForAgGrid(mouseEvent)) { return; } const rowEvent = this.createRowEventWithSource("rowDoubleClicked", mouseEvent); rowEvent.isEventHandlingSuppressed = this.isSuppressMouseEvent(mouseEvent); this.beans.eventSvc.dispatchEvent(rowEvent); } findFullWidthInfoForEvent(event) { if (!event) { return; } const rowGui = this.findFullWidthRowGui(event.target); const column = this.getColumnForFullWidth(rowGui); if (!rowGui || !column) { return; } return { rowGui, column }; } findFullWidthRowGui(target) { return this.allRowGuis.find((c) => c.element.contains(target)); } getColumnForFullWidth(fullWidthRowGui) { const { visibleCols } = this.beans; switch (fullWidthRowGui?.containerType) { case "center": return visibleCols.centerCols[0]; case "left": return visibleCols.leftCols[0]; case "right": return visibleCols.rightCols[0]; default: return visibleCols.allCols[0]; } } onRowMouseDown(mouseEvent) { this.lastMouseDownOnDragger = _isElementChildOfClass(mouseEvent.target, "ag-row-drag", 3); if (!this.isFullWidth() || this.isSuppressMouseEvent(mouseEvent)) { return; } const { rangeSvc, focusSvc } = this.beans; rangeSvc?.removeAllCellRanges(); const groupInfo = this.findFullWidthInfoForEvent(mouseEvent); if (!groupInfo) { return; } const { rowGui, column } = groupInfo; const element = rowGui.element; const target = mouseEvent.target; const node = this.rowNode; let forceBrowserFocus = mouseEvent.defaultPrevented || _isBrowserSafari(); if (element && element.contains(target) && _isFocusableFormField(target)) { forceBrowserFocus = false; } focusSvc.setFocusedCell({ rowIndex: node.rowIndex, column, rowPinned: node.rowPinned, forceBrowserFocus }); } isSuppressMouseEvent(mouseEvent) { const { gos, rowNode } = this; if (this.isFullWidth()) { const fullWidthRowGui = this.findFullWidthRowGui(mouseEvent.target); return _suppressFullWidthMouseEvent( gos, fullWidthRowGui?.rowComp.getFullWidthCellRendererParams(), rowNode, mouseEvent ); } const cellCtrl = _getCellCtrlForEventTarget(gos, mouseEvent.target); return cellCtrl != null && _suppressCellMouseEvent(gos, cellCtrl.column, rowNode, mouseEvent); } onRowClick(mouseEvent) { const stop = _isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger; if (stop) { return; } const isSuppressMouseEvent = this.isSuppressMouseEvent(mouseEvent); const { eventSvc, selectionSvc } = this.beans; const rowEvent = this.createRowEventWithSource("rowClicked", mouseEvent); rowEvent.isEventHandlingSuppressed = isSuppressMouseEvent; eventSvc.dispatchEvent(rowEvent); if (isSuppressMouseEvent) { return; } selectionSvc?.handleSelectionEvent(mouseEvent, this.rowNode, "rowClicked"); } setupDetailRowAutoHeight(eDetailGui) { if (this.rowType !== "FullWidthDetail") { return; } this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this, eDetailGui); } createFullWidthCompDetails(eRow, pinned) { const { gos, rowNode } = this; const params = _addGridCommonParams(gos, { fullWidth: true, data: rowNode.data, node: rowNode, value: rowNode.key, valueFormatted: rowNode.key, // these need to be taken out, as part of 'afterAttached' now eGridCell: eRow, eParentOfValue: eRow, pinned, addRenderedRowListener: this.addEventListener.bind(this), // This is not on the type of ICellRendererParams registerRowDragger: (rowDraggerElement, dragStartPixels, value, rowDragEntireRow) => this.addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value, rowDragEntireRow), setTooltip: (value, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); this.setupFullWidthRowTooltip(value, shouldDisplayTooltip); } }); const compFactory = this.beans.userCompFactory; switch (this.rowType) { case "FullWidthDetail": return _getFullWidthDetailCellRendererDetails(compFactory, params); case "FullWidthGroup": { const { value, valueFormatted } = this.beans.valueSvc.getValueForDisplay({ node: this.rowNode, includeValueFormatted: true, from: "edit" }); params.value = value; params.valueFormatted = valueFormatted; return _getFullWidthGroupCellRendererDetails(compFactory, params); } case "FullWidthLoading": return _getFullWidthLoadingCellRendererDetails(compFactory, params); default: return _getFullWidthCellRendererDetails(compFactory, params); } } setupFullWidthRowTooltip(value, shouldDisplayTooltip) { if (!this.fullWidthGui) { return; } this.tooltipFeature = this.beans.tooltipSvc?.setupFullWidthRowTooltip( this.tooltipFeature, this, value, shouldDisplayTooltip ); } addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value = "", alwaysVisible) { const { rowDragSvc, context } = this.beans; if (!rowDragSvc || !this.isFullWidth()) { return; } const rowDragComp = rowDragSvc.createRowDragComp( () => value, this.rowNode, void 0, rowDraggerElement, dragStartPixels, alwaysVisible ); this.createBean(rowDragComp, context); this.addDestroyFunc(() => { this.destroyBean(rowDragComp, context); }); } onUiLevelChanged() { const newLevel = calculateRowLevel(this.rowNode); if (this.rowLevel != newLevel) { const classToAdd = "ag-row-level-" + newLevel; const classToRemove = "ag-row-level-" + this.rowLevel; for (const gui of this.allRowGuis) { gui.rowComp.toggleCss(classToAdd, true); gui.rowComp.toggleCss(classToRemove, false); } } this.rowLevel = newLevel; } isFirstRowOnPage() { return this.rowNode.rowIndex === this.beans.pageBounds.getFirstRow(); } isLastRowOnPage() { return this.rowNode.rowIndex === this.beans.pageBounds.getLastRow(); } refreshFirstAndLastRowStyles() { const newFirst = this.isFirstRowOnPage(); const newLast = this.isLastRowOnPage(); if (this.firstRowOnPage !== newFirst) { this.firstRowOnPage = newFirst; for (const gui of this.allRowGuis) { gui.rowComp.toggleCss("ag-row-first", newFirst); } } if (this.lastRowOnPage !== newLast) { this.lastRowOnPage = newLast; for (const gui of this.allRowGuis) { gui.rowComp.toggleCss("ag-row-last", newLast); } } } getAllCellCtrls() { if (this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0) { return this.centerCellCtrls.list; } const res = [...this.centerCellCtrls.list, ...this.leftCellCtrls.list, ...this.rightCellCtrls.list]; return res; } postProcessClassesFromGridOptions() { const cssClasses = []; this.beans.rowStyleSvc?.processClassesFromGridOptions(cssClasses, this.rowNode); if (!cssClasses.length) { return; } for (const classStr of cssClasses) { for (const c of this.allRowGuis) { c.rowComp.toggleCss(classStr, true); } } } postProcessRowClassRules() { this.beans.rowStyleSvc?.processRowClassRules( this.rowNode, (className) => { for (const gui of this.allRowGuis) { gui.rowComp.toggleCss(className, true); } }, (className) => { for (const gui of this.allRowGuis) { gui.rowComp.toggleCss(className, false); } } ); } setStylesFromGridOptions(updateStyles, gui) { if (updateStyles) { this.rowStyles = this.processStylesFromGridOptions(); } this.forEachGui(gui, (gui2) => gui2.rowComp.setUserStyles(this.rowStyles)); } getPinnedForContainer(rowContainerType) { if (rowContainerType === "left" || rowContainerType === "right") { return rowContainerType; } return null; } getInitialRowClasses(rowContainerType) { const pinned = this.getPinnedForContainer(rowContainerType); const fullWidthRow = this.isFullWidth(); const { rowNode, beans } = this; const classes = []; classes.push("ag-row"); classes.push(this.rowFocused ? "ag-row-focus" : "ag-row-no-focus"); if (this.fadeInAnimation[rowContainerType]) { classes.push("ag-opacity-zero"); } classes.push(rowNode.rowIndex % 2 === 0 ? "ag-row-even" : "ag-row-odd"); if (rowNode.isRowPinned()) { classes.push("ag-row-pinned"); if (beans.pinnedRowModel?.isManual()) { classes.push("ag-row-pinned-manual"); } } if (!rowNode.isRowPinned() && rowNode.pinnedSibling) { classes.push("ag-row-pinned-source"); } if (rowNode.isSelected()) { classes.push("ag-row-selected"); } if (rowNode.footer) { classes.push("ag-row-footer"); } classes.push("ag-row-level-" + this.rowLevel); if (rowNode.stub) { classes.push("ag-row-loading"); } if (fullWidthRow) { classes.push("ag-full-width-row"); } beans.expansionSvc?.addExpandedCss(classes, rowNode); if (rowNode.dragging) { classes.push("ag-row-dragging"); } const { rowStyleSvc } = beans; if (rowStyleSvc) { rowStyleSvc.processClassesFromGridOptions(classes, rowNode); rowStyleSvc.preProcessRowClassRules(classes, rowNode); } classes.push(this.printLayout ? "ag-row-position-relative" : "ag-row-position-absolute"); if (this.isFirstRowOnPage()) { classes.push("ag-row-first"); } if (this.isLastRowOnPage()) { classes.push("ag-row-last"); } if (fullWidthRow) { if (pinned === "left") { classes.push("ag-cell-last-left-pinned"); } if (pinned === "right") { classes.push("ag-cell-first-right-pinned"); } } return classes; } processStylesFromGridOptions() { return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode) ?? this.emptyStyle; } onRowSelected(gui) { this.beans.selectionSvc?.onRowCtrlSelected( this, (gui2) => { if (gui2 === this.centerGui || gui2 === this.fullWidthGui) { this.announceDescription(); } }, gui ); } announceDescription() { this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode); } addHoverFunctionality(eGui) { if (!this.active) { return; } const { element, compBean } = eGui; const { rowNode, beans, gos } = this; compBean.addManagedListeners(element, { // We use pointer events here instead of mouse events, as pointer events // are more reliable for hover detection, especially with touch devices // or hybrid touch + mouse devices. pointerenter: (e) => { if (e.pointerType === "mouse") { rowNode.dispatchRowEvent("mouseEnter"); } }, pointerleave: (e) => { if (e.pointerType === "mouse") { rowNode.dispatchRowEvent("mouseLeave"); } } }); compBean.addManagedListeners(rowNode, { mouseEnter: () => { if (!beans.dragSvc?.dragging && !gos.get("suppressRowHoverHighlight")) { element.classList.add("ag-row-hover"); rowNode.setHovered(true); } }, mouseLeave: () => { this.resetHoveredStatus(element); } }); } resetHoveredStatus(el) { const elements = el ? [el] : this.allRowGuis.map((gui) => gui.element); for (const element of elements) { element.classList.remove("ag-row-hover"); } this.rowNode.setHovered(false); } // for animation, we don't want to animate entry or exit to a very far away pixel, // otherwise the row would move so fast, it would appear to disappear. so this method // moves the row closer to the viewport if it is far away, so the row slide in / out // at a speed the user can see. roundRowTopToBounds(rowTop) { const range = this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(); const minPixel = this.applyPaginationOffset(range.top, true) - 100; const maxPixel = this.applyPaginationOffset(range.bottom, true) + 100; return Math.min(Math.max(minPixel, rowTop), maxPixel); } forEachGui(gui, callback) { if (gui) { callback(gui); } else { for (const gui2 of this.allRowGuis) { callback(gui2); } } } isRowRendered() { return this.allRowGuis.length > 0; } onRowHeightChanged(gui) { if (this.rowNode.rowHeight == null) { return; } const rowHeight = this.rowNode.rowHeight; const defaultRowHeight = this.beans.environment.getDefaultRowHeight(); const isHeightFromFunc = _isGetRowHeightFunction(this.gos); const heightFromFunc = isHeightFromFunc ? _getRowHeightForNode(this.beans, this.rowNode).height : void 0; const lineHeight = heightFromFunc ? `${Math.min(defaultRowHeight, heightFromFunc) - 2}px` : void 0; this.forEachGui(gui, (gui2) => { gui2.element.style.height = `${rowHeight}px`; if (lineHeight) { gui2.element.style.setProperty("--ag-line-height", lineHeight); } }); } // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. destroyFirstPass(suppressAnimation = false) { this.active = false; const { rowNode } = this; if (!suppressAnimation && _isAnimateRows(this.gos) && !rowNode.sticky) { const rowStillVisibleJustNotInViewport = rowNode.rowTop != null; if (rowStillVisibleJustNotInViewport) { const rowTop = this.roundRowTopToBounds(rowNode.rowTop); this.setRowTop(rowTop); } else { for (const gui of this.allRowGuis) { gui.rowComp.toggleCss("ag-opacity-zero", true); } } } if (this.fullWidthGui?.element.contains(_getActiveDomElement(this.beans))) { this.beans.focusSvc.attemptToRecoverFocus(); } rowNode.setHovered(false); const event = this.createRowEvent("virtualRowRemoved"); this.dispatchLocalEvent(event); this.beans.eventSvc.dispatchEvent(event); super.destroy(); } destroySecondPass() { this.allRowGuis.length = 0; const destroyCellCtrls = (ctrls) => { for (const c of ctrls.list) { c.destroy(); } return { list: [], map: {} }; }; this.centerCellCtrls = destroyCellCtrls(this.centerCellCtrls); this.leftCellCtrls = destroyCellCtrls(this.leftCellCtrls); this.rightCellCtrls = destroyCellCtrls(this.rightCellCtrls); } setFocusedClasses(gui) { this.forEachGui(gui, (gui2) => { gui2.rowComp.toggleCss("ag-row-focus", this.rowFocused); gui2.rowComp.toggleCss("ag-row-no-focus", !this.rowFocused); }); } onCellFocusChanged() { const { focusSvc } = this.beans; const rowFocused = focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned); if (rowFocused !== this.rowFocused) { this.rowFocused = rowFocused; this.setFocusedClasses(); } } onPaginationChanged() { const currentPage = this.beans.pagination?.getCurrentPage() ?? 0; if (this.paginationPage !== currentPage) { this.paginationPage = currentPage; this.onTopChanged(); } this.refreshFirstAndLastRowStyles(); } onTopChanged() { this.setRowTop(this.rowNode.rowTop); } onPaginationPixelOffsetChanged() { this.onTopChanged(); } // applies pagination offset, eg if on second page, and page height is 500px, then removes // 500px from the top position, so a row with rowTop 600px is displayed at location 100px. // reverse will take the offset away rather than add. applyPaginationOffset(topPx, reverse = false) { if (this.rowNode.isRowPinned() || this.rowNode.sticky) { return topPx; } const pixelOffset = this.beans.pageBounds.getPixelOffset(); const multiplier = reverse ? 1 : -1; return topPx + pixelOffset * multiplier; } setRowTop(pixels) { if (this.printLayout) { return; } if (_exists(pixels)) { const afterPaginationPixels = this.applyPaginationOffset(pixels); const skipScaling = this.rowNode.isRowPinned() || this.rowNode.sticky; const afterScalingPixels = skipScaling ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels); const topPx = `${afterScalingPixels}px`; this.setRowTopStyle(topPx); } } // the top needs to be set into the DOM element when the element is created, not updated afterwards. // otherwise the transition would not work, as it would be transitioning from zero (the unset value). // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered, // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation // time, the row would animate down (ie from position zero). getInitialRowTop(rowContainerType) { return this.suppressRowTransform ? this.getInitialRowTopShared(rowContainerType) : void 0; } getInitialTransform(rowContainerType) { return this.suppressRowTransform ? void 0 : `translateY(${this.getInitialRowTopShared(rowContainerType)})`; } getInitialRowTopShared(rowContainerType) { if (this.printLayout) { return ""; } const rowNode = this.rowNode; let rowTop; if (rowNode.sticky) { rowTop = rowNode.stickyRowTop; } else { const pixels = this.slideInAnimation[rowContainerType] ? this.roundRowTopToBounds(rowNode.oldRowTop) : rowNode.rowTop; const afterPaginationPixels = this.applyPaginationOffset(pixels); rowTop = rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeight.getRealPixelPosition(afterPaginationPixels); } return rowTop + "px"; } setRowTopStyle(topPx) { for (const gui of this.allRowGuis) { if (this.suppressRowTransform) { gui.rowComp.setTop(topPx); } else { gui.rowComp.setTransform(`translateY(${topPx})`); } } } getCellCtrl(column, skipColSpanSearch = false) { let res = null; for (const cellCtrl of this.getAllCellCtrls()) { if (cellCtrl.column == column) { res = cellCtrl; } } if (res != null || skipColSpanSearch) { return res; } for (const cellCtrl of this.getAllCellCtrls()) { if (cellCtrl?.getColSpanningList().indexOf(column) >= 0) { res = cellCtrl; } } return res; } onRowIndexChanged() { if (this.rowNode.rowIndex != null) { this.onCellFocusChanged(); this.updateRowIndexes(); this.postProcessCss(); } } updateRowIndexes(gui) { const rowIndexStr = this.rowNode.getRowIndexString(); if (rowIndexStr === null) { return; } const headerRowCount = (this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.beans.filterManager?.getHeaderRowCount() ?? 0); const rowIsEven = this.rowNode.rowIndex % 2 === 0; const ariaRowIndex = this.ariaRowIndex = headerRowCount + this.rowNode.rowIndex + 1; this.forEachGui(gui, (c) => { c.rowComp.setRowIndex(rowIndexStr); c.rowComp.toggleCss("ag-row-even", rowIsEven); c.rowComp.toggleCss("ag-row-odd", !rowIsEven); _setAriaRowIndex(c.element, ariaRowIndex); }); } }; var NavigationService = class extends BeanStub { constructor() { super(); this.beanName = "navigation"; this.onPageDown = _throttle(this.onPageDown, 100); this.onPageUp = _throttle(this.onPageUp, 100); } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCon = p.gridBodyCtrl; }); } handlePageScrollingKey(event, fromFullWidth = false) { const key = event.key; const alt = event.altKey; const ctrl = event.ctrlKey || event.metaKey; const rangeServiceShouldHandleShift = !!this.beans.rangeSvc && event.shiftKey; const currentCell = _getCellPositionForEvent(this.gos, event); let processed = false; switch (key) { case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: if (!ctrl && !alt) { this.onHomeOrEndKey(key); processed = true; } break; case KeyCode.LEFT: case KeyCode.RIGHT: case KeyCode.UP: case KeyCode.DOWN: if (!currentCell) { return false; } if (ctrl && !alt && !rangeServiceShouldHandleShift) { this.onCtrlUpDownLeftRight(key, currentCell); processed = true; } break; case KeyCode.PAGE_DOWN: case KeyCode.PAGE_UP: if (!ctrl && !alt) { processed = this.handlePageUpDown(key, currentCell, fromFullWidth); } break; } if (processed) { event.preventDefault(); } return processed; } handlePageUpDown(key, currentCell, fromFullWidth) { if (fromFullWidth) { currentCell = this.beans.focusSvc.getFocusedCell(); } if (!currentCell) { return false; } if (key === KeyCode.PAGE_UP) { this.onPageUp(currentCell); } else { this.onPageDown(currentCell); } return true; } navigateTo({ scrollIndex, scrollType, scrollColumn, focusIndex, focusColumn, isAsync, rowPinned }) { const { scrollFeature } = this.gridBodyCon; if (_exists(scrollColumn) && !scrollColumn.isPinned()) { scrollFeature.ensureColumnVisible(scrollColumn); } if (_exists(scrollIndex)) { scrollFeature.ensureIndexVisible(scrollIndex, scrollType); } if (!isAsync) { scrollFeature.ensureIndexVisible(focusIndex); } const { focusSvc } = this.beans; focusSvc.setFocusedCell({ rowIndex: focusIndex, column: focusColumn, rowPinned, forceBrowserFocus: true }); this.setRangeToCellIfSupported({ rowIndex: focusIndex, rowPinned, column: focusColumn }); } // this method is throttled, see the `constructor` onPageDown(gridCell) { const beans = this.beans; const scrollPosition = getVScroll(beans); const pixelsInOnePage = this.getViewportHeight(); const { pageBounds, rowModel, rowAutoHeight } = beans; const pagingPixelOffset = pageBounds.getPixelOffset(); const currentPageBottomPixel = scrollPosition.top + pixelsInOnePage; const currentPageBottomRow = rowModel.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset); if (rowAutoHeight?.active) { this.navigateToNextPageWithAutoHeight(gridCell, currentPageBottomRow); } else { this.navigateToNextPage(gridCell, currentPageBottomRow); } } // this method is throttled, see the `constructor` onPageUp(gridCell) { const beans = this.beans; const scrollPosition = getVScroll(beans); const { pageBounds, rowModel, rowAutoHeight } = beans; const pagingPixelOffset = pageBounds.getPixelOffset(); const currentPageTopPixel = scrollPosition.top; const currentPageTopRow = rowModel.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset); if (rowAutoHeight?.active) { this.navigateToNextPageWithAutoHeight(gridCell, currentPageTopRow, true); } else { this.navigateToNextPage(gridCell, currentPageTopRow, true); } } navigateToNextPage(gridCell, scrollIndex, up = false) { const { pageBounds, rowModel } = this.beans; const pixelsInOnePage = this.getViewportHeight(); const firstRow = pageBounds.getFirstRow(); const lastRow = pageBounds.getLastRow(); const pagingPixelOffset = pageBounds.getPixelOffset(); const currentRowNode = rowModel.getRow(gridCell.rowIndex); const rowPixelDiff = up ? ( // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain currentRowNode?.rowHeight - pixelsInOnePage - pagingPixelOffset ) : pixelsInOnePage - pagingPixelOffset; const nextCellPixel = currentRowNode?.rowTop + rowPixelDiff; let focusIndex = rowModel.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset); if (focusIndex === gridCell.rowIndex) { const diff = up ? -1 : 1; scrollIndex = focusIndex = gridCell.rowIndex + diff; } let scrollType; if (up) { scrollType = "bottom"; if (focusIndex < firstRow) { focusIndex = firstRow; } if (scrollIndex < firstRow) { scrollIndex = firstRow; } } else { scrollType = "top"; if (focusIndex > lastRow) { focusIndex = lastRow; } if (scrollIndex > lastRow) { scrollIndex = lastRow; } } if (this.isRowTallerThanView(rowModel.getRow(focusIndex))) { scrollIndex = focusIndex; scrollType = "top"; } this.navigateTo({ scrollIndex, scrollType, scrollColumn: null, focusIndex, focusColumn: gridCell.column }); } navigateToNextPageWithAutoHeight(gridCell, scrollIndex, up = false) { this.navigateTo({ scrollIndex, scrollType: up ? "bottom" : "top", scrollColumn: null, focusIndex: scrollIndex, focusColumn: gridCell.column }); setTimeout(() => { const focusIndex = this.getNextFocusIndexForAutoHeight(gridCell, up); this.navigateTo({ scrollIndex, scrollType: up ? "bottom" : "top", scrollColumn: null, focusIndex, focusColumn: gridCell.column, isAsync: true }); }, 50); } getNextFocusIndexForAutoHeight(gridCell, up = false) { const step = up ? -1 : 1; const pixelsInOnePage = this.getViewportHeight(); const { pageBounds, rowModel } = this.beans; const lastRowIndex = pageBounds.getLastRow(); let pixelSum = 0; let currentIndex = gridCell.rowIndex; while (currentIndex >= 0 && currentIndex <= lastRowIndex) { const currentCell = rowModel.getRow(currentIndex); if (currentCell) { const currentCellHeight = currentCell.rowHeight ?? 0; if (pixelSum + currentCellHeight > pixelsInOnePage) { break; } pixelSum += currentCellHeight; } currentIndex += step; } return Math.max(0, Math.min(currentIndex, lastRowIndex)); } getViewportHeight() { const beans = this.beans; const scrollPosition = getVScroll(beans); const scrollbarWidth = this.beans.scrollVisibleSvc.getScrollbarWidth(); let pixelsInOnePage = scrollPosition.bottom - scrollPosition.top; if (beans.ctrlsSvc.get("center").isHorizontalScrollShowing()) { pixelsInOnePage -= scrollbarWidth; } return pixelsInOnePage; } isRowTallerThanView(rowNode) { if (!rowNode) { return false; } const rowHeight = rowNode.rowHeight; if (typeof rowHeight !== "number") { return false; } return rowHeight > this.getViewportHeight(); } onCtrlUpDownLeftRight(key, gridCell) { const cellToFocus = this.beans.cellNavigation.getNextCellToFocus(key, gridCell, true); if (!cellToFocus) { return; } const normalisedPosition = this.getNormalisedPosition(cellToFocus); const { rowIndex, rowPinned, column } = normalisedPosition ?? cellToFocus; const col = column; this.navigateTo({ scrollIndex: rowIndex, scrollType: null, scrollColumn: col, focusIndex: rowIndex, focusColumn: col, rowPinned }); } // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring // same cell into view (which means either scroll all the way up, or all the way down). onHomeOrEndKey(key) { const homeKey = key === KeyCode.PAGE_HOME; const { visibleCols, pageBounds, rowModel } = this.beans; const allColumns = visibleCols.allCols; const scrollIndex = homeKey ? pageBounds.getFirstRow() : pageBounds.getLastRow(); const rowNode = rowModel.getRow(scrollIndex); if (!rowNode) { return; } const columnToSelect = (homeKey ? allColumns : [...allColumns].reverse()).find( (col) => !col.isSuppressNavigable(rowNode) && !isRowNumberCol(col) ); if (!columnToSelect) { return; } this.navigateTo({ scrollIndex, scrollType: null, scrollColumn: columnToSelect, focusIndex: scrollIndex, focusColumn: columnToSelect }); } // result of keyboard event onTabKeyDown(previous, keyboardEvent) { const backwards = keyboardEvent.shiftKey; const movedToNextCell = this.tabToNextCellCommon(previous, backwards, keyboardEvent); const beans = this.beans; const { ctrlsSvc, pageBounds, focusSvc, gos } = beans; if (movedToNextCell !== false) { if (movedToNextCell) { keyboardEvent.preventDefault(); } else if (movedToNextCell === null) { ctrlsSvc.get("gridCtrl").allowFocusForNextCoreContainer(backwards); } return; } if (backwards) { const { rowIndex, rowPinned } = previous.getRowPosition(); const firstRow = rowPinned ? rowIndex === 0 : rowIndex === pageBounds.getFirstRow(); if (firstRow) { if (gos.get("headerHeight") === 0 || _isHeaderFocusSuppressed(beans)) { _focusNextGridCoreContainer(beans, true, true); } else { keyboardEvent.preventDefault(); focusSvc.focusPreviousFromFirstCell(keyboardEvent); } } } else { if (previous instanceof CellCtrl) { previous.focusCell(true); } if (focusSvc.focusOverlay(false) || _focusNextGridCoreContainer(beans, backwards)) { keyboardEvent.preventDefault(); } } } // comes from API tabToNextCell(backwards, event) { const beans = this.beans; const { focusSvc, rowRenderer } = beans; const focusedCell = focusSvc.getFocusedCell(); if (!focusedCell) { return false; } let cellOrRow = _getCellByPosition(beans, focusedCell); if (!cellOrRow) { cellOrRow = rowRenderer.getRowByPosition(focusedCell); if (!cellOrRow?.isFullWidth()) { return false; } } return !!this.tabToNextCellCommon(cellOrRow, backwards, event, "api"); } tabToNextCellCommon(previous, backwards, event, source = "ui") { const { editSvc, focusSvc } = this.beans; let res = void 0; const cellCtrl = previous instanceof CellCtrl ? previous : previous.getAllCellCtrls()?.[0]; if (editSvc?.isEditing()) { res = editSvc?.moveToNextCell(cellCtrl, backwards, event, source); } else { res = this.moveToNextCellNotEditing(previous, backwards, event); } if (res === null) { return res; } return res || !!focusSvc.focusedHeader; } // returns null if no navigation should be performed moveToNextCellNotEditing(previousCell, backwards, event) { const displayedColumns = this.beans.visibleCols.allCols; let cellPos; if (previousCell instanceof RowCtrl) { cellPos = { ...previousCell.getRowPosition(), column: backwards ? displayedColumns[0] : _last(displayedColumns) }; if (this.gos.get("embedFullWidthRows") && event) { const focusedContainer = previousCell.findFullWidthInfoForEvent(event); if (focusedContainer) { cellPos.column = focusedContainer.column; } } } else { cellPos = previousCell.getFocusedCellPosition(); } const nextCell = this.findNextCellToFocusOn(cellPos, { backwards, startEditing: false }); if (nextCell === false) { return null; } if (nextCell instanceof CellCtrl) { nextCell.focusCell(true); } else if (nextCell) { return this.tryToFocusFullWidthRow(nextCell, backwards); } return _exists(nextCell); } /** * called by the cell, when tab is pressed while editing. * @returns RenderedCell when navigation successful, false if navigation should not be performed, otherwise null */ findNextCellToFocusOn(previousPosition, { backwards, startEditing, skipToNextEditableCell }) { let nextPosition = previousPosition; const beans = this.beans; const { cellNavigation, gos, focusSvc, rowRenderer } = beans; while (true) { if (previousPosition !== nextPosition) { previousPosition = nextPosition; } if (!backwards) { nextPosition = this.getLastCellOfColSpan(nextPosition); } nextPosition = cellNavigation.getNextTabbedCell(nextPosition, backwards); const userFunc = gos.getCallback("tabToNextCell"); if (_exists(userFunc)) { const params = { backwards, editing: startEditing, previousCellPosition: previousPosition, nextCellPosition: nextPosition ? nextPosition : null }; const userResult = userFunc(params); if (userResult === true) { nextPosition = previousPosition; } else if (userResult === false) { return false; } else { nextPosition = { rowIndex: userResult.rowIndex, column: userResult.column, rowPinned: userResult.rowPinned }; } } if (!nextPosition) { return null; } if (nextPosition.rowIndex < 0) { const headerLen = getFocusHeaderRowCount(beans); focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: headerLen + nextPosition.rowIndex, column: nextPosition.column }, fromCell: true }); return null; } const fullRowEdit = gos.get("editType") === "fullRow"; if (startEditing && (!fullRowEdit || skipToNextEditableCell)) { const cellIsEditable = this.isCellEditable(nextPosition); if (!cellIsEditable) { continue; } } this.ensureCellVisible(nextPosition); const nextCell = _getCellByPosition(beans, nextPosition); if (!nextCell) { const row = rowRenderer.getRowByPosition(nextPosition); if (!row || !row.isFullWidth() || startEditing) { continue; } return { ...row.getRowPosition(), column: nextPosition?.column }; } if (cellNavigation.isSuppressNavigable(nextCell.column, nextCell.rowNode)) { continue; } nextCell.setFocusedCellPosition(nextPosition); this.setRangeToCellIfSupported(nextPosition); return nextCell; } } isCellEditable(cell) { const rowNode = this.lookupRowNodeForCell(cell); if (rowNode) { return cell.column.isCellEditable(rowNode); } return false; } lookupRowNodeForCell({ rowIndex, rowPinned }) { const { pinnedRowModel, rowModel } = this.beans; if (rowPinned === "top") { return pinnedRowModel?.getPinnedTopRow(rowIndex); } if (rowPinned === "bottom") { return pinnedRowModel?.getPinnedBottomRow(rowIndex); } return rowModel.getRow(rowIndex); } // we use index for rows, but column object for columns, as the next column (by index) might not // be visible (header grouping) so it's not reliable, so using the column object instead. navigateToNextCell(event, key, currentCell, allowUserOverride) { let nextCell = currentCell; let hitEdgeOfGrid = false; const beans = this.beans; const { cellNavigation, focusSvc, gos } = beans; while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) { if (gos.get("enableRtl")) { if (key === KeyCode.LEFT) { nextCell = this.getLastCellOfColSpan(nextCell); } } else if (key === KeyCode.RIGHT) { nextCell = this.getLastCellOfColSpan(nextCell); } nextCell = cellNavigation.getNextCellToFocus(key, nextCell); hitEdgeOfGrid = _missing(nextCell); } if (hitEdgeOfGrid && event && event.key === KeyCode.UP) { nextCell = { rowIndex: -1, rowPinned: null, column: currentCell.column }; } if (allowUserOverride) { const userFunc = gos.getCallback("navigateToNextCell"); if (_exists(userFunc)) { const params = { key, previousCellPosition: currentCell, nextCellPosition: nextCell ? nextCell : null, event }; const userCell = userFunc(params); if (_exists(userCell)) { nextCell = { rowPinned: userCell.rowPinned, rowIndex: userCell.rowIndex, column: userCell.column }; } else { nextCell = null; } } } if (!nextCell) { return; } if (nextCell.rowIndex < 0) { const headerLen = getFocusHeaderRowCount(beans); focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: headerLen + nextCell.rowIndex, column: nextCell.column ?? currentCell.column }, event: event || void 0, fromCell: true }); return; } const normalisedPosition = this.getNormalisedPosition(nextCell); if (normalisedPosition) { this.focusPosition(normalisedPosition); } else { this.tryToFocusFullWidthRow(nextCell); } } getNormalisedPosition(cellPosition) { const isSpannedCell = !!this.beans.spannedRowRenderer?.getCellByPosition(cellPosition); if (isSpannedCell) { return cellPosition; } this.ensureCellVisible(cellPosition); const cellCtrl = _getCellByPosition(this.beans, cellPosition); if (!cellCtrl) { return null; } cellPosition = cellCtrl.getFocusedCellPosition(); this.ensureCellVisible(cellPosition); return cellPosition; } tryToFocusFullWidthRow(position, backwards) { const { visibleCols, rowRenderer, focusSvc, eventSvc } = this.beans; const displayedColumns = visibleCols.allCols; const rowComp = rowRenderer.getRowByPosition(position); if (!rowComp?.isFullWidth()) { return false; } const currentCellFocused = focusSvc.getFocusedCell(); const cellPosition = { rowIndex: position.rowIndex, rowPinned: position.rowPinned, column: position.column || (backwards ? _last(displayedColumns) : displayedColumns[0]) }; this.focusPosition(cellPosition); const fromBelow = backwards == null ? currentCellFocused != null && _isRowBefore(cellPosition, currentCellFocused) : backwards; eventSvc.dispatchEvent({ type: "fullWidthRowFocused", rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned, column: cellPosition.column, isFullWidthCell: true, fromBelow }); return true; } focusPosition(cellPosition) { const { focusSvc } = this.beans; focusSvc.setFocusedCell({ rowIndex: cellPosition.rowIndex, column: cellPosition.column, rowPinned: cellPosition.rowPinned, forceBrowserFocus: true }); this.setRangeToCellIfSupported(cellPosition); } setRangeToCellIfSupported(cellPosition) { if (isRowNumberCol(cellPosition.column)) { return; } this.beans.rangeSvc?.setRangeToCell(cellPosition); } isValidNavigateCell(cell) { const rowNode = _getRowNode(this.beans, cell); return !!rowNode; } getLastCellOfColSpan(cell) { const cellCtrl = _getCellByPosition(this.beans, cell); if (!cellCtrl) { return cell; } const colSpanningList = cellCtrl.getColSpanningList(); if (colSpanningList.length === 1) { return cell; } return { rowIndex: cell.rowIndex, column: _last(colSpanningList), rowPinned: cell.rowPinned }; } ensureCellVisible(gridCell) { const isGroupStickyEnabled = _isGroupRowsSticky(this.gos); const rowNode = this.beans.rowModel.getRow(gridCell.rowIndex); const skipScrollToRow = isGroupStickyEnabled && rowNode?.sticky; const { scrollFeature } = this.gridBodyCon; if (!skipScrollToRow && _missing(gridCell.rowPinned)) { scrollFeature.ensureIndexVisible(gridCell.rowIndex); } if (!gridCell.column.isPinned()) { scrollFeature.ensureColumnVisible(gridCell.column); } } ensureColumnVisible(column) { const scrollFeature = this.gridBodyCon.scrollFeature; if (!column.isPinned()) { scrollFeature.ensureColumnVisible(column); } } ensureRowVisible(rowIndex) { const scrollFeature = this.gridBodyCon.scrollFeature; scrollFeature.ensureIndexVisible(rowIndex); } }; function getVScroll(beans) { return beans.ctrlsSvc.getScrollFeature().getVScrollPosition(); } var KeyboardNavigationModule = { moduleName: "KeyboardNavigation", version: VERSION, beans: [NavigationService, CellNavigationService, HeaderNavigationService], apiFunctions: { getFocusedCell, clearFocusedCell, setFocusedCell, setFocusedHeader, tabToNextCell, tabToPreviousCell } }; var PageBoundsListener = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pageBoundsListener"; } postConstruct() { this.addManagedEventListeners({ modelUpdated: this.onModelUpdated.bind(this), recalculateRowBounds: this.calculatePages.bind(this) }); this.onModelUpdated(); } onModelUpdated(modelUpdatedEvent) { this.calculatePages(); this.eventSvc.dispatchEvent({ type: "paginationChanged", animate: modelUpdatedEvent?.animate ?? false, newData: modelUpdatedEvent?.newData ?? false, newPage: modelUpdatedEvent?.newPage ?? false, newPageSize: modelUpdatedEvent?.newPageSize ?? false, keepRenderedRows: modelUpdatedEvent?.keepRenderedRows ?? false }); } calculatePages() { const { pageBounds, pagination, rowModel } = this.beans; if (pagination) { pagination.calculatePages(); } else { pageBounds.calculateBounds(0, rowModel.getRowCount() - 1); } } }; var PageBoundsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pageBounds"; this.pixelOffset = 0; } getFirstRow() { return this.topRowBounds?.rowIndex ?? -1; } getLastRow() { return this.bottomRowBounds?.rowIndex ?? -1; } getCurrentPageHeight() { const { topRowBounds, bottomRowBounds } = this; if (!topRowBounds || !bottomRowBounds) { return 0; } return Math.max(bottomRowBounds.rowTop + bottomRowBounds.rowHeight - topRowBounds.rowTop, 0); } getCurrentPagePixelRange() { const { topRowBounds, bottomRowBounds } = this; const pageFirstPixel = topRowBounds?.rowTop ?? 0; const pageLastPixel = bottomRowBounds ? bottomRowBounds.rowTop + bottomRowBounds.rowHeight : 0; return { pageFirstPixel, pageLastPixel }; } calculateBounds(topDisplayedRowIndex, bottomDisplayedRowIndex) { const { rowModel } = this.beans; const topRowBounds = rowModel.getRowBounds(topDisplayedRowIndex); if (topRowBounds) { topRowBounds.rowIndex = topDisplayedRowIndex; } this.topRowBounds = topRowBounds; const bottomRowBounds = rowModel.getRowBounds(bottomDisplayedRowIndex); if (bottomRowBounds) { bottomRowBounds.rowIndex = bottomDisplayedRowIndex; } this.bottomRowBounds = bottomRowBounds; this.calculatePixelOffset(); } getPixelOffset() { return this.pixelOffset; } calculatePixelOffset() { const value = this.topRowBounds?.rowTop ?? 0; if (this.pixelOffset === value) { return; } this.pixelOffset = value; this.eventSvc.dispatchEvent({ type: "paginationPixelOffsetChanged" }); } }; var pinnedColumnModule_default = ".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}"; var SetPinnedWidthFeature = class extends BeanStub { constructor(isLeft, elements) { super(); this.isLeft = isLeft; this.elements = elements; this.getWidth = isLeft ? () => this.beans.pinnedCols.leftWidth : () => this.beans.pinnedCols.rightWidth; } postConstruct() { this.addManagedEventListeners({ [`${this.isLeft ? "left" : "right"}PinnedWidthChanged`]: this.onPinnedWidthChanged.bind(this) }); } onPinnedWidthChanged() { const width = this.getWidth(); const displayed = width > 0; for (const element of this.elements) { if (element) { _setDisplayed(element, displayed); _setFixedWidth(element, width); } } } }; var PinnedColumnService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pinnedCols"; } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCtrl = p.gridBodyCtrl; }); const listener = this.checkContainerWidths.bind(this); this.addManagedEventListeners({ displayedColumnsChanged: listener, displayedColumnsWidthChanged: listener }); this.addManagedPropertyListener("domLayout", listener); } checkContainerWidths() { const { gos, visibleCols, eventSvc } = this.beans; const printLayout = _isDomLayout(gos, "print"); const newLeftWidth = printLayout ? 0 : visibleCols.getColsLeftWidth(); const newRightWidth = printLayout ? 0 : visibleCols.getDisplayedColumnsRightWidth(); if (newLeftWidth != this.leftWidth) { this.leftWidth = newLeftWidth; eventSvc.dispatchEvent({ type: "leftPinnedWidthChanged" }); } if (newRightWidth != this.rightWidth) { this.rightWidth = newRightWidth; eventSvc.dispatchEvent({ type: "rightPinnedWidthChanged" }); } } keepPinnedColumnsNarrowerThanViewport() { const eBodyViewport = this.gridBodyCtrl.eBodyViewport; const bodyWidth = _getInnerWidth(eBodyViewport); if (bodyWidth <= 50) { return; } const processedColumnsToRemove = this.getPinnedColumnsOverflowingViewport(bodyWidth - 50); const processUnpinnedColumns = this.gos.getCallback("processUnpinnedColumns"); const { columns, hasLockedPinned } = processedColumnsToRemove; let columnsToRemove = columns; if (!columnsToRemove.length && !hasLockedPinned) { return; } if (processUnpinnedColumns) { const params = { columns: columnsToRemove, viewportWidth: bodyWidth }; columnsToRemove = processUnpinnedColumns(params); } if (!columnsToRemove?.length) { return; } columnsToRemove = columnsToRemove.filter((col) => !isRowNumberCol(col)); this.setColsPinned(columnsToRemove, null, "viewportSizeFeature"); } createPinnedWidthFeature(isLeft, ...elements) { return new SetPinnedWidthFeature(isLeft, elements); } setColsPinned(keys, pinned, source) { const { colModel, colAnimation, visibleCols, gos } = this.beans; if (!colModel.cols) { return; } if (!keys?.length) { return; } if (_isDomLayout(gos, "print")) { _warn(37); return; } colAnimation?.start(); let actualPinned; if (pinned === true || pinned === "left") { actualPinned = "left"; } else if (pinned === "right") { actualPinned = "right"; } else { actualPinned = null; } const updatedCols = []; for (const key of keys) { if (!key) { continue; } const column = colModel.getCol(key); if (!column) { continue; } if (column.getPinned() !== actualPinned) { this.setColPinned(column, actualPinned); updatedCols.push(column); } } if (updatedCols.length) { visibleCols.refresh(source); dispatchColumnPinnedEvent(this.eventSvc, updatedCols, source); } colAnimation?.finish(); } initCol(column) { const { pinned, initialPinned } = column.colDef; if (pinned !== void 0) { this.setColPinned(column, pinned); } else { this.setColPinned(column, initialPinned); } } setColPinned(column, pinned) { if (pinned === true || pinned === "left") { column.pinned = "left"; } else if (pinned === "right") { column.pinned = "right"; } else { column.pinned = null; } column.dispatchStateUpdatedEvent("pinned"); } setupHeaderPinnedWidth(ctrl) { const { scrollVisibleSvc } = this.beans; if (ctrl.pinned == null) { return; } const pinningLeft = ctrl.pinned === "left"; const pinningRight = ctrl.pinned === "right"; ctrl.hidden = true; const listener = () => { const width = pinningLeft ? this.leftWidth : this.rightWidth; if (width == null) { return; } const hidden = width == 0; const hiddenChanged = ctrl.hidden !== hidden; const isRtl = this.gos.get("enableRtl"); const scrollbarWidth = scrollVisibleSvc.getScrollbarWidth(); const addPaddingForScrollbar = scrollVisibleSvc.verticalScrollShowing && (isRtl && pinningLeft || !isRtl && pinningRight); const widthWithPadding = addPaddingForScrollbar ? width + scrollbarWidth : width; ctrl.comp.setPinnedContainerWidth(`${widthWithPadding}px`); ctrl.comp.setDisplayed(!hidden); if (hiddenChanged) { ctrl.hidden = hidden; ctrl.refresh(); } }; ctrl.addManagedEventListeners({ leftPinnedWidthChanged: listener, rightPinnedWidthChanged: listener, scrollVisibilityChanged: listener, scrollbarWidthChanged: listener }); } getHeaderResizeDiff(diff, column) { const pinned = column.getPinned(); if (pinned) { const { leftWidth, rightWidth } = this; const bodyWidth = _getInnerWidth(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50; if (leftWidth + rightWidth + diff > bodyWidth) { if (bodyWidth > leftWidth + rightWidth) { diff = bodyWidth - leftWidth - rightWidth; } else { return 0; } } } return diff; } getPinnedColumnsOverflowingViewport(viewportWidth) { const pinnedRightWidth = this.rightWidth ?? 0; const pinnedLeftWidth = this.leftWidth ?? 0; const totalPinnedWidth = pinnedRightWidth + pinnedLeftWidth; let hasLockedPinned = false; if (totalPinnedWidth < viewportWidth) { return { columns: [], hasLockedPinned }; } const { visibleCols } = this.beans; const pinnedLeftColumns = [...visibleCols.leftCols]; const pinnedRightColumns = [...visibleCols.rightCols]; let indexRight = 0; let indexLeft = 0; const totalWidthRemoved = 0; const columnsToRemove = []; let spaceNecessary = totalPinnedWidth - totalWidthRemoved - viewportWidth; while ((indexLeft < pinnedLeftColumns.length || indexRight < pinnedRightColumns.length) && spaceNecessary > 0) { if (indexRight < pinnedRightColumns.length) { const currentColumn = pinnedRightColumns[indexRight++]; if (currentColumn.colDef.lockPinned) { hasLockedPinned = true; continue; } spaceNecessary -= currentColumn.getActualWidth(); columnsToRemove.push(currentColumn); } if (indexLeft < pinnedLeftColumns.length && spaceNecessary > 0) { const currentColumn = pinnedLeftColumns[indexLeft++]; if (currentColumn.colDef.lockPinned) { hasLockedPinned = true; continue; } spaceNecessary -= currentColumn.getActualWidth(); columnsToRemove.push(currentColumn); } } return { columns: columnsToRemove, hasLockedPinned }; } }; var PinnedColumnModule = { moduleName: "PinnedColumn", version: VERSION, beans: [PinnedColumnService], css: [pinnedColumnModule_default] }; var BaseAriaAnnouncementService = class extends AgBeanStub { constructor() { super(); this.beanName = "ariaAnnounce"; this.descriptionContainer = null; this.pendingAnnouncements = /* @__PURE__ */ new Map(); this.lastAnnouncement = ""; this.updateAnnouncement = _debounce(this, this.updateAnnouncement.bind(this), 200); } postConstruct() { const beans = this.beans; const eDocument = _getDocument(beans); const div = this.descriptionContainer = eDocument.createElement("div"); div.classList.add("ag-aria-description-container"); _setAriaLive(div, "polite"); _setAriaRelevant(div, "additions text"); _setAriaAtomic(div, true); beans.eRootDiv.appendChild(div); } /** * @param key used for debouncing calls */ announceValue(value, key) { this.pendingAnnouncements.set(key, value); this.updateAnnouncement(); } updateAnnouncement() { if (!this.descriptionContainer) { return; } const value = Array.from(this.pendingAnnouncements.values()).join(". "); this.pendingAnnouncements.clear(); this.descriptionContainer.textContent = ""; setTimeout(() => { this.handleAnnouncementUpdate(value); }, 50); } handleAnnouncementUpdate(value) { if (!this.isAlive() || !this.descriptionContainer) { return; } let valueToAnnounce = value; if (valueToAnnounce == null || valueToAnnounce.replace(/[ .]/g, "") == "") { this.lastAnnouncement = ""; return; } if (this.lastAnnouncement === valueToAnnounce) { valueToAnnounce = `${valueToAnnounce}\u200B`; } this.lastAnnouncement = valueToAnnounce; this.descriptionContainer.textContent = valueToAnnounce; } destroy() { super.destroy(); const { descriptionContainer } = this; if (descriptionContainer) { _clearElement(descriptionContainer); descriptionContainer.remove(); } this.descriptionContainer = null; this.pendingAnnouncements.clear(); } }; var AriaAnnouncementService = class extends BaseAriaAnnouncementService { }; var AriaModule = { moduleName: "Aria", version: VERSION, beans: [AriaAnnouncementService] }; var column_delay_render_default = ":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}"; var HideClass = "ag-delay-render"; var ColumnDelayRenderService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colDelayRenderSvc"; this.hideRequested = false; this.alreadyRevealed = false; this.timesRetried = 0; this.requesters = /* @__PURE__ */ new Set(); } hideColumns(key) { if (this.alreadyRevealed || this.requesters.has(key)) { return; } this.requesters.add(key); if (!this.hideRequested) { this.beans.ctrlsSvc.whenReady(this, (p) => { p.gridBodyCtrl.eGridBody.classList.add(HideClass); }); this.hideRequested = true; } } revealColumns(key) { if (this.alreadyRevealed || !this.isAlive()) { return; } this.requesters.delete(key); if (this.requesters.size > 0) { return; } const { renderStatus, ctrlsSvc } = this.beans; if (renderStatus) { if (!renderStatus.areHeaderCellsRendered() && this.timesRetried < 5) { this.timesRetried++; setTimeout(() => this.revealColumns(key)); return; } this.timesRetried = 0; } ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(HideClass); this.alreadyRevealed = true; } }; var ColumnDelayRenderModule = { moduleName: "ColumnDelayRender", version: VERSION, beans: [ColumnDelayRenderService], css: [column_delay_render_default] }; var OverlayComponent = class extends Component { constructor() { super(); } }; var ExportingOverlayElement = { tag: "div", cls: "ag-overlay-exporting-center", children: [ { tag: "span", ref: "eExportingIcon", cls: "ag-loading-icon" }, { tag: "span", ref: "eExportingText", cls: "ag-exporting-text" } ] }; var ExportingOverlayComponent = class extends OverlayComponent { constructor() { super(...arguments); this.eExportingIcon = RefPlaceholder; this.eExportingText = RefPlaceholder; } init(params) { const { beans } = this; this.setTemplate(ExportingOverlayElement); const eExportingIcon = _createIconNoSpan("overlayExporting", beans, null); if (eExportingIcon) { this.eExportingIcon.appendChild(eExportingIcon); } const exportingText = params.exporting?.overlayText ?? this.getLocaleTextFunc()("exportingOoo", "Exporting..."); this.eExportingText.textContent = exportingText; beans.ariaAnnounce.announceValue(exportingText, "overlay"); } }; var LoadingOverlayElement = { tag: "div", cls: "ag-overlay-loading-center", children: [ { tag: "span", ref: "eLoadingIcon", cls: "ag-loading-icon" }, { tag: "span", ref: "eLoadingText", cls: "ag-loading-text" } ] }; var LoadingOverlayComponent = class extends OverlayComponent { constructor() { super(...arguments); this.eLoadingIcon = RefPlaceholder; this.eLoadingText = RefPlaceholder; } init(params) { const { beans, gos } = this; const customTemplate = _makeNull(gos.get("overlayLoadingTemplate")?.trim()); this.setTemplate(customTemplate ?? LoadingOverlayElement); if (!customTemplate) { const eLoadingIcon = _createIconNoSpan("overlayLoading", beans, null); if (eLoadingIcon) { this.eLoadingIcon.appendChild(eLoadingIcon); } const loadingText = params.loading?.overlayText ?? this.getLocaleTextFunc()("loadingOoo", "Loading..."); this.eLoadingText.textContent = loadingText; beans.ariaAnnounce.announceValue(loadingText, "overlay"); } } }; var NoMatchingRowsOverlayElement = { tag: "span", cls: "ag-overlay-no-matching-rows-center" }; var NoMatchingRowsOverlayComponent = class extends OverlayComponent { init(params) { const { beans } = this; this.setTemplate(NoMatchingRowsOverlayElement); const noRowsText = params.noMatchingRows?.overlayText ?? this.getLocaleTextFunc()("noMatchingRows", "No Matching Rows"); this.getGui().textContent = noRowsText; beans.ariaAnnounce.announceValue(noRowsText, "overlay"); } }; var NoRowsOverlayElement = { tag: "span", cls: "ag-overlay-no-rows-center" }; var NoRowsOverlayComponent = class extends OverlayComponent { init(params) { const { beans, gos } = this; const customTemplate = _makeNull(gos.get("overlayNoRowsTemplate")?.trim()); this.setTemplate(customTemplate ?? NoRowsOverlayElement); if (!customTemplate) { const noRowsText = params.noRows?.overlayText ?? this.getLocaleTextFunc()("noRowsToShow", "No Rows To Show"); this.getGui().textContent = noRowsText; beans.ariaAnnounce.announceValue(noRowsText, "overlay"); } } }; function showLoadingOverlay(beans) { beans.overlays?.showLoadingOverlay(); } function showNoRowsOverlay(beans) { beans.overlays?.showNoRowsOverlay(); } function hideOverlay(beans) { beans.overlays?.hideOverlay(); } var overlayWrapperComponent_default = ".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}"; var OverlayWrapperElement = { tag: "div", cls: "ag-overlay", role: "presentation", children: [ { tag: "div", cls: "ag-overlay-panel", role: "presentation", children: [{ tag: "div", ref: "eOverlayWrapper", cls: "ag-overlay-wrapper", role: "presentation" }] } ] }; var OverlayWrapperComponent = class extends Component { constructor() { super(OverlayWrapperElement); this.eOverlayWrapper = RefPlaceholder; this.activeOverlay = null; this.activePromise = null; this.activeCssClass = null; this.elToFocusAfter = null; this.overlayExclusive = false; this.oldWrapperPadding = null; this.registerCSS(overlayWrapperComponent_default); } handleKeyDown(e) { if (e.key !== KeyCode.TAB || e.defaultPrevented || _isStopPropagationForAgGrid(e)) { return; } const { beans, eOverlayWrapper } = this; const nextEl = eOverlayWrapper && _findNextFocusableElement(beans, eOverlayWrapper, false, e.shiftKey); if (nextEl) { return; } let isFocused = false; if (e.shiftKey) { isFocused = beans.focusSvc.focusGridView({ column: _last(beans.visibleCols.allCols), backwards: true, canFocusOverlay: false }); } else { isFocused = _focusNextGridCoreContainer(beans, false); } if (isFocused) { e.preventDefault(); } } updateLayoutClasses(cssClass, params) { const eOverlayWrapper = this.eOverlayWrapper; if (!eOverlayWrapper) { return; } const overlayWrapperClassList = eOverlayWrapper.classList; const { AUTO_HEIGHT, NORMAL, PRINT } = LayoutCssClasses; overlayWrapperClassList.toggle(AUTO_HEIGHT, params.autoHeight); overlayWrapperClassList.toggle(NORMAL, params.normal); overlayWrapperClassList.toggle(PRINT, params.print); } postConstruct() { this.createManagedBean(new LayoutFeature(this)); this.setDisplayed(false, { skipAriaHidden: true }); this.beans.overlays.setWrapperComp(this, false); this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) }); this.addManagedEventListeners({ gridSizeChanged: this.refreshWrapperPadding.bind(this) }); } setWrapperTypeClass(overlayWrapperCssClass) { const overlayWrapperClassList = this.eOverlayWrapper?.classList; if (!overlayWrapperClassList) { this.activeCssClass = null; return; } if (this.activeCssClass) { overlayWrapperClassList.toggle(this.activeCssClass, false); } this.activeCssClass = overlayWrapperCssClass; overlayWrapperClassList.toggle(overlayWrapperCssClass, true); } showOverlay(overlayComponentPromise, overlayWrapperCssClass, exclusive) { this.destroyActiveOverlay(); this.elToFocusAfter = null; this.activePromise = overlayComponentPromise; this.overlayExclusive = exclusive; if (!overlayComponentPromise) { this.refreshWrapperPadding(); return AgPromise.resolve(); } this.setWrapperTypeClass(overlayWrapperCssClass); this.setDisplayed(true, { skipAriaHidden: true }); this.refreshWrapperPadding(); if (exclusive && this.isGridFocused()) { const activeElement = _getActiveDomElement(this.beans); if (activeElement && !_isNothingFocused(this.beans)) { this.elToFocusAfter = activeElement; } } overlayComponentPromise.then((comp) => { const eOverlayWrapper = this.eOverlayWrapper; if (!eOverlayWrapper) { this.destroyBean(comp); return; } if (this.activePromise !== overlayComponentPromise) { if (this.activeOverlay !== comp) { this.destroyBean(comp); comp = null; } return; } this.activePromise = null; if (!comp) { return; } if (this.activeOverlay !== comp) { eOverlayWrapper.appendChild(comp.getGui()); this.activeOverlay = comp; } if (exclusive && this.isGridFocused()) { _focusInto(eOverlayWrapper); } }); return overlayComponentPromise; } refreshWrapperPadding() { if (!this.eOverlayWrapper) { this.oldWrapperPadding = null; return; } const overlayActive = !!this.activeOverlay || !!this.activePromise; let padding = 0; if (overlayActive && !this.overlayExclusive) { padding = this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight || 0; } if (padding !== this.oldWrapperPadding) { this.oldWrapperPadding = padding; this.eOverlayWrapper.style.setProperty("padding-top", `${padding}px`); } } destroyActiveOverlay() { this.activePromise = null; const activeOverlay = this.activeOverlay; if (!activeOverlay) { this.overlayExclusive = false; this.elToFocusAfter = null; this.refreshWrapperPadding(); return; } let elementToFocus = this.elToFocusAfter; this.elToFocusAfter = null; this.activeOverlay = null; this.overlayExclusive = false; if (elementToFocus && !this.isGridFocused()) { elementToFocus = null; } this.destroyBean(activeOverlay); const eOverlayWrapper = this.eOverlayWrapper; if (eOverlayWrapper) { _clearElement(eOverlayWrapper); } elementToFocus?.focus?.({ preventScroll: true }); this.refreshWrapperPadding(); } hideOverlay() { this.destroyActiveOverlay(); this.setDisplayed(false, { skipAriaHidden: true }); } isGridFocused() { const activeEl = _getActiveDomElement(this.beans); return !!activeEl && this.beans.eGridDiv.contains(activeEl); } destroy() { this.elToFocusAfter = null; this.destroyActiveOverlay(); this.beans.overlays.setWrapperComp(this, true); super.destroy(); this.eOverlayWrapper = null; } }; var OverlayWrapperSelector = { selector: "AG-OVERLAY-WRAPPER", component: OverlayWrapperComponent }; var overlayCompTypeOptionalMethods = ["refresh"]; var overlayCompType = (name) => ({ name, optionalMethods: overlayCompTypeOptionalMethods }); var LoadingOverlayDef = { id: "agLoadingOverlay", overlayType: "loading", comp: overlayCompType("loadingOverlayComponent"), wrapperCls: "ag-overlay-loading-wrapper", exclusive: true, compKey: "loadingOverlayComponent", paramsKey: "loadingOverlayComponentParams", isSuppressed: (gos) => { const isLoading = gos.get("loading"); return isLoading === false || gos.get("suppressLoadingOverlay") === true && isLoading !== true; } }; var NoRowsOverlayDef = { id: "agNoRowsOverlay", overlayType: "noRows", comp: overlayCompType("noRowsOverlayComponent"), wrapperCls: "ag-overlay-no-rows-wrapper", compKey: "noRowsOverlayComponent", paramsKey: "noRowsOverlayComponentParams", isSuppressed: (gos) => gos.get("suppressNoRowsOverlay") }; var NoMatchingRowsOverlayDef = { id: "agNoMatchingRowsOverlay", overlayType: "noMatchingRows", comp: overlayCompType("noMatchingRowsOverlayComponent"), wrapperCls: "ag-overlay-no-matching-rows-wrapper" }; var ExportingOverlayDef = { id: "agExportingOverlay", overlayType: "exporting", comp: overlayCompType("exportingOverlayComponent"), wrapperCls: "ag-overlay-exporting-wrapper", exclusive: true }; var CustomOverlayDef = { id: "activeOverlay", comp: overlayCompType("activeOverlay"), wrapperCls: "ag-overlay-modal-wrapper", exclusive: true }; var getActiveOverlayDef = (activeOverlay) => { if (!activeOverlay) { return null; } return { agLoadingOverlay: LoadingOverlayDef, agNoRowsOverlay: NoRowsOverlayDef, agNoMatchingRowsOverlay: NoMatchingRowsOverlayDef, agExportingOverlay: ExportingOverlayDef }[activeOverlay] ?? CustomOverlayDef; }; var getOverlayDefForType = (overlayType) => { if (!overlayType) { return null; } return { loading: LoadingOverlayDef, noRows: NoRowsOverlayDef, noMatchingRows: NoMatchingRowsOverlayDef, exporting: ExportingOverlayDef }[overlayType]; }; var OverlayService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "overlays"; this.eWrapper = void 0; this.exclusive = false; this.oldExclusive = false; this.currentDef = null; this.showInitialOverlay = true; this.userForcedNoRows = false; this.exportsInProgress = 0; this.newColumnsLoadedCleanup = null; } postConstruct() { const gos = this.gos; this.showInitialOverlay = _isClientSideRowModel(gos); const updateOverlayVisibility = () => { if (this.userForcedNoRows) { return; } this.updateOverlay(false); }; const [newColumnsLoadedCleanup, rowCountReadyCleanup, _, __] = this.addManagedEventListeners({ newColumnsLoaded: updateOverlayVisibility, rowCountReady: () => { this.disableInitialOverlay(); updateOverlayVisibility(); rowCountReadyCleanup(); }, rowDataUpdated: updateOverlayVisibility, modelUpdated: updateOverlayVisibility }); this.newColumnsLoadedCleanup = newColumnsLoadedCleanup; this.addManagedPropertyListeners( [ "loading", "activeOverlay", "activeOverlayParams", "overlayComponentParams", "loadingOverlayComponentParams", "noRowsOverlayComponentParams" ], (params) => this.onPropChange(new Set(params.changeSet?.properties)) ); } destroy() { this.doHideOverlay(); super.destroy(); this.eWrapper = void 0; } setWrapperComp(overlayWrapperComp, destroyed) { if (!this.isAlive()) { return; } if (!destroyed) { this.eWrapper = overlayWrapperComp; } else if (this.eWrapper === overlayWrapperComp) { this.eWrapper = void 0; } this.updateOverlay(false); } /** Returns true if the overlay is visible. */ isVisible() { return !!this.currentDef; } showLoadingOverlay() { this.showInitialOverlay = false; const gos = this.gos; if (!this.eWrapper || gos.get("activeOverlay")) { return; } if (this.isDisabled(LoadingOverlayDef)) { return; } const loading = gos.get("loading"); if (!loading && loading !== void 0) { return; } this.doShowOverlay(LoadingOverlayDef); } showNoRowsOverlay() { this.showInitialOverlay = false; const gos = this.gos; if (!this.eWrapper || gos.get("activeOverlay") || gos.get("loading") || this.isDisabled(NoRowsOverlayDef)) { return; } this.userForcedNoRows = true; this.doShowOverlay(NoRowsOverlayDef); } async showExportOverlay(heavyOperation) { const { gos, beans } = this; if (!this.eWrapper || gos.get("activeOverlay") || gos.get("loading") || this.isDisabled(ExportingOverlayDef) || this.userForcedNoRows && this.currentDef === NoRowsOverlayDef) { heavyOperation(); return; } const desiredDef = this.getDesiredDefWithOverride(ExportingOverlayDef); if (!desiredDef) { heavyOperation(); return; } this.exportsInProgress++; this.focusedCell = beans.focusSvc.getFocusedCell(); await this.doShowOverlay(desiredDef); await new Promise((resolve) => setTimeout(() => resolve())); const shownAt = Date.now(); try { heavyOperation(); } finally { const elapsed = Date.now() - shownAt; const remaining = Math.max(0, 300 - elapsed); const clearExportOverlay = () => { this.exportsInProgress--; if (this.exportsInProgress === 0) { this.updateOverlay(false); _attemptToRestoreCellFocus(beans, this.focusedCell); this.focusedCell = null; } }; if (remaining > 0) { setTimeout(() => clearExportOverlay(), remaining); } else { clearExportOverlay(); } } } hideOverlay() { const gos = this.gos; this.showInitialOverlay = false; const userHadForced = this.userForcedNoRows; this.userForcedNoRows = false; if (gos.get("loading")) { _warn(99); return; } if (gos.get("activeOverlay")) { _warn(296); return; } if (this.currentDef === NoMatchingRowsOverlayDef) { _warn(297); return; } this.doHideOverlay(); if (userHadForced) { if (this.getOverlayDef() !== NoRowsOverlayDef) { this.updateOverlay(false); } } } getOverlayWrapperSelector() { return OverlayWrapperSelector; } getOverlayWrapperCompClass() { return OverlayWrapperComponent; } onPropChange(changedProps) { const activeOverlayChanged = changedProps.has("activeOverlay"); if (activeOverlayChanged || changedProps.has("loading")) { if (this.updateOverlay(activeOverlayChanged)) { return; } } const currentDef = this.currentDef; const currOverlayComp = this.eWrapper?.activeOverlay; if (currOverlayComp && currentDef) { const activeOverlayParamsChanged = changedProps.has("activeOverlayParams"); if (currentDef === CustomOverlayDef) { if (activeOverlayParamsChanged) { currOverlayComp.refresh?.(this.makeCompParams(true)); } } else { const paramsKey = currentDef.paramsKey; if (changedProps.has("overlayComponentParams") || paramsKey && changedProps.has(paramsKey)) { currOverlayComp.refresh?.(this.makeCompParams(false, paramsKey, currentDef.overlayType)); } } } } updateOverlay(activeOverlayChanged) { const eWrapper = this.eWrapper; if (!eWrapper) { this.currentDef = null; return false; } const desiredDef = this.getDesiredDefWithOverride(); const currentDef = this.currentDef; const shouldReload = desiredDef === CustomOverlayDef && activeOverlayChanged; if (desiredDef !== currentDef) { if (!desiredDef) { this.disableInitialOverlay(); return this.doHideOverlay(); } this.doShowOverlay(desiredDef); return true; } if (shouldReload && desiredDef) { eWrapper.hideOverlay(); this.doShowOverlay(desiredDef); return true; } if (!desiredDef) { this.disableInitialOverlay(); } return false; } getDesiredDefWithOverride(defaultDef) { const { gos } = this; let desiredDef = getActiveOverlayDef(gos.get("activeOverlay")); if (!desiredDef) { desiredDef = defaultDef ?? this.getOverlayDef(); if (desiredDef && this.isDisabled(desiredDef)) { desiredDef = null; } } return desiredDef; } getOverlayDef() { const { gos, beans } = this; const { rowModel } = beans; const loading = gos.get("loading"); const loadingDefined = loading !== void 0; if (loadingDefined) { this.disableInitialOverlay(); if (loading) { return LoadingOverlayDef; } } else if (this.showInitialOverlay) { if (!this.isDisabled(LoadingOverlayDef) && (!gos.get("columnDefs") || !gos.get("rowData"))) { return LoadingOverlayDef; } this.disableInitialOverlay(); } else { this.disableInitialOverlay(); } const overlayType = rowModel.getOverlayType(); return getOverlayDefForType(overlayType); } disableInitialOverlay() { this.showInitialOverlay = false; this.newColumnsLoadedCleanup?.(); this.newColumnsLoadedCleanup = null; } /** * Show an overlay requested by name or by built-in types. * This single function replaces the previous three helpers and handles * param selection and wrapper class choice for loading / no-rows and custom overlays. */ doShowOverlay(componentDef) { const { gos, beans } = this; const { userCompFactory } = beans; this.currentDef = componentDef; const isProvidedOverlay = componentDef !== CustomOverlayDef; const exclusive = !!componentDef.exclusive; this.exclusive = exclusive; let legacyParamsKey; if (componentDef.paramsKey && gos.get(componentDef.paramsKey) || componentDef.compKey && gos.get(componentDef.compKey)) { legacyParamsKey = componentDef.paramsKey; } let compDetails = void 0; if (isProvidedOverlay) { if (gos.get("overlayComponent") || gos.get("overlayComponentSelector")) { compDetails = userCompFactory.getCompDetailsFromGridOptions( { name: "overlayComponent", optionalMethods: ["refresh"] }, void 0, this.makeCompParams(false, componentDef.paramsKey, componentDef.overlayType) ); } } compDetails ?? (compDetails = userCompFactory.getCompDetailsFromGridOptions( componentDef.comp, isProvidedOverlay ? componentDef.id : void 0, this.makeCompParams(!isProvidedOverlay, legacyParamsKey, componentDef.overlayType), false )); const promise = compDetails?.newAgStackInstance() ?? null; const mountedPromise = this.eWrapper ? this.eWrapper.showOverlay(promise, componentDef.wrapperCls, exclusive) : AgPromise.resolve(); this.eWrapper?.refreshWrapperPadding(); this.setExclusive(exclusive); return mountedPromise; } makeCompParams(includeActiveOverlayParams, legacyParamsKey, overlayType) { const { gos } = this; const params = includeActiveOverlayParams ? gos.get("activeOverlayParams") : { ...gos.get("overlayComponentParams"), ...legacyParamsKey && gos.get(legacyParamsKey) || null, overlayType }; return _addGridCommonParams(gos, params ?? {}); } doHideOverlay() { let changed = false; if (this.currentDef) { this.currentDef = null; changed = true; } this.exclusive = false; const eWrapper = this.eWrapper; if (eWrapper) { eWrapper.hideOverlay(); eWrapper.refreshWrapperPadding(); this.setExclusive(false); } return changed; } setExclusive(exclusive) { if (this.oldExclusive !== exclusive) { this.oldExclusive = exclusive; this.eventSvc.dispatchEvent({ type: "overlayExclusiveChanged" }); } } isDisabled(def) { const { gos } = this; return def.overlayType && gos.get("suppressOverlays")?.includes(def.overlayType) || def.isSuppressed?.(gos) === true; } }; var OverlayModule = { moduleName: "Overlay", version: VERSION, userComponents: { agLoadingOverlay: LoadingOverlayComponent, agNoRowsOverlay: NoRowsOverlayComponent, agNoMatchingRowsOverlay: NoMatchingRowsOverlayComponent, agExportingOverlay: ExportingOverlayComponent }, apiFunctions: { showLoadingOverlay, showNoRowsOverlay, hideOverlay }, icons: { // rotating spinner shown by the loading overlay overlayLoading: "loading", overlayExporting: "loading" }, beans: [OverlayService] }; var RowContainerHeightService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowContainerHeight"; this.scrollY = 0; this.uiBodyHeight = 0; } postConstruct() { this.addManagedEventListeners({ bodyHeightChanged: this.updateOffset.bind(this) }); this.maxDivHeight = _getMaxDivHeight(); _logIfDebug(this.gos, "RowContainerHeightService - maxDivHeight = " + this.maxDivHeight); } updateOffset() { if (!this.stretching) { return; } const newScrollY = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top; const newBodyHeight = this.getUiBodyHeight(); const atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight; if (atLeastOneChanged) { this.scrollY = newScrollY; this.uiBodyHeight = newBodyHeight; this.calculateOffset(); } } calculateOffset() { this.setUiContainerHeight(this.maxDivHeight); this.pixelsToShave = this.modelHeight - this.uiContainerHeight; this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight; const scrollPercent = this.scrollY / this.maxScrollY; const divStretchOffset = scrollPercent * this.pixelsToShave; _logIfDebug( this.gos, `RowContainerHeightService - Div Stretch Offset = ${divStretchOffset} (${this.pixelsToShave} * ${scrollPercent})` ); this.setDivStretchOffset(divStretchOffset); } setUiContainerHeight(height) { if (height !== this.uiContainerHeight) { this.uiContainerHeight = height; this.eventSvc.dispatchEvent({ type: "rowContainerHeightChanged" }); } } clearOffset() { this.setUiContainerHeight(this.modelHeight); this.pixelsToShave = 0; this.setDivStretchOffset(0); } setDivStretchOffset(newOffset) { const newOffsetFloor = typeof newOffset === "number" ? Math.floor(newOffset) : null; if (this.divStretchOffset === newOffsetFloor) { return; } this.divStretchOffset = newOffsetFloor; this.eventSvc.dispatchEvent({ type: "heightScaleChanged" }); } setModelHeight(modelHeight) { this.modelHeight = modelHeight; this.stretching = modelHeight != null && // null happens when in print layout this.maxDivHeight > 0 && modelHeight > this.maxDivHeight; if (this.stretching) { this.calculateOffset(); } else { this.clearOffset(); } } getRealPixelPosition(modelPixel) { return modelPixel - this.divStretchOffset; } getUiBodyHeight() { const pos = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition(); return pos.bottom - pos.top; } getScrollPositionForPixel(rowTop) { if (this.pixelsToShave <= 0) { return rowTop; } const modelMaxScroll = this.modelHeight - this.getUiBodyHeight(); const scrollPercent = rowTop / modelMaxScroll; const scrollPixel = this.maxScrollY * scrollPercent; return scrollPixel; } }; var ROW_ANIMATION_TIMEOUT = 400; var RowRenderer = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowRenderer"; this.destroyFuncsForColumnListeners = []; this.rowCtrlsByRowIndex = {}; this.zombieRowCtrls = {}; this.allRowCtrls = []; this.topRowCtrls = []; this.bottomRowCtrls = []; this.refreshInProgress = false; this.dataFirstRenderedFired = false; this.setupRangeSelectionListeners = () => { const onCellSelectionChanged = () => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onCellSelectionChanged(); } }; const onColumnMovedPinnedVisible = () => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.updateRangeBordersIfRangeCount(); } }; const addCellSelectionListeners = () => { this.eventSvc.addListener("cellSelectionChanged", onCellSelectionChanged); this.eventSvc.addListener("columnMoved", onColumnMovedPinnedVisible); this.eventSvc.addListener("columnPinned", onColumnMovedPinnedVisible); this.eventSvc.addListener("columnVisible", onColumnMovedPinnedVisible); }; const removeCellSelectionListeners = () => { this.eventSvc.removeListener("cellSelectionChanged", onCellSelectionChanged); this.eventSvc.removeListener("columnMoved", onColumnMovedPinnedVisible); this.eventSvc.removeListener("columnPinned", onColumnMovedPinnedVisible); this.eventSvc.removeListener("columnVisible", onColumnMovedPinnedVisible); }; this.addDestroyFunc(() => removeCellSelectionListeners()); this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => { const isEnabled = _isCellSelectionEnabled(this.gos); if (isEnabled) { addCellSelectionListeners(); } else { removeCellSelectionListeners(); } }); const cellSelectionEnabled = _isCellSelectionEnabled(this.gos); if (cellSelectionEnabled) { addCellSelectionListeners(); } }; } wireBeans(beans) { this.pageBounds = beans.pageBounds; this.colModel = beans.colModel; this.pinnedRowModel = beans.pinnedRowModel; this.rowModel = beans.rowModel; this.focusSvc = beans.focusSvc; this.rowContainerHeight = beans.rowContainerHeight; this.ctrlsSvc = beans.ctrlsSvc; this.editSvc = beans.editSvc; } postConstruct() { this.ctrlsSvc.whenReady(this, (p) => { this.gridBodyCtrl = p.gridBodyCtrl; this.initialise(); }); } initialise() { this.addManagedEventListeners({ paginationChanged: this.onPageLoaded.bind(this), pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this), pinnedRowsChanged: this.onPinnedRowsChanged.bind(this), displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), bodyScroll: this.onBodyScroll.bind(this), bodyHeightChanged: this.redraw.bind(this, {}) }); this.addManagedPropertyListeners(["domLayout", "embedFullWidthRows"], () => this.onDomLayoutChanged()); this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction", "rowBuffer"], () => this.redraw()); this.addManagedPropertyListener("suppressCellFocus", (e) => this.onSuppressCellFocusChanged(e.currentValue)); this.addManagedPropertyListeners( [ "groupSuppressBlankHeader", "getBusinessKeyForNode", "fullWidthCellRenderer", "fullWidthCellRendererParams", "suppressStickyTotalRow", "groupRowRenderer", "groupRowRendererParams", // maybe only needs to refresh FW rows... "loadingCellRenderer", "loadingCellRendererParams", "detailCellRenderer", "detailCellRendererParams", "enableRangeSelection", "enableCellTextSelection" ], () => this.redrawRows() ); this.addManagedPropertyListener("cellSelection", ({ currentValue, previousValue }) => { if (!previousValue && currentValue || previousValue && !currentValue) { this.redrawRows(); } }); const { stickyRowSvc, gos, showRowGroupCols } = this.beans; if (showRowGroupCols) { this.addManagedPropertyListener("showOpenedGroup", () => { const columns = showRowGroupCols.columns; if (columns.length) { this.refreshCells({ columns, force: true }); } }); } if (stickyRowSvc) { this.stickyRowFeature = stickyRowSvc.createStickyRowFeature( this, this.createRowCon.bind(this), this.destroyRowCtrls.bind(this) ); } else { const gridBodyCtrl = this.gridBodyCtrl; gridBodyCtrl.setStickyTopHeight(0); gridBodyCtrl.setStickyBottomHeight(0); } this.registerCellEventListeners(); this.initialiseCache(); this.printLayout = _isDomLayout(gos, "print"); this.embedFullWidthRows = this.printLayout || gos.get("embedFullWidthRows"); this.redrawAfterModelUpdate(); } initialiseCache() { if (this.gos.get("keepDetailRows")) { const countProp = this.getKeepDetailRowsCount(); const count = countProp != null ? countProp : 3; this.cachedRowCtrls = new RowCtrlCache(count); } } getKeepDetailRowsCount() { return this.gos.get("keepDetailRowsCount"); } getStickyTopRowCtrls() { return this.stickyRowFeature?.stickyTopRowCtrls ?? []; } getStickyBottomRowCtrls() { return this.stickyRowFeature?.stickyBottomRowCtrls ?? []; } updateAllRowCtrls() { const liveList = Object.values(this.rowCtrlsByRowIndex); const zombieList = Object.values(this.zombieRowCtrls); const cachedList = this.cachedRowCtrls?.getEntries() ?? []; if (zombieList.length > 0 || cachedList.length > 0) { this.allRowCtrls = [...liveList, ...zombieList, ...cachedList]; } else { this.allRowCtrls = liveList; } } /** * Checks if the cell is rendered or not. Also returns true if row ctrl is present but has not rendered * cells yet. * @returns true if cellCtrl is present, or if the row is present but has not rendered rows yet */ isCellBeingRendered(rowIndex, column) { const rowCtrl = this.rowCtrlsByRowIndex[rowIndex]; if (!column || !rowCtrl) { return !!rowCtrl; } if (rowCtrl.isFullWidth()) { return true; } const spannedCell = this.beans.spannedRowRenderer?.getCellByPosition({ rowIndex, column, rowPinned: null }); return !!spannedCell || !!rowCtrl.getCellCtrl(column) || !rowCtrl.isRowRendered(); } /** * Notifies all row and cell controls of any change in focused cell. * @param event cell focused event */ updateCellFocus(event) { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onCellFocused(event); } for (const rowCtrl of this.getFullWidthRowCtrls()) { rowCtrl.onFullWidthRowFocused(event); } } /** * Called when a new cell is focused in the grid * - if the focused cell isn't rendered; re-draw rows to dry to render it * - subsequently updates all cell and row controls with the new focused cell * @param event cell focused event */ onCellFocusChanged(event) { if (event?.rowIndex != null && !event.rowPinned) { const col = this.beans.colModel.getCol(event.column) ?? void 0; if (!this.isCellBeingRendered(event.rowIndex, col)) { this.redraw(); } } this.updateCellFocus(event); } onSuppressCellFocusChanged(suppressCellFocus) { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onSuppressCellFocusChanged(suppressCellFocus); } for (const rowCtrl of this.getFullWidthRowCtrls()) { rowCtrl.onSuppressCellFocusChanged(suppressCellFocus); } } // in a clean design, each cell would register for each of these events. however when scrolling, all the cells // registering and de-registering for events is a performance bottleneck. so we register here once and inform // all active cells. registerCellEventListeners() { this.addManagedEventListeners({ cellFocused: (event) => this.onCellFocusChanged(event), cellFocusCleared: () => this.updateCellFocus(), flashCells: (event) => { const { cellFlashSvc } = this.beans; if (cellFlashSvc) { for (const cellCtrl of this.getAllCellCtrls()) { cellFlashSvc.onFlashCells(cellCtrl, event); } } }, columnHoverChanged: () => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onColumnHover(); } }, displayedColumnsChanged: () => { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onDisplayedColumnsChanged(); } }, displayedColumnsWidthChanged: () => { if (this.printLayout) { for (const cellCtrl of this.getAllCellCtrls()) { cellCtrl.onLeftChanged(); } } } }); this.setupRangeSelectionListeners(); this.refreshListenersToColumnsForCellComps(); this.addManagedEventListeners({ gridColumnsChanged: this.refreshListenersToColumnsForCellComps.bind(this) }); this.addDestroyFunc(this.removeGridColumnListeners.bind(this)); } // executes all functions in destroyFuncsForColumnListeners and then clears the list removeGridColumnListeners() { for (const func of this.destroyFuncsForColumnListeners) { func(); } this.destroyFuncsForColumnListeners.length = 0; } // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for. // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here // once instead. refreshListenersToColumnsForCellComps() { this.removeGridColumnListeners(); const cols = this.colModel.getCols(); for (const col of cols) { const forEachCellWithThisCol = (callback) => { for (const cellCtrl of this.getAllCellCtrls()) { if (cellCtrl.column === col) { callback(cellCtrl); } } }; const leftChangedListener = () => { forEachCellWithThisCol((cellCtrl) => cellCtrl.onLeftChanged()); }; const widthChangedListener = () => { forEachCellWithThisCol((cellCtrl) => cellCtrl.onWidthChanged()); }; const firstRightPinnedChangedListener = () => { forEachCellWithThisCol((cellCtrl) => cellCtrl.onFirstRightPinnedChanged()); }; const lastLeftPinnedChangedListener = () => { forEachCellWithThisCol((cellCtrl) => cellCtrl.onLastLeftPinnedChanged()); }; const colDefChangedListener = () => { forEachCellWithThisCol((cellCtrl) => cellCtrl.onColDefChanged()); }; col.__addEventListener("leftChanged", leftChangedListener); col.__addEventListener("widthChanged", widthChangedListener); col.__addEventListener("firstRightPinnedChanged", firstRightPinnedChangedListener); col.__addEventListener("lastLeftPinnedChanged", lastLeftPinnedChangedListener); col.__addEventListener("colDefChanged", colDefChangedListener); this.destroyFuncsForColumnListeners.push(() => { col.__removeEventListener("leftChanged", leftChangedListener); col.__removeEventListener("widthChanged", widthChangedListener); col.__removeEventListener("firstRightPinnedChanged", firstRightPinnedChangedListener); col.__removeEventListener("lastLeftPinnedChanged", lastLeftPinnedChangedListener); col.__removeEventListener("colDefChanged", colDefChangedListener); }); } } onDomLayoutChanged() { const printLayout = _isDomLayout(this.gos, "print"); const embedFullWidthRows = printLayout || this.gos.get("embedFullWidthRows"); const destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout; this.printLayout = printLayout; this.embedFullWidthRows = embedFullWidthRows; if (destroyRows) { this.redrawAfterModelUpdate({ domLayoutChanged: true }); } } // for row models that have datasources, when we update the datasource, we need to force the rowRenderer // to redraw all rows. otherwise the old rows from the old datasource will stay displayed. datasourceChanged() { this.firstRenderedRow = 0; this.lastRenderedRow = -1; const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex); this.removeRowCtrls(rowIndexesToRemove); } onPageLoaded(event) { const params = { recycleRows: event.keepRenderedRows, animate: event.animate, newData: event.newData, newPage: event.newPage, // because this is a model updated event (not pinned rows), we // can skip updating the pinned rows. this is needed so that if user // is doing transaction updates, the pinned rows are not getting constantly // trashed - or editing cells in pinned rows are not refreshed and put into read mode onlyBody: true }; this.redrawAfterModelUpdate(params); } /** * @param column AgColumn * @returns An array with HTMLElement for every cell of the column passed as param. * If the cell is spanning across multiple columns, it only returns the html element * if the column passed is the first column of the span (used for auto width calculation). */ getAllCellsNotSpanningForColumn(column) { const res = []; for (const rowCtrl of this.getAllRowCtrls()) { const eCell = rowCtrl.getCellCtrl(column, true)?.eGui; if (eCell) { res.push(eCell); } } return res; } refreshFloatingRowComps(recycleRows = true) { this.refreshFloatingRows(this.topRowCtrls, "top", recycleRows); this.refreshFloatingRows(this.bottomRowCtrls, "bottom", recycleRows); } /** * Determines which row controllers need to be destroyed and re-created vs which ones can * be re-used. * * This is operation is to pinned/floating rows as `this.recycleRows` is to normal/body rows. * * All `RowCtrl` instances in `rowCtrls` that don't correspond to `RowNode` instances in `rowNodes` are destroyed. * All `RowNode` instances in `rowNodes` that don't correspond to `RowCtrl` instances in `rowCtrls` are created. * All instances in `rowCtrls` must be in the same order as their corresponding nodes in `rowNodes`. * * @param rowCtrls The list of existing row controllers * @param rowNodes The canonical list of row nodes that should have associated controllers */ refreshFloatingRows(rowCtrls, floating, recycleRows) { const { pinnedRowModel, beans, printLayout } = this; const rowCtrlMap = Object.fromEntries(rowCtrls.map((ctrl) => [ctrl.rowNode.id, ctrl])); pinnedRowModel?.forEachPinnedRow(floating, (node, i) => { const rowCtrl = rowCtrls[i]; const rowCtrlDoesNotExist = rowCtrl && pinnedRowModel.getPinnedRowById(rowCtrl.rowNode.id, floating) === void 0; if (rowCtrlDoesNotExist) { rowCtrl.destroyFirstPass(); rowCtrl.destroySecondPass(); } if (node.id in rowCtrlMap && recycleRows) { rowCtrls[i] = rowCtrlMap[node.id]; delete rowCtrlMap[node.id]; } else { rowCtrls[i] = new RowCtrl(node, beans, false, false, printLayout); } }); const rowNodeCount = (floating === "top" ? pinnedRowModel?.getPinnedTopRowCount() : pinnedRowModel?.getPinnedBottomRowCount()) ?? 0; rowCtrls.length = rowNodeCount; } onPinnedRowDataChanged() { const params = { recycleRows: true }; this.redrawAfterModelUpdate(params); } onPinnedRowsChanged() { this.redrawAfterModelUpdate({ recycleRows: true }); } redrawRow(rowNode, suppressEvent = false) { if (rowNode.sticky) { this.stickyRowFeature?.refreshStickyNode(rowNode); } else if (this.cachedRowCtrls?.has(rowNode)) { this.cachedRowCtrls.removeRow(rowNode); return; } else { const destroyAndRecreateCtrl = (dataStruct) => { const ctrl = dataStruct[rowNode.rowIndex]; if (!ctrl) { return; } if (ctrl.rowNode !== rowNode) { return; } ctrl.destroyFirstPass(); ctrl.destroySecondPass(); dataStruct[rowNode.rowIndex] = this.createRowCon(rowNode, false, false); }; switch (rowNode.rowPinned) { case "top": destroyAndRecreateCtrl(this.topRowCtrls); break; case "bottom": destroyAndRecreateCtrl(this.bottomRowCtrls); break; default: destroyAndRecreateCtrl(this.rowCtrlsByRowIndex); this.updateAllRowCtrls(); } } if (!suppressEvent) { this.dispatchDisplayedRowsChanged(false); } } redrawRows(rowNodes) { const { editSvc } = this.beans; if (editSvc?.isEditing()) { if (editSvc.isBatchEditing()) { editSvc.cleanupEditors(); } else { editSvc.stopEditing(void 0, { source: "api" }); } } const partialRefresh = rowNodes != null; if (partialRefresh) { for (const node of rowNodes ?? []) { this.redrawRow(node, true); } this.dispatchDisplayedRowsChanged(false); return; } this.redrawAfterModelUpdate(); } // gets called from: // +) initialisation (in registerGridComp) params = null // +) onDomLayoutChanged, params = null // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true // +) onPinnedRowDataChanged, recycleRows = true // +) redrawRows (from Grid API), recycleRows = true/false redrawAfterModelUpdate(params = {}) { this.getLockOnRefresh(); const focusedCell = this.beans.focusSvc?.getFocusCellToUseAfterRefresh(); this.updateContainerHeights(); this.scrollToTopIfNewData(params); const recycleRows = !params.domLayoutChanged && !!params.recycleRows; const animate = params.animate && _isAnimateRows(this.gos); const rowsToRecycle = recycleRows ? this.getRowsToRecycle() : null; if (!recycleRows) { this.removeAllRowComps(); } this.workOutFirstAndLastRowsToRender(); const { stickyRowFeature, gos } = this; if (stickyRowFeature) { stickyRowFeature.checkStickyRows(); const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight; if (extraHeight) { this.updateContainerHeights(extraHeight); } } this.recycleRows(rowsToRecycle, animate); this.gridBodyCtrl.updateRowCount(); if (!params.onlyBody) { this.refreshFloatingRowComps(gos.get("enableRowPinning") ? recycleRows : void 0); } this.dispatchDisplayedRowsChanged(); if (focusedCell != null) { this.restoreFocusedCell(focusedCell); } this.releaseLockOnRefresh(); } scrollToTopIfNewData(params) { const scrollToTop = params.newData || params.newPage; const suppressScrollToTop = this.gos.get("suppressScrollOnNewData"); if (scrollToTop && !suppressScrollToTop) { this.gridBodyCtrl.scrollFeature.scrollToTop(); this.stickyRowFeature?.resetOffsets(); } } updateContainerHeights(additionalHeight = 0) { const { rowContainerHeight } = this; if (this.printLayout) { rowContainerHeight.setModelHeight(null); return; } let containerHeight = this.pageBounds.getCurrentPageHeight(); if (containerHeight === 0) { containerHeight = 1; } rowContainerHeight.setModelHeight(containerHeight + additionalHeight); } getLockOnRefresh() { if (this.refreshInProgress) { throw new Error(_errMsg(252)); } this.refreshInProgress = true; this.beans.frameworkOverrides.getLockOnRefresh?.(); } releaseLockOnRefresh() { this.refreshInProgress = false; this.beans.frameworkOverrides.releaseLockOnRefresh?.(); } isRefreshInProgress() { return this.refreshInProgress; } // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the // edited cell). restoreFocusedCell(cellPosition) { if (!cellPosition) { return; } const focusSvc = this.beans.focusSvc; const cellToFocus = this.findPositionToFocus(cellPosition); if (!cellToFocus) { focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: getFocusHeaderRowCount(this.beans) - 1, column: cellPosition.column } }); return; } if (cellPosition.rowIndex !== cellToFocus.rowIndex || cellPosition.rowPinned != cellToFocus.rowPinned) { focusSvc.setFocusedCell({ ...cellToFocus, preventScrollOnBrowserFocus: true, forceBrowserFocus: true }); return; } if (!focusSvc.doesRowOrCellHaveBrowserFocus()) { this.updateCellFocus( _addGridCommonParams(this.gos, { ...cellToFocus, forceBrowserFocus: true, preventScrollOnBrowserFocus: true, type: "cellFocused" }) ); } } findPositionToFocus(cellPosition) { const { pagination, pageBounds } = this.beans; let rowPosition = cellPosition; if (rowPosition.rowPinned == null && pagination && pageBounds && !pagination.isRowInPage(rowPosition.rowIndex)) { rowPosition = { rowPinned: null, rowIndex: pageBounds.getFirstRow() }; } while (rowPosition) { if (rowPosition.rowPinned == null && pageBounds) { if (rowPosition.rowIndex < pageBounds.getFirstRow()) { rowPosition = _getRowAbove(this.beans, { rowPinned: null, rowIndex: 0 }); if (!rowPosition) { return null; } } else if (rowPosition.rowIndex > pageBounds.getLastRow()) { rowPosition = { rowPinned: null, rowIndex: pageBounds.getLastRow() }; } } const row = this.getRowByPosition(rowPosition); if (row?.isAlive()) { return { ...row.getRowPosition(), column: cellPosition.column }; } rowPosition = _getRowAbove(this.beans, rowPosition); } return null; } getAllCellCtrls() { const res = []; const rowCtrls = this.getAllRowCtrls(); const rowCtrlsLength = rowCtrls.length; for (let i = 0; i < rowCtrlsLength; i++) { const cellCtrls = rowCtrls[i].getAllCellCtrls(); const cellCtrlsLength = cellCtrls.length; for (let j = 0; j < cellCtrlsLength; j++) { res.push(cellCtrls[j]); } } return res; } getAllRowCtrls() { const { spannedRowRenderer } = this.beans; const stickyTopRowCtrls = this.getStickyTopRowCtrls(); const stickyBottomRowCtrls = this.getStickyBottomRowCtrls(); const res = [ ...this.topRowCtrls, ...this.bottomRowCtrls, ...stickyTopRowCtrls, ...stickyBottomRowCtrls, ...spannedRowRenderer?.getCtrls("top") ?? [], ...spannedRowRenderer?.getCtrls("bottom") ?? [], ...spannedRowRenderer?.getCtrls("center") ?? [], ...Object.values(this.rowCtrlsByRowIndex) ]; return res; } addRenderedRowListener(eventName, rowIndex, callback) { const rowComp = this.rowCtrlsByRowIndex[rowIndex]; if (rowComp) { rowComp.addEventListener(eventName, callback); } } refreshCells({ rowNodes, columns, force, suppressFlash } = {}) { const refreshCellParams = { force, newData: false, suppressFlash }; for (const cellCtrl of this.getCellCtrls(rowNodes, columns)) { cellCtrl.refreshOrDestroyCell(refreshCellParams); } this.refreshFullWidth(rowNodes); } refreshRows(params = {}) { for (const rowCtrl of this.getRowCtrls(params.rowNodes)) { rowCtrl.refreshRow(params); } this.refreshFullWidth(params.rowNodes); } /** O(1) lookup of a RowCtrl by its RowNode (O(k) for sticky rows, where k is the sticky row count). */ getRowCtrlByNode(node) { const rowIndex = node.rowIndex; if (rowIndex == null) { return void 0; } const rowPinned = node.rowPinned; if (rowPinned === "top") { const ctrl2 = this.topRowCtrls[rowIndex]; return ctrl2?.rowNode === node ? ctrl2 : void 0; } if (rowPinned === "bottom") { const ctrl2 = this.bottomRowCtrls[rowIndex]; return ctrl2?.rowNode === node ? ctrl2 : void 0; } const ctrl = this.rowCtrlsByRowIndex[rowIndex]; if (ctrl?.rowNode === node) { return ctrl; } return this.getStickyRowCtrlByNode(node); } getStickyRowCtrlByNode(node) { const stickyRowFeature = this.stickyRowFeature; if (!stickyRowFeature) { return void 0; } for (const c of stickyRowFeature.stickyTopRowCtrls) { if (c.rowNode === node) { return c; } } for (const c of stickyRowFeature.stickyBottomRowCtrls) { if (c.rowNode === node) { return c; } } return void 0; } /** Refreshes the rendered row for the given node if it is currently in the viewport. Null-safe: no-op when node is null or undefined. */ refreshRowByNode(node) { if (node) { this.getRowCtrlByNode(node)?.refreshRow(); } } refreshFullWidth(rowNodes) { if (!rowNodes) { return; } let rowRedrawn = false; for (const rowCtrl of this.getRowCtrls(rowNodes)) { if (!rowCtrl.isFullWidth()) { continue; } const refreshed = rowCtrl.refreshFullWidth(); if (!refreshed) { rowRedrawn = true; this.redrawRow(rowCtrl.rowNode, true); } } if (rowRedrawn) { this.dispatchDisplayedRowsChanged(false); } } /** * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls. */ getRowCtrls(rowNodes) { const rowIdsMap = mapRowNodes(rowNodes); const allRowCtrls = this.getAllRowCtrls(); if (!rowNodes || !rowIdsMap) { return allRowCtrls; } return allRowCtrls.filter((rowCtrl) => { const rowNode = rowCtrl.rowNode; return isRowInMap(rowNode, rowIdsMap); }); } // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned. getCellCtrls(rowNodes, columns) { let colIdsMap; if (_exists(columns)) { colIdsMap = {}; columns.forEach((colKey) => { const column = this.colModel.getCol(colKey); if (_exists(column)) { colIdsMap[column.getId()] = true; } }); } const res = []; for (const rowCtrl of this.getRowCtrls(rowNodes)) { for (const cellCtrl of rowCtrl.getAllCellCtrls()) { const colId = cellCtrl.column.getId(); const excludeColFromRefresh = colIdsMap && !colIdsMap[colId]; if (excludeColFromRefresh) { continue; } res.push(cellCtrl); } } return res; } destroy() { this.removeAllRowComps(true); super.destroy(); } removeAllRowComps(suppressAnimation = false) { const rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex); this.removeRowCtrls(rowIndexesToRemove, suppressAnimation); this.stickyRowFeature?.destroyStickyCtrls(); } getRowsToRecycle() { const stubNodeIndexes = []; for (const index of Object.keys(this.rowCtrlsByRowIndex)) { const rowCtrl = this.rowCtrlsByRowIndex[index]; const stubNode = rowCtrl.rowNode.id == null; if (stubNode) { stubNodeIndexes.push(index); } } this.removeRowCtrls(stubNodeIndexes); const ctrlsByIdMap = {}; for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) { const rowNode = rowCtrl.rowNode; ctrlsByIdMap[rowNode.id] = rowCtrl; } this.rowCtrlsByRowIndex = {}; return ctrlsByIdMap; } // takes array of row indexes removeRowCtrls(rowsToRemove, suppressAnimation = false) { for (const indexToRemove of rowsToRemove) { const rowCtrl = this.rowCtrlsByRowIndex[indexToRemove]; if (rowCtrl) { rowCtrl.destroyFirstPass(suppressAnimation); rowCtrl.destroySecondPass(); } delete this.rowCtrlsByRowIndex[indexToRemove]; } } onBodyScroll(e) { if (e.direction !== "vertical") { return; } this.redraw({ afterScroll: true }); } // gets called when rows don't change, but viewport does, so after: // 1) height of grid body changes, ie number of displayed rows has changed // 2) grid scrolled to new position // 3) ensure index visible (which is a scroll) redraw(params = {}) { const { focusSvc, animationFrameSvc } = this.beans; const { afterScroll } = params; let cellFocused; const stickyRowFeature = this.stickyRowFeature; if (stickyRowFeature) { cellFocused = focusSvc?.getFocusCellToUseAfterRefresh() || void 0; } const oldFirstRow = this.firstRenderedRow; const oldLastRow = this.lastRenderedRow; this.workOutFirstAndLastRowsToRender(); let hasStickyRowChanges = false; if (stickyRowFeature) { hasStickyRowChanges = stickyRowFeature.checkStickyRows(); const extraHeight = stickyRowFeature.extraTopHeight + stickyRowFeature.extraBottomHeight; if (extraHeight) { this.updateContainerHeights(extraHeight); } } const rangeChanged = this.firstRenderedRow !== oldFirstRow || this.lastRenderedRow !== oldLastRow; if (afterScroll && !hasStickyRowChanges && !rangeChanged) { return; } this.getLockOnRefresh(); this.recycleRows(null, false, afterScroll); this.releaseLockOnRefresh(); this.dispatchDisplayedRowsChanged(afterScroll && !hasStickyRowChanges); if (cellFocused != null) { const newFocusedCell = focusSvc?.getFocusCellToUseAfterRefresh(); if (cellFocused != null && newFocusedCell == null) { animationFrameSvc?.flushAllFrames(); this.restoreFocusedCell(cellFocused); } } } removeRowCompsNotToDraw(indexesToDraw, suppressAnimation) { const indexesToDrawMap = {}; for (const index of indexesToDraw) { indexesToDrawMap[index] = true; } const existingIndexes = Object.keys(this.rowCtrlsByRowIndex); const indexesNotToDraw = existingIndexes.filter((index) => !indexesToDrawMap[index]); this.removeRowCtrls(indexesNotToDraw, suppressAnimation); } calculateIndexesToDraw(rowsToRecycle) { const indexesToDraw = []; for (let i = this.firstRenderedRow; i <= this.lastRenderedRow; i++) { indexesToDraw.push(i); } const pagination = this.beans.pagination; const focusedRowIndex = this.beans.focusSvc?.getFocusedCell()?.rowIndex; if (focusedRowIndex != null && (focusedRowIndex < this.firstRenderedRow || focusedRowIndex > this.lastRenderedRow) && (!pagination || pagination.isRowInPage(focusedRowIndex)) && focusedRowIndex < this.rowModel.getRowCount()) { indexesToDraw.push(focusedRowIndex); } const checkRowToDraw = (rowComp) => { const index = rowComp.rowNode.rowIndex; if (index == null || index === focusedRowIndex) { return; } if (index < this.firstRenderedRow || index > this.lastRenderedRow) { if (this.doNotUnVirtualiseRow(rowComp)) { indexesToDraw.push(index); } } }; for (const rowCtrl of Object.values(this.rowCtrlsByRowIndex)) { checkRowToDraw(rowCtrl); } if (rowsToRecycle) { for (const rowCtrl of Object.values(rowsToRecycle)) { checkRowToDraw(rowCtrl); } } indexesToDraw.sort((a, b) => a - b); const ret = []; for (let i = 0; i < indexesToDraw.length; i++) { const currRow = indexesToDraw[i]; const rowNode = this.rowModel.getRow(currRow); if (rowNode && !rowNode.sticky) { ret.push(currRow); } } return ret; } recycleRows(rowsToRecycle, animate = false, afterScroll = false) { const indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle); if (this.printLayout || afterScroll) { animate = false; } this.removeRowCompsNotToDraw(indexesToDraw, !animate); for (const rowIndex of indexesToDraw) { this.createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll); } if (rowsToRecycle) { const { animationFrameSvc } = this.beans; const useAnimationFrame = animationFrameSvc?.active && afterScroll && !this.printLayout; if (useAnimationFrame) { animationFrameSvc.addDestroyTask(() => { this.destroyRowCtrls(rowsToRecycle, animate); this.updateAllRowCtrls(); this.dispatchDisplayedRowsChanged(); }); } else { this.destroyRowCtrls(rowsToRecycle, animate); } } this.updateAllRowCtrls(); } dispatchDisplayedRowsChanged(afterScroll = false) { this.eventSvc.dispatchEvent({ type: "displayedRowsChanged", afterScroll }); } onDisplayedColumnsChanged() { const { visibleCols } = this.beans; const pinningLeft = visibleCols.isPinningLeft(); const pinningRight = visibleCols.isPinningRight(); const atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight; if (atLeastOneChanged) { this.pinningLeft = pinningLeft; this.pinningRight = pinningRight; if (this.embedFullWidthRows) { this.redrawFullWidthEmbeddedRows(); } } } // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse, // then it should go into the pinned left area if pinning left, or the center area if not pinning. redrawFullWidthEmbeddedRows() { const rowsToRemove = []; for (const fullWidthCtrl of this.getFullWidthRowCtrls()) { const rowIndex = fullWidthCtrl.rowNode.rowIndex; rowsToRemove.push(rowIndex.toString()); } this.refreshFloatingRowComps(); this.removeRowCtrls(rowsToRemove); this.redraw({ afterScroll: true }); } getFullWidthRowCtrls(rowNodes) { const rowNodesMap = mapRowNodes(rowNodes); return this.getAllRowCtrls().filter((rowCtrl) => { if (!rowCtrl.isFullWidth()) { return false; } const rowNode = rowCtrl.rowNode; if (rowNodesMap != null && !isRowInMap(rowNode, rowNodesMap)) { return false; } return true; }); } createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll) { let rowNode; let rowCtrl = this.rowCtrlsByRowIndex[rowIndex]; if (!rowCtrl) { rowNode = this.rowModel.getRow(rowIndex); if (_exists(rowNode) && _exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) { rowCtrl = rowsToRecycle[rowNode.id]; rowsToRecycle[rowNode.id] = null; } } const creatingNewRowCtrl = !rowCtrl; if (creatingNewRowCtrl) { if (!rowNode) { rowNode = this.rowModel.getRow(rowIndex); } if (_exists(rowNode)) { rowCtrl = this.createRowCon(rowNode, animate, afterScroll); } else { return; } } if (rowNode) { rowNode.alreadyRendered = true; } this.rowCtrlsByRowIndex[rowIndex] = rowCtrl; } destroyRowCtrls(rowCtrlsMap, animate) { const executeInAWhileFuncs = []; if (rowCtrlsMap) { for (const rowCtrl of Object.values(rowCtrlsMap)) { if (!rowCtrl) { continue; } if (this.cachedRowCtrls && rowCtrl.isCacheable()) { this.cachedRowCtrls.addRow(rowCtrl); continue; } rowCtrl.destroyFirstPass(!animate); if (animate) { const instanceId = rowCtrl.instanceId; this.zombieRowCtrls[instanceId] = rowCtrl; executeInAWhileFuncs.push(() => { rowCtrl.destroySecondPass(); delete this.zombieRowCtrls[instanceId]; }); } else { rowCtrl.destroySecondPass(); } } } if (animate) { executeInAWhileFuncs.push(() => { if (this.isAlive()) { this.updateAllRowCtrls(); this.dispatchDisplayedRowsChanged(); } }); window.setTimeout(() => { for (const func of executeInAWhileFuncs) { func(); } }, ROW_ANIMATION_TIMEOUT); } } getRowBuffer() { return this.gos.get("rowBuffer"); } getRowBufferInPixels() { const rowsToBuffer = this.getRowBuffer(); const defaultRowHeight = _getRowHeightAsNumber(this.beans); return rowsToBuffer * defaultRowHeight; } workOutFirstAndLastRowsToRender() { const { rowContainerHeight, pageBounds, rowModel } = this; rowContainerHeight.updateOffset(); let newFirst; let newLast; if (!rowModel.isRowsToRender()) { newFirst = 0; newLast = -1; } else if (this.printLayout) { this.beans.environment.refreshRowHeightVariable(); newFirst = pageBounds.getFirstRow(); newLast = pageBounds.getLastRow(); } else { const bufferPixels = this.getRowBufferInPixels(); const scrollFeature = this.ctrlsSvc.getScrollFeature(); const suppressRowVirtualisation = this.gos.get("suppressRowVirtualisation"); let rowHeightsChanged = false; let firstPixel; let lastPixel; do { const paginationOffset = pageBounds.getPixelOffset(); const { pageFirstPixel, pageLastPixel } = pageBounds.getCurrentPagePixelRange(); const divStretchOffset = rowContainerHeight.divStretchOffset; const bodyVRange = scrollFeature.getVScrollPosition(); const bodyTopPixel = bodyVRange.top; const bodyBottomPixel = bodyVRange.bottom; if (suppressRowVirtualisation) { firstPixel = pageFirstPixel + divStretchOffset; lastPixel = pageLastPixel + divStretchOffset; } else { firstPixel = Math.max(bodyTopPixel + paginationOffset - bufferPixels, pageFirstPixel) + divStretchOffset; lastPixel = Math.min(bodyBottomPixel + paginationOffset + bufferPixels, pageLastPixel) + divStretchOffset; } this.firstVisibleVPixel = Math.max(bodyTopPixel + paginationOffset, pageFirstPixel) + divStretchOffset; this.lastVisibleVPixel = Math.min(bodyBottomPixel + paginationOffset, pageLastPixel) + divStretchOffset; rowHeightsChanged = this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel); } while (rowHeightsChanged); let firstRowIndex = rowModel.getRowIndexAtPixel(firstPixel); let lastRowIndex = rowModel.getRowIndexAtPixel(lastPixel); const pageFirstRow = pageBounds.getFirstRow(); const pageLastRow = pageBounds.getLastRow(); if (firstRowIndex < pageFirstRow) { firstRowIndex = pageFirstRow; } if (lastRowIndex > pageLastRow) { lastRowIndex = pageLastRow; } newFirst = firstRowIndex; newLast = lastRowIndex; } const rowLayoutNormal = _isDomLayout(this.gos, "normal"); const suppressRowCountRestriction = this.gos.get("suppressMaxRenderedRowRestriction"); const rowBufferMaxSize = Math.max(this.getRowBuffer(), 500); if (rowLayoutNormal && !suppressRowCountRestriction) { if (newLast - newFirst > rowBufferMaxSize) { newLast = newFirst + rowBufferMaxSize; } } const firstDiffers = newFirst !== this.firstRenderedRow; const lastDiffers = newLast !== this.lastRenderedRow; if (firstDiffers || lastDiffers) { this.firstRenderedRow = newFirst; this.lastRenderedRow = newLast; this.eventSvc.dispatchEvent({ type: "viewportChanged", firstRow: newFirst, lastRow: newLast }); } } /** * This event will only be fired once, and is queued until after the browser next renders. * This allows us to fire an event during the start of the render cycle, when we first see data being rendered * but not execute the event until all of the data has finished being rendered to the dom. */ dispatchFirstDataRenderedEvent() { if (this.dataFirstRenderedFired) { return; } this.dataFirstRenderedFired = true; _requestAnimationFrame(this.beans, () => { this.beans.eventSvc.dispatchEvent({ type: "firstDataRendered", firstRow: this.firstRenderedRow, lastRow: this.lastRenderedRow }); }); } ensureAllRowsInRangeHaveHeightsCalculated(topPixel, bottomPixel) { const pinnedRowHeightsChanged = this.pinnedRowModel?.ensureRowHeightsValid(); const stickyHeightsChanged = this.stickyRowFeature?.ensureRowHeightsValid(); const { pageBounds, rowModel } = this; const rowModelHeightsChanged = rowModel.ensureRowHeightsValid( topPixel, bottomPixel, pageBounds.getFirstRow(), pageBounds.getLastRow() ); if (rowModelHeightsChanged || stickyHeightsChanged) { this.eventSvc.dispatchEvent({ type: "recalculateRowBounds" }); } if (stickyHeightsChanged || rowModelHeightsChanged || pinnedRowHeightsChanged) { this.updateContainerHeights(); return true; } return false; } // check that none of the rows to remove are editing or focused as: // a) if editing, we want to keep them, otherwise the user will loose the context of the edit, // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered // the edit is reset - so we want to keep it rendered. // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard, // otherwise the user can range select and drag (with focus cell going out of the viewport) // and then ctrl+c, nothing will happen if cell is removed from dom. // c) if detail record of master detail, as users complained that the context of detail rows // was getting lost when detail row out of view. eg user expands to show detail row, // then manipulates the detail panel (eg sorts the detail grid), then context is lost // after detail panel is scrolled out of / into view. doNotUnVirtualiseRow(rowCtrl) { const REMOVE_ROW = false; const KEEP_ROW = true; const rowNode = rowCtrl.rowNode; const rowHasFocus = this.focusSvc.isRowFocused(rowNode.rowIndex, rowNode.rowPinned); const rowIsEditing = this.editSvc?.isEditing(rowCtrl); const rowIsDetail = rowNode.detail; const mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail; if (!mightWantToKeepRow) { return REMOVE_ROW; } const rowNodePresent = this.isRowPresent(rowNode); return rowNodePresent ? KEEP_ROW : REMOVE_ROW; } isRowPresent(rowNode) { if (!this.rowModel.isRowPresent(rowNode)) { return false; } return this.beans.pagination?.isRowInPage(rowNode.rowIndex) ?? true; } createRowCon(rowNode, animate, afterScroll) { const rowCtrlFromCache = this.cachedRowCtrls?.getRow(rowNode) ?? null; if (rowCtrlFromCache) { return rowCtrlFromCache; } const useAnimationFrameForCreate = afterScroll && !this.printLayout && !!this.beans.animationFrameSvc?.active; const res = new RowCtrl(rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout); return res; } getRenderedNodes() { const viewportRows = Object.values(this.rowCtrlsByRowIndex).map((rowCtrl) => rowCtrl.rowNode); const stickyTopRows = this.getStickyTopRowCtrls().map((rowCtrl) => rowCtrl.rowNode); const stickyBottomRows = this.getStickyBottomRowCtrls().map((rowCtrl) => rowCtrl.rowNode); return [...stickyTopRows, ...viewportRows, ...stickyBottomRows]; } getRowByPosition(rowPosition) { let rowCtrl; const { rowIndex } = rowPosition; switch (rowPosition.rowPinned) { case "top": rowCtrl = this.topRowCtrls[rowIndex]; break; case "bottom": rowCtrl = this.bottomRowCtrls[rowIndex]; break; default: rowCtrl = this.rowCtrlsByRowIndex[rowIndex]; if (!rowCtrl) { rowCtrl = this.getStickyTopRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null; if (!rowCtrl) { rowCtrl = this.getStickyBottomRowCtrls().find((ctrl) => ctrl.rowNode.rowIndex === rowIndex) || null; } } break; } return rowCtrl; } // returns true if any row between startIndex and endIndex is rendered. used by // SSRM or IRM, as they don't want to purge visible blocks from cache. isRangeInRenderedViewport(startIndex, endIndex) { const parentClosed = startIndex == null || endIndex == null; if (parentClosed) { return false; } const blockAfterViewport = startIndex > this.lastRenderedRow; const blockBeforeViewport = endIndex < this.firstRenderedRow; const blockInsideViewport = !blockBeforeViewport && !blockAfterViewport; return blockInsideViewport; } }; var RowCtrlCache = class { constructor(maxCount) { this.entriesMap = {}; this.entriesList = []; this.maxCount = maxCount; } addRow(rowCtrl) { this.entriesMap[rowCtrl.rowNode.id] = rowCtrl; this.entriesList.push(rowCtrl); rowCtrl.setCached(true); if (this.entriesList.length > this.maxCount) { const rowCtrlToDestroy = this.entriesList[0]; rowCtrlToDestroy.destroyFirstPass(); rowCtrlToDestroy.destroySecondPass(); this.removeFromCache(rowCtrlToDestroy); } } getRow(rowNode) { if (rowNode?.id == null) { return null; } const res = this.entriesMap[rowNode.id]; if (!res) { return null; } this.removeFromCache(res); res.setCached(false); const rowNodeMismatch = res.rowNode != rowNode; return rowNodeMismatch ? null : res; } has(rowNode) { return this.entriesMap[rowNode.id] != null; } removeRow(rowNode) { const rowNodeId = rowNode.id; const ctrl = this.entriesMap[rowNodeId]; delete this.entriesMap[rowNodeId]; _removeFromArray(this.entriesList, ctrl); } removeFromCache(rowCtrl) { const rowNodeId = rowCtrl.rowNode.id; delete this.entriesMap[rowNodeId]; _removeFromArray(this.entriesList, rowCtrl); } getEntries() { return this.entriesList; } }; function mapRowNodes(rowNodes) { if (!rowNodes) { return; } const res = { top: {}, bottom: {}, normal: {} }; for (const rowNode of rowNodes) { const id = rowNode.id; switch (rowNode.rowPinned) { case "top": res.top[id] = rowNode; break; case "bottom": res.bottom[id] = rowNode; break; default: res.normal[id] = rowNode; break; } } return res; } function isRowInMap(rowNode, rowIdsMap) { const id = rowNode.id; const floating = rowNode.rowPinned; switch (floating) { case "top": return rowIdsMap.top[id] != null; case "bottom": return rowIdsMap.bottom[id] != null; default: return rowIdsMap.normal[id] != null; } } var RowNodeSorter = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowNodeSorter"; this.accentedSort = false; this.primaryColumnsSortGroups = false; this.pivotActive = false; } postConstruct() { this.firstLeaf = _isClientSideRowModel(this.gos) ? _csrmFirstLeaf : defaultGetLeaf; this.addManagedPropertyListeners( ["accentedSort", "autoGroupColumnDef", "treeData"], this.updateOptions.bind(this) ); const updatePivotModeState = this.updatePivotModeState.bind(this); this.addManagedEventListeners({ columnPivotModeChanged: updatePivotModeState, columnPivotChanged: updatePivotModeState }); this.updateOptions(); updatePivotModeState(); } updateOptions() { this.accentedSort = !!this.gos.get("accentedSort"); this.primaryColumnsSortGroups = _isColumnsSortingCoupledToGroup(this.gos); } updatePivotModeState() { this.pivotActive = this.beans.colModel.isPivotActive(); } doFullSortInPlace(rowNodes, sortOptions) { return rowNodes.sort((a, b) => this.compareRowNodes(sortOptions, a, b)); } compareRowNodes(sortOptions, nodeA, nodeB) { if (nodeA === nodeB) { return 0; } const accentedCompare = this.accentedSort; for (let i = 0, len = sortOptions.length; i < len; ++i) { const sortOption = sortOptions[i]; const isDescending = sortOption.sort === "desc"; let valueA = this.getValue(nodeA, sortOption.column); let valueB = this.getValue(nodeB, sortOption.column); let comparatorResult; const providedComparator = this.getComparator(sortOption, nodeA); if (providedComparator) { comparatorResult = providedComparator(valueA, valueB, nodeA, nodeB, isDescending); } else { if (sortOption.type === "absolute") { valueA = absoluteValueTransformer(valueA); valueB = absoluteValueTransformer(valueB); } comparatorResult = _defaultComparator(valueA, valueB, accentedCompare); } if (comparatorResult) { return sortOption.sort === "asc" ? comparatorResult : -comparatorResult; } } return 0; } /** * if user defines a comparator as a function then use that. * if user defines a dictionary of comparators, then use the one matching the sort type. * if no comparator provided, or no matching comparator found in dictionary, then return undefined. * * grid checks later if undefined is returned here and falls back to a default comparator corresponding to sort type on the coldef. * @private */ getComparator(sortOption, rowNode) { const colDef = sortOption.column.getColDef(); const comparatorOnCol = this.getComparatorFromColDef(colDef, sortOption); if (comparatorOnCol) { return comparatorOnCol; } if (!colDef.showRowGroup) { return; } const groupLeafField = !rowNode.group && colDef.field; if (!groupLeafField) { return; } const primaryColumn = this.beans.colModel.getColDefCol(groupLeafField); if (!primaryColumn) { return; } return this.getComparatorFromColDef(primaryColumn.getColDef(), sortOption); } getComparatorFromColDef(colDef, sortOption) { const comparator = colDef.comparator; if (comparator == null) { return; } if (typeof comparator === "object") { return comparator[_normalizeSortType(sortOption.type)]; } return comparator; } getValue(node, column) { const beans = this.beans; if (this.primaryColumnsSortGroups) { if (node.rowGroupColumn === column) { return this.getGroupDataValue(node, column); } if (node.group && column.getColDef().showRowGroup) { return void 0; } } const value = beans.valueSvc.getValue(column, node, "data"); if (column.isAllowFormula()) { const formula = beans.formula; if (formula?.isFormula(value)) { return formula.resolveValue(column, node); } } return value; } getGroupDataValue(node, column) { if (_isGroupUseEntireRow(this.gos, this.pivotActive)) { const leafChild = this.firstLeaf(node); return leafChild && this.beans.valueSvc.getValue(column, leafChild, "data"); } const displayCol = this.beans.showRowGroupCols?.getShowRowGroupCol(column.getId()); return displayCol ? node.groupData?.[displayCol.getId()] : void 0; } }; var defaultGetLeaf = (row) => { if (row.data) { return row; } let childrenAfterGroup = row.childrenAfterGroup; while (childrenAfterGroup?.length) { const node = childrenAfterGroup[0]; if (node.data) { return node; } childrenAfterGroup = node.childrenAfterGroup; } }; var absoluteValueTransformer = (value) => { if (!value) { return value; } if (typeof value === "bigint") { return value < 0n ? -value : value; } const numberValue = Number(value); return isNaN(numberValue) ? value : Math.abs(numberValue); }; function onSortChanged(beans) { beans.sortSvc?.onSortChanged("api"); } var makeIconParams = (dataRefSuffix, classSuffix) => ({ tag: "span", ref: `eSort${dataRefSuffix}`, cls: `ag-sort-indicator-icon ag-sort-${classSuffix} ag-hidden`, attrs: { "aria-hidden": "true" } }); var SortIndicatorElement = { tag: "span", cls: "ag-sort-indicator-container", children: [ makeIconParams("Order", "order"), makeIconParams("Asc", "ascending-icon"), makeIconParams("Desc", "descending-icon"), makeIconParams("Mixed", "mixed-icon"), makeIconParams("AbsoluteAsc", "absolute-ascending-icon"), makeIconParams("AbsoluteDesc", "absolute-descending-icon"), makeIconParams("None", "none-icon") ] }; var SortIndicatorComp = class extends Component { constructor(skipTemplate) { super(); this.eSortOrder = RefPlaceholder; this.eSortAsc = RefPlaceholder; this.eSortDesc = RefPlaceholder; this.eSortMixed = RefPlaceholder; this.eSortNone = RefPlaceholder; this.eSortAbsoluteAsc = RefPlaceholder; this.eSortAbsoluteDesc = RefPlaceholder; if (!skipTemplate) { this.setTemplate(SortIndicatorElement); } } attachCustomElements(eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone, eSortAbsoluteAsc, eSortAbsoluteDesc) { this.eSortOrder = eSortOrder; this.eSortAsc = eSortAsc; this.eSortDesc = eSortDesc; this.eSortMixed = eSortMixed; this.eSortNone = eSortNone; this.eSortAbsoluteAsc = eSortAbsoluteAsc; this.eSortAbsoluteDesc = eSortAbsoluteDesc; } setupSort(column, suppressOrder = false, getSortDefOverride) { this.column = column; this.suppressOrder = suppressOrder; this.getSortDefOverride = getSortDefOverride; this.setupMultiSortIndicator(); if (!column.isSortable() && !column.getColDef().showRowGroup) { return; } this.addInIcon("sortAscending", this.eSortAsc, column); this.addInIcon("sortDescending", this.eSortDesc, column); this.addInIcon("sortUnSort", this.eSortNone, column); this.addInIcon("sortAbsoluteAscending", this.eSortAbsoluteAsc, column); this.addInIcon("sortAbsoluteDescending", this.eSortAbsoluteDesc, column); const updateIcons = this.updateIcons.bind(this); const sortUpdated = this.onSortChanged.bind(this); this.addManagedPropertyListener("unSortIcon", updateIcons); this.addManagedEventListeners({ newColumnsLoaded: updateIcons, // Watch global events, as row group columns can effect their display column. sortChanged: sortUpdated, // when grouping changes so can sort indexes and icons columnRowGroupChanged: sortUpdated }); this.onSortChanged(); } addInIcon(iconName, eParent, column) { if (eParent == null) { return; } const eIcon = _createIconNoSpan(iconName, this.beans, column); if (eIcon) { eParent.appendChild(eIcon); } } onSortChanged() { this.updateIcons(); if (!this.suppressOrder) { this.updateSortOrder(); } } updateIcons() { const { eSortAsc, eSortDesc, eSortAbsoluteAsc, eSortAbsoluteDesc, eSortNone, column, gos, beans } = this; const displaySort = _getDisplaySortForColumn(column, beans, this.getSortDefOverride); const isDefaultSortAllowed = displaySort.isDefaultSortAllowed; const isAbsoluteSortAllowed = displaySort.isAbsoluteSortAllowed; const { isAbsoluteSort, isDefaultSort, isAscending, isDescending, direction } = displaySort; if (eSortAsc) { _setDisplayed(eSortAsc, isAscending && isDefaultSort && isDefaultSortAllowed, { skipAriaHidden: true }); } if (eSortDesc) { _setDisplayed(eSortDesc, isDescending && isDefaultSort && isDefaultSortAllowed, { skipAriaHidden: true }); } if (eSortNone) { const alwaysHideNoSort = !column.getColDef().unSortIcon && !gos.get("unSortIcon"); _setDisplayed(eSortNone, !alwaysHideNoSort && !direction, { skipAriaHidden: true }); } if (eSortAbsoluteAsc) { _setDisplayed(eSortAbsoluteAsc, isAscending && isAbsoluteSort && isAbsoluteSortAllowed, { skipAriaHidden: true }); } if (eSortAbsoluteDesc) { _setDisplayed(eSortAbsoluteDesc, isDescending && isAbsoluteSort && isAbsoluteSortAllowed, { skipAriaHidden: true }); } } setupMultiSortIndicator() { const { eSortMixed, column, gos } = this; this.addInIcon("sortUnSort", eSortMixed, column); const isColumnShowingRowGroup = column.getColDef().showRowGroup; const areGroupsCoupled = _isColumnsSortingCoupledToGroup(gos); if (areGroupsCoupled && isColumnShowingRowGroup) { this.addManagedEventListeners({ // Watch global events, as row group columns can effect their display column. sortChanged: this.updateMultiSortIndicator.bind(this), // when grouping changes so can sort indexes and icons columnRowGroupChanged: this.updateMultiSortIndicator.bind(this) }); this.updateMultiSortIndicator(); } } updateMultiSortIndicator() { const { eSortMixed, beans, column } = this; if (eSortMixed) { const isMixedSort = beans.sortSvc.getDisplaySortForColumn(column)?.direction === "mixed"; _setDisplayed(eSortMixed, isMixedSort, { skipAriaHidden: true }); } } // we listen here for global sort events, NOT column sort events, as we want to do this // when sorting has been set on all column (if we listened just for our col (where we // set the asc / desc icons) then it's possible other cols are yet to get their sorting state. updateSortOrder() { const { eSortOrder, column, beans: { sortSvc } } = this; if (!eSortOrder) { return; } const allColumnsWithSorting = sortSvc.getColumnsWithSortingOrdered(); const indexThisCol = sortSvc.getDisplaySortIndexForColumn(column) ?? -1; const moreThanOneColSorting = allColumnsWithSorting.some( (col) => sortSvc.getDisplaySortIndexForColumn(col) ?? -1 >= 1 ); const showIndex = indexThisCol >= 0 && moreThanOneColSorting; _setDisplayed(eSortOrder, showIndex, { skipAriaHidden: true }); if (indexThisCol >= 0) { eSortOrder.textContent = (indexThisCol + 1).toString(); } else { _clearElement(eSortOrder); } } refresh() { this.onSortChanged(); } }; var SortIndicatorSelector = { selector: "AG-SORT-INDICATOR", component: SortIndicatorComp }; var SortService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "sortSvc"; } progressSort(column, multiSort, source) { const nextDirection = this.getNextSortDirection(column); this.setSortForColumn(column, nextDirection, multiSort, source); } progressSortFromEvent(column, event) { const sortUsingCtrl = this.gos.get("multiSortKey") === "ctrl"; const multiSort = sortUsingCtrl ? event.ctrlKey || event.metaKey : event.shiftKey; this.progressSort(column, multiSort, "uiColumnSorted"); } setSortForColumn(column, sortDef, multiSort, source) { const { gos, showRowGroupCols } = this.beans; const isColumnsSortingCoupledToGroup = _isColumnsSortingCoupledToGroup(gos); let columnsToUpdate = [column]; if (isColumnsSortingCoupledToGroup) { if (column.getColDef().showRowGroup) { const rowGroupColumns = showRowGroupCols?.getSourceColumnsForGroupColumn?.(column); const sortableRowGroupColumns = rowGroupColumns?.filter((col) => col.isSortable()); if (sortableRowGroupColumns) { columnsToUpdate = [column, ...sortableRowGroupColumns]; } } } for (const col of columnsToUpdate) { this.setColSort(col, sortDef, source); } const doingMultiSort = (multiSort || gos.get("alwaysMultiSort")) && !gos.get("suppressMultiSort"); const updatedColumns = []; if (!doingMultiSort) { const clearedColumns = this.clearSortBarTheseColumns(columnsToUpdate, source); updatedColumns.push(...clearedColumns); } this.updateSortIndex(column); updatedColumns.push(...columnsToUpdate); this.dispatchSortChangedEvents(source, updatedColumns); } updateSortIndex(lastColToChange) { const { gos, colModel, showRowGroupCols } = this.beans; const isCoupled = _isColumnsSortingCoupledToGroup(gos); const groupParent = showRowGroupCols?.getShowRowGroupCol(lastColToChange.getId()); const lastSortIndexCol = isCoupled ? groupParent || lastColToChange : lastColToChange; const allSortedCols = this.getColumnsWithSortingOrdered(); colModel.forAllCols((col) => this.setColSortIndex(col, null)); const allSortedColsWithoutChangesOrGroups = allSortedCols.filter((col) => { if (isCoupled && col.getColDef().showRowGroup) { return false; } return col !== lastSortIndexCol; }); const sortedColsWithIndices = lastSortIndexCol.getSortDef() ? [...allSortedColsWithoutChangesOrGroups, lastSortIndexCol] : allSortedColsWithoutChangesOrGroups; sortedColsWithIndices.forEach((col, idx) => this.setColSortIndex(col, idx)); } // gets called by API, so if data changes, use can call this, which will end up // working out the sort order again of the rows. onSortChanged(source, columns) { this.dispatchSortChangedEvents(source, columns); } isSortActive() { let isSorting = false; this.beans.colModel.forAllCols((col) => { if (col.getSortDef()) { isSorting = true; return true; } }); return isSorting; } dispatchSortChangedEvents(source, columns) { const event = { type: "sortChanged", source }; if (columns) { event.columns = columns; } this.eventSvc.dispatchEvent(event); } clearSortBarTheseColumns(columnsToSkip, source) { const clearedColumns = []; this.beans.colModel.forAllCols((columnToClear) => { if (!columnsToSkip.includes(columnToClear)) { if (columnToClear.getSortDef()) { clearedColumns.push(columnToClear); } this.setColSort(columnToClear, void 0, source); } }); return clearedColumns; } getNextSortDirection(column, currentSort) { const sortingOrder = column.getSortingOrder(); const currentSortDef = currentSort === void 0 ? column.getSortDef() : _getSortDefFromInput(currentSort); const currentIndex = sortingOrder.findIndex((e) => _areSortDefsEqual(e, currentSortDef)); let nextIndex = currentIndex + 1; if (nextIndex >= sortingOrder.length) { nextIndex = 0; } return _getSortDefFromInput(sortingOrder[nextIndex]); } /** * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices */ getIndexedSortMap() { const { gos, colModel, showRowGroupCols, rowGroupColsSvc } = this.beans; let allSortedCols = []; colModel.forAllCols((col) => { if (col.getSortDef()) { allSortedCols.push(col); } }); if (colModel.isPivotMode()) { const isSortingLinked = _isColumnsSortingCoupledToGroup(gos); allSortedCols = allSortedCols.filter((col) => { const isAggregated = !!col.getAggFunc(); const isSecondary = !col.isPrimary(); const isGroup = isSortingLinked ? showRowGroupCols?.getShowRowGroupCol(col.getId()) : col.getColDef().showRowGroup; return isAggregated || isSecondary || isGroup; }); } const sortedRowGroupCols = rowGroupColsSvc?.columns.filter((col) => !!col.getSortDef()) ?? []; const allColsIndexes = {}; allSortedCols.forEach((col, index) => allColsIndexes[col.getId()] = index); allSortedCols.sort((a, b) => { const iA = a.getSortIndex(); const iB = b.getSortIndex(); if (iA != null && iB != null) { return iA - iB; } else if (iA == null && iB == null) { const posA = allColsIndexes[a.getId()]; const posB = allColsIndexes[b.getId()]; return posA > posB ? 1 : -1; } else if (iB == null) { return -1; } else { return 1; } }); const isSortLinked = _isColumnsSortingCoupledToGroup(gos) && !!sortedRowGroupCols.length; if (isSortLinked) { allSortedCols = [ ...new Set( // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness allSortedCols.map((col) => showRowGroupCols?.getShowRowGroupCol(col.getId()) ?? col) ) ]; } const indexMap = /* @__PURE__ */ new Map(); allSortedCols.forEach((col, idx) => indexMap.set(col, idx)); if (isSortLinked) { for (const col of sortedRowGroupCols) { const groupDisplayCol = showRowGroupCols.getShowRowGroupCol(col.getId()); indexMap.set(col, indexMap.get(groupDisplayCol)); } } return indexMap; } getColumnsWithSortingOrdered() { return [...this.getIndexedSortMap().entries()].sort(([, idx1], [, idx2]) => idx1 - idx2).map(([col]) => col); } /** * Util method to collect sort items by going through sorted columns once. */ collectSortItems(asSortModel = false) { const sortItems = []; const columnsWithSortingOrdered = this.getColumnsWithSortingOrdered(); for (const column of columnsWithSortingOrdered) { const sort = column.getSortDef()?.direction; if (!sort) { continue; } const type = _normalizeSortType(column.getSortDef()?.type); const sortItem = { sort, type }; if (asSortModel) { sortItem.colId = column.getId(); } else { sortItem.column = column; } sortItems.push(sortItem); } return sortItems; } // used by server side row models, to send sort to server getSortModel() { return this.collectSortItems(true); } getSortOptions() { return this.collectSortItems(); } canColumnDisplayMixedSort(column) { const isColumnSortCouplingActive = _isColumnsSortingCoupledToGroup(this.gos); const isGroupDisplayColumn = !!column.getColDef().showRowGroup; return isColumnSortCouplingActive && isGroupDisplayColumn; } getDisplaySortForColumn(column) { const linkedColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column); if (!this.canColumnDisplayMixedSort(column) || !linkedColumns?.length) { return column.getSortDef(); } const columnHasUniqueData = column.getColDef().field != null || !!column.getColDef().valueGetter; const sortableColumns = columnHasUniqueData ? [column, ...linkedColumns] : linkedColumns; const firstSort = sortableColumns[0].getSortDef(); const allMatch = sortableColumns.every((col) => _areSortDefsEqual(col.getSortDef(), firstSort)); if (!allMatch) { return { type: _normalizeSortType(column.getSortDef()?.type), direction: "mixed" }; } return firstSort; } getDisplaySortIndexForColumn(column) { return this.getIndexedSortMap().get(column); } setupHeader(comp, column) { const refreshStyles = () => { const { type, direction } = _getSortDefFromInput(column.getSortDef()); comp.toggleCss("ag-header-cell-sorted-asc", direction === "asc"); comp.toggleCss("ag-header-cell-sorted-desc", direction === "desc"); comp.toggleCss("ag-header-cell-sorted-abs-asc", type === "absolute" && direction === "asc"); comp.toggleCss("ag-header-cell-sorted-abs-desc", type === "absolute" && direction === "desc"); comp.toggleCss("ag-header-cell-sorted-none", !direction); if (column.getColDef().showRowGroup) { const sourceColumns = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column); const sortDirectionsMatch = sourceColumns?.every( (sourceCol) => direction == sourceCol.getSortDef()?.direction ); const isMultiSorting = !sortDirectionsMatch; comp.toggleCss("ag-header-cell-sorted-mixed", isMultiSorting); } }; comp.addManagedEventListeners({ sortChanged: refreshStyles, columnPinned: refreshStyles, columnRowGroupChanged: refreshStyles, displayedColumnsChanged: refreshStyles }); } initCol(column) { const { sortIndex, initialSortIndex } = column.colDef; const sortDef = _getSortDefFromColDef(column.colDef); if (sortDef) { column.setSortDef(sortDef, true); } if (sortIndex !== void 0) { if (sortIndex !== null) { column.sortIndex = sortIndex; } } else if (initialSortIndex !== null) { column.sortIndex = initialSortIndex; } } /** * Update a column's sort state from a sort definition. * If `sortDefOrDirection` is `undefined`, the call is a no-op (no change). */ updateColSort(column, sortDefOrDirection, source) { if (sortDefOrDirection === void 0) { return; } this.setColSort(column, _getSortDefFromInput(sortDefOrDirection), source); } setColSort(column, sort, source) { if (!_areSortDefsEqual(column.getSortDef(), sort)) { column.setSortDef(_getSortDefFromInput(sort), sort === void 0); column.dispatchColEvent("sortChanged", source); } column.dispatchStateUpdatedEvent("sort"); } setColSortIndex(column, sortOrder) { column.sortIndex = sortOrder; column.dispatchStateUpdatedEvent("sortIndex"); } createSortIndicator(skipTemplate) { return new SortIndicatorComp(skipTemplate); } getSortIndicatorSelector() { return SortIndicatorSelector; } }; var SortModule = { moduleName: "Sort", version: VERSION, beans: [SortService, RowNodeSorter], apiFunctions: { onSortChanged }, userComponents: { agSortIndicator: SortIndicatorComp }, icons: { // show on column header when column is sorted ascending sortAscending: "asc", // show on column header when column is sorted descending sortDescending: "desc", // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true sortUnSort: "none", // show on column header when column is sorted absolute ascending sortAbsoluteAscending: "aasc", // show on column header when column is sorted absolute descending sortAbsoluteDescending: "adesc" } }; var SyncService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "syncSvc"; this.waitingForColumns = false; } postConstruct() { this.addManagedPropertyListener("columnDefs", (event) => this.setColumnDefs(event)); } start() { this.beans.ctrlsSvc.whenReady(this, () => { const columnDefs = this.gos.get("columnDefs"); if (columnDefs) { this.setColumnsAndData(columnDefs); } else { this.waitingForColumns = true; } this.gridReady(); }); } setColumnsAndData(columnDefs) { const { colModel, rowModel } = this.beans; colModel.setColumnDefs(columnDefs ?? [], "gridInitializing"); rowModel.start(); } gridReady() { const { eventSvc, gos } = this; eventSvc.dispatchEvent({ type: "gridReady" }); _logIfDebug(gos, `initialised successfully, enterprise = ${gos.isModuleRegistered("EnterpriseCore")}`); } setColumnDefs(event) { const columnDefs = this.gos.get("columnDefs"); if (!columnDefs) { return; } if (this.waitingForColumns) { this.waitingForColumns = false; this.setColumnsAndData(columnDefs); return; } this.beans.colModel.setColumnDefs(columnDefs, _convertColumnEventSourceType(event.source)); } }; function expireValueCache(beans) { beans.valueCache?.expire(); } function getCellValue(beans, params) { const { colKey, rowNode, useFormatter, from = "edit" } = params; const column = beans.colModel.getColDefCol(colKey) ?? beans.colModel.getCol(colKey); if (!column) { return null; } const result = beans.valueSvc.getValueForDisplay({ column, node: rowNode, includeValueFormatted: useFormatter, from }); if (useFormatter) { return result.valueFormatted ?? _toString(result.value); } return result.value; } var SOURCE_PASTE = "paste"; var ChangeDetectionService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "changeDetectionSvc"; this.deferredDepth = 0; this.batchedPath = null; this.batchedNodes = null; } destroy() { super.destroy(); this.batchedPath = null; this.batchedNodes = null; } postConstruct() { this.csrm = _getClientSideRowModel(this.beans); this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this) }); } /** * Begin a deferred change-detection pass: subsequent `cellValueChanged` events are accumulated * rather than triggering individual aggregation + refresh passes. Flush happens on endDeferred(). * Calls may be nested — flush only occurs when the outermost endDeferred() is reached. */ beginDeferred() { this.deferredDepth++; } /** * End a deferred pass. When the outermost call is reached (depth returns to zero), runs a single * aggregation pass over all accumulated changes and refreshes the affected rows in depth-first order. */ endDeferred() { if (this.deferredDepth === 0) { return; } if (--this.deferredDepth > 0) { return; } const path = this.batchedPath; const nodes = this.batchedNodes; this.batchedPath = null; this.batchedNodes = null; if (path) { this.csrm?.doAggregate(path); } const { rowRenderer } = this.beans; if (nodes) { for (const node of nodes) { refreshRowAndSiblings(rowRenderer, node); } } if (path) { const rows = path.getSortedRows(); for (let i = 0, len = rows.length; i < len; ++i) { refreshRowAndSiblings(rowRenderer, rows[i]); } } if (this.batchedPath || this.batchedNodes) { this.deferredDepth = 1; this.endDeferred(); } } onCellValueChanged(event) { const { gos, rowModel, changedPathFactory } = this.beans; if (event.source === SOURCE_PASTE || gos.get("suppressChangeDetection")) { return; } if (!rowModel.rootNode) { return; } const node = event.node.primaryRow; if (this.csrm) { let batchedPath = this.batchedPath; if (!batchedPath) { batchedPath = changedPathFactory?.newPath(gos.get("aggregateOnlyChangedColumns")) ?? null; this.batchedPath = batchedPath; } let pathNode = node; if (!node.group) { const nodes = this.batchedNodes ?? (this.batchedNodes = /* @__PURE__ */ new Set()); nodes.add(node); pathNode = node.parent; } batchedPath?.addCell(pathNode, event.column.getColId()); } else { const nodes = this.batchedNodes ?? (this.batchedNodes = /* @__PURE__ */ new Set()); nodes.add(node); } if (this.deferredDepth === 0) { this.deferredDepth = 1; this.endDeferred(); } } }; var refreshRowAndSiblings = (rowRenderer, node) => { const { sibling, pinnedSibling } = node; rowRenderer.refreshRowByNode(node); rowRenderer.refreshRowByNode(sibling); rowRenderer.refreshRowByNode(pinnedSibling); rowRenderer.refreshRowByNode(sibling?.pinnedSibling); rowRenderer.refreshRowByNode(pinnedSibling?.sibling); }; var ExpressionService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "expressionSvc"; this.cache = {}; } evaluate(expression, params) { if (typeof expression === "string") { return this.evaluateExpression(expression, params); } else { _error(15, { expression }); } } evaluateExpression(expression, params) { try { const javaScriptFunction = this.createExpressionFunction(expression); const result = javaScriptFunction( params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.getValue, params.column, params.columnGroup ); return result; } catch (e) { _error(16, { expression, params, e }); return null; } } createExpressionFunction(expression) { const expressionToFunctionCache = this.cache; if (expressionToFunctionCache[expression]) { return expressionToFunctionCache[expression]; } const functionBody = this.createFunctionBody(expression); const theFunction = new Function( "x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup", functionBody ); expressionToFunctionCache[expression] = theFunction; return theFunction; } createFunctionBody(expression) { if (expression.includes("return")) { return expression; } else { return "return " + expression + ";"; } } }; var ValueCache = class extends BeanStub { constructor() { super(...arguments); this.beanName = "valueCache"; this.cacheVersion = 0; } postConstruct() { const gos = this.gos; this.active = gos.get("valueCache"); this.neverExpires = gos.get("valueCacheNeverExpires"); } onDataChanged() { if (this.neverExpires) { return; } this.expire(); } expire() { this.cacheVersion++; } setValue(rowNode, colId, value) { if (this.active) { const cacheVersion = this.cacheVersion; if (rowNode.__cacheVersion !== cacheVersion) { rowNode.__cacheVersion = cacheVersion; rowNode.__cacheData = {}; } rowNode.__cacheData[colId] = value; } } getValue(rowNode, colId) { if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) { return void 0; } return rowNode.__cacheData[colId]; } }; var ValueCacheModule = { moduleName: "ValueCache", version: VERSION, beans: [ValueCache], apiFunctions: { expireValueCache } }; var ExpressionModule = { moduleName: "Expression", version: VERSION, beans: [ExpressionService] }; var ChangeDetectionModule = { moduleName: "ChangeDetection", version: VERSION, beans: [ChangeDetectionService] }; var CellApiModule = { moduleName: "CellApi", version: VERSION, apiFunctions: { getCellValue } }; var ValueService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "valueSvc"; this.initialised = false; this.isSsrm = false; } wireBeans(beans) { this.expressionSvc = beans.expressionSvc; this.colModel = beans.colModel; this.valueCache = beans.valueCache; this.dataTypeSvc = beans.dataTypeSvc; this.editSvc = beans.editSvc; this.formulaDataSvc = beans.formulaDataSvc; this.rowGroupColsSvc = beans.rowGroupColsSvc; } postConstruct() { if (!this.initialised) { this.init(); } } init() { const { gos, valueCache } = this; this.executeValueGetter = valueCache ? this.executeValueGetterWithValueCache.bind(this) : this.executeValueGetterWithoutValueCache.bind(this); this.isSsrm = _isServerSideRowModel(gos); this.cellExpressions = gos.get("enableCellExpressions"); this.isTreeData = gos.get("treeData"); this.initialised = true; const listener = (event) => this.callColumnCellValueChangedHandler(event); this.eventSvc.addListener("cellValueChanged", listener, true); this.addDestroyFunc(() => this.eventSvc.removeListener("cellValueChanged", listener, true)); this.addManagedPropertyListener("treeData", (propChange) => this.isTreeData = propChange.currentValue); } /** * Use this function to get a displayable cell value. * The values from this function are not used for sorting, filtering, or aggregation purposes. * Handles: groupHideOpenParents, showOpenedGroup and groupSuppressBlankHeader behaviours */ getValueForDisplay(params) { const beans = this.beans; const column = params.column; const node = params.node; const showRowGroupColValueSvc = beans.showRowGroupColValueSvc; const isFullWidthGroup = !column && node.group; const isGroupCol = column?.colDef.showRowGroup; const processTreeDataAsGroup = !this.isTreeData || node.footer; if (showRowGroupColValueSvc && processTreeDataAsGroup && (isFullWidthGroup || isGroupCol)) { const groupValue = showRowGroupColValueSvc.getGroupValue(node, column, this.displayIgnoresAggData(node)); if (groupValue == null) { return { value: null, valueFormatted: null }; } return { value: groupValue.value, valueFormatted: params.includeValueFormatted ? showRowGroupColValueSvc.formatAndPrefixGroupColValue(groupValue, column, params.exporting) : null }; } if (!column) { return { value: node.key, valueFormatted: null }; } let value = this.getValue(column, node, params.from, this.displayIgnoresAggData(node)); let valueToFormat = value; const formula = beans.formula; if (column.isAllowFormula() && formula?.isFormula(value)) { if (params.useRawFormula) { value = formula.normaliseFormula(value, true); valueToFormat = formula.resolveValue(column, node); } else { value = formula.resolveValue(column, node); valueToFormat = value; } } const format = params.includeValueFormatted && !(params.exporting && column.colDef.useValueFormatterForExport === false); return { value, valueFormatted: format ? this.formatValue(column, node, valueToFormat) : null }; } getValue(column, rowNode, from, ignoreAggData = false) { if (!this.initialised) { this.init(); } if (!rowNode) { return; } const colDef = column.colDef; const isGroup = rowNode.group; if (!isGroup) { const pivotValueColumn = colDef.pivotValueColumn; if (pivotValueColumn) { column = pivotValueColumn; } } const pending = this.editSvc?.getPendingEditValue(rowNode, column, from); if (pending !== void 0) { return pending; } let result = this.resolveValue(column, rowNode, ignoreAggData, isGroup); if (result === void 0) { if (isGroup) { const rowGroupColId = colDef.showRowGroup; if (typeof rowGroupColId === "string") { const colRowGroupIndex = this.rowGroupColsSvc?.getColumnIndex(rowGroupColId); if (colRowGroupIndex != null && colRowGroupIndex > rowNode.level) { return null; } } } return void 0; } if (this.cellExpressions && _isExpressionString(result)) { const cellValueGetter = result.substring(1); result = this.executeValueGetter(cellValueGetter, rowNode.data, column, rowNode); } return result; } /** Computes whether to ignore aggregation data for display purposes. */ displayIgnoresAggData(node) { if (!node.group || node.footer || node.level === -1) { return false; } if (!node.sibling || this.gos.get("groupSuppressBlankHeader")) { return false; } if (node.leafGroup && this.colModel.isPivotMode()) { return false; } return !!node.expanded; } resolveValue(column, rowNode, ignoreAggData, isGroup) { const colDef = column.colDef; const colId = column.colId; const formulaDataSvc = !isGroup && this.formulaDataSvc; if (formulaDataSvc && formulaDataSvc.hasDataSource() && colDef.allowFormula === true) { const formula = formulaDataSvc.getFormula({ column, rowNode }); if (_isExpressionString(formula)) { return formula; } } const aggData = isGroup && !ignoreAggData ? rowNode.aggData : void 0; const isTreeData = this.isTreeData; if (isTreeData && aggData?.[colId] !== void 0) { return aggData[colId]; } const data = rowNode.data; const field = colDef.field; const valueGetter = colDef.valueGetter; if (isTreeData) { if (valueGetter) { return this.executeValueGetter(valueGetter, data, column, rowNode); } if (field && data) { return _getValueUsingField(data, field, column.isFieldContainsDots()); } } const groupData = rowNode.groupData; if (groupData && colId in groupData) { return groupData[colId]; } if (aggData?.[colId] !== void 0) { return aggData[colId]; } const rowGroupColId = colDef.showRowGroup; const allowUserValuesForCell = typeof rowGroupColId !== "string" || !isGroup; const isSsrm = this.isSsrm; const ignoreSsrmAggData = isSsrm && ignoreAggData && !!colDef.aggFunc; if (valueGetter && !ignoreSsrmAggData) { return allowUserValuesForCell ? this.executeValueGetter(valueGetter, data, column, rowNode) : void 0; } const ssrmFooterGroupCol = isSsrm && rowNode.footer && rowNode.field && (rowGroupColId === true || rowGroupColId === rowNode.field); if (ssrmFooterGroupCol) { return _getValueUsingField(data, rowNode.field, column.isFieldContainsDots()); } if (field && data && !ignoreSsrmAggData) { return allowUserValuesForCell ? _getValueUsingField(data, field, column.isFieldContainsDots()) : void 0; } return void 0; } parseValue(column, rowNode, newValue, oldValue) { const colDef = column.getColDef(); if (colDef.allowFormula && this.beans.formula?.isFormula(newValue)) { return newValue; } const valueParser = colDef.valueParser; if (_exists(valueParser)) { const params = _addGridCommonParams(this.gos, { node: rowNode, data: rowNode?.data, oldValue, newValue, colDef, column }); if (typeof valueParser === "function") { return valueParser(params); } return this.expressionSvc?.evaluate(valueParser, params); } return newValue; } getDeleteValue(column, rowNode) { if (_exists(column.getColDef().valueParser)) { return this.parseValue( column, rowNode, "", this.getValueForDisplay({ column, node: rowNode, from: "edit" }).value ) ?? null; } return null; } formatValue(column, node, value, suppliedFormatter, useFormatterFromColumn = true) { const { expressionSvc } = this.beans; let result = null; let formatter; const colDef = column.getColDef(); if (suppliedFormatter) { formatter = suppliedFormatter; } else if (useFormatterFromColumn) { formatter = colDef.valueFormatter; } if (formatter) { const data = node ? node.data : null; const params = _addGridCommonParams(this.gos, { value, node, data, colDef, column }); if (typeof formatter === "function") { result = formatter(params); } else { result = expressionSvc ? expressionSvc.evaluate(formatter, params) : null; } } else if (colDef.refData) { return colDef.refData[value] || ""; } if (result == null && Array.isArray(value)) { result = value.join(", "); } return result; } /** * Sets the value of a GridCell * @param rowNode The `RowNode` to be updated * @param column The `Column` to be updated * @param newValue The new value to be set * @param eventSource The event source * @returns `true` if the value has been updated, otherwise `false`. */ setValue(rowNode, column, newValue, eventSource) { const colDef = column.getColDef(); if (!rowNode.data && this.canCreateRowNodeData(rowNode, colDef)) { rowNode.data = {}; } if (!this.isSetValueSupported(column, rowNode, newValue, colDef)) { return false; } const oldValue = this.getValue(column, rowNode, "data"); const params = _addGridCommonParams(this.gos, { node: rowNode, data: rowNode.data, oldValue, newValue, colDef, column }); let valueSetterChanged = false; if (rowNode.data) { const externalFormulaResult = this.handleExternalFormulaChange({ column, eventSource, newValue, setterParams: params, rowNode }); if (externalFormulaResult !== null) { return externalFormulaResult; } const result = this.computeValueChange({ column, rowNode, newValue, params, rowData: rowNode.data, valueSetter: colDef.valueSetter, field: colDef.field }); valueSetterChanged = result ?? true; } const changeDetectionSvc = this.beans.changeDetectionSvc; changeDetectionSvc?.beginDeferred(); try { if (rowNode.group) { const groupResult = this.beans.rowGroupingEditValueSvc?.setGroupDataValue( rowNode, column, newValue, oldValue, eventSource, valueSetterChanged || newValue !== oldValue ); if (groupResult !== void 0) { if (!valueSetterChanged && !groupResult) { return false; } return this.finishValueChange(rowNode, column, params, eventSource, newValue); } } if (!valueSetterChanged) { return false; } return this.finishValueChange(rowNode, column, params, eventSource); } finally { changeDetectionSvc?.endDeferred(); } } canCreateRowNodeData(rowNode, colDef) { if (!rowNode.group) { return true; } if (colDef.groupRowValueSetter != null || colDef.groupRowEditable != null) { return false; } if (colDef.pivotValueColumn) { return false; } return true; } finishValueChange(rowNode, column, params, eventSource, savedValueOverride) { rowNode.resetQuickFilterAggregateText(); this.valueCache?.onDataChanged(); const savedValue = savedValueOverride === void 0 ? this.getValue(column, rowNode, "data") : savedValueOverride; this.dispatchCellValueChangedEvent(rowNode, params, savedValue, eventSource); if (rowNode.pinnedSibling) { this.dispatchCellValueChangedEvent(rowNode.pinnedSibling, params, savedValue, eventSource); } return true; } isSetValueSupported(column, rowNode, newValue, colDef) { const { field, valueSetter } = colDef; const formulaSvc = this.beans.formula; const isFormulaValue = column.isAllowFormula() && formulaSvc?.isFormula(newValue); const hasExternalFormulaData = !!this.formulaDataSvc?.hasDataSource(); if (_missing(field) && _missing(valueSetter) && !(hasExternalFormulaData && isFormulaValue)) { if (rowNode.group && (colDef.groupRowValueSetter || colDef.groupRowEditable)) { return true; } _warn(17); return false; } if (this.dataTypeSvc && !this.dataTypeSvc.checkType(column, newValue)) { _warn(135); return false; } return true; } handleExternalFormulaChange(args) { const { column, rowNode, newValue, eventSource, setterParams } = args; const formulaSvc = this.beans.formula; const formulaDataSvc = this.formulaDataSvc; if (!formulaDataSvc?.hasDataSource() || !column.isAllowFormula()) { return null; } const isFormulaValue = formulaSvc?.isFormula(newValue); const existingFormula = formulaDataSvc.getFormula({ column, rowNode }); if (isFormulaValue) { const valueWasDifferent = existingFormula !== newValue; if (!valueWasDifferent) { return false; } formulaDataSvc.setFormula({ column, rowNode, formula: newValue }); const computedValue = formulaSvc?.resolveValue(column, rowNode); const colDef = column.getColDef(); if (_exists(colDef.valueSetter) || !_missing(colDef.field)) { const computedParams = { ...setterParams, newValue: computedValue }; this.computeValueChange({ column, rowNode, newValue: computedValue, params: computedParams, rowData: rowNode.data, valueSetter: colDef.valueSetter, field: colDef.field }); } return this.finishValueChange(rowNode, column, setterParams, eventSource); } if (existingFormula !== void 0) { formulaDataSvc.setFormula({ column, rowNode, formula: void 0 }); } return null; } computeValueChange(params) { const { valueSetter, params: setterParams, rowData, field, column, newValue } = params; if (_exists(valueSetter)) { if (typeof valueSetter === "function") { return valueSetter(setterParams); } return this.expressionSvc?.evaluate(valueSetter, setterParams); } return !!rowData && this.setValueUsingField(rowData, field, newValue, column.isFieldContainsDots()); } dispatchCellValueChangedEvent(rowNode, params, value, source) { this.eventSvc.dispatchEvent({ type: "cellValueChanged", event: null, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned, column: params.column, colDef: params.colDef, data: rowNode.data, node: rowNode, oldValue: params.oldValue, newValue: value, newRawValue: params.newValue, value, source }); } callColumnCellValueChangedHandler(event) { const onCellValueChanged = event.colDef.onCellValueChanged; if (typeof onCellValueChanged === "function") { this.beans.frameworkOverrides.wrapOutgoing(() => { onCellValueChanged(event); }); } } setValueUsingField(data, field, newValue, isFieldContainsDots) { if (!field) { return false; } let valuesAreSame = false; if (!isFieldContainsDots) { valuesAreSame = data[field] === newValue; if (!valuesAreSame) { data[field] = newValue; } } else { const fieldPieces = field.split("."); let currentObject = data; while (fieldPieces.length > 0 && currentObject) { const fieldPiece = fieldPieces.shift(); if (fieldPieces.length === 0) { valuesAreSame = currentObject[fieldPiece] === newValue; if (!valuesAreSame) { currentObject[fieldPiece] = newValue; } } else { currentObject = currentObject[fieldPiece]; } } } return !valuesAreSame; } executeValueGetterWithValueCache(valueGetter, data, column, rowNode) { const colId = column.getColId(); const valueFromCache = this.valueCache.getValue(rowNode, colId); if (valueFromCache !== void 0) { return valueFromCache; } const result = this.executeValueGetterWithoutValueCache(valueGetter, data, column, rowNode); this.valueCache.setValue(rowNode, colId, result); return result; } executeValueGetterWithoutValueCache(valueGetter, data, column, rowNode) { const params = _addGridCommonParams(this.gos, { data, node: rowNode, column, colDef: column.getColDef(), getValue: (field) => this.getValueCallback(rowNode, field) }); let result; if (typeof valueGetter === "function") { result = valueGetter(params); } else { result = this.expressionSvc?.evaluate(valueGetter, params); } return result; } getValueCallback(node, field) { const otherColumn = this.colModel.getColDefCol(field); if (otherColumn) { return this.getValue(otherColumn, node, "data"); } return null; } // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col getKeyForNode(col, rowNode) { const value = this.getValue(col, rowNode, "data"); const keyCreator = col.getColDef().keyCreator; let result = value; if (keyCreator) { const keyParams = _addGridCommonParams(this.gos, { value, colDef: col.getColDef(), column: col, node: rowNode, data: rowNode.data }); result = keyCreator(keyParams); } if (typeof result === "string" || result == null) { return result; } result = String(result); if (result === "[object Object]") { _warn(121); } return result; } }; var CommunityCoreModule = { moduleName: "CommunityCore", version: VERSION, beans: [ GridDestroyService, ApiFunctionService, Registry, UserComponentFactory, RowContainerHeightService, VisibleColsService, EventService, GridOptionsService, ColumnModel, PageBoundsService, PageBoundsListener, RowRenderer, ValueService, FocusService, Environment, ScrollVisibleService, CtrlsService, SyncService, ColumnNameService, ColumnViewportService, IconService ], icons: { // icon on select dropdowns (select cell editor, charts tool panels) selectOpen: "small-down", /** @deprecated v33 */ smallDown: "small-down", /** @deprecated v33 */ colorPicker: "color-picker", /** @deprecated v33 */ smallUp: "small-up", /** @deprecated v33 */ checkboxChecked: "small-up", /** @deprecated v33 */ checkboxIndeterminate: "checkbox-indeterminate", /** @deprecated v33 */ checkboxUnchecked: "checkbox-unchecked", /** @deprecated v33 */ radioButtonOn: "radio-button-on", /** @deprecated v33 */ radioButtonOff: "radio-button-off", /** @deprecated v33 */ smallLeft: "small-left", /** @deprecated v33 */ smallRight: "small-right" }, apiFunctions: { getGridId, destroy, isDestroyed, getGridOption, setGridOption, updateGridOptions, isModuleRegistered }, dependsOn: [ DataTypeModule, ColumnMoveModule, ColumnResizeModule, SortModule, ColumnHeaderCompModule, ColumnGroupModule, ColumnGroupHeaderCompModule, OverlayModule, ChangeDetectionModule, AnimationFrameModule, KeyboardNavigationModule, PinnedColumnModule, AriaModule, TouchModule, CellRendererFunctionModule, ColumnFlexModule, ExpressionModule, SkeletonCellRendererModule, ColumnDelayRenderModule ] }; function _fuzzySuggestions(params) { const { inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch } = params; let thisSuggestions = (allSuggestions ?? []).map( (text, idx) => ({ value: text, relevance: _getLevenshteinSimilarityDistance(inputValue, text), idx }) ); thisSuggestions.sort((a, b) => a.relevance - b.relevance); if (hideIrrelevant) { thisSuggestions = thisSuggestions.filter( (suggestion) => suggestion.relevance < Math.max(suggestion.value.length, inputValue.length) ); } if (thisSuggestions.length > 0 && filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) { const bestMatch = thisSuggestions[0].relevance; const limit = bestMatch * filterByPercentageOfBestMatch; thisSuggestions = thisSuggestions.filter((suggestion) => limit - suggestion.relevance < 0); } const values = []; const indices = []; for (const suggestion of thisSuggestions) { values.push(suggestion.value); indices.push(suggestion.idx); } return { values, indices }; } function _getLevenshteinSimilarityDistance(source, target) { const sourceLength = source.length; const targetLength = target.length; if (targetLength === 0) { return sourceLength ? sourceLength : 0; } let inputLower = source.toLocaleLowerCase(); let targetLower = target.toLocaleLowerCase(); let swapTmp; if (source.length < target.length) { swapTmp = targetLower; targetLower = inputLower; inputLower = swapTmp; swapTmp = target; target = source; source = swapTmp; } let previousRow = new Uint16Array(targetLength + 1); let currentRow = new Uint16Array(targetLength + 1); for (let j = 0; j <= targetLength; j++) { previousRow[j] = j; } let secondaryScore = 0; const earlyMatchLimit = sourceLength / 2 - 10; for (let i = 1; i <= sourceLength; i++) { const inputChar = source[i - 1]; const inputCharLower = inputLower[i - 1]; currentRow[0] = i; for (let j = 1; j <= targetLength; j++) { const targetChar = target[j - 1]; const targetCharLower = targetLower[j - 1]; if (inputCharLower !== targetCharLower) { const insertCost = currentRow[j - 1]; const deleteCost = previousRow[j]; const replaceCost = previousRow[j - 1]; let cost = insertCost < deleteCost ? insertCost : deleteCost; if (replaceCost < cost) { cost = replaceCost; } currentRow[j] = cost + 1 | 0; continue; } secondaryScore++; if (inputChar === targetChar) { secondaryScore++; } if (i > 1 && j > 1) { const prevSourceChar = source[i - 2]; const prevSourceCharLower = inputLower[i - 2]; const prevTargetChar = target[j - 2]; const prevTargetCharLower = targetLower[j - 2]; if (prevSourceCharLower === prevTargetCharLower) { secondaryScore++; if (prevSourceChar === prevTargetChar) { secondaryScore++; } } } if (i < earlyMatchLimit) { secondaryScore++; } currentRow[j] = previousRow[j - 1]; } swapTmp = previousRow; previousRow = currentRow; currentRow = swapTmp; } return previousRow[targetLength] / (secondaryScore + 1); } var ENTERPRISE_MODULE_NAMES = { AdvancedFilter: 1, AiToolkit: 1, AllEnterprise: 1, BatchEdit: 1, CellSelection: 1, Clipboard: 1, ColumnMenu: 1, ColumnsToolPanel: 1, ContextMenu: 1, ExcelExport: 1, FiltersToolPanel: 1, Find: 1, GridCharts: 1, IntegratedCharts: 1, GroupFilter: 1, MasterDetail: 1, Menu: 1, MultiFilter: 1, NewFiltersToolPanel: 1, Pivot: 1, RangeSelection: 1, RichSelect: 1, RowNumbers: 1, RowGrouping: 1, RowGroupingEdit: 1, RowGroupingPanel: 1, ServerSideRowModelApi: 1, ServerSideRowModel: 1, SetFilter: 1, SideBar: 1, Sparklines: 1, StatusBar: 1, TreeData: 1, ViewportRowModel: 1, Formula: 1 }; var ALL_COLUMN_FILTERS = [ "TextFilter", "NumberFilter", "BigIntFilter", "DateFilter", "SetFilter", "MultiFilter", "GroupFilter", "CustomFilter" ]; var RESOLVABLE_MODULE_NAMES = { EditCore: [ "TextEditor", "NumberEditor", "DateEditor", "CheckboxEditor", "LargeTextEditor", "SelectEditor", "RichSelect", "CustomEditor" ], CheckboxCellRenderer: ["AllCommunity"], ClientSideRowModelHierarchy: ["RowGrouping", "Pivot", "TreeData"], ColumnFilter: ALL_COLUMN_FILTERS, ColumnGroupHeaderComp: ["AllCommunity"], ColumnGroup: ["AllCommunity"], ColumnHeaderComp: ["AllCommunity"], ColumnMove: ["AllCommunity"], ColumnResize: ["AllCommunity"], CommunityCore: ["AllCommunity"], CsrmSsrmSharedApi: ["ClientSideRowModelApi", "ServerSideRowModelApi"], RowModelSharedApi: ["ClientSideRowModelApi", "ServerSideRowModelApi"], EnterpriseCore: ["AllEnterprise"], FilterCore: [...ALL_COLUMN_FILTERS, "QuickFilter", "ExternalFilter", "AdvancedFilter"], GroupCellRenderer: ["RowGrouping", "Pivot", "TreeData", "MasterDetail", "ServerSideRowModel"], KeyboardNavigation: ["AllCommunity"], LoadingCellRenderer: ["ServerSideRowModel"], MenuCore: ["ColumnMenu", "ContextMenu"], MenuItem: ["ColumnMenu", "ContextMenu", "MultiFilter", "IntegratedCharts", "ColumnsToolPanel"], Overlay: ["AllCommunity"], PinnedColumn: ["AllCommunity"], SharedAggregation: ["RowGrouping", "Pivot", "TreeData", "ServerSideRowModel"], SharedDragAndDrop: ["AllCommunity"], SharedMasterDetail: ["MasterDetail", "ServerSideRowModel"], SharedMenu: [...ALL_COLUMN_FILTERS, "ColumnMenu", "ContextMenu"], SharedPivot: ["Pivot", "ServerSideRowModel"], SharedRowGrouping: ["RowGrouping", "ServerSideRowModel"], SharedRowSelection: ["RowSelection", "ServerSideRowModel"], SkeletonCellRenderer: ["ServerSideRowModel"], Sort: ["AllCommunity"], SsrmInfiniteSharedApi: ["InfiniteRowModel", "ServerSideRowModelApi"], SharedTreeData: ["TreeData", "ServerSideRowModel"] }; var MODULES_FOR_ROW_MODELS = { InfiniteRowModel: "infinite", ClientSideRowModelApi: "clientSide", ClientSideRowModel: "clientSide", ServerSideRowModelApi: "serverSide", ServerSideRowModel: "serverSide", ViewportRowModel: "viewport" }; function resolveModuleNames(moduleName4, rowModelType) { const resolvedModuleNames = []; for (const modName of Array.isArray(moduleName4) ? moduleName4 : [moduleName4]) { const resolved = RESOLVABLE_MODULE_NAMES[modName]; if (resolved) { for (const resolvedModName of resolved) { const rowModelForModule = MODULES_FOR_ROW_MODELS[resolvedModName]; if (!rowModelForModule || rowModelForModule === rowModelType) { resolvedModuleNames.push(resolvedModName); } } } else { resolvedModuleNames.push(modName); } } return resolvedModuleNames; } var NoModulesRegisteredError = () => `No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule: import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community'; ModuleRegistry.registerModules([ AllCommunityModule ]); `; var moduleImportMsg = (moduleNames) => { const imports = moduleNames.map( (moduleName4) => `import { ${convertToUserModuleName(moduleName4)} } from '${ENTERPRISE_MODULE_NAMES[moduleName4] ? "ag-grid-enterprise" : "ag-grid-community"}';` ); const includeCharts = moduleNames.some((m) => m === "IntegratedCharts" || m === "Sparklines"); if (includeCharts) { const chartImport = `import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';`; imports.push(chartImport); } return `import { ModuleRegistry } from 'ag-grid-community'; ${imports.join(" \n")} ModuleRegistry.registerModules([ ${moduleNames.map((m) => convertToUserModuleName(m, true)).join(", ")} ]); For more info see: ${baseDocLink}/modules/`; }; function convertToUserModuleName(moduleName4, inModuleRegistration = false) { if (inModuleRegistration && (moduleName4 === "IntegratedCharts" || moduleName4 === "Sparklines")) { return `${moduleName4}Module.with(AgChartsEnterpriseModule)`; } return `${moduleName4}Module`; } function umdMissingModule(reasonOrId, moduleNames) { const chartModules = moduleNames.filter((m) => m === "IntegratedCharts" || m === "Sparklines"); let message = ""; const agChartsDynamic = globalThis?.agCharts; if (!agChartsDynamic && chartModules.length > 0) { message = `Unable to use ${reasonOrId} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise. `; } else if (moduleNames.some((m) => ENTERPRISE_MODULE_NAMES[m])) { message = message + `Unable to use ${reasonOrId} as that requires the ag-grid-enterprise script to be included. `; } return message; } function missingRowModelTypeError({ moduleName: moduleName4, rowModelType }) { return `To use the ${moduleName4}Module you must set the gridOption "rowModelType='${rowModelType}'"`; } var missingModule = ({ reasonOrId, moduleName: moduleName4, gridScoped, gridId, rowModelType, additionalText, isUmd: isUmd2 }) => { const resolvedModuleNames = resolveModuleNames(moduleName4, rowModelType); const reason = typeof reasonOrId === "string" ? reasonOrId : MISSING_MODULE_REASONS[reasonOrId]; if (isUmd2) { return umdMissingModule(reason, resolvedModuleNames); } const chartModules = resolvedModuleNames.filter((m) => m === "IntegratedCharts" || m === "Sparklines"); const chartImportRequired = chartModules.length > 0 ? `${chartModules.map((m) => convertToUserModuleName(m)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.` : ""; const explanation = `Unable to use ${reason} as ${resolvedModuleNames.length > 1 ? "one of " + resolvedModuleNames.map((m) => convertToUserModuleName(m)).join(", ") : convertToUserModuleName(resolvedModuleNames[0])} is not registered${gridScoped ? " for gridId: " + gridId : ""}. ${chartImportRequired} Check if you have registered the module: `; return `${explanation} ${moduleImportMsg(resolvedModuleNames)}` + (additionalText ? ` ${additionalText}` : ""); }; var missingChartsWithModule = (gridModule) => { return `${gridModule} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. import { AgChartsEnterpriseModule } from 'ag-charts-enterprise'; import { ModuleRegistry } from 'ag-grid-community'; import { ${gridModule} } from 'ag-grid-enterprise'; ModuleRegistry.registerModules([${gridModule}.with(AgChartsEnterpriseModule)]); `; }; var clipboardApiError = (method) => `AG Grid: Unable to use the Clipboard API (navigator.clipboard.${method}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`; var AG_GRID_ERRORS = { 1: () => "`rowData` must be an array", 2: ({ nodeId }) => `Duplicate node id '${nodeId}' detected from getRowId callback, this could cause issues in your grid.`, 3: () => "Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.", 4: ({ id }) => `Could not find row id=${id}, data item was not found for this id`, 5: ({ data }) => [ `Could not find data item as object was not found.`, data, " Consider using getRowId to help the Grid find matching row data" ], 6: () => `'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'`, 7: () => "Pivoting is not supported with aligned grids as it may produce different columns in each grid.", 8: ({ key }) => `Unknown key for navigation ${key}`, 9: ({ variable }) => `No value for ${variable?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${variable?.defaultValue} will be used and updated when styles load.`, 10: ({ eventType }) => `As of v33, the '${eventType}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`, 11: () => "No gridOptions provided to createGrid", 12: ({ colKey }) => ["column ", colKey, " not found"], 13: () => "Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.", 14: ({ groupPrefix }) => `Row IDs cannot start with ${groupPrefix}, this is a reserved prefix for AG Grid's row grouping feature.`, 15: ({ expression }) => ["value should be either a string or a function", expression], 16: ({ expression, params, e }) => [ "Processing of the expression failed", "Expression = ", expression, "Params = ", params, "Exception = ", e ], 17: () => "you need either field or valueSetter set on colDef for editing to work", 18: () => `alignedGrids contains an undefined option.`, 19: () => `alignedGrids - No api found on the linked grid.`, 20: () => `You may want to configure via a callback to avoid setup race conditions: "alignedGrids: () => [linkedGrid]"`, 21: () => "pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.", 22: ({ key }) => `${key} is an initial property and cannot be updated.`, 23: () => "The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.", 24: () => "row height must be a number if not using standard row model", 25: ({ id }) => [`The getRowId callback must return a string. The ID `, id, ` is being cast to a string.`], 26: ({ fnName, preDestroyLink }) => { return `Grid API function ${fnName}() cannot be called as the grid has been destroyed. Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${preDestroyLink}`; }, 27: ({ fnName, module: module2 }) => `API function '${fnName}' not registered to module '${module2}'`, 28: () => "setRowCount cannot be used while using row grouping.", 29: () => "tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?", 30: ({ toIndex }) => [ "tried to insert columns in invalid location, toIndex = ", toIndex, "remember that you should not count the moving columns when calculating the new index" ], 31: () => "infinite loop in resizeColumnSets", 32: () => "applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.", 33: () => "stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.", 34: ({ key }) => `the column type '${key}' is a default column type and cannot be overridden.`, 35: () => `Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.`, 36: ({ t }) => "colDef.type '" + t + "' does not correspond to defined gridOptions.columnTypes", 37: () => `Changing the column pinning status is not allowed with domLayout='print'`, 38: ({ iconName }) => `provided icon '${iconName}' needs to be a string or a function`, 39: () => "Applying column order broke a group where columns should be married together. Applying new order has been discarded.", 40: ({ e, method }) => `${e} ${clipboardApiError(method)}`, 41: () => "Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.", 42: () => "Browser does not support document.execCommand('copy') for clipboard operations", 43: ({ iconName }) => `As of v33, icon '${iconName}' is deprecated. Use the icon CSS name instead.`, 44: () => 'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.', 45: ({ parentCellDataType }) => `The data type definition ${parentCellDataType} does not exist.`, 46: () => 'The "baseDataType" property of a data type definition must match that of its parent.', 47: ({ cellDataType }) => `Missing data type definition - "${cellDataType}"`, 48: ({ property, inferred, colId }) => { const inferredStr = inferred ? " (inferred)" : ""; const colIdStr = colId ? ` for column "${colId}"` : ""; const parserHint = inferred && property === "Parser" ? ` - "colDef.cellDataType = 'object'"` : ""; return `Cell data type is "object"${inferredStr} but no Value ${property} has been provided${colIdStr}. Please either provide an object data type definition with a Value ${property}, or set: - "colDef.value${property}"${parserHint}`; }, 49: ({ methodName }) => `Framework component is missing the method ${methodName}()`, 50: ({ compName }) => `Could not find component ${compName}, did you forget to configure this component?`, 51: () => `Export cancelled. Export is not allowed as per your configuration.`, 52: () => "There is no `window` associated with the current `document`", 53: () => `unknown value type during csv conversion`, 54: () => "Could not find document body, it is needed for drag and drop and context menu.", 55: () => "addRowDropZone - A container target needs to be provided", 56: () => "addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.", 57: () => "unable to show popup filter, filter instantiation failed", 58: () => "no values found for select cellEditor", 59: () => "cannot select pinned rows", 60: () => "cannot select node until it has finished loading", 61: () => "since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.", 62: ({ colId }) => `setFilterModel() - no column found for colId: ${colId}`, 63: ({ colId }) => `setFilterModel() - unable to fully apply model, filtering disabled for colId: ${colId}`, 64: ({ colId }) => `setFilterModel() - unable to fully apply model, unable to create filter for colId: ${colId}`, 65: () => "filter missing setModel method, which is needed for setFilterModel", 66: () => "filter API missing getModel method, which is needed for getFilterModel", 67: () => "Filter is missing isFilterActive() method", 68: () => "Column Filter API methods have been disabled as Advanced Filters are enabled.", 69: ({ guiFromFilter }) => `getGui method from filter returned ${guiFromFilter}; it should be a DOM element.`, 70: ({ newFilter }) => `Grid option quickFilterText only supports string inputs, received: ${typeof newFilter}`, 71: () => "debounceMs is ignored when apply button is present", 72: ({ keys }) => [`ignoring FilterOptionDef as it doesn't contain one of `, keys], 73: () => `invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'`, 74: () => "no filter options for filter", 75: () => "Unknown button type specified", 76: ({ filterModelType }) => [ 'Unexpected type of filter "', filterModelType, '", it looks like the filter was configured with incorrect Filter Options' ], 77: () => `Filter model is missing 'conditions'`, 78: () => 'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.', 79: () => '"filterParams.maxNumConditions" must be greater than or equal to zero.', 80: () => '"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.', 81: () => '"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".', 82: ({ param }) => `DateFilter ${param} is not a number`, 83: () => `DateFilter minValidYear should be <= maxValidYear`, 84: () => `DateFilter minValidDate should be <= maxValidDate`, 85: () => "DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.", 86: () => "DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.", 87: () => "DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.", 88: ({ index }) => `Invalid row index for ensureIndexVisible: ${index}`, 89: () => `A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)`, 90: () => `datasource is missing getRows method`, 91: () => "Filter is missing method doesFilterPass", 92: () => `AnimationFrameService called but animation frames are off`, 93: () => "cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`", 94: ({ paginationPageSizeOption, pageSizeSet, pageSizesSet, pageSizeOptions }) => `'paginationPageSize=${paginationPageSizeOption}'${pageSizeSet ? "" : " (default value)"}, but ${paginationPageSizeOption} is not included in${pageSizesSet ? "" : " the default"} paginationPageSizeSelector=[${pageSizeOptions?.join(", ")}].`, 95: ({ paginationPageSizeOption, paginationPageSizeSelector: paginationPageSizeSelector2 }) => `Either set '${paginationPageSizeSelector2}' to an array that includes ${paginationPageSizeOption} or to 'false' to disable the page size selector.`, 96: ({ id, data }) => [ "Duplicate ID", id, "found for pinned row with data", data, "When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter." ], 97: ({ colId }) => `cellEditor for column ${colId} is missing getGui() method`, 98: () => "popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.", 99: () => "Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.", // 100: ({ rowModelType }: { rowModelType: RowModelType }) => // `selectAll only available when rowModelType='clientSide', ie not ${rowModelType}` as const, 101: ({ propertyName, componentName, agGridDefaults, jsComps }) => { const textOutput = []; const validComponents = [ // Don't include the old names / internals in potential suggestions ...Object.keys(agGridDefaults ?? []).filter( (k) => !["agCellEditor", "agGroupRowRenderer", "agSortIndicator"].includes(k) ), ...Object.keys(jsComps ?? []).filter((k) => !!jsComps[k]) ]; const suggestions = _fuzzySuggestions({ inputValue: componentName, allSuggestions: validComponents, hideIrrelevant: true, filterByPercentageOfBestMatch: 0.8 }).values; textOutput.push( `Could not find '${componentName}' component. It was configured as "${propertyName}: '${componentName}'" but it wasn't found in the list of registered components. ` ); if (suggestions.length > 0) { textOutput.push(` Did you mean: [${suggestions.slice(0, 3)}]? `); } textOutput.push(`If using a custom component check it has been registered correctly.`); return textOutput; }, 102: () => "selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'", 103: () => "Invalid selection state. When using client-side row model, the state must conform to `string[]`.", 104: ({ value, param }) => `Numeric value ${value} passed to ${param} param will be interpreted as ${value} seconds. If this is intentional use "${value}s" to silence this warning.`, 105: ({ e }) => [`chart rendering failed`, e], 106: () => `Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${baseDocLink}/theming-migration/`, 107: ({ key, value }) => `Invalid value for theme param ${key} - ${value}`, 108: ({ e }) => ["chart update failed", e], 109: ({ inputValue, allSuggestions }) => { const suggestions = _fuzzySuggestions({ inputValue, allSuggestions, hideIrrelevant: true, filterByPercentageOfBestMatch: 0.8 }).values; return [ `Could not find '${inputValue}' aggregate function. It was configured as "aggFunc: '${inputValue}'" but it wasn't found in the list of registered aggregations.`, suggestions.length > 0 ? ` Did you mean: [${suggestions.slice(0, 3)}]?` : "", `If using a custom aggregation function check it has been registered correctly.` ].join("\n"); }, 110: () => "groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup", 111: () => "Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.", 113: () => "Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values", 114: ({ component }) => `Could not find component with name of ${component}. Is it in Vue.components?`, // 115: () => 'The provided selection state should be an object.' as const, 116: () => "Invalid selection state. The state must conform to `IServerSideSelectionState`.", 117: () => "selectAll must be of boolean type.", 118: () => "Infinite scrolling must be enabled in order to set the row count.", 119: () => "Unable to instantiate filter", 120: () => "MultiFloatingFilterComp expects MultiFilter as its parent", 121: () => "a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key", 122: () => "could not find the document, document is empty", 123: () => "Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.", 124: () => "No active charts to update.", 125: ({ chartId }) => `Unable to update chart. No active chart found with ID: ${chartId}.`, 126: () => "unable to restore chart as no chart model is provided", 127: ({ allRange }) => `unable to create chart as ${allRange ? "there are no columns in the grid" : "no range is selected"}.`, 128: ({ feature }) => `${feature} is only available if using 'multiRow' selection mode.`, 129: ({ feature, rowModel }) => `${feature} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${rowModel}.`, 130: () => 'cannot multi select unless selection mode is "multiRow"', // 131: () => 'cannot range select while selecting multiple rows' as const, 132: () => "Row selection features are not available unless `rowSelection` is enabled.", 133: ({ iconName }) => `icon '${iconName}' function should return back a string or a dom object`, 134: ({ iconName }) => `Did not find icon '${iconName}'`, 135: () => `Data type of the new value does not match the cell data type of the column`, 136: () => `Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`, 137: ({ type, currentChartType }) => `Unable to update chart as a '${type}' update type is not permitted on a ${currentChartType}.`, 138: ({ chartType }) => `invalid chart type supplied: ${chartType}`, 139: ({ customThemeName }) => `a custom chart theme with the name ${customThemeName} has been supplied but not added to the 'chartThemes' list`, 140: ({ name }) => `no stock theme exists with the name '${name}' and no custom chart theme with that name was supplied to 'customChartThemes'`, 141: () => "cross filtering with row grouping is not supported.", 142: () => "cross filtering is only supported in the client side row model.", 143: ({ panel }) => `'${panel}' is not a valid Chart Tool Panel name`, 144: ({ type }) => `Invalid charts data panel group name supplied: '${type}'`, 145: ({ group }) => `As of v32, only one charts customize panel group can be expanded at a time. '${group}' will not be expanded.`, 146: ({ comp }) => `Unable to instantiate component '${comp}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`, 147: ({ group }) => `Invalid charts customize panel group name supplied: '${group}'`, 148: ({ group }) => `invalid chartGroupsDef config '${group}'`, 149: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`, 150: () => `'seriesChartTypes' are required when the 'customCombo' chart type is specified.`, 151: ({ chartType }) => `invalid chartType '${chartType}' supplied in 'seriesChartTypes', converting to 'line' instead.`, 152: ({ colId }) => `no 'seriesChartType' found for colId = '${colId}', defaulting to 'line'.`, 153: ({ chartDataType }) => `unexpected chartDataType value '${chartDataType}' supplied, instead use 'category', 'series' or 'excluded'`, 154: ({ colId }) => `cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${colId}`, 155: ({ option }) => `'${option}' is not a valid Chart Toolbar Option`, 156: ({ panel }) => `Invalid panel in chartToolPanelsDef.panels: '${panel}'`, 157: ({ unrecognisedGroupIds }) => ["unable to find group(s) for supplied groupIds:", unrecognisedGroupIds], 158: () => "can not expand a column item that does not represent a column group header", 159: () => "Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.", 160: () => `Export cancelled. Export is not allowed as per your configuration.`, 161: () => "The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'", 162: ({ id, dataType }) => `Unrecognized data type for excel export [${id}.dataType=${dataType}]`, 163: ({ featureName }) => `Excel table export does not work with ${featureName}. The exported Excel file will not contain any Excel tables. Please turn off ${featureName} to enable Excel table exports.`, 164: () => "Unable to add data table to Excel sheet: A table already exists.", 165: () => "Unable to add data table to Excel sheet: Missing required parameters.", 166: ({ unrecognisedGroupIds }) => ["unable to find groups for these supplied groupIds:", unrecognisedGroupIds], 167: ({ unrecognisedColIds }) => ["unable to find columns for these supplied colIds:", unrecognisedColIds], 168: () => "detailCellRendererParams.template should be function or string", 169: () => 'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.', 170: ({ providedStrategy }) => `invalid cellRendererParams.refreshStrategy = ${providedStrategy} supplied, defaulting to refreshStrategy = 'rows'.`, 171: () => "could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions", 172: () => "could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData", 173: ({ group }) => `invalid chartGroupsDef config '${group}'`, 174: ({ group, chartType }) => `invalid chartGroupsDef config '${group}.${chartType}'`, 175: ({ menuTabName, itemsToConsider }) => [ `Trying to render an invalid menu item '${menuTabName}'. Check that your 'menuTabs' contains one of `, itemsToConsider ], 176: ({ key }) => `unknown menu item type ${key}`, 177: () => `valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.`, 178: ({ colId }) => `column ${colId} is not visible`, 179: () => "totalValueGetter should be either a function or a string (expression)", 180: () => "agRichSelectCellEditor requires cellEditorParams.values to be set", 181: () => "agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.", 182: () => 'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data', 183: () => "Group Column Filter only works on group columns. Please use a different filter.", 184: ({ parentGroupData, childNodeData }) => [`duplicate group keys for row data, keys should be unique`, [parentGroupData, childNodeData]], 185: ({ data }) => [`getDataPath() should not return an empty path`, [data]], 186: ({ rowId, rowData, duplicateRowsData }) => [ `duplicate group keys for row data, keys should be unique`, rowId, rowData, ...duplicateRowsData ?? [] ], 187: ({ rowId, firstData, secondData }) => [ `Duplicate node id ${rowId}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`, "first instance", firstData, "second instance", secondData ], 188: (props) => `getRowId callback must be provided for Server Side Row Model ${props?.feature || "selection"} to work correctly.`, 189: ({ startRow }) => `invalid value ${startRow} for startRow, the value should be >= 0`, 190: ({ rowGroupId, data }) => [ `null and undefined values are not allowed for server side row model keys`, rowGroupId ? `column = ${rowGroupId}` : ``, `data is `, data ], // 191: () => `cannot multi select unless selection mode is 'multiRow'` as const, // 192: () => `cannot use range selection when multi selecting rows` as const, // 193: () => "cannot multi select unless selection mode is 'multiRow'" as const, 194: ({ method }) => `calling gridApi.${method}() is only possible when using rowModelType=\`clientSide\`.`, 195: ({ justCurrentPage }) => `selecting just ${justCurrentPage ? "current page" : "filtered"} only works when gridOptions.rowModelType='clientSide'`, 196: ({ key }) => `Provided ids must be of string type. Invalid id provided: ${key}`, 197: () => "`toggledNodes` must be an array of string ids.", // 198: () => `cannot multi select unless selection mode is 'multiRow'` as const, 199: () => `getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use \`api.getServerSideSelectionState()\` instead.`, 200: missingModule, 201: ({ rowModelType }) => `Could not find row model for rowModelType = ${rowModelType}`, 202: () => `\`getSelectedNodes\` and \`getSelectedRows\` functions cannot be used with \`groupSelectsChildren\` and the server-side row model. Use \`api.getServerSideSelectionState()\` instead.`, 203: () => "Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.", 204: () => "Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.", 205: ({ duplicateIdText }) => `Unable to display rows as duplicate row ids (${duplicateIdText}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`, 206: () => "getRowId callback must be implemented for transactions to work. Transaction was ignored.", 207: () => 'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.', 208: () => `Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.`, 209: () => `Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${baseDocLink}/filter-set-filter-list/#filter-value-types`, 210: () => "Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?", 211: () => "property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.", 212: () => `please review all your toolPanel components, it seems like at least one of them doesn't have an id`, 213: () => "Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.", 214: ({ key }) => `unable to lookup Tool Panel as invalid key supplied: ${key}`, 215: ({ key, defaultByKey }) => `the key ${key} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(defaultByKey ?? {}).join(",")}`, 216: ({ name }) => `Missing component for '${name}'`, 217: ({ invalidColIds }) => ["unable to find grid columns for the supplied colDef(s):", invalidColIds], 218: ({ property, defaultOffset }) => `${property} must be a number, the value you provided is not a valid number. Using the default of ${defaultOffset}px.`, 219: ({ property }) => `Property ${property} does not exist on the target object.`, 220: ({ lineDash: lineDash2 }) => `'${lineDash2}' is not a valid 'lineDash' option.`, 221: () => `agAggregationComponent should only be used with the client and server side row model.`, 222: () => `agFilteredRowCountComponent should only be used with the client side row model.`, 223: () => `agSelectedRowCountComponent should only be used with the client and server side row model.`, 224: () => `agTotalAndFilteredRowCountComponent should only be used with the client side row model.`, 225: () => "agTotalRowCountComponent should only be used with the client side row model.", 226: () => "viewport is missing init method.", 227: () => "menu item icon must be DOM node or string", 228: ({ menuItemOrString }) => `unrecognised menu item ${menuItemOrString}`, // 229: ({ index }: { index: number }) => ['invalid row index for ensureIndexVisible: ', index] as const, 230: () => "detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/", // @deprecated v32 mark for removal as part of v32 deprecated features 231: () => "As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.", 232: () => "Using both rowData and v-model. rowData will be ignored.", 233: ({ methodName }) => `Framework component is missing the method ${methodName}()`, 234: () => 'Group Column Filter does not work with the colDef property "field". This property will be ignored.', 235: () => 'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.', 236: () => 'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.', 237: () => "Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.", 238: () => "setRowCount can only accept a positive row count.", 239: () => 'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.', 240: ({ theme }) => `theme grid option must be a Theming API theme object or the string "legacy", received: ${theme}`, // 241: () => `cannot select multiple rows when rowSelection.mode is set to 'singleRow'` as const, // 242: () => 'cannot select multiple rows when using rangeSelect' as const, 243: () => "Failed to deserialize state - each provided state object must be an object.", 244: () => "Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.", 245: () => "Failed to deserialize state - `toggledNodes` must be an array.", 246: () => "Failed to deserialize state - Every `toggledNode` requires an associated string id.", 247: () => `Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. Please rebuild the selection state and reapply it.`, 248: () => "SetFloatingFilter expects SetFilter as its parent", 249: () => "Must supply a Value Formatter in Set Filter params when using a Key Creator", 250: () => "Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.", 251: ({ chartType }) => `AG Grid: Unable to create chart as an invalid chartType = '${chartType}' was supplied.`, 252: () => "cannot get grid to draw rows when it is in the middle of drawing rows. \nYour code probably called a grid API method while the grid was in the render stage. \nTo overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). \nTo see what part of your code that caused the refresh check this stacktrace.", 253: ({ version }) => ["Illegal version string: ", version], 254: () => "Cannot create chart: no chart themes available.", 255: ({ point }) => `Lone surrogate U+${point?.toString(16).toUpperCase()} is not a scalar value`, 256: () => "Unable to initialise. See validation error, or load ValidationModule if missing.", 257: () => missingChartsWithModule("IntegratedChartsModule"), 258: () => missingChartsWithModule("SparklinesModule"), 259: ({ part }) => `the argument to theme.withPart must be a Theming API part object, received: ${part}`, 260: ({ propName, compName, gridScoped, gridId, rowModelType }) => missingModule({ reasonOrId: `AG Grid '${propName}' component: ${compName}`, moduleName: USER_COMP_MODULES[compName], gridId, gridScoped, rowModelType }), 261: () => "As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.", 262: () => 'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.', 263: () => 'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.', 264: () => 'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.', 265: ({ colId }) => `Unable to infer chart data type for column '${colId}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${baseDocLink}/integrated-charts-range-chart#coldefchartdatatype .`, 266: () => 'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.', 267: () => "Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.", 268: () => "Transactions aren't supported with tree data when using treeDataChildrenField", 269: () => "When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection", 270: ({ id, parentId }) => `Cycle detected for row with id='${id}' and parent id='${parentId}'. Resetting the parent for row with id='${id}' and showing it as a root-level node.`, 271: ({ id, parentId }) => `Parent row not found for row with id='${id}' and parent id='${parentId}'. Showing row with id='${id}' as a root-level node.`, 272: () => NoModulesRegisteredError(), 273: ({ providedId, usedId }) => `Provided column id '${providedId}' was already in use, ensure all column and group ids are unique. Using '${usedId}' instead.`, 274: ({ prop }) => { let msg = `Since v33, ${prop} has been deprecated.`; switch (prop) { case "maxComponentCreationTimeMs": msg += " This property is no longer required and so will be removed in a future version."; break; case "setGridApi": msg += ` This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api `; break; case "children": msg += ` For multiple versions AgGridReact does not support children.`; break; } return msg; }, 275: missingRowModelTypeError, 276: () => "Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.", 277: ({ colId }) => `'enableFilterHandlers' is set to true, but column '${colId}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`, 278: ({ colId }) => `Unable to create filter handler for column '${colId}'`, 279: (_) => { }, // `Unable to create dynamic bean '${name}' during module init lifecycle, dynamic beans must be initialised on first use.` as const, 280: ({ colId }) => `'name' must be provided for custom filter components for column '${colId}`, 281: ({ colId }) => `Filter for column '${colId}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`, 282: () => "New filter tool panel requires `enableFilterHandlers: true`.", 283: () => "As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.", 284: () => "As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.", 285: () => "As of v34, use (`api.getColumnFilterModel()`) instead.", 286: () => "As of v34, use (`api.setColumnFilterModel()`) instead.", 287: () => "`api.doFilterAction()` requires `enableFilterHandlers = true", 288: () => "`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true", 289: ({ rowModelType }) => `Row Model '${rowModelType}' is not supported with Batch Editing`, 290: ({ rowIndex, rowPinned }) => `Row with index '${rowIndex}' and pinned state '${rowPinned}' not found`, 291: () => "License Key being set multiple times with different values. This can result in an incorrect license key being used,", 292: ({ colId }) => `The Multi Filter for column '${colId}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`, 293: () => `The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.`, 294: () => `When using the \`agRichSelectCellEditor\` setting \`filterListAsync = true\` requires \`allowTyping = true\` and the \`values()\` callback must return a Promise of filtered values.`, 295: ({ blockedService }) => `colDef.allowFormula is not supported with ${blockedService}. Formulas has been turned off.`, 296: () => "Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.", 297: () => '`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.', 298: () => `Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates.` }; function getError(errorId, args) { const msgOrFunc = AG_GRID_ERRORS[errorId]; if (!msgOrFunc) { return [`Missing error text for error id ${errorId}!`]; } const errorBody = msgOrFunc(args); const errorLink = getErrorLink(errorId, args); const errorSuffix = ` See ${errorLink}`; return Array.isArray(errorBody) ? errorBody.concat(errorSuffix) : [errorBody, errorSuffix]; } var MISSING_MODULE_REASONS = { 1: "Charting Aggregation", 2: "pivotResultFields", 3: "setTooltip" }; var VanillaFrameworkOverrides = class { constructor(frameworkName = "javascript") { this.frameworkName = frameworkName; this.renderingEngine = "vanilla"; this.batchFrameworkComps = false; this.wrapIncoming = (callback) => callback(); this.wrapOutgoing = (callback) => callback(); this.baseDocLink = `${BASE_URL}/${this.frameworkName}-data-grid`; setValidationDocLink(this.baseDocLink); } frameworkComponent(_) { return null; } isFrameworkComponent(_) { return false; } getDocLink(path) { return this.baseDocLink + (path ? "/" + path : ""); } }; var _gridApiCache = /* @__PURE__ */ new WeakMap(); var _gridElementCache = /* @__PURE__ */ new WeakMap(); function createGrid(eGridDiv, gridOptions, params) { if (!gridOptions) { _error(11); return {}; } const gridParams = params; let destroyCallback; if (!gridParams?.setThemeOnGridDiv) { const newGridDiv = _createElement({ tag: "div" }); newGridDiv.style.height = "100%"; eGridDiv.appendChild(newGridDiv); eGridDiv = newGridDiv; destroyCallback = () => eGridDiv.remove(); } const api = new GridCoreCreator().create( eGridDiv, gridOptions, (context) => { const gridComp = new GridComp(eGridDiv); context.createBean(gridComp); }, void 0, params, destroyCallback ); return api; } var nextGridId = 1; var GridCoreCreator = class { create(eGridDiv, providedOptions, createUi, acceptChanges, params, _destroyCallback) { const gridOptions = GlobalGridOptions.applyGlobalGridOptions(providedOptions); const gridId = gridOptions.gridId ?? String(nextGridId++); const registeredModules = this.getRegisteredModules(params, gridId, gridOptions.rowModelType); const beanClasses = this.createBeansList(gridOptions.rowModelType, registeredModules, gridId); const providedBeanInstances = this.createProvidedBeans(eGridDiv, gridOptions, params); if (!beanClasses) { return void 0; } const destroyCallback = () => { _gridElementCache.delete(api); _gridApiCache.delete(eGridDiv); _unRegisterGridModules(gridId); _destroyCallback?.(); }; const contextParams = { providedBeanInstances, beanClasses, id: gridId, beanInitComparator: gridBeanInitComparator, beanDestroyComparator: gridBeanDestroyComparator, derivedBeans: [createGridApi], destroyCallback }; const context = new AgContext(contextParams); this.registerModuleFeatures(context, registeredModules); createUi(context); context.getBean("syncSvc").start(); acceptChanges?.(context); const api = context.getBean("gridApi"); _gridApiCache.set(eGridDiv, api); _gridElementCache.set(api, eGridDiv); return api; } getRegisteredModules(params, gridId, rowModelType) { _registerModule(CommunityCoreModule, void 0, true); params?.modules?.forEach((m) => _registerModule(m, gridId)); return _getRegisteredModules(gridId, getDefaultRowModelType(rowModelType)); } registerModuleFeatures(context, registeredModules) { const registry = context.getBean("registry"); const apiFunctionSvc = context.getBean("apiFunctionSvc"); for (const module2 of registeredModules) { registry.registerModule(module2); const apiFunctions2 = module2.apiFunctions; if (apiFunctions2) { const names = Object.keys(apiFunctions2); for (const name of names) { apiFunctionSvc?.addFunction(name, apiFunctions2[name]); } } } } createProvidedBeans(eGridDiv, gridOptions, params) { let frameworkOverrides = params ? params.frameworkOverrides : null; if (_missing(frameworkOverrides)) { frameworkOverrides = new VanillaFrameworkOverrides(); } const seed = { gridOptions, eGridDiv, eRootDiv: eGridDiv, globalListener: params ? params.globalListener : null, globalSyncListener: params ? params.globalSyncListener : null, frameworkOverrides, withinStudio: params?.withinStudio }; if (params?.providedBeanInstances) { Object.assign(seed, params.providedBeanInstances); } return seed; } createBeansList(userProvidedRowModelType, registeredModules, gridId) { const rowModelModuleNames = { clientSide: "ClientSideRowModel", infinite: "InfiniteRowModel", serverSide: "ServerSideRowModel", viewport: "ViewportRowModel" }; const rowModelType = getDefaultRowModelType(userProvidedRowModelType); const rowModuleModelName = rowModelModuleNames[rowModelType]; if (!rowModuleModelName) { _logPreInitErr(201, { rowModelType }, `Unknown rowModelType ${rowModelType}.`); return; } if (!_hasUserRegistered()) { _logPreInitErr(272, void 0, NoModulesRegisteredError()); return; } if (!userProvidedRowModelType) { const registeredRowModelModules = Object.entries(rowModelModuleNames).filter( ([rowModelType2, module2]) => _isModuleRegistered(module2, gridId, rowModelType2) ); if (registeredRowModelModules.length == 1) { const [userRowModelType, moduleName4] = registeredRowModelModules[0]; if (userRowModelType !== rowModelType) { const params = { moduleName: moduleName4, rowModelType: userRowModelType }; _logPreInitErr(275, params, missingRowModelTypeError(params)); return; } } } if (!_isModuleRegistered(rowModuleModelName, gridId, rowModelType)) { const isUmd2 = _isUmd(); const reasonOrId = `rowModelType = '${rowModelType}'`; const message = isUmd2 ? `Unable to use ${reasonOrId} as that requires the ag-grid-enterprise script to be included. ` : `Missing module ${rowModuleModelName}Module for rowModelType ${rowModelType}.`; _logPreInitErr( 200, { reasonOrId, moduleName: rowModuleModelName, gridScoped: _areModulesGridScoped(), gridId, rowModelType, isUmd: isUmd2 }, message ); return; } const beans = /* @__PURE__ */ new Set(); for (const module2 of registeredModules) { for (const bean of module2.beans ?? []) { beans.add(bean); } } return Array.from(beans); } }; function getDefaultRowModelType(passedRowModelType) { return passedRowModelType ?? "clientSide"; } function getGridApi(gridElement) { if (typeof gridElement === "string") { try { gridElement = document.querySelector(`[grid-id="${gridElement}"]`)?.parentElement ?? document.querySelector(gridElement)?.firstElementChild ?? document.getElementById(gridElement)?.firstElementChild; } catch { gridElement = null; } } return gridElement ? _gridApiCache.get(gridElement) : void 0; } function getGridElement(api) { return _gridElementCache.get(api); } function convertColumnState(columnState, enablePivotMode = false) { const sortColumns = []; const groupColIds = []; const aggregationColumns = []; const pivotColIds = []; const leftColIds = []; const rightColIds = []; const hiddenColIds = []; const columnSizes = []; const columns = []; let defaultSortIndex = 0; for (let i = 0; i < columnState.length; i++) { const { colId, sort, sortType, sortIndex, rowGroup, rowGroupIndex, aggFunc, pivot, pivotIndex, pinned, hide, width, flex } = columnState[i]; columns.push(colId); if (sort) { sortColumns[sortIndex ?? defaultSortIndex++] = { colId, sort, type: sortType }; } if (rowGroup) { groupColIds[rowGroupIndex ?? 0] = colId; } if (typeof aggFunc === "string") { aggregationColumns.push({ colId, aggFunc }); } if (pivot) { pivotColIds[pivotIndex ?? 0] = colId; } if (pinned) { (pinned === "right" ? rightColIds : leftColIds).push(colId); } if (hide) { hiddenColIds.push(colId); } if (flex != null || width) { columnSizes.push({ colId, flex: flex ?? void 0, width: width === null ? void 0 : width }); } } return { sort: sortColumns.length ? { sortModel: _removeEmptyValues(sortColumns) } : void 0, rowGroup: groupColIds.length ? { groupColIds: _removeEmptyValues(groupColIds) } : void 0, aggregation: aggregationColumns.length ? { aggregationModel: aggregationColumns } : void 0, pivot: pivotColIds.length || enablePivotMode ? { pivotMode: enablePivotMode, pivotColIds: _removeEmptyValues(pivotColIds) } : void 0, columnPinning: leftColIds.length || rightColIds.length ? { leftColIds, rightColIds } : void 0, columnVisibility: hiddenColIds.length ? { hiddenColIds } : void 0, columnSizing: columnSizes.length ? { columnSizingModel: columnSizes } : void 0, columnOrder: columns.length ? { orderedColIds: columns } : void 0 }; } function _removeEmptyValues(array) { return array.filter((a) => a != void 0); } function _convertColumnGroupState(columnGroupState) { const openColumnGroups = []; for (const { groupId, open } of columnGroupState) { if (open) { openColumnGroups.push(groupId); } } return openColumnGroups.length ? { openColumnGroupIds: openColumnGroups } : void 0; } function convertColumnGroupState(columnGroupState) { return { columnGroup: _convertColumnGroupState(columnGroupState) }; } var AlignedGridsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "alignedGridsSvc"; this.consuming = false; } getAlignedGridApis() { let alignedGrids = this.gos.get("alignedGrids") ?? []; const isCallbackConfig = typeof alignedGrids === "function"; if (typeof alignedGrids === "function") { alignedGrids = alignedGrids(); } const apis = alignedGrids.map((alignedGrid) => { if (!alignedGrid) { _error(18); if (!isCallbackConfig) { _error(20); } return; } if (this.isGridApi(alignedGrid)) { return alignedGrid; } const refOrComp = alignedGrid; if ("current" in refOrComp) { return refOrComp.current?.api; } if (!refOrComp.api) { _error(19); } return refOrComp.api; }).filter((api) => !!api && !api.isDestroyed()); return apis; } isGridApi(ref) { return !!ref && !!ref.dispatchEvent; } postConstruct() { const fireColumnEvent = this.fireColumnEvent.bind(this); this.addManagedEventListeners({ columnMoved: fireColumnEvent, columnVisible: fireColumnEvent, columnPinned: fireColumnEvent, columnGroupOpened: fireColumnEvent, columnResized: fireColumnEvent, bodyScroll: this.fireScrollEvent.bind(this), alignedGridColumn: ({ event }) => this.onColumnEvent(event), alignedGridScroll: ({ event }) => this.onScrollEvent(event) }); } // common logic across all the fire methods fireEvent(event) { if (this.consuming) { return; } for (const api of this.getAlignedGridApis()) { if (api.isDestroyed()) { continue; } api.dispatchEvent(event); } } // common logic across all consume methods. very little common logic, however extracting // guarantees consistency across the methods. onEvent(callback) { this.consuming = true; callback(); this.consuming = false; } fireColumnEvent(columnEvent) { this.fireEvent({ type: "alignedGridColumn", event: columnEvent }); } fireScrollEvent(scrollEvent) { if (scrollEvent.direction !== "horizontal") { return; } this.fireEvent({ type: "alignedGridScroll", event: scrollEvent }); } onScrollEvent(event) { this.onEvent(() => { this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(event.left, true); }); } extractDataFromEvent(event, func) { const result = []; if (event.columns) { event.columns.forEach((column) => { result.push(func(column)); }); } else if (event.column) { result.push(func(event.column)); } return result; } getMasterColumns(event) { return this.extractDataFromEvent(event, (col) => col); } getColumnIds(event) { return this.extractDataFromEvent(event, (col) => col.getColId()); } onColumnEvent(event) { this.onEvent(() => { switch (event.type) { case "columnMoved": case "columnVisible": case "columnPinned": case "columnResized": { this.processColumnEvent(event); break; } case "columnGroupOpened": { this.processGroupOpenedEvent(event); break; } case "columnPivotChanged": _warn(21); break; } }); } processGroupOpenedEvent(groupOpenedEvent) { const { colGroupSvc } = this.beans; if (!colGroupSvc) { return; } for (const masterGroup of groupOpenedEvent.columnGroups) { let otherColumnGroup = null; if (masterGroup) { otherColumnGroup = colGroupSvc.getProvidedColGroup(masterGroup.getGroupId()); } if (masterGroup && !otherColumnGroup) { continue; } colGroupSvc.setColumnGroupOpened(otherColumnGroup, masterGroup.isExpanded(), "alignedGridChanged"); } } processColumnEvent(colEvent) { const masterColumn = colEvent.column; let otherColumn = null; const beans = this.beans; const { colResize, ctrlsSvc, colModel } = beans; if (masterColumn) { otherColumn = colModel.getColDefCol(masterColumn.getColId()); } if (masterColumn && !otherColumn) { return; } const masterColumns = this.getMasterColumns(colEvent); switch (colEvent.type) { case "columnMoved": { const srcColState = colEvent.api.getColumnState(); const destColState = srcColState.map((s2) => ({ colId: s2.colId })); _applyColumnState(beans, { state: destColState, applyOrder: true }, "alignedGridChanged"); } break; case "columnVisible": { const srcColState = colEvent.api.getColumnState(); const destColState = srcColState.map((s2) => ({ colId: s2.colId, hide: s2.hide })); _applyColumnState(beans, { state: destColState }, "alignedGridChanged"); } break; case "columnPinned": { const srcColState = colEvent.api.getColumnState(); const destColState = srcColState.map((s2) => ({ colId: s2.colId, pinned: s2.pinned })); _applyColumnState(beans, { state: destColState }, "alignedGridChanged"); } break; case "columnResized": { const resizedEvent = colEvent; const columnWidths = {}; for (const column of masterColumns) { columnWidths[column.getId()] = { key: column.getColId(), newWidth: column.getActualWidth() }; } for (const col of resizedEvent.flexColumns ?? []) { if (columnWidths[col.getId()]) { delete columnWidths[col.getId()]; } } colResize?.setColumnWidths( Object.values(columnWidths), false, resizedEvent.finished, "alignedGridChanged" ); break; } } const gridBodyCon = ctrlsSvc.getGridBodyCtrl(); const isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing(); for (const api of this.getAlignedGridApis()) { api.setGridOption("alwaysShowVerticalScroll", isVerticalScrollShowing); } } }; var AlignedGridsModule = { moduleName: "AlignedGrids", version: VERSION, beans: [AlignedGridsService], dependsOn: [ColumnApiModule] }; function redrawRows(beans, params = {}) { const rowNodes = params ? params.rowNodes : void 0; beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.redrawRows(rowNodes)); } function setRowNodeExpanded(beans, rowNode, expanded, expandParents, forceSync) { if (rowNode) { if (expandParents && rowNode.parent && rowNode.parent.level !== -1) { setRowNodeExpanded(beans, rowNode.parent, expanded, expandParents, forceSync); } rowNode.setExpanded(expanded, void 0, forceSync); } } function getRowNode(beans, id) { return beans.rowModel.getRowNode(id); } function addRenderedRowListener(beans, eventName, rowIndex, callback) { beans.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback); } function getRenderedNodes(beans) { return beans.rowRenderer.getRenderedNodes(); } function forEachNode(beans, callback, includeFooterNodes) { beans.rowModel.forEachNode(callback, includeFooterNodes); } function getFirstDisplayedRowIndex(beans) { return beans.rowRenderer.firstRenderedRow; } function getLastDisplayedRowIndex(beans) { return beans.rowRenderer.lastRenderedRow; } function getDisplayedRowAtIndex(beans, index) { return beans.rowModel.getRow(index); } function getDisplayedRowCount(beans) { return beans.rowModel.getRowCount(); } function getVerticalPixelRange(beans) { return beans.ctrlsSvc.getScrollFeature().getVScrollPosition(); } function getHorizontalPixelRange(beans) { return beans.ctrlsSvc.getScrollFeature().getHScrollPosition(); } function ensureColumnVisible(beans, key, position = "auto") { beans.frameworkOverrides.wrapIncoming( () => beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(key, position), "ensureVisible" ); } function ensureIndexVisible(beans, index, position) { beans.frameworkOverrides.wrapIncoming( () => beans.ctrlsSvc.getScrollFeature().ensureIndexVisible(index, position), "ensureVisible" ); } function ensureNodeVisible(beans, nodeSelector, position = null) { beans.frameworkOverrides.wrapIncoming( () => beans.ctrlsSvc.getScrollFeature().ensureNodeVisible(nodeSelector, position), "ensureVisible" ); } var RowApiModule = { moduleName: "RowApi", version: VERSION, apiFunctions: { redrawRows, setRowNodeExpanded, getRowNode, addRenderedRowListener, getRenderedNodes, forEachNode, getFirstDisplayedRowIndex, getLastDisplayedRowIndex, getDisplayedRowAtIndex, getDisplayedRowCount } }; var ScrollApiModule = { moduleName: "ScrollApi", version: VERSION, apiFunctions: { getVerticalPixelRange, getHorizontalPixelRange, ensureColumnVisible, ensureIndexVisible, ensureNodeVisible } }; function expandAll(beans) { beans.expansionSvc?.expandAll(true); } function collapseAll(beans) { beans.expansionSvc?.expandAll(false); } function onRowHeightChanged(beans) { beans.rowModel?.onRowHeightChanged(); } function resetRowHeights(beans) { if (beans.rowAutoHeight?.active) { _warn(3); return; } beans.rowModel?.resetRowHeights(); } function resetRowGroupExpansion(beans) { beans.expansionSvc?.resetExpansion(); } function setRowCount(beans, rowCount, maxRowFound) { const serverSideRowModel = _getServerSideRowModel(beans); if (serverSideRowModel) { if (beans.rowGroupColsSvc?.columns.length === 0) { if (rowCount < 0) { _error(238); return; } serverSideRowModel.setRowCount(rowCount, maxRowFound); return; } _error(28); return; } _getInfiniteRowModel(beans)?.setRowCount(rowCount, maxRowFound); } function getCacheBlockState(beans) { if (_isServerSideRowModel(beans.gos)) { const ssrm = beans.rowModel; return ssrm.getBlockStates(); } return beans.rowNodeBlockLoader?.getBlockState() ?? {}; } function isLastRowIndexKnown(beans) { return beans.rowModel.isLastRowIndexKnown(); } var CsrmSsrmSharedApiModule = { moduleName: "CsrmSsrmSharedApi", version: VERSION, apiFunctions: { expandAll, collapseAll, resetRowGroupExpansion } }; var RowModelSharedApiModule = { moduleName: "RowModelSharedApi", version: VERSION, apiFunctions: { onRowHeightChanged, resetRowHeights } }; var SsrmInfiniteSharedApiModule = { moduleName: "SsrmInfiniteSharedApi", version: VERSION, apiFunctions: { setRowCount, getCacheBlockState, isLastRowIndexKnown } }; var forEachGroupDepthFirst = (children, callback) => { for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; const grandChildren = child.childrenAfterGroup; if (grandChildren !== null) { forEachGroupDepthFirst(grandChildren, callback); callback(child); } } }; var _forEachChangedGroupDepthFirst = (rootNode, hierarchical, changedPath, callback) => { if (changedPath != null) { const rows = changedPath.getSortedRows(); for (let i = 0, len = rows.length; i < len; ++i) { const row = rows[i]; if (row.childrenAfterGroup !== null && !row.destroyed) { callback(row); } } return; } if (rootNode == null) { return; } const children = rootNode.childrenAfterGroup; if (children === null) { return; } if (hierarchical) { forEachGroupDepthFirst(children, callback); } callback(rootNode); }; var ClientSideNodeManager = class extends BeanStub { constructor(rootNode) { super(); this.rootNode = rootNode; this.nextId = 0; this.allNodesMap = {}; initRootNode(rootNode); } getRowNode(id) { return this.allNodesMap[id]; } setNewRowData(rowData) { this.dispatchRowDataUpdateStarted(rowData); this.destroyAllNodes(); const rootNode = initRootNode(this.rootNode); const allLeafs = new Array(rowData.length); rootNode._leafs = allLeafs; let writeIdx = 0; const nestedDataGetter = this.beans.groupStage?.getNestedDataGetter(); const processedNested = nestedDataGetter ? /* @__PURE__ */ new Set() : null; const processChildren = (parent, childrenData) => { const level = parent.level + 1; for (let i = 0, len = childrenData.length; i < len; ++i) { const data = childrenData[i]; if (!data) { continue; } const node = this.createRowNode(data, level, writeIdx); allLeafs[writeIdx++] = node; if (processedNested && !processedNested.has(data)) { processedNested.add(data); node.treeParent = parent; const children = nestedDataGetter(data); if (children) { processChildren(node, children); } } } }; processChildren(rootNode, rowData); allLeafs.length = writeIdx; } destroyAllNodes() { const { selectionSvc, pinnedRowModel, groupStage } = this.beans; selectionSvc?.reset("rowDataChanged"); if (pinnedRowModel?.isManual()) { pinnedRowModel.reset(); } groupStage?.clearNonLeafs(); const existingLeafs = this.rootNode._leafs; if (existingLeafs) { for (let i = 0, len = existingLeafs.length; i < len; ++i) { existingLeafs[i]._destroy(false); } } this.allNodesMap = /* @__PURE__ */ Object.create(null); this.nextId = 0; } setImmutableRowData(params, rowData) { const { rootNode, gos } = this; this.dispatchRowDataUpdateStarted(rowData); const getRowIdFunc = _getRowIdCallback(gos); const changedRowNodes = params.changedRowNodes; const { adds, updates } = changedRowNodes; const processedNodes = /* @__PURE__ */ new Set(); const nodesToUnselect = []; const nestedDataGetter = this.beans.groupStage?.getNestedDataGetter(); let reorder = gos.get("suppressMaintainUnsortedOrder") ? void 0 : false; let prevIndex = -1; let treeUpdated = false; const updateNode = (node, data) => { if (!reorder && reorder !== void 0) { const oldIndex = node.sourceRowIndex; reorder = oldIndex <= prevIndex; prevIndex = oldIndex; } if (node.data !== data) { node.updateData(data); if (!adds.has(node)) { updates.add(node); } if (!node.selectable && node.isSelected()) { nodesToUnselect.push(node); } } }; const processChildren = (parent, childrenData, level) => { for (let i = 0, len = childrenData.length; i < len; ++i) { const data = childrenData[i]; if (!data) { continue; } let node = this.getRowNode(getRowIdFunc({ data, level })); if (node) { updateNode(node, data); treeUpdated || (treeUpdated = !!nestedDataGetter && node.treeParent !== parent); } else { node = this.createRowNode(data, level); adds.add(node); } if (!nestedDataGetter || processedNodes.has(node)) { processedNodes.add(node); continue; } processedNodes.add(node); node.treeParent = parent; const children = nestedDataGetter(data); if (children) { processChildren(node, children, level + 1); } } }; processChildren(rootNode, rowData, 0); const changed = this.deleteUnusedNodes(processedNodes, changedRowNodes, nodesToUnselect, !!params.animate) || reorder || adds.size > 0; if (changed) { const allLeafs = rootNode._leafs ?? (rootNode._leafs = []); if (reorder === void 0) { updateRootLeafsKeepOrder(allLeafs, processedNodes, changedRowNodes); } else if (updateRootLeafsOrdered(allLeafs, processedNodes)) { changedRowNodes.reordered = true; } } if (changed || treeUpdated || updates.size) { params.rowDataUpdated = true; this.deselect(nodesToUnselect); } } deleteUnusedNodes(processedNodes, { removals }, nodesToUnselect, animate) { const allLeafs = this.rootNode._leafs; for (let i = 0, len = allLeafs.length; i < len; i++) { const node = allLeafs[i]; if (!processedNodes.has(node)) { if (this.destroyNode(node, animate)) { removals.push(node); if (node.isSelected()) { nodesToUnselect.push(node); } } } } return removals.length > 0; } updateRowData(rowDataTran, changedRowNodes, animate) { this.dispatchRowDataUpdateStarted(rowDataTran.add); if (this.beans.groupStage?.getNestedDataGetter()) { _warn(268); return { remove: [], update: [], add: [] }; } const nodesToUnselect = []; const getRowIdFunc = _getRowIdCallback(this.gos); const remove = this.executeRemove(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect, animate); const update = this.executeUpdate(getRowIdFunc, rowDataTran, changedRowNodes, nodesToUnselect); const add = this.executeAdd(rowDataTran, changedRowNodes); this.deselect(nodesToUnselect); return { remove, update, add }; } executeRemove(getRowIdFunc, { remove }, { adds, updates, removals }, nodesToUnselect, animate) { const allLeafs = this.rootNode._leafs; const allLeafsLen = allLeafs?.length; const removeLen = remove?.length; if (!removeLen || !allLeafsLen) { return []; } let removeCount = 0; let filterIdx = allLeafsLen; let filterEndIdx = 0; const removedResult = new Array(removeLen); for (let i = 0; i < removeLen; ++i) { const rowNode = this.lookupNode(getRowIdFunc, remove[i]); if (!rowNode) { continue; } const sourceRowIndex = rowNode.sourceRowIndex; if (sourceRowIndex < filterIdx) { filterIdx = sourceRowIndex; } if (sourceRowIndex > filterEndIdx) { filterEndIdx = sourceRowIndex; } removedResult[removeCount++] = rowNode; if (!this.destroyNode(rowNode, animate)) { continue; } if (rowNode.isSelected()) { nodesToUnselect.push(rowNode); } if (!adds.delete(rowNode)) { updates.delete(rowNode); removals.push(rowNode); } } removedResult.length = removeCount; if (removeCount) { filterRemovedRowNodes(allLeafs, filterIdx, filterEndIdx); } return removedResult; } executeUpdate(getRowIdFunc, { update }, { adds, updates }, nodesToUnselect) { const updateLen = update?.length; if (!updateLen) { return []; } const updateResult = new Array(updateLen); let writeIdx = 0; for (let i = 0; i < updateLen; i++) { const item = update[i]; const rowNode = this.lookupNode(getRowIdFunc, item); if (rowNode) { rowNode.updateData(item); if (!rowNode.selectable && rowNode.isSelected()) { nodesToUnselect.push(rowNode); } updateResult[writeIdx++] = rowNode; if (!adds.has(rowNode)) { updates.add(rowNode); } } } updateResult.length = writeIdx; return updateResult; } executeAdd(rowDataTran, changedRowNodes) { var _a; const allLeafs = (_a = this.rootNode)._leafs ?? (_a._leafs = []); const allLeafsLen = allLeafs.length; const add = rowDataTran.add; const addLength = add?.length; if (!addLength) { return []; } const newLen = allLeafsLen + addLength; let addIndex = this.sanitizeAddIndex(allLeafs, rowDataTran.addIndex); if (addIndex < allLeafsLen) { for (let readIdx = allLeafsLen - 1, writeIdx = newLen - 1; readIdx >= addIndex; --readIdx) { const node = allLeafs[readIdx]; node.sourceRowIndex = writeIdx; allLeafs[writeIdx--] = node; } changedRowNodes.reordered = true; } allLeafs.length = newLen; const addedNodes = new Array(addLength); const adds = changedRowNodes.adds; for (let i = 0; i < addLength; i++) { const node = this.createRowNode(add[i], 0, addIndex); adds.add(node); allLeafs[addIndex] = node; addedNodes[i] = node; addIndex++; } return addedNodes; } dispatchRowDataUpdateStarted(data) { this.eventSvc.dispatchEvent({ type: "rowDataUpdateStarted", firstRowData: data?.length ? data[0] : null }); } deselect(nodes) { const source = "rowDataChanged"; const selectionSvc = this.beans.selectionSvc; if (nodes.length) { selectionSvc?.setNodesSelected({ newValue: false, nodes, suppressFinishActions: true, source }); } selectionSvc?.updateGroupsFromChildrenSelections?.(source); if (nodes.length) { this.eventSvc.dispatchEvent({ type: "selectionChanged", source, selectedNodes: selectionSvc?.getSelectedNodes() ?? null, serverSideState: null }); } } createRowNode(data, level, sourceRowIndex) { const node = new RowNode(this.beans); node.parent = this.rootNode; node.level = level; node.group = false; if (sourceRowIndex != null) { node.sourceRowIndex = sourceRowIndex; } node.setDataAndId(data, String(this.nextId++)); const id = node.id; const allNodesMap = this.allNodesMap; if (allNodesMap[id]) { _warn(2, { nodeId: id }); } allNodesMap[id] = node; return node; } /** Called when a node needs to be deleted */ destroyNode(node, animate) { if (!node._destroy(animate)) { return false; } const id = node.id; const allNodesMap = this.allNodesMap; if (allNodesMap[id] === node) { delete allNodesMap[id]; } return true; } lookupNode(getRowIdFunc, data) { if (!getRowIdFunc) { return lookupNodeByData(this.rootNode._leafs, data); } const id = getRowIdFunc({ data, level: 0 }); const rowNode = this.allNodesMap[id]; if (!rowNode) { _error(4, { id }); return null; } return rowNode; } sanitizeAddIndex(allLeafs, addIndex) { const allLeafsLen = allLeafs.length; if (typeof addIndex !== "number") { return allLeafsLen; } if (addIndex < 0 || addIndex >= allLeafsLen || Number.isNaN(addIndex)) { return allLeafsLen; } addIndex = Math.ceil(addIndex); const gos = this.gos; if (addIndex > 0 && gos.get("treeData") && gos.get("getDataPath")) { addIndex = adjustAddIndexForDataPath(allLeafs, addIndex); } return addIndex; } }; var adjustAddIndexForDataPath = (allLeafs, addIndex) => { for (let i = 0, len = allLeafs.length; i < len; i++) { const node = allLeafs[i]; if (node?.rowIndex == addIndex - 1) { return i + 1; } } return addIndex; }; var initRootNode = (rootNode) => { rootNode.group = true; rootNode.level = -1; rootNode._expanded = true; rootNode.id = "ROOT_NODE_ID"; if (rootNode._leafs?.length !== 0) { rootNode._leafs = []; } const childrenAfterGroup = []; const childrenAfterSort = []; const childrenAfterAggFilter = []; const childrenAfterFilter = []; rootNode.childrenAfterGroup = childrenAfterGroup; rootNode.childrenAfterSort = childrenAfterSort; rootNode.childrenAfterAggFilter = childrenAfterAggFilter; rootNode.childrenAfterFilter = childrenAfterFilter; const sibling = rootNode.sibling; if (sibling) { sibling.childrenAfterGroup = childrenAfterGroup; sibling.childrenAfterSort = childrenAfterSort; sibling.childrenAfterAggFilter = childrenAfterAggFilter; sibling.childrenAfterFilter = childrenAfterFilter; sibling.childrenMapped = rootNode.childrenMapped; } rootNode.updateHasChildren(); return rootNode; }; var lookupNodeByData = (nodes, data) => { if (nodes) { for (let i = 0, len = nodes.length; i < len; i++) { const node = nodes[i]; if (node.data === data) { return node; } } } _error(5, { data }); return null; }; var filterRemovedRowNodes = (allLeafs, filterIdx, filterEndIdx) => { filterIdx = Math.max(0, filterIdx); for (let readIdx = filterIdx, len = allLeafs.length; readIdx < len; ++readIdx) { const node = allLeafs[readIdx]; if (readIdx <= filterEndIdx && node.destroyed) { continue; } node.sourceRowIndex = filterIdx; allLeafs[filterIdx++] = node; } allLeafs.length = filterIdx; }; var updateRootLeafsOrdered = (allLeafs, processedNodes) => { const newSize = processedNodes.size; allLeafs.length = newSize; let writeIdx = 0; let added = false; let reordered = false; for (const node of processedNodes) { const sourceRowIndex = node.sourceRowIndex; if (sourceRowIndex === writeIdx) { reordered || (reordered = added); } else { if (sourceRowIndex >= 0) { reordered = true; } else { added = true; } node.sourceRowIndex = writeIdx; allLeafs[writeIdx] = node; } ++writeIdx; } return reordered; }; var updateRootLeafsKeepOrder = (allLeafs, processedNodes, { adds }) => { const allLeafsLen = allLeafs.length; const newAllLeafsLen = processedNodes.size; if (newAllLeafsLen > allLeafsLen) { allLeafs.length = newAllLeafsLen; } let writeIdx = 0; for (let readIdx = 0; readIdx < allLeafsLen; ++readIdx) { const node = allLeafs[readIdx]; if (!node.destroyed) { if (writeIdx !== readIdx) { node.sourceRowIndex = writeIdx; allLeafs[writeIdx] = node; } ++writeIdx; } } for (const node of adds) { if (node.sourceRowIndex < 0) { node.sourceRowIndex = writeIdx; allLeafs[writeIdx++] = node; } } allLeafs.length = writeIdx; }; function updateRowNodeAfterFilter(rowNode) { const sibling = rowNode.sibling; if (sibling) { sibling.childrenAfterFilter = rowNode.childrenAfterFilter; } } var FilterStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterStage"; this.step = "filter"; this.refreshProps = ["excludeChildrenWhenTreeDataFiltering"]; } wireBeans(beans) { this.filterManager = beans.filterManager; } execute(changedPath) { const filterActive = !!this.filterManager?.isChildFilterPresent(); if (this.beans.formula?.active) { this.softFilter(filterActive, changedPath); } else { this.filterNodes(filterActive, changedPath); } } filterNodes(filterActive, changedPath) { const filterCallback = (rowNode, includeChildNodes) => { if (rowNode.hasChildren()) { if (filterActive && !includeChildNodes) { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter((childNode) => { const passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0; const passBecauseDataPasses = childNode.data && this.filterManager.doesRowPassFilter({ rowNode: childNode }); return passBecauseChildren || passBecauseDataPasses; }); } else { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; } } else { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; } updateRowNodeAfterFilter(rowNode); }; if (this.doingTreeDataFiltering()) { const treeDataDepthFirstFilter = (rowNode, alreadyFoundInParent) => { if (rowNode.childrenAfterGroup) { for (let i = 0; i < rowNode.childrenAfterGroup.length; i++) { const childNode = rowNode.childrenAfterGroup[i]; const foundInParent = alreadyFoundInParent || this.filterManager.doesRowPassFilter({ rowNode: childNode }); if (childNode.childrenAfterGroup) { treeDataDepthFirstFilter(rowNode.childrenAfterGroup[i], foundInParent); } else { filterCallback(childNode, foundInParent); } } } filterCallback(rowNode, alreadyFoundInParent); }; treeDataDepthFirstFilter(this.beans.rowModel.rootNode, false); } else { const defaultFilterCallback = (rowNode) => filterCallback(rowNode, false); _forEachChangedGroupDepthFirst( this.beans.rowModel.rootNode, this.beans.rowModel.hierarchical, changedPath, defaultFilterCallback ); } } softFilter(filterActive, changedPath) { const filterCallback = (rowNode) => { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; if (rowNode.hasChildren()) { for (const childNode of rowNode.childrenAfterGroup) { childNode.softFiltered = filterActive && !(childNode.data && this.filterManager.doesRowPassFilter({ rowNode: childNode })); } } updateRowNodeAfterFilter(rowNode); }; const rowModel = this.beans.rowModel; _forEachChangedGroupDepthFirst(rowModel.rootNode, rowModel.hierarchical, changedPath, filterCallback); } doingTreeDataFiltering() { const { gos } = this; return !!this.beans.groupStage?.treeData && !gos.get("excludeChildrenWhenTreeDataFiltering"); } }; var MIN_DELTA_SORT_ROWS = 4; var doDeltaSort = (rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions) => { const oldSortedRows = rowNode.childrenAfterSort; const unsortedRows = rowNode.childrenAfterAggFilter; if (!unsortedRows) { return oldSortedRows && oldSortedRows.length > 0 ? oldSortedRows : []; } const unsortedRowsLen = unsortedRows.length; if (unsortedRowsLen <= 1) { if (oldSortedRows?.length === unsortedRowsLen && (unsortedRowsLen === 0 || oldSortedRows[0] === unsortedRows[0])) { return oldSortedRows; } return unsortedRows.slice(); } if (!oldSortedRows || unsortedRowsLen <= MIN_DELTA_SORT_ROWS) { return rowNodeSorter.doFullSortInPlace(unsortedRows.slice(), sortOptions); } const indexByNode = /* @__PURE__ */ new Map(); const { updates, adds } = changedRowNodes; const touchedRows = []; for (let i = 0; i < unsortedRowsLen; ++i) { const node = unsortedRows[i]; if (updates.has(node) || adds.has(node) || changedPath?.hasRow(node)) { indexByNode.set(node, ~i); touchedRows.push(node); } else { indexByNode.set(node, i); } } const touchedRowsLen = touchedRows.length; if (touchedRowsLen === 0) { return unsortedRowsLen === oldSortedRows.length ? oldSortedRows : filterRemovedNodes(oldSortedRows, indexByNode, touchedRows); } touchedRows.sort( (a, b) => rowNodeSorter.compareRowNodes(sortOptions, a, b) || ~indexByNode.get(a) - ~indexByNode.get(b) ); if (touchedRowsLen === unsortedRowsLen) { return touchedRows; } return mergeDeltaSortedArrays(rowNodeSorter, sortOptions, touchedRows, oldSortedRows, indexByNode, unsortedRowsLen); }; var mergeDeltaSortedArrays = (rowNodeSorter, sortOptions, touchedRows, oldSortedRows, indexByNode, resultSize) => { const result = new Array(resultSize); let touchedIdx = 0; let touchedNode = touchedRows[touchedIdx]; let untouchedNode; let untouchedIdx = -1; let oldIdx = 0; let resultIdx = 0; const touchedLength = touchedRows.length; const oldSortedLength = oldSortedRows.length; while (true) { if (untouchedIdx < 0) { if (oldIdx >= oldSortedLength) { break; } untouchedNode = oldSortedRows[oldIdx++]; untouchedIdx = indexByNode.get(untouchedNode) ?? -1; if (untouchedIdx < 0) { continue; } } const orderDelta = rowNodeSorter.compareRowNodes(sortOptions, touchedNode, untouchedNode) || ~indexByNode.get(touchedNode) - untouchedIdx; if (orderDelta < 0) { result[resultIdx++] = touchedNode; if (++touchedIdx >= touchedLength) { break; } touchedNode = touchedRows[touchedIdx]; } else { result[resultIdx++] = untouchedNode; untouchedIdx = -1; } } while (touchedIdx < touchedLength) { result[resultIdx++] = touchedRows[touchedIdx++]; } if (untouchedIdx < 0) { return result; } result[resultIdx++] = untouchedNode; while (oldIdx < oldSortedLength) { const node = oldSortedRows[oldIdx++]; if (indexByNode.get(node) >= 0) { result[resultIdx++] = node; } } return result; }; var filterRemovedNodes = (rows, map, result) => { let count = 0; result.length = map.size; for (let i = 0, len = rows.length; i < len; ++i) { const node = rows[i]; if (map.has(node)) { result[count++] = node; } } result.length = count; return result; }; var updateRowNodeAfterSort = (rowNode) => { const childrenAfterSort = rowNode.childrenAfterSort; const sibling = rowNode.sibling; if (sibling) { sibling.childrenAfterSort = childrenAfterSort; } if (!childrenAfterSort) { return; } for (let i = 0, lastIdx = childrenAfterSort.length - 1; i <= lastIdx; i++) { const child = childrenAfterSort[i]; const first = i === 0; const last = i === lastIdx; if (child.firstChild !== first) { child.firstChild = first; child.dispatchRowEvent("firstChildChanged"); } if (child.lastChild !== last) { child.lastChild = last; child.dispatchRowEvent("lastChildChanged"); } if (child.childIndex !== i) { child.childIndex = i; child.dispatchRowEvent("childIndexChanged"); } } }; var SortStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "sortStage"; this.step = "sort"; this.refreshProps = ["postSortRows", "groupDisplayType", "accentedSort"]; } execute(changedPath, changedRowNodes) { const sortOptions = this.beans.sortSvc.getSortOptions(); const useDeltaSort = sortOptions.length > 0 && !!changedRowNodes && // in time we can remove this check, so that delta sort is always // on if transactions are present. it's off for now so that we can // selectively turn it on and test it with some select users before // rolling out to everyone. this.gos.get("deltaSort"); const { gos, colModel, rowGroupColsSvc, rowNodeSorter, rowRenderer, showRowGroupCols } = this.beans; const groupMaintainOrder = gos.get("groupMaintainOrder"); const groupColumnsPresent = colModel.getCols().some((c) => c.isRowGroupActive()); const groupCols = rowGroupColsSvc?.columns; const isPivotMode2 = colModel.isPivotMode(); const postSortFunc = gos.getCallback("postSortRows"); let hasAnyFirstChildChanged = false; let sortContainsGroupColumns; const callback = (rowNode) => { const skipSortingPivotLeafs = isPivotMode2 && rowNode.leafGroup; let skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup; if (skipSortingGroups) { sortContainsGroupColumns ?? (sortContainsGroupColumns = this.shouldSortContainsGroupCols(sortOptions)); skipSortingGroups && (skipSortingGroups = !sortContainsGroupColumns); } let newChildrenAfterSort = null; if (skipSortingGroups) { let wasSortExplicitlyRemoved = false; if (groupCols) { const nextGroupIndex = rowNode.level + 1; if (nextGroupIndex < groupCols.length) { wasSortExplicitlyRemoved = groupCols[nextGroupIndex].wasSortExplicitlyRemoved; } } if (!wasSortExplicitlyRemoved) { newChildrenAfterSort = preserveGroupOrder(rowNode); } } else if (!sortOptions.length || skipSortingPivotLeafs) { } else if (useDeltaSort && changedRowNodes) { newChildrenAfterSort = doDeltaSort(rowNodeSorter, rowNode, changedRowNodes, changedPath, sortOptions); } else { newChildrenAfterSort = rowNodeSorter.doFullSortInPlace( rowNode.childrenAfterAggFilter.slice(), sortOptions ); } newChildrenAfterSort || (newChildrenAfterSort = rowNode.childrenAfterAggFilter?.slice() ?? []); hasAnyFirstChildChanged || (hasAnyFirstChildChanged = rowNode.childrenAfterSort?.[0] !== newChildrenAfterSort[0]); rowNode.childrenAfterSort = newChildrenAfterSort; updateRowNodeAfterSort(rowNode); if (postSortFunc) { const params = { nodes: rowNode.childrenAfterSort }; postSortFunc(params); } }; _forEachChangedGroupDepthFirst( this.beans.rowModel.rootNode, this.beans.rowModel.hierarchical, changedPath, callback ); if (hasAnyFirstChildChanged && gos.get("groupHideOpenParents")) { const columns = showRowGroupCols?.columns; if (columns?.length) { rowRenderer.refreshCells({ columns, force: true }); } } } shouldSortContainsGroupCols(sortOptions) { const sortOptionsLen = sortOptions.length; if (!sortOptionsLen) { return false; } if (_isColumnsSortingCoupledToGroup(this.gos)) { for (let i = 0; i < sortOptionsLen; ++i) { const column = sortOptions[i].column; if (column.isPrimary() && column.isRowGroupActive()) { return true; } } return false; } for (let i = 0; i < sortOptionsLen; ++i) { if (sortOptions[i].column.getColDef().showRowGroup) { return true; } } return false; } }; var preserveGroupOrder = (node) => { const childrenAfterSort = node.childrenAfterSort; const childrenAfterAggFilter = node.childrenAfterAggFilter; const childrenAfterSortLen = childrenAfterSort?.length; const childrenAfterAggFilterLen = childrenAfterAggFilter?.length; if (!childrenAfterSortLen || !childrenAfterAggFilterLen) { return null; } const result = new Array(childrenAfterAggFilterLen); const processed = /* @__PURE__ */ new Set(); for (let i = 0; i < childrenAfterAggFilterLen; ++i) { processed.add(childrenAfterAggFilter[i]); } let writeIdx = 0; for (let i = 0; i < childrenAfterSortLen; ++i) { const node2 = childrenAfterSort[i]; if (processed.delete(node2)) { result[writeIdx++] = node2; } } if (processed.size === 0 && writeIdx === childrenAfterSortLen) { return childrenAfterSort; } for (const newNode of processed) { result[writeIdx++] = newNode; } result.length = writeIdx; return result; }; var ClientSideRowModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowModel"; this.rootNode = null; this.rowCountReady = false; this.hierarchical = false; this.nodeManager = void 0; this.rowsToDisplay = []; this.formulaRows = []; this.stages = null; this.asyncTransactions = null; this.asyncTransactionsTimer = 0; this.started = false; this.refreshingData = false; this.rowDataUpdatedPending = false; this.refreshingModel = false; this.pendingNewData = false; this.noKeepRenderedRows = false; this.noKeepUndoRedoStack = false; this.noAnimate = false; this.rowNodesCountReady = false; this.stagesRefreshProps = /* @__PURE__ */ new Map(); this.onRowHeightChanged_debounced = _debounce(this, this.onRowHeightChanged.bind(this), 100); } postConstruct() { const beans = this.beans; const rootNode = new RowNode(beans); this.rootNode = rootNode; this.nodeManager = this.createBean(new ClientSideNodeManager(rootNode)); const onColumnsChanged = () => { this.beans.groupStage?.invalidateGroupCols(); this.refreshModel({ step: "group", afterColumnsChanged: true, keepRenderedRows: true, animate: !this.gos.get("suppressAnimationFrame") }); }; this.addManagedEventListeners({ newColumnsLoaded: onColumnsChanged, columnRowGroupChanged: onColumnsChanged, columnValueChanged: this.onValueChanged.bind(this), columnPivotChanged: () => this.refreshModel({ step: "pivot" }), columnPivotModeChanged: () => this.refreshModel({ step: "group" }), filterChanged: this.onFilterChanged.bind(this), sortChanged: this.onSortChanged.bind(this), stylesChanged: this.onGridStylesChanges.bind(this), gridReady: this.onGridReady.bind(this), rowExpansionStateChanged: this.onRowGroupOpened.bind(this) }); this.addPropertyListeners(); } addPropertyListeners() { const { beans, stagesRefreshProps } = this; const orderedStages = [ beans.groupStage, beans.filterStage, beans.pivotStage, beans.aggStage, beans.sortStage, beans.filterAggStage, beans.flattenStage ].filter((stage) => !!stage); this.stages = orderedStages; for (let i = orderedStages.length - 1; i >= 0; --i) { const stage = orderedStages[i]; for (const prop of stage.refreshProps) { stagesRefreshProps.set(prop, i); } } this.addManagedPropertyListeners([...stagesRefreshProps.keys(), "rowData"], (params) => { const properties = params.changeSet?.properties; if (properties) { this.onPropChange(properties); } }); this.addManagedPropertyListener("rowHeight", () => this.resetRowHeights()); } start() { this.started = true; if (this.rowNodesCountReady) { this.refreshModel({ step: "group", rowDataUpdated: true, newData: true }); } else { this.setInitialData(); } } setInitialData() { const rowData = this.gos.get("rowData"); if (rowData) { this.onPropChange(["rowData"]); } } ensureRowHeightsValid(startPixel, endPixel, startLimitIndex, endLimitIndex) { let atLeastOneChange; let res = false; do { atLeastOneChange = false; const rowAtStartPixel = this.getRowIndexAtPixel(startPixel); const rowAtEndPixel = this.getRowIndexAtPixel(endPixel); const firstRow = Math.max(rowAtStartPixel, startLimitIndex); const lastRow = Math.min(rowAtEndPixel, endLimitIndex); for (let rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) { const rowNode = this.getRow(rowIndex); if (rowNode.rowHeightEstimated) { const rowHeight = _getRowHeightForNode(this.beans, rowNode); rowNode.setRowHeight(rowHeight.height); atLeastOneChange = true; res = true; } } if (atLeastOneChange) { this.setRowTopAndRowIndex(); } } while (atLeastOneChange); return res; } onPropChange(properties) { const { nodeManager, gos, beans } = this; const groupStage = beans.groupStage; if (!nodeManager) { return; } const changedProps = new Set(properties); const extractData = groupStage?.onPropChange(changedProps); let newRowData; if (changedProps.has("rowData")) { newRowData = gos.get("rowData"); } else if (extractData) { newRowData = groupStage?.extractData(); } if (newRowData && !Array.isArray(newRowData)) { newRowData = null; _warn(1); } const params = { step: "nothing", changedProps }; if (newRowData) { const immutable = !extractData && !this.isEmpty() && newRowData.length > 0 && gos.exists("getRowId") && // backward compatibility - for who want old behaviour of Row IDs but NOT Immutable Data. !gos.get("resetRowDataOnUpdate"); this.refreshingData = true; if (immutable) { params.keepRenderedRows = true; params.animate = !gos.get("suppressAnimationFrame"); params.changedRowNodes = new ChangedRowNodes(); nodeManager.setImmutableRowData(params, newRowData); } else { params.rowDataUpdated = true; params.newData = true; nodeManager.setNewRowData(newRowData); this.rowNodesCountReady = true; } } const step = params.rowDataUpdated ? "group" : this.getRefreshedStage(properties); if (step) { params.step = step; this.refreshModel(params); } } getRefreshedStage(properties) { const { stages, stagesRefreshProps } = this; if (!stages) { return null; } const stagesLen = stages.length; let minIndex = stagesLen; for (let i = 0, len = properties.length; i < len && minIndex; ++i) { minIndex = Math.min(minIndex, stagesRefreshProps.get(properties[i]) ?? minIndex); } return minIndex < stagesLen ? stages[minIndex].step : null; } setRowTopAndRowIndex(outputDisplayedRowsMapped) { const { beans, rowsToDisplay } = this; const defaultRowHeight = beans.environment.getDefaultRowHeight(); let nextRowTop = 0; const allowEstimate = _isDomLayout(this.gos, "normal"); for (let i = 0, len = rowsToDisplay.length; i < len; ++i) { const rowNode = rowsToDisplay[i]; const id = rowNode.id; if (id != null) { outputDisplayedRowsMapped?.add(id); } if (rowNode.rowHeight == null) { const rowHeight = _getRowHeightForNode(beans, rowNode, allowEstimate, defaultRowHeight); rowNode.setRowHeight(rowHeight.height, rowHeight.estimated); } rowNode.setRowTop(nextRowTop); rowNode.setRowIndex(i); nextRowTop += rowNode.rowHeight; } if (this.beans.formula?.active) { const formulaRows = this.formulaRows; for (let i = 0, len = formulaRows.length; i < len; ++i) { const rowNode = formulaRows[i]; rowNode.formulaRowIndex = i; } } } clearRowTopAndRowIndex(changedPath, displayedRowsMapped) { const clearIfNotDisplayed = (rowNode) => { if (rowNode?.id != null && !displayedRowsMapped.has(rowNode.id)) { rowNode.clearRowTopAndRowIndex(); } }; const recurse = (rowNode) => { clearIfNotDisplayed(rowNode); clearIfNotDisplayed(rowNode.detailNode); clearIfNotDisplayed(rowNode.sibling); const childrenAfterGroup = rowNode.childrenAfterGroup; if (!rowNode.hasChildren() || !childrenAfterGroup) { return; } if (changedPath && rowNode.level !== -1 && !rowNode.expanded) { return; } for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) { recurse(childrenAfterGroup[i]); } }; const rootNode = this.rootNode; if (rootNode) { recurse(rootNode); } } isLastRowIndexKnown() { return true; } getRowCount() { return this.rowsToDisplay.length; } /** * Returns the number of rows with level === 1 */ getTopLevelRowCount() { const { rootNode, rowsToDisplay } = this; if (!rootNode || !rowsToDisplay.length) { return 0; } const showingRootNode = rowsToDisplay[0] === rootNode; if (showingRootNode) { return 1; } const totalFooterInc = rootNode.sibling?.displayed ? 1 : 0; return (rootNode.childrenAfterSort?.length ?? 0) + totalFooterInc; } /** * Get the row display index by the top level index * top level index is the index of rows with level === 1 */ getTopLevelRowDisplayedIndex(topLevelIndex) { const { beans, rootNode, rowsToDisplay } = this; const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode; if (showingRootNode) { return topLevelIndex; } const childrenAfterSort = rootNode.childrenAfterSort; const getDefaultIndex = (adjustedIndex) => { let rowNode = childrenAfterSort[adjustedIndex]; if (this.gos.get("groupHideOpenParents")) { while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) { rowNode = rowNode.childrenAfterSort[0]; } } return rowNode.rowIndex; }; const footerSvc = beans.footerSvc; if (footerSvc) { return footerSvc?.getTopDisplayIndex(rowsToDisplay, topLevelIndex, childrenAfterSort, getDefaultIndex); } return getDefaultIndex(topLevelIndex); } /** * The opposite of `getTopLevelRowDisplayedIndex` */ getTopLevelIndexFromDisplayedIndex(displayedIndex) { const { rootNode, rowsToDisplay } = this; const showingRootNode = !rootNode || !rowsToDisplay.length || rowsToDisplay[0] === rootNode; if (showingRootNode) { return displayedIndex; } let node = this.getRow(displayedIndex); if (node.footer) { node = node.sibling; } let parent = node.parent; while (parent && parent !== rootNode) { node = parent; parent = node.parent; } const topLevelIndex = rootNode.childrenAfterSort?.indexOf(node) ?? -1; return topLevelIndex >= 0 ? topLevelIndex : displayedIndex; } getRowBounds(index) { const rowNode = this.rowsToDisplay[index]; return rowNode ? { rowTop: rowNode.rowTop, rowHeight: rowNode.rowHeight } : null; } onRowGroupOpened() { this.refreshModel({ step: "map", keepRenderedRows: true, animate: _isAnimateRows(this.gos) }); } onFilterChanged({ afterDataChange, columns }) { if (!afterDataChange) { const primaryOrQuickFilterChanged = columns.length === 0 || columns.some((col) => col.isPrimary()); const step = primaryOrQuickFilterChanged ? "filter" : "filter_aggregates"; this.refreshModel({ step, keepRenderedRows: true, animate: _isAnimateRows(this.gos) }); } } onSortChanged() { this.refreshModel({ step: "sort", keepRenderedRows: true, animate: _isAnimateRows(this.gos) }); } getType() { return "clientSide"; } onValueChanged() { this.refreshModel({ step: this.beans.colModel.isPivotActive() ? "pivot" : "aggregate" }); } isSuppressModelUpdateAfterUpdateTransaction(params) { if (!this.gos.get("suppressModelUpdateAfterUpdateTransaction")) { return false; } const { changedRowNodes, newData, rowDataUpdated } = params; if (!changedRowNodes || newData || !rowDataUpdated) { return false; } if (changedRowNodes.removals.length || changedRowNodes.adds.size) { return false; } return true; } /** * Performs a map-only refresh. Safe to call during an active refresh. * If a refresh is in progress, flags are captured and applied to the outer refresh. * Flag accumulation is intentional - they persist until the next successful refreshModel(). */ reMapRows() { if (this.refreshingModel || this.refreshingData) { this.noKeepRenderedRows = true; this.noKeepUndoRedoStack = true; this.noAnimate = true; return; } this.refreshModel({ step: "map", keepRenderedRows: false, keepUndoRedoStack: false, animate: false }); } refreshModel(params) { const { nodeManager, eventSvc, started } = this; if (!nodeManager) { return; } const rowDataUpdated = !!params.rowDataUpdated; if (started && rowDataUpdated) { eventSvc.dispatchEvent({ type: "rowDataUpdated" }); } if (this.deferRefresh(params)) { this.setPendingRefreshFlags(params); this.rowDataUpdatedPending || (this.rowDataUpdatedPending = rowDataUpdated); return; } if (this.rowDataUpdatedPending) { this.rowDataUpdatedPending = false; params.step = "group"; } this.updateRefreshParams(params); let succeeded = false; this.refreshingModel = true; try { this.executeRefresh(params, rowDataUpdated); succeeded = true; } finally { this.refreshingData = false; this.refreshingModel = false; if (!succeeded) { this.setPendingRefreshFlags(params); } } this.clearPendingRefreshFlags(); eventSvc.dispatchEvent({ type: "modelUpdated", animate: params.animate, keepRenderedRows: params.keepRenderedRows, newData: params.newData, newPage: false, keepUndoRedoStack: params.keepUndoRedoStack }); } /** Executes the refresh pipeline stages and updates row positions. */ executeRefresh(params, rowDataUpdated) { const { beans, rootNode } = this; beans.masterDetailSvc?.refreshModel(params); if (rowDataUpdated && params.step !== "group") { beans.colFilter?.refreshModel(); } let changedPath = params.changedPath; changedPath?.addRow(rootNode); if (params.step === "group") { this.doGrouping(rootNode, params); changedPath ?? (changedPath = params.changedPath); } changedPath ?? (changedPath = beans.changedPathFactory?.ensureRowsPath(params, rootNode)); switch (params.step) { case "group": case "filter": this.doFilter(changedPath); case "pivot": if (this.doPivot(changedPath)) { changedPath = void 0; params.changedPath = void 0; } case "aggregate": this.doAggregate(changedPath); case "filter_aggregates": this.doFilterAggregates(changedPath); case "sort": this.doSort(changedPath, params.changedRowNodes); case "map": this.doRowsToDisplay(); } const displayedNodesMapped = /* @__PURE__ */ new Set(); this.setRowTopAndRowIndex(displayedNodesMapped); this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped); this.updateRefreshParams(params); } /** Checks if the refresh should be deferred. Caller must call setPendingRefreshFlags when this returns true. */ deferRefresh(params) { if (this.refreshingModel) { return true; } if (this.beans.colModel.changeEventsDispatching) { return true; } if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) { if (this.started) { this.refreshingData = false; } return true; } if (!this.started) { return true; } return false; } /** Captures flags from deferred refresh calls to apply to the eventual modelUpdated event. */ setPendingRefreshFlags(params) { this.pendingNewData || (this.pendingNewData = !!params.newData); this.noKeepRenderedRows || (this.noKeepRenderedRows = !params.keepRenderedRows); this.noKeepUndoRedoStack || (this.noKeepUndoRedoStack = !params.keepUndoRedoStack); this.noAnimate || (this.noAnimate = !params.animate); } /** Clears pending refresh flags. Called at the end of a successful refreshModel. */ clearPendingRefreshFlags() { this.pendingNewData = false; this.noKeepRenderedRows = false; this.noKeepUndoRedoStack = false; this.noAnimate = false; } /** Updates the params to reflect any forced flags from nested refresh calls. */ updateRefreshParams(params) { params.newData = this.pendingNewData || !!params.newData; params.keepRenderedRows = !this.noKeepRenderedRows && !!params.keepRenderedRows; params.keepUndoRedoStack = !this.noKeepUndoRedoStack && !!params.keepUndoRedoStack; params.animate = !this.noAnimate && !!params.animate; } isEmpty() { return !this.rootNode?._leafs?.length || !this.beans.colModel?.ready; } isRowsToRender() { return this.rowsToDisplay.length > 0; } getOverlayType() { const { beans, gos } = this; if (this.rootNode?._leafs?.length) { if (beans.filterManager?.isAnyFilterPresent() && this.getRowCount() === 0) { return "noMatchingRows"; } } else if (this.rowCountReady || (gos.get("rowData")?.length ?? 0) == 0) { return "noRows"; } return null; } getNodesInRangeForSelection(firstInRange, lastInRange) { let started = false; let finished = false; const result = []; const groupsSelectChildren = _getGroupSelectsDescendants(this.gos); this.forEachNodeAfterFilterAndSort((rowNode) => { if (finished) { return; } if (started) { if (rowNode === lastInRange || rowNode === firstInRange) { finished = true; if (groupsSelectChildren && rowNode.group) { addAllLeafs(result, rowNode); return; } } } if (!started) { if (rowNode !== lastInRange && rowNode !== firstInRange) { return; } started = true; if (lastInRange === firstInRange) { finished = true; } } const includeThisNode = !rowNode.group || !groupsSelectChildren; if (includeThisNode) { result.push(rowNode); } }); return result; } getTopLevelNodes() { return this.rootNode?.childrenAfterGroup ?? null; } getRow(index) { return this.rowsToDisplay[index]; } getFormulaRow(index) { return this.formulaRows[index]; } isRowPresent(rowNode) { return this.rowsToDisplay.indexOf(rowNode) >= 0; } getRowIndexAtPixel(pixelToMatch) { const rowsToDisplay = this.rowsToDisplay; const rowsToDisplayLen = rowsToDisplay.length; if (this.isEmpty() || rowsToDisplayLen === 0) { return -1; } let bottomPointer = 0; let topPointer = rowsToDisplayLen - 1; if (pixelToMatch <= 0) { return 0; } const lastNode = rowsToDisplay[topPointer]; if (lastNode.rowTop <= pixelToMatch) { return topPointer; } let oldBottomPointer = -1; let oldTopPointer = -1; while (true) { const midPointer = Math.floor((bottomPointer + topPointer) / 2); const currentRowNode = rowsToDisplay[midPointer]; if (this.isRowInPixel(currentRowNode, pixelToMatch)) { return midPointer; } if (currentRowNode.rowTop < pixelToMatch) { bottomPointer = midPointer + 1; } else if (currentRowNode.rowTop > pixelToMatch) { topPointer = midPointer - 1; } const caughtInInfiniteLoop = oldBottomPointer === bottomPointer && oldTopPointer === topPointer; if (caughtInInfiniteLoop) { return midPointer; } oldBottomPointer = bottomPointer; oldTopPointer = topPointer; } } isRowInPixel(rowNode, pixelToMatch) { const topPixel = rowNode.rowTop; const bottomPixel = topPixel + rowNode.rowHeight; return topPixel <= pixelToMatch && bottomPixel > pixelToMatch; } forEachLeafNode(callback) { const allLeafs = this.rootNode?._leafs; if (allLeafs) { for (let i = 0, len = allLeafs.length; i < len; ++i) { callback(allLeafs[i], i); } } } forEachNode(callback, includeFooterNodes = false) { this.depthFirstSearchRowNodes(callback, includeFooterNodes); } forEachDisplayedNode(callback) { const rowsToDisplay = this.rowsToDisplay; for (let i = 0, len = rowsToDisplay.length; i < len; ++i) { callback(rowsToDisplay[i], i); } } forEachNodeAfterFilter(callback, includeFooterNodes = false) { this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node) => node.childrenAfterAggFilter); } forEachNodeAfterFilterAndSort(callback, includeFooterNodes = false) { this.depthFirstSearchRowNodes(callback, includeFooterNodes, (node) => node.childrenAfterSort); } forEachPivotNode(callback, includeFooterNodes, afterSort) { const { colModel, rowGroupColsSvc } = this.beans; if (!colModel.isPivotMode()) { return; } if (!rowGroupColsSvc?.columns.length) { callback(this.rootNode, 0); return; } const childrenField = afterSort ? "childrenAfterSort" : "childrenAfterGroup"; this.depthFirstSearchRowNodes( callback, includeFooterNodes, (node) => !node.leafGroup ? node[childrenField] : null ); } /** * Iterate through each node and all of its children * @param callback the function to execute for each node * @param includeFooterNodes whether to also iterate over footer nodes * @param nodes the nodes to start iterating over * @param getChildren a function to determine the recursion strategy * @param startIndex the index to start from * @returns the index ended at */ depthFirstSearchRowNodes(callback, includeFooterNodes = false, getChildren = (node2) => node2.childrenAfterGroup, node = this.rootNode, startIndex = 0) { let index = startIndex; if (!node) { return index; } const isRootNode = node === this.rootNode; if (!isRootNode) { callback(node, index++); } if (node.hasChildren() && !node.footer) { const children = isRootNode || this.hierarchical ? getChildren(node) : null; if (children) { const footerSvc = this.beans.footerSvc; index = footerSvc?.addTotalRows(index, node, callback, includeFooterNodes, isRootNode, "top") ?? index; for (const node2 of children) { index = this.depthFirstSearchRowNodes(callback, includeFooterNodes, getChildren, node2, index); } return footerSvc?.addTotalRows(index, node, callback, includeFooterNodes, isRootNode, "bottom") ?? index; } } return index; } // it's possible to recompute the aggregate without doing the other parts + api.refreshClientSideRowModel('aggregate') doAggregate(changedPath) { const rootNode = this.rootNode; if (rootNode) { this.beans.aggStage?.execute(changedPath); } } doFilterAggregates(changedPath) { const rootNode = this.rootNode; const filterAggStage = this.beans.filterAggStage; if (filterAggStage && this.hierarchical) { filterAggStage.execute(changedPath); return; } rootNode.childrenAfterAggFilter = rootNode.childrenAfterFilter; const sibling = rootNode.sibling; if (sibling) { sibling.childrenAfterAggFilter = rootNode.childrenAfterFilter; } } doSort(changedPath, changedRowNodes) { const sortStage = this.beans.sortStage; if (sortStage) { sortStage.execute(changedPath, changedRowNodes); return; } _forEachChangedGroupDepthFirst(this.rootNode, this.hierarchical, changedPath, (rowNode) => { rowNode.childrenAfterSort = rowNode.childrenAfterAggFilter.slice(0); updateRowNodeAfterSort(rowNode); }); } doGrouping(rootNode, params) { const groupStage = this.beans.groupStage; const groupingChanged = groupStage?.execute(params); if (groupingChanged === void 0) { const allLeafs = rootNode._leafs; rootNode.childrenAfterGroup = allLeafs; rootNode.updateHasChildren(); const sibling = rootNode.sibling; if (sibling) { sibling.childrenAfterGroup = allLeafs; } } if (groupingChanged || params.rowDataUpdated) { this.beans.colFilter?.refreshModel(); } if (!this.rowCountReady && this.rowNodesCountReady) { this.rowCountReady = true; this.eventSvc.dispatchEventOnce({ type: "rowCountReady" }); } } doFilter(changedPath) { const filterStage = this.beans.filterStage; if (filterStage) { filterStage.execute(changedPath); return; } _forEachChangedGroupDepthFirst(this.rootNode, this.hierarchical, changedPath, (rowNode) => { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; updateRowNodeAfterFilter(rowNode); }); } /** Returns `true` if pivot columns changed and changedPath should be deactivated. */ doPivot(changedPath) { return this.beans.pivotStage?.execute(changedPath) ?? false; } getRowNode(id) { const found = this.nodeManager?.getRowNode(id); if (typeof found === "object") { return found; } return this.beans.groupStage?.getNonLeaf(id); } batchUpdateRowData(rowDataTransaction, callback) { if (!this.asyncTransactionsTimer) { this.asyncTransactions = []; const waitMilliseconds = this.gos.get("asyncTransactionWaitMillis"); this.asyncTransactionsTimer = setTimeout(() => this.executeBatchUpdateRowData(), waitMilliseconds); } this.asyncTransactions.push({ rowDataTransaction, callback }); } flushAsyncTransactions() { const asyncTransactionsTimer = this.asyncTransactionsTimer; if (asyncTransactionsTimer) { clearTimeout(asyncTransactionsTimer); this.executeBatchUpdateRowData(); } } executeBatchUpdateRowData() { const { nodeManager, beans, eventSvc, asyncTransactions } = this; if (!nodeManager) { return; } beans.valueCache?.onDataChanged(); const rowNodeTrans = []; const callbackFuncsBound = []; const changedRowNodes = new ChangedRowNodes(); const animate = !this.gos.get("suppressAnimationFrame"); for (const { rowDataTransaction, callback } of asyncTransactions ?? []) { this.rowNodesCountReady = true; this.refreshingData = true; const rowNodeTransaction = nodeManager.updateRowData(rowDataTransaction, changedRowNodes, animate); rowNodeTrans.push(rowNodeTransaction); if (callback) { callbackFuncsBound.push(callback.bind(null, rowNodeTransaction)); } } this.commitTransactions(changedRowNodes, animate); if (callbackFuncsBound.length > 0) { setTimeout(() => { for (let i = 0, len = callbackFuncsBound.length; i < len; i++) { callbackFuncsBound[i](); } }, 0); } if (rowNodeTrans.length > 0) { eventSvc.dispatchEvent({ type: "asyncTransactionsFlushed", results: rowNodeTrans }); } this.asyncTransactionsTimer = 0; this.asyncTransactions = null; } /** * Used to apply transaction changes. * Called by gridApi & rowDragFeature */ updateRowData(rowDataTran) { const nodeManager = this.nodeManager; if (!nodeManager) { return null; } this.beans.valueCache?.onDataChanged(); this.rowNodesCountReady = true; const changedRowNodes = new ChangedRowNodes(); const animate = !this.gos.get("suppressAnimationFrame"); this.refreshingData = true; const rowNodeTransaction = nodeManager.updateRowData(rowDataTran, changedRowNodes, animate); this.commitTransactions(changedRowNodes, animate); return rowNodeTransaction; } /** * Common to: * - executeBatchUpdateRowData (batch transactions) * - updateRowData (single transaction) * - setImmutableRowData (generated transaction) * * @param rowNodeTrans - the transactions to apply * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex */ commitTransactions(changedRowNodes, animate) { this.refreshModel({ step: "group", rowDataUpdated: true, keepRenderedRows: true, animate, changedRowNodes }); } /** 'map' stage */ doRowsToDisplay() { const { rootNode, beans } = this; if (beans.formula?.active) { const unfilteredRows = rootNode?.childrenAfterSort ?? []; this.formulaRows = unfilteredRows; this.rowsToDisplay = unfilteredRows.filter((row) => !row.softFiltered); for (const row of this.rowsToDisplay) { row.setUiLevel(0); } return; } const flattenStage = beans.flattenStage; if (flattenStage) { this.rowsToDisplay = flattenStage.execute(); return; } const rowsToDisplay = this.rootNode.childrenAfterSort ?? []; for (const row of rowsToDisplay) { row.setUiLevel(0); } this.rowsToDisplay = rowsToDisplay; } onRowHeightChanged() { this.refreshModel({ step: "map", keepRenderedRows: true, keepUndoRedoStack: true }); } resetRowHeights() { const rootNode = this.rootNode; if (!rootNode) { return; } const atLeastOne = this.resetRowHeightsForAllRowNodes(); rootNode.setRowHeight(rootNode.rowHeight, true); const sibling = rootNode.sibling; sibling?.setRowHeight(sibling.rowHeight, true); if (atLeastOne) { this.onRowHeightChanged(); } } resetRowHeightsForAllRowNodes() { let atLeastOne = false; this.forEachNode((rowNode) => { rowNode.setRowHeight(rowNode.rowHeight, true); const detailNode = rowNode.detailNode; detailNode?.setRowHeight(detailNode.rowHeight, true); const sibling = rowNode.sibling; sibling?.setRowHeight(sibling.rowHeight, true); atLeastOne = true; }); return atLeastOne; } onGridStylesChanges(e) { if (e.rowHeightChanged && !this.beans.rowAutoHeight?.active) { this.resetRowHeights(); } } onGridReady() { if (!this.started) { this.setInitialData(); } } destroy() { super.destroy(); this.nodeManager = this.destroyBean(this.nodeManager); this.started = false; this.rootNode = null; this.rowsToDisplay = []; this.asyncTransactions = null; this.stages = null; this.stagesRefreshProps.clear(); clearTimeout(this.asyncTransactionsTimer); } /** * @deprecated v33.1 */ onRowHeightChangedDebounced() { this.onRowHeightChanged_debounced(); } }; var addAllLeafs = (result, node) => { const childrenAfterGroup = node.childrenAfterGroup; if (childrenAfterGroup) { for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) { const child = childrenAfterGroup[i]; if (child.data) { result.push(child); } if (child.group) { addAllLeafs(result, child); } } } }; function onGroupExpandedOrCollapsed(beans) { beans.expansionSvc?.onGroupExpandedOrCollapsed(); } function refreshClientSideRowModel(beans, step) { const clientSideRowModel = _getClientSideRowModel(beans); if (clientSideRowModel) { if (!step || step === "everything") { step = "group"; } clientSideRowModel.refreshModel({ step, keepRenderedRows: true, animate: !beans.gos.get("suppressAnimationFrame") }); } } function isRowDataEmpty(beans) { return _getClientSideRowModel(beans)?.isEmpty() ?? true; } function forEachLeafNode(beans, callback) { _getClientSideRowModel(beans)?.forEachLeafNode(callback); } function forEachNodeAfterFilter(beans, callback) { _getClientSideRowModel(beans)?.forEachNodeAfterFilter(callback); } function forEachNodeAfterFilterAndSort(beans, callback) { _getClientSideRowModel(beans)?.forEachNodeAfterFilterAndSort(callback); } function applyTransaction(beans, rowDataTransaction) { return beans.frameworkOverrides.wrapIncoming( () => _getClientSideRowModel(beans)?.updateRowData(rowDataTransaction) ); } function applyTransactionAsync(beans, rowDataTransaction, callback) { beans.frameworkOverrides.wrapIncoming( () => _getClientSideRowModel(beans)?.batchUpdateRowData(rowDataTransaction, callback) ); } function flushAsyncTransactions(beans) { beans.frameworkOverrides.wrapIncoming(() => _getClientSideRowModel(beans)?.flushAsyncTransactions()); } function getBestCostNodeSelection(beans) { return beans.selectionSvc?.getBestCostNodeSelection(); } var ClientSideRowModelModule = { moduleName: "ClientSideRowModel", version: VERSION, rowModels: ["clientSide"], beans: [ClientSideRowModel, SortStage], dependsOn: [SortModule] }; var ClientSideRowModelApiModule = { moduleName: "ClientSideRowModelApi", version: VERSION, apiFunctions: { onGroupExpandedOrCollapsed, refreshClientSideRowModel, isRowDataEmpty, forEachLeafNode, forEachNodeAfterFilter, forEachNodeAfterFilterAndSort, applyTransaction, applyTransactionAsync, flushAsyncTransactions, getBestCostNodeSelection, resetRowHeights, onRowHeightChanged }, dependsOn: [CsrmSsrmSharedApiModule, RowModelSharedApiModule] }; var columnAutoSize_default = ":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}"; function sizeColumnsToFit(beans, paramsOrGridWidth) { if (typeof paramsOrGridWidth === "number") { beans.colAutosize?.sizeColumnsToFit(paramsOrGridWidth, "api"); } else { beans.colAutosize?.sizeColumnsToFitGridBody(paramsOrGridWidth); } } function autoSizeColumns({ colAutosize, visibleCols }, keysOrParams, skipHeader) { if (Array.isArray(keysOrParams)) { colAutosize?.autoSizeCols({ colKeys: keysOrParams, skipHeader, source: "api" }); } else { colAutosize?.autoSizeCols({ ...keysOrParams, colKeys: keysOrParams.colIds ?? visibleCols.allCols, source: "api" }); } } function autoSizeAllColumns(beans, paramsOrSkipHeader) { if (paramsOrSkipHeader && typeof paramsOrSkipHeader === "object") { autoSizeColumns(beans, paramsOrSkipHeader); } else { beans.colAutosize?.autoSizeAllColumns({ source: "api", skipHeader: paramsOrSkipHeader }); } } var ColumnAutosizeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colAutosize"; this.timesDelayed = 0; this.shouldQueueResizeOperations = false; this.resizeOperationQueue = []; } postConstruct() { const { gos } = this; const autoSizeStrategy = gos.get("autoSizeStrategy"); if (autoSizeStrategy) { let shouldHideColumns = false; const type = autoSizeStrategy.type; if (type === "fitGridWidth" || type === "fitProvidedWidth") { shouldHideColumns = true; } else if (type === "fitCellContents") { this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered(autoSizeStrategy) }); const rowData = gos.get("rowData"); shouldHideColumns = rowData != null && rowData.length > 0 && _isClientSideRowModel(gos); } if (shouldHideColumns) { this.beans.colDelayRenderSvc?.hideColumns(type); } } } autoSizeCols(params) { const { eventSvc, visibleCols, colModel } = this.beans; setWidthAnimation(this.beans, true); this.innerAutoSizeCols(params).then((columnsAutoSized) => { const dispatch = (cols) => dispatchColumnResizedEvent(eventSvc, Array.from(cols), true, "autosizeColumns"); if (!params.scaleUpToFitGridWidth) { setWidthAnimation(this.beans, false); return dispatch(columnsAutoSized); } const availableGridWidth = getAvailableWidth(this.beans); const isLeftCol = (col) => visibleCols.leftCols.some((leftCol) => _columnsMatch(leftCol, col)); const isRightCol = (col) => visibleCols.rightCols.some((rightCol) => _columnsMatch(rightCol, col)); const colKeys = params.colKeys.filter((col) => { const allowAutoSize = !colModel.getCol(col)?.getColDef().suppressAutoSize; return allowAutoSize && !isRowNumberCol(col) && !isLeftCol(col) && !isRightCol(col); }); this.sizeColumnsToFit(availableGridWidth, params.source, true, { defaultMaxWidth: params.defaultMaxWidth, defaultMinWidth: params.defaultMinWidth, columnLimits: params.columnLimits?.map((limit) => ({ ...limit, key: limit.colId })), colKeys, onlyScaleUp: true, animate: false }); setWidthAnimation(this.beans, false); dispatch(columnsAutoSized); }); } innerAutoSizeCols(params) { return new Promise((resolve, reject) => { if (this.shouldQueueResizeOperations) { return this.pushResizeOperation(() => this.innerAutoSizeCols(params).then(resolve, reject)); } const { colKeys, skipHeader, skipHeaderGroups, stopAtGroup, defaultMaxWidth, defaultMinWidth, columnLimits = [], source = "api" } = params; const { animationFrameSvc, renderStatus, colModel, autoWidthCalc, visibleCols } = this.beans; animationFrameSvc?.flushAllFrames(); if (this.timesDelayed < 5 && renderStatus && (!renderStatus.areHeaderCellsRendered() || !renderStatus.areCellsRendered())) { this.timesDelayed++; setTimeout(() => { if (this.isAlive()) { this.innerAutoSizeCols(params).then(resolve, reject); } }); return; } this.timesDelayed = 0; const columnsAutoSized = /* @__PURE__ */ new Set(); let changesThisTimeAround = -1; const columnLimitsIndex = Object.fromEntries( columnLimits.map(({ colId, ...dimensions }) => [colId, dimensions]) ); const shouldSkipHeader = skipHeader ?? this.gos.get("skipHeaderOnAutoSize"); const shouldSkipHeaderGroups = skipHeaderGroups ?? shouldSkipHeader; while (changesThisTimeAround !== 0) { changesThisTimeAround = 0; const updatedColumns = []; for (const key of colKeys) { if (!key || isSpecialCol(key)) { continue; } const column = colModel.getCol(key); if (!column || columnsAutoSized.has(column) || column.getColDef().suppressAutoSize) { continue; } const preferredWidth = autoWidthCalc.getPreferredWidthForColumn(column, shouldSkipHeader); if (preferredWidth > 0) { const columnLimit = columnLimitsIndex[column.colId] ?? {}; columnLimit.minWidth ?? (columnLimit.minWidth = defaultMinWidth); columnLimit.maxWidth ?? (columnLimit.maxWidth = defaultMaxWidth); const newWidth = normaliseColumnWidth(column, preferredWidth, columnLimit); column.setActualWidth(newWidth, source); columnsAutoSized.add(column); changesThisTimeAround++; } updatedColumns.push(column); } if (updatedColumns.length) { visibleCols.refresh(source); } } if (!shouldSkipHeaderGroups) { this.autoSizeColumnGroupsByColumns(colKeys, source, stopAtGroup); } resolve(columnsAutoSized); }); } autoSizeColumn(key, source, skipHeader) { this.autoSizeCols({ colKeys: [key], skipHeader, skipHeaderGroups: true, source }); } autoSizeColumnGroupsByColumns(keys, source, stopAtGroup) { const { colModel, ctrlsSvc } = this.beans; const columnGroups = /* @__PURE__ */ new Set(); const columns = colModel.getColsForKeys(keys); for (const col of columns) { let parent = col.getParent(); while (parent && parent != stopAtGroup) { if (!parent.isPadding()) { columnGroups.add(parent); } parent = parent.getParent(); } } let headerGroupCtrl; for (const columnGroup of columnGroups) { for (const headerContainerCtrl of ctrlsSvc.getHeaderRowContainerCtrls()) { headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup); if (headerGroupCtrl) { break; } } headerGroupCtrl?.resizeLeafColumnsToFit(source); } } autoSizeAllColumns(params) { if (this.shouldQueueResizeOperations) { this.pushResizeOperation(() => this.autoSizeAllColumns(params)); return; } this.autoSizeCols({ colKeys: this.beans.visibleCols.allCols, ...params }); } addColumnAutosizeListeners(element, column) { const skipHeaderOnAutoSize = this.gos.get("skipHeaderOnAutoSize"); const autoSizeColListener = () => { this.autoSizeColumn(column, "uiColumnResized", skipHeaderOnAutoSize); }; element.addEventListener("dblclick", autoSizeColListener); const touchListener = new TouchListener(element); touchListener.addEventListener("doubleTap", autoSizeColListener); return () => { element.removeEventListener("dblclick", autoSizeColListener); touchListener.destroy(); }; } addColumnGroupResize(element, columnGroup, callback) { const skipHeaderOnAutoSize = this.gos.get("skipHeaderOnAutoSize"); const listener = () => { const keys = []; const leafCols = columnGroup.getDisplayedLeafColumns(); for (const column of leafCols) { if (!column.getColDef().suppressAutoSize) { keys.push(column.getColId()); } } if (keys.length > 0) { this.autoSizeCols({ colKeys: keys, skipHeader: skipHeaderOnAutoSize, stopAtGroup: columnGroup, source: "uiColumnResized" }); } callback(); }; element.addEventListener("dblclick", listener); return () => element.removeEventListener("dblclick", listener); } // method will call itself if no available width. this covers if the grid // isn't visible, but is just about to be visible. sizeColumnsToFitGridBody(params, nextTimeout) { if (!this.isAlive()) { return; } const availableWidth = getAvailableWidth(this.beans); if (availableWidth > 0) { this.sizeColumnsToFit(availableWidth, "sizeColumnsToFit", false, params); return; } if (nextTimeout === void 0) { window.setTimeout(() => { this.sizeColumnsToFitGridBody(params, 100); }, 0); } else if (nextTimeout === 100) { window.setTimeout(() => { this.sizeColumnsToFitGridBody(params, 500); }, 100); } else if (nextTimeout === 500) { window.setTimeout(() => { this.sizeColumnsToFitGridBody(params, -1); }, 500); } else { _warn(29); } } // called from api sizeColumnsToFit(gridWidth, source = "sizeColumnsToFit", silent, params) { if (this.shouldQueueResizeOperations) { this.pushResizeOperation(() => this.sizeColumnsToFit(gridWidth, source, silent, params)); return; } const { beans } = this; const animate = params?.animate ?? true; if (animate) { setWidthAnimation(beans, true); } const limitsMap = {}; for (const { key, ...dimensions } of params?.columnLimits ?? []) { limitsMap[typeof key === "string" ? key : key.getColId()] = dimensions; } const allDisplayedColumns = beans.visibleCols.allCols; if (gridWidth <= 0 || !allDisplayedColumns.length) { return; } const currentTotalColumnWidth = getWidthOfColsInList(allDisplayedColumns); if (params?.onlyScaleUp && currentTotalColumnWidth > gridWidth) { return; } const doColumnsAlreadyFit = gridWidth === currentTotalColumnWidth; if (doColumnsAlreadyFit) { const doAllColumnsSatisfyConstraints = allDisplayedColumns.every((column) => { if (column.colDef.suppressSizeToFit) { return true; } const widthOverride = limitsMap?.[column.getId()]; const minWidth = widthOverride?.minWidth ?? params?.defaultMinWidth; const maxWidth = widthOverride?.maxWidth ?? params?.defaultMaxWidth; const colWidth = column.getActualWidth(); return (minWidth == null || colWidth >= minWidth) && (maxWidth == null || colWidth <= maxWidth); }); if (doAllColumnsSatisfyConstraints) { return; } } const colsToSpread = []; const colsToNotSpread = []; for (const column of allDisplayedColumns) { const isIncluded = params?.colKeys?.some((key) => _columnsMatch(column, key)) ?? true; if (column.getColDef().suppressSizeToFit || !isIncluded) { colsToNotSpread.push(column); } else { colsToSpread.push(column); } } const colsToDispatchEventFor = colsToSpread.slice(0); let finishedResizing = false; const moveToNotSpread = (column) => { _removeFromArray(colsToSpread, column); colsToNotSpread.push(column); }; const currentWidths = {}; for (const column of colsToSpread) { if (params?.onlyScaleUp) { currentWidths[column.getColId()] = column.getActualWidth(); } column.resetActualWidth(source); const widthOverride = limitsMap?.[column.getId()]; const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth ?? -Infinity; const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth ?? Infinity; const colWidth = column.getActualWidth(); const targetWidth = Math.max(Math.min(colWidth, maxOverride), minOverride); if (targetWidth != colWidth) { column.setActualWidth(targetWidth, source, true); } } while (!finishedResizing) { finishedResizing = true; const availablePixels = gridWidth - getWidthOfColsInList(colsToNotSpread); if (availablePixels <= 0) { for (const column of colsToSpread) { const newWidth = limitsMap?.[column.getId()]?.minWidth ?? params?.defaultMinWidth ?? column.minWidth; column.setActualWidth(newWidth, source, true); } } else { const scale = availablePixels / getWidthOfColsInList(colsToSpread); let pixelsForLastCol = availablePixels; for (let i = colsToSpread.length - 1; i >= 0; i--) { const column = colsToSpread[i]; const id = column.getColId(); const prevWidth = currentWidths[id]; const widthOverride = limitsMap?.[id]; const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth ?? prevWidth; const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth; const minWidth = Math.max(minOverride ?? -Infinity, column.getMinWidth()); const maxWidth = Math.min(maxOverride ?? Infinity, column.getMaxWidth()); let newWidth = Math.round(column.getActualWidth() * scale); if (newWidth < minWidth) { newWidth = minWidth; moveToNotSpread(column); finishedResizing = false; } else if (newWidth > maxWidth) { newWidth = maxWidth; moveToNotSpread(column); finishedResizing = false; } else if (i === 0) { newWidth = pixelsForLastCol; } column.setActualWidth(newWidth, source, true); pixelsForLastCol -= newWidth; } } } for (const col of colsToDispatchEventFor) { col.fireColumnWidthChangedEvent(source); } const visibleCols = beans.visibleCols; visibleCols.setLeftValues(source); visibleCols.updateBodyWidths(); if (silent) { return; } dispatchColumnResizedEvent(this.eventSvc, colsToDispatchEventFor, true, source); if (animate) { setWidthAnimation(beans, false); } } applyAutosizeStrategy() { const { gos, colDelayRenderSvc } = this.beans; const autoSizeStrategy = gos.get("autoSizeStrategy"); if (autoSizeStrategy?.type !== "fitGridWidth" && autoSizeStrategy?.type !== "fitProvidedWidth") { return; } setTimeout(() => { if (!this.isAlive()) { return; } const type = autoSizeStrategy.type; if (type === "fitGridWidth") { const { columnLimits: propColumnLimits, defaultMinWidth, defaultMaxWidth } = autoSizeStrategy; const columnLimits = propColumnLimits?.map(({ colId: key, minWidth, maxWidth }) => ({ key, minWidth, maxWidth })); this.sizeColumnsToFitGridBody({ defaultMinWidth, defaultMaxWidth, columnLimits }); } else if (type === "fitProvidedWidth") { this.sizeColumnsToFit(autoSizeStrategy.width, "sizeColumnsToFit"); } colDelayRenderSvc?.revealColumns(type); }); } onFirstDataRendered({ colIds: colKeys, ...params }) { setTimeout(() => { if (!this.isAlive()) { return; } const source = "autosizeColumns"; if (colKeys) { this.autoSizeCols({ ...params, source, colKeys }); } else { this.autoSizeAllColumns({ ...params, source }); } this.beans.colDelayRenderSvc?.revealColumns(params.type); }); } processResizeOperations() { this.shouldQueueResizeOperations = false; for (const resizeOperation of this.resizeOperationQueue) { resizeOperation(); } this.resizeOperationQueue = []; } pushResizeOperation(func) { this.resizeOperationQueue.push(func); } destroy() { this.resizeOperationQueue.length = 0; super.destroy(); } }; function normaliseColumnWidth(column, newWidth, limits = {}) { const minWidth = limits.minWidth ?? column.getMinWidth(); if (newWidth < minWidth) { newWidth = minWidth; } const maxWidth = limits.maxWidth ?? column.getMaxWidth(); if (newWidth > maxWidth) { newWidth = maxWidth; } return newWidth; } function getAvailableWidth({ ctrlsSvc, scrollVisibleSvc }) { const gridBodyCtrl = ctrlsSvc.getGridBodyCtrl(); const removeScrollWidth = gridBodyCtrl.isVerticalScrollShowing(); const scrollWidthToRemove = removeScrollWidth ? scrollVisibleSvc.getScrollbarWidth() : 0; const bodyViewportWidth = _getInnerWidth(gridBodyCtrl.eGridBody); return bodyViewportWidth - scrollWidthToRemove; } var WIDTH_ANIMATION_CLASS = "ag-animate-autosize"; function setWidthAnimation({ ctrlsSvc, gos }, enable) { if (!gos.get("animateColumnResizing") || gos.get("enableRtl") || !ctrlsSvc.isAlive()) { return; } const classList = ctrlsSvc.getGridBodyCtrl().eGridBody.classList; if (enable) { classList.add(WIDTH_ANIMATION_CLASS); } else { classList.remove(WIDTH_ANIMATION_CLASS); } } var ColumnAutoSizeModule = { moduleName: "ColumnAutoSize", version: VERSION, beans: [ColumnAutosizeService], apiFunctions: { sizeColumnsToFit, autoSizeColumns, autoSizeAllColumns }, dependsOn: [AutoWidthModule], css: [columnAutoSize_default] }; function isColumnHovered(beans, column) { return !!beans.colHover?.isHovered(column); } var HoverFeature = class extends BeanStub { constructor(columns, element) { super(); this.columns = columns; this.element = element; this.destroyManagedListeners = []; this.enableFeature = (enabled) => { const { beans, gos, element: element2, columns: columns2 } = this; const colHover = beans.colHover; const active = enabled ?? !!gos.get("columnHoverHighlight"); if (active) { this.destroyManagedListeners = this.addManagedElementListeners(element2, { mouseover: colHover.setMouseOver.bind(colHover, columns2), mouseout: colHover.clearMouseOver.bind(colHover) }); } else { for (const fn of this.destroyManagedListeners) { fn(); } this.destroyManagedListeners = []; } }; } postConstruct() { this.addManagedPropertyListener("columnHoverHighlight", ({ currentValue }) => { this.enableFeature(currentValue); }); this.enableFeature(); } destroy() { super.destroy(); this.destroyManagedListeners = null; } }; var CSS_COLUMN_HOVER = "ag-column-hover"; var ColumnHoverService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colHover"; } postConstruct() { this.addManagedPropertyListener("columnHoverHighlight", ({ currentValue }) => { if (!currentValue) { this.clearMouseOver(); } }); } setMouseOver(columns) { this.updateState(columns); } clearMouseOver() { this.updateState(null); } isHovered(column) { if (!this.gos.get("columnHoverHighlight")) { return false; } const selectedColumns = this.selectedColumns; return !!selectedColumns && selectedColumns.indexOf(column) >= 0; } addHeaderColumnHoverListener(compBean, comp, column) { const listener = () => { const isHovered = this.isHovered(column); comp.toggleCss("ag-column-hover", isHovered); }; compBean.addManagedEventListeners({ columnHoverChanged: listener }); listener(); } onCellColumnHover(column, cellComp) { if (!cellComp) { return; } const isHovered = this.isHovered(column); cellComp.toggleCss(CSS_COLUMN_HOVER, isHovered); } addHeaderFilterColumnHoverListener(compBean, comp, column, eGui) { this.createHoverFeature(compBean, [column], eGui); const listener = () => { const hovered = this.isHovered(column); comp.toggleCss("ag-column-hover", hovered); }; compBean.addManagedEventListeners({ columnHoverChanged: listener }); listener(); } createHoverFeature(compBean, columns, eGui) { compBean.createManagedBean(new HoverFeature(columns, eGui)); } updateState(columns) { this.selectedColumns = columns; this.eventSvc.dispatchEvent({ type: "columnHoverChanged" }); } }; var ColumnHoverModule = { moduleName: "ColumnHover", version: VERSION, beans: [ColumnHoverService], apiFunctions: { isColumnHovered } }; var GridSerializer = class extends BeanStub { constructor() { super(...arguments); this.beanName = "gridSerializer"; } wireBeans(beans) { this.visibleCols = beans.visibleCols; this.colModel = beans.colModel; this.rowModel = beans.rowModel; this.pinnedRowModel = beans.pinnedRowModel; } serialize(gridSerializingSession, params = {}) { const { allColumns, columnKeys, skipRowGroups, exportRowNumbers } = params; const columnsToExport = this.getColumnsToExport({ allColumns, skipRowGroups, columnKeys, exportRowNumbers }); return [ // first pass, put in the header names of the cols this.prepareSession(columnsToExport), this.prependContent(params), this.exportColumnGroups(params, columnsToExport), this.exportHeaders(params, columnsToExport), this.processPinnedTopRows(params, columnsToExport), this.processRows(params, columnsToExport), this.processPinnedBottomRows(params, columnsToExport), this.appendContent(params) ].reduce((composed, f) => f(composed), gridSerializingSession).parse(); } processRow(gridSerializingSession, params, columnsToExport, node) { const rowSkipper = params.shouldRowBeSkipped || (() => false); const isClipboardExport = params.rowPositions != null; const isExplicitExportSelection = isClipboardExport || !!params.onlySelected; const hideOpenParents = this.gos.get("groupHideOpenParents") && !isExplicitExportSelection; const isLeafNode = this.colModel.isPivotMode() ? node.leafGroup : !node.group; const isFooter = !!node.footer; const shouldSkipCurrentGroup = node.allChildrenCount === 1 && node.childrenAfterGroup?.length === 1 && _canSkipShowingRowGroup(this.gos, node); if (!isLeafNode && !isFooter && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents) || params.onlySelected && !node.isSelected() || params.skipPinnedTop && node.rowPinned === "top" || params.skipPinnedBottom && node.rowPinned === "bottom" || node.stub) { return; } const nodeIsRootNode = node.level === -1; if (nodeIsRootNode && !isLeafNode && !isFooter) { return; } const shouldRowBeSkipped = rowSkipper(_addGridCommonParams(this.gos, { node })); if (shouldRowBeSkipped) { return; } const rowAccumulator = gridSerializingSession.onNewBodyRow(node); columnsToExport.forEach((column, index) => { rowAccumulator.onColumn(column, index, node); }); if (params.getCustomContentBelowRow) { const content = params.getCustomContentBelowRow(_addGridCommonParams(this.gos, { node })); if (content) { gridSerializingSession.addCustomContent(content); } } } appendContent(params) { return (gridSerializingSession) => { const appendContent = params.appendContent; if (appendContent) { gridSerializingSession.addCustomContent(appendContent); } return gridSerializingSession; }; } prependContent(params) { return (gridSerializingSession) => { const prependContent = params.prependContent; if (prependContent) { gridSerializingSession.addCustomContent(prependContent); } return gridSerializingSession; }; } prepareSession(columnsToExport) { return (gridSerializingSession) => { gridSerializingSession.prepare(columnsToExport); return gridSerializingSession; }; } exportColumnGroups(params, columnsToExport) { return (gridSerializingSession) => { if (!params.skipColumnGroupHeaders) { const idCreator = new GroupInstanceIdCreator(); const { colGroupSvc } = this.beans; const displayedGroups = colGroupSvc ? colGroupSvc.createColumnGroups({ columns: columnsToExport, idCreator, pinned: null, isStandaloneStructure: true }) : columnsToExport; this.recursivelyAddHeaderGroups( displayedGroups, gridSerializingSession, params.processGroupHeaderCallback ); } return gridSerializingSession; }; } exportHeaders(params, columnsToExport) { return (gridSerializingSession) => { if (!params.skipColumnHeaders) { const gridRowIterator = gridSerializingSession.onNewHeaderRow(); columnsToExport.forEach((column, index) => { gridRowIterator.onColumn(column, index, void 0); }); } return gridSerializingSession; }; } processPinnedTopRows(params, columnsToExport) { return (gridSerializingSession) => { const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport); if (params.rowPositions) { params.rowPositions.filter((position) => position.rowPinned === "top").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedTopRow(position.rowIndex)).forEach(processRow); } else if (!this.pinnedRowModel?.isManual()) { this.pinnedRowModel?.forEachPinnedRow("top", processRow); } return gridSerializingSession; }; } processRows(params, columnsToExport) { return (gridSerializingSession) => { const rowModel = this.rowModel; const usingCsrm = _isClientSideRowModel(this.gos, rowModel); const usingSsrm = _isServerSideRowModel(this.gos, rowModel); const onlySelectedNonStandardModel = !usingCsrm && params.onlySelected; const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport); const { exportedRows = "filteredAndSorted" } = params; if (params.rowPositions) { params.rowPositions.filter((position) => position.rowPinned == null).sort((a, b) => a.rowIndex - b.rowIndex).map((position) => rowModel.getRow(position.rowIndex)).forEach(processRow); } else if (this.colModel.isPivotMode()) { if (usingCsrm) { rowModel.forEachPivotNode(processRow, true, exportedRows === "filteredAndSorted"); } else if (usingSsrm) { rowModel.forEachNodeAfterFilterAndSort(processRow, true); } else { rowModel.forEachNode(processRow); } } else if (params.onlySelectedAllPages || onlySelectedNonStandardModel) { const selectedNodes = this.beans.selectionSvc?.getSelectedNodes() ?? []; this.replicateSortedOrder(selectedNodes); selectedNodes.forEach(processRow); } else if (exportedRows === "all") { rowModel.forEachNode(processRow); } else if (usingCsrm || usingSsrm) { rowModel.forEachNodeAfterFilterAndSort(processRow, true); } else { rowModel.forEachNode(processRow); } return gridSerializingSession; }; } replicateSortedOrder(rows) { const { sortSvc, rowNodeSorter } = this.beans; if (!sortSvc || !rowNodeSorter) { return; } const sortOptions = sortSvc.getSortOptions(); const compareNodes = (rowA, rowB) => { if (rowA.rowIndex != null && rowB.rowIndex != null) { return rowA.rowIndex - rowB.rowIndex; } if (rowA.level === rowB.level) { if (rowA.parent?.id === rowB.parent?.id) { return rowNodeSorter.compareRowNodes(sortOptions, rowA, rowB) || (rowA.rowIndex ?? -1) - (rowB.rowIndex ?? -1); } return compareNodes(rowA.parent, rowB.parent); } if (rowA.level > rowB.level) { return compareNodes(rowA.parent, rowB); } return compareNodes(rowA, rowB.parent); }; rows.sort(compareNodes); } processPinnedBottomRows(params, columnsToExport) { return (gridSerializingSession) => { const processRow = this.processRow.bind(this, gridSerializingSession, params, columnsToExport); if (params.rowPositions) { params.rowPositions.filter((position) => position.rowPinned === "bottom").sort((a, b) => a.rowIndex - b.rowIndex).map((position) => this.pinnedRowModel?.getPinnedBottomRow(position.rowIndex)).forEach(processRow); } else if (!this.pinnedRowModel?.isManual()) { this.pinnedRowModel?.forEachPinnedRow("bottom", processRow); } return gridSerializingSession; }; } getColumnsToExport(params) { const { allColumns = false, skipRowGroups = false, exportRowNumbers = false, columnKeys } = params; const { colModel, gos, visibleCols } = this; const isPivotMode2 = colModel.isPivotMode(); const filterSpecialColumns = (col) => { if (isColumnSelectionCol(col)) { return false; } return !isRowNumberCol(col) || exportRowNumbers; }; if (columnKeys?.length) { return colModel.getColsForKeys(columnKeys).filter(filterSpecialColumns); } const isTreeData = gos.get("treeData"); let columnsToExport = []; if (allColumns && !isPivotMode2) { columnsToExport = colModel.getCols(); } else { columnsToExport = visibleCols.allCols; } columnsToExport = columnsToExport.filter( (column) => filterSpecialColumns(column) && (skipRowGroups && !isTreeData ? !isColumnGroupAutoCol(column) : true) ); return columnsToExport; } recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, processGroupHeaderCallback) { const directChildrenHeaderGroups = []; for (const columnGroupChild of displayedGroups) { const columnGroup = columnGroupChild; if (!columnGroup.getChildren) { continue; } for (const it of columnGroup.getChildren() ?? []) { directChildrenHeaderGroups.push(it); } } if (displayedGroups.length > 0 && isColumnGroup(displayedGroups[0])) { this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback); } if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) { this.recursivelyAddHeaderGroups( directChildrenHeaderGroups, gridSerializingSession, processGroupHeaderCallback ); } } doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback) { const gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow(); let columnIndex = 0; for (const columnGroupChild of displayedGroups) { const columnGroup = columnGroupChild; let name; if (processGroupHeaderCallback) { name = processGroupHeaderCallback( _addGridCommonParams(this.gos, { columnGroup }) ); } else { name = this.beans.colNames.getDisplayNameForColumnGroup(columnGroup, "header"); } const columnsToCalculateRange = columnGroup.isExpandable() ? columnGroup.getLeafColumns() : []; const collapsibleGroupRanges = columnsToCalculateRange.reduce( (collapsibleGroups, currentColumn, currentIdx, arr) => { let lastGroup = _last(collapsibleGroups); const groupShow = currentColumn.getColumnGroupShow() === "open"; if (!groupShow) { if (lastGroup && lastGroup[1] == null) { lastGroup[1] = currentIdx - 1; } } else if (!lastGroup || lastGroup[1] != null) { lastGroup = [currentIdx]; collapsibleGroups.push(lastGroup); } if (currentIdx === arr.length - 1 && lastGroup && lastGroup[1] == null) { lastGroup[1] = currentIdx; } return collapsibleGroups; }, [] ); gridRowIterator.onColumn( columnGroup, name || "", columnIndex++, columnGroup.getLeafColumns().length - 1, collapsibleGroupRanges ); } } }; var SharedExportModule = { moduleName: "SharedExport", version: VERSION, beans: [GridSerializer] }; var BaseCreator = class extends BeanStub { getFileName(fileName) { const extension = this.getDefaultFileExtension(); if (!fileName?.length) { fileName = this.getDefaultFileName(); } return fileName.includes(".") ? fileName : `${fileName}.${extension}`; } getData(params) { return this.beans.gridSerializer.serialize(this.createSerializingSession(params), params); } getDefaultFileName() { return `export.${this.getDefaultFileExtension()}`; } }; function _downloadFile(fileName, content) { const win = document.defaultView || window; if (!win) { _warn(52); return; } const element = document.createElement("a"); const url = win.URL.createObjectURL(content); element.setAttribute("href", url); element.setAttribute("download", fileName); element.style.display = "none"; document.body.appendChild(element); element.dispatchEvent( new MouseEvent("click", { bubbles: false, cancelable: true, view: win }) ); element.remove(); win.setTimeout(() => { win.URL.revokeObjectURL(url); }, 0); } var BaseGridSerializingSession = class { constructor(config) { this.valueFrom = "data"; const { colModel, rowGroupColsSvc, colNames, valueSvc, gos, processCellCallback, processHeaderCallback, processGroupHeaderCallback, processRowGroupCallback, valueFrom } = config; this.colModel = colModel; this.rowGroupColsSvc = rowGroupColsSvc; this.colNames = colNames; this.valueSvc = valueSvc; this.gos = gos; this.processCellCallback = processCellCallback; this.processHeaderCallback = processHeaderCallback; this.processGroupHeaderCallback = processGroupHeaderCallback; this.processRowGroupCallback = processRowGroupCallback; if (valueFrom) { this.valueFrom = valueFrom; } } prepare(_columnsToExport) { } extractHeaderValue(column) { const value = this.getHeaderName(this.processHeaderCallback, column); return value ?? ""; } extractRowCellValue(params) { const { column, node, currentColumnIndex, accumulatedRowIndex, type, useRawFormula } = params; const isFullWidthGroup = currentColumnIndex === 0 && _isFullWidthGroupRow(this.gos, node, this.colModel.isPivotMode()); if (this.processRowGroupCallback && (this.gos.get("treeData") || node.group) && (column.isRowGroupDisplayed(node.rowGroupColumn?.getColId() ?? "") || isFullWidthGroup)) { return { value: this.processRowGroupCallback(_addGridCommonParams(this.gos, { column, node })) ?? "" }; } if (this.processCellCallback) { return { value: this.processCellCallback( _addGridCommonParams(this.gos, { accumulatedRowIndex, column, node, value: this.valueSvc.getValueForDisplay({ column, node, from: this.valueFrom }).value, type, parseValue: (valueToParse) => this.valueSvc.parseValue( column, node, valueToParse, this.valueSvc.getValue(column, node, this.valueFrom) ), formatValue: (valueToFormat) => this.valueSvc.formatValue(column, node, valueToFormat) ?? valueToFormat }) ) ?? "" }; } const isTreeData = this.gos.get("treeData"); const valueService = this.valueSvc; const isGrandTotalRow = node.level === -1 && node.footer; const isMultiAutoCol = column.colDef.showRowGroup === true && (node.group || isTreeData); if (!isGrandTotalRow && (isFullWidthGroup || isMultiAutoCol)) { let concatenatedGroupValue = ""; let pointer = node; while (pointer && pointer.level !== -1) { const { value: value2, valueFormatted: valueFormatted2 } = valueService.getValueForDisplay({ column: isFullWidthGroup ? void 0 : column, // full width group doesn't have a column node: pointer, includeValueFormatted: true, exporting: true, from: this.valueFrom }); concatenatedGroupValue = ` -> ${valueFormatted2 ?? value2 ?? ""}${concatenatedGroupValue}`; pointer = pointer.parent; } return { value: concatenatedGroupValue, // don't return the unformatted value; as if the grid detects number it'll not use the concatenated string valueFormatted: concatenatedGroupValue }; } const { value, valueFormatted } = valueService.getValueForDisplay({ column, node, includeValueFormatted: true, exporting: true, useRawFormula, from: this.valueFrom }); return { value: value ?? "", valueFormatted }; } getHeaderName(callback, column) { if (callback) { return callback(_addGridCommonParams(this.gos, { column })); } return this.colNames.getDisplayNameForColumn(column, "csv", true); } }; var LINE_SEPARATOR = "\r\n"; var CsvSerializingSession = class extends BaseGridSerializingSession { constructor(config) { super(config); this.config = config; this.isFirstLine = true; this.result = ""; const { suppressQuotes, columnSeparator } = config; this.suppressQuotes = suppressQuotes; this.columnSeparator = columnSeparator; } addCustomContent(content) { if (!content) { return; } if (typeof content === "string") { if (!/^\s*\n/.test(content)) { this.beginNewLine(); } content = content.replace(/\r?\n/g, LINE_SEPARATOR); this.result += content; } else { content.forEach((row) => { this.beginNewLine(); row.forEach((cell, index) => { if (index !== 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(cell.data.value || ""); if (cell.mergeAcross) { this.appendEmptyCells(cell.mergeAcross); } }); }); } } onNewHeaderGroupingRow() { this.beginNewLine(); return { onColumn: this.onNewHeaderGroupingRowColumn.bind(this) }; } onNewHeaderGroupingRowColumn(columnGroup, header, index, span) { if (index != 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(header); this.appendEmptyCells(span); } appendEmptyCells(count) { for (let i = 1; i <= count; i++) { this.result += this.columnSeparator + this.putInQuotes(""); } } onNewHeaderRow() { this.beginNewLine(); return { onColumn: this.onNewHeaderRowColumn.bind(this) }; } onNewHeaderRowColumn(column, index) { if (index != 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(this.extractHeaderValue(column)); } onNewBodyRow() { this.beginNewLine(); return { onColumn: this.onNewBodyRowColumn.bind(this) }; } onNewBodyRowColumn(column, index, node) { if (index != 0) { this.result += this.columnSeparator; } const rowCellValue = this.extractRowCellValue({ column, node, currentColumnIndex: index, accumulatedRowIndex: index, type: "csv", useRawFormula: false }); this.result += this.putInQuotes(rowCellValue.valueFormatted ?? rowCellValue.value); } putInQuotes(value) { if (this.suppressQuotes) { return value; } if (value === null || value === void 0) { return '""'; } let stringValue; if (typeof value === "string") { stringValue = value; } else if (typeof value.toString === "function") { stringValue = value.toString(); } else { _warn(53); stringValue = ""; } const valueEscaped = stringValue.replace(/"/g, '""'); return '"' + valueEscaped + '"'; } parse() { return this.result; } beginNewLine() { if (!this.isFirstLine) { this.result += LINE_SEPARATOR; } this.isFirstLine = false; } }; var CsvCreator = class extends BaseCreator { constructor() { super(...arguments); this.beanName = "csvCreator"; } getMergedParams(params) { const baseParams6 = this.gos.get("defaultCsvExportParams"); return Object.assign({}, baseParams6, params); } export(userParams) { if (this.isExportSuppressed()) { _warn(51); return; } const exportFunc = () => { const mergedParams = this.getMergedParams(userParams); const data = this.getData(mergedParams); const packagedFile = new Blob(["\uFEFF", data], { type: "text/plain" }); const fileNameParams = mergedParams.fileName; const fileName = typeof fileNameParams === "function" ? fileNameParams(_addGridCommonParams(this.gos, {})) : fileNameParams; _downloadFile(this.getFileName(fileName), packagedFile); }; const { overlays } = this.beans; if (overlays) { overlays.showExportOverlay(exportFunc); } else { exportFunc(); } } exportDataAsCsv(params) { this.export(params); } getDataAsCsv(params, skipDefaultParams = false) { const mergedParams = skipDefaultParams ? Object.assign({}, params) : this.getMergedParams(params); return this.getData(mergedParams); } getDefaultFileExtension() { return "csv"; } createSerializingSession(params) { const { colModel, colNames, rowGroupColsSvc, valueSvc, gos } = this.beans; const { processCellCallback, processHeaderCallback, processGroupHeaderCallback, processRowGroupCallback, suppressQuotes, columnSeparator, valueFrom } = params; return new CsvSerializingSession({ colModel, colNames, valueSvc, gos, processCellCallback: processCellCallback || void 0, processHeaderCallback: processHeaderCallback || void 0, processGroupHeaderCallback: processGroupHeaderCallback || void 0, processRowGroupCallback: processRowGroupCallback || void 0, suppressQuotes: suppressQuotes || false, columnSeparator: columnSeparator || ",", rowGroupColsSvc, valueFrom }); } isExportSuppressed() { return this.gos.get("suppressCsvExport"); } }; function getDataAsCsv(beans, params) { return beans.csvCreator?.getDataAsCsv(params); } function exportDataAsCsv(beans, params) { beans.csvCreator?.exportDataAsCsv(params); } var CsvExportModule = { moduleName: "CsvExport", version: VERSION, beans: [CsvCreator], apiFunctions: { getDataAsCsv, exportDataAsCsv }, dependsOn: [SharedExportModule] }; var AgTooltipFeature = class extends AgBeanStub { constructor(ctrl, beans) { super(); this.ctrl = ctrl; if (beans) { this.beans = beans; } } postConstruct() { this.refreshTooltip(); } /** * * @param tooltip The tooltip value * @param allowEmptyString Set it to true to allow the title to be set to `''`. This is necessary * when the browser adds a default tooltip the element and the tooltip service will be displayed * next to a browser tooltip causing confusion. */ setBrowserTooltip(tooltip, allowEmptyString) { const name = "title"; const eGui = this.ctrl.getGui(); if (!eGui) { return; } if (tooltip != null && (tooltip != "" || allowEmptyString)) { eGui.setAttribute(name, tooltip); } else { eGui.removeAttribute(name); } } updateTooltipText() { const { getTooltipValue } = this.ctrl; if (getTooltipValue) { this.tooltip = getTooltipValue(); } } createTooltipFeatureIfNeeded() { if (this.tooltipManager == null) { const tooltipManager = this.beans.registry.createDynamicBean("tooltipStateManager", true, this.ctrl, () => this.tooltip); if (tooltipManager) { this.tooltipManager = this.createBean(tooltipManager, this.beans.context); } } } attemptToShowTooltip() { this.tooltipManager?.prepareToShowTooltip(); } attemptToHideTooltip() { this.tooltipManager?.hideTooltip(); } setTooltipAndRefresh(tooltip) { this.tooltip = tooltip; this.refreshTooltip(); } refreshTooltip(clearWithEmptyString) { this.browserTooltips = this.beans.gos.get("enableBrowserTooltips"); this.updateTooltipText(); if (this.browserTooltips) { this.setBrowserTooltip(this.tooltip); this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context); } else { this.setBrowserTooltip(clearWithEmptyString ? "" : null, clearWithEmptyString); this.createTooltipFeatureIfNeeded(); } } destroy() { this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context); super.destroy(); } }; var SHOW_SWITCH_TOOLTIP_DIFF = 1e3; var FADE_OUT_TOOLTIP_TIMEOUT = 1e3; var INTERACTIVE_HIDE_DELAY = 100; var lastTooltipHideTime; var isLocked = false; var BaseTooltipStateManager = class extends AgBeanStub { constructor(tooltipCtrl, getTooltipValue) { super(); this.tooltipCtrl = tooltipCtrl; this.getTooltipValue = getTooltipValue; this.interactionEnabled = false; this.isInteractingWithTooltip = false; this.state = 0; this.tooltipInstanceCount = 0; this.tooltipMouseTrack = false; } wireBeans(beans) { this.popupSvc = beans.popupSvc; } postConstruct() { if (this.gos.get("tooltipInteraction")) { this.interactionEnabled = true; } this.tooltipTrigger = this.getTooltipTrigger(); this.tooltipMouseTrack = this.gos.get("tooltipMouseTrack"); const el = this.tooltipCtrl.getGui(); if (this.tooltipTrigger === 0) { this.addManagedListeners(el, { mouseenter: this.onMouseEnter.bind(this), mouseleave: this.onMouseLeave.bind(this) }); } if (this.tooltipTrigger === 1) { this.addManagedListeners(el, { focusin: this.onFocusIn.bind(this), focusout: this.onFocusOut.bind(this) }); } this.addManagedListeners(el, { mousemove: this.onMouseMove.bind(this) }); if (!this.interactionEnabled) { this.addManagedListeners(el, { mousedown: this.onMouseDown.bind(this), keydown: this.onKeyDown.bind(this) }); } } getGridOptionsTooltipDelay(delayOption) { const delay = this.gos.get(delayOption); return Math.max(200, delay); } getTooltipDelay(type) { return this.tooltipCtrl[`getTooltip${type}DelayOverride`]?.() ?? this.getGridOptionsTooltipDelay(`tooltip${type}Delay`); } destroy() { this.setToDoNothing(); super.destroy(); } getTooltipTrigger() { const trigger = this.gos.get("tooltipTrigger"); if (!trigger || trigger === "hover") { return 0; } return 1; } onMouseEnter(e) { if (this.interactionEnabled && this.interactiveTooltipTimeoutId) { this.unlockService(); this.startHideTimeout(); } if (_isIOSUserAgent()) { return; } if (isLocked) { this.showTooltipTimeoutId = window.setTimeout(() => { this.prepareToShowTooltip(e); }, INTERACTIVE_HIDE_DELAY); } else { this.prepareToShowTooltip(e); } } onMouseMove(e) { if (this.lastMouseEvent) { this.lastMouseEvent = e; } if (this.tooltipMouseTrack && this.state === 2 && this.tooltipComp) { this.positionTooltip(); } } onMouseDown() { this.setToDoNothing(); } onMouseLeave() { if (this.interactionEnabled) { this.lockService(); } else { this.setToDoNothing(); } } onFocusIn() { this.prepareToShowTooltip(); } onFocusOut(e) { const relatedTarget = e.relatedTarget; const parentCompGui = this.tooltipCtrl.getGui(); const tooltipGui = this.tooltipComp?.getGui(); if (this.isInteractingWithTooltip || parentCompGui.contains(relatedTarget) || this.interactionEnabled && tooltipGui?.contains(relatedTarget)) { return; } this.setToDoNothing(); } onKeyDown() { if (this.isInteractingWithTooltip) { this.isInteractingWithTooltip = false; } this.setToDoNothing(); } prepareToShowTooltip(mouseEvent) { if (this.state != 0 || isLocked) { return; } let delay = 0; if (mouseEvent) { delay = this.isLastTooltipHiddenRecently() ? this.getTooltipDelay("SwitchShow") : this.getTooltipDelay("Show"); } this.lastMouseEvent = mouseEvent || null; this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay); this.state = 1; } isLastTooltipHiddenRecently() { const now = Date.now(); const then = lastTooltipHideTime; return now - then < SHOW_SWITCH_TOOLTIP_DIFF; } setToDoNothing(fromHideTooltip) { if (!fromHideTooltip && this.state === 2) { this.hideTooltip(); } if (this.onBodyScrollEventCallback) { this.onBodyScrollEventCallback(); this.onBodyScrollEventCallback = void 0; } this.clearEventHandlers(); if (this.onDocumentKeyDownCallback) { this.onDocumentKeyDownCallback(); this.onDocumentKeyDownCallback = void 0; } this.clearTimeouts(); this.state = 0; this.lastMouseEvent = null; } showTooltip() { const value = this.getTooltipValue(); const ctrl = this.tooltipCtrl; if (!_exists(value) || ctrl.shouldDisplayTooltip && !ctrl.shouldDisplayTooltip()) { this.setToDoNothing(); return; } const params = this.gos.addCommon({ location: ctrl.getLocation?.() ?? "UNKNOWN", value, hideTooltipCallback: () => this.hideTooltip(true), ...ctrl.getAdditionalParams?.() }); this.state = 2; this.tooltipInstanceCount++; const callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount); this.createTooltipComp(params, callback); } hideTooltip(forceHide) { if (!forceHide && this.isInteractingWithTooltip) { return; } if (this.tooltipComp) { this.destroyTooltipComp(); lastTooltipHideTime = Date.now(); } this.eventSvc.dispatchEvent({ type: "tooltipHide", parentGui: this.tooltipCtrl.getGui() }); if (forceHide) { this.isInteractingWithTooltip = false; } this.setToDoNothing(true); } newTooltipComponentCallback(tooltipInstanceCopy, tooltipComp) { const compNoLongerNeeded = this.state !== 2 || this.tooltipInstanceCount !== tooltipInstanceCopy; if (compNoLongerNeeded) { this.destroyBean(tooltipComp); return; } const eGui = tooltipComp.getGui(); this.tooltipComp = tooltipComp; if (!eGui.classList.contains("ag-tooltip")) { eGui.classList.add("ag-tooltip-custom"); } if (this.tooltipTrigger === 0) { eGui.classList.add("ag-tooltip-animate"); } if (this.interactionEnabled) { eGui.classList.add("ag-tooltip-interactive"); } const translate = this.getLocaleTextFunc(); const addPopupRes = this.popupSvc?.addPopup({ eChild: eGui, ariaLabel: translate("ariaLabelTooltip", "Tooltip") }); if (addPopupRes) { this.tooltipPopupDestroyFunc = addPopupRes.hideFunc; } this.positionTooltip(); if (this.tooltipTrigger === 1) { const listener = () => this.setToDoNothing(); [this.onBodyScrollEventCallback] = this.addManagedEventListeners({ bodyScroll: listener }); this.setEventHandlers(listener); } if (this.interactionEnabled) { [this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(eGui, { mouseenter: this.onTooltipMouseEnter.bind(this), mouseleave: this.onTooltipMouseLeave.bind(this) }); [this.onDocumentKeyDownCallback] = this.addManagedElementListeners(_getDocument(this.beans), { keydown: (e) => { if (!eGui.contains(e?.target)) { this.onKeyDown(); } } }); if (this.tooltipTrigger === 1) { [this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(eGui, { focusin: this.onTooltipFocusIn.bind(this), focusout: this.onTooltipFocusOut.bind(this) }); } } this.eventSvc.dispatchEvent({ type: "tooltipShow", tooltipGui: eGui, parentGui: this.tooltipCtrl.getGui() }); this.startHideTimeout(); } onTooltipMouseEnter() { this.isInteractingWithTooltip = true; this.unlockService(); } onTooltipMouseLeave() { if (this.isTooltipFocused()) { return; } this.isInteractingWithTooltip = false; this.lockService(); } onTooltipFocusIn() { this.isInteractingWithTooltip = true; } isTooltipFocused() { const tooltipGui = this.tooltipComp?.getGui(); const activeEl = _getActiveDomElement(this.beans); return !!tooltipGui && tooltipGui.contains(activeEl); } onTooltipFocusOut(e) { const parentGui = this.tooltipCtrl.getGui(); if (this.isTooltipFocused()) { return; } this.isInteractingWithTooltip = false; if (parentGui.contains(e.relatedTarget)) { this.startHideTimeout(); } else { this.hideTooltip(); } } positionTooltip() { const params = { type: "tooltip", ePopup: this.tooltipComp.getGui(), nudgeY: 18, skipObserver: this.tooltipMouseTrack }; if (this.lastMouseEvent) { this.popupSvc?.positionPopupUnderMouseEvent({ ...params, mouseEvent: this.lastMouseEvent }); } else { this.popupSvc?.positionPopupByComponent({ ...params, eventSource: this.tooltipCtrl.getGui(), position: "under", keepWithinBounds: true, nudgeY: 5 }); } } destroyTooltipComp() { this.tooltipComp.getGui().classList.add("ag-tooltip-hiding"); const tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc; const tooltipComp = this.tooltipComp; const delay = this.tooltipTrigger === 0 ? FADE_OUT_TOOLTIP_TIMEOUT : 0; window.setTimeout(() => { tooltipPopupDestroyFunc(); this.destroyBean(tooltipComp); }, delay); this.clearTooltipListeners(); this.tooltipPopupDestroyFunc = void 0; this.tooltipComp = void 0; } clearTooltipListeners() { for (const listener of [ this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener, this.tooltipFocusInListener, this.tooltipFocusOutListener ]) { if (listener) { listener(); } } this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null; } lockService() { isLocked = true; this.interactiveTooltipTimeoutId = window.setTimeout(() => { this.unlockService(); this.setToDoNothing(); }, INTERACTIVE_HIDE_DELAY); } unlockService() { isLocked = false; this.clearInteractiveTimeout(); } startHideTimeout() { this.clearHideTimeout(); this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay("Hide")); } clearShowTimeout() { if (!this.showTooltipTimeoutId) { return; } window.clearTimeout(this.showTooltipTimeoutId); this.showTooltipTimeoutId = void 0; } clearHideTimeout() { if (!this.hideTooltipTimeoutId) { return; } window.clearTimeout(this.hideTooltipTimeoutId); this.hideTooltipTimeoutId = void 0; } clearInteractiveTimeout() { if (!this.interactiveTooltipTimeoutId) { return; } window.clearTimeout(this.interactiveTooltipTimeoutId); this.interactiveTooltipTimeoutId = void 0; } clearTimeouts() { this.clearShowTimeout(); this.clearHideTimeout(); this.clearInteractiveTimeout(); } }; var AgHighlightTooltipFeature = class extends AgTooltipFeature { constructor(ctrl, highlightTracker, beans) { super(ctrl, beans); this.highlightTracker = highlightTracker; this.onHighlight = this.onHighlight.bind(this); } postConstruct() { super.postConstruct(); this.wireHighlightListeners(); } wireHighlightListeners() { this.addManagedPropertyListener("tooltipTrigger", ({ currentValue }) => { this.setTooltipMode(currentValue); }); this.setTooltipMode(this.gos.get("tooltipTrigger")); this.highlightTracker.addEventListener("itemHighlighted", this.onHighlight); } onHighlight(event) { if (this.tooltipMode !== 1) { return; } if (event.highlighted) { this.attemptToShowTooltip(); } else { this.attemptToHideTooltip(); } } setTooltipMode(tooltipTriggerMode = "focus") { this.tooltipMode = tooltipTriggerMode === "focus" ? 1 : 0; } destroy() { this.highlightTracker.removeEventListener("itemHighlighted", this.onHighlight); super.destroy(); } }; var AgTooltipComponent = class extends AgPopupComponent { constructor() { super({ tag: "div", cls: "ag-tooltip" }); } // will need to type params init(params) { const { value } = params; const eGui = this.getGui(); eGui.textContent = _toString(value); const locationKebabCase = params.location.replace(/([a-z])([A-Z0-9])/g, "$1-$2").toLowerCase(); eGui.classList.add(`ag-${locationKebabCase}-tooltip`); } }; var tooltip_default = ".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}"; var instanceIdSeq = 0; var WAIT_FOR_POPUP_CONTENT_RESIZE = 200; var BasePopupService = class extends AgBeanStub { constructor() { super(...arguments); this.beanName = "popupSvc"; this.popupList = []; } postConstruct() { this.addManagedEventListeners({ stylesChanged: this.handleThemeChange.bind(this) }); } getPopupParent() { const ePopupParent = this.gos.get("popupParent"); if (ePopupParent) { return ePopupParent; } return this.getDefaultPopupParent(); } positionPopupUnderMouseEvent(params) { const { ePopup, nudgeX, nudgeY, skipObserver } = params; this.positionPopup({ ePopup, nudgeX, nudgeY, keepWithinBounds: true, skipObserver, updatePosition: () => this.calculatePointerAlign(params.mouseEvent), postProcessCallback: () => this.callPostProcessPopup(params.additionalParams, params.type, params.ePopup, null, params.mouseEvent) }); } calculatePointerAlign(e) { const parentRect = this.getParentRect(); return { x: e.clientX - parentRect.left, y: e.clientY - parentRect.top }; } positionPopupByComponent(params) { const { ePopup, nudgeX, nudgeY, keepWithinBounds, eventSource, alignSide = "left", position = "over", type } = params; const sourceRect = eventSource.getBoundingClientRect(); const parentRect = this.getParentRect(); this.setAlignedTo(eventSource, ePopup); const updatePosition = () => { let x = sourceRect.left - parentRect.left; if (alignSide === "right") { x -= ePopup.offsetWidth - sourceRect.width; } let y; if (position === "over") { y = sourceRect.top - parentRect.top; this.setAlignedStyles(ePopup, "over"); } else { this.setAlignedStyles(ePopup, "under"); const alignSide2 = this.shouldRenderUnderOrAbove(ePopup, sourceRect, parentRect, params.nudgeY || 0); if (alignSide2 === "under") { y = sourceRect.top - parentRect.top + sourceRect.height; } else { y = sourceRect.top - ePopup.offsetHeight - (nudgeY || 0) * 2 - parentRect.top; } } return { x, y }; }; this.positionPopup({ ePopup, nudgeX, nudgeY, keepWithinBounds, updatePosition, postProcessCallback: () => this.callPostProcessPopup(params.additionalParams, type, ePopup, eventSource, null) }); } positionPopupForMenu(params) { const { eventSource, ePopup, event } = params; const sourceRect = eventSource.getBoundingClientRect(); const parentRect = this.getParentRect(); this.setAlignedTo(eventSource, ePopup); let minWidthSet = false; const updatePosition = () => { const y = this.keepXYWithinBounds( ePopup, sourceRect.top - parentRect.top, 0 /* Vertical */ ); const minWidth = ePopup.clientWidth > 0 ? ePopup.clientWidth : 200; if (!minWidthSet) { ePopup.style.minWidth = `${minWidth}px`; minWidthSet = true; } const widthOfParent = parentRect.right - parentRect.left; const maxX = widthOfParent - minWidth; let x; if (this.gos.get("enableRtl")) { x = xLeftPosition(); if (x < 0) { x = xRightPosition(); this.setAlignedStyles(ePopup, "left"); } if (x > maxX) { x = 0; this.setAlignedStyles(ePopup, "right"); } } else { x = xRightPosition(); if (x > maxX) { x = xLeftPosition(); this.setAlignedStyles(ePopup, "right"); } if (x < 0) { x = 0; this.setAlignedStyles(ePopup, "left"); } } return { x, y }; function xRightPosition() { return sourceRect.right - parentRect.left - 2; } function xLeftPosition() { return sourceRect.left - parentRect.left - minWidth; } }; this.positionPopup({ ePopup, keepWithinBounds: true, updatePosition, postProcessCallback: () => this.callPostProcessPopup( params.additionalParams, "subMenu", ePopup, eventSource, event instanceof MouseEvent ? event : void 0 ) }); } shouldRenderUnderOrAbove(ePopup, targetCompRect, parentRect, nudgeY) { const spaceAvailableUnder = parentRect.bottom - targetCompRect.bottom; const spaceAvailableAbove = targetCompRect.top - parentRect.top; const spaceRequired = ePopup.offsetHeight + nudgeY; if (spaceAvailableUnder > spaceRequired) { return "under"; } if (spaceAvailableAbove > spaceRequired || spaceAvailableAbove > spaceAvailableUnder) { return "above"; } return "under"; } setAlignedStyles(ePopup, positioned) { const popupIdx = this.getPopupIndex(ePopup); if (popupIdx === -1) { return; } const popup = this.popupList[popupIdx]; const { alignedToElement } = popup; if (!alignedToElement) { return; } const positions = ["right", "left", "over", "above", "under"]; for (const position of positions) { alignedToElement.classList.remove(`ag-has-popup-positioned-${position}`); ePopup.classList.remove(`ag-popup-positioned-${position}`); } if (!positioned) { return; } alignedToElement.classList.add(`ag-has-popup-positioned-${positioned}`); ePopup.classList.add(`ag-popup-positioned-${positioned}`); } setAlignedTo(eventSource, ePopup) { const popupIdx = this.getPopupIndex(ePopup); if (popupIdx !== -1) { const popup = this.popupList[popupIdx]; popup.alignedToElement = eventSource; } } positionPopup(params) { const { ePopup, keepWithinBounds, nudgeX, nudgeY, skipObserver, updatePosition } = params; const lastSize = { width: 0, height: 0 }; const updatePopupPosition = (fromResizeObserver = false) => { let { x, y } = updatePosition(); if (fromResizeObserver && ePopup.clientWidth === lastSize.width && ePopup.clientHeight === lastSize.height) { return; } lastSize.width = ePopup.clientWidth; lastSize.height = ePopup.clientHeight; if (nudgeX) { x += nudgeX; } if (nudgeY) { y += nudgeY; } if (keepWithinBounds) { x = this.keepXYWithinBounds( ePopup, x, 1 /* Horizontal */ ); y = this.keepXYWithinBounds( ePopup, y, 0 /* Vertical */ ); } ePopup.style.left = `${x}px`; ePopup.style.top = `${y}px`; if (params.postProcessCallback) { params.postProcessCallback(); } }; updatePopupPosition(); if (!skipObserver) { const resizeObserverDestroyFunc = _observeResize(this.beans, ePopup, () => updatePopupPosition(true)); setTimeout(() => resizeObserverDestroyFunc(), WAIT_FOR_POPUP_CONTENT_RESIZE); } } getParentRect() { const eDocument = _getDocument(this.beans); let popupParent = this.getPopupParent(); if (popupParent === eDocument.body) { popupParent = eDocument.documentElement; } else if (getComputedStyle(popupParent).position === "static") { popupParent = popupParent.offsetParent; } return _getElementRectWithOffset(popupParent); } keepXYWithinBounds(ePopup, position, direction) { const isVertical = direction === 0; const sizeProperty = isVertical ? "clientHeight" : "clientWidth"; const anchorProperty = isVertical ? "top" : "left"; const offsetProperty = isVertical ? "height" : "width"; const scrollPositionProperty = isVertical ? "scrollTop" : "scrollLeft"; const eDocument = _getDocument(this.beans); const docElement = eDocument.documentElement; const popupParent = this.getPopupParent(); const popupRect = ePopup.getBoundingClientRect(); const parentRect = popupParent.getBoundingClientRect(); const documentRect = eDocument.documentElement.getBoundingClientRect(); const isBody = popupParent === eDocument.body; const offsetSize = Math.ceil(popupRect[offsetProperty]); const getSize2 = isVertical ? _getAbsoluteHeight : _getAbsoluteWidth; let sizeOfParent = isBody ? getSize2(docElement) + docElement[scrollPositionProperty] : popupParent[sizeProperty]; if (isBody) { sizeOfParent -= Math.abs(documentRect[anchorProperty] - parentRect[anchorProperty]); } const max = sizeOfParent - offsetSize; return Math.min(Math.max(position, 0), Math.max(max, 0)); } addPopup(params) { const { eChild, ariaLabel, ariaOwns, alwaysOnTop, positionCallback, anchorToElement } = params; const pos = this.getPopupIndex(eChild); if (pos !== -1) { const popup = this.popupList[pos]; return { hideFunc: popup.hideFunc }; } this.initialisePopupPosition(eChild); const wrapperEl = this.createPopupWrapper(eChild, !!alwaysOnTop, ariaLabel, ariaOwns); const removeListeners = this.addEventListenersToPopup({ ...params, wrapperEl }); if (positionCallback) { positionCallback(); } this.addPopupToPopupList(eChild, wrapperEl, removeListeners, anchorToElement); return { hideFunc: removeListeners }; } initialisePopupPosition(element) { const ePopupParent = this.getPopupParent(); const ePopupParentRect = ePopupParent.getBoundingClientRect(); if (!_exists(element.style.top)) { element.style.top = `${ePopupParentRect.top * -1}px`; } if (!_exists(element.style.left)) { element.style.left = `${ePopupParentRect.left * -1}px`; } } createPopupWrapper(element, alwaysOnTop, ariaLabel, ariaOwns) { const ePopupParent = this.getPopupParent(); const { environment, gos } = this.beans; const eWrapper = _createAgElement({ tag: "div" }); environment.applyThemeClasses(eWrapper); eWrapper.classList.add("ag-popup"); element.classList.add(gos.get("enableRtl") ? "ag-rtl" : "ag-ltr", "ag-popup-child"); if (!element.hasAttribute("role")) { _setAriaRole(element, "dialog"); } if (ariaLabel) { _setAriaLabel(element, ariaLabel); } else if (ariaOwns) { element.id || (element.id = `popup-component-${instanceIdSeq}`); _setAriaOwns(ariaOwns, element.id); } eWrapper.appendChild(element); ePopupParent.appendChild(eWrapper); if (alwaysOnTop) { this.setAlwaysOnTop(element, true); } else { this.bringPopupToFront(element); } return eWrapper; } addEventListenersToPopup(params) { const beans = this.beans; const eDocument = _getDocument(beans); const { wrapperEl, eChild: popupEl, closedCallback, afterGuiAttached, closeOnEsc, modal, ariaOwns } = params; let popupHidden = false; const hidePopupOnKeyboardEvent = (event) => { if (!wrapperEl.contains(_getActiveDomElement(beans))) { return; } const key = event.key; if (key === KeyCode.ESCAPE && !this.isStopPropagation(event)) { removeListeners({ keyboardEvent: event }); } }; const hidePopupOnMouseEvent = (event) => removeListeners({ mouseEvent: event }); const hidePopupOnTouchEvent = (event) => removeListeners({ touchEvent: event }); const removeListeners = (popupParams = {}) => { const { mouseEvent, touchEvent, keyboardEvent, forceHide } = popupParams; if (!forceHide && // we don't hide popup if the event was on the child, or any // children of this child (this.isEventFromCurrentPopup({ mouseEvent, touchEvent }, popupEl) || // this method should only be called once. the client can have different // paths, each one wanting to close, so this method may be called multiple times. popupHidden)) { return; } popupHidden = true; wrapperEl.remove(); eDocument.removeEventListener("keydown", hidePopupOnKeyboardEvent); eDocument.removeEventListener("mousedown", hidePopupOnMouseEvent); eDocument.removeEventListener("touchstart", hidePopupOnTouchEvent); eDocument.removeEventListener("contextmenu", hidePopupOnMouseEvent); this.eventSvc.removeListener("dragStarted", hidePopupOnMouseEvent); if (closedCallback) { closedCallback(mouseEvent || touchEvent || keyboardEvent); } this.removePopupFromPopupList(popupEl, ariaOwns); }; if (afterGuiAttached) { afterGuiAttached({ hidePopup: removeListeners }); } window.setTimeout(() => { if (closeOnEsc) { eDocument.addEventListener("keydown", hidePopupOnKeyboardEvent); } if (modal) { eDocument.addEventListener("mousedown", hidePopupOnMouseEvent); this.eventSvc.addListener("dragStarted", hidePopupOnMouseEvent); eDocument.addEventListener("touchstart", hidePopupOnTouchEvent); eDocument.addEventListener("contextmenu", hidePopupOnMouseEvent); } }, 0); return removeListeners; } addPopupToPopupList(element, wrapperEl, removeListeners, anchorToElement) { this.popupList.push({ element, wrapper: wrapperEl, hideFunc: removeListeners, instanceId: instanceIdSeq, isAnchored: !!anchorToElement }); if (anchorToElement) { this.setPopupPositionRelatedToElement(element, anchorToElement); } instanceIdSeq = instanceIdSeq + 1; } getPopupIndex(el) { return this.popupList.findIndex((p) => p.element === el); } setPopupPositionRelatedToElement(popupEl, relativeElement) { const popupIndex = this.getPopupIndex(popupEl); if (popupIndex === -1) { return; } const popup = this.popupList[popupIndex]; if (popup.stopAnchoringPromise) { popup.stopAnchoringPromise.then((destroyFunc) => destroyFunc && destroyFunc()); } popup.stopAnchoringPromise = void 0; popup.isAnchored = false; if (!relativeElement) { return; } const destroyPositionTracker = this.keepPopupPositionedRelativeTo({ element: relativeElement, ePopup: popupEl, hidePopup: popup.hideFunc }); popup.stopAnchoringPromise = destroyPositionTracker; popup.isAnchored = true; return destroyPositionTracker; } removePopupFromPopupList(element, ariaOwns) { this.setAlignedStyles(element, null); this.setPopupPositionRelatedToElement(element, null); if (ariaOwns) { _setAriaOwns(ariaOwns, null); } this.popupList = this.popupList.filter((p) => p.element !== element); } keepPopupPositionedRelativeTo(params) { const eParent = this.getPopupParent(); const parentRect = eParent.getBoundingClientRect(); const { element, ePopup } = params; const sourceRect = element.getBoundingClientRect(); const extractFromPixelValue = (pxSize) => Number.parseInt(pxSize.substring(0, pxSize.length - 1), 10); const createPosition = (prop, direction) => { const initialDiff = parentRect[prop] - sourceRect[prop]; const initial = extractFromPixelValue(ePopup.style[prop]); return { initialDiff, lastDiff: initialDiff, initial, last: initial, direction }; }; const topPosition = createPosition( "top", 0 /* Vertical */ ); const leftPosition = createPosition( "left", 1 /* Horizontal */ ); const fwOverrides = this.beans.frameworkOverrides; return new AgPromise((resolve) => { fwOverrides.wrapIncoming(() => { _wrapInterval(() => { const pRect = eParent.getBoundingClientRect(); const sRect = element.getBoundingClientRect(); const elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0; if (elementNotInDom) { params.hidePopup(); return; } const calculateNewPosition = (position, prop) => { const current = extractFromPixelValue(ePopup.style[prop]); if (position.last !== current) { position.initial = current; position.last = current; } const currentDiff = pRect[prop] - sRect[prop]; if (currentDiff != position.lastDiff) { const newValue = this.keepXYWithinBounds( ePopup, position.initial + position.initialDiff - currentDiff, position.direction ); ePopup.style[prop] = `${newValue}px`; position.last = newValue; } position.lastDiff = currentDiff; }; calculateNewPosition(topPosition, "top"); calculateNewPosition(leftPosition, "left"); }, 200).then((intervalId) => { const result = () => { if (intervalId != null) { window.clearInterval(intervalId); } }; resolve(result); }); }, "popupPositioning"); }); } isEventFromCurrentPopup(params, target) { const { mouseEvent, touchEvent } = params; const event = mouseEvent ? mouseEvent : touchEvent; if (!event) { return false; } const indexOfThisChild = this.getPopupIndex(target); if (indexOfThisChild === -1) { return false; } for (let i = indexOfThisChild; i < this.popupList.length; i++) { const popup = this.popupList[i]; if (_isElementInEventPath(popup.element, event)) { return true; } } return this.isElementWithinCustomPopup(event.target); } isElementWithinCustomPopup(el) { const eDocument = _getDocument(this.beans); while (el && el !== eDocument.body) { if (el.classList.contains("ag-custom-component-popup") || el.parentElement === null) { return true; } el = el.parentElement; } return false; } getWrapper(ePopup) { while (!ePopup.classList.contains("ag-popup") && ePopup.parentElement) { ePopup = ePopup.parentElement; } return ePopup.classList.contains("ag-popup") ? ePopup : null; } setAlwaysOnTop(ePopup, alwaysOnTop) { const eWrapper = this.getWrapper(ePopup); if (!eWrapper) { return; } eWrapper.classList.toggle("ag-always-on-top", !!alwaysOnTop); if (alwaysOnTop) { this.bringPopupToFront(eWrapper); } } /** @returns true if moved */ bringPopupToFront(ePopup) { const parent = this.getPopupParent(); const popupList = Array.prototype.slice.call(parent.querySelectorAll(".ag-popup")); const popupLen = popupList.length; const eWrapper = this.getWrapper(ePopup); if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) { return; } const standardPopupList = []; const alwaysOnTopList = []; for (const popup of popupList) { if (popup === eWrapper) { continue; } if (popup.classList.contains("ag-always-on-top")) { alwaysOnTopList.push(popup); } else { standardPopupList.push(popup); } } const innerElsScrollMap = []; const onTopLength = alwaysOnTopList.length; const isPopupAlwaysOnTop = eWrapper.classList.contains("ag-always-on-top"); const shouldBeLast = isPopupAlwaysOnTop || !onTopLength; const targetList = shouldBeLast ? [...standardPopupList, ...alwaysOnTopList, eWrapper] : [...standardPopupList, eWrapper, ...alwaysOnTopList]; for (let i = 0; i <= popupLen; i++) { const currentPopup = targetList[i]; if (popupList[i] === targetList[i] || currentPopup === eWrapper) { continue; } const innerEls = currentPopup.querySelectorAll("div"); for (const el of innerEls) { if (el.scrollTop !== 0) { innerElsScrollMap.push([el, el.scrollTop]); } } if (i === 0) { parent.prepend(currentPopup); } else { targetList[i - 1].after(currentPopup); } } while (innerElsScrollMap.length) { const currentEl = innerElsScrollMap.pop(); currentEl[0].scrollTop = currentEl[1]; } } handleThemeChange(e) { if (e.themeChanged) { const environment = this.beans.environment; for (const popup of this.popupList) { environment.applyThemeClasses(popup.wrapper); } } } }; var PopupService = class extends BasePopupService { getDefaultPopupParent() { return this.beans.ctrlsSvc.get("gridCtrl").getGui(); } callPostProcessPopup(params, type, ePopup, eventSource, mouseEvent) { const callback = this.gos.getCallback("postProcessPopup"); if (callback) { const { column, rowNode } = params ?? {}; const postProcessParams = { column, rowNode, ePopup, type, eventSource, mouseEvent }; callback(postProcessParams); } } getActivePopups() { return this.popupList.map((popup) => popup.element); } hasAnchoredPopup() { return this.popupList.some((popup) => popup.isAnchored); } isStopPropagation(event) { return _isStopPropagationForAgGrid(event); } }; var PopupModule = { moduleName: "Popup", version: VERSION, beans: [PopupService] }; function _isShowTooltipWhenTruncated(gos) { return gos.get("tooltipShowMode") === "whenTruncated"; } function _getShouldDisplayTooltip(gos, getElement2) { return _isShowTooltipWhenTruncated(gos) ? _isElementOverflowingCallback(getElement2) : void 0; } var getErrorTooltipMessage = (error, translate) => { const localisable = error; if (typeof localisable.getTranslatedMessage === "function") { return localisable.getTranslatedMessage(translate); } return error.message; }; var getEditErrorsForPosition = (beans, cellCtrl, translate) => { const { editModelSvc } = beans; const cellValidationErrors = editModelSvc?.getCellValidationModel()?.getCellValidation(cellCtrl)?.errorMessages; const rowValidationErrors = editModelSvc?.getRowValidationModel().getRowValidation(cellCtrl)?.errorMessages; const errors = cellValidationErrors || rowValidationErrors; return errors?.length ? errors.join(translate("tooltipValidationErrorSeparator", ". ")) : void 0; }; var getCellTruncationCheck = (beans, ctrl) => { const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(beans.gos); if (!isTooltipWhenTruncated) { return void 0; } if (ctrl.isCellRenderer()) { const colDef = ctrl.column.getColDef(); const isGroupCellRenderer = !!colDef.showRowGroup || colDef.cellRenderer === "agGroupCellRenderer"; if (!isGroupCellRenderer) { return void 0; } return _isElementOverflowingCallback(() => { const eCell = ctrl.eGui; return eCell.querySelector(".ag-group-value") || eCell.querySelector(".ag-cell-value") || eCell; }); } return _isElementOverflowingCallback(() => { const eCell = ctrl.eGui; return eCell.children.length === 0 ? eCell : eCell.querySelector(".ag-cell-value"); }); }; var buildCellTooltipDisplayFunctions = (beans, ctrl, shouldDisplayTooltip) => { const { editSvc } = beans; const { column } = ctrl; const isCellTruncated = getCellTruncationCheck(beans, ctrl); const shouldDisplayCellTooltip = () => { if (editSvc?.isEditing(ctrl)) { return false; } if (!isCellTruncated) { return true; } if (!column.isTooltipEnabled()) { return false; } return isCellTruncated(); }; return { shouldDisplayDefault: shouldDisplayCellTooltip, shouldDisplayColumnTooltip: shouldDisplayCellTooltip, shouldDisplayCustomTooltip: shouldDisplayTooltip ?? shouldDisplayCellTooltip }; }; var resolveCellTooltip = ({ beans, ctrl, value, displayFunctions, translate }) => { const { editSvc, formula, gos } = beans; const { column, rowNode } = ctrl; if (formula?.active && column.isAllowFormula()) { const error = formula.getFormulaError(column, rowNode); if (error) { return { value: getErrorTooltipMessage(error, translate), location: "cellFormula", shouldDisplay: () => !!formula?.getFormulaError(column, rowNode) }; } } const isEditing2 = !!editSvc?.isEditing(ctrl); if (!isEditing2) { const errorMessages = getEditErrorsForPosition(beans, ctrl, translate); if (errorMessages) { return { value: errorMessages, location: "cellEditor", shouldDisplay: () => !editSvc?.isEditing(ctrl) && !!getEditErrorsForPosition(beans, ctrl, translate) }; } } const { shouldDisplayCustomTooltip, shouldDisplayColumnTooltip } = displayFunctions; if (value != null) { return { value, location: "cell", shouldDisplay: shouldDisplayCustomTooltip }; } const colDef = column.getColDef(); const data = rowNode.data; if (colDef.tooltipField && _exists(data)) { return { value: _getValueUsingField(data, colDef.tooltipField, column.isTooltipFieldContainsDots()), location: "cell", shouldDisplay: shouldDisplayColumnTooltip }; } const valueGetter = colDef.tooltipValueGetter; if (valueGetter) { return { value: valueGetter( _addGridCommonParams(gos, { location: "cell", colDef: column.getColDef(), column, rowIndex: ctrl.cellPosition.rowIndex, node: rowNode, data: rowNode.data, value: ctrl.value, valueFormatted: ctrl.valueFormatted }) ), location: "cell", shouldDisplay: shouldDisplayColumnTooltip }; } return null; }; var TooltipService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "tooltipSvc"; } setupHeaderTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) { if (existingTooltipFeature) { ctrl.destroyBean(existingTooltipFeature); } const gos = this.gos; const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos); const { column, eGui } = ctrl; const colDef = column.getColDef(); if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef.headerComponent) { shouldDisplayTooltip = _isElementOverflowingCallback( () => eGui.querySelector(".ag-header-cell-text") ); } const location = "header"; const headerLocation = "header"; const valueFormatted = this.beans.colNames.getDisplayNameForColumn(column, headerLocation, true); const value = passedValue ?? valueFormatted; const tooltipCtrl = { getGui: () => eGui, getLocation: () => location, getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.( _addGridCommonParams(gos, { location, colDef, column, value, valueFormatted }) ) ?? colDef?.headerTooltip, shouldDisplayTooltip, getAdditionalParams: () => ({ column, colDef: column.getColDef() }) }; let tooltipFeature = this.createTooltipFeature(tooltipCtrl); if (tooltipFeature) { tooltipFeature = ctrl.createBean(tooltipFeature); ctrl.setRefreshFunction("tooltip", () => tooltipFeature.refreshTooltip()); } return tooltipFeature; } setupHeaderGroupTooltip(existingTooltipFeature, ctrl, passedValue, shouldDisplayTooltip) { if (existingTooltipFeature) { ctrl.destroyBean(existingTooltipFeature); } const gos = this.gos; const isTooltipWhenTruncated = _isShowTooltipWhenTruncated(gos); const { column, eGui } = ctrl; const colDef = column.getColGroupDef(); if (!shouldDisplayTooltip && isTooltipWhenTruncated && !colDef?.headerGroupComponent) { shouldDisplayTooltip = _isElementOverflowingCallback( () => eGui.querySelector(".ag-header-group-text") ); } const location = "headerGroup"; const headerLocation = "header"; const valueFormatted = this.beans.colNames.getDisplayNameForColumnGroup(column, headerLocation); const value = passedValue ?? valueFormatted; const tooltipCtrl = { getGui: () => eGui, getLocation: () => location, getTooltipValue: () => passedValue ?? colDef?.headerTooltipValueGetter?.( _addGridCommonParams(gos, { location, colDef, column, value, valueFormatted }) ) ?? colDef?.headerTooltip, shouldDisplayTooltip, getAdditionalParams: () => { const additionalParams = { column }; if (colDef) { additionalParams.colDef = colDef; } return additionalParams; } }; const tooltipFeature = this.createTooltipFeature(tooltipCtrl); return tooltipFeature ? ctrl.createBean(tooltipFeature) : tooltipFeature; } enableCellTooltipFeature(ctrl, value, shouldDisplayTooltip) { const { beans } = this; const { column, rowNode } = ctrl; const displayFunctions = buildCellTooltipDisplayFunctions(beans, ctrl, shouldDisplayTooltip); const translate = this.getLocaleTextFunc(); let resolvedTooltip = null; const resolveAndStore = () => { resolvedTooltip = resolveCellTooltip({ beans, ctrl, value, displayFunctions, translate }); return resolvedTooltip; }; const getTooltipValue = () => resolveAndStore()?.value; const tooltipCtrl = { getGui: () => ctrl.eGui, getLocation: () => resolvedTooltip?.location ?? "cell", getTooltipValue, shouldDisplayTooltip: () => { const tooltip = resolvedTooltip ?? resolveAndStore(); if (!tooltip) { return false; } return tooltip.shouldDisplay ? tooltip.shouldDisplay() : true; }, getAdditionalParams: () => ({ column, colDef: column.getColDef(), rowIndex: ctrl.cellPosition.rowIndex, node: rowNode, data: rowNode.data, valueFormatted: ctrl.valueFormatted }) }; return this.createTooltipFeature(tooltipCtrl, beans); } setupFullWidthRowTooltip(existingTooltipFeature, ctrl, value, shouldDisplayTooltip) { const tooltipParams = { getGui: () => ctrl.getFullWidthElement(), getTooltipValue: () => value, getLocation: () => "fullWidthRow", shouldDisplayTooltip }; const beans = this.beans; const context = beans.context; if (existingTooltipFeature) { ctrl.destroyBean(existingTooltipFeature, context); } const tooltipFeature = this.createTooltipFeature(tooltipParams, beans); if (!tooltipFeature) { return; } return ctrl.createBean(tooltipFeature, context); } setupCellEditorTooltip(cellCtrl, editor) { const { beans } = this; const { context } = beans; const el = editor.getValidationElement?.(true) || !editor.isPopup?.() && cellCtrl.eGui; if (!el) { return; } const tooltipParams = { getGui: () => el, getTooltipValue: () => getEditErrorsForPosition(beans, cellCtrl, this.getLocaleTextFunc()), getLocation: () => "cellEditor", shouldDisplayTooltip: () => { const { editModelSvc } = beans; const rowValidationMap = editModelSvc?.getRowValidationModel()?.getRowValidationMap(); const cellValidationMap = editModelSvc?.getCellValidationModel()?.getCellValidationMap(); const hasRowValidationErrors = !!rowValidationMap && rowValidationMap.size > 0; const hasCellValidationErrors = !!cellValidationMap && cellValidationMap.size > 0; return hasRowValidationErrors || hasCellValidationErrors; } }; const tooltipFeature = this.createTooltipFeature(tooltipParams, beans); if (!tooltipFeature) { return; } return cellCtrl.createBean(tooltipFeature, context); } initCol(column) { const { colDef } = column; column.tooltipEnabled = _exists(colDef.tooltipField) || _exists(colDef.tooltipValueGetter) || _exists(colDef.tooltipComponent); } createTooltipFeature(tooltipCtrl, beans) { return this.beans.registry.createDynamicBean("tooltipFeature", false, tooltipCtrl, beans); } }; var TooltipStateManager = class extends BaseTooltipStateManager { createTooltipComp(params, callback) { const userDetails = _getTooltipCompDetails(this.beans.userCompFactory, params); userDetails?.newAgStackInstance().then(callback); } setEventHandlers(listener) { [this.onColumnMovedEventCallback] = this.addManagedEventListeners({ columnMoved: listener }); } clearEventHandlers() { this.onColumnMovedEventCallback?.(); this.onColumnMovedEventCallback = void 0; } }; var TooltipModule = { moduleName: "Tooltip", version: VERSION, beans: [TooltipService], dynamicBeans: { tooltipFeature: AgTooltipFeature, highlightTooltipFeature: AgHighlightTooltipFeature, tooltipStateManager: TooltipStateManager }, userComponents: { agTooltipComponent: AgTooltipComponent }, dependsOn: [PopupModule], css: [tooltip_default] }; var UndoRedoAction = class { constructor(cellValueChanges) { this.cellValueChanges = cellValueChanges; } }; var RangeUndoRedoAction = class extends UndoRedoAction { constructor(cellValueChanges, initialRange, finalRange, ranges) { super(cellValueChanges); this.initialRange = initialRange; this.finalRange = finalRange; this.ranges = ranges; } }; var DEFAULT_STACK_SIZE = 10; var UndoRedoStack = class { constructor(maxStackSize) { this.actionStack = []; this.maxStackSize = maxStackSize ? maxStackSize : DEFAULT_STACK_SIZE; this.actionStack = new Array(this.maxStackSize); } pop() { return this.actionStack.pop(); } push(item) { const shouldAddActions = item.cellValueChanges && item.cellValueChanges.length > 0; if (!shouldAddActions) { return; } if (this.actionStack.length === this.maxStackSize) { this.actionStack.shift(); } this.actionStack.push(item); } clear() { this.actionStack = []; } getCurrentStackSize() { return this.actionStack.length; } }; var UndoRedoService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "undoRedo"; this.cellValueChanges = []; this.activeCellEdit = null; this.activeRowEdit = null; this.isPasting = false; this.isRangeInAction = false; this.batchEditing = false; this.bulkEditing = false; this.onCellValueChanged = (event) => { const eventCell = { column: event.column, rowIndex: event.rowIndex, rowPinned: event.rowPinned }; const isCellEditing = this.activeCellEdit !== null && _areCellsEqual(this.activeCellEdit, eventCell); const isRowEditing = this.activeRowEdit !== null && _isSameRow(this.activeRowEdit, eventCell); const shouldCaptureAction = isCellEditing || isRowEditing || this.isPasting || this.isRangeInAction; if (!shouldCaptureAction) { return; } const { rowPinned, rowIndex, column, oldValue, value } = event; const cellValueChange = { rowPinned, rowIndex, columnId: column.getColId(), newValue: value, oldValue }; this.cellValueChanges.push(cellValueChange); }; this.clearStacks = () => { this.undoStack.clear(); this.redoStack.clear(); }; } postConstruct() { const { gos, ctrlsSvc } = this.beans; if (!gos.get("undoRedoCellEditing")) { return; } const undoRedoLimit = gos.get("undoRedoCellEditingLimit"); if (undoRedoLimit <= 0) { return; } this.undoStack = new UndoRedoStack(undoRedoLimit); this.redoStack = new UndoRedoStack(undoRedoLimit); this.addListeners(); const listener = this.clearStacks.bind(this); this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this), // undo / redo is restricted to actual editing so we clear the stacks when other operations are // performed that change the order of the row / cols. modelUpdated: (e) => { if (!e.keepUndoRedoStack) { this.clearStacks(); } }, columnPivotModeChanged: listener, newColumnsLoaded: listener, columnGroupOpened: listener, columnRowGroupChanged: listener, columnMoved: listener, columnPinned: listener, columnVisible: listener, rowDragEnd: listener }); ctrlsSvc.whenReady(this, (p) => { this.gridBodyCtrl = p.gridBodyCtrl; }); } getCurrentUndoStackSize() { return this.undoStack?.getCurrentStackSize() ?? 0; } getCurrentRedoStackSize() { return this.redoStack?.getCurrentStackSize() ?? 0; } undo(source) { const { eventSvc, undoStack, redoStack } = this; eventSvc.dispatchEvent({ type: "undoStarted", source }); const operationPerformed = this.undoRedo(undoStack, redoStack, "initialRange", "oldValue", "undo"); eventSvc.dispatchEvent({ type: "undoEnded", source, operationPerformed }); } redo(source) { const { eventSvc, undoStack, redoStack } = this; eventSvc.dispatchEvent({ type: "redoStarted", source }); const operationPerformed = this.undoRedo(redoStack, undoStack, "finalRange", "newValue", "redo"); eventSvc.dispatchEvent({ type: "redoEnded", source, operationPerformed }); } undoRedo(undoRedoStack, opposingUndoRedoStack, rangeProperty, cellValueChangeProperty, source) { if (!undoRedoStack) { return false; } const undoRedoAction = undoRedoStack.pop(); if (!undoRedoAction?.cellValueChanges) { return false; } this.processAction( undoRedoAction, (cellValueChange) => cellValueChange[cellValueChangeProperty], source ); if (undoRedoAction instanceof RangeUndoRedoAction) { this.processRange(undoRedoAction.ranges || [undoRedoAction[rangeProperty]]); } else { this.processCell(undoRedoAction.cellValueChanges); } opposingUndoRedoStack.push(undoRedoAction); return true; } processAction(action, valueExtractor, source) { const { changeDetectionSvc } = this.beans; changeDetectionSvc?.beginDeferred(); try { for (const cellValueChange of action.cellValueChanges) { const { rowIndex, rowPinned, columnId } = cellValueChange; const rowPosition = { rowIndex, rowPinned }; const currentRow = _getRowNode(this.beans, rowPosition); if (!currentRow?.displayed) { continue; } currentRow.setDataValue(columnId, valueExtractor(cellValueChange), source); } } finally { changeDetectionSvc?.endDeferred(); } } processRange(ranges) { let lastFocusedCell; const rangeSvc = this.beans.rangeSvc; rangeSvc.removeAllCellRanges(true); ranges.forEach((range, idx) => { if (!range) { return; } const startRow = range.startRow; const endRow = range.endRow; if (idx === ranges.length - 1) { lastFocusedCell = { rowPinned: startRow.rowPinned, rowIndex: startRow.rowIndex, columnId: range.startColumn.getColId() }; this.setLastFocusedCell(lastFocusedCell); } const cellRangeParams = { rowStartIndex: startRow.rowIndex, rowStartPinned: startRow.rowPinned, rowEndIndex: endRow.rowIndex, rowEndPinned: endRow.rowPinned, columnStart: range.startColumn, columns: range.columns }; rangeSvc.addCellRange(cellRangeParams); }); } processCell(cellValueChanges) { const cellValueChange = cellValueChanges[0]; const { rowIndex, rowPinned } = cellValueChange; const rowPosition = { rowIndex, rowPinned }; const row = _getRowNode(this.beans, rowPosition); const lastFocusedCell = { rowPinned: cellValueChange.rowPinned, rowIndex: row.rowIndex, columnId: cellValueChange.columnId }; this.setLastFocusedCell(lastFocusedCell); } setLastFocusedCell(lastFocusedCell) { const { rowIndex, columnId, rowPinned } = lastFocusedCell; const { colModel, focusSvc, rangeSvc } = this.beans; const column = colModel.getCol(columnId); if (!column) { return; } const { scrollFeature } = this.gridBodyCtrl; scrollFeature.ensureIndexVisible(rowIndex); scrollFeature.ensureColumnVisible(column); const cellPosition = { rowIndex, column, rowPinned }; focusSvc.setFocusedCell({ ...cellPosition, forceBrowserFocus: true }); rangeSvc?.setRangeToCell(cellPosition); } addListeners() { this.addManagedEventListeners({ rowEditingStarted: (e) => { this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned }; }, rowEditingStopped: () => { const action = new UndoRedoAction(this.cellValueChanges); this.pushActionsToUndoStack(action); this.activeRowEdit = null; }, cellEditingStarted: (e) => { this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned }; }, cellEditingStopped: (e) => { this.activeCellEdit = null; const shouldPushAction = e.valueChanged && !this.activeRowEdit && !this.isPasting && !this.isRangeInAction; if (shouldPushAction) { const action = new UndoRedoAction(this.cellValueChanges); this.pushActionsToUndoStack(action); } }, pasteStart: () => { this.isPasting = true; }, pasteEnd: () => { const action = new UndoRedoAction(this.cellValueChanges); this.pushActionsToUndoStack(action); this.isPasting = false; }, fillStart: () => { this.isRangeInAction = true; }, fillEnd: (event) => { const action = new RangeUndoRedoAction(this.cellValueChanges, event.initialRange, event.finalRange); this.pushActionsToUndoStack(action); this.isRangeInAction = false; }, keyShortcutChangedCellStart: () => { this.isRangeInAction = true; }, keyShortcutChangedCellEnd: () => { let action; const { rangeSvc, gos } = this.beans; if (rangeSvc && _isCellSelectionEnabled(gos)) { action = new RangeUndoRedoAction(this.cellValueChanges, void 0, void 0, [ ...rangeSvc.getCellRanges() ]); } else { action = new UndoRedoAction(this.cellValueChanges); } this.pushActionsToUndoStack(action); this.isRangeInAction = false; }, batchEditingStarted: () => this.startBigChange("batchEditing"), batchEditingStopped: ({ changes }) => this.stopBigChange("batchEditing", changes), bulkEditingStarted: () => this.startBigChange("bulkEditing"), bulkEditingStopped: ({ changes }) => this.stopBigChange("bulkEditing", changes) }); } startBigChange(key) { this.updateBigChange(key, true); } updateBigChange(key, value) { if (key === "bulkEditing") { this.bulkEditing = value; } else { this.batchEditing = value; } } stopBigChange(key, changes) { if (key === "bulkEditing" && !this.bulkEditing || key === "batchEditing" && !this.batchEditing) { return; } this.updateBigChange(key, false); if (changes?.length === 0) { return; } const action = new UndoRedoAction(changes ?? []); this.pushActionsToUndoStack(action); this.cellValueChanges = []; } pushActionsToUndoStack(action) { this.undoStack.push(action); this.cellValueChanges = []; this.redoStack.clear(); } }; var cell_editing_default = ".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}"; var CheckboxCellEditorElement = { tag: "div", cls: "ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit", children: [ { tag: "ag-checkbox", ref: "eEditor", role: "presentation" } ] }; var CheckboxCellEditor = class extends AgAbstractCellEditor { constructor() { super(CheckboxCellEditorElement, [AgCheckboxSelector]); this.eEditor = RefPlaceholder; } initialiseEditor(params) { this.agSetEditValue(params.value); const inputEl = this.eEditor.getInputElement(); inputEl.setAttribute("tabindex", "-1"); this.addManagedListeners(this.eEditor, { fieldValueChanged: (event) => this.setAriaLabel(event.selected) }); } agSetEditValue(value) { this.params.value = value; const isSelected = value ?? void 0; this.eEditor.setValue(isSelected, true); this.setAriaLabel(isSelected); } getValue() { return this.eEditor.getValue(); } focusIn() { this.eEditor.getFocusableElement().focus(); } afterGuiAttached() { if (this.params.cellStartedEdit) { this.focusIn(); } } isPopup() { return false; } setAriaLabel(isSelected) { const translate = this.getLocaleTextFunc(); const stateName = _getAriaCheckboxStateName(translate, isSelected); const ariaLabel = translate("ariaToggleCellValue", "Press SPACE to toggle cell value"); this.eEditor.setInputAriaLabel(`${ariaLabel} (${stateName})`); } getValidationElement(tooltip) { return tooltip ? this.params.eGridCell : this.eEditor.getInputElement(); } getValidationErrors() { const { params } = this; const { getValidationErrors } = params; const value = this.getValue(); if (!getValidationErrors) { return null; } return getValidationErrors({ value, internalErrors: null, cellEditorParams: params }); } }; var AgInputTextField = class extends AgAbstractInputField { constructor(config, className = "ag-text-field", inputType = "text") { super(config, className, inputType); } postConstruct() { super.postConstruct(); if (this.config.allowedCharPattern) { this.preventDisallowedCharacters(); } } setValue(value, silent) { const eInput = this.eInput; if (eInput.value !== value) { eInput.value = _exists(value) ? value : ""; } return super.setValue(value, silent); } /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */ setStartValue(value) { this.setValue(value, true); } setCustomValidity(message) { const eInput = this.eInput; const isInvalid = message.length > 0; eInput.setCustomValidity(message); if (isInvalid) { eInput.reportValidity(); } _setAriaInvalid(eInput, isInvalid); } preventDisallowedCharacters() { const pattern = new RegExp(`[${this.config.allowedCharPattern}]`); const preventCharacters = (event) => { if (!_isEventFromPrintableCharacter(event)) { return; } if (event.key && !pattern.test(event.key)) { event.preventDefault(); } }; this.addManagedListeners(this.eInput, { keydown: preventCharacters, paste: (e) => { const text = e.clipboardData?.getData("text"); if (text?.split("").some((c) => !pattern.test(c))) { e.preventDefault(); } } }); } }; var AgInputTextFieldSelector = { selector: "AG-INPUT-TEXT-FIELD", component: AgInputTextField }; var AgInputDateField = class extends AgInputTextField { constructor(config) { super(config, "ag-date-field", "date"); } postConstruct() { super.postConstruct(); const usingSafari = _isBrowserSafari(); this.addManagedListeners(this.eInput, { wheel: this.onWheel.bind(this), mousedown: () => { if (this.isDisabled() || usingSafari) { return; } this.eInput.focus(); } }); this.eInput.step = "any"; } onWheel(e) { if (_getActiveDomElement(this.beans) === this.eInput) { e.preventDefault(); } } setMin(minDate) { const min = minDate instanceof Date ? _serialiseDate(minDate ?? null, !!this.includeTime) ?? void 0 : minDate; if (this.min === min) { return this; } this.min = min; _addOrRemoveAttribute(this.eInput, "min", min); return this; } setMax(maxDate) { const max = maxDate instanceof Date ? _serialiseDate(maxDate ?? null, !!this.includeTime) ?? void 0 : maxDate; if (this.max === max) { return this; } this.max = max; _addOrRemoveAttribute(this.eInput, "max", max); return this; } setStep(step) { if (this.step === step) { return this; } this.step = step; _addOrRemoveAttribute(this.eInput, "step", step); return this; } setIncludeTime(includeTime) { if (this.includeTime === includeTime) { return this; } this.includeTime = includeTime; super.setInputType(includeTime ? "datetime-local" : "date"); if (includeTime) { this.setStep(1); } return this; } getDate() { if (!this.eInput.validity.valid) { return void 0; } return _parseDateTimeFromString(this.getValue()) ?? void 0; } setDate(date, silent) { this.setValue(_serialiseDate(date ?? null, this.includeTime), silent); } }; var AgInputDateFieldSelector = { selector: "AG-INPUT-DATE-FIELD", component: AgInputDateField }; var SimpleCellEditor = class extends AgAbstractCellEditor { constructor(cellEditorInput) { super(); this.cellEditorInput = cellEditorInput; this.eEditor = RefPlaceholder; } initialiseEditor(params) { const { cellEditorInput } = this; this.setTemplate( { tag: "div", cls: "ag-cell-edit-wrapper", children: [cellEditorInput.getTemplate()] }, cellEditorInput.getAgComponents() ); const { eEditor } = this; const { cellStartedEdit, eventKey, suppressPreventDefault } = params; eEditor.getInputElement().setAttribute("title", ""); cellEditorInput.init(eEditor, params); let startValue; let shouldSetStartValue = true; if (cellStartedEdit) { this.focusAfterAttached = true; if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) { startValue = ""; } else if (eventKey && eventKey.length === 1) { if (suppressPreventDefault) { shouldSetStartValue = false; } else { startValue = eventKey; } } else { startValue = cellEditorInput.getStartValue(); if (eventKey !== KeyCode.F2) { this.highlightAllOnFocus = true; } } } else { this.focusAfterAttached = false; startValue = cellEditorInput.getStartValue(); } if (shouldSetStartValue && startValue != null) { eEditor.setStartValue(startValue); } this.addGuiEventListener("keydown", (event) => { const { key } = event; if (key === KeyCode.PAGE_UP || key === KeyCode.PAGE_DOWN) { event.preventDefault(); } }); } afterGuiAttached() { const translate = this.getLocaleTextFunc(); const eInput = this.eEditor; eInput.setInputAriaLabel(translate("ariaInputEditor", "Input Editor")); if (!this.focusAfterAttached) { return; } if (!_isBrowserSafari()) { eInput.getFocusableElement().focus(); } const inputEl = eInput.getInputElement(); if (this.highlightAllOnFocus) { inputEl.select(); } else { this.cellEditorInput.setCaret?.(); } } // gets called when tabbing through cells and in full row edit mode focusIn() { const { eEditor } = this; const focusEl = eEditor.getFocusableElement(); const inputEl = eEditor.getInputElement(); focusEl.focus(); inputEl.select(); } getValue() { return this.cellEditorInput.getValue(); } agSetEditValue(value) { this.params.value = value; const startValue = this.cellEditorInput.getStartValue(); this.eEditor.setStartValue(startValue ?? null); } isPopup() { return false; } getValidationElement() { return this.eEditor.getInputElement(); } getValidationErrors() { return this.cellEditorInput.getValidationErrors(); } }; var DateCellElement = { tag: "ag-input-date-field", ref: "eEditor", cls: "ag-cell-editor" }; var DateCellEditorInput = class { constructor(getDataTypeService, getLocaleTextFunc) { this.getDataTypeService = getDataTypeService; this.getLocaleTextFunc = getLocaleTextFunc; } getTemplate() { return DateCellElement; } getAgComponents() { return [AgInputDateFieldSelector]; } init(eEditor, params) { this.eEditor = eEditor; this.params = params; const { min, max, step, colDef } = params; if (min != null) { eEditor.setMin(min); } if (max != null) { eEditor.setMax(max); } if (step != null) { eEditor.setStep(step); } this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType); if (this.includeTime != null) { eEditor.setIncludeTime(this.includeTime); } } getValidationErrors() { const eInput = this.eEditor.getInputElement(); const value = eInput.valueAsDate; const { params } = this; const { min, max, getValidationErrors } = params; let internalErrors = []; const translate = this.getLocaleTextFunc(); if (value instanceof Date && !isNaN(value.getTime())) { if (min) { const minValue = min instanceof Date ? min : new Date(min); if (value < minValue) { const minDateString = minValue.toLocaleDateString(); internalErrors.push( translate("minDateValidation", `Date must be after ${minDateString}`, [minDateString]) ); } } if (max) { const maxValue = max instanceof Date ? max : new Date(max); if (value > maxValue) { const maxDateString = maxValue.toLocaleDateString(); internalErrors.push( translate("maxDateValidation", `Date must be before ${maxDateString}`, [maxDateString]) ); } } } if (!internalErrors.length) { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value, cellEditorParams: params, internalErrors }); } return internalErrors; } getValue() { const { eEditor, params } = this; const value = eEditor.getDate(); if (!_exists(value) && !_exists(params.value)) { return params.value; } return value ?? null; } getStartValue() { const { value } = this.params; if (!(value instanceof Date)) { return void 0; } return _serialiseDate(value, this.includeTime ?? false); } }; var DateCellEditor = class extends SimpleCellEditor { constructor() { super( new DateCellEditorInput( () => this.beans.dataTypeSvc, () => this.getLocaleTextFunc() ) ); } }; var DateStringCellElement = { tag: "ag-input-date-field", ref: "eEditor", cls: "ag-cell-editor" }; var DateStringCellEditorInput = class { constructor(getDataTypeService, getLocaleTextFunc) { this.getDataTypeService = getDataTypeService; this.getLocaleTextFunc = getLocaleTextFunc; } getTemplate() { return DateStringCellElement; } getAgComponents() { return [AgInputDateFieldSelector]; } init(eEditor, params) { this.eEditor = eEditor; this.params = params; const { min, max, step, colDef } = params; if (min != null) { eEditor.setMin(min); } if (max != null) { eEditor.setMax(max); } if (step != null) { eEditor.setStep(step); } this.includeTime = params.includeTime ?? this.getDataTypeService()?.getDateIncludesTimeFlag?.(colDef.cellDataType); if (this.includeTime != null) { eEditor.setIncludeTime(this.includeTime); } } getValidationErrors() { const { eEditor, params } = this; const raw = eEditor.getInputElement().value; const value = this.formatDate(this.parseDate(raw ?? void 0)); const { min, max, getValidationErrors } = params; let internalErrors = []; if (value) { const date = new Date(value); const translate = this.getLocaleTextFunc(); if (min) { const minDate = new Date(min); if (date < minDate) { const minDateString = minDate.toLocaleDateString(); internalErrors.push( translate("minDateValidation", `Date must be after ${minDateString}`, [minDateString]) ); } } if (max) { const maxDate = new Date(max); if (date > maxDate) { const maxDateString = maxDate.toLocaleDateString(); internalErrors.push( translate("maxDateValidation", `Date must be before ${maxDateString}`, [maxDateString]) ); } } } if (!internalErrors.length) { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value: this.getValue(), cellEditorParams: params, internalErrors }); } return internalErrors; } getValue() { const { params, eEditor } = this; const value = this.formatDate(eEditor.getDate()); if (!_exists(value) && !_exists(params.value)) { return params.value; } return params.parseValue(value ?? ""); } getStartValue() { return _serialiseDate(this.parseDate(this.params.value ?? void 0) ?? null, this.includeTime ?? false); } parseDate(value) { const dataTypeSvc = this.getDataTypeService(); return dataTypeSvc ? dataTypeSvc.getDateParserFunction(this.params.column)(value) : _parseDateTimeFromString(value) ?? void 0; } formatDate(value) { const dataTypeSvc = this.getDataTypeService(); return dataTypeSvc ? dataTypeSvc.getDateFormatterFunction(this.params.column)(value) : _serialiseDate(value ?? null, this.includeTime ?? false) ?? void 0; } }; var DateStringCellEditor = class extends SimpleCellEditor { constructor() { super( new DateStringCellEditorInput( () => this.beans.dataTypeSvc, () => this.getLocaleTextFunc() ) ); } }; var AgInputTextArea = class extends AgAbstractInputField { constructor(config) { super(config, "ag-text-area", null, "textarea"); } setValue(value, silent) { const ret = super.setValue(value, silent); this.eInput.value = value; return ret; } setCols(cols) { this.eInput.cols = cols; return this; } setRows(rows) { this.eInput.rows = rows; return this; } }; var AgInputTextAreaSelector = { selector: "AG-INPUT-TEXT-AREA", component: AgInputTextArea }; var LargeTextCellElement = { tag: "div", cls: "ag-large-text", children: [ { tag: "ag-input-text-area", ref: "eEditor", cls: "ag-large-text-input" } ] }; var LargeTextCellEditor = class extends AgAbstractCellEditor { constructor() { super(LargeTextCellElement, [AgInputTextAreaSelector]); this.eEditor = RefPlaceholder; } initialiseEditor(params) { const { eEditor } = this; const { cellStartedEdit, eventKey, maxLength, cols, rows } = params; this.focusAfterAttached = cellStartedEdit; eEditor.getInputElement().setAttribute("title", ""); eEditor.setMaxLength(maxLength || 200).setCols(cols || 60).setRows(rows || 10); let startValue; if (cellStartedEdit) { this.focusAfterAttached = true; if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) { startValue = ""; } else if (eventKey && eventKey.length === 1) { startValue = eventKey; } else { startValue = this.getStartValue(params); if (eventKey !== KeyCode.F2) { this.highlightAllOnFocus = true; } } } else { this.focusAfterAttached = false; startValue = this.getStartValue(params); } if (startValue != null) { eEditor.setValue(startValue, true); } this.addGuiEventListener("keydown", this.onKeyDown.bind(this)); this.activateTabIndex(); } getStartValue(params) { const { value } = params; return value?.toString() ?? value; } agSetEditValue(value) { this.params.value = value; const startValue = this.getStartValue(this.params); this.eEditor.setValue(startValue ?? "", true); } onKeyDown(event) { const key = event.key; if (key === KeyCode.LEFT || key === KeyCode.UP || key === KeyCode.RIGHT || key === KeyCode.DOWN || event.shiftKey && key === KeyCode.ENTER) { event.stopPropagation(); } } afterGuiAttached() { const { eEditor, focusAfterAttached, highlightAllOnFocus } = this; const translate = this.getLocaleTextFunc(); eEditor.setInputAriaLabel(translate("ariaInputEditor", "Input Editor")); if (focusAfterAttached) { eEditor.getFocusableElement().focus(); if (highlightAllOnFocus) { eEditor.getInputElement().select(); } } } getValue() { const { eEditor, params } = this; const { value } = params; const editorValue = eEditor.getValue(); if (!_exists(editorValue) && !_exists(value)) { return value; } return params.parseValue(editorValue); } getValidationElement() { return this.eEditor.getInputElement(); } getValidationErrors() { const { params } = this; const { maxLength, getValidationErrors } = params; const translate = this.getLocaleTextFunc(); const value = this.getValue(); let internalErrors = []; if (typeof value === "string" && maxLength != null && value.length > maxLength) { internalErrors.push( translate("maxLengthValidation", `Must be ${maxLength} characters or fewer.`, [String(maxLength)]) ); } if (!internalErrors.length) { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value, internalErrors, cellEditorParams: params }); } return internalErrors; } }; var AgInputNumberField = class extends AgInputTextField { constructor(config) { super(config, "ag-number-field", "number"); } postConstruct() { super.postConstruct(); const eInput = this.eInput; this.addManagedListeners(eInput, { blur: () => { const floatedValue = Number.parseFloat(eInput.value); const value = isNaN(floatedValue) ? "" : this.normalizeValue(floatedValue.toString()); if (this.value !== value) { this.setValue(value); } }, wheel: this.onWheel.bind(this) }); eInput.step = "any"; const { precision, min, max, step } = this.config; if (typeof precision === "number") { this.setPrecision(precision); } if (typeof min === "number") { this.setMin(min); } if (typeof max === "number") { this.setMax(max); } if (typeof step === "number") { this.setStep(step); } } onWheel(e) { if (_getActiveDomElement(this.beans) === this.eInput) { e.preventDefault(); } } normalizeValue(value) { if (value === "") { return ""; } if (this.precision != null) { value = this.adjustPrecision(value); } return value; } adjustPrecision(value, isScientificNotation) { const precision = this.precision; if (precision == null) { return value; } if (isScientificNotation) { const floatString = Number.parseFloat(value).toFixed(precision); return Number.parseFloat(floatString).toString(); } const parts = String(value).split("."); if (parts.length > 1) { if (parts[1].length <= precision) { return value; } else if (precision > 0) { return `${parts[0]}.${parts[1].slice(0, precision)}`; } } return parts[0]; } setMin(min) { if (this.min === min) { return this; } this.min = min; _addOrRemoveAttribute(this.eInput, "min", min); return this; } setMax(max) { if (this.max === max) { return this; } this.max = max; _addOrRemoveAttribute(this.eInput, "max", max); return this; } setPrecision(precision) { this.precision = precision; return this; } setStep(step) { if (this.step === step) { return this; } this.step = step; _addOrRemoveAttribute(this.eInput, "step", step); return this; } setValue(value, silent) { return this.setValueOrInputValue( (v) => super.setValue(v, silent), () => this, value ); } setStartValue(value) { return this.setValueOrInputValue( (v) => super.setValue(v, true), (v) => { this.eInput.value = v; }, value ); } setValueOrInputValue(setValueFunc, setInputValueOnlyFunc, value) { if (_exists(value)) { let setInputValueOnly = this.isScientificNotation(value); if (setInputValueOnly && this.eInput.validity.valid) { return setValueFunc(value); } if (!setInputValueOnly) { value = this.adjustPrecision(value); const normalizedValue = this.normalizeValue(value); setInputValueOnly = value != normalizedValue; } if (setInputValueOnly) { return setInputValueOnlyFunc(value); } } return setValueFunc(value); } getValue(ignoreValidity = false) { const eInput = this.eInput; if (!eInput.validity.valid && !ignoreValidity) { return void 0; } const inputValue = eInput.value; if (this.isScientificNotation(inputValue)) { return this.adjustPrecision(inputValue, true); } return super.getValue(); } isScientificNotation(value) { return typeof value === "string" && value.includes("e"); } }; var AgInputNumberFieldSelector = { selector: "AG-INPUT-NUMBER-FIELD", component: AgInputNumberField }; var NumberCellElement = { tag: "ag-input-number-field", ref: "eEditor", cls: "ag-cell-editor" }; var NumberCellEditorInput = class { constructor(getLocaleTextFunc) { this.getLocaleTextFunc = getLocaleTextFunc; } getTemplate() { return NumberCellElement; } getAgComponents() { return [AgInputNumberFieldSelector]; } init(eEditor, params) { this.eEditor = eEditor; this.params = params; const { max, min, precision, step } = params; if (max != null) { eEditor.setMax(max); } if (min != null) { eEditor.setMin(min); } if (precision != null) { eEditor.setPrecision(precision); } if (step != null) { eEditor.setStep(step); } const editorEl = eEditor.getInputElement(); if (params.preventStepping) { eEditor.addManagedElementListeners(editorEl, { keydown: this.preventStepping }); } else if (params.showStepperButtons) { editorEl.classList.add("ag-number-field-input-stepper"); } } getValidationErrors() { const { params } = this; const { min, max, getValidationErrors } = params; const eInput = this.eEditor.getInputElement(); const value = eInput.valueAsNumber; const translate = this.getLocaleTextFunc(); let internalErrors = []; if (typeof value === "number") { if (min != null && value < min) { internalErrors.push( translate("minValueValidation", `Must be greater than or equal to ${min}.`, [String(min)]) ); } if (max != null && value > max) { internalErrors.push( translate("maxValueValidation", `Must be less than or equal to ${max}.`, [String(max)]) ); } } if (!internalErrors.length) { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value, cellEditorParams: params, internalErrors }); } return internalErrors; } preventStepping(e) { if (e.key === KeyCode.UP || e.key === KeyCode.DOWN) { e.preventDefault(); } } getValue() { const { eEditor, params } = this; const value = eEditor.getValue(); if (!_exists(value) && !_exists(params.value)) { return params.value; } let parsedValue = params.parseValue(value); if (parsedValue == null) { return parsedValue; } if (typeof parsedValue === "string") { if (parsedValue === "") { return null; } parsedValue = Number(parsedValue); } return isNaN(parsedValue) ? null : parsedValue; } getStartValue() { return this.params.value; } setCaret() { if (_isBrowserSafari()) { this.eEditor.getInputElement().focus({ preventScroll: true }); } } }; var NumberCellEditor = class extends SimpleCellEditor { constructor() { super(new NumberCellEditorInput(() => this.getLocaleTextFunc())); } }; var agList_default = ".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}"; var ACTIVE_CLASS = "ag-active-item"; var getAgListElement = (cssIdentifier, label) => ({ tag: "div", cls: `ag-list-item ag-${cssIdentifier}-list-item`, attrs: { role: "option" }, children: [ { tag: "span", cls: `ag-list-item-text ag-${cssIdentifier}-list-item-text`, ref: "eText", children: label } ] }); var AgListItem = class extends AgComponentStub { constructor(cssIdentifier, label, value) { super(getAgListElement(cssIdentifier, label)); this.label = label; this.value = value; this.eText = RefPlaceholder; } postConstruct() { this.createTooltip(); this.addEventListeners(); } setHighlighted(highlighted) { const eGui = this.getGui(); eGui.classList.toggle(ACTIVE_CLASS, highlighted); _setAriaSelected(eGui, highlighted); this.dispatchLocalEvent({ type: "itemHighlighted", highlighted }); } getHeight() { return this.getGui().clientHeight; } setIndex(idx, setSize) { const eGui = this.getGui(); _setAriaPosInSet(eGui, idx); _setAriaSetSize(eGui, setSize); } createTooltip() { const tooltipCtrl = { getTooltipValue: () => this.label, getGui: () => this.getGui(), getLocation: () => "UNKNOWN", // only show tooltips for items where the text cannot be fully displayed shouldDisplayTooltip: () => _isHorizontalScrollShowing(this.eText) }; const tooltipFeature = this.createOptionalManagedBean( this.beans.registry.createDynamicBean( "highlightTooltipFeature", false, tooltipCtrl, this ) ); if (tooltipFeature) { this.tooltipFeature = tooltipFeature; } } addEventListeners() { const parentComponent = this.getParentComponent(); if (!parentComponent) { return; } this.addGuiEventListener("mouseover", () => { parentComponent.highlightItem(this); }); this.addGuiEventListener("mousedown", (e) => { e.preventDefault(); e.stopPropagation(); parentComponent.setValue(this.value); }); } }; var AgList = class extends AgComponentStub { constructor(cssIdentifier = "default") { super({ tag: "div", cls: `ag-list ag-${cssIdentifier}-list` }); this.cssIdentifier = cssIdentifier; this.options = []; this.listItems = []; this.highlightedItem = null; this.registerCSS(agList_default); } postConstruct() { const eGui = this.getGui(); this.addManagedElementListeners(eGui, { mouseleave: () => this.clearHighlighted() }); } handleKeyDown(e) { const key = e.key; switch (key) { case KeyCode.ENTER: if (!this.highlightedItem) { this.setValue(this.getValue()); } else { const pos = this.listItems.indexOf(this.highlightedItem); this.setValueByIndex(pos); } break; case KeyCode.DOWN: case KeyCode.UP: e.preventDefault(); this.navigate(key); break; case KeyCode.PAGE_DOWN: case KeyCode.PAGE_UP: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: e.preventDefault(); this.navigateToPage(key); break; } } addOptions(listOptions) { for (const listOption of listOptions) { this.addOption(listOption); } return this; } addOption(listOption) { const { value, text } = listOption; const valueToRender = text ?? value; this.options.push({ value, text: valueToRender }); this.renderOption(value, valueToRender); this.updateIndices(); return this; } clearOptions() { this.options = []; this.reset(true); for (const item of this.listItems) { item.destroy(); } _clearElement(this.getGui()); this.listItems = []; this.refreshAriaRole(); } updateOptions(listOptions) { const needsUpdate = this.options !== listOptions; if (needsUpdate) { this.clearOptions(); this.addOptions(listOptions); } return needsUpdate; } setValue(value, silent) { if (this.value === value) { this.fireItemSelected(); return this; } if (value == null) { this.reset(silent); return this; } const idx = this.options.findIndex((option) => option.value === value); if (idx !== -1) { const option = this.options[idx]; this.value = option.value; this.displayValue = option.text; this.highlightItem(this.listItems[idx]); if (!silent) { this.fireChangeEvent(); } } return this; } setValueByIndex(idx) { return this.setValue(this.options[idx].value); } getValue() { return this.value; } getDisplayValue() { return this.displayValue; } refreshHighlighted() { this.clearHighlighted(); const idx = this.options.findIndex((option) => option.value === this.value); if (idx !== -1) { this.highlightItem(this.listItems[idx]); } } highlightItem(item) { const itemEl = item.getGui(); if (!_isVisible(itemEl)) { return; } this.clearHighlighted(); item.setHighlighted(true); this.highlightedItem = item; const eGui = this.getGui(); const { scrollTop, clientHeight } = eGui; const { offsetTop, offsetHeight } = itemEl; if (offsetTop + offsetHeight > scrollTop + clientHeight || offsetTop < scrollTop) { itemEl.scrollIntoView({ block: "nearest" }); } } hideItemTooltip() { this.highlightedItem?.tooltipFeature?.attemptToHideTooltip(); } destroy() { this.hideItemTooltip(); super.destroy(); } reset(silent) { this.value = null; this.displayValue = null; this.clearHighlighted(); if (!silent) { this.fireChangeEvent(); } } clearHighlighted() { this.highlightedItem?.setHighlighted(false); this.highlightedItem = null; } renderOption(value, text) { const item = new AgListItem(this.cssIdentifier, text, value); item.setParentComponent(this); const listItem = this.createManagedBean(item); this.listItems.push(listItem); this.getGui().appendChild(listItem.getGui()); } navigate(key) { const isDown = key === KeyCode.DOWN; let itemToHighlight; const { listItems, highlightedItem } = this; if (!highlightedItem) { itemToHighlight = isDown ? listItems[0] : _last(listItems); } else { const currentIdx = listItems.indexOf(highlightedItem); let nextPos = currentIdx + (isDown ? 1 : -1); nextPos = Math.min(Math.max(nextPos, 0), listItems.length - 1); itemToHighlight = listItems[nextPos]; } this.highlightItem(itemToHighlight); } navigateToPage(key) { const { listItems, highlightedItem } = this; if (!highlightedItem || listItems.length === 0) { return; } const currentIdx = listItems.indexOf(highlightedItem); const rowCount = this.options.length - 1; const itemHeight = listItems[0].getHeight(); const pageSize = Math.floor(this.getGui().clientHeight / itemHeight); let newIndex = -1; if (key === KeyCode.PAGE_HOME) { newIndex = 0; } else if (key === KeyCode.PAGE_END) { newIndex = rowCount; } else if (key === KeyCode.PAGE_DOWN) { newIndex = Math.min(currentIdx + pageSize, rowCount); } else if (key === KeyCode.PAGE_UP) { newIndex = Math.max(currentIdx - pageSize, 0); } if (newIndex === -1) { return; } this.highlightItem(listItems[newIndex]); } refreshAriaRole() { _setAriaRole(this.getGui(), this.options.length === 0 ? "presentation" : "listbox"); } updateIndices() { this.refreshAriaRole(); const listItems = this.listItems; const len = listItems.length; listItems.forEach((item, idx) => { item.setIndex(idx + 1, len); }); } fireChangeEvent() { this.dispatchLocalEvent({ type: "fieldValueChanged" }); this.fireItemSelected(); } fireItemSelected() { this.dispatchLocalEvent({ type: "selectedItem" }); } }; var agPickerField_default = ".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}"; var AgPickerFieldElement = { tag: "div", cls: "ag-picker-field", role: "presentation", children: [ { tag: "div", ref: "eLabel" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-picker-field-wrapper ag-picker-collapsed", children: [ { tag: "div", ref: "eDisplayField", cls: "ag-picker-field-display" }, { tag: "div", ref: "eIcon", cls: "ag-picker-field-icon", attrs: { "aria-hidden": "true" } } ] } ] }; var AgPickerField = class extends AgAbstractField { constructor(config) { super(config, config?.template || AgPickerFieldElement, config?.agComponents || [], config?.className); this.isPickerDisplayed = false; this.skipClick = false; this.pickerGap = 4; this.hideCurrentPicker = null; this.eLabel = RefPlaceholder; this.eWrapper = RefPlaceholder; this.eDisplayField = RefPlaceholder; this.eIcon = RefPlaceholder; this.registerCSS(agPickerField_default); this.ariaRole = config?.ariaRole; this.onPickerFocusIn = this.onPickerFocusIn.bind(this); this.onPickerFocusOut = this.onPickerFocusOut.bind(this); if (!config) { return; } const { pickerGap, maxPickerHeight, variableWidth, minPickerWidth, maxPickerWidth } = config; if (pickerGap != null) { this.pickerGap = pickerGap; } this.variableWidth = !!variableWidth; if (maxPickerHeight != null) { this.setPickerMaxHeight(maxPickerHeight); } if (minPickerWidth != null) { this.setPickerMinWidth(minPickerWidth); } if (maxPickerWidth != null) { this.setPickerMaxWidth(maxPickerWidth); } } postConstruct() { super.postConstruct(); this.setupAria(); const displayId = `ag-${this.getCompId()}-display`; this.eDisplayField.setAttribute("id", displayId); const ariaEl = this.getAriaElement(); this.addManagedElementListeners(ariaEl, { keydown: this.onKeyDown.bind(this) }); this.addManagedElementListeners(this.eLabel, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) }); this.addManagedElementListeners(this.eWrapper, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) }); const { pickerIcon, inputWidth } = this.config; if (pickerIcon) { const icon = this.beans.iconSvc.createIconNoSpan(pickerIcon); if (icon) { this.eIcon.appendChild(icon); } } if (inputWidth != null) { this.setInputWidth(inputWidth); } } setupAria() { const ariaEl = this.getAriaElement(); ariaEl.setAttribute("tabindex", this.gos.get("tabIndex").toString()); _setAriaExpanded(ariaEl, false); if (this.ariaRole) { _setAriaRole(ariaEl, this.ariaRole); } } onLabelOrWrapperMouseDown(e) { if (e) { const focusableEl = this.getFocusableElement(); if (focusableEl !== this.eWrapper && e?.target === focusableEl) { return; } e.preventDefault(); this.getFocusableElement().focus(); } if (this.skipClick) { this.skipClick = false; return; } if (this.isDisabled()) { return; } if (this.isPickerDisplayed) { this.hidePicker(); } else { this.showPicker(); } } onKeyDown(e) { switch (e.key) { case KeyCode.UP: case KeyCode.DOWN: case KeyCode.ENTER: case KeyCode.SPACE: e.preventDefault(); this.onLabelOrWrapperMouseDown(); break; case KeyCode.ESCAPE: if (this.isPickerDisplayed) { e.preventDefault(); e.stopPropagation(); if (this.hideCurrentPicker) { this.hideCurrentPicker(); } } break; } } showPicker() { this.isPickerDisplayed = true; if (!this.pickerComponent) { this.pickerComponent = this.createPickerComponent(); } const pickerGui = this.pickerComponent.getGui(); pickerGui.addEventListener("focusin", this.onPickerFocusIn); pickerGui.addEventListener("focusout", this.onPickerFocusOut); this.hideCurrentPicker = this.renderAndPositionPicker(); this.toggleExpandedStyles(true); } renderAndPositionPicker() { const ePicker = this.pickerComponent.getGui(); if (!this.gos.get("suppressScrollWhenPopupsAreOpen")) { [this.destroyMouseWheelFunc] = this.addManagedEventListeners({ bodyScroll: () => { this.hidePicker(); } }); } const translate = this.getLocaleTextFunc(); const { config: { pickerAriaLabelKey, pickerAriaLabelValue, modalPicker = true }, maxPickerHeight, minPickerWidth, maxPickerWidth, variableWidth, beans, eWrapper } = this; const popupParams = { modal: modalPicker, eChild: ePicker, closeOnEsc: true, closedCallback: () => { const shouldRestoreFocus = _isNothingFocused(beans); this.beforeHidePicker(); if (shouldRestoreFocus && this.isAlive()) { this.getFocusableElement().focus(); } }, ariaLabel: translate(pickerAriaLabelKey, pickerAriaLabelValue), anchorToElement: eWrapper }; ePicker.style.position = "absolute"; const popupSvc = beans.popupSvc; const addPopupRes = popupSvc.addPopup(popupParams); if (variableWidth) { if (minPickerWidth) { ePicker.style.minWidth = minPickerWidth; } ePicker.style.width = _formatSize(_getAbsoluteWidth(eWrapper)); if (maxPickerWidth) { ePicker.style.maxWidth = maxPickerWidth; } } else { _setElementWidth(ePicker, maxPickerWidth ?? _getAbsoluteWidth(eWrapper)); } const maxHeight = maxPickerHeight ?? `${_getInnerHeight(popupSvc.getPopupParent())}px`; ePicker.style.setProperty("max-height", maxHeight); this.alignPickerToComponent(); return addPopupRes.hideFunc; } alignPickerToComponent() { if (!this.pickerComponent) { return; } const { pickerGap, config: { pickerType }, beans: { popupSvc, gos }, eWrapper, pickerComponent } = this; const alignSide = gos.get("enableRtl") ? "right" : "left"; popupSvc.positionPopupByComponent({ type: pickerType, eventSource: eWrapper, ePopup: pickerComponent.getGui(), position: "under", alignSide, keepWithinBounds: true, nudgeY: pickerGap }); } beforeHidePicker() { if (this.destroyMouseWheelFunc) { this.destroyMouseWheelFunc(); this.destroyMouseWheelFunc = void 0; } this.toggleExpandedStyles(false); const pickerGui = this.pickerComponent.getGui(); pickerGui.removeEventListener("focusin", this.onPickerFocusIn); pickerGui.removeEventListener("focusout", this.onPickerFocusOut); this.isPickerDisplayed = false; this.pickerComponent = void 0; this.hideCurrentPicker = null; } toggleExpandedStyles(expanded) { if (!this.isAlive()) { return; } const ariaEl = this.getAriaElement(); _setAriaExpanded(ariaEl, expanded); const classList = this.eWrapper.classList; classList.toggle("ag-picker-expanded", expanded); classList.toggle("ag-picker-collapsed", !expanded); } onPickerFocusIn() { this.togglePickerHasFocus(true); } onPickerFocusOut(e) { if (!this.pickerComponent?.getGui().contains(e.relatedTarget)) { this.togglePickerHasFocus(false); } } togglePickerHasFocus(focused) { if (!this.pickerComponent) { return; } this.eWrapper.classList.toggle("ag-picker-has-focus", focused); } hidePicker() { if (this.hideCurrentPicker) { this.hideCurrentPicker(); this.dispatchLocalEvent({ type: "pickerHidden" }); } } setInputWidth(width) { _setElementWidth(this.eWrapper, width); return this; } getFocusableElement() { return this.eWrapper; } setPickerGap(gap) { this.pickerGap = gap; return this; } setPickerMinWidth(width) { if (typeof width === "number") { width = `${width}px`; } this.minPickerWidth = width == null ? void 0 : width; return this; } setPickerMaxWidth(width) { if (typeof width === "number") { width = `${width}px`; } this.maxPickerWidth = width == null ? void 0 : width; return this; } setPickerMaxHeight(height) { if (typeof height === "number") { height = `${height}px`; } this.maxPickerHeight = height == null ? void 0 : height; return this; } destroy() { this.hidePicker(); super.destroy(); } }; var agSelect_default = ".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"; var AgSelect = class extends AgPickerField { constructor(config) { super({ pickerAriaLabelKey: "ariaLabelSelectField", pickerAriaLabelValue: "Select Field", pickerType: "ag-list", className: "ag-select", pickerIcon: "selectOpen", ariaRole: "combobox", ...config }); this.registerCSS(agSelect_default); } postConstruct() { this.tooltipFeature = this.createOptionalManagedBean( this.beans.registry.createDynamicBean( "tooltipFeature", false, { shouldDisplayTooltip: _isElementOverflowingCallback(() => this.eDisplayField), getGui: () => this.getGui() } ) ); super.postConstruct(); this.createListComponent(); this.eWrapper.tabIndex = this.gos.get("tabIndex"); const { options, value, placeholder } = this.config; if (options != null) { this.addOptions(options); } if (value != null) { this.setValue(value, true); } if (placeholder && value == null) { this.eDisplayField.textContent = placeholder; } this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) }); } onWrapperFocusOut(e) { if (!this.eWrapper.contains(e.relatedTarget)) { this.hidePicker(); } } createListComponent() { const listComponent = this.createBean( new AgList("select") ); this.listComponent = listComponent; listComponent.setParentComponent(this); const eListAriaEl = listComponent.getAriaElement(); const listId = `ag-select-list-${listComponent.getCompId()}`; eListAriaEl.setAttribute("id", listId); _setAriaControlsAndLabel(this.getAriaElement(), eListAriaEl); listComponent.addManagedElementListeners(listComponent.getGui(), { mousedown: (e) => { e?.preventDefault(); } }); listComponent.addManagedListeners(listComponent, { selectedItem: () => { this.hidePicker(); this.dispatchLocalEvent({ type: "selectedItem" }); }, fieldValueChanged: () => { if (!this.listComponent) { return; } this.setValue(this.listComponent.getValue(), false, true); this.hidePicker(); } }); } createPickerComponent() { return this.listComponent; } beforeHidePicker() { this.listComponent?.hideItemTooltip(); super.beforeHidePicker(); } onKeyDown(e) { const { key } = e; if (key === KeyCode.TAB) { this.hidePicker(); } switch (key) { case KeyCode.ENTER: case KeyCode.UP: case KeyCode.DOWN: case KeyCode.PAGE_UP: case KeyCode.PAGE_DOWN: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: e.preventDefault(); if (this.isPickerDisplayed) { this.listComponent?.handleKeyDown(e); } else { super.onKeyDown(e); } break; case KeyCode.ESCAPE: super.onKeyDown(e); break; case KeyCode.SPACE: if (this.isPickerDisplayed) { e.preventDefault(); } else { super.onKeyDown(e); } break; } } showPicker() { const listComponent = this.listComponent; if (!listComponent) { return; } super.showPicker(); listComponent.refreshHighlighted(); } addOptions(options) { for (const option of options) { this.addOption(option); } return this; } addOption(option) { this.listComponent.addOption(option); return this; } clearOptions() { this.listComponent?.clearOptions(); this.setValue(void 0, true); return this; } updateOptions(options) { if (this.listComponent?.updateOptions(options)) { this.setValue(void 0, true); } return this; } setValue(value, silent, fromPicker) { const { listComponent, config: { placeholder }, eDisplayField, tooltipFeature } = this; if (this.value === value || !listComponent) { return this; } if (!fromPicker) { listComponent.setValue(value, true); } const newValue = listComponent.getValue(); if (newValue === this.getValue()) { return this; } let displayValue = listComponent.getDisplayValue(); if (displayValue == null && placeholder) { displayValue = placeholder; } eDisplayField.textContent = displayValue; tooltipFeature?.setTooltipAndRefresh(displayValue ?? null); return super.setValue(value, silent); } destroy() { this.listComponent = this.destroyBean(this.listComponent); super.destroy(); } }; var AgSelectSelector = { selector: "AG-SELECT", component: AgSelect }; var SelectCellElement = { tag: "div", cls: "ag-cell-edit-wrapper", children: [ { tag: "ag-select", ref: "eEditor", cls: "ag-cell-editor" } ] }; var SelectCellEditor = class extends AgAbstractCellEditor { constructor() { super(SelectCellElement, [AgSelectSelector]); this.eEditor = RefPlaceholder; this.startedByEnter = false; } wireBeans(beans) { this.valueSvc = beans.valueSvc; } initialiseEditor(params) { this.focusAfterAttached = params.cellStartedEdit; const { eEditor, valueSvc, gos } = this; const { values, value, eventKey } = params; if (_missing(values)) { _warn(58); return; } this.startedByEnter = eventKey != null ? eventKey === KeyCode.ENTER : false; let hasValue = false; values.forEach((currentValue) => { const option = { value: currentValue }; const valueFormatted = valueSvc.formatValue(params.column, null, currentValue); const valueFormattedExits = valueFormatted !== null && valueFormatted !== void 0; option.text = valueFormattedExits ? valueFormatted : currentValue; eEditor.addOption(option); hasValue = hasValue || value === currentValue; }); if (hasValue) { eEditor.setValue(params.value ?? void 0, true); } else if (params.values.length) { eEditor.setValue(params.values[0], true); } const { valueListGap, valueListMaxWidth, valueListMaxHeight } = params; if (valueListGap != null) { eEditor.setPickerGap(valueListGap); } if (valueListMaxHeight != null) { eEditor.setPickerMaxHeight(valueListMaxHeight); } if (valueListMaxWidth != null) { eEditor.setPickerMaxWidth(valueListMaxWidth); } if (gos.get("editType") !== "fullRow") { this.addManagedListeners(this.eEditor, { selectedItem: () => params.stopEditing() }); } } afterGuiAttached() { if (this.focusAfterAttached) { this.eEditor.getFocusableElement().focus(); } if (this.startedByEnter) { setTimeout(() => { if (this.isAlive()) { this.eEditor.showPicker(); } }); } } focusIn() { this.eEditor.getFocusableElement().focus(); } agSetEditValue(value) { this.params.value = value; this.eEditor.setValue(value ?? void 0, true); } getValue() { return this.eEditor.getValue(); } isPopup() { return false; } getValidationElement() { return this.eEditor.getAriaElement(); } getValidationErrors() { const { params } = this; const { values, getValidationErrors } = params; const value = this.getValue(); let internalErrors = []; if (values && value != null && !values.includes(value)) { const translate = this.getLocaleTextFunc(); internalErrors.push(translate("invalidSelectionValidation", "Invalid selection.")); } else { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value, internalErrors, cellEditorParams: params }); } return internalErrors; } }; var TextCellEditorElement = { tag: "ag-input-text-field", ref: "eEditor", cls: "ag-cell-editor" }; var TextCellEditorInput = class { constructor(getLocaleTextFunc) { this.getLocaleTextFunc = getLocaleTextFunc; } getTemplate() { return TextCellEditorElement; } getAgComponents() { return [AgInputTextFieldSelector]; } init(eEditor, params) { this.eEditor = eEditor; this.params = params; const maxLength = params.maxLength; if (maxLength != null) { eEditor.setMaxLength(maxLength); } } getValidationErrors() { const { params } = this; const { maxLength, getValidationErrors } = params; const value = this.getValue(); const translate = this.getLocaleTextFunc(); let internalErrors = []; if (maxLength != null && typeof value === "string" && value.length > maxLength) { internalErrors.push( translate("maxLengthValidation", `Must be ${maxLength} characters or fewer.`, [String(maxLength)]) ); } if (!internalErrors.length) { internalErrors = null; } if (getValidationErrors) { return getValidationErrors({ value, cellEditorParams: params, internalErrors }); } return internalErrors; } getValue() { const { eEditor, params } = this; const value = eEditor.getValue(); if (!_exists(value) && !_exists(params.value)) { return params.value; } return params.parseValue(value); } getStartValue() { const params = this.params; const formatValue = params.useFormatter || params.column.getColDef().refData; return formatValue ? params.formatValue(params.value) : params.value; } setCaret() { if (_isBrowserSafari()) { this.eEditor.getInputElement().focus({ preventScroll: true }); } const eInput = this.eEditor; const value = eInput.getValue(); const len = _exists(value) && value.length || 0; if (len) { eInput.getInputElement().setSelectionRange(len, len); } } }; var TextCellEditor = class extends SimpleCellEditor { constructor() { super(new TextCellEditorInput(() => this.getLocaleTextFunc())); } }; function undoCellEditing(beans) { beans.undoRedo?.undo("api"); } function redoCellEditing(beans) { beans.undoRedo?.redo("api"); } function getEditRowValues(beans, rowNode) { return beans.editModelSvc?.getEditRowDataValue(rowNode, { checkSiblings: true }); } function getEditingCells(beans) { const edits = beans.editModelSvc?.getEditMap(); const positions = []; edits?.forEach((editRow, rowNode) => { const { rowIndex, rowPinned } = rowNode; editRow.forEach((editValue, column) => { const { editorValue, pendingValue, sourceValue: oldValue, state } = editValue; const diff = _sourceAndPendingDiffer(editValue); let newValue = editorValue ?? pendingValue; if (newValue === UNEDITED) { newValue = void 0; } const edit = { newValue, oldValue, state, column, colId: column.getColId(), colKey: column.getColId(), rowIndex, rowPinned }; const editing = state === "editing"; const changed = !editing && diff; if (editing || changed) { positions.push(edit); } }); }); return positions; } function stopEditing(beans, cancel = false) { const { editSvc } = beans; if (editSvc?.isBatchEditing()) { if (cancel) { for (const cellPosition of beans.editModelSvc?.getEditPositions() ?? []) { if (cellPosition.state === "editing") { editSvc.revertSingleCellEdit(cellPosition); } } } else { _syncFromEditors(beans, { persist: true }); } _destroyEditors(beans, void 0, { cancel }); } else { editSvc?.stopEditing(void 0, { cancel, source: "edit", forceStop: !cancel, forceCancel: cancel }); } } function isEditing(beans, cellPosition) { const cellCtrl = _getCellCtrl(beans, cellPosition); return !!beans.editSvc?.isEditing(cellCtrl); } function startEditingCell(beans, params) { const { key, colKey, rowIndex, rowPinned } = params; const { editSvc, colModel } = beans; const column = colModel.getCol(colKey); if (!column) { _warn(12, { colKey }); return; } const cellPosition = { rowIndex, rowPinned: rowPinned || null, column }; const rowNode = _getRowNode(beans, cellPosition); if (!rowNode) { _warn(290, { rowIndex, rowPinned }); return; } if (!editSvc?.isCellEditable({ rowNode, column }, "api")) { return; } const notPinned = rowPinned == null; if (notPinned) { ensureIndexVisible(beans, rowIndex); } ensureColumnVisible(beans, colKey); editSvc?.startEditing( { rowNode, column }, { event: key ? new KeyboardEvent("keydown", { key }) : void 0, source: "api", editable: true } ); } function validateEdit(beans) { return beans.editSvc?.validateEdit() || null; } function getCurrentUndoSize(beans) { return beans.undoRedo?.getCurrentUndoStackSize() ?? 0; } function getCurrentRedoSize(beans) { return beans.undoRedo?.getCurrentRedoStackSize() ?? 0; } var PopupEditorElement = { tag: "div", cls: "ag-popup-editor", attrs: { tabindex: "-1" } }; var PopupEditorWrapper = class extends AgPopupComponent { constructor(params) { super(PopupEditorElement); this.params = params; } postConstruct() { _setDomData(this.gos, this.getGui(), "popupEditorWrapper", true); this.addKeyDownListener(); } addKeyDownListener() { const eGui = this.getGui(); const params = this.params; const listener = (event) => { if (!_isUserSuppressingKeyboardEvent(this.gos, event, params.node, params.column, true)) { params.onKeyDown(event); } }; this.addManagedElementListeners(eGui, { keydown: listener }); } }; function shouldStartEditing(beans, { column }, event, cellStartedEdit, source = "ui") { if (event instanceof KeyboardEvent && (event.key === KeyCode.TAB || event.key === KeyCode.ENTER || event.key === KeyCode.F2 || event.key === KeyCode.BACKSPACE && cellStartedEdit)) { return true; } const extendingRange = event?.shiftKey && beans.rangeSvc?.getCellRanges().length != 0; if (extendingRange) { return false; } const colDef = column?.getColDef(); const clickCount = deriveClickCount(beans.gos, colDef); const type = event?.type; if (type === "click" && event?.detail === 1 && clickCount === 1) { return true; } if (type === "dblclick" && event?.detail === 2 && clickCount === 2) { return true; } if (source === "api") { return !!cellStartedEdit; } return false; } function deriveClickCount(gos, colDef) { if (gos.get("suppressClickEdit") === true) { return 0; } if (gos.get("singleClickEdit") === true) { return 1; } if (colDef?.singleClickEdit) { return 1; } return 2; } function existingEditing(beans, editPosition) { return beans.editModelSvc?.hasEdits(editPosition, { withOpenEditor: true }) ?? false; } function isCellEditable(beans, editPosition) { const column = editPosition.column; const rowNode = editPosition.rowNode; const colDef = column.getColDef(); if (!rowNode) { return existingEditing(beans, editPosition); } const editable = colDef.editable; if (rowNode.group && colDef.groupRowEditable != null) { if (beans.rowGroupingEditValueSvc?.isGroupCellEditable(rowNode, column)) { return true; } return existingEditing(beans, editPosition); } if (column.isColumnFunc(rowNode, editable)) { return true; } return existingEditing(beans, editPosition); } function isFullRowCellEditable(beans, position, source = "ui") { const editable = isCellEditable(beans, position); if (editable || source === "ui") { return editable; } const { rowNode, column } = position; for (const col of beans.colModel.getCols()) { if (col !== column && isCellEditable(beans, { rowNode, column: col })) { return true; } } return false; } var editHighlightFn = (edit, includeEditing = false) => { if (edit !== void 0) { return _sourceAndPendingDiffer(edit) || includeEditing && edit.state === "editing"; } }; function _hasEdits(beans, position, includeEditing = false) { return editHighlightFn(beans.editModelSvc?.getEdit(position), includeEditing); } var nodeHasLeafEdit = (children, editModelSvc, column) => { if (!children) { return; } for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; if (child.data) { const highlight = editHighlightFn(editModelSvc?.getEdit({ rowNode: child, column })) || editHighlightFn(editModelSvc?.getEdit({ rowNode: child.pinnedSibling, column })); if (highlight) { return true; } } if (nodeHasLeafEdit(child.childrenAfterGroup, editModelSvc, column)) { return true; } } }; function _hasLeafEdits(beans, position) { const { column, rowNode } = position; if (beans.gos.get("groupTotalRow") && !rowNode?.footer) { return false; } return nodeHasLeafEdit(rowNode?.childrenAfterGroup, beans.editModelSvc, column); } function _hasPinnedEdits(beans, { rowNode, column }) { rowNode = rowNode.pinnedSibling; if (!rowNode) { return; } return editHighlightFn( beans.editModelSvc?.getEdit({ rowNode, column }) ); } var CellEditStyleFeature = class extends BeanStub { constructor(cellCtrl, beans) { super(); this.cellCtrl = cellCtrl; this.beans = beans; this.editSvc = beans.editSvc; this.editModelSvc = beans.editModelSvc; } setComp(comp) { this.cellComp = comp; this.applyCellStyles(); } applyCellStyles() { const { cellCtrl, editSvc, beans } = this; if (editSvc?.isBatchEditing() && editSvc.isEditing()) { const state = _hasEdits(beans, cellCtrl) || _hasLeafEdits(beans, cellCtrl) || _hasPinnedEdits(beans, cellCtrl); this.applyBatchingStyle(state); } else { this.applyBatchingStyle(false); } const hasErrors = !!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl); this.cellComp.toggleCss("ag-cell-editing-error", hasErrors); } applyBatchingStyle(newState) { this.cellComp.toggleCss("ag-cell-editing", newState ?? false); this.cellComp.toggleCss("ag-cell-batch-edit", (newState && this.editSvc?.isBatchEditing()) ?? false); } }; var RowEditStyleFeature = class extends BeanStub { constructor(rowCtrl, beans) { super(); this.rowCtrl = rowCtrl; this.beans = beans; this.gos = beans.gos; this.editSvc = beans.editSvc; this.editModelSvc = beans.editModelSvc; } applyRowStyles() { const { rowCtrl, editModelSvc, beans } = this; let rowNode = rowCtrl.rowNode; let edits = editModelSvc?.getEditRow(rowNode); const hasErrors = this.editModelSvc?.getRowValidationModel().hasRowValidation({ rowNode }); if (!edits && rowNode.pinnedSibling) { rowNode = rowNode.pinnedSibling; edits = editModelSvc?.getEditRow(rowNode); } if (edits) { const editing = Array.from(edits.keys()).some((column) => { const position = { rowNode, column }; return _hasEdits(beans, position, true) || _hasLeafEdits(beans, position) || _hasPinnedEdits(beans, position); }); this.applyStyle(hasErrors, editing); return; } this.applyStyle(hasErrors); } applyStyle(hasErrors = false, editing = false) { const batchEdit = !!this.editSvc?.isBatchEditing(); const fullRow = this.gos.get("editType") === "fullRow"; this.rowCtrl?.forEachGui(void 0, ({ rowComp }) => { rowComp.toggleCss("ag-row-editing", fullRow && editing); rowComp.toggleCss("ag-row-batch-edit", fullRow && editing && batchEdit); rowComp.toggleCss("ag-row-inline-editing", editing); rowComp.toggleCss("ag-row-not-inline-editing", !editing); rowComp.toggleCss("ag-row-editing-invalid", fullRow && editing && hasErrors); }); } }; var purgeRows = ({ rowModel, pinnedRowModel, editModelSvc }, rowNodes) => { const found = /* @__PURE__ */ new Set(); rowModel.forEachNode((node) => rowNodes.has(node) && found.add(node)); pinnedRowModel?.forEachPinnedRow("top", (node) => rowNodes.has(node) && found.add(node)); pinnedRowModel?.forEachPinnedRow("bottom", (node) => rowNodes.has(node) && found.add(node)); for (const rowNode of rowNodes) { if (!found.has(rowNode)) { editModelSvc.removeEdits({ rowNode }); } } return found; }; var purgeCells = ({ editModelSvc }, rowNodes, columns) => { for (const rowNode of rowNodes) { editModelSvc?.getEditRow(rowNode)?.forEach((_, column) => !columns.has(column) && editModelSvc.removeEdits({ rowNode, column })); } }; var _refreshEditCells = (beans) => () => { const columns = new Set(beans.colModel.getCols()); const updates = beans.editModelSvc.getEditMap(true); const rowNodes = new Set(updates.keys()); purgeCells(beans, purgeRows(beans, rowNodes), columns); }; var KEEP_EDITOR_SOURCES = /* @__PURE__ */ new Set(["undo", "redo", "paste", "bulk", "rangeSvc"]); var INTERNAL_EDITOR_SOURCES = /* @__PURE__ */ new Set(["ui", "api"]); var STOP_EDIT_SOURCE_TRANSFORM = { paste: "api", rangeSvc: "api", fillHandle: "api", cellClear: "api", bulk: "api" }; var STOP_EDIT_SOURCE_TRANSFORM_KEYS = new Set(Object.keys(STOP_EDIT_SOURCE_TRANSFORM)); var SET_DATA_SOURCE_AS_API = /* @__PURE__ */ new Set(["paste", "rangeSvc", "cellClear", "redo", "undo"]); var CANCEL_PARAMS = { cancel: true, source: "api" }; var COMMIT_PARAMS = { cancel: false, source: "api" }; var CHECK_SIBLING = { checkSiblings: true }; var FORCE_REFRESH = { force: true, suppressFlash: true }; var FORCE_REFRESH_FLASH = { force: true }; var EditService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "editSvc"; this.committing = false; this.batch = false; this.batchStartDispatched = false; this.stopping = false; this.rangeSelectionWhileEditing = 0; } postConstruct() { const { beans } = this; this.model = beans.editModelSvc; this.valueSvc = beans.valueSvc; this.rangeSvc = beans.rangeSvc; this.addManagedPropertyListener("editType", ({ currentValue }) => { this.stopEditing(void 0, CANCEL_PARAMS); this.createStrategy(currentValue); }); const handler = _refreshEditCells(beans); const stopInvalidEdits = () => { const hasCellValidation = this.model.getCellValidationModel().getCellValidationMap().size > 0; const hasRowValidation = this.model.getRowValidationModel().getRowValidationMap().size > 0; if (hasCellValidation || hasRowValidation) { this.stopEditing(void 0, CANCEL_PARAMS); } else if (this.isEditing()) { if (this.batch) { _destroyEditors(beans, this.model.getEditPositions()); } else { this.stopEditing(void 0, COMMIT_PARAMS); } } return false; }; this.addManagedEventListeners({ columnPinned: handler, columnVisible: handler, columnRowGroupChanged: handler, rowExpansionStateChanged: handler, pinnedRowsChanged: handler, displayedRowsChanged: handler, sortChanged: stopInvalidEdits, filterChanged: stopInvalidEdits, cellFocused: this.onCellFocused.bind(this) }); } isBatchEditing() { return this.batch; } startBatchEditing() { if (this.batch) { return; } this.batch = true; this.batchStartDispatched = false; this.stopEditing(void 0, CANCEL_PARAMS); } stopBatchEditing(params) { if (!this.batch) { return; } if (params) { this.stopEditing(void 0, params); } if (this.batchStartDispatched) { this.dispatchBatchStopped(/* @__PURE__ */ new Map(), false); } this.batch = false; this.batchStartDispatched = false; } /** Lazily dispatch batchEditingStarted when the first write or editor open occurs during a batch session. */ ensureBatchStarted() { if (!this.batch || this.batchStartDispatched) { return; } this.batchStartDispatched = true; this.dispatchBatchEvent("batchEditingStarted", /* @__PURE__ */ new Map()); } createStrategy(editType) { const { beans, gos, strategy } = this; const name = getEditType(gos, editType); if (strategy) { if (strategy.beanName === name) { return strategy; } this.destroyStrategy(); } return this.strategy = this.createOptionalManagedBean( beans.registry.createDynamicBean(name, true) ); } destroyStrategy() { if (!this.strategy) { return; } this.strategy.destroy(); this.strategy = this.destroyBean(this.strategy); } shouldStartEditing(position, event, cellStartedEdit, source = "ui") { const shouldStart = shouldStartEditing(this.beans, position, event, cellStartedEdit, source); if (shouldStart) { this.strategy ?? (this.strategy = this.createStrategy()); } return shouldStart; } shouldStopEditing(position, event, source = "ui") { return this.strategy?.shouldStop(position, event, source) ?? null; } shouldCancelEditing(position, event, source = "ui") { return this.strategy?.shouldCancel(position, event, source) ?? null; } validateEdit() { return _validateEdit(this.beans); } isEditing(position, params) { return this.model.hasEdits(position ?? void 0, params ?? CHECK_SIBLING); } isRowEditing(rowNode, params) { return !!rowNode && this.model.hasRowEdits(rowNode, params); } enableRangeSelectionWhileEditing() { if (this.beans.rangeSvc && this.gos.get("cellSelection")) { this.rangeSelectionWhileEditing++; } } disableRangeSelectionWhileEditing() { this.rangeSelectionWhileEditing = Math.max(0, this.rangeSelectionWhileEditing - 1); } isRangeSelectionEnabledWhileEditing() { return this.rangeSelectionWhileEditing > 0; } /** @returns whether to prevent default on event */ startEditing(position, params) { const { startedEdit = true, event = null, source = "ui", ignoreEventKey = false, silent } = params; this.strategy ?? (this.strategy = this.createStrategy()); const editable = params.editable ?? this.isCellEditable(position, "api"); if (!editable) { return; } const cellCtrl = _getCellCtrl(this.beans, position); if (cellCtrl && !cellCtrl.comp) { params.editable = void 0; cellCtrl.onCompAttachedFuncs.push(() => this.startEditing(position, params)); return; } const res = this.shouldStartEditing(position, event, startedEdit, source); if (res === false && source !== "api") { if (this.isEditing(position)) { this.stopEditing(); } return; } if (!this.batch && this.shouldStopEditing(position, void 0, source) && !params.continueEditing) { this.stopEditing(void 0, { source }); } if (res) { this.ensureBatchStarted(); } this.strategy.start({ position, event, source, ignoreEventKey, startedEdit, silent }); } stopEditing(position, params) { const context = this.prepareStopContext(position, params); if (!context) { return false; } this.stopping = true; let res = false; let { edits } = context; try { const outcome = this.processStopRequest(context); res || (res = outcome.res); edits = outcome.edits; this.finishStopEditing({ ...context, edits, params, position, res }); return res; } finally { this.rangeSelectionWhileEditing = 0; this.stopping = false; } } prepareStopContext(position, params) { const { event = null, cancel = false, source = "ui", forceCancel = false, forceStop = false, commit = false } = params || {}; if (STOP_EDIT_SOURCE_TRANSFORM_KEYS.has(source) && this.batch) { if (position?.rowNode && position?.column) { this.bulkRefreshCell(position); } return null; } const treatAsSource = this.committing ? STOP_EDIT_SOURCE_TRANSFORM[source] : source; const isEditingOrBatchWithEdits = this.committing || this.isEditing(position) || this.batch && this.model.hasEdits(position, CHECK_SIBLING); if (!isEditingOrBatchWithEdits || !this.strategy || this.stopping) { return null; } const cellCtrl = _getCellCtrl(this.beans, position); if (cellCtrl) { cellCtrl.onEditorAttachedFuncs = []; } const willStop = !cancel && (!!this.shouldStopEditing(position, event, treatAsSource) || (this.committing || source === "paste") && !this.batch) || forceStop; const willCancel = cancel && !!this.shouldCancelEditing(position, event, treatAsSource) || forceCancel; return { cancel, cellCtrl, edits: this.model.getEditMap(true), event: event ?? null, forceCancel, forceStop, commit, position, source, treatAsSource, willCancel, willStop }; } processStopRequest(context) { const { event, position, willCancel, willStop } = context; if (willStop || willCancel) { return this.handleStopOrCancel(context); } if (this.shouldHandleMidBatchKey(event, position)) { return { res: false, edits: this.handleMidBatchKey(event, position, context) }; } _syncFromEditors(this.beans, { persist: true }); if (this.batch) { this.strategy?.cleanupEditors(position); } return { res: false, edits: this.model.getEditMap() }; } handleStopOrCancel(context) { const { beans, model } = this; const { cancel, commit, edits, event, source, willCancel, willStop } = context; const persist = !this.batch || !willCancel; _syncFromEditors(beans, { persist, isCancelling: willCancel || cancel, isStopping: willStop }); const freshEdits = model.getEditMap(); const shouldCommit = !willCancel && (!this.batch || commit); const editsToDelete = shouldCommit ? this.processEdits(freshEdits, source) : []; if (cancel) { this.strategy?.stopCancelled(context.forceCancel); } else { this.strategy?.stopCommitted(event, commit); } this.clearValidationIfNoOpenEditors(); for (const position of editsToDelete) { model.clearEditValue(position); } this.bulkRefreshMap(edits); for (const pos of model.getEditPositions(freshEdits)) { const cellCtrl = _getCellCtrl(beans, pos); const valueChanged = _sourceAndPendingDiffer(pos); cellCtrl?.refreshCell({ force: true, suppressFlash: !valueChanged }); } return { res: willStop, edits: freshEdits }; } shouldHandleMidBatchKey(event, position) { return event instanceof KeyboardEvent && this.batch && !!this.strategy?.midBatchInputsAllowed(position) && this.isEditing(position, { withOpenEditor: true }); } handleMidBatchKey(event, position, context) { const { beans, model } = this; const { cellCtrl, edits } = context; const { key } = event; const isEnter = key === KeyCode.ENTER; const isEscape = key === KeyCode.ESCAPE; const isTab = key === KeyCode.TAB; if (isEnter || isTab || isEscape) { if (isEnter || isTab) { _syncFromEditors(beans, { persist: true }); } else if (isEscape && cellCtrl) { const { rowNode, column } = cellCtrl; if (this.batch && rowNode && column) { const pos = { rowNode, column }; _destroyEditors(beans, [pos], { silent: true }); this.model.stop(pos, true, true); _getCellCtrl(beans, pos)?.refreshCell(FORCE_REFRESH); } else { this.revertSingleCellEdit(cellCtrl); } } if (this.batch) { this.strategy?.cleanupEditors(); } else { _destroyEditors(beans, model.getEditPositions(), { event, cancel: isEscape }); } event.preventDefault(); this.bulkRefreshMap(edits, { suppressFlash: true }); return model.getEditMap(); } return edits; } finishStopEditing({ cellCtrl, edits, params, position, res, commit, forceCancel, willCancel, willStop }) { const beans = this.beans; if (res && position) { if (!this.batch || commit) { this.model.removeEdits(position); } } this.navigateAfterEdit(params, cellCtrl?.cellPosition); _purgeUnchangedEdits(beans); this.clearValidationIfNoOpenEditors(); const { rowRenderer, formula } = beans; if (willCancel) { rowRenderer.refreshRows({ rowNodes: Array.from(edits.keys()) }); } if (this.batch) { if (formula) { formula.refreshFormulas(true); } else { rowRenderer.refreshRows({ suppressFlash: true, force: true }); } const batchCommit = willStop && commit; const batchCancel = willCancel && forceCancel; if (batchCommit || batchCancel) { this.dispatchBatchStopped(edits, batchCommit); } } } /** Dispatch batchEditingStopped if batchEditingStarted was (or should have been) dispatched. */ dispatchBatchStopped(edits, commit) { let eventEdits; if (commit) { eventEdits = _filterChangedEdits(edits); if (eventEdits.size > 0) { this.ensureBatchStarted(); } } if (this.batchStartDispatched) { this.batchStartDispatched = false; this.dispatchBatchEvent("batchEditingStopped", eventEdits ?? /* @__PURE__ */ new Map()); } } clearValidationIfNoOpenEditors() { const hasOpenEditors = this.model.hasEdits(void 0, { withOpenEditor: true }); if (!hasOpenEditors) { this.model.getCellValidationModel().clearCellValidationMap(); this.model.getRowValidationModel().clearRowValidationMap(); } } navigateAfterEdit(params, cellPosition) { if (!params || !cellPosition) { return; } const { event, suppressNavigateAfterEdit } = params; const isKeyBoardEvent = event instanceof KeyboardEvent; if (!isKeyBoardEvent || suppressNavigateAfterEdit) { return; } const { key, shiftKey } = event; const navAfterEdit = this.gos.get("enterNavigatesVerticallyAfterEdit"); if (key !== KeyCode.ENTER || !navAfterEdit) { return; } const direction = shiftKey ? KeyCode.UP : KeyCode.DOWN; this.beans.navigation?.navigateToNextCell(null, direction, cellPosition, false); } processEdits(edits, source) { const rowNodes = Array.from(edits.keys()); const hasValidationErrors = this.model.getCellValidationModel().getCellValidationMap().size > 0 || this.model.getRowValidationModel().getRowValidationMap().size > 0; const editsToDelete = []; const { changeDetectionSvc } = this.beans; changeDetectionSvc?.beginDeferred(); try { for (const rowNode of rowNodes) { const editRow = edits.get(rowNode); for (const column of editRow.keys()) { const editValue = editRow.get(column); const position = { rowNode, column }; if (_sourceAndPendingDiffer(editValue) && !hasValidationErrors) { const cellCtrl = _getCellCtrl(this.beans, position); const success = this.setNodeDataValue( rowNode, column, editValue.pendingValue, cellCtrl, source ); if (!success) { editsToDelete.push(position); } } } } } finally { changeDetectionSvc?.endDeferred(); } return editsToDelete; } /** * Commits a value to the row node's data via `rowNode.setDataValue`. * * This is a low-level helper that only writes to data; it does NOT update the * edit model. Callers are responsible for any model reconciliation — see * `syncEditAfterCommit` for the non-batch case and `processEdits` for the * batch-finalisation case (where edits are removed immediately after commit). */ setNodeDataValue(rowNode, column, newValue, cellCtrl, originalSource = "edit") { const translatedSource = INTERNAL_EDITOR_SOURCES.has(originalSource) ? "edit" : originalSource; if (cellCtrl) { cellCtrl.suppressRefreshCell = true; } this.committing = true; try { return rowNode.setDataValue(column, newValue, translatedSource); } finally { this.committing = false; if (cellCtrl) { cellCtrl.suppressRefreshCell = false; } } } /** * Syncs the edit model after a non-batch commit so sourceValue never becomes stale. * On success, re-reads the actual committed value from data (via getValue) because * a custom valueSetter may transform or store it differently than the passed value. * On failure, reverts the pending edit back to sourceValue. * * Skipped when an editor is open (state === 'editing'), because the upcoming * stopEditing flow will call _syncFromEditors which reads from the editor widget; * updating sourceValue here would cause that flow to re-commit stale editor content. * * NOTE: The re-read via `getValue` happens after `setNodeDataValue` has dispatched * `cellValueChanged`. If a `cellValueChanged` listener synchronously mutates the * same data field, the re-read will pick up that mutation. This is acceptable because * the listener intentionally transformed the value and the model should track the * actual committed state. */ syncEditAfterCommit(position, success) { const edit = this.model.getEdit(position); if (edit && edit.state !== "editing") { if (success) { this.beans.editModelSvc?.setEdit(position, { sourceValue: edit.pendingValue }); } else { this.model.clearEditValue(position); } } } setEditMap(edits, params) { this.strategy ?? (this.strategy = this.createStrategy()); this.strategy?.setEditMap(edits, params); this.bulkRefreshMap(edits); let refreshParams = FORCE_REFRESH; if (params?.forceRefreshOfEditCellsOnly) { refreshParams = { ...getRowColumnsFromMap(edits), ...FORCE_REFRESH }; } this.beans.rowRenderer.refreshCells(refreshParams); } dispatchEditValuesChanged({ rowNode, column }, edit = {}) { if (!rowNode || !column || !edit) { return; } const { pendingValue, sourceValue } = edit; const { rowIndex, rowPinned, data } = rowNode; this.beans.eventSvc.dispatchEvent({ type: "cellEditValuesChanged", node: rowNode, rowIndex, rowPinned, column, source: "api", data, newValue: pendingValue, oldValue: sourceValue, value: pendingValue, colDef: column.getColDef() }); } bulkRefreshCell(position, params) { if (_isClientSideRowModel(this.gos, this.beans.rowModel)) { this.refCell(position, this.model.getEdit(position), params); } } bulkRefreshMap(editMap, params) { if (_isClientSideRowModel(this.gos, this.beans.rowModel)) { editMap.forEach((editRow, rowNode) => { for (const column of editRow.keys()) { this.refCell({ rowNode, column }, editRow.get(column), params); } }); } } refCell({ rowNode, column }, edit, params = {}) { const { beans, gos } = this; const updatedNodes = /* @__PURE__ */ new Set([rowNode]); const refreshNodes = /* @__PURE__ */ new Set(); const pinnedSibling = rowNode.pinnedSibling; if (pinnedSibling) { updatedNodes.add(pinnedSibling); } const sibling = rowNode.sibling; if (sibling) { refreshNodes.add(sibling); } let parent = rowNode.parent; while (parent) { if (parent.sibling?.footer && gos.get("groupTotalRow")) { refreshNodes.add(parent.sibling); } else if (!parent.parent && parent.sibling && gos.get("grandTotalRow")) { refreshNodes.add(parent.sibling); } else { refreshNodes.add(parent); } parent = parent.parent; } for (const node of updatedNodes) { this.dispatchEditValuesChanged({ rowNode: node, column }, edit); } for (const node of updatedNodes) { _getCellCtrl(beans, { rowNode: node, column })?.refreshCell(params); } for (const node of refreshNodes) { const cellCtrl = _getCellCtrl(beans, { rowNode: node, column }); if (cellCtrl) { cellCtrl.refreshCell(params); if (!params.force && this.batch) { cellCtrl.editStyleFeature?.applyCellStyles?.(); } } } } stopAllEditing(cancel = false, source = "ui") { if (this.isEditing()) { this.stopEditing(void 0, { cancel, source }); } } isCellEditable(position, source = "ui") { const { gos, beans } = this; const rowNode = position.rowNode; if (rowNode.group && position.column.getColDef().groupRowEditable == null) { if (gos.get("treeData")) { if (!rowNode.data && !gos.get("enableGroupEdit")) { return false; } } else if (!gos.get("enableGroupEdit")) { return false; } } const isEditable = getEditType(gos) === "fullRow" ? isFullRowCellEditable(beans, position, source) : isCellEditable(beans, position); if (isEditable) { this.strategy ?? (this.strategy = this.createStrategy()); } return isEditable; } cellEditingInvalidCommitBlocks() { return this.gos.get("invalidEditValueMode") === "block"; } checkNavWithValidation(position, event, focus = true) { if (this.hasValidationErrors(position)) { const cellCtrl = _getCellCtrl(this.beans, position); if (this.cellEditingInvalidCommitBlocks()) { event?.preventDefault?.(); if (focus) { if (cellCtrl && !cellCtrl.hasBrowserFocus()) { cellCtrl.focusCell(); } cellCtrl?.comp?.getCellEditor()?.focusIn?.(); } return "block-stop"; } if (cellCtrl) { this.revertSingleCellEdit(cellCtrl); } return "revert-continue"; } return "continue"; } revertSingleCellEdit(cellPosition, focus = false) { const cellCtrl = _getCellCtrl(this.beans, cellPosition); if (!cellCtrl?.comp?.getCellEditor()) { return; } _destroyEditors(this.beans, [cellPosition], { silent: true }); this.model.clearEditValue(cellPosition); _setupEditor(this.beans, cellPosition, { silent: true }); _populateModelValidationErrors(this.beans); cellCtrl?.refreshCell(FORCE_REFRESH); if (!focus) { return; } cellCtrl?.focusCell(); cellCtrl?.comp?.getCellEditor()?.focusIn?.(); } hasValidationErrors(position) { _populateModelValidationErrors(this.beans); const cellCtrl = _getCellCtrl(this.beans, position); if (cellCtrl) { cellCtrl.refreshCell(FORCE_REFRESH); cellCtrl.rowCtrl.rowEditStyleFeature?.applyRowStyles(); } let invalid = false; if (position?.rowNode) { invalid || (invalid = this.model.getRowValidationModel().hasRowValidation({ rowNode: position.rowNode })); if (position.column) { invalid || (invalid = this.model.getCellValidationModel().hasCellValidation({ rowNode: position.rowNode, column: position.column })); } } else { invalid || (invalid = this.model.getCellValidationModel().getCellValidationMap().size > 0); invalid || (invalid = this.model.getRowValidationModel().getRowValidationMap().size > 0); } return invalid; } moveToNextCell(prev, backwards, event, source = "ui") { let res; const editing = this.isEditing(); const preventNavigation = editing && this.checkNavWithValidation(void 0, event) === "block-stop"; if (prev instanceof CellCtrl && editing) { res = this.strategy?.moveToNextEditingCell(prev, backwards, event, source, preventNavigation); } if (res === null) { return res; } res = res || !!this.beans.focusSvc.focusedHeader; if (res === false && !preventNavigation) { this.stopEditing(); } return res; } /** * Gets the pending edit value for a cell (used by ValueService). * Returns undefined to fallback to committed data/valueGetter. */ getPendingEditValue(rowNode, column, from) { if (from === "data") { return void 0; } if (from === "batch" && !this.batch) { return void 0; } const edit = this.model.getEdit({ rowNode, column }, CHECK_SIBLING); if (!edit) { return void 0; } if (this.stopping && !this.batch && !edit.editorState?.cellStartedEditing) { return void 0; } if (from === "edit") { const editorValue = edit.editorValue; if (editorValue != null && editorValue !== UNEDITED) { return editorValue; } } const pendingValue = edit.pendingValue; if (pendingValue !== UNEDITED) { return pendingValue; } return void 0; } getCellDataValue(position) { const edit = this.model.getEdit(position, CHECK_SIBLING); if (edit) { const newValue = edit.pendingValue; if (newValue !== UNEDITED) { return newValue; } const sourceValue = edit.sourceValue; if (sourceValue != null) { return sourceValue; } } return this.valueSvc.getValue(position.column, position.rowNode, "data"); } addStopEditingWhenGridLosesFocus(viewports) { _addStopEditingWhenGridLosesFocus(this, this.beans, viewports); } createPopupEditorWrapper(params) { return new PopupEditorWrapper(params); } batchResetToSourceValue(position) { if (!this.batch) { return false; } const existing = this.model.getEdit(position); if (!existing) { return false; } const { pendingValue, sourceValue, state } = existing; if (pendingValue === sourceValue) { return false; } if (state === "editing") { return false; } this.dispatchEditValuesChanged(position, { ...existing, pendingValue: sourceValue }); this.beans.editModelSvc?.removeEdits(position); _getCellCtrl(this.beans, position)?.refreshCell(FORCE_REFRESH); return true; } /** * Applies a data value change to a cell, handling batch editing, undo/redo, paste, and range operations. */ setDataValue(position, newValue, eventSource) { try { const batch = this.batch; const editing = this.isEditing(batch ? void 0 : position); if ((!editing || this.committing) && !batch && !SET_DATA_SOURCE_AS_API.has(eventSource)) { return; } if (!editing && !batch && eventSource === "paste") { return; } if (eventSource === "batch" && !batch) { return; } if (eventSource === "edit") { if (editing && this.applyEditorValue(position, newValue)) { return true; } if (!batch) { return; } } this.strategy ?? (this.strategy = this.createStrategy()); if (eventSource === "batch" || eventSource === "edit") { return this.applyDirectValue(position, newValue, eventSource); } const beans = this.beans; let source; if (batch) { source = "ui"; } else if (this.committing) { source = eventSource ?? "api"; } else { source = "api"; } if (!eventSource || KEEP_EDITOR_SOURCES.has(eventSource)) { return this.applyDirectValue(position, newValue, eventSource); } const result = this.applyExistingEdit(position, newValue, eventSource, source); if (result !== void 0) { return result; } _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true }); this.ensureBatchStarted(); this.stopEditing(position, { source, suppressNavigateAfterEdit: true }); return true; } finally { this.committing = false; } } /** Handles setDataValue when an edit already exists for the cell. */ applyExistingEdit(position, newValue, eventSource, source) { const existing = this.model.getEdit(position); if (!existing) { return void 0; } if (existing.pendingValue === newValue) { return false; } if (existing.sourceValue !== newValue) { _syncFromEditor(this.beans, position, newValue, eventSource, void 0, { persist: true }); this.ensureBatchStarted(); this.stopEditing(position, { source, suppressNavigateAfterEdit: true }); return true; } this.beans.editModelSvc?.removeEdits(position); this.ensureBatchStarted(); this.dispatchEditValuesChanged(position, { ...existing, pendingValue: newValue }); return true; } /** * Pushes a value into an open cell editor without closing it or committing. * Updates editorValue and pendingValue in the edit model, then refreshes the editor DOM. * Returns true if an editor was open and updated, false otherwise. */ applyEditorValue(position, newValue) { const beans = this.beans; const cellCtrl = _getCellCtrl(beans, position); const editor = cellCtrl?.comp?.getCellEditor(); if (!cellCtrl || !editor) { return false; } _syncFromEditor(beans, position, newValue, "edit", void 0, { persist: true }); cellCtrl.editStyleFeature?.applyCellStyles?.(); if ("agSetEditValue" in editor) { editor.agSetEditValue(newValue); return true; } if (editor.refresh && cellCtrl.editCompDetails) { editor.refresh({ ...cellCtrl.editCompDetails.params, value: newValue }); return true; } const restoreFocus = cellCtrl.hasBrowserFocus(); if (restoreFocus) { cellCtrl.onEditorAttachedFuncs.push(() => { const latestCellCtrl = _getCellCtrl(this.beans, position); latestCellCtrl?.focusCell(true); latestCellCtrl?.comp?.getCellEditor()?.focusIn?.(); }); } _destroyEditors(beans, [position], { silent: true, cancel: true }); _setupEditor(beans, position, { silent: true }); _populateModelValidationErrors(beans); _getCellCtrl(beans, position)?.refreshCell(FORCE_REFRESH); return true; } /** editApi or undoRedoApi apply change without involving the editor. */ applyDirectValue(position, newValue, eventSource) { const beans = this.beans; if (this.batch) { if (eventSource === "batch" && _getCellCtrl(beans, position)?.comp?.getCellEditor()) { const { editModelSvc, valueSvc } = beans; const { rowNode, column } = position; const existingEdit = editModelSvc?.getEdit(position); if (existingEdit?.sourceValue === void 0) { editModelSvc?.setEdit(position, { sourceValue: valueSvc.getValue(column, rowNode, "data") }); } editModelSvc?.setEdit(position, { pendingValue: newValue }); } else { _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true }); if (eventSource !== "batch") { this.cleanupEditors(); } } _purgeUnchangedEdits(beans); this.ensureBatchStarted(); this.bulkRefreshCell(position); return true; } _syncFromEditor(beans, position, newValue, eventSource, void 0, { persist: true }); const cellCtrl = _getCellCtrl(beans, position); const success = this.setNodeDataValue(position.rowNode, position.column, newValue, cellCtrl, eventSource); this.syncEditAfterCommit(position, success); _purgeUnchangedEdits(beans); _getCellCtrl(beans, position)?.refreshCell(success ? FORCE_REFRESH_FLASH : FORCE_REFRESH); return success; } handleColDefChanged(cellCtrl) { _refreshEditorOnColDefChanged(this.beans, cellCtrl); } destroy() { this.model.clear(); this.destroyStrategy(); super.destroy(); } prepDetailsDuringBatch(position, params) { const { model } = this; if (!this.batch) { return; } const hasEdits = model.hasRowEdits(position.rowNode, CHECK_SIBLING); if (!hasEdits) { return; } const { rowNode } = position; const { compDetails, valueToDisplay } = params; if (compDetails) { const { params: params2 } = compDetails; params2.data = model.getEditRowDataValue(rowNode, CHECK_SIBLING); return { compDetails }; } return { valueToDisplay }; } cleanupEditors() { this.strategy?.cleanupEditors(); } dispatchCellEvent(position, event, type, payload) { this.strategy?.dispatchCellEvent(position, event, type, payload); } dispatchBatchEvent(type, edits) { this.eventSvc.dispatchEvent(this.createBatchEditEvent(type, edits)); } createBatchEditEvent(type, edits) { return _addGridCommonParams(this.gos, { type, ...type === "batchEditingStopped" ? { changes: this.toEventChangeList(edits) } : {} }); } toEventChangeList(edits) { return this.model.getEditPositions(edits).map((edit) => ({ rowIndex: edit.rowNode.rowIndex, rowPinned: edit.rowNode.rowPinned, columnId: edit.column.getColId(), newValue: edit.pendingValue, oldValue: edit.sourceValue })); } applyBulkEdit({ rowNode, column }, ranges) { if (!ranges || ranges.length === 0) { return; } const { beans, rangeSvc, valueSvc } = this; const { formula } = beans; _syncFromEditors(beans, { persist: true }); const edits = this.model.getEditMap(true); let editValue = edits.get(rowNode)?.get(column)?.pendingValue; let bulkStartDispatched = false; if (!this.batch) { this.eventSvc.dispatchEvent({ type: "bulkEditingStarted" }); bulkStartDispatched = true; } const isFormula = formula?.isFormula(editValue) ?? false; ranges.forEach((range) => { const hasFormulaColumnsInRange = range.columns.some((col) => col?.isAllowFormula()); rangeSvc?.forEachRowInRange(range, (position) => { const rowNode2 = _getRowNode(beans, position); if (rowNode2 === void 0) { return; } const editRow = edits.get(rowNode2) ?? /* @__PURE__ */ new Map(); let valueForColumn = editValue; for (const column2 of range.columns) { if (!column2) { continue; } const isFormulaForColumn = !!isFormula && column2.isAllowFormula(); if (this.isCellEditable({ rowNode: rowNode2, column: column2 }, "api")) { const sourceValue = valueSvc.getValue(column2, rowNode2, "data", true); let pendingValue = valueSvc.parseValue( column2, rowNode2 ?? null, valueForColumn, sourceValue ); if (Number.isNaN(pendingValue)) { pendingValue = null; } editRow.set(column2, { editorValue: void 0, pendingValue, sourceValue, state: "changed", editorState: { isCancelAfterEnd: void 0, isCancelBeforeStart: void 0 } }); } if (isFormulaForColumn) { valueForColumn = formula?.updateFormulaByOffset({ value: valueForColumn, columnDelta: 1 }); } } if (editRow.size > 0) { edits.set(rowNode2, editRow); } if (isFormula && hasFormulaColumnsInRange) { editValue = formula?.updateFormulaByOffset({ value: editValue, rowDelta: 1 }); } }); this.setEditMap(edits); if (this.batch) { this.cleanupEditors(); _purgeUnchangedEdits(beans); this.ensureBatchStarted(); return; } this.committing = true; try { this.stopEditing(void 0, { source: "bulk" }); } finally { this.committing = false; if (bulkStartDispatched) { this.eventSvc.dispatchEvent({ type: "bulkEditingStopped", changes: this.toEventChangeList(edits) }); } } }); const cellCtrl = _getCellCtrl(beans, { rowNode, column }); if (cellCtrl) { cellCtrl.focusCell(true); } } createCellStyleFeature(cellCtrl) { return new CellEditStyleFeature(cellCtrl, this.beans); } createRowStyleFeature(rowCtrl) { return new RowEditStyleFeature(rowCtrl, this.beans); } setEditingCells(cells, params) { const { beans } = this; const { colModel, valueSvc } = beans; const edits = /* @__PURE__ */ new Map(); for (let { colId, column, colKey, rowIndex, rowPinned, newValue: pendingValue, state } of cells) { const col = colId ? colModel.getCol(colId) : colKey ? colModel.getCol(colKey) : column; if (!col) { continue; } const rowNode = _getRowNode(beans, { rowIndex, rowPinned }); if (!rowNode) { continue; } const sourceValue = valueSvc.getValue(col, rowNode, "data", true); if (!params?.forceRefreshOfEditCellsOnly && !_sourceAndPendingDiffer({ pendingValue, sourceValue }) && state !== "editing") { continue; } let editRow = edits.get(rowNode); if (!editRow) { editRow = /* @__PURE__ */ new Map(); edits.set(rowNode, editRow); } if (pendingValue === void 0) { pendingValue = UNEDITED; } editRow.set(col, { editorValue: void 0, pendingValue, sourceValue, state: state ?? "changed", editorState: { isCancelAfterEnd: void 0, isCancelBeforeStart: void 0 } }); } this.setEditMap(edits, params); } onCellFocused(event) { const cellCtrl = _getCellCtrl(this.beans, event); if (!cellCtrl || !this.isEditing(cellCtrl, CHECK_SIBLING)) { return; } const edit = this.model.getEdit(cellCtrl); if (!edit || !_sourceAndPendingDiffer(edit)) { return; } const translate = this.getLocaleTextFunc(); const label = translate("ariaPendingChange", "Pending Change"); this.beans.ariaAnnounce?.announceValue(label, "pendingChange"); } allowedFocusTargetOnValidation(cellPosition) { return _getCellCtrl(this.beans, cellPosition); } }; function getRowColumnsFromMap(edits) { return { rowNodes: edits ? Array.from(edits.keys()) : void 0, columns: edits ? [...new Set(Array.from(edits.values()).flatMap((er) => Array.from(er.keys())))] : void 0 }; } function getEditType(gos, editType) { return editType ?? gos.get("editType") ?? "singleCell"; } var BaseEditStrategy = class extends BeanStub { postConstruct() { this.model = this.beans.editModelSvc; this.editSvc = this.beans.editSvc; this.addManagedEventListeners({ cellFocused: this.onCellFocusChanged?.bind(this), cellFocusCleared: this.onCellFocusChanged?.bind(this) }); } clearEdits(position) { this.model.clearEditValue(position); } onCellFocusChanged(event) { let cellCtrl; const previous = event["previousParams"]; const { editSvc, beans } = this; const sourceEvent = event.type === "cellFocused" ? event.sourceEvent : null; if (previous) { cellCtrl = _getCellCtrl(beans, previous); } const { gos, editModelSvc } = beans; const isFocusCleared = event.type === "cellFocusCleared"; if (editSvc.isEditing(void 0, { withOpenEditor: true })) { const { column, rowIndex, rowPinned } = event; const cellPositionFromEvent = { column, rowNode: _getRowNode(beans, { rowIndex, rowPinned }) }; const isBlock = gos.get("invalidEditValueMode") === "block"; if (isBlock) { return; } const shouldRevert = !isBlock; const hasError = !!editModelSvc?.getCellValidationModel().hasCellValidation(cellPositionFromEvent); const shouldCancel = shouldRevert && hasError; const result = previous || isFocusCleared ? editSvc.stopEditing(void 0, { cancel: shouldCancel, source: isFocusCleared && shouldRevert ? "api" : void 0, event: sourceEvent }) : true; if (!result) { if (editSvc.isBatchEditing()) { editSvc.cleanupEditors(); } else { editSvc.stopEditing(void 0, { source: "api" }); } } } cellCtrl?.refreshCell({ suppressFlash: true, force: true }); } stopCancelled(forceCancel) { const preserveBatch = this.editSvc.isBatchEditing() && !forceCancel; for (const cell of this.model.getEditPositions()) { _destroyEditor(this.beans, cell, { cancel: true }, _getCellCtrl(this.beans, cell)); this.model.stop(cell, preserveBatch, true); } return true; } stopCommitted(event, commit) { const editingCells = this.model.getEditPositions(); const results = { all: [], pass: [], fail: [] }; for (const cell of editingCells) { results.all.push(cell); if ((this.model.getCellValidationModel().getCellValidation(cell)?.errorMessages?.length ?? 0) > 0) { results.fail.push(cell); } else { results.pass.push(cell); } } const actions = this.processValidationResults(results); const preserveBatch = this.editSvc.isBatchEditing() && !commit; for (const cell of actions.destroy) { _destroyEditor(this.beans, cell, { event }, _getCellCtrl(this.beans, cell)); this.model.stop(cell, preserveBatch, false); } for (const cell of actions.keep) { const cellCtrl = _getCellCtrl(this.beans, cell); if (!this.editSvc.cellEditingInvalidCommitBlocks() && cellCtrl) { this.editSvc.revertSingleCellEdit(cellCtrl); } } return true; } cleanupEditors({ rowNode } = {}, includeEditing) { _syncFromEditors(this.beans, { persist: false }); const positions = this.model.getEditPositions(); const discard = []; if (rowNode) { for (const pos of positions) { if (pos.rowNode !== rowNode) { discard.push(pos); } } } else { for (const pos of positions) { discard.push(pos); } } _destroyEditors(this.beans, discard); _purgeUnchangedEdits(this.beans, includeEditing); } setFocusOutOnEditor(cellCtrl) { cellCtrl.comp?.getCellEditor()?.focusOut?.(); } setFocusInOnEditor(cellCtrl) { const comp = cellCtrl.comp; const editor = comp?.getCellEditor(); if (editor?.focusIn) { editor.focusIn(); } else { const isFullRow = this.beans.gos.get("editType") === "fullRow"; cellCtrl.focusCell(isFullRow); cellCtrl.onEditorAttachedFuncs.push(() => comp?.getCellEditor()?.focusIn?.()); } } setupEditors(params) { const { event, ignoreEventKey = false, startedEdit, position, cells = this.model.getEditPositions() } = params; const key = event instanceof KeyboardEvent && !ignoreEventKey && event.key || void 0; _setupEditors(this.beans, cells, position, key, event, startedEdit); } dispatchCellEvent(position, event, type, payload) { const cellCtrl = _getCellCtrl(this.beans, position); if (cellCtrl) { this.eventSvc.dispatchEvent({ ...cellCtrl.createEvent(event ?? null, type), ...payload }); } } dispatchRowEvent(position, type, silent) { if (silent) { return; } const rowCtrl = _getRowCtrl(this.beans, position); if (rowCtrl) { this.eventSvc.dispatchEvent(rowCtrl.createRowEvent(type)); } } shouldStop(_position, event, source = "ui") { const batch = this.editSvc.isBatchEditing(); if (batch && source === "api") { return true; } if (batch && (source === "ui" || source === "edit")) { return false; } if (source === "api") { return true; } if (event instanceof KeyboardEvent && !batch) { return event.key === KeyCode.ENTER; } return null; } shouldCancel(_position, event, source = "ui") { const batch = this.editSvc.isBatchEditing(); if (event instanceof KeyboardEvent && !batch) { const result = event.key === KeyCode.ESCAPE; if (result) { return true; } } if (batch && source === "api") { return true; } if (source === "api") { return true; } return false; } setEditMap(edits, params) { if (!params?.update) { this.editSvc.stopEditing(void 0, { cancel: true, source: "api" }); } const cells = []; edits.forEach((editRow, rowNode) => { editRow.forEach((cellData, column) => { if (cellData.state === "editing") { cells.push({ ...cellData, rowNode, column }); } }); }); if (params?.update) { edits = new Map([...this.model.getEditMap(), ...edits]); } this.model?.setEditMap(edits); if (cells.length > 0) { const position = cells.at(-1); const key = position.pendingValue === UNEDITED ? void 0 : position.pendingValue; this.start({ position, event: new KeyboardEvent("keydown", { key }), source: "api" }); const cellCtrl = _getCellCtrl(this.beans, position); if (cellCtrl) { this.setFocusInOnEditor(cellCtrl); } } } destroy() { this.cleanupEditors(); super.destroy(); } }; var FullRowEditStrategy = class extends BaseEditStrategy { constructor() { super(...arguments); this.beanName = "fullRow"; this.startedRows = /* @__PURE__ */ new Set(); } shouldStop(position, event, _source = "ui") { const { rowNode: currentRowNode, beans } = this; const { rowNode } = position || {}; const oldRowCtrl = _getRowCtrl(beans, { rowNode: currentRowNode }); if (!oldRowCtrl) { return true; } const res = super.shouldStop({ rowNode: currentRowNode }, event, _source); if (res !== null) { return res; } if (!currentRowNode) { return false; } return rowNode !== currentRowNode; } midBatchInputsAllowed({ rowNode }) { if (!rowNode) { return false; } return this.model.hasEdits({ rowNode }); } clearEdits(position) { this.model.clearEditValue(position); } start(params) { const { position, silent, startedEdit, event, ignoreEventKey } = params; const { rowNode } = position; const { beans, model, startedRows } = this; if (this.rowNode !== rowNode) { super.cleanupEditors(position); } const columns = beans.visibleCols.allCols; const cells = []; const editableColumns = []; for (const column of columns) { if (column.isCellEditable(rowNode)) { editableColumns.push(column); } } if (editableColumns.length == 0) { return; } if (!startedRows.has(rowNode)) { this.dispatchRowEvent({ rowNode }, "rowEditingStarted", silent); startedRows.add(rowNode); } for (const column of editableColumns) { const position2 = { rowNode, column }; cells.push(position2); model.start(position2); } this.rowNode = rowNode; this.setupEditors({ cells, position, startedEdit, event, ignoreEventKey }); } processValidationResults(results) { const anyFailed = results.fail.length > 0; if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) { return { destroy: [], keep: results.all }; } return { destroy: results.all, keep: [] }; } stopCancelled(forceCancel) { const { rowNode, model } = this; if (rowNode && !model.hasRowEdits(rowNode)) { return false; } super.stopCancelled(forceCancel); this.cleanupEditors({ rowNode }, true); this.rowNode = void 0; return true; } stopCommitted(event, commit) { const { rowNode, beans, model, editSvc } = this; if (rowNode && !model.hasRowEdits(rowNode)) { return false; } const changedRows = []; model.getEditMap().forEach((rowEdits, rowNode2) => { if (!rowEdits || rowEdits.size === 0) { return; } for (const edit of rowEdits.values()) { if (_sourceAndPendingDiffer(edit)) { changedRows.push(rowNode2); break; } } }); _populateModelValidationErrors(beans); if (editSvc.checkNavWithValidation({ rowNode }) === "block-stop") { return false; } super.stopCommitted(event, commit); if (commit || !editSvc.isBatchEditing()) { for (const rowNode2 of changedRows) { this.dispatchRowEvent({ rowNode: rowNode2 }, "rowValueChanged"); } } this.cleanupEditors({ rowNode }, true); this.rowNode = void 0; return true; } onCellFocusChanged(event) { const { rowIndex } = event; const prev = event["previousParams"]; if (prev?.rowIndex === rowIndex || event.sourceEvent instanceof KeyboardEvent) { return; } const { beans, gos, model } = this; if (beans.editSvc?.isRangeSelectionEnabledWhileEditing()) { return; } const prevCell = _getCellCtrl(beans, prev); const isBlock = gos.get("invalidEditValueMode") === "block"; if (isBlock && prevCell && (model.getCellValidationModel().getCellValidation(prevCell) || model.getRowValidationModel().getRowValidation(prevCell))) { return; } super.onCellFocusChanged(event); } cleanupEditors(position = {}, includeEditing) { super.cleanupEditors(position, includeEditing); const { startedRows } = this; for (const rowNode of startedRows) { this.dispatchRowEvent({ rowNode }, "rowEditingStopped"); this.destroyEditorsForRow(rowNode); } startedRows.clear(); } /** * Destroys all editors for a row that started full row editing, including editors * that are not represented in the edit model (e.g. empty/unedited editors). */ destroyEditorsForRow(rowNode) { const rowCtrl = _getRowCtrl(this.beans, { rowNode }); if (!rowCtrl) { return; } const destroyParams = {}; for (const cellCtrl of rowCtrl.getAllCellCtrls()) { if (cellCtrl.comp?.getCellEditor()) { _destroyEditor(this.beans, cellCtrl, destroyParams, cellCtrl); } } } // returns null if no navigation should be performed moveToNextEditingCell(prevCell, backwards, event, source = "ui", preventNavigation = false) { const { beans, model, gos, editSvc } = this; const prevPos = prevCell.cellPosition; let nextCell; model.suspend(true); try { nextCell = beans.navigation?.findNextCellToFocusOn(prevPos, { backwards, startEditing: true, // Default behaviour for fullRow is skip to the next cell, // editable or not. FullRow editing might have some editable // and some not editable cells in the row. // More complex logic needed to skip to the // next FullRow editable cell, skipToNextEditableCell: false }); } finally { model.suspend(false); } if (nextCell === false) { return null; } if (nextCell == null) { return false; } const nextPos = nextCell.cellPosition; const prevEditable = prevCell.isCellEditable(); const nextEditable = nextCell.isCellEditable(); const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned; if (prevEditable) { this.setFocusOutOnEditor(prevCell); } this.restoreEditors(); const suppressStartEditOnTab = gos.get("suppressStartEditOnTab"); if (nextEditable && !preventNavigation) { if (suppressStartEditOnTab) { nextCell.focusCell(true, event); } else { if (!nextCell.comp?.getCellEditor()) { _setupEditor(beans, nextCell, { event, cellStartedEdit: true }); } this.setFocusInOnEditor(nextCell); nextCell.focusCell(false, event); } } else { if (nextEditable && preventNavigation) { this.setFocusInOnEditor(nextCell); } nextCell.focusCell(true, event); } if (!rowsMatch && !preventNavigation) { editSvc?.stopEditing({ rowNode: prevCell.rowNode }, { event, forceStop: true }); if (editSvc?.isRowEditing(prevCell.rowNode, { withOpenEditor: true })) { this.cleanupEditors(nextCell, true); } if (suppressStartEditOnTab) { nextCell.focusCell(true, event); } else { editSvc.startEditing(nextCell, { startedEdit: true, event, source, ignoreEventKey: true, editable: nextEditable || void 0 }); } } prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true }); return true; } restoreEditors() { const { beans, model } = this; model.getEditMap().forEach( (rowEdits, rowNode) => rowEdits.forEach(({ state }, column) => { if (state !== "editing") { return; } const cellCtrl = _getCellCtrl(beans, { rowNode, column }); if (cellCtrl && !cellCtrl.comp?.getCellEditor()) { _setupEditor(beans, cellCtrl, { silent: true }); } }) ); } destroy() { super.destroy(); this.rowNode = void 0; this.startedRows.clear(); } }; var SingleCellEditStrategy = class extends BaseEditStrategy { constructor() { super(...arguments); this.beanName = "singleCell"; } shouldStop(position, event, source = "ui") { const res = super.shouldStop(position, event, source); if (res !== null) { return res; } const rowNode = position?.rowNode; const column = position?.column; const trackedRowNode = this.rowNode; const trackedColumn = this.column; if ((!trackedRowNode || !trackedColumn) && rowNode && column) { return null; } if (trackedRowNode !== rowNode || trackedColumn !== column) { return true; } if (!trackedRowNode && !trackedColumn) { return this.model.hasEdits(void 0, { withOpenEditor: true }); } return false; } midBatchInputsAllowed(position) { return this.model.hasEdits(position); } start(params) { const { position, startedEdit, event, ignoreEventKey } = params; if (this.rowNode !== position.rowNode || this.column !== position.column) { super.cleanupEditors(); } this.rowNode = position.rowNode; this.column = position.column; this.model.start(position); this.setupEditors({ cells: [position], position, startedEdit, event, ignoreEventKey }); } dispatchRowEvent(_position, _type, _silent) { } processValidationResults(results) { const anyFailed = results.fail.length > 0; if (anyFailed && this.editSvc.cellEditingInvalidCommitBlocks()) { return { destroy: [], keep: results.all }; } return { destroy: results.all, keep: [] }; } stopCancelled(forceCancel) { super.stopCancelled(forceCancel); return this.clearPosition(); } stopCommitted(event, commit) { super.stopCommitted(event, commit); return this.clearPosition(); } clearPosition() { this.rowNode = void 0; this.column = void 0; return true; } onCellFocusChanged(event) { const { colModel, editSvc } = this.beans; const { rowIndex, column, rowPinned } = event; const rowNode = _getRowNode(this.beans, { rowIndex, rowPinned }); const curColId = _getColId(column); const curCol = colModel.getCol(curColId); const previous = event["previousParams"]; if (previous) { const prevColId = _getColId(previous.column); if (previous?.rowIndex === rowIndex && prevColId === curColId && previous?.rowPinned === rowPinned) { return; } } if (event.type == "cellFocused" && (editSvc?.isRangeSelectionEnabledWhileEditing() || editSvc?.isEditing({ rowNode, column: curCol }, { withOpenEditor: true }))) { return; } super.onCellFocusChanged(event); } // returns null if no navigation should be performed moveToNextEditingCell(prevCell, backwards, event, source = "ui", preventNavigation = false) { const focusedCell = this.beans.focusSvc.getFocusedCell(); if (focusedCell) { prevCell = _getCellByPosition(this.beans, focusedCell) ?? prevCell; } const prevPos = prevCell.cellPosition; let nextCell; const shouldSuspend = this.beans.gos.get("editType") === "fullRow"; if (shouldSuspend) { this.model.suspend(true); } if (!preventNavigation) { prevCell.eGui.focus(); this.editSvc?.stopEditing(prevCell, { source: this.editSvc?.isBatchEditing() ? "ui" : "api", event }); } try { nextCell = this.beans.navigation?.findNextCellToFocusOn(prevPos, { backwards, startEditing: true // Default behaviour for fullRow is skip to the next cell, // editable or not. FullRow editing might have some editable // and some not editable cells in the row. // More complex logic needed to skip to the // next FullRow editable cell, // skipToNextEditableCell: false, }); } finally { if (shouldSuspend) { this.model.suspend(false); } } if (nextCell === false) { return null; } if (nextCell == null) { return false; } const nextPos = nextCell.cellPosition; const prevEditable = prevCell.isCellEditable(); const nextEditable = nextCell.isCellEditable(); const rowsMatch = nextPos && prevPos.rowIndex === nextPos.rowIndex && prevPos.rowPinned === nextPos.rowPinned; if (prevEditable && !preventNavigation) { this.setFocusOutOnEditor(prevCell); } const suppressStartEditOnTab = this.gos.get("suppressStartEditOnTab"); let startEditingCalled = false; if (!rowsMatch && !preventNavigation) { super.cleanupEditors(nextCell, true); if (suppressStartEditOnTab) { nextCell.focusCell(true, event); } else { startEditingCalled = true; this.editSvc.startEditing(nextCell, { startedEdit: true, event, source, ignoreEventKey: true, editable: nextEditable }); } } if (nextEditable && !preventNavigation) { nextCell.focusCell(false, event); if (suppressStartEditOnTab) { nextCell.focusCell(true, event); } else if (!nextCell.comp?.getCellEditor()) { if (!startEditingCalled) { const alreadyEditing = this.editSvc?.isEditing(nextCell, { withOpenEditor: true }); _setupEditor(this.beans, nextCell, { event, cellStartedEdit: true, silent: alreadyEditing }); } this.setFocusInOnEditor(nextCell); this.cleanupEditors(nextCell); } } else { if (nextEditable && preventNavigation) { this.setFocusInOnEditor(nextCell); } nextCell.focusCell(true, event); } prevCell.rowCtrl?.refreshRow({ suppressFlash: true, force: true }); return true; } destroy() { super.destroy(); this.rowNode = void 0; this.column = void 0; } }; var EditCoreModule = { moduleName: "EditCore", version: VERSION, beans: [EditModelService, EditService], apiFunctions: { getEditingCells, getEditRowValues, getCellEditorInstances, startEditingCell, stopEditing, isEditing, validateEdit }, dynamicBeans: { singleCell: SingleCellEditStrategy, fullRow: FullRowEditStrategy }, dependsOn: [PopupModule, TooltipModule], css: [cell_editing_default] }; var UndoRedoEditModule = { moduleName: "UndoRedoEdit", version: VERSION, beans: [UndoRedoService], apiFunctions: { undoCellEditing, redoCellEditing, getCurrentUndoSize, getCurrentRedoSize }, dependsOn: [EditCoreModule] }; var TextEditorModule = { moduleName: "TextEditor", version: VERSION, userComponents: { agCellEditor: TextCellEditor, agTextCellEditor: TextCellEditor }, dependsOn: [EditCoreModule] }; var NumberEditorModule = { moduleName: "NumberEditor", version: VERSION, userComponents: { agNumberCellEditor: { classImp: NumberCellEditor } }, dependsOn: [EditCoreModule] }; var DateEditorModule = { moduleName: "DateEditor", version: VERSION, userComponents: { agDateCellEditor: DateCellEditor, agDateStringCellEditor: DateStringCellEditor }, dependsOn: [EditCoreModule] }; var CheckboxEditorModule = { moduleName: "CheckboxEditor", version: VERSION, userComponents: { agCheckboxCellEditor: CheckboxCellEditor }, dependsOn: [EditCoreModule] }; var SelectEditorModule = { moduleName: "SelectEditor", version: VERSION, userComponents: { agSelectCellEditor: SelectCellEditor }, dependsOn: [EditCoreModule] }; var LargeTextEditorModule = { moduleName: "LargeTextEditor", version: VERSION, userComponents: { agLargeTextCellEditor: LargeTextCellEditor }, dependsOn: [EditCoreModule] }; var CustomEditorModule = { moduleName: "CustomEditor", version: VERSION, dependsOn: [EditCoreModule] }; var FILTER_HANDLER_MAP = { agSetColumnFilter: "agSetColumnFilterHandler", agMultiColumnFilter: "agMultiColumnFilterHandler", agGroupColumnFilter: "agGroupColumnFilterHandler", agNumberColumnFilter: "agNumberColumnFilterHandler", agBigIntColumnFilter: "agBigIntColumnFilterHandler", agDateColumnFilter: "agDateColumnFilterHandler", agTextColumnFilter: "agTextColumnFilterHandler" }; var FILTER_HANDLERS = new Set(Object.values(FILTER_HANDLER_MAP)); function getFilterUiFromWrapper(filterWrapper, skipCreate) { const filterUi = filterWrapper.filterUi; if (!filterUi) { return null; } if (filterUi.created) { return filterUi.promise; } if (skipCreate) { return null; } const promise = filterUi.create(filterUi.refreshed); const createdFilterUi = filterUi; createdFilterUi.created = true; createdFilterUi.promise = promise; return promise; } function _refreshHandlerAndUi(getFilterUi, handler, handlerParams, model, state, source, additionalEventAttributes) { handler.refresh?.({ ...handlerParams, model, source, additionalEventAttributes }); return getFilterUi().then((filterUi) => { if (filterUi) { const { filter, filterParams } = filterUi; _refreshFilterUi(filter, filterParams, model, state, source, additionalEventAttributes); } }); } function _refreshFilterUi(filter, filterParams, model, state, source, additionalEventAttributes) { filter?.refresh?.({ ...filterParams, model, state, source, additionalEventAttributes }); } function getAndRefreshFilterUi(getFilterUi, getModel, getState2, additionalEventAttributes) { const filterUi = getFilterUi(); if (filterUi?.created) { filterUi.promise.then((filter) => { const model = getModel(); _refreshFilterUi( filter, filterUi.filterParams, model, getState2() ?? { model }, "ui", additionalEventAttributes ); }); } } function _updateFilterModel(params) { let state; let shouldUpdateModel = false; let model; const { action, filterParams, getFilterUi, getModel, getState: getState2, updateState, updateModel, processModelToApply } = params; switch (action) { case "apply": { const oldState = getState2(); model = oldState?.model ?? null; if (processModelToApply) { model = processModelToApply(model); } state = { // keep the other UI state state: oldState?.state, model }; shouldUpdateModel = true; break; } case "clear": { state = { // wipe other UI state model: null }; if (!filterParams?.buttons?.includes("apply")) { shouldUpdateModel = true; model = null; } break; } case "reset": { state = { // wipe other UI state model: null }; shouldUpdateModel = true; model = null; break; } case "cancel": { state = { // wipe other UI state model: getModel() }; break; } } updateState(state); if (shouldUpdateModel) { updateModel(model); } else { getAndRefreshFilterUi(getFilterUi, getModel, getState2, { fromAction: action }); } } function _getFilterModel(model, colId) { return model[colId] ?? null; } var HeaderFilterCellCtrl = class extends AbstractHeaderCellCtrl { constructor() { super(...arguments); this.iconCreated = false; } wireComp(comp, eGui, eButtonShowMainFilter, eFloatingFilterBody, compBeanInput) { this.comp = comp; const compBean = setupCompBean(this, this.beans.context, compBeanInput); this.eButtonShowMainFilter = eButtonShowMainFilter; this.eFloatingFilterBody = eFloatingFilterBody; this.setGui(eGui, compBean); this.setupActive(); this.refreshHeaderStyles(); this.setupWidth(compBean); this.setupLeft(compBean); this.setupHover(compBean); this.setupFocus(compBean); this.setupAria(); this.setupFilterButton(); this.setupUserComp(); this.setupSyncWithFilter(compBean); this.setupUi(); compBean.addManagedElementListeners(this.eButtonShowMainFilter, { click: this.showParentFilter.bind(this) }); this.setupFilterChangedListener(compBean); const colDefChanged = () => this.onColDefChanged(compBean); compBean.addManagedListeners(this.column, { colDefChanged }); compBean.addManagedEventListeners({ filterSwitched: ({ column }) => { if (column === this.column) { colDefChanged(); } } }); compBean.addDestroyFunc(() => { this.eButtonShowMainFilter = null; this.eFloatingFilterBody = null; this.userCompDetails = null; this.clearComponent(); }); } resizeHeader() { } moveHeader() { } getHeaderClassParams() { const { column, beans } = this; const colDef = column.colDef; return _addGridCommonParams(beans.gos, { colDef, column, floatingFilter: true }); } setupActive() { const colDef = this.column.getColDef(); const filterExists = !!colDef.filter; const floatingFilterExists = !!colDef.floatingFilter; this.active = filterExists && floatingFilterExists; } setupUi() { this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active); this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body", this.suppressFilterButton); this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body", !this.suppressFilterButton); if (!this.active || this.iconCreated) { return; } const eMenuIcon = _createIconNoSpan("filter", this.beans, this.column); if (eMenuIcon) { this.iconCreated = true; this.eButtonShowMainFilter.appendChild(eMenuIcon); } } setupFocus(compBean) { compBean.createManagedBean( new ManagedFocusFeature(this.eGui, { shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this) }) ); } setupAria() { const localeTextFunc = this.getLocaleTextFunc(); _setAriaLabel(this.eButtonShowMainFilter, localeTextFunc("ariaFilterMenuOpen", "Open Filter Menu")); } onTabKeyDown(e) { const { beans } = this; const activeEl = _getActiveDomElement(beans); const wrapperHasFocus = activeEl === this.eGui; if (wrapperHasFocus) { return; } const nextFocusableEl = _findNextFocusableElement(beans, this.eGui, null, e.shiftKey); if (nextFocusableEl) { beans.headerNavigation?.scrollToColumn(this.column); e.preventDefault(); nextFocusableEl.focus(); return; } const nextFocusableColumn = this.findNextColumnWithFloatingFilter(e.shiftKey); if (!nextFocusableColumn) { return; } if (beans.focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: this.rowCtrl.rowIndex, column: nextFocusableColumn }, event: e })) { e.preventDefault(); } } findNextColumnWithFloatingFilter(backwards) { const presentedColsService = this.beans.visibleCols; let nextCol = this.column; do { nextCol = backwards ? presentedColsService.getColBefore(nextCol) : presentedColsService.getColAfter(nextCol); if (!nextCol) { break; } } while (!nextCol.getColDef().filter || !nextCol.getColDef().floatingFilter); return nextCol; } handleKeyDown(e) { super.handleKeyDown(e); const wrapperHasFocus = this.getWrapperHasFocus(); switch (e.key) { case KeyCode.UP: case KeyCode.DOWN: case KeyCode.LEFT: case KeyCode.RIGHT: if (wrapperHasFocus) { return; } _stopPropagationForAgGrid(e); case KeyCode.ENTER: if (wrapperHasFocus) { if (_focusInto(this.eGui)) { e.preventDefault(); } } break; case KeyCode.ESCAPE: if (!wrapperHasFocus) { this.eGui.focus(); } } } onFocusIn(e) { const isRelatedWithin = this.eGui.contains(e.relatedTarget); if (isRelatedWithin) { return; } const notFromHeaderWrapper = !!e.relatedTarget && !e.relatedTarget.classList.contains("ag-floating-filter"); const fromWithinHeader = !!e.relatedTarget && _isElementChildOfClass(e.relatedTarget, "ag-floating-filter"); if (notFromHeaderWrapper && fromWithinHeader && e.target === this.eGui) { const lastFocusEvent = this.lastFocusEvent; const fromTab = !!(lastFocusEvent && lastFocusEvent.key === KeyCode.TAB); if (lastFocusEvent && fromTab) { const shouldFocusLast = lastFocusEvent.shiftKey; _focusInto(this.eGui, shouldFocusLast); } } this.focusThis(); } setupHover(compBean) { this.beans.colHover?.addHeaderFilterColumnHoverListener(compBean, this.comp, this.column, this.eGui); } setupLeft(compBean) { const setLeftFeature = new SetLeftFeature(this.column, this.eGui, this.beans); compBean.createManagedBean(setLeftFeature); } setupFilterButton() { this.suppressFilterButton = !this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column); this.highlightFilterButtonWhenActive = !_isLegacyMenuEnabled(this.gos); } setupUserComp() { if (!this.active) { return; } const compDetails = this.beans.colFilter?.getFloatingFilterCompDetails( this.column, () => this.showParentFilter() ); if (compDetails) { this.setCompDetails(compDetails); } } setCompDetails(compDetails) { this.userCompDetails = compDetails; this.comp.setCompDetails(compDetails); } showParentFilter() { const eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter; this.beans.menuSvc?.showFilterMenu({ column: this.column, buttonElement: eventSource, containerType: "floatingFilter", positionBy: "button" }); } setupSyncWithFilter(compBean) { if (!this.active) { return; } const { beans: { colFilter }, column, gos } = this; const syncWithFilter = (event) => { if (event?.source === "filterDestroyed" && (!this.isAlive() || !colFilter?.isAlive())) { return; } const compPromise = this.comp.getFloatingFilterComp(); if (!compPromise) { return; } compPromise.then((comp) => { if (comp) { if (gos.get("enableFilterHandlers")) { const eventWithParams = event; let source = "filter"; if (eventWithParams?.afterFloatingFilter) { source = "ui"; } else if (eventWithParams?.afterDataChange) { source = "dataChanged"; } else if (event?.source === "api") { source = "api"; } this.updateFloatingFilterParams(this.userCompDetails, source); return; } const parentModel = colFilter?.getCurrentFloatingFilterParentModel(column); const filterChangedEvent = event ? { // event can have additional params like `afterDataChange` which need to be passed through ...event, columns: event.columns ?? [], source: event.source === "api" ? "api" : "columnFilter" } : null; comp.onParentModelChanged(parentModel, filterChangedEvent); } }); }; [this.destroySyncListener] = compBean.addManagedListeners(column, { filterChanged: syncWithFilter }); if (colFilter?.isFilterActive(column)) { syncWithFilter(null); } } setupWidth(compBean) { const listener = () => { const width = `${this.column.getActualWidth()}px`; this.comp.setWidth(width); }; compBean.addManagedListeners(this.column, { widthChanged: listener }); listener(); } setupFilterChangedListener(compBean) { if (this.active) { [this.destroyFilterChangedListener] = compBean.addManagedListeners(this.column, { filterChanged: this.updateFilterButton.bind(this) }); this.updateFilterButton(); } } updateFilterButton() { if (!this.suppressFilterButton && this.comp) { const isFilterAllowed = !!this.beans.filterManager?.isFilterAllowed(this.column); this.comp.setButtonWrapperDisplayed(isFilterAllowed); if (this.highlightFilterButtonWhenActive && isFilterAllowed) { this.eButtonShowMainFilter.classList.toggle("ag-filter-active", this.column.isFilterActive()); } } } onColDefChanged(compBean) { const wasActive = this.active; this.setupActive(); const becomeActive = !wasActive && this.active; if (wasActive && !this.active) { this.destroySyncListener(); this.destroyFilterChangedListener(); } const colFilter = this.beans.colFilter; const newCompDetails = this.active ? colFilter?.getFloatingFilterCompDetails(this.column, () => this.showParentFilter()) : null; const compPromise = this.comp.getFloatingFilterComp(); if (!compPromise || !newCompDetails) { this.updateCompDetails(compBean, newCompDetails, becomeActive); } else { compPromise.then((compInstance) => { if (!compInstance || colFilter?.areFilterCompsDifferent(this.userCompDetails ?? null, newCompDetails)) { this.updateCompDetails(compBean, newCompDetails, becomeActive); } else { this.updateFloatingFilterParams(newCompDetails, "colDef"); } }); } } updateCompDetails(compBean, compDetails, becomeActive) { if (!this.isAlive()) { return; } this.setCompDetails(compDetails); this.setupFilterButton(); this.setupUi(); if (becomeActive) { this.setupSyncWithFilter(compBean); this.setupFilterChangedListener(compBean); } } updateFloatingFilterParams(userCompDetails, source) { if (!userCompDetails) { return; } let params = userCompDetails.params; this.comp.getFloatingFilterComp()?.then((floatingFilter) => { if (typeof floatingFilter?.refresh === "function") { if (this.gos.get("enableFilterHandlers")) { params = { ...params, model: _getFilterModel(this.beans.colFilter?.model ?? {}, this.column.getColId()), source }; } floatingFilter.refresh(params); } }); } addResizeAndMoveKeyboardListeners() { } destroy() { super.destroy(); this.destroySyncListener = null; this.destroyFilterChangedListener = null; } }; function showColumnMenu(beans, colKey) { const column = beans.colModel.getCol(colKey); if (!column) { _error(12, { colKey }); return; } beans.menuSvc?.showColumnMenu({ column, positionBy: "auto" }); } function hidePopupMenu(beans) { beans.menuSvc?.hidePopupMenu(); } var MenuService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "menuSvc"; } postConstruct() { const { enterpriseMenuFactory, filterMenuFactory } = this.beans; this.activeMenuFactory = enterpriseMenuFactory ?? filterMenuFactory; } showColumnMenu(params) { this.showColumnMenuCommon(this.activeMenuFactory, params, "columnMenu"); } showFilterMenu(params) { this.showColumnMenuCommon(getFilterMenuFactory(this.beans), params, params.containerType, true); } showHeaderContextMenu(column, mouseEvent, touchEvent) { this.activeMenuFactory?.showMenuAfterContextMenuEvent(column, mouseEvent, touchEvent); } hidePopupMenu() { this.beans.contextMenuSvc?.hideActiveMenu(); this.activeMenuFactory?.hideActiveMenu(); } hideFilterMenu() { getFilterMenuFactory(this.beans)?.hideActiveMenu(); } isColumnMenuInHeaderEnabled(column) { const { suppressHeaderMenuButton } = column.getColDef(); return !suppressHeaderMenuButton && !!this.activeMenuFactory?.isMenuEnabled(column) && (_isLegacyMenuEnabled(this.gos) || !!this.beans.enterpriseMenuFactory); } isFilterMenuInHeaderEnabled(column) { return !column.getColDef().suppressHeaderFilterButton && !!this.beans.filterManager?.isFilterAllowed(column); } isHeaderContextMenuEnabled(column) { const colDef = column && isColumn(column) ? column.getColDef() : column?.getColGroupDef(); return !colDef?.suppressHeaderContextMenu && this.gos.get("columnMenu") === "new"; } isHeaderMenuButtonAlwaysShowEnabled() { return this.isSuppressMenuHide(); } isHeaderMenuButtonEnabled() { const menuHides = !this.isSuppressMenuHide(); const onIpadAndMenuHides = _isIOSUserAgent() && menuHides; return !onIpadAndMenuHides; } isHeaderFilterButtonEnabled(column) { return this.isFilterMenuInHeaderEnabled(column) && !_isLegacyMenuEnabled(this.gos) && !this.isFloatingFilterButtonDisplayed(column); } isFilterMenuItemEnabled(column) { return !!this.beans.filterManager?.isFilterAllowed(column) && !_isLegacyMenuEnabled(this.gos) && !this.isFilterMenuInHeaderEnabled(column) && !this.isFloatingFilterButtonDisplayed(column); } isFloatingFilterButtonEnabled(column) { return !column.getColDef().suppressFloatingFilterButton; } isFloatingFilterButtonDisplayed(column) { return !!column.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(column); } isSuppressMenuHide() { const gos = this.gos; const suppressMenuHide = gos.get("suppressMenuHide"); if (_isLegacyMenuEnabled(gos)) { return gos.exists("suppressMenuHide") ? suppressMenuHide : false; } return suppressMenuHide; } showColumnMenuCommon(menuFactory, params, containerType, filtersOnly) { const { positionBy, onClosedCallback } = params; const column = params.column; if (positionBy === "button") { const { buttonElement } = params; menuFactory?.showMenuAfterButtonClick(column, buttonElement, containerType, onClosedCallback, filtersOnly); } else if (positionBy === "mouse") { const { mouseEvent } = params; menuFactory?.showMenuAfterMouseEvent(column, mouseEvent, containerType, onClosedCallback, filtersOnly); } else if (column) { const beans = this.beans; const ctrlsSvc = beans.ctrlsSvc; ctrlsSvc.getScrollFeature().ensureColumnVisible(column, "auto"); _requestAnimationFrame(beans, () => { const headerCellCtrl = ctrlsSvc.getHeaderRowContainerCtrl(column.getPinned())?.getHeaderCtrlForColumn(column); if (headerCellCtrl) { menuFactory?.showMenuAfterButtonClick( column, headerCellCtrl.getAnchorElementForMenu(filtersOnly), containerType, onClosedCallback, filtersOnly ); } }); } } }; function _setColMenuVisible(column, visible, source) { if (column.menuVisible !== visible) { column.menuVisible = visible; column.dispatchColEvent("menuVisibleChanged", source); } } function getFilterMenuFactory(beans) { const { enterpriseMenuFactory, filterMenuFactory, gos } = beans; return enterpriseMenuFactory && _isLegacyMenuEnabled(gos) ? enterpriseMenuFactory : filterMenuFactory; } var SharedMenuModule = { moduleName: "SharedMenu", version: VERSION, beans: [MenuService], apiFunctions: { showColumnMenu, hidePopupMenu } }; var column_filters_default = ".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}"; function isColumnFilterPresent(beans) { const filterManager = beans.filterManager; return !!filterManager?.isColumnFilterPresent() || !!filterManager?.isAggregateFilterPresent(); } function getColumnFilterInstance(beans, key) { return beans.filterManager?.getColumnFilterInstance(key) ?? Promise.resolve(void 0); } function destroyFilter(beans, key) { const column = beans.colModel.getColDefCol(key); if (column) { return beans.colFilter?.destroyFilter(column, "api"); } } function setFilterModel(beans, model) { beans.frameworkOverrides.wrapIncoming(() => beans.filterManager?.setFilterModel(model)); } function getFilterModel(beans) { return beans.filterManager?.getFilterModel() ?? {}; } function getColumnFilterModel(beans, key, useUnapplied) { const { gos, colModel, colFilter } = beans; if (useUnapplied && !gos.get("enableFilterHandlers")) { _warn(288); useUnapplied = false; } const column = colModel.getColDefCol(key); return column ? colFilter?.getModelForColumn(column, useUnapplied) ?? null : null; } function setColumnFilterModel(beans, column, model) { return beans.filterManager?.setColumnFilterModel(column, model) ?? Promise.resolve(); } function showColumnFilter(beans, colKey) { const column = beans.colModel.getCol(colKey); if (!column) { _error(12, { colKey }); return; } beans.menuSvc?.showFilterMenu({ column, containerType: "columnFilter", positionBy: "auto" }); } function hideColumnFilter(beans) { beans.menuSvc?.hideFilterMenu(); } function getColumnFilterHandler(beans, colKey) { const column = beans.colModel.getCol(colKey); if (!column) { _error(12, { colKey }); return void 0; } return beans.colFilter?.getHandler(column, true); } function doFilterAction(beans, params) { const { colModel, colFilter, gos } = beans; if (!gos.get("enableFilterHandlers")) { _warn(287); return; } const { colId, action } = params; if (colId) { const column = colModel.getColById(colId); if (column) { colFilter?.updateModel(column, action); } } else { colFilter?.updateAllModels(action); } } var MONTH_LOCALE_TEXT = { january: "January", february: "February", march: "March", april: "April", may: "May", june: "June", july: "July", august: "August", september: "September", october: "October", november: "November", december: "December" }; var MONTH_KEYS = [ "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ]; function setFilterNumberComparator(a, b) { if (a == null) { return -1; } if (b == null) { return 1; } return Number.parseFloat(a) - Number.parseFloat(b); } function setFilterBigIntComparator(a, b) { if (a == null) { return -1; } if (b == null) { return 1; } const valueA = _parseBigIntOrNull(a); const valueB = _parseBigIntOrNull(b); if (valueA != null && valueB != null) { if (valueA === valueB) { return 0; } return valueA > valueB ? 1 : -1; } return String(a).localeCompare(String(b)); } function isValidDate(value) { return value instanceof Date && !isNaN(value.getTime()); } var filterParamsForEachDataType = { number: () => void 0, bigint: () => void 0, boolean: () => ({ maxNumConditions: 1, debounceMs: 0, filterOptions: [ "empty", { displayKey: "true", displayName: "True", predicate: (_filterValues, cellValue) => cellValue, numberOfInputs: 0 }, { displayKey: "false", displayName: "False", predicate: (_filterValues, cellValue) => cellValue === false, numberOfInputs: 0 } ] }), date: () => ({ isValidDate }), dateString: ({ dataTypeDefinition }) => ({ comparator: (filterDate, cellValue) => { const cellAsDate = dataTypeDefinition.dateParser(cellValue); if (cellValue == null || cellAsDate < filterDate) { return -1; } if (cellAsDate > filterDate) { return 1; } return 0; }, isValidDate: (value) => typeof value === "string" && isValidDate(dataTypeDefinition.dateParser(value)) }), dateTime: (args) => filterParamsForEachDataType.date(args), dateTimeString: (args) => filterParamsForEachDataType.dateString(args), object: () => void 0, text: () => void 0 }; var setFilterParamsForEachDataType = { number: () => ({ comparator: setFilterNumberComparator }), bigint: () => ({ comparator: setFilterBigIntComparator }), boolean: ({ t }) => ({ valueFormatter: (params) => _exists(params.value) ? t(String(params.value), params.value ? "True" : "False") : t("blanks", "(Blanks)") }), date: ({ formatValue, t }) => ({ valueFormatter: (params) => { const valueFormatted = formatValue(params); return _exists(valueFormatted) ? valueFormatted : t("blanks", "(Blanks)"); }, treeList: true, treeListFormatter: (pathKey, level) => { if (pathKey === "NaN") { return t("invalidDate", "Invalid Date"); } if (level === 1 && pathKey != null) { const monthKey = MONTH_KEYS[Number(pathKey) - 1]; return t(monthKey, MONTH_LOCALE_TEXT[monthKey]); } return pathKey ?? t("blanks", "(Blanks)"); }, treeListPathGetter: (date) => _getDateParts(date, false) }), dateString: ({ formatValue, dataTypeDefinition, t }) => ({ valueFormatter: (params) => { const valueFormatted = formatValue(params); return _exists(valueFormatted) ? valueFormatted : t("blanks", "(Blanks)"); }, treeList: true, treeListPathGetter: (value) => _getDateParts(dataTypeDefinition.dateParser(value ?? void 0), false), treeListFormatter: (pathKey, level) => { if (level === 1 && pathKey != null) { const monthKey = MONTH_KEYS[Number(pathKey) - 1]; return t(monthKey, MONTH_LOCALE_TEXT[monthKey]); } return pathKey ?? t("blanks", "(Blanks)"); } }), dateTime: (args) => { const params = setFilterParamsForEachDataType.date(args); params.treeListPathGetter = _getDateParts; return params; }, dateTimeString(args) { const convertToDate = args.dataTypeDefinition.dateParser; const params = setFilterParamsForEachDataType.dateString(args); params.treeListPathGetter = (value) => _getDateParts(convertToDate(value ?? void 0)); return params; }, object: ({ formatValue, t }) => ({ valueFormatter: (params) => { const valueFormatted = formatValue(params); return _exists(valueFormatted) ? valueFormatted : t("blanks", "(Blanks)"); } }), text: () => void 0 }; function _getFilterParamsForDataType(filter, existingFilterParams, existingFilterValueGetter, dataTypeDefinition, formatValue, beans, translate) { let filterParams = existingFilterParams; let filterValueGetter = existingFilterValueGetter; const usingSetFilter = filter === "agSetColumnFilter"; if (!filterValueGetter && dataTypeDefinition.baseDataType === "object" && !usingSetFilter) { filterValueGetter = ({ column, node }) => formatValue({ column, node, value: beans.valueSvc.getValue(column, node, "data") }); } const filterParamsMap = usingSetFilter ? setFilterParamsForEachDataType : filterParamsForEachDataType; const filterParamsGetter = filterParamsMap[dataTypeDefinition.baseDataType]; const newFilterParams = filterParamsGetter({ dataTypeDefinition, formatValue, t: translate }); filterParams = typeof existingFilterParams === "object" ? { ...newFilterParams, ...existingFilterParams } : newFilterParams; return { filterParams, filterValueGetter }; } var defaultFilters = { boolean: "agTextColumnFilter", date: "agDateColumnFilter", dateString: "agDateColumnFilter", dateTime: "agDateColumnFilter", dateTimeString: "agDateColumnFilter", bigint: "agBigIntColumnFilter", number: "agNumberColumnFilter", object: "agTextColumnFilter", text: "agTextColumnFilter" }; var defaultFloatingFilters = { boolean: "agTextColumnFloatingFilter", date: "agDateColumnFloatingFilter", dateString: "agDateColumnFloatingFilter", dateTime: "agDateColumnFloatingFilter", dateTimeString: "agDateColumnFloatingFilter", bigint: "agBigIntColumnFloatingFilter", number: "agNumberColumnFloatingFilter", object: "agTextColumnFloatingFilter", text: "agTextColumnFloatingFilter" }; function _getDefaultSimpleFilter(cellDataType, isFloating = false) { const filterSet = isFloating ? defaultFloatingFilters : defaultFilters; return filterSet[cellDataType ?? "text"]; } function _getDefaultFloatingFilterType(frameworkOverrides, def, getFromDefault) { if (def == null) { return null; } let defaultFloatingFilterType = null; const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, def); if (compName) { const floatingFilterTypeMap = { agSetColumnFilter: "agSetColumnFloatingFilter", agMultiColumnFilter: "agMultiColumnFloatingFilter", agGroupColumnFilter: "agGroupColumnFloatingFilter", agNumberColumnFilter: "agNumberColumnFloatingFilter", agBigIntColumnFilter: "agBigIntColumnFloatingFilter", agDateColumnFilter: "agDateColumnFloatingFilter", agTextColumnFilter: "agTextColumnFloatingFilter" }; defaultFloatingFilterType = floatingFilterTypeMap[compName]; } else { const usingDefaultFilter = jsComp == null && fwComp == null && def.filter === true; if (usingDefaultFilter) { defaultFloatingFilterType = getFromDefault(); } } return defaultFloatingFilterType; } var DUMMY_HANDLER = { filterHandler: () => ({ doesFilterPass: () => true }) }; function isAggFilter(column, isPivotMode2, isPivotActive, groupFilterEnabled) { const isSecondary = !column.isPrimary(); if (isSecondary) { return true; } const isShowingPrimaryColumns = !isPivotActive; const isValueActive = column.isValueActive(); if (!isValueActive || !isShowingPrimaryColumns) { return false; } if (isPivotMode2) { return true; } return groupFilterEnabled; } var ColumnFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colFilter"; this.allColumnFilters = /* @__PURE__ */ new Map(); this.allColumnListeners = /* @__PURE__ */ new Map(); this.activeAggregateFilters = []; this.activeColumnFilters = []; this.processingFilterChange = false; this.modelUpdates = []; this.columnModelUpdates = []; this.state = /* @__PURE__ */ new Map(); this.handlerMap = { ...FILTER_HANDLER_MAP }; this.isGlobalButtons = false; this.activeFilterComps = /* @__PURE__ */ new Set(); } postConstruct() { this.addManagedEventListeners({ gridColumnsChanged: this.onColumnsChanged.bind(this), dataTypesInferred: this.processFilterModelUpdateQueue.bind(this) }); this.addManagedPropertyListener("pivotMode", this.onPivotModeChanged.bind(this)); const gos = this.gos; const initialFilterModel = { ...gos.get("initialState")?.filter?.filterModel ?? {} }; this.initialModel = initialFilterModel; this.model = { ...initialFilterModel }; if (!gos.get("enableFilterHandlers")) { delete this.handlerMap["agMultiColumnFilter"]; } } refreshModel() { this.onNewRowsLoaded("rowDataUpdated"); } setModel(model, source = "api", forceUpdateActive) { const { colModel, dataTypeSvc, filterManager } = this.beans; if (dataTypeSvc?.isPendingInference) { this.modelUpdates.push({ model, source }); return; } const allPromises = []; const previousModel = this.getModel(true); if (model) { const modelKeys = new Set(Object.keys(model)); this.allColumnFilters.forEach((filterWrapper, colId) => { const newModel = model[colId]; allPromises.push(this.setModelOnFilterWrapper(filterWrapper, newModel)); modelKeys.delete(colId); }); modelKeys.forEach((colId) => { const column = colModel.getColDefCol(colId) || colModel.getCol(colId); if (!column) { _warn(62, { colId }); return; } if (!column.isFilterAllowed()) { _warn(63, { colId }); return; } const filterWrapper = this.getOrCreateFilterWrapper(column, true); if (!filterWrapper) { _warn(64, { colId }); return; } allPromises.push(this.setModelOnFilterWrapper(filterWrapper, model[colId], true)); }); } else { this.model = {}; this.allColumnFilters.forEach((filterWrapper) => { allPromises.push(this.setModelOnFilterWrapper(filterWrapper, null)); }); } AgPromise.all(allPromises).then(() => { const currentModel = this.getModel(true); const columns = []; this.allColumnFilters.forEach((filterWrapper, colId) => { const before = previousModel ? previousModel[colId] : null; const after = currentModel ? currentModel[colId] : null; if (!_jsonEquals(before, after)) { columns.push(filterWrapper.column); } }); if (columns.length > 0) { filterManager?.onFilterChanged({ columns, source }); } else if (forceUpdateActive) { this.updateActive("filterChanged"); } }); } getModel(excludeInitialState) { const result = {}; const { allColumnFilters, initialModel, beans: { colModel } } = this; allColumnFilters.forEach((filterWrapper, key) => { const model = this.getModelFromFilterWrapper(filterWrapper); if (_exists(model)) { result[key] = model; } }); if (!excludeInitialState) { for (const colId of Object.keys(initialModel)) { const model = initialModel[colId]; if (_exists(model) && !allColumnFilters.has(colId) && colModel.getCol(colId)?.isFilterAllowed()) { result[colId] = model; } } } return result; } setState(model, state, source = "api") { this.state.clear(); if (state) { for (const colId of Object.keys(state)) { const newState = state[colId]; this.state.set(colId, { model: _getFilterModel(this.model, colId), state: newState }); } } this.setModel(model, source, true); } getState() { const state = this.state; if (!state.size) { return void 0; } const newState = {}; let hasNewState = false; state.forEach((colState, colId) => { const actualState = colState.state; if (actualState != null) { hasNewState = true; newState[colId] = actualState; } }); return hasNewState ? newState : void 0; } getModelFromFilterWrapper(filterWrapper) { const column = filterWrapper.column; const colId = column.getColId(); if (filterWrapper.isHandler) { return _getFilterModel(this.model, colId); } const filter = filterWrapper.filter; if (filter) { if (typeof filter.getModel !== "function") { _warn(66); return null; } return filter.getModel(); } return _getFilterModel(this.initialModel, colId); } isFilterPresent() { return this.activeColumnFilters.length > 0; } isAggFilterPresent() { return !!this.activeAggregateFilters.length; } disableFilters() { this.initialModel = {}; const { allColumnFilters } = this; if (allColumnFilters.size) { allColumnFilters.forEach( (filterWrapper) => this.disposeFilterWrapper(filterWrapper, "advancedFilterEnabled") ); return true; } return false; } updateActiveFilters() { const isFilterActive = (filter) => { if (!filter) { return false; } if (!filter.isFilterActive) { _warn(67); return false; } return filter.isFilterActive(); }; const { colModel, gos } = this.beans; const groupFilterEnabled = !!_getGroupAggFiltering(gos); const activeAggregateFilters = []; const activeColumnFilters = []; const addFilter = (column, filterActive, doesFilterPassWrapper) => { if (filterActive) { if (isAggFilter(column, colModel.isPivotMode(), colModel.isPivotActive(), groupFilterEnabled)) { activeAggregateFilters.push(doesFilterPassWrapper); } else { activeColumnFilters.push(doesFilterPassWrapper); } } }; const promises = []; this.allColumnFilters.forEach((filterWrapper) => { const column = filterWrapper.column; const colId = column.getColId(); if (filterWrapper.isHandler) { promises.push( AgPromise.resolve().then(() => { addFilter(column, this.isHandlerActive(column), { colId, isHandler: true, handler: filterWrapper.handler, handlerParams: filterWrapper.handlerParams }); }) ); } else { const promise = getFilterUiFromWrapper(filterWrapper); if (promise) { promises.push( promise.then((filter) => { addFilter(column, isFilterActive(filter), { colId, isHandler: false, comp: filter }); }) ); } } }); return AgPromise.all(promises).then(() => { this.activeAggregateFilters = activeAggregateFilters; this.activeColumnFilters = activeColumnFilters; }); } updateFilterFlagInColumns(source, additionalEventAttributes) { const promises = []; this.allColumnFilters.forEach((filterWrapper) => { const column = filterWrapper.column; if (filterWrapper.isHandler) { promises.push( AgPromise.resolve().then(() => { this.setColFilterActive( column, this.isHandlerActive(column), source, additionalEventAttributes ); }) ); } else { const promise = getFilterUiFromWrapper(filterWrapper); if (promise) { promises.push( promise.then((filter) => { this.setColFilterActive( column, filter.isFilterActive(), source, additionalEventAttributes ); }) ); } } }); this.beans.groupFilter?.updateFilterFlags(source, additionalEventAttributes); return AgPromise.all(promises); } doFiltersPass(node, colIdToSkip, targetAggregates) { const { data, aggData } = node; const targetedFilters = targetAggregates ? this.activeAggregateFilters : this.activeColumnFilters; const targetedData = targetAggregates ? aggData : data; const model = this.model; for (let i = 0; i < targetedFilters.length; i++) { const filter = targetedFilters[i]; const { colId, isHandler } = filter; if (colId === colIdToSkip) { continue; } if (isHandler) { const { handler, handlerParams } = filter; if (!handler.doesFilterPass({ node, data: targetedData, model: _getFilterModel(model, colId), handlerParams })) { return false; } } else { const comp = filter.comp; if (typeof comp.doesFilterPass !== "function") { _error(91); continue; } if (!comp.doesFilterPass({ node, data: targetedData })) { return false; } } } return true; } getHandlerParams(column) { const wrapper = this.allColumnFilters.get(column.getColId()); return wrapper?.isHandler ? wrapper.handlerParams : void 0; } // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens. // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer) // which results in React State getting applied in the main application, triggering a useEffect() to // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was // getting it's useEffect() triggered in this way. callOnFilterChangedOutsideRenderCycle(params) { const { rowRenderer, filterManager } = this.beans; const action = () => { if (this.isAlive()) { filterManager?.onFilterChanged(params); } }; if (rowRenderer.isRefreshInProgress()) { setTimeout(action, 0); } else { action(); } } updateBeforeFilterChanged(params = {}) { const { column, additionalEventAttributes } = params; const colId = column?.getColId(); return this.updateActiveFilters().then( () => this.updateFilterFlagInColumns("filterChanged", additionalEventAttributes).then(() => { this.allColumnFilters.forEach((filterWrapper) => { const { column: filterColumn, isHandler } = filterWrapper; if (colId === filterColumn.getColId()) { return; } if (isHandler) { filterWrapper.handler.onAnyFilterChanged?.(); } getFilterUiFromWrapper(filterWrapper, isHandler)?.then((filter) => { if (typeof filter?.onAnyFilterChanged === "function") { filter.onAnyFilterChanged(); } }); }); this.processingFilterChange = true; }) ); } updateAfterFilterChanged() { this.processingFilterChange = false; } isSuppressFlashingCellsBecauseFiltering() { const allowShowChangeAfterFilter = this.gos.get("allowShowChangeAfterFilter") ?? false; return !allowShowChangeAfterFilter && this.processingFilterChange; } onNewRowsLoaded(source) { const promises = []; this.allColumnFilters.forEach((filterWrapper) => { const isHandler = filterWrapper.isHandler; if (isHandler) { filterWrapper.handler.onNewRowsLoaded?.(); } const promise = getFilterUiFromWrapper(filterWrapper, isHandler); if (promise) { promises.push( promise.then((filter) => { filter.onNewRowsLoaded?.(); }) ); } }); AgPromise.all(promises).then(() => this.updateActive(source, { afterDataChange: true })); } updateActive(source, additionalEventAttributes) { this.updateFilterFlagInColumns(source, additionalEventAttributes).then(() => this.updateActiveFilters()); } createGetValue(filterColumn, filterValueGetterOverride) { const { filterValueSvc, colModel } = this.beans; return (rowNode, column) => { const columnToUse = column ? colModel.getCol(column) : filterColumn; return columnToUse ? filterValueSvc.getValue(columnToUse, rowNode, filterValueGetterOverride) : void 0; }; } isFilterActive(column) { const filterWrapper = this.cachedFilter(column); if (filterWrapper?.isHandler) { return this.isHandlerActive(column); } const filter = filterWrapper?.filter; if (filter) { return filter.isFilterActive(); } return _getFilterModel(this.initialModel, column.getColId()) != null; } isHandlerActive(column) { const active = _exists(_getFilterModel(this.model, column.getColId())); if (active) { return active; } const groupFilter = this.beans.groupFilter; return groupFilter?.isGroupFilter(column) ? groupFilter.isFilterActive(column) : false; } getOrCreateFilterUi(column) { const filterWrapper = this.getOrCreateFilterWrapper(column, true); return filterWrapper ? getFilterUiFromWrapper(filterWrapper) : null; } getFilterUiForDisplay(column) { const filterWrapper = this.getOrCreateFilterWrapper(column, true); if (!filterWrapper) { return null; } const compPromise = getFilterUiFromWrapper(filterWrapper); if (!compPromise) { return null; } return compPromise.then((comp) => ({ comp, params: filterWrapper.filterUi.filterParams, isHandler: filterWrapper.isHandler })); } getHandler(column, createIfMissing) { const filterWrapper = this.getOrCreateFilterWrapper(column, createIfMissing); return filterWrapper?.isHandler ? filterWrapper.handler : void 0; } getOrCreateFilterWrapper(column, createIfMissing) { if (!column.isFilterAllowed()) { return void 0; } let filterWrapper = this.cachedFilter(column); if (!filterWrapper && createIfMissing) { filterWrapper = this.createFilterWrapper(column); this.setColumnFilterWrapper(column, filterWrapper); } return filterWrapper; } cachedFilter(column) { return this.allColumnFilters.get(column.getColId()); } getDefaultFilter(column, isFloating = false) { return this.getDefaultFilterFromDataType(() => this.beans.dataTypeSvc?.getBaseDataType(column), isFloating); } getDefaultFilterFromDataType(getCellDataType, isFloating = false) { if (_isSetFilterByDefault(this.gos)) { return isFloating ? "agSetColumnFloatingFilter" : "agSetColumnFilter"; } return _getDefaultSimpleFilter(getCellDataType(), isFloating); } getDefaultFloatingFilter(column) { return this.getDefaultFilter(column, true); } createFilterComp(column, filterDef, defaultFilter, getFilterParams, isHandler, source) { const createFilterCompDetails = () => { const params = this.createFilterCompParams(column, isHandler, source); const updatedParams = getFilterParams(params, isHandler); return _getFilterDetails(this.beans.userCompFactory, filterDef, updatedParams, defaultFilter); }; const compDetails = createFilterCompDetails(); if (!compDetails) { return null; } const createFilterUi = (update) => { return (update ? createFilterCompDetails() : compDetails).newAgStackInstance(); }; return { compDetails, createFilterUi }; } createFilterInstance(column, filterDef, defaultFilter, getFilterParams) { const selectableFilter = this.beans.selectableFilter; if (selectableFilter?.isSelectable(filterDef)) { filterDef = selectableFilter.getFilterDef(column, filterDef); } const { handler, handlerParams, handlerGenerator } = this.createHandler(column, filterDef, defaultFilter) ?? {}; const filterCompDetails = this.createFilterComp( column, filterDef, defaultFilter, getFilterParams, !!handler, "init" ); if (!filterCompDetails) { return { compDetails: null, createFilterUi: null, handler, handlerGenerator, handlerParams }; } const { compDetails, createFilterUi } = filterCompDetails; if (this.isGlobalButtons) { const hasLocalButtons = !!compDetails.params?.buttons?.length; if (!hasLocalButtons) { _warn(281, { colId: column.getColId() }); } } return { compDetails, handler, handlerGenerator, handlerParams, createFilterUi }; } createBaseFilterParams(column, forFloatingFilter) { const { filterManager, rowModel } = this.beans; return _addGridCommonParams(this.gos, { column, colDef: column.getColDef(), getValue: this.createGetValue(column), doesRowPassOtherFilter: forFloatingFilter ? () => true : (node) => filterManager?.doesRowPassOtherFilters(column.getColId(), node) ?? true, // to avoid breaking changes to `filterParams` defined as functions // we need to provide the below options even though they are not valid for handlers rowModel }); } createFilterCompParams(column, useHandler, source, forFloatingFilter) { const filterChangedCallback = this.filterChangedCallbackFactory(column); const params = this.createBaseFilterParams(column, forFloatingFilter); params.filterChangedCallback = filterChangedCallback; params.filterModifiedCallback = forFloatingFilter ? () => { } : (additionalEventAttributes) => this.filterModified(column, additionalEventAttributes); if (useHandler) { const displayParams = params; const colId = column.getColId(); const model = _getFilterModel(this.model, colId); displayParams.model = model; displayParams.state = this.state.get(colId) ?? { model }; displayParams.onModelChange = (model2, additionalEventAttributes) => { this.updateStoredModel(colId, model2); this.refreshHandlerAndUi(column, model2, "ui", false, additionalEventAttributes).then(() => { filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" }); }); }; displayParams.onStateChange = (state) => { this.updateState(column, state); this.updateOrRefreshFilterUi(column); }; displayParams.onAction = (action, additionalEventAttributes, event) => { this.updateModel(column, action, additionalEventAttributes); this.dispatchLocalEvent({ type: "filterAction", column, action, event }); }; displayParams.getHandler = () => this.getHandler(column, true); displayParams.onUiChange = (additionalEventAttributes) => this.filterUiChanged(column, additionalEventAttributes); displayParams.source = source; } return params; } createFilterUiForHandler(compDetails, createFilterUi) { return createFilterUi ? { created: false, create: createFilterUi, filterParams: compDetails.params, compDetails } : null; } createFilterUiLegacy(compDetails, createFilterUi, updateInstanceCallback) { const promise = createFilterUi(); const filterUi = { created: true, create: createFilterUi, filterParams: compDetails.params, compDetails, promise }; promise.then(updateInstanceCallback); return filterUi; } createFilterWrapper(column) { const { compDetails, handler, handlerGenerator, handlerParams, createFilterUi } = this.createFilterInstance( column, column.getColDef(), this.getDefaultFilter(column), (params) => params ); const colId = column.getColId(); if (handler) { delete this.initialModel[colId]; handler.init?.({ ...handlerParams, source: "init", model: _getFilterModel(this.model, colId) }); return { column, isHandler: true, handler, handlerGenerator, handlerParams, filterUi: this.createFilterUiForHandler(compDetails, createFilterUi) }; } if (createFilterUi) { const filterWrapper = { column, filterUi: null, isHandler: false }; filterWrapper.filterUi = this.createFilterUiLegacy(compDetails, createFilterUi, (filterComp) => { filterWrapper.filter = filterComp ?? void 0; }); return filterWrapper; } return { column, filterUi: null, isHandler: false }; } createHandlerFunc(column, filterDef, defaultFilter) { const { gos, frameworkOverrides, registry } = this.beans; let doesFilterPass; const getFilterHandlerFromDef = (filterDef2) => { const filter = filterDef2.filter; if (isColumnFilterComp(filter)) { const handler = filter.handler; if (handler) { return handler; } doesFilterPass = filter.doesFilterPass; if (doesFilterPass) { return () => ({ doesFilterPass }); } return void 0; } return typeof filter === "string" ? filter : void 0; }; const enableFilterHandlers = gos.get("enableFilterHandlers"); const providedFilterHandler = enableFilterHandlers ? getFilterHandlerFromDef(filterDef) : void 0; const resolveProvidedFilterHandler = (handlerName2) => () => this.createBean(registry.createDynamicBean(handlerName2, true)); let filterHandler; let handlerName; if (typeof providedFilterHandler === "string") { const userFilterHandler = gos.get("filterHandlers")?.[providedFilterHandler]; if (userFilterHandler != null) { filterHandler = userFilterHandler; } else if (FILTER_HANDLERS.has(providedFilterHandler)) { filterHandler = resolveProvidedFilterHandler(providedFilterHandler); handlerName = providedFilterHandler; } } else { filterHandler = providedFilterHandler; } if (!filterHandler) { let filterName; const { compName, jsComp, fwComp } = _getFilterCompKeys(frameworkOverrides, filterDef); if (compName) { filterName = compName; } else { const usingDefaultFilter = jsComp == null && fwComp == null && filterDef.filter === true; if (usingDefaultFilter) { filterName = defaultFilter; } } handlerName = this.handlerMap[filterName]; if (handlerName) { filterHandler = resolveProvidedFilterHandler(handlerName); } } if (!filterHandler) { if (!enableFilterHandlers) { return void 0; } if (_isClientSideRowModel(gos)) { _warn(277, { colId: column.getColId() }); } return DUMMY_HANDLER; } return { filterHandler, handlerNameOrCallback: doesFilterPass ?? handlerName }; } createHandler(column, filterDef, defaultFilter) { const handlerFunc = this.createHandlerFunc(column, filterDef, defaultFilter); if (!handlerFunc) { return void 0; } const filterParams = _mergeFilterParamsWithApplicationProvidedParams( this.beans.userCompFactory, filterDef, this.createFilterCompParams(column, true, "init") ); const { handlerNameOrCallback, filterHandler } = handlerFunc; const { handler, handlerParams } = this.createHandlerFromFunc(column, filterHandler, filterParams); return { handler, handlerParams, handlerGenerator: handlerNameOrCallback ?? filterHandler }; } createHandlerFromFunc(column, filterHandler, filterParams) { const colDef = column.getColDef(); const handler = filterHandler(_addGridCommonParams(this.gos, { column, colDef })); const handlerParams = this.createHandlerParams(column, filterParams); return { handler, handlerParams }; } createHandlerParams(column, filterParams) { const colDef = column.getColDef(); const colId = column.getColId(); const filterChangedCallback = this.filterChangedCallbackFactory(column); return _addGridCommonParams(this.gos, { colDef, column, getValue: this.createGetValue(column), doesRowPassOtherFilter: (node) => this.beans.filterManager?.doesRowPassOtherFilters(colId, node) ?? true, onModelChange: (newModel, additionalEventAttributes) => { this.updateStoredModel(colId, newModel); this.refreshHandlerAndUi(column, newModel, "handler", false, additionalEventAttributes).then(() => { filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" }); }); }, onModelAsStringChange: () => { column.dispatchColEvent("filterChanged", "filterChanged"); this.dispatchLocalEvent({ type: "filterModelAsStringChanged", column }); }, filterParams }); } onColumnsChanged() { const columns = []; const { colModel, filterManager, groupFilter } = this.beans; this.allColumnFilters.forEach((wrapper, colId) => { let currentColumn; if (wrapper.column.isPrimary()) { currentColumn = colModel.getColDefCol(colId); } else { currentColumn = colModel.getCol(colId); } if (currentColumn && currentColumn === wrapper.column) { return; } columns.push(wrapper.column); this.disposeFilterWrapper(wrapper, "columnChanged"); this.disposeColumnListener(colId); }); const allFiltersAreGroupFilters = groupFilter && columns.every((col) => groupFilter.isGroupFilter(col)); if (columns.length > 0 && !allFiltersAreGroupFilters) { filterManager?.onFilterChanged({ columns, source: "api" }); } } isFilterAllowed(column) { const isFilterAllowed = column.isFilterAllowed(); if (!isFilterAllowed) { return false; } const groupFilter = this.beans.groupFilter; if (groupFilter?.isGroupFilter(column)) { return groupFilter.isFilterAllowed(column); } return true; } getFloatingFilterCompDetails(column, showParentFilter) { const { userCompFactory, frameworkOverrides, selectableFilter, gos } = this.beans; const parentFilterInstance = (callback) => { const filterComponent = this.getOrCreateFilterUi(column); filterComponent?.then((instance) => { callback(_unwrapUserComp(instance)); }); }; const colDef = column.getColDef(); const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column, colDef) : colDef; const defaultFloatingFilterType = _getDefaultFloatingFilterType(frameworkOverrides, filterDef, () => this.getDefaultFloatingFilter(column)) ?? "agReadOnlyFloatingFilter"; const isReactive = gos.get("enableFilterHandlers"); const filterParams = _mergeFilterParamsWithApplicationProvidedParams( userCompFactory, filterDef, this.createFilterCompParams(column, isReactive, "init", true) ); const params = _addGridCommonParams(gos, { column, filterParams, currentParentModel: () => this.getCurrentFloatingFilterParentModel(column), parentFilterInstance, showParentFilter }); if (isReactive) { const displayParams = params; const colId = column.getColId(); const filterChangedCallback = this.filterChangedCallbackFactory(column); displayParams.onUiChange = (additionalEventAttributes) => this.floatingFilterUiChanged(column, additionalEventAttributes); displayParams.model = _getFilterModel(this.model, colId); displayParams.onModelChange = (model, additionalEventAttributes) => { this.updateStoredModel(colId, model); this.refreshHandlerAndUi(column, model, "floating", true, additionalEventAttributes).then(() => { filterChangedCallback({ ...additionalEventAttributes, source: "columnFilter" }); }); }; displayParams.getHandler = () => this.getHandler(column, true); displayParams.source = "init"; } return _getFloatingFilterCompDetails(userCompFactory, colDef, params, defaultFloatingFilterType); } getCurrentFloatingFilterParentModel(column) { return this.getModelFromFilterWrapper(this.cachedFilter(column) ?? { column }); } destroyFilterUi(filterWrapper, column, compDetails, createFilterUi) { const source = "paramsUpdated"; if (filterWrapper.isHandler) { const colId = column.getColId(); delete this.initialModel[colId]; this.state.delete(colId); const filterUi = filterWrapper.filterUi; const newFilterUi = this.createFilterUiForHandler(compDetails, createFilterUi); filterWrapper.filterUi = newFilterUi; const eventSvc = this.eventSvc; if (filterUi?.created) { filterUi.promise.then((filter) => { this.destroyBean(filter); eventSvc.dispatchEvent({ type: "filterDestroyed", source, column }); }); } else { eventSvc.dispatchEvent({ type: "filterHandlerDestroyed", source, column }); } } else { this.destroyFilter(column, source); } } // destroys the filter, so it no longer takes part destroyFilter(column, source = "api") { const colId = column.getColId(); const filterWrapper = this.allColumnFilters.get(colId); this.disposeColumnListener(colId); delete this.initialModel[colId]; if (filterWrapper) { this.disposeFilterWrapper(filterWrapper, source).then((wasActive) => { if (wasActive && this.isAlive()) { this.beans.filterManager?.onFilterChanged({ columns: [column], source: "api" }); } }); } } disposeColumnListener(colId) { const columnListener = this.allColumnListeners.get(colId); if (columnListener) { this.allColumnListeners.delete(colId); columnListener(); } } disposeFilterWrapper(filterWrapper, source) { let isActive = false; const { column, isHandler, filterUi } = filterWrapper; const colId = column.getColId(); if (isHandler) { isActive = this.isHandlerActive(column); this.destroyBean(filterWrapper.handler); delete this.model[colId]; this.state.delete(colId); } const removeFilter = () => { this.setColFilterActive(column, false, "filterDestroyed"); this.allColumnFilters.delete(colId); this.eventSvc.dispatchEvent({ type: "filterDestroyed", source, column }); }; if (filterUi) { if (filterUi.created) { return filterUi.promise.then((filter) => { isActive = isHandler ? isActive : !!filter?.isFilterActive(); this.destroyBean(filter); removeFilter(); return isActive; }); } else { removeFilter(); } } return AgPromise.resolve(isActive); } filterChangedCallbackFactory(column) { return (additionalEventAttributes) => { this.callOnFilterChangedOutsideRenderCycle({ additionalEventAttributes, columns: [column], column, source: additionalEventAttributes?.source ?? "columnFilter" }); }; } filterParamsChanged(colId, source = "api") { const filterWrapper = this.allColumnFilters.get(colId); if (!filterWrapper) { return; } const beans = this.beans; const column = filterWrapper.column; const colDef = column.getColDef(); const isFilterAllowed = column.isFilterAllowed(); const defaultFilter = this.getDefaultFilter(column); const selectableFilter = beans.selectableFilter; const filterDef = selectableFilter?.isSelectable(colDef) ? selectableFilter.getFilterDef(column, colDef) : colDef; const handlerFunc = isFilterAllowed ? this.createHandlerFunc(column, filterDef, this.getDefaultFilter(column)) : void 0; const isHandler = !!handlerFunc; const wasHandler = filterWrapper.isHandler; if (wasHandler != isHandler) { this.destroyFilter(column, "paramsUpdated"); return; } const { compDetails, createFilterUi } = (isFilterAllowed ? this.createFilterComp(column, filterDef, defaultFilter, (params) => params, isHandler, "colDef") : null) ?? { compDetails: null, createFilterUi: null }; const newFilterParams = compDetails?.params ?? _mergeFilterParamsWithApplicationProvidedParams( beans.userCompFactory, filterDef, this.createFilterCompParams(column, isHandler, "colDef") ); if (wasHandler) { const handlerGenerator = handlerFunc?.handlerNameOrCallback ?? handlerFunc?.filterHandler; const existingModel = _getFilterModel(this.model, colId); if (filterWrapper.handlerGenerator != handlerGenerator) { const oldHandler = filterWrapper.handler; const { handler, handlerParams } = this.createHandlerFromFunc( column, handlerFunc.filterHandler, newFilterParams ); filterWrapper.handler = handler; filterWrapper.handlerParams = handlerParams; filterWrapper.handlerGenerator = handlerGenerator; delete this.model[colId]; handler.init?.({ ...handlerParams, source: "init", model: null }); this.destroyBean(oldHandler); if (existingModel != null) { this.beans.filterManager?.onFilterChanged({ columns: [column], source }); } } else { const handlerParams = this.createHandlerParams(column, compDetails?.params); filterWrapper.handlerParams = handlerParams; filterWrapper.handler.refresh?.({ ...handlerParams, source: "colDef", model: existingModel }); } } if (this.areFilterCompsDifferent(filterWrapper.filterUi?.compDetails ?? null, compDetails) || !filterWrapper.filterUi || !compDetails) { this.destroyFilterUi(filterWrapper, column, compDetails, createFilterUi); return; } filterWrapper.filterUi.filterParams = newFilterParams; getFilterUiFromWrapper(filterWrapper, wasHandler)?.then((filter) => { const shouldRefreshFilter = filter?.refresh ? filter.refresh(newFilterParams) : true; if (shouldRefreshFilter === false) { this.destroyFilterUi(filterWrapper, column, compDetails, createFilterUi); } else { this.dispatchLocalEvent({ type: "filterParamsChanged", column, params: newFilterParams }); } }); } refreshHandlerAndUi(column, model, source, createIfMissing, additionalEventAttributes) { const filterWrapper = this.cachedFilter(column); if (!filterWrapper) { if (createIfMissing) { this.getOrCreateFilterWrapper(column, true); } return AgPromise.resolve(); } if (!filterWrapper.isHandler) { return AgPromise.resolve(); } const { filterUi, handler, handlerParams } = filterWrapper; return _refreshHandlerAndUi( () => { if (filterUi) { const { created, filterParams } = filterUi; if (created) { return filterUi.promise.then((filter) => { return filter ? { filter, filterParams } : void 0; }); } else { filterUi.refreshed = true; } } return AgPromise.resolve(void 0); }, handler, handlerParams, model, this.state.get(column.getColId()) ?? { model }, source, additionalEventAttributes ); } setColumnFilterWrapper(column, filterWrapper) { const colId = column.getColId(); this.allColumnFilters.set(colId, filterWrapper); this.allColumnListeners.set( colId, this.addManagedListeners(column, { colDefChanged: () => this.filterParamsChanged(colId) })[0] ); } areFilterCompsDifferent(oldCompDetails, newCompDetails) { if (!newCompDetails || !oldCompDetails) { return true; } const { componentClass: oldComponentClass } = oldCompDetails; const { componentClass: newComponentClass } = newCompDetails; const isSameComponentClass = oldComponentClass === newComponentClass || // react hooks returns new wrappers, so check nested render method oldComponentClass?.render && newComponentClass?.render && oldComponentClass.render === newComponentClass.render; return !isSameComponentClass; } hasFloatingFilters() { const gridColumns = this.beans.colModel.getCols(); return gridColumns.some((col) => col.getColDef().floatingFilter); } getFilterInstance(key) { const column = this.beans.colModel.getColDefCol(key); if (!column) { return Promise.resolve(void 0); } const filterPromise = this.getOrCreateFilterUi(column); if (!filterPromise) { return Promise.resolve(null); } return new Promise((resolve) => { filterPromise.then((filter) => { resolve(_unwrapUserComp(filter)); }); }); } processFilterModelUpdateQueue() { this.modelUpdates.forEach(({ model, source }) => this.setModel(model, source)); this.modelUpdates = []; this.columnModelUpdates.forEach(({ key, model, resolve }) => { this.setModelForColumn(key, model).then(() => resolve()); }); this.columnModelUpdates = []; } getModelForColumn(column, useUnapplied) { if (useUnapplied) { const { state, model } = this; const colId = column.getColId(); const colState = state.get(colId); if (colState) { return colState.model ?? null; } return _getFilterModel(model, colId); } const filterWrapper = this.cachedFilter(column); return filterWrapper ? this.getModelFromFilterWrapper(filterWrapper) : null; } setModelForColumn(key, model) { if (this.beans.dataTypeSvc?.isPendingInference) { let resolve = () => { }; const promise = new Promise((res) => { resolve = res; }); this.columnModelUpdates.push({ key, model, resolve }); return promise; } return new Promise((resolve) => { this.setModelForColumnLegacy(key, model).then((result) => resolve(result)); }); } getStateForColumn(colId) { return this.state.get(colId) ?? { model: _getFilterModel(this.model, colId) }; } setModelForColumnLegacy(key, model) { const column = this.beans.colModel.getColDefCol(key); const filterWrapper = column ? this.getOrCreateFilterWrapper(column, true) : null; return filterWrapper ? this.setModelOnFilterWrapper(filterWrapper, model) : AgPromise.resolve(); } setColDefPropsForDataType(colDef, dataTypeDefinition, formatValue) { const providedFilter = colDef.filter; const filter = providedFilter === true ? this.getDefaultFilterFromDataType(() => dataTypeDefinition.baseDataType) : providedFilter; if (typeof filter !== "string") { return; } let filterParams; let filterValueGetter; const beans = this.beans; const { filterParams: colDefFilterParams, filterValueGetter: colDefFilterValueGetter } = colDef; if (filter === "agMultiColumnFilter") { ({ filterParams, filterValueGetter } = beans.multiFilter?.getParamsForDataType( colDefFilterParams, colDefFilterValueGetter, dataTypeDefinition, formatValue ) ?? {}); } else { ({ filterParams, filterValueGetter } = _getFilterParamsForDataType( filter, colDefFilterParams, colDefFilterValueGetter, dataTypeDefinition, formatValue, beans, this.getLocaleTextFunc() )); } colDef.filterParams = filterParams; if (filterValueGetter) { colDef.filterValueGetter = filterValueGetter; } } // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event setColFilterActive(column, active, source, additionalEventAttributes) { if (column.filterActive !== active) { column.filterActive = active; column.dispatchColEvent("filterActiveChanged", source); } column.dispatchColEvent("filterChanged", source, additionalEventAttributes); } setModelOnFilterWrapper(filterWrapper, newModel, justCreated) { return new AgPromise((resolve) => { if (filterWrapper.isHandler) { const column = filterWrapper.column; const colId = column.getColId(); const existingModel = this.model[colId]; this.updateStoredModel(colId, newModel); if (justCreated && newModel === existingModel) { resolve(); return; } this.refreshHandlerAndUi(column, newModel, "api").then(() => resolve()); return; } const uiPromise = getFilterUiFromWrapper(filterWrapper); if (uiPromise) { uiPromise.then((filter) => { if (typeof filter?.setModel !== "function") { _warn(65); resolve(); return; } (filter.setModel(newModel) || AgPromise.resolve()).then(() => resolve()); }); return; } resolve(); }); } /** for handlers only */ updateStoredModel(colId, model) { if (_exists(model)) { this.model[colId] = model; } else { delete this.model[colId]; } const oldState = this.state.get(colId); const newState = { model, state: oldState?.state }; this.state.set(colId, newState); } filterModified(column, additionalEventAttributes) { this.getOrCreateFilterUi(column)?.then((filterInstance) => { this.eventSvc.dispatchEvent({ type: "filterModified", column, filterInstance, ...additionalEventAttributes }); }); } filterUiChanged(column, additionalEventAttributes) { if (this.gos.get("enableFilterHandlers")) { this.eventSvc.dispatchEvent({ type: "filterUiChanged", column, ...additionalEventAttributes }); } } floatingFilterUiChanged(column, additionalEventAttributes) { if (this.gos.get("enableFilterHandlers")) { this.eventSvc.dispatchEvent({ type: "floatingFilterUiChanged", column, ...additionalEventAttributes }); } } updateModel(column, action, additionalEventAttributes) { const colId = column.getColId(); const filterWrapper = this.cachedFilter(column); const getFilterUi = () => filterWrapper?.filterUi; _updateFilterModel({ action, filterParams: filterWrapper?.filterUi?.filterParams, getFilterUi, getModel: () => _getFilterModel(this.model, colId), getState: () => this.state.get(colId), updateState: (state) => this.updateState(column, state), updateModel: (model) => getFilterUi()?.filterParams?.onModelChange(model, { ...additionalEventAttributes, fromAction: action }), processModelToApply: filterWrapper?.isHandler ? filterWrapper.handler.processModelToApply?.bind(filterWrapper.handler) : void 0 }); } updateAllModels(action, additionalEventAttributes) { const promises = []; this.allColumnFilters.forEach((filter, colId) => { const column = this.beans.colModel.getColDefCol(colId); if (column) { _updateFilterModel({ action, filterParams: filter.filterUi?.filterParams, getFilterUi: () => filter.filterUi, getModel: () => _getFilterModel(this.model, colId), getState: () => this.state.get(colId), updateState: (state) => this.updateState(column, state), updateModel: (model) => { this.updateStoredModel(colId, model); this.dispatchLocalEvent({ type: "filterAction", column, action }); promises.push(this.refreshHandlerAndUi(column, model, "ui")); }, processModelToApply: filter?.isHandler ? filter.handler.processModelToApply?.bind(filter.handler) : void 0 }); } }); if (promises.length) { AgPromise.all(promises).then(() => { this.callOnFilterChangedOutsideRenderCycle({ source: "columnFilter", additionalEventAttributes, columns: [] }); }); } } updateOrRefreshFilterUi(column) { const colId = column.getColId(); getAndRefreshFilterUi( () => this.cachedFilter(column)?.filterUi, () => _getFilterModel(this.model, colId), () => this.state.get(colId) ); } updateState(column, state) { this.state.set(column.getColId(), state); this.dispatchLocalEvent({ type: "filterStateChanged", column, state }); } // for tool panel only canApplyAll() { const { state, model, activeFilterComps } = this; for (const comp of activeFilterComps) { if (comp.source === "COLUMN_MENU") { return false; } } let hasChanges = false; for (const colId of state.keys()) { const colState = state.get(colId); if (colState.valid === false) { return false; } if ((colState.model ?? null) !== _getFilterModel(model, colId)) { hasChanges = true; } } return hasChanges; } hasUnappliedModel(colId) { const { model, state } = this; return (state.get(colId)?.model ?? null) !== _getFilterModel(model, colId); } setGlobalButtons(isGlobal) { this.isGlobalButtons = isGlobal; this.dispatchLocalEvent({ type: "filterGlobalButtons", isGlobal }); } shouldKeepStateOnDetach(column, lastContainerType) { if (lastContainerType === "newFiltersToolPanel") { return true; } const filterPanelSvc = this.beans.filterPanelSvc; if (filterPanelSvc?.isActive) { return !!filterPanelSvc.getState(column.getColId()); } return false; } /** * When filters are applied in pivotMode, they are stored in `activeAggregateFilters`. * When users disable pivotMode (e.g. via sidebar), they expect any applied filters to * still be active but just re-applied to the non-pivoted data. * This should also apply vice-versa (i.e. applying a filter and then pivoting) */ onPivotModeChanged(event) { const { colModel, pivotColsSvc } = this.beans; const groupFilterEnabled = !!_getGroupAggFiltering(this.gos); const isPivotMode2 = event.currentValue; const from = isPivotMode2 ? this.activeColumnFilters : this.activeAggregateFilters; const to = isPivotMode2 ? this.activeAggregateFilters : this.activeColumnFilters; const moved = []; for (const filter of from) { const column = colModel.getColById(filter.colId); const isPivotActive = isPivotMode2 && !!pivotColsSvc?.columns.length; if (column && isPivotMode2 === isAggFilter(column, isPivotMode2, isPivotActive, groupFilterEnabled)) { to.push(filter); moved.push(filter); } } _removeAllFromArray(from, moved); } destroy() { super.destroy(); this.allColumnFilters.forEach((filterWrapper) => this.disposeFilterWrapper(filterWrapper, "gridDestroyed")); this.allColumnListeners.clear(); this.state.clear(); this.activeFilterComps.clear(); } }; function isAnyFilterPresent(beans) { return !!beans.filterManager?.isAnyFilterPresent(); } function onFilterChanged(beans, source = "api") { beans.filterManager?.onFilterChanged({ source }); } var FilterManager = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterManager"; this.advFilterModelUpdateQueue = []; } wireBeans(beans) { this.quickFilter = beans.quickFilter; this.advancedFilter = beans.advancedFilter; this.colFilter = beans.colFilter; } postConstruct() { const refreshFiltersForAggregations = this.refreshFiltersForAggregations.bind(this); const updateAdvFilterColumns = this.updateAdvFilterColumns.bind(this); this.addManagedEventListeners({ columnValueChanged: refreshFiltersForAggregations, columnPivotChanged: refreshFiltersForAggregations, columnPivotModeChanged: refreshFiltersForAggregations, newColumnsLoaded: updateAdvFilterColumns, columnVisible: updateAdvFilterColumns, advancedFilterEnabledChanged: ({ enabled }) => this.onAdvFilterEnabledChanged(enabled), dataTypesInferred: this.processFilterModelUpdateQueue.bind(this) }); this.externalFilterPresent = this.isExternalFilterPresentCallback(); this.addManagedPropertyListeners(["isExternalFilterPresent", "doesExternalFilterPass"], () => { this.onFilterChanged({ source: "api" }); }); this.updateAggFiltering(); this.addManagedPropertyListener("groupAggFiltering", () => { this.updateAggFiltering(); this.onFilterChanged(); }); if (this.quickFilter) { this.addManagedListeners(this.quickFilter, { quickFilterChanged: () => this.onFilterChanged({ source: "quickFilter" }) }); } const { gos } = this; this.alwaysPassFilter = gos.get("alwaysPassFilter"); this.addManagedPropertyListener("alwaysPassFilter", () => { this.alwaysPassFilter = gos.get("alwaysPassFilter"); this.onFilterChanged({ source: "api" }); }); } isExternalFilterPresentCallback() { const isFilterPresent = this.gos.getCallback("isExternalFilterPresent"); return typeof isFilterPresent === "function" && isFilterPresent({}); } doesExternalFilterPass(node) { const doesFilterPass = this.gos.get("doesExternalFilterPass"); return typeof doesFilterPass === "function" && doesFilterPass(node); } setFilterState(model, state, source = "api") { if (this.isAdvFilterEnabled()) { return; } this.colFilter?.setState(model, state, source); } setFilterModel(model, source = "api", skipWarning) { if (this.isAdvFilterEnabled()) { if (!skipWarning) { this.warnAdvFilters(); } return; } this.colFilter?.setModel(model, source); } getFilterModel() { return this.colFilter?.getModel() ?? {}; } getFilterState() { return this.colFilter?.getState(); } isColumnFilterPresent() { return !!this.colFilter?.isFilterPresent(); } isAggregateFilterPresent() { return !!this.colFilter?.isAggFilterPresent(); } isChildFilterPresent() { return this.isColumnFilterPresent() || this.isQuickFilterPresent() || this.externalFilterPresent || this.isAdvFilterPresent(); } isAnyFilterPresent() { return this.isChildFilterPresent() || this.isAggregateFilterPresent(); } isAdvFilterPresent() { return this.isAdvFilterEnabled() && this.advancedFilter.isFilterPresent(); } onAdvFilterEnabledChanged(enabled) { if (enabled) { if (this.colFilter?.disableFilters()) { this.onFilterChanged({ source: "advancedFilter" }); } } else if (this.advancedFilter?.isFilterPresent()) { this.advancedFilter.setModel(null); this.onFilterChanged({ source: "advancedFilter" }); } } isAdvFilterEnabled() { return !!this.advancedFilter?.isEnabled(); } isAdvFilterHeaderActive() { return this.isAdvFilterEnabled() && this.advancedFilter.isHeaderActive(); } refreshFiltersForAggregations() { if (_getGroupAggFiltering(this.gos) && this.isAnyFilterPresent()) { this.onFilterChanged(); } } onFilterChanged(params = {}) { const { source, additionalEventAttributes, columns = [] } = params; this.externalFilterPresent = this.isExternalFilterPresentCallback(); (this.colFilter ? this.colFilter.updateBeforeFilterChanged(params) : AgPromise.resolve()).then(() => { const filterChangedEvent = { source, type: "filterChanged", columns }; if (additionalEventAttributes) { _mergeDeep(filterChangedEvent, additionalEventAttributes); } this.eventSvc.dispatchEvent(filterChangedEvent); this.colFilter?.updateAfterFilterChanged(); }); } isSuppressFlashingCellsBecauseFiltering() { return !!this.colFilter?.isSuppressFlashingCellsBecauseFiltering(); } isQuickFilterPresent() { return !!this.quickFilter?.isFilterPresent(); } updateAggFiltering() { this.aggFiltering = !!_getGroupAggFiltering(this.gos); } isAggregateQuickFilterPresent() { return this.isQuickFilterPresent() && this.shouldApplyQuickFilterAfterAgg(); } isNonAggregateQuickFilterPresent() { return this.isQuickFilterPresent() && !this.shouldApplyQuickFilterAfterAgg(); } shouldApplyQuickFilterAfterAgg() { return (this.aggFiltering || this.beans.colModel.isPivotMode()) && !this.gos.get("applyQuickFilterBeforePivotOrAgg"); } doesRowPassOtherFilters(colIdToSkip, rowNode) { return this.doesRowPassFilter({ rowNode, colIdToSkip }); } doesRowPassAggregateFilters(params) { const { rowNode } = params; if (this.alwaysPassFilter?.(rowNode)) { return true; } if (this.isAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) { return false; } if (this.isAggregateFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip, true)) { return false; } return true; } doesRowPassFilter(params) { const { rowNode } = params; if (this.alwaysPassFilter?.(rowNode)) { return true; } if (this.isNonAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(rowNode)) { return false; } if (this.externalFilterPresent && !this.doesExternalFilterPass(rowNode)) { return false; } if (this.isColumnFilterPresent() && !this.colFilter.doFiltersPass(rowNode, params.colIdToSkip)) { return false; } if (this.isAdvFilterPresent() && !this.advancedFilter.doesFilterPass(rowNode)) { return false; } return true; } // for group filters, can change dynamically whether they are allowed or not isFilterAllowed(column) { if (this.isAdvFilterEnabled()) { return false; } return !!this.colFilter?.isFilterAllowed(column); } getAdvFilterModel() { return this.isAdvFilterEnabled() ? this.advancedFilter.getModel() : null; } setAdvFilterModel(expression, source = "api") { if (!this.isAdvFilterEnabled()) { return; } if (this.beans.dataTypeSvc?.isPendingInference) { this.advFilterModelUpdateQueue.push(expression); return; } this.advancedFilter.setModel(expression ?? null); this.onFilterChanged({ source }); } toggleAdvFilterBuilder(show, source) { if (!this.isAdvFilterEnabled()) { return; } this.advancedFilter.getCtrl().toggleFilterBuilder({ source, force: show }); } updateAdvFilterColumns() { if (!this.isAdvFilterEnabled()) { return; } if (this.advancedFilter.updateValidity()) { this.onFilterChanged({ source: "advancedFilter" }); } } hasFloatingFilters() { if (this.isAdvFilterEnabled()) { return false; } return !!this.colFilter?.hasFloatingFilters(); } getColumnFilterInstance(key) { if (this.isAdvFilterEnabled()) { this.warnAdvFilters(); return Promise.resolve(void 0); } return this.colFilter?.getFilterInstance(key) ?? Promise.resolve(void 0); } warnAdvFilters() { _warn(68); } setupAdvFilterHeaderComp(eCompToInsertBefore) { this.advancedFilter?.getCtrl().setupHeaderComp(eCompToInsertBefore); } getHeaderRowCount() { return this.isAdvFilterHeaderActive() ? 1 : 0; } getHeaderHeight() { return this.isAdvFilterHeaderActive() ? this.advancedFilter.getCtrl().getHeaderHeight() : 0; } processFilterModelUpdateQueue() { for (const model of this.advFilterModelUpdateQueue) { this.setAdvFilterModel(model); } this.advFilterModelUpdateQueue = []; } setColumnFilterModel(key, model) { if (this.isAdvFilterEnabled()) { this.warnAdvFilters(); return Promise.resolve(); } return this.colFilter?.setModelForColumn(key, model) ?? Promise.resolve(); } }; function getElement(className) { return { tag: "div", cls: className }; } var FilterButtonComp = class extends Component { constructor(config) { const { className = "ag-filter-apply-panel" } = config ?? {}; super(getElement(className)); this.listeners = []; this.validationMessage = null; this.className = className; } updateButtons(buttons, useForm) { const oldButtons = this.buttons; this.buttons = buttons; if (oldButtons === buttons) { return; } const eGui = this.getGui(); _clearElement(eGui); let eApplyButton; this.destroyListeners(); const fragment = document.createDocumentFragment(); const className = this.className; const addButton = ({ type, label }) => { const clickListener = (event) => { this.dispatchLocalEvent({ type, event }); }; if (!["apply", "clear", "reset", "cancel"].includes(type)) { _warn(75); } const isApply = type === "apply"; const buttonType = isApply && useForm ? "submit" : "button"; const button = _createElement({ tag: "button", attrs: { type: buttonType }, ref: `${type}FilterButton`, cls: `ag-button ag-standard-button ${className}-button${isApply ? " " + className + "-apply-button" : ""}`, children: label }); this.activateTabIndex([button]); if (isApply) { eApplyButton = button; } const keydownListener = (event) => { if (event.key === KeyCode.ENTER) { event.preventDefault(); clickListener(event); } }; const listeners = this.listeners; button.addEventListener("click", clickListener); listeners.push(() => button.removeEventListener("click", clickListener)); button.addEventListener("keydown", keydownListener); listeners.push(() => button.removeEventListener("keydown", keydownListener)); fragment.append(button); }; for (const button of buttons) { addButton(button); } this.eApply = eApplyButton; const tooltip = this.validationTooltipFeature; if (eApplyButton && !tooltip) { this.validationTooltipFeature = this.createOptionalManagedBean( this.beans.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eApply, getLocation: () => "advancedFilter", getTooltipShowDelayOverride: () => 1e3 }) ); } else if (!eApplyButton && tooltip) { this.validationTooltipFeature = this.destroyBean(tooltip); } eGui.append(fragment); } getApplyButton() { return this.eApply; } updateValidity(valid, message = null) { const eApplyButton = this.eApply; if (!eApplyButton) { return; } _setDisabled(eApplyButton, !valid); this.validationMessage = message; this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage); } destroyListeners() { for (const destroyFunc of this.listeners) { destroyFunc(); } this.listeners = []; } destroy() { this.destroyListeners(); super.destroy(); } }; var AgFilterButtonSelector = { selector: "AG-FILTER-BUTTON", component: FilterButtonComp }; var FilterWrapperComp = class extends Component { constructor(column, wrapper, eventParent, updateModel, isGlobalButtons, enableGlobalButtonCheck) { super(); this.column = column; this.wrapper = wrapper; this.eventParent = eventParent; this.updateModel = updateModel; this.isGlobalButtons = isGlobalButtons; this.enableGlobalButtonCheck = enableGlobalButtonCheck; this.hidePopup = null; this.applyActive = false; } postConstruct() { const { comp, params: originalParams } = this.wrapper; const params = originalParams; const useForm = params.useForm; const tag = useForm ? "form" : "div"; this.setTemplate({ tag, cls: "ag-filter-wrapper" }); if (useForm) { this.addManagedElementListeners(this.getGui(), { submit: (e) => { e?.preventDefault(); }, keydown: this.handleKeyDown.bind(this) }); } this.appendChild(comp.getGui()); this.params = params; this.resetButtonsPanel(params); this.addManagedListeners(this.eventParent, { filterParamsChanged: ({ column, params: eventParams }) => { if (column === this.column) { this.resetButtonsPanel(eventParams, this.params); } }, filterStateChanged: ({ column, state }) => { if (column === this.column) { this.eButtons?.updateValidity(state.valid !== false); } }, filterAction: ({ column, action, event: keyboardEvent }) => { if (column === this.column) { this.afterAction(action, keyboardEvent); } }, ...this.enableGlobalButtonCheck ? { filterGlobalButtons: ({ isGlobal }) => { if (isGlobal !== this.isGlobalButtons) { this.isGlobalButtons = isGlobal; const currentParams = this.params; this.resetButtonsPanel(currentParams, currentParams, true); } } } : void 0 }); } afterGuiAttached(params) { if (params) { this.hidePopup = params.hidePopup; } } resetButtonsPanel(newParams, oldParams, forceUpdate) { const { buttons: oldButtons, readOnly: oldReadOnly } = oldParams ?? {}; const { buttons: newButtons, readOnly, useForm } = newParams; if (!forceUpdate && oldReadOnly === readOnly && _jsonEquals(oldButtons, newButtons)) { return; } const hasButtons = newButtons && newButtons.length > 0 && !newParams.readOnly && !this.isGlobalButtons; let eButtonsPanel = this.eButtons; if (hasButtons) { const buttons = newButtons.map((type) => { const localeKey = `${type}Filter`; return { type, label: translateForFilter(this, localeKey) }; }); this.applyActive = _isUseApplyButton(this.params); if (!eButtonsPanel) { eButtonsPanel = this.createBean(new FilterButtonComp()); this.appendChild(eButtonsPanel.getGui()); const column = this.column; const getListener = (action) => ({ event }) => { this.updateModel(column, action, { fromButtons: true }); this.afterAction(action, event); }; eButtonsPanel?.addManagedListeners(eButtonsPanel, { apply: getListener("apply"), clear: getListener("clear"), reset: getListener("reset"), cancel: getListener("cancel") }); this.eButtons = eButtonsPanel; } eButtonsPanel.updateButtons(buttons, useForm); } else { this.applyActive = false; if (eButtonsPanel) { _removeFromParent(eButtonsPanel.getGui()); this.eButtons = this.destroyBean(eButtonsPanel); } } } close(e) { const hidePopup = this.hidePopup; if (!hidePopup) { return; } const keyboardEvent = e; const key = keyboardEvent?.key; let params; if (key === KeyCode.ENTER || key === KeyCode.SPACE) { params = { keyboardEvent }; } hidePopup(params); this.hidePopup = null; } afterAction(action, event) { const { params, applyActive } = this; const closeOnApply = params?.closeOnApply; switch (action) { case "apply": { event?.preventDefault(); if (closeOnApply && applyActive) { this.close(event); } break; } case "reset": { if (closeOnApply && applyActive) { this.close(); } break; } case "cancel": { if (closeOnApply) { this.close(event); } break; } } } handleKeyDown(event) { if (!event.defaultPrevented && event.key === KeyCode.ENTER && this.applyActive) { this.updateModel(this.column, "apply", { fromButtons: true }); this.afterAction("apply", event); } } destroy() { this.hidePopup = null; this.eButtons = this.destroyBean(this.eButtons); } }; var legacyFilter_default = ":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}"; var FilterElement = { tag: "div", cls: "ag-filter" }; var FilterComp = class extends Component { constructor(column, source, enableGlobalButtonCheck) { super(FilterElement); this.column = column; this.source = source; this.enableGlobalButtonCheck = enableGlobalButtonCheck; this.wrapper = null; } postConstruct() { this.beans.colFilter?.activeFilterComps.add(this); this.createFilter(true); this.addManagedEventListeners({ filterDestroyed: this.onFilterDestroyed.bind(this) }); } hasFilter() { return this.wrapper != null; } getFilter() { return this.wrapper?.then((wrapper) => wrapper.comp) ?? null; } afterInit() { return this.wrapper?.then(() => { }) ?? AgPromise.resolve(); } afterGuiAttached(params) { this.afterGuiAttachedParams = params; this.wrapper?.then((wrapper) => { this.comp?.afterGuiAttached(params); wrapper?.comp?.afterGuiAttached?.(params); }); } afterGuiDetached() { this.wrapper?.then((wrapper) => { wrapper?.comp?.afterGuiDetached?.(); }); } createFilter(init) { const { column, source, beans: { colFilter } } = this; const filterPromise = colFilter.getFilterUiForDisplay(column) ?? null; this.wrapper = filterPromise; filterPromise?.then((wrapper) => { if (!wrapper) { return; } const { isHandler, comp } = wrapper; let filterGui; if (isHandler) { const enableGlobalButtonCheck = !!this.enableGlobalButtonCheck; const displayComp = this.createBean( new FilterWrapperComp( column, wrapper, colFilter, colFilter.updateModel.bind(colFilter), enableGlobalButtonCheck && colFilter.isGlobalButtons, enableGlobalButtonCheck ) ); this.comp = displayComp; filterGui = displayComp.getGui(); } else { this.registerCSS(legacyFilter_default); filterGui = comp.getGui(); if (!_exists(filterGui)) { _warn(69, { guiFromFilter: filterGui }); } } this.appendChild(filterGui); if (init) { this.eventSvc.dispatchEvent({ type: "filterOpened", column, source, eGui: this.getGui() }); } else { comp.afterGuiAttached?.(this.afterGuiAttachedParams); } }); } onFilterDestroyed(event) { const { source, column } = event; if ((source === "api" || source === "paramsUpdated") && column.getId() === this.column.getId() && this.beans.colModel.getColDefCol(this.column)) { _clearElement(this.getGui()); this.comp = this.destroyBean(this.comp); this.createFilter(); } } destroy() { this.beans.colFilter?.activeFilterComps.delete(this); this.eventSvc.dispatchEvent({ type: "filterClosed", column: this.column }); this.wrapper = null; this.comp = this.destroyBean(this.comp); this.afterGuiAttachedParams = void 0; super.destroy(); } }; var FilterMenuFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterMenuFactory"; } wireBeans(beans) { this.popupSvc = beans.popupSvc; } hideActiveMenu() { this.hidePopup?.(); } showMenuAfterMouseEvent(column, mouseEvent, containerType, onClosedCallback) { if (column && !column.isColumn) { return; } this.showPopup( column, (eMenu) => { this.popupSvc?.positionPopupUnderMouseEvent({ additionalParams: { column }, type: containerType, mouseEvent, ePopup: eMenu }); }, containerType, mouseEvent.target, _isLegacyMenuEnabled(this.gos), onClosedCallback ); } showMenuAfterButtonClick(column, eventSource, containerType, onClosedCallback) { if (column && !column.isColumn) { return; } let multiplier = -1; let alignSide = "left"; const isLegacyMenuEnabled = _isLegacyMenuEnabled(this.gos); if (!isLegacyMenuEnabled && this.gos.get("enableRtl")) { multiplier = 1; alignSide = "right"; } const nudgeX = isLegacyMenuEnabled ? void 0 : 4 * multiplier; const nudgeY = isLegacyMenuEnabled ? void 0 : 4; this.showPopup( column, (eMenu) => { this.popupSvc?.positionPopupByComponent({ type: containerType, eventSource, ePopup: eMenu, nudgeX, nudgeY, alignSide, keepWithinBounds: true, position: "under", additionalParams: { column } }); }, containerType, eventSource, isLegacyMenuEnabled, onClosedCallback ); } showPopup(column, positionCallback, containerType, eventSource, isLegacyMenuEnabled, onClosedCallback) { const comp = column ? this.createBean(new FilterComp(column, "COLUMN_MENU")) : void 0; this.activeMenu = comp; if (!comp?.hasFilter() || !column) { _error(57); return; } const eMenu = _createElement({ tag: "div", cls: `ag-menu${!isLegacyMenuEnabled ? " ag-filter-menu" : ""}`, role: "presentation" }); [this.tabListener] = this.addManagedElementListeners(eMenu, { keydown: (e) => this.trapFocusWithin(e, eMenu) }); eMenu.appendChild(comp?.getGui()); let hidePopup; const afterGuiDetached = () => comp?.afterGuiDetached(); const anchorToElement = _isColumnMenuAnchoringEnabled(this.gos) ? eventSource ?? this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody : void 0; const closedCallback = (e) => { _setColMenuVisible(column, false, "contextMenu"); const isKeyboardEvent = e instanceof KeyboardEvent; if (this.tabListener) { this.tabListener = this.tabListener(); } if (isKeyboardEvent && eventSource && _isVisible(eventSource)) { const focusableEl = _findTabbableParent(eventSource); focusableEl?.focus({ preventScroll: true }); } afterGuiDetached(); this.destroyBean(this.activeMenu); this.dispatchVisibleChangedEvent(false, containerType, column); onClosedCallback?.(); }; const translate = this.getLocaleTextFunc(); const ariaLabel = isLegacyMenuEnabled && containerType !== "columnFilter" ? translate("ariaLabelColumnMenu", "Column Menu") : translate("ariaLabelColumnFilter", "Column Filter"); const addPopupRes = this.popupSvc?.addPopup({ modal: true, eChild: eMenu, closeOnEsc: true, closedCallback, positionCallback: () => positionCallback(eMenu), anchorToElement, ariaLabel }); if (addPopupRes) { this.hidePopup = hidePopup = addPopupRes.hideFunc; } comp.afterInit().then(() => { positionCallback(eMenu); comp.afterGuiAttached({ container: containerType, hidePopup }); }); _setColMenuVisible(column, true, "contextMenu"); this.dispatchVisibleChangedEvent(true, containerType, column); } trapFocusWithin(e, menu) { if (e.key !== KeyCode.TAB || e.defaultPrevented || _findNextFocusableElement(this.beans, menu, false, e.shiftKey)) { return; } e.preventDefault(); _focusInto(menu, e.shiftKey); } dispatchVisibleChangedEvent(visible, containerType, column) { this.eventSvc.dispatchEvent({ type: "columnMenuVisibleChanged", visible, switchingTab: false, key: containerType, column: column ?? null, columnGroup: null }); } isMenuEnabled(column) { return column.isFilterAllowed() && (column.getColDef().menuTabs ?? ["filterMenuTab"]).includes("filterMenuTab"); } showMenuAfterContextMenuEvent() { } destroy() { this.destroyBean(this.activeMenu); super.destroy(); } }; var FilterValueService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterValueSvc"; } getValue(column, rowNode, filterValueGetterOverride) { if (!rowNode) { return; } const colDef = column.getColDef(); const { selectableFilter, valueSvc, formula } = this.beans; const filterValueGetter = filterValueGetterOverride ?? selectableFilter?.getFilterValueGetter(column.getColId()) ?? colDef.filterValueGetter; if (filterValueGetter) { return this.executeFilterValueGetter(filterValueGetter, rowNode.data, column, rowNode, colDef); } const value = valueSvc.getValue(column, rowNode, "data"); if (column.isAllowFormula() && formula?.isFormula(value)) { return formula.resolveValue(column, rowNode); } return value; } executeFilterValueGetter(valueGetter, data, column, node, colDef) { const { expressionSvc, valueSvc } = this.beans; const params = _addGridCommonParams(this.gos, { data, node, column, colDef, getValue: valueSvc.getValueCallback.bind(valueSvc, node) }); if (typeof valueGetter === "function") { return valueGetter(params); } return expressionSvc?.evaluate(valueGetter, params); } }; var ReadOnlyFloatingFilterElement = { tag: "div", cls: "ag-floating-filter-input", role: "presentation", children: [ { tag: "ag-input-text-field", ref: "eFloatingFilterText" } ] }; var ReadOnlyFloatingFilter = class extends Component { constructor() { super(ReadOnlyFloatingFilterElement, [AgInputTextFieldSelector]); this.eFloatingFilterText = RefPlaceholder; } init(params) { this.params = params; const displayName = this.beans.colNames.getDisplayNameForColumn(params.column, "header", true); this.eFloatingFilterText.setDisabled(true).setInputAriaLabel(`${displayName} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`); if (this.gos.get("enableFilterHandlers")) { const reactiveParams = params; const handler = reactiveParams.getHandler(); if (handler.getModelAsString) { const modelAsString = handler.getModelAsString(reactiveParams.model); this.eFloatingFilterText.setValue(modelAsString); } } } onParentModelChanged(parentModel) { if (parentModel == null) { this.eFloatingFilterText.setValue(""); return; } this.params.parentFilterInstance((filterInstance) => { if (filterInstance.getModelAsString) { const modelAsString = filterInstance.getModelAsString(parentModel); this.eFloatingFilterText.setValue(modelAsString); } }); } refresh(params) { this.init(params); } }; var AgRadioButton = class extends AgCheckbox { constructor(config) { super(config, "ag-radio-button", "radio"); } isSelected() { return this.eInput.checked; } toggle() { if (this.eInput.disabled) { return; } if (!this.isSelected()) { this.setValue(true); } } addInputListeners() { super.addInputListeners(); this.addManagedEventListeners({ checkboxChanged: this.onChange.bind(this) }); } /** * This ensures that if another radio button in the same named group is selected, we deselect this radio button. * By default the browser does this for you, but we are managing classes ourselves in order to ensure input * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected, * not deselected, so we need to use our own event. */ onChange(event) { const eInput = this.eInput; if (event.selected && event.name && eInput.name && eInput.name === event.name && event.id && eInput.id !== event.id) { this.setValue(false, true); } } }; var AgRadioButtonSelector = { selector: "AG-RADIO-BUTTON", component: AgRadioButton }; var OptionsFactory = class { constructor() { this.customFilterOptions = {}; } init(params, defaultOptions) { this.filterOptions = params.filterOptions ?? defaultOptions; this.mapCustomOptions(); this.defaultOption = this.getDefaultItem(params.defaultOption); } refresh(params, defaultOptions) { const filterOptions = params.filterOptions ?? defaultOptions; if (this.filterOptions !== filterOptions) { this.filterOptions = filterOptions; this.customFilterOptions = {}; this.mapCustomOptions(); } this.defaultOption = this.getDefaultItem(params.defaultOption); } mapCustomOptions() { const { filterOptions } = this; if (!filterOptions) { return; } for (const filterOption of filterOptions) { if (typeof filterOption === "string") { continue; } const requiredProperties = [["displayKey"], ["displayName"], ["predicate", "test"]]; const propertyCheck = (keys) => { if (!keys.some((key) => filterOption[key] != null)) { _warn(72, { keys }); return false; } return true; }; if (!requiredProperties.every(propertyCheck)) { this.filterOptions = filterOptions.filter((v) => v === filterOption) || []; continue; } this.customFilterOptions[filterOption.displayKey] = filterOption; } } getDefaultItem(defaultOption) { const { filterOptions } = this; if (defaultOption) { return defaultOption; } else if (filterOptions.length >= 1) { const firstFilterOption = filterOptions[0]; if (typeof firstFilterOption === "string") { return firstFilterOption; } else if (firstFilterOption.displayKey) { return firstFilterOption.displayKey; } else { _warn(73); } } else { _warn(74); } return void 0; } getCustomOption(name) { return this.customFilterOptions[name]; } }; function removeItems(items, startPosition, deleteCount) { return deleteCount == null ? items.splice(startPosition) : items.splice(startPosition, deleteCount); } function isBlank(cellValue) { return cellValue == null || typeof cellValue === "string" && cellValue.trim().length === 0; } function getDefaultJoinOperator(defaultJoinOperator) { return defaultJoinOperator === "AND" || defaultJoinOperator === "OR" ? defaultJoinOperator : "AND"; } function evaluateCustomFilter(customFilterOption, values, cellValue) { if (customFilterOption == null) { return; } const { predicate } = customFilterOption; if (predicate != null && !values.some((v) => v == null)) { return predicate(values, cellValue); } } function validateAndUpdateConditions(conditions, maxNumConditions) { let numConditions = conditions.length; if (numConditions > maxNumConditions) { conditions.splice(maxNumConditions); _warn(78); numConditions = maxNumConditions; } return numConditions; } var zeroInputTypes = /* @__PURE__ */ new Set([ "empty", "notBlank", "blank", "today", "yesterday", "tomorrow", "thisWeek", "lastWeek", "nextWeek", "thisMonth", "lastMonth", "nextMonth", "thisQuarter", "lastQuarter", "nextQuarter", "thisYear", "lastYear", "nextYear", "yearToDate", "last7Days", "last30Days", "last90Days", "last6Months", "last12Months", "last24Months" ]); function getNumberOfInputs(type, optionsFactory) { const customOpts = optionsFactory.getCustomOption(type); if (customOpts) { const { numberOfInputs } = customOpts; return numberOfInputs != null ? numberOfInputs : 1; } if (type && zeroInputTypes.has(type)) { return 0; } else if (type === "inRange") { return 2; } return 1; } var SimpleFilter = class extends ProvidedFilter { constructor(filterNameKey, mapValuesFromModel, defaultOptions) { super(filterNameKey, "simple-filter"); this.mapValuesFromModel = mapValuesFromModel; this.defaultOptions = defaultOptions; this.eTypes = []; this.eJoinPanels = []; this.eJoinAnds = []; this.eJoinOrs = []; this.eConditionBodies = []; this.listener = () => this.onUiChanged(); this.lastUiCompletePosition = null; this.joinOperatorId = 0; } setParams(params) { super.setParams(params); const optionsFactory = new OptionsFactory(); this.optionsFactory = optionsFactory; optionsFactory.init(params, this.defaultOptions); this.commonUpdateSimpleParams(params); this.createOption(); this.createMissingConditionsAndOperators(); } updateParams(newParams, oldParams) { this.optionsFactory.refresh(newParams, this.defaultOptions); super.updateParams(newParams, oldParams); this.commonUpdateSimpleParams(newParams); } commonUpdateSimpleParams(params) { this.setNumConditions(params); this.defaultJoinOperator = getDefaultJoinOperator(params.defaultJoinOperator); this.filterPlaceholder = params.filterPlaceholder; this.createFilterListOptions(); _addOrRemoveAttribute(this.getGui(), "tabindex", this.isReadOnly() ? "-1" : null); } // floating filter calls this when user applies filter from floating filter onFloatingFilterChanged(type, value) { this.setTypeFromFloatingFilter(type); this.setValueFromFloatingFilter(value); this.onUiChanged("immediately", true); } setTypeFromFloatingFilter(type) { this.eTypes.forEach((eType, position) => { const value = position === 0 ? type : this.optionsFactory.defaultOption; eType.setValue(value, true); }); } getModelFromUi() { const conditions = this.getUiCompleteConditions(); if (conditions.length === 0) { return null; } if (this.maxNumConditions > 1 && conditions.length > 1) { return { filterType: this.filterType, operator: this.getJoinOperator(), conditions }; } return conditions[0]; } getConditionTypes() { return this.eTypes.map((eType) => eType.getValue()); } getConditionType(position) { return this.eTypes[position].getValue(); } getJoinOperator() { const { eJoinOrs: eJoinOperatorsOr, defaultJoinOperator } = this; return eJoinOperatorsOr.length === 0 ? defaultJoinOperator : eJoinOperatorsOr[0].getValue() === true ? "OR" : "AND"; } areNonNullModelsEqual(a, b) { const aIsSimple = !a.operator; const bIsSimple = !b.operator; const oneSimpleOneCombined = !aIsSimple && bIsSimple || aIsSimple && !bIsSimple; if (oneSimpleOneCombined) { return false; } let res; if (aIsSimple) { const aSimple = a; const bSimple = b; res = this.areSimpleModelsEqual(aSimple, bSimple); } else { const aCombined = a; const bCombined = b; res = aCombined.operator === bCombined.operator && _areEqual( aCombined.conditions, bCombined.conditions, (aModel, bModel) => this.areSimpleModelsEqual(aModel, bModel) ); } return res; } setModelIntoUi(model, isInitialLoad) { if (model == null) { this.resetUiToDefaults(isInitialLoad); return AgPromise.resolve(); } const isCombined = model.operator; if (isCombined) { const combinedModel = model; let conditions = combinedModel.conditions; if (conditions == null) { conditions = []; _warn(77); } const numConditions = validateAndUpdateConditions(conditions, this.maxNumConditions); const numPrevConditions = this.getNumConditions(); if (numConditions < numPrevConditions) { this.removeConditionsAndOperators(numConditions); } else if (numConditions > numPrevConditions) { for (let i = numPrevConditions; i < numConditions; i++) { this.createJoinOperatorPanel(); this.createOption(); } } const orChecked = combinedModel.operator === "OR"; this.eJoinAnds.forEach((eJoinOperatorAnd) => eJoinOperatorAnd.setValue(!orChecked, true)); this.eJoinOrs.forEach((eJoinOperatorOr) => eJoinOperatorOr.setValue(orChecked, true)); conditions.forEach((condition, position) => { this.eTypes[position].setValue(condition.type, true); this.setConditionIntoUi(condition, position); }); } else { const simpleModel = model; if (this.getNumConditions() > 1) { this.removeConditionsAndOperators(1); } this.eTypes[0].setValue(simpleModel.type, true); this.setConditionIntoUi(simpleModel, 0); } this.lastUiCompletePosition = this.getNumConditions() - 1; this.createMissingConditionsAndOperators(); this.updateUiVisibility(); if (!isInitialLoad) { this.params.onUiChange(this.getUiChangeEventParams()); } return AgPromise.resolve(); } setNumConditions(params) { let maxNumConditions = params.maxNumConditions ?? 2; if (maxNumConditions < 1) { _warn(79); maxNumConditions = 1; } this.maxNumConditions = maxNumConditions; let numAlwaysVisibleConditions = params.numAlwaysVisibleConditions ?? 1; if (numAlwaysVisibleConditions < 1) { _warn(80); numAlwaysVisibleConditions = 1; } if (numAlwaysVisibleConditions > maxNumConditions) { _warn(81); numAlwaysVisibleConditions = maxNumConditions; } this.numAlwaysVisibleConditions = numAlwaysVisibleConditions; } createOption() { const eGui = this.getGui(); const eType = this.createManagedBean(new AgSelect()); this.eTypes.push(eType); eType.addCss("ag-filter-select"); eGui.appendChild(eType.getGui()); const eConditionBody = this.createEValue(); this.eConditionBodies.push(eConditionBody); eGui.appendChild(eConditionBody); this.putOptionsIntoDropdown(eType); this.resetType(eType); const position = this.getNumConditions() - 1; this.forEachPositionInput(position, (element) => this.resetInput(element)); this.addChangedListeners(eType, position); } createJoinOperatorPanel() { const eJoinOperatorPanel = _createElement({ tag: "div", cls: "ag-filter-condition" }); this.eJoinPanels.push(eJoinOperatorPanel); const eJoinOperatorAnd = this.createJoinOperator(this.eJoinAnds, eJoinOperatorPanel, "and"); const eJoinOperatorOr = this.createJoinOperator(this.eJoinOrs, eJoinOperatorPanel, "or"); this.getGui().appendChild(eJoinOperatorPanel); const index = this.eJoinPanels.length - 1; const uniqueGroupId = this.joinOperatorId++; this.resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId); this.resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId); if (!this.isReadOnly()) { eJoinOperatorAnd.onValueChange(this.listener); eJoinOperatorOr.onValueChange(this.listener); } } createJoinOperator(eJoinOperators, eJoinOperatorPanel, andOr) { const eJoinOperator = this.createManagedBean(new AgRadioButton()); eJoinOperators.push(eJoinOperator); const baseClass = "ag-filter-condition-operator"; eJoinOperator.addCss(baseClass); eJoinOperator.addCss(`${baseClass}-${andOr}`); eJoinOperatorPanel.appendChild(eJoinOperator.getGui()); return eJoinOperator; } createFilterListOptions() { this.filterListOptions = this.optionsFactory.filterOptions.map( (option) => typeof option === "string" ? this.createBoilerplateListOption(option) : this.createCustomListOption(option) ); } putOptionsIntoDropdown(eType) { const { filterListOptions } = this; for (const listOption of filterListOptions) { eType.addOption(listOption); } eType.setDisabled(filterListOptions.length <= 1); } createBoilerplateListOption(option) { return { value: option, text: this.translate(option) }; } createCustomListOption(option) { const { displayKey } = option; const customOption = this.optionsFactory.getCustomOption(option.displayKey); return { value: displayKey, text: customOption ? this.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) : this.translate(displayKey) }; } createBodyTemplate() { return null; } getAgComponents() { return []; } updateUiVisibility() { const joinOperator = this.getJoinOperator(); this.updateNumConditions(); this.updateConditionStatusesAndValues(this.lastUiCompletePosition, joinOperator); } updateNumConditions() { let lastUiCompletePosition = -1; let areAllConditionsUiComplete = true; for (let position = 0; position < this.getNumConditions(); position++) { if (this.isConditionUiComplete(position)) { lastUiCompletePosition = position; } else { areAllConditionsUiComplete = false; } } if (this.shouldAddNewConditionAtEnd(areAllConditionsUiComplete)) { this.createJoinOperatorPanel(); this.createOption(); } else { const activePosition = this.lastUiCompletePosition ?? this.getNumConditions() - 2; if (lastUiCompletePosition < activePosition) { this.removeConditionsAndOperators(activePosition + 1); const removeStartPosition = lastUiCompletePosition + 1; const numConditionsToRemove = activePosition - removeStartPosition; if (numConditionsToRemove > 0) { this.removeConditionsAndOperators(removeStartPosition, numConditionsToRemove); } this.createMissingConditionsAndOperators(); } } this.lastUiCompletePosition = lastUiCompletePosition; } updateConditionStatusesAndValues(lastUiCompletePosition, joinOperator) { this.eTypes.forEach((eType, position) => { const disabled = this.isConditionDisabled(position, lastUiCompletePosition); eType.setDisabled(disabled || this.filterListOptions.length <= 1); if (position === 1) { _setDisabled(this.eJoinPanels[0], disabled); this.eJoinAnds[0].setDisabled(disabled); this.eJoinOrs[0].setDisabled(disabled); } }); this.eConditionBodies.forEach((element, index) => { _setDisplayed(element, this.isConditionBodyVisible(index)); }); const orChecked = (joinOperator ?? this.getJoinOperator()) === "OR"; for (const eJoinOperatorAnd of this.eJoinAnds) { eJoinOperatorAnd.setValue(!orChecked, true); } for (const eJoinOperatorOr of this.eJoinOrs) { eJoinOperatorOr.setValue(orChecked, true); } this.forEachInput((element, index, position, numberOfInputs) => { this.setElementDisplayed(element, index < numberOfInputs); this.setElementDisabled(element, this.isConditionDisabled(position, lastUiCompletePosition)); }); this.resetPlaceholder(); } shouldAddNewConditionAtEnd(areAllConditionsUiComplete) { return areAllConditionsUiComplete && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly(); } removeConditionsAndOperators(startPosition, deleteCount) { if (startPosition >= this.getNumConditions()) { return; } const { eTypes, eConditionBodies, eJoinPanels: eJoinOperatorPanels, eJoinAnds: eJoinOperatorsAnd, eJoinOrs: eJoinOperatorsOr } = this; this.removeComponents(eTypes, startPosition, deleteCount); this.removeElements(eConditionBodies, startPosition, deleteCount); this.removeEValues(startPosition, deleteCount); const joinOperatorIndex = Math.max(startPosition - 1, 0); this.removeElements(eJoinOperatorPanels, joinOperatorIndex, deleteCount); this.removeComponents(eJoinOperatorsAnd, joinOperatorIndex, deleteCount); this.removeComponents(eJoinOperatorsOr, joinOperatorIndex, deleteCount); } removeElements(elements, startPosition, deleteCount) { const removedElements = removeItems(elements, startPosition, deleteCount); for (const element of removedElements) { _removeFromParent(element); } } removeComponents(components, startPosition, deleteCount) { const removedComponents = removeItems(components, startPosition, deleteCount); for (const comp of removedComponents) { _removeFromParent(comp.getGui()); this.destroyBean(comp); } } afterGuiAttached(params) { super.afterGuiAttached(params); this.resetPlaceholder(); if (!params?.suppressFocus) { let elementToFocus; if (!this.isReadOnly()) { const firstInput = this.getInputs(0)[0]; if (firstInput instanceof AgAbstractInputField && this.isConditionBodyVisible(0)) { elementToFocus = firstInput.getInputElement(); } else { elementToFocus = this.eTypes[0]?.getFocusableElement(); } } (elementToFocus ?? this.getGui()).focus({ preventScroll: true }); } } shouldKeepInvalidInputState() { return false; } afterGuiDetached() { super.afterGuiDetached(); const params = this.params; if (this.beans.colFilter?.shouldKeepStateOnDetach(params.column) || this.shouldKeepInvalidInputState()) { return; } params.onStateChange({ model: params.model }); let lastUiCompletePosition = -1; let updatedLastUiCompletePosition = -1; let conditionsRemoved = false; const joinOperator = this.getJoinOperator(); for (let position = this.getNumConditions() - 1; position >= 0; position--) { if (this.isConditionUiComplete(position)) { if (lastUiCompletePosition === -1) { lastUiCompletePosition = position; updatedLastUiCompletePosition = position; } } else { const shouldRemovePositionAtEnd = position >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(position - 1); const positionBeforeLastUiCompletePosition = position < lastUiCompletePosition; if (shouldRemovePositionAtEnd || positionBeforeLastUiCompletePosition) { this.removeConditionsAndOperators(position, 1); conditionsRemoved = true; if (positionBeforeLastUiCompletePosition) { updatedLastUiCompletePosition--; } } } } let shouldUpdateConditionStatusesAndValues = false; if (this.getNumConditions() < this.numAlwaysVisibleConditions) { this.createMissingConditionsAndOperators(); shouldUpdateConditionStatusesAndValues = true; } if (this.shouldAddNewConditionAtEnd(updatedLastUiCompletePosition === this.getNumConditions() - 1)) { this.createJoinOperatorPanel(); this.createOption(); shouldUpdateConditionStatusesAndValues = true; } if (shouldUpdateConditionStatusesAndValues) { this.updateConditionStatusesAndValues(updatedLastUiCompletePosition, joinOperator); } if (conditionsRemoved) { this.updateJoinOperatorsDisabled(); } this.lastUiCompletePosition = updatedLastUiCompletePosition; } getModelAsString(model) { return this.params.getHandler()?.getModelAsString?.(model) ?? ""; } // allow sub-classes to reset HTML placeholders after UI update. resetPlaceholder() { const globalTranslate = this.getLocaleTextFunc(); const { filterPlaceholder, eTypes } = this; this.forEachInput((element, index, position, numberOfInputs) => { if (!(element instanceof AgAbstractInputField)) { return; } const placeholderKey = index === 0 && numberOfInputs > 1 ? "inRangeStart" : index === 0 ? "filterOoo" : "inRangeEnd"; const ariaLabel = index === 0 && numberOfInputs > 1 ? globalTranslate("ariaFilterFromValue", "Filter from value") : index === 0 ? globalTranslate("ariaFilterValue", "Filter Value") : globalTranslate("ariaFilterToValue", "Filter to Value"); const filterOptionKey = eTypes[position].getValue(); const placeholderText = getPlaceholderText(this, filterPlaceholder, placeholderKey, filterOptionKey); element.setInputPlaceholder(placeholderText); element.setInputAriaLabel(ariaLabel); }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars setElementValue(element, value, fromFloatingFilter) { if (element instanceof AgAbstractInputField) { element.setValue(value != null ? String(value) : null, true); } } setElementDisplayed(element, displayed) { if (_isComponent(element)) { _setDisplayed(element.getGui(), displayed); } } setElementDisabled(element, disabled) { if (_isComponent(element)) { _setDisabled(element.getGui(), disabled); } } attachElementOnChange(element, listener) { if (element instanceof AgAbstractInputField) { element.onValueChange(listener); } } forEachInput(cb) { this.getConditionTypes().forEach((type, position) => { this.forEachPositionTypeInput(position, type, cb); }); } forEachPositionInput(position, cb) { const type = this.getConditionType(position); this.forEachPositionTypeInput(position, type, cb); } forEachPositionTypeInput(position, type, cb) { const numberOfInputs = getNumberOfInputs(type, this.optionsFactory); const inputs = this.getInputs(position); for (let index = 0; index < inputs.length; index++) { const input = inputs[index]; if (input != null) { cb(input, index, position, numberOfInputs); } } } isConditionDisabled(position, lastUiCompletePosition) { if (this.isReadOnly()) { return true; } if (position === 0) { return false; } return position > lastUiCompletePosition + 1; } isConditionBodyVisible(position) { const type = this.getConditionType(position); const numberOfInputs = getNumberOfInputs(type, this.optionsFactory); return numberOfInputs > 0; } // returns true if the UI represents a working filter, eg all parts are filled out. // eg if text filter and textfield blank then returns false. isConditionUiComplete(position) { if (position >= this.getNumConditions()) { return false; } const type = this.getConditionType(position); if (type === "empty") { return false; } if (this.getValues(position).some((v) => v == null)) { return false; } if (this.positionHasInvalidInputs(position)) { return false; } return true; } getNumConditions() { return this.eTypes.length; } getUiCompleteConditions() { const conditions = []; for (let position = 0; position < this.getNumConditions(); position++) { if (this.isConditionUiComplete(position)) { conditions.push(this.createCondition(position)); } } return conditions; } createMissingConditionsAndOperators() { if (this.isReadOnly()) { return; } for (let i = this.getNumConditions(); i < this.numAlwaysVisibleConditions; i++) { this.createJoinOperatorPanel(); this.createOption(); } } resetUiToDefaults(silent) { this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions); this.eTypes.forEach((eType) => this.resetType(eType)); this.eJoinAnds.forEach( (eJoinOperatorAnd, index) => this.resetJoinOperatorAnd(eJoinOperatorAnd, index, this.joinOperatorId + index) ); this.eJoinOrs.forEach( (eJoinOperatorOr, index) => this.resetJoinOperatorOr(eJoinOperatorOr, index, this.joinOperatorId + index) ); this.joinOperatorId++; this.forEachInput((element) => this.resetInput(element)); this.resetPlaceholder(); this.createMissingConditionsAndOperators(); this.lastUiCompletePosition = null; this.updateUiVisibility(); if (!silent) { this.params.onUiChange(this.getUiChangeEventParams()); } } resetType(eType) { const translate = this.getLocaleTextFunc(); const filteringLabel = translate("ariaFilteringOperator", "Filtering operator"); eType.setValue(this.optionsFactory.defaultOption, true).setAriaLabel(filteringLabel).setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1); } resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId) { this.resetJoinOperator( eJoinOperatorAnd, index, this.defaultJoinOperator === "AND", this.translate("andCondition"), uniqueGroupId ); } resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId) { this.resetJoinOperator( eJoinOperatorOr, index, this.defaultJoinOperator === "OR", this.translate("orCondition"), uniqueGroupId ); } resetJoinOperator(eJoinOperator, index, value, label, uniqueGroupId) { this.updateJoinOperatorDisabled( eJoinOperator.setValue(value, true).setName(`ag-simple-filter-and-or-${this.getCompId()}-${uniqueGroupId}`).setLabel(label), index ); } updateJoinOperatorsDisabled() { const updater = (eJoinOperator, index) => this.updateJoinOperatorDisabled(eJoinOperator, index); this.eJoinAnds.forEach(updater); this.eJoinOrs.forEach(updater); } updateJoinOperatorDisabled(eJoinOperator, index) { eJoinOperator.setDisabled(this.isReadOnly() || index > 0); } resetInput(element) { this.setElementValue(element, null); this.setElementDisabled(element, this.isReadOnly()); } // puts model values into the UI setConditionIntoUi(model, position) { const values = this.mapValuesFromModel(model, this.optionsFactory); this.forEachInput((element, index, elPosition) => { if (elPosition !== position) { return; } this.setElementValue(element, values[index] != null ? values[index] : null); }); } // after floating filter changes, this sets the 'value' section. this is implemented by the base class // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class. setValueFromFloatingFilter(value) { this.forEachInput((element, index, position) => { this.setElementValue(element, index === 0 && position === 0 ? value : null, true); }); } addChangedListeners(eType, position) { if (this.isReadOnly()) { return; } eType.onValueChange(this.listener); this.forEachPositionInput(position, (element) => { this.attachElementOnChange(element, this.listener); }); } hasInvalidInputs() { return false; } positionHasInvalidInputs(_position) { return false; } isReadOnly() { return !!this.params.readOnly; } }; var DEFAULT_BIGINT_FILTER_OPTIONS = [ "equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "blank", "notBlank" ]; function getAllowedCharPattern(filterParams) { return filterParams?.allowedCharPattern ?? null; } function mapValuesFromBigIntFilterModel(filterModel, optionsFactory) { const { filter, filterTo, type } = filterModel || {}; return [_parseBigIntOrNull(filter), _parseBigIntOrNull(filterTo)].slice(0, getNumberOfInputs(type, optionsFactory)); } var BigIntFilter = class extends SimpleFilter { constructor() { super("bigintFilter", mapValuesFromBigIntFilterModel, DEFAULT_BIGINT_FILTER_OPTIONS); this.eValuesFrom = []; this.eValuesTo = []; this.filterType = "bigint"; this.defaultDebounceMs = 500; } afterGuiAttached(params) { super.afterGuiAttached(params); this.refreshInputValidation(); } shouldKeepInvalidInputState() { return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes("inRange"); } refreshInputValidation() { for (let i = 0; i < this.eValuesFrom.length; i++) { const from = this.eValuesFrom[i]; const to = this.eValuesTo[i]; this.refreshInputPairValidation(from, to); } } refreshInputPairValidation(from, to, isFrom = false) { const { bigintParser } = this.params; const fromValue = this.getParsedValue(from, bigintParser); const toValue = this.getParsedValue(to, bigintParser); const fromInvalid = this.isInvalidValue(from, fromValue); const toInvalid = this.isInvalidValue(to, toValue); const target = isFrom ? from : to; const other = isFrom ? to : from; const targetInvalid = isFrom ? fromInvalid : toInvalid; const otherInvalid = isFrom ? toInvalid : fromInvalid; let validityMessage = ""; if (targetInvalid) { const translate = this.getLocaleTextFunc(); validityMessage = translate("invalidBigInt", "Invalid BigInt"); } else if (!fromInvalid && !toInvalid) { const localeKey = getValidityMessageKey(fromValue, toValue, isFrom); if (localeKey) { validityMessage = this.translate(localeKey, [String(isFrom ? to.getValue() : from.getValue())]); } } target.setCustomValidity(validityMessage); if (!otherInvalid) { other.setCustomValidity(""); } if (validityMessage.length > 0) { this.beans.ariaAnnounce.announceValue(validityMessage, "dateFilter"); } } getState() { return { isInvalid: this.hasInvalidInputs() }; } areStatesEqual(stateA, stateB) { return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false); } refresh(legacyNewParams) { const result = super.refresh(legacyNewParams); const { state: newState, additionalEventAttributes } = legacyNewParams; const oldState = this.state; const fromAction = additionalEventAttributes?.fromAction; const forceRefreshValidation = fromAction && fromAction != "apply"; if (forceRefreshValidation || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) { this.refreshInputValidation(); } return result; } setElementValue(element, value, fromFloatingFilter) { super.setElementValue(element, value, fromFloatingFilter); if (value === null) { element.setCustomValidity(""); } } createEValue() { const { params, eValuesFrom, eValuesTo } = this; const allowedCharPattern = getAllowedCharPattern(params); const eCondition = _createElement({ tag: "div", cls: "ag-filter-body", role: "presentation" }); const from = this.createFromToElement(eCondition, eValuesFrom, "from", allowedCharPattern); const to = this.createFromToElement(eCondition, eValuesTo, "to", allowedCharPattern); const getFieldChangedListener = (fromEl, toEl, isFrom) => () => this.refreshInputPairValidation(fromEl, toEl, isFrom); const fromListener = getFieldChangedListener(from, to, true); from.onValueChange(fromListener); from.addGuiEventListener("focusin", fromListener); const toListener = getFieldChangedListener(from, to, false); to.onValueChange(toListener); to.addGuiEventListener("focusin", toListener); return eCondition; } createFromToElement(eCondition, eValues, fromTo, allowedCharPattern) { const eValue = this.createManagedBean( allowedCharPattern ? new AgInputTextField({ allowedCharPattern }) : new AgInputTextField() ); eValue.addCss(`ag-filter-${fromTo}`); eValue.addCss("ag-filter-filter"); eValues.push(eValue); eCondition.appendChild(eValue.getGui()); return eValue; } removeEValues(startPosition, deleteCount) { const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount); removeComps(this.eValuesFrom); removeComps(this.eValuesTo); } getValues(position) { const result = []; this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => { if (index < numberOfInputs) { result.push(_parseBigIntOrNull(element.getValue() ?? null)); } }); return result; } areSimpleModelsEqual(aSimple, bSimple) { return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type; } createCondition(position) { const type = this.getConditionType(position); const model = { filterType: this.filterType, type }; const values = this.getValues(position); if (values.length > 0) { model.filter = String(values[0]); } if (values.length > 1) { model.filterTo = String(values[1]); } return model; } removeConditionsAndOperators(startPosition, deleteCount) { if (this.hasInvalidInputs()) { return; } return super.removeConditionsAndOperators(startPosition, deleteCount); } getInputs(position) { const { eValuesFrom, eValuesTo } = this; if (position >= eValuesFrom.length) { return [null, null]; } return [eValuesFrom[position], eValuesTo[position]]; } hasInvalidInputs() { let invalidInputs = false; this.forEachInput((element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid)); return invalidInputs; } positionHasInvalidInputs(position) { let invalidInputs = false; this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid)); return invalidInputs; } canApply(_model) { return !this.hasInvalidInputs(); } getParsedValue(element, bigintParser) { const rawValue = element.getValue(); if (rawValue == null || typeof rawValue === "string" && rawValue.trim() === "") { return null; } return bigintParser ? bigintParser(rawValue) : _parseBigIntOrNull(rawValue); } isInvalidValue(element, parsedValue) { const rawValue = element.getValue(); return rawValue != null && String(rawValue).trim() !== "" && parsedValue === null; } }; function getValidityMessageKey(fromValue, toValue, isFrom) { const isInvalid = fromValue != null && toValue != null && fromValue >= toValue; if (!isInvalid) { return null; } return `strict${isFrom ? "Max" : "Min"}ValueValidation`; } var SimpleFilterHandler = class extends BeanStub { constructor(mapValuesFromModel, defaultOptions) { super(); this.mapValuesFromModel = mapValuesFromModel; this.defaultOptions = defaultOptions; } init(params) { const filterParams = params.filterParams; const optionsFactory = new OptionsFactory(); this.optionsFactory = optionsFactory; optionsFactory.init(filterParams, this.defaultOptions); this.filterModelFormatter = this.createManagedBean( new this.FilterModelFormatterClass(optionsFactory, filterParams) ); this.updateParams(params); this.validateModel(params); } refresh(params) { if (params.source === "colDef") { const filterParams = params.filterParams; const optionsFactory = this.optionsFactory; optionsFactory.refresh(filterParams, this.defaultOptions); this.filterModelFormatter.updateParams({ optionsFactory, filterParams }); this.updateParams(params); } this.validateModel(params); } updateParams(params) { this.params = params; } doesFilterPass(params) { const model = params.model; if (model == null) { return true; } const { operator } = model; const models = []; if (operator) { const combinedModel = model; models.push(...combinedModel.conditions ?? []); } else { models.push(model); } const combineFunction = operator && operator === "OR" ? "some" : "every"; const cellValue = this.params.getValue(params.node); return models[combineFunction]((m) => this.individualConditionPasses(params, m, cellValue)); } getModelAsString(model, source) { return this.filterModelFormatter.getModelAsString(model, source) ?? ""; } validateModel(params) { const { model, filterParams: { filterOptions, maxNumConditions } } = params; if (model == null) { return; } const isCombined = isCombinedFilterModel(model); let conditions = isCombined ? model.conditions : [model]; const newOptionsList = filterOptions?.map((option) => typeof option === "string" ? option : option.displayKey) ?? this.defaultOptions; const allConditionsExistInNewOptionsList = !conditions || conditions.every((condition) => newOptionsList.find((option) => option === condition.type) !== void 0); if (!allConditionsExistInNewOptionsList) { this.params = { ...params, model: null }; params.onModelChange(null); return; } let needsUpdate = false; const filterType = this.filterType; if (conditions && !conditions.every((condition) => condition.filterType === filterType) || model.filterType !== filterType) { conditions = conditions.map((condition) => ({ ...condition, filterType })); needsUpdate = true; } if (typeof maxNumConditions === "number" && conditions && conditions.length > maxNumConditions) { conditions = conditions.slice(0, maxNumConditions); needsUpdate = true; } if (needsUpdate) { const updatedModel = conditions.length > 1 ? { ...model, filterType, conditions } : { ...conditions[0], filterType }; this.params = { ...params, model: updatedModel }; params.onModelChange(updatedModel); } } /** returns true if the row passes the said condition */ individualConditionPasses(params, filterModel, cellValue) { const optionsFactory = this.optionsFactory; const values = this.mapValuesFromModel(filterModel, optionsFactory); const customFilterOption = optionsFactory.getCustomOption(filterModel.type); const customFilterResult = evaluateCustomFilter(customFilterOption, values, cellValue); if (customFilterResult != null) { return customFilterResult; } if (cellValue == null) { return this.evaluateNullValue(filterModel.type); } return this.evaluateNonNullValue(values, cellValue, filterModel, params); } }; var ScalarFilterHandler = class extends SimpleFilterHandler { evaluateNullValue(filterType) { const { includeBlanksInEquals, includeBlanksInNotEqual, includeBlanksInGreaterThan, includeBlanksInLessThan, includeBlanksInRange } = this.params.filterParams; switch (filterType) { case "equals": if (includeBlanksInEquals) { return true; } break; case "notEqual": if (includeBlanksInNotEqual) { return true; } break; case "greaterThan": case "greaterThanOrEqual": if (includeBlanksInGreaterThan) { return true; } break; case "lessThan": case "lessThanOrEqual": if (includeBlanksInLessThan) { return true; } break; case "inRange": if (includeBlanksInRange) { return true; } break; case "blank": return true; case "notBlank": return false; } return false; } evaluateNonNullValue(values, cellValue, filterModel) { const type = filterModel.type; if (!this.isValid(cellValue)) { return type === "notEqual" || type === "notBlank"; } const comparator = this.comparator(); const compareResult = values[0] != null ? comparator(values[0], cellValue) : 0; switch (type) { case "equals": return compareResult === 0; case "notEqual": return compareResult !== 0; case "greaterThan": return compareResult > 0; case "greaterThanOrEqual": return compareResult >= 0; case "lessThan": return compareResult < 0; case "lessThanOrEqual": return compareResult <= 0; case "inRange": { const compareToResult = comparator(values[1], cellValue); return this.params.filterParams.inRangeInclusive ? compareResult >= 0 && compareToResult <= 0 : compareResult > 0 && compareToResult < 0; } case "blank": return isBlank(cellValue); case "notBlank": return !isBlank(cellValue); default: _warn(76, { filterModelType: type }); return true; } } }; var SCALAR_FILTER_TYPE_KEYS = { equals: "Equals", notEqual: "NotEqual", greaterThan: "GreaterThan", greaterThanOrEqual: "GreaterThanOrEqual", lessThan: "LessThan", lessThanOrEqual: "LessThanOrEqual", inRange: "InRange" }; var TEXT_FILTER_TYPE_KEYS = { contains: "Contains", notContains: "NotContains", equals: "TextEquals", notEqual: "TextNotEqual", startsWith: "StartsWith", endsWith: "EndsWith", inRange: "InRange" }; var SimpleFilterModelFormatter = class extends BeanStub { constructor(optionsFactory, filterParams, valueFormatter) { super(); this.optionsFactory = optionsFactory; this.filterParams = filterParams; this.valueFormatter = valueFormatter; } // used by: // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only. // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only) getModelAsString(model, source) { const translate = this.getLocaleTextFunc(); const forToolPanel = source === "filterToolPanel"; if (!model) { return forToolPanel ? translateForFilter(this, "filterSummaryInactive") : null; } const isCombined = model.operator != null; if (isCombined) { const combinedModel = model; const conditions = combinedModel.conditions ?? []; const customOptions = conditions.map((condition) => this.getModelAsString(condition, source)); const joinOperatorTranslateKey = combinedModel.operator === "AND" ? "andCondition" : "orCondition"; return customOptions.join(` ${translateForFilter(this, joinOperatorTranslateKey)} `); } else if (model.type === "blank" || model.type === "notBlank") { return forToolPanel ? translateForFilter(this, model.type === "blank" ? "filterSummaryBlank" : "filterSummaryNotBlank") : translate(model.type, model.type); } else { const condition = model; const customOption = this.optionsFactory.getCustomOption(condition.type); const { displayKey, displayName, numberOfInputs } = customOption || {}; if (displayKey && displayName && numberOfInputs === 0) { return translate(displayKey, displayName); } return this.conditionToString( condition, forToolPanel, condition.type === "inRange" || numberOfInputs === 2, displayKey, displayName ); } } updateParams(params) { const { optionsFactory, filterParams } = params; this.optionsFactory = optionsFactory; this.filterParams = filterParams; } conditionForToolPanel(type, isRange, getFilter, getFilterTo, customDisplayKey, customDisplayName) { let typeValue; const typeKey = this.getTypeKey(type); if (typeKey) { typeValue = translateForFilter(this, typeKey); } if (customDisplayKey && customDisplayName) { typeValue = this.getLocaleTextFunc()(customDisplayKey, customDisplayName); } if (typeValue != null) { if (isRange) { return `${typeValue} ${translateForFilter(this, "filterSummaryInRangeValues", [getFilter(), getFilterTo()])}`; } else { return `${typeValue} ${getFilter()}`; } } return null; } getTypeKey(type) { const suffix = this.filterTypeKeys[type]; return suffix ? `filterSummary${suffix}` : null; } formatValue(value) { const valueFormatter = this.valueFormatter; return valueFormatter ? valueFormatter(value ?? null) ?? "" : String(value); } }; var BigIntFilterModelFormatter = class extends SimpleFilterModelFormatter { constructor(optionsFactory, filterParams) { super(optionsFactory, filterParams, filterParams.bigintFormatter); this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS; } conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) { const { filter, filterTo, type } = condition; const format = this.formatValue.bind(this); const parsedFrom = _parseBigIntOrNull(filter); const parsedTo = _parseBigIntOrNull(filterTo); if (forToolPanel) { const valueForToolPanel = this.conditionForToolPanel( type, isRange, () => format(parsedFrom), () => format(parsedTo), customDisplayKey, customDisplayName ); if (valueForToolPanel != null) { return valueForToolPanel; } } if (isRange) { return `${format(parsedFrom)}-${format(parsedTo)}`; } if (filter != null) { return format(parsedFrom); } return `${type}`; } }; var BigIntFilterHandler = class extends ScalarFilterHandler { constructor() { super(mapValuesFromBigIntFilterModel, DEFAULT_BIGINT_FILTER_OPTIONS); this.filterType = "bigint"; this.FilterModelFormatterClass = BigIntFilterModelFormatter; } comparator() { return (left, right) => { if (left === right) { return 0; } return left < right ? 1 : -1; }; } isValid(value) { return _parseBigIntOrNull(value) !== null; } }; var FloatingFilterTextInputService = class extends BeanStub { constructor(params) { super(); this.params = params; this.eInput = RefPlaceholder; this.onValueChanged = () => { }; } setupGui(parentElement) { this.eInput = this.createManagedBean(new AgInputTextField(this.params?.config)); const eInput = this.eInput.getGui(); parentElement.appendChild(eInput); const listener = (e) => this.onValueChanged(e); this.addManagedListeners(eInput, { input: listener, keydown: listener }); } setEditable(editable) { this.eInput.setDisabled(!editable); } getValue() { return this.eInput.getValue(); } setValue(value, silent) { this.eInput.setValue(value, silent); } setValueChangedListener(listener) { this.onValueChanged = listener; } setParams({ ariaLabel, autoComplete, placeholder }) { const { eInput } = this; eInput.setInputAriaLabel(ariaLabel); if (autoComplete !== void 0) { eInput.setAutoComplete(autoComplete); } eInput.toggleCss("ag-floating-filter-search-icon", !!placeholder); eInput.setInputPlaceholder(placeholder); } }; function trimInputForFilter(value) { const trimmedInput = value?.trim(); return trimmedInput === "" ? value : trimmedInput; } function mapValuesFromTextFilterModel(filterModel, optionsFactory) { const { filter, filterTo, type } = filterModel || {}; return [filter || null, filterTo || null].slice(0, getNumberOfInputs(type, optionsFactory)); } var SimpleFloatingFilter = class extends Component { constructor() { super(...arguments); this.defaultDebounceMs = 0; } setLastTypeFromModel(model) { if (!model) { this.lastType = this.optionsFactory.defaultOption; return; } const isCombined = model.operator; let condition; if (isCombined) { const combinedModel = model; condition = combinedModel.conditions[0]; } else { condition = model; } this.lastType = condition.type; } canWeEditAfterModelFromParentFilter(model) { if (!model) { return this.isTypeEditable(this.lastType); } const isCombined = model.operator; if (isCombined) { return false; } const simpleModel = model; return this.isTypeEditable(simpleModel.type); } init(params) { this.params = params; const reactive = this.gos.get("enableFilterHandlers"); this.reactive = reactive; this.setParams(params); if (reactive) { const reactiveParams = params; this.onModelUpdated(reactiveParams.model); } } setParams(params) { const optionsFactory = new OptionsFactory(); this.optionsFactory = optionsFactory; optionsFactory.init(params.filterParams, this.defaultOptions); this.filterModelFormatter = this.createManagedBean( new this.FilterModelFormatterClass(optionsFactory, params.filterParams) ); this.setSimpleParams(params, false); } setSimpleParams(params, update = true) { const defaultOption = this.optionsFactory.defaultOption; if (!update) { this.lastType = defaultOption; } this.readOnly = !!params.filterParams.readOnly; const editable = this.isTypeEditable(defaultOption); this.setEditable(editable); } refresh(params) { this.params = params; const reactiveParams = params; const reactive = this.reactive; if (!reactive || reactiveParams.source === "colDef") { this.updateParams(params); } if (reactive) { const { source, model } = reactiveParams; if (source === "dataChanged" || source === "ui") { return; } this.onModelUpdated(model); } } updateParams(params) { const optionsFactory = this.optionsFactory; optionsFactory.refresh(params.filterParams, this.defaultOptions); this.setSimpleParams(params); this.filterModelFormatter.updateParams({ optionsFactory, filterParams: params.filterParams }); } onParentModelChanged(model, event) { if (event?.afterFloatingFilter || event?.afterDataChange) { return; } this.onModelUpdated(model); } isTypeEditable(type) { return !!type && !this.readOnly && getNumberOfInputs(type, this.optionsFactory) === 1; } getAriaLabel(column) { const displayName = this.beans.colNames.getDisplayNameForColumn(column, "header", true); return `${displayName} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`; } }; var TextInputFloatingFilterElement = { tag: "div", ref: "eFloatingFilterInputContainer", cls: "ag-floating-filter-input", role: "presentation" }; var TextInputFloatingFilter = class extends SimpleFloatingFilter { constructor() { super(...arguments); this.eFloatingFilterInputContainer = RefPlaceholder; this.defaultDebounceMs = 500; } postConstruct() { this.setTemplate(TextInputFloatingFilterElement); } onModelUpdated(model) { this.setLastTypeFromModel(model); this.setEditable(this.canWeEditAfterModelFromParentFilter(model)); this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(model)); } setParams(params) { this.setupFloatingFilterInputService(params); super.setParams(params); this.setTextInputParams(params); } setupFloatingFilterInputService(params) { this.inputSvc = this.createFloatingFilterInputService(params); this.inputSvc.setupGui(this.eFloatingFilterInputContainer); } setTextInputParams(params) { const { inputSvc, defaultDebounceMs, readOnly } = this; const { filterPlaceholder, column, browserAutoComplete, filterParams } = params; const filterOptionKey = this.lastType ?? this.optionsFactory.defaultOption; const parentFilterPlaceholder = params.filterParams.filterPlaceholder; const placeholder = filterPlaceholder === true ? getPlaceholderText(this, parentFilterPlaceholder, "filterOoo", filterOptionKey) : filterPlaceholder || void 0; inputSvc.setParams({ ariaLabel: this.getAriaLabel(column), autoComplete: browserAutoComplete ?? false, placeholder }); this.applyActive = _isUseApplyButton(filterParams); if (!readOnly) { const debounceMs = getDebounceMs(filterParams, defaultDebounceMs); inputSvc.setValueChangedListener(_debounce(this, this.syncUpWithParentFilter.bind(this), debounceMs)); } } updateParams(params) { super.updateParams(params); this.setTextInputParams(params); } recreateFloatingFilterInputService(params) { const { inputSvc } = this; const value = inputSvc.getValue(); _clearElement(this.eFloatingFilterInputContainer); this.destroyBean(inputSvc); this.setupFloatingFilterInputService(params); inputSvc.setValue(value, true); } syncUpWithParentFilter(e) { const isEnterKey = e.key === KeyCode.ENTER; const reactive = this.reactive; if (reactive) { const reactiveParams = this.params; reactiveParams.onUiChange(); } if (this.applyActive && !isEnterKey) { return; } const { inputSvc, params, lastType } = this; let value = inputSvc.getValue(); if (params.filterParams.trimInput) { value = trimInputForFilter(value); inputSvc.setValue(value, true); } if (reactive) { const reactiveParams = params; const model = reactiveParams.model; const parsedValue = this.convertValue(value); const newModel = parsedValue == null ? null : { ...model ?? { filterType: this.filterType, type: lastType ?? this.optionsFactory.defaultOption }, filter: parsedValue }; reactiveParams.onModelChange(newModel, { afterFloatingFilter: true }); } else { params.parentFilterInstance((filterInstance) => { filterInstance?.onFloatingFilterChanged(lastType || null, value || null); }); } } convertValue(value) { return value || null; } setEditable(editable) { this.inputSvc.setEditable(editable); } }; var BigIntFloatingFilter = class extends TextInputFloatingFilter { constructor() { super(...arguments); this.FilterModelFormatterClass = BigIntFilterModelFormatter; this.filterType = "bigint"; this.defaultOptions = DEFAULT_BIGINT_FILTER_OPTIONS; } updateParams(params) { const filterParams = params.filterParams; const allowedCharPattern = getAllowedCharPattern(filterParams); if (allowedCharPattern !== this.allowedCharPattern) { this.recreateFloatingFilterInputService(params); } this.bigintParser = filterParams?.bigintParser; super.updateParams(params); } createFloatingFilterInputService(params) { const filterParams = params.filterParams; this.allowedCharPattern = getAllowedCharPattern(filterParams); this.bigintParser = filterParams?.bigintParser; const config = this.allowedCharPattern ? { allowedCharPattern: this.allowedCharPattern } : void 0; return this.createManagedBean(new FloatingFilterTextInputService({ config })); } convertValue(value) { if (value == null || value === "") { return null; } if (this.bigintParser) { return this.bigintParser(value); } return _parseBigIntOrNull(value); } }; var CLASS_INPUT_FIELD = ".ag-input-field-input"; var DateCompWrapper = class { constructor(context, userCompFactory, colDef, dateComponentParams, eParent, onReady) { this.context = context; this.eParent = eParent; this.alive = true; this.debouncedReport = _debounce({ isAlive: () => this.alive }, reportValidity, 500); this.timeoutHandle = null; const compDetails = _getDateCompDetails(userCompFactory, colDef, dateComponentParams); compDetails?.newAgStackInstance().then((dateComp) => { if (!this.alive) { context.destroyBean(dateComp); return; } this.dateComp = dateComp; if (!dateComp) { return; } eParent.appendChild(dateComp.getGui()); dateComp?.afterGuiAttached?.(); const { tempValue, disabled } = this; if (tempValue) { dateComp.setDate(tempValue); } if (disabled != null) { dateComp.setDisabled?.(disabled); } onReady?.(this); }); } destroy() { this.alive = false; this.dateComp = this.context.destroyBean(this.dateComp); } getDate() { return this.dateComp ? this.dateComp.getDate() : this.tempValue; } setDate(value) { const dateComp = this.dateComp; if (dateComp) { dateComp.setDate(value); } else { this.tempValue = value; } } setDisabled(disabled) { const dateComp = this.dateComp; if (dateComp) { dateComp.setDisabled?.(disabled); } else { this.disabled = disabled; } } setDisplayed(displayed) { _setDisplayed(this.eParent, displayed); } setInputPlaceholder(placeholder) { this.dateComp?.setInputPlaceholder?.(placeholder); } setInputAriaLabel(label) { this.dateComp?.setInputAriaLabel?.(label); } afterGuiAttached(params) { this.dateComp?.afterGuiAttached?.(params); } updateParams(params) { this.dateComp?.refresh?.(params); } setCustomValidity(message, defer = false) { const eInput = this.dateComp?.getGui().querySelector(CLASS_INPUT_FIELD); if (eInput && "setCustomValidity" in eInput) { const isInvalid = message.length > 0; eInput.setCustomValidity(message); if (isInvalid) { if (defer) { this.timeoutHandle = this.debouncedReport(eInput); } else { reportValidity(eInput); } } else if (this.timeoutHandle) { window.clearTimeout(this.timeoutHandle); } _setAriaInvalid(eInput, isInvalid); } } getValidity() { return this.dateComp?.getGui().querySelector(CLASS_INPUT_FIELD)?.validity; } }; function reportValidity(eInput) { eInput.reportValidity(); } var DEFAULT_DATE_FILTER_OPTIONS = [ "equals", "notEqual", "lessThan", "greaterThan", "inRange", "blank", "notBlank" ]; function mapValuesFromDateFilterModel(filterModel, optionsFactory) { const { dateFrom, dateTo, type } = filterModel || {}; return [ dateFrom && _parseDateTimeFromString(dateFrom, void 0, true) || null, dateTo && _parseDateTimeFromString(dateTo, void 0, true) || null ].slice(0, getNumberOfInputs(type, optionsFactory)); } var DEFAULT_MIN_YEAR = 1e3; var DEFAULT_MAX_YEAR = Infinity; var DateFilter = class extends SimpleFilter { constructor() { super("dateFilter", mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS); this.eConditionPanelsFrom = []; this.eConditionPanelsTo = []; this.dateConditionFromComps = []; this.dateConditionToComps = []; this.minValidYear = DEFAULT_MIN_YEAR; this.maxValidYear = DEFAULT_MAX_YEAR; this.minValidDate = null; this.maxValidDate = null; this.filterType = "date"; } afterGuiAttached(params) { super.afterGuiAttached(params); this.dateConditionFromComps[0].afterGuiAttached(params); this.refreshInputValidation(); } shouldKeepInvalidInputState() { return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes("inRange"); } commonUpdateSimpleParams(params) { super.commonUpdateSimpleParams(params); const yearParser = (param, fallback) => { const value = params[param]; if (value != null) { if (!isNaN(value)) { return value == null ? fallback : Number(value); } else { _warn(82, { param }); } } return fallback; }; const minValidYear = yearParser("minValidYear", DEFAULT_MIN_YEAR); const maxValidYear = yearParser("maxValidYear", DEFAULT_MAX_YEAR); this.minValidYear = minValidYear; this.maxValidYear = maxValidYear; if (minValidYear > maxValidYear) { _warn(83); } const { minValidDate, maxValidDate } = params; const parsedMinValidDate = minValidDate instanceof Date ? minValidDate : _parseDateTimeFromString(minValidDate); this.minValidDate = parsedMinValidDate; const parsedMaxValidDate = maxValidDate instanceof Date ? maxValidDate : _parseDateTimeFromString(maxValidDate); this.maxValidDate = parsedMaxValidDate; if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate > parsedMaxValidDate) { _warn(84); } } refreshInputValidation() { for (let i = 0; i < this.dateConditionFromComps.length; i++) { this.refreshInputPairValidation(i, false, true); } } refreshInputPairValidation(position, isFrom = false, forceImmediate = false) { const { dateConditionFromComps, dateConditionToComps, beans } = this; const from = dateConditionFromComps[position]; const to = dateConditionToComps[position]; const numberOfInputs = getNumberOfInputs(this.getConditionType(position), this.optionsFactory); const fromDate = from.getDate(); const toDate = to.getDate(); const localeKey = numberOfInputs >= 2 ? getRangeValidityMessageKey(fromDate, toDate, isFrom) : null; const message = localeKey ? this.translate(localeKey, [String(isFrom ? toDate : fromDate)]) : ""; const shouldDebounceReport = !_isBrowserFirefox() && !forceImmediate; (isFrom ? from : to).setCustomValidity(message, shouldDebounceReport); (isFrom ? to : from).setCustomValidity("", shouldDebounceReport); if (message.length > 0) { beans.ariaAnnounce.announceValue(message, "dateFilter"); } } createDateCompWrapper(element, position, fromTo) { const { beans: { userCompFactory, context, gos }, params } = this; const isFrom = fromTo === "from"; const dateCompWrapper = new DateCompWrapper( context, userCompFactory, params.colDef, _addGridCommonParams(gos, { onDateChanged: () => { this.refreshInputPairValidation(position, isFrom); this.onUiChanged(); }, onFocusIn: () => this.refreshInputPairValidation(position, isFrom), filterParams: params, location: "filter" }), element ); this.addDestroyFunc(() => dateCompWrapper.destroy()); return dateCompWrapper; } getState() { return { isInvalid: this.hasInvalidInputs() }; } areStatesEqual(stateA, stateB) { return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false); } setElementValue(element, value) { element.setDate(value); if (!value) { element.setCustomValidity(""); } } setElementDisplayed(element, displayed) { element.setDisplayed(displayed); } setElementDisabled(element, disabled) { element.setDisabled(disabled); } createEValue() { const eCondition = _createElement({ tag: "div", cls: "ag-filter-body" }); this.createFromToElement(eCondition, this.eConditionPanelsFrom, this.dateConditionFromComps, "from"); this.createFromToElement(eCondition, this.eConditionPanelsTo, this.dateConditionToComps, "to"); return eCondition; } createFromToElement(eCondition, eConditionPanels, dateConditionComps, fromTo) { const eConditionPanel = _createElement({ tag: "div", cls: `ag-filter-${fromTo} ag-filter-date-${fromTo}` }); eConditionPanels.push(eConditionPanel); eCondition.appendChild(eConditionPanel); dateConditionComps.push(this.createDateCompWrapper(eConditionPanel, eConditionPanels.length - 1, fromTo)); } removeEValues(startPosition, deleteCount) { this.removeDateComps(this.dateConditionFromComps, startPosition, deleteCount); this.removeDateComps(this.dateConditionToComps, startPosition, deleteCount); removeItems(this.eConditionPanelsFrom, startPosition, deleteCount); removeItems(this.eConditionPanelsTo, startPosition, deleteCount); } removeDateComps(components, startPosition, deleteCount) { const removedComponents = removeItems(components, startPosition, deleteCount); for (const comp of removedComponents) { comp.destroy(); } } isValidDateValue(value) { if (value === null) { return false; } const { minValidDate, maxValidDate, minValidYear, maxValidYear } = this; if (minValidDate) { if (value < minValidDate) { return false; } } else if (value.getUTCFullYear() < minValidYear) { return false; } if (maxValidDate) { if (value > maxValidDate) { return false; } } else if (value.getUTCFullYear() > maxValidYear) { return false; } return true; } hasInvalidInputs() { let invalidInputs = false; this.forEachInput( (element) => invalidInputs || (invalidInputs = element.getDate() != null && !(element.getValidity()?.valid ?? true)) ); return invalidInputs; } positionHasInvalidInputs(position) { let invalidInputs = false; this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !(element.getValidity()?.valid ?? true))); return invalidInputs; } canApply(_model) { return !this.hasInvalidInputs(); } isConditionUiComplete(position) { if (!super.isConditionUiComplete(position)) { return false; } let valid = true; this.forEachPositionInput(position, (element, index, _pos, numberOfInputs) => { if (!valid || index >= numberOfInputs) { return; } valid && (valid = this.isValidDateValue(element.getDate())); }); return valid; } areSimpleModelsEqual(aSimple, bSimple) { return aSimple.dateFrom === bSimple.dateFrom && aSimple.dateTo === bSimple.dateTo && aSimple.type === bSimple.type; } createCondition(position) { const type = this.getConditionType(position); const model = {}; const { params, filterType } = this; const values = this.getValues(position); const separator = params.useIsoSeparator ? "T" : " "; if (values.length > 0) { model.dateFrom = _serialiseDate(values[0], true, separator); } if (values.length > 1) { model.dateTo = _serialiseDate(values[1], true, separator); } return { dateFrom: null, dateTo: null, filterType, type, ...model }; } removeConditionsAndOperators(startPosition, deleteCount) { if (this.hasInvalidInputs()) { return; } return super.removeConditionsAndOperators(startPosition, deleteCount); } resetPlaceholder() { const globalTranslate = this.getLocaleTextFunc(); const placeholder = this.translate("dateFormatOoo"); const ariaLabel = globalTranslate("ariaFilterValue", "Filter Value"); this.forEachInput((element) => { element.setInputPlaceholder(placeholder); element.setInputAriaLabel(ariaLabel); }); } getInputs(position) { const { dateConditionFromComps, dateConditionToComps } = this; if (position >= dateConditionFromComps.length) { return [null, null]; } return [dateConditionFromComps[position], dateConditionToComps[position]]; } getValues(position) { const result = []; this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => { if (index < numberOfInputs) { result.push(element.getDate()); } }); return result; } translate(key, variableValues) { let normalisedKey = key; if (key === "lessThan") { normalisedKey = "before"; } else if (key === "greaterThan") { normalisedKey = "after"; } return super.translate(normalisedKey, variableValues); } }; function getRangeValidityMessageKey(fromDate, toDate, isFrom) { const isInvalid = fromDate != null && toDate != null && fromDate >= toDate; if (!isInvalid) { return null; } return `${isFrom ? "max" : "min"}DateValidation`; } var DateFilterModelFormatter = class extends SimpleFilterModelFormatter { constructor(optionsFactory, filterParams) { super(optionsFactory, filterParams, (value) => { const { dataTypeSvc, valueSvc } = this.beans; const column = filterParams.column; const dateFormatFn = dataTypeSvc?.getDateFormatterFunction(column); const valueToFormat = dateFormatFn ? dateFormatFn(value ?? void 0) : value; return valueSvc.formatValue(column, null, valueToFormat); }); this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS; } conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) { const { type } = condition; const dateFrom = _parseDateTimeFromString(condition.dateFrom); const dateTo = _parseDateTimeFromString(condition.dateTo); const format = this.filterParams.inRangeFloatingFilterDateFormat; const formatDate = forToolPanel ? this.formatValue.bind(this) : (value) => _dateToFormattedString(value, format); const formattedFrom = () => dateFrom !== null ? formatDate(dateFrom) : "null"; const formattedTo = () => dateTo !== null ? formatDate(dateTo) : "null"; if (dateFrom == null && dateTo == null) { return translateForFilter(this, type); } if (forToolPanel) { const valueForToolPanel = this.conditionForToolPanel( type, isRange, formattedFrom, formattedTo, customDisplayKey, customDisplayName ); if (valueForToolPanel != null) { return valueForToolPanel; } } if (isRange) { return `${formattedFrom()}-${formattedTo()}`; } if (dateFrom != null) { return formatDate(dateFrom); } return `${type}`; } }; function defaultDateComparator(filterDate, cellValue) { const cellAsDate = cellValue; if (cellAsDate < filterDate) { return -1; } if (cellAsDate > filterDate) { return 1; } return 0; } var DateFilterHandler = class extends ScalarFilterHandler { constructor() { super(mapValuesFromDateFilterModel, DEFAULT_DATE_FILTER_OPTIONS); this.filterType = "date"; this.FilterModelFormatterClass = DateFilterModelFormatter; this.filterTypeToRangeCache = /* @__PURE__ */ new Map(); } getOrRefreshRangeCacheItem(key, rangeFn) { const { filterTypeToRangeCache } = this; const now = Date.now(); let cache = filterTypeToRangeCache.get(key); if (cache && cache.expires < now) { cache = void 0; } if (!cache) { const [from, to] = rangeFn(new Date(now), new Date(now)); cache = { from, to, expires: setStartOfNextDay(new Date(now)).getTime() - now }; filterTypeToRangeCache.set(key, cache); } return cache; } comparator() { return this.params.filterParams.comparator ?? defaultDateComparator; } isValid(value) { const isValidDate2 = this.params.filterParams.isValidDate; return !isValidDate2 || isValidDate2(value); } evaluateNonNullValue(values, cellValue, filterModel) { const type = filterModel.type; const comparator = this.comparator(); if (!this.isValid(cellValue)) { return type === "notEqual" || type === "notBlank"; } const maybeTypeAsPreset = type; const presetDateRangeFn = presetDateFilterTypeRelativeFromToMap[maybeTypeAsPreset]; if (presetDateRangeFn) { const { from, to } = this.getOrRefreshRangeCacheItem(maybeTypeAsPreset, presetDateRangeFn); return comparator(from, cellValue) >= 0 && comparator(to, cellValue) < 0; } return super.evaluateNonNullValue(values, cellValue, filterModel); } }; var DEFAULT_FIRST_DAY_OF_WEEK = 1; var cachedFirstDayOfWeek = null; var getFirstDayOfWeek = () => { if (cachedFirstDayOfWeek != null) { return cachedFirstDayOfWeek; } let firstDay; const locale = typeof navigator === "undefined" ? void 0 : navigator.languages?.[0] ?? navigator.language; if (locale && typeof Intl !== "undefined" && typeof Intl.Locale === "function") { try { const weekInfo = new Intl.Locale(locale).getWeekInfo?.(); firstDay = weekInfo?.firstDay; } catch { firstDay = void 0; } } cachedFirstDayOfWeek = firstDay == null ? DEFAULT_FIRST_DAY_OF_WEEK : firstDay % 7; return cachedFirstDayOfWeek; }; var setStartOfDay = (date) => { date.setHours(0, 0, 0, 0); return date; }; var setStartOfWeek = (date) => { const day = date.getDay(); const weekStart = getFirstDayOfWeek(); const diff = (day - weekStart + 7) % 7; date.setDate(date.getDate() - diff); return setStartOfDay(date); }; var setPreviousNDay = (date, n = 1) => { date.setDate(date.getDate() - n); return date; }; var setStartOfNextDay = (date) => { date.setDate(date.getDate() + 1); return setStartOfDay(date); }; var setStartOfNextWeek = (date) => { setStartOfWeek(date); date.setDate(date.getDate() + 6); return setStartOfNextDay(date); }; var setStartOfMonth = (date) => { date.setDate(1); return setStartOfDay(date); }; var setStartOfNextMonth = (date) => { date.setDate(1); date.setMonth(date.getMonth() + 1); return setStartOfDay(date); }; var setStartOfQuarter = (date) => { const quarter = Math.floor(date.getMonth() / 3); date.setMonth(quarter * 3); return setStartOfMonth(date); }; var setStartOfNextQuarter = (date) => { const quarter = Math.floor(date.getMonth() / 3); date.setMonth(quarter * 3 + 2); return setStartOfNextMonth(date); }; var setStartOfYear = (date) => { date.setMonth(0, 1); return setStartOfDay(date); }; var setStartOfNextYear = (date) => { date.setMonth(12, 0); return setStartOfNextDay(date); }; var setPreviousDay = (date) => setPreviousNDay(date); var setPreviousWeek = (date) => setPreviousDay(setStartOfWeek(date)); var setPreviousMonth = (date) => setPreviousDay(setStartOfMonth(date)); var setPreviousQuarter = (date) => setPreviousDay(setStartOfQuarter(date)); var today = (from, to) => [setStartOfDay(from), setStartOfNextDay(to)]; var yesterday = (from, to) => today(setPreviousDay(from), setPreviousDay(to)); var thisWeek = (from, to) => [setStartOfWeek(from), setStartOfNextWeek(to)]; var lastWeek = (from, to) => thisWeek(setPreviousWeek(from), setPreviousWeek(to)); var thisMonth = (from, to) => [setStartOfMonth(from), setStartOfNextMonth(to)]; var lastMonth = (from, to) => thisMonth(setPreviousMonth(from), setPreviousMonth(to)); var thisQuarter = (from, to) => [setStartOfQuarter(from), setStartOfNextQuarter(to)]; var lastQuarter = (from, to) => thisQuarter(setPreviousQuarter(from), setPreviousQuarter(to)); var thisYear = (from, to) => [setStartOfYear(from), setStartOfNextYear(to)]; var yearToDate = (from, to) => [setStartOfYear(from), setStartOfNextDay(to)]; var last7Days = (from, to) => [ setStartOfDay(setPreviousNDay(from, 7)), setStartOfNextDay(to) ]; var last30Days = (from, to) => [ setStartOfDay(setPreviousNDay(from, 30)), setStartOfNextDay(to) ]; var last90Days = (from, to) => [ setStartOfDay(setPreviousNDay(from, 90)), setStartOfNextDay(to) ]; var last6Months = (from, to) => { from.setFullYear(from.getFullYear() - 1); from.setMonth(from.getMonth() + 6); return [setStartOfDay(from), setStartOfNextDay(to)]; }; var last12Months = (from, to) => { from.setFullYear(from.getFullYear() - 1); return [setStartOfDay(from), setStartOfNextDay(to)]; }; var last24Months = (from, to) => { from.setFullYear(from.getFullYear() - 2); return [setStartOfDay(from), setStartOfNextDay(to)]; }; var lastYear = (from, to) => { from.setFullYear(from.getFullYear() - 1); to.setFullYear(to.getFullYear() - 1); return thisYear(from, to); }; var nextYear = (from, to) => { from.setFullYear(from.getFullYear() + 1); to.setFullYear(to.getFullYear() + 1); return thisYear(from, to); }; var nextQuarter = (from, to) => { from.setMonth(from.getMonth() + 3); to.setMonth(to.getMonth() + 3); return thisQuarter(from, to); }; var nextMonth = (from, to) => { from.setMonth(from.getMonth() + 1); to.setMonth(to.getMonth() + 1); return thisMonth(from, to); }; var nextWeek = (from, to) => { from.setDate(from.getDate() + 7); to.setDate(to.getDate() + 7); return thisWeek(from, to); }; var tomorrow = (from, to) => { from.setDate(from.getDate() + 1); to.setDate(to.getDate() + 1); return today(from, to); }; var presetDateFilterTypeRelativeFromToMap = { today, yesterday, tomorrow, thisWeek, lastWeek, nextWeek, thisMonth, lastMonth, nextMonth, thisQuarter, lastQuarter, nextQuarter, thisYear, lastYear, nextYear, yearToDate, last7Days, last30Days, last90Days, last6Months, last12Months, last24Months, setStartOfDay, setStartOfWeek, setStartOfNextDay, setStartOfNextWeek, setStartOfMonth, setStartOfNextMonth, setStartOfQuarter, setStartOfNextQuarter, setStartOfYear, setStartOfNextYear, setPreviousDay, setPreviousWeek, setPreviousMonth, setPreviousQuarter }; var DateFloatingFilterElement = { tag: "div", cls: "ag-floating-filter-input", role: "presentation", children: [ { tag: "ag-input-text-field", ref: "eReadOnlyText" }, { tag: "div", ref: "eDateWrapper", cls: "ag-date-floating-filter-wrapper" } ] }; var DateFloatingFilter = class extends SimpleFloatingFilter { constructor() { super(DateFloatingFilterElement, [AgInputTextFieldSelector]); this.eReadOnlyText = RefPlaceholder; this.eDateWrapper = RefPlaceholder; this.FilterModelFormatterClass = DateFilterModelFormatter; this.filterType = "date"; this.defaultOptions = DEFAULT_DATE_FILTER_OPTIONS; } setParams(params) { super.setParams(params); this.createDateComponent(); const translate = this.getLocaleTextFunc(); this.eReadOnlyText.setDisabled(true).setInputAriaLabel(translate("ariaDateFilterInput", "Date Filter Input")); } updateParams(params) { super.updateParams(params); this.dateComp.updateParams(this.getDateComponentParams()); this.updateCompOnModelChange(params.currentParentModel()); } updateCompOnModelChange(model) { const allowEditing = !this.readOnly && this.canWeEditAfterModelFromParentFilter(model); this.setEditable(allowEditing); if (allowEditing) { const dateModel = model ? _parseDateTimeFromString(model.dateFrom) : null; this.dateComp.setDate(dateModel); this.eReadOnlyText.setValue(""); } else { this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(model)); this.dateComp.setDate(null); } } setEditable(editable) { _setDisplayed(this.eDateWrapper, editable); _setDisplayed(this.eReadOnlyText.getGui(), !editable); } onModelUpdated(model) { super.setLastTypeFromModel(model); this.updateCompOnModelChange(model); } onDateChanged() { const filterValueDate = this.dateComp.getDate(); if (this.reactive) { const reactiveParams = this.params; reactiveParams.onUiChange(); const model = reactiveParams.model; const filterValueText = _serialiseDate(filterValueDate); const newModel = filterValueText == null ? null : { ...model ?? { filterType: this.filterType, type: this.lastType ?? this.optionsFactory.defaultOption }, dateFrom: filterValueText }; reactiveParams.onModelChange(newModel, { afterFloatingFilter: true }); } else { this.params.parentFilterInstance((filterInstance) => { filterInstance?.onFloatingFilterChanged(this.lastType || null, filterValueDate); }); } } getDateComponentParams() { const { filterParams } = this.params; const debounceMs = getDebounceMs(filterParams, this.defaultDebounceMs); return _addGridCommonParams(this.gos, { onDateChanged: _debounce(this, this.onDateChanged.bind(this), debounceMs), filterParams, location: "floatingFilter" }); } createDateComponent() { const { beans: { context, userCompFactory }, eDateWrapper, params: { column } } = this; this.dateComp = new DateCompWrapper( context, userCompFactory, column.getColDef(), this.getDateComponentParams(), eDateWrapper, (dateComp) => { dateComp.setInputAriaLabel(this.getAriaLabel(column)); } ); this.addDestroyFunc(() => this.dateComp.destroy()); } }; var DefaultDateElement = { tag: "div", cls: "ag-filter-filter", children: [ { tag: "ag-input-text-field", ref: "eDateInput", cls: "ag-date-filter" } ] }; var DefaultDateComponent = class extends Component { constructor() { super(DefaultDateElement, [AgInputTextFieldSelector]); this.eDateInput = RefPlaceholder; this.isApply = false; this.applyOnFocusOut = false; } init(params) { this.params = params; this.setParams(params); const inputElement = this.eDateInput.getInputElement(); this.addManagedListeners(inputElement, { // ensures that the input element is focussed when a clear button is clicked, // unless using safari as there is no clear button and focus does not work properly mouseDown: () => { if (this.eDateInput.isDisabled() || this.usingSafariDatePicker) { return; } inputElement.focus({ preventScroll: true }); }, input: this.handleInput.bind(this, false), change: this.handleInput.bind(this, true), focusout: this.handleFocusOut.bind(this), focusin: this.handleFocusIn.bind(this) }); } handleInput(isChange) { if (this.eDateInput.isDisabled()) { return; } if (this.isApply) { this.applyOnFocusOut = !isChange; if (isChange) { this.params.onDateChanged(); } return; } if (!isChange) { this.params.onDateChanged(); } } handleFocusOut() { if (this.applyOnFocusOut) { this.applyOnFocusOut = false; this.params.onDateChanged(); } } handleFocusIn() { this.params.onFocusIn?.(); } setParams(params) { const inputElement = this.eDateInput.getInputElement(); const shouldUseBrowserDatePicker = this.shouldUseBrowserDatePicker(params); this.usingSafariDatePicker = shouldUseBrowserDatePicker && _isBrowserSafari(); const { minValidYear, maxValidYear, minValidDate, maxValidDate, buttons, includeTime, colDef } = params.filterParams || {}; const dataTypeSvc = this.beans.dataTypeSvc; const shouldUseDateTimeLocal = includeTime ?? dataTypeSvc?.getDateIncludesTimeFlag?.(colDef.cellDataType) ?? false; if (shouldUseBrowserDatePicker) { if (shouldUseDateTimeLocal) { inputElement.type = "datetime-local"; inputElement.step = "1"; } else { inputElement.type = "date"; } } else { inputElement.type = "text"; } const parsedMinValidDate = parseOrConstructDate(minValidDate, minValidYear, true); const parsedMaxValidDate = parseOrConstructDate(maxValidDate, maxValidYear, false); if (parsedMinValidDate && parsedMaxValidDate && parsedMinValidDate.getTime() > parsedMaxValidDate.getTime()) { _warn(87); } if (parsedMinValidDate) { inputElement.min = _serialiseDate(parsedMinValidDate, shouldUseDateTimeLocal); } if (parsedMaxValidDate) { inputElement.max = _serialiseDate(parsedMaxValidDate, shouldUseDateTimeLocal); } this.isApply = params.location === "floatingFilter" && !!buttons?.includes("apply"); } refresh(params) { this.params = params; this.setParams(params); } getDate() { return _parseDateTimeFromString(this.eDateInput.getValue()); } setDate(date) { const colType = this.params.filterParams.colDef.cellDataType; const includeTime = this.beans.dataTypeSvc?.getDateIncludesTimeFlag(colType) ?? false; this.eDateInput.setValue(_serialiseDate(date, includeTime)); } setInputPlaceholder(placeholder) { this.eDateInput.setInputPlaceholder(placeholder); } setInputAriaLabel(ariaLabel) { this.eDateInput.setAriaLabel(ariaLabel); } setDisabled(disabled) { this.eDateInput.setDisabled(disabled); } afterGuiAttached(params) { if (!params?.suppressFocus) { this.eDateInput.getInputElement().focus({ preventScroll: true }); } } shouldUseBrowserDatePicker(params) { return params?.filterParams?.browserDatePicker ?? true; } }; function parseOrConstructDate(date, year, isMin) { if (date && year) { _warn(isMin ? 85 : 86); } if (date instanceof Date) { return date; } if (date) { return _parseDateTimeFromString(date); } else if (year) { return _parseDateTimeFromString(`${year}-${isMin ? "01-01" : "12-31"}`); } return null; } var DEFAULT_NUMBER_FILTER_OPTIONS = [ "equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "blank", "notBlank" ]; function getAllowedCharPattern2(filterParams) { return filterParams?.allowedCharPattern ?? null; } function processNumberFilterValue(value) { if (value == null) { return null; } return isNaN(value) ? null : value; } function mapValuesFromNumberFilterModel(filterModel, optionsFactory) { const { filter, filterTo, type } = filterModel || {}; return [processNumberFilterValue(filter), processNumberFilterValue(filterTo)].slice( 0, getNumberOfInputs(type, optionsFactory) ); } var NumberFilter = class extends SimpleFilter { constructor() { super("numberFilter", mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS); this.eValuesFrom = []; this.eValuesTo = []; this.filterType = "number"; this.defaultDebounceMs = 500; } afterGuiAttached(params) { super.afterGuiAttached(params); this.refreshInputValidation(); } shouldKeepInvalidInputState() { return !_isBrowserFirefox() && this.hasInvalidInputs() && this.getConditionTypes().includes("inRange"); } refreshInputValidation() { for (let i = 0; i < this.eValuesFrom.length; i++) { const from = this.eValuesFrom[i]; const to = this.eValuesTo[i]; this.refreshInputPairValidation(from, to); } } refreshInputPairValidation(from, to, isFrom = false) { const parser = this.params.numberParser; const fromValue = getNormalisedValue(parser, from); const toValue = getNormalisedValue(parser, to); const localeKey = getValidityMessageKey2(fromValue, toValue, isFrom); const validityMessage = localeKey ? this.translate(localeKey, [String(isFrom ? toValue : fromValue)]) : ""; (isFrom ? from : to).setCustomValidity(validityMessage); (isFrom ? to : from).setCustomValidity(""); if (validityMessage.length > 0) { this.beans.ariaAnnounce.announceValue(validityMessage, "dateFilter"); } } getState() { return { isInvalid: this.hasInvalidInputs() }; } areStatesEqual(stateA, stateB) { return (stateA?.isInvalid ?? false) === (stateB?.isInvalid ?? false); } refresh(legacyNewParams) { const result = super.refresh(legacyNewParams); const { state: newState, additionalEventAttributes } = legacyNewParams; const oldState = this.state; const fromAction = additionalEventAttributes?.fromAction; const forceRefreshValidation = fromAction && fromAction != "apply"; if (forceRefreshValidation || newState.model !== oldState.model || !this.areStatesEqual(newState.state, oldState.state)) { this.refreshInputValidation(); } return result; } setElementValue(element, value, fromFloatingFilter) { const { numberFormatter } = this.params; const valueToSet = !fromFloatingFilter && numberFormatter ? numberFormatter(value ?? null) : value; super.setElementValue(element, valueToSet); if (valueToSet === null) { element.setCustomValidity(""); } } createEValue() { const { params, eValuesFrom, eValuesTo } = this; const allowedCharPattern = getAllowedCharPattern2(params); const eCondition = _createElement({ tag: "div", cls: "ag-filter-body", role: "presentation" }); const from = this.createFromToElement(eCondition, eValuesFrom, "from", allowedCharPattern); const to = this.createFromToElement(eCondition, eValuesTo, "to", allowedCharPattern); const getFieldChangedListener = (from2, to2, isFrom) => () => this.refreshInputPairValidation(from2, to2, isFrom); const fromListener = getFieldChangedListener(from, to, true); from.onValueChange(fromListener); from.addGuiEventListener("focusin", fromListener); const toListener = getFieldChangedListener(from, to, false); to.onValueChange(toListener); to.addGuiEventListener("focusin", toListener); return eCondition; } createFromToElement(eCondition, eValues, fromTo, allowedCharPattern) { const eValue = this.createManagedBean( allowedCharPattern ? new AgInputTextField({ allowedCharPattern }) : new AgInputNumberField() ); eValue.addCss(`ag-filter-${fromTo}`); eValue.addCss("ag-filter-filter"); eValues.push(eValue); eCondition.appendChild(eValue.getGui()); return eValue; } removeEValues(startPosition, deleteCount) { const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount); removeComps(this.eValuesFrom); removeComps(this.eValuesTo); } getValues(position) { const result = []; this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => { if (index < numberOfInputs) { result.push(processNumberFilterValue(stringToFloat(this.params.numberParser, element.getValue()))); } }); return result; } areSimpleModelsEqual(aSimple, bSimple) { return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type; } createCondition(position) { const type = this.getConditionType(position); const model = { filterType: this.filterType, type }; const values = this.getValues(position); if (values.length > 0) { model.filter = values[0]; } if (values.length > 1) { model.filterTo = values[1]; } return model; } removeConditionsAndOperators(startPosition, deleteCount) { if (this.hasInvalidInputs()) { return; } return super.removeConditionsAndOperators(startPosition, deleteCount); } getInputs(position) { const { eValuesFrom, eValuesTo } = this; if (position >= eValuesFrom.length) { return [null, null]; } return [eValuesFrom[position], eValuesTo[position]]; } hasInvalidInputs() { let invalidInputs = false; this.forEachInput((element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid)); return invalidInputs; } positionHasInvalidInputs(position) { let invalidInputs = false; this.forEachPositionInput(position, (element) => invalidInputs || (invalidInputs = !element.getInputElement().validity.valid)); return invalidInputs; } canApply(_model) { return !this.hasInvalidInputs(); } }; function stringToFloat(numberParser, value) { if (typeof value === "number") { return value; } let filterText = _makeNull(value); if (filterText != null && filterText.trim() === "") { filterText = null; } if (numberParser) { return numberParser(filterText); } return filterText == null || filterText.trim() === "-" ? null : Number.parseFloat(filterText); } function getNormalisedValue(numberParser, input) { return processNumberFilterValue(stringToFloat(numberParser, input.getValue(true))); } function getValidityMessageKey2(fromValue, toValue, isFrom) { const isInvalid = fromValue != null && toValue != null && fromValue >= toValue; if (!isInvalid) { return null; } return `strict${isFrom ? "Max" : "Min"}ValueValidation`; } var NumberFilterModelFormatter = class extends SimpleFilterModelFormatter { constructor(optionsFactory, filterParams) { super(optionsFactory, filterParams, filterParams.numberFormatter); this.filterTypeKeys = SCALAR_FILTER_TYPE_KEYS; } conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) { const { filter, filterTo, type } = condition; const formatValue = this.formatValue.bind(this); if (forToolPanel) { const valueForToolPanel = this.conditionForToolPanel( type, isRange, () => formatValue(filter), () => formatValue(filterTo), customDisplayKey, customDisplayName ); if (valueForToolPanel != null) { return valueForToolPanel; } } if (isRange) { return `${formatValue(filter)}-${formatValue(filterTo)}`; } if (filter != null) { return formatValue(filter); } return `${type}`; } }; var NumberFilterHandler = class extends ScalarFilterHandler { constructor() { super(mapValuesFromNumberFilterModel, DEFAULT_NUMBER_FILTER_OPTIONS); this.filterType = "number"; this.FilterModelFormatterClass = NumberFilterModelFormatter; } comparator() { return (left, right) => { if (left === right) { return 0; } return left < right ? 1 : -1; }; } isValid(value) { return !isNaN(value); } }; var FloatingFilterNumberInputService = class extends BeanStub { constructor() { super(...arguments); this.onValueChanged = () => { }; this.numberInputActive = true; } setupGui(parentElement) { this.eNumberInput = this.createManagedBean(new AgInputNumberField()); this.eTextInput = this.createManagedBean(new AgInputTextField()); this.eTextInput.setDisabled(true); const eNumberInput = this.eNumberInput.getGui(); const eTextInput = this.eTextInput.getGui(); parentElement.appendChild(eNumberInput); parentElement.appendChild(eTextInput); this.setupListeners(eNumberInput, (e) => this.onValueChanged(e)); this.setupListeners(eTextInput, (e) => this.onValueChanged(e)); } setEditable(editable) { this.numberInputActive = editable; this.eNumberInput.setDisplayed(this.numberInputActive); this.eTextInput.setDisplayed(!this.numberInputActive); } setAutoComplete(autoComplete) { this.eNumberInput.setAutoComplete(autoComplete); this.eTextInput.setAutoComplete(autoComplete); } getValue() { return this.getActiveInputElement().getValue(); } setValue(value, silent) { this.getActiveInputElement().setValue(value, silent); } getActiveInputElement() { return this.numberInputActive ? this.eNumberInput : this.eTextInput; } setValueChangedListener(listener) { this.onValueChanged = listener; } setupListeners(element, listener) { this.addManagedListeners(element, { input: listener, keydown: listener }); } setParams({ ariaLabel, autoComplete, placeholder }) { this.setAriaLabel(ariaLabel); if (autoComplete !== void 0) { this.setAutoComplete(autoComplete); } this.setPlaceholder(this.eNumberInput, placeholder); this.setPlaceholder(this.eTextInput, placeholder); } setPlaceholder(input, placeholder) { input.toggleCss("ag-floating-filter-search-icon", !!placeholder); input.setInputPlaceholder(placeholder); } setAriaLabel(ariaLabel) { this.eNumberInput.setInputAriaLabel(ariaLabel); this.eTextInput.setInputAriaLabel(ariaLabel); } }; var NumberFloatingFilter = class extends TextInputFloatingFilter { constructor() { super(...arguments); this.FilterModelFormatterClass = NumberFilterModelFormatter; this.filterType = "number"; this.defaultOptions = DEFAULT_NUMBER_FILTER_OPTIONS; } updateParams(params) { const allowedCharPattern = getAllowedCharPattern2(params.filterParams); if (allowedCharPattern !== this.allowedCharPattern) { this.recreateFloatingFilterInputService(params); } super.updateParams(params); } createFloatingFilterInputService(params) { this.allowedCharPattern = getAllowedCharPattern2(params.filterParams); if (this.allowedCharPattern) { return this.createManagedBean( new FloatingFilterTextInputService({ config: { allowedCharPattern: this.allowedCharPattern } }) ); } return this.createManagedBean(new FloatingFilterNumberInputService()); } convertValue(value) { return value ? Number(value) : null; } }; var DEFAULT_TEXT_FILTER_OPTIONS = [ "contains", "notContains", "equals", "notEqual", "startsWith", "endsWith", "blank", "notBlank" ]; var TextFilter = class extends SimpleFilter { constructor() { super("textFilter", mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS); this.filterType = "text"; this.eValuesFrom = []; this.eValuesTo = []; this.defaultDebounceMs = 500; } createCondition(position) { const type = this.getConditionType(position); const model = { filterType: this.filterType, type }; const values = this.getValues(position); if (values.length > 0) { model.filter = values[0]; } if (values.length > 1) { model.filterTo = values[1]; } return model; } areSimpleModelsEqual(aSimple, bSimple) { return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type; } getInputs(position) { const { eValuesFrom, eValuesTo } = this; if (position >= eValuesFrom.length) { return [null, null]; } return [eValuesFrom[position], eValuesTo[position]]; } getValues(position) { const result = []; this.forEachPositionInput(position, (element, index, _elPosition, numberOfInputs) => { if (index < numberOfInputs) { result.push(_makeNull(element.getValue())); } }); return result; } createEValue() { const eCondition = _createElement({ tag: "div", cls: "ag-filter-body", role: "presentation" }); const { eValuesFrom, eValuesTo } = this; this.createFromToElement(eCondition, eValuesFrom, "from"); this.createFromToElement(eCondition, eValuesTo, "to"); return eCondition; } createFromToElement(eCondition, eValues, fromTo) { const eValue = this.createManagedBean(new AgInputTextField()); eValue.addCss(`ag-filter-${fromTo}`); eValue.addCss("ag-filter-filter"); eValues.push(eValue); eCondition.appendChild(eValue.getGui()); } removeEValues(startPosition, deleteCount) { const removeComps = (eGui) => this.removeComponents(eGui, startPosition, deleteCount); const { eValuesFrom, eValuesTo } = this; removeComps(eValuesFrom); removeComps(eValuesTo); } }; var TextFilterModelFormatter = class extends SimpleFilterModelFormatter { constructor() { super(...arguments); this.filterTypeKeys = TEXT_FILTER_TYPE_KEYS; } conditionToString(condition, forToolPanel, isRange, customDisplayKey, customDisplayName) { const { filter, filterTo, type } = condition; if (forToolPanel) { const getValueFunc = (value) => () => translateForFilter(this, "filterSummaryTextQuote", [value]); const valueForToolPanel = this.conditionForToolPanel( type, isRange, getValueFunc(filter), getValueFunc(filterTo), customDisplayKey, customDisplayName ); if (valueForToolPanel != null) { return valueForToolPanel; } } if (isRange) { return `${filter}-${filterTo}`; } if (filter != null) { return `${filter}`; } return `${type}`; } }; var defaultMatcher = ({ filterOption, value, filterText }) => { if (filterText == null) { return false; } switch (filterOption) { case "contains": return value.includes(filterText); case "notContains": return !value.includes(filterText); case "equals": return value === filterText; case "notEqual": return value != filterText; case "startsWith": return value.indexOf(filterText) === 0; case "endsWith": { const index = value.lastIndexOf(filterText); return index >= 0 && index === value.length - filterText.length; } default: return false; } }; var defaultFormatter = (from) => from; var defaultLowercaseFormatter = (from) => from == null ? null : from.toString().toLowerCase(); var TextFilterHandler = class extends SimpleFilterHandler { constructor() { super(mapValuesFromTextFilterModel, DEFAULT_TEXT_FILTER_OPTIONS); this.filterType = "text"; this.FilterModelFormatterClass = TextFilterModelFormatter; } updateParams(params) { super.updateParams(params); const filterParams = params.filterParams; this.matcher = filterParams.textMatcher ?? defaultMatcher; this.formatter = filterParams.textFormatter ?? (filterParams.caseSensitive ? defaultFormatter : defaultLowercaseFormatter); } evaluateNullValue(filterType) { const filterTypesAllowNulls = ["notEqual", "notContains", "blank"]; return filterType ? filterTypesAllowNulls.indexOf(filterType) >= 0 : false; } evaluateNonNullValue(values, cellValue, filterModel, params) { const formattedValues = values.map((v) => this.formatter(v)) || []; const cellValueFormatted = this.formatter(cellValue); const { api, colDef, column, context, filterParams: { textFormatter } } = this.params; if (filterModel.type === "blank") { return isBlank(cellValue); } else if (filterModel.type === "notBlank") { return !isBlank(cellValue); } const matcherParams = { api, colDef, column, context, node: params.node, data: params.data, filterOption: filterModel.type, value: cellValueFormatted, textFormatter }; return formattedValues.some((v) => this.matcher({ ...matcherParams, filterText: v })); } processModelToApply(model) { if (model && this.params.filterParams.trimInput) { const processCondition = (condition) => { const newCondition = { ...condition }; const { filter, filterTo } = condition; if (filter) { newCondition.filter = trimInputForFilter(filter) ?? null; } if (filterTo) { newCondition.filterTo = trimInputForFilter(filterTo) ?? null; } return newCondition; }; if (isCombinedFilterModel(model)) { return { ...model, conditions: model.conditions.map(processCondition) }; } return processCondition(model); } return model; } }; var TextFloatingFilter = class extends TextInputFloatingFilter { constructor() { super(...arguments); this.FilterModelFormatterClass = TextFilterModelFormatter; this.filterType = "text"; this.defaultOptions = DEFAULT_TEXT_FILTER_OPTIONS; } createFloatingFilterInputService() { return this.createManagedBean(new FloatingFilterTextInputService()); } }; function isQuickFilterPresent(beans) { return !!beans.quickFilter?.isFilterPresent(); } function getQuickFilter(beans) { return beans.quickFilter?.getText(); } function resetQuickFilter(beans) { beans.quickFilter?.resetCache(); } var QuickFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "quickFilter"; this.quickFilter = null; this.quickFilterParts = null; } postConstruct() { const resetListener = this.resetCache.bind(this); const gos = this.gos; this.addManagedEventListeners({ columnPivotModeChanged: resetListener, newColumnsLoaded: resetListener, columnRowGroupChanged: resetListener, columnVisible: () => { if (!gos.get("includeHiddenColumnsInQuickFilter")) { this.resetCache(); } } }); this.addManagedPropertyListener("quickFilterText", (e) => this.setFilter(e.currentValue)); this.addManagedPropertyListeners( ["includeHiddenColumnsInQuickFilter", "applyQuickFilterBeforePivotOrAgg"], () => this.onColumnConfigChanged() ); this.quickFilter = this.parseFilter(gos.get("quickFilterText")); this.parser = gos.get("quickFilterParser"); this.matcher = gos.get("quickFilterMatcher"); this.setFilterParts(); this.addManagedPropertyListeners(["quickFilterMatcher", "quickFilterParser"], () => this.setParserAndMatcher()); } // if we are using autoGroupCols, then they should be included for quick filter. this covers the // following scenarios: // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping) refreshCols() { const { autoColSvc, colModel, gos, pivotResultCols } = this.beans; const pivotMode = colModel.isPivotMode(); const groupAutoCols = autoColSvc?.getColumns(); const providedCols = colModel.getColDefCols(); let columnsForQuickFilter = (pivotMode && !gos.get("applyQuickFilterBeforePivotOrAgg") ? pivotResultCols?.getPivotResultCols()?.list : providedCols) ?? []; if (groupAutoCols) { columnsForQuickFilter = columnsForQuickFilter.concat(groupAutoCols); } this.colsToUse = gos.get("includeHiddenColumnsInQuickFilter") ? columnsForQuickFilter : columnsForQuickFilter.filter((col) => col.isVisible() || col.isRowGroupActive()); } isFilterPresent() { return this.quickFilter !== null; } doesRowPass(node) { const usingCache = this.gos.get("cacheQuickFilter"); if (this.matcher) { return this.doesRowPassMatcher(usingCache, node); } return this.quickFilterParts.every( (part) => usingCache ? this.doesRowPassCache(node, part) : this.doesRowPassNoCache(node, part) ); } resetCache() { this.beans.rowModel.forEachNode((node) => node.quickFilterAggregateText = null); } getText() { return this.gos.get("quickFilterText"); } setFilterParts() { const { quickFilter, parser } = this; if (quickFilter) { this.quickFilterParts = parser ? parser(quickFilter) : quickFilter.split(" "); } else { this.quickFilterParts = null; } } parseFilter(newFilter) { if (!_exists(newFilter)) { return null; } return newFilter.toUpperCase(); } setFilter(newFilter) { if (newFilter != null && typeof newFilter !== "string") { _warn(70, { newFilter }); return; } const parsedFilter = this.parseFilter(newFilter); if (this.quickFilter !== parsedFilter) { this.quickFilter = parsedFilter; this.setFilterParts(); this.dispatchLocalEvent({ type: "quickFilterChanged" }); } } setParserAndMatcher() { const parser = this.gos.get("quickFilterParser"); const matcher = this.gos.get("quickFilterMatcher"); const hasChanged = parser !== this.parser || matcher !== this.matcher; this.parser = parser; this.matcher = matcher; if (hasChanged) { this.setFilterParts(); this.dispatchLocalEvent({ type: "quickFilterChanged" }); } } onColumnConfigChanged() { this.refreshCols(); this.resetCache(); if (this.isFilterPresent()) { this.dispatchLocalEvent({ type: "quickFilterChanged" }); } } doesRowPassNoCache(node, filterPart) { return this.colsToUse.some((column) => { const part = this.getTextForColumn(column, node); return _exists(part) && part.includes(filterPart); }); } doesRowPassCache(node, filterPart) { this.checkGenerateAggText(node); return node.quickFilterAggregateText.includes(filterPart); } doesRowPassMatcher(usingCache, node) { let quickFilterAggregateText; if (usingCache) { this.checkGenerateAggText(node); quickFilterAggregateText = node.quickFilterAggregateText; } else { quickFilterAggregateText = this.getAggText(node); } const { quickFilterParts, matcher } = this; return matcher(quickFilterParts, quickFilterAggregateText); } checkGenerateAggText(node) { if (!node.quickFilterAggregateText) { node.quickFilterAggregateText = this.getAggText(node); } } getTextForColumn(column, node) { let value = this.beans.filterValueSvc.getValue(column, node); const colDef = column.getColDef(); if (colDef.getQuickFilterText) { const params = _addGridCommonParams(this.gos, { value, node, data: node.data, column, colDef }); value = colDef.getQuickFilterText(params); } return _exists(value) ? value.toString().toUpperCase() : null; } getAggText(node) { const stringParts = []; for (const column of this.colsToUse) { const part = this.getTextForColumn(column, node); if (_exists(part)) { stringParts.push(part); } } return stringParts.join("\n"); } }; var ClientSideRowModelFilterModule = { moduleName: "ClientSideRowModelFilter", version: VERSION, rowModels: ["clientSide"], beans: [FilterStage] }; var FilterCoreModule = { moduleName: "FilterCore", version: VERSION, beans: [FilterManager], apiFunctions: { isAnyFilterPresent, onFilterChanged }, css: [column_filters_default], dependsOn: [ClientSideRowModelFilterModule] }; var FilterValueModule = { moduleName: "FilterValue", version: VERSION, beans: [FilterValueService] }; var ColumnFilterModule = { moduleName: "ColumnFilter", version: VERSION, beans: [ColumnFilterService, FilterMenuFactory], dynamicBeans: { headerFilterCellCtrl: HeaderFilterCellCtrl }, icons: { // open filter button - header, floating filter, menu filter: "filter", // filter is applied - header (legacy column menu), filter tool panel filterActive: "filter" }, apiFunctions: { isColumnFilterPresent, getColumnFilterInstance, destroyFilter, setFilterModel, getFilterModel, getColumnFilterModel, setColumnFilterModel, showColumnFilter, hideColumnFilter, getColumnFilterHandler, doFilterAction }, dependsOn: [FilterCoreModule, PopupModule, FilterValueModule, SharedMenuModule] }; var CustomFilterModule = { moduleName: "CustomFilter", version: VERSION, userComponents: { agReadOnlyFloatingFilter: ReadOnlyFloatingFilter }, dependsOn: [ColumnFilterModule] }; var TextFilterModule = { moduleName: "TextFilter", version: VERSION, dependsOn: [ColumnFilterModule], userComponents: { agTextColumnFilter: { classImp: TextFilter, params: { useForm: true } }, agTextColumnFloatingFilter: TextFloatingFilter }, dynamicBeans: { agTextColumnFilterHandler: TextFilterHandler } }; var NumberFilterModule = { moduleName: "NumberFilter", version: VERSION, dependsOn: [ColumnFilterModule], userComponents: { agNumberColumnFilter: { classImp: NumberFilter, params: { useForm: true } }, agNumberColumnFloatingFilter: NumberFloatingFilter }, dynamicBeans: { agNumberColumnFilterHandler: NumberFilterHandler } }; var BigIntFilterModule = { moduleName: "BigIntFilter", version: VERSION, dependsOn: [ColumnFilterModule], userComponents: { agBigIntColumnFilter: { classImp: BigIntFilter, params: { useForm: true } }, agBigIntColumnFloatingFilter: BigIntFloatingFilter }, dynamicBeans: { agBigIntColumnFilterHandler: BigIntFilterHandler } }; var DateFilterModule = { moduleName: "DateFilter", version: VERSION, dependsOn: [ColumnFilterModule], userComponents: { agDateColumnFilter: { classImp: DateFilter, params: { useForm: true } }, agDateInput: DefaultDateComponent, agDateColumnFloatingFilter: DateFloatingFilter }, dynamicBeans: { agDateColumnFilterHandler: DateFilterHandler } }; var QuickFilterCoreModule = { moduleName: "QuickFilterCore", version: VERSION, rowModels: ["clientSide"], beans: [QuickFilterService], dependsOn: [FilterCoreModule, FilterValueModule] }; var QuickFilterModule = { moduleName: "QuickFilter", version: VERSION, apiFunctions: { isQuickFilterPresent, getQuickFilter, resetQuickFilter }, dependsOn: [QuickFilterCoreModule] }; var ExternalFilterModule = { moduleName: "ExternalFilter", version: VERSION, dependsOn: [FilterCoreModule] }; var InfiniteBlock = class extends BeanStub { constructor(id, parentCache, params) { super(); this.id = id; this.parentCache = parentCache; this.params = params; this.state = "needsLoading"; this.version = 0; this.startRow = id * params.blockSize; this.endRow = this.startRow + params.blockSize; } load() { this.state = "loading"; this.loadFromDatasource(); } setStateWaitingToLoad() { this.version++; this.state = "needsLoading"; } pageLoadFailed(version) { const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version); if (requestMostRecentAndLive) { this.state = "failed"; } this.dispatchLocalEvent({ type: "loadComplete" }); } pageLoaded(version, rows, lastRow) { this.successCommon(version, { rowData: rows, rowCount: lastRow }); } isRequestMostRecentAndLive(version) { const thisIsMostRecentRequest = version === this.version; const weAreNotDestroyed = this.isAlive(); return thisIsMostRecentRequest && weAreNotDestroyed; } successCommon(version, params) { this.dispatchLocalEvent({ type: "loadComplete" }); const requestMostRecentAndLive = this.isRequestMostRecentAndLive(version); if (requestMostRecentAndLive) { this.state = "loaded"; this.processServerResult(params); } } postConstruct() { this.rowNodes = []; const { params: { blockSize, rowHeight }, startRow, beans, rowNodes } = this; for (let i = 0; i < blockSize; i++) { const rowIndex = startRow + i; const rowNode = new RowNode(beans); rowNode.setRowHeight(rowHeight); rowNode.uiLevel = 0; rowNode.setRowIndex(rowIndex); rowNode.setRowTop(rowHeight * rowIndex); rowNodes.push(rowNode); } } getBlockStateJson() { const { id, startRow, endRow, state: pageStatus } = this; return { id: "" + id, state: { blockNumber: id, startRow, endRow, pageStatus } }; } setDataAndId(rowNode, data, index) { if (_exists(data)) { rowNode.setDataAndId(data, index.toString()); } else { rowNode.setDataAndId(void 0, void 0); } } loadFromDatasource() { const params = this.createLoadParams(); if (_missing(this.params.datasource.getRows)) { _warn(90); return; } window.setTimeout(() => { this.params.datasource.getRows(params); }, 0); } createLoadParams() { const { startRow, endRow, version, params: { sortModel, filterModel }, gos } = this; const params = _addGridCommonParams(gos, { startRow, endRow, successCallback: this.pageLoaded.bind(this, version), failCallback: this.pageLoadFailed.bind(this, version), sortModel, filterModel }); return params; } forEachNode(callback, sequence, rowCount) { this.rowNodes.forEach((rowNode, index) => { const rowIndex = this.startRow + index; if (rowIndex < rowCount) { callback(rowNode, sequence.value++); } }); } getRow(rowIndex, dontTouchLastAccessed = false) { if (!dontTouchLastAccessed) { this.lastAccessed = this.params.lastAccessedSequence.value++; } const localIndex = rowIndex - this.startRow; return this.rowNodes[localIndex]; } processServerResult(params) { const { rowNodes, beans } = this; rowNodes.forEach((rowNode, index) => { const data = params.rowData ? params.rowData[index] : void 0; if (!rowNode.id && rowNode.alreadyRendered && data) { rowNodes[index] = new RowNode(beans); rowNodes[index].setRowIndex(rowNode.rowIndex); rowNodes[index].setRowTop(rowNode.rowTop); rowNodes[index].setRowHeight(rowNode.rowHeight); rowNode._destroy(true); } this.setDataAndId(rowNodes[index], data, this.startRow + index); }); const finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : void 0; this.parentCache.pageLoaded(this, finalRowCount); } destroy() { const rowNodes = this.rowNodes; for (let i = 0, len = rowNodes.length; i < len; i++) { rowNodes[i]._destroy(false); } rowNodes.length = 0; super.destroy(); } }; var MAX_EMPTY_BLOCKS_TO_KEEP = 2; var InfiniteCache = class extends BeanStub { constructor(params) { super(); this.params = params; this.lastRowIndexKnown = false; this.blocks = {}; this.blockCount = 0; this.rowCount = params.initialRowCount; } // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid, // it will want new pages in the cache as it asks for rows. only when we are inserting / // removing rows via the api is dontCreatePage set, where we move rows between the pages. getRow(rowIndex, dontCreatePage = false) { const blockId = Math.floor(rowIndex / this.params.blockSize); let block = this.blocks[blockId]; if (!block) { if (dontCreatePage) { return void 0; } block = this.createBlock(blockId); } return block.getRow(rowIndex); } createBlock(blockNumber) { const params = this.params; const newBlock = this.createBean(new InfiniteBlock(blockNumber, this, params)); this.blocks[newBlock.id] = newBlock; this.blockCount++; this.purgeBlocksIfNeeded(newBlock); params.rowNodeBlockLoader.addBlock(newBlock); return newBlock; } // we have this on infinite row model only, not server side row model, // because for server side, it would leave the children in inconsistent // state - eg if a node had children, but after the refresh it had data // for a different row, then the children would be with the wrong row node. refreshCache() { const nothingToRefresh = this.blockCount == 0; if (nothingToRefresh) { this.purgeCache(); return; } for (const block of this.getBlocksInOrder()) { block.setStateWaitingToLoad(); } this.params.rowNodeBlockLoader.checkBlockToLoad(); } destroy() { for (const block of this.getBlocksInOrder()) { this.destroyBlock(block); } super.destroy(); } getRowCount() { return this.rowCount; } isLastRowIndexKnown() { return this.lastRowIndexKnown; } // block calls this, when page loaded pageLoaded(block, lastRow) { if (!this.isAlive()) { return; } _logIfDebug(this.gos, `InfiniteCache - onPageLoaded: page = ${block.id}, lastRow = ${lastRow}`); this.checkRowCount(block, lastRow); this.onCacheUpdated(); } purgeBlocksIfNeeded(blockToExclude) { const blocksForPurging = this.getBlocksInOrder().filter((b) => b != blockToExclude); const lastAccessedComparator = (a, b) => b.lastAccessed - a.lastAccessed; blocksForPurging.sort(lastAccessedComparator); const maxBlocksProvided = this.params.maxBlocksInCache > 0; const blocksToKeep = maxBlocksProvided ? this.params.maxBlocksInCache - 1 : null; const emptyBlocksToKeep = MAX_EMPTY_BLOCKS_TO_KEEP - 1; blocksForPurging.forEach((block, index) => { const purgeBecauseBlockEmpty = block.state === "needsLoading" && index >= emptyBlocksToKeep; const purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false; if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) { if (this.isBlockCurrentlyDisplayed(block)) { return; } if (this.isBlockFocused(block)) { return; } this.removeBlockFromCache(block); } }); } isBlockFocused(block) { const focusedCell = this.beans.focusSvc.getFocusCellToUseAfterRefresh(); if (!focusedCell) { return false; } if (focusedCell.rowPinned != null) { return false; } const { startRow, endRow } = block; const hasFocus = focusedCell.rowIndex >= startRow && focusedCell.rowIndex < endRow; return hasFocus; } isBlockCurrentlyDisplayed(block) { const { startRow, endRow } = block; return this.beans.rowRenderer.isRangeInRenderedViewport(startRow, endRow - 1); } removeBlockFromCache(blockToRemove) { if (!blockToRemove) { return; } this.destroyBlock(blockToRemove); } checkRowCount(block, lastRow) { if (typeof lastRow === "number" && lastRow >= 0) { this.rowCount = lastRow; this.lastRowIndexKnown = true; } else if (!this.lastRowIndexKnown) { const { blockSize, overflowSize } = this.params; const lastRowIndex = (block.id + 1) * blockSize; const lastRowIndexPlusOverflow = lastRowIndex + overflowSize; if (this.rowCount < lastRowIndexPlusOverflow) { this.rowCount = lastRowIndexPlusOverflow; } } } setRowCount(rowCount, lastRowIndexKnown) { this.rowCount = rowCount; if (_exists(lastRowIndexKnown)) { this.lastRowIndexKnown = lastRowIndexKnown; } if (!this.lastRowIndexKnown) { if (this.rowCount % this.params.blockSize === 0) { this.rowCount++; } } this.onCacheUpdated(); } forEachNodeDeep(callback) { const sequence = { value: 0 }; for (const block of this.getBlocksInOrder()) { block.forEachNode(callback, sequence, this.rowCount); } } getBlocksInOrder() { const blockComparator = (a, b) => a.id - b.id; const blocks = Object.values(this.blocks).sort(blockComparator); return blocks; } destroyBlock(block) { delete this.blocks[block.id]; this.destroyBean(block); this.blockCount--; this.params.rowNodeBlockLoader.removeBlock(block); } // gets called 1) row count changed 2) cache purged 3) items inserted onCacheUpdated() { if (this.isAlive()) { this.destroyAllBlocksPastVirtualRowCount(); this.eventSvc.dispatchEvent({ type: "storeUpdated" }); } } destroyAllBlocksPastVirtualRowCount() { const blocksToDestroy = []; for (const block of this.getBlocksInOrder()) { const startRow = block.id * this.params.blockSize; if (startRow >= this.rowCount) { blocksToDestroy.push(block); } } if (blocksToDestroy.length > 0) { for (const block of blocksToDestroy) { this.destroyBlock(block); } } } purgeCache() { for (const block of this.getBlocksInOrder()) { this.removeBlockFromCache(block); } this.lastRowIndexKnown = false; if (this.rowCount === 0) { this.rowCount = this.params.initialRowCount; } this.onCacheUpdated(); } getRowNodesInRange(firstInRange, lastInRange) { const result = []; let lastBlockId = -1; let inActiveRange = false; const numberSequence = { value: 0 }; let foundGapInSelection = false; for (const block of this.getBlocksInOrder()) { if (foundGapInSelection) { continue; } if (inActiveRange && lastBlockId + 1 !== block.id) { foundGapInSelection = true; continue; } lastBlockId = block.id; block.forEachNode( (rowNode) => { const hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange; if (inActiveRange || hitFirstOrLast) { result.push(rowNode); } if (hitFirstOrLast) { inActiveRange = !inActiveRange; } }, numberSequence, this.rowCount ); } const invalidRange = foundGapInSelection || inActiveRange; return invalidRange ? [] : result; } }; var InfiniteRowModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowModel"; this.rootNode = null; this.hierarchical = false; } getRowBounds(index) { return { rowHeight: this.rowHeight, rowTop: this.rowHeight * index }; } // we don't implement as lazy row heights is not supported in this row model ensureRowHeightsValid() { return false; } postConstruct() { if (this.gos.get("rowModelType") !== "infinite") { return; } const beans = this.beans; const rootNode = new RowNode(beans); this.rootNode = rootNode; rootNode.level = -1; this.rowHeight = _getRowHeightAsNumber(beans); this.addEventListeners(); this.addDestroyFunc(() => this.destroyCache()); } start() { this.setDatasource(this.gos.get("datasource")); } destroy() { this.destroyDatasource(); super.destroy(); this.rootNode = null; } destroyDatasource() { if (this.datasource) { this.destroyBean(this.datasource); this.beans.rowRenderer.datasourceChanged(); this.datasource = null; } } addEventListeners() { this.addManagedEventListeners({ filterChanged: this.reset.bind(this), sortChanged: this.reset.bind(this), newColumnsLoaded: this.onColumnEverything.bind(this), storeUpdated: this.dispatchModelUpdatedEvent.bind(this) }); this.addManagedPropertyListener("datasource", () => this.setDatasource(this.gos.get("datasource"))); this.addManagedPropertyListener("cacheBlockSize", () => this.resetCache()); this.addManagedPropertyListener("rowHeight", () => { this.rowHeight = _getRowHeightAsNumber(this.beans); this.cacheParams.rowHeight = this.rowHeight; this.updateRowHeights(); }); } onColumnEverything() { let resetRequired; if (this.cacheParams) { resetRequired = !_jsonEquals(this.cacheParams.sortModel, this.beans.sortSvc?.getSortModel() ?? []); } else { resetRequired = true; } if (resetRequired) { this.reset(); } } getType() { return "infinite"; } setDatasource(datasource) { this.destroyDatasource(); this.datasource = datasource; if (datasource) { this.reset(); } } isEmpty() { return !this.infiniteCache; } isRowsToRender() { return !!this.infiniteCache; } getOverlayType() { const cache = this.infiniteCache; if (cache?.getRowCount() === 0) { return this.beans.filterManager?.isAnyFilterPresent() ? "noMatchingRows" : "noRows"; } return null; } getNodesInRangeForSelection(firstInRange, lastInRange) { return this.infiniteCache?.getRowNodesInRange(firstInRange, lastInRange) ?? []; } reset() { if (!this.datasource) { return; } const getRowIdFunc = _getRowIdCallback(this.gos); const userGeneratingIds = getRowIdFunc != null; if (!userGeneratingIds) { this.beans.selectionSvc?.reset("rowDataChanged"); } this.resetCache(); } dispatchModelUpdatedEvent() { this.eventSvc.dispatchEvent({ type: "modelUpdated", // not sure if these should all be false - noticed if after implementing, // maybe they should be true? newPage: false, newPageSize: false, newData: false, keepRenderedRows: true, animate: false }); } resetCache() { this.destroyCache(); const beans = this.beans; const { filterManager, sortSvc, rowNodeBlockLoader, eventSvc, gos } = beans; this.cacheParams = { // the user provided datasource datasource: this.datasource, // sort and filter model filterModel: filterManager?.getFilterModel() ?? {}, sortModel: sortSvc?.getSortModel() ?? [], rowNodeBlockLoader, // properties - this way we take a snapshot of them, so if user changes any, they will be // used next time we create a new cache, which is generally after a filter or sort change, // or a new datasource is set initialRowCount: gos.get("infiniteInitialRowCount"), maxBlocksInCache: gos.get("maxBlocksInCache"), rowHeight: _getRowHeightAsNumber(beans), // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past // the current page and request first row of next page overflowSize: gos.get("cacheOverflowSize"), // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the // server for one page at a time. so the default if not specified is 100. blockSize: gos.get("cacheBlockSize"), // the cache could create this, however it is also used by the pages, so handy to create it // here as the settings are also passed to the pages lastAccessedSequence: { value: 0 } }; this.infiniteCache = this.createBean(new InfiniteCache(this.cacheParams)); eventSvc.dispatchEventOnce({ type: "rowCountReady" }); this.dispatchModelUpdatedEvent(); } updateRowHeights() { this.forEachNode((node) => { node.setRowHeight(this.rowHeight); node.setRowTop(this.rowHeight * node.rowIndex); }); this.dispatchModelUpdatedEvent(); } destroyCache() { this.infiniteCache = this.destroyBean(this.infiniteCache); } getRow(rowIndex) { const infiniteCache = this.infiniteCache; if (!infiniteCache) { return void 0; } if (rowIndex >= infiniteCache.getRowCount()) { return void 0; } return infiniteCache.getRow(rowIndex); } getRowNode(id) { let result; this.forEachNode((rowNode) => { if (rowNode.id === id) { result = rowNode; } }); return result; } forEachNode(callback) { this.infiniteCache?.forEachNodeDeep(callback); } getTopLevelRowCount() { return this.getRowCount(); } getTopLevelRowDisplayedIndex(topLevelIndex) { return topLevelIndex; } getRowIndexAtPixel(pixel) { if (this.rowHeight !== 0) { const rowIndexForPixel = Math.floor(pixel / this.rowHeight); const lastRowIndex = this.getRowCount() - 1; if (rowIndexForPixel > lastRowIndex) { return lastRowIndex; } return rowIndexForPixel; } return 0; } getRowCount() { return this.infiniteCache ? this.infiniteCache.getRowCount() : 0; } isRowPresent(rowNode) { return !!this.getRowNode(rowNode.id); } refreshCache() { this.infiniteCache?.refreshCache(); } purgeCache() { this.infiniteCache?.purgeCache(); } // for iRowModel isLastRowIndexKnown() { return this.infiniteCache?.isLastRowIndexKnown() ?? false; } setRowCount(rowCount, lastRowIndexKnown) { this.infiniteCache?.setRowCount(rowCount, lastRowIndexKnown); } resetRowHeights() { } onRowHeightChanged() { } }; function refreshInfiniteCache(beans) { _getInfiniteRowModel(beans)?.refreshCache(); } function purgeInfiniteCache(beans) { _getInfiniteRowModel(beans)?.purgeCache(); } function getInfiniteRowCount(beans) { return _getInfiniteRowModel(beans)?.getRowCount(); } var RowNodeBlockLoader = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowNodeBlockLoader"; this.activeBlockLoadsCount = 0; this.blocks = []; this.active = true; } postConstruct() { this.maxConcurrentRequests = _getMaxConcurrentDatasourceRequests(this.gos); const blockLoadDebounceMillis = this.gos.get("blockLoadDebounceMillis"); if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) { this.checkBlockToLoadDebounce = _debounce( this, this.performCheckBlocksToLoad.bind(this), blockLoadDebounceMillis ); } } addBlock(block) { this.blocks.push(block); block.addEventListener("loadComplete", this.loadComplete.bind(this)); this.checkBlockToLoad(); } removeBlock(block) { _removeFromArray(this.blocks, block); } destroy() { super.destroy(); this.active = false; } loadComplete() { this.activeBlockLoadsCount--; this.checkBlockToLoad(); } checkBlockToLoad() { if (this.checkBlockToLoadDebounce) { this.checkBlockToLoadDebounce(); } else { this.performCheckBlocksToLoad(); } } performCheckBlocksToLoad() { if (!this.active) { return; } this.printCacheStatus(); if (this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) { _logIfDebug(this.gos, `RowNodeBlockLoader - checkBlockToLoad: max loads exceeded`); return; } const loadAvailability = this.maxConcurrentRequests != null ? this.maxConcurrentRequests - this.activeBlockLoadsCount : 1; const blocksToLoad = this.blocks.filter((block) => block.state === "needsLoading").slice(0, loadAvailability); this.activeBlockLoadsCount += blocksToLoad.length; for (const block of blocksToLoad) { block.load(); } this.printCacheStatus(); } getBlockState() { const result = {}; this.blocks.forEach((block) => { const { id, state } = block.getBlockStateJson(); result[id] = state; }); return result; } printCacheStatus() { _logIfDebug( this.gos, `RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}` ); } }; var InfiniteRowModelCoreModule = { moduleName: "InfiniteRowModelCore", version: VERSION, rowModels: ["infinite"], beans: [InfiniteRowModel, RowNodeBlockLoader] }; var InfiniteRowModelModule = { moduleName: "InfiniteRowModel", version: VERSION, apiFunctions: { refreshInfiniteCache, purgeInfiniteCache, getInfiniteRowCount }, dependsOn: [InfiniteRowModelCoreModule, SsrmInfiniteSharedApiModule] }; var ApiEventService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "apiEventSvc"; this.syncListeners = /* @__PURE__ */ new Map(); this.asyncListeners = /* @__PURE__ */ new Map(); this.syncGlobalListeners = /* @__PURE__ */ new Set(); this.globalListenerPairs = /* @__PURE__ */ new Map(); } postConstruct() { this.wrapSvc = this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.(); } addListener(eventType, userListener) { const listener = this.wrapSvc?.wrap(eventType, userListener) ?? userListener; const async = !ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType); const listeners = async ? this.asyncListeners : this.syncListeners; if (!listeners.has(eventType)) { listeners.set(eventType, /* @__PURE__ */ new Set()); } listeners.get(eventType).add(listener); this.eventSvc.addListener(eventType, listener, async); } removeListener(eventType, userListener) { const listener = this.wrapSvc?.unwrap(eventType, userListener) ?? userListener; const asyncListeners = this.asyncListeners.get(eventType); const hasAsync = !!asyncListeners?.delete(listener); if (!hasAsync) { this.syncListeners.get(eventType)?.delete(listener); } this.eventSvc.removeListener(eventType, listener, hasAsync); } addGlobalListener(userListener) { const listener = this.wrapSvc?.wrapGlobal(userListener) ?? userListener; const syncListener = (eventType, event) => { if (ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) { listener(eventType, event); } }; const asyncListener = (eventType, event) => { if (!ALWAYS_SYNC_GLOBAL_EVENTS.has(eventType)) { listener(eventType, event); } }; this.globalListenerPairs.set(userListener, { syncListener, asyncListener }); const eventSvc = this.eventSvc; eventSvc.addGlobalListener(syncListener, false); eventSvc.addGlobalListener(asyncListener, true); } removeGlobalListener(userListener) { const { eventSvc, wrapSvc, globalListenerPairs } = this; const listener = wrapSvc?.unwrapGlobal(userListener) ?? userListener; const hasAsync = globalListenerPairs.has(listener); if (hasAsync) { const { syncListener, asyncListener } = globalListenerPairs.get(listener); eventSvc.removeGlobalListener(syncListener, false); eventSvc.removeGlobalListener(asyncListener, true); globalListenerPairs.delete(userListener); } else { this.syncGlobalListeners.delete(listener); eventSvc.removeGlobalListener(listener, false); } } destroyEventListeners(map, async) { map.forEach((listeners, eventType) => { listeners.forEach((listener) => this.eventSvc.removeListener(eventType, listener, async)); listeners.clear(); }); map.clear(); } destroyGlobalListeners(set2, async) { for (const listener of set2) { this.eventSvc.removeGlobalListener(listener, async); } set2.clear(); } destroy() { super.destroy(); this.destroyEventListeners(this.syncListeners, false); this.destroyEventListeners(this.asyncListeners, true); this.destroyGlobalListeners(this.syncGlobalListeners, false); const { globalListenerPairs, eventSvc } = this; globalListenerPairs.forEach(({ syncListener, asyncListener }) => { eventSvc.removeGlobalListener(syncListener, false); eventSvc.removeGlobalListener(asyncListener, true); }); globalListenerPairs.clear(); } }; function addEventListener(beans, eventType, listener) { beans.apiEventSvc?.addListener(eventType, listener); } function removeEventListener(beans, eventType, listener) { beans.apiEventSvc?.removeListener(eventType, listener); } function addGlobalListener(beans, listener) { beans.apiEventSvc?.addGlobalListener(listener); } function removeGlobalListener(beans, listener) { beans.apiEventSvc?.removeGlobalListener(listener); } var EventApiModule = { moduleName: "EventApi", version: VERSION, apiFunctions: { addEventListener, addGlobalListener, removeEventListener, removeGlobalListener }, beans: [ApiEventService] }; var LocaleService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "localeSvc"; } getLocaleTextFunc() { const gos = this.gos; const getLocaleText = gos.getCallback("getLocaleText"); if (getLocaleText) { return _getLocaleTextFromFunc(getLocaleText); } return _getLocaleTextFromMap(gos.get("localeText")); } }; var LocaleModule = { moduleName: "Locale", version: VERSION, beans: [LocaleService] }; function getState(beans) { return beans.stateSvc?.getState() ?? {}; } function setState(beans, state, propertiesToIgnore) { return beans.stateSvc?.setState(state, propertiesToIgnore); } function migrateGridStateModel(state) { state = { ...state }; if (!state.version) { state.version = "32.1.0"; } if (state.version === "32.1.0") { state = migrateV32_1(state); } state.version = VERSION; return state; } function migrateV32_1(state) { state.cellSelection = jsonGet(state, "rangeSelection"); return state; } function jsonGet(json, key) { if (json && typeof json === "object") { return json[key]; } } var StateService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "stateSvc"; this.updateRowGroupExpansionStateTimer = 0; this.suppressEvents = true; this.queuedUpdateSources = /* @__PURE__ */ new Set(); this.dispatchStateUpdateEventDebounced = _debounce( this, () => this.dispatchQueuedStateUpdateEvents(), 0 ); this.onRowGroupOpenedDebounced = _debounce(this, () => this.updateGroupExpansionState(), 0); this.onRowSelectedDebounced = _debounce( this, () => { this.staleStateKeys.delete("rowSelection"); this.updateCachedState("rowSelection", this.getRowSelectionState()); }, 0 ); this.staleStateKeys = /* @__PURE__ */ new Set(); } postConstruct() { const { gos, ctrlsSvc, colDelayRenderSvc } = this.beans; this.isClientSideRowModel = _isClientSideRowModel(gos); const initialState = migrateGridStateModel(gos.get("initialState") ?? {}); const partialColumnState = initialState.partialColumnState; delete initialState.partialColumnState; this.cachedState = initialState; const suppressEventsAndDispatchInitEvent = this.suppressEventsAndDispatchInitEvent.bind(this); ctrlsSvc.whenReady( this, () => suppressEventsAndDispatchInitEvent(() => this.setupStateOnGridReady(initialState)) ); if (initialState.columnOrder || initialState.columnVisibility || initialState.columnSizing || initialState.columnPinning || initialState.columnGroup) { colDelayRenderSvc?.hideColumns("columnState"); } const [newColumnsLoadedDestroyFunc, rowCountReadyDestroyFunc, firstDataRenderedDestroyFunc] = this.addManagedEventListeners({ newColumnsLoaded: ({ source }) => { if (source === "gridInitializing") { newColumnsLoadedDestroyFunc(); suppressEventsAndDispatchInitEvent(() => { this.setupStateOnColumnsInitialised(initialState, !!partialColumnState); colDelayRenderSvc?.revealColumns("columnState"); }); } }, rowCountReady: () => { rowCountReadyDestroyFunc?.(); suppressEventsAndDispatchInitEvent(() => this.setupStateOnRowCountReady(initialState)); }, firstDataRendered: () => { firstDataRenderedDestroyFunc?.(); suppressEventsAndDispatchInitEvent(() => this.setupStateOnFirstDataRendered(initialState)); } }); } destroy() { super.destroy(); clearTimeout(this.updateRowGroupExpansionStateTimer); this.queuedUpdateSources.clear(); } getState() { if (this.staleStateKeys.size) { this.refreshStaleState(); } return this.cachedState; } setState(providedState, propertiesToIgnore) { const state = migrateGridStateModel(providedState); delete state.partialColumnState; this.cachedState = state; this.startSuppressEvents(); const source = "api"; const ignoreSet = propertiesToIgnore ? new Set(propertiesToIgnore) : void 0; this.setGridReadyState(state, source, ignoreSet); this.setColumnsInitialisedState(state, source, !!ignoreSet, ignoreSet); this.setRowCountState(state, source, ignoreSet); setTimeout(() => { if (this.isAlive()) { this.setFirstDataRenderedState(state, source, ignoreSet); } this.stopSuppressEvents(source); }); } setGridReadyState(state, source, ignoreSet) { if (source === "api" && !ignoreSet?.has("sideBar")) { this.beans.sideBar?.comp?.setState(state.sideBar); } this.updateCachedState("sideBar", this.getSideBarState()); } setupStateOnGridReady(initialState) { this.setGridReadyState(initialState, "gridInitializing"); const stateUpdater = () => this.updateCachedState("sideBar", this.getSideBarState()); this.addManagedEventListeners({ toolPanelVisibleChanged: stateUpdater, sideBarUpdated: stateUpdater }); } updateColumnAndGroupState() { this.updateColumnState([ "aggregation", "columnOrder", "columnPinning", "columnSizing", "columnVisibility", "pivot", "rowGroup", "sort" ]); this.updateCachedState("columnGroup", this.getColumnGroupState()); } setColumnsInitialisedState(state, source, partialColumnState, ignoreSet) { this.setColumnState(state, source, partialColumnState, ignoreSet); this.setColumnGroupState(state, source, ignoreSet); this.updateColumnAndGroupState(); } setupStateOnColumnsInitialised(initialState, partialColumnState) { this.setColumnsInitialisedState(initialState, "gridInitializing", partialColumnState); const onUpdate = (state) => () => this.updateColumnState([state]); this.addManagedEventListeners({ columnValueChanged: onUpdate("aggregation"), columnMoved: onUpdate("columnOrder"), columnPinned: onUpdate("columnPinning"), columnResized: onUpdate("columnSizing"), columnVisible: onUpdate("columnVisibility"), columnPivotChanged: onUpdate("pivot"), columnPivotModeChanged: onUpdate("pivot"), columnRowGroupChanged: onUpdate("rowGroup"), sortChanged: onUpdate("sort"), newColumnsLoaded: ({ source }) => { this.updateColumnAndGroupState(); if (source !== "gridInitializing" && this.isClientSideRowModel) { this.onRowGroupOpenedDebounced(); } }, columnGroupOpened: () => this.updateCachedState("columnGroup", this.getColumnGroupState()) }); } setRowCountState(state, source, ignoreSet) { const { filter: filterState, rowGroupExpansion: rowGroupExpansionState, ssrmRowGroupExpansion, rowSelection: rowSelectionState, pagination: paginationState, rowPinning } = state; const shouldSetState = (prop, propState) => !ignoreSet?.has(prop) && (propState || source === "api"); if (shouldSetState("filter", filterState)) { this.setFilterState(filterState); } if (shouldSetState("rowGroupExpansion", rowGroupExpansionState) || shouldSetState("ssrmRowGroupExpansion", ssrmRowGroupExpansion)) { this.setRowGroupExpansionState(ssrmRowGroupExpansion, rowGroupExpansionState, source); } if (shouldSetState("rowSelection", rowSelectionState)) { this.setRowSelectionState(rowSelectionState, source); } if (shouldSetState("pagination", paginationState)) { this.setPaginationState(paginationState, source); } if (shouldSetState("rowPinning", rowPinning)) { this.setRowPinningState(rowPinning); } const updateCachedState = this.updateCachedState.bind(this); updateCachedState("filter", this.getFilterState()); this.updateGroupExpansionState(); updateCachedState("rowSelection", this.getRowSelectionState()); updateCachedState("pagination", this.getPaginationState()); } setupStateOnRowCountReady(initialState) { this.setRowCountState(initialState, "gridInitializing"); const updateCachedState = this.updateCachedState.bind(this); const updateRowGroupExpansionState = () => { this.updateRowGroupExpansionStateTimer = 0; this.updateGroupExpansionState(); }; const updateFilterState = () => updateCachedState("filter", this.getFilterState()); const { gos, colFilter, selectableFilter } = this.beans; this.addManagedEventListeners({ filterChanged: updateFilterState, rowExpansionStateChanged: this.onRowGroupOpenedDebounced, expandOrCollapseAll: updateRowGroupExpansionState, // `groupDefaultExpanded`/`isGroupOpenByDefault` updates expansion state without an expansion event columnRowGroupChanged: updateRowGroupExpansionState, rowDataUpdated: () => { if (gos.get("groupDefaultExpanded") !== 0 || gos.get("isGroupOpenByDefault")) { this.updateRowGroupExpansionStateTimer || (this.updateRowGroupExpansionStateTimer = setTimeout(updateRowGroupExpansionState)); } }, selectionChanged: () => { this.staleStateKeys.add("rowSelection"); this.onRowSelectedDebounced(); }, paginationChanged: (event) => { if (event.newPage || event.newPageSize) { updateCachedState("pagination", this.getPaginationState()); } }, pinnedRowsChanged: () => updateCachedState("rowPinning", this.getRowPinningState()) }); if (colFilter) { this.addManagedListeners(colFilter, { filterStateChanged: updateFilterState }); } if (selectableFilter) { this.addManagedListeners(selectableFilter, { selectedFilterChanged: updateFilterState }); } } setFirstDataRenderedState(state, source, ignoreSet) { const { scroll: scrollState, cellSelection: cellSelectionState, focusedCell: focusedCellState, columnOrder: columnOrderState } = state; const shouldSetState = (prop, propState) => !ignoreSet?.has(prop) && (propState || source === "api"); if (shouldSetState("focusedCell", focusedCellState)) { this.setFocusedCellState(focusedCellState); } if (shouldSetState("cellSelection", cellSelectionState)) { this.setCellSelectionState(cellSelectionState); } if (shouldSetState("scroll", scrollState)) { this.setScrollState(scrollState); } this.setColumnPivotState(!!columnOrderState?.orderedColIds, source); const updateCachedState = this.updateCachedState.bind(this); updateCachedState("sideBar", this.getSideBarState()); updateCachedState("focusedCell", this.getFocusedCellState()); const cellSelection = this.getRangeSelectionState(); updateCachedState("rangeSelection", cellSelection); updateCachedState("cellSelection", cellSelection); updateCachedState("scroll", this.getScrollState()); } setupStateOnFirstDataRendered(initialState) { this.setFirstDataRenderedState(initialState, "gridInitializing"); const updateCachedState = this.updateCachedState.bind(this); const updateFocusState = () => updateCachedState("focusedCell", this.getFocusedCellState()); this.addManagedEventListeners({ cellFocused: updateFocusState, cellFocusCleared: updateFocusState, cellSelectionChanged: (event) => { if (event.finished) { const cellSelection = this.getRangeSelectionState(); updateCachedState("rangeSelection", cellSelection); updateCachedState("cellSelection", cellSelection); } }, bodyScrollEnd: () => updateCachedState("scroll", this.getScrollState()) }); } getColumnState() { const beans = this.beans; return convertColumnState(_getColumnState(beans), beans.colModel.isPivotMode()); } setColumnState(state, source, partialColumnState, ignoreSet) { const { sort: sortState, rowGroup: groupState, aggregation: aggregationState, pivot: pivotState, columnPinning: columnPinningState, columnVisibility: columnVisibilityState, columnSizing: columnSizingState, columnOrder: columnOrderState } = state; let forceSetState = false; const shouldSetState = (prop, propState) => { const shouldSet = !ignoreSet?.has(prop) && !!(propState || source === "api"); forceSetState || (forceSetState = shouldSet); return shouldSet; }; const columnStateMap = {}; const getColumnState2 = (colId) => { let columnState = columnStateMap[colId]; if (columnState) { return columnState; } columnState = { colId }; columnStateMap[colId] = columnState; return columnState; }; const defaultState = {}; const shouldSetSortState = shouldSetState("sort", sortState); if (shouldSetSortState) { sortState?.sortModel.forEach(({ colId, sort, type }, sortIndex) => { const columnState = getColumnState2(colId); columnState.sort = sort; columnState.sortIndex = sortIndex; columnState.sortType = type; }); } if (shouldSetSortState || !partialColumnState) { defaultState.sort = null; defaultState.sortIndex = null; } const shouldSetGroupState = shouldSetState("rowGroup", groupState); if (shouldSetGroupState) { groupState?.groupColIds.forEach((colId, rowGroupIndex) => { const columnState = getColumnState2(colId); columnState.rowGroup = true; columnState.rowGroupIndex = rowGroupIndex; }); } if (shouldSetGroupState || !partialColumnState) { defaultState.rowGroup = null; defaultState.rowGroupIndex = null; } const shouldSetAggregationState = shouldSetState("aggregation", aggregationState); if (shouldSetAggregationState) { aggregationState?.aggregationModel.forEach(({ colId, aggFunc }) => { getColumnState2(colId).aggFunc = aggFunc; }); } if (shouldSetAggregationState || !partialColumnState) { defaultState.aggFunc = null; } const shouldSetPivotState = shouldSetState("pivot", pivotState); if (shouldSetPivotState) { pivotState?.pivotColIds.forEach((colId, pivotIndex) => { const columnState = getColumnState2(colId); columnState.pivot = true; columnState.pivotIndex = pivotIndex; }); this.gos.updateGridOptions({ options: { pivotMode: !!pivotState?.pivotMode }, source }); } if (shouldSetPivotState || !partialColumnState) { defaultState.pivot = null; defaultState.pivotIndex = null; } const shouldSetColumnPinningState = shouldSetState("columnPinning", columnPinningState); if (shouldSetColumnPinningState) { for (const colId of columnPinningState?.leftColIds ?? []) { getColumnState2(colId).pinned = "left"; } for (const colId of columnPinningState?.rightColIds ?? []) { getColumnState2(colId).pinned = "right"; } } if (shouldSetColumnPinningState || !partialColumnState) { defaultState.pinned = null; } const shouldSetColumnVisibilityState = shouldSetState("columnVisibility", columnVisibilityState); if (shouldSetColumnVisibilityState) { for (const colId of columnVisibilityState?.hiddenColIds ?? []) { getColumnState2(colId).hide = true; } } if (shouldSetColumnVisibilityState || !partialColumnState) { defaultState.hide = null; } const shouldSetColumnSizingState = shouldSetState("columnSizing", columnSizingState); if (shouldSetColumnSizingState) { for (const { colId, flex, width } of columnSizingState?.columnSizingModel ?? []) { const columnState = getColumnState2(colId); columnState.flex = flex ?? null; columnState.width = width; } } if (shouldSetColumnSizingState || !partialColumnState) { defaultState.flex = null; } const columns = columnOrderState?.orderedColIds; const applyOrder = !!columns?.length && !ignoreSet?.has("columnOrder"); const columnStates = applyOrder ? columns.map((colId) => getColumnState2(colId)) : Object.values(columnStateMap); if (columnStates.length || forceSetState) { this.columnStates = columnStates; _applyColumnState( this.beans, { state: columnStates, applyOrder, defaultState }, source ); } } setColumnPivotState(applyOrder, source) { const columnStates = this.columnStates; this.columnStates = void 0; const columnGroupStates = this.columnGroupStates; this.columnGroupStates = void 0; const beans = this.beans; const { pivotResultCols, colGroupSvc } = beans; if (!pivotResultCols?.isPivotResultColsPresent()) { return; } if (columnStates) { const secondaryColumnStates = []; for (const columnState of columnStates) { if (pivotResultCols.getPivotResultCol(columnState.colId)) { secondaryColumnStates.push(columnState); } } _applyColumnState( beans, { state: secondaryColumnStates, applyOrder }, source ); } if (columnGroupStates) { colGroupSvc?.setColumnGroupState(columnGroupStates, source); } } getColumnGroupState() { const colGroupSvc = this.beans.colGroupSvc; if (!colGroupSvc) { return void 0; } const columnGroupState = colGroupSvc.getColumnGroupState(); return _convertColumnGroupState(columnGroupState); } setColumnGroupState(state, source, ignoreSet) { const colGroupSvc = this.beans.colGroupSvc; if (!colGroupSvc || ignoreSet?.has("columnGroup") || source !== "api" && !Object.prototype.hasOwnProperty.call(state, "columnGroup")) { return; } const openColumnGroups = new Set(state.columnGroup?.openColumnGroupIds); const existingColumnGroupState = colGroupSvc.getColumnGroupState(); const stateItems = existingColumnGroupState.map(({ groupId }) => { const open = openColumnGroups.has(groupId); if (open) { openColumnGroups.delete(groupId); } return { groupId, open }; }); for (const groupId of openColumnGroups) { stateItems.push({ groupId, open: true }); } if (stateItems.length) { this.columnGroupStates = stateItems; } colGroupSvc.setColumnGroupState(stateItems, source); } getFilterState() { const { filterManager, selectableFilter } = this.beans; let filterModel = filterManager?.getFilterModel(); if (filterModel && Object.keys(filterModel).length === 0) { filterModel = void 0; } const columnFilterState = filterManager?.getFilterState(); const advancedFilterModel = filterManager?.getAdvFilterModel() ?? void 0; const selectableFilters = selectableFilter?.getState(); return filterModel || advancedFilterModel || columnFilterState || selectableFilters ? { filterModel, columnFilterState, advancedFilterModel, selectableFilters } : void 0; } setFilterState(filterState) { const { filterManager, selectableFilter } = this.beans; const { filterModel, columnFilterState, advancedFilterModel, selectableFilters } = filterState ?? { filterModel: null, columnFilterState: null, advancedFilterModel: null }; if (selectableFilters !== void 0) { selectableFilter?.setState(selectableFilters ?? {}); } if (filterModel !== void 0 || columnFilterState !== void 0) { filterManager?.setFilterState(filterModel ?? null, columnFilterState ?? null, "columnFilter"); } if (advancedFilterModel !== void 0) { filterManager?.setAdvFilterModel(advancedFilterModel ?? null, "advancedFilter"); } } getRangeSelectionState() { const cellRanges = this.beans.rangeSvc?.getCellRanges().map((cellRange) => { const { id, type, startRow, endRow, columns, startColumn } = cellRange; return { id, type, startRow, endRow, colIds: columns.map((column) => column.getColId()), startColId: startColumn.getColId() }; }); return cellRanges?.length ? { cellRanges } : void 0; } setCellSelectionState(cellSelectionState) { const { gos, rangeSvc, colModel, visibleCols } = this.beans; if (!_isCellSelectionEnabled(gos) || !rangeSvc) { return; } const cellRanges = []; for (const cellRange of cellSelectionState?.cellRanges ?? []) { const columns = []; for (const colId of cellRange.colIds) { const column = colModel.getCol(colId); if (column) { columns.push(column); } } if (!columns.length) { continue; } let startColumn = colModel.getCol(cellRange.startColId); if (!startColumn) { const allColumns = visibleCols.allCols; const columnSet = new Set(columns); startColumn = allColumns.find((column) => columnSet.has(column)); } cellRanges.push({ ...cellRange, columns, startColumn }); } rangeSvc.setCellRanges(cellRanges); } getScrollState() { if (!this.isClientSideRowModel) { return void 0; } const scrollFeature = this.beans.ctrlsSvc.getScrollFeature(); const { left } = scrollFeature?.getHScrollPosition() ?? { left: 0 }; const { top } = scrollFeature?.getVScrollPosition() ?? { top: 0 }; return top || left ? { top, left } : void 0; } setScrollState(scrollState) { if (!this.isClientSideRowModel) { return; } const { top, left } = scrollState ?? { top: 0, left: 0 }; const { frameworkOverrides, rowRenderer, animationFrameSvc, ctrlsSvc } = this.beans; frameworkOverrides.wrapIncoming(() => { ctrlsSvc.get("center").setCenterViewportScrollLeft(left); ctrlsSvc.getScrollFeature()?.setVerticalScrollPosition(top); rowRenderer.redraw({ afterScroll: true }); animationFrameSvc?.flushAllFrames(); }); } getSideBarState() { return this.beans.sideBar?.comp?.getState(); } getFocusedCellState() { if (!this.isClientSideRowModel) { return void 0; } const focusedCell = this.beans.focusSvc.getFocusedCell(); if (focusedCell) { const { column, rowIndex, rowPinned } = focusedCell; return { colId: column.getColId(), rowIndex, rowPinned }; } return void 0; } setFocusedCellState(focusedCellState) { if (!this.isClientSideRowModel) { return; } const { focusSvc, colModel } = this.beans; if (!focusedCellState) { focusSvc.clearFocusedCell(); return; } const { colId, rowIndex, rowPinned } = focusedCellState; focusSvc.setFocusedCell({ column: colModel.getCol(colId), rowIndex, rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: true }); } getPaginationState() { const { pagination, gos } = this.beans; if (!pagination) { return void 0; } const page = pagination.getCurrentPage(); const pageSize = !gos.get("paginationAutoPageSize") ? pagination.getPageSize() : void 0; if (!page && !pageSize) { return; } return { page, pageSize }; } setPaginationState(paginationState, source) { const { pagination, gos } = this.beans; if (!pagination) { return; } const { pageSize, page } = paginationState ?? { page: 0, pageSize: gos.get("paginationPageSize") }; const isInit = source === "gridInitializing"; if (pageSize && !gos.get("paginationAutoPageSize")) { pagination.setPageSize(pageSize, isInit ? "initialState" : "pageSizeSelector"); } if (typeof page === "number") { if (isInit) { pagination.setPage(page); } else { pagination.goToPage(page); } } } getRowSelectionState() { const selectionSvc = this.beans.selectionSvc; if (!selectionSvc) { return void 0; } const selectionState = selectionSvc.getSelectionState(); const noSelections = !selectionState || !Array.isArray(selectionState) && (selectionState.selectAll === false || selectionState.selectAllChildren === false) && !selectionState?.toggledNodes?.length; return noSelections ? void 0 : selectionState; } setRowSelectionState(rowSelectionState, source) { this.beans.selectionSvc?.setSelectionState(rowSelectionState, source, source === "api"); } updateGroupExpansionState() { const { expansionSvc, gos } = this.beans; const state = expansionSvc?.getExpansionState(); const ssrmExpandAllAffectsAllRows = gos.get("ssrmExpandAllAffectsAllRows"); this.updateCachedState("ssrmRowGroupExpansion", ssrmExpandAllAffectsAllRows ? state : void 0); this.updateCachedState( "rowGroupExpansion", ssrmExpandAllAffectsAllRows ? void 0 : state ); } getRowPinningState() { return this.beans.pinnedRowModel?.getPinnedState(); } setRowPinningState(state) { const pinnedRowModel = this.beans.pinnedRowModel; if (state) { pinnedRowModel?.setPinnedState(state); } else { pinnedRowModel?.reset(); } } setRowGroupExpansionState(ssrmRowGroupExpansionState, rowGroupExpansionState, source) { const state = ssrmRowGroupExpansionState ?? rowGroupExpansionState ?? { expandedRowGroupIds: [], collapsedRowGroupIds: [] }; this.beans.expansionSvc?.setExpansionState(state, source); } updateColumnState(features) { const newColumnState = this.getColumnState(); let hasChanged = false; const cachedState = this.cachedState; for (const key of Object.keys(newColumnState)) { const value = newColumnState[key]; if (!_jsonEquals(value, cachedState[key])) { hasChanged = true; } } this.cachedState = { ...cachedState, ...newColumnState }; if (hasChanged) { this.dispatchStateUpdateEvent(features); } } updateCachedState(key, value) { const existingValue = this.cachedState[key]; this.setCachedStateValue(key, value); if (!_jsonEquals(value, existingValue)) { this.dispatchStateUpdateEvent([key]); } } setCachedStateValue(key, value) { this.cachedState = { ...this.cachedState, [key]: value }; } refreshStaleState() { const staleStateKeys = this.staleStateKeys; for (const key of staleStateKeys) { if (key === "rowSelection") { this.setCachedStateValue(key, this.getRowSelectionState()); } } staleStateKeys.clear(); } dispatchStateUpdateEvent(sources) { if (this.suppressEvents) { return; } for (const source of sources) { this.queuedUpdateSources.add(source); } this.dispatchStateUpdateEventDebounced(); } dispatchQueuedStateUpdateEvents() { const queuedUpdateSources = this.queuedUpdateSources; const sources = Array.from(queuedUpdateSources); queuedUpdateSources.clear(); this.eventSvc.dispatchEvent({ type: "stateUpdated", sources, state: this.cachedState }); } startSuppressEvents() { this.suppressEvents = true; this.beans.colAnimation?.setSuppressAnimation(true); } stopSuppressEvents(source) { setTimeout(() => { this.suppressEvents = false; this.queuedUpdateSources.clear(); if (!this.isAlive()) { return; } this.beans.colAnimation?.setSuppressAnimation(false); this.dispatchStateUpdateEvent([source]); }); } suppressEventsAndDispatchInitEvent(updateFunc) { this.startSuppressEvents(); updateFunc(); this.stopSuppressEvents("gridInitializing"); } }; var GridStateModule = { moduleName: "GridState", version: VERSION, beans: [StateService], apiFunctions: { getState, setState } }; function paginationIsLastPageFound(beans) { return beans.rowModel.isLastRowIndexKnown(); } function paginationGetPageSize(beans) { return beans.pagination?.getPageSize() ?? 100; } function paginationGetCurrentPage(beans) { return beans.pagination?.getCurrentPage() ?? 0; } function paginationGetTotalPages(beans) { return beans.pagination?.getTotalPages() ?? 1; } function paginationGetRowCount(beans) { return beans.pagination ? beans.pagination.getMasterRowCount() : beans.rowModel.getRowCount(); } function paginationGoToNextPage(beans) { beans.pagination?.goToNextPage(); } function paginationGoToPreviousPage(beans) { beans.pagination?.goToPreviousPage(); } function paginationGoToFirstPage(beans) { beans.pagination?.goToFirstPage(); } function paginationGoToLastPage(beans) { beans.pagination?.goToLastPage(); } function paginationGoToPage(beans, page) { beans.pagination?.goToPage(page); } var PaginationAutoPageSizeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "paginationAutoPageSizeSvc"; } postConstruct() { this.beans.ctrlsSvc.whenReady(this, (p) => { this.centerRowsCtrl = p.center; const listener = this.checkPageSize.bind(this); this.addManagedEventListeners({ bodyHeightChanged: listener, scrollVisibilityChanged: listener }); this.addManagedPropertyListener("paginationAutoPageSize", this.onPaginationAutoSizeChanged.bind(this)); this.checkPageSize(); }); } notActive() { return !this.gos.get("paginationAutoPageSize") || this.centerRowsCtrl == null; } onPaginationAutoSizeChanged() { if (this.notActive()) { this.beans.pagination.unsetAutoCalculatedPageSize(); } else { this.checkPageSize(); } } checkPageSize() { if (this.notActive()) { return; } const bodyHeight = this.centerRowsCtrl.viewportSizeFeature.getBodyHeight(); if (bodyHeight > 0) { const beans = this.beans; const update = () => { const rowHeight = Math.max(_getRowHeightAsNumber(beans), 1); const newPageSize = Math.floor(bodyHeight / rowHeight); beans.pagination.setPageSize(newPageSize, "autoCalculated"); }; if (!this.isBodyRendered) { update(); this.isBodyRendered = true; } else { _debounce(this, update, 50)(); } } else { this.isBodyRendered = false; } } }; function _formatNumberCommas(value, getLocaleTextFunc) { if (typeof value !== "number") { return ""; } const localeTextFunc = getLocaleTextFunc(); const thousandSeparator = localeTextFunc("thousandSeparator", ","); const decimalSeparator = localeTextFunc("decimalSeparator", "."); return value.toString().replace(".", decimalSeparator).replace(/(\d)(?=(\d{3})+(?!\d))/g, `$1${thousandSeparator}`); } var paginationPageSizeSelector = "paginationPageSizeSelector"; var PageSizeSelectorCompElement = { tag: "span", cls: "ag-paging-page-size" }; var PageSizeSelectorComp = class extends Component { constructor() { super(PageSizeSelectorCompElement); this.hasEmptyOption = false; this.handlePageSizeItemSelected = () => { if (!this.selectPageSizeComp) { return; } const newValue = this.selectPageSizeComp.getValue(); if (!newValue) { return; } const paginationPageSize = Number(newValue); if (isNaN(paginationPageSize) || paginationPageSize < 1 || paginationPageSize === this.pagination.getPageSize()) { return; } this.pagination.setPageSize(paginationPageSize, "pageSizeSelector"); if (this.hasEmptyOption) { this.toggleSelectDisplay(true); } this.selectPageSizeComp.getFocusableElement().focus(); }; } wireBeans(beans) { this.pagination = beans.pagination; } postConstruct() { this.addManagedPropertyListener(paginationPageSizeSelector, () => { this.onPageSizeSelectorValuesChange(); }); this.addManagedEventListeners({ paginationChanged: (event) => this.handlePaginationChanged(event) }); } handlePaginationChanged(paginationChangedEvent) { if (!this.selectPageSizeComp || !paginationChangedEvent?.newPageSize) { return; } const paginationPageSize = this.pagination.getPageSize(); if (this.getPageSizeSelectorValues().includes(paginationPageSize)) { this.selectPageSizeComp.setValue(paginationPageSize.toString()); } else if (this.hasEmptyOption) { this.selectPageSizeComp.setValue(""); } else { this.toggleSelectDisplay(true); } } toggleSelectDisplay(show) { if (this.selectPageSizeComp && !show) { this.reset(); } if (!show) { return; } this.reloadPageSizesSelector(); if (!this.selectPageSizeComp) { return; } } reset() { _clearElement(this.getGui()); if (!this.selectPageSizeComp) { return; } this.selectPageSizeComp = this.destroyBean(this.selectPageSizeComp); } onPageSizeSelectorValuesChange() { if (!this.selectPageSizeComp) { return; } if (this.shouldShowPageSizeSelector()) { this.reloadPageSizesSelector(); } } shouldShowPageSizeSelector() { return this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel") && !this.gos.get("paginationAutoPageSize") && this.gos.get(paginationPageSizeSelector) !== false; } reloadPageSizesSelector() { const pageSizeOptions = this.getPageSizeSelectorValues(); const paginationPageSizeOption = this.pagination.getPageSize(); const shouldAddAndSelectEmptyOption = !paginationPageSizeOption || !pageSizeOptions.includes(paginationPageSizeOption); if (shouldAddAndSelectEmptyOption) { const pageSizeSet = this.gos.exists("paginationPageSize"); const pageSizesSet = this.gos.get(paginationPageSizeSelector) !== true; _warn(94, { pageSizeSet, pageSizesSet, pageSizeOptions, paginationPageSizeOption }); if (!pageSizesSet) { _warn(95, { paginationPageSizeOption, paginationPageSizeSelector }); } pageSizeOptions.unshift(""); } const value = String(shouldAddAndSelectEmptyOption ? "" : paginationPageSizeOption); if (this.selectPageSizeComp) { if (!_areEqual(this.pageSizeOptions, pageSizeOptions)) { this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(pageSizeOptions)); this.pageSizeOptions = pageSizeOptions; } this.selectPageSizeComp.setValue(value, true); } else { this.createPageSizeSelectorComp(pageSizeOptions, value); } this.hasEmptyOption = shouldAddAndSelectEmptyOption; } createPageSizeSelectOptions(pageSizeOptions) { return pageSizeOptions.map((value) => ({ value: String(value) })); } createPageSizeSelectorComp(pageSizeOptions, value) { const localeTextFunc = this.getLocaleTextFunc(); const localisedLabel = localeTextFunc("pageSizeSelectorLabel", "Page Size:"); const localisedAriaLabel = localeTextFunc("ariaPageSizeSelectorLabel", "Page Size"); this.selectPageSizeComp = this.createManagedBean(new AgSelect()).addOptions(this.createPageSizeSelectOptions(pageSizeOptions)).setValue(value).setAriaLabel(localisedAriaLabel).setLabel(localisedLabel).onValueChange(() => this.handlePageSizeItemSelected()); this.appendChild(this.selectPageSizeComp); } getPageSizeSelectorValues() { const defaultValues = [20, 50, 100]; const paginationPageSizeSelectorValues = this.gos.get(paginationPageSizeSelector); if (!Array.isArray(paginationPageSizeSelectorValues) || !paginationPageSizeSelectorValues?.length) { return defaultValues; } return [...paginationPageSizeSelectorValues].sort((a, b) => a - b); } destroy() { this.toggleSelectDisplay(false); super.destroy(); } }; var PageSizeSelectorSelector = { selector: "AG-PAGE-SIZE-SELECTOR", component: PageSizeSelectorComp }; var paginationComp_default = ".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;flex-wrap:wrap-reverse;gap:calc(var(--ag-spacing)*4);justify-content:flex-end;min-height:var(--ag-pagination-panel-height);padding:calc(var(--ag-spacing)*.5) var(--ag-cell-horizontal-padding);row-gap:calc(var(--ag-spacing)*.5);@container (width < 600px){justify-content:center}}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel,.ag-paging-row-summary-panel{margin:calc(var(--ag-spacing)*.5)}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}.ag-paging-description{line-height:0}"; var PaginationComp = class extends TabGuardComp { constructor() { super(); this.btFirst = RefPlaceholder; this.btPrevious = RefPlaceholder; this.btNext = RefPlaceholder; this.btLast = RefPlaceholder; this.lbRecordCount = RefPlaceholder; this.lbFirstRowOnPage = RefPlaceholder; this.lbLastRowOnPage = RefPlaceholder; this.lbCurrent = RefPlaceholder; this.lbTotal = RefPlaceholder; this.pageSizeComp = RefPlaceholder; this.previousAndFirstButtonsDisabled = false; this.nextButtonDisabled = false; this.lastButtonDisabled = false; this.areListenersSetup = false; this.allowFocusInnerElement = false; this.registerCSS(paginationComp_default); } wireBeans(beans) { this.rowModel = beans.rowModel; this.pagination = beans.pagination; this.ariaAnnounce = beans.ariaAnnounce; } postConstruct() { const isRtl = this.gos.get("enableRtl"); this.setTemplate(this.getTemplate(), [PageSizeSelectorSelector]); const { btFirst, btPrevious, btNext, btLast } = this; this.activateTabIndex([btFirst, btPrevious, btNext, btLast]); btFirst.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "last" : "first", this.beans)); btPrevious.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "next" : "previous", this.beans)); btNext.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "previous" : "next", this.beans)); btLast.insertAdjacentElement("afterbegin", _createIconNoSpan(isRtl ? "first" : "last", this.beans)); this.addManagedPropertyListener("pagination", this.onPaginationChanged.bind(this)); this.addManagedPropertyListener("suppressPaginationPanel", this.onPaginationChanged.bind(this)); this.addManagedPropertyListeners( ["paginationPageSizeSelector", "paginationAutoPageSize", "suppressPaginationPanel"], () => this.onPageSizeRelatedOptionsChange() ); this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()); this.initialiseTabGuard({ // prevent tab guard default logic onTabKeyDown: () => { }, focusInnerElement: (fromBottom) => { if (this.allowFocusInnerElement) { return this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(fromBottom); } else { return _focusGridInnerElement(this.beans, fromBottom); } }, forceFocusOutWhenTabGuardsAreEmpty: true }); this.onPaginationChanged(); } setAllowFocus(allowFocus) { this.allowFocusInnerElement = allowFocus; } getFocusableContainerName() { return "pagination"; } onPaginationChanged() { const isPaging = this.gos.get("pagination"); const paginationPanelEnabled = isPaging && !this.gos.get("suppressPaginationPanel"); this.setDisplayed(paginationPanelEnabled); if (!paginationPanelEnabled) { return; } this.setupListeners(); this.enableOrDisableButtons(); this.updateLabels(); this.onPageSizeRelatedOptionsChange(); } onPageSizeRelatedOptionsChange() { this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()); } setupListeners() { if (!this.areListenersSetup) { this.addManagedEventListeners({ paginationChanged: this.onPaginationChanged.bind(this) }); for (const item of [ { el: this.btFirst, fn: this.onBtFirst.bind(this) }, { el: this.btPrevious, fn: this.onBtPrevious.bind(this) }, { el: this.btNext, fn: this.onBtNext.bind(this) }, { el: this.btLast, fn: this.onBtLast.bind(this) } ]) { const { el, fn } = item; this.addManagedListeners(el, { click: fn, keydown: (e) => { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { e.preventDefault(); fn(); } } }); } _addFocusableContainerListener(this.beans, this, this.getGui()); this.areListenersSetup = true; } } onBtFirst() { if (!this.previousAndFirstButtonsDisabled) { this.pagination.goToFirstPage(); } } formatNumber(value) { const userFunc = this.gos.getCallback("paginationNumberFormatter"); if (userFunc) { const params = { value }; return userFunc(params); } return _formatNumberCommas(value, this.getLocaleTextFunc.bind(this)); } getTemplate() { const localeTextFunc = this.getLocaleTextFunc(); const idPrefix = `ag-${this.getCompId()}`; return { tag: "div", cls: "ag-paging-panel ag-unselectable", attrs: { id: `${idPrefix}` }, children: [ { tag: "ag-page-size-selector", ref: "pageSizeComp" }, { tag: "span", cls: "ag-paging-row-summary-panel", children: [ { tag: "span", ref: "lbFirstRowOnPage", cls: "ag-paging-row-summary-panel-number", attrs: { id: `${idPrefix}-first-row` } }, { tag: "span", attrs: { id: `${idPrefix}-to` }, children: localeTextFunc("to", "to") }, { tag: "span", ref: "lbLastRowOnPage", cls: "ag-paging-row-summary-panel-number", attrs: { id: `${idPrefix}-last-row` } }, { tag: "span", attrs: { id: `${idPrefix}-of` }, children: localeTextFunc("of", "of") }, { tag: "span", ref: "lbRecordCount", cls: "ag-paging-row-summary-panel-number", attrs: { id: `${idPrefix}-row-count` } } ] }, { tag: "span", cls: "ag-paging-page-summary-panel", role: "presentation", children: [ { tag: "div", ref: "btFirst", cls: "ag-button ag-paging-button", role: "button", attrs: { "aria-label": localeTextFunc("firstPage", "First Page") } }, { tag: "div", ref: "btPrevious", cls: "ag-button ag-paging-button", role: "button", attrs: { "aria-label": localeTextFunc("previousPage", "Previous Page") } }, { tag: "span", cls: "ag-paging-description", children: [ { tag: "span", attrs: { id: `${idPrefix}-start-page` }, children: localeTextFunc("page", "Page") }, { tag: "span", ref: "lbCurrent", cls: "ag-paging-number", attrs: { id: `${idPrefix}-start-page-number` } }, { tag: "span", attrs: { id: `${idPrefix}-of-page` }, children: localeTextFunc("of", "of") }, { tag: "span", ref: "lbTotal", cls: "ag-paging-number", attrs: { id: `${idPrefix}-of-page-number` } } ] }, { tag: "div", ref: "btNext", cls: "ag-button ag-paging-button", role: "button", attrs: { "aria-label": localeTextFunc("nextPage", "Next Page") } }, { tag: "div", ref: "btLast", cls: "ag-button ag-paging-button", role: "button", attrs: { "aria-label": localeTextFunc("lastPage", "Last Page") } } ] } ] }; } onBtNext() { if (!this.nextButtonDisabled) { this.pagination.goToNextPage(); } } onBtPrevious() { if (!this.previousAndFirstButtonsDisabled) { this.pagination.goToPreviousPage(); } } onBtLast() { if (!this.lastButtonDisabled) { this.pagination.goToLastPage(); } } enableOrDisableButtons() { const currentPage = this.pagination.getCurrentPage(); const maxRowFound = this.rowModel.isLastRowIndexKnown(); const totalPages = this.pagination.getTotalPages(); this.previousAndFirstButtonsDisabled = currentPage === 0; this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled); this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled); const zeroPagesToDisplay = this.isZeroPagesToDisplay(); const onLastPage = currentPage === totalPages - 1; this.nextButtonDisabled = onLastPage || zeroPagesToDisplay; this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === totalPages - 1; this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled); this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled); } toggleButtonDisabled(button, disabled) { _setAriaDisabled(button, disabled); button.classList.toggle("ag-disabled", disabled); } isZeroPagesToDisplay() { const maxRowFound = this.rowModel.isLastRowIndexKnown(); const totalPages = this.pagination.getTotalPages(); return maxRowFound && totalPages === 0; } updateLabels() { const lastPageFound = this.rowModel.isLastRowIndexKnown(); const totalPages = this.pagination.getTotalPages(); const masterRowCount = this.pagination.getMasterRowCount(); const rowCount = lastPageFound ? masterRowCount : null; const currentPage = this.pagination.getCurrentPage(); const pageSize = this.pagination.getPageSize(); let startRow; let endRow; if (this.isZeroPagesToDisplay()) { startRow = endRow = 0; } else { startRow = pageSize * currentPage + 1; endRow = startRow + pageSize - 1; if (lastPageFound && endRow > rowCount) { endRow = rowCount; } } const theoreticalEndRow = startRow + pageSize - 1; const isLoadingPageSize = !lastPageFound && masterRowCount < theoreticalEndRow; const lbFirstRowOnPage = this.formatNumber(startRow); this.lbFirstRowOnPage.textContent = lbFirstRowOnPage; let lbLastRowOnPage; const localeTextFunc = this.getLocaleTextFunc(); if (isLoadingPageSize) { lbLastRowOnPage = localeTextFunc("pageLastRowUnknown", "?"); } else { lbLastRowOnPage = this.formatNumber(endRow); } this.lbLastRowOnPage.textContent = lbLastRowOnPage; const pagesExist = totalPages > 0; const toDisplay = pagesExist ? currentPage + 1 : 0; const lbCurrent = this.formatNumber(toDisplay); this.lbCurrent.textContent = lbCurrent; let lbTotal; let lbRecordCount; if (lastPageFound) { lbTotal = this.formatNumber(totalPages); lbRecordCount = this.formatNumber(rowCount); } else { const moreText = localeTextFunc("more", "more"); lbTotal = moreText; lbRecordCount = moreText; } this.lbTotal.textContent = lbTotal; this.lbRecordCount.textContent = lbRecordCount; this.announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal); } announceAriaStatus(lbFirstRowOnPage, lbLastRowOnPage, lbRecordCount, lbCurrent, lbTotal) { const localeTextFunc = this.getLocaleTextFunc(); const strPage = localeTextFunc("page", "Page"); const strTo = localeTextFunc("to", "to"); const strOf = localeTextFunc("of", "of"); const ariaRowStatus = `${lbFirstRowOnPage} ${strTo} ${lbLastRowOnPage} ${strOf} ${lbRecordCount}`; const ariaPageStatus = `${strPage} ${lbCurrent} ${strOf} ${lbTotal}`; if (ariaRowStatus !== this.ariaRowStatus) { this.ariaRowStatus = ariaRowStatus; this.ariaAnnounce?.announceValue(ariaRowStatus, "paginationRow"); } if (ariaPageStatus !== this.ariaPageStatus) { this.ariaPageStatus = ariaPageStatus; this.ariaAnnounce?.announceValue(ariaPageStatus, "paginationPage"); } } }; var PaginationSelector = { selector: "AG-PAGINATION", component: PaginationComp }; var DEFAULT_PAGE_SIZE = 100; var PaginationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pagination"; this.currentPage = 0; this.topDisplayedRowIndex = 0; this.bottomDisplayedRowIndex = 0; this.masterRowCount = 0; } postConstruct() { const gos = this.gos; this.active = gos.get("pagination"); this.pageSizeFromGridOptions = gos.get("paginationPageSize"); this.paginateChildRows = this.isPaginateChildRows(); this.addManagedPropertyListener("pagination", this.onPaginationGridOptionChanged.bind(this)); this.addManagedPropertyListener("paginationPageSize", this.onPageSizeGridOptionChanged.bind(this)); } getPaginationSelector() { return PaginationSelector; } isPaginateChildRows() { const gos = this.gos; const shouldPaginate = gos.get("groupHideParentOfSingleChild") || // following two properties deprecated v32.3.0 gos.get("groupRemoveSingleChildren") || gos.get("groupRemoveLowestSingleChildren"); if (shouldPaginate) { return true; } return gos.get("paginateChildRows"); } onPaginationGridOptionChanged() { this.active = this.gos.get("pagination"); this.calculatePages(); this.dispatchPaginationChangedEvent({ keepRenderedRows: true }); } onPageSizeGridOptionChanged() { this.setPageSize(this.gos.get("paginationPageSize"), "gridOptions"); } goToPage(page) { const currentPage = this.currentPage; if (!this.active || currentPage === page || typeof currentPage !== "number") { return; } const { editSvc } = this.beans; if (editSvc?.isEditing()) { if (editSvc.isBatchEditing()) { editSvc.cleanupEditors(); } else { editSvc.stopEditing(void 0, { source: "api" }); } } this.currentPage = page; this.calculatePages(); this.dispatchPaginationChangedEvent({ newPage: true }); } goToPageWithIndex(index) { if (!this.active) { return; } let adjustedIndex = index; if (!this.paginateChildRows) { adjustedIndex = this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(index) ?? index; } this.goToPage(Math.floor(adjustedIndex / this.pageSize)); } isRowInPage(rowIndex) { if (!this.active) { return true; } return rowIndex >= this.topDisplayedRowIndex && rowIndex <= this.bottomDisplayedRowIndex; } getCurrentPage() { return this.currentPage; } goToNextPage() { this.goToPage(this.currentPage + 1); } goToPreviousPage() { this.goToPage(this.currentPage - 1); } goToFirstPage() { this.goToPage(0); } goToLastPage() { const rowCount = this.beans.rowModel.getRowCount(); const lastPage = Math.floor(rowCount / this.pageSize); this.goToPage(lastPage); } getPageSize() { return this.pageSize; } getTotalPages() { return this.totalPages; } /** This is only for state setting before data has been loaded */ setPage(page) { this.currentPage = page; } get pageSize() { if (_exists(this.pageSizeAutoCalculated) && this.gos.get("paginationAutoPageSize")) { return this.pageSizeAutoCalculated; } if (_exists(this.pageSizeFromPageSizeSelector)) { return this.pageSizeFromPageSizeSelector; } if (_exists(this.pageSizeFromInitialState)) { return this.pageSizeFromInitialState; } if (_exists(this.pageSizeFromGridOptions)) { return this.pageSizeFromGridOptions; } return DEFAULT_PAGE_SIZE; } calculatePages() { if (this.active) { if (this.paginateChildRows) { this.calculatePagesAllRows(); } else { this.calculatePagesMasterRowsOnly(); } } else { this.calculatedPagesNotActive(); } this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex, this.bottomDisplayedRowIndex); } unsetAutoCalculatedPageSize() { if (this.pageSizeAutoCalculated === void 0) { return; } const oldPageSize = this.pageSizeAutoCalculated; this.pageSizeAutoCalculated = void 0; if (this.pageSize === oldPageSize) { return; } this.calculatePages(); this.dispatchPaginationChangedEvent({ newPageSize: true }); } setPageSize(size, source) { const currentSize = this.pageSize; switch (source) { case "autoCalculated": this.pageSizeAutoCalculated = size; break; case "pageSizeSelector": this.pageSizeFromPageSizeSelector = size; if (this.currentPage !== 0) { this.goToFirstPage(); } break; case "initialState": this.pageSizeFromInitialState = size; break; case "gridOptions": this.pageSizeFromGridOptions = size; this.pageSizeFromInitialState = void 0; this.pageSizeFromPageSizeSelector = void 0; if (this.currentPage !== 0) { this.goToFirstPage(); } break; } if (currentSize !== this.pageSize) { this.calculatePages(); this.dispatchPaginationChangedEvent({ newPageSize: true, keepRenderedRows: true }); } } setZeroRows() { this.masterRowCount = 0; this.topDisplayedRowIndex = 0; this.bottomDisplayedRowIndex = -1; this.currentPage = 0; this.totalPages = 0; } adjustCurrentPageIfInvalid() { const totalPages = this.totalPages; if (this.currentPage >= totalPages) { this.currentPage = totalPages - 1; } const currentPage = this.currentPage; if (!isFinite(currentPage) || isNaN(currentPage) || currentPage < 0) { this.currentPage = 0; } } calculatePagesMasterRowsOnly() { const rowModel = this.beans.rowModel; const masterRowCount = rowModel.getTopLevelRowCount(); this.masterRowCount = masterRowCount; if (masterRowCount <= 0) { this.setZeroRows(); return; } const pageSize = this.pageSize; const masterLastRowIndex = masterRowCount - 1; this.totalPages = Math.floor(masterLastRowIndex / pageSize) + 1; this.adjustCurrentPageIfInvalid(); const currentPage = this.currentPage; const masterPageStartIndex = pageSize * currentPage; let masterPageEndIndex = pageSize * (currentPage + 1) - 1; if (masterPageEndIndex > masterLastRowIndex) { masterPageEndIndex = masterLastRowIndex; } this.topDisplayedRowIndex = rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex); if (masterPageEndIndex === masterLastRowIndex) { this.bottomDisplayedRowIndex = rowModel.getRowCount() - 1; } else { const firstIndexNotToShow = rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1); this.bottomDisplayedRowIndex = firstIndexNotToShow - 1; } } getMasterRowCount() { return this.masterRowCount; } calculatePagesAllRows() { const masterRowCount = this.beans.rowModel.getRowCount(); this.masterRowCount = masterRowCount; if (masterRowCount === 0) { this.setZeroRows(); return; } const { pageSize, currentPage } = this; const maxRowIndex = masterRowCount - 1; this.totalPages = Math.floor(maxRowIndex / pageSize) + 1; this.adjustCurrentPageIfInvalid(); this.topDisplayedRowIndex = pageSize * currentPage; this.bottomDisplayedRowIndex = pageSize * (currentPage + 1) - 1; if (this.bottomDisplayedRowIndex > maxRowIndex) { this.bottomDisplayedRowIndex = maxRowIndex; } } calculatedPagesNotActive() { this.setPageSize(void 0, "autoCalculated"); this.totalPages = 1; this.currentPage = 0; this.topDisplayedRowIndex = 0; this.bottomDisplayedRowIndex = this.beans.rowModel.getRowCount() - 1; } dispatchPaginationChangedEvent(params) { const { keepRenderedRows = false, newPage = false, newPageSize = false } = params; this.eventSvc.dispatchEvent({ type: "paginationChanged", animate: false, newData: false, newPage, newPageSize, keepRenderedRows }); } }; var PaginationModule = { moduleName: "Pagination", version: VERSION, beans: [PaginationService, PaginationAutoPageSizeService], icons: { // "go to first" button in pagination controls first: "first", // "go to previous" button in pagination controls previous: "previous", // "go to next" button in pagination controls next: "next", // "go to last" button in pagination controls last: "last" }, apiFunctions: { paginationIsLastPageFound, paginationGetPageSize, paginationGetCurrentPage, paginationGetTotalPages, paginationGetRowCount, paginationGoToNextPage, paginationGoToPreviousPage, paginationGoToFirstPage, paginationGoToLastPage, paginationGoToPage }, dependsOn: [PopupModule] }; var manualPinnedRow_default = ".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}"; function getPinnedTopRowCount(beans) { return beans.pinnedRowModel?.getPinnedTopRowCount() ?? 0; } function getPinnedBottomRowCount(beans) { return beans.pinnedRowModel?.getPinnedBottomRowCount() ?? 0; } function getPinnedTopRow(beans, index) { return beans.pinnedRowModel?.getPinnedTopRow(index); } function getPinnedBottomRow(beans, index) { return beans.pinnedRowModel?.getPinnedBottomRow(index); } function forEachPinnedRow(beans, floating, callback) { return beans.pinnedRowModel?.forEachPinnedRow(floating, callback); } var PinnedRowModule = { moduleName: "PinnedRow", version: VERSION, beans: [PinnedRowModel], css: [manualPinnedRow_default], apiFunctions: { getPinnedTopRowCount, getPinnedBottomRowCount, getPinnedTopRow, getPinnedBottomRow, forEachPinnedRow }, icons: { rowPin: "pin", rowPinTop: "pinned-top", rowPinBottom: "pinned-bottom", rowUnpin: "un-pin" } }; var ARROW_UP = "\u2191"; var ARROW_DOWN = "\u2193"; var AnimateShowChangeCellRendererElement = { tag: "span", children: [ { tag: "span", ref: "eDelta", cls: "ag-value-change-delta" }, { tag: "span", ref: "eValue", cls: "ag-value-change-value" } ] }; var AnimateShowChangeCellRenderer = class extends Component { constructor() { super(AnimateShowChangeCellRendererElement); this.eValue = RefPlaceholder; this.eDelta = RefPlaceholder; this.refreshCount = 0; } init(params) { this.refresh(params, true); } showDelta(params, delta) { const absDelta = Math.abs(delta); const valueFormatted = params.formatValue(absDelta); const valueToUse = _exists(valueFormatted) ? valueFormatted : absDelta; const deltaUp = delta >= 0; const eDelta = this.eDelta; if (deltaUp) { eDelta.textContent = ARROW_UP + valueToUse; } else { eDelta.textContent = ARROW_DOWN + valueToUse; } eDelta.classList.toggle("ag-value-change-delta-up", deltaUp); eDelta.classList.toggle("ag-value-change-delta-down", !deltaUp); } setTimerToRemoveDelta() { this.refreshCount++; const refreshCountCopy = this.refreshCount; this.beans.frameworkOverrides.wrapIncoming(() => { window.setTimeout(() => { if (refreshCountCopy === this.refreshCount) { this.hideDeltaValue(); } }, 2e3); }); } hideDeltaValue() { this.eValue.classList.remove("ag-value-change-value-highlight"); _clearElement(this.eDelta); } refresh(params, isInitialRender = false) { const { value, valueFormatted } = params; const { eValue, lastValue, beans } = this; if (value === lastValue) { return false; } if (_exists(valueFormatted)) { eValue.textContent = valueFormatted; } else if (_exists(value)) { eValue.textContent = value; } else { _clearElement(eValue); } if (beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) { return false; } const numericValue = value && typeof value === "object" && "toNumber" in value ? value.toNumber() : value; const numericLastValue = lastValue && typeof lastValue === "object" && "toNumber" in lastValue ? lastValue.toNumber() : lastValue; if (numericValue === numericLastValue) { return false; } if (typeof numericValue === "number" && typeof numericLastValue === "number") { const delta = numericValue - numericLastValue; this.showDelta(params, delta); } if (lastValue) { eValue.classList.add("ag-value-change-value-highlight"); } if (!isInitialRender) { this.setTimerToRemoveDelta(); } this.lastValue = value; return true; } }; var animateSlideCellRenderer_default = ".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}"; var AnimateSlideCellRendererElement = { tag: "span", children: [{ tag: "span", ref: "eCurrent", cls: "ag-value-slide-current" }] }; var AnimateSlideCellRenderer = class extends Component { constructor() { super(AnimateSlideCellRendererElement); this.eCurrent = RefPlaceholder; this.refreshCount = 0; this.registerCSS(animateSlideCellRenderer_default); } init(params) { this.refresh(params, true); } addSlideAnimation() { this.refreshCount++; const refreshCountCopy = this.refreshCount; this.ePrevious?.remove(); const { beans, eCurrent } = this; const prevElement = _createElement({ tag: "span", cls: "ag-value-slide-previous ag-value-slide-out" }); this.ePrevious = prevElement; prevElement.textContent = eCurrent.textContent; this.getGui().insertBefore(prevElement, eCurrent); beans.frameworkOverrides.wrapIncoming(() => { window.setTimeout(() => { if (refreshCountCopy !== this.refreshCount) { return; } this.ePrevious.classList.add("ag-value-slide-out-end"); }, 50); window.setTimeout(() => { if (refreshCountCopy !== this.refreshCount) { return; } this.ePrevious?.remove(); this.ePrevious = null; }, 3e3); }); } refresh(params, isInitialRender = false) { let value = params.value; if (_missing(value)) { value = ""; } if (value === this.lastValue) { return false; } if (this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) { return false; } if (!isInitialRender) { this.addSlideAnimation(); } this.lastValue = value; const eCurrent = this.eCurrent; if (_exists(params.valueFormatted)) { eCurrent.textContent = params.valueFormatted; } else if (_exists(params.value)) { eCurrent.textContent = value; } else { _clearElement(eCurrent); } return true; } }; var CellFlashService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "cellFlashSvc"; this.nextAnimationTime = null; this.nextAnimationCycle = null; this.animations = { highlight: /* @__PURE__ */ new Map(), "data-changed": /* @__PURE__ */ new Map() }; } animateCell(cellCtrl, cssName, flashDuration = this.beans.gos.get("cellFlashDuration"), fadeDuration = this.beans.gos.get("cellFadeDuration")) { const animations = this.animations[cssName]; animations.delete(cellCtrl); const time = Date.now(); const flashEndTime = time + flashDuration; const fadeEndTime = time + flashDuration + fadeDuration; const animState = { phase: "flash", flashEndTime, fadeEndTime }; animations.set(cellCtrl, animState); const cssBase = `ag-cell-${cssName}`; const cssAnimation = `${cssBase}-animation`; const { comp, eGui: { style } } = cellCtrl; comp.toggleCss(cssBase, true); comp.toggleCss(cssAnimation, false); style.removeProperty("transition"); style.removeProperty("transition-delay"); if (this.nextAnimationTime && flashEndTime + 15 < this.nextAnimationTime) { clearTimeout(this.nextAnimationCycle); this.nextAnimationCycle = null; this.nextAnimationTime = null; } if (!this.nextAnimationCycle) { this.beans.frameworkOverrides.wrapIncoming(() => { this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), flashDuration); }); this.nextAnimationTime = flashEndTime; } } advanceAnimations() { const time = Date.now(); let nextAnimationTime = null; for (const cssName of Object.keys(this.animations)) { const animations = this.animations[cssName]; const cssBase = `ag-cell-${cssName}`; const cssAnimation = `${cssBase}-animation`; for (const [cell, animState] of animations) { if (!cell.isAlive() || !cell.comp) { animations.delete(cell); continue; } const { phase, flashEndTime, fadeEndTime } = animState; const nextActionableTime = phase === "flash" ? flashEndTime : fadeEndTime; const requiresAction = time + 15 >= nextActionableTime; if (!requiresAction) { nextAnimationTime = Math.min(nextActionableTime, nextAnimationTime ?? Infinity); continue; } const { comp, eGui: { style } } = cell; switch (phase) { case "flash": comp.toggleCss(cssBase, false); comp.toggleCss(cssAnimation, true); style.transition = `background-color ${fadeEndTime - flashEndTime}ms`; style.transitionDelay = `${flashEndTime - time}ms`; nextAnimationTime = Math.min(fadeEndTime, nextAnimationTime ?? Infinity); animState.phase = "fade"; break; case "fade": comp.toggleCss(cssBase, false); comp.toggleCss(cssAnimation, false); style.removeProperty("transition"); style.removeProperty("transition-delay"); animations.delete(cell); break; } } } if (nextAnimationTime == null) { this.nextAnimationTime = null; this.nextAnimationCycle = null; } else if (nextAnimationTime) { this.nextAnimationCycle = setTimeout(this.advanceAnimations.bind(this), nextAnimationTime - time); this.nextAnimationTime = nextAnimationTime; } } onFlashCells(cellCtrl, event) { if (!cellCtrl.comp) { return; } const cellId = _createCellId(cellCtrl.cellPosition); const shouldFlash = event.cells[cellId]; if (shouldFlash) { this.animateCell(cellCtrl, "highlight"); } } flashCell(cellCtrl, delays) { this.animateCell(cellCtrl, "data-changed", delays?.flashDuration, delays?.fadeDuration); } destroy() { for (const cssName of Object.keys(this.animations)) { const animations = this.animations[cssName]; animations.clear(); } } }; function flashCells(beans, params = {}) { const { cellFlashSvc } = beans; if (!cellFlashSvc) { return; } beans.frameworkOverrides.wrapIncoming(() => { for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) { cellFlashSvc.flashCell(cellCtrl, params); } }); } var HighlightChangesModule = { moduleName: "HighlightChanges", version: VERSION, beans: [CellFlashService], userComponents: { agAnimateShowChangeCellRenderer: AnimateShowChangeCellRenderer, agAnimateSlideCellRenderer: AnimateSlideCellRenderer }, apiFunctions: { flashCells } }; function setGridAriaProperty(beans, property, value) { if (!property) { return; } const eGrid = beans.ctrlsSvc.getGridBodyCtrl().eGridBody; const ariaProperty = `aria-${property}`; if (value === null) { eGrid.removeAttribute(ariaProperty); } else { eGrid.setAttribute(ariaProperty, value); } } function refreshCells(beans, params = {}) { beans.frameworkOverrides.wrapIncoming(() => beans.rowRenderer.refreshCells(params)); } function refreshHeader(beans) { beans.frameworkOverrides.wrapIncoming(() => { for (const c of beans.ctrlsSvc.getHeaderRowContainerCtrls()) { c.refresh(); } }); } function isAnimationFrameQueueEmpty(beans) { return beans.animationFrameSvc?.isQueueEmpty() ?? true; } function flushAllAnimationFrames(beans) { beans.animationFrameSvc?.flushAllFrames(); } function getSizesForCurrentTheme(beans) { return { rowHeight: _getRowHeightAsNumber(beans), headerHeight: getHeaderHeight(beans) }; } function getCellRendererInstances(beans, params = {}) { const cellRenderers = []; for (const cellCtrl of beans.rowRenderer.getCellCtrls(params.rowNodes, params.columns)) { const cellRenderer = cellCtrl.getCellRenderer(); if (cellRenderer != null) { cellRenderers.push(_unwrapUserComp(cellRenderer)); } } if (params.columns?.length) { return cellRenderers; } const fullWidthRenderers = []; const rowIdMap = mapRowNodes(params.rowNodes); for (const rowCtrl of beans.rowRenderer.getAllRowCtrls()) { if (rowIdMap && !isRowInMap(rowCtrl.rowNode, rowIdMap)) { continue; } if (!rowCtrl.isFullWidth()) { continue; } const renderers = rowCtrl.getFullWidthCellRenderers(); for (let i = 0; i < renderers.length; i++) { const renderer = renderers[i]; if (renderer != null) { fullWidthRenderers.push(_unwrapUserComp(renderer)); } } } return [...fullWidthRenderers, ...cellRenderers]; } var RenderApiModule = { moduleName: "RenderApi", version: VERSION, apiFunctions: { setGridAriaProperty, refreshCells, refreshHeader, isAnimationFrameQueueEmpty, flushAllAnimationFrames, getSizesForCurrentTheme, getCellRendererInstances } }; var RowAutoHeightService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowAutoHeight"; this.wasEverActive = false; this._debouncedCalculateRowHeights = _debounce(this, this.calculateRowHeights.bind(this), 1); } /** * If row height has been active, request a refresh of the row heights. */ requestCheckAutoHeight() { if (!this.wasEverActive) { return; } this._debouncedCalculateRowHeights(); } calculateRowHeights() { const { visibleCols, rowModel, rowSpanSvc, pinnedRowModel } = this.beans; const displayedAutoHeightCols = visibleCols.autoHeightCols; let anyNodeChanged = false; const updateDisplayedRowHeights = (row) => { const autoHeights = row.__autoHeights; let newRowHeight = _getRowHeightForNode(this.beans, row).height; for (const col of displayedAutoHeightCols) { let cellHeight = autoHeights?.[col.getColId()]; const spannedCell = rowSpanSvc?.getCellSpan(col, row); if (spannedCell) { if (spannedCell.getLastNode() !== row) { continue; } cellHeight = rowSpanSvc?.getCellSpan(col, row)?.getLastNodeAutoHeight(); if (!cellHeight) { return; } } if (cellHeight == null) { if (this.colSpanSkipCell(col, row)) { continue; } return; } newRowHeight = Math.max(cellHeight, newRowHeight); } if (newRowHeight !== row.rowHeight) { row.setRowHeight(newRowHeight); anyNodeChanged = true; } }; pinnedRowModel?.forEachPinnedRow?.("top", updateDisplayedRowHeights); pinnedRowModel?.forEachPinnedRow?.("bottom", updateDisplayedRowHeights); rowModel.forEachDisplayedNode?.(updateDisplayedRowHeights); if (anyNodeChanged) { rowModel.onRowHeightChanged?.(); } } /** * Set the cell height into the row node, and request a refresh of the row heights if there's been a change. * @param rowNode the node to set the auto height on * @param cellHeight the height to set, undefined if the cell has just been destroyed * @param column the column of the cell */ setRowAutoHeight(rowNode, cellHeight, column) { rowNode.__autoHeights ?? (rowNode.__autoHeights = {}); if (cellHeight == void 0) { delete rowNode.__autoHeights[column.getId()]; return; } const previousCellHeight = rowNode.__autoHeights[column.getId()]; rowNode.__autoHeights[column.getId()] = cellHeight; if (previousCellHeight !== cellHeight) { this.requestCheckAutoHeight(); } } /** * If using col span, then cells which have been spanned over do not need an auto height value * @param col the column of the cell * @param node the node of the cell * @returns whether the row needs auto height value for that column */ colSpanSkipCell(col, node) { const { colModel, colViewport, visibleCols } = this.beans; if (!colModel.colSpanActive) { return false; } let activeColsForRow = []; switch (col.getPinned()) { case "left": activeColsForRow = visibleCols.getLeftColsForRow(node); break; case "right": activeColsForRow = visibleCols.getRightColsForRow(node); break; case null: activeColsForRow = colViewport.getColsWithinViewport(node); break; } return !activeColsForRow.includes(col); } /** * If required, sets up observers to continuously measure changes in the cell height. * @param cellCtrl the cellCtrl of the cell * @param eCellWrapper the HTMLElement to track the height of * @param compBean the component bean to add the destroy/cleanup function to * @returns whether or not auto height has been set up on this cell */ setupCellAutoHeight(cellCtrl, eCellWrapper, compBean) { if (!cellCtrl.column.isAutoHeight() || !eCellWrapper) { return false; } this.wasEverActive = true; const eParentCell = eCellWrapper.parentElement; const { rowNode, column } = cellCtrl; const beans = this.beans; const measureHeight = (timesCalled) => { if (this.beans.editSvc?.isEditing(cellCtrl)) { return; } if (!cellCtrl.isAlive() || !compBean.isAlive()) { return; } const { paddingTop, paddingBottom, borderBottomWidth, borderTopWidth } = _getElementSize(eParentCell); const extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth; const wrapperHeight = eCellWrapper.offsetHeight; const autoHeight = wrapperHeight + extraHeight; if (timesCalled < 5) { const doc = _getDocument(beans); const notYetInDom = !doc?.contains(eCellWrapper); const possiblyNoContentYet = autoHeight == 0; if (notYetInDom || possiblyNoContentYet) { window.setTimeout(() => measureHeight(timesCalled + 1), 0); return; } } this.setRowAutoHeight(rowNode, autoHeight, column); }; const listener = () => measureHeight(0); listener(); const destroyResizeObserver = _observeResize(beans, eCellWrapper, listener); compBean.addDestroyFunc(() => { destroyResizeObserver(); this.setRowAutoHeight(rowNode, void 0, column); }); return true; } setAutoHeightActive(cols) { this.active = cols.list.some((col) => col.isVisible() && col.isAutoHeight()); } /** * Determines if the row auto height service has cells to grow. * @returns true if all of the rendered rows are at least as tall as their rendered cells. */ areRowsMeasured() { if (!this.active) { return true; } const rowCtrls = this.beans.rowRenderer.getAllRowCtrls(); let renderedAutoHeightCols = null; for (const { rowNode } of rowCtrls) { if (!renderedAutoHeightCols || this.beans.colModel.colSpanActive) { const renderedCols = this.beans.colViewport.getColsWithinViewport(rowNode); renderedAutoHeightCols = renderedCols.filter((col) => col.isAutoHeight()); } if (renderedAutoHeightCols.length === 0) { continue; } if (!rowNode.__autoHeights) { return false; } for (const col of renderedAutoHeightCols) { const cellHeight = rowNode.__autoHeights[col.getColId()]; if (!cellHeight || rowNode.rowHeight < cellHeight) { return false; } } } return true; } }; var RowAutoHeightModule = { moduleName: "RowAutoHeight", version: VERSION, beans: [RowAutoHeightService] }; var CellSpan = class { constructor(col, firstNode) { this.col = col; this.firstNode = firstNode; this.cellSpan = true; this.spannedNodes = /* @__PURE__ */ new Set(); this.addSpannedNode(firstNode); } /** * Reset the span leaving only the head. * Head is used as a comparison as this is the row used to render this cell * Even if the row data changes, the cell will properly reflect the correct value. */ reset() { this.spannedNodes.clear(); this.addSpannedNode(this.firstNode); } addSpannedNode(node) { this.spannedNodes.add(node); this.lastNode = node; } getLastNode() { return this.lastNode; } getCellHeight() { return this.lastNode.rowTop + this.lastNode.rowHeight - this.firstNode.rowTop - 1; } doesSpanContain(cellPosition) { if (cellPosition.column !== this.col) { return false; } if (cellPosition.rowPinned != this.firstNode.rowPinned) { return false; } return this.firstNode.rowIndex <= cellPosition.rowIndex && cellPosition.rowIndex <= this.lastNode.rowIndex; } /** * Gets the auto height value for last node in the spanned cell. * The first node is used to store the auto height for the cell, but the additional height for this cell * needs applied to the last row in the span. */ getLastNodeAutoHeight() { const autoHeight = this.firstNode.__autoHeights?.[this.col.getColId()]; if (autoHeight == null) { return void 0; } let allButLastHeights = 0; for (const node of this.spannedNodes) { if (node === this.lastNode) { continue; } allButLastHeights += node.rowHeight; } return autoHeight - allButLastHeights; } }; var RowSpanCache = class extends BeanStub { constructor(column) { super(); this.column = column; } buildCache(pinned) { const { column, beans: { gos, pinnedRowModel, rowModel, valueSvc, pagination } } = this; const { colDef } = column; const oldMap = this.getNodeMap(pinned); const newMap = /* @__PURE__ */ new Map(); const isFullWidthCellFunc = gos.getCallback("isFullWidthRow"); const equalsFnc = colDef.equals; const customCompare = colDef.spanRows; const isCustomCompare = typeof customCompare === "function"; let lastNode = null; let spanData = null; let lastValue; const setNewHead = (node, value) => { lastNode = node; spanData = null; lastValue = value; }; const checkNodeForCache = (node) => { const doesNodeSupportSpanning = !node.isExpandable() && !node.group && !node.detail && (isFullWidthCellFunc ? !isFullWidthCellFunc({ rowNode: node }) : true); if (node.rowIndex == null || !doesNodeSupportSpanning) { setNewHead(null, null); return; } if (lastNode == null || node.level !== lastNode.level || // no span across groups node.footer || spanData && node.rowIndex - 1 !== spanData?.getLastNode().rowIndex) { setNewHead(node, valueSvc.getValue(column, node, "data")); return; } const value = valueSvc.getValue(column, node, "data"); if (isCustomCompare) { const params = _addGridCommonParams(gos, { valueA: lastValue, nodeA: lastNode, valueB: value, nodeB: node, column, colDef }); if (!customCompare(params)) { setNewHead(node, value); return; } } else if (equalsFnc ? !equalsFnc(lastValue, value) : lastValue !== value) { setNewHead(node, value); return; } if (!spanData) { const oldSpan = oldMap?.get(lastNode); if (oldSpan?.firstNode === lastNode) { oldSpan.reset(); spanData = oldSpan; } else { spanData = new CellSpan(column, lastNode); } newMap.set(lastNode, spanData); } spanData.addSpannedNode(node); newMap.set(node, spanData); }; switch (pinned) { case "center": rowModel.forEachDisplayedNode?.((node) => { const isNodeInPage = !pagination || pagination.isRowInPage(node.rowIndex); if (!isNodeInPage) { return; } checkNodeForCache(node); }); this.centerValueNodeMap = newMap; break; case "top": pinnedRowModel?.forEachPinnedRow("top", checkNodeForCache); this.topValueNodeMap = newMap; break; case "bottom": pinnedRowModel?.forEachPinnedRow("bottom", checkNodeForCache); this.bottomValueNodeMap = newMap; break; } } isCellSpanning(node) { return !!this.getCellSpan(node); } getCellSpan(node) { return this.getNodeMap(node.rowPinned).get(node); } getNodeMap(container) { switch (container) { case "top": return this.topValueNodeMap; case "bottom": return this.bottomValueNodeMap; default: return this.centerValueNodeMap; } } }; var RowSpanService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowSpanSvc"; this.spanningColumns = /* @__PURE__ */ new Map(); this.debouncePinnedEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, true), 0); this.debounceModelEvent = _debounce(this, this.dispatchCellsUpdatedEvent.bind(this, false), 0); this.pinnedTimeout = null; this.modelTimeout = null; } postConstruct() { const onRowDataUpdated = this.onRowDataUpdated.bind(this); const buildPinnedCaches = this.buildPinnedCaches.bind(this); this.addManagedEventListeners({ paginationChanged: this.buildModelCaches.bind(this), pinnedRowDataChanged: buildPinnedCaches, pinnedRowsChanged: buildPinnedCaches, rowNodeDataChanged: onRowDataUpdated, cellValueChanged: onRowDataUpdated }); } /** * When a new column is created with spanning (or spanning changes for a column) * @param column column that is now spanning */ register(column) { const { gos } = this.beans; if (!gos.get("enableCellSpan")) { return; } if (this.spanningColumns.has(column)) { return; } const cache = this.createManagedBean(new RowSpanCache(column)); this.spanningColumns.set(column, cache); cache.buildCache("top"); cache.buildCache("bottom"); cache.buildCache("center"); this.debouncePinnedEvent(); this.debounceModelEvent(); } dispatchCellsUpdatedEvent(pinned) { this.dispatchLocalEvent({ type: "spannedCellsUpdated", pinned }); } /** * When a new column is destroyed with spanning (or spanning changes for a column) * @param column column that is now spanning */ deregister(column) { this.spanningColumns.delete(column); } // called when data changes, as this could be a hot path it's debounced // it uses timeouts instead of debounce so that it can be cancelled by `modelUpdated` // which is expected to run immediately (to exec before the rowRenderer) onRowDataUpdated({ node }) { const { spannedRowRenderer } = this.beans; if (node.rowPinned) { if (this.pinnedTimeout != null) { return; } this.pinnedTimeout = window.setTimeout(() => { this.pinnedTimeout = null; this.buildPinnedCaches(); spannedRowRenderer?.createCtrls("top"); spannedRowRenderer?.createCtrls("bottom"); }, 0); return; } if (this.modelTimeout != null) { return; } this.modelTimeout = window.setTimeout(() => { this.modelTimeout = null; this.buildModelCaches(); spannedRowRenderer?.createCtrls("center"); }, 0); } buildModelCaches() { if (this.modelTimeout != null) { clearTimeout(this.modelTimeout); } this.spanningColumns.forEach((cache) => cache.buildCache("center")); this.debounceModelEvent(); } buildPinnedCaches() { if (this.pinnedTimeout != null) { clearTimeout(this.pinnedTimeout); } this.spanningColumns.forEach((cache) => { cache.buildCache("top"); cache.buildCache("bottom"); }); this.debouncePinnedEvent(); } isCellSpanning(col, rowNode) { const cache = this.spanningColumns.get(col); if (!cache) { return false; } return cache.isCellSpanning(rowNode); } getCellSpanByPosition(position) { const { pinnedRowModel, rowModel } = this.beans; const col = position.column; const index = position.rowIndex; const cache = this.spanningColumns.get(col); if (!cache) { return void 0; } let node; switch (position.rowPinned) { case "top": node = pinnedRowModel?.getPinnedTopRow(index); break; case "bottom": node = pinnedRowModel?.getPinnedBottomRow(index); break; default: node = rowModel.getRow(index); } if (!node) { return void 0; } return cache.getCellSpan(node); } getCellStart(position) { const span = this.getCellSpanByPosition(position); if (!span) { return position; } return { ...position, rowIndex: span.firstNode.rowIndex }; } getCellEnd(position) { const span = this.getCellSpanByPosition(position); if (!span) { return position; } return { ...position, rowIndex: span.getLastNode().rowIndex }; } /** * Look-up a spanned cell given a col and node as position indicators * * @param col a column to lookup a span at this position * @param rowNode a node that may be spanned at this position * @returns the CellSpan object if one exists */ getCellSpan(col, rowNode) { const cache = this.spanningColumns.get(col); if (!cache) { return void 0; } return cache.getCellSpan(rowNode); } forEachSpannedColumn(rowNode, callback) { for (const [col, cache] of this.spanningColumns) { if (cache.isCellSpanning(rowNode)) { const spanningNode = cache.getCellSpan(rowNode); callback(col, spanningNode); } } } destroy() { super.destroy(); this.spanningColumns.clear(); } }; var SpannedCellCtrl = class extends CellCtrl { constructor(cellSpan, rowCtrl, beans) { super(cellSpan.col, cellSpan.firstNode, beans, rowCtrl); this.cellSpan = cellSpan; this.SPANNED_CELL_CSS_CLASS = "ag-spanned-cell"; } setComp(comp, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean) { this.eWrapper = eWrapper; super.setComp(comp, eCell, eWrapper, eCellWrapper, printLayout, startEditing, compBean); this.setAriaRowSpan(); } isCellSpanning() { return true; } getCellSpan() { return this.cellSpan; } /** * When cell is spanning, ensure row index is also available on the cell */ refreshAriaRowIndex() { const { eGui, rowNode } = this; if (!eGui || rowNode.rowIndex == null) { return; } _setAriaRowIndex(eGui, rowNode.rowIndex); } /** * When cell is spanning, ensure row index is also available on the cell */ setAriaRowSpan() { _setAriaRowSpan(this.eGui, this.cellSpan.spannedNodes.size); } // not ideal, for tabbing need to force the focused position setFocusedCellPosition(cellPos) { this.focusedCellPosition = cellPos; } getFocusedCellPosition() { return this.focusedCellPosition ?? this.cellPosition; } checkCellFocused() { const focusedCell = this.beans.focusSvc.getFocusedCell(); return !!focusedCell && this.cellSpan.doesSpanContain(focusedCell); } applyStaticCssClasses() { super.applyStaticCssClasses(); this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS, true); } onCellFocused(event) { const { beans } = this; if (_isCellFocusSuppressed(beans)) { this.focusedCellPosition = void 0; return; } const cellFocused = this.isCellFocused(); if (!cellFocused) { this.focusedCellPosition = void 0; } if (event && cellFocused) { this.focusedCellPosition = { rowIndex: event.rowIndex, rowPinned: event.rowPinned, column: event.column // fix }; } super.onCellFocused(event); } getRootElement() { return this.eWrapper; } }; var SpannedRowCtrl = class extends RowCtrl { getInitialRowClasses(_rowContainerType) { return ["ag-spanned-row"]; } getNewCellCtrl(col) { const cellSpan = this.beans.rowSpanSvc?.getCellSpan(col, this.rowNode); if (!cellSpan) { return; } const firstRowOfSpan = cellSpan.firstNode !== this.rowNode; if (firstRowOfSpan) { return; } return new SpannedCellCtrl(cellSpan, this, this.beans); } isCorrectCtrlForSpan(cell) { const cellSpan = this.beans.rowSpanSvc?.getCellSpan(cell.column, this.rowNode); if (!cellSpan) { return false; } const firstRowOfSpan = cellSpan.firstNode !== this.rowNode; if (firstRowOfSpan) { return false; } return cell.getCellSpan() === cellSpan; } /** * Below overrides are explicitly disabling styling and other unwanted behaviours for spannedRowCtrl */ onRowHeightChanged() { } refreshFirstAndLastRowStyles() { } addHoverFunctionality() { } resetHoveredStatus() { } }; var SpannedRowRenderer = class extends BeanStub { constructor() { super(...arguments); this.beanName = "spannedRowRenderer"; this.topCtrls = /* @__PURE__ */ new Map(); this.bottomCtrls = /* @__PURE__ */ new Map(); this.centerCtrls = /* @__PURE__ */ new Map(); } postConstruct() { this.addManagedEventListeners({ displayedRowsChanged: this.createAllCtrls.bind(this) }); } createAllCtrls() { this.createCtrls("top"); this.createCtrls("bottom"); this.createCtrls("center"); } /** * When displayed rows or cols change, the spanned cell ctrls need to update */ createCtrls(ctrlsKey) { const { rowSpanSvc } = this.beans; const previousCtrls = this.getCtrlsMap(ctrlsKey); const previousCtrlsSize = previousCtrls.size; const rowCtrls = this.getAllRelevantRowControls(ctrlsKey); const newRowCtrls = /* @__PURE__ */ new Map(); let hasNewSpans = false; for (const ctrl of rowCtrls) { if (!ctrl.isAlive()) { continue; } rowSpanSvc?.forEachSpannedColumn(ctrl.rowNode, (col, cellSpan) => { if (newRowCtrls.has(cellSpan.firstNode)) { return; } const existingCtrl = previousCtrls.get(cellSpan.firstNode); if (existingCtrl) { newRowCtrls.set(cellSpan.firstNode, existingCtrl); previousCtrls.delete(cellSpan.firstNode); return; } hasNewSpans = true; const newCtrl = new SpannedRowCtrl(cellSpan.firstNode, this.beans, false, false, false); newRowCtrls.set(cellSpan.firstNode, newCtrl); }); } this.setCtrlsMap(ctrlsKey, newRowCtrls); const sameCount = newRowCtrls.size === previousCtrlsSize; if (!hasNewSpans && sameCount) { return; } for (const oldCtrl of previousCtrls.values()) { oldCtrl.destroyFirstPass(true); oldCtrl.destroySecondPass(); } this.dispatchLocalEvent({ type: `spannedRowsUpdated`, ctrlsKey }); } // cannot use getAllRowCtrls as it returns this services row ctrls. getAllRelevantRowControls(ctrlsKey) { const { rowRenderer } = this.beans; switch (ctrlsKey) { case "top": return rowRenderer.topRowCtrls; case "bottom": return rowRenderer.bottomRowCtrls; case "center": return rowRenderer.allRowCtrls; } } getCellByPosition(cellPosition) { const { rowSpanSvc } = this.beans; const cellSpan = rowSpanSvc?.getCellSpanByPosition(cellPosition); if (!cellSpan) { return void 0; } const ctrl = this.getCtrlsMap(cellPosition.rowPinned).get(cellSpan.firstNode); if (!ctrl) { return void 0; } return ctrl.getAllCellCtrls().find((cellCtrl) => cellCtrl.column === cellPosition.column); } getCtrls(container) { return [...this.getCtrlsMap(container).values()]; } destroyRowCtrls(container) { for (const ctrl of this.getCtrlsMap(container).values()) { ctrl.destroyFirstPass(true); ctrl.destroySecondPass(); } this.setCtrlsMap(container, /* @__PURE__ */ new Map()); } getCtrlsMap(container) { switch (container) { case "top": return this.topCtrls; case "bottom": return this.bottomCtrls; default: return this.centerCtrls; } } setCtrlsMap(container, map) { switch (container) { case "top": this.topCtrls = map; break; case "bottom": this.bottomCtrls = map; break; default: this.centerCtrls = map; break; } } destroy() { super.destroy(); this.destroyRowCtrls("top"); this.destroyRowCtrls("bottom"); this.destroyRowCtrls("center"); } }; var CellSpanModule = { moduleName: "CellSpan", version: VERSION, beans: [RowSpanService, SpannedRowRenderer] }; var SelectionColService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "selectionColSvc"; } postConstruct() { this.addManagedPropertyListener("rowSelection", (event) => { this.onSelectionOptionsChanged( event.currentValue, event.previousValue, _convertColumnEventSourceType(event.source) ); }); this.addManagedPropertyListener("selectionColumnDef", this.updateColumns.bind(this)); } addColumns(cols) { const selectionCols = this.columns; if (selectionCols == null) { return; } cols.list = selectionCols.list.concat(cols.list); cols.tree = selectionCols.tree.concat(cols.tree); _updateColsMap(cols); } createColumns(cols, updateOrders) { const destroyCollection = () => { _destroyColumnTree(this.beans, this.columns?.tree); this.columns = null; }; const newTreeDepth = cols.treeDepth; const oldTreeDepth = this.columns?.treeDepth ?? -1; const treeDepthSame = oldTreeDepth == newTreeDepth; const list = this.generateSelectionCols(); const areSame = _areColIdsEqual(list, this.columns?.list ?? []); if (areSame && treeDepthSame) { return; } destroyCollection(); const { colGroupSvc } = this.beans; const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0; const tree = colGroupSvc?.balanceTreeForAutoCols(list, treeDepth) ?? []; this.columns = { list, tree, treeDepth, map: {} }; const putSelectionColsFirstInList = (cols2) => { if (!cols2) { return null; } const colsFiltered = cols2.filter((col) => !isColumnSelectionCol(col)); return [...list, ...colsFiltered]; }; updateOrders(putSelectionColsFirstInList); } updateColumns(event) { const source = _convertColumnEventSourceType(event.source); const { beans } = this; for (const col of this.columns?.list ?? []) { const colDef = this.createSelectionColDef(event.currentValue); col.setColDef(colDef, null, source); _applyColumnState(beans, { state: [_getColumnStateFromColDef(colDef, col.colId)] }, source); } } getColumn(key) { return this.columns?.list.find((col) => _columnsMatch(col, key)) ?? null; } getColumns() { return this.columns?.list ?? null; } isSelectionColumnEnabled() { const { gos, beans } = this; const rowSelection = gos.get("rowSelection"); if (typeof rowSelection !== "object" || !_isRowSelection(gos)) { return false; } const hasAutoCols = (beans.autoColSvc?.getColumns()?.length ?? 0) > 0; if (rowSelection.checkboxLocation === "autoGroupColumn" && hasAutoCols) { return false; } const checkboxes = !!_getCheckboxes(rowSelection); const headerCheckbox = _getHeaderCheckbox(rowSelection); return checkboxes || headerCheckbox; } createSelectionColDef(def) { const { gos } = this; const selectionColumnDef = def ?? gos.get("selectionColumnDef"); const enableRTL = gos.get("enableRtl"); const { rowSpan: _, spanRows: __, ...filteredSelColDef } = selectionColumnDef ?? {}; return { // overridable properties width: 50, resizable: false, suppressHeaderMenuButton: true, sortable: false, suppressMovable: true, lockPosition: enableRTL ? "right" : "left", comparator(valueA, valueB, nodeA, nodeB) { const aSelected = nodeA.isSelected(); const bSelected = nodeB.isSelected(); return aSelected === bSelected ? 0 : aSelected ? 1 : -1; }, editable: false, suppressFillHandle: true, suppressAutoSize: true, pinned: null, // overrides ...filteredSelColDef, // non-overridable properties colId: SELECTION_COLUMN_ID, chartDataType: "excluded" }; } generateSelectionCols() { if (!this.isSelectionColumnEnabled()) { return []; } const colDef = this.createSelectionColDef(); const colId = colDef.colId; this.gos.validateColDef(colDef, colId, true); const col = new AgColumn(colDef, null, colId, false); this.createBean(col); return [col]; } onSelectionOptionsChanged(current, prev, source) { const prevCheckbox = prev && typeof prev !== "string" ? _getCheckboxes(prev) : void 0; const currCheckbox = current && typeof current !== "string" ? _getCheckboxes(current) : void 0; const checkboxHasChanged = prevCheckbox !== currCheckbox; const prevHeaderCheckbox = prev && typeof prev !== "string" ? _getHeaderCheckbox(prev) : void 0; const currHeaderCheckbox = current && typeof current !== "string" ? _getHeaderCheckbox(current) : void 0; const headerCheckboxHasChanged = prevHeaderCheckbox !== currHeaderCheckbox; const currLocation = _getCheckboxLocation(current); const prevLocation = _getCheckboxLocation(prev); const locationChanged = currLocation !== prevLocation; if (checkboxHasChanged || headerCheckboxHasChanged || locationChanged) { this.beans.colModel.refreshAll(source); } } destroy() { _destroyColumnTree(this.beans, this.columns?.tree); super.destroy(); } /** * Refreshes visibility of the selection column based on which columns are currently visible. * Called by the VisibleColsService with the columns that are currently visible in left/center/right * containers. This method *MUTATES* those arrays directly. * * The selection column should be visible if all of the following are true * - The selection column is not disabled * - The number of visible columns excluding the selection column and row numbers column is greater than 0 * @param leftCols Visible columns in the left-pinned container * @param centerCols Visible columns in the center viewport * @param rightCols Visible columns in the right-pinned container */ refreshVisibility(leftCols, centerCols, rightCols) { if (!this.columns?.list.length) { return; } const numVisibleCols = leftCols.length + centerCols.length + rightCols.length; if (numVisibleCols === 0) { return; } const column = this.columns.list[0]; if (!column.isVisible()) { return; } const hideSelectionCol = () => { let cols; switch (column.pinned) { case "left": case true: cols = leftCols; break; case "right": cols = rightCols; break; default: cols = centerCols; } if (cols) { _removeFromArray(cols, column); } }; const rowNumbersCol = this.beans.rowNumbersSvc?.getColumn(ROW_NUMBERS_COLUMN_ID); const expectedNumCols = rowNumbersCol ? 2 : 1; if (expectedNumCols === numVisibleCols) { hideSelectionCol(); } } }; var rowSelection_default = ':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}'; function setNodesSelected(beans, params) { const allNodesValid = params.nodes.every((node) => { if (node.rowPinned && !_isManualPinnedRow(node)) { _warn(59); return false; } if (node.id === void 0) { _warn(60); return false; } return true; }); if (!allNodesValid) { return; } const { nodes, source, newValue } = params; beans.selectionSvc?.setNodesSelected({ nodes, source: source ?? "api", newValue }); } function selectAll(beans, selectAll2, source = "apiSelectAll") { beans.selectionSvc?.selectAllRowNodes({ source, selectAll: selectAll2 }); } function deselectAll(beans, selectAll2, source = "apiSelectAll") { beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: selectAll2 }); } function selectAllFiltered(beans, source = "apiSelectAllFiltered") { beans.selectionSvc?.selectAllRowNodes({ source, selectAll: "filtered" }); } function deselectAllFiltered(beans, source = "apiSelectAllFiltered") { beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: "filtered" }); } function selectAllOnCurrentPage(beans, source = "apiSelectAllCurrentPage") { beans.selectionSvc?.selectAllRowNodes({ source, selectAll: "currentPage" }); } function deselectAllOnCurrentPage(beans, source = "apiSelectAllCurrentPage") { beans.selectionSvc?.deselectAllRowNodes({ source, selectAll: "currentPage" }); } function getSelectedNodes(beans) { return beans.selectionSvc?.getSelectedNodes() ?? []; } function getSelectedRows(beans) { return beans.selectionSvc?.getSelectedRows() ?? []; } var CheckboxSelectionComponentElement = { tag: "div", cls: "ag-selection-checkbox", role: "presentation", children: [ { tag: "ag-checkbox", ref: "eCheckbox", role: "presentation" } ] }; var CheckboxSelectionComponent = class extends Component { constructor() { super(CheckboxSelectionComponentElement, [AgCheckboxSelector]); this.eCheckbox = RefPlaceholder; } postConstruct() { this.eCheckbox.setPassive(true); } onDataChanged() { this.onSelectionChanged(); } onSelectableChanged() { this.showOrHideSelect(); } onSelectionChanged() { const translate = this.getLocaleTextFunc(); const { rowNode, eCheckbox } = this; const state = rowNode.isSelected(); const stateName = _getAriaCheckboxStateName(translate, state); const [ariaKey, ariaLabel] = rowNode.selectable ? ["ariaRowToggleSelection", "Press Space to toggle row selection"] : ["ariaRowSelectionDisabled", "Row Selection is disabled for this row"]; const translatedLabel = translate(ariaKey, ariaLabel); eCheckbox.setValue(state, true); eCheckbox.setInputAriaLabel(`${translatedLabel} (${stateName})`); } init(params) { this.rowNode = params.rowNode; this.column = params.column; this.overrides = params.overrides; this.onSelectionChanged(); this.addManagedListeners(this.eCheckbox.getWrapperElement(), { // we don't want double click on this icon to open a group dblclick: _stopPropagationForAgGrid, click: (event) => { _stopPropagationForAgGrid(event); if (this.eCheckbox.isDisabled()) { return; } this.beans.selectionSvc?.handleSelectionEvent(event, this.rowNode, "checkboxSelected"); } }); this.addManagedListeners(this.rowNode, { rowSelected: this.onSelectionChanged.bind(this), dataChanged: this.onDataChanged.bind(this), selectableChanged: this.onSelectableChanged.bind(this) }); this.addManagedPropertyListener("rowSelection", ({ currentValue, previousValue }) => { const curr = typeof currentValue === "object" ? _getHideDisabledCheckboxes(currentValue) : void 0; const prev = typeof previousValue === "object" ? _getHideDisabledCheckboxes(previousValue) : void 0; if (curr !== prev) { this.onSelectableChanged(); } }); const isRowSelectableFunc = _getIsRowSelectable(this.gos); const checkboxVisibleIsDynamic = isRowSelectableFunc || typeof this.getIsVisible() === "function"; if (checkboxVisibleIsDynamic) { const showOrHideSelectListener = this.showOrHideSelect.bind(this); this.addManagedEventListeners({ displayedColumnsChanged: showOrHideSelectListener }); this.addManagedListeners(this.rowNode, { dataChanged: showOrHideSelectListener, cellChanged: showOrHideSelectListener }); this.showOrHideSelect(); } this.eCheckbox.getInputElement().setAttribute("tabindex", "-1"); } showOrHideSelect() { const { column, rowNode, overrides, gos } = this; const selectable = rowNode.selectable; const isVisible = this.getIsVisible(); let checkboxes = void 0; if (typeof isVisible === "function") { const extraParams = overrides?.callbackParams; if (!column) { checkboxes = isVisible({ ...extraParams, node: rowNode, data: rowNode.data }); } else { const params = column.createColumnFunctionCallbackParams(rowNode); checkboxes = isVisible({ ...extraParams, ...params }); } } else { checkboxes = isVisible ?? false; } const disabled = selectable && !checkboxes || !selectable && checkboxes; const visible = selectable || checkboxes; const so = gos.get("rowSelection"); const showDisabledCheckboxes = so && typeof so !== "string" ? !_getHideDisabledCheckboxes(so) : !!column?.getColDef().showDisabledCheckboxes; this.setVisible(visible && (disabled ? showDisabledCheckboxes : true)); this.setDisplayed(visible && (disabled ? showDisabledCheckboxes : true)); if (visible) { this.eCheckbox.setDisabled(disabled); } if (overrides?.removeHidden) { this.setDisplayed(visible); } } getIsVisible() { const overrides = this.overrides; if (overrides) { return overrides.isVisible; } const so = this.gos.get("rowSelection"); if (so && typeof so !== "string") { return _getCheckboxes(so); } return this.column?.getColDef()?.checkboxSelection; } }; var RowRangeSelectionContext = class { constructor(rowModel, pinnedRowModel) { this.rowModel = rowModel; this.pinnedRowModel = pinnedRowModel; this.selectAll = false; this.rootId = null; this.endId = null; this.cachedRange = []; } reset() { this.rootId = null; this.endId = null; this.cachedRange.length = 0; } setRoot(node) { this.rootId = node.id; this.endId = null; this.cachedRange.length = 0; } setEndRange(end) { this.endId = end.id; this.cachedRange.length = 0; } getRange() { if (this.cachedRange.length === 0) { const root = this.getRoot(); const end = this.getEnd(); if (root == null || end == null) { return this.cachedRange; } this.cachedRange = this.getNodesInRange(root, end) ?? []; } return this.cachedRange; } isInRange(node) { if (this.rootId === null) { return false; } return this.getRange().some((nodeInRange) => nodeInRange.id === node.id); } getRoot(fallback) { if (this.rootId) { return this.getRowNode(this.rootId); } if (fallback) { this.setRoot(fallback); return fallback; } } getEnd() { if (this.endId) { return this.getRowNode(this.endId); } } getRowNode(id) { let node; const { rowModel, pinnedRowModel } = this; node ?? (node = rowModel.getRowNode(id)); if (pinnedRowModel?.isManual()) { node ?? (node = pinnedRowModel.getPinnedRowById(id, "top")); node ?? (node = pinnedRowModel.getPinnedRowById(id, "bottom")); } return node; } /** * Truncates the range to the given node (assumed to be within the current range). * Returns nodes that remain in the current range and those that should be removed * * @param node - Node at which to truncate the range * @returns Object of nodes to either keep or discard (i.e. deselect) from the range */ truncate(node) { const range = this.getRange(); if (range.length === 0) { return { keep: [], discard: [] }; } const discardAfter = range[0].id === this.rootId; const idx = range.findIndex((rowNode) => rowNode.id === node.id); if (idx > -1) { const above = range.slice(0, idx); const below = range.slice(idx + 1); this.setEndRange(node); return discardAfter ? { keep: above, discard: below } : { keep: below, discard: above }; } else { return { keep: range, discard: [] }; } } /** * Extends the range to the given node. Returns nodes that remain in the current range * and those that should be removed. * * @param node - Node marking the new end of the range * @returns Object of nodes to either keep or discard (i.e. deselect) from the range */ extend(node, groupSelectsChildren = false) { const root = this.getRoot(); if (root == null) { const keep = this.getRange().slice(); if (groupSelectsChildren) { node.depthFirstSearch((node2) => !node2.group && keep.push(node2)); } keep.push(node); this.setRoot(node); return { keep, discard: [] }; } const newRange = this.getNodesInRange(root, node); if (!newRange) { this.setRoot(node); return { keep: [node], discard: [] }; } if (newRange.find((newRangeNode) => newRangeNode.id === this.endId)) { this.setEndRange(node); return { keep: this.getRange(), discard: [] }; } else { const discard = this.getRange().slice(); this.setEndRange(node); return { keep: this.getRange(), discard }; } } getNodesInRange(start, end) { const { pinnedRowModel, rowModel } = this; if (!pinnedRowModel?.isManual()) { return rowModel.getNodesInRangeForSelection(start, end); } if (start.rowPinned === "top" && !end.rowPinned) { const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, "top", start, void 0); return pinnedRange.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), end) ?? []); } if (start.rowPinned === "bottom" && !end.rowPinned) { const pinnedRange = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, start); const count = rowModel.getRowCount(); const lastMain = rowModel.getRow(count - 1); return (rowModel.getNodesInRangeForSelection(end, lastMain) ?? []).concat(pinnedRange); } if (!start.rowPinned && !end.rowPinned) { return rowModel.getNodesInRangeForSelection(start, end); } if (start.rowPinned === "top" && end.rowPinned === "top") { return _getNodesInRangeForSelection(pinnedRowModel, "top", start, end); } if (start.rowPinned === "bottom" && end.rowPinned === "top") { const top = _getNodesInRangeForSelection(pinnedRowModel, "top", end, void 0); const bottom = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, start); const first = rowModel.getRow(0); const last = rowModel.getRow(rowModel.getRowCount() - 1); return top.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom); } if (!start.rowPinned && end.rowPinned === "top") { const pinned = _getNodesInRangeForSelection(pinnedRowModel, "top", end, void 0); return pinned.concat(rowModel.getNodesInRangeForSelection(rowModel.getRow(0), start) ?? []); } if (start.rowPinned === "top" && end.rowPinned === "bottom") { const top = _getNodesInRangeForSelection(pinnedRowModel, "top", start, void 0); const bottom = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, end); const first = rowModel.getRow(0); const last = rowModel.getRow(rowModel.getRowCount() - 1); return top.concat(rowModel.getNodesInRangeForSelection(first, last) ?? []).concat(bottom); } if (start.rowPinned === "bottom" && end.rowPinned === "bottom") { return _getNodesInRangeForSelection(pinnedRowModel, "bottom", start, end); } if (!start.rowPinned && end.rowPinned === "bottom") { const pinned = _getNodesInRangeForSelection(pinnedRowModel, "bottom", void 0, end); const last = rowModel.getRow(rowModel.getRowCount()); return (rowModel.getNodesInRangeForSelection(start, last) ?? []).concat(pinned); } return null; } }; var SelectAllFeature = class extends BeanStub { constructor(column) { super(); this.column = column; this.cbSelectAllVisible = false; this.processingEventFromCheckbox = false; } onSpaceKeyDown(e) { const checkbox = this.cbSelectAll; if (checkbox.isDisplayed() && !checkbox.getGui().contains(_getActiveDomElement(this.beans))) { e.preventDefault(); checkbox.setValue(!checkbox.getValue()); } } getCheckboxGui() { return this.cbSelectAll.getGui(); } setComp(ctrl) { this.headerCellCtrl = ctrl; const cbSelectAll = this.createManagedBean(new AgCheckbox()); this.cbSelectAll = cbSelectAll; cbSelectAll.addCss("ag-header-select-all"); _setAriaRole(cbSelectAll.getGui(), "presentation"); this.showOrHideSelectAll(); const updateStateOfCheckbox = this.updateStateOfCheckbox.bind(this); this.addManagedEventListeners({ newColumnsLoaded: () => this.showOrHideSelectAll(), displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), selectionChanged: updateStateOfCheckbox, paginationChanged: updateStateOfCheckbox, modelUpdated: updateStateOfCheckbox }); this.addManagedPropertyListener("rowSelection", ({ currentValue, previousValue }) => { const getSelectAll = (rowSelection) => typeof rowSelection === "string" || !rowSelection || rowSelection.mode === "singleRow" ? void 0 : rowSelection.selectAll; if (getSelectAll(currentValue) !== getSelectAll(previousValue)) { this.showOrHideSelectAll(); } this.updateStateOfCheckbox(); }); this.addManagedListeners(cbSelectAll, { fieldValueChanged: this.onCbSelectAll.bind(this) }); cbSelectAll.getInputElement().setAttribute("tabindex", "-1"); this.refreshSelectAllLabel(); } onDisplayedColumnsChanged(e) { if (!this.isAlive()) { return; } this.showOrHideSelectAll(e.source === "uiColumnMoved"); } showOrHideSelectAll(fromColumnMoved = false) { const cbSelectAllVisible = this.isCheckboxSelection(); this.cbSelectAllVisible = cbSelectAllVisible; this.cbSelectAll.setDisplayed(cbSelectAllVisible); if (cbSelectAllVisible) { this.checkRightRowModelType("selectAllCheckbox"); this.checkSelectionType("selectAllCheckbox"); this.updateStateOfCheckbox(); } this.refreshSelectAllLabel(fromColumnMoved); } updateStateOfCheckbox() { if (!this.cbSelectAllVisible || this.processingEventFromCheckbox) { return; } this.processingEventFromCheckbox = true; const selectAllMode = this.getSelectAllMode(); const selectionSvc = this.beans.selectionSvc; const cbSelectAll = this.cbSelectAll; const allSelected = selectionSvc.getSelectAllState(selectAllMode); cbSelectAll.setValue(allSelected); const hasNodesToSelect = selectionSvc.hasNodesToSelect(selectAllMode); cbSelectAll.setDisabled(!hasNodesToSelect); this.refreshSelectAllLabel(); this.processingEventFromCheckbox = false; } refreshSelectAllLabel(fromColumnMoved = false) { const translate = this.getLocaleTextFunc(); const { headerCellCtrl, cbSelectAll, cbSelectAllVisible } = this; const checked = cbSelectAll.getValue(); const ariaStatus = _getAriaCheckboxStateName(translate, checked); const ariaLabel = translate("ariaRowSelectAll", "Press Space to toggle all rows selection"); headerCellCtrl.setAriaDescriptionProperty( "selectAll", cbSelectAllVisible ? `${ariaLabel} (${ariaStatus})` : null ); cbSelectAll.setInputAriaLabel(translate("ariaHeaderSelection", "Column with Header Selection")); if (!fromColumnMoved) { headerCellCtrl.announceAriaDescription(); } } checkSelectionType(feature) { const isMultiSelect = _isMultiRowSelection(this.gos); if (!isMultiSelect) { _warn(128, { feature }); return false; } return true; } checkRightRowModelType(feature) { const { gos, rowModel } = this.beans; const rowModelMatches = _isClientSideRowModel(gos) || _isServerSideRowModel(gos); if (!rowModelMatches) { _warn(129, { feature, rowModel: rowModel.getType() }); return false; } return true; } onCbSelectAll() { if (this.processingEventFromCheckbox) { return; } if (!this.cbSelectAllVisible) { return; } const value = this.cbSelectAll.getValue(); const selectAll2 = this.getSelectAllMode(); let source = "uiSelectAll"; if (selectAll2 === "currentPage") { source = "uiSelectAllCurrentPage"; } else if (selectAll2 === "filtered") { source = "uiSelectAllFiltered"; } const params = { source, selectAll: selectAll2 }; const selectionSvc = this.beans.selectionSvc; if (value) { selectionSvc.selectAllRowNodes(params); } else { selectionSvc.deselectAllRowNodes(params); } } /** * Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API * or `headerCheckboxSelection` is enabled in the legacy API. */ isCheckboxSelection() { const { column, gos, beans } = this; const rowSelection = gos.get("rowSelection"); const newHeaderCheckbox = typeof rowSelection === "object"; const featureName = newHeaderCheckbox ? "headerCheckbox" : "headerCheckboxSelection"; return isCheckboxSelection(beans, column) && this.checkRightRowModelType(featureName) && this.checkSelectionType(featureName); } getSelectAllMode() { const selectAll2 = _getSelectAll(this.gos, false); if (selectAll2) { return selectAll2; } const { headerCheckboxSelectionCurrentPageOnly, headerCheckboxSelectionFilteredOnly } = this.column.getColDef(); if (headerCheckboxSelectionCurrentPageOnly) { return "currentPage"; } if (headerCheckboxSelectionFilteredOnly) { return "filtered"; } return "all"; } destroy() { super.destroy(); this.cbSelectAll = void 0; this.headerCellCtrl = void 0; } }; function isCheckboxSelection({ gos, selectionColSvc }, column) { const rowSelection = gos.get("rowSelection"); const colDef = column.getColDef(); const { headerCheckboxSelection } = colDef; let result = false; const newHeaderCheckbox = typeof rowSelection === "object"; if (newHeaderCheckbox) { const isSelectionCol = isColumnSelectionCol(column); const isAutoCol = isColumnGroupAutoCol(column); const location = _getCheckboxLocation(rowSelection); if (location === "autoGroupColumn" && isAutoCol || isSelectionCol && selectionColSvc?.isSelectionColumnEnabled()) { result = _getHeaderCheckbox(rowSelection); } } else if (typeof headerCheckboxSelection === "function") { result = headerCheckboxSelection(_addGridCommonParams(gos, { column, colDef })); } else { result = !!headerCheckboxSelection; } return result; } var BaseSelectionService = class extends BeanStub { postConstruct() { const { gos, beans } = this; this.selectionCtx = new RowRangeSelectionContext(beans.rowModel, beans.pinnedRowModel); this.addManagedPropertyListeners(["isRowSelectable", "rowSelection"], () => { const callback = _getIsRowSelectable(gos); if (callback !== this.isRowSelectable) { this.isRowSelectable = callback; this.updateSelectable(); } }); this.isRowSelectable = _getIsRowSelectable(gos); this.addManagedEventListeners({ cellValueChanged: (e) => this.updateRowSelectable(e.node), rowNodeDataChanged: (e) => this.updateRowSelectable(e.node) }); } destroy() { super.destroy(); this.selectionCtx.reset(); } createCheckboxSelectionComponent() { return new CheckboxSelectionComponent(); } createSelectAllFeature(column) { if (isCheckboxSelection(this.beans, column)) { return new SelectAllFeature(column); } } isMultiSelect() { return _isMultiRowSelection(this.gos); } onRowCtrlSelected(rowCtrl, hasFocusFunc, gui) { const selected = !!rowCtrl.rowNode.isSelected(); rowCtrl.forEachGui(gui, (gui2) => { gui2.rowComp.toggleCss("ag-row-selected", selected); const element = gui2.element; _setAriaSelected(element, selected); const hasFocus = element.contains(_getActiveDomElement(this.beans)); if (hasFocus) { hasFocusFunc(gui2); } }); } announceAriaRowSelection(rowNode) { if (this.isRowSelectionBlocked(rowNode)) { return; } const selected = rowNode.isSelected(); const isEditing2 = this.beans.editSvc?.isEditing({ rowNode }); if (!rowNode.selectable || isEditing2) { return; } const translate = this.getLocaleTextFunc(); const label = translate( selected ? "ariaRowDeselect" : "ariaRowSelect", `Press SPACE to ${selected ? "deselect" : "select"} this row` ); this.beans.ariaAnnounce?.announceValue(label, "rowSelection"); } isRowSelectionBlocked(rowNode) { return !rowNode.selectable || rowNode.rowPinned && !_isManualPinnedRow(rowNode) || !_isRowSelection(this.gos); } updateRowSelectable(rowNode, suppressSelectionUpdate) { const selectable = rowNode.rowPinned && rowNode.pinnedSibling ? ( // If row node is pinned sibling, copy selectable status over from sibling row node rowNode.pinnedSibling.selectable ) : ( // otherwise calculate selectable state directly this.isRowSelectable?.(rowNode) ?? true ); this.setRowSelectable(rowNode, selectable, suppressSelectionUpdate); return selectable; } setRowSelectable(rowNode, newVal, suppressSelectionUpdate) { if (rowNode.selectable !== newVal) { rowNode.selectable = newVal; rowNode.dispatchRowEvent("selectableChanged"); if (suppressSelectionUpdate) { return; } const isGroupSelectsChildren = _getGroupSelectsDescendants(this.gos); if (isGroupSelectsChildren) { const selected = this.calculateSelectedFromChildren(rowNode); this.setNodesSelected({ nodes: [rowNode], newValue: selected ?? false, source: "selectableChanged" }); return; } if (rowNode.isSelected() && !rowNode.selectable) { this.setNodesSelected({ nodes: [rowNode], newValue: false, source: "selectableChanged" }); } } } calculateSelectedFromChildren(rowNode) { let atLeastOneSelected = false; let atLeastOneDeSelected = false; if (!rowNode.childrenAfterGroup?.length) { return rowNode.selectable ? rowNode.__selected : null; } for (let i = 0; i < rowNode.childrenAfterGroup.length; i++) { const child = rowNode.childrenAfterGroup[i]; let childState = child.isSelected(); if (!child.selectable) { const selectable = this.calculateSelectedFromChildren(child); if (selectable === null) { continue; } childState = selectable; } switch (childState) { case true: atLeastOneSelected = true; break; case false: atLeastOneDeSelected = true; break; default: return void 0; } } if (atLeastOneSelected && atLeastOneDeSelected) { return void 0; } if (atLeastOneSelected) { return true; } if (atLeastOneDeSelected) { return false; } if (!rowNode.selectable) { return null; } return rowNode.__selected; } selectRowNode(rowNode, newValue, e, source = "api") { if (newValue && rowNode.destroyed) { return false; } const selectionNotAllowed = !rowNode.selectable && newValue; const selectionNotChanged = rowNode.__selected === newValue; if (selectionNotAllowed || selectionNotChanged) { return false; } rowNode.__selected = newValue; rowNode.dispatchRowEvent("rowSelected"); const sibling = rowNode.sibling; if (sibling && sibling.footer && sibling.__localEventService) { sibling.dispatchRowEvent("rowSelected"); } const pinnedSibling = rowNode.pinnedSibling; if (pinnedSibling?.rowPinned && pinnedSibling.__localEventService) { pinnedSibling.dispatchRowEvent("rowSelected"); } this.eventSvc.dispatchEvent({ ..._createGlobalRowEvent(rowNode, this.gos, "rowSelected"), event: e || null, source }); return true; } isCellCheckboxSelection(column, rowNode) { const so = this.gos.get("rowSelection"); if (so && typeof so !== "string") { const checkbox = isColumnSelectionCol(column) && _getCheckboxes(so); return column.isColumnFunc(rowNode, checkbox); } else { return column.isColumnFunc(rowNode, column.colDef.checkboxSelection); } } inferNodeSelections(node, shiftKey, metaKey, source) { const { gos, selectionCtx } = this; const currentSelection = node.isSelected(); const groupSelectsDescendants = _getGroupSelectsDescendants(gos); const enableClickSelection = _getEnableSelection(gos); const enableDeselection = _getEnableDeselection(gos); const isMultiSelect = this.isMultiSelect(); const isRowClicked = source === "rowClicked"; if (isRowClicked && !(enableClickSelection || enableDeselection)) { return null; } if (shiftKey && metaKey && isMultiSelect) { const root = selectionCtx.getRoot(); if (!root) { return null; } else if (!root.isSelected()) { const partition = selectionCtx.extend(node, groupSelectsDescendants); return { select: [], deselect: partition.keep, reset: false }; } else { const partition = selectionCtx.isInRange(node) ? selectionCtx.truncate(node) : selectionCtx.extend(node, groupSelectsDescendants); return { deselect: partition.discard, select: partition.keep, reset: false }; } } else if (shiftKey && isMultiSelect) { const fallback = selectionCtx.selectAll ? this.beans.rowModel.getRow(0) : void 0; const root = selectionCtx.getRoot(fallback); const partition = selectionCtx.isInRange(node) ? selectionCtx.truncate(node) : selectionCtx.extend(node, groupSelectsDescendants); return { select: partition.keep, deselect: partition.discard, reset: selectionCtx.selectAll || !!(root && !root.isSelected()) }; } else if (metaKey) { if (isRowClicked) { const newValue = !currentSelection; const selectingWhenDisabled = newValue && !enableClickSelection; const deselectingWhenDisabled = !newValue && !enableDeselection; if (selectingWhenDisabled || deselectingWhenDisabled) { return null; } selectionCtx.setRoot(node); return { node, newValue, clearSelection: false }; } selectionCtx.setRoot(node); return { node, newValue: !currentSelection, clearSelection: !isMultiSelect }; } else { selectionCtx.setRoot(node); const enableSelectionWithoutKeys = _getEnableSelectionWithoutKeys(gos); const groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants"; const shouldClear = isRowClicked && (!enableSelectionWithoutKeys || !enableClickSelection); if (groupSelectsFiltered && currentSelection === void 0 && _isClientSideRowModel(gos)) { return { node, newValue: false, checkFilteredNodes: true, clearSelection: !isMultiSelect || shouldClear }; } if (isRowClicked) { const newValue = currentSelection ? !enableSelectionWithoutKeys : enableClickSelection; const selectingWhenDisabled = newValue && !enableClickSelection; const deselectingWhenDisabled = !newValue && !enableDeselection; const wouldStateBeUnchanged = newValue === currentSelection && !shouldClear; if (wouldStateBeUnchanged || selectingWhenDisabled || deselectingWhenDisabled) { return null; } return { node, newValue, clearSelection: !isMultiSelect || shouldClear, keepDescendants: node.group && groupSelectsDescendants }; } return { node, newValue: !currentSelection, clearSelection: !isMultiSelect || shouldClear }; } } }; var SelectionService = class extends BaseSelectionService { constructor() { super(...arguments); this.beanName = "selectionSvc"; this.selectedNodes = /* @__PURE__ */ new Map(); this.detailSelection = /* @__PURE__ */ new Map(); this.masterSelectsDetail = false; } postConstruct() { super.postConstruct(); const { gos } = this; this.mode = _getRowSelectionMode(gos); this.groupSelectsDescendants = _getGroupSelectsDescendants(gos); this.groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants"; this.masterSelectsDetail = _getMasterSelects(gos) === "detail"; this.addManagedPropertyListeners(["groupSelectsChildren", "groupSelectsFiltered", "rowSelection"], () => { const groupSelectsDescendants = _getGroupSelectsDescendants(gos); const selectionMode = _getRowSelectionMode(gos); const groupSelectsFiltered = _getGroupSelection(gos) === "filteredDescendants"; this.masterSelectsDetail = _getMasterSelects(gos) === "detail"; if (groupSelectsDescendants !== this.groupSelectsDescendants || groupSelectsFiltered !== this.groupSelectsFiltered || selectionMode !== this.mode) { this.deselectAllRowNodes({ source: "api" }); this.groupSelectsDescendants = groupSelectsDescendants; this.groupSelectsFiltered = groupSelectsFiltered; this.mode = selectionMode; } }); this.addManagedEventListeners({ rowSelected: this.onRowSelected.bind(this) }); } destroy() { super.destroy(); this.resetNodes(); } handleSelectionEvent(event, rowNode, source) { if (this.isRowSelectionBlocked(rowNode)) { return 0; } const selection = this.inferNodeSelections(rowNode, event.shiftKey, event.metaKey || event.ctrlKey, source); if (selection == null) { return 0; } this.selectionCtx.selectAll = false; if ("select" in selection) { if (selection.reset) { this.resetNodes(); } else { this.selectRange(selection.deselect, false, source); } return this.selectRange(selection.select, true, source); } else { const newValue = selection.checkFilteredNodes ? recursiveCanNodesBeSelected(selection.node) : selection.newValue; return this.setNodesSelected({ nodes: [selection.node], newValue, clearSelection: selection.clearSelection, keepDescendants: selection.keepDescendants, event, source }); } } setNodesSelected({ newValue, clearSelection, suppressFinishActions, nodes, event, source, keepDescendants = false }) { if (nodes.length === 0) { return 0; } const { gos } = this; if (!_isRowSelection(gos) && newValue) { _warn(132); return 0; } if (nodes.length > 1 && !this.isMultiSelect()) { _warn(130); return 0; } let updatedCount = 0; for (let i = 0; i < nodes.length; i++) { const rowNode = nodes[i]; const node = rowNode.primaryRow; if (node.rowPinned && !_isManualPinnedRow(node)) { _warn(59); continue; } if (node.id === void 0) { _warn(60); continue; } if (newValue && rowNode.destroyed) { continue; } const skipThisNode = this.groupSelectsFiltered && node.group && !gos.get("treeData"); if (!skipThisNode) { const thisNodeWasSelected = this.selectRowNode(node, newValue, event, source); if (thisNodeWasSelected) { this.detailSelection.delete(node.id); updatedCount++; } } if (this.groupSelectsDescendants && node.childrenAfterGroup?.length) { updatedCount += this.selectChildren(node, newValue, source); } } if (!suppressFinishActions) { if (nodes.length === 1 && source === "api") { this.selectionCtx.setRoot(nodes[0].primaryRow); } const clearOtherNodes = newValue && (clearSelection || !this.isMultiSelect()); if (clearOtherNodes) { updatedCount += this.clearOtherNodes(nodes[0].primaryRow, keepDescendants, source); } if (updatedCount > 0) { this.updateGroupsFromChildrenSelections(source); this.dispatchSelectionChanged(source); } } return updatedCount; } // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by // holding down 'shift'. selectRange(nodesToSelect, value, source) { let updatedCount = 0; nodesToSelect.forEach((node) => { const rowNode = node.primaryRow; if (rowNode.group && this.groupSelectsDescendants) { return; } const nodeWasSelected = this.selectRowNode(rowNode, value, void 0, source); if (nodeWasSelected) { updatedCount++; } }); if (updatedCount > 0) { this.updateGroupsFromChildrenSelections(source); this.dispatchSelectionChanged(source); } return updatedCount; } selectChildren(node, newValue, source) { const children = this.groupSelectsFiltered ? node.childrenAfterAggFilter : node.childrenAfterGroup; if (!children) { return 0; } return this.setNodesSelected({ newValue, clearSelection: false, suppressFinishActions: true, source, nodes: children }); } getSelectedNodes() { return Array.from(this.selectedNodes.values()); } getSelectedRows() { const selectedRows = []; this.selectedNodes.forEach((rowNode) => rowNode.data && selectedRows.push(rowNode.data)); return selectedRows; } getSelectionCount() { return this.selectedNodes.size; } /** * This method is used by the CSRM to remove groups which are being disposed of, * events do not need fired in this case */ filterFromSelection(predicate) { const newSelectedNodes = /* @__PURE__ */ new Map(); this.selectedNodes.forEach((rowNode, key) => { if (predicate(rowNode)) { newSelectedNodes.set(key, rowNode); } }); this.selectedNodes = newSelectedNodes; } updateGroupsFromChildrenSelections(source, changedPath) { if (!this.groupSelectsDescendants) { return false; } const { gos, rowModel } = this.beans; if (!_isClientSideRowModel(gos, rowModel)) { return false; } const rootNode = rowModel.rootNode; if (!rootNode) { return false; } let selectionChanged = false; const nodeCallback = (rowNode) => { if (rowNode !== rootNode) { const selected = this.calculateSelectedFromChildren(rowNode); selectionChanged = this.selectRowNode(rowNode, selected === null ? false : selected, void 0, source) || selectionChanged; } }; _forEachChangedGroupDepthFirst(rootNode, this.beans.rowModel.hierarchical, changedPath, nodeCallback); return selectionChanged; } clearOtherNodes(rowNodeToKeepSelected, keepDescendants, source) { const groupsToRefresh = /* @__PURE__ */ new Map(); let updatedCount = 0; this.selectedNodes.forEach((otherRowNode) => { const isNodeToKeep = otherRowNode.id == rowNodeToKeepSelected.id; const shouldClearDescendant = keepDescendants ? !isDescendantOf(rowNodeToKeepSelected, otherRowNode) : true; if (shouldClearDescendant && !isNodeToKeep) { const rowNode = this.selectedNodes.get(otherRowNode.id); updatedCount += this.setNodesSelected({ nodes: [rowNode], newValue: false, clearSelection: false, suppressFinishActions: true, source }); if (this.groupSelectsDescendants && otherRowNode.parent) { groupsToRefresh.set(otherRowNode.parent.id, otherRowNode.parent); } } }); groupsToRefresh.forEach((group) => { const selected = this.calculateSelectedFromChildren(group); this.selectRowNode(group, selected === null ? false : selected, void 0, source); }); return updatedCount; } onRowSelected(event) { const rowNode = event.node; if (this.groupSelectsDescendants && rowNode.group) { return; } if (rowNode.isSelected()) { this.selectedNodes.set(rowNode.id, rowNode); } else { this.selectedNodes.delete(rowNode.id); } } syncInRowNode(rowNode, oldNode) { this.syncInOldRowNode(rowNode, oldNode); this.syncInNewRowNode(rowNode); } createDaemonNode(rowNode) { if (!rowNode.id) { return void 0; } const oldNode = new RowNode(this.beans); oldNode.id = rowNode.id; oldNode.data = rowNode.data; oldNode.__selected = rowNode.__selected; oldNode.level = rowNode.level; return oldNode; } // if the id has changed for the node, then this means the rowNode // is getting used for a different data item, which breaks // our selectedNodes, as the node now is mapped by the old id // which is inconsistent. so to keep the old node as selected, // we swap in the clone (with the old id and old data). this means // the oldNode is effectively a daemon we keep a reference to, // so if client calls api.getSelectedNodes(), it gets the daemon // in the result. when the client un-selects, the reference to the // daemon is removed. the daemon, because it's an oldNode, is not // used by the grid for rendering, it's a copy of what the node used // to be like before the id was changed. syncInOldRowNode(rowNode, oldNode) { if (oldNode && rowNode.id !== oldNode.id) { const oldNodeSelected = this.selectedNodes.get(oldNode.id) == rowNode; if (oldNodeSelected) { this.selectedNodes.set(oldNode.id, oldNode); } } } syncInNewRowNode(rowNode) { if (this.selectedNodes.has(rowNode.id)) { rowNode.__selected = true; this.selectedNodes.set(rowNode.id, rowNode); } else { rowNode.__selected = false; } } reset(source) { const selectionCount = this.getSelectionCount(); this.resetNodes(); if (selectionCount) { this.dispatchSelectionChanged(source); } } resetNodes() { this.selectedNodes.forEach((node) => { this.selectRowNode(node, false); }); this.selectedNodes.clear(); } // returns a list of all nodes at 'best cost' - a feature to be used // with groups / trees. if a group has all it's children selected, // then the group appears in the result, but not the children. // Designed for use with 'children' as the group selection type, // where groups don't actually appear in the selection normally. getBestCostNodeSelection() { const { gos, rowModel } = this.beans; if (!_isClientSideRowModel(gos, rowModel)) { return; } const topLevelNodes = rowModel.getTopLevelNodes(); if (topLevelNodes === null) { return; } const result = []; function traverse(nodes) { for (let i = 0, l = nodes.length; i < l; i++) { const node = nodes[i]; if (node.isSelected()) { result.push(node); } else if (node.group && node.childrenAfterGroup) { traverse(node.childrenAfterGroup); } } } traverse(topLevelNodes); return result; } isEmpty() { return this.getSelectionCount() === 0; } deselectAllRowNodes({ source, selectAll: selectAll2 }) { const rowModelClientSide = _isClientSideRowModel(this.gos); let updatedNodes = false; const callback = (rowNode) => { const updated = this.selectRowNode(rowNode.primaryRow, false, void 0, source); updatedNodes || (updatedNodes = updated); }; if (selectAll2 === "currentPage" || selectAll2 === "filtered") { if (!rowModelClientSide) { _error(102); return; } this.getNodesToSelect(selectAll2).forEach(callback); } else { this.selectedNodes.forEach(callback); this.reset(source); } this.selectionCtx.selectAll = false; if (rowModelClientSide && this.groupSelectsDescendants) { const updated = this.updateGroupsFromChildrenSelections(source); updatedNodes || (updatedNodes = updated); } if (updatedNodes) { this.dispatchSelectionChanged(source); } } getSelectedCounts(selectAll2) { let selectedCount = 0; let notSelectedCount = 0; this.getNodesToSelect(selectAll2).forEach((node) => { if (this.groupSelectsDescendants && node.group) { return; } if (node.isSelected()) { selectedCount++; } else if (node.selectable) { notSelectedCount++; } }); return { selectedCount, notSelectedCount }; } getSelectAllState(selectAll2) { const { selectedCount, notSelectedCount } = this.getSelectedCounts(selectAll2); return _calculateSelectAllState(selectedCount, notSelectedCount) ?? null; } hasNodesToSelect(selectAll2) { return this.getNodesToSelect(selectAll2).filter((node) => node.selectable).length > 0; } /** * @param selectAll See `MultiRowSelectionOptions.selectAll` * @returns all nodes including unselectable nodes which are the target of this selection attempt */ getNodesToSelect(selectAll2) { if (!this.canSelectAll()) { return []; } const nodes = []; const addToResult = (node) => nodes.push(node); if (selectAll2 === "currentPage") { this.forEachNodeOnPage((node) => { if (!node.group) { addToResult(node); return; } if (!node.footer && !node.expanded) { const recursivelyAddChildren = (child) => { addToResult(child); const children = child.childrenAfterFilter; if (children) { for (let i = 0, len = children.length; i < len; ++i) { recursivelyAddChildren(children[i]); } } }; recursivelyAddChildren(node); return; } if (!this.groupSelectsDescendants) { addToResult(node); } }); return nodes; } const clientSideRowModel = this.beans.rowModel; if (selectAll2 === "filtered") { clientSideRowModel.forEachNodeAfterFilter(addToResult); return nodes; } clientSideRowModel.forEachNode(addToResult); return nodes; } forEachNodeOnPage(callback) { const { pageBounds, rowModel } = this.beans; const firstRow = pageBounds.getFirstRow(); const lastRow = pageBounds.getLastRow(); for (let i = firstRow; i <= lastRow; i++) { const node = rowModel.getRow(i); if (node) { callback(node); } } } selectAllRowNodes(params) { const { gos, selectionCtx } = this; if (!_isRowSelection(gos)) { _warn(132); return; } if (_isUsingNewRowSelectionAPI(gos) && !_isMultiRowSelection(gos)) { _warn(130); return; } if (!this.canSelectAll()) { return; } const { source, selectAll: selectAll2 } = params; let updatedNodes = false; this.getNodesToSelect(selectAll2).forEach((rowNode) => { const updated = this.selectRowNode(rowNode.primaryRow, true, void 0, source); updatedNodes || (updatedNodes = updated); }); selectionCtx.selectAll = true; if (_isClientSideRowModel(gos) && this.groupSelectsDescendants) { const updated = this.updateGroupsFromChildrenSelections(source); updatedNodes || (updatedNodes = updated); } if (updatedNodes) { this.dispatchSelectionChanged(source); } } getSelectionState() { return this.isEmpty() ? null : Array.from(this.selectedNodes.keys()); } setSelectionState(state, source, clearSelection) { if (!state) { state = []; } if (!Array.isArray(state)) { _error(103); return; } const rowIds = new Set(state); const nodes = []; this.beans.rowModel.forEachNode((node) => { if (rowIds.has(node.id)) { nodes.push(node); } }); if (clearSelection) { this.resetNodes(); } this.setNodesSelected({ newValue: true, nodes, source }); } canSelectAll() { return _isClientSideRowModel(this.beans.gos); } /** * Updates the selectable state for a node by invoking isRowSelectable callback. * If the node is not selectable, it will be deselected. * * Callers: * - property isRowSelectable changed * - after grouping / treeData via `updateSelectableAfterGrouping` */ updateSelectable(changedPath) { const { gos, rowModel } = this.beans; if (!_isRowSelection(gos)) { return; } const source = "selectableChanged"; const isCSRMGroupSelectsDescendants = _isClientSideRowModel(gos) && this.groupSelectsDescendants; const nodesToDeselect = []; if (isCSRMGroupSelectsDescendants) { const rootNode = rowModel.rootNode; if (rootNode) { _forEachChangedGroupDepthFirst(rootNode, rowModel.hierarchical, changedPath, (node) => { let childSelectable = false; for (const child of node.childrenAfterGroup) { childSelectable || (childSelectable = child.selectable); if (!child.group && !this.updateRowSelectable(child, true) && child.isSelected()) { nodesToDeselect.push(child); } } this.setRowSelectable(node, childSelectable, true); }); } } else { rowModel.forEachNode((node) => { if (!this.updateRowSelectable(node, true) && node.isSelected()) { nodesToDeselect.push(node); } }); } if (nodesToDeselect.length) { this.setNodesSelected({ nodes: nodesToDeselect, newValue: false, source }); } if (!changedPath && isCSRMGroupSelectsDescendants) { this.updateGroupsFromChildrenSelections?.(source); } } // only called by CSRM updateSelectableAfterGrouping(changedPath) { this.updateSelectable(changedPath); if (this.groupSelectsDescendants) { const selectionChanged = this.updateGroupsFromChildrenSelections?.("rowGroupChanged", changedPath); if (selectionChanged) { this.dispatchSelectionChanged("rowGroupChanged"); } } } refreshMasterNodeState(node, e) { if (!this.masterSelectsDetail) { return; } const detailApi = node.detailNode?.detailGridInfo?.api; if (!detailApi) { return; } const isSelectAll = _isAllSelected(detailApi); const current = node.isSelected(); if (current !== isSelectAll) { const selectionChanged = this.selectRowNode(node, isSelectAll, e, "masterDetail"); if (selectionChanged) { this.dispatchSelectionChanged("masterDetail"); } } if (!isSelectAll) { this.detailSelection.set(node.id, new Set(detailApi.getSelectedNodes().map((n) => n.id))); } } setDetailSelectionState(masterNode, detailGridOptions, detailApi) { if (!this.masterSelectsDetail) { return; } if (!_isMultiRowSelection(detailGridOptions)) { _warn(269); return; } switch (masterNode.isSelected()) { case true: { detailApi.selectAll(); break; } case false: { detailApi.deselectAll(); break; } case void 0: { const selectedIds = this.detailSelection.get(masterNode.id); if (selectedIds) { const nodes = []; for (const id of selectedIds) { const n = detailApi.getRowNode(id); if (n) { nodes.push(n); } } detailApi.setNodesSelected({ nodes, newValue: true, source: "masterDetail" }); } break; } default: break; } } dispatchSelectionChanged(source) { this.eventSvc.dispatchEvent({ type: "selectionChanged", source, selectedNodes: this.getSelectedNodes(), serverSideState: null }); } }; function _isAllSelected(api) { let selectedCount = 0; let notSelectedCount = 0; api.forEachNode((node) => { if (node.isSelected()) { selectedCount++; } else if (node.selectable) { notSelectedCount++; } }); return _calculateSelectAllState(selectedCount, notSelectedCount); } function _calculateSelectAllState(selected, notSelected) { if (selected === 0 && notSelected === 0) { return false; } if (selected > 0 && notSelected > 0) { return; } return selected > 0; } function isDescendantOf(root, child) { let parent = child.parent; while (parent) { if (parent === root) { return true; } parent = parent.parent; } return false; } function recursiveCanNodesBeSelected(root) { const rootCanBeSelected = root.isSelected() === false; const childrenCanBeSelected = root.childrenAfterFilter?.some(recursiveCanNodesBeSelected) ?? false; return rootCanBeSelected || childrenCanBeSelected; } var SharedRowSelectionModule = { moduleName: "SharedRowSelection", version: VERSION, beans: [SelectionColService], css: [rowSelection_default], apiFunctions: { setNodesSelected, selectAll, deselectAll, selectAllFiltered, deselectAllFiltered, selectAllOnCurrentPage, deselectAllOnCurrentPage, getSelectedNodes, getSelectedRows } }; var RowSelectionModule = { moduleName: "RowSelection", version: VERSION, rowModels: ["clientSide", "infinite", "viewport"], beans: [SelectionService], dependsOn: [SharedRowSelectionModule] }; var CellCustomStyleFeature = class extends BeanStub { constructor(cellCtrl, beans) { super(); this.cellCtrl = cellCtrl; this.staticClasses = []; this.beans = beans; this.column = cellCtrl.column; } setComp(comp) { this.cellComp = comp; this.applyUserStyles(); this.applyCellClassRules(); this.applyClassesFromColDef(); } applyCellClassRules() { const { column, cellComp } = this; const colDef = column.colDef; const cellClassRules = colDef.cellClassRules; const cellClassParams = this.getCellClassParams(column, colDef); processClassRules( this.beans.expressionSvc, // if current was previous, skip cellClassRules === this.cellClassRules ? void 0 : this.cellClassRules, cellClassRules, cellClassParams, (className) => cellComp.toggleCss(className, true), (className) => cellComp.toggleCss(className, false) ); this.cellClassRules = cellClassRules; } applyUserStyles() { const column = this.column; const colDef = column.colDef; const cellStyle = colDef.cellStyle; if (!cellStyle) { return; } let styles; if (typeof cellStyle === "function") { const cellStyleParams = this.getCellClassParams(column, colDef); styles = cellStyle(cellStyleParams); } else { styles = cellStyle; } if (styles) { this.cellComp.setUserStyles(styles); } } applyClassesFromColDef() { const { column, cellComp } = this; const colDef = column.colDef; const cellClassParams = this.getCellClassParams(column, colDef); for (const className of this.staticClasses) { cellComp.toggleCss(className, false); } const newStaticClasses = this.beans.cellStyles.getStaticCellClasses(colDef, cellClassParams); this.staticClasses = newStaticClasses; for (const className of newStaticClasses) { cellComp.toggleCss(className, true); } } getCellClassParams(column, colDef) { const { value, rowNode } = this.cellCtrl; return _addGridCommonParams(this.beans.gos, { value, data: rowNode.data, node: rowNode, colDef, column, rowIndex: rowNode.rowIndex }); } }; var CellStyleService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "cellStyles"; } processAllCellClasses(colDef, params, onApplicableClass, onNotApplicableClass) { processClassRules( this.beans.expressionSvc, void 0, colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass ); this.processStaticCellClasses(colDef, params, onApplicableClass); } getStaticCellClasses(colDef, params) { const { cellClass } = colDef; if (!cellClass) { return []; } let classOrClasses; if (typeof cellClass === "function") { const cellClassFunc = cellClass; classOrClasses = cellClassFunc(params); } else { classOrClasses = cellClass; } if (typeof classOrClasses === "string") { classOrClasses = [classOrClasses]; } return classOrClasses || []; } createCellCustomStyleFeature(ctrl) { return new CellCustomStyleFeature(ctrl, this.beans); } processStaticCellClasses(colDef, params, onApplicableClass) { const classOrClasses = this.getStaticCellClasses(colDef, params); classOrClasses.forEach((cssClassItem) => { onApplicableClass(cssClassItem); }); } }; var CellStyleModule = { moduleName: "CellStyle", version: VERSION, beans: [CellStyleService] }; var RowStyleModule = { moduleName: "RowStyle", version: VERSION, beans: [RowStyleService] }; var INITIAL_GRID_OPTION_KEYS = { enableBrowserTooltips: true, tooltipTrigger: true, tooltipMouseTrack: true, tooltipShowMode: true, tooltipInteraction: true, defaultColGroupDef: true, suppressAutoSize: true, skipHeaderOnAutoSize: true, autoSizeStrategy: true, components: true, stopEditingWhenCellsLoseFocus: true, undoRedoCellEditing: true, undoRedoCellEditingLimit: true, excelStyles: true, cacheQuickFilter: true, customChartThemes: true, chartThemeOverrides: true, chartToolPanelsDef: true, loadingCellRendererSelector: true, localeText: true, keepDetailRows: true, keepDetailRowsCount: true, detailRowHeight: true, detailRowAutoHeight: true, tabIndex: true, valueCache: true, valueCacheNeverExpires: true, enableCellExpressions: true, suppressTouch: true, suppressBrowserResizeObserver: true, suppressPropertyNamesCheck: true, debug: true, dragAndDropImageComponent: true, overlayComponent: true, suppressOverlays: true, loadingOverlayComponent: true, suppressLoadingOverlay: true, noRowsOverlayComponent: true, paginationPageSizeSelector: true, paginateChildRows: true, pivotPanelShow: true, pivotSuppressAutoColumn: true, suppressExpandablePivotGroups: true, aggFuncs: true, allowShowChangeAfterFilter: true, ensureDomOrder: true, enableRtl: true, suppressColumnVirtualisation: true, suppressMaxRenderedRowRestriction: true, suppressRowVirtualisation: true, rowDragText: true, groupLockGroupColumns: true, suppressGroupRowsSticky: true, rowModelType: true, cacheOverflowSize: true, infiniteInitialRowCount: true, serverSideInitialRowCount: true, maxBlocksInCache: true, maxConcurrentDatasourceRequests: true, blockLoadDebounceMillis: true, serverSideOnlyRefreshFilteredGroups: true, serverSidePivotResultFieldSeparator: true, viewportRowModelPageSize: true, viewportRowModelBufferSize: true, debounceVerticalScrollbar: true, suppressAnimationFrame: true, suppressPreventDefaultOnMouseWheel: true, scrollbarWidth: true, icons: true, suppressRowTransform: true, gridId: true, enableGroupEdit: true, initialState: true, processUnpinnedColumns: true, createChartContainer: true, getLocaleText: true, getRowId: true, reactiveCustomComponents: true, renderingMode: true, columnMenu: true, suppressSetFilterByDefault: true, getDataPath: true, enableCellSpan: true, enableFilterHandlers: true, filterHandlers: true }; var clientSide = "clientSide"; var serverSide = "serverSide"; var infinite = "infinite"; var functionRowModels = { onGroupExpandedOrCollapsed: [clientSide], refreshClientSideRowModel: [clientSide], isRowDataEmpty: [clientSide], forEachLeafNode: [clientSide], forEachNodeAfterFilter: [clientSide], forEachNodeAfterFilterAndSort: [clientSide], resetRowHeights: [clientSide, serverSide], applyTransaction: [clientSide], applyTransactionAsync: [clientSide], flushAsyncTransactions: [clientSide], getBestCostNodeSelection: [clientSide], getServerSideSelectionState: [serverSide], setServerSideSelectionState: [serverSide], applyServerSideTransaction: [serverSide], applyServerSideTransactionAsync: [serverSide], applyServerSideRowData: [serverSide], retryServerSideLoads: [serverSide], flushServerSideAsyncTransactions: [serverSide], refreshServerSide: [serverSide], getServerSideGroupLevelState: [serverSide], refreshInfiniteCache: [infinite], purgeInfiniteCache: [infinite], getInfiniteRowCount: [infinite], isLastRowIndexKnown: [infinite, serverSide], expandAll: [clientSide, serverSide], collapseAll: [clientSide, serverSide], onRowHeightChanged: [clientSide, serverSide], setRowCount: [infinite, serverSide], getCacheBlockState: [infinite, serverSide] }; var deprecatedFunctions = { showLoadingOverlay: { version: "v32", message: '`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).' }, clearRangeSelection: { version: "v32.2", message: "Use `clearCellSelection` instead." }, getInfiniteRowCount: { version: "v32.2", old: "getInfiniteRowCount()", new: "getDisplayedRowCount()" }, selectAllFiltered: { version: "v33", old: "selectAllFiltered()", new: 'selectAll("filtered")' }, deselectAllFiltered: { version: "v33", old: "deselectAllFiltered()", new: 'deselectAll("filtered")' }, selectAllOnCurrentPage: { version: "v33", old: "selectAllOnCurrentPage()", new: 'selectAll("currentPage")' }, deselectAllOnCurrentPage: { version: "v33", old: "deselectAllOnCurrentPage()", new: 'deselectAll("currentPage")' } }; function validateApiFunction(functionName, apiFunction, beans) { const deprecation = deprecatedFunctions[functionName]; if (deprecation) { const { version, new: replacement, old, message } = deprecation; const apiMethod = old ?? functionName; return (...args) => { const replacementMessage = replacement ? `Please use ${replacement} instead. ` : ""; _warnOnce(`Since ${version} api.${apiMethod} is deprecated. ${replacementMessage}${message ?? ""}`); return apiFunction.apply(apiFunction, args); }; } const rowModels = functionRowModels[functionName]; if (rowModels) { return (...args) => { const rowModel = beans.rowModel.getType(); if (!rowModels.includes(rowModel)) { _errorOnce( `api.${functionName} can only be called when gridOptions.rowModelType is ${rowModels.join(" or ")}` ); return void 0; } return apiFunction.apply(apiFunction, args); }; } return apiFunction; } var DYNAMIC_BEAN_MODULES = { detailCellRendererCtrl: "SharedMasterDetail", dndSourceComp: "DragAndDrop", fillHandle: "CellSelection", groupCellRendererCtrl: "GroupCellRenderer", headerFilterCellCtrl: "ColumnFilter", headerGroupCellCtrl: "ColumnGroup", rangeHandle: "CellSelection", tooltipFeature: "Tooltip", highlightTooltipFeature: "Tooltip", tooltipStateManager: "Tooltip", groupStrategy: "RowGrouping", treeGroupStrategy: "TreeData", rowNumberRowResizer: "RowNumbers", singleCell: "EditCore", fullRow: "EditCore", agSetColumnFilterHandler: "SetFilter", agMultiColumnFilterHandler: "MultiFilter", agGroupColumnFilterHandler: "GroupFilter", agNumberColumnFilterHandler: "NumberFilter", agBigIntColumnFilterHandler: "BigIntFilter", agDateColumnFilterHandler: "DateFilter", agTextColumnFilterHandler: "TextFilter" }; var ICON_VALUES = { expanded: 1, contracted: 1, "tree-closed": 1, "tree-open": 1, "tree-indeterminate": 1, pin: 1, "eye-slash": 1, arrows: 1, left: 1, right: 1, group: 1, aggregation: 1, pivot: 1, "not-allowed": 1, chart: 1, cross: 1, cancel: 1, tick: 1, first: 1, previous: 1, next: 1, last: 1, linked: 1, unlinked: 1, "color-picker": 1, loading: 1, menu: 1, "menu-alt": 1, filter: 1, "filter-add": 1, columns: 1, maximize: 1, minimize: 1, copy: 1, cut: 1, paste: 1, grip: 1, save: 1, csv: 1, excel: 1, "small-down": 1, "small-left": 1, "small-right": 1, "small-up": 1, asc: 1, desc: 1, aasc: 1, adesc: 1, none: 1, up: 1, down: 1, plus: 1, minus: 1, settings: 1, "checkbox-checked": 1, "checkbox-indeterminate": 1, "checkbox-unchecked": 1, "radio-button-on": 1, "radio-button-off": 1, eye: 1, "column-arrow": 1, "un-pin": 1, "pinned-top": 1, "pinned-bottom": 1, "chevron-up": 1, "chevron-down": 1, "chevron-left": 1, "chevron-right": 1, edit: 1 }; var ICON_MODULES = { chart: "MenuCore", cancel: "EnterpriseCore", first: "Pagination", previous: "Pagination", next: "Pagination", last: "Pagination", linked: "IntegratedCharts", loadingMenuItems: "MenuCore", unlinked: "IntegratedCharts", menu: "ColumnHeaderComp", legacyMenu: "ColumnMenu", filter: "ColumnFilter", filterActive: "ColumnFilter", filterAdd: "NewFiltersToolPanel", filterCardCollapse: "NewFiltersToolPanel", filterCardExpand: "NewFiltersToolPanel", filterCardEditing: "NewFiltersToolPanel", filterTab: "ColumnMenu", filtersToolPanel: "FiltersToolPanel", columns: ["MenuCore"], columnsToolPanel: ["ColumnsToolPanel"], maximize: "EnterpriseCore", minimize: "EnterpriseCore", save: "MenuCore", columnGroupOpened: "ColumnGroupHeaderComp", columnGroupClosed: "ColumnGroupHeaderComp", accordionOpen: "EnterpriseCore", accordionClosed: "EnterpriseCore", accordionIndeterminate: "EnterpriseCore", columnSelectClosed: ["ColumnsToolPanel", "ColumnMenu"], columnSelectOpen: ["ColumnsToolPanel", "ColumnMenu"], columnSelectIndeterminate: ["ColumnsToolPanel", "ColumnMenu"], columnMovePin: "SharedDragAndDrop", columnMoveHide: "SharedDragAndDrop", columnMoveMove: "SharedDragAndDrop", columnMoveLeft: "SharedDragAndDrop", columnMoveRight: "SharedDragAndDrop", columnMoveGroup: "SharedDragAndDrop", columnMoveValue: "SharedDragAndDrop", columnMovePivot: "SharedDragAndDrop", dropNotAllowed: "SharedDragAndDrop", ensureColumnVisible: ["ColumnsToolPanel", "ColumnMenu"], groupContracted: "GroupCellRenderer", groupExpanded: "GroupCellRenderer", setFilterGroupClosed: "SetFilter", setFilterGroupOpen: "SetFilter", setFilterGroupIndeterminate: "SetFilter", setFilterLoading: "SetFilter", close: "EnterpriseCore", check: "MenuItem", colorPicker: "CommunityCore", groupLoading: "LoadingCellRenderer", overlayLoading: "Overlay", overlayExporting: "Overlay", menuAlt: "ColumnHeaderComp", menuPin: "MenuCore", menuValue: "MenuCore", menuAddRowGroup: ["MenuCore", "ColumnsToolPanel"], menuRemoveRowGroup: ["MenuCore", "ColumnsToolPanel"], clipboardCopy: "MenuCore", clipboardCut: "MenuCore", clipboardPaste: "MenuCore", pivotPanel: ["ColumnsToolPanel", "RowGroupingPanel"], rowGroupPanel: ["ColumnsToolPanel", "RowGroupingPanel"], valuePanel: "ColumnsToolPanel", columnDrag: "EnterpriseCore", rowDrag: ["RowDrag", "DragAndDrop"], csvExport: "MenuCore", excelExport: "MenuCore", smallDown: "CommunityCore", selectOpen: "CommunityCore", richSelectOpen: "RichSelect", richSelectRemove: "RichSelect", richSelectLoading: "RichSelect", smallLeft: "CommunityCore", smallRight: "CommunityCore", subMenuOpen: "MenuItem", subMenuOpenRtl: "MenuItem", panelDelimiter: "RowGroupingPanel", panelDelimiterRtl: "RowGroupingPanel", smallUp: "CommunityCore", sortAscending: ["MenuCore", "Sort"], sortDescending: ["MenuCore", "Sort"], sortAbsoluteAscending: ["MenuCore", "Sort"], sortAbsoluteDescending: ["MenuCore", "Sort"], sortUnSort: ["MenuCore", "Sort"], advancedFilterBuilder: "AdvancedFilter", advancedFilterBuilderDrag: "AdvancedFilter", advancedFilterBuilderInvalid: "AdvancedFilter", advancedFilterBuilderMoveUp: "AdvancedFilter", advancedFilterBuilderMoveDown: "AdvancedFilter", advancedFilterBuilderAdd: "AdvancedFilter", advancedFilterBuilderRemove: "AdvancedFilter", advancedFilterBuilderSelectOpen: "AdvancedFilter", chartsMenu: "IntegratedCharts", chartsMenuEdit: "IntegratedCharts", chartsMenuAdvancedSettings: "IntegratedCharts", chartsMenuAdd: "IntegratedCharts", chartsColorPicker: "IntegratedCharts", chartsThemePrevious: "IntegratedCharts", chartsThemeNext: "IntegratedCharts", chartsDownload: "IntegratedCharts", checkboxChecked: "CommunityCore", checkboxIndeterminate: "CommunityCore", checkboxUnchecked: "CommunityCore", radioButtonOn: "CommunityCore", radioButtonOff: "CommunityCore", rowPin: "PinnedRow", rowUnpin: "PinnedRow", rowPinBottom: "PinnedRow", rowPinTop: "PinnedRow" }; var DEPRECATED_ICONS_V33 = /* @__PURE__ */ new Set([ "colorPicker", "smallUp", "checkboxChecked", "checkboxIndeterminate", "checkboxUnchecked", "radioButtonOn", "radioButtonOff", "smallDown", "smallLeft", "smallRight" ]); var ValidationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "validation"; } wireBeans(beans) { this.gridOptions = beans.gridOptions; provideValidationServiceLogger(getError); } warnOnInitialPropertyUpdate(source, key) { if (source === "api" && INITIAL_GRID_OPTION_KEYS[key]) { _warn(22, { key }); } } processGridOptions(options) { this.processOptions(options, GRID_OPTIONS_VALIDATORS()); } validateApiFunction(functionName, apiFunction) { return validateApiFunction(functionName, apiFunction, this.beans); } missingUserComponent(propertyName, componentName, agGridDefaults, jsComps) { const moduleForComponent = USER_COMP_MODULES[componentName]; if (moduleForComponent) { this.gos.assertModuleRegistered( moduleForComponent, `AG Grid '${propertyName}' component: ${componentName}` ); } else { _warn(101, { propertyName, componentName, agGridDefaults, jsComps }); } } missingDynamicBean(beanName) { const moduleName4 = DYNAMIC_BEAN_MODULES[beanName]; return moduleName4 ? _errMsg(200, { ...this.gos.getModuleErrorParams(), moduleName: moduleName4, reasonOrId: beanName }) : void 0; } checkRowEvents(eventType) { if (DEPRECATED_ROW_NODE_EVENTS.has(eventType)) { _warn(10, { eventType }); } } validateIcon(iconName) { if (DEPRECATED_ICONS_V33.has(iconName)) { _warn(43, { iconName }); } if (ICON_VALUES[iconName]) { return; } const moduleName4 = ICON_MODULES[iconName]; if (moduleName4) { _error(200, { reasonOrId: `icon '${iconName}'`, moduleName: moduleName4, gridScoped: _areModulesGridScoped(), gridId: this.beans.context.getId(), rowModelType: this.gos.get("rowModelType"), additionalText: "Alternatively, use the CSS icon name directly." }); return; } _warn(134, { iconName }); } isProvidedUserComp(compName) { return !!USER_COMP_MODULES[compName]; } /** Should only be called via the GridOptionsService */ validateColDef(colDef) { this.processOptions(colDef, COL_DEF_VALIDATORS()); } processOptions(options, validator) { const { validations, deprecations, allProperties, propertyExceptions, objectName, docsUrl } = validator; if (allProperties && this.gridOptions.suppressPropertyNamesCheck !== true) { this.checkProperties( options, [...propertyExceptions ?? [], ...Object.keys(deprecations)], allProperties, objectName, docsUrl ); } const warnings = /* @__PURE__ */ new Set(); const optionKeys = Object.keys(options); optionKeys.forEach((key) => { const deprecation = deprecations[key]; if (deprecation) { const { message, version } = deprecation; warnings.add(`As of v${version}, ${String(key)} is deprecated. ${message ?? ""}`); } const value = options[key]; if (value == null || value === false) { return; } const rules = validations[key]; if (!rules) { return; } const { dependencies, validate, supportedRowModels, expectedType } = rules; if (expectedType) { const actualType = typeof value; if (actualType !== expectedType) { warnings.add( `${String(key)} should be of type '${expectedType}' but received '${actualType}' (${value}).` ); return; } } if (supportedRowModels) { const rowModel = this.gridOptions.rowModelType ?? "clientSide"; if (!supportedRowModels.includes(rowModel)) { warnings.add( `${String(key)} is not supported with the '${rowModel}' row model. It is only valid with: ${supportedRowModels.join(", ")}.` ); return; } } if (dependencies) { const warning = this.checkForRequiredDependencies(key, dependencies, options); if (warning) { warnings.add(warning); return; } } if (validate) { const warning = validate(options, this.gridOptions, this.beans); if (warning) { warnings.add(warning); return; } } }); if (warnings.size > 0) { for (const warning of warnings) { _warnOnce(warning); } } } checkForRequiredDependencies(key, validator, options) { const optionEntries = Object.entries(validator); const failedOptions = optionEntries.filter(([key2, value]) => { const gridOptionValue = options[key2]; return !value.required.includes(gridOptionValue); }); if (failedOptions.length === 0) { return null; } return failedOptions.map( ([failedKey, possibleOptions]) => `'${String(key)}' requires '${failedKey}' to be one of [${possibleOptions.required.map((o) => { if (o === null) { return "null"; } else if (o === void 0) { return "undefined"; } return o; }).join(", ")}]. ${possibleOptions.reason ?? ""}` ).join("\n "); } checkProperties(object, exceptions, validProperties, containerName, docsUrl) { const VUE_FRAMEWORK_PROPS = ["__ob__", "__v_skip", "__metadata__"]; const invalidProperties = _fuzzyCheckStrings( Object.getOwnPropertyNames(object), [...VUE_FRAMEWORK_PROPS, ...exceptions, ...validProperties], validProperties ); const invalidPropertiesKeys = Object.keys(invalidProperties); for (const key of invalidPropertiesKeys) { const value = invalidProperties[key]; let message = `invalid ${containerName} property '${key}' did you mean any of these: ${value.slice(0, 8).join(", ")}.`; if (validProperties.includes("context")) { message += ` If you are trying to annotate ${containerName} with application data, use the '${containerName}.context' property instead.`; } _warnOnce(message); } if (invalidPropertiesKeys.length > 0 && docsUrl) { const url = this.beans.frameworkOverrides.getDocLink(docsUrl); _warnOnce(`to see all the valid ${containerName} properties please check: ${url}`); } } }; function _fuzzyCheckStrings(inputValues, validValues, allSuggestions) { const fuzzyMatches = {}; const invalidInputs = inputValues.filter( (inputValue) => !validValues.some((validValue) => validValue === inputValue) ); if (invalidInputs.length > 0) { for (const invalidInput of invalidInputs) { fuzzyMatches[invalidInput] = _fuzzySuggestions({ inputValue: invalidInput, allSuggestions }).values; } } return fuzzyMatches; } var DEPRECATED_ROW_NODE_EVENTS = /* @__PURE__ */ new Set([ "firstChildChanged", "lastChildChanged", "childIndexChanged" ]); var ValidationModule = { moduleName: "Validation", version: VERSION, beans: [ValidationService] }; var AllCommunityModule = { moduleName: "AllCommunity", version: VERSION, dependsOn: [ ClientSideRowModelModule, CsvExportModule, InfiniteRowModelModule, ValidationModule, TextEditorModule, NumberEditorModule, DateEditorModule, CheckboxEditorModule, SelectEditorModule, LargeTextEditorModule, CustomEditorModule, UndoRedoEditModule, TextFilterModule, NumberFilterModule, BigIntFilterModule, DateFilterModule, CustomFilterModule, QuickFilterModule, ExternalFilterModule, GridStateModule, AlignedGridsModule, PaginationModule, ColumnApiModule, RowApiModule, ScrollApiModule, RenderApiModule, ColumnAutoSizeModule, RowDragModule, PinnedRowModule, RowSelectionModule, ValueCacheModule, CellStyleModule, ColumnHoverModule, RowStyleModule, EventApiModule, CellApiModule, HighlightChangesModule, TooltipModule, LocaleModule, RowAutoHeightModule, DragAndDropModule, ClientSideRowModelApiModule, CellSpanModule ] }; function formatTestId(name, attributes = {}) { const params = Object.keys(attributes).map((k) => { const v = attributes[k]; return v != null ? `${k}=${v}` : null; }).filter(Boolean).join(";"); return [name, params].filter((s2) => s2.length > 0).join(":"); } var agTestIdFor = { grid(gridId) { return formatTestId("ag-grid-root", { gridId }); }, /** Headers */ headerGroupCell(colId) { return formatTestId("ag-header-group-cell", { colId }); }, headerCell(colId) { return formatTestId("ag-header-cell", { colId }); }, headerCheckbox(colId) { return formatTestId("ag-header-selection-checkbox", { colId }); }, headerFilterButton(colId) { return formatTestId("ag-header-cell-filter-button", { colId }); }, floatingFilter(colId) { return formatTestId("ag-floating-filter", { colId }); }, floatingFilterButton(colId) { return formatTestId("ag-floating-filter-button", { colId }); }, headerCellMenuButton(colId) { return formatTestId("ag-header-cell-menu-button", { colId }); }, headerResizeHandle(colId) { return formatTestId("ag-header-cell-resize", { colId }); }, /** Column Filters */ filterInstancePickerDisplay(spec) { return formatTestId(`ag-${spec.source}-picker-display`, prepFilterSpec(spec)); }, numberFilterInstanceInput(spec) { return formatTestId(`ag-${spec.source}-number-input`, prepFilterSpec(spec)); }, textFilterInstanceInput(spec) { return formatTestId(`ag-${spec.source}-text-input`, prepFilterSpec(spec)); }, dateFilterInstanceInput(spec) { return formatTestId(`ag-${spec.source}-date-input`, prepFilterSpec(spec)); }, setFilterInstanceMiniFilterInput(spec) { return formatTestId( `ag-${spec.source}-set-filter-mini-filter-input`, spec.source === "filter-toolpanel" ? { label: spec.colLabel } : { colId: spec.colId } ); }, setFilterInstanceItem(spec, itemLabel) { return formatTestId( `ag-${spec.source}-set-filter-item`, spec.source === "filter-toolpanel" ? { colLabel: spec.colLabel, itemLabel } : { colId: spec.colId, itemLabel } ); }, setFilterApplyPanelButton(spec, buttonLabel) { return formatTestId( `ag-${spec.source}-set-filter-apply-panel-button`, spec.source === "filter-toolpanel" ? { colLabel: spec.colLabel, buttonLabel } : { colId: spec.colId, buttonLabel } ); }, filterConditionRadioButton(spec, buttonLabel) { return formatTestId( `ag-${spec.source}-filter-condition-radio-button`, spec.source === "filter-toolpanel" ? { colLabel: spec.colLabel, buttonLabel } : { colId: spec.colId, buttonLabel } ); }, /** Advanced Filter */ advancedFilterInput() { return formatTestId("ag-advanced-filter-input"); }, advancedFilterButton(label) { return formatTestId("ag-advanced-filter-button", { label }); }, advancedFilterBuilderButton() { return formatTestId("ag-advanced-filter-builder-button"); }, advancedFilterPanelMaximiseButton() { return formatTestId("ag-advanced-filter-builder-panel-maximise"); }, advancedFilterPanelCloseButton() { return formatTestId("ag-advanced-filter-builder-panel-close"); }, advancedFilterPill(label) { return formatTestId("ag-advanced-filter-builder-pill", { label }); }, advancedFilterBuilderAddItemButton() { return formatTestId("ag-advanced-filter-builder-add-item-button"); }, /** Rows */ rowNode(rowId) { return formatTestId("ag-row", { ["row-id"]: rowId }); }, /** Cells */ cell(rowId, colId) { return formatTestId("ag-cell", { ["row-id"]: rowId, colId }); }, autoGroupCell(rowId) { return agTestIdFor.cell(rowId, GROUP_AUTO_COLUMN_ID); }, checkbox(rowId, colId) { return formatTestId("ag-selection-checkbox", { ["row-id"]: rowId, colId }); }, selectionColumnCheckbox(rowId) { return agTestIdFor.checkbox(rowId, SELECTION_COLUMN_ID); }, autoGroupColumnCheckbox(rowId) { return agTestIdFor.checkbox(rowId, GROUP_AUTO_COLUMN_ID); }, dragHandle(rowId, colId) { return formatTestId("ag-drag-handle", { ["row-id"]: rowId, colId }); }, groupContracted(rowId, colId) { return formatTestId("ag-group-contracted", { ["row-id"]: rowId, colId }); }, groupExpanded(rowId, colId) { return formatTestId("ag-group-expanded", { ["row-id"]: rowId, colId }); }, autoGroupContracted(rowId) { return agTestIdFor.groupContracted(rowId, GROUP_AUTO_COLUMN_ID); }, autoGroupExpanded(rowId) { return agTestIdFor.groupExpanded(rowId, GROUP_AUTO_COLUMN_ID); }, rowNumber(rowId) { return agTestIdFor.cell(rowId, ROW_NUMBERS_COLUMN_ID); }, /** Menu */ menu() { return formatTestId("ag-menu"); }, menuOption(option) { return formatTestId("ag-menu-option", { ["option"]: option }); }, /** SideBar */ sideBar() { return formatTestId("ag-side-bar"); }, sideBarButton(label) { return formatTestId("ag-side-button", { label }); }, /** Column Tool Panel */ columnToolPanel() { return formatTestId("ag-column-panel"); }, pivotModeSelect() { return formatTestId("ag-pivot-mode-select"); }, columnPanelSelectHeaderCheckbox() { return formatTestId("ag-column-panel-select-header-checkbox"); }, columnPanelSelectHeaderFilter() { return formatTestId("ag-column-panel-select-header-filter"); }, columnSelectListItemGroupClosedIcon(label) { return formatTestId("ag-column-select-list-item-group-closed-icon", { label }); }, columnSelectListItemCheckbox(label) { return formatTestId("ag-column-select-list-item-checkbox", { label }); }, columnSelectListItemDragHandle(label) { return formatTestId("ag-column-select-list-item-drag-handle", { label }); }, columnDropCellDragHandle(source, area, label) { return formatTestId("ag-column-drop-cell-drag-handle", { source, area, label }); }, columnDropCellCancelButton(source, area, label) { return formatTestId("ag-column-drop-cell-cancel", { source, area, label }); }, columnDropArea(source, name) { return formatTestId("ag-column-drop-area", { source, name }); }, /** Filter Tool Panel (New) */ filterToolPanel() { return formatTestId("ag-filter-panel"); }, filterToolPanelAddFilterButton() { return formatTestId("ag-filter-panel-add-filter-button"); }, filterToolPanelFilterTypeSelector(colLabel) { return formatTestId("ag-filter-panel-filter-type-selector", { colLabel }); }, /** Filter Tool Panel (Old) */ filterToolPanelSearchInput() { return formatTestId("ag-filter-toolpanel-search-input"); }, filterToolPanelGroup(title) { return formatTestId("ag-filter-toolpanel-group", { title }); }, filterToolPanelGroupCollapsedIcon(title) { return formatTestId("ag-filter-toolpanel-group-collapsed-icon", { title }); }, /** Status Bar */ statusBarTotalAndFilteredRowCount() { return formatTestId("ag-status-bar-total-and-filtered-row-count"); }, statusBarTotalRowCount() { return formatTestId("ag-status-bar-total-row-count"); }, statusBarFilteredRowCount() { return formatTestId("ag-status-bar-filtered-row-count"); }, statusBarSelectedRowCount() { return formatTestId("ag-status-bar-selected-row-count"); }, statusBarAggregations() { return formatTestId("ag-status-bar-aggregations"); }, /** Pagination */ paginationPanelSizePickerDisplay(value) { return formatTestId("ag-pagination-page-size-picker-field-display", { value }); }, paginationPanelFirstRowOnPage(value) { return formatTestId("ag-paging-row-summary-panel-first-row-on-page", { value }); }, paginationPanelLastRowOnPage(value) { return formatTestId("ag-paging-row-summary-panel-last-row-on-page", { value }); }, paginationPanelRecordCount(value) { return formatTestId("ag-paging-row-summary-panel-record-count", { value }); }, paginationSummaryPanelButton(label) { return formatTestId("ag-paging-page-summary-panel-btn", { label }); }, paginationSummaryPanelCurrentPage(value) { return formatTestId("ag-paging-page-summary-panel-current-page", { value }); }, paginationSummaryPanelTotalPage(value) { return formatTestId("ag-paging-page-summary-panel-total-page", { value }); }, /** Fill Handle */ fillHandle() { return formatTestId("ag-fill-handle"); }, /** Column Chooser */ columnChooserCloseButton() { return formatTestId("ag-column-chooser-close-button"); }, columnChooserSearchBarCheckbox() { return formatTestId("ag-column-chooser-header-checkbox"); }, columnChooserSearchBarFilter() { return formatTestId("ag-column-chooser-searchbar-filter"); }, columnChooserListItemGroupClosedIcon(label) { return formatTestId("ag-column-chooser-list-item-group-closed-icon", { label }); }, columnChooserListItemCheckbox(label) { return formatTestId("ag-column-chooser-list-item-checkbox", { label }); }, columnChooserListItemDragHandle(label) { return formatTestId("ag-column-chooser-list-item-drag-handle", { label }); }, /** Overlay */ overlay() { return formatTestId("ag-overlay"); } }; var wrapAgTestIdFor = (fn) => { const locators = {}; const keys = Object.keys(agTestIdFor); for (const k of keys) { locators[k] = (...args) => { return fn(agTestIdFor[k](...args)); }; } return locators; }; function mapKeys(obj, keys) { const result = {}; for (const k of Object.keys(obj)) { if (keys[k] !== null) { result[keys[k] ?? k] = obj[k]; } } return result; } function applySpecDefaults(obj) { return obj.source !== "floating-filter" ? { index: 0, ...obj } : obj; } function prepFilterSpec(obj) { return mapKeys(applySpecDefaults(obj), { colLabel: "label" }); } var TEST_ID_ATTR = "data-testid"; function setTestId(element, testId) { element?.setAttribute(TEST_ID_ATTR, testId); } function setTestIdAttribute(attr) { TEST_ID_ATTR = attr; } var TestIdService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "testIdSvc"; } postConstruct() { const delayedDebounce = _debounce(this, () => this.setupAllTestIds(), 500); const setup = _debounce( this, () => { this.setupAllTestIds(); delayedDebounce(); }, 0 ); this.addManagedEventListeners({ firstDataRendered: setup, displayedRowsChanged: setup, displayedColumnsChanged: setup, displayedColumnsWidthChanged: setup, virtualColumnsChanged: setup, columnMenuVisibleChanged: setup, contextMenuVisibleChanged: setup, advancedFilterBuilderVisibleChanged: setup, fieldPickerValueSelected: setup, modelUpdated: setup, sideBarUpdated: setup, pinnedHeightChanged: setup, gridReady: setup, overlayExclusiveChanged: setup, rowGroupOpened: setup, scrollVisibilityChanged: setup, gridSizeChanged: setup, filterOpened: setup, filterChanged: setup, cellSelectionChanged: setup }); } setupAllTestIds() { const root = _getRootNode(this.beans); const gridId = getGridId(this.beans); const gridWrapper = root.querySelector(`[grid-id="${gridId}"]`); setTestId(gridWrapper, agTestIdFor.grid(gridId)); root.querySelectorAll(".ag-header-group-cell").forEach((groupCell) => { setTestId(groupCell, agTestIdFor.headerGroupCell(groupCell.getAttribute("col-id"))); }); root.querySelectorAll(".ag-header-cell").forEach((cell) => { const colId = cell.getAttribute("col-id"); const isFloatingFilter = cell.classList.contains("ag-floating-filter"); const headerCellId = isFloatingFilter ? agTestIdFor.floatingFilter(colId) : agTestIdFor.headerCell(colId); setTestId(cell, headerCellId); setTestId(cell.querySelector(".ag-header-cell-filter-button"), agTestIdFor.headerFilterButton(colId)); setTestId(cell.querySelector(".ag-header-cell-menu-button"), agTestIdFor.headerCellMenuButton(colId)); setTestId(cell.querySelector(".ag-header-cell-resize"), agTestIdFor.headerResizeHandle(colId)); setTestId(cell.querySelector(".ag-checkbox input[type=checkbox]"), agTestIdFor.headerCheckbox(colId)); setTestId(cell.querySelector(".ag-floating-filter-button button"), agTestIdFor.floatingFilterButton(colId)); this.setupFilterInstance(cell.querySelector(".ag-floating-filter-body"), { source: "floating-filter", colId }); }); const filterMenu = root.querySelector(".ag-filter-menu"); this.setupFilterInstance(filterMenu, { source: "column-filter" }); setTestId(root.querySelector(".ag-advanced-filter input[type=text]"), agTestIdFor.advancedFilterInput()); root.querySelectorAll(".ag-advanced-filter-buttons button").forEach((button) => { setTestId(button, agTestIdFor.advancedFilterButton(button.textContent)); }); setTestId( root.querySelector("button.ag-advanced-filter-builder-button"), agTestIdFor.advancedFilterBuilderButton() ); root.querySelectorAll('.ag-panel[aria-label="Advanced Filter"] .ag-panel-title-bar-button').forEach( (button, i) => { setTestId( button, i === 0 ? agTestIdFor.advancedFilterPanelMaximiseButton() : agTestIdFor.advancedFilterPanelCloseButton() ); } ); root.querySelectorAll('.ag-panel[aria-lable="Advanced Filter"] .ag-advanced-filter-builder-pill').forEach( (pill) => { setTestId( pill, agTestIdFor.advancedFilterPill(pill.querySelector(".ag-picker-field-display")?.textContent) ); } ); setTestId( root.querySelector('.ag-panel[aria-label="Advanced Filter"] .ag-advanced-filter-builder-item-button'), agTestIdFor.advancedFilterBuilderAddItemButton() ); root.querySelectorAll(".ag-row").forEach((row) => { const rowId = row.getAttribute("row-id"); setTestId(row, agTestIdFor.rowNode(rowId)); row.querySelectorAll(".ag-cell").forEach((cell) => { const colId = cell.getAttribute("col-id"); setTestId(cell, agTestIdFor.cell(rowId, colId)); setTestId( cell.querySelector(".ag-selection-checkbox input[type=checkbox]"), agTestIdFor.checkbox(rowId, colId) ); setTestId(cell.querySelector(".ag-drag-handle"), agTestIdFor.dragHandle(rowId, colId)); setTestId(cell.querySelector(".ag-group-contracted"), agTestIdFor.groupContracted(rowId, colId)); setTestId(cell.querySelector(".ag-group-expanded"), agTestIdFor.groupExpanded(rowId, colId)); }); }); root.querySelectorAll(".ag-menu-list").forEach((menu) => { setTestId(menu, agTestIdFor.menu()); menu.querySelectorAll(".ag-menu-option").forEach((option) => { setTestId(option, agTestIdFor.menuOption(option.querySelector(".ag-menu-option-text")?.textContent)); }); }); root.querySelectorAll(".ag-side-bar").forEach((sideBar) => { setTestId(sideBar, agTestIdFor.sideBar()); sideBar.querySelectorAll(".ag-side-button button").forEach((button) => { setTestId( button, agTestIdFor.sideBarButton(button.querySelector(".ag-side-button-label")?.textContent) ); }); sideBar.querySelectorAll(".ag-column-panel").forEach((panel) => { setTestId(panel, agTestIdFor.columnToolPanel()); setTestId( panel.querySelector(".ag-pivot-mode-select input[type=checkbox]"), agTestIdFor.pivotModeSelect() ); setTestId( panel.querySelector(".ag-column-select-header-checkbox input[type=checkbox]"), agTestIdFor.columnPanelSelectHeaderCheckbox() ); setTestId( panel.querySelector(".ag-column-select-header-filter-wrapper input[type=text]"), agTestIdFor.columnPanelSelectHeaderFilter() ); panel.querySelectorAll(".ag-column-select-list").forEach((list) => { list.querySelectorAll(".ag-column-select-virtual-list-item").forEach((item) => { const label = item.getAttribute("aria-label"); setTestId( item.querySelector(".ag-column-group-closed-icon"), agTestIdFor.columnSelectListItemGroupClosedIcon(label) ); setTestId( item.querySelector(".ag-column-select-checkbox input[type=checkbox]"), agTestIdFor.columnSelectListItemCheckbox(label) ); setTestId( item.querySelector(".ag-drag-handle"), agTestIdFor.columnSelectListItemDragHandle(label) ); }); }); this.setupColumnDropArea(panel, "toolbar"); }); sideBar.querySelectorAll(".ag-filter-panel").forEach((panel) => { setTestId(panel, agTestIdFor.filterToolPanel()); setTestId( panel.querySelector("button.ag-filter-add-button"), agTestIdFor.filterToolPanelAddFilterButton() ); panel.querySelectorAll(".ag-filter-card").forEach((filterCard) => { const colLabel = filterCard.querySelector(".ag-filter-card-title")?.textContent; const typeSelector = filterCard.querySelector(".ag-filter-type-select"); setTestId(typeSelector, agTestIdFor.filterToolPanelFilterTypeSelector(colLabel)); filterCard.querySelectorAll(".ag-filter").forEach( (filter) => this.setupFilterInstance(filter, { source: "filter-toolpanel", colLabel }) ); }); }); sideBar.querySelectorAll(".ag-filter-toolpanel").forEach((panel) => { setTestId( panel.querySelector(".ag-filter-toolpanel-search-input input[type=text]"), agTestIdFor.filterToolPanelSearchInput() ); panel.querySelectorAll(".ag-filter-toolpanel-group").forEach((group) => { const title = group.querySelector(".ag-filter-toolpanel-group-title")?.textContent; setTestId(group, agTestIdFor.filterToolPanelGroup(title)); setTestId( group.querySelector(".ag-filter-toolpanel-group-title-bar-icon .ag-icon-tree-closed"), agTestIdFor.filterToolPanelGroupCollapsedIcon(title) ); const filterRoot = group.querySelector(".ag-filter-toolpanel-instance-filter"); if (filterRoot) { this.setupFilterInstance(filterRoot, { source: "filter-toolpanel", colLabel: title }); } }); }); }); setTestId( root.querySelector(".ag-status-bar .ag-status-panel-total-and-filtered-row-count"), agTestIdFor.statusBarTotalAndFilteredRowCount() ); setTestId( root.querySelector(".ag-status-bar .ag-status-panel-total-row-count"), agTestIdFor.statusBarTotalRowCount() ); setTestId( root.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"), agTestIdFor.statusBarFilteredRowCount() ); setTestId( root.querySelector(".ag-status-bar .ag-status-panel-selected-row-count"), agTestIdFor.statusBarSelectedRowCount() ); setTestId( root.querySelector(".ag-status-bar .ag-status-panel-filtered-row-count"), agTestIdFor.statusBarAggregations() ); root.querySelectorAll(".ag-paging-panel").forEach((pagingPanel) => { setTestId( pagingPanel.querySelector(".ag-paging-page-size .ag-picker-field-display"), agTestIdFor.paginationPanelSizePickerDisplay( pagingPanel.querySelector(".ag-paging-page-size .ag-picker-field-display")?.textContent ) ); pagingPanel.querySelectorAll(".ag-paging-row-summary-panel-number").forEach((panelNumber) => { const dataRef = panelNumber.getAttribute("data-ref"); switch (dataRef) { case "lbFirstRowOnPage": setTestId(panelNumber, agTestIdFor.paginationPanelFirstRowOnPage(panelNumber.textContent)); break; case "lbLastRowOnPage": setTestId(panelNumber, agTestIdFor.paginationPanelLastRowOnPage(panelNumber.textContent)); break; case "lbRecordCount": setTestId(panelNumber, agTestIdFor.paginationPanelRecordCount(panelNumber.textContent)); break; } }); pagingPanel.querySelectorAll(".ag-paging-page-summary-panel .ag-button").forEach((pagingButton) => { setTestId( pagingButton, agTestIdFor.paginationSummaryPanelButton(pagingButton.getAttribute("aria-label")?.toLowerCase()) ); }); pagingPanel.querySelectorAll(".ag-paging-page-summary-panel .ag-paging-number").forEach((pagingNumber) => { const dataRef = pagingNumber.getAttribute("data-ref"); switch (dataRef) { case "lbCurrent": setTestId( pagingNumber, agTestIdFor.paginationSummaryPanelCurrentPage(pagingNumber.textContent) ); break; case "lbTotal": setTestId(pagingNumber, agTestIdFor.paginationSummaryPanelTotalPage(pagingNumber.textContent)); break; } }); }); setTestId(root.querySelector(".ag-fill-handle"), agTestIdFor.fillHandle()); root.querySelectorAll('.ag-panel[aria-label="Choose Columns"]').forEach((panel) => { setTestId(panel.querySelector(".ag-panel-title-bar-button-icon"), agTestIdFor.columnChooserCloseButton()); setTestId( panel.querySelector('.ag-column-select-header-checkbox input[type="checkbox"]'), agTestIdFor.columnChooserSearchBarCheckbox() ); setTestId( panel.querySelector('.ag-column-select-header-filter-wrapper input[type="text"]'), agTestIdFor.columnChooserSearchBarFilter() ); panel.querySelectorAll(".ag-column-select-list").forEach((list) => { list.querySelectorAll(".ag-column-select-virtual-list-item").forEach((item) => { const label = item.getAttribute("aria-label"); setTestId( item.querySelector(".ag-column-group-closed-icon"), agTestIdFor.columnChooserListItemGroupClosedIcon(label) ); setTestId( item.querySelector(".ag-column-select-checkbox input[type=checkbox]"), agTestIdFor.columnChooserListItemCheckbox(label) ); setTestId( item.querySelector(".ag-drag-handle"), agTestIdFor.columnChooserListItemDragHandle(label) ); }); }); }); setTestId(root.querySelector(".ag-overlay-wrapper"), agTestIdFor.overlay()); const rowGroupPanelWrapper = root.querySelector(".ag-column-drop-wrapper"); if (rowGroupPanelWrapper) { this.setupColumnDropArea(rowGroupPanelWrapper, "panel"); } } setupFilterInstance(filterRoot, spec) { if (!filterRoot) { return; } filterRoot.querySelectorAll(".ag-filter-select .ag-picker-field-display").forEach((fieldDisplay) => { setTestId(fieldDisplay, agTestIdFor.filterInstancePickerDisplay(spec)); }); const filterClass = spec.source === "floating-filter" ? ".ag-floating-filter-body" : ".ag-filter-body"; filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type="number"]`).forEach((numberInput, i, array) => { const setIndex = array.length > 1; const filterSpec = setIndex ? { ...spec, index: i } : spec; setTestId(numberInput, agTestIdFor.numberFilterInstanceInput(filterSpec)); }); filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type="text"]`).forEach((textInput, i, array) => { const setIndex = array.length > 1; const filterSpec = setIndex ? { ...spec, index: i } : spec; setTestId(textInput, agTestIdFor.textFilterInstanceInput(filterSpec)); }); filterRoot.querySelectorAll(`${filterClass} .ag-input-field:not(.ag-hidden) input[type="date"]`).forEach((dateInput, i, array) => { const setIndex = array.length > 1; const filterSpec = setIndex ? { ...spec, index: i } : spec; setTestId(dateInput, agTestIdFor.dateFilterInstanceInput(filterSpec)); }); const setMiniFilterInput = filterRoot.querySelector('.ag-mini-filter input[type="text"]'); setTestId(setMiniFilterInput, agTestIdFor.setFilterInstanceMiniFilterInput(spec)); filterRoot.querySelectorAll(".ag-set-filter-list .ag-set-filter-item").forEach((item) => { const label = item.querySelector(".ag-checkbox-label")?.textContent; const checkbox = item.querySelector('input[type="checkbox"]'); setTestId(checkbox, agTestIdFor.setFilterInstanceItem(spec, label)); }); filterRoot.querySelectorAll(".ag-filter-apply-panel button").forEach((button) => { setTestId(button, agTestIdFor.setFilterApplyPanelButton(spec, button.textContent)); }); filterRoot.querySelectorAll(".ag-filter-condition .ag-radio-button").forEach((radioButton) => { const label = radioButton.querySelector(".ag-radio-button-label")?.textContent; setTestId( radioButton.querySelector("input[type=radio]"), agTestIdFor.filterConditionRadioButton(spec, label) ); }); } setupColumnDropArea(root, source) { root.querySelectorAll(".ag-column-drop").forEach((columnDrop) => { const dropAreaName = columnDrop.querySelector(".ag-column-drop-list")?.getAttribute("aria-label"); setTestId(columnDrop, agTestIdFor.columnDropArea(source, dropAreaName)); columnDrop.querySelectorAll(".ag-column-drop-cell").forEach((columnDropCell) => { const label = columnDropCell.querySelector(".ag-column-drop-cell-text")?.textContent; setTestId( columnDropCell.querySelector(".ag-drag-handle"), agTestIdFor.columnDropCellDragHandle(source, dropAreaName, label) ); setTestId( columnDropCell.querySelector(".ag-column-drop-cell-button .ag-icon-cancel"), agTestIdFor.columnDropCellCancelButton(source, dropAreaName, label) ); }); }); } }; var TestingModule = { moduleName: "Testing", version: VERSION, beans: [TestIdService] }; function setupAgTestIds({ testIdAttribute } = {}) { if (testIdAttribute) { setTestIdAttribute(testIdAttribute); } ModuleRegistry.registerModules([TestingModule]); } var BaseColsService = class extends BeanStub { constructor() { super(...arguments); this.dispatchColumnChangedEvent = dispatchColumnChangedEvent; this.columns = []; this.columnIndexMap = {}; this.updateIndexMap = () => { this.columnIndexMap = {}; this.columns.forEach((col, index) => this.columnIndexMap[col.getId()] = index); }; } wireBeans(beans) { this.colModel = beans.colModel; this.aggFuncSvc = beans.aggFuncSvc; this.visibleCols = beans.visibleCols; this.groupHierarchCols = beans.groupHierarchyColSvc; } sortColumns(compareFn) { const { groupHierarchCols } = this; this.columns.sort((a, b) => groupHierarchCols?.compareVirtualColumns(a, b) ?? compareFn(a, b)); this.updateIndexMap(); } setColumns(colKeys, source) { this.setColList(colKeys, this.columns, this.eventName, true, true, this.columnProcessors.set, source); } addColumns(colKeys, source) { this.updateColList(colKeys, this.columns, true, true, this.columnProcessors.add, this.eventName, source); } removeColumns(colKeys, source) { this.updateColList(colKeys, this.columns, false, true, this.columnProcessors.remove, this.eventName, source); } getColumnIndex(colId) { return this.columnIndexMap[colId]; } setColList(colKeys = [], masterList, eventName, detectOrderChange, autoGroupsNeedBuilding, columnCallback, source) { const gridColumns = this.colModel.getCols(); if (!gridColumns || gridColumns.length === 0) { return; } const changes = /* @__PURE__ */ new Map(); masterList.forEach((col, idx) => changes.set(col, idx)); masterList.length = 0; for (const key of colKeys) { const column = this.colModel.getColDefCol(key); if (column) { masterList.push(column); } } masterList.forEach((col, idx) => { const oldIndex = changes.get(col); if (oldIndex === void 0) { changes.set(col, 0); return; } if (detectOrderChange && oldIndex !== idx) { return; } changes.delete(col); }); this.updateIndexMap(); const primaryCols = this.colModel.getColDefCols(); for (const column of primaryCols ?? []) { const added = masterList.indexOf(column) >= 0; columnCallback(column, added, source); } if (autoGroupsNeedBuilding) { this.colModel.refreshCols(false, source); } this.visibleCols.refresh(source); this.dispatchColumnChangedEvent(this.eventSvc, eventName, [...changes.keys()], source); } updateColList(keys = [], masterList, actionIsAdd, autoGroupsNeedBuilding, columnCallback, eventType, source) { if (!keys || keys.length === 0) { return; } let atLeastOne = false; const updatedCols = /* @__PURE__ */ new Set(); for (const key of keys) { if (!key) { continue; } const columnToAdd = this.colModel.getColDefCol(key); if (!columnToAdd) { continue; } updatedCols.add(columnToAdd); if (actionIsAdd) { if (masterList.indexOf(columnToAdd) >= 0) { continue; } masterList.push(columnToAdd); } else { const currentIndex = masterList.indexOf(columnToAdd); if (currentIndex < 0) { continue; } for (let i = currentIndex + 1; i < masterList.length; i++) { updatedCols.add(masterList[i]); } _removeFromArray(masterList, columnToAdd); } columnCallback(columnToAdd, actionIsAdd, source); atLeastOne = true; } if (!atLeastOne) { return; } this.updateIndexMap(); if (autoGroupsNeedBuilding) { this.colModel.refreshCols(false, source); } this.visibleCols.refresh(source); const eventColumns = Array.from(updatedCols); this.eventSvc.dispatchEvent({ type: eventType, columns: eventColumns, column: eventColumns.length === 1 ? eventColumns[0] : null, source }); } extractCols(source, oldProvidedCols = []) { const previousCols = this.columns; const colsWithIndex = []; const colsWithValue = []; const { setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc } = this.columnExtractors; const primaryCols = this.colModel.getColDefCols(); for (const col of primaryCols ?? []) { const colIsNew = !oldProvidedCols.includes(col); const colDef = col.getColDef(); const value = getValueFunc(colDef); const initialValue = getInitialValueFunc(colDef); const index = getIndexFunc(colDef); const initialIndex = getInitialIndexFunc(colDef); let include; const valuePresent = value !== void 0; const indexPresent = index !== void 0; const initialValuePresent = initialValue !== void 0; const initialIndexPresent = initialIndex !== void 0; if (valuePresent) { include = value; } else if (indexPresent) { if (index === null) { include = false; } else { include = index >= 0; } } else if (colIsNew) { if (initialValuePresent) { include = initialValue; } else if (initialIndexPresent) { include = initialIndex != null && initialIndex >= 0; } else { include = false; } } else { include = previousCols.indexOf(col) >= 0; } if (include) { const useIndex = colIsNew ? index != null || initialIndex != null : index != null; if (useIndex) { colsWithIndex.push(col); } else { colsWithValue.push(col); } } } const getIndexForCol = (col) => { const colDef = col.getColDef(); return getIndexFunc(colDef) ?? getInitialIndexFunc(colDef); }; colsWithIndex.sort((colA, colB) => getIndexForCol(colA) - getIndexForCol(colB)); const res = []; const groupHierarchCols = this.groupHierarchCols; const addCol = (col) => { if (groupHierarchCols) { groupHierarchCols.expandColumnInto(res, col); } else { res.push(col); } }; colsWithIndex.forEach(addCol); for (const col of previousCols) { if (colsWithValue.indexOf(col) >= 0) { addCol(col); } } for (const col of colsWithValue) { if (res.indexOf(col) < 0) { addCol(col); } } for (const col of previousCols) { if (res.indexOf(col) < 0) { setFlagFunc(col, false, source); } } for (const col of res) { if (previousCols.indexOf(col) < 0) { setFlagFunc(col, true, source); } } this.columns = res; this.updateIndexMap(); return this.columns; } restoreColumnOrder(columnStateAccumulator, incomingColumnState) { const colList = this.columns; const primaryCols = this.colModel.getColDefCols(); if (!colList.length || !primaryCols) { return columnStateAccumulator; } const updatedColIdArray = Object.keys(incomingColumnState); const updatedColIds = new Set(updatedColIdArray); const newColIds = new Set(updatedColIdArray); const allColIds = new Set( colList.map((column) => { const colId = column.getColId(); newColIds.delete(colId); return colId; }).concat(updatedColIdArray) ); const colIdsInOriginalOrder = []; const originalOrderMap = {}; let orderIndex = 0; for (let i = 0; i < primaryCols.length; i++) { const colId = primaryCols[i].getColId(); if (allColIds.has(colId)) { colIdsInOriginalOrder.push(colId); originalOrderMap[colId] = orderIndex++; } } let index = 1e3; let hasAddedNewCols = false; let lastIndex = 0; const enableProp = this.columnOrdering.enableProp; const initialEnableProp = this.columnOrdering.initialEnableProp; const indexProp = this.columnOrdering.indexProp; const initialIndexProp = this.columnOrdering.initialIndexProp; const processPrecedingNewCols = (colId) => { const originalOrderIndex = originalOrderMap[colId]; for (let i = lastIndex; i < originalOrderIndex; i++) { const newColId = colIdsInOriginalOrder[i]; if (newColIds.has(newColId)) { incomingColumnState[newColId][indexProp] = index++; newColIds.delete(newColId); } } lastIndex = originalOrderIndex; }; for (const column of colList) { const colId = column.getColId(); if (updatedColIds.has(colId)) { processPrecedingNewCols(colId); incomingColumnState[colId][indexProp] = index++; } else { const colDef = column.getColDef(); const missingIndex = colDef[indexProp] === null || colDef[indexProp] === void 0 && colDef[initialIndexProp] == null; if (missingIndex) { if (!hasAddedNewCols) { const propEnabled = colDef[enableProp] || colDef[enableProp] === void 0 && colDef[initialEnableProp]; if (propEnabled) { processPrecedingNewCols(colId); } else { for (const newColId of newColIds) { incomingColumnState[newColId][indexProp] = index + originalOrderMap[newColId]; } index += colIdsInOriginalOrder.length; hasAddedNewCols = true; } } if (!columnStateAccumulator[colId]) { columnStateAccumulator[colId] = { colId }; } columnStateAccumulator[colId][indexProp] = index++; } } } return columnStateAccumulator; } }; var BaseComponentWrapper = class { wrap(OriginalConstructor, mandatoryMethods, optionalMethods, componentType) { const wrapper = this.createWrapper(OriginalConstructor, componentType); for (const methodName of mandatoryMethods ?? []) { this.createMethod(wrapper, methodName, true); } for (const methodName of optionalMethods ?? []) { this.createMethod(wrapper, methodName, false); } return wrapper; } createMethod(wrapper, methodName, mandatory) { wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory)); } createMethodProxy(wrapper, methodName, mandatory) { return function() { if (wrapper.hasMethod(methodName)) { return wrapper.callMethod(methodName, arguments); } if (mandatory) { _warn(49, { methodName }); } return null; }; } }; var TabGuardCtrl = class extends AgTabGuardCtrl { constructor(params) { super(params, STOP_PROPAGATION_CALLBACKS); } }; var TabGuardFeature = class extends AgTabGuardFeature { constructor(comp) { super(comp, STOP_PROPAGATION_CALLBACKS); } }; var agContentEditableField_default = ".ag-content-editable-field{align-items:center;display:flex}.ag-content-editable-field-input{background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);cursor:text;display:block;flex:1 1 auto;line-height:normal;outline:none;overflow:auto;overflow-y:hidden;padding:0 var(--ag-input-padding-start);white-space:nowrap;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-content-editable-field-input::-webkit-scrollbar{display:none!important}.ag-wrapper.ag-content-editable-field-input{line-height:var(--ag-internal-content-line-height)}.ag-content-editable-field-input:where(:focus,:focus-within){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color)}:where(.ag-content-editable-field.ag-disabled .ag-content-editable-field-input){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}.ag-content-editable-field-input:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}"; var AgContentEditableFieldElement = { tag: "div", cls: "ag-content-editable-field", role: "presentation", children: [ { tag: "div", ref: "eLabel" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-content-editable-field-input", attrs: { contenteditable: "plaintext-only" } } ] }; var AgContentEditableField = class extends AgAbstractField { constructor(config) { super(config, AgContentEditableFieldElement, [], config?.className); this.eLabel = RefPlaceholder; this.eWrapper = RefPlaceholder; this.renderValueToElement = config?.renderValueToElement ?? true; this.registerCSS(agContentEditableField_default); } postConstruct() { super.postConstruct(); this.setupEditable(); this.setupAria(); this.addManagedElementListeners(this.eWrapper, { input: () => this.syncValueFromDom(), blur: () => this.syncValueFromDom(true) }); if (this.renderValueToElement && this.value != null) { this.refreshDisplayedValue(this.value); } } setupAria() { const ariaEl = this.getAriaElement(); _setAriaRole(ariaEl, this.config.ariaRole ?? "textbox"); ariaEl.setAttribute("tabindex", this.gos.get("tabIndex").toString()); } setupEditable() { const editable = this.config.contentEditable ?? "plaintext-only"; if (editable === false) { this.eWrapper.removeAttribute("contenteditable"); } else if (editable === true) { this.eWrapper.setAttribute("contenteditable", "true"); } else { this.eWrapper.setAttribute("contenteditable", editable); } } setValue(value, silent) { const res = super.setValue(value, silent); if (this.renderValueToElement && !silent) { this.refreshDisplayedValue(value); } return res; } setRenderValueToElement(render) { this.renderValueToElement = render; } setDisplayedValue(value) { this.refreshDisplayedValue(value ?? ""); } getContentElement() { return this.eWrapper; } refreshDisplayedValue(value) { this.eWrapper.textContent = value ?? ""; } syncValueFromDom(silent) { super.setValue(this.eWrapper.textContent ?? "", silent); } getFocusableElement() { return this.eWrapper; } }; var AgContentEditableFieldSelector = { selector: "AG-CONTENT-EDITABLE-FIELD", component: AgContentEditableField }; var agToggleButton_default = '.ag-toggle-button{flex:none;min-width:unset;width:unset}.ag-toggle-button-input-wrapper{background-color:var(--ag-toggle-button-off-background-color);border-radius:calc(var(--ag-toggle-button-height)*.5);flex:none;height:var(--ag-toggle-button-height);max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);position:relative;transition:background-color .1s;:where(.ag-toggle-button-input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-toggle-button-height);margin:0;max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);opacity:0}&.ag-checked{background-color:var(--ag-toggle-button-on-background-color)}&.ag-disabled{opacity:.5}}.ag-toggle-button-input-wrapper:before{background-color:var(--ag-toggle-button-switch-background-color);border-radius:100%;content:"";display:block;height:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2);left:var(--ag-toggle-button-switch-inset);pointer-events:none;position:absolute;top:var(--ag-toggle-button-switch-inset);transition:left .1s;width:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2)}.ag-toggle-button-input-wrapper.ag-checked:before{left:calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-switch-inset))}.ag-toggle-button-input-wrapper:focus-within{box-shadow:var(--ag-focus-shadow)}'; var AgToggleButton = class extends AgCheckbox { constructor(config) { super(config, "ag-toggle-button"); this.registerCSS(agToggleButton_default); } setValue(value, silent) { super.setValue(value, silent); this.toggleCss("ag-selected", this.getValue()); return this; } }; var AgToggleButtonSelector = { selector: "AG-TOGGLE-BUTTON", component: AgToggleButton }; // packages/ag-grid-enterprise/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, s2, t) { a = this.add32(this.add32(a, q), this.add32(x, t)); return this.add32(a << s2 | a >>> 32 - s2, b); } ff(a, b, c, d, x, s2, t) { return this.cmn(b & c | ~b & d, a, b, x, s2, t); } gg(a, b, c, d, x, s2, t) { return this.cmn(b & d | c & ~d, a, b, x, s2, t); } hh(a, b, c, d, x, s2, t) { return this.cmn(b ^ c ^ d, a, b, x, s2, t); } ii(a, b, c, d, x, s2, t) { return this.cmn(c ^ (b | ~d), a, b, x, s2, t); } md51(s2) { const n = s2.length; const state = [1732584193, -271733879, -1732584194, 271733878]; let i; for (i = 64; i <= s2.length; i += 64) { this.md5cycle(state, this.md5blk(s2.substring(i - 64, i))); } s2 = s2.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 < s2.length; i++) { tail[i >> 2] |= s2.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(s2) { const md5blks = []; for (let i = 0; i < 64; i += 4) { md5blks[i >> 2] = s2.charCodeAt(i) + (s2.charCodeAt(i + 1) << 8) + (s2.charCodeAt(i + 2) << 16) + (s2.charCodeAt(i + 3) << 24); } return md5blks; } rhex(n) { const hex_chr = "0123456789abcdef".split(""); let s2 = "", j = 0; for (; j < 4; j++) { s2 += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15]; } return s2; } hex(x) { for (let i = 0; i < x.length; i++) { x[i] = this.rhex(x[i]); } return x.join(""); } md5(s2) { return this.hex(this.md51(s2)); } 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; } }; // packages/ag-grid-enterprise/src/license/shared/licenseManager.ts var LICENSE_TYPES = { "01": "GRID", "02": "CHARTS", "0102": "BOTH" }; var LICENSING_HELP_URL = "https://www.ag-grid.com/licensing/"; 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 (!licenseKey?.length) { 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.includes("For_Trialing_ag-Grid_Only"); 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 (!type?.length) { 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() && !!this.watermarkMessage?.length; } 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.includes("forceWatermark") : false; } isWebsiteUrl() { const hostname = this.getHostname(); return hostname.match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.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 s2, o, u, a; let f = 0; const e = input.replace(/[^A-Za-z0-9+/=]/g, ""); while (f < e.length) { s2 = keystr.indexOf(e.charAt(f++)); o = keystr.indexOf(e.charAt(f++)); u = keystr.indexOf(e.charAt(f++)); a = keystr.indexOf(e.charAt(f++)); n = s2 << 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; this.chartsLicenseManager?.setLicenseKey(this.licenseKey, true); } static setLicenseKey(licenseKey) { if (_exists(this.licenseKey) && this.licenseKey !== licenseKey) { _logPreInitWarn( 291, void 0, "AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used." ); } this.licenseKey = licenseKey; 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(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`, " ", "*"); this.centerPadAndOutput(""); this.centerPadAndOutput(""); } else { this.centerPadAndOutput(""); this.centerPadAndOutput(` ${currentLicenseName} License `); this.centerPadAndOutput(" Invalid License Key "); this.padAndOutput(`* Your license key is not valid.`, " ", "*"); this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`, " ", "*"); 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${suppliedLicenseName == "" ? "" : ` 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"; } }; // eslint-disable-next-line no-restricted-syntax _LicenseManager.RELEASE_INFORMATION = "MTc3NTU1MDg5NDgwOQ=="; var LicenseManager = _LicenseManager; // packages/ag-grid-enterprise/src/license/watermark.css var watermark_default = '.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}'; // packages/ag-grid-enterprise/src/license/watermark.ts var WatermarkElement = { tag: "div", cls: "ag-watermark", children: [{ tag: "div", ref: "eLicenseTextRef", cls: "ag-watermark-text" }] }; var AgWatermark = class extends Component { constructor() { super(WatermarkElement); this.eLicenseTextRef = RefPlaceholder; this.registerCSS(watermark_default); } wireBeans(beans) { this.licenseManager = beans.licenseManager; } postConstruct() { const show = this.shouldDisplayWatermark(); this.setDisplayed(show); if (show) { this.eLicenseTextRef.textContent = this.licenseManager.getWatermarkMessage(); window.setTimeout(() => this.addCss("ag-opacity-zero"), 0); window.setTimeout(() => this.setDisplayed(false), 5e3); } } shouldDisplayWatermark() { return this.licenseManager.isDisplayWatermark(); } }; var AgWatermarkSelector = { selector: "AG-WATERMARK", component: AgWatermark }; // packages/ag-grid-enterprise/src/license/gridLicenseManager.ts var GridLicenseManager = class extends BeanStub { constructor() { super(...arguments); this.beanName = "licenseManager"; } postConstruct() { this.validateLicense(); } validateLicense() { const beans = this.beans; if (beans.withinStudio) { this.licenseManager = { isDisplayWatermark: () => false, getWatermarkMessage: () => "" }; } else { const licenseManager = new LicenseManager(_getDocument(beans)); this.licenseManager = licenseManager; 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); } }; // packages/ag-grid-enterprise/src/excelExport/assets/excelConstants.ts var INCH_TO_EMU = 9525; var numberFormatMap = { "0": 1, "0.00": 2, "#,##0": 3, "#,##0.00": 4, "0%": 9, "0.00%": 10, "0.00E+00": 11, "# ?/?": 12, "# ??/??": 13, "mm-dd-yy": 14, "d-mmm-yy": 15, "d-mmm": 16, "mmm-yy": 17, "h:mm AM/PM": 18, "h:mm:ss AM/PM": 19, "h:mm": 20, "h:mm:ss": 21, "m/d/yy h:mm": 22, "#,##0 ;(#,##0)": 37, "#,##0 ;[Red](#,##0)": 38, "#,##0.00;(#,##0.00)": 39, "#,##0.00;[Red](#,##0.00)": 40, "mm:ss": 45, "[h]:mm:ss": 46, "mmss.0": 47, "##0.0E+0": 48, "@": 49 }; // packages/ag-grid-enterprise/src/excelExport/assets/xmlFactory.ts var LINE_SEPARATOR2 = "\r\n"; function returnAttributeIfPopulated(key, value, booleanTransformer) { if (!value && value !== "" && value !== 0) { return ""; } let xmlValue = value; if (typeof value === "boolean") { if (booleanTransformer) { xmlValue = booleanTransformer(value); } } return ` ${key}="${xmlValue}"`; } function createXmlHeader(headerElement = {}) { const headerStart = ""; const keys = ["version"]; if (!headerElement.version) { headerElement.version = "1.0"; } if (headerElement.encoding) { keys.push("encoding"); } if (headerElement.standalone) { keys.push("standalone"); } const att = keys.map((key) => `${key}="${headerElement[key]}"`).join(" "); return `${headerStart}xml ${att} ${headerEnd}`; } function createXml(xmlElement, booleanTransformer) { let props = ""; if (xmlElement.properties) { if (xmlElement.properties.prefixedAttributes) { xmlElement.properties.prefixedAttributes.forEach((prefixedSet) => { for (const key of Object.keys(prefixedSet.map)) { props += returnAttributeIfPopulated( prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer ); } }); } if (xmlElement.properties.rawMap) { for (const key of Object.keys(xmlElement.properties.rawMap)) { props += returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer); } } } let result = "<" + xmlElement.name + props; if (!xmlElement.children && xmlElement.textNode == null) { return result + "/>" + LINE_SEPARATOR2; } if (xmlElement.textNode != null) { return result + ">" + xmlElement.textNode + "" + LINE_SEPARATOR2; } result += ">" + LINE_SEPARATOR2; if (xmlElement.children) { for (const it of xmlElement.children) { result += createXml(it, booleanTransformer); } } return result + "" + LINE_SEPARATOR2; } // packages/ag-grid-enterprise/src/excelExport/assets/excelUtils.ts var pointsToPixel = (points) => { return Math.round(points * 96 / 72); }; var pixelsToEMU = (value) => { return Math.ceil(value * INCH_TO_EMU); }; var getFontFamilyId = (name) => { if (name === void 0) { return; } const families = ["Automatic", "Roman", "Swiss", "Modern", "Script", "Decorative"]; const pos = families.indexOf(name || "Automatic"); return Math.max(pos, 0); }; var getHeightFromProperty = (rowIndex, height) => { if (!height) { return; } let finalHeight; if (typeof height === "number") { finalHeight = height; } else { const heightFunc = height; finalHeight = heightFunc({ rowIndex }); } return finalHeight; }; var setExcelImageTotalWidth = (image, columnsToExport) => { const { colSpan, column } = image.position; if (!image.width) { return; } if (colSpan) { const columnsInSpan = columnsToExport.slice(column - 1, column + colSpan - 1); let totalWidth = 0; for (let i = 0; i < columnsInSpan.length; i++) { const colWidth = columnsInSpan[i].getActualWidth(); if (image.width < totalWidth + colWidth) { image.position.colSpan = i + 1; image.totalWidth = image.width; image.width = image.totalWidth - totalWidth; break; } totalWidth += colWidth; } } else { image.totalWidth = image.width; } }; var setExcelImageTotalHeight = (image, rowHeight) => { const { rowSpan, row } = image.position; if (!image.height) { return; } if (rowSpan) { let totalHeight = 0; let counter = 0; for (let i = row; i < row + rowSpan; i++) { const nextRowHeight = pointsToPixel(getHeightFromProperty(i, rowHeight) || 20); if (image.height < totalHeight + nextRowHeight) { image.position.rowSpan = counter + 1; image.totalHeight = image.height; image.height = image.totalHeight - totalHeight; break; } totalHeight += nextRowHeight; counter++; } } else { image.totalHeight = image.height; } }; var createXmlPart = (body, skipHeader) => { const header = createXmlHeader({ encoding: "UTF-8", standalone: "yes" }); const xmlBody = createXml(body); if (skipHeader) { return xmlBody; } return `${header}${xmlBody}`; }; var getExcelColumnName = (colIdx) => { const startCode = 65; const tableWidth = 26; const fromCharCode = String.fromCharCode; const pos = Math.floor(colIdx / tableWidth); const tableIdx = colIdx % tableWidth; if (!pos || colIdx === tableWidth) { return fromCharCode(startCode + colIdx - 1); } if (!tableIdx) { return getExcelColumnName(pos - 1) + "Z"; } if (pos < tableWidth) { return fromCharCode(startCode + pos - 1) + fromCharCode(startCode + tableIdx - 1); } return getExcelColumnName(pos) + fromCharCode(startCode + tableIdx - 1); }; var sanitizeTableName = (name) => { return name.replaceAll("\n", "_x000a_"); }; var replaceInvisibleCharacters = (str) => { if (str == null) { return null; } let newString = ""; for (let i = 0; i < str.length; i++) { const point = str.charCodeAt(i); if (point >= 0 && point <= 31 && point !== 10) { const convertedCode = point.toString(16).toUpperCase(); const paddedCode = convertedCode.padStart(4, "0"); const newValue = `_x${paddedCode}_`; newString += newValue; } else { newString += str[i]; } } return newString; }; var buildSharedString = (strMap) => { const ret = []; for (const key of strMap.keys()) { const textNode = key.toString(); const child = { name: "t", textNode: _escapeString(replaceInvisibleCharacters(textNode)) }; const preserveSpaces = textNode.trim().length !== textNode.length; if (preserveSpaces) { child.properties = { rawMap: { "xml:space": "preserve" } }; } ret.push({ name: "si", children: [child] }); } return ret; }; // packages/ag-grid-enterprise/src/excelExport/excelSerializingSession.ts var ExcelSerializingSession = class extends BaseGridSerializingSession { constructor(config) { super(config); this.mixedStyles = {}; this.mixedStyleCounter = 0; this.rows = []; this.frozenRowCount = 0; this.skipFrozenRows = false; this.frozenColumnCount = 0; this.skipFrozenColumns = false; this.formulaSvc = config.formulaSvc; this.config = Object.assign({}, config); this.workbook = config.workbook; this.stylesByIds = {}; for (const style of this.config.baseExcelStyles) { this.stylesByIds[style.id] = style; } const quotePrefixStyle = { id: "_quotePrefix", quotePrefix: 1 }; this.stylesByIds[quotePrefixStyle.id] = quotePrefixStyle; this.excelStyles = [...this.config.baseExcelStyles, quotePrefixStyle]; } addCustomContent(customContent) { for (const row of customContent) { const rowLen = this.rows.length + 1; let outlineLevel; if (!this.config.suppressRowOutline && row.outlineLevel != null) { outlineLevel = row.outlineLevel; } const rowObj = { height: getHeightFromProperty(rowLen, row.height || this.config.rowHeight), cells: (row.cells || []).map((cell, idx) => { const image = this.addImage(rowLen, this.columnsToExport[idx], cell.data?.value); let excelStyles = null; if (cell.styleId) { excelStyles = typeof cell.styleId === "string" ? [cell.styleId] : cell.styleId; } const excelStyleId = this.getStyleId(excelStyles); if (image) { return this.createCell( excelStyleId, this.getDataTypeForValue(image.value), image.value == null ? "" : image.value ); } const value = cell.data?.value ?? ""; const type = this.getDataTypeForValue(value); if (cell.mergeAcross) { return this.createMergedCell(excelStyleId, type, value, cell.mergeAcross); } return this.createCell(excelStyleId, type, value); }), outlineLevel }; if (row.collapsed != null) { rowObj.collapsed = row.collapsed; } if (row.hidden != null) { rowObj.hidden = row.hidden; } this.rows.push(rowObj); } } onNewHeaderGroupingRow() { const currentCells = []; const { freezeRows, headerRowHeight } = this.config; this.rows.push({ cells: currentCells, height: getHeightFromProperty(this.rows.length + 1, headerRowHeight) }); if (freezeRows) { this.frozenRowCount++; } return { onColumn: (columnGroup, header, index, span, collapsibleGroupRanges) => { const styleIds = this.config.styleLinker({ rowType: "HEADER_GROUPING", rowIndex: 1, value: `grouping-${header}`, columnGroup }); currentCells.push({ ...this.createMergedCell( this.getStyleId(styleIds), this.getDataTypeForValue("string"), header, span ), collapsibleRanges: collapsibleGroupRanges }); } }; } onNewHeaderRow() { const { freezeRows, headerRowHeight } = this.config; if (freezeRows) { this.frozenRowCount++; } return this.onNewRow(this.onNewHeaderColumn, headerRowHeight); } onNewBodyRow(node) { const { freezeRows, rowHeight } = this.config; if (!this.skipFrozenRows) { if (freezeRows === "headersAndPinnedRows" && node?.rowPinned === "top") { this.frozenRowCount++; } else if (typeof freezeRows === "function") { if (freezeRows(_addGridCommonParams(this.gos, { node }))) { this.frozenRowCount++; } else { this.skipFrozenRows = true; } } else { this.skipFrozenRows = true; } } const rowAccumulator = this.onNewRow(this.onNewBodyColumn, rowHeight); if (node) { this.addRowOutlineIfNecessary(node); } return rowAccumulator; } prepare(columnsToExport) { super.prepare(columnsToExport); this.columnsToExport = [...columnsToExport]; this.cols = columnsToExport.map((col, i) => this.convertColumnToExcel(col, i)); } parse() { const longestRow = this.rows.reduce((a, b) => Math.max(a, b.cells.length), 0); while (this.cols.length < longestRow) { this.cols.push(this.convertColumnToExcel(null, this.cols.length + 1)); } const worksheet = this.createWorksheet(); return this.addWorksheetToWorkbook(worksheet); } createWorksheet() { const { sheetName } = this.config; let name; if (sheetName != null) { const sheetNameValue = typeof sheetName === "function" ? sheetName(_addGridCommonParams(this.gos, {})) : sheetName; name = String(sheetNameValue).substring(0, 31); } else { name = "ag-grid"; } return { name, table: { columns: this.cols, rows: this.rows } }; } addRowOutlineIfNecessary(node) { const { gos, suppressRowOutline, rowGroupExpandState = "expanded" } = this.config; const isGroupHideOpenParents = gos.get("groupHideOpenParents"); if (isGroupHideOpenParents || suppressRowOutline || node.level == null) { return; } const padding = node.footer ? 1 : 0; const currentRow = _last(this.rows); if (node.uiLevel == null || node.level === node.uiLevel) { const outlineLevel = Math.min(node.level + padding, 7); currentRow.outlineLevel = outlineLevel; } if (rowGroupExpandState === "expanded") { return; } const collapseAll2 = rowGroupExpandState === "collapsed"; if (node.isExpandable()) { const isExpanded = !collapseAll2 && node.expanded; currentRow.collapsed = !isExpanded; } currentRow.hidden = // always show the node if there is no parent to be expanded !!node.parent && // or if it is a child of the root node node.parent.level !== -1 && (collapseAll2 || this.isAnyParentCollapsed(node.parent)); } isAnyParentCollapsed(node) { while (node && node.level !== -1) { if (!node.expanded) { return true; } node = node.parent; } return false; } convertColumnToExcel(column, index) { const columnWidth = this.config.columnWidth; const headerValue = column ? this.extractHeaderValue(column) : void 0; const displayName = headerValue ?? ""; const filterAllowed = column ? column.isFilterAllowed() : false; if (columnWidth) { if (typeof columnWidth === "number") { return { width: columnWidth, displayName, filterAllowed }; } return { width: columnWidth({ column, index }), displayName, filterAllowed }; } if (column) { const smallestUsefulWidth = 75; return { width: Math.max(column.getActualWidth(), smallestUsefulWidth), displayName, filterAllowed }; } return { displayName, filterAllowed }; } onNewHeaderColumn(rowIndex, currentCells) { return (column) => { const nameForCol = this.extractHeaderValue(column); const styleIds = this.config.styleLinker({ rowType: "HEADER", rowIndex, value: nameForCol, column }); currentCells.push( this.createCell(this.getStyleId(styleIds), this.getDataTypeForValue("string"), nameForCol) ); }; } onNewBodyColumn(rowIndex, currentCells) { let skipCols = 0; const { freezeColumns, rightToLeft } = this.config; return (column, index, node) => { if (skipCols > 0) { skipCols -= 1; return; } if (!this.skipFrozenColumns) { const pinned = column.getPinned(); const isPinnedLeft = pinned === true || pinned === "left"; if (freezeColumns === "pinned" && pinned && isPinnedLeft !== rightToLeft) { this.frozenColumnCount++; } else if (typeof freezeColumns === "function" && freezeColumns(_addGridCommonParams(this.gos, { column }))) { this.frozenColumnCount++; } else { this.skipFrozenColumns = true; } } const { value: valueForCell, valueFormatted } = this.extractRowCellValue({ column, node, currentColumnIndex: index, accumulatedRowIndex: rowIndex, type: "excel", useRawFormula: true }); const rawValueForCell = valueForCell; const valueForCellString = typeof rawValueForCell === "bigint" ? rawValueForCell.toString() : rawValueForCell; const styleIds = this.config.styleLinker({ rowType: "BODY", rowIndex, value: rawValueForCell, column, node }); const excelStyleId = this.getStyleId(styleIds); const colSpan = column.getColSpan(node); const addedImage = this.addImage(rowIndex, column, valueForCellString); if (addedImage) { currentCells.push( this.createCell( excelStyleId, this.getDataTypeForValue(addedImage.value), addedImage.value == null ? "" : addedImage.value ) ); } else if (colSpan > 1) { skipCols = colSpan - 1; currentCells.push( this.createMergedCell( excelStyleId, this.getDataTypeForValue(rawValueForCell), valueForCellString, colSpan - 1 ) ); } else { const isFormula = column.isAllowFormula() && this.formulaSvc?.isFormula(valueForCellString); const cell = this.createCell( excelStyleId, isFormula ? "f" : this.getDataTypeForValue(rawValueForCell), isFormula ? this.formulaSvc?.updateFormulaByOffset({ value: valueForCellString, rowDelta: rowIndex - (node.formulaRowIndex + 1), useRefFormat: false }) : valueForCellString, valueFormatted ); currentCells.push(cell); } }; } onNewRow(onNewColumnAccumulator, height) { const currentCells = []; this.rows.push({ cells: currentCells, height: getHeightFromProperty(this.rows.length + 1, height) }); return { onColumn: onNewColumnAccumulator.bind(this, this.rows.length, currentCells)() }; } addWorksheetToWorkbook(worksheet) { const { excelStyles, config } = this; this.mapSharedStrings(worksheet); if (this.frozenColumnCount) { config.frozenColumnCount = this.frozenColumnCount; } if (this.frozenRowCount) { config.frozenRowCount = this.frozenRowCount; } return this.workbook.addWorksheet(excelStyles, worksheet, config); } mapSharedStrings(worksheet) { let emptyStringPosition; for (const row of worksheet.table.rows) { for (const cell of row.cells) { const data = cell.data; if (!data || data.type !== "s") { continue; } const value = data.value; if (value == null) { continue; } if (value === "") { emptyStringPosition ?? (emptyStringPosition = this.workbook.getStringPosition("").toString()); data.value = emptyStringPosition; continue; } data.value = this.workbook.getStringPosition(String(value)).toString(); } } } getDataTypeForValue(valueForCell) { if (valueForCell === void 0) { return "empty"; } let dataType = "s"; try { if (this.isNumerical(valueForCell)) { dataType = "n"; } } catch (e) { } return dataType; } getTypeFromStyle(style, value) { if (this.isFormula(value)) { return "f"; } if (style?.dataType) { switch (style.dataType.toLocaleLowerCase()) { case "formula": return "f"; case "string": return "s"; case "number": return "n"; case "datetime": return "d"; case "error": return "e"; case "boolean": return "b"; default: _warn(162, { id: style.id, dataType: style.dataType }); } } return null; } addImage(rowIndex, column, value) { if (!this.config.addImageToCell) { return; } const addedImage = this.config.addImageToCell(rowIndex, column, value); if (!addedImage) { return; } this.workbook.addBodyImageToMap( addedImage.image, rowIndex, column, this.columnsToExport, this.config.rowHeight ); return addedImage; } createCell(styleId, type, value, valueFormatted) { const actualStyle = this.getStyleById(styleId); if (!actualStyle?.dataType && type === "s" && valueFormatted != null) { value = valueFormatted; } const processedType = this.getTypeFromStyle(actualStyle, value) || type; const { value: processedValue, escaped } = this.getCellValue(processedType, value); const styles = []; if (actualStyle) { styles.push(styleId); } if (escaped) { styles.push("_quotePrefix"); } styleId = this.getStyleId(styles) || void 0; return { styleId, data: { type: processedType, value: processedValue } }; } createMergedCell(styleId, type, value, numOfCells) { const valueToUse = value == null ? "" : value; return { styleId: this.getStyleById(styleId) ? styleId : void 0, data: { type, value: type === "s" ? String(valueToUse) : value }, mergeAcross: numOfCells }; } getCellValue(type, value) { let escaped = false; if (value == null || type === "s" && value === "") { return { value: "", escaped: false }; } if (type === "s") { value = String(value); if (value[0] === "'") { escaped = true; value = value.slice(1); } } else if (type === "f") { value = this.addXlfnPrefix(value).slice(1); } else if (type === "n") { const numberValue = Number(value); if (isNaN(numberValue)) { value = ""; } else if (value !== "") { value = numberValue.toString(); } } return { value, escaped }; } addXlfnPrefix(value) { if (!value) { return value; } const concatRegex = /(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi; return value.replace(concatRegex, (_match, prefix, fn, openParen) => `${prefix}_xlfn.${fn}${openParen}`); } getStyleId(styleIds) { if (!styleIds?.length) { return null; } const filteredStyleIds = styleIds.filter((styleId) => this.stylesByIds[styleId] != null); if (!filteredStyleIds.length) { return null; } if (filteredStyleIds.length === 1) { return filteredStyleIds[0]; } const key = filteredStyleIds.join("-"); if (!this.mixedStyles[key]) { this.addNewMixedStyle(filteredStyleIds); } return this.mixedStyles[key].excelID; } addNewMixedStyle(styleIds) { this.mixedStyleCounter += 1; const excelId = `mixedStyle${this.mixedStyleCounter}`; const resultantStyle = {}; for (const styleId of styleIds) { const excelStyle = this.stylesByIds[styleId]; if (excelStyle) { _mergeDeep(resultantStyle, excelStyle, true, true); } } resultantStyle.id = excelId; const key = styleIds.join("-"); this.mixedStyles[key] = { excelID: excelId, key, result: resultantStyle }; this.excelStyles.push(resultantStyle); this.stylesByIds[excelId] = resultantStyle; } isFormula(value) { if (value == null) { return false; } const strValue = String(value); return this.config.autoConvertFormulas && _isExpressionString(strValue); } isNumerical(value) { if (typeof value === "bigint") { return false; } return isFinite(value) && value !== "" && !isNaN(parseFloat(value)); } getStyleById(styleId) { if (styleId == null) { return null; } return this.stylesByIds[styleId] || null; } }; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/contentType.ts var contentTypeFactory = { getTemplate(config) { const { name, ContentType, Extension, PartName } = config; return { name, properties: { rawMap: { Extension, PartName, ContentType } } }; } }; var contentType_default = contentTypeFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/contentTypes.ts var _normaliseImageExtension = (ext) => ext === "jpg" ? "jpeg" : ext; var contentTypesFactory = { getTemplate({ sheetLen, hasCustomProperties }) { const worksheets = new Array(sheetLen).fill(void 0).map((v, i) => ({ name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml", PartName: `/xl/worksheets/sheet${i + 1}.xml` })); const sheetsWithImages = XLSX_WORKSHEET_IMAGES.size; const headerFooterImages = XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.size; const imageTypesObject = {}; XLSX_WORKBOOK_IMAGE_IDS.forEach((v) => { imageTypesObject[_normaliseImageExtension(v.type)] = true; }); const imageDocs = new Array(sheetsWithImages).fill(void 0).map((v, i) => ({ name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.drawing+xml", PartName: `/xl/drawings/drawing${i + 1}.xml` })); const tableDocs = []; XLSX_WORKSHEET_DATA_TABLES.forEach(({ name }) => { tableDocs.push({ name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml", PartName: `/xl/tables/${name}.xml` }); }); const customPropertiesDocs = hasCustomProperties ? [ { name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.custom-properties+xml", PartName: "/docProps/custom.xml" } ] : []; const imageTypes = Object.keys(imageTypesObject).map((ext) => ({ name: "Default", ContentType: `image/${ext}`, Extension: ext })); if (headerFooterImages) { imageTypes.push({ name: "Default", Extension: "vml", ContentType: "application/vnd.openxmlformats-officedocument.vmlDrawing" }); } const children = [ ...imageTypes, { name: "Default", Extension: "rels", ContentType: "application/vnd.openxmlformats-package.relationships+xml" }, { name: "Default", ContentType: "application/xml", Extension: "xml" }, { name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", PartName: "/xl/workbook.xml" }, ...worksheets, { name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.theme+xml", PartName: "/xl/theme/theme1.xml" }, { name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml", PartName: "/xl/styles.xml" }, { name: "Override", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml", PartName: "/xl/sharedStrings.xml" }, ...imageDocs, ...tableDocs, { name: "Override", ContentType: "application/vnd.openxmlformats-package.core-properties+xml", PartName: "/docProps/core.xml" }, ...customPropertiesDocs ].map((contentType) => contentType_default.getTemplate(contentType)); return { name: "Types", properties: { rawMap: { xmlns: "http://schemas.openxmlformats.org/package/2006/content-types" } }, children }; } }; var contentTypes_default = contentTypesFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/core.ts var coreFactory = { getTemplate(author) { const dt = /* @__PURE__ */ new Date(); const jsonDate = dt.toJSON(); return { name: "cp:coreProperties", properties: { prefixedAttributes: [ { prefix: "xmlns:", map: { cp: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", dc: "http://purl.org/dc/elements/1.1/", dcterms: "http://purl.org/dc/terms/", dcmitype: "http://purl.org/dc/dcmitype/", xsi: "http://www.w3.org/2001/XMLSchema-instance" } } ] }, children: [ { name: "dc:creator", textNode: author }, { name: "dc:title", textNode: "Workbook" }, { name: "dcterms:created", properties: { rawMap: { "xsi:type": "dcterms:W3CDTF" } }, textNode: jsonDate }, { name: "dcterms:modified", properties: { rawMap: { "xsi:type": "dcterms:W3CDTF" } }, textNode: jsonDate } ] }; } }; var core_default2 = coreFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/customProperties.ts var DEFAULT_FMTID = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}"; var buildPropertyElements = (metadata) => { const keys = Object.keys(metadata).filter((name) => name && metadata[name] != null); return keys.map((name, index) => ({ name: "property", properties: { rawMap: { fmtid: DEFAULT_FMTID, pid: (index + 2).toString(), name: _escapeString(name) ?? "" } }, children: [ { name: "vt:lpwstr", textNode: _escapeString(replaceInvisibleCharacters(String(metadata[name]))) ?? "" } ] })); }; var customPropertiesFactory = { getTemplate(metadata) { return { name: "Properties", properties: { rawMap: { xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties", "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" } }, children: buildPropertyElements(metadata) }; } }; var customProperties_default = customPropertiesFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/drawing.ts var getAnchor = (name, imageAnchor) => ({ name: `xdr:${name}`, children: [ { name: "xdr:col", textNode: imageAnchor.col.toString() }, { name: "xdr:colOff", textNode: imageAnchor.offsetX.toString() }, { name: "xdr:row", textNode: imageAnchor.row.toString() }, { name: "xdr:rowOff", textNode: imageAnchor.offsetY.toString() } ] }); var getExt = (image) => { const children = [ { name: "a:ext", properties: { rawMap: { uri: "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" } }, children: [ { name: "a16:creationId", properties: { rawMap: { id: "{822E6D20-D7BC-2841-A643-D49A6EF008A2}", "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main" } } } ] } ]; const recolor = image.recolor?.toLowerCase(); switch (recolor) { case "grayscale": case "sepia": case "washout": children.push({ name: "a:ext", properties: { rawMap: { uri: "{C183D7F6-B498-43B3-948B-1728B52AA6E4}" } }, children: [ { name: "adec:decorative", properties: { rawMap: { val: "0", "xmlns:adec": "http://schemas.microsoft.com/office/drawing/2017/decorative" } } } ] }); } return { name: "a:extLst", children }; }; var getNvPicPr = (image, index) => ({ name: "xdr:nvPicPr", children: [ { name: "xdr:cNvPr", properties: { rawMap: { id: index, name: image.id, descr: image.altText != null ? image.altText : void 0 } }, children: [getExt(image)] }, { name: "xdr:cNvPicPr", properties: { rawMap: { preferRelativeResize: "0" } }, children: [ { name: "a:picLocks" } ] } ] }); var getColorDetails = (color) => { if (!color.saturation && !color.tint) { return; } const ret = []; if (color.saturation) { ret.push({ name: "a:satMod", properties: { rawMap: { val: color.saturation * 1e3 } } }); } if (color.tint) { ret.push({ name: "a:tint", properties: { rawMap: { val: color.tint * 1e3 } } }); } return ret; }; var getDuoTone = (primaryColor, secondaryColor) => { return { name: "a:duotone", children: [ { name: "a:prstClr", properties: { rawMap: { val: primaryColor.color } }, children: getColorDetails(primaryColor) }, { name: "a:srgbClr", properties: { rawMap: { val: secondaryColor.color } }, children: getColorDetails(secondaryColor) } ] }; }; var getBlipFill = (image, index) => { let blipChildren; if (image.transparency) { const transparency = Math.min(Math.max(image.transparency, 0), 100); blipChildren = [ { name: "a:alphaModFix", properties: { rawMap: { amt: 1e5 - Math.round(transparency * 1e3) } } } ]; } if (image.recolor) { if (!blipChildren) { blipChildren = []; } switch (image.recolor.toLocaleLowerCase()) { case "grayscale": blipChildren.push({ name: "a:grayscl" }); break; case "sepia": blipChildren.push(getDuoTone({ color: "black" }, { color: "D9C3A5", tint: 50, saturation: 180 })); break; case "washout": blipChildren.push({ name: "a:lum", properties: { rawMap: { bright: "70000", contrast: "-70000" } } }); break; default: } } return { name: "xdr:blipFill", children: [ { name: "a:blip", properties: { rawMap: { cstate: "print", "r:embed": `rId${index}`, "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" } }, children: blipChildren }, { name: "a:stretch", children: [ { name: "a:fillRect" } ] } ] }; }; var getSpPr = (image, imageBoxSize) => { const xfrm = { name: "a:xfrm", children: [ { name: "a:off", properties: { rawMap: { x: 0, y: 0 } } }, { name: "a:ext", properties: { rawMap: { cx: imageBoxSize.width, cy: imageBoxSize.height } } } ] }; if (image.rotation) { const rotation = image.rotation; xfrm.properties = { rawMap: { rot: Math.min(Math.max(rotation, 0), 360) * 6e4 } }; } const prstGeom = { name: "a:prstGeom", properties: { rawMap: { prst: "rect" } }, children: [{ name: "a:avLst" }] }; const ret = { name: "xdr:spPr", children: [xfrm, prstGeom] }; return ret; }; var getImageBoxSize = (image) => { image.fitCell = !!image.fitCell || !image.width || !image.height; const { position = {}, fitCell, width = 0, height = 0, totalHeight, totalWidth } = image; const { offsetX = 0, offsetY = 0, row = 1, rowSpan = 1, column = 1, colSpan = 1 } = position; return { from: { row: row - 1, col: column - 1, offsetX: pixelsToEMU(offsetX), offsetY: pixelsToEMU(offsetY) }, to: { row: row - 1 + (fitCell ? 1 : rowSpan - 1), col: column - 1 + (fitCell ? 1 : colSpan - 1), offsetX: pixelsToEMU(width + offsetX), offsetY: pixelsToEMU(height + offsetY) }, height: pixelsToEMU(totalHeight || height), width: pixelsToEMU(totalWidth || width) }; }; var getPicture = (image, currentIndex, worksheetImageIndex, imageBoxSize) => { return { name: "xdr:pic", children: [ getNvPicPr(image, currentIndex + 1), getBlipFill(image, worksheetImageIndex + 1), getSpPr(image, imageBoxSize) ] }; }; var drawingFactory = { getTemplate(config) { const { sheetIndex } = config; const sheetImages = XLSX_WORKSHEET_IMAGES.get(sheetIndex); const sheetImageIds = XLSX_WORKSHEET_IMAGE_IDS.get(sheetIndex); const children = sheetImages.map((image, idx) => { const boxSize = getImageBoxSize(image); return { name: "xdr:twoCellAnchor", properties: { rawMap: { editAs: "absolute" } }, children: [ getAnchor("from", boxSize.from), getAnchor("to", boxSize.to), getPicture(image, idx, sheetImageIds.get(image.id).index, boxSize), { name: "xdr:clientData" } ] }; }); return { name: "xdr:wsDr", properties: { rawMap: { "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main", "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" } }, children }; } }; var drawing_default = drawingFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/relationship.ts var relationshipFactory = { getTemplate(config) { const { Id, Type, Target } = config; return { name: "Relationship", properties: { rawMap: { Id, Type, Target } } }; } }; var relationship_default = relationshipFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/relationships.ts var relationshipsFactory = { getTemplate(c) { const children = c.map((relationship) => relationship_default.getTemplate(relationship)); return { name: "Relationships", properties: { rawMap: { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" } }, children }; } }; var relationships_default = relationshipsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/sharedStrings.ts var sharedStrings = { getTemplate(strings) { return { name: "sst", properties: { rawMap: { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", count: strings.size, uniqueCount: strings.size } }, children: buildSharedString(strings) }; } }; var sharedStrings_default = sharedStrings; // packages/ag-grid-enterprise/src/excelExport/assets/excelLegacyConvert.ts var getWeightName = (value) => { switch (value) { case 1: return "thin"; case 2: return "medium"; case 3: return "thick"; default: return "hair"; } }; var mappedBorderNames = { None: "None", Dot: "Dotted", Dash: "Dashed", Double: "Double", DashDot: "DashDot", DashDotDot: "DashDotDot", SlantDashDot: "SlantDashDot", Continuous: "Continuous" }; var mediumBorders = ["Dashed", "DashDot", "DashDotDot"]; var colorMap = { None: "none", Solid: "solid", Gray50: "mediumGray", Gray75: "darkGray", Gray25: "lightGray", HorzStripe: "darkHorizontal", VertStripe: "darkVertical", ReverseDiagStripe: "darkDown", DiagStripe: "darkUp", DiagCross: "darkGrid", ThickDiagCross: "darkTrellis", ThinHorzStripe: "lightHorizontal", ThinVertStripe: "lightVertical", ThinReverseDiagStripe: "lightDown", ThinDiagStripe: "lightUp", ThinHorzCross: "lightGrid", ThinDiagCross: "lightTrellis", Gray125: "gray125", Gray0625: "gray0625" }; var horizontalAlignmentMap = { Automatic: "general", Left: "left", Center: "center", Right: "right", Fill: "fill", Justify: "justify", CenterAcrossSelection: "centerContinuous", Distributed: "distributed", JustifyDistributed: "justify" }; var verticalAlignmentMap = { Automatic: void 0, Top: "top", Bottom: "bottom", Center: "center", Justify: "justify", Distributed: "distributed", JustifyDistributed: "justify" }; var convertLegacyPattern = (name) => { if (!name) { return "none"; } return colorMap[name] || name; }; var convertLegacyColor = (color) => { if (color == void 0) { return color; } if (color.charAt(0) === "#") { color = color.substring(1); } return color.length === 6 ? "FF" + color : color; }; var convertLegacyBorder = (type, weight) => { if (!type) { return "thin"; } const namedWeight = getWeightName(weight); if (type === "Continuous") { return namedWeight; } const mappedName = mappedBorderNames[type]; if (namedWeight === "medium" && mediumBorders.some((type2) => type2 === mappedName)) { return `medium${mappedName}`; } return `${mappedName.charAt(0).toLowerCase()}${mappedName.substring(1)}`; }; var convertLegacyHorizontalAlignment = (alignment) => { return horizontalAlignmentMap[alignment] || "general"; }; var convertLegacyVerticalAlignment = (alignment) => { return verticalAlignmentMap[alignment] || void 0; }; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/border.ts var getBorderColor = (color) => { return { name: "color", properties: { rawMap: { rgb: convertLegacyColor(color || "#000000") } } }; }; var borderFactory = { getTemplate(border) { const { left, right, top, bottom, diagonal } = border; const leftChildren = left ? [getBorderColor(left.color)] : void 0; const rightChildren = right ? [getBorderColor(right.color)] : void 0; const topChildren = top ? [getBorderColor(top.color)] : void 0; const bottomChildren = bottom ? [getBorderColor(bottom.color)] : void 0; const diagonalChildren = diagonal ? [getBorderColor(diagonal.color)] : void 0; return { name: "border", children: [ { name: "left", properties: { rawMap: { style: left?.style } }, children: leftChildren }, { name: "right", properties: { rawMap: { style: right?.style } }, children: rightChildren }, { name: "top", properties: { rawMap: { style: top?.style } }, children: topChildren }, { name: "bottom", properties: { rawMap: { style: bottom?.style } }, children: bottomChildren }, { name: "diagonal", properties: { rawMap: { style: diagonal?.style } }, children: diagonalChildren } ] }; } }; var border_default = borderFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/borders.ts var bordersFactory = { getTemplate(borders) { return { name: "borders", properties: { rawMap: { count: borders.length } }, children: borders.map((border) => border_default.getTemplate(border)) }; } }; var borders_default = bordersFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/alignment.ts var getReadingOrderId = (readingOrder) => { const order = ["Context", "LeftToRight", "RightToLeft"]; const pos = order.indexOf(readingOrder); return Math.max(pos, 0); }; var alignmentFactory = { getTemplate(alignment) { const { horizontal, indent, readingOrder, rotate, shrinkToFit, vertical, wrapText } = alignment; return { name: "alignment", properties: { rawMap: { horizontal: horizontal && convertLegacyHorizontalAlignment(horizontal), indent, readingOrder: readingOrder && getReadingOrderId(readingOrder), textRotation: rotate, shrinkToFit, vertical: vertical && convertLegacyVerticalAlignment(vertical), wrapText } } }; } }; var alignment_default = alignmentFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/protection.ts var protectionFactory = { getTemplate(protection) { const locked = protection.protected === false ? 0 : 1; const hidden = protection.hideFormula === true ? 1 : 0; return { name: "protection", properties: { rawMap: { hidden, locked } } }; } }; var protection_default = protectionFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/xf.ts var xfFactory = { getTemplate(xf) { const { alignment, borderId, fillId, fontId, numFmtId, protection, quotePrefix, xfId } = xf; const children = []; if (alignment) { children.push(alignment_default.getTemplate(alignment)); } if (protection) { children.push(protection_default.getTemplate(protection)); } return { name: "xf", properties: { rawMap: { applyAlignment: alignment ? 1 : void 0, applyProtection: protection ? 1 : void 0, applyBorder: borderId ? 1 : void 0, applyFill: fillId ? 1 : void 0, borderId, fillId, applyFont: fontId ? 1 : void 0, fontId, applyNumberFormat: numFmtId ? 1 : void 0, numFmtId, quotePrefix: quotePrefix ? 1 : void 0, xfId } }, children: children.length ? children : void 0 }; } }; var xf_default = xfFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/cellStyleXfs.ts var cellStylesXfsFactory = { getTemplate(xfs) { return { name: "cellStyleXfs", properties: { rawMap: { count: xfs.length } }, children: xfs.map((xf) => xf_default.getTemplate(xf)) }; } }; var cellStyleXfs_default = cellStylesXfsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/cellStyle.ts var borderFactory2 = { getTemplate(cellStyle) { const { builtinId, name, xfId } = cellStyle; return { name: "cellStyle", properties: { rawMap: { builtinId, name, xfId } } }; } }; var cellStyle_default = borderFactory2; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/cellStyles.ts var cellStylesFactory = { getTemplate(cellStyles) { return { name: "cellStyles", properties: { rawMap: { count: cellStyles.length } }, children: cellStyles.map((cellStyle) => cellStyle_default.getTemplate(cellStyle)) }; } }; var cellStyles_default = cellStylesFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/cellXfs.ts var cellXfsFactory = { getTemplate(xfs) { return { name: "cellXfs", properties: { rawMap: { count: xfs.length } }, children: xfs.map((xf) => xf_default.getTemplate(xf)) }; } }; var cellXfs_default = cellXfsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/fill.ts var fillFactory = { getTemplate(fill) { const { patternType, fgTheme, fgTint, fgRgb, bgRgb, bgIndexed } = fill; const pf = { name: "patternFill", properties: { rawMap: { patternType } } }; if (fgTheme || fgTint || fgRgb) { pf.children = [ { name: "fgColor", properties: { rawMap: { theme: fgTheme, tint: fgTint, rgb: fgRgb } } } ]; } if (bgIndexed || bgRgb) { if (!pf.children) { pf.children = []; } pf.children.push({ name: "bgColor", properties: { rawMap: { indexed: bgIndexed, rgb: bgRgb } } }); } return { name: "fill", children: [pf] }; } }; var fill_default = fillFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/fills.ts var fillsFactory = { getTemplate(fills) { return { name: "fills", properties: { rawMap: { count: fills.length } }, children: fills.map((fill) => fill_default.getTemplate(fill)) }; } }; var fills_default = fillsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/font.ts var fontFactory = { getTemplate(font) { const { size, colorTheme, color = "FF000000", fontName = "Calibri", family, scheme, italic, bold, strikeThrough, outline, shadow: shadow2, underline, verticalAlign } = font; const children = [ { name: "sz", properties: { rawMap: { val: size } } }, { name: "color", properties: { rawMap: { theme: colorTheme, rgb: color } } }, { name: "name", properties: { rawMap: { val: fontName } } } ]; if (family) { children.push({ name: "family", properties: { rawMap: { val: family } } }); } if (scheme) { children.push({ name: "scheme", properties: { rawMap: { val: scheme } } }); } if (italic) { children.push({ name: "i" }); } if (bold) { children.push({ name: "b" }); } if (strikeThrough) { children.push({ name: "strike" }); } if (outline) { children.push({ name: "outline" }); } if (shadow2) { children.push({ name: "shadow" }); } if (underline) { children.push({ name: "u", properties: { rawMap: { val: underline } } }); } if (verticalAlign) { children.push({ name: "vertAlign", properties: { rawMap: { val: verticalAlign } } }); } return { name: "font", children }; } }; var font_default = fontFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/fonts.ts var fontsFactory = { getTemplate(fonts) { return { name: "fonts", properties: { rawMap: { count: fonts.length } }, children: fonts.map((font) => font_default.getTemplate(font)) }; } }; var fonts_default = fontsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/numberFormat.ts function prepareString(str) { const split = str.split(/(\[[^\]]*\])/); for (let i = 0; i < split.length; i++) { let currentString = split[i]; if (!currentString.length) { continue; } if (!currentString.startsWith("[")) { currentString = currentString.replace(/\$/g, '"$"'); } split[i] = _escapeString(currentString); } return split.join(""); } var numberFormatFactory = { getTemplate(numberFormat) { let { formatCode, numFmtId } = numberFormat; if (formatCode.length) { formatCode = prepareString(formatCode); } return { name: "numFmt", properties: { rawMap: { formatCode, numFmtId } } }; } }; var numberFormat_default = numberFormatFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/numberFormats.ts var numberFormatsFactory = { getTemplate(numberFormats) { return { name: "numFmts", properties: { rawMap: { count: numberFormats.length } }, children: numberFormats.map((numberFormat) => numberFormat_default.getTemplate(numberFormat)) }; } }; var numberFormats_default = numberFormatsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/styles/stylesheet.ts var stylesMap; var registeredNumberFmts; var registeredFonts; var registeredFills; var registeredBorders; var registeredCellStyleXfs; var registeredCellXfs; var registeredCellStyles; var currentSheet; var getStyleName = (name, currentSheet2) => { if (name.includes("mixedStyle") && currentSheet2 > 1) { name += `_${currentSheet2}`; } return name; }; var resetStylesheetValues = () => { stylesMap = { base: 0 }; registeredNumberFmts = []; registeredFonts = [{ fontName: "Calibri", colorTheme: "1", family: "2", scheme: "minor" }]; registeredFills = [{ patternType: "none" }, { patternType: "gray125" }]; registeredBorders = [{ left: void 0, right: void 0, top: void 0, bottom: void 0, diagonal: void 0 }]; registeredCellStyleXfs = [{ borderId: 0, fillId: 0, fontId: 0, numFmtId: 0 }]; registeredCellXfs = [{ borderId: 0, fillId: 0, fontId: 0, numFmtId: 0, xfId: 0 }]; registeredCellStyles = [{ builtinId: 0, name: "Normal", xfId: 0 }]; }; var registerFill = (fill) => { const convertedPattern = convertLegacyPattern(fill.pattern); const convertedFillColor = convertLegacyColor(fill.color); const convertedPatternColor = convertLegacyColor(fill.patternColor); let pos = registeredFills.findIndex((currentFill) => { const { patternType, fgRgb, bgRgb } = currentFill; return !(patternType != convertedPattern || fgRgb != convertedFillColor || bgRgb != convertedPatternColor); }); if (pos === -1) { pos = registeredFills.length; registeredFills.push({ patternType: convertedPattern, fgRgb: convertedFillColor, bgRgb: convertedPatternColor }); } return pos; }; var registerNumberFmt = (format) => { if (numberFormatMap[format]) { return numberFormatMap[format]; } let pos = registeredNumberFmts.findIndex((currentFormat) => currentFormat.formatCode === format); if (pos === -1) { pos = registeredNumberFmts.length + 164; registeredNumberFmts.push({ formatCode: format, numFmtId: pos }); } else { pos = registeredNumberFmts[pos].numFmtId; } return pos; }; var registerBorders = (borders) => { const { borderBottom, borderTop, borderLeft, borderRight } = borders; let bottomStyle; let topStyle; let leftStyle; let rightStyle; let bottomColor; let topColor; let leftColor; let rightColor; if (borderLeft) { leftStyle = convertLegacyBorder(borderLeft.lineStyle, borderLeft.weight); leftColor = convertLegacyColor(borderLeft.color); } if (borderRight) { rightStyle = convertLegacyBorder(borderRight.lineStyle, borderRight.weight); rightColor = convertLegacyColor(borderRight.color); } if (borderBottom) { bottomStyle = convertLegacyBorder(borderBottom.lineStyle, borderBottom.weight); bottomColor = convertLegacyColor(borderBottom.color); } if (borderTop) { topStyle = convertLegacyBorder(borderTop.lineStyle, borderTop.weight); topColor = convertLegacyColor(borderTop.color); } let pos = registeredBorders.findIndex((currentBorder) => { const { left, right, top, bottom } = currentBorder; if (!left && (leftStyle || leftColor)) { return false; } if (!right && (rightStyle || rightColor)) { return false; } if (!top && (topStyle || topColor)) { return false; } if (!bottom && (bottomStyle || bottomColor)) { return false; } const { style: clS, color: clC } = left || {}; const { style: crS, color: crC } = right || {}; const { style: ctS, color: ctC } = top || {}; const { style: cbS, color: cbC } = bottom || {}; if (clS != leftStyle || clC != leftColor) { return false; } if (crS != rightStyle || crC != rightColor) { return false; } if (ctS != topStyle || ctC != topColor) { return false; } if (cbS != bottomStyle || cbC != bottomColor) { return false; } return true; }); if (pos === -1) { pos = registeredBorders.length; registeredBorders.push({ left: { style: leftStyle, color: leftColor }, right: { style: rightStyle, color: rightColor }, top: { style: topStyle, color: topColor }, bottom: { style: bottomStyle, color: bottomColor }, diagonal: { style: void 0, color: void 0 } }); } return pos; }; var registerFont = (font) => { const { fontName: name = "Calibri", color, size, bold, italic, outline, shadow: shadow2, strikeThrough, underline, family, verticalAlign } = font; const convertedColor = convertLegacyColor(color); const familyId = getFontFamilyId(family); const convertedUnderline = underline ? underline.toLocaleLowerCase() : void 0; const convertedVerticalAlign = verticalAlign ? verticalAlign.toLocaleLowerCase() : void 0; let pos = registeredFonts.findIndex((currentFont) => { return !(currentFont.fontName != name || currentFont.color != convertedColor || currentFont.size != size || currentFont.bold != bold || currentFont.italic != italic || currentFont.outline != outline || currentFont.shadow != shadow2 || currentFont.strikeThrough != strikeThrough || currentFont.underline != convertedUnderline || currentFont.verticalAlign != convertedVerticalAlign || currentFont.family != familyId); }); if (pos === -1) { pos = registeredFonts.length; registeredFonts.push({ fontName: name, color: convertedColor, size, bold, italic, outline, shadow: shadow2, strikeThrough, underline: convertedUnderline, verticalAlign: convertedVerticalAlign, family: familyId != null ? familyId.toString() : void 0 }); } return pos; }; var registerStyle = (config) => { const { alignment, borders, font, interior, numberFormat, protection, quotePrefix } = config; let { id } = config; let currentFill = 0; let currentBorder = 0; let currentFont = 0; let currentNumberFmt = 0; if (!id) { return; } id = getStyleName(id, currentSheet); if (stylesMap[id] != void 0) { return; } if (interior) { currentFill = registerFill(interior); } if (borders) { currentBorder = registerBorders(borders); } if (font) { currentFont = registerFont(font); } if (numberFormat) { currentNumberFmt = registerNumberFmt(numberFormat.format); } stylesMap[id] = registeredCellXfs.length; registeredCellXfs.push({ alignment, borderId: currentBorder || 0, fillId: currentFill || 0, fontId: currentFont || 0, numFmtId: currentNumberFmt || 0, protection, quotePrefix, xfId: 0 }); }; var stylesheetFactory = { getTemplate(defaultFontSize) { const numberFormats = numberFormats_default.getTemplate(registeredNumberFmts); const fonts = fonts_default.getTemplate( registeredFonts.map((font) => ({ ...font, size: font.size != null ? font.size : defaultFontSize })) ); const fills = fills_default.getTemplate(registeredFills); const borders = borders_default.getTemplate(registeredBorders); const cellStylesXfs = cellStyleXfs_default.getTemplate(registeredCellStyleXfs); const cellXfs = cellXfs_default.getTemplate(registeredCellXfs); const cellStyles = cellStyles_default.getTemplate(registeredCellStyles); resetStylesheetValues(); return { name: "styleSheet", properties: { rawMap: { "mc:Ignorable": "x14ac x16r2 xr", xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac", "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main", "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision" } }, children: [ numberFormats, fonts, fills, borders, cellStylesXfs, cellXfs, cellStyles, { name: "tableStyles", properties: { rawMap: { count: 0, defaultPivotStyle: "PivotStyleLight16", defaultTableStyle: "TableStyleMedium2" } } } ] }; } }; var getStyleId = (name, currentSheet2) => { return stylesMap[getStyleName(name, currentSheet2)] || 0; }; var registerStyles = (styles, _currentSheet) => { currentSheet = _currentSheet; if (currentSheet === 1) { resetStylesheetValues(); } styles.forEach(registerStyle); }; var stylesheet_default = stylesheetFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/table.ts var tableFactory = { getTemplate(dataTable, idx) { const { name, columns, rowRange, displayName, showRowStripes, showColumnStripes, showFilterButtons, highlightFirstColumn, highlightLastColumn } = dataTable || {}; const noRows = !rowRange || rowRange[0] - rowRange[1] === 0; if (!dataTable || !name || !Array.isArray(columns) || !columns.length || noRows) { return { name: "table" }; } const filterColumns = columns.map((col, idx2) => ({ name: "filterColumn", properties: { rawMap: { colId: idx2.toString(), // For filters, this should start with 0 hiddenButton: showFilterButtons[idx2] ? 0 : 1 } } })); const firstCell = `A${rowRange[0]}`; const lastCell = `${getExcelColumnName(columns.length)}${rowRange[1]}`; const ref = `${firstCell}:${lastCell}`; const id = `${idx + 1}`; const displayNameToUse = idx ? `${displayName}_${id}` : displayName; return { name: "table", properties: { rawMap: { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "mc:Ignorable": "xr xr3", "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision", "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3", name: displayNameToUse, displayName: displayNameToUse, ref, totalsRowShown: 0, id } }, children: [ { name: "autoFilter", properties: { rawMap: { ref } }, children: filterColumns }, { name: "tableColumns", properties: { rawMap: { count: columns.length } }, children: columns.map((col, idx2) => ({ name: "tableColumn", properties: { rawMap: { id: (idx2 + 1).toString(), name: _escapeString(sanitizeTableName(col)), dataCellStyle: "Normal" } } })) }, { name: "tableStyleInfo", properties: { rawMap: { name: "TableStyleLight1", showFirstColumn: highlightFirstColumn ? 1 : 0, showLastColumn: highlightLastColumn ? 1 : 0, showRowStripes: showRowStripes ? 1 : 0, showColumnStripes: showColumnStripes ? 1 : 0 } } } ] }; } }; var table_default = tableFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/themes/office/colorScheme.ts var getColorChildren = (props) => { const [type, innerType, val, lastClr] = props; return { name: `a:${type}`, children: [ { name: `a:${innerType}`, properties: { rawMap: { val, lastClr } } } ] }; }; var colorScheme = { getTemplate() { return { name: "a:clrScheme", properties: { rawMap: { name: "Office" } }, children: [ getColorChildren(["dk1", "sysClr", "windowText", "000000"]), getColorChildren(["lt1", "sysClr", "window", "FFFFFF"]), getColorChildren(["dk2", "srgbClr", "44546A"]), getColorChildren(["lt2", "srgbClr", "E7E6E6"]), getColorChildren(["accent1", "srgbClr", "4472C4"]), getColorChildren(["accent2", "srgbClr", "ED7D31"]), getColorChildren(["accent3", "srgbClr", "A5A5A5"]), getColorChildren(["accent4", "srgbClr", "FFC000"]), getColorChildren(["accent5", "srgbClr", "5B9BD5"]), getColorChildren(["accent6", "srgbClr", "70AD47"]), getColorChildren(["hlink", "srgbClr", "0563C1"]), getColorChildren(["folHlink", "srgbClr", "954F72"]) ] }; } }; var colorScheme_default = colorScheme; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/themes/office/fontScheme.ts var getFont = (props) => { const [type, typeface, script, panose] = props; return { name: `a:${type}`, properties: { rawMap: { script, typeface, panose } } }; }; var fontScheme = { getTemplate() { return { name: "a:fontScheme", properties: { rawMap: { name: "Office" } }, children: [ { name: "a:majorFont", children: [ getFont(["latin", "Calibri Light", void 0, "020F0302020204030204"]), getFont(["ea", ""]), getFont(["cs", ""]), getFont(["font", "\u6E38\u30B4\u30B7\u30C3\u30AF Light", "Jpan"]), getFont(["font", "\uB9D1\uC740 \uACE0\uB515", "Hang"]), getFont(["font", "\u7B49\u7EBF Light", "Hans"]), getFont(["font", "\u65B0\u7D30\u660E\u9AD4", "Hant"]), getFont(["font", "Times New Roman", "Arab"]), getFont(["font", "Times New Roman", "Hebr"]), getFont(["font", "Tahoma", "Thai"]), getFont(["font", "Nyala", "Ethi"]), getFont(["font", "Vrinda", "Beng"]), getFont(["font", "Shruti", "Gujr"]), getFont(["font", "MoolBoran", "Khmr"]), getFont(["font", "Tunga", "Knda"]), getFont(["font", "Raavi", "Guru"]), getFont(["font", "Euphemia", "Cans"]), getFont(["font", "Plantagenet Cherokee", "Cher"]), getFont(["font", "Microsoft Yi Baiti", "Yiii"]), getFont(["font", "Microsoft Himalaya", "Tibt"]), getFont(["font", "MV Boli", "Thaa"]), getFont(["font", "Mangal", "Deva"]), getFont(["font", "Gautami", "Telu"]), getFont(["font", "Latha", "Taml"]), getFont(["font", "Estrangelo Edessa", "Syrc"]), getFont(["font", "Kalinga", "Orya"]), getFont(["font", "Kartika", "Mlym"]), getFont(["font", "DokChampa", "Laoo"]), getFont(["font", "Iskoola Pota", "Sinh"]), getFont(["font", "Mongolian Baiti", "Mong"]), getFont(["font", "Times New Roman", "Viet"]), getFont(["font", "Microsoft Uighur", "Uigh"]), getFont(["font", "Sylfaen", "Geor"]), getFont(["font", "Arial", "Armn"]), getFont(["font", "Leelawadee UI", "Bugi"]), getFont(["font", "Microsoft JhengHei", "Bopo"]), getFont(["font", "Javanese Text", "Java"]), getFont(["font", "Segoe UI", "Lisu"]), getFont(["font", "Myanmar Text", "Mymr"]), getFont(["font", "Ebrima", "Nkoo"]), getFont(["font", "Nirmala UI", "Olck"]), getFont(["font", "Ebrima", "Osma"]), getFont(["font", "Phagspa", "Phag"]), getFont(["font", "Estrangelo Edessa", "Syrn"]), getFont(["font", "Estrangelo Edessa", "Syrj"]), getFont(["font", "Estrangelo Edessa", "Syre"]), getFont(["font", "Nirmala UI", "Sora"]), getFont(["font", "Microsoft Tai Le", "Tale"]), getFont(["font", "Microsoft New Tai Lue", "Talu"]), getFont(["font", "Ebrima", "Tfng"]) ] }, { name: "a:minorFont", children: [ getFont(["latin", "Calibri", void 0, "020F0502020204030204"]), getFont(["ea", ""]), getFont(["cs", ""]), getFont(["font", "\u6E38\u30B4\u30B7\u30C3\u30AF", "Jpan"]), getFont(["font", "\uB9D1\uC740 \uACE0\uB515", "Hang"]), getFont(["font", "\u7B49\u7EBF", "Hans"]), getFont(["font", "\u65B0\u7D30\u660E\u9AD4", "Hant"]), getFont(["font", "Arial", "Arab"]), getFont(["font", "Arial", "Hebr"]), getFont(["font", "Tahoma", "Thai"]), getFont(["font", "Nyala", "Ethi"]), getFont(["font", "Vrinda", "Beng"]), getFont(["font", "Shruti", "Gujr"]), getFont(["font", "DaunPenh", "Khmr"]), getFont(["font", "Tunga", "Knda"]), getFont(["font", "Raavi", "Guru"]), getFont(["font", "Euphemia", "Cans"]), getFont(["font", "Plantagenet Cherokee", "Cher"]), getFont(["font", "Microsoft Yi Baiti", "Yiii"]), getFont(["font", "Microsoft Himalaya", "Tibt"]), getFont(["font", "MV Boli", "Thaa"]), getFont(["font", "Mangal", "Deva"]), getFont(["font", "Gautami", "Telu"]), getFont(["font", "Latha", "Taml"]), getFont(["font", "Estrangelo Edessa", "Syrc"]), getFont(["font", "Kalinga", "Orya"]), getFont(["font", "Kartika", "Mlym"]), getFont(["font", "DokChampa", "Laoo"]), getFont(["font", "Iskoola Pota", "Sinh"]), getFont(["font", "Mongolian Baiti", "Mong"]), getFont(["font", "Arial", "Viet"]), getFont(["font", "Microsoft Uighur", "Uigh"]), getFont(["font", "Sylfaen", "Geor"]), getFont(["font", "Arial", "Armn"]), getFont(["font", "Leelawadee UI", "Bugi"]), getFont(["font", "Microsoft JhengHei", "Bopo"]), getFont(["font", "Javanese Text", "Java"]), getFont(["font", "Segoe UI", "Lisu"]), getFont(["font", "Myanmar Text", "Mymr"]), getFont(["font", "Ebrima", "Nkoo"]), getFont(["font", "Nirmala UI", "Olck"]), getFont(["font", "Ebrima", "Osma"]), getFont(["font", "Phagspa", "Phag"]), getFont(["font", "Estrangelo Edessa", "Syrn"]), getFont(["font", "Estrangelo Edessa", "Syrj"]), getFont(["font", "Estrangelo Edessa", "Syre"]), getFont(["font", "Nirmala UI", "Sora"]), getFont(["font", "Microsoft Tai Le", "Tale"]), getFont(["font", "Microsoft New Tai Lue", "Talu"]), getFont(["font", "Ebrima", "Tfng"]) ] } ] }; } }; var fontScheme_default = fontScheme; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/themes/office/formatScheme.ts var getPropertyVal = (name, val, children) => ({ name: `a:${name}`, properties: { rawMap: { val } }, children }); var getGs = (props) => { const [pos, schemeColor, satMod, lumMod, tint, shade] = props; const children = []; children.push(getPropertyVal("satMod", satMod)); if (lumMod) { children.push(getPropertyVal("lumMod", lumMod)); } if (tint) { children.push(getPropertyVal("tint", tint)); } if (shade) { children.push(getPropertyVal("shade", shade)); } return { name: "a:gs", properties: { rawMap: { pos } }, children: [ { name: "a:schemeClr", properties: { rawMap: { val: schemeColor } }, children } ] }; }; var getSolidFill = (val, children) => ({ name: "a:solidFill", children: [getPropertyVal("schemeClr", val, children)] }); var getGradFill = (props) => { const [rotWithShape, gs1, gs2, gs3, lin] = props; const [ang, scaled] = lin; return { name: "a:gradFill", properties: { rawMap: { rotWithShape } }, children: [ { name: "a:gsLst", children: [getGs(gs1), getGs(gs2), getGs(gs3)] }, { name: "a:lin", properties: { rawMap: { ang, scaled } } } ] }; }; var getLine = (props) => { const [w, cap, cmpd, algn] = props; return { name: "a:ln", properties: { rawMap: { w, cap, cmpd, algn } }, children: [ getSolidFill("phClr"), getPropertyVal("prstDash", "solid"), { name: "a:miter", properties: { rawMap: { lim: "800000" } } } ] }; }; var getEffectStyle = (shadow2) => { const children = []; if (shadow2) { const [blurRad, dist, dir, algn, rotWithShape] = shadow2; children.push({ name: "a:outerShdw", properties: { rawMap: { blurRad, dist, dir, algn, rotWithShape } }, children: [getPropertyVal("srgbClr", "000000", [getPropertyVal("alpha", "63000")])] }); } return { name: "a:effectStyle", children: [ Object.assign( {}, { name: "a:effectLst" }, children.length ? { children } : {} ) ] }; }; var getFillStyleList = () => ({ name: "a:fillStyleLst", children: [ getSolidFill("phClr"), getGradFill([ "1", ["0", "phClr", "105000", "110000", "67000"], ["50000", "phClr", "103000", "105000", "73000"], ["100000", "phClr", "109000", "105000", "81000"], ["5400000", "0"] ]), getGradFill([ "1", ["0", "phClr", "103000", "102000", "94000"], ["50000", "phClr", "110000", "100000", void 0, "100000"], ["100000", "phClr", "120000", "99000", void 0, "78000"], ["5400000", "0"] ]) ] }); var getLineStyleList = () => ({ name: "a:lnStyleLst", children: [ getLine(["6350", "flat", "sng", "ctr"]), getLine(["12700", "flat", "sng", "ctr"]), getLine(["19050", "flat", "sng", "ctr"]) ] }); var getEffectStyleList = () => ({ name: "a:effectStyleLst", children: [getEffectStyle(), getEffectStyle(), getEffectStyle(["57150", "19050", "5400000", "ctr", "0"])] }); var getBgFillStyleList = () => ({ name: "a:bgFillStyleLst", children: [ getSolidFill("phClr"), getSolidFill("phClr", [getPropertyVal("tint", "95000"), getPropertyVal("satMod", "170000")]), getGradFill([ "1", ["0", "phClr", "150000", "102000", "93000", "98000"], ["50000", "phClr", "130000", "103000", "98000", "90000"], ["100000", "phClr", "120000", void 0, void 0, "63000"], ["5400000", "0"] ]) ] }); var formatScheme = { getTemplate() { return { name: "a:fmtScheme", properties: { rawMap: { name: "Office" } }, children: [getFillStyleList(), getLineStyleList(), getEffectStyleList(), getBgFillStyleList()] }; } }; var formatScheme_default = formatScheme; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/themes/office/themeElements.ts var themeElements = { getTemplate() { return { name: "a:themeElements", children: [colorScheme_default.getTemplate(), fontScheme_default.getTemplate(), formatScheme_default.getTemplate()] }; } }; var themeElements_default = themeElements; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/themes/office.ts var officeTheme = { getTemplate() { return { name: "a:theme", properties: { prefixedAttributes: [ { prefix: "xmlns:", map: { a: "http://schemas.openxmlformats.org/drawingml/2006/main" } } ], rawMap: { name: "Office Theme" } }, children: [ themeElements_default.getTemplate(), { name: "a:objectDefaults" }, { name: "a:extraClrSchemeLst" } ] }; } }; var office_default = officeTheme; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/vmlDrawing.ts var getShapeLayout = () => ({ name: "o:shapelayout", properties: { prefixedAttributes: [ { prefix: "v:", map: { ext: "edit" } } ] }, children: [ { name: "o:idmap", properties: { prefixedAttributes: [ { prefix: "v:", map: { ext: "edit" } } ], rawMap: { data: "1" } } } ] }); var getStroke = () => ({ name: "v:stroke", properties: { rawMap: { joinstyle: "miter" } } }); var getFormulas = (formulas) => ({ name: "v:formulas", children: formulas.map((formula) => ({ name: "v:f", properties: { rawMap: { eqn: formula } } })) }); var getPath = () => ({ name: "v:path", properties: { prefixedAttributes: [ { prefix: "o:", map: { connecttype: "rect", extrusionok: "f" } } ], rawMap: { gradientshapeok: "t" } } }); var getLock = (params) => { const { aspectratio, rotation } = params || {}; const rawMap = {}; if (aspectratio) { rawMap.aspectratio = "t"; } if (rotation) { rawMap.rotation = "t"; } return { name: "o:lock", properties: { prefixedAttributes: [ { prefix: "v:", map: { ext: "edit" } } ], rawMap } }; }; function mapNumber(value, startSource, endSource, startTarget, endTarget) { return (value - startSource) / (endSource - startSource) * (endTarget - startTarget) + startTarget; } var getImageData = (image, idx) => { let rawMap; const { recolor, brightness, contrast, id } = image; if (recolor) { rawMap = {}; if (recolor === "Washout" || recolor === "Grayscale") { rawMap.gain = "19661f"; rawMap.blacklevel = "22938f"; } if (recolor === "Black & White" || recolor === "Grayscale") { rawMap.grayscale = "t"; if (recolor === "Black & White") { rawMap.bilevel = "t"; } } } if (!recolor || recolor === "Grayscale") { if (!rawMap) { rawMap = {}; } if (contrast != null && contrast !== 50) { let gain = "1"; if (contrast >= 0) { if (contrast < 50) { gain = String(contrast / 50); } else if (contrast < 100) { gain = String(50 / (100 - contrast)); } else if (contrast === 100) { gain = "2147483647f"; } } rawMap.gain = gain; } if (brightness != null && brightness !== 50) { rawMap.blacklevel = mapNumber(brightness, 0, 100, -0.5, 0.5).toString(); } } return { name: "v:imagedata", properties: { prefixedAttributes: [ { prefix: "o:", map: { relid: `rId${idx}`, title: id } } ], rawMap } }; }; var getShapeType = () => { const formulas = [ "if lineDrawn pixelLineWidth 0", "sum @0 1 0", "sum 0 0 @1", "prod @2 1 2", "prod @3 21600 pixelWidth", "prod @3 21600 pixelHeight", "sum @0 0 1", "prod @6 1 2", "prod @7 21600 pixelWidth", "sum @8 21600 0", "prod @7 21600 pixelHeight", "sum @10 21600 0" ]; return { name: "v:shapetype", properties: { prefixedAttributes: [ { prefix: "o:", map: { spt: "75", preferrelative: "t" } } ], rawMap: { coordsize: "21600,21600", filled: "f", id: "_x0000_t75", path: "m@4@5l@4@11@9@11@9@5xe", stroked: "f" } }, children: [getStroke(), getFormulas(formulas), getPath(), getLock({ aspectratio: true })] }; }; var pixelToPoint = (value) => Math.floor((value ?? 0) * 0.74999943307122); var getShape = (image, idx) => { const { width = 0, height = 0, altText } = image; const imageWidth = pixelToPoint(width); const imageHeight = pixelToPoint(height); return { name: "v:shape", properties: { rawMap: { id: image.headerFooterPosition, "o:spid": "_x0000_s1025", style: `position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${imageWidth}pt; height: ${imageHeight}pt; z-index: ${idx + 1}`, type: "#_x0000_t75", alt: altText } }, children: [getImageData(image, idx + 1), getLock({ rotation: true })] }; }; var vmlDrawingFactory = { getTemplate(params) { const headerFooterImages = XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.get(params.sheetIndex) || []; const children = [ getShapeLayout(), getShapeType(), ...headerFooterImages.map((img, idx) => getShape(img, idx)) ]; return { name: "xml", properties: { prefixedAttributes: [ { prefix: "xmlns:", map: { v: "urn:schemas-microsoft-com:vml", o: "urn:schemas-microsoft-com:office:office", x: "urn:schemas-microsoft-com:office:excel" } } ] }, children }; } }; var vmlDrawing_default = vmlDrawingFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/sheet.ts var sheetFactory = { getTemplate(name, idx) { const sheetId = (idx + 1).toString(); return { name: "sheet", properties: { rawMap: { name, sheetId, "r:id": `rId${sheetId}` } } }; } }; var sheet_default = sheetFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/sheets.ts var sheetsFactory = { getTemplate(names) { return { name: "sheets", children: names.map((sheet, idx) => sheet_default.getTemplate(sheet, idx)) }; } }; var sheets_default = sheetsFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/workbook.ts var workbookFactory = { getTemplate(names, activeTab) { return { name: "workbook", properties: { prefixedAttributes: [ { prefix: "xmlns:", map: { r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships" } } ], rawMap: { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" } }, children: [ { name: "bookViews", children: [ { name: "workbookView", properties: { rawMap: { activeTab } } } ] }, sheets_default.getTemplate(names) ] }; } }; var workbook_default = workbookFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/column.ts var getExcelCellWidth = (width) => Math.ceil((width - 12) / 7 + 1); var colFactory = { getTemplate(config) { const { min, max, outlineLevel, s: s2, width, hidden, bestFit } = config; let excelWidth = 1; let customWidth = "0"; if (width > 1) { excelWidth = getExcelCellWidth(width); customWidth = "1"; } return { name: "col", properties: { rawMap: { min, max, outlineLevel: outlineLevel != null ? outlineLevel : void 0, width: excelWidth, style: s2, hidden: hidden ? "1" : "0", bestFit: bestFit ? "1" : "0", customWidth } } }; } }; var column_default = colFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/mergeCell.ts var mergeCellFactory = { getTemplate(ref) { return { name: "mergeCell", properties: { rawMap: { ref } } }; } }; var mergeCell_default = mergeCellFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/cell.ts var convertLegacyType = (type) => { const t = type.charAt(0).toLowerCase(); return t === "s" ? "inlineStr" : t; }; var cellFactory = { getTemplate(config, idx, currentSheet2) { const { ref, data, styleId } = config; const { type, value } = data || { type: "empty", value: null }; let convertedType = type; if (type === "f") { convertedType = "str"; } else if (type.charAt(0) === type.charAt(0).toUpperCase()) { convertedType = convertLegacyType(type); } const obj = { name: "c", properties: { rawMap: { r: ref, t: convertedType === "empty" ? void 0 : convertedType, s: styleId ? getStyleId(styleId, currentSheet2) : void 0 } } }; if (convertedType === "empty") { return obj; } let children; if (convertedType === "str" && type === "f") { children = [ { name: "f", textNode: _escapeString(replaceInvisibleCharacters(value)) } ]; } else if (convertedType === "inlineStr") { children = [ { name: "is", children: [ { name: "t", textNode: _escapeString(replaceInvisibleCharacters(value)) } ] } ]; } else { children = [ { name: "v", textNode: value } ]; } return Object.assign({}, obj, { children }); } }; var cell_default = cellFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/row.ts var addEmptyCells = (cells, rowIdx) => { const mergeMap = []; let posCounter = 0; for (let i = 0; i < cells.length; i++) { const cell = cells[i]; if (cell.mergeAcross) { mergeMap.push({ pos: i, excelPos: posCounter }); posCounter += cell.mergeAcross; } posCounter++; } if (mergeMap.length) { for (let i = mergeMap.length - 1; i >= 0; i--) { const mergedCells = []; const cell = cells[mergeMap[i].pos]; for (let j = 1; j <= cell.mergeAcross; j++) { mergedCells.push({ ref: `${getExcelColumnName(mergeMap[i].excelPos + 1 + j)}${rowIdx + 1}`, styleId: cell.styleId, data: { type: "empty", value: null } }); } if (mergedCells.length) { cells.splice(mergeMap[i].pos + 1, 0, ...mergedCells); } } } }; var shouldDisplayCell = (cell) => cell.data?.value !== "" || cell.styleId !== void 0; var rowFactory = { getTemplate(config, idx, currentSheet2) { const { collapsed, hidden, height, outlineLevel, cells = [] } = config; addEmptyCells(cells, idx); const children = cells.filter(shouldDisplayCell).map((cell, idx2) => cell_default.getTemplate(cell, idx2, currentSheet2)); return { name: "row", properties: { rawMap: { r: idx + 1, collapsed: collapsed ? "1" : "0", hidden: hidden ? "1" : "0", ht: height, customHeight: height != null ? "1" : "0", spans: "1:1", outlineLevel: outlineLevel || void 0 } }, children }; } }; var row_default = rowFactory; // packages/ag-grid-enterprise/src/excelExport/files/ooxml/worksheet.ts var getMergedCellsAndAddColumnGroups = (rows, cols, suppressColumnOutline) => { const mergedCells = []; const cellsWithCollapsibleGroups = []; rows.forEach((currentRow, rowIdx) => { const cells = currentRow.cells; let merges = 0; let lastCol; cells.forEach((currentCell, cellIdx) => { const min = cellIdx + merges + 1; const start = getExcelColumnName(min); const outputRow = rowIdx + 1; if (currentCell.mergeAcross) { merges += currentCell.mergeAcross; const end = getExcelColumnName(cellIdx + merges + 1); mergedCells.push(`${start}${outputRow}:${end}${outputRow}`); } if (!cols[min - 1]) { cols[min - 1] = {}; } const { collapsibleRanges } = currentCell; if (collapsibleRanges) { collapsibleRanges.forEach((range) => { cellsWithCollapsibleGroups.push([min + range[0], min + range[1]]); }); } lastCol = cols[min - 1]; lastCol.min = min; lastCol.max = min; currentCell.ref = `${start}${outputRow}`; }); }); cellsWithCollapsibleGroups.sort((a, b) => { if (a[0] !== b[0]) { return a[0] - b[0]; } return b[1] - a[1]; }); const rangeMap = /* @__PURE__ */ new Map(); const outlineLevel = /* @__PURE__ */ new Map(); cellsWithCollapsibleGroups.filter((currentRange) => { const rangeString = currentRange.toString(); const inMap = rangeMap.get(rangeString); if (inMap) { return false; } rangeMap.set(rangeString, true); return true; }).forEach((range) => { const refCol = cols.find((col) => col.min == range[0] && col.max == range[1]); const currentOutlineLevel = outlineLevel.get(range[0]); cols.push({ min: range[0], max: range[1], outlineLevel: suppressColumnOutline ? void 0 : currentOutlineLevel || 1, width: (refCol || { width: 100 }).width }); outlineLevel.set(range[0], (currentOutlineLevel || 0) + 1); }); return mergedCells; }; var getPageOrientation = (orientation) => { if (!orientation || orientation !== "Portrait" && orientation !== "Landscape") { return "portrait"; } return orientation.toLocaleLowerCase(); }; var getPageSize = (pageSize) => { if (pageSize == null) { return 1; } const positions = [ "Letter", "Letter Small", "Tabloid", "Ledger", "Legal", "Statement", "Executive", "A3", "A4", "A4 Small", "A5", "A6", "B4", "B5", "Folio", "Envelope", "Envelope DL", "Envelope C5", "Envelope B5", "Envelope C3", "Envelope C4", "Envelope C6", "Envelope Monarch", "Japanese Postcard", "Japanese Double Postcard" ]; const pos = positions.indexOf(pageSize); return pos === -1 ? 1 : pos + 1; }; var replaceHeaderFooterTokens = (value) => { const map = { "&[Page]": "&P", "&[Pages]": "&N", "&[Date]": "&D", "&[Time]": "&T", "&[Tab]": "&A", "&[Path]": "&Z", "&[File]": "&F", "&[Picture]": "&G" }; for (const key of Object.keys(map)) { value = value.replace(key, map[key]); } return value; }; var getHeaderPosition = (position) => { if (position === "Center") { return "C"; } if (position === "Right") { return "R"; } return "L"; }; var applyHeaderFontStyle = (headerString, font) => { if (!font) { return headerString; } headerString += "&""; headerString += font.fontName || "Calibri"; if (font.bold !== font.italic) { headerString += font.bold ? ",Bold" : ",Italic"; } else if (font.bold) { headerString += ",Bold Italic"; } else { headerString += ",Regular"; } headerString += """; if (font.size) { headerString += `&${font.size}`; } if (font.strikeThrough) { headerString += "&S"; } if (font.underline) { headerString += `&${font.underline === "Double" ? "E" : "U"}`; } if (font.color) { headerString += `&K${font.color.replace("#", "").toUpperCase()}`; } return headerString; }; var processHeaderFooterContent = (content, location, rule) => content.reduce((prev, curr, idx) => { const pos = getHeaderPosition(curr.position); const output = applyHeaderFontStyle(`${prev}&${pos}`, curr.font); const PositionMap = ["Left", "Center", "Right"]; if (!curr.position) { curr.position = PositionMap[idx]; } const { image } = curr; if (curr.value === "&[Picture]" && image) { const imagePosition = `${pos}${location}${rule}`; addXlsxHeaderFooterImageToMap(image, imagePosition); } return `${output}${_escapeString(replaceHeaderFooterTokens(curr.value))}`; }, ""); var buildHeaderFooter = (headerFooterConfig) => { const rules = ["all", "first", "even"]; const headersAndFooters = []; rules.forEach((rule) => { const headerFooter = headerFooterConfig[rule]; const namePrefix = rule === "all" ? "odd" : rule; if (!headerFooter) { return; } for (const key of Object.keys(headerFooter)) { const value = headerFooter[key]; const nameSuffix = `${key.charAt(0).toUpperCase()}${key.slice(1)}`; const location = key[0].toUpperCase(); if (value) { const normalizedRule = rule === "all" ? "" : rule.toUpperCase(); headersAndFooters.push({ name: `${namePrefix}${nameSuffix}`, properties: { rawMap: { "xml:space": "preserve" } }, textNode: processHeaderFooterContent(value, location, normalizedRule) }); } } }); return headersAndFooters; }; var addColumns = (columns) => { return (params) => { if (columns.length) { params.children.push({ name: "cols", children: columns.map((column) => column_default.getTemplate(column)) }); } return params; }; }; var addSheetData = (rows, sheetNumber) => { return (params) => { if (rows.length) { params.children.push({ name: "sheetData", children: rows.map((row, idx) => row_default.getTemplate(row, idx, sheetNumber)) }); } return params; }; }; var getPasswordHash = (password) => { const passwordLength = password.length; if (!passwordLength) { return ""; } const passwordArray = new Array(passwordLength + 1); passwordArray[0] = passwordLength; for (let i = 1; i <= passwordLength; i++) { passwordArray[i] = password.charCodeAt(i - 1) & 255; } let verifier = 0; for (let i = passwordArray.length - 1; i >= 0; i--) { const passwordByte = passwordArray[i]; const intermediate1 = (verifier & 16384) === 0 ? 0 : 1; const intermediate2 = verifier << 1 & 32767; verifier = (intermediate1 | intermediate2) ^ passwordByte; } return (verifier ^ 52811).toString(16).toUpperCase().padStart(4, "0"); }; var addSheetProtection = (protectSheet) => { return (params) => { if (!protectSheet) { return params; } const sheetProtection = typeof protectSheet === "boolean" ? {} : protectSheet; const rawMap = { sheet: 1 }; const passwordHash = sheetProtection.password ? getPasswordHash(sheetProtection.password) : ""; if (passwordHash) { rawMap.password = passwordHash; } const defaults = { autoFilter: false, deleteColumns: false, deleteRows: false, formatCells: false, formatColumns: false, formatRows: false, insertColumns: false, insertHyperlinks: false, insertRows: false, pivotTables: false, selectLockedCells: true, selectUnlockedCells: true }; Object.keys(defaults).forEach( (key) => { const allow = sheetProtection[key]; if (allow == null || allow === defaults[key]) { return; } rawMap[key] = allow ? 0 : 1; } ); params.children.push({ name: "sheetProtection", properties: { rawMap } }); return params; }; }; var addMergeCells = (mergeCells) => { return (params) => { if (mergeCells.length) { params.children.push({ name: "mergeCells", properties: { rawMap: { count: mergeCells.length } }, children: mergeCells.map((mergedCell) => mergeCell_default.getTemplate(mergedCell)) }); } return params; }; }; var addPageMargins = (margins) => { return (params) => { const { top = 0.75, right = 0.7, bottom = 0.75, left = 0.7, header = 0.3, footer = 0.3 } = margins; params.children.push({ name: "pageMargins", properties: { rawMap: { bottom, footer, header, left, right, top } } }); return params; }; }; var addPageSetup = (pageSetup) => { return (params) => { if (pageSetup) { params.children.push({ name: "pageSetup", properties: { rawMap: { horizontalDpi: 0, verticalDpi: 0, orientation: getPageOrientation(pageSetup.orientation), paperSize: getPageSize(pageSetup.pageSize) } } }); } return params; }; }; var addHeaderFooter = (headerFooterConfig) => { return (params) => { if (!headerFooterConfig) { return params; } const differentFirst = headerFooterConfig.first != null ? 1 : 0; const differentOddEven = headerFooterConfig.even != null ? 1 : 0; params.children.push({ name: "headerFooter", properties: { rawMap: { differentFirst, differentOddEven } }, children: buildHeaderFooter(headerFooterConfig) }); return params; }; }; var addExcelTableRel = (excelTable) => { return (params) => { if (excelTable) { params.children.push({ name: "tableParts", properties: { rawMap: { count: "1" } }, children: [ { name: "tablePart", properties: { rawMap: { "r:id": `rId${++params.rIdCounter}` } } } ] }); } return params; }; }; var addDrawingRel = (currentSheet2) => { return (params) => { const worksheetImages = XLSX_WORKSHEET_IMAGES.get(currentSheet2); if (worksheetImages?.length) { params.children.push({ name: "drawing", properties: { rawMap: { "r:id": `rId${++params.rIdCounter}` } } }); } return params; }; }; var addVmlDrawingRel = (currentSheet2) => { return (params) => { if (XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.get(currentSheet2)) { params.children.push({ name: "legacyDrawingHF", properties: { rawMap: { "r:id": `rId${++params.rIdCounter}` } } }); } return params; }; }; var getPane = (xSplit = 0, ySplit = 0) => { const shouldSplit = xSplit > 0 || ySplit > 0; return shouldSplit ? [ { name: "pane", properties: { rawMap: { state: shouldSplit ? "frozen" : void 0, topLeftCell: shouldSplit ? `${getExcelColumnName(xSplit + 1)}${ySplit + 1}` : void 0, xSplit: xSplit === 0 ? void 0 : xSplit, ySplit: ySplit === 0 ? void 0 : ySplit } } } ] : void 0; }; var addSheetViews = (rtl = false, xSplit, ySplit) => { return (params) => { params.children.push({ name: "sheetViews", children: [ { name: "sheetView", properties: { rawMap: { rightToLeft: rtl === true ? "1" : "0", workbookViewId: "0" } }, children: getPane(xSplit, ySplit) } ] }); return params; }; }; var addSheetPr = () => { return (params) => { params.children.push({ name: "sheetPr", children: [ { name: "outlinePr", properties: { rawMap: { summaryBelow: 0 } } } ] }); return params; }; }; var addSheetFormatPr = (rows) => { return (params) => { const maxOutline = rows.reduce((prev, row) => { if (row.outlineLevel && row.outlineLevel > prev) { return row.outlineLevel; } return prev; }, 0); params.children.push({ name: "sheetFormatPr", properties: { rawMap: { baseColWidth: 10, defaultRowHeight: 16, outlineLevelRow: maxOutline ? maxOutline : void 0 } } }); return params; }; }; var worksheetFactory = { getTemplate(params) { const { worksheet, currentSheet: currentSheet2, config } = params; const { margins = {}, pageSetup, headerFooterConfig, suppressColumnOutline, rightToLeft, frozenRowCount, frozenColumnCount, protectSheet } = config; const { table } = worksheet; const { rows, columns } = table; const mergedCells = columns?.length ? getMergedCellsAndAddColumnGroups(rows, columns, !!suppressColumnOutline) : []; const worksheetExcelTables = XLSX_WORKSHEET_DATA_TABLES.get(currentSheet2); const { children } = [ addSheetPr(), addSheetViews(rightToLeft, frozenColumnCount, frozenRowCount), addSheetFormatPr(rows), addColumns(columns), addSheetData(rows, currentSheet2 + 1), addSheetProtection(protectSheet), addMergeCells(mergedCells), addPageMargins(margins), addPageSetup(pageSetup), addHeaderFooter(headerFooterConfig), addDrawingRel(currentSheet2), addVmlDrawingRel(currentSheet2), addExcelTableRel(worksheetExcelTables) ].reduce((composed, f) => f(composed), { children: [], rIdCounter: 0 }); return { name: "worksheet", properties: { prefixedAttributes: [ { prefix: "xmlns:", map: { r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships" } } ], rawMap: { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" } }, children }; } }; var worksheet_default = worksheetFactory; // packages/ag-grid-enterprise/src/excelExport/excelXlsxFactory.ts var XLSX_SHARED_STRINGS = /* @__PURE__ */ new Map(); var XLSX_SHEET_NAMES = []; var XLSX_SHEET_DATA = []; var XLSX_SHEET_CONTENT_INDICES = /* @__PURE__ */ new Map(); var XLSX_IMAGES = /* @__PURE__ */ new Map(); var XLSX_WORKSHEET_IMAGES = /* @__PURE__ */ new Map(); var XLSX_WORKSHEET_HEADER_FOOTER_IMAGES = /* @__PURE__ */ new Map(); var XLSX_WORKBOOK_IMAGE_IDS = /* @__PURE__ */ new Map(); var XLSX_WORKSHEET_IMAGE_IDS = /* @__PURE__ */ new Map(); var XLSX_WORKSHEET_DATA_TABLES = /* @__PURE__ */ new Map(); var DEFAULT_TABLE_DISPLAY_NAME = "AG-GRID-TABLE"; var XLSX_FACTORY_MODE = "SINGLE_SHEET"; function getXlsxFactoryMode() { return XLSX_FACTORY_MODE; } function setXlsxFactoryMode(factoryMode) { XLSX_FACTORY_MODE = factoryMode; } function createXlsxExcel(styles, worksheet, config) { addSheetName(worksheet); registerStyles(styles, XLSX_SHEET_NAMES.length); const newConfig = Object.assign({}, config); if (config.exportAsExcelTable && config.pivotModeActive) { _warn(163, { featureName: "pivot mode" }); newConfig.exportAsExcelTable = false; } processTableConfig(worksheet, newConfig); const worksheetXml = createWorksheet(worksheet, newConfig); registerSheetXml(worksheetXml); return worksheetXml; } function getXlsxSanitizedTableName(name) { return name.replace(/^[^a-zA-Z_]+/, "_").replace(/\s/g, "_").replace(/[^a-zA-Z0-9_]/g, "_"); } function addXlsxTableToSheet(sheetIndex, table) { if (XLSX_WORKSHEET_DATA_TABLES.has(sheetIndex)) { _warn(164); return; } XLSX_WORKSHEET_DATA_TABLES.set(sheetIndex, table); } function processTableConfig(worksheet, config) { const { exportAsExcelTable, prependContent, appendContent, headerRowCount = 0 } = config; if (!exportAsExcelTable) { return; } const tableConfig = typeof exportAsExcelTable === "boolean" ? {} : exportAsExcelTable; const { name, showColumnStripes, showRowStripes, showFilterButton, highlightFirstColumn, highlightLastColumn } = tableConfig; const tableName = getXlsxSanitizedTableName(name || DEFAULT_TABLE_DISPLAY_NAME); const sheetIndex = XLSX_SHEET_NAMES.length - 1; const { table } = worksheet; const { rows, columns } = table; const skipTopRows = prependContent ? prependContent.length : 0; const removeFromBottom = appendContent ? appendContent.length : 0; const tableRowCount = rows.length; const tableColCount = columns.length; const tableColumns = []; const showFilterButtons = []; for (let i = 0; i < tableColCount; i++) { const col = columns[i]; tableColumns.push(col.displayName || ""); showFilterButtons.push( showFilterButton === "match" || showFilterButton === void 0 ? col.filterAllowed ?? false : showFilterButton ); } if (!tableColumns?.length || !tableRowCount || !tableName) { _warn(165); return; } addXlsxTableToSheet(sheetIndex, { name: `table${XLSX_WORKSHEET_DATA_TABLES.size + 1}`, displayName: tableName, columns: tableColumns, showFilterButtons, rowRange: [headerRowCount + skipTopRows, headerRowCount + (tableRowCount - headerRowCount) - removeFromBottom], showRowStripes: showRowStripes ?? true, showColumnStripes: showColumnStripes ?? false, highlightFirstColumn: highlightFirstColumn ?? false, highlightLastColumn: highlightLastColumn ?? false }); } function addXlsxHeaderFooterImageToMap(image, position) { const sheetIndex = XLSX_SHEET_NAMES.length - 1; const headerFooterImage = image; headerFooterImage.headerFooterPosition = position; buildImageMap({ imageToAdd: headerFooterImage, idx: sheetIndex }); let headerFooterImagesForSheet = XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.get(sheetIndex); if (!headerFooterImagesForSheet) { headerFooterImagesForSheet = []; XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.set(sheetIndex, headerFooterImagesForSheet); } if (!headerFooterImagesForSheet.find((img) => img.id === image.id)) { headerFooterImagesForSheet.push(image); } } function addXlsxBodyImageToMap(image, rowIndex, col, columnsToExport, rowHeight) { const sheetIndex = XLSX_SHEET_NAMES.length; const { row, column } = image.position || {}; const calculatedImage = image; if (columnsToExport) { if (rowIndex != null && col != null && (!row || !column)) { if (!image.position) { image.position = {}; } image.position = Object.assign({}, image.position, { row: rowIndex, column: columnsToExport.indexOf(col) + 1 }); } setExcelImageTotalWidth(calculatedImage, columnsToExport); setExcelImageTotalHeight(calculatedImage, rowHeight); } buildImageMap({ imageToAdd: calculatedImage, idx: sheetIndex }); let worksheetImageIdMap = XLSX_WORKSHEET_IMAGE_IDS.get(sheetIndex); if (!worksheetImageIdMap) { worksheetImageIdMap = /* @__PURE__ */ new Map(); XLSX_WORKSHEET_IMAGE_IDS.set(sheetIndex, worksheetImageIdMap); } const sheetImages = XLSX_WORKSHEET_IMAGES.get(sheetIndex); if (!sheetImages) { XLSX_WORKSHEET_IMAGES.set(sheetIndex, [calculatedImage]); } else { sheetImages.push(calculatedImage); } if (!worksheetImageIdMap.get(image.id)) { worksheetImageIdMap.set(image.id, { index: worksheetImageIdMap.size, type: image.imageType }); } } function buildImageMap(params) { const { imageToAdd, idx } = params; const mappedImagesToSheet = XLSX_IMAGES.get(imageToAdd.id); if (mappedImagesToSheet) { const currentSheetImages = mappedImagesToSheet.find((currentImage) => currentImage.sheetId === idx); if (currentSheetImages) { currentSheetImages.image.push(imageToAdd); } else { mappedImagesToSheet.push({ sheetId: idx, image: [imageToAdd] }); } } else { XLSX_IMAGES.set(imageToAdd.id, [{ sheetId: idx, image: [imageToAdd] }]); XLSX_WORKBOOK_IMAGE_IDS.set(imageToAdd.id, { type: imageToAdd.imageType, index: XLSX_WORKBOOK_IMAGE_IDS.size }); } } function addSheetName(worksheet) { const name = _escapeString(worksheet.name) || ""; let append = ""; while (XLSX_SHEET_NAMES.indexOf(`${name}${append}`) !== -1) { if (append === "") { append = "_1"; } else { const curr = parseInt(append.slice(1), 10); append = `_${curr + 1}`; } } worksheet.name = `${name}${append}`; XLSX_SHEET_NAMES.push(worksheet.name); } function getXlsxStringPosition(str) { if (XLSX_SHARED_STRINGS.has(str)) { return XLSX_SHARED_STRINGS.get(str); } XLSX_SHARED_STRINGS.set(str, XLSX_SHARED_STRINGS.size); return XLSX_SHARED_STRINGS.size - 1; } function resetXlsxFactory() { XLSX_SHARED_STRINGS.clear(); XLSX_IMAGES.clear(); XLSX_WORKSHEET_IMAGES.clear(); XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.clear(); XLSX_WORKBOOK_IMAGE_IDS.clear(); XLSX_WORKSHEET_IMAGE_IDS.clear(); XLSX_WORKSHEET_DATA_TABLES.clear(); XLSX_SHEET_NAMES = []; XLSX_SHEET_DATA = []; XLSX_SHEET_CONTENT_INDICES = /* @__PURE__ */ new Map(); XLSX_FACTORY_MODE = "SINGLE_SHEET"; } function createXlsxWorkbook(currentSheet2) { return createXmlPart(workbook_default.getTemplate(XLSX_SHEET_NAMES, currentSheet2)); } function createXlsxStylesheet(defaultFontSize) { return createXmlPart(stylesheet_default.getTemplate(defaultFontSize)); } function createXlsxSharedStrings() { return createXmlPart(sharedStrings_default.getTemplate(XLSX_SHARED_STRINGS)); } function createXlsxCore(author) { return createXmlPart(core_default2.getTemplate(author)); } function createXlsxCustomProperties(metadata) { return createXmlPart(customProperties_default.getTemplate(metadata)); } function createXlsxContentTypes(sheetLen, hasCustomProperties) { return createXmlPart(contentTypes_default.getTemplate({ sheetLen, hasCustomProperties })); } function createXlsxRels(hasCustomProperties) { const relationships = [ { Id: "rId1", Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", Target: "xl/workbook.xml" }, { Id: "rId2", Type: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", Target: "docProps/core.xml" } ]; if (hasCustomProperties) { relationships.push({ Id: "rId3", Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", Target: "docProps/custom.xml" }); } const rs = relationships_default.getTemplate(relationships); return createXmlPart(rs); } function createXlsxTheme() { return createXmlPart(office_default.getTemplate()); } function createXlsxTable(dataTable, index) { return createXmlPart(table_default.getTemplate(dataTable, index)); } function createXlsxWorkbookRels(sheetLen) { const worksheets = new Array(sheetLen).fill(void 0).map((v, i) => ({ Id: `rId${i + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", Target: `worksheets/sheet${i + 1}.xml` })); const rs = relationships_default.getTemplate([ ...worksheets, { Id: `rId${sheetLen + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", Target: "theme/theme1.xml" }, { Id: `rId${sheetLen + 2}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", Target: "styles.xml" }, { Id: `rId${sheetLen + 3}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings", Target: "sharedStrings.xml" } ]); return createXmlPart(rs); } function createXlsxDrawing(sheetIndex) { return createXmlPart(drawing_default.getTemplate({ sheetIndex })); } function createXlsxDrawingRel(sheetIndex) { const worksheetImageIds = XLSX_WORKSHEET_IMAGE_IDS.get(sheetIndex) || []; const XMLArr = []; for (const [key, value] of worksheetImageIds) { const { index, type } = value; XMLArr.push({ Id: `rId${index + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Target: `../media/image${XLSX_WORKBOOK_IMAGE_IDS.get(key).index + 1}.${_normaliseImageExtension(type)}` }); } return createXmlPart(relationships_default.getTemplate(XMLArr)); } function createXlsxVmlDrawing(sheetIndex) { return createXmlPart(vmlDrawing_default.getTemplate({ sheetIndex }), true); } function createXlsxVmlDrawingRel(sheetIndex) { const worksheetHeaderFooterImages = XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.get(sheetIndex) || []; const XMLArr = []; for (let i = 0; i < worksheetHeaderFooterImages.length; i++) { const headerFooterImage = worksheetHeaderFooterImages[i]; const workbookImage = XLSX_WORKBOOK_IMAGE_IDS.get(headerFooterImage.id); if (!workbookImage) { continue; } const { index, type } = workbookImage; XMLArr.push({ Id: `rId${i + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Target: `../media/image${index + 1}.${_normaliseImageExtension(type)}` }); } return createXmlPart(relationships_default.getTemplate(XMLArr)); } function createXlsxRelationships({ drawingIndex, vmlDrawingIndex, tableName } = {}) { if (drawingIndex === void 0 && vmlDrawingIndex === void 0 && tableName === void 0) { return ""; } const config = []; if (drawingIndex != null) { config.push({ Id: `rId${config.length + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing", Target: `../drawings/drawing${drawingIndex + 1}.xml` }); } if (vmlDrawingIndex != null) { config.push({ Id: `rId${config.length + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing", Target: `../drawings/vmlDrawing${vmlDrawingIndex + 1}.vml` }); } if (tableName != null) { config.push({ Id: `rId${config.length + 1}`, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table", Target: `../tables/${tableName}.xml` }); } const rs = relationships_default.getTemplate(config); return createXmlPart(rs); } function createWorksheet(worksheet, config) { return createXmlPart( worksheet_default.getTemplate({ worksheet, currentSheet: XLSX_SHEET_NAMES.length - 1, config }) ); } var reorderSheetSpecificMap = (map, order) => { if (!map.size) { return; } const remapped = /* @__PURE__ */ new Map(); order.forEach((originalIdx, newIdx) => { if (map.has(originalIdx)) { remapped.set(newIdx, map.get(originalIdx)); } }); map.clear(); remapped.forEach((value, key) => map.set(key, value)); }; var registerSheetXml = (worksheetXml) => { const indices = XLSX_SHEET_CONTENT_INDICES.get(worksheetXml) ?? []; indices.push(XLSX_SHEET_NAMES.length - 1); XLSX_SHEET_CONTENT_INDICES.set(worksheetXml, indices); XLSX_SHEET_DATA.push(worksheetXml); }; var getSheetOrderFromRefs = (data) => { const refMap = new Map(XLSX_SHEET_CONTENT_INDICES); const order = []; for (const sheetData of data) { const indices = refMap.get(sheetData); if (!indices?.length) { return null; } const idx = indices.shift(); order.push(idx); refMap.set(sheetData, indices); } return order; }; var getSheetOrderFromData = (data) => { if (!data.length || XLSX_SHEET_DATA.length === 0) { return null; } const consumed = /* @__PURE__ */ new Set(); const order = []; for (const sheetData of data) { const matchIndex = XLSX_SHEET_DATA.findIndex((value, idx) => !consumed.has(idx) && value === sheetData); if (matchIndex === -1) { return null; } consumed.add(matchIndex); order.push(matchIndex); } return order; }; var reorderSheetState = (order) => { const indexRemap = /* @__PURE__ */ new Map(); order.forEach((originalIdx, newIdx) => indexRemap.set(originalIdx, newIdx)); XLSX_SHEET_NAMES = order.map((idx) => XLSX_SHEET_NAMES[idx]); XLSX_SHEET_DATA = order.map((idx) => XLSX_SHEET_DATA[idx]); reorderSheetSpecificMap(XLSX_WORKSHEET_IMAGES, order); reorderSheetSpecificMap(XLSX_WORKSHEET_HEADER_FOOTER_IMAGES, order); reorderSheetSpecificMap(XLSX_WORKSHEET_DATA_TABLES, order); reorderSheetSpecificMap(XLSX_WORKSHEET_IMAGE_IDS, order); XLSX_IMAGES.forEach((sheetImages) => { sheetImages.forEach((entry) => { const remappedId = indexRemap.get(entry.sheetId); if (remappedId != null) { entry.sheetId = remappedId; } }); }); XLSX_SHEET_CONTENT_INDICES = /* @__PURE__ */ new Map(); XLSX_SHEET_DATA.forEach((xml, idx) => { const indices = XLSX_SHEET_CONTENT_INDICES.get(xml) ?? []; indices.push(idx); XLSX_SHEET_CONTENT_INDICES.set(xml, indices); }); }; var syncXlsxOrderWithSheetData = (data) => { if (data.length <= 1) { return; } const order = getSheetOrderFromRefs(data) ?? getSheetOrderFromData(data); if (!order) { return; } reorderSheetState(order); }; var Workbook = class { getStringPosition(str) { return getXlsxStringPosition(str); } addBodyImageToMap(image, rowIndex, col, columnsToExport, rowHeight) { addXlsxBodyImageToMap(image, rowIndex, col, columnsToExport, rowHeight); } addHeaderFooterImageToMap(image, position) { addXlsxHeaderFooterImageToMap(image, position); } addWorksheet(styles, worksheet, config) { return createXlsxExcel(styles, worksheet, config); } syncOrderWithSheetData(data) { syncXlsxOrderWithSheetData(data); } reset() { resetXlsxFactory(); } setFactoryMode(factoryMode) { setXlsxFactoryMode(factoryMode); } getFactoryMode() { return getXlsxFactoryMode(); } getSheetNames() { return [...XLSX_SHEET_NAMES]; } }; // packages/ag-grid-enterprise/src/excelExport/zipContainer/compress.ts var compressBlob = async (data) => { let chunksSize = 0; const chunks = []; const writeCompressedData = new WritableStream({ write: (chunk) => { chunks.push(chunk); chunksSize += chunk.length; } }); const readable = new ReadableStream({ start: (controller) => { const reader = new FileReader(); reader.onload = (e) => { if (e.target?.result) { controller.enqueue(e.target.result); } controller.close(); }; reader.readAsArrayBuffer(data); } }); const compressStream = new window.CompressionStream("deflate-raw"); await readable.pipeThrough(compressStream).pipeTo(writeCompressedData); return { size: chunksSize, content: new Blob(chunks) }; }; var deflateLocalFile = async (rawContent) => { const contentAsBlob = new Blob([rawContent]); const { size: compressedSize, content: compressedContent } = await compressBlob(contentAsBlob); const compressedContentAsUint8Array = new Uint8Array(await compressedContent.arrayBuffer()); return { size: compressedSize, content: compressedContentAsUint8Array }; }; // packages/ag-grid-enterprise/src/excelExport/zipContainer/convert.ts var convertTime = (date) => { let time = date.getHours(); time <<= 6; time = time | date.getMinutes(); time <<= 5; time = time | date.getSeconds() / 2; return time; }; var convertDate = (date) => { let dt = date.getFullYear() - 1980; dt <<= 4; dt = dt | date.getMonth() + 1; dt <<= 5; dt = dt | date.getDate(); return dt; }; function convertDecToHex(number, bytes) { let hex = ""; for (let i = 0; i < bytes; i++) { hex += String.fromCharCode(number & 255); number >>>= 8; } return hex; } // packages/ag-grid-enterprise/src/excelExport/zipContainer/crcTable.ts var getCrcFromCrc32TableAndByteArray = (content) => { if (!content.length) { return 0; } let crc = 0 ^ -1; let j = 0; let k = 0; let l = 0; for (let i = 0; i < content.length; i++) { j = content[i]; k = (crc ^ j) & 255; l = crcTable[k]; crc = crc >>> 8 ^ l; } return crc ^ -1; }; var getCrcFromCrc32Table = (content) => { if (!content.length) { return 0; } if (typeof content === "string") { return getCrcFromCrc32TableAndByteArray(new TextEncoder().encode(content)); } return getCrcFromCrc32TableAndByteArray(content); }; var crcTable = /* @__PURE__ */ new Uint32Array([ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ]); // packages/ag-grid-enterprise/src/excelExport/zipContainer/zipContainerHelper.ts function _utf8_encode(s2) { const stringFromCharCode = String.fromCharCode; function ucs2decode(string) { const output = []; if (!string) { return []; } const len = string.length; let counter = 0; let value; let extra; while (counter < len) { value = string.charCodeAt(counter++); if (value >= 55296 && value <= 56319 && counter < len) { extra = string.charCodeAt(counter++); if ((extra & 64512) == 56320) { output.push(((value & 1023) << 10) + (extra & 1023) + 65536); } else { output.push(value); counter--; } } else { output.push(value); } } return output; } function checkScalarValue(point) { if (point >= 55296 && point <= 57343) { throw new Error(_errMsg(255, { point })); } } function createByte(point, shift) { return stringFromCharCode(point >> shift & 63 | 128); } function encodeCodePoint(point) { if ((point & 4294967168) == 0) { return stringFromCharCode(point); } let symbol = ""; if ((point & 4294965248) == 0) { symbol = stringFromCharCode(point >> 6 & 31 | 192); } else if ((point & 4294901760) == 0) { checkScalarValue(point); symbol = stringFromCharCode(point >> 12 & 15 | 224); symbol += createByte(point, 6); } else if ((point & 4292870144) == 0) { symbol = stringFromCharCode(point >> 18 & 7 | 240); symbol += createByte(point, 12); symbol += createByte(point, 6); } symbol += stringFromCharCode(point & 63 | 128); return symbol; } const codePoints = ucs2decode(s2); const length = codePoints.length; let index = -1; let codePoint; let byteString = ""; while (++index < length) { codePoint = codePoints[index]; byteString += encodeCodePoint(codePoint); } return byteString; } var getHeaders = (currentFile, isCompressed, offset, rawSize, rawContent, deflatedSize) => { const { content, path, created: creationDate } = currentFile; const time = convertTime(creationDate); const dt = convertDate(creationDate); const crcFlag = getCrcFromCrc32Table(rawContent); const zipSize = deflatedSize !== void 0 ? deflatedSize : rawSize; const utfPath = _utf8_encode(path); const isUTF8 = utfPath !== path; let extraFields = ""; if (isUTF8) { const uExtraFieldPath = convertDecToHex(1, 1) + convertDecToHex(getCrcFromCrc32Table(utfPath), 4) + utfPath; extraFields = "up" + convertDecToHex(uExtraFieldPath.length, 2) + uExtraFieldPath; } const commonHeader = "\0" + // version needed to extract (isUTF8 ? "\0\b" : "\0\0") + // Language encoding flag (EFS) (12th bit turned on) convertDecToHex(isCompressed ? 8 : 0, 2) + // As per ECMA-376 Part 2 specs convertDecToHex(time, 2) + // last modified time convertDecToHex(dt, 2) + // last modified date convertDecToHex(zipSize ? crcFlag : 0, 4) + convertDecToHex(deflatedSize ?? rawSize, 4) + // compressed size convertDecToHex(rawSize, 4) + // uncompressed size convertDecToHex(utfPath.length, 2) + // file name length convertDecToHex(extraFields.length, 2); const localFileHeader = "PK" + commonHeader + utfPath + extraFields; const centralDirectoryHeader = "PK\0" + commonHeader + // file header "\0\0\0\0\0\0" + (content ? "\0\0\0\0" : "\0\0\0") + // external file attributes convertDecToHex(offset, 4) + // relative offset of local header utfPath + // file name extraFields; return { localFileHeader: Uint8Array.from(localFileHeader, (c) => c.charCodeAt(0)), centralDirectoryHeader: Uint8Array.from(centralDirectoryHeader, (c) => c.charCodeAt(0)) }; }; var getDecodedContent = (content) => { let contentToUse; if (typeof content === "string") { const base64String = atob(content.split(";base64,")[1]); contentToUse = Uint8Array.from(base64String, (c) => c.charCodeAt(0)); } else { contentToUse = content; } return { size: contentToUse.length, content: contentToUse }; }; var preprocessFileForZip = async (currentFile) => { const { content } = currentFile; const { size: rawSize, content: rawContent } = !content ? { size: 0, content: Uint8Array.from([]) } : getDecodedContent(content); let deflatedContent; let deflatedSize; let deflationPerformed = false; const shouldDeflate = currentFile.type === "file" && rawContent && rawSize > 0; if (shouldDeflate) { const result = await deflateLocalFile(rawContent); deflatedContent = result.content; deflatedSize = result.size; deflationPerformed = true; } return { rawContent, rawSize, deflatedContent, deflatedSize, isCompressed: deflationPerformed }; }; var getHeaderAndContent = (currentFile, offset) => { const { content } = currentFile; const { content: rawContent } = !content ? { content: Uint8Array.from([]) } : getDecodedContent(content); const headers = getHeaders(currentFile, false, offset, rawContent.length, rawContent, void 0); return { ...headers, content: rawContent, isCompressed: false }; }; var buildCentralDirectoryEnd = (tLen, cLen, lLen) => { const str = "PK\0\0\0\0" + convertDecToHex(tLen, 2) + // total number of entries in the central folder convertDecToHex(tLen, 2) + // total number of entries in the central folder convertDecToHex(cLen, 4) + // size of the central folder convertDecToHex(lLen, 4) + // central folder start offset "\0\0"; return Uint8Array.from(str, (c) => c.charCodeAt(0)); }; // packages/ag-grid-enterprise/src/excelExport/zipContainer/zipContainer.ts var ZipContainer = class { constructor() { this.folders = []; this.files = []; } addFolders(paths) { paths.forEach(this.addFolder.bind(this)); } addFolder(path) { this.folders.push({ path, created: /* @__PURE__ */ new Date(), isBase64: false, type: "folder" }); } addFile(path, content, isBase64 = false) { this.files.push({ path, created: /* @__PURE__ */ new Date(), content: isBase64 ? content : new TextEncoder().encode(content), isBase64, type: "file" }); } async getZipFile(mimeType = "application/zip") { const textOutput = await this.buildCompressedFileStream(); this.clearStream(); return new Blob([textOutput], { type: mimeType }); } getUncompressedZipFile(mimeType = "application/zip") { const textOutput = this.buildFileStream(); this.clearStream(); return new Blob([textOutput], { type: mimeType }); } clearStream() { this.folders = []; this.files = []; } packageFiles(files) { let fileLen = 0; let folderLen = 0; for (const currentFile of files) { const { localFileHeader, centralDirectoryHeader, content } = currentFile; fileLen += localFileHeader.length + content.length; folderLen += centralDirectoryHeader.length; } const fileData = new Uint8Array(fileLen); const folderData = new Uint8Array(folderLen); let fileOffset = 0; let folderOffset = 0; for (const currentFile of files) { const { localFileHeader, centralDirectoryHeader, content } = currentFile; fileData.set(localFileHeader, fileOffset); fileOffset += localFileHeader.length; fileData.set(content, fileOffset); fileOffset += content.length; folderData.set(centralDirectoryHeader, folderOffset); folderOffset += centralDirectoryHeader.length; } const folderEnd = buildCentralDirectoryEnd(files.length, folderLen, fileLen); const result = new Uint8Array(fileData.length + folderData.length + folderEnd.length); result.set(fileData); result.set(folderData, fileData.length); result.set(folderEnd, fileData.length + folderData.length); return result; } async buildCompressedFileStream() { const totalFiles = [...this.folders, ...this.files]; const preprocessed = await Promise.all(totalFiles.map(preprocessFileForZip)); const processed = []; let offset = 0; for (let i = 0; i < totalFiles.length; i++) { const currentFile = totalFiles[i]; const { rawContent, rawSize, deflatedContent, deflatedSize, isCompressed } = preprocessed[i]; const headers = getHeaders(currentFile, isCompressed, offset, rawSize, rawContent, deflatedSize); const contentToUse = deflatedContent ?? rawContent; processed.push({ ...headers, content: contentToUse, isCompressed }); offset += headers.localFileHeader.length + contentToUse.length; } return this.packageFiles(processed); } buildFileStream() { const totalFiles = [...this.folders, ...this.files]; const readyFiles = []; let lL = 0; for (const currentFile of totalFiles) { const readyFile = getHeaderAndContent(currentFile, lL); const { localFileHeader, content } = readyFile; readyFiles.push(readyFile); lL += localFileHeader.length + content.length; } return this.packageFiles(readyFiles); } }; // packages/ag-grid-enterprise/src/excelExport/excelCreator.ts var createExcelXMLCoreFolderStructure = (zipContainer) => { zipContainer.addFolders(["_rels/", "docProps/", "xl/", "xl/theme/", "xl/_rels/", "xl/worksheets/"]); if (!XLSX_IMAGES.size) { return; } zipContainer.addFolders(["xl/worksheets/_rels", "xl/drawings/", "xl/drawings/_rels", "xl/media/"]); let imgCounter = 0; XLSX_IMAGES.forEach((value) => { const firstImage = value[0].image[0]; const { base64, imageType } = firstImage; zipContainer.addFile(`xl/media/image${++imgCounter}.${_normaliseImageExtension(imageType)}`, base64, true); }); }; var createExcelXmlWorksheets = (zipContainer, data) => { let imageRelationCounter = 0; let headerFooterImageCounter = 0; for (let i = 0; i < data.length; i++) { const value = data[i]; zipContainer.addFile(`xl/worksheets/sheet${i + 1}.xml`, value, false); const hasImages = XLSX_IMAGES.size > 0 && XLSX_WORKSHEET_IMAGES.has(i); const tableData = XLSX_WORKSHEET_DATA_TABLES.size > 0 && XLSX_WORKSHEET_DATA_TABLES.get(i); const hasHeaderFooterImages = XLSX_IMAGES.size && XLSX_WORKSHEET_HEADER_FOOTER_IMAGES.has(i); if (!hasImages && !tableData && !hasHeaderFooterImages) { continue; } let tableName; let drawingIndex; let vmlDrawingIndex; if (hasImages) { createExcelXmlDrawings(zipContainer, i, imageRelationCounter); drawingIndex = imageRelationCounter; imageRelationCounter++; } if (hasHeaderFooterImages) { createExcelVmlDrawings(zipContainer, i, headerFooterImageCounter); vmlDrawingIndex = headerFooterImageCounter; headerFooterImageCounter++; } if (tableData) { tableName = tableData.name; } const worksheetRelFile = `xl/worksheets/_rels/sheet${i + 1}.xml.rels`; zipContainer.addFile( worksheetRelFile, createXlsxRelationships({ tableName, drawingIndex, vmlDrawingIndex }) ); } }; var createExcelXmlDrawings = (zipContainer, sheetIndex, drawingIndex) => { const drawingFolder = "xl/drawings"; const drawingFileName = `${drawingFolder}/drawing${drawingIndex + 1}.xml`; const relFileName = `${drawingFolder}/_rels/drawing${drawingIndex + 1}.xml.rels`; zipContainer.addFile(relFileName, createXlsxDrawingRel(sheetIndex)); zipContainer.addFile(drawingFileName, createXlsxDrawing(sheetIndex)); }; var createExcelVmlDrawings = (zipContainer, sheetIndex, drawingIndex) => { const drawingFolder = "xl/drawings"; const drawingFileName = `${drawingFolder}/vmlDrawing${drawingIndex + 1}.vml`; const relFileName = `${drawingFolder}/_rels/vmlDrawing${drawingIndex + 1}.vml.rels`; zipContainer.addFile(drawingFileName, createXlsxVmlDrawing(sheetIndex)); zipContainer.addFile(relFileName, createXlsxVmlDrawingRel(sheetIndex)); }; var createExcelXmlTables = (zipContainer) => { const tablesDataByWorksheet = XLSX_WORKSHEET_DATA_TABLES; const worksheetKeys = Array.from(tablesDataByWorksheet.keys()); for (let i = 0; i < worksheetKeys.length; i++) { const sheetIndex = worksheetKeys[i]; const table = tablesDataByWorksheet.get(sheetIndex); if (!table) { continue; } zipContainer.addFile(`xl/tables/${table.name}.xml`, createXlsxTable(table, i)); } }; var createExcelXmlCoreSheets = (zipContainer, fontSize, author, sheetLen, activeTab, customMetadata) => { const hasCustomMetadata = !!customMetadata && Object.keys(customMetadata).some((key) => customMetadata[key] != null); zipContainer.addFile("xl/workbook.xml", createXlsxWorkbook(activeTab)); zipContainer.addFile("xl/styles.xml", createXlsxStylesheet(fontSize)); zipContainer.addFile("xl/sharedStrings.xml", createXlsxSharedStrings()); zipContainer.addFile("xl/theme/theme1.xml", createXlsxTheme()); zipContainer.addFile("xl/_rels/workbook.xml.rels", createXlsxWorkbookRels(sheetLen)); zipContainer.addFile("docProps/core.xml", createXlsxCore(author)); if (hasCustomMetadata) { zipContainer.addFile("docProps/custom.xml", createXlsxCustomProperties(customMetadata)); } zipContainer.addFile("[Content_Types].xml", createXlsxContentTypes(sheetLen, hasCustomMetadata)); zipContainer.addFile("_rels/.rels", createXlsxRels(hasCustomMetadata)); }; var createExcelFileForExcel = (zipContainer, data, options = {}, workbook) => { if (!data || data.length === 0) { _warn(159); workbook.reset(); return false; } workbook.syncOrderWithSheetData(data); const { fontSize = 11, author = "AG Grid", activeTab = 0, customMetadata } = options; const len = data.length; const activeTabWithinBounds = Math.max(Math.min(activeTab, len - 1), 0); createExcelXMLCoreFolderStructure(zipContainer); createExcelXmlTables(zipContainer); createExcelXmlWorksheets(zipContainer, data); createExcelXmlCoreSheets(zipContainer, fontSize, author, len, activeTabWithinBounds, customMetadata); workbook.reset(); return true; }; var getMultipleSheetsAsExcelCompressed = (params, workbook = new Workbook()) => { const { data, fontSize, author, activeSheetIndex, customMetadata } = params; const mimeType = params.mimeType || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; const zipContainer = new ZipContainer(); if (!createExcelFileForExcel( zipContainer, data, { author, fontSize, activeTab: activeSheetIndex, customMetadata }, workbook )) { return Promise.resolve(void 0); } return zipContainer.getZipFile(mimeType); }; var getMultipleSheetsAsExcel = (params, workbook = new Workbook()) => { const { data, fontSize, author, activeSheetIndex: activeTab, customMetadata } = params; const mimeType = params.mimeType || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; const zipContainer = new ZipContainer(); if (!createExcelFileForExcel( zipContainer, data, { author, fontSize, activeTab, customMetadata }, workbook )) { return; } return zipContainer.getUncompressedZipFile(mimeType); }; var exportMultipleSheetsAsExcel = (params) => { const { fileName = "export.xlsx" } = params; const workbook = new Workbook(); getMultipleSheetsAsExcelCompressed(params, workbook).then((contents) => { if (contents) { const downloadFileName = typeof fileName === "function" ? fileName() : fileName; _downloadFile(downloadFileName, contents); } }); }; var ExcelCreator = class extends BaseCreator { constructor() { super(...arguments); this.beanName = "excelCreator"; this.workbook = new Workbook(); } getMergedParams(params) { const baseParams6 = this.gos.get("defaultExcelExportParams"); return Object.assign({}, baseParams6, params); } export(userParams) { if (this.isExportSuppressed()) { _warn(160); return; } const exportFunc = () => { const mergedParams = this.getMergedParams(userParams); const data = this.getData(mergedParams); const { fontSize, author, mimeType, customMetadata } = mergedParams; const exportParams = { data: [data], fontSize, author, mimeType, customMetadata }; this.packageCompressedFile(exportParams).then((packageFile) => { if (packageFile) { const { fileName } = mergedParams; const providedFileName = typeof fileName === "function" ? fileName(_addGridCommonParams(this.gos, {})) : fileName; _downloadFile(this.getFileName(providedFileName), packageFile); } }); }; const { overlays } = this.beans; if (overlays) { overlays.showExportOverlay(exportFunc); } else { exportFunc(); } } exportDataAsExcel(params) { this.export(params); } getDataAsExcel(params) { const mergedParams = this.getMergedParams(params); const data = this.getData(mergedParams); const { fontSize, author, mimeType, customMetadata } = mergedParams; const exportParams = { data: [data], fontSize, author, mimeType, customMetadata }; return this.packageFile(exportParams); } setFactoryMode(factoryMode) { this.workbook.setFactoryMode(factoryMode); } getFactoryMode() { return this.workbook.getFactoryMode(); } getSheetDataForExcel(params) { const mergedParams = this.getMergedParams(params); return this.getData(mergedParams); } getMultipleSheetsAsExcel(params) { return getMultipleSheetsAsExcel(params, this.workbook); } exportMultipleSheetsAsExcel(params) { getMultipleSheetsAsExcelCompressed(params, this.workbook).then((contents) => { const { fileName = "export.xlsx" } = params; if (contents) { const downloadFileName = typeof fileName === "function" ? fileName() : fileName; _downloadFile(downloadFileName, contents); } }); } getDefaultFileExtension() { return "xlsx"; } createSerializingSession(params) { const { colModel, colNames, rowGroupColsSvc, valueSvc, formula, gos } = this.beans; const baseExcelStyles = gos.get("excelStyles") || []; const styleLinker = this.createStyleLinker(baseExcelStyles); const config = { ...params, colModel, colNames, rowGroupColsSvc, valueSvc, formulaSvc: formula, gos, suppressRowOutline: params.suppressRowOutline || params.skipRowGroups, headerRowHeight: params.headerRowHeight || params.rowHeight, baseExcelStyles, rightToLeft: params.rightToLeft ?? gos.get("enableRtl"), styleLinker, headerRowCount: getHeaderRowCount(colModel), pivotModeActive: colModel.isPivotActive(), workbook: this.workbook }; return new ExcelSerializingSession(config); } createStyleLinker(baseExcelStyles) { const styleIds = []; const styleIdsSet = /* @__PURE__ */ new Set(); const styleIdOrder = /* @__PURE__ */ new Map(); baseExcelStyles.forEach((it, idx) => { styleIds.push(it.id); styleIdsSet.add(it.id); styleIdOrder.set(it.id, idx); }); const { gos, cellStyles } = this.beans; return (params) => { const { rowType, rowIndex, value, column, columnGroup, node } = params; const isHeader = rowType === "HEADER"; const isGroupHeader = rowType === "HEADER_GROUPING"; const col = isHeader ? column : columnGroup; let headerClasses = []; if (isHeader || isGroupHeader) { headerClasses.push("header"); if (isGroupHeader) { headerClasses.push("headerGroup"); } if (col) { headerClasses = headerClasses.concat( _getHeaderClassesFromColDef( col.getDefinition(), gos, column || null, columnGroup || null ) ); } return headerClasses; } const applicableStyles = ["cell"]; if (!styleIds.length) { return applicableStyles; } const colDef = column.getDefinition(); cellStyles?.processAllCellClasses( colDef, _addGridCommonParams(gos, { value, data: node.data, node, colDef, column, rowIndex }), (className) => { if (styleIdsSet.has(className)) { applicableStyles.push(className); } } ); return applicableStyles.sort((left, right) => { const leftIdx = styleIdOrder.get(left) ?? -1; const rightIdx = styleIdOrder.get(right) ?? -1; return leftIdx === rightIdx ? 0 : leftIdx < rightIdx ? -1 : 1; }); }; } isExportSuppressed() { return this.gos.get("suppressExcelExport"); } packageCompressedFile(params) { return getMultipleSheetsAsExcelCompressed(params, this.workbook); } packageFile(params) { return getMultipleSheetsAsExcel(params, this.workbook); } }; // packages/ag-grid-enterprise/src/agStack/agVirtualList.css var agVirtualList_default = ":where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:auto;position:relative;width:100%}.ag-virtual-list-container{overflow:hidden;position:relative}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}"; // packages/ag-grid-enterprise/src/agStack/agVirtualList.ts function getVirtualListTemplate(cssIdentifier) { return { tag: "div", cls: `ag-virtual-list-viewport ag-${cssIdentifier}-virtual-list-viewport`, role: "presentation", children: [ { tag: "div", ref: "eContainer", cls: `ag-virtual-list-container ag-${cssIdentifier}-virtual-list-container` } ] }; } var AgVirtualList = class extends AgTabGuardComp { constructor(stopPropagationCallbacks, params) { super(getVirtualListTemplate(params?.cssIdentifier || "default")); this.stopPropagationCallbacks = stopPropagationCallbacks; this.renderedRows = /* @__PURE__ */ new Map(); this.rowHeight = 20; this.pageSize = -1; this.isScrolling = false; this.isHeightFromTheme = true; this.eContainer = RefPlaceholder; this.awaitStableCallbacks = []; this.registerCSS(agVirtualList_default); const { cssIdentifier = "default", ariaRole = "listbox", listName, moveItemCallback } = params || {}; this.cssIdentifier = cssIdentifier; this.ariaRole = ariaRole; this.listName = listName; this.moveItemCallback = moveItemCallback; } postConstruct() { this.addScrollListener(); this.rowHeight = this.getItemHeight(); this.addResizeObserver(); this.initialiseTabGuard( { onFocusIn: (e) => this.onFocusIn(e), onFocusOut: (e) => this.onFocusOut(e), focusInnerElement: (fromBottom) => this.focusInnerElement(fromBottom), onTabKeyDown: (e) => this.onTabKeyDown(e), handleKeyDown: (e) => this.handleKeyDown(e) }, this.stopPropagationCallbacks ); this.refreshAriaProperties(); this.addManagedEventListeners({ stylesChanged: this.onStylesChanged.bind(this) }); } onStylesChanged(e) { if (e.listItemHeightChanged) { this.rowHeight = this.getItemHeight(); this.refresh(); } } refreshAriaProperties() { const translate = this.getLocaleTextFunc(); const listName = translate("ariaDefaultListName", this.listName || "List"); const ariaEl = this.eContainer; _setAriaRole(ariaEl, this.model?.getRowCount() > 0 ? this.ariaRole : "presentation"); _setAriaLabel(ariaEl, listName); } addResizeObserver() { const listener = () => _requestAnimationFrame(this.beans, () => this.drawVirtualRows()); const destroyObserver = _observeResize(this.beans, this.getGui(), listener); this.addDestroyFunc(destroyObserver); } focusInnerElement(fromBottom) { this.focusRow(fromBottom ? this.model.getRowCount() - 1 : 0); return true; } onFocusIn(e) { const target = e.target; if (target.classList.contains("ag-virtual-list-item")) { this.lastFocusedRowIndex = _getAriaPosInSet(target) - 1; } } onFocusOut(e) { if (!this.getFocusableElement().contains(e.relatedTarget)) { this.lastFocusedRowIndex = null; } } handleKeyDown(e) { const { key, shiftKey } = e; switch (key) { case KeyCode.UP: case KeyCode.DOWN: { const isUp = key === KeyCode.UP; e.preventDefault(); if (shiftKey) { this.moveItem(isUp); } else { this.navigate(isUp); } } break; case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: case KeyCode.PAGE_UP: case KeyCode.PAGE_DOWN: if (this.navigateToPage(key) !== null) { e.preventDefault(); } break; } } onTabKeyDown(e) { this.stopPropagationCallbacks?.stopPropagation(e); this.forceFocusOutOfContainer(e.shiftKey); } getNextRow(up) { if (this.lastFocusedRowIndex == null) { return void 0; } const nextRow = this.lastFocusedRowIndex + (up ? -1 : 1); if (nextRow < 0 || nextRow >= this.model.getRowCount()) { return void 0; } return nextRow; } moveItem(up) { if (!this.moveItemCallback) { return; } const item = this.getComponentAt(this.lastFocusedRowIndex); if (!item) { return; } this.moveItemCallback(item, up); } navigate(up) { const nextRow = this.getNextRow(up); if (nextRow === void 0) { return; } this.focusRow(nextRow); } navigateToPage(key, fromItem = "focused") { let hasFocus = false; if (fromItem === "focused") { fromItem = this.getLastFocusedRow(); hasFocus = true; } const rowCount = this.model.getRowCount() - 1; let newIndex = -1; if (key === KeyCode.PAGE_HOME) { newIndex = 0; } else if (key === KeyCode.PAGE_END) { newIndex = rowCount; } else if (key === KeyCode.PAGE_DOWN) { newIndex = Math.min(fromItem + this.pageSize, rowCount); } else if (key === KeyCode.PAGE_UP) { newIndex = Math.max(fromItem - this.pageSize, 0); } if (newIndex === -1) { return null; } if (hasFocus) { this.focusRow(newIndex); } else { this.ensureIndexVisible(newIndex); } return newIndex; } getLastFocusedRow() { return this.lastFocusedRowIndex; } focusRow(rowNumber) { if (this.isScrolling) { return; } this.isScrolling = true; this.ensureIndexVisible(rowNumber); _requestAnimationFrame(this.beans, () => { this.isScrolling = false; if (!this.isAlive()) { return; } const renderedRow = this.renderedRows.get(rowNumber); if (renderedRow) { renderedRow.eDiv.focus(); } }); } getComponentAt(rowIndex) { const comp = this.renderedRows.get(rowIndex); return comp && comp.rowComponent; } forEachRenderedRow(func) { this.renderedRows.forEach((value, key) => func(value.rowComponent, key)); } getItemHeight() { if (!this.isHeightFromTheme) { return this.rowHeight; } return this.beans.environment.getDefaultListItemHeight(); } /** * Returns true if the view had to be scrolled, otherwise, false. */ ensureIndexVisible(index, scrollPartialIntoView = true) { const lastRow = this.model.getRowCount(); if (typeof index !== "number" || index < 0 || index >= lastRow) { return false; } const rowTopPixel = index * this.rowHeight; const rowBottomPixel = rowTopPixel + this.rowHeight; const eGui = this.getGui(); const viewportTopPixel = eGui.scrollTop; const viewportHeight = eGui.offsetHeight; const viewportBottomPixel = viewportTopPixel + viewportHeight; const diff = scrollPartialIntoView ? 0 : this.rowHeight; const viewportScrolledPastRow = viewportTopPixel > rowTopPixel + diff; const viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel - diff; if (viewportScrolledPastRow) { eGui.scrollTop = rowTopPixel; return true; } if (viewportScrolledBeforeRow) { const newScrollPosition = rowBottomPixel - viewportHeight; eGui.scrollTop = newScrollPosition; return true; } return false; } setComponentCreator(componentCreator) { this.componentCreator = componentCreator; } setComponentUpdater(componentUpdater) { this.componentUpdater = componentUpdater; } getRowHeight() { return this.rowHeight; } getScrollTop() { return this.getGui().scrollTop; } setRowHeight(rowHeight) { this.isHeightFromTheme = false; this.rowHeight = rowHeight; this.refresh(); } refresh(softRefresh) { if (this.model == null || !this.isAlive()) { return; } const rowCount = this.model.getRowCount(); this.eContainer.style.height = `${rowCount * this.rowHeight}px`; this.refreshAriaProperties(); this.awaitStable(() => { if (!this.isAlive()) { return; } if (this.canSoftRefresh(softRefresh)) { this.drawVirtualRows(true); } else { this.clearVirtualRows(); this.drawVirtualRows(); } }); } awaitStable(callback) { this.awaitStableCallbacks.push(callback); if (this.awaitStableCallbacks.length > 1) { return; } const rowCount = this.model.getRowCount(); _waitUntil( this, () => this.eContainer.clientHeight >= rowCount * this.rowHeight, () => { if (!this.isAlive()) { return; } const callbacks = this.awaitStableCallbacks; this.awaitStableCallbacks = []; for (const c of callbacks) { c(); } } ); } canSoftRefresh(softRefresh) { return !!(softRefresh && this.renderedRows.size && typeof this.model.areRowsEqual === "function" && this.componentUpdater); } clearVirtualRows() { this.renderedRows.forEach((_, rowIndex) => this.removeRow(rowIndex)); } drawVirtualRows(softRefresh) { if (!this.isAlive() || !this.model) { return; } const gui = this.getGui(); const topPixel = gui.scrollTop; const bottomPixel = topPixel + gui.offsetHeight; if (topPixel === bottomPixel) { this.clearVirtualRows(); } else { const firstRow = Math.floor(topPixel / this.rowHeight); const lastRow = Math.floor(bottomPixel / this.rowHeight); this.pageSize = Math.floor((bottomPixel - topPixel) / this.rowHeight); this.ensureRowsRendered(firstRow, lastRow, softRefresh); } } ensureRowsRendered(start, finish, softRefresh) { this.renderedRows.forEach((_, rowIndex) => { if ((rowIndex < start || rowIndex > finish) && rowIndex !== this.lastFocusedRowIndex) { this.removeRow(rowIndex); } }); if (softRefresh) { this.refreshRows(); } for (let rowIndex = start; rowIndex <= finish; rowIndex++) { if (this.renderedRows.has(rowIndex)) { continue; } if (rowIndex < this.model.getRowCount()) { this.insertRow(rowIndex); } } } insertRow(rowIndex) { const { model } = this; if (rowIndex < 0 || rowIndex >= model.getRowCount()) { return; } const { cssIdentifier, ariaRole, renderedRows, eContainer } = this; const value = model.getRow(rowIndex); const role = ariaRole === "tree" ? "treeitem" : "option"; const eDiv = _createAgElement({ tag: "div", cls: `ag-virtual-list-item ag-${cssIdentifier}-virtual-list-item`, role, attrs: { tabindex: "-1" } }); _setAriaSetSize(eDiv, model.getRowCount()); _setAriaPosInSet(eDiv, rowIndex + 1); const rowHeight = this.rowHeight; eDiv.style.height = `${rowHeight}px`; eDiv.style.top = `${rowHeight * rowIndex}px`; const rowComponent = this.componentCreator(value, eDiv); rowComponent.addGuiEventListener("focusin", () => this.lastFocusedRowIndex = rowIndex); eDiv.appendChild(rowComponent.getGui()); if (renderedRows.has(rowIndex - 1)) { renderedRows.get(rowIndex - 1).eDiv.insertAdjacentElement("afterend", eDiv); } else if (renderedRows.has(rowIndex + 1)) { renderedRows.get(rowIndex + 1).eDiv.insertAdjacentElement("beforebegin", eDiv); } else { eContainer.appendChild(eDiv); } renderedRows.set(rowIndex, { rowComponent, eDiv, value }); } removeRow(rowIndex) { const component = this.renderedRows.get(rowIndex); component.eDiv.remove(); this.destroyBean(component.rowComponent); this.renderedRows.delete(rowIndex); } refreshRows() { const rowCount = this.model.getRowCount(); this.renderedRows.forEach((row, rowIndex) => { if (rowIndex >= rowCount) { this.removeRow(rowIndex); } else { const newValue = this.model.getRow(rowIndex); if (this.model.areRowsEqual?.(row.value, newValue)) { this.componentUpdater(newValue, row.rowComponent); } else { this.removeRow(rowIndex); } } }); } addScrollListener() { this.addGuiEventListener("scroll", () => this.drawVirtualRows(), { passive: true }); } setModel(model) { this.model = model; } getAriaElement() { return this.eContainer; } destroy() { if (!this.isAlive()) { return; } this.clearVirtualRows(); this.awaitStableCallbacks.length = 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/agStack/agVirtualListDragFeature.css var agVirtualListDragFeature_default = '.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}'; // packages/ag-grid-enterprise/src/agStack/agVirtualListDragFeature.ts var LIST_ITEM_HOVERED = "ag-list-item-hovered"; var AgVirtualListDragFeature = class extends AgBeanStub { constructor(comp, virtualList, params) { super(); this.comp = comp; this.virtualList = virtualList; this.params = params; this.currentDragValue = null; this.lastHoveredListItem = null; } postConstruct() { this.beans.environment.addGlobalCSS(agVirtualListDragFeature_default, "component-AgVirtualListDragFeature"); this.params.addListeners(this, this.listItemDragStart.bind(this), this.listItemDragEnd.bind(this)); this.createDropTarget(); this.createAutoScrollService(); } listItemDragStart(event) { this.currentDragValue = this.params.getCurrentDragValue(event); this.moveBlocked = this.params.isMoveBlocked(this.currentDragValue); } listItemDragEnd() { window.setTimeout(() => { this.currentDragValue = null; this.moveBlocked = false; }, 10); } createDropTarget() { const dropTarget = { isInterestedIn: (type) => type === this.params.dragSourceType, getIconName: () => this.moveBlocked ? "pinned" : "move", getContainer: () => this.comp.getGui(), onDragging: (e) => this.onDragging(e), onDragStop: () => this.onDragStop(), onDragLeave: () => this.onDragLeave(), onDragCancel: () => this.onDragCancel() }; this.beans.dragAndDrop?.addDropTarget(dropTarget); } createAutoScrollService() { const virtualListGui = this.virtualList.getGui(); this.autoScrollService = new AutoScrollService({ scrollContainer: virtualListGui, scrollAxis: "y", getVerticalPosition: () => virtualListGui.scrollTop, setVerticalPosition: (position) => virtualListGui.scrollTop = position }); } onDragging(e) { if (!this.currentDragValue || this.moveBlocked) { return; } const hoveredListItem = this.getListDragItem(e); const comp = this.virtualList.getComponentAt(hoveredListItem.rowIndex); if (!comp) { return; } const el = comp.getGui().parentElement; if (this.lastHoveredListItem && this.lastHoveredListItem.rowIndex === hoveredListItem.rowIndex && this.lastHoveredListItem.position === hoveredListItem.position) { return; } this.autoScrollService.check(e.event); this.clearHoveredItems(); this.lastHoveredListItem = hoveredListItem; _radioCssClass(el, LIST_ITEM_HOVERED); _radioCssClass(el, `ag-item-highlight-${hoveredListItem.position}`); } getListDragItem(e) { const virtualListGui = this.virtualList.getGui(); const paddingTop = Number.parseFloat(window.getComputedStyle(virtualListGui).paddingTop); const rowHeight = this.virtualList.getRowHeight(); const scrollTop = this.virtualList.getScrollTop(); const rowIndex = Math.max(0, (e.y - paddingTop + scrollTop) / rowHeight); const maxLen = this.params.getNumRows(this.comp) - 1; const normalizedRowIndex = Math.min(maxLen, rowIndex) | 0; return { rowIndex: normalizedRowIndex, position: Math.round(rowIndex) > rowIndex || rowIndex > maxLen ? "bottom" : "top", component: this.virtualList.getComponentAt(normalizedRowIndex) }; } onDragStop() { if (this.moveBlocked) { return; } this.params.moveItem(this.currentDragValue, this.lastHoveredListItem); this.clearDragProperties(); } onDragCancel() { this.clearDragProperties(); } onDragLeave() { this.clearDragProperties(); } clearDragProperties() { this.clearHoveredItems(); this.autoScrollService.ensureCleared(); } clearHoveredItems() { const virtualListGui = this.virtualList.getGui(); for (const el of virtualListGui.querySelectorAll(`.${LIST_ITEM_HOVERED}`)) { for (const cls of [LIST_ITEM_HOVERED, "ag-item-highlight-top", "ag-item-highlight-bottom"]) { el.classList.remove(cls); } } this.lastHoveredListItem = null; } }; // packages/ag-grid-enterprise/src/agStack/agInputRange.ts var AgInputRange = class extends AgAbstractInputField { constructor(config) { super(config, "ag-range-field", "range"); } postConstruct() { super.postConstruct(); const { min, max, step } = this.config; if (min != null) { this.setMinValue(min); } if (max != null) { this.setMaxValue(max); } this.setStep(step || 1); } addInputListeners() { this.addManagedElementListeners(this.eInput, { input: (e) => { const value = e.target.value; this.setValue(value); } }); } setMinValue(value) { this.min = value; this.eInput.setAttribute("min", value.toString()); return this; } setMaxValue(value) { this.max = value; this.eInput.setAttribute("max", value.toString()); return this; } setStep(value) { this.eInput.setAttribute("step", value.toString()); return this; } setValue(value, silent) { if (this.min != null) { value = Math.max(parseFloat(value), this.min).toString(); } if (this.max != null) { value = Math.min(parseFloat(value), this.max).toString(); } const ret = super.setValue(value, silent); this.eInput.value = value; return ret; } }; var AgInputRangeSelector = { selector: "AG-INPUT-RANGE", component: AgInputRange }; // packages/ag-grid-enterprise/src/agStack/agSlider.ts var AgSlider = class extends AgAbstractLabel { constructor(config) { super( config, /* html */ `
`, [AgInputRangeSelector, AgInputNumberFieldSelector] ); this.eLabel = RefPlaceholder; this.eSlider = RefPlaceholder; this.eText = RefPlaceholder; this.labelAlignment = "top"; } postConstruct() { super.postConstruct(); this.eSlider.addCss("ag-slider-field"); const { minValue, maxValue, textFieldWidth, step, value, onValueChange } = this.config; if (minValue != null) { this.setMinValue(minValue); } if (maxValue != null) { this.setMaxValue(maxValue); } if (textFieldWidth != null) { this.setTextFieldWidth(textFieldWidth); } if (step != null) { this.setStep(step); } if (value != null) { this.setValue(value); } if (onValueChange != null) { this.onValueChange(onValueChange); } } onValueChange(callbackFn) { this.addManagedListeners(this.eText, { fieldValueChanged: () => { const textValue = parseFloat(this.eText.getValue()); this.eSlider.setValue(textValue.toString(), true); callbackFn(textValue || 0); } }); this.addManagedListeners(this.eSlider, { fieldValueChanged: () => { const sliderValue = this.eSlider.getValue(); this.eText.setValue(sliderValue, true); callbackFn(parseFloat(sliderValue)); } }); return this; } setSliderWidth(width) { this.eSlider.setWidth(width); return this; } setTextFieldWidth(width) { this.eText.setWidth(width); return this; } setMinValue(minValue) { this.eSlider.setMinValue(minValue); this.eText.setMin(minValue); return this; } setMaxValue(maxValue) { this.eSlider.setMaxValue(maxValue); this.eText.setMax(maxValue); return this; } getValue() { return this.eText.getValue(); } setValue(value, silent) { if (this.getValue() === value) { return this; } this.eText.setValue(value, true); this.eSlider.setValue(value, true); if (!silent) { this.dispatchLocalEvent({ type: "fieldValueChanged" }); } return this; } setStep(step) { this.eSlider.setStep(step); this.eText.setStep(step); return this; } }; var AgSliderSelector = { selector: "AG-SLIDER", component: AgSlider }; // packages/ag-grid-enterprise/src/agStack/agColorInput.ts var AgColorInput = class extends AgInputTextField { constructor() { super({ template: { tag: "div", cls: "ag-color-input", role: "presentation", children: [ { tag: "div", ref: "eLabel", cls: "ag-input-field-label" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-input-wrapper", role: "presentation", children: [ { tag: "input", ref: "eInput", cls: "ag-input-field-input" }, { tag: "div", ref: "eColor", cls: "ag-color-input-color" } ] } ] } }); this.eColor = RefPlaceholder; } wireBeans(beans) { this.color = beans.agChartsExports._Util.Color; } setColor(color) { const rgbaColor = color.toRgbaString(); this.setValue(this.color.fromString(rgbaColor).toHexString().toUpperCase(), true); this.eColor.style.backgroundColor = rgbaColor; } setValue(value, silent) { const isValid = this.color.validColorString(value ?? ""); this.eInput.setCustomValidity( isValid ? "" : this.getLocaleTextFunc()("invalidColor", "Color value is invalid") ); super.setValue(value, silent); if (isValid && !silent) { this.dispatchLocalEvent({ type: "colorChanged" }); } return this; } onColorChanged(callback) { this.addManagedListeners(this, { colorChanged: () => callback(this.color.fromString(this.value)) }); } }; var AgColorInputSelector = { selector: "AG-COLOR-INPUT", component: AgColorInput }; // packages/ag-grid-enterprise/src/agStack/agColorPanel.ts var maxRecentColors = 8; var sharedRecentColors = []; var AgColorPanel = class extends AgComponentStub { constructor(config) { super( /* html */ `
`, [AgColorInputSelector] ); this.H = 1; // in the [0, 1] range this.S = 1; // in the [0, 1] range this.B = 1; // in the [0, 1] range this.A = 1; this.isSpectrumDragging = false; this.isSpectrumHueDragging = false; this.isSpectrumAlphaDragging = false; this.colorChanged = false; this.spectrumColor = RefPlaceholder; this.spectrumVal = RefPlaceholder; this.spectrumDragger = RefPlaceholder; this.spectrumHue = RefPlaceholder; this.spectrumHueSlider = RefPlaceholder; this.spectrumAlpha = RefPlaceholder; this.spectrumAlphaSlider = RefPlaceholder; this.colorInput = RefPlaceholder; this.recentColors = RefPlaceholder; this.picker = config.picker; } wireBeans(beans) { this._Color = beans.agChartsExports._Util.Color; } postConstruct() { this.initTabIndex(); this.initRecentColors(); this.addGuiEventListener("focus", () => this.spectrumColor.focus()); this.addGuiEventListener("keydown", (e) => { if (e.key === KeyCode.ENTER && !e.defaultPrevented) { this.destroy(); } }); this.addManagedListeners(this.spectrumColor, { keydown: (e) => this.moveDragger(e) }); this.addManagedListeners(this.spectrumAlphaSlider, { keydown: (e) => this.moveAlphaSlider(e) }); this.addManagedListeners(this.spectrumHueSlider, { keydown: (e) => this.moveHueSlider(e) }); this.addManagedListeners(this.spectrumVal, { mousedown: this.onSpectrumDraggerDown.bind(this) }); this.addManagedListeners(this.spectrumHue, { mousedown: this.onSpectrumHueDown.bind(this) }); this.addManagedListeners(this.spectrumAlpha, { mousedown: this.onSpectrumAlphaDown.bind(this) }); this.addGuiEventListener("mousemove", (e) => { this.onSpectrumDraggerMove(e); this.onSpectrumHueMove(e); this.onSpectrumAlphaMove(e); }); this.addManagedListeners(document, { mouseup: this.onMouseUp.bind(this) }); this.colorInput.onColorChanged(this.setColor.bind(this)); this.addManagedListeners(this.recentColors, { click: this.onRecentColorClick.bind(this), keydown: (e) => { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { e.preventDefault(); this.onRecentColorClick(e); } } }); } initTabIndex() { const tabIndex = this.tabIndex = this.gos.get("tabIndex").toString(); this.spectrumColor.setAttribute("tabindex", tabIndex); this.spectrumHueSlider.setAttribute("tabindex", tabIndex); this.spectrumAlphaSlider.setAttribute("tabindex", tabIndex); } refreshSpectrumRect() { return this.spectrumValRect = this.spectrumVal.getBoundingClientRect(); } refreshHueRect() { return this.spectrumHueRect = this.spectrumHue.getBoundingClientRect(); } refreshAlphaRect() { return this.spectrumAlphaRect = this.spectrumAlpha.getBoundingClientRect(); } onSpectrumDraggerDown(e) { e.preventDefault(); this.refreshSpectrumRect(); this.isSpectrumDragging = true; this.moveDragger(e); } onSpectrumDraggerMove(e) { if (this.isSpectrumDragging) { this.moveDragger(e); } } onSpectrumHueDown(e) { this.refreshHueRect(); this.isSpectrumHueDragging = true; this.moveHueSlider(e); } onSpectrumHueMove(e) { if (this.isSpectrumHueDragging) { this.moveHueSlider(e); } } onSpectrumAlphaDown(e) { this.refreshAlphaRect(); this.isSpectrumAlphaDragging = true; this.moveAlphaSlider(e); } onSpectrumAlphaMove(e) { if (this.isSpectrumAlphaDragging) { this.moveAlphaSlider(e); } } onMouseUp() { this.isSpectrumDragging = false; this.isSpectrumHueDragging = false; this.isSpectrumAlphaDragging = false; } moveDragger(e) { const valRect = this.spectrumValRect; if (!valRect) { return; } let x; let y; if (e instanceof MouseEvent) { x = e.clientX - valRect.left; y = e.clientY - valRect.top; } else { const isLeft = e.key === KeyCode.LEFT; const isRight = e.key === KeyCode.RIGHT; const isUp = e.key === KeyCode.UP; const isDown = e.key === KeyCode.DOWN; const isVertical = isUp || isDown; const isHorizontal = isLeft || isRight; if (!isVertical && !isHorizontal) { return; } e.preventDefault(); const { x: currentX, y: currentY } = this.getSpectrumValue(); x = currentX + (isHorizontal ? isLeft ? -5 : 5 : 0); y = currentY + (isVertical ? isUp ? -5 : 5 : 0); } x = Math.max(x, 0); x = Math.min(x, valRect.width); y = Math.max(y, 0); y = Math.min(y, valRect.height); this.setSpectrumValue(x / valRect.width, 1 - y / valRect.height); } moveHueSlider(e) { const rect = this.spectrumHueRect; if (!rect) { return; } const x = this.moveSlider(this.spectrumHueSlider, e); if (x == null) { return; } this.H = 1 - x / rect.width; this.update(); } moveAlphaSlider(e) { const rect = this.spectrumAlphaRect; if (!rect) { return; } const x = this.moveSlider(this.spectrumAlphaSlider, e); if (x == null) { return; } this.A = x / rect.width; this.update(); } moveSlider(slider, e) { const sliderRect = slider.getBoundingClientRect(); const parentRect = slider.parentElement?.getBoundingClientRect(); if (!slider || !parentRect) { return null; } const offset = sliderRect.width / 2; let x; if (e instanceof MouseEvent) { x = Math.floor(e.clientX - parentRect.left); } else { const isLeft = e.key === KeyCode.LEFT; const isRight = e.key === KeyCode.RIGHT; if (!isLeft && !isRight) { return null; } e.preventDefault(); const diff = isLeft ? -5 : 5; x = parseFloat(slider.style.left) + offset + diff; } x = Math.max(x, 0); x = Math.min(x, parentRect.width); slider.style.left = x - offset + "px"; return x; } update(suppressColorInputUpdate) { const { A, S, B, H, _Color } = this; const hue = H * 360; const color = _Color.fromHSB(hue, S, B, A); const rgbaColor = color.toRgbaString(); const colorWithoutAlpha = _Color.fromHSB(hue, S, B); const rgbaColorWithoutAlpha = colorWithoutAlpha.toRgbaString(); const spectrumColor = _Color.fromHSB(hue, 1, 1); const spectrumRgbaColor = spectrumColor.toRgbaString(); const colorPicker = this.picker; const existingColor = _Color.fromString(colorPicker.getValue()); if (existingColor.toRgbaString() !== rgbaColor) { this.colorChanged = true; } colorPicker.setValue(rgbaColor); this.spectrumColor.style.backgroundColor = spectrumRgbaColor; this.spectrumDragger.style.backgroundColor = rgbaColorWithoutAlpha; this.spectrumHueSlider.style.backgroundColor = spectrumRgbaColor; this.spectrumAlpha.style.setProperty( "--ag-internal-spectrum-alpha-color-from", _Color.fromHSB(hue, S, B, 0).toRgbaString() ); this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-to", rgbaColorWithoutAlpha); this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color", rgbaColor); if (!suppressColorInputUpdate) { this.colorInput.setColor(color); } } /** * @param saturation In the [0, 1] interval. * @param brightness In the [0, 1] interval. */ setSpectrumValue(saturation, brightness, suppressColorInputUpdate) { const valRect = this.spectrumValRect || this.refreshSpectrumRect(); if (valRect == null) { return; } const dragger = this.spectrumDragger; const draggerRect = dragger.getBoundingClientRect(); saturation = Math.max(0, saturation); saturation = Math.min(1, saturation); brightness = Math.max(0, brightness); brightness = Math.min(1, brightness); this.S = saturation; this.B = brightness; dragger.style.left = saturation * valRect.width - draggerRect.width / 2 + "px"; dragger.style.top = (1 - brightness) * valRect.height - draggerRect.height / 2 + "px"; this.update(suppressColorInputUpdate); } getSpectrumValue() { const dragger = this.spectrumDragger; const draggerRect = dragger.getBoundingClientRect(); const x = parseFloat(dragger.style.left) + draggerRect.width / 2; const y = parseFloat(dragger.style.top) + draggerRect.height / 2; return { x, y }; } initRecentColors() { const recentColors = sharedRecentColors; const colorsHtmlStr = recentColors.map((color, index) => { return ( /* html */ `
` ); }); this.recentColors.innerHTML = colorsHtmlStr.join(""); _setDisplayed(this.recentColors, !!recentColors.length); } setValue(val) { const color = this._Color.fromString(val); this.setColor(color, true); } setColor(color, updateColorInput) { const [h, s2, b] = color.toHSB(); this.H = (isNaN(h) ? 0 : h) / 360; this.A = color.a; const spectrumHueRect = this.spectrumHueRect || this.refreshHueRect(); const spectrumAlphaRect = this.spectrumAlphaRect || this.refreshAlphaRect(); this.spectrumHueSlider.style.left = `${(this.H - 1) * -spectrumHueRect.width - this.spectrumHueSlider.getBoundingClientRect().width / 2}px`; this.spectrumAlphaSlider.style.left = `${this.A * spectrumAlphaRect.width - this.spectrumAlphaSlider.getBoundingClientRect().width / 2}px`; this.setSpectrumValue(s2, b, !updateColorInput); } onRecentColorClick(e) { const target = e.target; if (!_exists(target.id)) { return; } const id = parseInt(target.id, 10); this.setValue(sharedRecentColors[id]); this.destroy(); } addRecentColor() { const color = this._Color.fromHSB(this.H * 360, this.S, this.B, this.A); const rgbaColor = color.toRgbaString(); let recentColors = sharedRecentColors; if (!this.colorChanged || recentColors[0] === rgbaColor) { return; } recentColors = recentColors.filter((currentColor) => currentColor != rgbaColor); recentColors = [rgbaColor].concat(recentColors); if (recentColors.length > maxRecentColors) { recentColors = recentColors.slice(0, maxRecentColors); } sharedRecentColors = recentColors; } destroy() { this.addRecentColor(); super.destroy(); } }; // packages/ag-grid-enterprise/src/agStack/agPanel.css var agPanel_default = ".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}"; // packages/ag-grid-enterprise/src/agStack/agPanel.ts function getTemplate(cssIdentifier) { cssIdentifier ?? (cssIdentifier = cssIdentifier || "default"); return { tag: "div", cls: `ag-panel ag-${cssIdentifier}-panel`, attrs: { tabindex: "-1" }, children: [ { tag: "div", ref: "eTitleBar", cls: `ag-panel-title-bar ag-${cssIdentifier}-panel-title-bar ag-unselectable`, children: [ { tag: "span", ref: "eTitle", cls: `ag-panel-title-bar-title ag-${cssIdentifier}-panel-title-bar-title` }, { tag: "div", ref: "eTitleBarButtons", cls: `ag-panel-title-bar-buttons ag-${cssIdentifier}-panel-title-bar-buttons` } ] }, { tag: "div", ref: "eContentWrapper", cls: `ag-panel-content-wrapper ag-${cssIdentifier}-panel-content-wrapper` } ] }; } var AgPanel = class extends AgComponentStub { constructor(config) { super(getTemplate(config.cssIdentifier)); this.config = config; this.closable = true; this.eContentWrapper = RefPlaceholder; this.eTitleBar = RefPlaceholder; this.eTitleBarButtons = RefPlaceholder; this.eTitle = RefPlaceholder; this.registerCSS(agPanel_default); } postConstruct() { const { component, closable, hideTitleBar, title, minWidth = 250, width, minHeight = 250, height, centered, popup, x, y, postProcessPopupParams } = this.config; const beans = this.beans; const positionableFeature = this.createManagedBean( new AgPositionableFeature( this.getGui(), { minWidth, width, minHeight, height, centered, x, y, popup, calculateTopBuffer: () => this.positionableFeature.getHeight() - this.getBodyHeight() } ) ); this.positionableFeature = positionableFeature; const eGui = this.getGui(); if (component) { this.setBodyComponent(component); } if (!hideTitleBar) { if (title) { this.setTitle(title); } this.setClosable(closable != null ? closable : this.closable); } else { _setDisplayed(this.eTitleBar, false); } this.addManagedElementListeners(this.eTitleBar, { mousedown: (e) => { if (eGui.contains(e.relatedTarget) || eGui.contains(_getActiveDomElement(beans)) || this.eTitleBarButtons.contains(e.target)) { e.preventDefault(); return; } const focusEl = this.eContentWrapper.querySelector( "button, [href], input, select, textarea, [tabindex]" ); if (focusEl) { focusEl.focus(); } } }); if (popup && positionableFeature.isPositioned()) { return; } if (this.renderComponent) { this.renderComponent(); } let postProcessCallback; if (postProcessPopupParams) { const { type, eventSource, mouseEvent } = postProcessPopupParams; postProcessCallback = () => beans.popupSvc?.callPostProcessPopup(postProcessPopupParams, type, eGui, eventSource, mouseEvent); } positionableFeature.initialisePosition(postProcessCallback); this.eContentWrapper.style.height = "0"; } renderComponent() { const eGui = this.getGui(); eGui.focus(); this.close = () => { eGui.remove(); this.destroy(); }; } getHeight() { return this.positionableFeature.getHeight(); } setHeight(height) { this.positionableFeature.setHeight(height); } getWidth() { return this.positionableFeature.getWidth(); } setWidth(width) { this.positionableFeature.setWidth(width); } setClosable(closable) { if (closable !== this.closable) { this.closable = closable; } if (closable) { const closeButtonComp = this.closeButtonComp = new AgComponentStub({ tag: "div", cls: "ag-button" }); this.createBean(closeButtonComp); const eGui = closeButtonComp.getGui(); const child = this.beans.iconSvc.createIconNoSpan("close", this.beans); child.classList.add("ag-panel-title-bar-button-icon"); eGui.appendChild(child); this.addTitleBarButton(closeButtonComp); closeButtonComp.addManagedElementListeners(eGui, { click: this.onBtClose.bind(this) }); } else if (this.closeButtonComp) { const eGui = this.closeButtonComp.getGui(); eGui.remove(); this.closeButtonComp = this.destroyBean(this.closeButtonComp); } } setBodyComponent(bodyComponent) { bodyComponent.setParentComponent(this); this.eContentWrapper.appendChild(bodyComponent.getGui()); } addTitleBarButton(button, position) { const eTitleBarButtons = this.eTitleBarButtons; const buttons = eTitleBarButtons.children; const len = buttons.length; if (position == null) { position = len; } position = Math.max(0, Math.min(position, len)); button.addCss("ag-panel-title-bar-button"); const eGui = button.getGui(); if (position === 0) { eTitleBarButtons.prepend(eGui); } else if (position === len) { eTitleBarButtons.append(eGui); } else { buttons[position - 1].after(eGui); } button.setParentComponent(this); } getBodyHeight() { return _getInnerHeight(this.eContentWrapper); } getBodyWidth() { return _getInnerWidth(this.eContentWrapper); } setTitle(title) { this.eTitle.innerText = title; } // called when user hits the 'x' in the top right onBtClose() { this.close(); } destroy() { if (this.closeButtonComp) { this.closeButtonComp = this.destroyBean(this.closeButtonComp); } const eGui = this.getGui(); if (eGui && _isVisible(eGui)) { this.close(); } super.destroy(); } }; // packages/ag-grid-enterprise/src/agStack/agDialog.ts var AgDialog = class extends AgPanel { constructor(config, callbacks) { super({ ...config, popup: true }); this.callbacks = callbacks; this.isMaximizable = false; this.isMaximized = false; this.maximizeListeners = []; this.resizeListenerDestroy = null; this.lastPosition = { x: 0, y: 0, width: 0, height: 0 }; } wireBeans(beans) { this.popupSvc = beans.popupSvc; } postConstruct() { const eGui = this.getGui(); const { movable, resizable, maximizable, modal } = this.config; this.addCss("ag-dialog"); super.postConstruct(); this.tabGuardFeature = this.createManagedBean( new AgTabGuardFeature(this, this.callbacks?.stopPropagationCallbacks) ); this.tabGuardFeature.initialiseTabGuard({ isFocusableContainer: true, onFocusIn: () => { this.popupSvc?.bringPopupToFront(eGui); }, onTabKeyDown: (e) => { if (modal) { return; } const backwards = e.shiftKey; const nextFocusableElement = _findNextFocusableElement(this.beans, eGui, false, backwards); if (!nextFocusableElement || this.tabGuardFeature.getTabGuardCtrl().isTabGuard(nextFocusableElement)) { if (this.callbacks?.focusNextContainer(this.beans, backwards)) { e.preventDefault(); } } } }); if (movable) { this.setMovable(movable); } if (maximizable) { this.setMaximizable(maximizable); } if (resizable) { this.setResizable(resizable); } if (!this.config.modal) { this.callbacks?.configureFocusableContainer(this.beans, this); } } setAllowFocus(allowFocus) { this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(allowFocus); } renderComponent() { const eGui = this.getGui(); const { alwaysOnTop, modal, title, afterGuiAttached } = this.config; const translate = this.getLocaleTextFunc(); const addPopupRes = this.popupSvc?.addPopup({ modal, eChild: eGui, closeOnEsc: true, closedCallback: this.onClosed.bind(this), alwaysOnTop, ariaLabel: title || translate("ariaLabelDialog", "Dialog"), afterGuiAttached }); if (addPopupRes) { this.close = addPopupRes.hideFunc; } } onClosed(event) { this.destroy(); this.config.closedCallback?.(event); } setMaximized(maximized) { if (this.isMaximizable && maximized !== this.isMaximized) { this.toggleMaximize(); } } toggleMaximize() { const position = this.positionableFeature.getPosition(); if (this.isMaximized) { const { x, y, width, height } = this.lastPosition; this.setWidth(width); this.setHeight(height); this.positionableFeature.offsetElement(x, y); } else { this.lastPosition.width = this.getWidth(); this.lastPosition.height = this.getHeight(); this.lastPosition.x = position.x; this.lastPosition.y = position.y; this.positionableFeature.offsetElement(0, 0); this.setHeight("100%"); this.setWidth("100%"); } this.isMaximized = !this.isMaximized; this.refreshMaximizeIcon(); } refreshMaximizeIcon() { _setDisplayed(this.maximizeIcon, !this.isMaximized); _setDisplayed(this.minimizeIcon, this.isMaximized); } clearMaximizebleListeners() { if (this.maximizeListeners.length) { for (const destroyListener of this.maximizeListeners) { destroyListener(); } this.maximizeListeners.length = 0; } if (this.resizeListenerDestroy) { this.resizeListenerDestroy(); this.resizeListenerDestroy = null; } } destroy() { this.maximizeButtonComp = this.destroyBean(this.maximizeButtonComp); this.clearMaximizebleListeners(); super.destroy(); } setResizable(resizable) { this.positionableFeature.setResizable(resizable); } setMovable(movable) { this.positionableFeature.setMovable(movable, this.eTitleBar); } setMaximizable(maximizable) { if (!maximizable) { this.clearMaximizebleListeners(); if (this.maximizeButtonComp) { this.destroyBean(this.maximizeButtonComp); this.maximizeButtonComp = this.maximizeIcon = this.minimizeIcon = void 0; } return; } const eTitleBar = this.eTitleBar; if (!eTitleBar || maximizable === this.isMaximizable) { return; } this.isMaximizable = maximizable; const maximizeButtonComp = this.buildMaximizeAndMinimizeElements(); this.refreshMaximizeIcon(); maximizeButtonComp.addManagedElementListeners(maximizeButtonComp.getGui(), { click: this.toggleMaximize.bind(this) }); this.addTitleBarButton(maximizeButtonComp, 0); this.maximizeListeners.push( ...this.addManagedElementListeners(eTitleBar, { dblclick: this.toggleMaximize.bind(this) }) ); [this.resizeListenerDestroy] = this.addManagedListeners(this.positionableFeature, { resize: () => { this.isMaximized = false; this.refreshMaximizeIcon(); } }); } buildMaximizeAndMinimizeElements() { const maximizeButtonComp = this.maximizeButtonComp = this.createBean(new AgComponentStub({ tag: "div", cls: "ag-dialog-button" })); const eGui = maximizeButtonComp.getGui(); const iconSvc = this.beans.iconSvc; this.maximizeIcon = iconSvc.createIconNoSpan("maximize"); eGui.appendChild(this.maximizeIcon); this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"); this.minimizeIcon = iconSvc.createIconNoSpan("minimize"); eGui.appendChild(this.minimizeIcon); this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"); return maximizeButtonComp; } }; // packages/ag-grid-enterprise/src/agStack/agColorPicker.ts var AgColorPicker = class extends AgPickerField { constructor(config) { super({ pickerAriaLabelKey: "ariaLabelColorPicker", pickerAriaLabelValue: "Color Picker", pickerType: "ag-list", className: "ag-color-picker", pickerIcon: "chartsColorPicker", ...config }); } postConstruct() { this.eDisplayFieldColor = _createElement({ tag: "span", cls: "ag-color-picker-color" }); this.eDisplayFieldText = _createElement({ tag: "span", cls: "ag-color-picker-value" }); this.eDisplayField.append(this.eDisplayFieldColor, this.eDisplayFieldText); super.postConstruct(); if (this.value) { this.setValue(this.value); } } createPickerComponent() { const eGuiRect = this.eWrapper.getBoundingClientRect(); const parentRect = this.beans.popupSvc.getParentRect(); const colorDialog = this.createBean( new AgDialog( { closable: false, modal: true, hideTitleBar: true, minWidth: 190, width: 190, height: 250, x: eGuiRect.right - parentRect.left - 190, y: eGuiRect.top - parentRect.top - 250 - (this.config.pickerGap ?? 0), postProcessPopupParams: { type: "colorPicker", eventSource: this.eWrapper } }, this.config.dialogCallbacks ) ); return colorDialog; } renderAndPositionPicker() { const pickerComponent = this.pickerComponent; const colorPanel = this.createBean( new AgColorPanel({ picker: this }) ); pickerComponent.addCss("ag-color-dialog"); colorPanel.addDestroyFunc(() => { if (pickerComponent.isAlive()) { this.destroyBean(pickerComponent); } }); pickerComponent.setParentComponent(this); pickerComponent.setBodyComponent(colorPanel); colorPanel.setValue(this.getValue()); colorPanel.getGui().focus(); pickerComponent.addDestroyFunc(() => { if (!this.isDestroyingPicker) { this.beforeHidePicker(); this.isDestroyingPicker = true; if (colorPanel.isAlive()) { this.destroyBean(colorPanel); } if (this.isAlive()) { this.getFocusableElement().focus(); } } else { this.isDestroyingPicker = false; } }); return () => this.pickerComponent?.close(); } setValue(color) { if (this.value === color) { return this; } this.eDisplayFieldColor.style.backgroundColor = color; this.eDisplayFieldText.textContent = this.beans.agChartsExports._Util.Color.fromString( color ).toHexString().toUpperCase(); return super.setValue(color); } getValue() { return this.value; } }; var AgColorPickerSelector = { selector: "AG-COLOR-PICKER", component: AgColorPicker }; // packages/ag-grid-enterprise/src/agStack/agMenuPanel.ts var AgMenuPanel = class extends AgTabGuardComp { constructor(wrappedComponent) { super(); this.setTemplateFromElement(wrappedComponent.getGui(), void 0, void 0, true); } postConstruct() { this.initialiseTabGuard({ onTabKeyDown: (e) => this.onTabKeyDown(e), handleKeyDown: (e) => this.handleKeyDown(e) }); } handleKeyDown(e) { if (e.key === KeyCode.ESCAPE) { this.closePanel(); } } onTabKeyDown(e) { if (e.defaultPrevented) { return; } this.closePanel(); e.preventDefault(); } closePanel() { const menuItem = this.parentComponent; menuItem.closeSubMenu(); setTimeout(() => menuItem.getGui().focus(), 0); } }; // packages/ag-grid-enterprise/src/agStack/agMenuItemComponent.ts var AgMenuItemComponent = class extends AgBeanStub { constructor(callbacks) { super(); this.callbacks = callbacks; this.ACTIVATION_DELAY = 80; this.isActive = false; this.subMenuIsOpen = false; this.subMenuIsOpening = false; this.suppressRootStyles = true; this.suppressAria = true; this.suppressFocus = true; } init(params) { const { menuItemDef, isAnotherSubMenuOpen, level, childComponent, contextParams } = params; this.params = params.menuItemDef; this.level = level; this.isAnotherSubMenuOpen = isAnotherSubMenuOpen; this.childComponent = childComponent; this.contextParams = contextParams; this.cssClassPrefix = this.params.menuItemParams?.cssClassPrefix ?? "ag-menu-option"; return this.callbacks.getMenuItemComp(this.beans, this.params, { ...menuItemDef, level, isAnotherSubMenuOpen, openSubMenu: (activateFirstItem) => this.openSubMenu(activateFirstItem), closeSubMenu: () => this.closeSubMenu(), closeMenu: (event) => this.closeMenu(event), updateTooltip: (tooltip, shouldDisplayTooltip) => this.refreshTooltip(tooltip, shouldDisplayTooltip), onItemActivated: () => this.onItemActivated() }).then((comp) => { if (!comp) { return; } this.menuItemComp = comp; const configureDefaults = comp.configureDefaults?.(); if (configureDefaults) { this.configureDefaults(configureDefaults === true ? void 0 : configureDefaults); } }); } addListeners(eGui, params) { if (!params?.suppressClick) { this.addManagedElementListeners(eGui, { click: (e) => this.onItemSelected(e) }); } if (!params?.suppressKeyboardSelect) { this.addManagedElementListeners(eGui, { keydown: (e) => { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { e.preventDefault(); this.onItemSelected(e); } } }); } if (!params?.suppressMouseDown) { this.addManagedElementListeners(eGui, { mousedown: (e) => { e.stopPropagation(); e.preventDefault(); } }); } if (!params?.suppressMouseOver) { this.addManagedElementListeners(eGui, { mouseenter: () => this.onMouseEnter(), mouseleave: () => this.onMouseLeave() }); } } isDisabled() { return !!this.params.disabled; } openSubMenu(activateFirstItem = false, event) { this.closeSubMenu(); if (!this.params.subMenu) { return; } this.subMenuIsOpening = true; const ePopup = _createElement({ tag: "div", cls: "ag-menu", role: "presentation" }); this.eSubMenuGui = ePopup; let destroySubMenu; let afterGuiAttached = () => { this.subMenuIsOpening = false; }; if (this.childComponent) { const menuPanel = this.createBean( new AgMenuPanel(this.childComponent) ); menuPanel.setParentComponent(this); const subMenuGui = menuPanel.getGui(); const mouseEvent = "mouseenter"; const mouseEnterListener = () => this.cancelDeactivate(); subMenuGui.addEventListener(mouseEvent, mouseEnterListener); destroySubMenu = () => { subMenuGui.removeEventListener(mouseEvent, mouseEnterListener); this.destroyBean(menuPanel); }; ePopup.appendChild(subMenuGui); if (this.childComponent.afterGuiAttached) { afterGuiAttached = () => { this.childComponent.afterGuiAttached(); this.subMenuIsOpening = false; }; } } else if (this.params.subMenu) { const childMenu = this.createBean( new AgMenuList(this.level + 1, this.contextParams, this.callbacks) ); childMenu.setParentComponent(this); childMenu.addMenuItems(this.params.subMenu); ePopup.appendChild(childMenu.getGui()); this.addManagedListeners(childMenu, { closeMenu: (e) => this.dispatchLocalEvent(e) }); childMenu.addGuiEventListener("mouseenter", () => this.cancelDeactivate()); destroySubMenu = () => this.destroyBean(childMenu); if (activateFirstItem) { afterGuiAttached = () => { childMenu.activateFirstItem(); this.subMenuIsOpening = false; }; } } const popupSvc = this.beans.popupSvc; const positionCallback = () => { const eventSource = this.eGui; popupSvc?.positionPopupForMenu({ eventSource, ePopup, event: event instanceof MouseEvent ? event : void 0, additionalParams: this.callbacks.getPostProcessPopupParams(this.contextParams) }); }; const translate = this.getLocaleTextFunc(); const addPopupRes = popupSvc?.addPopup({ modal: true, eChild: ePopup, positionCallback, anchorToElement: this.eGui, ariaLabel: translate("ariaLabelSubMenu", "SubMenu"), afterGuiAttached }); this.subMenuIsOpen = true; this.setAriaExpanded(true); this.hideSubMenu = () => { if (addPopupRes) { addPopupRes.hideFunc(); } this.subMenuIsOpen = false; this.setAriaExpanded(false); destroySubMenu(); this.menuItemComp.setExpanded?.(false); this.eSubMenuGui = void 0; }; this.menuItemComp.setExpanded?.(true); } setAriaExpanded(expanded) { if (!this.suppressAria) { _setAriaExpanded(this.eGui, expanded); } } closeSubMenu() { if (!this.hideSubMenu) { return; } this.hideSubMenu(); this.hideSubMenu = null; this.setAriaExpanded(false); } isSubMenuOpen() { return this.subMenuIsOpen; } isSubMenuOpening() { return this.subMenuIsOpening; } activate(openSubMenu, fromKeyNav) { this.cancelActivate(); if (this.params.disabled && !fromKeyNav) { return; } this.isActive = true; if (!this.suppressRootStyles) { this.eGui.classList.add(`${this.cssClassPrefix}-active`); } this.menuItemComp.setActive?.(true); if (!this.suppressFocus) { this.callbacks.preserveRangesWhile(this.beans, () => this.eGui.focus({ preventScroll: !fromKeyNav })); } if (openSubMenu && this.params.subMenu) { window.setTimeout(() => { if (this.isAlive() && this.isActive) { this.openSubMenu(); } }, 300); } this.onItemActivated(); } deactivate() { this.cancelDeactivate(); if (!this.suppressRootStyles) { this.eGui.classList.remove(`${this.cssClassPrefix}-active`); } this.menuItemComp.setActive?.(false); this.isActive = false; if (this.subMenuIsOpen) { this.closeSubMenu(); } } getGui() { return this.menuItemComp.getGui(); } getParentComponent() { return this.parentComponent; } setParentComponent(component) { this.parentComponent = component; } getSubMenuGui() { return this.eSubMenuGui; } onItemSelected(event) { this.menuItemComp.select?.(); if (this.params.action) { this.beans.frameworkOverrides.wrapOutgoing( () => this.params.action( this.gos.addCommon({ ...this.contextParams }) ) ); } else { this.openSubMenu(event && event.type === "keydown", event); } if (this.params.subMenu && !this.params.action || this.params.suppressCloseOnSelect) { return; } this.closeMenu(event); } closeMenu(event) { const e = { type: "closeMenu" }; if (event) { if (event instanceof MouseEvent) { e.mouseEvent = event; } else { e.keyboardEvent = event; } } this.dispatchLocalEvent(e); } onItemActivated() { const event = { type: "menuItemActivated", menuItem: this }; this.dispatchLocalEvent(event); } cancelActivate() { if (this.activateTimeoutId) { window.clearTimeout(this.activateTimeoutId); this.activateTimeoutId = 0; } } cancelDeactivate() { if (this.deactivateTimeoutId) { window.clearTimeout(this.deactivateTimeoutId); this.deactivateTimeoutId = 0; } } onMouseEnter() { this.cancelDeactivate(); if (this.isAnotherSubMenuOpen()) { this.activateTimeoutId = window.setTimeout(() => this.activate(true), this.ACTIVATION_DELAY); } else { this.activate(true); } } onMouseLeave() { this.cancelActivate(); if (this.isSubMenuOpen()) { this.deactivateTimeoutId = window.setTimeout(() => this.deactivate(), this.ACTIVATION_DELAY); } else { this.deactivate(); } } refreshRootElementGui(suppressRootStyles) { let eGui = this.menuItemComp.getGui(); const { cssClassPrefix, params: { cssClasses, disabled } } = this; const rootElement = this.menuItemComp.getRootElement?.(); if (rootElement) { if (!suppressRootStyles) { eGui.classList.add("ag-menu-option-custom"); } eGui = rootElement; } this.suppressRootStyles = !!suppressRootStyles; if (!this.suppressRootStyles) { eGui.classList.add(cssClassPrefix); for (const it of cssClasses ?? []) { eGui.classList.add(it); } if (disabled) { eGui.classList.add(`${cssClassPrefix}-disabled`); } } return eGui; } applyAriaProperties(eGui) { const { params: { checked, subMenu, subMenuRole, disabled } } = this; const hasCheck = checked != null; _setAriaRole(eGui, hasCheck ? "menuitemcheckbox" : "menuitem"); if (subMenu) { _setAriaHasPopup(eGui, subMenuRole ?? "menu"); } if (disabled) { _setAriaDisabled(eGui, true); } } configureDefaults(configParams) { if (!this.menuItemComp) { setTimeout(() => this.configureDefaults(configParams)); return; } const { suppressRootStyles, suppressTooltip, suppressAria, suppressTabIndex, suppressFocus } = configParams || {}; const { params: { tooltip, disabled } } = this; const eGui = this.eGui = this.refreshRootElementGui(!!suppressRootStyles); this.suppressAria = !!suppressAria; if (!suppressAria) { this.applyAriaProperties(eGui); } if (!suppressTabIndex) { eGui.setAttribute("tabindex", "-1"); } if (!suppressTooltip) { this.refreshTooltip(tooltip); } if (!disabled) { this.addListeners(eGui, configParams); } this.suppressFocus = !!suppressFocus; } refreshTooltip(tooltip, shouldDisplayTooltip) { this.tooltip = tooltip; this.tooltipFeature = this.destroyBean(this.tooltipFeature); if (!tooltip || !this.menuItemComp) { return; } const tooltipFeature = this.beans.registry.createDynamicBean( "tooltipFeature", false, { getGui: () => this.getGui(), getTooltipValue: () => this.tooltip, getLocation: () => "menu", shouldDisplayTooltip } ); if (tooltipFeature) { this.tooltipFeature = this.createBean(tooltipFeature); } } destroy() { this.tooltipFeature = this.destroyBean(this.tooltipFeature); this.menuItemComp?.destroy?.(); super.destroy(); } }; // packages/ag-grid-enterprise/src/agStack/agMenuList.ts var AgMenuList = class extends AgTabGuardComp { constructor(level = 0, menuActionParams, callbacks) { super({ tag: "div", cls: "ag-menu-list", role: "menu" }); this.level = level; this.menuActionParams = menuActionParams; this.callbacks = callbacks; this.menuItems = []; } postConstruct() { this.initialiseTabGuard({ onTabKeyDown: (e) => this.onTabKeyDown(e), handleKeyDown: (e) => this.callbacks.preserveRangesWhile(this.beans, () => this.handleKeyDown(e)), onFocusIn: (e) => this.handleFocusIn(e), onFocusOut: (e) => this.handleFocusOut(e) }); } onTabKeyDown(e) { const parent = this.getParentComponent(); const isManaged = parent?.getGui()?.classList.contains("ag-focus-managed"); if (!isManaged) { e.preventDefault(); } if (e.shiftKey) { this.closeIfIsChild(e); } } handleKeyDown(e) { switch (e.key) { case KeyCode.UP: case KeyCode.RIGHT: case KeyCode.DOWN: case KeyCode.LEFT: e.preventDefault(); this.handleNavKey(e.key); break; case KeyCode.ESCAPE: if (this.closeIfIsChild()) { this.callbacks.stopPropagationCallbacks.stopPropagation(e); } break; } } handleFocusIn(e) { const oldFocusedElement = e.relatedTarget; if (!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(oldFocusedElement) && (this.getGui().contains(oldFocusedElement) || this.activeMenuItem?.getSubMenuGui()?.contains(oldFocusedElement))) { return; } if (this.activeMenuItem) { this.activeMenuItem.activate(); } else { this.activateFirstItem(); } } handleFocusOut(e) { const newFocusedElement = e.relatedTarget; if (!this.activeMenuItem || this.getGui().contains(newFocusedElement) || this.activeMenuItem.getSubMenuGui()?.contains(newFocusedElement)) { return; } if (!this.activeMenuItem.isSubMenuOpening()) { this.activeMenuItem.deactivate(); } } clearActiveItem() { if (this.activeMenuItem) { this.activeMenuItem.deactivate(); this.activeMenuItem = null; } } addMenuItems(menuItems) { if (menuItems == null) { return; } AgPromise.all( menuItems.map((menuItemOrString) => { if (menuItemOrString === "separator") { return AgPromise.resolve({ eGui: this.createSeparator() }); } else if (typeof menuItemOrString === "string") { this.callbacks.warnNoItem?.(menuItemOrString); return AgPromise.resolve({ eGui: null }); } else { return this.addItem(menuItemOrString); } }) ).then((elements) => { for (const element of elements ?? []) { if (element?.eGui) { this.appendChild(element.eGui); if (element.comp) { this.menuItems.push(element.comp); } } } }); } addItem(menuItemDef) { const menuItem = this.createManagedBean( new AgMenuItemComponent(this.callbacks) ); return menuItem.init({ menuItemDef, isAnotherSubMenuOpen: () => this.menuItems.some((m) => m.isSubMenuOpen()), level: this.level, contextParams: this.menuActionParams }).then(() => { menuItem.setParentComponent(this); this.addManagedListeners(menuItem, { closeMenu: (event) => { this.dispatchLocalEvent(event); }, menuItemActivated: (event) => { if (this.activeMenuItem && this.activeMenuItem !== event.menuItem) { this.activeMenuItem.deactivate(); } this.activeMenuItem = event.menuItem; } }); return { comp: menuItem, eGui: menuItem.getGui() }; }); } activateFirstItem() { const item = this.menuItems.filter((currentItem) => !currentItem.isDisabled())[0]; if (!item) { return; } item.activate(); } createSeparator() { const part = { tag: "div", cls: "ag-menu-separator-part" }; return _createAgElement({ tag: "div", cls: "ag-menu-separator", attrs: { "aria-hidden": "true" }, children: [part, part, part, part] }); } handleNavKey(key) { switch (key) { case KeyCode.UP: case KeyCode.DOWN: { const nextItem = this.findNextItem(key === KeyCode.UP); if (nextItem && nextItem !== this.activeMenuItem) { nextItem.activate(false, true); } return; } } const left = this.gos.get("enableRtl") ? KeyCode.RIGHT : KeyCode.LEFT; if (key === left) { this.closeIfIsChild(); } else { this.openChild(); } } closeIfIsChild(e) { const parentItem = this.getParentComponent(); if (parentItem && parentItem instanceof AgMenuItemComponent) { if (e) { e.preventDefault(); } parentItem.closeSubMenu(); parentItem.getGui().focus(); return true; } return false; } openChild() { if (this.activeMenuItem) { this.activeMenuItem.openSubMenu(true); } } findNextItem(up) { const items = [...this.menuItems]; if (!items.length) { return; } if (!this.activeMenuItem) { return up ? _last(items) : items[0]; } if (up) { items.reverse(); } let nextItem; let foundCurrent = false; for (const item of items) { if (!foundCurrent) { if (item === this.activeMenuItem) { foundCurrent = true; } continue; } nextItem = item; break; } if (foundCurrent && !nextItem) { return items[0]; } return nextItem || this.activeMenuItem; } destroy() { this.clearActiveItem(); super.destroy(); } }; // packages/ag-grid-enterprise/src/agStack/agContextMenuService.ts var CSS_MENU = "ag-menu"; var CSS_CONTEXT_MENU_LOADING_ICON = "ag-context-menu-loading-icon"; var AgContextMenuService = class extends AgBeanStub { constructor(params) { super(); this.params = params; this.destroyLoadingSpinner = null; this.lastPromise = 0; } hideActiveMenu() { this.destroyBean(this.activeMenu); } showMenu(menuActionParams, mouseEvent, anchorToElement) { const { getMenuItems, shouldBlockMenuOpen: shouldBlockMenu } = this.params; const menuItems = getMenuItems(menuActionParams, mouseEvent); if (_isPromise(menuItems)) { const currentPromise = this.lastPromise + 1; this.lastPromise = currentPromise; if (!this.destroyLoadingSpinner) { this.createLoadingIcon(mouseEvent); } menuItems.then((menuItems2) => { if (this.lastPromise !== currentPromise) { return; } const { target } = mouseEvent; const isFromFakeEvent = !target; const shouldShowMenu = ( // check if there are actual menu items to be displayed menuItems2?.length && // check if the element that triggered the context menu was removed from the DOM (isFromFakeEvent || _isVisible(target)) && !shouldBlockMenu?.() ); if (shouldShowMenu) { this.createContextMenu({ menuItems: menuItems2, menuActionParams, mouseEvent, anchorToElement }); } this.destroyLoadingSpinner?.(); }); return true; } if (!menuItems?.length) { return false; } this.createContextMenu({ menuItems, menuActionParams, mouseEvent, anchorToElement }); return true; } createLoadingIcon(mouseEvent) { const { beans } = this; const translate = this.getLocaleTextFunc(); const loadingIcon = beans.iconSvc.createIconNoSpan("loadingMenuItems"); const wrapperEl = _createAgElement({ tag: "div", cls: CSS_CONTEXT_MENU_LOADING_ICON }); wrapperEl.appendChild(loadingIcon); const rootNode = _getRootNode(beans); const targetEl = _getPageBody(beans); if (!targetEl) { return; } targetEl.appendChild(wrapperEl); beans.ariaAnnounce?.announceValue( translate("ariaLabelLoadingContextMenu", "Loading Context Menu"), "contextmenu" ); beans.environment.applyThemeClasses(wrapperEl); _anchorElementToMouseMoveEvent(wrapperEl, mouseEvent, beans); const mouseMoveCallback = (e) => { _anchorElementToMouseMoveEvent(wrapperEl, e, beans); }; rootNode.addEventListener("mousemove", mouseMoveCallback); this.destroyLoadingSpinner = () => { rootNode.removeEventListener("mousemove", mouseMoveCallback); wrapperEl.remove(); this.destroyLoadingSpinner = null; }; } createContextMenu(params) { const { mapMenuItems, menuItemCallbacks, beforeMenuOpen, onMenuClose, afterMenuDestroyed, onVisibleChanged, onMenuOpen } = this.params; const { menuItems, menuActionParams, mouseEvent, anchorToElement } = params; const popupSvc = this.beans.popupSvc; const getMenuItems = mapMenuItems ? (getGui) => mapMenuItems(menuItems, menuActionParams, getGui) : () => menuItems; const menu = new ContextMenu(getMenuItems, menuActionParams, menuItemCallbacks); this.createBean(menu); const eMenuGui = menu.getGui(); beforeMenuOpen?.(menuActionParams); const positionParams = { additionalParams: menuItemCallbacks.getPostProcessPopupParams(menuActionParams), type: "contextMenu", mouseEvent, ePopup: eMenuGui, // move one pixel away so that accidentally double clicking // won't show the browser's contextmenu nudgeY: 1 }; const translate = this.getLocaleTextFunc(); const addPopupRes = popupSvc?.addPopup({ modal: true, eChild: eMenuGui, closeOnEsc: true, closedCallback: (e) => { menuItemCallbacks.preserveRangesWhile(this.beans, () => { onMenuClose?.(); this.destroyBean(menu); afterMenuDestroyed?.(); onVisibleChanged?.(false, e === void 0 ? "api" : "ui"); }); }, click: mouseEvent, positionCallback: () => { const isRtl = this.gos.get("enableRtl"); popupSvc?.positionPopupUnderMouseEvent({ ...positionParams, nudgeX: isRtl ? (eMenuGui.offsetWidth + 1) * -1 : 1 }); }, // so when browser is scrolled down, or grid is scrolled, context menu stays with cell anchorToElement, ariaLabel: translate("ariaLabelContextMenu", "Context Menu") }); if (addPopupRes) { onMenuOpen?.(); menu.afterGuiAttached({ container: "contextMenu", hidePopup: addPopupRes.hideFunc }); } if (this.activeMenu) { this.hideActiveMenu(); } this.activeMenu = menu; menu.addEventListener("destroyed", () => { if (this.activeMenu === menu) { this.activeMenu = null; } }); if (addPopupRes) { menu.addEventListener( "closeMenu", (e) => addPopupRes.hideFunc({ mouseEvent: e.mouseEvent ?? void 0, keyboardEvent: e.keyboardEvent ?? void 0, forceHide: true }) ); } const isApi = mouseEvent && mouseEvent instanceof MouseEvent && mouseEvent.type === "mousedown"; onVisibleChanged?.(true, isApi ? "api" : "ui"); } destroy() { this.destroyLoadingSpinner?.(); super.destroy(); } }; var ContextMenu = class extends AgComponentStub { constructor(getMenuItems, menuActionParams, callbacks) { super({ tag: "div", cls: CSS_MENU, role: "presentation" }); this.getMenuItems = getMenuItems; this.menuActionParams = menuActionParams; this.callbacks = callbacks; this.menuList = null; } postConstruct() { const menuList = this.createManagedBean( new AgMenuList(0, this.menuActionParams, this.callbacks) ); const menuItemsMapped = this.getMenuItems(() => this.getGui()); menuList.addMenuItems(menuItemsMapped); this.appendChild(menuList); this.menuList = menuList; menuList.addEventListener("closeMenu", (e) => this.dispatchLocalEvent(e)); } afterGuiAttached({ hidePopup }) { if (hidePopup) { this.addDestroyFunc(hidePopup); } const menuList = this.menuList; if (menuList) { this.callbacks.preserveRangesWhile(this.beans, () => _focusInto(menuList.getGui())); } } }; // packages/ag-grid-enterprise/src/agStack/agMenuItemRenderer.ts var AgMenuItemRenderer = class extends AgComponentStub { constructor(callbacks) { super({ tag: "div" }); this.callbacks = callbacks; } init(params) { this.params = params; this.cssClassPrefix = this.params.cssClassPrefix ?? "ag-menu-option"; this.addAriaAttributes(); this.addIcon(); this.addName(); this.addShortcut(); this.addSubMenu(); } configureDefaults() { return true; } addAriaAttributes() { const { checked, subMenu } = this.params; const eGui = this.getGui(); if (checked) { _setAriaChecked(eGui, checked); } if (subMenu) { _setAriaExpanded(eGui, false); } } addIcon() { if (this.params.isCompact) { return; } const iconWrapper = _createAgElement({ tag: "span", ref: "eIcon", cls: `${this.getClassName("part")} ${this.getClassName("icon")}`, role: "presentation" }); const { checked, icon } = this.params; if (checked) { iconWrapper.appendChild(this.beans.iconSvc.createIconNoSpan("check")); } else if (icon) { if (_isNodeOrElement(icon)) { iconWrapper.appendChild(icon); } else if (typeof icon === "string") { iconWrapper.innerHTML = icon; } else { this.callbacks?.warnNoIcon?.(); } } this.getGui().appendChild(iconWrapper); } addName() { const name = _createAgElement({ tag: "span", ref: "eName", cls: `${this.getClassName("part")} ${this.getClassName("text")}`, children: this.params.name || "" }); this.getGui().appendChild(name); } addShortcut() { if (this.params.isCompact) { return; } const shortcut = _createAgElement({ tag: "span", ref: "eShortcut", cls: `${this.getClassName("part")} ${this.getClassName("shortcut")}`, children: this.params.shortcut || "" }); this.getGui().appendChild(shortcut); } addSubMenu() { const pointer = _createAgElement({ tag: "span", ref: "ePopupPointer", cls: `${this.getClassName("part")} ${this.getClassName("popup-pointer")}` }); const eGui = this.getGui(); if (this.params.subMenu) { const iconName = this.gos.get("enableRtl") ? "subMenuOpenRtl" : "subMenuOpen"; pointer.appendChild(this.beans.iconSvc.createIconNoSpan(iconName)); } eGui.appendChild(pointer); } getClassName(suffix) { return `${this.cssClassPrefix}-${suffix}`; } }; // packages/ag-grid-enterprise/src/misc/enterpriseFocusUtils.ts function findFocusableElementBeforeTabGuard(rootNode, referenceElement) { if (!referenceElement) { return null; } const focusableElements = _findFocusableElements(rootNode); const referenceIndex = focusableElements.indexOf(referenceElement); if (referenceIndex === -1) { return null; } let lastTabGuardIndex = -1; for (let i = referenceIndex - 1; i >= 0; i--) { if (focusableElements[i].classList.contains(TabGuardClassNames.TAB_GUARD_TOP)) { lastTabGuardIndex = i; break; } } if (lastTabGuardIndex <= 0) { return null; } return focusableElements[lastTabGuardIndex - 1]; } function isTargetUnderManagedComponent(rootNode, target) { if (!target) { return false; } const managedContainers = rootNode.querySelectorAll(`.${FOCUS_MANAGED_CLASS}`); if (!managedContainers.length) { return false; } for (let i = 0; i < managedContainers.length; i++) { if (managedContainers[i].contains(target)) { return true; } } return false; } // packages/ag-grid-enterprise/src/agStack/agTabbedLayout.ts function getTabbedLayoutTemplate(cssClass) { return { tag: "div", cls: `ag-tabs ${cssClass}`, children: [ { tag: "div", ref: "eHeader" }, { tag: "div", ref: "eBody", role: "presentation", cls: "ag-tabs-body" + cssClass ? ` ${cssClass}-body` : "" } ] }; } var AgTabbedLayout = class extends AgTabGuardComp { constructor(params) { super(getTabbedLayoutTemplate(params.cssClass)); this.eHeader = RefPlaceholder; this.eBody = RefPlaceholder; this.items = []; this.tabbedItemScrollMap = /* @__PURE__ */ new Map(); this.params = params; } postConstruct() { this.setupHeader(); if (this.params.items) { for (const item of this.params.items) { this.addItem(item); } } this.initialiseTabGuard({ onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this), focusInnerElement: this.focusInnerElement.bind(this), focusTrapActive: true }); this.addDestroyFunc(() => this.activeItem?.tabbedItem?.afterDetachedCallback?.()); } setupHeader() { const { enableCloseButton, cssClass } = this.params; const addCssClasses = (el, suffix) => { el.classList.add(`ag-tabs-${suffix}`); if (cssClass) { el.classList.add(`${cssClass}-${suffix}`); } }; if (enableCloseButton) { this.setupCloseButton(addCssClasses); this.eTabHeader = _createAgElement({ tag: "div", role: "presentation" }); addCssClasses(this.eHeader, "header-wrapper"); this.eHeader.appendChild(this.eTabHeader); } else { this.eTabHeader = this.eHeader; } _setAriaRole(this.eTabHeader, "tablist"); addCssClasses(this.eTabHeader, "header"); } setupCloseButton(addCssClasses) { const eCloseButton = _createAgElement({ tag: "button" }); addCssClasses(eCloseButton, "close-button"); const eIcon = this.beans.iconSvc.createIconNoSpan("close"); _setAriaLabel(eCloseButton, this.params.closeButtonAriaLabel); eCloseButton.appendChild(eIcon); this.addManagedElementListeners(eCloseButton, { click: () => this.params.onCloseClicked?.() }); const eCloseButtonWrapper = _createAgElement({ tag: "div", role: "presentation" }); addCssClasses(eCloseButtonWrapper, "close-button-wrapper"); eCloseButtonWrapper.appendChild(eCloseButton); this.eHeader.appendChild(eCloseButtonWrapper); this.eCloseButton = eCloseButton; } handleKeyDown(e) { switch (e.key) { case KeyCode.RIGHT: case KeyCode.LEFT: { if (!this.eTabHeader.contains(_getActiveDomElement(this.beans))) { return; } const isRightKey = e.key === KeyCode.RIGHT; const isRtl = this.gos.get("enableRtl"); const currentPosition = this.items.indexOf(this.activeItem); const nextPosition = isRightKey !== isRtl ? Math.min(currentPosition + 1, this.items.length - 1) : Math.max(currentPosition - 1, 0); if (currentPosition === nextPosition) { return; } e.preventDefault(); const nextItem = this.items[nextPosition]; this.showItemWrapper(nextItem); nextItem.eHeaderButton.focus(); break; } case KeyCode.UP: case KeyCode.DOWN: e.stopPropagation(); break; } } onTabKeyDown(e) { if (e.defaultPrevented) { return; } const { beans, eHeader, eBody, activeItem, params } = this; const { suppressTrapFocus, enableCloseButton } = params; const activeElement = _getActiveDomElement(beans); const target = e.target; const backwards = e.shiftKey; if (eHeader.contains(activeElement)) { e.preventDefault(); if (enableCloseButton && backwards && !this.eCloseButton?.contains(activeElement)) { this.eCloseButton?.focus(); } else if (suppressTrapFocus && backwards) { findFocusableElementBeforeTabGuard(_getDocument(beans).body, target)?.focus(); } else { this.focusBody(e.shiftKey); } return; } let nextEl = null; if (isTargetUnderManagedComponent(eBody, target)) { if (backwards) { nextEl = findFocusableElementBeforeTabGuard(eBody, target); } if (!nextEl && !suppressTrapFocus) { nextEl = activeItem.eHeaderButton; } } if (!nextEl && eBody.contains(activeElement)) { nextEl = _findNextFocusableElement(beans, eBody, false, backwards); if (!nextEl) { if (suppressTrapFocus && !backwards) { this.forceFocusOutOfContainer(backwards); } else if (enableCloseButton && !backwards) { e.preventDefault(); this.eCloseButton?.focus(); } else { e.preventDefault(); this.focusHeader(); } return; } } if (nextEl) { e.preventDefault(); nextEl.focus(); } } focusInnerElement(fromBottom) { if (fromBottom) { return this.focusBody(true); } else { this.focusHeader(); return true; } } focusHeader(preventScroll) { this.activeItem.eHeaderButton.focus({ preventScroll }); } focusBody(fromBottom) { return _focusInto(this.eBody, fromBottom); } setAfterAttachedParams(params) { this.afterAttachedParams = params; } showFirstItem() { if (this.items.length > 0) { this.showItemWrapper(this.items[0]); } } addItem(item) { const eHeaderButton = _createAgElement({ tag: "span", cls: "ag-tab", role: "tab", attrs: { tabindex: "-1" } }); eHeaderButton.appendChild(item.title); this.eTabHeader.appendChild(eHeaderButton); _setAriaLabel(eHeaderButton, item.titleLabel); const wrapper = { tabbedItem: item, eHeaderButton }; this.items.push(wrapper); eHeaderButton.addEventListener("click", this.showItemWrapper.bind(this, wrapper)); } showItem(tabbedItem) { const itemWrapper = this.items.find((wrapper) => wrapper.tabbedItem === tabbedItem); if (itemWrapper) { this.showItemWrapper(itemWrapper); } } showItemWrapper(wrapper) { const { tabbedItem, eHeaderButton } = wrapper; this.params.onItemClicked?.({ item: tabbedItem }); if (this.activeItem === wrapper) { this.params.onActiveItemClicked?.(); return; } if (this.lastScrollListener) { this.lastScrollListener = this.lastScrollListener(); } _clearElement(this.eBody); tabbedItem.bodyPromise.then((body) => { this.eBody.appendChild(body); const onlyUnmanaged = !_isKeyboardMode(); if (!this.params.suppressFocusBodyOnOpen) { _focusInto(this.eBody, false, onlyUnmanaged); } if (tabbedItem.afterAttachedCallback) { tabbedItem.afterAttachedCallback(this.afterAttachedParams); } if (this.params.keepScrollPosition) { const scrollableContainer = tabbedItem.getScrollableContainer?.() || body; [this.lastScrollListener] = this.addManagedElementListeners(scrollableContainer, { scroll: () => { this.tabbedItemScrollMap.set(tabbedItem.name, scrollableContainer.scrollTop); } }); const scrollPosition = this.tabbedItemScrollMap.get(tabbedItem.name); if (scrollPosition !== void 0) { setTimeout(() => { scrollableContainer.scrollTop = scrollPosition; }, 0); } } }); if (this.activeItem) { this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"); this.activeItem.tabbedItem.afterDetachedCallback?.(); } eHeaderButton.classList.add("ag-tab-selected"); this.activeItem = wrapper; } }; // packages/ag-grid-enterprise/src/agStack/agGroupComponent.css var agGroupComponent_default = ".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}"; // packages/ag-grid-enterprise/src/agStack/agGroupComponent.ts function getAgGroupComponentTemplate(params) { const cssIdentifier = params.cssIdentifier || "default"; const direction = params.direction || "vertical"; return { tag: "div", cls: `ag-group ag-${cssIdentifier}-group`, role: "presentation", children: [ { tag: "div", ref: "eToolbar", cls: `ag-group-toolbar ag-${cssIdentifier}-group-toolbar`, children: [{ tag: "ag-checkbox", ref: "cbGroupEnabled" }] }, { tag: "div", ref: "eContainer", cls: `ag-group-container ag-group-container-${direction} ag-${cssIdentifier}-group-container` } ] }; } var AgGroupComponent = class extends AgComponentStub { constructor(params = {}) { super( getAgGroupComponentTemplate(params), [AgCheckboxSelector] ); this.params = params; this.suppressEnabledCheckbox = true; this.suppressToggleExpandOnEnableChange = false; this.eToolbar = RefPlaceholder; this.cbGroupEnabled = RefPlaceholder; this.eContainer = RefPlaceholder; this.registerCSS(agGroupComponent_default); 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.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.removeCss(`ag-group-item-alignment-${this.alignItems}`); } this.alignItems = alignment; const newCls = `ag-group-item-alignment-${this.alignItems}`; this.addCss(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) { for (const item of items) { this.addItem(item); } } prependItem(item) { this.insertItem(item, true); } addItem(item) { this.insertItem(item, false); } updateItems(newItems) { const oldItems = this.items; let newIndex = 0; for (let prevIndex = 0; prevIndex < oldItems.length; ++prevIndex) { const ePrevItem = oldItems[prevIndex]; if (ePrevItem === newItems[newIndex]) { newIndex++; } else { const el = _isComponent(ePrevItem) ? ePrevItem.getGui() : ePrevItem; _removeFromParent(el); } } while (newIndex < newItems.length) { this.insertItem(newItems[newIndex++]); } this.items = newItems; } insertItem(item, prepend) { const container = this.eContainer; const el = _isComponent(item) ? item.getGui() : item; el.classList.add("ag-group-item", `ag-${this.cssIdentifier}-group-item`); if (prepend) { container.prepend(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 = _isComponent(item) ? 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?.addCss(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.addCss("ag-group-title-bar"); eToggle.addCss(`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"; return { tag: "div", cls: `ag-group-title-bar ag-${cssIdentifier}-group-title-bar ag-unselectable`, role: params.suppressKeyboardNavigation ? "presentation" : "group", children: [ { tag: "span", ref: "eGroupOpenedIcon", cls: `ag-group-title-bar-icon ag-${cssIdentifier}-group-title-bar-icon`, role: "presentation" }, { tag: "span", ref: "eGroupClosedIcon", cls: `ag-group-title-bar-icon ag-${cssIdentifier}-group-title-bar-icon`, role: "presentation" }, { tag: "span", ref: "eTitle", cls: `ag-group-title ag-${cssIdentifier}-group-title` } ] }; } var DefaultTitleBar = class extends AgComponentStub { constructor(params = {}) { super(getDefaultTitleBarTemplate(params)); this.suppressOpenCloseIcons = false; this.suppressKeyboardNavigation = false; this.eGroupOpenedIcon = RefPlaceholder; this.eGroupClosedIcon = RefPlaceholder; this.eTitle = 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() { const iconSvc = this.beans.iconSvc; this.eGroupClosedIcon.appendChild(iconSvc.createIconNoSpan("accordionClosed")); this.eGroupOpenedIcon.appendChild(iconSvc.createIconNoSpan("accordionOpen")); 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) { _setAriaExpanded(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"); _setAriaRole(eGui, "presentation"); } else { eGui.classList.remove(TITLE_BAR_DISABLED_CLASS); if (typeof this.title === "string" && !this.suppressKeyboardNavigation) { this.activateTabIndex([eGui]); _setAriaRole(eGui, "group"); } else { eGui.removeAttribute("tabindex"); _setAriaRole(eGui, "presentation"); } } } }; var AgGroupComponentSelector = { selector: "AG-GROUP-COMPONENT", component: AgGroupComponent }; // packages/ag-grid-enterprise/src/version.ts var VERSION2 = "35.2.1"; // packages/ag-grid-enterprise/src/agGridEnterpriseModule.ts var EnterpriseCoreModule = { moduleName: "EnterpriseCore", version: VERSION2, beans: [GridLicenseManager], icons: { // accordion open (filter tool panel group, charts group) accordionOpen: "tree-open", // accordion closed (filter tool panel group, charts group) accordionClosed: "tree-closed", // accordion indeterminate - shown when some children are expanded and // others are collapsed (filter tool panel group, charts group) accordionIndeterminate: "tree-indeterminate", // dialog title bar close: "cross", // X (remove) on column 'pill' after adding it to a drop zone list cancel: "cancel", // button in chart regular size window title bar (click to maximise) maximize: "maximize", // button in chart maximised window title bar (click to make regular size) minimize: "minimize", // drag handle used to pick up draggable columns columnDrag: "grip" }, dependsOn: [], setLicenseKey: GridLicenseManager.setLicenseKey }; // packages/ag-grid-enterprise/src/advancedFilter/advanced-filter.css var advanced_filter_default = '.ag-advanced-filter-header{align-items:center;background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);display:flex;position:relative}.ag-advanced-filter{align-items:center;display:flex;width:100%}.ag-advanced-filter-buttons{display:contents}.ag-advanced-filter-header-cell{height:100%;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding)}.ag-advanced-filter-apply-button,.ag-advanced-filter-builder-button{align-items:center;background-color:unset;border:0;display:flex;font-size:var(--ag-font-size);font-weight:600;line-height:normal;padding:var(--ag-spacing);white-space:nowrap;&:where(.ag-standard-button):where(:not(:disabled)){cursor:pointer;&:where(.ag-standard-button):hover{background-color:var(--ag-row-hover-color)}}}:where(.ag-ltr) .ag-advanced-filter-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-button{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-advanced-filter-builder-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-advanced-filter-builder-button-label{margin-right:var(--ag-spacing)}.ag-advanced-filter-builder{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-advanced-filter-builder-list{flex:1;overflow:auto}.ag-advanced-filter-builder-button-panel{border-top:var(--ag-advanced-filter-builder-button-bar-border);display:flex;justify-content:flex-end;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-advanced-filter-builder-apply-button,:where(.ag-ltr) .ag-advanced-filter-builder-cancel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-advanced-filter-builder-apply-button,:where(.ag-rtl) .ag-advanced-filter-builder-cancel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-advanced-filter-builder-item-wrapper{align-items:center;display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}:where(.ag-ltr) .ag-advanced-filter-builder-item-wrapper{padding-left:calc(var(--ag-icon-size)/2);padding-right:var(--ag-icon-size)}:where(.ag-rtl) .ag-advanced-filter-builder-item-wrapper{padding-left:var(--ag-icon-size);padding-right:calc(var(--ag-icon-size)/2)}:where(.ag-virtual-list-viewport) .ag-advanced-filter-builder-item-wrapper .ag-tab-guard{position:absolute}.ag-advanced-filter-builder-item-tree-line{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size)}.ag-advanced-filter-builder-item-tree-line-root:before{height:50%;top:50%}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative}.ag-advanced-filter-builder-item-tree-line-horizontal:after,.ag-advanced-filter-builder-item-tree-line-horizontal:before,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:after,.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before,.ag-advanced-filter-builder-item-tree-line-vertical-top:after,.ag-advanced-filter-builder-item-tree-line-vertical-top:before,.ag-advanced-filter-builder-item-tree-line-vertical:after,.ag-advanced-filter-builder-item-tree-line-vertical:before{content:"";height:100%;position:absolute}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:var(--ag-border-width) solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:var(--ag-border-width) solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:var(--ag-border-width) solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons{display:flex;gap:var(--ag-spacing);padding:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height)}.ag-advanced-filter-builder-virtual-list-item:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}.ag-advanced-filter-builder-invalid{color:var(--ag-subtle-text-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color)}:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}'; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterApi.ts function getAdvancedFilterModel(beans) { return beans.filterManager?.getAdvFilterModel() ?? null; } function setAdvancedFilterModel(beans, advancedFilterModel) { beans.filterManager?.setAdvFilterModel(advancedFilterModel); } function showAdvancedFilterBuilder(beans) { beans.filterManager?.toggleAdvFilterBuilder(true, "api"); } function hideAdvancedFilterBuilder(beans) { beans.filterManager?.toggleAdvFilterBuilder(false, "api"); } // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterLocaleText.ts var ADVANCED_FILTER_LOCALE_TEXT = { ariaAdvancedFilterBuilderItem: (variableValues) => `${variableValues[0]}. Level ${variableValues[1]}. Press ENTER to edit`, ariaAdvancedFilterBuilderItemValidation: (variableValues) => `${variableValues[0]}. Level ${variableValues[1]}. ${variableValues[2]} Press ENTER to edit`, ariaAdvancedFilterBuilderList: "Advanced Filter Builder List", ariaAdvancedFilterBuilderFilterItem: "Filter Condition", ariaAdvancedFilterBuilderGroupItem: "Filter Group", ariaAdvancedFilterBuilderColumn: "Column", ariaAdvancedFilterBuilderOption: "Option", ariaAdvancedFilterBuilderValue: "Value", ariaAdvancedFilterBuilderJoinOperator: "Join Operator", ariaAdvancedFilterInput: "Advanced Filter Input", ariaLabelAdvancedFilterAutocomplete: "Advanced Filter Autocomplete", advancedFilterContains: "contains", advancedFilterNotContains: "does not contain", advancedFilterTextEquals: "equals", advancedFilterTextNotEqual: "does not equal", advancedFilterStartsWith: "begins with", advancedFilterEndsWith: "ends with", advancedFilterBlank: "is blank", advancedFilterNotBlank: "is not blank", advancedFilterEquals: "=", advancedFilterNotEqual: "!=", advancedFilterGreaterThan: ">", advancedFilterGreaterThanOrEqual: ">=", advancedFilterLessThan: "<", advancedFilterLessThanOrEqual: "<=", advancedFilterTrue: "is true", advancedFilterFalse: "is false", advancedFilterAnd: "AND", advancedFilterOr: "OR", advancedFilterApply: "Apply", advancedFilterReset: "Reset", advancedFilterCancel: "Cancel", advancedFilterClear: "Clear", advancedFilterBuilder: "Builder", advancedFilterValidationMissingColumn: "Column is missing", advancedFilterValidationMissingOption: "Option is missing", advancedFilterValidationMissingValue: "Value is missing", advancedFilterValidationInvalidColumn: "Column not found", advancedFilterValidationInvalidOption: "Option not found", advancedFilterValidationMissingQuote: "Value is missing an end quote", advancedFilterValidationNotANumber: "Value is not a number", advancedFilterValidationNotABigInt: "Value is not a big integer", advancedFilterValidationInvalidDate: "Value is not a valid date", advancedFilterValidationMissingCondition: "Condition is missing", advancedFilterValidationJoinOperatorMismatch: "Join operators within a condition must be the same", advancedFilterValidationInvalidJoinOperator: "Join operator not found", advancedFilterValidationMissingEndBracket: "Missing end bracket", advancedFilterValidationExtraEndBracket: "Too many end brackets", advancedFilterValidationMessage: (variableValues) => `Expression has an error. ${variableValues[0]} - ${variableValues[1]}.`, advancedFilterValidationMessageAtEnd: (variableValues) => `Expression has an error. ${variableValues[0]} at end of expression.`, advancedFilterBuilderTitle: "Advanced Filter", advancedFilterBuilderApply: "Apply", advancedFilterBuilderCancel: "Cancel", advancedFilterBuilderClear: "Clear", advancedFilterBuilderReset: "Reset", advancedFilterBuilderAddButtonTooltip: "Add Filter or Group", advancedFilterBuilderRemoveButtonTooltip: "Remove", advancedFilterBuilderMoveUpButtonTooltip: "Move Up", advancedFilterBuilderMoveDownButtonTooltip: "Move Down", advancedFilterBuilderAddJoin: "Add Group", advancedFilterBuilderAddCondition: "Add Filter", advancedFilterBuilderSelectColumn: "Select a column", advancedFilterBuilderSelectOption: "Select an option", advancedFilterBuilderEnterValue: "Enter a value...", advancedFilterBuilderValidationAlreadyApplied: "Current filter already applied.", advancedFilterBuilderValidationIncomplete: "Not all conditions are complete.", advancedFilterBuilderValidationSelectColumn: "Must select a column.", advancedFilterBuilderValidationSelectOption: "Must select an option.", advancedFilterBuilderValidationEnterValue: "Must enter a value." }; // packages/ag-grid-enterprise/src/advancedFilter/filterExpressionUtils.ts function getSearchString(value, position, endPosition) { if (!value) { return ""; } const numChars = endPosition - position; return numChars ? value.slice(0, value.length - numChars) : value; } function updateExpression(expression, startPosition, endPosition, updatedValuePart, appendSpace, appendQuote, empty) { const secondPartStartPosition = endPosition + (!expression.length || empty ? 0 : 1); let positionOffset = 0; if (appendSpace) { if (expression[secondPartStartPosition] === " ") { positionOffset = 1; } else { updatedValuePart += " "; if (appendQuote) { updatedValuePart += `"`; } } } const updatedValue = expression.slice(0, startPosition) + updatedValuePart + expression.slice(secondPartStartPosition); return { updatedValue, updatedPosition: startPosition + updatedValuePart.length + positionOffset }; } function findStartPosition(expression, position, endPosition) { let startPosition = position; while (startPosition < endPosition) { const char = expression[startPosition]; if (char !== " ") { break; } startPosition++; } return startPosition; } function findEndPosition(expression, position, includeCloseBracket, isStartPositionUnknown) { let endPosition = position; let isEmpty = false; while (endPosition < expression.length) { const char = expression[endPosition]; if (char === "(") { if (isStartPositionUnknown && expression[endPosition - 1] === " ") { isEmpty = true; } else { endPosition = endPosition - 1; } break; } else if (char === " " || includeCloseBracket && char === ")") { endPosition = endPosition - 1; break; } endPosition++; } return { endPosition, isEmpty }; } function checkAndUpdateExpression(params, userValue, displayValue, endPosition) { if (displayValue !== userValue) { params.expression = updateExpression( params.expression, endPosition - userValue.length + 1, endPosition, displayValue ).updatedValue; } } // packages/ag-grid-enterprise/src/advancedFilter/colFilterExpressionParser.ts var ColumnParser = class { constructor(params, startPosition) { this.params = params; this.startPosition = startPosition; this.type = "column"; this.valid = true; this.hasStartChar = false; this.hasEndChar = false; this.colName = ""; } parse(char, position) { if (char === COL_FILTER_EXPRESSION_START_CHAR && !this.colName) { this.hasStartChar = true; } else if (char === COL_FILTER_EXPRESSION_END_CHAR && this.hasStartChar) { const isMatch = this.parseColumn(false, position); if (isMatch) { this.hasEndChar = true; return false; } else { this.colName += char; } } else { this.colName += char; } return void 0; } getDisplayValue() { return (this.hasStartChar ? COL_FILTER_EXPRESSION_START_CHAR : "") + this.colName + (this.hasEndChar ? COL_FILTER_EXPRESSION_END_CHAR : ""); } getColId() { return this.colId; } complete(position) { this.parseColumn(true, position); } getValidationError() { return this.valid ? null : { message: this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidColumn"), startPosition: this.startPosition, endPosition: this.endPosition ?? this.params.expression.length - 1 }; } parseColumn(fromComplete, endPosition) { this.endPosition = endPosition; const colValue = this.params.advFilterExpSvc.getColId(this.colName); if (colValue && this.hasStartChar) { this.colId = colValue.colId; checkAndUpdateExpression(this.params, this.colName, colValue.columnName, endPosition - 1); this.colName = colValue.columnName; this.column = this.params.colModel.getColDefCol(this.colId); if (this.column) { this.baseCellDataType = this.params.dataTypeSvc?.getBaseDataType(this.column) ?? "text"; return true; } } if (fromComplete) { this.valid = false; } this.baseCellDataType = "text"; return false; } }; var OperatorParser = class { constructor(params, startPosition, baseCellDataType) { this.params = params; this.startPosition = startPosition; this.baseCellDataType = baseCellDataType; this.type = "operator"; this.valid = true; this.expectedNumOperands = 0; this.operator = ""; } parse(char, position) { if (char === " " || char === ")") { const isMatch = this.parseOperator(false, position - 1); if (isMatch) { return true; } else { this.operator += char; } } else { this.operator += char; } return void 0; } complete(position) { this.parseOperator(true, position); } getValidationError() { return this.valid ? null : { message: this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidOption"), startPosition: this.startPosition, endPosition: this.endPosition ?? this.params.expression.length - 1 }; } getDisplayValue() { return this.operator; } getOperatorKey() { return this.parsedOperator; } parseOperator(fromComplete, endPosition) { const operatorForType = this.params.advFilterExpSvc.getDataTypeExpressionOperator(this.baseCellDataType); const parsedOperator = operatorForType.findOperator(this.operator); this.endPosition = endPosition; if (parsedOperator) { this.parsedOperator = parsedOperator; const operator = operatorForType.operators[parsedOperator]; this.expectedNumOperands = operator.numOperands; const operatorDisplayValue = operator.displayValue; checkAndUpdateExpression(this.params, this.operator, operatorDisplayValue, endPosition); this.operator = operatorDisplayValue; return true; } const isPartialMatch = parsedOperator === null; if (fromComplete || !isPartialMatch) { this.valid = false; } return false; } }; var OperandParser = class { constructor(params, startPosition, baseCellDataType, column) { this.params = params; this.startPosition = startPosition; this.baseCellDataType = baseCellDataType; this.column = column; this.type = "operand"; this.valid = true; this.operand = ""; this.validationMessage = null; this.filterValidationSetters = { number: () => { if (this.quotes || isNaN(this.modelValue)) { this.valid = false; this.validationMessage = this.params.advFilterExpSvc.translate("advancedFilterValidationNotANumber"); } }, bigint: () => { if (this.quotes || _parseBigIntOrNull(this.modelValue) === null) { this.valid = false; this.validationMessage = this.params.advFilterExpSvc.translate("advancedFilterValidationNotABigInt"); } }, date: (modelValue) => { if (modelValue == null) { this.valid = false; this.validationMessage = this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidDate"); } }, dateString: (...args) => this.filterValidationSetters.date(...args), dateTime: (...args) => this.filterValidationSetters.date(...args), dateTimeString: (...args) => this.filterValidationSetters.date(...args), boolean() { }, object() { }, text() { } }; } parse(char, position) { if (char === " ") { if (this.quotes) { this.operand += char; } else { this.parseOperand(false, position); return true; } } else if (char === ")") { if (this.baseCellDataType === "number" || !this.quotes) { this.parseOperand(false, position - 1); return true; } else { this.operand += char; } } else if (!this.operand && !this.quotes && (char === `'` || char === `"`)) { this.quotes = char; } else if (this.quotes && char === this.quotes) { this.parseOperand(false, position); return false; } else { this.operand += char; } return void 0; } complete(position) { this.parseOperand(true, position); } getValidationError() { return this.validationMessage ? { message: this.validationMessage, startPosition: this.startPosition, endPosition: this.endPosition ?? this.params.expression.length - 1 } : null; } getRawValue() { return this.operand; } getModelValue() { return this.modelValue; } parseOperand(fromComplete, position) { const { advFilterExpSvc } = this.params; this.endPosition = position; this.modelValue = this.operand; if (fromComplete && this.quotes) { this.valid = false; this.validationMessage = advFilterExpSvc.translate("advancedFilterValidationMissingQuote"); } else if (this.modelValue === "") { this.valid = false; this.validationMessage = advFilterExpSvc.translate("advancedFilterValidationMissingValue"); } else { const modelValue = advFilterExpSvc.getOperandModelValue(this.operand, this.baseCellDataType, this.column); if (modelValue != null) { this.modelValue = modelValue; } this.filterValidationSetters[this.baseCellDataType](modelValue); } } }; var COL_FILTER_EXPRESSION_START_CHAR = "["; var COL_FILTER_EXPRESSION_END_CHAR = "]"; var ColFilterExpressionParser = class { constructor(params, startPosition) { this.params = params; this.startPosition = startPosition; this.isAwaiting = true; this.operandValueGetters = { number: Number, bigint: (operand) => _parseBigIntOrNull(operand), date: (operand) => this.params.valueSvc.parseValue(this.columnParser.column, null, operand, void 0), dateString: (operand) => this.operandValueGetters.date(operand), dateTime: (operand) => this.operandValueGetters.date(operand), dateTimeString: (operand) => this.operandValueGetters.date(operand), boolean: (operand) => operand, object: (operand) => operand, text: (operand) => operand }; } parseExpression() { let i = this.startPosition; const { expression } = this.params; while (i < expression.length) { const char = expression[i]; if (char === " " && this.isAwaiting) { } else { this.isAwaiting = false; if (!this.parser) { let parser; if (!this.columnParser) { this.columnParser = new ColumnParser(this.params, i); parser = this.columnParser; } else if (!this.operatorParser) { this.operatorParser = new OperatorParser(this.params, i, this.columnParser.baseCellDataType); parser = this.operatorParser; } else { this.operandParser = new OperandParser( this.params, i, this.columnParser.baseCellDataType, this.columnParser.column ); parser = this.operandParser; } this.parser = parser; } const hasCompletedOnPrevChar = this.parser.parse(char, i); if (hasCompletedOnPrevChar != null) { if (this.isComplete()) { return this.returnEndPosition(hasCompletedOnPrevChar ? i - 1 : i, true); } this.parser = void 0; this.isAwaiting = true; } } i++; } this.parser?.complete?.(i - 1); return this.returnEndPosition(i); } isValid() { return this.isComplete() && this.columnParser.valid && this.operatorParser.valid && (!this.operandParser || this.operandParser.valid); } getValidationError() { const validationError = this.columnParser?.getValidationError() ?? this.operatorParser?.getValidationError() ?? this.operandParser?.getValidationError(); if (validationError) { return validationError; } const endPosition = this.params.expression.length; let translateKey; if (!this.columnParser) { translateKey = "advancedFilterValidationMissingColumn"; } else if (!this.operatorParser) { translateKey = "advancedFilterValidationMissingOption"; } else if (this.operatorParser.expectedNumOperands && !this.operandParser) { translateKey = "advancedFilterValidationMissingValue"; } if (translateKey) { return { message: this.params.advFilterExpSvc.translate(translateKey), startPosition: endPosition, endPosition }; } return null; } getFunction(params) { return this.getFunctionCommon(params, (operandIndex, operatorIndex, colId, evaluatorParamsIndex) => { return (expressionProxy, node, p) => p.operators[operatorIndex].evaluator( expressionProxy.getValue(colId, node), node, p.evaluatorParams[evaluatorParamsIndex], operandIndex == null ? void 0 : p.operands[operandIndex] ); }); } getAutocompleteListParams(position) { if (this.isColumnPosition(position)) { return this.getColumnAutocompleteListParams(position); } if (this.isOperatorPosition(position)) { return this.getOperatorAutocompleteListParams(position); } if (this.isBeyondEndPosition(position)) { return void 0; } return { enabled: false }; } updateExpression(position, updateEntry, type) { const { expression } = this.params; if (this.isColumnPosition(position)) { return updateExpression( this.params.expression, this.startPosition, this.columnParser?.getColId() ? this.columnParser.endPosition : findEndPosition(expression, position).endPosition, this.params.advFilterExpSvc.getColumnValue(updateEntry), true ); } else if (this.isOperatorPosition(position)) { const baseCellDataType = this.getBaseCellDataTypeFromOperatorAutocompleteType(type); const hasOperand = this.hasOperand(baseCellDataType, updateEntry.key); const doesOperandNeedQuotes = hasOperand && this.doesOperandNeedQuotes(baseCellDataType); let update; if (this.operatorParser?.startPosition != null && position < this.operatorParser.startPosition) { update = updateExpression( expression, position, position, updateEntry.displayValue ?? updateEntry.key, hasOperand, doesOperandNeedQuotes ); } else { let endPosition; let empty = false; if (this.operatorParser?.getOperatorKey()) { endPosition = this.operatorParser.endPosition; } else { const { endPosition: calculatedEndPosition, isEmpty } = findEndPosition( expression, position, true, true ); endPosition = calculatedEndPosition; empty = isEmpty; } update = updateExpression( expression, findStartPosition(expression, this.columnParser.endPosition + 1, endPosition), endPosition, updateEntry.displayValue ?? updateEntry.key, hasOperand, doesOperandNeedQuotes, empty ); } return { ...update, hideAutocomplete: !hasOperand }; } return null; } getModel() { const colId = this.columnParser.getColId(); const model = { filterType: this.columnParser.baseCellDataType, colId, type: this.operatorParser.getOperatorKey() }; if (this.operatorParser.expectedNumOperands) { model.filter = this.operandParser.getModelValue(); } return model; } getFunctionCommon(params, processFunc) { const colId = this.columnParser.getColId(); const operator = this.operatorParser?.getOperatorKey(); const { operators, evaluatorParams, operands } = params; const operatorForColumn = this.params.advFilterExpSvc.getExpressionOperator( this.columnParser.baseCellDataType, operator ); const operatorIndex = this.addToListAndGetIndex(operators, operatorForColumn); const evaluatorParamsForColumn = this.params.advFilterExpSvc.getExpressionEvaluatorParams(colId); const evaluatorParamsIndex = this.addToListAndGetIndex(evaluatorParams, evaluatorParamsForColumn); const operandIndex = this.operatorParser?.expectedNumOperands === 0 ? void 0 : this.addToListAndGetIndex(operands, this.getOperandValue()); return processFunc(operandIndex, operatorIndex, colId, evaluatorParamsIndex); } getOperandValue() { const { baseCellDataType, column } = this.columnParser; const operand = this.operandValueGetters[baseCellDataType](this.operandParser.getRawValue()); if (baseCellDataType === "dateString" || baseCellDataType === "dateTimeString") { return this.params.dataTypeSvc?.getDateParserFunction(column)(operand) ?? operand; } return operand; } isComplete() { return !!(this.operatorParser && (!this.operatorParser.expectedNumOperands || this.operatorParser.expectedNumOperands && this.operandParser)); } isColumnPosition(position) { return this.columnParser?.endPosition == null || position <= this.columnParser.endPosition + 1; } isOperatorPosition(position) { return this.operatorParser?.endPosition == null || position <= this.operatorParser.endPosition + 1; } isBeyondEndPosition(position) { return this.isComplete() && this.endPosition != null && position > this.endPosition + 1 && this.endPosition + 1 < this.params.expression.length; } returnEndPosition(returnPosition, treatAsEnd) { this.endPosition = treatAsEnd ? returnPosition : returnPosition - 1; return returnPosition; } getColumnAutocompleteListParams(position) { return this.params.advFilterExpSvc.generateAutocompleteListParams( this.params.advFilterExpSvc.getColumnAutocompleteEntries(), "column", this.getColumnSearchString(position) ); } getColumnSearchString(position) { const columnName = this.columnParser?.getDisplayValue() ?? ""; const searchString = getSearchString( columnName, position, this.columnParser?.endPosition == null ? this.params.expression.length : this.columnParser.endPosition + 1 ); const containsStartChar = this.columnParser?.hasStartChar && searchString.length > 0; const containsEndChar = this.columnParser?.hasEndChar && searchString.length === columnName.length + 2; if (containsStartChar) { return searchString.slice(1, containsEndChar ? -1 : void 0); } return searchString; } getOperatorAutocompleteListParams(position) { const column = this.columnParser?.column; if (!column) { return { enabled: false }; } const baseCellDataType = this.columnParser.baseCellDataType; const searchString = this.operatorParser?.startPosition != null && position < this.operatorParser.startPosition ? "" : getSearchString( this.operatorParser?.getDisplayValue() ?? "", position, this.operatorParser?.endPosition == null ? this.params.expression.length : this.operatorParser.endPosition + 1 ); return this.params.advFilterExpSvc.generateAutocompleteListParams( this.params.advFilterExpSvc.getOperatorAutocompleteEntries(column, baseCellDataType), `operator-${baseCellDataType}`, searchString ); } getBaseCellDataTypeFromOperatorAutocompleteType(type) { return type?.replace("operator-", ""); } hasOperand(baseCellDataType, operator) { return !baseCellDataType || !operator || (this.params.advFilterExpSvc.getExpressionOperator(baseCellDataType, operator)?.numOperands ?? 0) > 0; } doesOperandNeedQuotes(baseCellDataType) { return baseCellDataType !== "number" && baseCellDataType !== "bigint"; } addToListAndGetIndex(list, value) { const index = list.length; list.push(value); return index; } }; // packages/ag-grid-enterprise/src/advancedFilter/filterExpressionOperators.ts function findMatch(searchValue, values, getDisplayValue) { let partialMatch = false; const searchValueLowerCase = searchValue.toLocaleLowerCase(); const partialSearchValue = searchValueLowerCase + " "; const parsedValue = Object.keys(values).find((key) => { const value = values[key]; const displayValueLowerCase = getDisplayValue(value).toLocaleLowerCase(); if (displayValueLowerCase.startsWith(partialSearchValue)) { partialMatch = true; } return displayValueLowerCase === searchValueLowerCase; }); if (parsedValue) { return parsedValue; } else if (partialMatch) { return null; } else { return void 0; } } function getEntries(operators, activeOperatorKeys) { const keys = activeOperatorKeys ?? Object.keys(operators); return keys.map((key) => ({ key, displayValue: operators[key].displayValue })); } var TextFilterExpressionOperators = class { constructor(params) { this.params = params; this.initOperators(); } getEntries(activeOperators) { return getEntries(this.operators, activeOperators); } findOperator(displayValue) { return findMatch(displayValue, this.operators, ({ displayValue: displayValue2 }) => displayValue2); } initOperators() { const { translate } = this.params; this.operators = { contains: { displayValue: translate("advancedFilterContains"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, false, (v, o) => v.includes(o)), numOperands: 1 }, notContains: { displayValue: translate("advancedFilterNotContains"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, true, (v, o) => !v.includes(o)), numOperands: 1 }, equals: { displayValue: translate("advancedFilterTextEquals"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, false, (v, o) => v === o), numOperands: 1 }, notEqual: { displayValue: translate("advancedFilterTextNotEqual"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, true, (v, o) => v != o), numOperands: 1 }, startsWith: { displayValue: translate("advancedFilterStartsWith"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, false, (v, o) => v.startsWith(o)), numOperands: 1 }, endsWith: { displayValue: translate("advancedFilterEndsWith"), evaluator: (value, node, params, operand1) => this.evaluateExpression(value, node, params, operand1, false, (v, o) => v.endsWith(o)), numOperands: 1 }, blank: { displayValue: translate("advancedFilterBlank"), evaluator: (value) => value == null || typeof value === "string" && value.trim().length === 0, numOperands: 0 }, notBlank: { displayValue: translate("advancedFilterNotBlank"), evaluator: (value) => value != null && (typeof value !== "string" || value.trim().length > 0), numOperands: 0 } }; } evaluateExpression(value, node, params, operand, nullsMatch, expression) { if (value == null) { return nullsMatch; } return params.caseSensitive ? expression(params.valueConverter(value, node), operand) : expression(params.valueConverter(value, node).toLocaleLowerCase(), operand.toLocaleLowerCase()); } }; var ScalarFilterExpressionOperators = class { constructor(params) { this.params = params; this.initOperators(); } getEntries(activeOperators) { return getEntries(this.operators, activeOperators); } findOperator(displayValue) { return findMatch(displayValue, this.operators, ({ displayValue: displayValue2 }) => displayValue2); } initOperators() { const { translate, equals } = this.params; this.operators = { equals: { displayValue: translate("advancedFilterEquals"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInEquals, equals ), numOperands: 1 }, notEqual: { displayValue: translate("advancedFilterNotEqual"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInEquals, (v, o) => !equals(v, o) ), numOperands: 1 }, greaterThan: { displayValue: translate("advancedFilterGreaterThan"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInGreaterThan, (v, o) => v > o ), numOperands: 1 }, greaterThanOrEqual: { displayValue: translate("advancedFilterGreaterThanOrEqual"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInGreaterThan, (v, o) => v >= o ), numOperands: 1 }, lessThan: { displayValue: translate("advancedFilterLessThan"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInLessThan, (v, o) => v < o ), numOperands: 1 }, lessThanOrEqual: { displayValue: translate("advancedFilterLessThanOrEqual"), evaluator: (value, node, params, operand1) => this.evaluateSingleOperandExpression( value, node, params, operand1, !!params.includeBlanksInLessThan, (v, o) => v <= o ), numOperands: 1 }, blank: { displayValue: translate("advancedFilterBlank"), evaluator: (value) => value == null, numOperands: 0 }, notBlank: { displayValue: translate("advancedFilterNotBlank"), evaluator: (value) => value != null, numOperands: 0 } }; } evaluateSingleOperandExpression(value, node, params, operand, nullsMatch, expression) { if (value == null) { return nullsMatch; } return expression(params.valueConverter(value, node), operand); } }; var BooleanFilterExpressionOperators = class { constructor(params) { this.params = params; this.initOperators(); } getEntries(activeOperators) { return getEntries(this.operators, activeOperators); } findOperator(displayValue) { return findMatch(displayValue, this.operators, ({ displayValue: displayValue2 }) => displayValue2); } initOperators() { const { translate } = this.params; this.operators = { true: { displayValue: translate("advancedFilterTrue"), evaluator: (value) => !!value, numOperands: 0 }, false: { displayValue: translate("advancedFilterFalse"), evaluator: (value) => value === false, numOperands: 0 }, blank: { displayValue: translate("advancedFilterBlank"), evaluator: (value) => value == null, numOperands: 0 }, notBlank: { displayValue: translate("advancedFilterNotBlank"), evaluator: (value) => value != null, numOperands: 0 } }; } }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterExpressionService.ts var AdvancedFilterExpressionService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "advFilterExpSvc"; this.filterOperandGetters = { number: (model) => _toStringOrNull(model.filter) ?? "", bigint: (model) => _toStringOrNull(model.filter) ?? "", date: (model) => { const column = this.colModel.getColDefCol(model.colId); if (!column) { return null; } return this.valueSvc.formatValue( column, null, _parseDateTimeFromString(_toStringOrNull(model.filter) ?? "") ); }, dateTime: (model) => this.filterOperandGetters.date(model), dateString: (model) => { const column = this.colModel.getColDefCol(model.colId); if (!column) { return null; } const { filter } = model; const dateFormatFn = this.dataTypeSvc?.getDateFormatterFunction(column); const dateStringStringValue = dateFormatFn?.(_parseDateTimeFromString(_toStringOrNull(model.filter) ?? "") ?? void 0) ?? filter; return this.valueSvc.formatValue(column, null, dateStringStringValue); }, dateTimeString: (model) => this.filterOperandGetters.dateString(model), boolean: () => null, object: () => null, text: () => null }; this.operandModelValueGetters = { number: (operand) => _exists(operand) ? Number(operand) : null, bigint: (operand) => operand, date: (operand, column, baseCellDataType) => _serialiseDate( this.valueSvc.parseValue(column, null, operand, void 0), !!this.dataTypeSvc?.getDateIncludesTimeFlag(baseCellDataType) ), dateTime: (...args) => this.operandModelValueGetters.date(...args), dateString: (operand, column, baseCellDataType) => { const parsedDateString = this.valueSvc.parseValue(column, null, operand, void 0); if (this.dataTypeSvc) { return _serialiseDate( this.dataTypeSvc.getDateParserFunction(column)(parsedDateString) ?? null, this.dataTypeSvc.getDateIncludesTimeFlag(baseCellDataType) ); } return parsedDateString; }, dateTimeString: (...args) => this.operandModelValueGetters.dateString(...args), boolean: (operand) => operand, object: (operand) => operand, text: (operand) => operand }; this.columnNameToIdMap = {}; this.columnAutocompleteEntries = null; this.expressionEvaluatorParams = {}; } wireBeans(beans) { this.valueSvc = beans.valueSvc; this.colModel = beans.colModel; this.colNames = beans.colNames; this.dataTypeSvc = beans.dataTypeSvc; } postConstruct() { this.expressionJoinOperators = this.generateExpressionJoinOperators(); this.expressionOperators = this.generateExpressionOperators(); } parseJoinOperator(model) { const { type } = model; return this.expressionJoinOperators[type] ?? type; } getColumnDisplayValue(model) { const { colId } = model; const columnEntries = this.getColumnAutocompleteEntries(); const columnEntry = columnEntries.find(({ key }) => key === colId); let columnName; if (columnEntry) { columnName = columnEntry.displayValue; this.columnNameToIdMap[columnName.toLocaleUpperCase()] = { colId, columnName }; } else { columnName = colId; } return columnName; } getOperatorDisplayValue(model) { return this.getExpressionOperator(model.filterType, model.type)?.displayValue ?? model.type; } getOperandModelValue(operand, baseCellDataType, column) { return this.operandModelValueGetters[baseCellDataType](operand, column, baseCellDataType); } getOperandDisplayValue(model, skipFormatting) { const { filter, filterType } = model; if (filter == null) { return ""; } let operand1 = this.filterOperandGetters[filterType]( model ); if (filterType !== "number" && filterType !== "bigint") { operand1 ?? (operand1 = _toStringOrNull(filter) ?? ""); if (!skipFormatting) { operand1 = `"${operand1}"`; } } return skipFormatting ? operand1 : ` ${operand1}`; } parseColumnFilterModel(model) { const columnName = this.getColumnDisplayValue(model) ?? ""; const operator = this.getOperatorDisplayValue(model) ?? ""; const operands = this.getOperandDisplayValue(model); return `[${columnName}] ${operator}${operands}`; } updateAutocompleteCache(updateEntry, type) { if (type === "column") { const { key: colId, displayValue } = updateEntry; this.columnNameToIdMap[updateEntry.displayValue.toLocaleUpperCase()] = { colId, columnName: displayValue }; } } translate(key, variableValues) { let defaultValue = ADVANCED_FILTER_LOCALE_TEXT[key]; if (typeof defaultValue === "function") { defaultValue = defaultValue(variableValues); } return this.getLocaleTextFunc()(key, defaultValue, variableValues); } generateAutocompleteListParams(entries, type, searchString) { return { enabled: true, type, searchString, entries }; } getColumnAutocompleteEntries() { if (this.columnAutocompleteEntries) { return this.columnAutocompleteEntries; } const columns = this.colModel.getColDefCols() ?? []; const entries = []; const includeHiddenColumns = this.gos.get("includeHiddenColumnsInAdvancedFilter"); for (const column of columns) { if (column.getColDef().filter && (includeHiddenColumns || column.isVisible() || column.isRowGroupActive())) { entries.push({ key: column.getColId(), displayValue: this.colNames.getDisplayNameForColumn(column, "advancedFilter") }); } } entries.sort((a, b) => { const aValue = a.displayValue ?? ""; const bValue = b.displayValue ?? ""; if (aValue < bValue) { return -1; } else if (bValue > aValue) { return 1; } return 0; }); return entries; } getOperatorAutocompleteEntries(column, baseCellDataType) { const activeOperators = this.getActiveOperators(column); return this.getDataTypeExpressionOperator(baseCellDataType).getEntries(activeOperators); } getJoinOperatorAutocompleteEntries() { return Object.entries(this.expressionJoinOperators).map(([key, displayValue]) => ({ key, displayValue })); } getDefaultAutocompleteListParams(searchString) { return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(), "column", searchString); } getDataTypeExpressionOperator(baseCellDataType) { return this.expressionOperators[baseCellDataType]; } getExpressionOperator(baseCellDataType, operator) { return this.getDataTypeExpressionOperator(baseCellDataType)?.operators?.[operator]; } getExpressionJoinOperators() { return this.expressionJoinOperators; } getColId(columnName) { const upperCaseColumnName = columnName.toLocaleUpperCase(); const cachedColId = this.columnNameToIdMap[upperCaseColumnName]; if (cachedColId) { return cachedColId; } const columnAutocompleteEntries = this.getColumnAutocompleteEntries(); const colEntry = columnAutocompleteEntries.find( ({ displayValue }) => displayValue.toLocaleUpperCase() === upperCaseColumnName ); if (colEntry) { const { key: colId, displayValue } = colEntry; const colValue = { colId, columnName: displayValue }; this.columnNameToIdMap[upperCaseColumnName] = colValue; return colValue; } return null; } getExpressionEvaluatorParams(colId) { let params = this.expressionEvaluatorParams[colId]; if (params) { return params; } const column = this.colModel.getColDefCol(colId); if (!column) { return { valueConverter: (v) => v }; } const baseCellDataType = this.dataTypeSvc?.getBaseDataType(column); switch (baseCellDataType) { case "dateTimeString": case "dateString": params = { valueConverter: this.dataTypeSvc?.getDateParserFunction(column) ?? ((v) => v) }; break; case "object": if (column.getColDef().filterValueGetter) { params = { valueConverter: (v) => v }; } else { params = { valueConverter: (value, node) => this.valueSvc.formatValue(column, node, value) ?? (typeof value.toString === "function" ? value.toString() : "") }; } break; case "text": case void 0: params = { valueConverter: (v) => _toStringOrNull(v) }; break; default: params = { valueConverter: (v) => v }; break; } const { filterParams } = column.getColDef(); if (filterParams) { ["caseSensitive", "includeBlanksInEquals", "includeBlanksInLessThan", "includeBlanksInGreaterThan"].forEach( (param) => { const paramValue = filterParams[param]; if (paramValue) { params[param] = paramValue; } } ); } this.expressionEvaluatorParams[colId] = params; return params; } getColumnDetails(colId) { const column = this.colModel.getColDefCol(colId) ?? void 0; const baseCellDataType = (column ? this.dataTypeSvc?.getBaseDataType(column) : void 0) ?? "text"; return { column, baseCellDataType }; } generateExpressionOperators() { const translate = (key, variableValues) => this.translate(key, variableValues); const dateOperatorsParams = { translate, equals: (v, o) => v.getTime() === o.getTime() }; return { text: new TextFilterExpressionOperators({ translate }), boolean: new BooleanFilterExpressionOperators({ translate }), object: new TextFilterExpressionOperators({ translate }), number: new ScalarFilterExpressionOperators({ translate, equals: (v, o) => v === o }), bigint: new ScalarFilterExpressionOperators({ translate, equals: (v, o) => v === o }), date: new ScalarFilterExpressionOperators(dateOperatorsParams), dateString: new ScalarFilterExpressionOperators(dateOperatorsParams), dateTime: new ScalarFilterExpressionOperators(dateOperatorsParams), dateTimeString: new ScalarFilterExpressionOperators(dateOperatorsParams) }; } getColumnValue({ displayValue }) { return `${COL_FILTER_EXPRESSION_START_CHAR}${displayValue}${COL_FILTER_EXPRESSION_END_CHAR}`; } generateExpressionJoinOperators() { return { AND: this.translate("advancedFilterAnd"), OR: this.translate("advancedFilterOr") }; } getActiveOperators(column) { const filterOptions = column.getColDef().filterParams?.filterOptions; if (!filterOptions) { return void 0; } const isValid = filterOptions.every((filterOption) => typeof filterOption === "string"); return isValid ? filterOptions : void 0; } resetColumnCaches() { this.columnAutocompleteEntries = null; this.columnNameToIdMap = {}; this.expressionEvaluatorParams = {}; } }; // packages/ag-grid-enterprise/src/widgets/dialog.ts var DIALOG_CALLBACKS = { stopPropagationCallbacks: STOP_PROPAGATION_CALLBACKS, focusNextContainer: (beans, backwards) => { return _focusNextGridCoreContainer(beans, backwards); }, configureFocusableContainer: (beans, dialog) => { const gridCtrl = beans.ctrlsSvc.get("gridCtrl"); gridCtrl.addFocusableContainer(dialog); dialog.addDestroyFunc(() => gridCtrl.removeFocusableContainer(dialog)); } }; var Dialog = class extends AgDialog { constructor(config) { super(config, DIALOG_CALLBACKS); } getFocusableContainerName() { return "dialog"; } }; // packages/ag-grid-enterprise/src/advancedFilter/autocomplete/agAutocomplete.css var agAutocomplete_default = ".ag-autocomplete{align-items:center;display:flex;width:100%;>:where(.ag-text-field){flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}}.ag-autocomplete-virtual-list-item:hover{background-color:var(--ag-row-hover-color)}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}"; // packages/ag-grid-enterprise/src/widgets/virtualList.ts var VirtualList = class extends AgVirtualList { constructor(params) { super(STOP_PROPAGATION_CALLBACKS, params); } }; // packages/ag-grid-enterprise/src/advancedFilter/autocomplete/agAutocompleteRow.ts var AgAutocompleteRowElement = { tag: "div", cls: "ag-autocomplete-row", role: "presentation", children: [{ tag: "div", cls: "ag-autocomplete-row-label" }] }; var AgAutocompleteRow = class extends Component { constructor() { super(AgAutocompleteRowElement); this.hasHighlighting = false; } setState(value, selected) { this.value = value; this.render(); this.updateSelected(selected); } updateSelected(selected) { this.toggleCss("ag-autocomplete-row-selected", selected); } setSearchString(searchString) { let keepHighlighting = false; const { value } = this; if (value && _exists(searchString)) { const index = value.toLocaleLowerCase().indexOf(searchString.toLocaleLowerCase()); if (index >= 0) { keepHighlighting = true; this.hasHighlighting = true; const highlightEndIndex = index + searchString.length; const child = this.getGui().lastElementChild; _clearElement(child); child.append( // Start part value.slice(0, index), // Highlighted part wrapped in bold tag _createElement({ tag: "b", children: value.slice(index, highlightEndIndex) }), // End part value.slice(highlightEndIndex) ); } } if (!keepHighlighting && this.hasHighlighting) { this.hasHighlighting = false; this.render(); } } render() { this.getGui().lastElementChild.textContent = this.value ?? "\xA0"; } }; // packages/ag-grid-enterprise/src/advancedFilter/autocomplete/agAutocompleteList.ts var AgAutocompleteListElement = { tag: "div", cls: "ag-autocomplete-list-popup", children: [ { tag: "div", ref: "eList", cls: "ag-autocomplete-list" } ] }; var AgAutocompleteList = class extends AgPopupComponent { constructor(params) { super(AgAutocompleteListElement); this.params = params; this.eList = RefPlaceholder; this.searchString = ""; this.lastAutoListHeight = null; } postConstruct() { this.autocompleteEntries = this.params.autocompleteEntries; this.virtualList = this.createManagedBean(new VirtualList({ cssIdentifier: "autocomplete" })); this.virtualList.setComponentCreator(this.createRowComponent.bind(this)); this.eList.appendChild(this.virtualList.getGui()); this.virtualList.setModel({ getRowCount: () => this.autocompleteEntries.length, getRow: (index) => this.autocompleteEntries[index] }); const virtualListGui = this.virtualList.getGui(); this.addManagedListeners(virtualListGui, { click: () => this.params.onConfirmed(), mousemove: this.onMouseMove.bind(this), mousedown: (e) => e.preventDefault() }); this.setSelectedValue(0); this.updateListHeight(); } onNavigationKeyDown(event, key) { event.preventDefault(); const oldIndex = this.autocompleteEntries.indexOf(this.selectedValue); const newIndex = key === KeyCode.UP ? oldIndex - 1 : oldIndex + 1; this.checkSetSelectedValue(newIndex); } setSearch(searchString) { this.searchString = searchString; if (_exists(searchString)) { this.runSearch(); } else { this.autocompleteEntries = this.params.autocompleteEntries; this.virtualList.refresh(); this.checkSetSelectedValue(0); this.updateListHeight(); } this.updateSearchInList(); } runContainsSearch(searchString, searchStrings) { let topMatch; let topMatchStartsWithSearchString = false; const lowerCaseSearchString = searchString.toLocaleLowerCase(); const allMatches = searchStrings.filter((string) => { const lowerCaseString = string.toLocaleLowerCase(); const index = lowerCaseString.indexOf(lowerCaseSearchString); const startsWithSearchString = index === 0; const isMatch = index >= 0; if (isMatch && (!topMatch || !topMatchStartsWithSearchString && startsWithSearchString || topMatchStartsWithSearchString === startsWithSearchString && string.length < topMatch.length)) { topMatch = string; topMatchStartsWithSearchString = startsWithSearchString; } return isMatch; }); if (!topMatch && allMatches.length) { topMatch = allMatches[0]; } return { topMatch, allMatches }; } runStartsWithSearch(searchString, searchStrings) { const lowerCaseSearchString = searchString.toLocaleLowerCase(); const allMatches = searchStrings.filter( (string) => string.toLocaleLowerCase().startsWith(lowerCaseSearchString) ); const topMatch = allMatches[0]; return { topMatch, allMatches }; } runSearch() { const { autocompleteEntries, useFuzzySearch, useStartsWithSearch, forceLastSelection } = this.params; const searchStrings = autocompleteEntries.map((v) => v.displayValue ?? v.key); let matchingStrings; let topSuggestion; if (useFuzzySearch) { matchingStrings = _fuzzySuggestions({ inputValue: this.searchString, allSuggestions: searchStrings, hideIrrelevant: true }).values; topSuggestion = matchingStrings.length ? matchingStrings[0] : void 0; } else { const matches = useStartsWithSearch ? this.runStartsWithSearch(this.searchString, searchStrings) : this.runContainsSearch(this.searchString, searchStrings); matchingStrings = matches.allMatches; topSuggestion = matches.topMatch; } let filteredEntries = autocompleteEntries.filter( ({ key, displayValue }) => matchingStrings.includes(displayValue ?? key) ); if (!filteredEntries.length && this.selectedValue && forceLastSelection?.(this.selectedValue, this.searchString)) { filteredEntries = [this.selectedValue]; } this.autocompleteEntries = filteredEntries; this.virtualList.refresh(); this.updateListHeight(); if (!topSuggestion) { return; } const topSuggestionIndex = matchingStrings.indexOf(topSuggestion); this.checkSetSelectedValue(topSuggestionIndex); } updateSearchInList() { this.virtualList.forEachRenderedRow((row) => row.setSearchString(this.searchString)); } updateListHeight() { if (!this.params.autoSizeList) { return; } const rowCount = this.autocompleteEntries.length; const rowHeight = this.virtualList.getRowHeight(); const maxItems = this.params.maxVisibleItems ?? rowCount; const visibleCount = Math.min(rowCount, maxItems); let height = visibleCount * rowHeight; if (rowCount === 0) { height = rowHeight; } if (this.lastAutoListHeight === height) { return; } this.lastAutoListHeight = height; this.eList.style.height = `${height}px`; if (_isVisible(this.eList)) { this.params.onListHeightChanged?.(); } } checkSetSelectedValue(index) { if (index >= 0 && index < this.autocompleteEntries.length) { this.setSelectedValue(index); } } setSelectedValue(index) { const value = this.autocompleteEntries[index]; if (this.selectedValue === value) { return; } this.selectedValue = value; this.virtualList.ensureIndexVisible(index); this.virtualList.forEachRenderedRow((cmp, idx) => { cmp.updateSelected(index === idx); }); } createRowComponent(value) { const row = new AgAutocompleteRow(); this.createBean(row); row.setState(value.displayValue ?? value.key, value === this.selectedValue); return row; } onMouseMove(mouseEvent) { const virtualList = this.virtualList; const rect = virtualList.getGui().getBoundingClientRect(); const scrollTop = virtualList.getScrollTop(); const mouseY = mouseEvent.clientY - rect.top + scrollTop; const row = Math.floor(mouseY / virtualList.getRowHeight()); this.checkSetSelectedValue(row); } afterGuiAttached() { this.virtualList.refresh(); this.updateListHeight(); } getSelectedValue() { if (!this.autocompleteEntries.length) { return null; } return this.selectedValue ?? null; } }; // packages/ag-grid-enterprise/src/advancedFilter/autocomplete/agAutocomplete.ts var AgAutocompleteElement = { tag: "div", cls: "ag-autocomplete", role: "presentation", children: [ { tag: "ag-input-text-field", ref: "eAutocompleteInput" } ] }; var AgAutocomplete = class extends Component { constructor() { super(AgAutocompleteElement, [AgInputTextFieldSelector]); this.eAutocompleteInput = RefPlaceholder; this.isListOpen = false; this.lastPosition = 0; this.valid = true; this.registerCSS(agAutocomplete_default); } wireBeans(beans) { this.popupSvc = beans.popupSvc; } postConstruct() { this.eAutocompleteInput.onValueChange((value) => this.onValueChanged(value)); this.eAutocompleteInput.getInputElement().setAttribute("autocomplete", "off"); this.addGuiEventListener("keydown", this.onKeyDown.bind(this)); this.addGuiEventListener("click", this.updatePositionAndList.bind(this)); this.addDestroyFunc(() => { this.destroyBean(this.autocompleteList); }); this.addGuiEventListener("focusout", () => this.onFocusOut()); } onValueChanged(value) { const parsedValue = _makeNull(value); this.updateValue(parsedValue); this.updateAutocompleteList(parsedValue); } updateValue(value) { this.updateLastPosition(); this.dispatchLocalEvent({ type: "eventValueChanged", value }); this.validate(value); } updateAutocompleteList(value) { const autocompleteListParams = this.listGenerator?.(value, this.lastPosition) ?? { enabled: false }; if (!autocompleteListParams.type || autocompleteListParams.type !== this.autocompleteListParams?.type) { if (this.isListOpen) { this.closeList(); } } const isListOpen = this.isListOpen; this.autocompleteListParams = autocompleteListParams; if (autocompleteListParams?.enabled) { if (!isListOpen) { this.openList(); } const { searchString } = autocompleteListParams; this.autocompleteList.setSearch(searchString ?? ""); } else if (isListOpen) { this.closeList(); } } onKeyDown(event) { const key = event.key; this.updateLastPosition(); switch (key) { case KeyCode.ENTER: this.onEnterKeyDown(event); break; case KeyCode.TAB: this.onTabKeyDown(event); break; case KeyCode.DOWN: case KeyCode.UP: this.onUpDownKeyDown(event, key); break; case KeyCode.LEFT: case KeyCode.RIGHT: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: setTimeout(() => { this.updatePositionAndList(); }); break; case KeyCode.ESCAPE: this.onEscapeKeyDown(event); break; case KeyCode.SPACE: if (event.ctrlKey && !this.isListOpen) { event.preventDefault(); this.forceOpenList(); } break; } } confirmSelection() { const selectedValue = this.autocompleteList?.getSelectedValue(); if (selectedValue) { this.closeList(); this.dispatchLocalEvent({ type: "eventOptionSelected", value: this.getValue(), position: this.lastPosition, updateEntry: selectedValue, autocompleteType: this.autocompleteListParams.type }); } } onTabKeyDown(event) { if (this.isListOpen) { event.preventDefault(); event.stopPropagation(); this.confirmSelection(); } } onEnterKeyDown(event) { event.preventDefault(); if (this.isListOpen) { this.confirmSelection(); } else { this.onCompleted(); } } onUpDownKeyDown(event, key) { event.preventDefault(); if (!this.isListOpen) { this.forceOpenList(); } else { this.autocompleteList?.onNavigationKeyDown(event, key); } } onEscapeKeyDown(event) { if (this.isListOpen) { event.preventDefault(); event.stopPropagation(); this.closeList(); this.setCaret(this.lastPosition, true); } } onFocusOut() { if (this.isListOpen) { this.closeList(); } } updatePositionAndList() { this.updateLastPosition(); this.updateAutocompleteList(this.eAutocompleteInput.getValue() ?? null); } setCaret(position, setFocus) { if (setFocus || _isNothingFocused(this.beans)) { this.eAutocompleteInput.getFocusableElement().focus(); } const eInput = this.eAutocompleteInput.getInputElement(); eInput.setSelectionRange(position, position); if (position === eInput.value.length) { eInput.scrollLeft = eInput.scrollWidth; } } forceOpenList() { this.onValueChanged(this.eAutocompleteInput.getValue()); } updateLastPosition() { this.lastPosition = this.eAutocompleteInput.getInputElement().selectionStart ?? 0; } validate(value) { if (!this.validator) { return; } const validationMessage = this.validationMessage = this.validator(value); this.eAutocompleteInput.getInputElement().setCustomValidity(validationMessage ?? ""); this.valid = !validationMessage; this.dispatchLocalEvent({ type: "eventValidChanged", isValid: this.valid, validationMessage }); } openList() { this.isListOpen = true; this.autocompleteList = this.createBean( new AgAutocompleteList({ autocompleteEntries: this.autocompleteListParams.entries, onConfirmed: () => this.confirmSelection(), forceLastSelection: this.forceLastSelection }) ); const ePopupGui = this.autocompleteList.getGui(); const positionParams = { ePopup: ePopupGui, type: "autocomplete", eventSource: this.getGui(), position: "under", alignSide: this.gos.get("enableRtl") ? "right" : "left", keepWithinBounds: true }; const addPopupRes = this.popupSvc.addPopup({ eChild: ePopupGui, anchorToElement: this.getGui(), positionCallback: () => this.popupSvc.positionPopupByComponent(positionParams), ariaLabel: this.listAriaLabel }); this.hidePopup = addPopupRes.hideFunc; this.autocompleteList.afterGuiAttached(); } closeList() { this.isListOpen = false; this.hidePopup(); this.destroyBean(this.autocompleteList); this.autocompleteList = null; } onCompleted() { if (this.isListOpen) { this.closeList(); } this.dispatchLocalEvent({ type: "eventValueConfirmed", value: this.getValue(), isValid: this.isValid() }); } getValue() { return _makeNull(this.eAutocompleteInput.getValue()); } setInputPlaceholder(placeholder) { this.eAutocompleteInput.setInputPlaceholder(placeholder); return this; } setInputAriaLabel(label) { this.eAutocompleteInput.setInputAriaLabel(label); return this; } setListAriaLabel(label) { this.listAriaLabel = label; return this; } setListGenerator(listGenerator) { this.listGenerator = listGenerator; return this; } setValidator(validator) { this.validator = validator; return this; } isValid() { return this.valid; } setValue(params) { const { value, position, silent, updateListOnlyIfOpen, restoreFocus } = params; this.eAutocompleteInput.setValue(value, true); this.setCaret(position ?? this.lastPosition, restoreFocus); if (!silent) { this.updateValue(value); } if (!updateListOnlyIfOpen || this.isListOpen) { this.updateAutocompleteList(value); } } setForceLastSelection(forceLastSelection) { this.forceLastSelection = forceLastSelection; return this; } setInputDisabled(disabled) { this.eAutocompleteInput.setDisabled(disabled); return this; } }; var AgAutocompleteSelector = { selector: "AG-AUTOCOMPLETE", component: AgAutocomplete }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterComp.ts var DEFAULT_ADVANCED_FILTER_PARAMS = { buttons: ["apply"], suppressBuilderButton: false }; var ButtonLocaleMap = { apply: "advancedFilterApply", clear: "advancedFilterClear", cancel: "advancedFilterCancel", reset: "advancedFilterReset" }; var AdvancedFilterElement = { tag: "div", cls: "ag-advanced-filter", role: "presentation", attrs: { tabindex: "-1" }, children: [ { tag: "ag-autocomplete", ref: "eAutocomplete" }, { tag: "ag-filter-button", ref: "eButtons", cls: "ag-advanced-filter-buttons" }, { tag: "button", ref: "eBuilderFilterButton", cls: "ag-button ag-advanced-filter-builder-button", children: [ { tag: "span", ref: "eBuilderFilterButtonIcon", attrs: { "aria-hidden": "true" } }, { tag: "span", ref: "eBuilderFilterButtonLabel", cls: "ag-advanced-filter-builder-button-label" } ] } ] }; var AdvancedFilterComp = class extends Component { constructor() { super(AdvancedFilterElement, [AgAutocompleteSelector, AgFilterButtonSelector]); this.eAutocomplete = RefPlaceholder; this.eButtons = RefPlaceholder; this.eBuilderFilterButton = RefPlaceholder; this.eBuilderFilterButtonIcon = RefPlaceholder; this.eBuilderFilterButtonLabel = RefPlaceholder; this.expressionParser = null; this.isApplyDisabled = true; this.builderOpen = false; } wireBeans(beans) { this.advFilterExpSvc = beans.advFilterExpSvc; this.advancedFilter = beans.advancedFilter; this.filterManager = beans.filterManager; this.registry = beans.registry; } postConstruct() { this.tooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.getGui(), getTooltipShowDelayOverride: () => 1e3, getLocation: () => "advancedFilter" }) ); this.eAutocomplete.setListGenerator((_value, position) => this.generateAutocompleteListParams(position)).setValidator(() => this.validateValue()).setForceLastSelection( (lastSelection, searchString) => this.forceLastSelection(lastSelection, searchString) ).setInputAriaLabel(this.advFilterExpSvc.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advFilterExpSvc.translate("ariaLabelAdvancedFilterAutocomplete")); this.refresh(); this.addManagedListeners(this.eAutocomplete, { eventValueChanged: ({ value }) => this.onValueChanged(value), eventValueConfirmed: ({ isValid }) => this.onValueConfirmed(isValid), eventOptionSelected: ({ position, updateEntry, autocompleteType }) => this.onOptionSelected(position, updateEntry, autocompleteType), eventValidChanged: ({ isValid, validationMessage }) => this.onValidChanged(isValid, validationMessage) }); const { buttons, suppressBuilderButton } = { ...DEFAULT_ADVANCED_FILTER_PARAMS, ...this.gos.get("advancedFilterParams") }; this.setupButtons(buttons); this.setupBuilderButton(suppressBuilderButton); this.beans.gos.addManagedPropertyListener("advancedFilterParams", (event) => { const currentValue = { ...DEFAULT_ADVANCED_FILTER_PARAMS, ...event.currentValue }; const previousValue = { ...DEFAULT_ADVANCED_FILTER_PARAMS, ...event.previousValue }; if (currentValue.buttons !== previousValue.buttons) { const buttons2 = currentValue.buttons.map((type) => ({ type, label: this.advFilterExpSvc.translate(ButtonLocaleMap[type]) })); this.eButtons.updateButtons(buttons2); } if (currentValue.suppressBuilderButton !== previousValue.suppressBuilderButton) { _setDisplayed(this.eBuilderFilterButton, !currentValue.suppressBuilderButton); } }); } refresh() { const expression = this.advancedFilter.getExpressionDisplayValue(); this.eAutocomplete.setValue({ value: expression ?? "", position: expression?.length, updateListOnlyIfOpen: true }); } setInputDisabled(disabled) { this.eAutocomplete.setInputDisabled(disabled); this.eButtons.updateValidity( !disabled && !this.isApplyDisabled && !this.advancedFilter.isCurrentExpressionApplied() ); } setupButtons(actions) { const buttons = actions.map((type) => ({ type, label: this.advFilterExpSvc.translate(ButtonLocaleMap[type]) })); const getListener = (action) => () => { this.updateModel(action); }; this.eButtons.addManagedListeners(this.eButtons, { apply: getListener("apply"), clear: getListener("clear"), reset: getListener("reset"), cancel: getListener("cancel") }); this.eButtons.updateButtons(buttons); } updateModel(action) { switch (action) { case "apply": this.onValueConfirmed(this.eAutocomplete.isValid()); break; case "reset": this.advancedFilter.setModel(null); this.filterManager?.onFilterChanged({ source: "advancedFilter" }); break; case "cancel": this.advancedFilter.setModel(this.advancedFilter.getModel()); this.filterManager?.onFilterChanged({ source: "advancedFilter" }); break; case "clear": this.eAutocomplete.setValue({ value: "", restoreFocus: true }); break; } } setupBuilderButton(suppressed) { this.eBuilderFilterButtonIcon.appendChild(_createIconNoSpan("advancedFilterBuilder", this.beans)); this.eBuilderFilterButtonLabel.textContent = this.advFilterExpSvc.translate("advancedFilterBuilder"); this.activateTabIndex([this.eBuilderFilterButton]); this.addManagedElementListeners(this.eBuilderFilterButton, { click: () => this.openBuilder() }); this.addManagedListeners(this.advancedFilter.getCtrl(), { advancedFilterBuilderClosed: () => this.closeBuilder() }); _setDisplayed(this.eBuilderFilterButton, !suppressed); } onValueChanged(value) { value = _makeNull(value); this.advancedFilter.setExpressionDisplayValue(value); this.expressionParser = this.advancedFilter.createExpressionParser(value); const updatedExpression = this.expressionParser?.parseExpression(); if (updatedExpression && updatedExpression !== value) { this.eAutocomplete.setValue({ value: updatedExpression, silent: true, restoreFocus: true }); } } onValueConfirmed(isValid) { if (!isValid || this.isApplyDisabled) { return; } this.eButtons?.updateValidity(false); this.advancedFilter.applyExpression(); this.filterManager?.onFilterChanged({ source: "advancedFilter" }); } onOptionSelected(position, updateEntry, type) { const { updatedValue, updatedPosition, hideAutocomplete } = this.updateExpression(position, updateEntry, type); this.eAutocomplete.setValue({ value: updatedValue, position: updatedPosition, updateListOnlyIfOpen: hideAutocomplete, restoreFocus: true }); } validateValue() { return this.expressionParser?.isValid() ? null : this.expressionParser?.getValidationMessage() ?? null; } onValidChanged(isValid, validationMessage) { this.isApplyDisabled = !isValid || this.advancedFilter.isCurrentExpressionApplied(); this.eButtons.updateValidity(!this.isApplyDisabled); this.tooltipFeature?.setTooltipAndRefresh(validationMessage); } generateAutocompleteListParams(position) { return this.expressionParser ? this.expressionParser.getAutocompleteListParams(position) : this.advFilterExpSvc.getDefaultAutocompleteListParams(""); } updateExpression(position, updateEntry, type) { this.advFilterExpSvc.updateAutocompleteCache(updateEntry, type); return this.expressionParser?.updateExpression(position, updateEntry, type) ?? this.advancedFilter.getDefaultExpression(updateEntry); } forceLastSelection({ key, displayValue }, searchString) { return !!searchString.toLocaleLowerCase().match(`^${(displayValue ?? key).toLocaleLowerCase()}\\s*$`); } openBuilder() { if (this.builderOpen) { return; } this.builderOpen = true; _setDisabled(this.eBuilderFilterButton, true); this.advancedFilter.getCtrl().toggleFilterBuilder({ source: "ui", eventSource: this.eBuilderFilterButton }); } closeBuilder() { if (!this.builderOpen) { return; } this.builderOpen = false; _setDisabled(this.eBuilderFilterButton, false); this.eBuilderFilterButton.focus(); } }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterHeaderComp.ts var AdvancedFilterHeaderElement = { tag: "div", cls: "ag-advanced-filter-header", role: "row" }; var AdvancedFilterHeaderComp = class extends Component { constructor(enabled) { super(AdvancedFilterHeaderElement); this.enabled = enabled; } wireBeans(beans) { this.colModel = beans.colModel; this.focusSvc = beans.focusSvc; this.ctrlsSvc = beans.ctrlsSvc; } postConstruct() { this.setupAdvancedFilter(this.enabled); this.addDestroyFunc(() => this.destroyBean(this.eAdvancedFilter)); const heightListener = () => { if (this.enabled) { this.setEnabledHeight(); } }; this.addManagedEventListeners({ gridColumnsChanged: () => this.onGridColumnsChanged(), columnHeaderHeightChanged: heightListener, stylesChanged: heightListener }); this.addManagedPropertyListener("headerHeight", heightListener); this.addManagedPropertyListener("floatingFiltersHeight", heightListener); this.addGuiEventListener("keydown", (event) => this.onKeyDown(event)); this.addGuiEventListener("focusout", (event) => { if (!this.getFocusableElement().contains(event.relatedTarget)) { this.focusSvc.clearAdvancedFilterColumn(); } }); } getFocusableElement() { return this.eAdvancedFilter?.getGui() ?? this.getGui(); } setEnabled(enabled) { if (enabled === this.enabled) { return; } this.setupAdvancedFilter(enabled); } refresh() { this.eAdvancedFilter?.refresh(); } getHeight() { return this.height; } setInputDisabled(disabled) { this.eAdvancedFilter?.setInputDisabled(disabled); } setupAdvancedFilter(enabled) { const eGui = this.getGui(); if (enabled) { this.eAdvancedFilter = this.createBean(new AdvancedFilterComp()); const eAdvancedFilterGui = this.eAdvancedFilter.getGui(); this.eAdvancedFilter.addCss("ag-advanced-filter-header-cell"); this.setEnabledHeight(); this.setAriaRowIndex(); _setAriaRole(eAdvancedFilterGui, "gridcell"); _setAriaColIndex(eAdvancedFilterGui, 1); this.setAriaColumnCount(eAdvancedFilterGui); eGui.appendChild(eAdvancedFilterGui); } else { _clearElement(eGui); this.destroyBean(this.eAdvancedFilter); this.height = 0; } _setDisplayed(eGui, enabled); this.enabled = enabled; } setEnabledHeight() { const eGui = this.getGui(); this.height = getFloatingFiltersHeight(this.beans); const height = `${this.height}px`; eGui.style.height = height; eGui.style.minHeight = height; } setAriaColumnCount(eAdvancedFilterGui) { _setAriaColSpan(eAdvancedFilterGui, this.colModel.getCols().length); } setAriaRowIndex() { _setAriaRowIndex(this.getGui(), this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0); } onGridColumnsChanged() { if (!this.eAdvancedFilter) { return; } this.setAriaColumnCount(this.eAdvancedFilter.getGui()); this.setAriaRowIndex(); } onKeyDown(event) { switch (event.key) { case KeyCode.ENTER: { if (this.hasFocus()) { if (_focusInto(this.getFocusableElement())) { event.preventDefault(); } } break; } case KeyCode.ESCAPE: if (!this.hasFocus()) { this.getFocusableElement().focus(); } break; case KeyCode.UP: this.navigateUpDown(true, event); break; case KeyCode.DOWN: this.navigateUpDown(false, event); break; case KeyCode.TAB: if (this.hasFocus()) { this.navigateLeftRight(event); } else { const nextFocusableEl = _findNextFocusableElement( this.beans, this.getFocusableElement(), null, event.shiftKey ); if (nextFocusableEl) { event.preventDefault(); nextFocusableEl.focus(); } else { this.navigateLeftRight(event); } } break; } } navigateUpDown(backwards, event) { if (this.hasFocus()) { if (this.focusSvc.focusNextFromAdvancedFilter(backwards)) { event.preventDefault(); } } } navigateLeftRight(event) { if (event.shiftKey ? this.focusSvc.focusLastHeader() : this.focusSvc.focusNextFromAdvancedFilter(false, true)) { event.preventDefault(); } } hasFocus() { return _getActiveDomElement(this.beans) === this.getFocusableElement(); } }; // packages/ag-grid-enterprise/src/features/virtualListDragFeature.ts var VirtualListDragFeature = class extends AgVirtualListDragFeature { }; // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderDragFeature.ts var AdvancedFilterBuilderDragFeature = class extends BeanStub { constructor(comp, virtualList) { super(); this.comp = comp; this.virtualList = virtualList; } postConstruct() { this.createManagedBean( new VirtualListDragFeature(this.comp, this.virtualList, { dragSourceType: DragSourceType.AdvancedFilterBuilder, addListeners: (parent, listItemDragStart, listItemDragEnd) => { parent.addManagedListeners(this, { advancedFilterBuilderDragStarted: listItemDragStart, advancedFilterBuilderDragEnded: listItemDragEnd }); }, getCurrentDragValue: (listItemDragStartEvent) => this.getCurrentDragValue(listItemDragStartEvent), isMoveBlocked: () => false, getNumRows: (comp) => comp.getNumItems(), moveItem: (currentDragValue, lastHoveredListItem) => this.moveItem(currentDragValue, lastHoveredListItem) }) ); } getCurrentDragValue(listItemDragStartEvent) { return listItemDragStartEvent.item; } moveItem(currentDragValue, lastHoveredListItem) { this.comp.moveItem(currentDragValue, lastHoveredListItem); } }; // packages/ag-grid-enterprise/src/richSelect/richSelectAsyncRequestsFeature.ts var DEFAULT_VALUES_PAGE_SIZE = 100; function createRichSelectAsyncRequestBindings(params) { const { host, source, useAsyncSearch, onMisconfiguredSearchSource, onFirstValuesPageLoaded } = params; const controller = new RichSelectAsyncRequestsFeature({ host, source, onMisconfiguredSearchSource, onFirstValuesPageLoaded: onFirstValuesPageLoaded ?? (() => { }) }); const hasPagedSource = typeof source.loadValuesPage === "function"; return { controller, hasPagedSource, onSearch: useAsyncSearch ? (searchString) => controller.onSearch(searchString) : void 0, onLoadMoreRows: hasPagedSource ? (direction) => controller.loadValuesPage(direction ?? "down") : void 0 }; } var RichSelectAsyncRequestsFeature = class { constructor(ctrlParams) { this.ctrlParams = ctrlParams; this.currentSearchRequest = 0; this.currentValuesPageRequest = 0; this.valuesPageLoading = false; this.valuesPageHasMoreNext = false; this.valuesPageHasMorePrev = false; this.valuesPageLoadedValues = []; this.valuesPageSearch = ""; this.valuesPageWindowStartRow = 0; this.destroyed = false; } destroy() { this.destroyed = true; this.currentSearchRequest++; this.currentValuesPageRequest++; } onSearch(searchString) { if (this.destroyed) { return; } if (this.isValuesPaged()) { this.resetValuesPage(searchString); return; } const currentRequest = ++this.currentSearchRequest; const { host, source, onMisconfiguredSearchSource } = this.ctrlParams; host.setValueList({ refresh: true, valueList: void 0 }); if (!searchString) { return; } if (typeof source.searchValues !== "function") { onMisconfiguredSearchSource?.(); return; } let valuesPromise; try { valuesPromise = source.searchValues(searchString); } catch (error) { _consoleError("Rich Select", error); if (currentRequest === this.currentSearchRequest) { host.setValueList({ refresh: true, valueList: [] }); } return; } if (Array.isArray(valuesPromise)) { onMisconfiguredSearchSource?.(); host.setValueList({ refresh: true, valueList: valuesPromise }); return; } host.setValueList({ valueList: valuesPromise.then((results) => { if (currentRequest === this.currentSearchRequest) { return results; } }).catch((error) => { _consoleError("Rich Select", error); if (currentRequest === this.currentSearchRequest) { return []; } }), refresh: true }); } resetValuesPage(searchString) { if (this.destroyed) { return; } this.valuesPageSearch = searchString; this.valuesPageLoadedValues = []; this.valuesPageWindowStartRow = this.resolveValuesPageStartRow(searchString); this.valuesPageNextCursor = void 0; this.valuesPageHasMoreNext = true; this.valuesPageHasMorePrev = this.valuesPageWindowStartRow > 0; this.valuesPageLoading = false; this.currentValuesPageRequest++; this.ctrlParams.host.setValueList({ valueList: void 0, refresh: true, isInitial: true }); this.loadValuesPage("down"); } loadValuesPage(direction) { if (this.destroyed) { return; } const valuesPage = this.ctrlParams.source.loadValuesPage; if (typeof valuesPage !== "function" || this.valuesPageLoading) { return; } if (direction === "up" && !this.valuesPageHasMorePrev || direction === "down" && !this.valuesPageHasMoreNext) { return; } const pageSize = Math.max(this.ctrlParams.source.valuesPageSize ?? DEFAULT_VALUES_PAGE_SIZE, 1); const startRow = direction === "up" ? Math.max(this.valuesPageWindowStartRow - pageSize, 0) : this.valuesPageWindowStartRow + this.valuesPageLoadedValues.length; const endRow = direction === "up" ? this.valuesPageWindowStartRow : startRow + pageSize; if (startRow >= endRow) { if (direction === "up") { this.valuesPageHasMorePrev = false; } else { this.valuesPageHasMoreNext = false; } return; } const requestVersion = this.currentValuesPageRequest; const requestParams = { search: this.valuesPageSearch, startRow, endRow, cursor: direction === "down" ? this.valuesPageNextCursor : void 0 }; this.valuesPageLoading = true; if (this.valuesPageLoadedValues.length === 0) { this.ctrlParams.host.setIsLoading(); } let pageResultOrPromise; try { pageResultOrPromise = valuesPage(requestParams); } catch (error) { this.handleValuesPageError(error, requestVersion); return; } Promise.resolve(pageResultOrPromise).then( (pageResult) => this.applyValuesPageResult(pageResult, pageSize, requestVersion, direction, startRow, endRow) ).catch((error) => this.handleValuesPageError(error, requestVersion)); } applyValuesPageResult(pageResult, pageSize, requestVersion, direction, requestStartRow, requestEndRow) { if (this.destroyed || requestVersion !== this.currentValuesPageRequest) { return; } this.valuesPageLoading = false; const isFirstLoadedPage = this.valuesPageLoadedValues.length === 0; const values = pageResult?.values ?? []; if (direction === "up") { if (values.length) { this.valuesPageLoadedValues = [...values, ...this.valuesPageLoadedValues]; this.valuesPageWindowStartRow = requestStartRow; } const expectedCount = requestEndRow - requestStartRow; this.valuesPageHasMorePrev = requestStartRow > 0 && values.length >= expectedCount; } else { if (values.length) { this.valuesPageLoadedValues = [...this.valuesPageLoadedValues, ...values]; } this.valuesPageNextCursor = pageResult?.cursor; const loadedRowCount = this.valuesPageLoadedValues.length; if (typeof pageResult?.lastRow === "number") { this.valuesPageHasMoreNext = this.valuesPageWindowStartRow + loadedRowCount < pageResult.lastRow; } else if (pageResult?.cursor !== void 0) { this.valuesPageHasMoreNext = !!pageResult.cursor; } else { this.valuesPageHasMoreNext = values.length >= pageSize; } } this.ctrlParams.host.setValueList({ valueList: this.valuesPageLoadedValues, refresh: true, isInitial: true, scrollToCurrentValue: isFirstLoadedPage, prependedRowCount: direction === "up" ? values.length : void 0 }); if (isFirstLoadedPage) { this.ctrlParams.onFirstValuesPageLoaded(); } } handleValuesPageError(error, requestVersion) { _consoleError("Rich Select", error); if (this.destroyed || requestVersion !== this.currentValuesPageRequest) { return; } this.valuesPageLoading = false; this.valuesPageHasMoreNext = false; this.valuesPageHasMorePrev = false; this.ctrlParams.host.setValueList({ valueList: this.valuesPageLoadedValues, refresh: true, isInitial: true }); } resolveValuesPageStartRow(searchString) { if (searchString) { return 0; } const startRow = this.ctrlParams.source.valuesPageInitialStartRow?.(searchString); return Math.max(Math.floor(startRow ?? 0), 0); } isValuesPaged() { return typeof this.ctrlParams.source.loadValuesPage === "function"; } }; // packages/ag-grid-enterprise/src/widgets/agPill.ts var AgPillElement = { tag: "div", cls: "ag-pill", role: "option", children: [ { tag: "span", ref: "eText", cls: "ag-pill-text" }, { tag: "span", ref: "eButton", cls: "ag-button ag-pill-button", role: "presentation" } ] }; var AgPill = class extends Component { constructor(config) { super(AgPillElement); this.config = config; this.eText = RefPlaceholder; this.eButton = 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; } }; // packages/ag-grid-enterprise/src/widgets/AgPillContainer.ts var AgPillContainerElement = { tag: "div", cls: "ag-pill-container" }; var AgPillContainer = class extends Component { constructor() { super(AgPillContainerElement); this.pills = []; } init(params) { this.params = params; this.getKey = params.valueFormatter ?? ((v) => String(v)); this.refresh(); } refresh() { this.clearPills(); const { params, onPillKeyDown, getKey } = this; let values = params.getValue(); if (!Array.isArray(values)) { if (values == null) { return; } values = [values]; } const valueFormatter = params.valueFormatter ?? ((v) => String(v)); const len = values.length; _setAriaRole(this.getGui(), len === 0 ? "presentation" : "listbox"); 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(valueFormatter(value) ?? ""); pill.toggleCloseButtonClass("ag-icon-cancel", true); this.appendChild(pillGui); this.pills.push({ key: getKey(value) ?? i.toString(), pill }); } } onNavigationKeyDown(e) { const { key } = e; const isRtl = this.gos.get("enableRtl"); const isPrevious = !isRtl && key === KeyCode.LEFT || isRtl && key === KeyCode.RIGHT; const isNext = !isRtl && key === KeyCode.RIGHT || isRtl && key === KeyCode.LEFT; if (!this.pills.length || !isPrevious && !isNext) { return; } e.preventDefault(); const { beans, params } = this; const activeEl = _getActiveDomElement(beans); const eGui = this.getGui(); const focusableElements = _findFocusableElements(eGui); if (eGui.contains(activeEl)) { const activePill = focusableElements.find((el) => el.contains(activeEl)); if (activePill && activePill !== activeEl) { activePill.focus(); } const nextFocusableEl = _findNextFocusableElement(beans, eGui, false, isPrevious); if (nextFocusableEl) { nextFocusableEl.focus(); } else if (isNext) { params.focusAfterForwardBoundary?.(); } } else if (focusableElements.length > 0) { focusableElements[isNext ? 0 : focusableElements.length - 1].focus(); } } clearPills() { const eGui = this.getGui(); if (eGui.contains(_getActiveDomElement(this.beans)) && this.params.eWrapper) { this.params.eWrapper.focus(); } _clearElement(eGui); this.destroyBeans(this.pills.map(({ pill }) => pill)); this.pills = []; } onPillButtonClick(pill) { this.deletePill(pill); } onPillKeyDown(e) { const key = e.key; if (key === KeyCode.LEFT || key === KeyCode.RIGHT) { e.stopPropagation(); if (this.params.onHorizontalArrowKeyDown) { this.params.onHorizontalArrowKeyDown(e); } else { this.onNavigationKeyDown(e); } return; } if (key !== KeyCode.DELETE && key !== KeyCode.BACKSPACE) { return; } e.preventDefault(); const eDoc = _getDocument(this.beans); const pillIndex = this.pills.findIndex(({ pill }) => pill.getGui().contains(eDoc.activeElement)); if (pillIndex === -1) { return; } const pillObj = this.pills[pillIndex]; if (pillObj?.pill) { this.deletePill(pillObj.pill, pillIndex); } } deletePill(p, restoreFocusToIndex) { const { getKey, pills, params } = this; const pillKey = (pills[restoreFocusToIndex ?? -1] ?? pills.find(({ pill }) => pill === p))?.key; const values = (params.getValue() || []).filter((val) => getKey(val) !== pillKey); params.setValue(values); if (!values.length) { if (params.focusAfterDelete) { params.focusAfterDelete(); } else { params.eWrapper?.focus(); } } else if (restoreFocusToIndex != null) { const { pill } = pills[Math.min(restoreFocusToIndex, pills.length - 1)]; if (pill) { pill.getFocusableElement().focus(); } } } destroy() { this.clearPills(); super.destroy(); } }; // packages/ag-grid-enterprise/src/widgets/agRichSelect.css var agRichSelect_default = ".ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-virtual-list-viewport.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-rich-select-loading){display:flex;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);:where(.ag-loading-text){overflow:hidden;text-overflow:ellipsis}}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}.ag-rich-select-typing-multi{:where(.ag-picker-field-display){flex:0 1 auto;max-width:100%;min-width:0}:where(.ag-rich-select-pill-display){align-items:center;display:flex;flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;:where(.ag-pill-container){flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden}}:where(.ag-rich-select-field-input){flex:0 0 auto;max-width:100%;min-width:0;:where(.ag-input-wrapper){flex:0 0 auto;max-width:100%}:where(.ag-input-field-input){max-width:100%;min-width:1ch;width:auto}}}:where(.ag-ltr) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-left:.25rem}:where(.ag-rich-select-deselect-button){margin-left:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-left:auto}}:where(.ag-rtl) .ag-rich-select-typing-multi{:where(.ag-rich-select-field-input){margin-right:.25rem}:where(.ag-rich-select-deselect-button){margin-right:auto}:where(.ag-rich-select-deselect-button.ag-hidden+.ag-picker-field-icon){margin-right:auto}}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem;min-width:0}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}.ag-pill-button:hover{color:var(--ag-accent-color);cursor:pointer}"; // packages/ag-grid-enterprise/src/widgets/agRichSelectRow.ts var RichSelectRowElement = { tag: "div", cls: "ag-rich-select-row", role: "presentation" }; var RichSelectRow = class extends Component { constructor(params) { super(RichSelectRowElement); this.params = params; this.valueFormatter = resolveRichSelectValueFormatter(params.valueFormatter); } wireBeans(beans) { this.userCompFactory = beans.userCompFactory; this.registry = beans.registry; } postConstruct() { this.tooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean( "highlightTooltipFeature", false, { getGui: () => this.getGui(), shouldDisplayTooltip: () => this.shouldDisplayTooltip?.() ?? true }, this ) ); } setState(value) { const formattedValue = this.valueFormatter(value); const rendererSuccessful = this.populateWithRenderer(value, formattedValue); if (!rendererSuccessful) { this.populateWithoutRenderer(value, formattedValue); } this.value = value; } highlightString(matchString) { const { parsedValue, params } = this; if (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 child = this.getGui().querySelector("span"); if (child) { _clearElement(child); child.append( // Start part parsedValue.slice(0, index), // Highlighted part wrapped in bold tag _createElement({ tag: "span", cls: "ag-rich-select-row-text-highlight", children: parsedValue.slice(index, highlightEndIndex) }), // End part parsedValue.slice(highlightEndIndex) ); } } else { hasMatch = false; } } if (!hasMatch) { this.renderValueWithoutRenderer(parsedValue); } } updateSelected(selected) { const eGui = this.getGui(); _setAriaSelected(eGui.parentElement, selected); this.toggleCss("ag-rich-select-row-selected", selected); } getValue() { return this.value; } toggleHighlighted(highlighted) { this.toggleCss("ag-rich-select-row-highlighted", highlighted); this.dispatchLocalEvent({ type: "itemHighlighted", highlighted }); } populateWithoutRenderer(value, valueFormatted) { const eGui = this.getGui(); const span = _createElement({ tag: "span" }); span.style.overflow = "hidden"; span.style.textOverflow = "ellipsis"; const parsedValue = _toString(_exists(valueFormatted) ? valueFormatted : value); this.parsedValue = _exists(parsedValue) ? parsedValue : null; eGui.appendChild(span); this.renderValueWithoutRenderer(parsedValue); this.shouldDisplayTooltip = _isElementOverflowingCallback(() => span); this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue); } renderValueWithoutRenderer(value) { const span = this.getGui().querySelector("span"); if (!span) { return; } span.textContent = _exists(value) ? value : "\xA0"; } populateWithRenderer(value, valueFormatted) { let cellRendererPromise; let userCompDetails; const { cellRenderer, cellRendererParams } = this.params; if (cellRenderer) { const richSelect = this.getParentComponent()?.getParentComponent(); userCompDetails = _getEditorRendererDetails( this.userCompFactory, this.params, _addGridCommonParams(this.gos, { value, valueFormatted, cellRendererParams, getValue: () => richSelect?.getValue(), setValue: (value2) => { richSelect?.setValue(value2, true); }, setTooltip: (value2, shouldDisplayTooltip) => { this.gos.assertModuleRegistered("Tooltip", 3); this.shouldDisplayTooltip = shouldDisplayTooltip; this.tooltipFeature?.setTooltipAndRefresh(value2); } }) ); } 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; } }; // packages/ag-grid-enterprise/src/widgets/agRichSelectList.ts var LIST_COMPONENT_NAME = "ag-rich-select-list"; var ROW_COMPONENT_NAME = "ag-rich-select-row"; var STATE_LOADING = 0; var STATE_READY_WITH_RESULTS = 1; var STATE_NO_RESULTS = 2; var STATE_READY_FOR_INPUT = 3; var AgRichSelectList = class extends VirtualList { constructor(params, richSelectWrapper, getSearchString2) { super({ cssIdentifier: "rich-select" }); this.params = params; this.richSelectWrapper = richSelectWrapper; this.getSearchString = getSearchString2; this.lastRowHovered = -1; this.selectedItems = /* @__PURE__ */ new Set(); this.loadingState = STATE_READY_FOR_INPUT; this.loadMoreRowsThreshold = 10; this.valueFormatter = resolveRichSelectValueFormatter(params.valueFormatter); this.setComponentCreator(this.createRowComponent.bind(this)); this.setComponentUpdater(() => { }); } postConstruct() { super.postConstruct(); const translate = this.getLocaleTextFunc(); this.loadingLabel = translate("loadingOoo", "Loading..."); this.noMatchesLabel = translate("noMatches", "No matches to show"); this.eLoadingIcon = _createIconNoSpan("richSelectLoading", this.beans, null); this.eStateCompLabel = _createElement({ tag: "span", cls: "ag-loading-text", children: this.loadingLabel }); this.eStateComp = _createElement({ tag: "div", cls: "ag-rich-select-loading", children: [ { tag: "span", cls: "ag-loading-icon", children: [this.eLoadingIcon ? () => this.eLoadingIcon : void 0] }, { tag: "span", cls: "ag-loading-text", children: [() => this.eStateCompLabel] } ] }); this.appendChild(this.eStateComp); const { cellRowHeight, pickerAriaLabelKey, pickerAriaLabelValue } = this.params; if (cellRowHeight) { this.setRowHeight(cellRowHeight); } const eGui = this.getGui(); const eListAriaEl = this.getAriaElement(); this.addManagedListeners(eGui, { mousemove: this.onMouseMove.bind(this), mouseout: this.onMouseOut.bind(this), mousedown: this.onMouseDown.bind(this), click: this.onClick.bind(this), scroll: this.onGuiScroll.bind(this) }); eGui.classList.add(LIST_COMPONENT_NAME); const listId = `${LIST_COMPONENT_NAME}-${this.getCompId()}`; eListAriaEl.setAttribute("id", listId); const ariaLabel = translate(pickerAriaLabelKey, pickerAriaLabelValue); _setAriaLabel(eListAriaEl, ariaLabel); _setAriaControlsAndLabel(this.richSelectWrapper, eListAriaEl); } setIsLoading() { this.setLoadingState(STATE_LOADING); } setLoadingState(state) { const hasChanged = this.loadingState !== state; this.loadingState = state; this.toggleStateComp(); this.toggleVisibility(); if (hasChanged) { const stateAnnouncement = this.getStateAnnouncementText(state); if (stateAnnouncement) { this.stateAnnouncementCallback?.(stateAnnouncement); } } } toggleStateComp() { const { eStateComp, eStateCompLabel, eLoadingIcon, loadingState, loadingLabel, noMatchesLabel, params } = this; if (!eStateComp) { return; } if (loadingState === STATE_LOADING) { eStateCompLabel.textContent = loadingLabel; if (eLoadingIcon) { _setDisplayed(eLoadingIcon, true); } _setDisplayed(eStateComp, true); return; } if (loadingState === STATE_NO_RESULTS && params.allowNoResultsCopy) { eStateCompLabel.textContent = noMatchesLabel; if (eLoadingIcon) { _setDisplayed(eLoadingIcon, false); } _setDisplayed(eStateComp, true); return; } _setDisplayed(eStateComp, false); } shouldBeVisible() { if (this.loadingState === STATE_NO_RESULTS) { return !!this.params.allowNoResultsCopy; } return this.loadingState !== STATE_READY_FOR_INPUT; } toggleVisibility(forceVisible) { const eListGui = this.getGui(); if (forceVisible === void 0) { _setDisplayed(eListGui, this.shouldBeVisible()); } else { _setDisplayed(eListGui, forceVisible); } this.scheduleMaybeRequestMoreRows(); } setLoadMoreRowsCallback(callback, thresholdRows = 10) { this.loadMoreRowsCallback = callback; this.loadMoreRowsThreshold = Math.max(thresholdRows, 1); this.maybeRequestMoreRows(); } setStateAnnouncementCallback(callback) { this.stateAnnouncementCallback = callback; } navigateToPage(key) { const newIndex = super.navigateToPage(key, this.lastRowHovered); if (newIndex != null) { _requestAnimationFrame(this.beans, () => { if (!this.isAlive()) { return null; } this.highlightIndex(newIndex); }); } return newIndex; } drawVirtualRows(softRefresh) { super.drawVirtualRows(softRefresh); this.refreshSelectedItems(); if (this.lastRowHovered !== -1) { this.updateRenderedHighlightState(this.lastRowHovered); } } highlightFilterMatch(searchString) { this.forEachRenderedRow((cmp) => { cmp.highlightString(searchString); }); } onNavigationKeyDown(key, announceItem) { _requestAnimationFrame(this.beans, () => { if (!this.currentList || !this.isAlive()) { return; } const len = this.currentList.length; const oldIndex = this.lastRowHovered; const diff = key === KeyCode.DOWN ? 1 : -1; const newIndex = Math.min(Math.max(oldIndex === -1 ? 0 : oldIndex + diff, 0), len - 1); this.highlightIndex(newIndex); announceItem(); }); } selectValue(value) { if (!this.currentList || value == null) { return false; } const selectedPositions = this.getIndicesForValues(value); const refresh = selectedPositions.length > 0; if (refresh) { this.refresh(); this.ensureIndexVisible(selectedPositions[0]); this.refresh(true); } this.selectListItems(Array.isArray(value) ? value : [value]); if (refresh) { this.highlightIndex(selectedPositions[0], true); } return refresh; } selectListItems(values, append = false) { if (!append) { this.selectedItems.clear(); } for (let i = 0; i < values.length; i++) { const currentItem = values[i]; if (this.findItemInSelected(currentItem) !== void 0) { continue; } this.selectedItems.add(currentItem); } this.refreshSelectedItems(); } getCurrentList() { return this.currentList; } setCurrentList(list) { const newState = getListStateBasedOnResults(list); this.setLoadingState(newState); list || (list = []); this.currentList = list; this.setModel({ getRowCount: () => list.length, getRow: (index) => list[index], areRowsEqual: (oldRow, newRow) => oldRow === newRow }); } offsetHoveredIndexOnPrependedRows(prependedRowCount) { if (prependedRowCount <= 0 || this.lastRowHovered < 0) { return; } this.lastRowHovered += prependedRowCount; } restoreScrollOnPrependedRows(previousScrollTop, prependedRowCount) { if (prependedRowCount <= 0) { return; } const eGui = this.getGui(); const rowHeight = this.getRowHeight(); const nextScrollTop = previousScrollTop + prependedRowCount * rowHeight; this.awaitStable(() => { if (!this.isAlive()) { return; } eGui.scrollTop = nextScrollTop; }); } getSelectedItems() { return this.selectedItems; } getLastItemHovered() { return this.currentList?.[this.lastRowHovered]; } highlightIndex(index, preventUnnecessaryScroll) { if (!this.currentList) { return; } if (index < 0 || index >= this.currentList.length) { this.lastRowHovered = -1; this.setActiveOption(); } else { this.lastRowHovered = index; const wasScrolled = this.ensureIndexVisible(index, !preventUnnecessaryScroll); if (wasScrolled && !preventUnnecessaryScroll) { this.refresh(true); } } this.updateRenderedHighlightState(index); } updateRenderedHighlightState(index) { let activeOptionId; this.forEachRenderedRow((cmp, idx) => { const highlighted = index === idx; cmp.toggleHighlighted(highlighted); if (highlighted) { activeOptionId = `${ROW_COMPONENT_NAME}-${cmp.getCompId()}`; } }); this.setActiveOption(activeOptionId); } setActiveOption(activeOptionId) { _setAriaActiveDescendant(this.richSelectWrapper, activeOptionId ?? null); _addOrRemoveAttribute(this.richSelectWrapper, "data-active-option", activeOptionId); } getIndicesForValues(values) { const { currentList } = this; if (!currentList || currentList.length === 0 || values === void 0) { return []; } const valuesToFind = Array.isArray(values) ? values : [values]; if (valuesToFind.length === 0) { return []; } const positions = []; let formattedList; for (const value of valuesToFind) { let idx = currentList.indexOf(value); if (idx === -1 && value != null) { formattedList ?? (formattedList = currentList.map((item) => this.valueFormatter(item))); const formattedValue = this.getComparableFormattedValue(value); idx = formattedList.indexOf(formattedValue); } if (idx >= 0) { positions.push(idx); } } return positions; } toggleListItemSelection(value) { const item = this.findItemInSelected(value); if (item !== void 0) { this.selectedItems.delete(item); } else { this.selectedItems.add(value); } this.refreshSelectedItems(); this.dispatchValueSelected(); } refreshSelectedItems() { this.forEachRenderedRow((cmp) => { const selected = this.findItemInSelected(cmp.getValue()) !== void 0; cmp.updateSelected(selected); }); } findItemInSelected(value) { if (typeof value === "object") { if (this.selectedItems.has(value)) { return value; } const valueFormatted = this.valueFormatter(value); for (const item of this.selectedItems) { if (this.valueFormatter(item) === valueFormatted) { return item; } } } else { return this.selectedItems.has(value) ? value : void 0; } } getComparableFormattedValue(value) { return value != null && typeof value === "object" ? this.valueFormatter(value) : String(value ?? ""); } createRowComponent(value, listItemElement) { const row = new RichSelectRow(this.params); listItemElement.setAttribute("id", `${ROW_COMPONENT_NAME}-${row.getCompId()}`); row.setParentComponent(this); this.createBean(row); row.setState(value); const { highlightMatch, searchType = "fuzzy" } = this.params; if (highlightMatch && searchType !== "fuzzy") { row.highlightString(this.getSearchString()); } return row; } getRowForMouseEvent(e) { if (!this.model) { return -1; } const eGui = this.getGui(); const rect = eGui.getBoundingClientRect(); const scrollTop = this.getScrollTop(); const mouseY = e.clientY - rect.top + scrollTop; return Math.min(Math.max(Math.floor(mouseY / this.getRowHeight()), 0), this.model.getRowCount() - 1); } onMouseMove(e) { const row = this.getRowForMouseEvent(e); if (row !== -1 && row != this.lastRowHovered) { this.lastRowHovered = row; this.highlightIndex(row, true); } } onGuiScroll() { this.maybeRequestMoreRows(true); } scheduleMaybeRequestMoreRows() { if (this.beans) { _requestAnimationFrame(this.beans, () => this.maybeRequestMoreRows(false)); return; } this.maybeRequestMoreRows(false); } maybeRequestMoreRows(fromScrollEvent = false) { const callback = this.loadMoreRowsCallback; const currentList = this.currentList; if (!callback || !currentList || this.loadingState === STATE_LOADING) { return; } const eGui = this.getGui(); if (eGui.clientHeight <= 0) { return; } const remainingPixels = eGui.scrollHeight - (eGui.scrollTop + eGui.clientHeight); const remainingRows = remainingPixels / this.getRowHeight(); const rowsFromTop = eGui.scrollTop / this.getRowHeight(); const hasVerticalOverflow = eGui.scrollHeight > eGui.clientHeight; if (rowsFromTop <= this.loadMoreRowsThreshold && (fromScrollEvent || !hasVerticalOverflow)) { callback("up"); } if (remainingRows <= this.loadMoreRowsThreshold) { callback("down"); } } getStateAnnouncementText(state) { if (state === STATE_LOADING) { return this.loadingLabel; } if (state === STATE_NO_RESULTS && this.params.allowNoResultsCopy) { return this.noMatchesLabel; } return void 0; } onMouseDown(e) { e.preventDefault(); } onMouseOut(e) { if (!this.getGui().contains(e.relatedTarget)) { this.highlightIndex(-1); } } onClick(e) { const { multiSelect } = this.params; if (!this.currentList?.length) { return; } const row = this.getRowForMouseEvent(e); const item = this.currentList[row]; if (multiSelect) { this.toggleListItemSelection(item); } else { this.selectListItems([item]); this.dispatchValueSelected(); } } dispatchValueSelected() { this.dispatchLocalEvent({ type: "richSelectListRowSelected", fromEnterKey: false, value: this.selectedItems }); } destroy() { super.destroy(); this.eStateComp = void 0; } }; function getListStateBasedOnResults(valueList) { if (!valueList) { return STATE_READY_FOR_INPUT; } if (valueList.length) { return STATE_READY_WITH_RESULTS; } return STATE_NO_RESULTS; } // packages/ag-grid-enterprise/src/widgets/agRichSelect.ts var ON_SEARCH_CALLBACK_DEBOUNCE_DELAY = 300; var AgRichSelectElement = { tag: "div", cls: "ag-picker-field", role: "presentation", children: [ { tag: "div", ref: "eLabel" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed", children: [ { tag: "span", ref: "eDisplayField", cls: "ag-picker-field-display" }, { tag: "ag-input-text-field", ref: "eInput", cls: "ag-rich-select-field-input" }, { tag: "span", ref: "eDeselect", cls: "ag-rich-select-deselect-button ag-picker-field-icon", role: "presentation" }, { tag: "span", ref: "eIcon", cls: "ag-picker-field-icon", attrs: { "aria-hidden": "true" } } ] } ] }; var AgRichSelect = class extends AgPickerField { constructor(config) { const valueFormatter = resolveRichSelectValueFormatter(config?.valueFormatter); const resolvedAgComponents = config?.agComponents?.includes(AgInputTextFieldSelector) ? config.agComponents : [AgInputTextFieldSelector, ...config?.agComponents ?? []]; super({ ...config, // prevents undefined values from being passed to the picker which can cause // issues with the list component's value selection and highlighting logic pickerAriaLabelKey: config?.pickerAriaLabelKey ?? "ariaLabelRichSelectField", pickerAriaLabelValue: config?.pickerAriaLabelValue ?? "Rich Select Field", pickerType: config?.pickerType ?? "ag-list", className: config?.className ?? "ag-rich-select", pickerIcon: config?.pickerIcon ?? "richSelectOpen", ariaRole: config?.ariaRole ?? "combobox", template: config?.template ?? AgRichSelectElement, agComponents: resolvedAgComponents, modalPicker: config?.modalPicker ?? false, valueFormatter, maxPickerHeight: config?.maxPickerHeight ?? "calc(var(--ag-row-height) * 6.5)" }); this.searchString = ""; this.loadMoreRowsThreshold = 10; this.hasPagedAsyncSource = false; this.searchStringCreator = null; this.eInput = RefPlaceholder; this.eDeselect = RefPlaceholder; this.skipWrapperAnnouncement = false; this.onPillHorizontalArrowKeyDown = (e) => { this.handleHorizontalNavigationKey(e); }; this.valueFormatter = valueFormatter; const { value, valueList, searchStringCreator, onSearch } = config ?? {}; if (value !== void 0) { this.value = value; } if (searchStringCreator) { this.searchStringCreator = searchStringCreator; } if (valueList != null) { this.setValueList({ valueList, isInitial: true }); } const { searchDebounceDelay = ON_SEARCH_CALLBACK_DEBOUNCE_DELAY } = this.config; if (onSearch) { this.onSearchCallbackDebounced = _debounce(this, onSearch, searchDebounceDelay); } this.registerCSS(agRichSelect_default); } wireBeans(beans) { this.userCompFactory = beans.userCompFactory; this.ariaAnnounce = beans.ariaAnnounce; this.registry = beans.registry; } postConstruct() { this.tooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.getGui(), shouldDisplayTooltip: () => this.shouldDisplayTooltip?.() ?? true }) ); super.postConstruct(); this.createListComponent(); this.eDeselect.appendChild(_createIconNoSpan("richSelectRemove", this.beans)); const { allowTyping, placeholder, multiSelect, suppressDeselectAll, suppressMultiSelectPillRenderer } = this.config; this.eDeselect.classList.add("ag-hidden"); if (allowTyping) { this.eInput.setAutoComplete(false).setInputPlaceholder(placeholder); if (!multiSelect) { this.eDisplayField.classList.add("ag-hidden"); } else { this.eWrapper.classList.add("ag-rich-select-typing-multi"); if (!suppressMultiSelectPillRenderer) { this.eDisplayField.classList.add("ag-rich-select-pill-display"); } } } else { this.eInput.setDisplayed(false); } this.setupAriaProperties(); const { searchDebounceDelay = 300 } = this.config; this.clearSearchString = _debounce(this, this.clearSearchString.bind(this), searchDebounceDelay); this.renderSelectedValue(); if (allowTyping) { this.eInput.onValueChange((value) => { this.openPickerOnTypingIfNeeded(value); this.updateTypingMultiSelectPlaceholder(value); this.searchTextFromString(value); }); } this.addManagedElementListeners(this.eWrapper, { focus: this.onWrapperFocus.bind(this) }); this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) }); if (!suppressDeselectAll) { this.addManagedElementListeners(this.eDeselect, { mousedown: this.onDeselectAllMouseDown.bind(this), click: this.onDeselectAllClick.bind(this) }); } } setupAriaProperties() { const { eWrapper, gos } = this; eWrapper.tabIndex = gos.get("tabIndex"); const translate = this.getLocaleTextFunc(); this.ariaDeleteSelection = translate("ariaLabelRichSelectDeleteSelection", "Press DELETE to deselect item"); this.ariaDeselectAllItems = translate( "ariaLabelRichSelectDeselectAllItems", "Press DELETE to deselect all items" ); this.ariaToggleSelection = translate("ariaLabelRichSelectToggleSelection", "Press SPACE to toggle selection"); } createListComponent() { this.listComponent = this.createBean( new AgRichSelectList(this.config, this.getFocusableElement(), () => this.searchString) ); this.listComponent.setLoadMoreRowsCallback(this.loadMoreRowsCallback, this.loadMoreRowsThreshold); this.listComponent.setStateAnnouncementCallback((value) => this.announceAriaValue(value)); this.listComponent.setParentComponent(this); this.addManagedListeners(this.listComponent, { richSelectListRowSelected: (e) => { this.onListValueSelected(e.value, e.fromEnterKey); } }); } renderSelectedValue(fromPicker) { const { value, eDisplayField, config, gos } = this; const { allowTyping, cellRenderer, cellRendererParams, initialInputValue, multiSelect, suppressDeselectAll, suppressMultiSelectPillRenderer, onSearch } = config; const valueFormatted = this.valueFormatter(value); const isTypingMultiSelect = !!(allowTyping && multiSelect); if (allowTyping) { const inputValue = isTypingMultiSelect ? initialInputValue ?? this.eInput.getValue() ?? "" : initialInputValue ?? (value === "" ? "" : valueFormatted); this.eInput.setValue(inputValue, !!fromPicker && !!onSearch); if (!isTypingMultiSelect) { return; } this.updateTypingMultiSelectPlaceholder(inputValue); } if (multiSelect && !suppressDeselectAll) { const isEmpty = value == null || Array.isArray(value) && value.length === 0; this.eDeselect.classList.toggle("ag-hidden", isEmpty); } let userCompDetails; if (multiSelect && !suppressMultiSelectPillRenderer) { this.createOrUpdatePillContainer(eDisplayField); return; } if (cellRenderer && !allowTyping) { userCompDetails = _getEditorRendererDetails( this.userCompFactory, config, _addGridCommonParams(this.gos, { value, valueFormatted, cellRendererParams, getValue: () => this.getValue(), setValue: (value2) => { this.setValue(value2, true); }, setTooltip: (value2, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); this.shouldDisplayTooltip = shouldDisplayTooltip; this.tooltipFeature?.setTooltipAndRefresh(value2); } }) ); } let userCompDetailsPromise; if (userCompDetails) { userCompDetailsPromise = userCompDetails.newAgStackInstance(); } if (userCompDetailsPromise) { _clearElement(eDisplayField); _bindCellRendererToHtmlElement(userCompDetailsPromise, eDisplayField); userCompDetailsPromise.then((renderer) => { this.addDestroyFunc(() => this.destroyBean(renderer)); }); } else { if (value != null) { eDisplayField.innerText = valueFormatted; eDisplayField.classList.remove("ag-display-as-placeholder"); } else { const { placeholder } = config; if (_exists(placeholder)) { eDisplayField.textContent = placeholder; eDisplayField.classList.add("ag-display-as-placeholder"); } else { _clearElement(eDisplayField); } } this.shouldDisplayTooltip = _isElementOverflowingCallback(() => this.eDisplayField); this.tooltipFeature?.setTooltipAndRefresh(valueFormatted ?? null); } } createPickerComponent() { const { values } = this; if (values) { this.setValueList({ valueList: values }); } return this.listComponent; } setSearchStringCreator(searchStringFn) { this.searchStringCreator = searchStringFn; } setAsyncValuesSource(params) { const { source, thresholdRows, useAsyncSearch, onMisconfiguredSearchSource, onFirstValuesPageLoaded } = params; this.asyncRequests?.destroy(); const asyncRequestBindings = createRichSelectAsyncRequestBindings({ host: { setValueList: (valueListParams) => this.setValueList(valueListParams), setIsLoading: () => this.setIsLoading() }, source, useAsyncSearch, onMisconfiguredSearchSource, onFirstValuesPageLoaded }); this.asyncRequests = asyncRequestBindings.controller; this.hasPagedAsyncSource = asyncRequestBindings.hasPagedSource; if (asyncRequestBindings.onSearch) { const { searchDebounceDelay = ON_SEARCH_CALLBACK_DEBOUNCE_DELAY } = this.config; this.onSearchCallbackDebounced = _debounce(this, asyncRequestBindings.onSearch, searchDebounceDelay); } else if (!this.config.onSearch) { this.onSearchCallbackDebounced = void 0; } this.setLoadMoreRowsCallback(asyncRequestBindings.onLoadMoreRows, thresholdRows ?? this.loadMoreRowsThreshold); } resetAsyncValues(searchString = "") { if (!this.hasPagedAsyncSource) { return; } this.asyncRequests?.resetValuesPage(searchString); } setLoadMoreRowsCallback(callback, thresholdRows = 10) { this.loadMoreRowsCallback = callback; this.loadMoreRowsThreshold = Math.max(thresholdRows, 1); this.listComponent?.setLoadMoreRowsCallback(this.loadMoreRowsCallback, this.loadMoreRowsThreshold); } setIsLoading() { this.listComponent?.setIsLoading(); } setValueListInternal(params) { const { listComponent, isPickerDisplayed, value } = this; const { valueList, refresh, isInitial, scrollToCurrentValue = true, prependedRowCount = 0 } = params; if (isInitial) { this.setValues(valueList); } if (!listComponent) { return; } const previousScrollTop = prependedRowCount > 0 ? listComponent.getScrollTop() : void 0; if (prependedRowCount > 0) { listComponent.offsetHoveredIndexOnPrependedRows(prependedRowCount); } listComponent.setCurrentList(valueList); if (!refresh) { return; } if (isPickerDisplayed && previousScrollTop != null && prependedRowCount > 0) { listComponent.restoreScrollOnPrependedRows?.(previousScrollTop, prependedRowCount); } if (this.values) { listComponent.refresh(true); const hasCurrentValueInLoadedList = value != null && listComponent.getIndicesForValues(value).length > 0; if (isPickerDisplayed && hasCurrentValueInLoadedList && scrollToCurrentValue) { listComponent.selectValue(value); } } else if (isPickerDisplayed) { const hasRefreshed = listComponent.selectValue(value); if (!hasRefreshed) { listComponent.refresh(); } } this.alignPickerToComponent(); } setValueList(params) { const { valueList } = params; if (!valueList || Array.isArray(valueList)) { this.setValueListInternal(params); return; } this.listComponent?.setIsLoading(); valueList.then((values) => { if (values !== void 0) { this.setValueListInternal({ ...params, valueList: values }); } }).catch(() => { this.setValueListInternal({ ...params, valueList: [], refresh: true }); }); } /** * This method updates the list of select options */ setValues(values) { this.values = values; this.searchStrings = this.getSearchStringsFromValues(values || []); } showPicker() { const { listComponent, value } = this; if (!listComponent) { return; } super.showPicker(); const valueToUse = value ?? null; listComponent.selectValue(valueToUse); const idx = listComponent.getIndicesForValues(valueToUse)[0]; if (idx != null) { this.tooltipFeature?.attemptToHideTooltip(); listComponent.highlightIndex(idx); } else { listComponent.refresh(); } } createOrUpdatePillContainer(container) { if (!this.pillContainer) { const pillContainer = this.pillContainer = this.createBean(new AgPillContainer()); this.addDestroyFunc(() => { this.destroyBean(this.pillContainer); this.pillContainer = null; }); _clearElement(container); container.appendChild(pillContainer.getGui()); const { config, eWrapper, ariaDeleteSelection } = this; pillContainer.init({ eWrapper, valueFormatter: this.valueFormatter, onPillMouseDown: (e) => { e.stopImmediatePropagation(); }, announceItemFocus: () => { this.announceAriaValue(ariaDeleteSelection); }, focusAfterDelete: config.allowTyping ? () => this.focusTypingInputAtBoundary() : void 0, focusAfterForwardBoundary: config.allowTyping ? () => this.focusTypingInputAtBoundary() : void 0, onHorizontalArrowKeyDown: this.onPillHorizontalArrowKeyDown, getValue: () => this.getValue(), setValue: (value) => this.setValue(value, true) }); } const previousPillCount = this.pillContainer.getGui().childElementCount; this.doWhileBlockingAnnouncement(() => this.pillContainer?.refresh()); this.scrollTypingMultiSelectPillsToEndOnAdd(previousPillCount); } scrollTypingMultiSelectPillsToEndOnAdd(previousPillCount) { const { allowTyping, multiSelect, suppressMultiSelectPillRenderer } = this.config; if (!allowTyping || !multiSelect || suppressMultiSelectPillRenderer) { return; } const ePillContainer = this.pillContainer?.getGui(); if (!ePillContainer || ePillContainer.childElementCount <= previousPillCount) { return; } _setScrollLeft(ePillContainer, ePillContainer.scrollWidth, this.isRtl()); } doWhileBlockingAnnouncement(func) { this.skipWrapperAnnouncement = true; func(); this.skipWrapperAnnouncement = false; } isPreviousHorizontalNavigation(key) { return key === KeyCode.LEFT !== this.isRtl(); } isRtl() { return !!this.gos?.get("enableRtl"); } isTypingInputAtPillBoundary() { const inputEl = this.eInput.getInputElement(); const { selectionStart, selectionEnd, value } = inputEl; if (selectionStart == null || selectionEnd == null || selectionStart !== selectionEnd) { return false; } const isRtl = this.isRtl(); return isRtl ? selectionStart === (value ?? "").length : selectionStart === 0; } focusTypingInputAtBoundary() { const inputEl = this.eInput.getInputElement(); inputEl.focus(); const caret = this.isRtl() ? inputEl.value.length : 0; inputEl.setSelectionRange(caret, caret); } getActiveElementForKeyboardNavigation() { if (this.beans?.eRootDiv) { return _getActiveDomElement(this.beans); } const inputEl = this.getTypingInputElement(); if (!inputEl) { return document.activeElement; } return inputEl.ownerDocument?.activeElement ?? document.activeElement; } onWrapperFocus() { const { eInput, config } = this; const { allowTyping, multiSelect, suppressDeselectAll } = config; if (allowTyping) { const focusableEl = eInput.getFocusableElement(); focusableEl.focus(); focusableEl.select(); } else if (multiSelect && !suppressDeselectAll && !this.skipWrapperAnnouncement) { this.announceAriaValue(this.ariaDeselectAllItems); } } onWrapperFocusOut(e) { if (!this.eWrapper.contains(e.relatedTarget)) { this.hidePicker(); } } onDeselectAllMouseDown(e) { e.stopImmediatePropagation(); } onDeselectAllClick() { this.setValue([], true); } buildSearchStringFromKeyboardEvent(searchKey) { let { key } = searchKey; if (key === KeyCode.BACKSPACE) { this.searchString = this.searchString.slice(0, -1); key = ""; } else if (!_isEventFromPrintableCharacter(searchKey)) { return; } searchKey.preventDefault(); this.searchTextFromCharacter(key); } searchTextFromCharacter(char) { this.searchString += char; this.runSearch(); this.clearSearchString(); } searchTextFromString(str) { if (str == null) { str = ""; } this.searchString = str; if (this.onSearchCallbackDebounced) { this.setValueList({ valueList: void 0, refresh: true }); } this.runSearch(); } getSearchStringsFromValues(values) { if (typeof values[0] === "object" && this.searchStringCreator) { return this.searchStringCreator(values); } return values.map((value) => value === "" ? "" : this.valueFormatter(value)); } filterListModel(filteredValues) { const { filterList } = this.config; if (!filterList) { return; } this.setValueList({ valueList: filteredValues, refresh: true }); } runSearch() { if (!this.listComponent) { return; } if (this.onSearchCallbackDebounced) { this.onSearchCallbackDebounced(this.searchString); return; } const searchStrings = this.searchStrings; if (!searchStrings) { this.listComponent.highlightIndex(-1); return; } const { suggestions, filteredValues } = this.getSuggestionsAndFilteredValues(this.searchString, searchStrings); const { filterList, highlightMatch, searchType = "fuzzy" } = this.config; const shouldFilter = !!(filterList && this.searchString !== ""); this.filterListModel(shouldFilter ? filteredValues : this.values || []); if (!this.highlightEmptyValue()) { this.highlightListValue(suggestions, filteredValues, shouldFilter); } if (highlightMatch && searchType !== "fuzzy") { this.listComponent?.highlightFilterMatch(this.searchString); } this.listComponent?.toggleVisibility(); } highlightEmptyValue() { if (this.searchString === "") { const emptyIdx = this.searchStrings?.indexOf(""); if (emptyIdx !== void 0 && emptyIdx !== -1) { this.listComponent?.highlightIndex(emptyIdx); return true; } } return false; } highlightListValue(suggestions, filteredValues, shouldFilter) { if (suggestions.length) { const topSuggestionIndex = shouldFilter ? 0 : this.searchStrings?.indexOf(suggestions[0]); if (topSuggestionIndex !== void 0) { this.listComponent?.highlightIndex(topSuggestionIndex); } } else { this.listComponent?.highlightIndex(-1); if (!shouldFilter || filteredValues.length) { this.listComponent?.ensureIndexVisible(0); } else if (shouldFilter) { const eAriaEl = this.getFocusableElement(); _addOrRemoveAttribute(eAriaEl, "data-active-option", null); _setAriaActiveDescendant(eAriaEl, null); } } } getSuggestionsAndFilteredValues(searchValue, valueList) { let suggestions = []; const filteredValues = []; if (!searchValue.length) { return { suggestions, filteredValues }; } const { searchType = "fuzzy", filterList } = this.config; const values = this.values || []; if (searchType === "fuzzy") { const fuzzySearchResult = _fuzzySuggestions({ inputValue: searchValue, allSuggestions: valueList, hideIrrelevant: true }); suggestions = fuzzySearchResult.values; const indices = fuzzySearchResult.indices; if (filterList && indices.length) { for (let i = 0; i < indices.length; i++) { filteredValues.push(values[indices[i]]); } } } else { suggestions = valueList.filter((val, idx) => { const currentValue = val.toLocaleLowerCase(); const valueToMatch = this.searchString.toLocaleLowerCase(); const isMatch = searchType === "match" ? currentValue.startsWith(valueToMatch) : currentValue.includes(valueToMatch); if (filterList && isMatch) { filteredValues.push(values[idx]); } return isMatch; }); } return { suggestions, filteredValues }; } clearSearchString() { this.searchString = ""; } setValue(value, silent, fromPicker, skipRendering) { if (this.value === value) { this.updateTypingMultiSelectPlaceholder(); return this; } const isArray = Array.isArray(value); if (value != null) { if (!isArray) { const indices = this.listComponent?.getIndicesForValues(value); if (!indices?.length) { return this; } } if (!fromPicker) { this.listComponent?.selectValue(value); } } super.setValue(value, silent); if (!skipRendering) { this.renderSelectedValue(fromPicker); } else { this.updateTypingMultiSelectPlaceholder(); } return this; } onNavigationKeyDown(event, key, announceItem) { event.preventDefault(); const isDown = key === KeyCode.DOWN; if (!this.isPickerDisplayed && isDown) { this.showPicker(); return; } this.listComponent?.onNavigationKeyDown(key, announceItem); } onEnterKeyDown(e) { const isTypingMultiSelect = !!(this.config.allowTyping && this.config.multiSelect); if (!this.isPickerDisplayed) { if (isTypingMultiSelect) { e.preventDefault(); this.dispatchPickerEventAndHidePicker(this.value, true); } return; } e.preventDefault(); if (this.listComponent?.getCurrentList()) { const lastRowHovered = this.listComponent.getLastItemHovered(); if (isTypingMultiSelect) { if (lastRowHovered !== void 0) { const values = this.getCurrentSelectionWithAppendedItem(lastRowHovered); this.listComponent.selectValue(values); this.setValue(values, false, true); this.resetTypingMultiSelectSearchState(); this.hidePicker(); } return; } if (this.config.multiSelect || lastRowHovered === void 0) { this.dispatchPickerEventAndHidePicker(this.value, true); } else { this.onListValueSelected(/* @__PURE__ */ new Set([lastRowHovered]), true); } } } getCurrentSelectionWithAppendedItem(item) { const value = this.getValue(); const values = Array.isArray(value) ? [...value] : value != null ? [value] : []; if (!values.some((selectedValue) => this.areValuesEquivalent(selectedValue, item))) { values.push(item); } return values; } areValuesEquivalent(left, right) { if (left === right) { return true; } if (typeof left === "object" && typeof right === "object" && left != null && right != null) { return this.valueFormatter(left) === this.valueFormatter(right); } return false; } resetTypingMultiSelectSearchState() { this.searchString = ""; this.eInput.setValue("", true); if (this.onSearchCallbackDebounced) { this.setValueList({ valueList: void 0, refresh: true }); return; } if (this.config.filterList && this.values) { this.setValueList({ valueList: this.values, refresh: true }); } } updateTypingMultiSelectPlaceholder(inputValue) { const { allowTyping, multiSelect, placeholder } = this.config; if (!allowTyping || !multiSelect) { return; } const currentInputValue = inputValue ?? this.eInput.getValue() ?? ""; const hasInputValue = currentInputValue.length > 0; const value = this.value; const hasSelectedValues = (Array.isArray(value) ? value.length > 0 : value != null) || (this.listComponent?.getSelectedItems().size ?? 0) > 0; const nextPlaceholder = !hasInputValue && !hasSelectedValues ? placeholder : ""; this.eInput.setInputPlaceholder(nextPlaceholder); this.updateTypingMultiSelectInputSize(currentInputValue, nextPlaceholder); } updateTypingMultiSelectInputSize(inputValue, placeholder) { const inputEl = this.getTypingInputElement(); if (!inputEl) { return; } const widthSource = inputValue || placeholder || ""; const nextSize = Math.max(1, Math.min(widthSource.length + 1, 32)); if (inputEl.size !== nextSize) { inputEl.size = nextSize; } if (inputValue) { const ePillContainer = this.pillContainer?.getGui(); if (ePillContainer) { _setScrollLeft(ePillContainer, ePillContainer.scrollWidth, this.isRtl()); } } } getTypingInputElement() { const getInputElement = this.eInput.getInputElement; if (typeof getInputElement !== "function") { return; } return getInputElement.call(this.eInput); } openPickerOnTypingIfNeeded(value) { const { isPickerDisplayed, config: { allowTyping, multiSelect } } = this; if (allowTyping && multiSelect && !isPickerDisplayed && !!value) { this.showPicker(); } } onDeleteKeyDown(e) { const { eWrapper, beans } = this; const activeEl = _getActiveDomElement(beans); if (activeEl === eWrapper) { e.preventDefault(); this.setValue([], true); } } onBackspaceKeyDown(e) { if (!this.isTypingInputAtPillBoundary()) { return; } const value = this.getValue(); const selectedValues = Array.isArray(value) ? value : value != null ? [value] : Array.from(this.listComponent?.getSelectedItems() ?? []); if (!selectedValues.length) { return; } e.preventDefault(); this.setValue(selectedValues.slice(0, -1), true); } onTabKeyDown() { const { config, isPickerDisplayed, listComponent } = this; const { multiSelect } = config; if (!isPickerDisplayed || !listComponent) { return; } if (multiSelect) { const values = this.getValueFromSet(listComponent.getSelectedItems()); if (values) { this.setValue(values, false, true, true); } } else { const lastItemHovered = listComponent.getLastItemHovered(); if (lastItemHovered !== void 0) { this.setValue(lastItemHovered, false, true); } } this.hidePicker(); } getValueFromSet(valueSet) { const { multiSelect } = this.config; if (!multiSelect) { return valueSet.size ? valueSet.values().next().value : null; } const selectedValues = Array.from(valueSet); return selectedValues.length ? selectedValues : null; } onListValueSelected(valueSet, fromEnterKey) { const newValue = this.getValueFromSet(valueSet); this.setValue(newValue, false, true); const { multiSelect, allowTyping } = this.config; if (multiSelect && allowTyping) { this.resetTypingMultiSelectSearchState(); this.hidePicker(); } else if (!multiSelect) { this.dispatchPickerEventAndHidePicker(newValue, fromEnterKey); } } dispatchPickerEventAndHidePicker(value, fromEnterKey) { const event = { type: "fieldPickerValueSelected", fromEnterKey, value }; this.dispatchLocalEvent(event); this.hidePicker(); } getFocusableElement() { const { allowTyping } = this.config; if (allowTyping) { return this.eInput.getFocusableElement(); } return super.getFocusableElement(); } handleHorizontalNavigationKey(e) { const { allowTyping, multiSelect } = this.config; if (!allowTyping) { e.preventDefault(); this.listComponent?.highlightIndex(-1); this.pillContainer?.onNavigationKeyDown(e); return; } const pillContainer = this.pillContainer; if (!pillContainer) { return; } if (!multiSelect) { return; } const activeEl = this.getActiveElementForKeyboardNavigation(); const isPrevious = this.isPreviousHorizontalNavigation(e.key); const inputEl = this.eInput.getInputElement(); if (activeEl === inputEl) { if (isPrevious && this.isTypingInputAtPillBoundary()) { this.listComponent?.highlightIndex(-1); pillContainer.onNavigationKeyDown(e); } return; } if (pillContainer.getGui().contains(activeEl)) { this.listComponent?.highlightIndex(-1); const activeBefore = activeEl; pillContainer.onNavigationKeyDown(e); if (!isPrevious && this.getActiveElementForKeyboardNavigation() === activeBefore) { this.focusTypingInputAtBoundary(); } } } handlePageNavigationKey(e, key) { const { allowTyping } = this.config; if (allowTyping && (key === KeyCode.PAGE_HOME || key === KeyCode.PAGE_END)) { e.preventDefault(); const inputEl = this.eInput.getInputElement(); const target = key === KeyCode.PAGE_HOME ? 0 : inputEl.value.length; inputEl.setSelectionRange(target, target); return; } e.preventDefault(); if (this.pickerComponent) { this.listComponent?.navigateToPage(key); } } handleVerticalNavigationKey(e, key, isComposing) { if (isComposing) { return; } this.onNavigationKeyDown(e, key, () => { if (this.config.multiSelect) { this.doWhileBlockingAnnouncement(() => this.eWrapper.focus()); this.announceAriaValue(this.ariaToggleSelection); } }); } handleEscapeKey(e) { if (!this.isPickerDisplayed) { return; } if (_isVisible(this.listComponent.getGui())) { e.preventDefault(); _stopPropagationForAgGrid(e); } this.hidePicker(); } handleEnterKey(e, isComposing) { if (isComposing) { e.preventDefault(); return; } this.onEnterKeyDown(e); } handleSpaceKey(e, isComposing) { const { allowTyping, multiSelect } = this.config; const { isPickerDisplayed, listComponent } = this; const shouldToggleSelectionWithSpace = !isComposing && isPickerDisplayed && multiSelect && !!listComponent && (!allowTyping || (this.eInput.getValue() ?? "") === ""); if (!allowTyping || isComposing || shouldToggleSelectionWithSpace) { e.preventDefault(); } if (shouldToggleSelectionWithSpace && listComponent) { const lastItemHovered = listComponent.getLastItemHovered(); if (lastItemHovered !== void 0) { listComponent.toggleListItemSelection(lastItemHovered); } } } handleBackspaceKey(e, isComposing) { if (!isComposing && this.config.allowTyping && this.config.multiSelect) { this.onBackspaceKeyDown(e); } } handleDeleteKey(e) { if (this.config.multiSelect && !this.config.suppressDeselectAll) { this.onDeleteKeyDown(e); } } handleSearchWithoutTyping(e) { if (!this.config.allowTyping) { this.buildSearchStringFromKeyboardEvent(e); } } onKeyDown(e) { const { key, isComposing } = e; switch (key) { case KeyCode.LEFT: case KeyCode.RIGHT: this.handleHorizontalNavigationKey(e); break; case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: case KeyCode.PAGE_UP: case KeyCode.PAGE_DOWN: this.handlePageNavigationKey(e, key); break; case KeyCode.DOWN: case KeyCode.UP: this.handleVerticalNavigationKey(e, key, isComposing); break; case KeyCode.ESCAPE: this.handleEscapeKey(e); break; case KeyCode.ENTER: this.handleEnterKey(e, isComposing); break; case KeyCode.SPACE: this.handleSpaceKey(e, isComposing); break; case KeyCode.BACKSPACE: this.handleBackspaceKey(e, isComposing); break; case KeyCode.TAB: this.onTabKeyDown(); break; case KeyCode.DELETE: this.handleDeleteKey(e); break; default: this.handleSearchWithoutTyping(e); } } announceAriaValue(value) { this.ariaAnnounce?.announceValue(value, "richSelect"); } destroy() { this.asyncRequests?.destroy(); this.asyncRequests = void 0; this.hasPagedAsyncSource = false; if (this.listComponent) { this.listComponent = this.destroyBean(this.listComponent); } this.searchStrings = void 0; super.destroy(); } }; function _bindCellRendererToHtmlElement(cellRendererPromise, eTarget) { cellRendererPromise.then((cellRenderer) => { const gui = cellRenderer.getGui(); if (gui != null) { eTarget.appendChild(gui); } }); } function resolveRichSelectValueFormatter(valueFormatter) { return (value) => valueFormatter?.(value) ?? String(value ?? ""); } // packages/ag-grid-enterprise/src/advancedFilter/builder/addDropdownComp.ts var AddDropdownCompElement = { tag: "div", cls: "ag-picker-field", role: "presentation", children: [ { tag: "div", ref: "eLabel" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-picker-collapsed", children: [ { tag: "div", ref: "eDisplayField", cls: "ag-picker-field-display" }, { tag: "ag-input-text-field", ref: "eInput", cls: "ag-rich-select-field-input" }, { tag: "span", ref: "eDeselect", cls: "ag-rich-select-deselect-button ag-picker-field-icon", role: "presentation" }, { tag: "div", ref: "eIcon", cls: "ag-picker-field-icon", attrs: { "aria-hidden": "true" } } ] } ] }; var AddDropdownComp = class extends AgRichSelect { constructor(params) { super({ ...params, template: AddDropdownCompElement, agComponents: [AgInputTextFieldSelector] }); this.params = params; } showPicker() { setTimeout(() => super.showPicker()); } hidePicker() { setTimeout(() => super.hidePicker()); } postConstruct() { super.postConstruct(); const { wrapperClassName, ariaLabel } = this.params; _setDisplayed(this.eDisplayField, false); if (wrapperClassName) { this.eWrapper.classList.add(wrapperClassName); } _setAriaLabelledBy(this.eWrapper, ""); _setAriaLabel(this.eWrapper, ariaLabel); } onEnterKeyDown(event) { _stopPropagationForAgGrid(event); if (this.isPickerDisplayed) { super.onEnterKeyDown(event); } else { event.preventDefault(); this.showPicker(); } } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderItemNavigationFeature.ts var AdvancedFilterBuilderItemNavigationFeature = class extends BeanStub { constructor(eGui, focusWrapper, eFocusableComp) { super(); this.eGui = eGui; this.focusWrapper = focusWrapper; this.eFocusableComp = eFocusableComp; } postConstruct() { this.addManagedElementListeners(this.eGui, { keydown: (event) => { switch (event.key) { case KeyCode.TAB: if (!event.defaultPrevented) { _stopPropagationForAgGrid(event); } break; case KeyCode.UP: case KeyCode.DOWN: _stopPropagationForAgGrid(event); break; case KeyCode.ESCAPE: if (_isStopPropagationForAgGrid(event)) { return; } if (this.eGui.contains(_getActiveDomElement(this.beans))) { event.preventDefault(); _stopPropagationForAgGrid(event); this.focusWrapper.focus(); } break; } } }); const highlightClass = "ag-advanced-filter-builder-virtual-list-item-highlight"; this.addManagedListeners(this.focusWrapper, { keydown: (event) => { if (event.key === KeyCode.ENTER) { if (_isStopPropagationForAgGrid(event)) { return; } if (_getActiveDomElement(this.beans) === this.focusWrapper) { event.preventDefault(); _stopPropagationForAgGrid(event); this.eFocusableComp.getFocusableElement().focus(); } } }, focusin: () => { this.focusWrapper.classList.add(highlightClass); }, focusout: (event) => { if (!this.focusWrapper.contains(event.relatedTarget)) { this.focusWrapper.classList.remove(highlightClass); } } }); } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderUtils.ts function getAdvancedFilterBuilderAddButtonParams(translate, maxPickerWidth) { return { pickerAriaLabelKey: "ariaLabelAdvancedFilterBuilderAddField", pickerAriaLabelValue: "Advanced Filter Builder Add Field", pickerType: "ag-list", valueList: [ { key: "condition", displayValue: translate("advancedFilterBuilderAddCondition") }, { key: "join", displayValue: translate("advancedFilterBuilderAddJoin") } ], valueFormatter: (value) => value == null ? "" : value.displayValue ?? value.key, pickerIcon: "advancedFilterBuilderAdd", maxPickerWidth: `${maxPickerWidth ?? 120}px`, wrapperClassName: "ag-advanced-filter-builder-item-button", ariaLabel: translate("advancedFilterBuilderAddButtonTooltip") }; } // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderItemAddComp.ts var ItemAddElement = { tag: "div", cls: "ag-advanced-filter-builder-item-wrapper", role: "presentation", children: [ { tag: "div", ref: "eItem", cls: "ag-advanced-filter-builder-item", role: "presentation", children: [ { tag: "div", cls: "ag-advanced-filter-builder-item-tree-lines", attrs: { "aria-hidden": "true" }, children: [ { tag: "div", cls: "ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-top ag-advanced-filter-builder-item-tree-line-horizontal" } ] } ] } ] }; var AdvancedFilterBuilderItemAddComp = class extends Component { constructor(item, focusWrapper) { super(ItemAddElement); this.item = item; this.focusWrapper = focusWrapper; this.eItem = RefPlaceholder; } wireBeans(beans) { this.advFilterExpSvc = beans.advFilterExpSvc; this.registry = beans.registry; } postConstruct() { _setAriaLevel(this.focusWrapper, 2); const addButtonParams = getAdvancedFilterBuilderAddButtonParams( (key) => this.advFilterExpSvc.translate(key), this.gos.get("advancedFilterBuilderParams")?.addSelectWidth ); const eAddButton = this.createManagedBean(new AddDropdownComp(addButtonParams)); this.addManagedListeners(eAddButton, { fieldPickerValueSelected: ({ value }) => { this.dispatchLocalEvent({ type: "advancedFilterBuilderAdded", item: this.item, isJoin: value.key === "join" }); } }); this.eItem.appendChild(eAddButton.getGui()); this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => eAddButton.getGui(), getLocation: () => "advancedFilter", getTooltipValue: () => this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip") }) ); this.createManagedBean( new AdvancedFilterBuilderItemNavigationFeature(this.getGui(), this.focusWrapper, eAddButton) ); _setAriaLabel( this.focusWrapper, this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem", [ this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip"), `${this.item.level + 1}` ]) ); } afterAdd() { } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/conditionPillWrapperComp.ts var ConditionPillWrapperComp = class extends Component { constructor() { super({ tag: "div", cls: "ag-advanced-filter-builder-item-condition", role: "presentation" }); this.validationMessage = null; } wireBeans(beans) { this.advFilterExpSvc = beans.advFilterExpSvc; } init(params) { const { item, createPill } = params; this.item = item; this.createPill = createPill; this.filterModel = item.filterModel; this.setupColumnCondition(this.filterModel); this.validate(); this.addDestroyFunc(() => this.destroyBeans([this.eColumnPill, this.eOperatorPill, this.eOperandPill])); } getDragName() { return this.filterModel.colId ? this.advFilterExpSvc.parseColumnFilterModel(this.filterModel) : this.getDefaultColumnDisplayValue(); } getAriaLabel() { return `${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`; } getValidationMessage() { return this.validationMessage; } getFocusableElement() { return this.eColumnPill.getFocusableElement(); } setupColumnCondition(filterModel) { const columnDetails = this.advFilterExpSvc.getColumnDetails(filterModel.colId); this.baseCellDataType = columnDetails.baseCellDataType; this.column = columnDetails.column; this.numOperands = this.getNumOperands(this.getOperatorKey()); this.eColumnPill = this.createPill({ key: this.getColumnKey(), displayValue: this.getColumnDisplayValue() ?? this.getDefaultColumnDisplayValue(), cssClass: "ag-advanced-filter-builder-column-pill", isSelect: true, getEditorParams: () => ({ values: this.advFilterExpSvc.getColumnAutocompleteEntries() }), update: (key) => this.setColumnKey(key), pickerAriaLabelKey: "ariaLabelAdvancedFilterBuilderColumnSelectField", pickerAriaLabelValue: "Advanced Filter Builder Column Select Field", ariaLabel: this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderColumn") }); this.getGui().appendChild(this.eColumnPill.getGui()); if (_exists(this.getColumnKey())) { this.createOperatorPill(); if (this.hasOperand()) { this.createOperandPill(); } } } createOperatorPill() { this.eOperatorPill = this.createPill({ key: this.getOperatorKey(), displayValue: this.getOperatorDisplayValue() ?? this.getDefaultOptionSelectValue(), cssClass: "ag-advanced-filter-builder-option-pill", isSelect: true, getEditorParams: () => ({ values: this.getOperatorAutocompleteEntries() }), update: (key) => this.setOperatorKey(key), pickerAriaLabelKey: "ariaLabelAdvancedFilterBuilderOptionSelectField", pickerAriaLabelValue: "Advanced Filter Builder Option Select Field", ariaLabel: this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderOption") }); this.eColumnPill.getGui().insertAdjacentElement("afterend", this.eOperatorPill.getGui()); } createOperandPill() { const { filter } = this.filterModel; const key = (typeof filter === "number" || typeof filter === "bigint" ? _toStringOrNull(filter) : filter) ?? ""; this.eOperandPill = this.createPill({ key, // Convert from the input format to display format. // Input format matches model format except for numbers, but these get stringified anyway valueFormatter: (value) => this.advFilterExpSvc.getOperandDisplayValue({ ...this.filterModel, filter: value }, true), baseCellDataType: this.baseCellDataType, cssClass: "ag-advanced-filter-builder-value-pill", isSelect: false, update: (key2) => this.setOperand(key2), ariaLabel: this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderValue") }); this.getGui().appendChild(this.eOperandPill.getGui()); } getColumnKey() { return this.filterModel.colId; } getColumnDisplayValue() { return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel); } getOperatorKey() { return this.filterModel.type; } getOperatorDisplayValue() { return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel); } getOperandDisplayValue() { return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel, true); } hasOperand() { return this.numOperands > 0; } getOperatorAutocompleteEntries() { return this.column ? this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column, this.baseCellDataType) : []; } setColumnKey(colId) { if (!this.eOperatorPill) { this.createOperatorPill(); } const newColumnDetails = this.advFilterExpSvc.getColumnDetails(colId); this.column = newColumnDetails.column; const newBaseCellDataType = newColumnDetails.baseCellDataType; if (this.baseCellDataType !== newBaseCellDataType) { this.baseCellDataType = newBaseCellDataType; this.setOperatorKey(void 0); if (this.eOperatorPill) { _removeFromParent(this.eOperatorPill.getGui()); this.destroyBean(this.eOperatorPill); this.createOperatorPill(); } this.validate(); } this.filterModel.colId = colId; this.filterModel.filterType = this.baseCellDataType; } setOperatorKey(operator) { const newNumOperands = this.getNumOperands(operator); if (newNumOperands !== this.numOperands) { this.numOperands = newNumOperands; if (newNumOperands === 0) { this.destroyOperandPill(); } else { this.createOperandPill(); if (this.baseCellDataType !== "number") { this.setOperand(""); } } } this.filterModel.type = operator; this.validate(); } setOperand(operand) { let parsedOperand = operand; if (this.baseCellDataType === "number") { parsedOperand = _exists(operand) ? Number(operand) : ""; } this.filterModel.filter = parsedOperand; this.validate(); } getNumOperands(operator) { return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType, operator)?.numOperands ?? 0; } destroyOperandPill() { delete this.filterModel.filter; this.eOperandPill?.getGui().remove(); this.destroyBean(this.eOperandPill); this.eOperandPill = void 0; } validate() { let validationMessage = null; if (!_exists(this.getColumnKey())) { validationMessage = this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectColumn"); } else if (!_exists(this.getOperatorKey())) { validationMessage = this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectOption"); } else if (this.numOperands > 0 && !_exists(this.getOperandDisplayValue())) { validationMessage = this.advFilterExpSvc.translate("advancedFilterBuilderValidationEnterValue"); } this.item.valid = !validationMessage; if (validationMessage !== this.validationMessage) { this.validationMessage = validationMessage; this.dispatchLocalEvent({ type: "advancedFilterBuilderValidChanged" }); } } getDefaultColumnDisplayValue() { return this.advFilterExpSvc.translate("advancedFilterBuilderSelectColumn"); } getDefaultOptionSelectValue() { return this.advFilterExpSvc.translate("advancedFilterBuilderSelectOption"); } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/inputPillComp.ts var inputComponentDescriptors = { number: [AgInputNumberField], bigint: [AgInputTextField], boolean: [AgInputTextField], object: [AgInputTextField], text: [AgInputTextField], date: [AgInputDateField], dateString: [AgInputDateField], dateTime: [AgInputDateField, (i) => i.setIncludeTime(true)], dateTimeString: [AgInputDateField, (i) => i.setIncludeTime(true)] }; var InputPillElement = { tag: "div", cls: "ag-advanced-filter-builder-pill-wrapper", role: "presentation", children: [ { tag: "div", ref: "ePill", cls: "ag-advanced-filter-builder-pill", role: "button", children: [ { tag: "span", ref: "eLabel", cls: "ag-advanced-filter-builder-pill-display" } ] } ] }; var InputPillComp = class extends Component { constructor(params) { super(InputPillElement); this.params = params; this.ePill = RefPlaceholder; this.eLabel = RefPlaceholder; const { value, valueFormatter } = params; this.value = value; this.displayValue = valueFormatter(value); } wireBeans(beans) { this.advFilterExpSvc = beans.advFilterExpSvc; } postConstruct() { const { cssClass, ariaLabel } = this.params; this.ePill.classList.add(cssClass); this.activateTabIndex([this.ePill]); this.eLabel.id = `${this.getCompId()}`; _setAriaDescribedBy(this.ePill, this.eLabel.id); _setAriaLabel(this.ePill, ariaLabel); this.renderValue(); this.addManagedListeners(this.ePill, { click: (event) => { event.preventDefault(); this.showEditor(); }, keydown: (event) => { if (event.key === KeyCode.ENTER) { event.preventDefault(); _stopPropagationForAgGrid(event); this.showEditor(); } } }); this.addDestroyFunc(() => this.destroyBean(this.eEditor)); } getFocusableElement() { return this.ePill; } showEditor() { if (this.eEditor) { return; } _setDisplayed(this.ePill, false); this.eEditor = this.createEditorComp(this.params.type); this.eEditor.setValue(this.value); const eEditorGui = this.eEditor.getGui(); this.eEditor.addManagedElementListeners(eEditorGui, { keydown: (event) => { switch (event.key) { case KeyCode.ENTER: event.preventDefault(); _stopPropagationForAgGrid(event); this.updateValue(true); break; case KeyCode.ESCAPE: event.preventDefault(); _stopPropagationForAgGrid(event); this.hideEditor(true); break; } }, focusout: () => this.updateValue(false) }); this.getGui().appendChild(eEditorGui); this.eEditor.getFocusableElement().focus(); } /** * Responsible for instantiating an InputField and calling some of the setup methods */ createEditorComp(type) { const [Comp, postConstruct] = inputComponentDescriptors[type]; const instance = this.createBean(new Comp()); postConstruct?.(instance); return instance; } hideEditor(keepFocus) { const { eEditor } = this; if (!eEditor) { return; } this.eEditor = void 0; eEditor.getGui().remove(); this.destroyBean(eEditor); _setDisplayed(this.ePill, true); if (keepFocus) { this.ePill.focus(); } } renderValue() { let value; const { displayValue, eLabel, params } = this; const { type } = params; const { classList } = eLabel; classList.remove( "ag-advanced-filter-builder-value-empty", "ag-advanced-filter-builder-value-number", "ag-advanced-filter-builder-value-text" ); if (!_exists(displayValue)) { value = this.advFilterExpSvc.translate("advancedFilterBuilderEnterValue"); classList.add("ag-advanced-filter-builder-value-empty"); } else if (type === "number" || type === "bigint") { value = displayValue; classList.add("ag-advanced-filter-builder-value-number"); } else { value = `"${displayValue}"`; classList.add("ag-advanced-filter-builder-value-text"); } eLabel.textContent = value; } updateValue(keepFocus) { if (!this.eEditor) { return; } const value = this.eEditor.getValue() ?? ""; this.dispatchLocalEvent({ type: "fieldValueChanged", value }); this.value = value; this.displayValue = this.params.valueFormatter(value); this.renderValue(); this.hideEditor(keepFocus); } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/joinPillWrapperComp.ts var JoinPillWrapperComp = class extends Component { wireBeans(beans) { this.advFilterExpSvc = beans.advFilterExpSvc; } constructor() { super({ tag: "div", cls: "ag-advanced-filter-builder-item-condition", role: "presentation" }); } init(params) { const { item, createPill } = params; const filterModel = item.filterModel; this.filterModel = filterModel; this.ePill = createPill({ key: filterModel.type, displayValue: this.advFilterExpSvc.parseJoinOperator(filterModel), cssClass: "ag-advanced-filter-builder-join-pill", isSelect: true, getEditorParams: () => ({ values: this.advFilterExpSvc.getJoinOperatorAutocompleteEntries() }), update: (key) => filterModel.type = key, pickerAriaLabelKey: "ariaLabelAdvancedFilterBuilderJoinSelectField", pickerAriaLabelValue: "Advanced Filter Builder Join Operator Select Field", ariaLabel: this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderJoinOperator") }); this.getGui().appendChild(this.ePill.getGui()); this.addDestroyFunc(() => this.destroyBean(this.ePill)); } getDragName() { return this.advFilterExpSvc.parseJoinOperator(this.filterModel); } getAriaLabel() { return `${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`; } getValidationMessage() { return null; } getFocusableElement() { return this.ePill.getFocusableElement(); } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/selectPillComp.ts var SelectPillElement = { tag: "div", cls: "ag-picker-field ag-advanced-filter-builder-pill-wrapper", role: "presentation", children: [ { tag: "div", ref: "eLabel" }, { tag: "div", ref: "eWrapper", cls: "ag-wrapper ag-advanced-filter-builder-pill ag-picker-collapsed", children: [ { tag: "div", ref: "eDisplayField", cls: "ag-picker-field-display ag-advanced-filter-builder-pill-display" }, { tag: "ag-input-text-field", ref: "eInput", cls: "ag-rich-select-field-input" }, { tag: "span", ref: "eDeselect", cls: "ag-rich-select-deselect-button ag-picker-field-icon", role: "presentation" }, { tag: "div", ref: "eIcon", cls: "ag-picker-field-icon", attrs: { "aria-hidden": "true" } } ] } ] }; var SelectPillComp = class extends AgRichSelect { constructor(params) { super({ ...params, template: SelectPillElement, agComponents: [AgInputTextFieldSelector] }); this.params = params; } getFocusableElement() { return this.eWrapper; } showPicker() { setTimeout(() => super.showPicker()); } hidePicker() { setTimeout(() => super.hidePicker()); } postConstruct() { super.postConstruct(); const { wrapperClassName, ariaLabel } = this.params; this.eWrapper.classList.add(wrapperClassName); _setAriaLabelledBy(this.eWrapper, ""); _setAriaLabel(this.eWrapper, ariaLabel); } createPickerComponent() { if (!this.values) { const { values } = this.params.getEditorParams(); this.values = values; const key = this.value.key; const value = values.find((value2) => value2.key === key) ?? { key, displayValue: this.value.displayValue }; this.value = value; } return super.createPickerComponent(); } onEnterKeyDown(event) { _stopPropagationForAgGrid(event); if (this.isPickerDisplayed) { super.onEnterKeyDown(event); } else { event.preventDefault(); this.showPicker(); } } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderItemComp.ts var AdvancedFilterBuilderItemElement = { tag: "div", cls: "ag-advanced-filter-builder-item-wrapper", role: "presentation", children: [ { tag: "div", cls: "ag-advanced-filter-builder-item", role: "presentation", children: [ { tag: "div", ref: "eTreeLines", cls: "ag-advanced-filter-builder-item-tree-lines", attrs: { "aria-hidden": "true" } }, { tag: "span", ref: "eDragHandle", cls: "ag-drag-handle", attrs: { "aria-hidden": "true" } }, { tag: "span", ref: "eValidation", cls: "ag-advanced-filter-builder-item-button ag-advanced-filter-builder-invalid", attrs: { "aria-hidden": "true" } } ] }, { tag: "div", ref: "eButtons", cls: "ag-advanced-filter-builder-item-buttons", children: [ { tag: "span", ref: "eMoveUpButton", cls: "ag-advanced-filter-builder-item-button", role: "button" }, { tag: "span", ref: "eMoveDownButton", cls: "ag-advanced-filter-builder-item-button", role: "button" }, { tag: "div", ref: "eAddButton", role: "presentation" }, { tag: "span", ref: "eRemoveButton", cls: "ag-advanced-filter-builder-item-button", role: "button" } ] } ] }; var AdvancedFilterBuilderItemComp = class extends TabGuardComp { constructor(item, dragFeature, focusWrapper) { super(AdvancedFilterBuilderItemElement); this.item = item; this.dragFeature = dragFeature; this.focusWrapper = focusWrapper; this.eTreeLines = RefPlaceholder; this.eDragHandle = RefPlaceholder; this.eButtons = RefPlaceholder; this.eValidation = RefPlaceholder; this.eMoveUpButton = RefPlaceholder; this.eMoveDownButton = RefPlaceholder; this.eAddButton = RefPlaceholder; this.eRemoveButton = RefPlaceholder; this.moveUpDisabled = false; this.moveDownDisabled = false; } wireBeans(beans) { this.dragAndDrop = beans.dragAndDrop; this.advFilterExpSvc = beans.advFilterExpSvc; this.registry = beans.registry; } postConstruct() { const { filterModel, level, showMove } = this.item; const isJoin = filterModel.filterType === "join"; this.ePillWrapper = this.createManagedBean(isJoin ? new JoinPillWrapperComp() : new ConditionPillWrapperComp()); this.ePillWrapper.init({ item: this.item, createPill: (params) => this.createPill(params) }); this.eDragHandle.insertAdjacentElement("afterend", this.ePillWrapper.getGui()); if (level === 0) { const eTreeLine = _createElement({ tag: "div", cls: "ag-advanced-filter-builder-item-tree-line ag-advanced-filter-builder-item-tree-line-vertical-bottom ag-advanced-filter-builder-item-tree-line-root" }); this.eTreeLines.appendChild(eTreeLine); _setDisplayed(this.eDragHandle, false); _setDisplayed(this.eButtons, false); _setAriaExpanded(this.focusWrapper, true); } else { this.setupTreeLines(level); this.eDragHandle.appendChild(_createIconNoSpan("advancedFilterBuilderDrag", this.beans)); this.setupValidation(); this.setupMoveButtons(showMove); this.setupAddButton(); this.setupRemoveButton(); this.setupDragging(); this.updateAriaExpanded(); } _setAriaLevel(this.focusWrapper, level + 1); this.initialiseTabGuard({}); this.createManagedBean( new AdvancedFilterBuilderItemNavigationFeature(this.getGui(), this.focusWrapper, this.ePillWrapper) ); this.updateAriaLabel(); this.addManagedListeners(this.ePillWrapper, { advancedFilterBuilderValueChanged: () => this.dispatchLocalEvent({ type: "advancedFilterBuilderValueChanged" }), advancedFilterBuilderValidChanged: () => this.updateValidity() }); } setState(params) { const { level } = this.item; if (level === 0) { return; } const { showMove } = this.item; const { disableMoveUp, disableMoveDown, treeLines, showStartTreeLine } = params; this.updateTreeLines(treeLines, showStartTreeLine); this.updateAriaExpanded(); if (showMove) { this.moveUpDisabled = !!disableMoveUp; this.moveDownDisabled = !!disableMoveDown; this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled", disableMoveUp); this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled", disableMoveDown); _setAriaDisabled(this.eMoveUpButton, !!disableMoveUp); _setAriaDisabled(this.eMoveDownButton, !!disableMoveDown); this.moveUpTooltipFeature?.refreshTooltip(); this.moveDownTooltipFeature?.refreshTooltip(); } } focusMoveButton(backwards) { (backwards ? this.eMoveUpButton : this.eMoveDownButton).focus(); } afterAdd() { this.ePillWrapper.getFocusableElement().focus(); } setupTreeLines(level) { for (let i = 0; i < level; i++) { this.eTreeLines.appendChild( _createElement({ tag: "div", cls: "ag-advanced-filter-builder-item-tree-line" }) ); } } updateTreeLines(treeLines, showStartTreeLine) { const lastTreeLineIndex = treeLines.length - 1; const { children } = this.eTreeLines; for (let i = 0; i < lastTreeLineIndex; i++) { const eTreeLine2 = children.item(i); if (eTreeLine2) { eTreeLine2.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical", !treeLines[i]); } } const eTreeLine = children.item(lastTreeLineIndex); if (eTreeLine) { eTreeLine.classList.add("ag-advanced-filter-builder-item-tree-line-horizontal"); const isLastChild = treeLines[lastTreeLineIndex]; eTreeLine.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical-top", isLastChild); eTreeLine.classList.toggle("ag-advanced-filter-builder-item-tree-line-vertical", !isLastChild); } this.eDragHandle.classList.toggle( "ag-advanced-filter-builder-item-tree-line-vertical-bottom", showStartTreeLine ); } setupValidation() { this.eValidation.appendChild(_createIconNoSpan("advancedFilterBuilderInvalid", this.beans)); this.validationTooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eValidation, getLocation: () => "advancedFilter", getTooltipValue: () => this.ePillWrapper.getValidationMessage(), getTooltipShowDelayOverride: () => 1e3 }) ); this.updateValidity(); } setupAddButton() { const addButtonParams = getAdvancedFilterBuilderAddButtonParams( (key) => this.advFilterExpSvc.translate(key), this.gos.get("advancedFilterBuilderParams")?.addSelectWidth ); const eAddButton = this.createManagedBean(new AddDropdownComp(addButtonParams)); this.addManagedListeners(eAddButton, { fieldPickerValueSelected: ({ value }) => this.dispatchLocalEvent({ type: "advancedFilterBuilderAdded", item: this.item, isJoin: value.key === "join" }) }); this.eAddButton.appendChild(eAddButton.getGui()); this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eAddButton, getLocation: () => "advancedFilter", getTooltipValue: () => this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip") }) ); } setupRemoveButton() { this.eRemoveButton.appendChild(_createIconNoSpan("advancedFilterBuilderRemove", this.beans)); this.addManagedListeners(this.eRemoveButton, { click: () => this.removeItem(), keydown: (event) => { if (event.key === KeyCode.ENTER) { event.preventDefault(); _stopPropagationForAgGrid(event); this.removeItem(); } } }); this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eRemoveButton, getLocation: () => "advancedFilter", getTooltipValue: () => this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip") }) ); _setAriaLabel(this.eRemoveButton, this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")); this.activateTabIndex([this.eRemoveButton]); } setupMoveButtons(showMove) { if (showMove) { this.eMoveUpButton.appendChild(_createIconNoSpan("advancedFilterBuilderMoveUp", this.beans)); this.addManagedListeners(this.eMoveUpButton, { click: () => this.moveItem(true), keydown: (event) => { if (event.key === KeyCode.ENTER) { event.preventDefault(); _stopPropagationForAgGrid(event); this.moveItem(true); } } }); this.moveUpTooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eMoveUpButton, getLocation: () => "advancedFilter", getTooltipValue: () => this.moveUpDisabled ? null : this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip") }) ); _setAriaLabel( this.eMoveUpButton, this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip") ); this.eMoveDownButton.appendChild(_createIconNoSpan("advancedFilterBuilderMoveDown", this.beans)); this.addManagedListeners(this.eMoveDownButton, { click: () => this.moveItem(false), keydown: (event) => { if (event.key === KeyCode.ENTER) { event.preventDefault(); _stopPropagationForAgGrid(event); this.moveItem(false); } } }); this.moveDownTooltipFeature = this.createOptionalManagedBean( this.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.eMoveDownButton, getLocation: () => "advancedFilter", getTooltipValue: () => this.moveDownDisabled ? null : this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip") }) ); _setAriaLabel( this.eMoveDownButton, this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip") ); this.activateTabIndex([this.eMoveUpButton, this.eMoveDownButton]); } else { _setDisplayed(this.eMoveUpButton, false); _setDisplayed(this.eMoveDownButton, false); } } updateValidity() { _setVisible(this.eValidation, !this.item.valid); this.validationTooltipFeature?.refreshTooltip(); this.updateAriaLabel(); } createPill(params) { const { key, cssClass, update, ariaLabel } = params; const onUpdated = (key2) => { if (key2 == null) { return; } update(key2); this.dispatchLocalEvent({ type: "advancedFilterBuilderValueChanged" }); }; if (params.isSelect) { const { getEditorParams, pickerAriaLabelKey, pickerAriaLabelValue, displayValue } = params; const advancedFilterBuilderParams = this.gos.get("advancedFilterBuilderParams"); const minPickerWidth = `${advancedFilterBuilderParams?.pillSelectMinWidth ?? 140}px`; const maxPickerWidth = `${advancedFilterBuilderParams?.pillSelectMaxWidth ?? 200}px`; const comp = this.createBean( new SelectPillComp({ pickerAriaLabelKey, pickerAriaLabelValue, pickerType: "ag-list", value: { key, displayValue }, valueFormatter: (value) => value == null ? "" : value.displayValue ?? value.key, variableWidth: true, minPickerWidth, maxPickerWidth, getEditorParams, wrapperClassName: cssClass, ariaLabel, pickerIcon: "advancedFilterBuilderSelectOpen" }) ); this.addManagedListeners(comp, { fieldPickerValueSelected: ({ value }) => onUpdated(value?.key) }); return comp; } else { const { baseCellDataType, valueFormatter } = params; const comp = this.createBean( new InputPillComp({ value: key, valueFormatter, cssClass, type: baseCellDataType, ariaLabel }) ); this.addManagedListeners(comp, { fieldValueChanged: ({ value }) => onUpdated(value) }); return comp; } } setupDragging() { const dragSource = { type: DragSourceType.AdvancedFilterBuilder, eElement: this.eDragHandle, dragItemName: () => this.ePillWrapper.getDragName(), getDefaultIconName: () => "notAllowed", getDragItem: () => ({}), onDragStarted: () => this.dragFeature.dispatchLocalEvent({ type: "advancedFilterBuilderDragStarted", item: this.item }), onDragStopped: () => this.dragFeature.dispatchLocalEvent({ type: "advancedFilterBuilderDragEnded" }) }; this.dragAndDrop.addDragSource(dragSource, true); this.addDestroyFunc(() => this.dragAndDrop.removeDragSource(dragSource)); } updateAriaLabel() { const wrapperLabel = this.ePillWrapper.getAriaLabel(); const level = `${this.item.level + 1}`; const validationMessage = this.ePillWrapper.getValidationMessage(); let ariaLabel; if (validationMessage) { ariaLabel = this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItemValidation", [ wrapperLabel, level, validationMessage ]); } else { ariaLabel = this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem", [wrapperLabel, level]); } _setAriaLabel(this.focusWrapper, ariaLabel); } updateAriaExpanded() { _removeAriaExpanded(this.focusWrapper); const { filterModel } = this.item; if (filterModel?.filterType === "join" && filterModel.conditions.length) { _setAriaExpanded(this.focusWrapper, true); } } removeItem() { this.dispatchLocalEvent({ type: "advancedFilterBuilderRemoved", item: this.item }); } moveItem(backwards) { this.dispatchLocalEvent({ type: "advancedFilterBuilderMoved", item: this.item, backwards }); } }; // packages/ag-grid-enterprise/src/advancedFilter/builder/advancedFilterBuilderComp.ts var ButtonLocaleMap2 = { apply: "advancedFilterBuilderApply", clear: "advancedFilterBuilderClear", cancel: "advancedFilterBuilderCancel", reset: "advancedFilterBuilderReset" }; var AdvancedFilterBuilderElement = { tag: "div", cls: "ag-advanced-filter-builder", role: "presentation", attrs: { tabindex: "-1" }, children: [ { tag: "div", ref: "eList", cls: "ag-advanced-filter-builder-list", role: "presentation" } ] }; var AdvancedFilterBuilderComp = class extends Component { constructor() { super(AdvancedFilterBuilderElement); this.eList = RefPlaceholder; } wireBeans(beans) { this.filterManager = beans.filterManager; this.advancedFilter = beans.advancedFilter; this.advFilterExpSvc = beans.advFilterExpSvc; } postConstruct() { const params = this.gos.get("advancedFilterBuilderParams"); this.params = { buttons: ["apply", "cancel"], ...params }; this.addManagedPropertyListener("advancedFilterBuilderParams", ({ currentValue }) => { this.params.showMoveButtons = !!currentValue?.showMoveButtons; this.params.buttons = currentValue?.buttons ?? ["apply", "cancel"]; this.refreshList(false); }); this.filterModel = this.setupFilterModel(); this.setupVirtualList(); this.dragFeature = this.createManagedBean(new AdvancedFilterBuilderDragFeature(this, this.virtualList)); this.resetButtonsPanel(this.params.buttons); } refresh() { const virtualList = this.virtualList; let indexToFocus = virtualList.getLastFocusedRow(); this.setupFilterModel(); this.validateItems(); this.refreshList(false); if (indexToFocus != null) { if (!virtualList.getComponentAt(indexToFocus)) { indexToFocus = 0; } virtualList.focusRow(indexToFocus); } } getNumItems() { return this.items.length; } moveItem(item, destination) { if (!destination || !item) { return; } this.moveItemToIndex(item, destination.rowIndex, destination.position); } afterGuiAttached() { this.virtualList.awaitStable(() => this.virtualList.focusRow(0)); } setupVirtualList() { const virtualList = this.virtualList = this.createManagedBean( new VirtualList({ cssIdentifier: "advanced-filter-builder", ariaRole: "tree", listName: this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderList"), moveItemCallback: this.virtualListMoveItemCallback.bind(this) }) ); virtualList.setComponentCreator(this.createItemComponent.bind(this)); virtualList.setComponentUpdater(this.updateItemComponent.bind(this)); virtualList.setRowHeight(40); this.eList.appendChild(virtualList.getGui()); virtualList.setModel({ getRowCount: () => this.items?.length || 0, getRow: (index) => this.items[index], areRowsEqual: (oldRow, newRow) => oldRow === newRow }); this.buildList(); virtualList.refresh(); } resetButtonsPanel(actions) { const hasButtons = actions && actions.length > 0; let eButtonsPanel = this.eButtons; if (hasButtons) { const buttons = actions.map((type) => ({ type, label: this.advFilterExpSvc.translate(ButtonLocaleMap2[type]) })); if (!eButtonsPanel) { eButtonsPanel = this.createBean(new FilterButtonComp()); this.appendChild(eButtonsPanel.getGui()); const getListener = (action) => ({ event }) => { this.updateModel(action); this.afterAction(action, event); }; eButtonsPanel.addManagedListeners(eButtonsPanel, { apply: getListener("apply"), clear: getListener("clear"), reset: getListener("reset"), cancel: getListener("cancel") }); this.eButtons = eButtonsPanel; } eButtonsPanel.updateButtons(buttons); const applyButton = eButtonsPanel.getApplyButton(); if (applyButton) { const mouseListener = (isEnter) => this.toggleCss("ag-advanced-filter-builder-validation", isEnter); this.addManagedElementListeners(applyButton, { mouseenter: () => mouseListener(true), mouseleave: () => mouseListener(false) }); } } else if (eButtonsPanel) { _removeFromParent(eButtonsPanel.getGui()); this.eButtons = this.destroyBean(eButtonsPanel); } } updateModel(action) { switch (action) { case "apply": this.advancedFilter.setModel(this.filterModel); this.filterManager?.onFilterChanged({ source: "advancedFilter" }); break; case "reset": this.advancedFilter.setModel(null); this.filterManager?.onFilterChanged({ source: "advancedFilter" }); break; case "cancel": break; case "clear": this.filterModel = this.formatFilterModel(null); this.refreshList(false); break; } } afterAction(action, event) { switch (action) { case "apply": { event?.preventDefault(); this.close(); break; } case "reset": { this.close(); break; } case "cancel": { this.close(); break; } } } removeItemFromParent(item) { const sourceParentIndex = item.parent.conditions.indexOf(item.filterModel); item.parent.conditions.splice(sourceParentIndex, 1); return sourceParentIndex; } moveItemToIndex(item, destinationRowIndex, destinationPosition) { const destinationItem = this.items[destinationRowIndex]; const destinationIsParent = destinationItem.filterModel?.filterType === "join" && destinationPosition === "bottom"; const destinationParent = destinationIsParent ? destinationItem.filterModel : destinationItem.parent; if (!destinationParent) { return; } if (this.isChildOrSelf(destinationParent, item.filterModel) || destinationItem === item) { return; } this.removeItemFromParent(item); let destinationParentIndex; if (destinationIsParent) { destinationParentIndex = 0; } else { destinationParentIndex = destinationParent.conditions.indexOf(destinationItem.filterModel); if (destinationParentIndex === -1) { destinationParentIndex = destinationParent.conditions.length; } else if (destinationPosition === "bottom") { destinationParentIndex += 1; } } destinationParent.conditions.splice(destinationParentIndex, 0, item.filterModel); this.refreshList(false); } isChildOrSelf(modelToCheck, potentialParentModel) { return modelToCheck === potentialParentModel || potentialParentModel.filterType === "join" && potentialParentModel.conditions.some((condition) => this.isChildOrSelf(modelToCheck, condition)); } setupFilterModel() { const filterModel = this.formatFilterModel(this.advancedFilter.getModel()); this.stringifiedModel = JSON.stringify(filterModel); return filterModel; } formatFilterModel(filterModel) { filterModel = filterModel ?? { filterType: "join", type: "AND", conditions: [] }; if (filterModel.filterType !== "join") { filterModel = { filterType: "join", type: "AND", conditions: [filterModel] }; } return filterModel; } buildList() { const parseFilterModel = (filterModel, items, level, parent) => { items.push({ filterModel, level, parent, valid: true, showMove: this.params.showMoveButtons }); if (filterModel.filterType === "join") { for (const childFilterModel of filterModel.conditions) { parseFilterModel(childFilterModel, items, level + 1, filterModel); } if (level === 0) { items.push({ filterModel: null, level: level + 1, parent: filterModel, valid: true }); } } }; this.items = []; parseFilterModel(this.filterModel, this.items, 0); } refreshList(softRefresh) { if (!softRefresh) { const invalidModels = []; for (const item of this.items) { if (!item.valid) { invalidModels.push(item.filterModel); } } this.buildList(); if (invalidModels.length) { for (const item of this.items) { if (item.filterModel && invalidModels.includes(item.filterModel)) { item.valid = false; } } } } this.virtualList.refresh(softRefresh); this.validate(); } updateItemComponent(item, comp) { const index = this.items.indexOf(item); const populateTreeLines = (filterModel2, treeLines2) => { const parentItem = this.items.find((itemToCheck) => itemToCheck.filterModel === filterModel2); const parentFilterModel = parentItem?.parent; if (parentFilterModel) { const { conditions } = parentFilterModel; populateTreeLines(parentFilterModel, treeLines2); treeLines2.push(conditions[conditions.length - 1] === filterModel2); } }; const treeLines = []; const { filterModel } = item; if (filterModel) { populateTreeLines(filterModel, treeLines); treeLines[0] = false; } const showStartTreeLine = filterModel?.filterType === "join" && !!filterModel.conditions.length; comp.setState({ disableMoveUp: index === 1, disableMoveDown: !this.canMoveDown(item, index), treeLines, showStartTreeLine }); } createItemComponent(item, focusWrapper) { const itemComp = this.createBean( item.filterModel ? new AdvancedFilterBuilderItemComp(item, this.dragFeature, focusWrapper) : new AdvancedFilterBuilderItemAddComp(item, focusWrapper) ); itemComp.addManagedListeners(itemComp, { advancedFilterBuilderRemoved: ({ item: item2 }) => this.removeItem(item2), advancedFilterBuilderValueChanged: () => this.validate(), advancedFilterBuilderAdded: ({ item: item2, isJoin }) => this.addItem(item2, isJoin), advancedFilterBuilderMoved: ({ item: item2, backwards }) => this.moveItemUpDown(item2, backwards) }); if (itemComp instanceof AdvancedFilterBuilderItemComp) { this.updateItemComponent(item, itemComp); } return itemComp; } addItem(item, isJoin) { const { parent: itemParent, level, filterModel: itemFilterModel } = item; const itemIsJoin = itemFilterModel?.filterType === "join"; const filterModel = isJoin ? { filterType: "join", type: "AND", conditions: [] } : {}; const parent = itemIsJoin ? itemFilterModel : itemParent; let insertIndex = itemIsJoin ? 0 : parent.conditions.indexOf(itemFilterModel); if (insertIndex >= 0) { if (!itemIsJoin) { insertIndex += 1; } parent.conditions.splice(insertIndex, 0, filterModel); } else { parent.conditions.push(filterModel); } let index = this.items.indexOf(item); const softRefresh = index >= 0; if (softRefresh) { if (item.filterModel) { index++; } const newItems = [ { filterModel, level: itemIsJoin ? level + 1 : level, parent, valid: isJoin, showMove: this.params.showMoveButtons } ]; this.items.splice(index, 0, ...newItems); } this.refreshList(softRefresh); if (softRefresh) { this.virtualList.getComponentAt(index)?.afterAdd(); } } removeItem(item) { const parent = item.parent; const { filterModel } = item; const parentIndex = parent.conditions.indexOf(filterModel); parent.conditions.splice(parentIndex, 1); const isJoin = item.filterModel?.filterType === "join"; const index = this.items.indexOf(item); const softRefresh = !isJoin && index >= 0; if (softRefresh) { this.items.splice(index, 1); } this.refreshList(softRefresh); if (index >= 0) { this.virtualList.focusRow(index); } } moveItemUpDown(item, backwards, fromVirtualList) { const itemIndex = this.items.indexOf(item); const destinationIndex = backwards ? itemIndex - 1 : itemIndex + 1; if (destinationIndex === 0 || !backwards && !this.canMoveDown(item, itemIndex)) { return; } const destinationItem = this.items[destinationIndex]; const indexInParent = this.removeItemFromParent(item); const { level, filterModel, parent } = item; const { level: destinationLevel, filterModel: destinationFilterModel, parent: destinationParent } = destinationItem; if (backwards) { if (destinationLevel === level && destinationFilterModel.filterType === "join") { destinationFilterModel.conditions.push(filterModel); } else if (destinationLevel <= level) { const destinationIndex2 = destinationParent.conditions.indexOf(destinationFilterModel); destinationParent.conditions.splice(destinationIndex2, 0, filterModel); } else { const newParentItem = parent.conditions[indexInParent - 1]; newParentItem.conditions.push(filterModel); } } else if (destinationLevel === level) { if (destinationFilterModel.filterType === "join") { destinationFilterModel.conditions.splice(0, 0, filterModel); } else { const destinationIndex2 = destinationParent.conditions.indexOf(destinationFilterModel); destinationParent.conditions.splice(destinationIndex2 + 1, 0, filterModel); } } else if (indexInParent < parent.conditions.length) { parent.conditions.splice(indexInParent + 1, 0, filterModel); } else { const parentItem = this.items.find((itemToCheck) => itemToCheck.filterModel === parent); const destinationIndex2 = parentItem.parent.conditions.indexOf(parentItem.filterModel) + 1; parentItem.parent.conditions.splice(destinationIndex2, 0, filterModel); } this.refreshList(false); const newIndex = this.items.findIndex( ({ filterModel: filterModelToCheck }) => filterModelToCheck === filterModel ); if (newIndex < 0) { return; } const comp = this.virtualList.getComponentAt(newIndex); if (!(comp instanceof AdvancedFilterBuilderItemComp)) { return; } if (!fromVirtualList) { comp.focusMoveButton(backwards); } } virtualListMoveItemCallback(itemComp, isUp) { const item = itemComp.item; const from = this.items.indexOf(item); if (from <= 0 || from === this.items.length - 1) { return; } if (isUp && from === 1 || !isUp && !this.canMoveDown(item, from)) { return; } this.moveItemUpDown(item, isUp, true); this.virtualList.focusRow(from + (isUp ? -1 : 1)); } canMoveDown(item, index) { return !(item.level === 1 && index === this.items.length - 2 || item.level === 1 && item.parent.conditions[item.parent.conditions.length - 1] === item.filterModel); } close() { this.advancedFilter.getCtrl().toggleFilterBuilder({ source: "ui" }); } validate() { let isValid = this.items.every(({ valid }) => valid); let validationMessage = null; if (isValid) { isValid = JSON.stringify(this.filterModel) !== this.stringifiedModel; if (!isValid) { validationMessage = this.advFilterExpSvc.translate("advancedFilterBuilderValidationAlreadyApplied"); } } else { validationMessage = this.advFilterExpSvc.translate("advancedFilterBuilderValidationIncomplete"); } this.eButtons?.updateValidity(isValid, validationMessage); } validateItems() { const clearOperator = (filterModel) => { filterModel.type = void 0; }; const clearOperand = (filterModel) => { delete filterModel.filter; }; for (const item of this.items) { if (!item.valid || !item.filterModel || item.filterModel.filterType === "join") { continue; } const { filterModel } = item; const { colId } = filterModel; const hasColumn = this.advFilterExpSvc.getColumnAutocompleteEntries().find(({ key }) => key === colId); const columnDetails = this.advFilterExpSvc.getColumnDetails(filterModel.colId); if (!hasColumn || !columnDetails.column) { item.valid = false; filterModel.colId = void 0; clearOperator(filterModel); clearOperand(filterModel); continue; } const operatorForType = this.advFilterExpSvc.getDataTypeExpressionOperator(columnDetails.baseCellDataType); const operator = operatorForType.operators[filterModel.type]; if (!operator) { item.valid = false; clearOperator(filterModel); clearOperand(filterModel); continue; } if (operator.numOperands > 0 && !_exists(filterModel.filter)) { item.valid = false; } } } }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterCtrl.ts var AdvancedFilterCtrl = class extends BeanStub { constructor(enabled) { super(); this.enabled = enabled; } wireBeans(beans) { this.ctrlsSvc = beans.ctrlsSvc; this.popupSvc = beans.popupSvc; this.advFilterExpSvc = beans.advFilterExpSvc; this.environment = beans.environment; } postConstruct() { this.hasAdvancedFilterParent = !!this.gos.get("advancedFilterParent"); this.ctrlsSvc.whenReady(this, () => this.setAdvancedFilterComp()); this.addManagedEventListeners({ advancedFilterEnabledChanged: ({ enabled }) => this.onEnabledChanged(enabled) }); this.addManagedPropertyListener("advancedFilterParent", () => this.updateComps()); this.addManagedPropertyListener("advancedFilterBuilderParams", (event) => { if (event.currentValue?.suppressFullScreenButton !== event.previousValue?.suppressFullScreenButton) { this.eBuilderDialog?.setMaximizable(event.currentValue?.suppressFullScreenButton ?? true); } }); this.addDestroyFunc(() => { this.destroyAdvancedFilterComp(); this.destroyBean(this.eBuilderComp); if (this.eBuilderDialog?.isAlive()) { this.destroyBean(this.eBuilderDialog); } }); } setupHeaderComp(eCompToInsertBefore) { if (this.eHeaderComp) { this.eHeaderComp?.getGui().remove(); this.destroyBean(this.eHeaderComp); } this.eHeaderComp = this.createManagedBean( new AdvancedFilterHeaderComp(this.enabled && !this.hasAdvancedFilterParent) ); eCompToInsertBefore.insertAdjacentElement("beforebegin", this.eHeaderComp.getGui()); } focusHeaderComp() { if (this.eHeaderComp) { this.eHeaderComp.getFocusableElement().focus(); return true; } return false; } refreshComp() { this.eFilterComp?.refresh(); this.eHeaderComp?.refresh(); } refreshBuilderComp() { this.eBuilderComp?.refresh(); } getHeaderHeight() { return this.eHeaderComp?.getHeight() ?? 0; } setInputDisabled(disabled) { this.eFilterComp?.setInputDisabled(disabled); this.eHeaderComp?.setInputDisabled(disabled); } toggleFilterBuilder(params) { const { source, force, eventSource } = params; if (force && this.eBuilderDialog || force === false && !this.eBuilderDialog) { return; } if (this.eBuilderDialog) { this.builderDestroySource = source; this.destroyBean(this.eBuilderDialog); return; } this.setInputDisabled(true); const { width, height, minWidth } = this.getBuilderDialogSize(); const { suppressFullScreenButton } = { suppressFullScreenButton: false, ...this.gos.get("advancedFilterBuilderParams") }; this.eBuilderComp = this.createBean(new AdvancedFilterBuilderComp()); this.eBuilderDialog = this.createBean( new Dialog({ title: this.advFilterExpSvc.translate("advancedFilterBuilderTitle"), component: this.eBuilderComp, width, height, resizable: true, movable: true, maximizable: !suppressFullScreenButton, centered: true, closable: true, minWidth, afterGuiAttached: () => this.eBuilderComp?.afterGuiAttached(), postProcessPopupParams: { type: "advancedFilterBuilder", eventSource } }) ); this.dispatchFilterBuilderVisibleChangedEvent(source, true); this.eBuilderDialog.addEventListener("destroyed", () => { this.destroyBean(this.eBuilderComp); this.eBuilderComp = void 0; this.eBuilderDialog = void 0; this.setInputDisabled(false); this.dispatchLocalEvent({ type: "advancedFilterBuilderClosed" }); this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource ?? "ui", false); this.builderDestroySource = void 0; }); } dispatchFilterBuilderVisibleChangedEvent(source, visible) { this.eventSvc.dispatchEvent({ type: "advancedFilterBuilderVisibleChanged", source, visible }); } getBuilderDialogSize() { const minWidth = this.gos.get("advancedFilterBuilderParams")?.minWidth ?? 500; const popupParent = this.popupSvc.getPopupParent(); const maxWidth = Math.round(_getAbsoluteWidth(popupParent)) - 2; const maxHeight = Math.round(_getAbsoluteHeight(popupParent) * 0.75) - 2; const width = Math.min(Math.max(700, minWidth), maxWidth); const height = Math.min(600, maxHeight); return { width, height, minWidth }; } onEnabledChanged(enabled) { this.enabled = enabled; this.updateComps(); } updateComps() { this.setAdvancedFilterComp(); this.setHeaderCompEnabled(); this.eventSvc.dispatchEvent({ type: "headerHeightChanged" }); } setAdvancedFilterComp() { this.destroyAdvancedFilterComp(); if (!this.enabled) { return; } const advancedFilterParent = this.gos.get("advancedFilterParent"); this.hasAdvancedFilterParent = !!advancedFilterParent; if (advancedFilterParent) { const eAdvancedFilterComp = this.createBean(new AdvancedFilterComp()); const eAdvancedFilterCompGui = eAdvancedFilterComp.getGui(); this.environment.applyThemeClasses(eAdvancedFilterCompGui); eAdvancedFilterCompGui.classList.add(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr"); advancedFilterParent.appendChild(eAdvancedFilterCompGui); this.eFilterComp = eAdvancedFilterComp; } } setHeaderCompEnabled() { this.eHeaderComp?.setEnabled(this.enabled && !this.hasAdvancedFilterParent); } destroyAdvancedFilterComp() { if (this.eFilterComp) { _removeFromParent(this.eFilterComp.getGui()); this.destroyBean(this.eFilterComp); } } }; // packages/ag-grid-enterprise/src/advancedFilter/joinFilterExpressionParser.ts var OperatorParser2 = class { constructor(params) { this.params = params; this.operators = []; this.operatorStartPositions = []; this.operatorEndPositions = []; this.activeOperator = 0; this.validationError = null; } parseExpression(i) { this.operators.push(""); this.operatorStartPositions.push(i); this.operatorEndPositions.push(void 0); const { expression } = this.params; while (i < expression.length) { const char = expression[i]; if (char === " ") { const isComplete = this.parseOperator(i - 1); if (isComplete) { this.activeOperator++; return i - 1; } else { this.operators[this.activeOperator] += char; } } else { this.operators[this.activeOperator] += char; } i++; } this.parseOperator(i - 1); return i; } isValid() { return !this.validationError && (!this.operators.length || !!this.parsedOperator); } getValidationError() { return this.validationError; } getFunction() { return this.parsedOperator === "OR" ? "||" : "&&"; } getModel() { return this.parsedOperator === "OR" ? "OR" : "AND"; } getAutocompleteListParams(position, operatorIndex) { let searchString; if (operatorIndex == null) { searchString = ""; } else { const operator = this.operators[operatorIndex]; const operatorEndPosition = this.operatorEndPositions[operatorIndex]; searchString = getSearchString( operator, position, operatorEndPosition == null ? this.params.expression.length : operatorEndPosition + 1 ); } let entries = this.params.advFilterExpSvc.getJoinOperatorAutocompleteEntries(); if (operatorIndex || operatorIndex == null && this.activeOperator) { entries = entries.filter(({ key }) => key === this.parsedOperator); } return this.params.advFilterExpSvc.generateAutocompleteListParams(entries, "join", searchString); } updateExpression(position, updateEntry, operatorIndex) { let { expression } = this.params; const updatedValuePart = updateEntry.displayValue ?? updateEntry.key; if (operatorIndex === 0) { for (let i = this.operatorEndPositions.length - 1; i > 0; i--) { const operatorEndPosition = this.operatorEndPositions[i]; if (operatorEndPosition == null) { continue; } expression = updateExpression( expression, this.operatorStartPositions[i], operatorEndPosition, updatedValuePart ).updatedValue; } } const startPosition = this.operatorStartPositions.length > operatorIndex ? this.operatorStartPositions[operatorIndex] : position; const endPosition = (this.operatorEndPositions.length > operatorIndex ? this.operatorEndPositions[operatorIndex] : void 0) ?? findEndPosition(expression, position, true).endPosition; return updateExpression(expression, startPosition, endPosition, updatedValuePart, true); } getNumOperators() { return this.operators.length; } getLastOperatorEndPosition() { return this.operatorEndPositions[this.operatorEndPositions.length - 1]; } parseOperator(endPosition) { const operator = this.operators.length > this.activeOperator ? this.operators[this.activeOperator] : ""; const joinOperators = this.params.advFilterExpSvc.getExpressionJoinOperators(); const parsedValue = findMatch(operator, joinOperators, (v) => v); if (parsedValue) { this.operatorEndPositions[this.activeOperator] = endPosition; const displayValue = joinOperators[parsedValue]; if (this.activeOperator) { if (parsedValue !== this.parsedOperator) { if (!this.validationError) { this.validationError = { message: this.params.advFilterExpSvc.translate( "advancedFilterValidationJoinOperatorMismatch" ), startPosition: endPosition - operator.length + 1, endPosition }; } return false; } } else { this.parsedOperator = parsedValue; } if (operator !== displayValue) { checkAndUpdateExpression(this.params, operator, displayValue, endPosition); this.operators[this.activeOperator] = displayValue; } return true; } else if (parsedValue === null) { return false; } else { if (!this.validationError) { this.validationError = { message: this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidJoinOperator"), startPosition: endPosition - operator.length + 1, endPosition }; } return true; } } }; var JoinFilterExpressionParser = class _JoinFilterExpressionParser { constructor(params, startPosition) { this.params = params; this.startPosition = startPosition; this.expectingExpression = true; this.expectingOperator = false; this.expressionParsers = []; this.operatorParser = new OperatorParser2(this.params); this.missingEndBracket = false; this.extraEndBracket = false; } parseExpression() { let i = this.startPosition; const { expression } = this.params; while (i < expression.length) { const char = expression[i]; if (char === "(" && !this.expectingOperator) { const nestedParser = new _JoinFilterExpressionParser(this.params, i + 1); i = nestedParser.parseExpression(); this.expressionParsers.push(nestedParser); this.expectingExpression = false; this.expectingOperator = true; } else if (char === ")") { this.endPosition = i - 1; if (this.startPosition === 0) { this.extraEndBracket = true; } return i; } else if (char === " ") { } else if (this.expectingExpression) { const nestedParser = new ColFilterExpressionParser(this.params, i); i = nestedParser.parseExpression(); this.expressionParsers.push(nestedParser); this.expectingExpression = false; this.expectingOperator = true; } else if (this.expectingOperator) { i = this.operatorParser.parseExpression(i); this.expectingOperator = false; this.expectingExpression = true; } i++; } if (this.startPosition > 0) { this.missingEndBracket = true; } return i; } isValid() { return !this.missingEndBracket && !this.extraEndBracket && this.expressionParsers.length === this.operatorParser.getNumOperators() + 1 && this.operatorParser.isValid() && this.expressionParsers.every((expressionParser) => expressionParser.isValid()); } getValidationError() { const operatorError = this.operatorParser.getValidationError(); for (let i = 0; i < this.expressionParsers.length; i++) { const expressionError = this.expressionParsers[i].getValidationError(); if (expressionError) { return operatorError && operatorError.startPosition < expressionError.startPosition ? operatorError : expressionError; } } if (operatorError) { return operatorError; } if (this.extraEndBracket) { return { message: this.params.advFilterExpSvc.translate("advancedFilterValidationExtraEndBracket"), startPosition: this.endPosition + 1, endPosition: this.endPosition + 1 }; } let translateKey; if (this.expressionParsers.length === this.operatorParser.getNumOperators()) { translateKey = "advancedFilterValidationMissingCondition"; } else if (this.missingEndBracket) { translateKey = "advancedFilterValidationMissingEndBracket"; } if (translateKey) { return { message: this.params.advFilterExpSvc.translate(translateKey), startPosition: this.params.expression.length, endPosition: this.params.expression.length }; } return null; } getFunction(params) { const operator = this.operatorParser.getFunction(); const funcs = this.expressionParsers.map((expressionParser) => expressionParser.getFunction(params)); const arrayFunc = operator === "&&" ? "every" : "some"; return (expressionProxy, node, p) => funcs[arrayFunc]((func) => func(expressionProxy, node, p)); } getAutocompleteListParams(position) { if (this.endPosition != null && position > this.endPosition + 1) { return void 0; } if (!this.expressionParsers.length) { return this.getColumnAutocompleteListParams(); } const expressionParserIndex = this.getExpressionParserIndex(position); if (expressionParserIndex == null) { if (this.params.expression[position] === "(") { return { enabled: false }; } return this.getColumnAutocompleteListParams(); } const expressionParser = this.expressionParsers[expressionParserIndex]; const autocompleteType = expressionParser.getAutocompleteListParams(position); if (!autocompleteType) { if (expressionParserIndex < this.expressionParsers.length - 1) { return this.operatorParser.getAutocompleteListParams(position, expressionParserIndex); } if (this.expressionParsers.length === this.operatorParser.getNumOperators()) { const operatorEndPosition = this.operatorParser.getLastOperatorEndPosition(); return operatorEndPosition == null || position <= operatorEndPosition + 1 ? this.operatorParser.getAutocompleteListParams(position, this.operatorParser.getNumOperators() - 1) : this.getColumnAutocompleteListParams(); } if (this.params.expression[position - 1] === ")") { return { enabled: false }; } return this.operatorParser.getAutocompleteListParams(position); } return autocompleteType; } updateExpression(position, updateEntry, type) { const expression = this.params.expression; const expressionParserIndex = this.getExpressionParserIndex(position); if (expressionParserIndex == null) { const updatedValuePart = type === "column" ? this.params.advFilterExpSvc.getColumnValue(updateEntry) : updateEntry.displayValue ?? updateEntry.key; return updateExpression(expression, this.startPosition, this.startPosition, updatedValuePart, true); } const expressionParser = this.expressionParsers[expressionParserIndex]; const updatedExpression = expressionParser.updateExpression(position, updateEntry, type); if (updatedExpression == null) { if (type === "column") { return updateExpression( expression, position, expression.length - 1, this.params.advFilterExpSvc.getColumnValue(updateEntry), true ); } else if (this.endPosition != null && position > this.endPosition + 1) { return null; } else { return this.operatorParser.updateExpression(position, updateEntry, expressionParserIndex); } } return updatedExpression; } getModel() { if (this.expressionParsers.length > 1) { return { filterType: "join", type: this.operatorParser.getModel(), conditions: this.expressionParsers.map((parser) => parser.getModel()) }; } else { return this.expressionParsers[0].getModel(); } } getColumnAutocompleteListParams() { return this.params.advFilterExpSvc.generateAutocompleteListParams( this.params.advFilterExpSvc.getColumnAutocompleteEntries(), "column", "" ); } getExpressionParserIndex(position) { let expressionParserIndex; for (let i = 0; i < this.expressionParsers.length; i++) { const expressionParserToCheck = this.expressionParsers[i]; if (expressionParserToCheck.startPosition > position) { break; } expressionParserIndex = i; } return expressionParserIndex; } }; // packages/ag-grid-enterprise/src/advancedFilter/filterExpressionParser.ts var FilterExpressionParser = class { constructor(params) { this.params = params; this.valid = false; } parseExpression() { this.joinExpressionParser = new JoinFilterExpressionParser(this.params, 0); const i = this.joinExpressionParser.parseExpression(); this.valid = i >= this.params.expression.length - 1 && this.joinExpressionParser.isValid(); return this.params.expression; } isValid() { return this.valid; } getValidationMessage() { const error = this.joinExpressionParser.getValidationError(); if (!error) { return null; } const { message, startPosition, endPosition } = error; return startPosition < this.params.expression.length ? this.params.advFilterExpSvc.translate("advancedFilterValidationMessage", [ message, this.params.expression.slice(startPosition, endPosition + 1).trim() ]) : this.params.advFilterExpSvc.translate("advancedFilterValidationMessageAtEnd", [message]); } getFunction() { const params = this.createFunctionParams(); return { expressionFunction: this.joinExpressionParser.getFunction(params), params }; } getAutocompleteListParams(position) { return this.joinExpressionParser.getAutocompleteListParams(position) ?? { enabled: false }; } updateExpression(position, updateEntry, type) { return this.joinExpressionParser.updateExpression(position, updateEntry, type); } getModel() { return this.isValid() ? this.joinExpressionParser.getModel() : null; } createFunctionParams() { return { operands: [], operators: [], evaluatorParams: [] }; } }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterService.ts var AdvancedFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "advancedFilter"; this.appliedExpression = null; /** The value displayed in the input, which may be invalid */ this.expression = null; this.isValid = true; } wireBeans(beans) { this.valueSvc = beans.valueSvc; this.colModel = beans.colModel; this.dataTypeSvc = beans.dataTypeSvc; this.advFilterExpSvc = beans.advFilterExpSvc; this.filterValueSvc = beans.filterValueSvc; this.filterManager = beans.filterManager; } postConstruct() { this.setEnabled(this.gos.get("enableAdvancedFilter"), true); this.ctrl = this.createManagedBean(new AdvancedFilterCtrl(this.enabled)); this.expressionProxy = { getValue: (colId, node) => { const column = this.colModel.getColDefCol(colId); return column ? this.filterValueSvc.getValue(column, node) : void 0; } }; this.addManagedPropertyListener("enableAdvancedFilter", (event) => this.setEnabled(!!event.currentValue)); this.addManagedEventListeners({ newColumnsLoaded: (event) => this.onNewColumnsLoaded(event) }); this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter", () => { const updatedValidity = this.updateValidity(); if (updatedValidity) { this.filterManager?.onFilterChanged({ source: "advancedFilter" }); } }); } isEnabled() { return this.enabled; } isFilterPresent() { return !!this.expressionFunction; } doesFilterPass(node) { return this.expressionFunction(this.expressionProxy, node, this.expressionParams); } getModel() { const expressionParser = this.createExpressionParser(this.appliedExpression); expressionParser?.parseExpression(); return expressionParser?.getModel() ?? null; } setModel(model) { const parseModel = (model2, isFirstParent) => { if (model2.filterType === "join") { const operator = this.advFilterExpSvc.parseJoinOperator(model2); const expression2 = model2.conditions.map((condition) => parseModel(condition)).filter((condition) => _exists(condition)).join(` ${operator} `); return isFirstParent || model2.conditions.length <= 1 ? expression2 : `(${expression2})`; } else { return this.advFilterExpSvc.parseColumnFilterModel(model2); } }; const expression = model ? parseModel(model, true) : null; this.setExpressionDisplayValue(expression); this.applyExpression(); this.ctrl.refreshComp(); this.ctrl.refreshBuilderComp(); } getExpressionDisplayValue() { return this.expression; } setExpressionDisplayValue(expression) { this.expression = expression; } isCurrentExpressionApplied() { return this.appliedExpression === this.expression; } createExpressionParser(expression) { if (!expression) { return null; } return new FilterExpressionParser({ expression, colModel: this.colModel, dataTypeSvc: this.dataTypeSvc, valueSvc: this.valueSvc, advFilterExpSvc: this.advFilterExpSvc }); } getDefaultExpression(updateEntry) { const updatedValue = this.advFilterExpSvc.getColumnValue(updateEntry) + " "; return { updatedValue, updatedPosition: updatedValue.length }; } isHeaderActive() { return !this.gos.get("advancedFilterParent"); } getCtrl() { return this.ctrl; } setEnabled(enabled, silent) { const previousValue = this.enabled; const isValidRowModel = _isClientSideRowModel(this.gos) || _isServerSideRowModel(this.gos); if (enabled && !isValidRowModel) { _warn(123); } this.enabled = enabled && isValidRowModel; if (!silent && this.enabled !== previousValue) { this.eventSvc.dispatchEvent({ type: "advancedFilterEnabledChanged", enabled: this.enabled }); } } applyExpression() { const expressionParser = this.createExpressionParser(this.expression); expressionParser?.parseExpression(); this.applyExpressionFromParser(expressionParser); } getAppliedExpressionDisplayValue() { return this.appliedExpression; } applyExpressionFromParser(expressionParser) { this.isValid = !expressionParser || expressionParser.isValid(); if (!expressionParser || !this.isValid) { this.expressionFunction = null; this.expressionParams = null; this.appliedExpression = null; return; } const { expressionFunction, params } = expressionParser.getFunction(); this.expressionFunction = expressionFunction; this.expressionParams = params; this.appliedExpression = this.expression; } updateValidity() { this.advFilterExpSvc.resetColumnCaches(); const expressionParser = this.createExpressionParser(this.expression); expressionParser?.parseExpression(); const isValid = !expressionParser || expressionParser.isValid(); const updatedValidity = isValid !== this.isValid; this.applyExpressionFromParser(expressionParser); this.ctrl.refreshComp(); this.ctrl.refreshBuilderComp(); return updatedValidity; } onNewColumnsLoaded(event) { if (event.source !== "gridInitializing" || !this.dataTypeSvc?.isPendingInference) { return; } this.ctrl.setInputDisabled(true); const [destroyFunc] = this.addManagedEventListeners({ dataTypesInferred: () => { destroyFunc?.(); this.ctrl.setInputDisabled(false); } }); } }; // packages/ag-grid-enterprise/src/advancedFilter/advancedFilterModule.ts var AdvancedFilterModule = { moduleName: "AdvancedFilter", version: VERSION2, beans: [AdvancedFilterService, AdvancedFilterExpressionService], icons: { // Builder button in Advanced Filter advancedFilterBuilder: "group", // drag handle used to pick up Advanced Filter Builder rows advancedFilterBuilderDrag: "grip", // Advanced Filter Builder row validation error advancedFilterBuilderInvalid: "not-allowed", // shown on Advanced Filter Builder rows to move them up advancedFilterBuilderMoveUp: "up", // shown on Advanced Filter Builder rows to move them down advancedFilterBuilderMoveDown: "down", // shown on Advanced Filter Builder rows to add new rows advancedFilterBuilderAdd: "plus", // shown on Advanced Filter Builder rows to remove row advancedFilterBuilderRemove: "minus", // shown on Advanced Filter Builder selection pills advancedFilterBuilderSelectOpen: "small-down", // remove for rich select editor pills richSelectRemove: "cancel", // loading async values richSelectLoading: "loading" }, apiFunctions: { getAdvancedFilterModel, setAdvancedFilterModel, showAdvancedFilterBuilder, hideAdvancedFilterBuilder }, dependsOn: [ EnterpriseCoreModule, FilterCoreModule, SharedDragAndDropModule, PopupModule, FilterValueModule, TooltipModule ], css: [advanced_filter_default] }; // packages/ag-grid-enterprise/src/aiToolkit/schemaBuilder.ts var BaseSchemaBuilder = class { constructor(description) { this._defs = {}; this._nullable = false; this.description = description; } _collectNestedDefs(schemas) { const allDefs = { ...this._defs }; for (const schema of schemas) { if (schema && typeof schema === "object" && "$defs" in schema) { Object.assign(allDefs, schema.$defs); delete schema.$defs; } } return allDefs; } _toJSON(additionalProperties = {}) { const result = { type: this._nullable ? [this.type, "null"] : this.type, description: this.description, ...additionalProperties }; if (Object.keys(this._defs).length > 0) { result.$defs = this._defs; } return result; } nullable() { this._nullable = true; return this; } define(id, schema) { this._defs[id] = schema; return this; } }; var StringSchemaBuilder = class extends BaseSchemaBuilder { constructor(descriptionOrOptions) { super(typeof descriptionOrOptions === "string" ? descriptionOrOptions : descriptionOrOptions?.description); this.type = "string"; if (typeof descriptionOrOptions === "object" && descriptionOrOptions) { this._pattern = descriptionOrOptions.pattern; this._format = descriptionOrOptions.format; } } pattern(input) { this._pattern = input; return this; } format(input) { this._format = input; return this; } toJSON() { return this._toJSON({ pattern: this._pattern, format: this._format }); } }; var NumberSchemaBuilder = class extends BaseSchemaBuilder { constructor(descriptionOrOptions) { super(typeof descriptionOrOptions === "string" ? descriptionOrOptions : descriptionOrOptions?.description); this.type = "number"; if (typeof descriptionOrOptions === "object" && descriptionOrOptions) { this._minimum = descriptionOrOptions.minimum; this._maximum = descriptionOrOptions.maximum; this._exclusiveMinimum = descriptionOrOptions.exclusiveMinimum; this._exclusiveMaximum = descriptionOrOptions.exclusiveMaximum; this._multipleOf = descriptionOrOptions.multipleOf; } } minimum(value) { this._minimum = value; return this; } exclusiveMinimum(value) { this._exclusiveMinimum = value; return this; } maximum(value) { this._maximum = value; return this; } exclusiveMaximum(value) { this._exclusiveMaximum = value; return this; } multipleOf(value) { this._multipleOf = value; return this; } toJSON() { return this._toJSON({ minimum: this._minimum, exclusiveMinimum: this._exclusiveMinimum, maximum: this._maximum, exclusiveMaximum: this._exclusiveMaximum, multipleOf: this._multipleOf }); } }; var EnumSchemaBuilder = class extends BaseSchemaBuilder { constructor(_enum, description) { super(description); this._enum = _enum; this.type = "string"; } toJSON() { return this._toJSON({ enum: this._enum }); } }; var LiteralSchemaBuilder = class extends EnumSchemaBuilder { constructor(value, description) { super([value], description); } }; var BooleanSchemaBuilder = class extends BaseSchemaBuilder { constructor(description) { super(description); this.type = "boolean"; } toJSON() { return this._toJSON(); } }; var ArraySchemaBuilder = class extends BaseSchemaBuilder { constructor(items, descriptionOrOptions) { super(typeof descriptionOrOptions === "string" ? descriptionOrOptions : descriptionOrOptions?.description); this.items = items; this.type = "array"; if (typeof descriptionOrOptions === "object" && descriptionOrOptions) { this._minItems = descriptionOrOptions.minItems; this._maxItems = descriptionOrOptions.maxItems; } } minItems(value) { this._minItems = value; return this; } maxItems(value) { this._maxItems = value; return this; } toJSON() { const itemsSchema = this.items.toJSON(); const allDefs = this._collectNestedDefs([itemsSchema]); this._defs = allDefs; return this._toJSON({ items: itemsSchema, minItems: this._minItems, maxItems: this._maxItems }); } }; var ObjectSchemaBuilder = class extends BaseSchemaBuilder { constructor(properties, description) { super(description); this.properties = properties; this.type = "object"; } toJSON() { const propertySchemas = Object.fromEntries( Object.keys(this.properties).map((key) => [key, this.properties[key].toJSON()]) ); const allDefs = this._collectNestedDefs(Object.values(propertySchemas)); this._defs = allDefs; return this._toJSON({ required: Object.keys(this.properties), additionalProperties: false, properties: propertySchemas }); } }; var UnionSchemaBuilder = class { constructor(schemas, description) { this.schemas = schemas; this._nullable = false; this._defs = {}; this.description = description; } nullable() { this._nullable = true; return this; } define(id, schema) { this._defs[id] = schema; return this; } _collectNestedDefs(schemas) { const allDefs = this._defs; for (const schema of schemas) { if (schema && typeof schema === "object" && "$defs" in schema) { Object.assign(allDefs, schema.$defs); delete schema.$defs; } } return allDefs; } toJSON() { const schemaJsons = this.schemas.map((x) => x.toJSON()); const allDefs = this._collectNestedDefs(schemaJsons); const result = { anyOf: this._nullable ? [...schemaJsons, { type: "null" }] : schemaJsons }; if (this.description) { result.description = this.description; } if (Object.keys(allDefs).length > 0) { result.$defs = allDefs; } return result; } }; var ReferenceSchemaBuilder = class { constructor(id) { this.id = id; } nullable() { return this; } toJSON() { return { $ref: `#/$defs/${this.id}` }; } }; var s = { string: (descriptionOrOptions) => new StringSchemaBuilder(descriptionOrOptions), number: (descriptionOrOptions) => new NumberSchemaBuilder(descriptionOrOptions), enum: (values, description) => new EnumSchemaBuilder(values, description), boolean: (description) => new BooleanSchemaBuilder(description), array: (items, descriptionOrOptions) => new ArraySchemaBuilder(items, descriptionOrOptions), object: (properties, description) => new ObjectSchemaBuilder(properties, description), union: (schemas, description) => new UnionSchemaBuilder(schemas, description), literal: (value, description) => new LiteralSchemaBuilder(value, description), ref: (id) => new ReferenceSchemaBuilder(id) }; // packages/ag-grid-enterprise/src/aiToolkit/features/aggregationFeatureSchema.ts var buildAggregationFeatureSchema = (beans) => { const { aggFuncSvc } = beans; if (!aggFuncSvc) { return; } const columns = beans.colModel.getCols(); const aggregatableColumns = columns.filter((col) => col.isAllowValue() && aggFuncSvc.getFuncNames(col).length > 0); if (aggregatableColumns.length === 0) { return; } return s.object( { aggregationModel: s.array( s.union( aggregatableColumns.map( (col) => s.object({ colId: s.literal(col.getColId(), "Column identifier"), aggFunc: s.enum(beans.aggFuncSvc?.getFuncNames(col) || [], "Aggregation function") }) ) ), "Array of column aggregations" ) }, "Aggregation configuration for the grid" ).nullable(); }; // packages/ag-grid-enterprise/src/aiToolkit/features/columnSizingFeatureSchema.ts var buildColumnSizingFeatureSchema = (beans) => { const columns = beans.colModel.getCols(); const resizableColumns = columns.filter((col) => col.isResizable()); if (resizableColumns.length === 0) { return; } const resizableColumnIds = resizableColumns.map((col) => col.getColId()); return s.object( { columnSizingModel: s.array( s.union([ s.object({ colId: s.ref("resizableColumnId"), width: s.number("Fixed width in pixels").minimum(20) }), s.object({ colId: s.ref("resizableColumnId"), flex: s.number("Flex sizing ratio").minimum(0) }) ]), "Array of column sizing configurations" ) }, "Column sizing configuration for the grid" ).define("resizableColumnId", s.enum(resizableColumnIds, "Column ID that supports resizing")); }; // packages/ag-grid-enterprise/src/aiToolkit/features/columnVisibilityFeatureSchema.ts var buildColumnVisibilityFeatureSchema = () => { return s.object( { hiddenColIds: s.array(s.ref("allColumnIds"), "Array of column IDs to hide") }, "Column visibility configuration for the grid" ).nullable(); }; // packages/ag-grid-enterprise/src/aiToolkit/features/advancedFilterFeatureSchema.ts var buildAdvancedFilterFeatureSchema = ({ colModel, dataTypeSvc }) => { if (!dataTypeSvc) { return; } const columns = colModel.getCols(); const dataTypes = { boolean: [], object: [], date: [], dateString: [], dateTime: [], dateTimeString: [], number: [], bigint: [], text: [] }; for (const col of columns) { const dataType = dataTypeSvc.getBaseDataType(col); if (dataType) { dataTypes[dataType].push(col.colId); } } const columnFilterModels = []; const defs = {}; for (const key of Object.keys(dataTypes)) { if (dataTypes[key].length > 0) { const ref = `${key}AdvancedFilterModel`; const builder = DataTypeSchemaBuilders[key]; defs[ref] = builder(dataTypes[key]); columnFilterModels.push({ $ref: `#/$defs/${ref}` }); } } defs.joinAdvancedFilterModel = s.object({ filterType: s.literal("join", "Filter type identifier for joining multiple advanced filter conditions"), type: s.enum(["AND", "OR"], "Logical operator to combine multiple advanced filter conditions"), conditions: s.array(s.ref("advancedFilterModel"), "Array of advanced filter conditions to be combined") }); defs.advancedFilterModel = { anyOf: [...columnFilterModels, { $ref: "#/$defs/joinAdvancedFilterModel" }] }; return s.object( { advancedFilterModel: s.ref("advancedFilterModel") }, "Advanced filter configuration for the grid" ).nullable(); }; var buildBooleanFilterSchema = (colIds) => { return s.object({ filterType: s.literal("boolean", "Filter type identifier for boolean column filters"), colId: s.enum(colIds, "Column identifier for the boolean column to filter"), type: s.enum(["true", "false"], "Boolean value to filter by") }); }; var buildObjectFilterSchema = (colIds) => { return s.object({ filterType: s.literal("object", "Filter type identifier for object column filters"), colId: s.enum(colIds, "Column identifier for the object column to filter"), filter: s.string("Filter value to compare against object column values").nullable(), type: s.enum( ["equals", "notEqual", "contains", "notContains", "startsWith", "endsWith", "blank", "notBlank"], "Object filter operation type" ) }); }; var buildDateFilterSchema = (colIds) => { return s.object({ filterType: s.literal("date", "Filter type identifier for date column filters"), colId: s.enum(colIds, "Column identifier for the date column to filter"), filter: s.string({ pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "Date value in YYYY-MM-DD format" }).nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "Date filter operation type" ) }); }; var buildDateStringFilterSchema = (colIds) => { return s.object({ filterType: s.literal("date", "Filter type identifier for date string column filters"), colId: s.enum(colIds, "Column identifier for the date string column to filter"), filter: s.string({ pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "Date value in YYYY-MM-DD format" }).nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "Date string filter operation type" ) }); }; var buildDateTimeFilterSchema = (colIds) => { return s.object({ filterType: s.literal("dateTime", "Filter type identifier for datetime column filters"), colId: s.enum(colIds, "Column identifier for the datetime column to filter"), filter: s.string({ pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$", description: "DateTime value in YYYY-MM-DDTHH:mm:ss format" }).nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "DateTime filter operation type" ) }); }; var buildDateTimeStringFilterSchema = (colIds) => { return s.object({ filterType: s.literal("dateTimeString", "Filter type identifier for datetime string column filters"), colId: s.enum(colIds, "Column identifier for the datetime string column to filter"), filter: s.string({ pattern: "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$", description: "DateTime value in YYYY-MM-DD HH:mm:ss format" }).nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "DateTime string filter operation type" ) }); }; var buildNumberFilterSchema = (colIds) => { return s.object({ filterType: s.literal("number", "Filter type identifier for number column filters"), colId: s.enum(colIds, "Column identifier for the number column to filter"), filter: s.number("Numeric value to filter by").nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "Number filter operation type" ) }); }; var buildBigIntFilterSchema = (colIds) => { return s.object({ filterType: s.literal("bigint", "Filter type identifier for bigint column filters"), colId: s.enum(colIds, "Column identifier for the bigint column to filter"), filter: s.string({ pattern: "^-?\\d+$", description: "BigInt value to filter by" }).nullable(), type: s.enum( [ "equals", "notEqual", "lessThan", "lessThanOrEqual", "greaterThan", "greaterThanOrEqual", "blank", "notBlank" ], "BigInt filter operation type" ) }); }; var buildTextFilterSchema = (colIds) => { return s.object({ filterType: s.literal("text", "Filter type identifier for text column filters"), colId: s.enum(colIds, "Column identifier for the text column to filter"), filter: s.string("Text value to filter by").nullable(), type: s.enum( ["equals", "notEqual", "contains", "notContains", "startsWith", "endsWith", "blank", "notBlank"], "Text filter operation type" ) }); }; var DataTypeSchemaBuilders = { boolean: buildBooleanFilterSchema, object: buildObjectFilterSchema, date: buildDateFilterSchema, dateString: buildDateStringFilterSchema, dateTime: buildDateTimeFilterSchema, dateTimeString: buildDateTimeStringFilterSchema, number: buildNumberFilterSchema, bigint: buildBigIntFilterSchema, text: buildTextFilterSchema }; // packages/ag-grid-enterprise/src/aiToolkit/features/filterFeatureSchema.ts var TextFilterKey = "agTextColumnFilter"; var NumberFilterKey = "agNumberColumnFilter"; var DateFilterKey = "agDateColumnFilter"; var SetFilterKey = "agSetColumnFilter"; var MultiFilterKey = "agMultiColumnFilter"; var SimpleFilterKeys = [TextFilterKey, NumberFilterKey, DateFilterKey]; var buildFilterFeatureSchema = (beans, params) => { const { advancedFilter } = beans; if (advancedFilter?.isEnabled()) { return buildAdvancedFilterFeatureSchema(beans); } else { return buildColumnFilterFeatureSchema(beans, params); } }; var buildColumnFilterFeatureSchema = (beans, params) => { const { gos, colFilter, colModel } = beans; if (!colFilter) { return; } const columns = colModel.getCols(); const filterableColumns = columns.filter((col) => col.isFilterAllowed()); if (filterableColumns.length === 0) { return; } const filterSchemas = {}; const enableFilterHandlers = gos.get("enableFilterHandlers"); for (const column of filterableColumns) { const columnParams = params?.columns ? params.columns[column.getColId()] : void 0; const colDef = column.getColDef(); const defaultFilter = colFilter.getDefaultFilter(column); const includeSetValues = columnParams?.includeSetValues ?? false; const filter = buildColumnFilterSchema( colDef.filter, colDef.filterParams, defaultFilter, (isMulti = false, multiIndex = 0) => { if (!includeSetValues) { return []; } let handler = void 0; if (!isMulti) { handler = colFilter.getHandler(column, true); } else if (enableFilterHandlers) { const multiHandler = colFilter.getHandler(column, true); handler = multiHandler.getHandler(multiIndex); } if (!handler) { return []; } return handler.getFilterKeys(); } ); if (filter) { filterSchemas[column.colId] = filter.nullable(); } } return s.object({ filterModel: s.object(filterSchemas) }).nullable(); }; function buildColumnFilterSchema(filter, filterParams, defaultFilter, getKeys) { let filterKey = void 0; if (typeof filter === "string") { filterKey = filter; } else if (typeof filter === "object" && typeof filter.component === "string") { filterKey = filter.component; } else if (filter === true || typeof filter === "object" && filter.component === true) { filterKey = defaultFilter; } if (!filterKey) { return null; } if (SimpleFilterKeys.includes(filterKey)) { const maxConditions = filterParams?.maxNumConditions; const filterOptions = filterParams?.filterOptions ? filterParams.filterOptions.map((option) => { if (typeof option === "string") { return option; } if (typeof option === "object" && option.displayKey) { return option.displayKey; } return null; }).filter(Boolean) : void 0; const useIsoSeparator = filterParams?.useIsoSeparator || false; return buildSimpleFilterSchema(filterKey, { maxConditions, filterOptions, useIsoSeparator }); } else if (filterKey === SetFilterKey) { return buildSetFilterSchema(getKeys); } else if (filterKey === MultiFilterKey) { return buildMultiFilterSchema(filterParams.filters, defaultFilter, getKeys); } return null; } var buildSimpleFilterSchema = (filterKey, params) => { if (filterKey === DateFilterKey) { return buildDateFilterSchema2(params); } else if (filterKey === NumberFilterKey) { return buildNumberFilterSchema2(params); } else { return buildTextFilterSchema2(params); } }; var buildJoinSchema = (schema, filterType, maxConditions = 2) => { if (maxConditions === 1) { return schema; } return s.object({ filterType: s.literal(filterType, `Filter type identifier for ${filterType} filters with multiple conditions`), operator: s.enum( ["AND", "OR"], "Logical operator to combine multiple filter conditions. Must be included even with a single filter to adhere to the API." ), conditions: s.array(schema, "Array of filter conditions to be combined").minItems(2).maxItems(maxConditions) }); }; var buildTextFilterSchema2 = (params) => { const options = params.filterOptions ?? [ "contains", "notContains", "equals", "notEqual", "startsWith", "endsWith", "blank", "notBlank" ]; const schema = s.object({ filterType: s.literal("text", "Filter type identifier for text filters"), type: s.enum(options, "Text filter operation type"), filter: s.string("Primary filter value").nullable(), filterTo: s.string("Secondary filter value for range operations").nullable() }); return buildJoinSchema(schema, "text", params.maxConditions); }; var buildNumberFilterSchema2 = (params) => { const options = params.filterOptions ?? [ "equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "blank", "notBlank" ]; const schema = s.object({ filterType: s.literal("number", "Filter type identifier for number filters"), type: s.enum(options, "Number filter operation type"), filter: s.number("Primary filter value").nullable(), filterTo: s.number("Secondary filter value for range operations").nullable() }); return buildJoinSchema(schema, "number", params.maxConditions); }; var buildDateFilterSchema2 = (params) => { const options = params.filterOptions ?? [ "equals", "notEqual", "lessThan", "greaterThan", "inRange", "blank", "notBlank" ]; const pattern = params.useIsoSeparator ? "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$" : "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"; const schema = s.object({ filterType: s.literal("date", "Filter type identifier for date filters"), type: s.enum(options, "Date filter operation type"), dateFrom: s.string({ pattern, description: "Primary date filter value in YYYY-MM-DD HH:mm:ss format" }).nullable(), dateTo: s.string({ pattern, description: "Secondary date filter value for range operations in YYYY-MM-DD HH:mm:ss format" }).nullable() }); return buildJoinSchema(schema, "date", params.maxConditions); }; var buildSetFilterSchema = (getKeys) => { const values = getKeys ? getKeys().filter(Boolean) : []; return s.object({ filterType: s.literal("set", "Filter type identifier for set filters"), values: s.array( values.length > 0 ? s.enum(values, "Available values to filter by") : s.string("Filter values"), "Array of values to include in the filter" ) }); }; var buildMultiFilterSchema = (filters, defaultFilter, getKeys = () => []) => { return s.object({ filterType: s.literal("multi", "Filter type identifier for multi-condition filters"), filterModels: s.array( s.union( filters.map( (filter, index) => buildColumnFilterSchema( filter.filter, filter.filterParams, defaultFilter, () => getKeys(true, index) ) ), "Union of different filter types that can be combined" ).nullable(), "Array of filter conditions to be combined with AND/OR logic" ) }); }; // packages/ag-grid-enterprise/src/aiToolkit/features/pivotFeatureSchema.ts var buildPivotFeatureSchema = (beans) => { const columns = beans.colModel.getCols(); const pivotableColumnIds = columns.filter((col) => col.isAllowPivot()).map((col) => col.getColId()); if (pivotableColumnIds.length === 0) { return; } return s.object( { pivotMode: s.boolean("Whether pivot mode is enabled"), pivotColIds: s.array( s.enum(pivotableColumnIds, "Column ID that supports pivoting"), "Array of column IDs to use as pivot columns" ) }, "Pivot configuration for the grid" ).nullable(); }; // packages/ag-grid-enterprise/src/aiToolkit/features/rowGroupFeatureSchema.ts var buildRowGroupFeatureSchema = (beans) => { const columns = beans.colModel.getCols(); const groupableColumns = columns.filter((col) => col.isAllowRowGroup()); if (groupableColumns.length === 0) { return; } const groupableColumnIds = groupableColumns.map((col) => col.getColId()); return s.object( { groupColIds: s.array( s.enum(groupableColumnIds, "Column ID that supports row grouping"), "Array of column IDs to group by" ) }, "Row grouping configuration for the grid" ); }; // packages/ag-grid-enterprise/src/aiToolkit/features/sortFeatureSchema.ts var buildSortFeatureSchema = (beans) => { const { sortSvc } = beans; if (!sortSvc) { return; } const columns = beans.colModel.getCols(); const sortableColumns = columns.filter((col) => col.isSortable()); if (sortableColumns.length === 0) { return; } const sortableColumnIds = sortableColumns.map((col) => col.getColId()); return s.object( { sortModel: s.array( s.object({ colId: s.enum(sortableColumnIds, "Column ID that supports sorting"), sort: s.enum(["asc", "desc"], "Sort direction: ascending or descending"), type: s.enum(["default", "absolute"], "Sort type: default or absolute values") }), "Array of sort configurations" ) }, "Sort configuration for the grid" ).nullable(); }; // packages/ag-grid-enterprise/src/aiToolkit/structuredSchema.ts var StructuredSchemaBuilderMap = { aggregation: buildAggregationFeatureSchema, filter: buildFilterFeatureSchema, sort: buildSortFeatureSchema, pivot: buildPivotFeatureSchema, columnVisibility: buildColumnVisibilityFeatureSchema, columnSizing: buildColumnSizingFeatureSchema, rowGroup: buildRowGroupFeatureSchema }; function getStructuredSchema(beans, params) { const allColumnIds = beans.colModel.getCols().map((col) => col.getColId()); const features = {}; for (const feature of STRUCTURED_SCHEMA_FEATURES) { if (params?.exclude?.includes(feature)) { continue; } const builder = StructuredSchemaBuilderMap[feature]; const schema2 = builder(beans, params); if (schema2) { features[feature] = schema2.nullable(); } } const columnParams = params?.columns ?? {}; const descriptions = allColumnIds.map((colId) => { if (columnParams[colId]?.description) { return `${colId}: ${columnParams[colId].description}`; } else { return colId; } }).filter(Boolean).join("\n"); const schema = s.object(features).define("allColumnIds", s.enum(allColumnIds, descriptions)); return schema.toJSON(); } // packages/ag-grid-enterprise/src/aiToolkit/aiToolkitModule.ts var AiToolkitModule = { moduleName: "AiToolkit", version: VERSION2, beans: [], dependsOn: [EnterpriseCoreModule, ColumnApiModule], apiFunctions: { getStructuredSchema } }; // packages/ag-grid-enterprise/src/sideBar/sideBarApi.ts function isSideBarVisible(beans) { return beans.sideBar?.comp.isDisplayed() ?? false; } function setSideBarVisible(beans, show) { beans.sideBar?.comp.setDisplayed(show); } function setSideBarPosition(beans, position) { beans.sideBar?.comp.setSideBarPosition(position); } function openToolPanel(beans, key, parent) { beans.sideBar?.comp.openToolPanel(key, "api", parent); } function closeToolPanel(beans) { beans.sideBar?.comp.close("api"); } function getOpenedToolPanel(beans) { return beans.sideBar?.comp.openedItem() ?? null; } function refreshToolPanel(beans) { beans.sideBar?.comp.refresh(); } function isToolPanelShowing(beans) { return beans.sideBar?.comp.isToolPanelShowing() ?? false; } function getToolPanelInstance(beans, id) { const comp = beans.sideBar?.comp.getToolPanelInstance(id); return _unwrapUserComp(comp); } function getSideBar(beans) { return beans.sideBar?.comp.getDef(); } // packages/ag-grid-enterprise/src/sideBar/agSideBar.css var agSideBar_default = '.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{\n /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}'; // packages/ag-grid-enterprise/src/sideBar/sideBarButtonComp.ts var SideBarButtonElement = { tag: "div", cls: "ag-side-button", role: "presentation", children: [ { tag: "button", ref: "eToggleButton", cls: "ag-button ag-side-button-button", role: "tab", attrs: { type: "button", tabindex: "-1", "aria-expanded": "false" }, children: [ { tag: "div", ref: "eIconWrapper", cls: "ag-side-button-icon-wrapper", attrs: { "aria-hidden": "true" } }, { tag: "span", ref: "eLabel", cls: "ag-side-button-label" } ] } ] }; var SideBarButtonComp = class extends Component { constructor(toolPanelDef) { super(); this.toolPanelDef = toolPanelDef; this.eToggleButton = RefPlaceholder; this.eIconWrapper = RefPlaceholder; this.eLabel = RefPlaceholder; } getToolPanelId() { return this.toolPanelDef.id; } postConstruct() { this.setTemplate(SideBarButtonElement, []); this.setLabel(); this.setIcon(); this.addManagedElementListeners(this.eToggleButton, { click: this.onButtonPressed.bind(this) }); this.eToggleButton.setAttribute("id", `ag-${this.getCompId()}-button`); } setLabel() { const def = this.toolPanelDef; const label = this.getLocaleTextFunc()(def.labelKey, def.labelDefault); this.eLabel.textContent = label; } setIcon() { this.eIconWrapper.insertAdjacentElement( "afterbegin", _createIconNoSpan(this.toolPanelDef.iconKey, this.beans) ); } onButtonPressed() { this.dispatchLocalEvent({ type: "toggleButtonClicked" }); } setSelected(selected) { this.toggleCss("ag-selected", selected); _setAriaExpanded(this.eToggleButton, selected); } }; // packages/ag-grid-enterprise/src/sideBar/agSideBarButtons.ts var SideBarElement = { tag: "div", cls: "ag-side-buttons", role: "tablist" }; var AgSideBarButtons = class extends Component { constructor() { super(SideBarElement); this.buttonComps = []; } postConstruct() { this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) }); } handleKeyDown(e) { if (e.key !== KeyCode.TAB || !e.shiftKey) { return; } if (_focusNextGridCoreContainer(this.beans, true)) { e.preventDefault(); return; } _stopPropagationForAgGrid(e); } setActiveButton(id) { for (const comp of this.buttonComps) { comp.setSelected(id === comp.getToolPanelId()); } } addButtonComp(def) { const buttonComp = this.createBean(new SideBarButtonComp(def)); this.buttonComps.push(buttonComp); this.appendChild(buttonComp); buttonComp.addEventListener("toggleButtonClicked", () => { this.dispatchLocalEvent({ type: "sideBarButtonClicked", toolPanelId: def.id }); }); return buttonComp; } clearButtons() { this.buttonComps = this.destroyBeans(this.buttonComps); _clearElement(this.getGui()); } destroy() { this.clearButtons(); super.destroy(); } }; var AgSideBarButtonsSelector = { selector: "AG-SIDE-BAR-BUTTONS", component: AgSideBarButtons }; // packages/ag-grid-enterprise/src/sideBar/sideBarDefParser.ts var DEFAULT_COLUMN_COMP = { id: "columns", labelDefault: "Columns", labelKey: "columns", iconKey: "columnsToolPanel", toolPanel: "agColumnsToolPanel" }; var DEFAULT_FILTER_COMP = { id: "filters", labelDefault: "Filters", labelKey: "filters", iconKey: "filtersToolPanel", toolPanel: "agFiltersToolPanel" }; var DEFAULT_NEW_FILTER_COMP = { id: "filters-new", labelDefault: "Filters", labelKey: "filters", iconKey: "filtersToolPanel", toolPanel: "agNewFiltersToolPanel" }; var DEFAULT_BY_KEY = { columns: DEFAULT_COLUMN_COMP, filters: DEFAULT_FILTER_COMP, "filters-new": DEFAULT_NEW_FILTER_COMP }; function parseSideBarDef(toParse) { if (!toParse) { return void 0; } if (toParse === true) { return { toolPanels: [DEFAULT_COLUMN_COMP, DEFAULT_FILTER_COMP], defaultToolPanel: "columns" }; } if (typeof toParse === "string") { return parseSideBarDef([toParse]); } if (Array.isArray(toParse)) { const comps = []; for (const key of toParse) { const lookupResult = DEFAULT_BY_KEY[key]; if (!lookupResult) { _warn(215, { key, defaultByKey: DEFAULT_BY_KEY }); continue; } comps.push(lookupResult); } if (comps.length === 0) { return void 0; } return { toolPanels: comps, defaultToolPanel: comps[0].id }; } return { toolPanels: parseComponents(toParse.toolPanels), defaultToolPanel: toParse.defaultToolPanel, hiddenByDefault: toParse.hiddenByDefault, position: toParse.position, hideButtons: toParse.hideButtons }; } function parseComponents(from) { const result = []; if (!from) { return result; } from.forEach((it) => { const parsed = parseOneComponent(it); if (!parsed) { return; } result.push(parsed); }); return result; } function parseOneComponent(it) { if (typeof it !== "string") { return it; } if (DEFAULT_BY_KEY[it]) { return DEFAULT_BY_KEY[it]; } _warn(215, { key: it, defaultByKey: DEFAULT_BY_KEY }); return null; } // packages/ag-grid-enterprise/src/sideBar/agHorizontalResize.ts var AgHorizontalResize = class extends Component { constructor() { super({ tag: "div", cls: "ag-tool-panel-horizontal-resize" }); this.minWidth = 100; this.maxWidth = null; } postConstruct() { const finishedWithResizeFunc = this.beans.horizontalResizeSvc.addResizeBar({ eResizeBar: this.getGui(), dragStartPixels: 1, onResizeStart: this.onResizeStart.bind(this), onResizing: this.onResizing.bind(this), onResizeEnd: this.onResizeEnd.bind(this) }); this.addDestroyFunc(finishedWithResizeFunc); this.inverted = this.gos.get("enableRtl"); } dispatchResizeEvent(start, end, width) { this.eventSvc.dispatchEvent({ type: "toolPanelSizeChanged", width, started: start, ended: end }); } onResizeStart() { this.startingWidth = this.elementToResize.offsetWidth; this.dispatchResizeEvent(true, false, this.startingWidth); } onResizeEnd(delta) { return this.onResizing(delta, true); } onResizing(delta, isEnd = false) { const direction = this.inverted ? -1 : 1; let newWidth = Math.max(this.minWidth, Math.floor(this.startingWidth - delta * direction)); if (this.maxWidth != null) { newWidth = Math.min(this.maxWidth, newWidth); } this.elementToResize.style.setProperty("--ag-horizontal-size", `${newWidth}px`); this.dispatchResizeEvent(false, isEnd, newWidth); } }; // packages/ag-grid-enterprise/src/sideBar/toolPanelWrapper.ts function getToolPanelCompDetails(userCompFactory, toolPanelDef, params) { return userCompFactory.getCompDetails(toolPanelDef, ToolPanelComponent, void 0, params, true); } var ToolPanelComponent = { name: "toolPanel", optionalMethods: ["refresh", "getState"] }; var ToolPanelElement = { tag: "div", cls: "ag-tool-panel-wrapper", role: "tabpanel", children: [ { tag: "div", cls: "ag-tool-panel-content", ref: "eContent" } ] }; var ToolPanelWrapper = class extends Component { constructor() { super(ToolPanelElement); this.eContent = RefPlaceholder; this.animationId = 0; this.defParent = null; } postConstruct() { const eGui = this.getGui(); const resizeBar = this.resizeBar = this.createManagedBean(new AgHorizontalResize()); eGui.setAttribute("id", `ag-${this.getCompId()}`); resizeBar.elementToResize = eGui; this.appendChild(resizeBar); } getToolPanelId() { return this.toolPanelId; } getDefParent() { return this.defParent; } setDefParent(parent) { this.defParent = parent; } setToolPanelDef(toolPanelDef, params) { const { id, minWidth, maxWidth, width, parent } = toolPanelDef; this.toolPanelId = id; this.defParent = parent ?? null; if (width) { this.getGui().style.setProperty("--ag-side-bar-panel-width", `${width}px`); } const compDetails = getToolPanelCompDetails(this.beans.userCompFactory, toolPanelDef, params); if (compDetails == null) { return false; } const componentPromise = compDetails.newAgStackInstance(); this.params = compDetails.params; componentPromise.then(this.setToolPanelComponent.bind(this)); const resizeBar = this.resizeBar; if (minWidth != null) { resizeBar.minWidth = minWidth; } if (maxWidth != null) { resizeBar.maxWidth = maxWidth; } return true; } setToolPanelComponent(compInstance) { this.toolPanelCompInstance = compInstance; const { eContent } = this; eContent.appendChild(compInstance.getGui()); this.addDestroyFunc(() => { this.destroyBean(compInstance); }); } getToolPanelInstance() { return this.toolPanelCompInstance; } setResizerSizerSide(side) { const isRtl = this.gos.get("enableRtl"); const isLeft = side === "left"; const inverted = isRtl ? isLeft : !isLeft; this.resizeBar.inverted = inverted; } refresh() { this.toolPanelCompInstance?.refresh(this.params); } animateDisplayed(displayed) { if (this.isDisplayed() === displayed) { return; } const id = ++this.animationId; const { eContent } = this; const cleanup2 = () => { if (this.animationId === id) { eGui.classList.remove("ag-tool-panel-animating"); eContent.style.width = ""; eGui.style.width = ""; } }; const eGui = this.getGui(); const currentWrapperWidth = eGui.offsetWidth; this.setDisplayed(displayed); eGui.classList.add("ag-tool-panel-animating"); const durationStr = getComputedStyle(eGui).transitionDuration; if (!parseFloat(durationStr)) { cleanup2(); return; } eGui.style.transition = "none"; eGui.style.width = ""; eContent.style.width = `${eContent.offsetWidth}px`; eGui.style.width = `${currentWrapperWidth}px`; const _ = eGui.offsetWidth; eGui.style.transition = ""; eGui.style.width = displayed ? "" : "0"; const fallbackTimeout = setTimeout(cleanup2, 100); eGui.addEventListener("transitionstart", () => clearTimeout(fallbackTimeout), { once: true }); eGui.addEventListener("transitionend", cleanup2, { once: true }); } }; // packages/ag-grid-enterprise/src/sideBar/agSideBar.ts var AgSideBarElement = { tag: "div", cls: "ag-side-bar ag-unselectable", children: [ { tag: "ag-side-bar-buttons", ref: "sideBarButtons" } ] }; var AgSideBar = class extends Component { constructor() { super(AgSideBarElement, [AgSideBarButtonsSelector]); this.sideBarButtons = RefPlaceholder; this.toolPanelWrappers = []; this.registerCSS(agSideBar_default); } postConstruct() { this.sideBarButtons.addEventListener("sideBarButtonClicked", this.onToolPanelButtonClicked.bind(this)); const { beans, gos } = this; const { sideBar: sideBarState } = gos.get("initialState") ?? {}; this.setSideBarDef({ sideBarDef: parseSideBarDef(gos.get("sideBar")), sideBarState }); this.addManagedPropertyListener("sideBar", () => this.setState()); beans.sideBar.comp = this; const eGui = this.getFocusableElement(); this.createManagedBean( new ManagedFocusFeature(eGui, { onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this) }) ); _addFocusableContainerListener(beans, this, eGui); this.addManagedPropertyListener("enableAdvancedFilter", this.onAdvancedFilterChanged.bind(this)); } getFocusableContainerName() { return "sideBar"; } onTabKeyDown(e) { if (e.defaultPrevented) { return; } const { beans, sideBarButtons } = this; const eGui = this.getGui(); const sideBarGui = sideBarButtons.getGui(); const activeElement = _getActiveDomElement(beans); const openPanel = eGui.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"); const target = e.target; const backwards = e.shiftKey; if (!openPanel) { if (_focusNextGridCoreContainer(beans, backwards, true)) { e.preventDefault(); return true; } _skipFocusableContainerListenerForAgGrid(e); return false; } if (sideBarGui.contains(activeElement)) { if (_focusInto(openPanel, backwards)) { e.preventDefault(); } return; } if (!backwards) { return; } let nextEl = null; if (openPanel.contains(activeElement)) { nextEl = _findNextFocusableElement(beans, openPanel, void 0, true); } else if (isTargetUnderManagedComponent(openPanel, target)) { nextEl = findFocusableElementBeforeTabGuard(openPanel, target); } if (!nextEl) { nextEl = sideBarGui.querySelector(".ag-selected button"); nextEl = _isVisible(nextEl) ? nextEl : null; } if (nextEl && nextEl !== e.target) { e.preventDefault(); nextEl.focus(); } } handleKeyDown(e) { const currentButton = _getActiveDomElement(this.beans); const sideBarButtons = this.sideBarButtons; if (!sideBarButtons.getGui().contains(currentButton)) { return; } const sideBarGui = sideBarButtons.getGui(); const buttons = Array.prototype.slice.call(sideBarGui.querySelectorAll(".ag-side-button")); const currentPos = buttons.findIndex((button) => button.contains(currentButton)); let nextPos = null; switch (e.key) { case KeyCode.LEFT: case KeyCode.UP: nextPos = Math.max(0, currentPos - 1); break; case KeyCode.RIGHT: case KeyCode.DOWN: nextPos = Math.min(currentPos + 1, buttons.length - 1); break; } if (nextPos === null) { return; } const innerButton = buttons[nextPos].querySelector("button"); if (innerButton) { innerButton.focus(); e.preventDefault(); } } onToolPanelButtonClicked(event) { const id = event.toolPanelId; const openedItem = this.openedItem(); if (openedItem === id) { this.openToolPanel(void 0, "sideBarButtonClicked"); } else { this.openToolPanel(id, "sideBarButtonClicked"); } } clearDownUi() { this.sideBarButtons.clearButtons(); this.destroyToolPanelWrappers(); } setSideBarDef({ sideBarDef, sideBarState, existingToolPanelWrappers }) { this.setDisplayed(false); this.sideBar = sideBarDef; if (sideBarDef) { this.sideBarButtons.setDisplayed(!sideBarDef.hideButtons); } if (sideBarDef?.toolPanels) { const toolPanelDefs = sideBarDef.toolPanels; this.createToolPanelsAndSideButtons(toolPanelDefs, sideBarState, existingToolPanelWrappers); if (!this.toolPanelWrappers.length) { return; } const shouldDisplaySideBar = sideBarState ? sideBarState.visible : !sideBarDef.hiddenByDefault; this.setDisplayed(shouldDisplaySideBar); this.setSideBarPosition(sideBarState ? sideBarState.position : sideBarDef.position); if (shouldDisplaySideBar) { if (sideBarState) { const { openToolPanel: openToolPanel2 } = sideBarState; if (openToolPanel2) { this.openToolPanel(openToolPanel2, "sideBarInitializing"); } } else { this.openToolPanel(sideBarDef.defaultToolPanel, "sideBarInitializing"); } } } } getDef() { return this.sideBar; } setSideBarPosition(position) { if (!position) { position = "right"; } this.position = position; const isLeft = position === "left"; const resizerSide = isLeft ? "right" : "left"; this.toggleCss("ag-side-bar-left", isLeft); this.toggleCss("ag-side-bar-right", !isLeft); for (const wrapper of this.toolPanelWrappers) { wrapper.setResizerSizerSide(resizerSide); } this.dispatchSideBarUpdated(); return this; } setDisplayed(displayed, options) { super.setDisplayed(displayed, options); this.dispatchSideBarUpdated(); } getState() { const toolPanels = {}; for (const wrapper of this.toolPanelWrappers) { toolPanels[wrapper.getToolPanelId()] = wrapper.getToolPanelInstance()?.getState?.(); } return { visible: this.isDisplayed(), position: this.position, openToolPanel: this.openedItem(), toolPanels }; } createToolPanelsAndSideButtons(defs, sideBarState, existingToolPanelWrappers) { for (const def of defs) { this.createToolPanelAndSideButton( def, sideBarState?.toolPanels?.[def.id], existingToolPanelWrappers?.[def.id] ); } } validateDef(def) { const { id, toolPanel } = def; if (id == null) { _warn(212); return false; } if (isFilterPanel(toolPanel)) { if (this.beans.filterManager?.isAdvFilterEnabled()) { _warn(213); return false; } } return true; } createToolPanelAndSideButton(def, initialState, existingToolPanelWrapper) { if (!this.validateDef(def)) { this.destroyBean(existingToolPanelWrapper); return; } let wrapper; if (existingToolPanelWrapper) { wrapper = existingToolPanelWrapper; wrapper.setDefParent(def.parent ?? null); } else { wrapper = this.createBean(new ToolPanelWrapper()); const created = wrapper.setToolPanelDef( def, _addGridCommonParams(this.gos, { initialState, onStateUpdated: () => this.dispatchSideBarUpdated() }) ); if (!created) { return; } } wrapper.setDisplayed(false); this.renderToolPanelUnderParent(wrapper, def.parent); this.toolPanelWrappers.push(wrapper); const button = this.sideBarButtons.addButtonComp(def); _setAriaControlsAndLabel(button.eToggleButton, wrapper.getGui()); } refresh() { for (const wrapper of this.toolPanelWrappers) { wrapper.refresh(); } } renderToolPanelUnderParent(wrapper, externalParent) { const wrapperGui = wrapper.getGui(); if (externalParent) { this.beans.environment.applyThemeClasses(externalParent, ["ag-external", "ag-tool-panel-external"]); wrapperGui.classList.add(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr"); } const correctParent = externalParent ?? wrapper.getDefParent() ?? this.getGui(); if (wrapperGui.parentElement !== correctParent) { correctParent.appendChild(wrapperGui); } } getWrapper(key) { return this.toolPanelWrappers.find((wrapper) => wrapper.getToolPanelId() === key); } openToolPanel(key, source = "api", parent) { const currentlyOpenedKey = this.openedItem(); const switchingToolPanel = !!key && !!currentlyOpenedKey; const skipAnimation = switchingToolPanel || source === "sideBarInitializing"; for (const wrapper of this.toolPanelWrappers) { const show = key === wrapper.getToolPanelId(); if (show) { this.renderToolPanelUnderParent(wrapper, parent ?? null); } if (skipAnimation) { wrapper.setDisplayed(show); } else { wrapper.animateDisplayed(show); } } const newlyOpenedKey = this.openedItem(); const openToolPanelChanged = currentlyOpenedKey !== newlyOpenedKey; if (openToolPanelChanged) { this.sideBarButtons.setActiveButton(key); this.raiseToolPanelVisibleEvent(key, currentlyOpenedKey ?? void 0, source); } } getToolPanelInstance(key) { const toolPanelWrapper = this.getWrapper(key); if (!toolPanelWrapper) { _warn(214, { key }); return; } return toolPanelWrapper.getToolPanelInstance(); } raiseToolPanelVisibleEvent(key, previousKey, source) { const switchingToolPanel = !!key && !!previousKey; const eventSvc = this.eventSvc; if (previousKey) { eventSvc.dispatchEvent({ type: "toolPanelVisibleChanged", source, key: previousKey, visible: false, switchingToolPanel }); } if (key) { eventSvc.dispatchEvent({ type: "toolPanelVisibleChanged", source, key, visible: true, switchingToolPanel }); } } close(source = "api") { this.openToolPanel(void 0, source); } isToolPanelShowing() { return !!this.openedItem(); } openedItem() { let activeToolPanel = null; for (const wrapper of this.toolPanelWrappers) { if (wrapper.isDisplayed()) { activeToolPanel = wrapper.getToolPanelId(); } } return activeToolPanel; } setState(sideBarState) { const sideBarDef = parseSideBarDef(this.gos.get("sideBar")); const existingToolPanelWrappers = {}; if (sideBarDef && this.sideBar) { sideBarDef.toolPanels?.forEach((toolPanelDef) => { const { id } = toolPanelDef; if (!id) { return; } const existingToolPanelDef = this.sideBar.toolPanels?.find( (toolPanelDefToCheck) => toolPanelDefToCheck.id === id ); if (!existingToolPanelDef || toolPanelDef.toolPanel !== existingToolPanelDef.toolPanel) { return; } const toolPanelWrapper = this.getWrapper(id); if (!toolPanelWrapper) { return; } const params = _addGridCommonParams(this.gos, { ...toolPanelDef.toolPanelParams ?? {}, initialState: sideBarState?.toolPanels?.[id], onStateUpdated: () => this.dispatchSideBarUpdated() }); const hasRefreshed = toolPanelWrapper.getToolPanelInstance()?.refresh(params); if (hasRefreshed !== true) { return; } this.toolPanelWrappers = this.toolPanelWrappers.filter((toolPanel) => toolPanel !== toolPanelWrapper); _removeFromParent(toolPanelWrapper.getGui()); existingToolPanelWrappers[id] = toolPanelWrapper; }); } this.clearDownUi(); this.setSideBarDef({ sideBarDef, sideBarState, existingToolPanelWrappers }); } dispatchSideBarUpdated() { this.eventSvc.dispatchEvent({ type: "sideBarUpdated" }); } destroyToolPanelWrappers() { for (const wrapper of this.toolPanelWrappers) { _removeFromParent(wrapper.getGui()); this.destroyBean(wrapper); } this.toolPanelWrappers.length = 0; } onAdvancedFilterChanged() { const needsRefresh = this.sideBar?.toolPanels?.some( (toolPanel) => isFilterPanel(typeof toolPanel === "string" ? toolPanel : toolPanel.toolPanel) ); if (needsRefresh) { this.setState(); } } destroy() { this.destroyToolPanelWrappers(); super.destroy(); } }; function isFilterPanel(toolPanel) { return toolPanel === "agFiltersToolPanel" || toolPanel === "agNewFiltersToolPanel"; } var AgSideBarSelector = { selector: "AG-SIDE-BAR", component: AgSideBar }; // packages/ag-grid-enterprise/src/sideBar/sideBarService.ts var SideBarService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "sideBar"; } getSelector() { return AgSideBarSelector; } }; // packages/ag-grid-enterprise/src/sideBar/sideBarModule.ts var SideBarModule = { moduleName: "SideBar", version: VERSION2, beans: [SideBarService], apiFunctions: { isSideBarVisible, setSideBarVisible, setSideBarPosition, openToolPanel, closeToolPanel, getOpenedToolPanel, refreshToolPanel, isToolPanelShowing, getToolPanelInstance, getSideBar }, dependsOn: [EnterpriseCoreModule, HorizontalResizeModule] }; // packages/ag-grid-enterprise/src/widgets/menu.css var menu_default = '.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}'; // packages/ag-grid-enterprise/src/widgets/menuItemRenderer.ts var MenuItemRenderer = class extends AgMenuItemRenderer { constructor() { super({ warnNoIcon: () => _warn(227) }); } }; // packages/ag-grid-enterprise/src/widgets/menuItemModule.ts var MenuItemModule = { moduleName: "MenuItem", version: VERSION2, userComponents: { agMenuItem: MenuItemRenderer }, icons: { // indicates the currently active pin state in the "Pin column" sub-menu of the column menu check: "tick", // icon for sub menu item subMenuOpen: "small-right", // version of subMenuOpen used in RTL mode subMenuOpenRtl: "small-left" }, css: [menu_default] }; // packages/ag-grid-enterprise/src/columnToolPanel/agPrimaryCols.css var agPrimaryCols_default = ".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}"; // packages/ag-grid-enterprise/src/columnToolPanel/agPrimaryColsHeader.ts var DEBOUNCE_DELAY = 300; var AgPrimaryColsHeaderElement = { tag: "div", cls: "ag-column-select-header", role: "presentation", children: [ { tag: "div", ref: "eExpand", cls: "ag-column-select-header-icon" }, { tag: "ag-checkbox", ref: "eSelect", cls: "ag-column-select-header-checkbox" }, { tag: "ag-input-text-field", ref: "eFilterTextField", cls: "ag-column-select-header-filter-wrapper" } ] }; var AgPrimaryColsHeader = class extends Component { constructor() { super(AgPrimaryColsHeaderElement, [AgCheckboxSelector, AgInputTextFieldSelector]); this.eExpand = RefPlaceholder; this.eSelect = RefPlaceholder; this.eFilterTextField = RefPlaceholder; } postConstruct() { this.createExpandIcons(); this.addManagedListeners(this.eExpand, { click: this.onExpandClicked.bind(this), keydown: (e) => { if (e.key === KeyCode.SPACE) { e.preventDefault(); this.onExpandClicked(); } } }); this.addManagedElementListeners(this.eSelect.getInputElement(), { click: this.onSelectClicked.bind(this) }); this.addManagedPropertyListener("functionsReadOnly", () => this.onFunctionsReadOnlyPropChanged()); this.eFilterTextField.setAutoComplete(false).onValueChange(() => this.onFilterTextChanged()); this.addManagedEventListeners({ newColumnsLoaded: this.showOrHideOptions.bind(this) }); const translate = this.getLocaleTextFunc(); this.eSelect.setInputAriaLabel(translate("ariaColumnSelectAll", "Toggle All Columns Visibility")); this.eFilterTextField.setInputAriaLabel(translate("ariaFilterColumnsInput", "Filter Columns Input")); this.activateTabIndex([this.eExpand]); } onFunctionsReadOnlyPropChanged() { const readOnly = this.gos.get("functionsReadOnly"); this.eSelect.setReadOnly(readOnly); this.eSelect.toggleCss("ag-column-select-column-readonly", readOnly); } init(params) { this.params = params; const readOnly = this.gos.get("functionsReadOnly"); this.eSelect.setReadOnly(readOnly); this.eSelect.toggleCss("ag-column-select-column-readonly", readOnly); if (this.beans.colModel.ready) { this.showOrHideOptions(); } } createExpandIcons() { const beans = this.beans; this.eExpand.appendChild(this.eExpandChecked = _createIconNoSpan("columnSelectOpen", beans)); this.eExpand.appendChild(this.eExpandUnchecked = _createIconNoSpan("columnSelectClosed", beans)); this.eExpand.appendChild(this.eExpandIndeterminate = _createIconNoSpan("columnSelectIndeterminate", beans)); this.setExpandState(0 /* EXPANDED */); } // we only show expand / collapse if we are showing columns showOrHideOptions() { const params = this.params; const showFilter = !params.suppressColumnFilter; const showSelect = !params.suppressColumnSelectAll; const showExpand = !params.suppressColumnExpandAll; const groupsPresent = !!this.beans.colModel.colDefCols?.treeDepth; const translate = this.getLocaleTextFunc(); this.eFilterTextField.setInputPlaceholder(translate("searchOoo", "Search...")); _setDisplayed(this.eFilterTextField.getGui(), showFilter); _setDisplayed(this.eSelect.getGui(), showSelect); _setDisplayed(this.eExpand, showExpand && groupsPresent); } onFilterTextChanged() { if (!this.onFilterTextChangedDebounced) { this.onFilterTextChangedDebounced = _debounce( this, () => { const filterText = this.eFilterTextField.getValue(); this.dispatchLocalEvent({ type: "filterChanged", filterText }); }, DEBOUNCE_DELAY ); } this.onFilterTextChangedDebounced(); } onSelectClicked() { this.dispatchLocalEvent({ type: this.selectState ? "unselectAll" : "selectAll" }); } onExpandClicked() { this.dispatchLocalEvent({ type: this.expandState === 0 /* EXPANDED */ ? "collapseAll" : "expandAll" }); } setExpandState(state) { this.expandState = state; _setDisplayed(this.eExpandChecked, state === 0 /* EXPANDED */); _setDisplayed(this.eExpandUnchecked, state === 1 /* COLLAPSED */); _setDisplayed(this.eExpandIndeterminate, state === 2 /* INDETERMINATE */); } setSelectionState(state) { this.selectState = state; this.eSelect.setValue(this.selectState); } }; var AgPrimaryColsHeaderSelector = { selector: "AG-PRIMARY-COLS-HEADER", component: AgPrimaryColsHeader }; // packages/ag-grid-enterprise/src/sideBar/common/sideBarUtils.ts function isColGroupDef(colDef) { return !!colDef && typeof colDef.children !== "undefined"; } function getId(colDef) { return isColGroupDef(colDef) ? colDef.groupId : colDef.colId; } function addChildrenToGroup(tree, groupId, colDef) { const subGroupIsSplit = (currentSubGroup, currentSubGroupToAdd) => { const existingChildIds = currentSubGroup.children.map(getId); const childGroupAlreadyExists = existingChildIds.includes(getId(currentSubGroupToAdd)); const lastChild = _last(currentSubGroup.children); const lastChildIsDifferent = lastChild && getId(lastChild) !== getId(currentSubGroupToAdd); return childGroupAlreadyExists && lastChildIsDifferent; }; if (!isColGroupDef(tree)) { return true; } const currentGroup = tree; const groupToAdd = colDef; if (subGroupIsSplit(currentGroup, groupToAdd)) { currentGroup.children.push(groupToAdd); return true; } if (currentGroup.groupId === groupId) { const existingChildIds = currentGroup.children.map(getId); const colDefAlreadyPresent = existingChildIds.includes(getId(groupToAdd)); if (!colDefAlreadyPresent) { currentGroup.children.push(groupToAdd); return true; } } for (let i = currentGroup.children.length - 1; i >= 0; i--) { if (addChildrenToGroup(currentGroup.children[i], groupId, colDef)) { break; } } return false; } function mergeLeafPathTrees(leafPathTrees) { const matchingRootGroupIds = (pathA, pathB) => { const bothPathsAreGroups = isColGroupDef(pathA) && isColGroupDef(pathB); return bothPathsAreGroups && getId(pathA) === getId(pathB); }; const mergeTrees = (treeA, treeB) => { if (!isColGroupDef(treeB)) { return treeA; } const mergeResult = treeA; const groupToMerge = treeB; if (groupToMerge.children && groupToMerge.groupId) { const added = addChildrenToGroup(mergeResult, groupToMerge.groupId, groupToMerge.children[0]); if (added) { return mergeResult; } } for (const child of groupToMerge.children) { mergeTrees(mergeResult, child); } return mergeResult; }; const mergeColDefs = []; for (let i = 1; i <= leafPathTrees.length; i++) { const first = leafPathTrees[i - 1]; const second = leafPathTrees[i]; if (matchingRootGroupIds(first, second)) { leafPathTrees[i] = mergeTrees(first, second); } else { mergeColDefs.push(first); } } return mergeColDefs; } // packages/ag-grid-enterprise/src/sideBar/common/toolPanelColDefService.ts function toolPanelCreateColumnTree(colModel, colDefs) { const invalidColIds = []; const createDummyColGroup = (abstractColDef, depth) => { if (isColGroupDef(abstractColDef)) { const groupDef = abstractColDef; const groupId = typeof groupDef.groupId !== "undefined" ? groupDef.groupId : groupDef.headerName; const group = new AgProvidedColumnGroup(groupDef, groupId, false, depth); const children = []; for (const def of groupDef.children) { const child = createDummyColGroup(def, depth + 1); if (child) { children.push(child); } } group.setChildren(children); return group; } else { const colDef = abstractColDef; const key = colDef.colId ? colDef.colId : colDef.field; const column = colModel.getColDefCol(key); if (!column) { invalidColIds.push(colDef); } return column; } }; const mappedResults = []; for (const colDef of colDefs) { const result = createDummyColGroup(colDef, 0); if (result) { mappedResults.push(result); } } if (invalidColIds.length > 0) { _warn(217, { invalidColIds }); } return mappedResults; } function syncLayoutWithGrid(colModel, syncLayoutCallback) { const leafPathTrees = getLeafPathTrees(getGridPrimaryColumns(colModel)); const mergedColumnTrees = mergeLeafPathTrees(leafPathTrees); syncLayoutCallback(mergedColumnTrees); } function syncLayoutWithColumns(columns, syncLayoutCallback) { const leafPathTrees = getLeafPathTrees(columns); const mergedColumnTrees = mergeLeafPathTrees(leafPathTrees); syncLayoutCallback(mergedColumnTrees); } function getLeafPathTrees(columns) { const getLeafPathTree = (node, childDef) => { let leafPathTree; if (isProvidedColumnGroup(node)) { if (node.isPadding()) { leafPathTree = childDef; } else { const groupDef = Object.assign({}, node.getColGroupDef()); groupDef.groupId = node.getGroupId(); groupDef.children = [childDef]; leafPathTree = groupDef; } } else { const colDef = Object.assign({}, node.getColDef()); colDef.colId = node.getColId(); leafPathTree = colDef; } const parent = node.getOriginalParent(); if (parent) { return getLeafPathTree(parent, leafPathTree); } else { return leafPathTree; } }; return columns.map((col) => getLeafPathTree(col, col.getColDef())); } function getGridPrimaryColumns(colModel) { return colModel.getCols().filter((column) => { const colDef = column.getColDef(); return column.isPrimary() && !colDef.showRowGroup; }); } // packages/ag-grid-enterprise/src/columnToolPanel/columnModelItem.ts var ColumnModelItem = class { constructor(displayName, columnOrGroup, depth, group = false, expanded) { this.displayName = displayName; this.depth = depth; this.group = group; this.localEventService = new LocalEventService(); if (group) { this.columnGroup = columnOrGroup; this._expanded = expanded; this.children = []; } else { this.column = columnOrGroup; } } get expanded() { return !!this._expanded; } set expanded(expanded) { if (expanded === this._expanded) { return; } this._expanded = expanded; this.localEventService.dispatchEvent({ type: "expandedChanged" }); } addEventListener(eventType, listener) { this.localEventService.addEventListener(eventType, listener); } removeEventListener(eventType, listener) { this.localEventService.removeEventListener(eventType, listener); } }; // packages/ag-grid-enterprise/src/columnToolPanel/toolPanelDeferredUiUtils.ts function isDeferredMode(params) { return !!params?.buttons?.includes("apply"); } function refreshDeferredToolPanelUi(beans, params) { if (!isDeferredMode(params)) { return; } const openedPanelId = beans.sideBar?.comp.openedItem(); if (!openedPanelId) { return; } const toolPanel = beans.sideBar?.comp.getToolPanelInstance(openedPanelId); toolPanel?.refreshDeferredUi(); } // packages/ag-grid-enterprise/src/columnToolPanel/modelItemUtils.ts function selectAllChildren(beans, colTree, selectAllChecked, eventType, params) { const cols = extractAllLeafColumns(colTree); setAllColumns(beans, cols, selectAllChecked, eventType, params); } function setAllColumns(beans, cols, selectAllChecked, eventType, params) { const updateStrategy = beans.columnStateUpdateStrategy; const isPivotMode2 = updateStrategy.getPivotMode(isDeferredMode(params)); if (isPivotMode2) { setAllPivot(beans, cols, selectAllChecked, eventType, params); } else { setAllVisible(beans, cols, selectAllChecked, eventType, params); } } function extractAllLeafColumns(allItems) { const res = []; const recursiveFunc = (items) => { for (const item of items) { if (!item.passesFilter) { continue; } if (item.group) { recursiveFunc(item.children); } else { res.push(item.column); } } }; recursiveFunc(allItems); return res; } function setAllVisible(beans, columns, visible, eventType, params) { const updateStrategy = beans.columnStateUpdateStrategy; const colStateItems = []; for (const col of columns) { if (col.getColDef().lockVisible) { continue; } if (updateStrategy.isColumnVisibleInToolPanel(isDeferredMode(params), col) !== visible) { colStateItems.push({ colId: col.getId(), hide: !visible }); } } updateStrategy.applyColumnState(isDeferredMode(params), colStateItems, eventType); refreshDeferredToolPanelUi(beans, params); } function setAllPivot(beans, columns, value, eventType, params) { setAllPivotActive(beans, columns, value, eventType, params); } function setAllPivotActive(beans, columns, value, eventType, params) { const updateStrategy = beans.columnStateUpdateStrategy; const colStateItems = []; const turnOnAction = (col) => { if (updateStrategy.isColumnSelectedInPivotModeToolPanel(isDeferredMode(params), col)) { return; } if (col.isAllowValue()) { const aggFunc = typeof col.getAggFunc() === "string" ? col.getAggFunc() : beans.aggFuncSvc?.getDefaultAggFunc(col); colStateItems.push({ colId: col.getId(), aggFunc }); } else if (col.isAllowRowGroup()) { colStateItems.push({ colId: col.getId(), rowGroup: true }); } else if (col.isAllowPivot()) { colStateItems.push({ colId: col.getId(), pivot: true }); } }; const turnOffAction = (col) => { const isActive = updateStrategy.isColumnSelectedInPivotModeToolPanel(isDeferredMode(params), col); if (isActive) { colStateItems.push({ colId: col.getId(), pivot: false, rowGroup: false, aggFunc: null }); } }; const action = value ? turnOnAction : turnOffAction; columns.forEach(action); updateStrategy.applyColumnState(isDeferredMode(params), colStateItems, eventType); refreshDeferredToolPanelUi(beans, params); } function updateColumns(beans, params) { const { columns, visibleState, pivotState, eventType } = params; const updateStrategy = beans.columnStateUpdateStrategy; const isPivotMode2 = updateStrategy.getPivotMode(isDeferredMode(params)); const state = columns.map((column) => { const colId = column.getColId(); if (isPivotMode2) { const pivotStateForColumn = pivotState?.[colId]; return { colId, pivot: pivotStateForColumn?.pivot, rowGroup: pivotStateForColumn?.rowGroup, aggFunc: pivotStateForColumn?.aggFunc }; } else { return { colId, hide: !visibleState?.[colId] }; } }); updateStrategy.applyColumnState(isDeferredMode(params), state, eventType); refreshDeferredToolPanelUi(beans, params); } function createPivotState(column) { return { pivot: column.isPivotActive(), rowGroup: column.isRowGroupActive(), aggFunc: column.isValueActive() ? column.getAggFunc() : void 0 }; } function createPivotStateForToolPanel(column, updateStrategy, deferApply) { if (!deferApply) { return createPivotState(column); } const rowGroup = updateStrategy.getRowGroupColumns(deferApply).includes(column); const pivot = updateStrategy.getPivotColumns(deferApply).includes(column); const value = updateStrategy.getValueColumns(deferApply).includes(column); return { pivot, rowGroup, aggFunc: value ? updateStrategy.getColumnAggFunc(deferApply, column) : void 0 }; } // packages/ag-grid-enterprise/src/aggregation/aggDataUtils.ts var getNodesFromMappedSet = (mappedSet, keys) => { if (!keys) { return []; } let mapPointer = mappedSet; for (let i = 0, len = keys.length; i < len && mapPointer; ++i) { mapPointer = mapPointer[keys[i]]; } return Array.isArray(mapPointer) ? mapPointer : []; }; var setAggData = (rowNode, newAggData, colModel) => { const oldAggData = rowNode.aggData; if (oldAggData === newAggData) { return; } rowNode.aggData = newAggData; if (rowNode.__localEventService) { fireAggDataChangedEvents(rowNode, oldAggData, newAggData, colModel); } }; var setAggDataWithSiblings = (rowNode, newAggData, colModel) => { setAggData(rowNode, newAggData, colModel); const pinnedSibling = rowNode.pinnedSibling; if (pinnedSibling) { setAggData(pinnedSibling, newAggData, colModel); } const sibling = rowNode.sibling; if (sibling) { setAggData(sibling, newAggData, colModel); const siblingPinnedSibling = sibling.pinnedSibling; if (siblingPinnedSibling) { setAggData(siblingPinnedSibling, newAggData, colModel); } } }; var fireAggDataChangedEvents = (rowNode, oldAggData, newAggData, colModel) => { if (!newAggData) { if (!oldAggData) { return; } const oldKeys2 = Object.keys(oldAggData); for (let i = 0, len = oldKeys2.length; i < len; ++i) { const colId = oldKeys2[i]; const column = colModel.getColById(colId); if (column) { rowNode.dispatchCellChangedEvent(column, void 0, oldAggData[colId]); } } return; } const newKeys = Object.keys(newAggData); for (let i = 0, len = newKeys.length; i < len; ++i) { const colId = newKeys[i]; const value = newAggData[colId]; const oldValue = oldAggData ? oldAggData[colId] : void 0; if (value === oldValue) { continue; } const column = colModel.getColById(colId); if (column) { rowNode.dispatchCellChangedEvent(column, value, oldValue); } } if (!oldAggData) { return; } const oldKeys = Object.keys(oldAggData); for (let i = 0, len = oldKeys.length; i < len; ++i) { const colId = oldKeys[i]; if (colId in newAggData) { continue; } const column = colModel.getColById(colId); if (column) { rowNode.dispatchCellChangedEvent(column, void 0, oldAggData[colId]); } } }; // packages/ag-grid-enterprise/src/rowGrouping/rowGroupingUtils.ts var setRowNodeGroupValue = (rowNode, colModel, colKey, newValue) => { const column = colModel.getCol(colKey); let groupData = rowNode._groupData; if (!groupData) { groupData = {}; rowNode._groupData = groupData; } const columnId = column.getColId(); const oldValue = groupData[columnId]; if (oldValue === newValue) { return; } groupData[columnId] = newValue; rowNode.dispatchCellChangedEvent(column, newValue, oldValue); }; var doSetRowNodeGroup = (rowNode, beans, group) => { if (!rowNode) { return; } const oldGroup = rowNode.group; if (oldGroup === group) { return; } rowNode.group = group; rowNode.updateHasChildren(); if (oldGroup && !group) { setAggData(rowNode, null, beans.colModel); rowNode.setAllChildrenCount(null); } beans.selectionSvc?.updateRowSelectable(rowNode); rowNode.dispatchRowEvent("groupChanged"); }; var setRowNodeGroup = (rowNode, beans, group) => { doSetRowNodeGroup(rowNode, beans, group); doSetRowNodeGroup(rowNode.pinnedSibling, beans, group); }; var isRowGroupColLocked = (column, beans) => { const { gos, rowGroupColsSvc } = beans; if (!rowGroupColsSvc || !column) { return false; } const groupLockGroupColumns = gos.get("groupLockGroupColumns"); if (!column.isRowGroupActive() || groupLockGroupColumns === 0) { return false; } if (groupLockGroupColumns === -1) { return true; } const colIndex = rowGroupColsSvc.columns.findIndex((groupCol) => groupCol.getColId() === column.getColId()); return groupLockGroupColumns > colIndex; }; var getGroupingLocaleText = (localeTextFunc, key, displayName) => { const prefix = key === "groupBy" ? "Group by" : "Un-Group by"; const localStr = localeTextFunc(key, `${prefix} ${displayName}`, [displayName]); if (localStr.indexOf(displayName) >= 0) { return localStr; } else { return `${localStr} ${displayName}`; } }; // packages/ag-grid-enterprise/src/misc/enterpriseDomUtils.ts function _getTextSelectionRanges(beans) { const rootNode = _getRootNode(beans); const selection = "getSelection" in rootNode ? rootNode.getSelection() : null; const ranges = []; for (let i = 0; i < (selection?.rangeCount ?? 0); i++) { const range = selection?.getRangeAt(i); if (range) { ranges.push(range); } } return { selection, ranges }; } function _preserveRangesWhile(beans, fn) { const enableCellTextSelection = beans.gos.get("enableCellTextSelection"); if (!enableCellTextSelection) { return fn(); } if (!_isBrowserFirefox() && !_isBrowserSafari()) { return fn(); } const { selection, ranges } = _getTextSelectionRanges(beans); fn(); selection?.removeAllRanges(); for (const range of ranges) { selection?.addRange(range); } } // packages/ag-grid-enterprise/src/widgets/menuItemComponent.ts var MenuItemComponentType = { name: "menuItem", optionalMethods: ["setActive", "select", "setExpanded", "configureDefaults"] }; var MENU_ITEM_CALLBACKS = { getMenuItemComp: (beans, def, params) => { const compDetails = beans.userCompFactory.getCompDetails( def, MenuItemComponentType, "agMenuItem", _addGridCommonParams(beans.gos, params), true ); return compDetails?.newAgStackInstance() ?? AgPromise.resolve(); }, getPostProcessPopupParams: ({ column, node }) => ({ column, rowNode: node }), preserveRangesWhile: _preserveRangesWhile, stopPropagationCallbacks: STOP_PROPAGATION_CALLBACKS, warnNoItem: (menuItemOrString) => { _warn(228, { menuItemOrString }); } }; var MenuItemComponent = class extends AgMenuItemComponent { constructor() { super(MENU_ITEM_CALLBACKS); } }; // packages/ag-grid-enterprise/src/widgets/menuList.ts var MenuList = class extends AgMenuList { constructor(level, menuActionParams = { column: null, node: null, value: null }) { super(level, menuActionParams, MENU_ITEM_CALLBACKS); } }; // packages/ag-grid-enterprise/src/columnToolPanel/toolPanelContextMenu.ts var ToolPanelContextMenu = class extends Component { constructor(column, mouseEventOrTouch, parentEl, params = {}) { super({ tag: "div", cls: "ag-menu" }); this.column = column; this.mouseEventOrTouch = mouseEventOrTouch; this.parentEl = parentEl; this.params = params; this.displayName = null; } postConstruct() { const { column, beans: { colNames } } = this; this.initializeProperties(column); let displayName; if (isColumn(column)) { displayName = colNames.getDisplayNameForColumn(column, "columnToolPanel"); } else { displayName = colNames.getDisplayNameForProvidedColumnGroup(null, column, "columnToolPanel"); } this.displayName = displayName; this.buildMenuItemMap(); if (this.isActive()) { const mouseEventOrTouch = this.mouseEventOrTouch; if ("preventDefault" in mouseEventOrTouch) { mouseEventOrTouch.preventDefault(); } const menuItemsMapped = this.getMappedMenuItems(); if (menuItemsMapped.length === 0) { return; } this.displayContextMenu(menuItemsMapped); } } initializeProperties(column) { const updateStrategy = this.beans.columnStateUpdateStrategy; let columns; if (isProvidedColumnGroup(column)) { columns = column.getLeafColumns(); } else { columns = [column]; } this.columns = columns; const isPivotMode2 = updateStrategy.getPivotMode(isDeferredMode(this.params)); this.allowScrollIntoView = !isPivotMode2 && columns.some(this.isColumnValidForScrollIntoView); this.allowGrouping = columns.some((col) => col.isPrimary() && col.isAllowRowGroup()); this.allowValues = columns.some((col) => col.isPrimary() && col.isAllowValue()); this.allowPivoting = isPivotMode2 && columns.some((col) => col.isPrimary() && col.isAllowPivot()); } buildMenuItemMap() { const localeTextFunc = this.getLocaleTextFunc(); const { beans, displayName } = this; const updateStrategy = this.beans.columnStateUpdateStrategy; const menuItemMap = /* @__PURE__ */ new Map(); this.menuItemMap = menuItemMap; const deferMode = isDeferredMode(this.params); const isPivotMode2 = updateStrategy.getPivotMode(deferMode); const rowGroupColIdSet = new Set( updateStrategy.getRowGroupColumns(deferMode).map((col) => col.getColId()) ); const valueColIdSet = new Set(updateStrategy.getValueColumns(deferMode).map((col) => col.getColId())); const pivotColIdSet = new Set(updateStrategy.getPivotColumns(deferMode).map((col) => col.getColId())); menuItemMap.set("scrollIntoView", { allowedFunction: (col) => !col.isPinned() && !isPivotMode2 && this.isColumnValidForScrollIntoView(col), activeFunction: () => false, activateLabel: () => localeTextFunc("scrollColumnIntoView", `Scroll ${displayName} into View`, [displayName]), activateFunction: () => { const firstVisibleColumn = this.columns.find(this.isColumnValidForScrollIntoView); if (firstVisibleColumn) { this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(firstVisibleColumn); } }, deActivateFunction: () => { }, addIcon: "ensureColumnVisible" }); const rowGroupAllowed = (col) => col.isPrimary() && col.isAllowRowGroup() && !isRowGroupColLocked(col, beans); menuItemMap.set("rowGroup", { allowedFunction: rowGroupAllowed, activeFunction: (col) => rowGroupColIdSet.has(col.getColId()), activateLabel: () => getGroupingLocaleText(localeTextFunc, "groupBy", displayName), deactivateLabel: () => getGroupingLocaleText(localeTextFunc, "ungroupBy", displayName), activateFunction: () => { const columns = this.addColumnsToList(updateStrategy.getRowGroupColumns(deferMode), rowGroupAllowed); updateStrategy.setRowGroupColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, deActivateFunction: () => { const columns = this.removeColumnsFromList( updateStrategy.getRowGroupColumns(deferMode), rowGroupAllowed ); updateStrategy.setRowGroupColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, addIcon: "menuAddRowGroup", removeIcon: "menuRemoveRowGroup" }); const valueAllowed = (col) => col.isPrimary() && col.isAllowValue(); menuItemMap.set("value", { allowedFunction: valueAllowed, activeFunction: (col) => valueColIdSet.has(col.getColId()), activateLabel: () => localeTextFunc("addToValues", `Add ${displayName} to values`, [displayName]), deactivateLabel: () => localeTextFunc("removeFromValues", `Remove ${displayName} from values`, [displayName]), activateFunction: () => { const columns = this.addColumnsToList(updateStrategy.getValueColumns(deferMode), valueAllowed); updateStrategy.setValueColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, deActivateFunction: () => { const columns = this.removeColumnsFromList(updateStrategy.getValueColumns(deferMode), valueAllowed); updateStrategy.setValueColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, addIcon: "valuePanel", removeIcon: "valuePanel" }); const pivotAllowed = (col) => isPivotMode2 && col.isPrimary() && col.isAllowPivot(); menuItemMap.set("pivot", { allowedFunction: pivotAllowed, activeFunction: (col) => pivotColIdSet.has(col.getColId()), activateLabel: () => localeTextFunc("addToLabels", `Add ${displayName} to labels`, [displayName]), deactivateLabel: () => localeTextFunc("removeFromLabels", `Remove ${displayName} from labels`, [displayName]), activateFunction: () => { const columns = this.addColumnsToList(updateStrategy.getPivotColumns(deferMode), pivotAllowed); updateStrategy.setPivotColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, deActivateFunction: () => { const columns = this.removeColumnsFromList(updateStrategy.getPivotColumns(deferMode), pivotAllowed); updateStrategy.setPivotColumns(deferMode, columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.params); }, addIcon: "pivotPanel", removeIcon: "pivotPanel" }); } isColumnValidForScrollIntoView(col) { const isVisible = col.isVisible(); if (!isVisible) { return false; } const parent = col.getParent(); if (!parent) { return true; } return parent.getDisplayedChildren()?.includes(col) ?? true; } addColumnsToList(columnList, predicate) { return [...columnList].concat(this.columns.filter((col) => predicate(col) && !columnList.includes(col))); } removeColumnsFromList(columnList, predicate) { return columnList.filter((col) => !predicate(col) || !this.columns.includes(col)); } displayContextMenu(menuItemsMapped) { const eGui = this.getGui(); const menuList = this.createBean(new MenuList()); const localeTextFunc = this.getLocaleTextFunc(); let hideFunc = () => { }; eGui.appendChild(menuList.getGui()); menuList.addMenuItems(menuItemsMapped); menuList.addManagedListeners(menuList, { closeMenu: () => { this.parentEl.focus(); hideFunc(); } }); const popupSvc = this.beans.popupSvc; const addPopupRes = popupSvc.addPopup({ modal: true, eChild: eGui, closeOnEsc: true, afterGuiAttached: () => _focusInto(menuList.getGui()), ariaLabel: localeTextFunc("ariaLabelContextMenu", "Context Menu"), closedCallback: (e) => { if (e instanceof KeyboardEvent) { this.parentEl.focus(); } this.destroyBean(menuList); } }); if (addPopupRes) { hideFunc = addPopupRes.hideFunc; } popupSvc.positionPopupUnderMouseEvent({ type: "columnContextMenu", mouseEvent: this.mouseEventOrTouch, ePopup: eGui }); } isActive() { return this.allowScrollIntoView || this.allowGrouping || this.allowValues || this.allowPivoting; } getMappedMenuItems() { const ret = []; const { menuItemMap, columns, displayName, beans } = this; for (const val of menuItemMap.values()) { const isInactive = columns.some((col) => val.allowedFunction(col) && !val.activeFunction(col)); const isActive = columns.some((col) => val.allowedFunction(col) && val.activeFunction(col)); if (isInactive) { ret.push({ name: val.activateLabel(displayName), icon: _createIconNoSpan(val.addIcon, beans, null), action: () => val.activateFunction() }); } if (isActive && val.removeIcon && val.deactivateLabel) { ret.push({ name: val.deactivateLabel(displayName), icon: _createIconNoSpan(val.removeIcon, beans, null), action: () => val.deActivateFunction?.() }); } } return ret; } }; // packages/ag-grid-enterprise/src/columnToolPanel/toolPanelColumnGroupComp.ts var ToolPanelColumnGroupElement = { tag: "div", cls: "ag-column-select-column-group", children: [ { tag: "span", ref: "eColumnGroupIcons", cls: "ag-column-group-icons", children: [ { tag: "span", ref: "eGroupClosedIcon", cls: "ag-column-group-closed-icon" }, { tag: "span", ref: "eGroupOpenedIcon", cls: "ag-column-group-opened-icon" } ] }, { tag: "ag-checkbox", ref: "cbSelect", cls: "ag-column-select-checkbox" }, { tag: "span", ref: "eLabel", cls: "ag-column-select-column-label" } ] }; var ToolPanelColumnGroupComp = class extends Component { constructor(modelItem, allowDragging, eventType, focusWrapper, params) { super(); this.modelItem = modelItem; this.allowDragging = allowDragging; this.eventType = eventType; this.focusWrapper = focusWrapper; this.params = params; this.cbSelect = RefPlaceholder; this.eLabel = RefPlaceholder; this.eGroupOpenedIcon = RefPlaceholder; this.eGroupClosedIcon = RefPlaceholder; this.eColumnGroupIcons = RefPlaceholder; this.processingColumnStateChange = false; const { columnGroup, depth, displayName } = modelItem; this.columnGroup = columnGroup; this.columnDepth = depth; this.displayName = displayName; } postConstruct() { this.setTemplate(ToolPanelColumnGroupElement, [AgCheckboxSelector]); const { beans, cbSelect, eLabel, displayName, columnDepth, modelItem, focusWrapper, columnGroup } = this; const { registry, gos } = beans; const eDragHandle = _createIconNoSpan("columnDrag", beans); this.eDragHandle = eDragHandle; eDragHandle.classList.add("ag-drag-handle", "ag-column-select-column-group-drag-handle"); const checkboxGui = cbSelect.getGui(); const checkboxInput = cbSelect.getInputElement(); checkboxGui.after(eDragHandle); checkboxInput.setAttribute("tabindex", "-1"); eLabel.textContent = displayName ?? ""; this.setupExpandContract(); this.addCss("ag-column-select-indent-" + columnDepth); this.getGui().style.setProperty("--ag-indentation-level", String(columnDepth)); this.tooltipFeature = this.createOptionalManagedBean( registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.focusWrapper, getLocation: () => "columnToolPanelColumnGroup", shouldDisplayTooltip: _getShouldDisplayTooltip(gos, () => eLabel) }) ); this.addManagedEventListeners({ columnPivotModeChanged: this.onColumnStateChanged.bind(this) }); this.addManagedElementListeners(eLabel, { click: this.onLabelClicked.bind(this) }); this.addManagedListeners(cbSelect, { fieldValueChanged: this.onCheckboxChanged.bind(this) }); this.addManagedListeners(modelItem, { expandedChanged: this.onExpandChanged.bind(this) }); const touchListener = new TouchListener(this.getGui(), false); this.addManagedListeners(touchListener, { longTap: (e) => this.onContextMenu(e.touchStart) }); this.addDestroyFunc(touchListener.destroy.bind(touchListener)); this.addManagedListeners(focusWrapper, { keydown: this.handleKeyDown.bind(this), contextmenu: this.onContextMenu.bind(this) }); this.setOpenClosedIcons(); this.setupDragging(); this.onColumnStateChanged(); this.addVisibilityListenersToAllChildren(); this.refreshAriaExpanded(); this.refreshAriaLabel(); this.setupTooltip(); const classes = _getToolPanelClassesFromColDef(columnGroup.getColGroupDef(), gos, null, columnGroup); for (const c of classes) { this.toggleCss(c, true); } } getColumns() { return this.columnGroup.getLeafColumns(); } setupTooltip() { const colGroupDef = this.columnGroup.getColGroupDef(); if (!colGroupDef) { return; } const refresh = () => this.tooltipFeature?.setTooltipAndRefresh(colGroupDef.headerTooltip); refresh(); this.addManagedEventListeners({ newColumnsLoaded: refresh }); } handleKeyDown(e) { switch (e.key) { case KeyCode.LEFT: e.preventDefault(); this.modelItem.expanded = false; break; case KeyCode.RIGHT: e.preventDefault(); this.modelItem.expanded = true; break; case KeyCode.SPACE: e.preventDefault(); if (this.isSelectable()) { this.onSelectAllChanged(!this.isSelected()); } break; } } onContextMenu(e) { const { columnGroup, gos } = this; if (gos.get("functionsReadOnly")) { return; } const contextMenu = this.createBean(new ToolPanelContextMenu(columnGroup, e, this.focusWrapper, this.params)); this.addDestroyFunc(() => { if (contextMenu.isAlive()) { this.destroyBean(contextMenu); } }); } addVisibilityListenersToAllChildren() { const listener = this.onColumnStateChanged.bind(this); for (const column of this.columnGroup.getLeafColumns()) { this.addManagedListeners(column, { visibleChanged: listener, columnValueChanged: listener, columnPivotChanged: listener, columnRowGroupChanged: listener }); } } setupDragging() { if (!this.allowDragging) { _setDisplayed(this.eDragHandle, false); return; } const beans = this.beans; const { gos, eventSvc, dragAndDrop } = beans; let hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); const dragSource = { type: DragSourceType.ToolPanel, eElement: this.eDragHandle, dragItemName: this.displayName, getDefaultIconName: () => hideColumnOnExit ? "hide" : "notAllowed", getDragItem: () => this.createDragItem(), onDragStarted: () => { hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); eventSvc.dispatchEvent({ type: "columnPanelItemDragStart", column: this.columnGroup }); }, onDragStopped: () => { eventSvc.dispatchEvent({ type: "columnPanelItemDragEnd" }); }, onGridEnter: (dragItem) => { if (hideColumnOnExit) { updateColumns(beans, { columns: this.columnGroup.getLeafColumns(), visibleState: dragItem?.visibleState, pivotState: dragItem?.pivotState, eventType: this.eventType, buttons: this.params.buttons }); } }, onGridExit: () => { if (hideColumnOnExit) { this.onChangeCommon(false); } } }; dragAndDrop.addDragSource(dragSource, true); this.addDestroyFunc(() => dragAndDrop.removeDragSource(dragSource)); } createDragItem() { const columns = this.columnGroup.getLeafColumns(); const visibleState = {}; const pivotState = {}; const updateStrategy = this.beans.columnStateUpdateStrategy; const deferApply = isDeferredMode(this.params); for (const col of columns) { const colId = col.getId(); visibleState[colId] = col.isVisible(); pivotState[colId] = createPivotStateForToolPanel(col, updateStrategy, deferApply); } return { columns, visibleState, pivotState }; } setupExpandContract() { const { beans, eGroupClosedIcon, eGroupOpenedIcon, eColumnGroupIcons } = this; eGroupClosedIcon.appendChild(_createIcon("columnSelectClosed", beans, null)); eGroupOpenedIcon.appendChild(_createIcon("columnSelectOpen", beans, null)); const listener = this.onExpandOrContractClicked.bind(this); this.addManagedElementListeners(eGroupClosedIcon, { click: listener }); this.addManagedElementListeners(eGroupOpenedIcon, { click: listener }); const touchListener = new TouchListener(eColumnGroupIcons, true); this.addManagedListeners(touchListener, { tap: listener }); this.addDestroyFunc(touchListener.destroy.bind(touchListener)); } onLabelClicked() { const nextState = !this.cbSelect.getValue(); this.onChangeCommon(nextState); } onCheckboxChanged(event) { this.onChangeCommon(event.selected); } getVisibleLeafColumns() { const childColumns = []; const extractCols = (children) => { for (const child of children) { if (child.passesFilter) { if (child.group) { extractCols(child.children); } else { childColumns.push(child.column); } } } }; extractCols(this.modelItem.children); return childColumns; } onChangeCommon(nextState) { this.refreshAriaLabel(); if (this.processingColumnStateChange) { return; } selectAllChildren(this.beans, this.modelItem.children, nextState, this.eventType, this.params); } refreshAriaLabel() { const { cbSelect, focusWrapper, displayName } = this; const translate = this.getLocaleTextFunc(); const columnLabel = translate("ariaColumnGroup", "Column Group"); const checkboxValue = cbSelect.getValue(); const state = checkboxValue === void 0 ? translate("ariaIndeterminate", "indeterminate") : checkboxValue ? translate("ariaVisible", "visible") : translate("ariaHidden", "hidden"); const visibilityLabel = translate("ariaToggleVisibility", "Press SPACE to toggle visibility"); _setAriaLabel(focusWrapper, `${displayName} ${columnLabel}`); cbSelect.setInputAriaLabel(`${visibilityLabel} (${state})`); _setAriaDescribedBy(focusWrapper, cbSelect.getInputElement().id); } onColumnStateChanged() { const selectedValue = this.workOutSelectedValue(); const readOnlyValue = this.workOutReadOnlyValue(); this.processingColumnStateChange = true; const cbSelect = this.cbSelect; cbSelect.setValue(selectedValue); cbSelect.setReadOnly(readOnlyValue); this.toggleCss("ag-column-select-column-group-readonly", readOnlyValue); this.processingColumnStateChange = false; } workOutSelectedValue() { const updateStrategy = this.beans.columnStateUpdateStrategy; const pivotMode = updateStrategy.getPivotMode(isDeferredMode(this.params)); const visibleLeafColumns = this.getVisibleLeafColumns(); let checkedCount = 0; let uncheckedCount = 0; for (const column of visibleLeafColumns) { if (pivotMode || !column.getColDef().lockVisible) { if (this.isColumnChecked(column)) { checkedCount++; } else { uncheckedCount++; } } } if (checkedCount > 0 && uncheckedCount > 0) { return void 0; } return checkedCount > 0; } workOutReadOnlyValue() { const pivotMode = this.beans.columnStateUpdateStrategy.getPivotMode(isDeferredMode(this.params)); let colsThatCanAction = 0; for (const col of this.columnGroup.getLeafColumns()) { if (pivotMode) { if (col.isAnyFunctionAllowed()) { colsThatCanAction++; } } else if (!col.getColDef().lockVisible) { colsThatCanAction++; } } return colsThatCanAction === 0; } isColumnChecked(column) { const updateStrategy = this.beans.columnStateUpdateStrategy; if (updateStrategy.getPivotMode(isDeferredMode(this.params))) { return updateStrategy.isColumnSelectedInPivotModeToolPanel(isDeferredMode(this.params), column); } return updateStrategy.isColumnVisibleInToolPanel(isDeferredMode(this.params), column); } onExpandOrContractClicked() { const modelItem = this.modelItem; const oldState = modelItem.expanded; modelItem.expanded = !oldState; } onExpandChanged() { this.setOpenClosedIcons(); this.refreshAriaExpanded(); } setOpenClosedIcons() { const folderOpen = this.modelItem.expanded; _setDisplayed(this.eGroupClosedIcon, !folderOpen); _setDisplayed(this.eGroupOpenedIcon, folderOpen); } refreshAriaExpanded() { _setAriaExpanded(this.focusWrapper, this.modelItem.expanded); } getDisplayName() { return this.displayName; } onSelectAllChanged(value) { const cbSelect = this.cbSelect; const cbValue = cbSelect.getValue(); const readOnly = cbSelect.isReadOnly(); if (!readOnly && (value && !cbValue || !value && cbValue)) { cbSelect.toggle(); } } isSelected() { return this.cbSelect.getValue(); } isSelectable() { return !this.cbSelect.isReadOnly(); } setSelected(selected) { this.cbSelect.setValue(selected, true); } }; // packages/ag-grid-enterprise/src/columnToolPanel/columnMoveUtils.ts var getCurrentColumnsBeingMoved = (column) => { if (isProvidedColumnGroup(column)) { return column.getLeafColumns(); } return column ? [column] : []; }; var getMoveTargetIndex = (currentColumns, lastHoveredColumn, isBefore, allColumns) => { if (!lastHoveredColumn || !currentColumns) { return null; } const targetColumnIndex = allColumns.indexOf(lastHoveredColumn); const adjustedTarget = isBefore ? targetColumnIndex : targetColumnIndex + 1; const diff = getMoveDiff(allColumns, currentColumns, adjustedTarget); return adjustedTarget - diff; }; var getMoveDiff = (allColumns, currentColumns, end) => { if (!currentColumns) { return 0; } const targetColumn = currentColumns[0]; const span = currentColumns.length; const currentIndex = allColumns.indexOf(targetColumn); if (currentIndex < end) { return span; } return 0; }; var isMoveBlocked = (gos, beans, currentColumns, params) => { const deferMode = isDeferredMode(params); const preventMoving = gos.get("suppressMovableColumns") || beans.columnStateUpdateStrategy.getPivotMode(deferMode); if (preventMoving) { return true; } const hasNotMovable = currentColumns.find(({ colDef }) => !!colDef.suppressMovable || !!colDef.lockPosition); return !!hasNotMovable; }; var moveItem = (beans, currentColumns, lastHoveredListItem, params) => { if (!lastHoveredListItem) { return; } const { component } = lastHoveredListItem; let lastHoveredColumn = null; let isBefore = lastHoveredListItem.position === "top"; if (component instanceof ToolPanelColumnGroupComp) { const columns = component.getColumns(); lastHoveredColumn = columns[0]; isBefore = true; } else if (component) { lastHoveredColumn = component.column; } if (!lastHoveredColumn) { return; } const deferMode = isDeferredMode(params); const allColumns = deferMode ? beans.columnStateUpdateStrategy.getPrimaryColumns(deferMode) : beans.colModel.getCols(); const targetIndex = getMoveTargetIndex(currentColumns, lastHoveredColumn, isBefore, allColumns); if (targetIndex != null) { beans.columnStateUpdateStrategy.moveColumns(deferMode, currentColumns, targetIndex, "toolPanelUi"); refreshDeferredToolPanelUi(beans, params); } }; var getCurrentDragValue = (listItemDragStartEvent) => { return listItemDragStartEvent.column; }; // packages/ag-grid-enterprise/src/columnToolPanel/toolPanelColumnComp.ts var ToolPanelColumnElement = { tag: "div", cls: "ag-column-select-column", children: [ { tag: "ag-checkbox", ref: "cbSelect", cls: "ag-column-select-checkbox" }, { tag: "span", ref: "eLabel", cls: "ag-column-select-column-label" } ] }; var ToolPanelColumnComp = class extends Component { constructor(modelItem, allowDragging, groupsExist, focusWrapper, params) { super(); this.modelItem = modelItem; this.allowDragging = allowDragging; this.groupsExist = groupsExist; this.focusWrapper = focusWrapper; this.params = params; this.eLabel = RefPlaceholder; this.cbSelect = RefPlaceholder; this.processingColumnStateChange = false; const { column, depth, displayName } = modelItem; this.column = column; this.columnDepth = depth; this.displayName = displayName; } postConstruct() { this.setTemplate(ToolPanelColumnElement, [AgCheckboxSelector]); const { beans, cbSelect, displayName, eLabel, columnDepth: indent, groupsExist, column, gos, focusWrapper } = this; const eDragHandle = _createIconNoSpan("columnDrag", beans); this.eDragHandle = eDragHandle; eDragHandle.classList.add("ag-drag-handle", "ag-column-select-column-drag-handle"); const checkboxGui = cbSelect.getGui(); const checkboxInput = cbSelect.getInputElement(); checkboxGui.after(eDragHandle); checkboxInput.setAttribute("tabindex", "-1"); eLabel.textContent = displayName; if (groupsExist) { this.addCss("ag-column-select-add-group-indent"); } this.addCss(`ag-column-select-indent-${indent}`); this.getGui().style.setProperty("--ag-indentation-level", String(indent)); this.tooltipFeature = this.createOptionalManagedBean( beans.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.focusWrapper, getLocation: () => "columnToolPanelColumn", shouldDisplayTooltip: _getShouldDisplayTooltip(gos, () => eLabel), getAdditionalParams: () => ({ colDef: column.getColDef() }) }) ); this.setupDragging(); const onColStateChanged = this.onColumnStateChanged.bind(this); this.addManagedEventListeners({ columnPivotModeChanged: onColStateChanged }); this.addManagedListeners(column, { columnValueChanged: onColStateChanged, columnPivotChanged: onColStateChanged, columnRowGroupChanged: onColStateChanged, visibleChanged: onColStateChanged }); this.addManagedListeners(focusWrapper, { keydown: this.handleKeyDown.bind(this), contextmenu: this.onContextMenu.bind(this) }); const touchListener = new TouchListener(focusWrapper); this.addManagedListeners(touchListener, { longTap: (e) => this.onContextMenu(e.touchStart) }); this.addDestroyFunc(touchListener.destroy.bind(touchListener)); this.addManagedPropertyListener("functionsReadOnly", this.onColumnStateChanged.bind(this)); this.addManagedListeners(cbSelect, { fieldValueChanged: this.onCheckboxChanged.bind(this) }); this.addManagedElementListeners(eLabel, { click: this.onLabelClicked.bind(this) }); this.onColumnStateChanged(); this.refreshAriaLabel(); this.setupTooltip(); const classes = _getToolPanelClassesFromColDef(column.getColDef(), gos, column, null); for (const c of classes) { this.toggleCss(c, true); } } getColumn() { return this.column; } setupTooltip() { const refresh = () => this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip); refresh(); this.addManagedEventListeners({ newColumnsLoaded: refresh }); } onContextMenu(e) { const { column, gos } = this; if (gos.get("functionsReadOnly")) { return; } const contextMenu = this.createBean(new ToolPanelContextMenu(column, e, this.focusWrapper, this.params)); this.addDestroyFunc(() => { if (contextMenu.isAlive()) { this.destroyBean(contextMenu); } }); } handleKeyDown(e) { if (e.key === KeyCode.SPACE) { e.preventDefault(); if (this.isSelectable()) { this.onSelectAllChanged(!this.isSelected()); } } } onLabelClicked() { if (this.gos.get("functionsReadOnly")) { return; } const nextState = !this.cbSelect.getValue(); this.onChangeCommon(nextState); } onCheckboxChanged(event) { this.onChangeCommon(event.selected); } onChangeCommon(nextState) { if (this.cbSelect.isReadOnly()) { return; } this.refreshAriaLabel(); if (this.processingColumnStateChange) { return; } setAllColumns(this.beans, [this.column], nextState, "toolPanelUi", this.params); } refreshAriaLabel() { const { cbSelect, focusWrapper, displayName } = this; const translate = this.getLocaleTextFunc(); const columnLabel = translate("ariaColumn", "Column"); const state = cbSelect.getValue() ? translate("ariaVisible", "visible") : translate("ariaHidden", "hidden"); const visibilityLabel = translate("ariaToggleVisibility", "Press SPACE to toggle visibility"); _setAriaLabel(focusWrapper, `${displayName} ${columnLabel}`); this.cbSelect.setInputAriaLabel(`${visibilityLabel} (${state})`); _setAriaDescribedBy(focusWrapper, cbSelect.getInputElement().id); } setupDragging() { const eDragHandle = this.eDragHandle; if (!this.allowDragging) { _setDisplayed(eDragHandle, false); return; } const beans = this.beans; const { gos, eventSvc, dragAndDrop } = beans; if (isDeferredMode(this.params)) { eDragHandle.setAttribute("data-column-tool-panel-deferred", ""); } let hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); const dragSource = { type: DragSourceType.ToolPanel, eElement: eDragHandle, dragItemName: this.displayName, getDefaultIconName: () => hideColumnOnExit && !isDeferredMode(this.params) ? "hide" : "notAllowed", getDragItem: () => this.createDragItem(), onDragStarted: () => { hideColumnOnExit = !gos.get("suppressDragLeaveHidesColumns"); eventSvc.dispatchEvent({ type: "columnPanelItemDragStart", column: this.column }); }, onDragStopped: () => { eventSvc.dispatchEvent({ type: "columnPanelItemDragEnd" }); }, onGridEnter: (dragItem) => { if (hideColumnOnExit && !isDeferredMode(this.params)) { updateColumns(beans, { columns: [this.column], visibleState: dragItem?.visibleState, pivotState: dragItem?.pivotState, eventType: "toolPanelUi", buttons: this.params.buttons }); } }, onGridExit: () => { if (hideColumnOnExit && !isDeferredMode(this.params)) { this.onChangeCommon(false); } } }; dragAndDrop.addDragSource(dragSource, true); this.addDestroyFunc(() => dragAndDrop.removeDragSource(dragSource)); } createDragItem() { const colId = this.column.getColId(); const visibleState = { [colId]: this.column.isVisible() }; const updateStrategy = this.beans.columnStateUpdateStrategy; const pivotState = { [colId]: createPivotStateForToolPanel(this.column, updateStrategy, isDeferredMode(this.params)) }; return { columns: [this.column], visibleState, pivotState }; } onColumnStateChanged() { this.processingColumnStateChange = true; const updateStrategy = this.beans.columnStateUpdateStrategy; const isPivotMode2 = updateStrategy.getPivotMode(isDeferredMode(this.params)); if (isPivotMode2) { const anyFunctionActive = updateStrategy.isColumnSelectedInPivotModeToolPanel( isDeferredMode(this.params), this.column ); this.cbSelect.setValue(anyFunctionActive); } else { this.cbSelect.setValue(updateStrategy.isColumnVisibleInToolPanel(isDeferredMode(this.params), this.column)); } let canBeToggled = true; let canBeDragged = true; if (isPivotMode2) { const functionsReadOnly = this.gos.get("functionsReadOnly"); const noFunctionsAllowed = !this.column.isAnyFunctionAllowed(); canBeToggled = !functionsReadOnly && !noFunctionsAllowed; canBeDragged = canBeToggled; } else { const { enableRowGroup, enableValue, lockPosition, suppressMovable, lockVisible } = this.column.getColDef(); const forceDraggable = !!enableRowGroup || !!enableValue; const disableDraggable = !!lockPosition || !!suppressMovable; canBeToggled = !lockVisible; canBeDragged = forceDraggable || !disableDraggable; } this.cbSelect.setReadOnly(!canBeToggled); this.eDragHandle.classList.toggle("ag-column-select-column-readonly", !canBeDragged); this.toggleCss("ag-column-select-column-readonly", !canBeDragged && !canBeToggled); this.cbSelect.setPassive(false); this.processingColumnStateChange = false; } getDisplayName() { return this.displayName; } onSelectAllChanged(value) { const cbSelect = this.cbSelect; if (value !== cbSelect.getValue()) { if (!cbSelect.isReadOnly()) { cbSelect.toggle(); } } } isSelected() { return this.cbSelect.getValue(); } isSelectable() { return !this.cbSelect.isReadOnly(); } isExpandable() { return false; } setExpanded(_value) { _warn(158); } }; // packages/ag-grid-enterprise/src/columnToolPanel/agPrimaryColsList.ts var UIColumnModel = class { constructor(items) { this.items = items; } getRowCount() { return this.items.length; } getRow(index) { return this.items[index]; } }; var PRIMARY_COLS_LIST_PANEL_CLASS = "ag-column-select-list"; var AgPrimaryColsList = class extends Component { constructor() { super({ tag: "div", cls: PRIMARY_COLS_LIST_PANEL_CLASS, role: "presentation" }); this.destroyColumnItemFuncs = []; this.hasLoadedInitialState = false; this.isInitialState = false; this.skipRefocus = false; } wireBeans(beans) { this.colModel = beans.colModel; } destroy() { this.destroyColumnTree(); super.destroy(); } destroyColumnTree() { this.allColsTree = []; for (const f of this.destroyColumnItemFuncs) { f(); } this.destroyColumnItemFuncs = []; } init(params, allowDragging, eventType) { this.params = params; const { suppressSyncLayoutWithGrid, contractColumnSelection, suppressColumnMove } = params; this.allowDragging = allowDragging; this.eventType = eventType; if (!suppressSyncLayoutWithGrid) { this.addManagedEventListeners({ columnMoved: this.onColumnsChanged.bind(this) }); } this.addManagedEventListeners({ newColumnsLoaded: this.onColumnsChanged.bind(this) }); const listener = this.fireSelectionChangedEvent.bind(this); this.addManagedEventListeners({ columnPivotChanged: listener, columnPivotModeChanged: listener, columnRowGroupChanged: listener, columnValueChanged: listener, columnVisible: listener, newColumnsLoaded: listener }); this.expandGroupsByDefault = !contractColumnSelection; const isPreventMove = suppressColumnMove || suppressSyncLayoutWithGrid; const virtualList = this.createManagedBean( new VirtualList({ cssIdentifier: "column-select", ariaRole: "tree", moveItemCallback: (item, isUp) => { if (isPreventMove) { return; } this.moveItems(item, isUp); } }) ); this.virtualList = virtualList; this.appendChild(virtualList.getGui()); virtualList.setComponentCreator((item, listItemElement) => { _setAriaLevel(listItemElement, item.depth + 1); return this.createComponentFromItem(item, listItemElement); }); if (this.colModel.ready) { this.onColumnsChanged(); } if (isPreventMove) { return; } this.createItemDragFeature(); } createItemDragFeature() { const { gos, beans, virtualList } = this; this.createManagedBean( new VirtualListDragFeature(this, virtualList, { dragSourceType: DragSourceType.ToolPanel, addListeners: (parent, listItemDragStart, listItemDragEnd) => { parent.addManagedEventListeners({ columnPanelItemDragStart: listItemDragStart, columnPanelItemDragEnd: listItemDragEnd }); }, getCurrentDragValue: (listItemDragStartEvent) => getCurrentDragValue(listItemDragStartEvent), isMoveBlocked: (currentDragValue) => isMoveBlocked(gos, beans, getCurrentColumnsBeingMoved(currentDragValue), this.params), getNumRows: (comp) => comp.getDisplayedColsList().length, moveItem: (currentDragValue, lastHoveredListItem) => moveItem(beans, getCurrentColumnsBeingMoved(currentDragValue), lastHoveredListItem, this.params) }) ); } moveItems(item, isUp) { const { gos, beans } = this; const { modelItem } = item; const { group, columnGroup, column, expanded } = modelItem; const currentColumns = getCurrentColumnsBeingMoved(group ? columnGroup : column); if (isMoveBlocked(gos, beans, currentColumns, this.params)) { return; } const currentIndex = this.displayedColsList.indexOf(modelItem); const diff = isUp ? -1 : 1; let movePadding = 0; if (isUp) { const children = item.columnDepth > 0 ? column.getParent()?.getChildren() : null; if (children?.length && column === children[0]) { movePadding = -1; } } else if (group) { movePadding = expanded ? modelItem.children.length : 0; } const nextItem = Math.min(Math.max(currentIndex + movePadding + diff, 0), this.displayedColsList.length - 1); this.skipRefocus = true; moveItem( beans, currentColumns, { rowIndex: nextItem, position: isUp ? "top" : "bottom", component: this.virtualList.getComponentAt(nextItem) }, this.params ); this.focusRowIfAlive(nextItem - movePadding).then(() => { this.skipRefocus = false; }); } createComponentFromItem(item, listItemElement) { const allowDragging = this.allowDragging; if (item.group) { const renderedGroup = new ToolPanelColumnGroupComp( item, allowDragging, this.eventType, listItemElement, this.params ); this.createBean(renderedGroup); return renderedGroup; } const columnComp = new ToolPanelColumnComp(item, allowDragging, this.groupsExist, listItemElement, this.params); this.createBean(columnComp); return columnComp; } onColumnsChanged() { const params = this.params; if (!this.hasLoadedInitialState) { this.hasLoadedInitialState = true; this.isInitialState = !!params.initialState; } const expandedStates = this.getExpandedStates(); const pivotModeActive = this.colModel.isPivotMode(); const deferApply = isDeferredMode(params); const hasDeferredColumnOrder = deferApply && this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(deferApply); const shouldSyncColumnLayoutWithGrid = (!params.suppressSyncLayoutWithGrid || deferApply) && !pivotModeActive || hasDeferredColumnOrder; if (shouldSyncColumnLayoutWithGrid) { this.buildTreeFromWhatGridIsDisplaying(); } else { this.buildTreeFromProvidedColumnDefs(); } this.setExpandedStates(expandedStates); this.markFilteredColumns(); this.flattenAndFilterModel(); this.isInitialState = false; } getDisplayedColsList() { return this.displayedColsList; } getExpandedStates() { const res = {}; if (this.isInitialState) { const { expandedGroupIds } = this.params.initialState; for (const id of expandedGroupIds) { res[id] = true; } return res; } if (!this.allColsTree) { return {}; } this.forEachItem((item) => { if (!item.group) { return; } const colGroup = item.columnGroup; if (colGroup) { res[colGroup.getId()] = item.expanded; } }); return res; } setExpandedStates(states) { if (!this.allColsTree) { return; } const { isInitialState } = this; this.forEachItem((item) => { if (!item.group) { return; } const colGroup = item.columnGroup; if (colGroup) { const expanded = states[colGroup.getId()]; const groupExistedLastTime = expanded != null; if (groupExistedLastTime || isInitialState) { item.expanded = !!expanded; } } }); } buildTreeFromWhatGridIsDisplaying() { const deferApply = isDeferredMode(this.params); if (deferApply && this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(deferApply)) { const columnOrder = this.beans.columnStateUpdateStrategy.getPrimaryColumns(deferApply); if (columnOrder.length > 0) { syncLayoutWithColumns(columnOrder, this.setColumnLayout.bind(this)); return; } } if (this.params.suppressSyncLayoutWithGrid) { this.buildTreeFromProvidedColumnDefs(); return; } syncLayoutWithGrid(this.colModel, this.setColumnLayout.bind(this)); } setColumnLayout(colDefs) { const columnTree = toolPanelCreateColumnTree(this.colModel, colDefs); this.buildListModel(columnTree); this.groupsExist = colDefs.some((colDef) => { return colDef && typeof colDef.children !== "undefined"; }); this.markFilteredColumns(); this.flattenAndFilterModel(); } buildTreeFromProvidedColumnDefs() { const colModel = this.colModel; this.buildListModel(colModel.getColDefColTree()); this.groupsExist = !!colModel.colDefCols?.treeDepth; } buildListModel(columnTree) { const columnExpandedListener = this.onColumnExpanded.bind(this); const addListeners = (item) => { item.addEventListener("expandedChanged", columnExpandedListener); const removeFunc = item.removeEventListener.bind(item, "expandedChanged", columnExpandedListener); this.destroyColumnItemFuncs.push(removeFunc); }; const colNames = this.beans.colNames; const recursivelyBuild = (tree, depth, parentList) => { for (const child of tree) { if (isProvidedColumnGroup(child)) { createGroupItem(child, depth, parentList); } else { createColumnItem(child, depth, parentList); } } }; const createGroupItem = (columnGroup, depth, parentList) => { const columnGroupDef = columnGroup.getColGroupDef(); const skipThisGroup = columnGroupDef?.suppressColumnsToolPanel; if (skipThisGroup) { return; } if (columnGroup.isPadding()) { recursivelyBuild(columnGroup.getChildren(), depth, parentList); return; } const displayName = colNames.getDisplayNameForProvidedColumnGroup(null, columnGroup, "columnToolPanel"); const item = new ColumnModelItem( displayName, columnGroup, depth, true, this.expandGroupsByDefault ); parentList.push(item); addListeners(item); recursivelyBuild(columnGroup.getChildren(), depth + 1, item.children); }; const createColumnItem = (column, depth, parentList) => { const skipThisColumn = column.getColDef()?.suppressColumnsToolPanel; if (skipThisColumn) { return; } const displayName = colNames.getDisplayNameForColumn(column, "columnToolPanel"); parentList.push(new ColumnModelItem(displayName, column, depth)); }; this.destroyColumnTree(); recursivelyBuild(columnTree, 0, this.allColsTree); } onColumnExpanded() { this.flattenAndFilterModel(); } flattenAndFilterModel() { this.displayedColsList = []; const recursiveFunc = (item) => { if (!item.passesFilter) { return; } this.displayedColsList.push(item); if (item.group && item.expanded) { item.children.forEach(recursiveFunc); } }; const virtualList = this.virtualList; this.allColsTree.forEach(recursiveFunc); virtualList.setModel(new UIColumnModel(this.displayedColsList)); let focusedRow = null; if (!this.skipRefocus) { focusedRow = virtualList.getLastFocusedRow(); } virtualList.refresh(); if (focusedRow != null) { this.focusRowIfAlive(focusedRow); } this.notifyListeners(); this.refreshAriaLabel(); } refreshAriaLabel() { const translate = this.getLocaleTextFunc(); const columnListName = translate("ariaColumnPanelList", "Column List"); const localeColumns = translate("columns", "Columns"); const items = this.displayedColsList.length; _setAriaLabel(this.virtualList.getAriaElement(), `${columnListName} ${items} ${localeColumns}`); } focusRowIfAlive(rowIndex) { if (rowIndex === -1) { return Promise.resolve(); } return new Promise((res) => { window.setTimeout(() => { if (this.isAlive()) { this.virtualList.focusRow(rowIndex); } res(); }, 0); }); } forEachItem(callback) { const recursiveFunc = (items) => { for (const item of items) { callback(item); if (item.group) { recursiveFunc(item.children); } } }; const allColsTree = this.allColsTree; if (!allColsTree) { return; } recursiveFunc(allColsTree); } doSetExpandedAll(value) { this.forEachItem((item) => { if (item.group) { item.expanded = value; } }); } setGroupsExpanded(expand, groupIds) { if (!groupIds) { this.doSetExpandedAll(expand); return; } const expandedGroupIds = []; this.forEachItem((item) => { if (!item.group) { return; } const groupId = item.columnGroup.getId(); if (groupIds.indexOf(groupId) >= 0) { item.expanded = expand; expandedGroupIds.push(groupId); } }); const unrecognisedGroupIds = groupIds.filter((groupId) => !expandedGroupIds.includes(groupId)); if (unrecognisedGroupIds.length > 0) { _warn(157, { unrecognisedGroupIds }); } } getExpandState() { let expandedCount = 0; let notExpandedCount = 0; this.forEachItem((item) => { if (!item.group) { return; } if (item.expanded) { expandedCount++; } else { notExpandedCount++; } }); if (expandedCount > 0 && notExpandedCount > 0) { return 2 /* INDETERMINATE */; } if (notExpandedCount > 0) { return 1 /* COLLAPSED */; } return 0 /* EXPANDED */; } doSetSelectedAll(selectAllChecked) { selectAllChildren(this.beans, this.allColsTree, selectAllChecked, this.eventType, this.params); this.syncVisibleSelectionState(); this.fireSelectionChangedEvent(); } syncVisibleSelectionState() { for (let i = 0; i < this.displayedColsList.length; i++) { const comp = this.virtualList.getComponentAt(i); comp?.onColumnStateChanged?.(); } } getSelectionState() { let checkedCount = 0; let uncheckedCount = 0; const updateStrategy = this.beans.columnStateUpdateStrategy; const pivotMode = updateStrategy.getPivotMode(isDeferredMode(this.params)); this.forEachItem((item) => { if (item.group) { return; } if (!item.passesFilter) { return; } const column = item.column; const colDef = column.getColDef(); let checked; if (pivotMode) { const noPivotModeOptionsAllowed = !column.isAllowPivot() && !column.isAllowRowGroup() && !column.isAllowValue(); if (noPivotModeOptionsAllowed) { return; } checked = updateStrategy.isColumnSelectedInPivotModeToolPanel(isDeferredMode(this.params), column) ?? false; } else { if (colDef.lockVisible) { return; } checked = updateStrategy.isColumnVisibleInToolPanel(isDeferredMode(this.params), column) ?? false; } if (checked) { checkedCount++; } else { uncheckedCount++; } }); if (checkedCount > 0 && uncheckedCount > 0) { return void 0; } return !(checkedCount === 0 || uncheckedCount > 0); } setFilterText(filterText) { this.filterText = _exists(filterText) ? filterText.toLowerCase() : null; this.markFilteredColumns(); this.flattenAndFilterModel(); } markFilteredColumns() { const passesFilter = (item) => { if (!_exists(this.filterText)) { return true; } const displayName = item.displayName; return displayName == null || displayName.toLowerCase().indexOf(this.filterText) !== -1; }; const recursivelyCheckFilter = (item, parentPasses) => { let atLeastOneChildPassed = false; if (item.group) { const groupPasses = passesFilter(item); for (const child of item.children) { const childPasses = recursivelyCheckFilter(child, groupPasses || parentPasses); if (childPasses) { atLeastOneChildPassed = childPasses; } } } const filterPasses = parentPasses || atLeastOneChildPassed ? true : passesFilter(item); item.passesFilter = filterPasses; return filterPasses; }; for (const item of this.allColsTree) { recursivelyCheckFilter(item, false); } } notifyListeners() { this.fireGroupExpandedEvent(); this.fireSelectionChangedEvent(); } fireGroupExpandedEvent() { const expandState = this.getExpandState(); this.dispatchLocalEvent({ type: "groupExpanded", state: expandState }); } fireSelectionChangedEvent() { if (!this.allColsTree) { return; } const selectionState = this.getSelectionState(); this.dispatchLocalEvent({ type: "selectionChanged", state: selectionState }); } getExpandedGroups() { const expandedGroupIds = []; if (!this.allColsTree) { return expandedGroupIds; } this.forEachItem((item) => { if (item.group && item.expanded) { expandedGroupIds.push(item.columnGroup.getId()); } }); return expandedGroupIds; } }; var AgPrimaryColsListSelector = { selector: "AG-PRIMARY-COLS-LIST", component: AgPrimaryColsList }; // packages/ag-grid-enterprise/src/columnToolPanel/agPrimaryCols.ts var AgPrimaryColsElement = { tag: "div", cls: "ag-column-select", children: [ { tag: "ag-primary-cols-header", ref: "primaryColsHeaderPanel" }, { tag: "ag-primary-cols-list", ref: "primaryColsListPanel" } ] }; var AgPrimaryCols = class extends Component { constructor() { super(AgPrimaryColsElement, [AgPrimaryColsHeaderSelector, AgPrimaryColsListSelector]); this.primaryColsHeaderPanel = RefPlaceholder; this.primaryColsListPanel = RefPlaceholder; this.registerCSS(agPrimaryCols_default); } // we allow dragging in the toolPanel, but not when this component appears in the column menu init(allowDragging, params, eventType) { const { primaryColsHeaderPanel, primaryColsListPanel } = this; primaryColsHeaderPanel.init(params); const hideFilter = params.suppressColumnFilter; const hideSelect = params.suppressColumnSelectAll; const hideExpand = params.suppressColumnExpandAll; if (hideExpand && hideFilter && hideSelect) { primaryColsHeaderPanel.setDisplayed(false); } this.addManagedListeners(primaryColsListPanel, { groupExpanded: (event) => { primaryColsHeaderPanel.setExpandState(event.state); params.onStateUpdated(); }, selectionChanged: (event) => primaryColsHeaderPanel.setSelectionState(event.state) }); primaryColsListPanel.init(params, allowDragging, eventType); this.addManagedListeners(primaryColsHeaderPanel, { expandAll: primaryColsListPanel.doSetExpandedAll.bind(primaryColsListPanel, true), collapseAll: primaryColsListPanel.doSetExpandedAll.bind(primaryColsListPanel, false), selectAll: primaryColsListPanel.doSetSelectedAll.bind(primaryColsListPanel, true), unselectAll: primaryColsListPanel.doSetSelectedAll.bind(primaryColsListPanel, false), filterChanged: (event) => primaryColsListPanel.setFilterText(event.filterText) }); this.positionableFeature = this.createManagedBean(new PositionableFeature(this.getGui(), { minHeight: 100 })); } toggleResizable(resizable) { this.positionableFeature.setResizable(resizable ? { bottom: true } : false); } expandGroups(groupIds) { this.primaryColsListPanel.setGroupsExpanded(true, groupIds); } collapseGroups(groupIds) { this.primaryColsListPanel.setGroupsExpanded(false, groupIds); } setColumnLayout(colDefs) { this.primaryColsListPanel.setColumnLayout(colDefs); } syncLayoutWithGrid() { this.primaryColsListPanel.onColumnsChanged(); } getExpandedGroups() { return this.primaryColsListPanel.getExpandedGroups(); } }; // packages/ag-grid-enterprise/src/columnToolPanel/columnToolPanel.css var columnToolPanel_default = ".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}"; // packages/ag-grid-enterprise/src/columnToolPanel/columnToolPanel.ts var DEFERRED_TOOL_PANEL_CLASS = "ag-column-panel-deferred"; var ColumnToolPanel = class extends Component { constructor() { super({ tag: "div", cls: "ag-column-panel" }); this.initialised = false; this.childDestroyFuncs = []; this.isDeferModeEnabled = false; this.isCommitting = false; this.onDeferredApply = () => { this.isCommitting = true; try { this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled); } finally { this.isCommitting = false; } this.deferredButtonsComp?.updateValidity(false); this.lastKnownGridState = this.captureGridState(); }; this.onDeferredCancel = () => { this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled); this.deferredButtonsComp?.updateValidity(false); this.refreshToolPanelLayouts(); this.pivotModePanel?.refreshEditStrategy(); this.lastKnownGridState = this.captureGridState(); }; this.onPivotModePanelValueChanged = () => { this.refreshToolPanelLayouts(); this.setLastVisible(); this.deferredButtonsComp?.updateValidity( this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled) ); }; /** Handles columnEverythingChanged — only resets staged changes on true no-ops. */ this.onColumnEverythingChanged = () => { if (!this.isDeferModeEnabled || this.isCommitting) { return; } const currentState = this.captureGridState(); if (!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)) { this.lastKnownGridState = currentState; return; } const isNoOp = this.lastKnownGridState && this.isGridStateEqual(this.lastKnownGridState, currentState); this.lastKnownGridState = currentState; if (!isNoOp) { return; } this.resetDeferredState(); }; this.onExternalGridChange = () => { if (!this.isDeferModeEnabled || this.isCommitting) { return; } if (!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)) { return; } this.resetDeferredState(); this.lastKnownGridState = this.captureGridState(); }; this.registerCSS(columnToolPanel_default); } wireBeans(beans) { this.colToolPanelFactory = beans.colToolPanelFactory; } // lazy initialise the panel setVisible(visible) { super.setDisplayed(visible); if (visible && !this.initialised) { this.init(this.params); } } init(params) { const defaultParams = _addGridCommonParams(this.gos, { suppressColumnMove: false, suppressColumnSelectAll: false, suppressColumnFilter: false, suppressColumnExpandAll: false, contractColumnSelection: false, suppressPivotMode: false, suppressRowGroups: false, suppressValues: false, suppressPivots: false, suppressSyncLayoutWithGrid: false }); const mergedParams = { ...defaultParams, ...params }; this.params = mergedParams; const { childDestroyFuncs, colToolPanelFactory, gos } = this; const hasPivotModule = gos.isModuleRegistered("SharedPivot"); const hasRowGroupingModule = hasPivotModule || gos.isModuleRegistered("SharedRowGrouping"); this.isDeferModeEnabled = isDeferredMode(mergedParams); this.toggleCss(DEFERRED_TOOL_PANEL_CLASS, this.isDeferModeEnabled); if (!mergedParams.suppressPivotMode && colToolPanelFactory && hasPivotModule) { this.pivotModePanel = colToolPanelFactory.createPivotModePanel( this, childDestroyFuncs, mergedParams, this.onPivotModePanelValueChanged ); } const primaryColsPanel = this.createBean(new AgPrimaryCols()); this.primaryColsPanel = primaryColsPanel; childDestroyFuncs.push(() => this.destroyBean(this.primaryColsPanel)); primaryColsPanel.init(true, mergedParams, "toolPanelUi"); primaryColsPanel.addCss("ag-column-panel-column-select"); this.appendChild(primaryColsPanel); if (colToolPanelFactory) { if (!mergedParams.suppressRowGroups && hasRowGroupingModule) { this.rowGroupDropZonePanel = colToolPanelFactory.createRowGroupPanel( this, childDestroyFuncs, mergedParams ); } if (!mergedParams.suppressValues && hasRowGroupingModule) { this.valuesDropZonePanel = colToolPanelFactory.createValuesPanel(this, childDestroyFuncs, mergedParams); } if (!mergedParams.suppressPivots && hasPivotModule) { this.pivotDropZonePanel = colToolPanelFactory.createPivotPanel(this, childDestroyFuncs, mergedParams); } this.setLastVisible(); const [pivotModeListener] = this.addManagedEventListeners({ columnPivotModeChanged: () => { this.resetChildrenHeight(); this.setLastVisible(); } }); childDestroyFuncs.push(() => pivotModeListener()); } if (this.isDeferModeEnabled) { const resetListener = this.onExternalGridChange; childDestroyFuncs.push( ...this.addManagedEventListeners({ columnEverythingChanged: this.onColumnEverythingChanged, sortChanged: resetListener, columnVisible: resetListener, columnRowGroupChanged: resetListener, columnValueChanged: resetListener, columnPivotChanged: resetListener, columnPivotModeChanged: resetListener, newColumnsLoaded: resetListener, ...mergedParams.suppressSyncLayoutWithGrid ? {} : { columnMoved: resetListener } }) ); } if (mergedParams.buttons) { if (!mergedParams.buttons.includes("apply")) { _warn(298); } if (mergedParams.buttons.length) { this.initDeferredButtons(mergedParams.buttons); } } this.initialised = true; } initDeferredButtons(buttons) { const buttonComp = this.createBean(new FilterButtonComp({ className: "ag-column-panel-buttons" })); this.deferredButtonsComp = buttonComp; this.childDestroyFuncs.push(() => { this.deferredButtonsComp = this.destroyBean(this.deferredButtonsComp); }); const translate = this.getLocaleTextFunc(); const buttonDefs = buttons.map((type) => ({ type, label: translate( type === "apply" ? "applyColumnToolPanel" : "cancelColumnToolPanel", type === "apply" ? "Apply" : "Cancel" ) })); buttonComp.updateButtons(buttonDefs); buttonComp.updateValidity(false); buttonComp.addManagedListeners(buttonComp, { apply: this.onDeferredApply, cancel: this.onDeferredCancel }); this.appendChild(buttonComp); } resetDeferredState() { this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled); this.deferredButtonsComp?.updateValidity(false); this.refreshToolPanelLayouts(); this.pivotModePanel?.refreshEditStrategy(); } captureGridState() { const { beans } = this; const getColIds = (cols) => (cols ?? []).map((c) => c.getColId()); return { rowGroupColIds: getColIds(beans.rowGroupColsSvc?.columns), valueColIds: getColIds(beans.valueColsSvc?.columns), pivotColIds: getColIds(beans.pivotColsSvc?.columns), pivotMode: beans.colModel.isPivotMode(), columnOrder: beans.colModel.getCols().map((c) => c.getColId()), visibleColIds: beans.colModel.getCols().filter((c) => c.isVisible()).map((c) => c.getColId()), sortState: beans.colModel.getCols().filter((c) => c.getSort()).map((c) => `${c.getColId()}:${c.getSort()}:${c.getSortIndex()}`), aggFuncState: (beans.valueColsSvc?.columns ?? []).map((c) => c.getAggFunc()), widthState: beans.colModel.getCols().map((c) => `${c.getColId()}:${c.getActualWidth()}`) }; } isGridStateEqual(a, b) { return _areEqual(a.rowGroupColIds, b.rowGroupColIds) && _areEqual(a.valueColIds, b.valueColIds) && _areEqual(a.pivotColIds, b.pivotColIds) && a.pivotMode === b.pivotMode && _areEqual(a.columnOrder, b.columnOrder) && _areEqual(a.visibleColIds, b.visibleColIds) && _areEqual(a.sortState, b.sortState) && _areEqual(a.aggFuncState, b.aggFuncState) && _areEqual(a.widthState, b.widthState); } refreshDeferredUi() { this.refreshToolPanelLayouts(); this.setLastVisible(); this.pivotModePanel?.refreshEditStrategy(); this.deferredButtonsComp?.updateValidity( this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled) ); } refreshToolPanelLayouts() { this.primaryColsPanel.syncLayoutWithGrid(); this.rowGroupDropZonePanel?.refreshGui(); this.valuesDropZonePanel?.refreshGui(); this.pivotDropZonePanel?.refresh(); } setPivotModeSectionVisible(visible) { const colToolPanelFactory = this.colToolPanelFactory; if (!colToolPanelFactory) { return; } this.pivotModePanel = colToolPanelFactory.setPanelVisible( this.pivotModePanel, visible, colToolPanelFactory.createPivotModePanel.bind( colToolPanelFactory, this, this.childDestroyFuncs, this.params, this.onPivotModePanelValueChanged, true ) ); this.setLastVisible(); } setRowGroupsSectionVisible(visible) { const colToolPanelFactory = this.colToolPanelFactory; if (!colToolPanelFactory) { return; } this.rowGroupDropZonePanel = colToolPanelFactory.setPanelVisible( this.rowGroupDropZonePanel, visible, colToolPanelFactory.createRowGroupPanel.bind(colToolPanelFactory, this, this.childDestroyFuncs, this.params) ); this.setLastVisible(); } setValuesSectionVisible(visible) { const colToolPanelFactory = this.colToolPanelFactory; if (!colToolPanelFactory) { return; } this.valuesDropZonePanel = colToolPanelFactory.setPanelVisible( this.valuesDropZonePanel, visible, colToolPanelFactory.createValuesPanel.bind(colToolPanelFactory, this, this.childDestroyFuncs, this.params) ); this.setLastVisible(); } setPivotSectionVisible(visible) { const colToolPanelFactory = this.colToolPanelFactory; if (!colToolPanelFactory) { return; } this.pivotDropZonePanel = colToolPanelFactory.setPanelVisible( this.pivotDropZonePanel, visible, colToolPanelFactory.createPivotPanel.bind(colToolPanelFactory, this, this.childDestroyFuncs, this.params) ); this.pivotDropZonePanel?.setDisplayed(visible); this.setLastVisible(); } setResizers() { for (const panel of [ this.primaryColsPanel, this.rowGroupDropZonePanel, this.valuesDropZonePanel, this.pivotDropZonePanel ]) { if (!panel) { continue; } const eGui = panel.getGui(); panel.toggleResizable( !eGui.classList.contains("ag-last-column-drop") && !eGui.classList.contains("ag-hidden") && !eGui.classList.contains("ag-last-visible-child") ); } } setLastVisible() { const eGui = this.getGui(); const columnDrops = Array.prototype.slice.call(eGui.querySelectorAll(".ag-column-drop")); for (const columnDrop of columnDrops) { columnDrop.classList.remove("ag-last-column-drop"); } const columnDropEls = eGui.querySelectorAll(".ag-column-drop:not(.ag-hidden)"); const lastVisible = _last(columnDropEls); if (lastVisible) { lastVisible.classList.add("ag-last-column-drop"); } this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child", !lastVisible); this.setResizers(); } resetChildrenHeight() { const eGui = this.getGui(); const children = eGui.children; for (let i = 0; i < children.length; i++) { const { style } = children[i]; style.removeProperty("height"); style.removeProperty("flex"); } } expandColumnGroups(groupIds) { this.primaryColsPanel.expandGroups(groupIds); } collapseColumnGroups(groupIds) { this.primaryColsPanel.collapseGroups(groupIds); } setColumnLayout(colDefs) { this.primaryColsPanel.setColumnLayout(colDefs); } syncLayoutWithGrid() { this.primaryColsPanel.syncLayoutWithGrid(); } destroyChildren() { const childDestroyFuncs = this.childDestroyFuncs; for (const func of childDestroyFuncs) { func(); } childDestroyFuncs.length = 0; _clearElement(this.getGui()); } refresh(params) { this.destroyChildren(); this.init(params); return true; } getState() { return { expandedGroupIds: this.primaryColsPanel.getExpandedGroups() }; } destroy() { this.destroyChildren(); super.destroy(); } }; // packages/ag-grid-enterprise/src/widgets/pillDropZonePanel.css var pillDropZonePanel_default = ".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}.ag-column-drop-cell-button:hover{opacity:1}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}.ag-select-agg-func-virtual-list-item:hover{background-color:var(--ag-selected-row-background-color)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}"; // packages/ag-grid-enterprise/src/widgets/pillDropZonePanel.ts function _insertArrayIntoArray(dest, src, toIndex) { if (dest == null || src == null) { return; } dest.splice(toIndex, 0, ...src); } var PillDropZonePanelElement = { tag: "div", cls: "ag-unselectable", role: "presentation" }; var PillDropZonePanel = class extends Component { constructor(horizontal) { super(PillDropZonePanelElement); this.horizontal = horizontal; this.state = "notDragging"; this.guiDestroyFunctions = []; this.childPillComponents = []; this.resizeEnabled = false; this.addElementClasses(this.getGui()); this.ePillDropList = _createElement({ tag: "div" }); this.addElementClasses(this.ePillDropList, "list"); this.registerCSS(pillDropZonePanel_default); } toggleResizable(resizable) { this.positionableFeature.setResizable(resizable ? { bottom: true } : false); this.resizeEnabled = resizable; } isSourceEventFromTarget(draggingEvent) { const { dropZoneTarget, dragSource } = draggingEvent; return dropZoneTarget.contains(dragSource.eElement); } destroy() { this.destroyGui(); super.destroy(); } destroyGui() { for (const func of this.guiDestroyFunctions) { func(); } this.guiDestroyFunctions.length = 0; this.childPillComponents.length = 0; _clearElement(this.getGui()); _clearElement(this.ePillDropList); } init(params) { this.params = params ?? {}; this.createManagedBean( new ManagedFocusFeature(this.getFocusableElement(), { onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.onKeyDown.bind(this) }) ); this.setupDropTarget(); this.positionableFeature = new PositionableFeature(this.getGui()); this.createManagedBean(this.positionableFeature); this.refreshGui(); _setAriaLabel(this.ePillDropList, this.getAriaLabel()); } onTabKeyDown(e) { const focusableElements = _findFocusableElements(this.getFocusableElement(), null, true); const len = focusableElements.length; if (len === 0) { return; } const { shiftKey } = e; const activeEl = _getActiveDomElement(this.beans); const isFirstFocused = activeEl === focusableElements[0]; const isLastFocused = activeEl === _last(focusableElements); const shouldAllowDefaultTab = len === 1 || isFirstFocused && shiftKey || isLastFocused && !shiftKey; if (!shouldAllowDefaultTab) { focusableElements[shiftKey ? 0 : len - 1].focus(); } } onKeyDown(e) { const { key } = e; const isVertical = !this.horizontal; let isNext = key === KeyCode.DOWN; let isPrevious = key === KeyCode.UP; if (!isVertical) { const isRtl = this.gos.get("enableRtl"); isNext = !isRtl && key === KeyCode.RIGHT || isRtl && key === KeyCode.LEFT; isPrevious = !isRtl && key === KeyCode.LEFT || isRtl && key === KeyCode.RIGHT; } if (!isNext && !isPrevious) { return; } e.preventDefault(); if (e.shiftKey) { this.moveFocusedItem(isPrevious); } else { const el = _findNextFocusableElement(this.beans, this.getFocusableElement(), false, isPrevious); if (el) { el.focus(); } } } moveFocusedItem(isPrevious) { const currentItemIndex = this.getFocusedItem(); if (currentItemIndex === -1) { return; } const diff = isPrevious ? -1 : 1; const changed = this.normalizeAndUpdateInsertIndex(currentItemIndex, currentItemIndex + diff); if (!changed) { return; } const comp = this.childPillComponents[currentItemIndex]; if (!comp.isMovable()) { return; } const currentItem = comp.getItem(); this.focusItemAtIndex(this.insertIndex); this.rearrangeItems([currentItem], true); } addElementClasses(el, suffix) { suffix = suffix ? `-${suffix}` : ""; const direction = this.horizontal ? "horizontal" : "vertical"; el.classList.add(`ag-column-drop${suffix}`, `ag-column-drop-${direction}${suffix}`); } setupDropTarget() { this.dropTarget = { getContainer: this.getGui.bind(this), getIconName: this.getIconName.bind(this), onDragging: this.onDragging.bind(this), onDragEnter: this.onDragEnter.bind(this), onDragLeave: this.onDragLeave.bind(this), onDragStop: this.onDragStop.bind(this), onDragCancel: this.onDragCancel.bind(this), isInterestedIn: this.isInterestedIn.bind(this) }; this.beans.dragAndDrop?.addDropTarget(this.dropTarget); } minimumAllowedNewInsertIndex() { return 0; } checkInsertIndex(draggingEvent) { const newIndex = this.getNewInsertIndex(draggingEvent); if (newIndex < 0) { return false; } return this.normalizeAndUpdateInsertIndex(this.insertIndex, newIndex); } normalizeAndUpdateInsertIndex(currentIndex, index) { const minimumAllowedIndex = this.minimumAllowedNewInsertIndex(); const newAdjustedIndex = Math.max(minimumAllowedIndex, index); const changed = newAdjustedIndex !== currentIndex; if (changed) { this.insertIndex = newAdjustedIndex; } return changed; } getNewInsertIndex(draggingEvent) { const mouseEvent = draggingEvent.event; const mouseLocation = this.horizontal ? mouseEvent.clientX : mouseEvent.clientY; const boundsList = this.childPillComponents.map((comp) => comp.getGui().getBoundingClientRect()); const hoveredIndex = boundsList.findIndex( (rect) => this.horizontal ? rect.right > mouseLocation && rect.left < mouseLocation : rect.top < mouseLocation && rect.bottom > mouseLocation ); if (hoveredIndex === -1) { const enableRtl = this.gos.get("enableRtl"); const isLast = boundsList.every((rect) => mouseLocation > (this.horizontal ? rect.right : rect.bottom)); if (isLast) { return enableRtl && this.horizontal ? 0 : this.childPillComponents.length; } const isFirst = boundsList.every((rect) => mouseLocation < (this.horizontal ? rect.left : rect.top)); if (isFirst) { return enableRtl && this.horizontal ? this.childPillComponents.length : 0; } return this.insertIndex; } if (this.insertIndex <= hoveredIndex) { return hoveredIndex + 1; } return hoveredIndex; } checkDragStartedBySelf(draggingEvent) { if (this.state !== "notDragging") { return; } this.state = "rearrangeItems"; this.potentialDndItems = this.getItems(draggingEvent.dragSource.getDragItem()); this.refreshGui(); this.checkInsertIndex(draggingEvent); this.refreshGui(); } onDragging(draggingEvent) { this.checkDragStartedBySelf(draggingEvent); if (this.checkInsertIndex(draggingEvent)) { this.refreshGui(); } } handleDragEnterEnd(_) { } onDragEnter(draggingEvent) { const dragItems = this.getItems(draggingEvent.dragSource.getDragItem()); this.state = "newItemsIn"; const goodDragItems = dragItems.filter((item) => this.isItemDroppable(item, draggingEvent)); const alreadyPresent = goodDragItems.every( (item) => this.childPillComponents.map((cmp) => cmp.getItem()).indexOf(item) !== -1 ); if (goodDragItems.length === 0) { return; } this.potentialDndItems = goodDragItems; if (alreadyPresent) { this.state = "notDragging"; return; } this.handleDragEnterEnd(draggingEvent); this.checkInsertIndex(draggingEvent); this.refreshGui(); } isPotentialDndItems() { return !!this.potentialDndItems?.length; } handleDragLeaveEnd(_) { } onDragLeave(draggingEvent) { if (this.state === "rearrangeItems") { const items = this.getItems(draggingEvent.dragSource.getDragItem()); this.removeItems(items); } if (this.isPotentialDndItems()) { this.handleDragLeaveEnd(draggingEvent); this.potentialDndItems = []; this.refreshGui(); } this.state = "notDragging"; } onDragCancel(draggingEvent) { if (this.isPotentialDndItems()) { if (this.state === "newItemsIn") { this.handleDragLeaveEnd(draggingEvent); } this.potentialDndItems = []; this.refreshGui(); } this.state = "notDragging"; } onDragStop() { if (this.isPotentialDndItems()) { if (this.state === "newItemsIn") { this.addItems(this.potentialDndItems); } else { this.rearrangeItems(this.potentialDndItems); } this.potentialDndItems = []; this.refreshGui(); } this.state = "notDragging"; } removeItems(itemsToRemove) { const newItemList = this.getExistingItems().filter((item) => !itemsToRemove.includes(item)); this.updateItems(newItemList); this.refreshGui(); } addItems(itemsToAdd) { if (!itemsToAdd) { return; } const newItemList = this.getExistingItems().slice(); const itemsToAddNoDuplicates = itemsToAdd.filter((item) => newItemList.indexOf(item) < 0); _insertArrayIntoArray(newItemList, itemsToAddNoDuplicates, this.insertIndex); this.updateItems(newItemList); this.refreshGui(); } addItem(item) { this.insertIndex = this.getExistingItems().length; this.addItems([item]); } rearrangeItems(itemsToAdd, fromKeyboard) { let newItemList; if (!fromKeyboard) { newItemList = this.getNonGhostItems().slice(); } else { newItemList = this.getExistingItems().filter((item) => itemsToAdd.indexOf(item) === -1); } _insertArrayIntoArray(newItemList, itemsToAdd, this.insertIndex); if (_areEqual(newItemList, this.getExistingItems())) { return false; } this.updateItems(newItemList); this.refreshGui(); return true; } refreshGui() { let scrollTop = 0; if (!this.horizontal) { scrollTop = this.ePillDropList.scrollTop; } const resizeEnabled = this.resizeEnabled; const focusedIndex = this.getFocusedItem(); const { eGridDiv } = this.beans; const isKeyboardMode = _isKeyboardMode(); let alternateElement = null; if (isKeyboardMode) { alternateElement = _findNextFocusableElement(this.beans, eGridDiv) ?? _findNextFocusableElement(this.beans, eGridDiv, false, true); } this.toggleResizable(false); this.destroyGui(); this.addIconAndTitleToGui(); this.addEmptyMessageToGui(); this.addItemsToGui(); if (scrollTop !== 0) { this.ePillDropList.scrollTop = scrollTop; } if (resizeEnabled) { this.toggleResizable(resizeEnabled); } if (isKeyboardMode) { this.restoreFocus(focusedIndex, alternateElement); } } getFocusedItem() { const eGui = this.getGui(); const activeElement = _getActiveDomElement(this.beans); if (!eGui.contains(activeElement)) { return -1; } const items = Array.from(eGui.querySelectorAll(".ag-column-drop-cell")); return items.indexOf(activeElement); } focusItemAtIndex(index) { const eGui = this.getGui(); const items = Array.from(eGui.querySelectorAll(".ag-column-drop-cell")); const item = items[index]; if (!item) { return; } item.focus({ preventScroll: true }); } restoreFocus(index, alternateElement) { const eGui = this.getGui(); const items = Array.from(eGui.querySelectorAll(".ag-column-drop-cell")); if (index === -1) { return; } if (items.length === 0) { alternateElement.focus(); } const indexToFocus = Math.min(items.length - 1, index); const el = items[indexToFocus]; if (el) { el.focus(); } } focusList(fromBottom) { const index = fromBottom ? this.childPillComponents.length - 1 : 0; this.restoreFocus(index, this.getFocusableElement()); } getNonGhostItems() { const existingItems = this.getExistingItems(); if (this.isPotentialDndItems()) { return existingItems.filter((item) => !this.potentialDndItems.includes(item)); } return existingItems; } addItemsToGui() { const nonGhostItems = this.getNonGhostItems(); const itemsToAddToGui = nonGhostItems.map((item) => this.createItemComponent(item, false)); if (this.isPotentialDndItems()) { const dndItems = this.potentialDndItems.map((item) => this.createItemComponent(item, true)); if (this.insertIndex >= itemsToAddToGui.length) { itemsToAddToGui.push(...dndItems); } else { itemsToAddToGui.splice(this.insertIndex, 0, ...dndItems); } } this.appendChild(this.ePillDropList); itemsToAddToGui.forEach((itemComponent, index) => { if (index > 0) { this.addArrow(this.ePillDropList); } this.ePillDropList.appendChild(itemComponent.getGui()); }); this.addAriaLabelsToComponents(); } addAriaLabelsToComponents() { const { childPillComponents, ePillDropList } = this; const len = childPillComponents.length; _setAriaRole(ePillDropList, len === 0 ? "presentation" : "listbox"); for (let i = 0; i < len; i++) { const comp = childPillComponents[i]; const eGui = comp.getGui(); _setAriaPosInSet(eGui, i + 1); _setAriaSetSize(eGui, len); } } createItemComponent(item, ghost) { const itemComponent = this.createPillComponent(item, this.dropTarget, ghost, this.horizontal); itemComponent.addEventListener("columnRemove", this.removeItems.bind(this, [item])); this.createBean(itemComponent); this.guiDestroyFunctions.push(() => this.destroyBean(itemComponent)); if (!ghost) { this.childPillComponents.push(itemComponent); } return itemComponent; } addIconAndTitleToGui() { const { title, icon: eGroupIcon } = this.params; if (!title || !eGroupIcon) { return; } const eTitleBar = _createElement({ tag: "div" }); _setAriaHidden(eTitleBar, true); this.addElementClasses(eTitleBar, "title-bar"); this.addElementClasses(eGroupIcon, "icon"); this.toggleCss("ag-column-drop-empty", this.isExistingItemsEmpty()); eTitleBar.appendChild(eGroupIcon); if (!this.horizontal) { const eTitle = _createElement({ tag: "span" }); this.addElementClasses(eTitle, "title"); eTitle.textContent = title; eTitleBar.appendChild(eTitle); } this.appendChild(eTitleBar); } isExistingItemsEmpty() { return this.getExistingItems().length === 0; } addEmptyMessageToGui() { const { emptyMessage } = this.params; if (!emptyMessage || !this.isExistingItemsEmpty() || this.isPotentialDndItems()) { return; } const eMessage = _createElement({ tag: "span" }); eMessage.textContent = emptyMessage; this.addElementClasses(eMessage, "empty-message"); this.ePillDropList.appendChild(eMessage); } addArrow(eParent) { if (this.horizontal) { const enableRtl = this.gos.get("enableRtl"); const icon = _createIconNoSpan(enableRtl ? "panelDelimiterRtl" : "panelDelimiter", this.beans); this.addElementClasses(icon, "cell-separator"); eParent.appendChild(icon); } } }; // packages/ag-grid-enterprise/src/widgets/pillDragComp.ts var PillDragCompElement = { tag: "span", role: "option", children: [ { tag: "span", ref: "eDragHandle", cls: "ag-drag-handle ag-column-drop-cell-drag-handle", role: "presentation" }, { tag: "span", ref: "eText", cls: "ag-column-drop-cell-text", attrs: { "aria-hidden": "true" } }, { tag: "span", ref: "eButton", cls: "ag-column-drop-cell-button", role: "presentation" } ] }; var PillDragComp = class extends Component { constructor(dragSourceDropTarget, ghost, horizontal, template, agComponents) { super(); this.dragSourceDropTarget = dragSourceDropTarget; this.ghost = ghost; this.horizontal = horizontal; this.template = template; this.agComponents = agComponents; this.eText = RefPlaceholder; this.eDragHandle = RefPlaceholder; this.eButton = RefPlaceholder; } postConstruct() { this.setTemplate(this.template ?? PillDragCompElement, this.agComponents); const eGui = this.getGui(); const { beans, eDragHandle, eText, eButton } = this; this.addElementClasses(eGui); this.addElementClasses(eDragHandle, "drag-handle"); this.addElementClasses(eText, "text"); this.addElementClasses(eButton, "button"); eDragHandle.appendChild(_createIconNoSpan("columnDrag", beans)); eButton.appendChild(_createIconNoSpan("cancel", beans)); this.tooltipFeature = this.createOptionalManagedBean( beans.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.getGui() }) ); this.setupComponents(); if (!this.ghost && this.isDraggable()) { this.addDragSource(); } this.setupAria(); this.setupTooltip(); this.activateTabIndex(); this.refreshDraggable(); } isDraggable() { return true; } refreshDraggable() { this.eDragHandle.classList.toggle("ag-column-select-column-readonly", !this.isDraggable()); } setupAria() { const translate = this.getLocaleTextFunc(); const ariaInstructions = [this.getAriaDisplayName()]; this.addAdditionalAriaInstructions(ariaInstructions, translate); _setAriaLabel(this.getGui(), ariaInstructions.join(". ")); } addAdditionalAriaInstructions(ariaInstructions, translate) { if (this.isRemovable()) { const deleteAria = translate("ariaDropZoneColumnComponentDescription", "Press DELETE to remove"); ariaInstructions.push(deleteAria); } } setupTooltip() { const refresh = () => this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip()); refresh(); this.addManagedEventListeners({ newColumnsLoaded: refresh }); } getDragSourceId() { return void 0; } getDefaultIconName() { return "notAllowed"; } addDragSource() { const { beans: { dragAndDrop }, eDragHandle } = this; const getDragItem = this.createGetDragItem(); const defaultIconName = this.getDefaultIconName(); const dragSource = { type: this.getDragSourceType(), sourceId: this.getDragSourceId(), eElement: eDragHandle, getDefaultIconName: () => defaultIconName, getDragItem, dragItemName: this.getDisplayName() }; dragAndDrop?.addDragSource(dragSource, true); this.addDestroyFunc(() => dragAndDrop?.removeDragSource(dragSource)); } setupComponents() { this.eText.textContent = this.getDisplayValue(); this.setupRemove(); if (this.ghost) { this.addCss("ag-column-drop-cell-ghost"); } } isRemovable() { return true; } refreshRemove() { _setDisplayed(this.eButton, this.isRemovable()); } setupRemove() { this.refreshRemove(); const agEvent = { type: "columnRemove" }; this.addGuiEventListener("keydown", (e) => this.onKeyDown(e)); this.addManagedElementListeners(this.eButton, { click: (mouseEvent) => { this.dispatchLocalEvent(agEvent); mouseEvent.stopPropagation(); } }); const touchListener = new TouchListener(this.eButton); this.addManagedListeners(touchListener, { tap: () => this.dispatchLocalEvent(agEvent) }); this.addDestroyFunc(touchListener.destroy.bind(touchListener)); } onKeyDown(e) { const isDelete = e.key === KeyCode.DELETE; if (isDelete) { if (this.isRemovable()) { e.preventDefault(); this.dispatchLocalEvent({ type: "columnRemove" }); } } } getDisplayValue() { return this.getDisplayName(); } addElementClasses(el, suffix) { suffix = suffix ? `-${suffix}` : ""; const direction = this.horizontal ? "horizontal" : "vertical"; el.classList.add(`ag-column-drop-cell${suffix}`, `ag-column-drop-${direction}-cell${suffix}`); } destroy() { super.destroy(); this.dragSourceDropTarget = null; } }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/dropZoneColumnComp.ts var DropZoneColumnComp = class extends PillDragComp { constructor(column, dragSourceDropTarget, ghost, dropZonePurpose, horizontal, updateParams) { super(dragSourceDropTarget, ghost, horizontal); this.column = column; this.dropZonePurpose = dropZonePurpose; this.updateParams = updateParams; this.eSortIndicator = RefPlaceholder; this.popupShowing = false; this.deferApply = isDeferredMode(updateParams); } postConstruct() { const { sortSvc, colNames } = this.beans; this.template = { tag: "span", role: "option", children: [ { tag: "span", ref: "eDragHandle", cls: "ag-drag-handle ag-column-drop-cell-drag-handle", role: "presentation" }, { tag: "span", ref: "eText", cls: "ag-column-drop-cell-text", attrs: { "aria-hidden": "true" } }, sortSvc ? { tag: "ag-sort-indicator", ref: "eSortIndicator" } : void 0, { tag: "span", ref: "eButton", cls: "ag-column-drop-cell-button", role: "presentation" } ] }; if (sortSvc) { this.agComponents = [sortSvc.getSortIndicatorSelector()]; } this.displayName = colNames.getDisplayNameForColumn(this.column, "columnDrop"); super.postConstruct(); if (this.deferApply) { this.eDragHandle.setAttribute("data-column-tool-panel-deferred", ""); } if (sortSvc) { this.setupSort(); this.addManagedEventListeners({ sortChanged: () => { this.setupAria(); } }); } if (this.isGroupingZone()) { this.addManagedPropertyListener("groupLockGroupColumns", () => { this.refreshRemove(); this.refreshDraggable(); this.setupAria(); }); } } getItem() { return this.column; } getDisplayName() { return this.displayName; } getTooltip() { return this.column.getColDef().headerTooltip; } addAdditionalAriaInstructions(ariaInstructions, translate) { const isSortSuppressed = this.gos.get("rowGroupPanelSuppressSort"); const isFunctionsReadOnly = this.gos.get("functionsReadOnly"); if (this.isAggregationZone() && !isFunctionsReadOnly) { const aggregationMenuAria = translate( "ariaDropZoneColumnValueItemDescription", "Press ENTER to change the aggregation type" ); ariaInstructions.push(aggregationMenuAria); } if (this.isGroupingZone() && this.column.isSortable() && !isSortSuppressed) { const sortProgressAria = translate("ariaDropZoneColumnGroupItemDescription", "Press ENTER to sort"); ariaInstructions.push(sortProgressAria); } super.addAdditionalAriaInstructions(ariaInstructions, translate); } isMovable() { return this.isDraggable(); } isDraggable() { return this.isReadOnly(); } isRemovable() { return this.isReadOnly(); } isReadOnly() { return !this.isGroupingAndLocked() && !this.gos.get("functionsReadOnly"); } getAriaDisplayName() { const translate = this.getLocaleTextFunc(); const { name, aggFuncName } = this.getColumnAndAggFuncName(); const aggSeparator = translate("ariaDropZoneColumnComponentAggFuncSeparator", " of "); const sortDirection = { asc: translate("ariaDropZoneColumnComponentSortAscending", "ascending"), desc: translate("ariaDropZoneColumnComponentSortDescending", "descending") }; const columnSort = this.getCurrentSortDirection(this.column); const isSortSuppressed = this.gos.get("rowGroupPanelSuppressSort"); return [ aggFuncName && `${aggFuncName}${aggSeparator}`, name, this.isGroupingZone() && !isSortSuppressed && columnSort && `, ${sortDirection[columnSort]}` ].filter((part) => !!part).join(""); } getColumnAndAggFuncName() { const name = this.displayName; let aggFuncName = ""; if (this.isAggregationZone()) { const aggFunc = this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply, this.column); const aggFuncString = typeof aggFunc === "string" ? aggFunc : "agg"; const localeTextFunc = this.getLocaleTextFunc(); aggFuncName = localeTextFunc(aggFuncString, aggFuncString); } return { name, aggFuncName }; } setupSort() { if (!this.column.isSortable() || !this.isGroupingZone()) { return; } const { gos, column, eSortIndicator } = this; if (!gos.get("rowGroupPanelSuppressSort")) { eSortIndicator.setupSort(column, true, this.getSortDefOverride.bind(this)); const performSort = (event) => { event.preventDefault(); this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply, column, event); eSortIndicator.refresh(); this.setupAria(); refreshDeferredToolPanelUi(this.beans, this.updateParams); }; this.addGuiEventListener("click", performSort); this.addGuiEventListener("keydown", (e) => { const isEnter = e.key === KeyCode.ENTER; if (isEnter && this.isGroupingZone()) { performSort(e); } }); } } getCurrentSortDirection(column) { return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply, column)?.direction ?? null; } getSortDefOverride() { if (!this.deferApply) { return void 0; } return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply, this.column); } getDefaultIconName() { return "hide"; } createGetDragItem() { const { column } = this; return () => { const visibleState = {}; visibleState[column.getId()] = column.isVisible(); return { columns: [column], visibleState }; }; } setupComponents() { super.setupComponents(); if (this.isAggregationZone() && !this.gos.get("functionsReadOnly")) { this.addGuiEventListener("click", this.onShowAggFuncSelection.bind(this)); } } onKeyDown(e) { super.onKeyDown(e); const isEnter = e.key === KeyCode.ENTER; if (isEnter && this.isAggregationZone() && !this.gos.get("functionsReadOnly")) { e.preventDefault(); this.onShowAggFuncSelection(); } } getDisplayValue() { const { name, aggFuncName } = this.getColumnAndAggFuncName(); return this.isAggregationZone() ? `${aggFuncName}(${name})` : name; } onShowAggFuncSelection() { if (this.popupShowing) { return; } this.popupShowing = true; const { aggFuncSvc, popupSvc } = this.beans; const virtualList = new VirtualList({ cssIdentifier: "select-agg-func" }); const rows = aggFuncSvc.getFuncNames(this.column); const eGui = this.getGui(); const virtualListGui = virtualList.getGui(); virtualList.setModel({ getRow: function(index) { return rows[index]; }, getRowCount: function() { return rows.length; } }); this.createBean(virtualList); const ePopup = _createElement({ tag: "div", cls: "ag-select-agg-func-popup" }); ePopup.style.top = "0px"; ePopup.style.left = "0px"; ePopup.appendChild(virtualListGui); ePopup.style.width = `${eGui.clientWidth}px`; const [focusoutListener] = this.addManagedElementListeners(ePopup, { focusout: (e) => { if (!ePopup.contains(e.relatedTarget) && addPopupRes) { addPopupRes.hideFunc(); } } }); const popupHiddenFunc = (callbackEvent) => { this.destroyBean(virtualList); this.popupShowing = false; if (callbackEvent?.key === "Escape") { eGui.focus(); } if (focusoutListener) { focusoutListener(); } }; const translate = this.getLocaleTextFunc(); const addPopupRes = popupSvc.addPopup({ modal: true, eChild: ePopup, closeOnEsc: true, closedCallback: popupHiddenFunc, ariaLabel: translate("ariaLabelAggregationFunction", "Aggregation Function") }); if (addPopupRes) { virtualList.setComponentCreator(this.createAggSelect.bind(this, addPopupRes.hideFunc)); } virtualList.addGuiEventListener("keydown", (e) => { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { const row = virtualList.getLastFocusedRow(); if (row == null) { return; } const comp = virtualList.getComponentAt(row); if (comp) { comp.selectItem(); } } }); popupSvc.positionPopupByComponent({ type: "aggFuncSelect", eventSource: eGui, ePopup, keepWithinBounds: true, additionalParams: { column: this.column }, position: "under" }); virtualList.refresh(); const currentAggFunc = this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply, this.column); let rowToFocus = rows.findIndex((r) => r === currentAggFunc); if (rowToFocus === -1) { rowToFocus = 0; } virtualList.focusRow(rowToFocus); } createAggSelect(hidePopup, value) { const itemSelected = () => { hidePopup(); this.getGui().focus(); this.beans.columnStateUpdateStrategy.setColumnAggFunc( this.deferApply, this.column, value, "toolPanelDragAndDrop" ); if (this.column) { const eText = this.getGui().querySelector(".ag-column-drop-cell-text"); if (eText) { eText.textContent = this.getDisplayValue(); } this.setupAria(); } refreshDeferredToolPanelUi(this.beans, this.updateParams); }; const localeTextFunc = this.getLocaleTextFunc(); const aggFuncString = (value || "").toString(); const aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString); const comp = new AggItemComp(itemSelected, aggFuncStringTranslated); return comp; } isGroupingAndLocked() { return this.isGroupingZone() && isRowGroupColLocked(this.column, this.beans); } isAggregationZone() { return this.dropZonePurpose === "aggregation"; } isGroupingZone() { return this.dropZonePurpose === "rowGroup"; } getDragSourceType() { return DragSourceType.ToolPanel; } destroy() { super.destroy(); this.column = null; } }; var AggItemComp = class extends Component { constructor(itemSelected, value) { super({ tag: "div", cls: "ag-select-agg-func-item", children: value }); this.selectItem = itemSelected; this.addGuiEventListener("click", this.selectItem); } }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/baseDropZonePanel.ts var BaseDropZonePanel = class extends PillDropZonePanel { constructor(horizontal, dropZonePurpose, updateParams) { super(horizontal); this.dropZonePurpose = dropZonePurpose; this.updateParams = updateParams; this.addElementClasses(this.getGui(), this.dropZonePurpose.toLowerCase()); } init(params) { super.init(params); this.addManagedEventListeners({ newColumnsLoaded: this.refreshGui.bind(this) }); this.addManagedPropertyListeners( ["functionsReadOnly", "rowGroupPanelSuppressSort", "groupLockGroupColumns"], this.refreshGui.bind(this) ); } getItems(dragItem) { return dragItem.columns ?? []; } isInterestedIn(type, sourceElement) { if (type === DragSourceType.HeaderCell) { return true; } if (type !== DragSourceType.ToolPanel) { return false; } if (!this.horizontal) { return true; } return !sourceElement.hasAttribute("data-column-tool-panel-deferred"); } minimumAllowedNewInsertIndex() { const { gos, rowGroupColsSvc } = this.beans; const numberOfLockedCols = gos.get("groupLockGroupColumns"); const numberOfGroupCols = rowGroupColsSvc?.columns.length ?? 0; if (numberOfLockedCols === -1) { return numberOfGroupCols; } return Math.min(numberOfLockedCols, numberOfGroupCols); } showOrHideColumnOnExit(draggingEvent) { return this.isRowGroupPanel() && _shouldUpdateColVisibilityAfterGroup(this.gos, true) && !draggingEvent.fromNudge; } handleDragEnterEnd(draggingEvent) { const hideColumnOnExit = this.showOrHideColumnOnExit(draggingEvent); if (hideColumnOnExit) { const dragItem = draggingEvent.dragSource.getDragItem(); const columns = dragItem.columns; this.setColumnsVisible(columns, false, "uiColumnDragged"); } } handleDragLeaveEnd(draggingEvent) { const showColumnOnExit = this.showOrHideColumnOnExit(draggingEvent); if (showColumnOnExit) { const dragItem = draggingEvent.dragSource.getDragItem(); this.setColumnsVisible(dragItem.columns, true, "uiColumnDragged"); } } setColumnsVisible(columns, visible, source) { if (!columns) { return; } if (isDeferredMode(this.updateParams)) { return; } const allowedCols = columns.filter((c) => !c.getColDef().lockVisible); this.beans.columnStateUpdateStrategy.setColumnsVisible(false, allowedCols, visible, source); } isRowGroupPanel() { return this.dropZonePurpose === "rowGroup"; } createPillComponent(column, dropTarget, ghost, horizontal) { return new DropZoneColumnComp(column, dropTarget, ghost, this.dropZonePurpose, horizontal, this.updateParams); } }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/pivotDropZonePanel.ts var PivotDropZonePanel = class extends BaseDropZonePanel { constructor(horizontal, params) { super(horizontal, "pivot", params); } postConstruct() { const localeTextFunc = this.getLocaleTextFunc(); const emptyMessage = localeTextFunc("pivotColumnsEmptyMessage", "Drag here to set column labels"); const title = localeTextFunc("pivots", "Column Labels"); super.init({ icon: _createIconNoSpan("pivotPanel", this.beans, null), emptyMessage, title }); if (this.horizontal) { _addFocusableContainerListener(this.beans, this, this.getGui()); } this.addManagedEventListeners({ newColumnsLoaded: this.refresh.bind(this), columnPivotChanged: this.refresh.bind(this), columnPivotModeChanged: this.checkVisibility.bind(this) }); this.refresh(); } getAriaLabel() { const translate = this.getLocaleTextFunc(); return translate("ariaPivotDropZonePanelLabel", "Column Labels"); } refresh() { this.checkVisibility(); this.refreshGui(); } checkVisibility() { const colModel = this.beans.colModel; const pivotMode = colModel.isPivotMode(); if (this.horizontal) { switch (this.gos.get("pivotPanelShow")) { case "always": this.setDisplayed(pivotMode); break; case "onlyWhenPivoting": { const pivotActive = colModel.isPivotActive(); this.setDisplayed(pivotMode && pivotActive); break; } default: this.setDisplayed(false); break; } } else { this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(isDeferredMode(this.updateParams))); } } isItemDroppable(column, draggingEvent) { if (this.gos.get("functionsReadOnly") || !column.isPrimary()) { return false; } const isActive = this.beans.columnStateUpdateStrategy.getPivotColumns(isDeferredMode(this.updateParams)).includes(column); return column.isAllowPivot() && (!isActive || this.isSourceEventFromTarget(draggingEvent)); } updateItems(columns) { this.beans.columnStateUpdateStrategy.setPivotColumns(isDeferredMode(this.updateParams), columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.updateParams); } getIconName() { return this.isPotentialDndItems() ? "pivot" : "notAllowed"; } getExistingItems() { return this.beans.columnStateUpdateStrategy.getPivotColumns(isDeferredMode(this.updateParams)); } getFocusableContainerName() { return "pivotToolbar"; } }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/rowGroupDropZonePanel.ts var RowGroupDropZonePanel = class extends BaseDropZonePanel { constructor(horizontal, params) { super(horizontal, "rowGroup", params); } postConstruct() { const localeTextFunc = this.getLocaleTextFunc(); const emptyMessage = localeTextFunc("rowGroupColumnsEmptyMessage", "Drag here to set row groups"); const title = localeTextFunc("groups", "Row Groups"); super.init({ icon: _createIconNoSpan("rowGroupPanel", this.beans, null), emptyMessage, title }); if (this.horizontal) { _addFocusableContainerListener(this.beans, this, this.getGui()); } this.addManagedEventListeners({ columnRowGroupChanged: this.refreshGui.bind(this) }); } getAriaLabel() { const translate = this.getLocaleTextFunc(); const label = translate("ariaRowGroupDropZonePanelLabel", "Row Groups"); return label; } isItemDroppable(column, draggingEvent) { if (this.gos.get("functionsReadOnly") || !column.isPrimary() || column.colDef.showRowGroup) { return false; } const isActive = this.beans.columnStateUpdateStrategy.getRowGroupColumns(isDeferredMode(this.updateParams)).includes(column); return column.isAllowRowGroup() && (!isActive || this.isSourceEventFromTarget(draggingEvent)); } updateItems(columns) { this.beans.columnStateUpdateStrategy.setRowGroupColumns( isDeferredMode(this.updateParams), columns, "toolPanelUi" ); refreshDeferredToolPanelUi(this.beans, this.updateParams); } getIconName() { return this.isPotentialDndItems() ? "group" : "notAllowed"; } getExistingItems() { return this.beans.columnStateUpdateStrategy.getRowGroupColumns(isDeferredMode(this.updateParams)); } getFocusableContainerName() { return "rowGroupToolbar"; } }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/valueDropZonePanel.ts var ValuesDropZonePanel = class extends BaseDropZonePanel { constructor(horizontal, params) { super(horizontal, "aggregation", params); } postConstruct() { const localeTextFunc = this.getLocaleTextFunc(); const emptyMessage = localeTextFunc("valueColumnsEmptyMessage", "Drag here to aggregate"); const title = localeTextFunc("values", "Values"); super.init({ icon: _createIconNoSpan("valuePanel", this.beans, null), emptyMessage, title }); this.addManagedEventListeners({ columnValueChanged: this.refreshGui.bind(this) }); } getAriaLabel() { const translate = this.getLocaleTextFunc(); const label = translate("ariaValuesDropZonePanelLabel", "Values"); return label; } getIconName() { return this.isPotentialDndItems() ? "aggregate" : "notAllowed"; } isItemDroppable(column, draggingEvent) { if (this.gos.get("functionsReadOnly") || !column.isPrimary()) { return false; } const isActive = this.beans.columnStateUpdateStrategy.getValueColumns(isDeferredMode(this.updateParams)).includes(column); return column.isAllowValue() && (!isActive || this.isSourceEventFromTarget(draggingEvent)); } updateItems(columns) { this.beans.columnStateUpdateStrategy.setValueColumns(isDeferredMode(this.updateParams), columns, "toolPanelUi"); refreshDeferredToolPanelUi(this.beans, this.updateParams); } getExistingItems() { return this.beans.columnStateUpdateStrategy.getValueColumns(isDeferredMode(this.updateParams)); } }; // packages/ag-grid-enterprise/src/columnToolPanel/pivotModePanel.ts var PivotModePanelElement = { tag: "div", cls: "ag-pivot-mode-panel", children: [ { tag: "ag-toggle-button", ref: "cbPivotMode", cls: "ag-pivot-mode-select" } ] }; var PivotModePanel = class extends Component { constructor(params, onPivotModeValueChanged) { super(); this.params = params; this.onPivotModeValueChanged = onPivotModeValueChanged; this.cbPivotMode = RefPlaceholder; } getCurrentPivotMode() { return this.beans.columnStateUpdateStrategy.getPivotMode(isDeferredMode(this.params)); } syncFromGrid() { this.cbPivotMode.setValue(this.getCurrentPivotMode()); } refreshEditStrategy() { this.syncFromGrid(); } postConstruct() { this.setTemplate(PivotModePanelElement, [AgToggleButtonSelector]); const cbPivotMode = this.cbPivotMode; cbPivotMode.setValue(this.getCurrentPivotMode()); const localeTextFunc = this.getLocaleTextFunc(); cbPivotMode.setLabel(localeTextFunc("pivotMode", "Pivot Mode")); const onBtPivotMode = () => { const newValue = !!cbPivotMode.getValue(); this.beans.columnStateUpdateStrategy.setPivotMode(isDeferredMode(this.params), newValue, "toolPanelUi"); this.onPivotModeValueChanged?.(); }; const onPivotModeChanged = () => { cbPivotMode.setValue(this.getCurrentPivotMode()); }; this.addManagedListeners(cbPivotMode, { fieldValueChanged: onBtPivotMode }); this.addManagedEventListeners({ newColumnsLoaded: onPivotModeChanged, columnPivotModeChanged: onPivotModeChanged }); } }; // packages/ag-grid-enterprise/src/columnToolPanel/columnToolPanelFactory.ts var ColumnToolPanelFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colToolPanelFactory"; } setPanelVisible(existingPanel, visible, createFunc) { if (existingPanel) { existingPanel.setDisplayed(visible); } else if (visible) { existingPanel = createFunc(); } return existingPanel; } createRowGroupPanel(parent, destroyFuncs, params) { return this.createPanel(parent, destroyFuncs, new RowGroupDropZonePanel(false, params)); } createValuesPanel(parent, destroyFuncs, params) { return this.createPanel(parent, destroyFuncs, new ValuesDropZonePanel(false, params)); } createPivotPanel(parent, destroyFuncs, params) { return this.createPanel(parent, destroyFuncs, new PivotDropZonePanel(false, params)); } createPivotModePanel(parent, destroyFuncs, params, onPivotModeValueChanged, prepend) { return this.createPanel(parent, destroyFuncs, new PivotModePanel(params, onPivotModeValueChanged), prepend); } createPanel(parent, destroyFuncs, panel, prepend) { panel = parent.createBean(panel); destroyFuncs.push(() => parent.destroyBean(panel)); if (prepend) { parent.prependChild(panel); } else { parent.appendChild(panel); } return panel; } }; // packages/ag-grid-enterprise/src/columnToolPanel/updates/columnStateUpdateExecutionStrategy.ts var noop = () => { }; var ColumnStateUpdateExecutionStrategy = class extends BeanStub { constructor() { super(...arguments); this.beanName = "columnStateUpdateExecutionStrategy"; } applyColumnState(deferMode, state, eventType) { this.getUpdateStrategy(deferMode).applyColumnState(state, eventType); } commit(deferMode) { this.getUpdateStrategy(deferMode).commit(); } hasPendingChanges(deferMode) { return this.getUpdateStrategy(deferMode).hasPendingChanges(); } moveColumns(deferMode, columns, targetIndex, eventType) { this.getUpdateStrategy(deferMode).moveColumns(columns, targetIndex, eventType); } reset(deferMode) { this.getUpdateStrategy(deferMode).reset(); } setColumnsVisible(deferMode, columns, visible, eventType) { this.getUpdateStrategy(deferMode).setColumnsVisible(columns, visible, eventType); } isColumnVisibleInToolPanel(deferMode, column) { return this.getUpdateStrategy(deferMode).isColumnVisibleInToolPanel(column); } setRowGroupColumns(deferMode, columns, eventType) { this.getUpdateStrategy(deferMode).setRowGroupColumns(columns, eventType); } getRowGroupColumns(deferMode) { return this.getUpdateStrategy(deferMode).getRowGroupColumns(); } getPrimaryColumns(deferMode) { return this.getUpdateStrategy(deferMode).getPrimaryColumns(); } hasDeferredColumnOrder(deferMode) { return this.getUpdateStrategy(deferMode).hasDeferredColumnOrder(); } setValueColumns(deferMode, columns, eventType) { this.getUpdateStrategy(deferMode).setValueColumns(columns, eventType); } getValueColumns(deferMode) { return this.getUpdateStrategy(deferMode).getValueColumns(); } setColumnAggFunc(deferMode, column, aggFunc, eventType) { this.getUpdateStrategy(deferMode).setColumnAggFunc(column, aggFunc, eventType); } getColumnAggFunc(deferMode, column) { return this.getUpdateStrategy(deferMode).getColumnAggFunc(column); } setPivotColumns(deferMode, columns, eventType) { this.getUpdateStrategy(deferMode).setPivotColumns(columns, eventType); } getPivotColumns(deferMode) { return this.getUpdateStrategy(deferMode).getPivotColumns(); } setPivotMode(deferMode, pivotMode, eventType) { this.getUpdateStrategy(deferMode).setPivotMode(pivotMode, eventType); } getPivotMode(deferMode) { return this.getUpdateStrategy(deferMode).getPivotMode(); } isColumnSelectedInPivotModeToolPanel(deferMode, column) { return this.getUpdateStrategy(deferMode).isColumnSelectedInPivotModeToolPanel(column); } progressSortFromEvent(deferMode, column, event) { this.getUpdateStrategy(deferMode).progressSortFromEvent(column, event); } getSortDef(deferMode, column) { return this.getUpdateStrategy(deferMode).getSortDef(column); } getUpdateStrategy(deferApply) { return deferApply ? this.getDeferredUpdateStrategy() : this.getSyncUpdateStrategy(); } getSyncUpdateStrategy() { return this.syncUpdateStrategy ?? (this.syncUpdateStrategy = new SynchronousColumnStateUpdateStrategy(this.beans)); } getDeferredUpdateStrategy() { return this.deferredUpdateStrategy ?? (this.deferredUpdateStrategy = new DeferredColumnStateUpdateStrategy(this.beans)); } }; var SynchronousColumnStateUpdateStrategy = class { constructor(beans) { this.beans = beans; this.lastPivotColIds = []; this.reset = noop; this.commit = noop; this.hasPendingChanges = () => false; this.hasDeferredColumnOrder = () => false; } applyColumnState(state, eventType) { if (state.length === 0) { return; } _applyColumnState(this.beans, { state }, eventType); } moveColumns(columns, targetIndex, eventType) { this.beans.colMoves?.moveColumns(columns, targetIndex, eventType); syncPrimaryColDefOrderFromCurrentColumns(this.beans); } setColumnsVisible(columns, visible, eventType) { const allowedCols = columns.filter((column) => !column.getColDef().lockVisible); this.beans.colModel.setColsVisible(allowedCols, visible, eventType); } setRowGroupColumns(columns, eventType) { this.beans.rowGroupColsSvc?.setColumns(columns, eventType); } getRowGroupColumns() { return this.beans.rowGroupColsSvc?.columns ?? []; } getPrimaryColumns() { return getPrimaryColumns(this.beans); } setValueColumns(columns, eventType) { this.beans.valueColsSvc?.setColumns(columns, eventType); } getValueColumns() { return this.beans.valueColsSvc?.columns ?? []; } setColumnAggFunc(column, aggFunc, eventType) { this.beans.valueColsSvc?.setColumnAggFunc?.(column, aggFunc, eventType); } getColumnAggFunc(column) { return column.getAggFunc(); } setPivotColumns(columns, eventType) { this.lastPivotColIds = columns.map((column) => column.getColId()); this.beans.pivotColsSvc?.setColumns(columns, eventType); } getPivotColumns() { return this.beans.pivotColsSvc?.columns ?? []; } setPivotMode(pivotMode, eventType) { const { colModel, gos, ctrlsSvc } = this.beans; if (pivotMode === colModel.isPivotMode()) { return; } const currentPivotColIds = this.beans.pivotColsSvc?.columns.map((col) => col.getColId()) ?? []; if (currentPivotColIds.length > 0) { this.lastPivotColIds = currentPivotColIds; } if (!pivotMode) { const cols = this.beans.colModel.getColDefCols() ?? []; _applyColumnState( this.beans, { state: cols.map((col) => ({ colId: col.getColId(), pivot: false, pivotIndex: null })) }, eventType ); } gos.updateGridOptions({ options: { pivotMode }, source: eventType }); if (pivotMode && this.lastPivotColIds.length > 0) { this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds, eventType); } for (const c of ctrlsSvc.getHeaderRowContainerCtrls()) { c.refresh(); } } progressSortFromEvent(column, event) { this.beans.sortSvc?.progressSortFromEvent(column, event); } isColumnVisibleInToolPanel(column) { return column.isVisible(); } isColumnSelectedInPivotModeToolPanel(column) { return column.isAnyFunctionActive(); } getPivotMode() { return this.beans.colModel.isPivotMode(); } getSortDef(column) { return column.getSortDef(); } }; var DeferredColumnStateUpdateStrategy = class { constructor(beans) { this.beans = beans; this.state = {}; this.sequence = 0; this.lastPivotColIds = []; } reset() { this.sequence = 0; this.state = {}; } hasPendingChanges() { const { state, beans } = this; const { columnState, columnOrder, rowGroup, aggregation, pivot, pivotMode, sort, aggFuncs } = state; const getColIds = (cols) => (cols ?? []).map((c) => c.getColId()); if (columnState) { for (const [colId, patch] of columnState.patches) { const column = beans.colModel.getColDefCol(colId); if (!column) { continue; } if (patch.hide !== void 0 && patch.hide !== !column.isVisible() || patch.rowGroup !== void 0 && !!patch.rowGroup !== column.isRowGroupActive() || patch.pivot !== void 0 && !!patch.pivot !== column.isPivotActive() || patch.aggFunc !== void 0 && (patch.aggFunc ?? null) !== (column.getAggFunc() ?? null)) { return true; } } } if (columnOrder && !_areEqual(columnOrder.colIds, getPrimaryColumnIds(beans))) { return true; } if (rowGroup && !_areEqual(rowGroup.colIds, getColIds(beans.rowGroupColsSvc?.columns))) { return true; } if (aggregation && !_areEqual(aggregation.colIds, getColIds(beans.valueColsSvc?.columns))) { return true; } if (pivot && !_areEqual(pivot.colIds, getColIds(beans.pivotColsSvc?.columns))) { return true; } if (pivotMode && pivotMode.pivotMode !== beans.colModel.isPivotMode()) { return true; } if (sort) { for (const [colId, sortDef] of sort.sortDefsByColId) { const column = beans.colModel.getColDefCol(colId); if (!column) { continue; } if ((sortDef?.direction ?? null) !== (column.getSortDef()?.direction ?? null)) { return true; } } if (sort.baselineCleared) { const primaryColumns = getPrimaryColumns(beans); for (const col of primaryColumns) { if (!sort.sortDefsByColId.has(col.getColId()) && col.getSortDef() !== null) { return true; } } } } if (aggFuncs) { for (const [colId, aggFunc] of aggFuncs.values) { const column = beans.colModel.getColDefCol(colId); if (!column) { continue; } if (aggFunc !== column.getAggFunc()) { return true; } } } return false; } commit() { const { beans, state } = this; const operations = []; for (const type of Object.keys(state)) { const operation = state[type]; if (operation) { operations.push({ type, ...operation }); } } const sortedEntries = operations.sort((a, b) => a.seq - b.seq); for (const operation of sortedEntries) { switch (operation.type) { case "columnState": { _applyColumnState(beans, { state: [...operation.patches.values()] }, operation.eventType); break; } case "columnOrder": { const orderedColumns = operation.colIds.map((colId) => beans.colModel.getColDefCol(colId)).filter((column) => !!column && isPrimaryColDefColumn(column)); if (!beans.colModel.isPivotMode()) { for (let i = 0; i < orderedColumns.length; i++) { const column = orderedColumns[i]; const allColumns = beans.colModel.getCols(); const nonPrimaryPrefix = allColumns.findIndex((col) => isPrimaryColDefColumn(col)); const targetIndex = (nonPrimaryPrefix >= 0 ? nonPrimaryPrefix : 0) + i; if (allColumns[targetIndex] !== column) { beans.colMoves?.moveColumns([column], targetIndex, operation.eventType, true); } } } syncPrimaryColDefOrder(beans, orderedColumns); break; } case "rowGroup": { beans.rowGroupColsSvc?.setColumns(operation.colIds, operation.eventType); break; } case "aggregation": { beans.valueColsSvc?.setColumns(operation.colIds, operation.eventType); break; } case "pivot": { this.lastPivotColIds = operation.colIds; beans.pivotColsSvc?.setColumns(operation.colIds, operation.eventType); break; } case "pivotMode": { const { colModel, ctrlsSvc, gos, stateSvc } = beans; if (operation.pivotMode !== colModel.isPivotMode()) { const currentPivotColIds = beans.pivotColsSvc?.columns.map((col) => col.getColId()) ?? []; if (currentPivotColIds.length > 0) { this.lastPivotColIds = currentPivotColIds; } const previousPivotColIds = stateSvc?.getState().pivot?.pivotColIds ?? currentPivotColIds; const pivotColIds = operation.pivotMode ? this.state.pivot?.colIds ?? this.lastPivotColIds : previousPivotColIds; stateSvc?.setState( { ...stateSvc.getState(), pivot: { pivotMode: operation.pivotMode, pivotColIds } }, ["pivot"] ); if (!operation.pivotMode) { const cols = beans.colModel.getColDefCols() ?? []; _applyColumnState( beans, { state: cols.map((col) => ({ colId: col.getColId(), pivot: false, pivotIndex: null })) }, operation.eventType ); } gos.updateGridOptions({ options: { pivotMode: operation.pivotMode }, source: operation.eventType }); if (operation.pivotMode && pivotColIds.length > 0) { beans.pivotColsSvc?.setColumns(pivotColIds, operation.eventType); } for (const c of ctrlsSvc.getHeaderRowContainerCtrls()) { c.refresh(); } } break; } case "sort": { const sortState = []; let sortIndex = 0; for (const [colId, sortDef] of operation.sortDefsByColId) { sortState.push({ colId, sort: sortDef?.direction ?? null, sortIndex: sortDef?.direction ? sortIndex++ : null, sortType: sortDef?.type ?? void 0 }); } _applyColumnState( beans, { state: sortState, defaultState: operation.baselineCleared ? { sort: null, sortIndex: null, sortType: void 0 } : void 0 }, operation.eventType ); break; } case "aggFuncs": { for (const [colId, aggFunc] of operation.values) { const column = beans.colModel.getColDefCol(colId); if (!column) { continue; } beans.valueColsSvc?.setColumnAggFunc?.(column, aggFunc, operation.eventType); } break; } } } this.reset(); } applyColumnState(state, eventType) { for (const patch of state) { mergeColumnStatePatch(this.state, patch); } const columnState = ensureColumnStateDraft(this.state); columnState.seq = nextSeq(this.sequence); this.sequence = columnState.seq; columnState.eventType = eventType; } moveColumns(columns, targetIndex, eventType) { const movingColIds = new Set(columns.map((column) => column.getColId())); const orderedColIds = this.state.columnOrder?.colIds ?? getPrimaryColumnIds(this.beans); const remaining = orderedColIds.filter((colId) => !movingColIds.has(colId)); const movedIds = columns.map((column) => column.getColId()); const seq = nextSeq(this.sequence); this.sequence = seq; this.state.columnOrder = { colIds: [...remaining.slice(0, targetIndex), ...movedIds, ...remaining.slice(targetIndex)], eventType, seq }; } setColumnsVisible(columns, visible, eventType) { for (const column of columns) { if (column.getColDef().lockVisible) { continue; } mergeColumnStatePatch(this.state, { colId: column.getColId(), hide: !visible }); } const columnState = ensureColumnStateDraft(this.state); columnState.seq = nextSeq(this.sequence); this.sequence = columnState.seq; columnState.eventType = eventType; } setRowGroupColumns(columns, eventType) { clearDeferredFunctionPatches(this.state, "rowGroup"); const seq = nextSeq(this.sequence); this.sequence = seq; this.state.rowGroup = { colIds: columns.map((column) => column.getColId()), eventType, seq }; } setValueColumns(columns, eventType) { clearDeferredFunctionPatches(this.state, "aggFunc"); const liveValueColIds = new Set((this.beans.valueColsSvc?.columns ?? []).map((col) => col.getColId())); const aggFuncs = ensureAggFuncsDraft(this.state); for (const col of columns) { if (!liveValueColIds.has(col.getColId()) && !aggFuncs.values.has(col.getColId())) { const existingAggFunc = col.getAggFunc(); const aggFunc = existingAggFunc != null ? existingAggFunc : this.beans.aggFuncSvc?.getDefaultAggFunc(col); if (aggFunc != null) { aggFuncs.values.set(col.getColId(), aggFunc); } } } const seq = nextSeq(this.sequence); this.sequence = seq; aggFuncs.seq = seq; aggFuncs.eventType = eventType; this.state.aggregation = { colIds: columns.map((column) => column.getColId()), eventType, seq }; } setColumnAggFunc(column, aggFunc, eventType) { mergeColumnStatePatch(this.state, { colId: column.getColId(), aggFunc }); const columnState = ensureColumnStateDraft(this.state); columnState.seq = nextSeq(this.sequence); this.sequence = columnState.seq; columnState.eventType = eventType; const aggFuncs = ensureAggFuncsDraft(this.state); aggFuncs.seq = columnState.seq; aggFuncs.eventType = eventType; aggFuncs.values.set(column.getColId(), aggFunc); } getColumnAggFunc(column) { const colId = column.getColId(); if (this.state.aggFuncs?.values.has(colId)) { return this.state.aggFuncs.values.get(colId); } return column.getAggFunc(); } isColumnVisibleInToolPanel(column) { const columnState = this.state.columnState?.patches.get(column.getColId()); if (columnState?.hide !== void 0) { return !columnState.hide; } return column.isVisible(); } isColumnSelectedInPivotModeToolPanel(column) { const colId = column.getColId(); const columnState = this.state.columnState?.patches.get(colId); let rowGroupActive; if (columnState?.rowGroup !== void 0) { rowGroupActive = !!columnState.rowGroup; } else if (this.state.rowGroup) { rowGroupActive = this.state.rowGroup.colIds.includes(colId); } else { rowGroupActive = column.isRowGroupActive(); } let pivotActive; if (columnState?.pivot !== void 0) { pivotActive = !!columnState.pivot; } else if (this.state.pivot) { pivotActive = this.state.pivot.colIds.includes(colId); } else { pivotActive = column.isPivotActive(); } let valueActive; if (columnState?.aggFunc !== void 0) { valueActive = columnState.aggFunc != null; } else if (this.state.aggregation) { valueActive = this.state.aggregation.colIds.includes(colId); } else { valueActive = column.isValueActive(); } return rowGroupActive || pivotActive || valueActive; } setPivotColumns(columns, eventType) { clearDeferredFunctionPatches(this.state, "pivot"); const seq = nextSeq(this.sequence); this.sequence = seq; this.state.pivot = { colIds: columns.map((column) => column.getColId()), eventType, seq }; } setPivotMode(pivotMode, eventType) { const seq = nextSeq(this.sequence); this.sequence = seq; this.state.pivotMode = { pivotMode, eventType, seq }; } getRowGroupColumns() { return getDraftColumns( this.beans, getDraftFunctionColumnIds( this.state.rowGroup?.colIds, this.beans.rowGroupColsSvc?.columns, this.state.columnState?.patches, (patch) => patch.rowGroup == null ? void 0 : !!patch.rowGroup ) ); } getPrimaryColumns() { return getDraftColumns(this.beans, this.state.columnOrder?.colIds ?? getPrimaryColumnIds(this.beans)); } hasDeferredColumnOrder() { return !!this.state.columnOrder; } getValueColumns() { return getDraftColumns( this.beans, getDraftFunctionColumnIds( this.state.aggregation?.colIds, this.beans.valueColsSvc?.columns, this.state.columnState?.patches, (patch) => patch.aggFunc === void 0 ? void 0 : patch.aggFunc != null ) ); } getPivotColumns() { if (!this.getPivotMode()) { return []; } const livePivotColumns = this.beans.pivotColsSvc?.columns; const fallbackColumns = livePivotColumns?.length ? livePivotColumns : getDraftColumns(this.beans, this.lastPivotColIds); return getDraftColumns( this.beans, getDraftFunctionColumnIds( this.state.pivot?.colIds, fallbackColumns, this.state.columnState?.patches, (patch) => patch.pivot == null ? void 0 : !!patch.pivot ) ); } getPivotMode() { return this.state.pivotMode?.pivotMode ?? this.beans.colModel.isPivotMode(); } getSortDef(column) { const draftSortState = this.state.sort; const colId = column.getColId(); const sortDefsByColId = draftSortState?.sortDefsByColId; if (sortDefsByColId?.has(colId)) { return sortDefsByColId.get(colId) ?? null; } if (draftSortState?.baselineCleared) { return null; } return column.getSortDef(); } progressSortFromEvent(column, event) { const currentDraft = this.state.sort ?? { sortDefsByColId: /* @__PURE__ */ new Map(), baselineCleared: false, seq: 0, eventType: "toolPanelUi" }; const { sortSvc } = this.beans; const colId = column.getColId(); let currentSortDef; if (currentDraft.sortDefsByColId.has(colId)) { currentSortDef = currentDraft.sortDefsByColId.get(colId); } else if (currentDraft.baselineCleared) { currentSortDef = null; } else { currentSortDef = column.getSortDef(); } const nextSortDef = sortSvc?.getNextSortDirection(column, currentSortDef); if (!nextSortDef) { return; } const { gos } = this.beans; const sortUsingCtrl = gos.get("multiSortKey") === "ctrl"; const multiSort = sortUsingCtrl ? event.ctrlKey || event.metaKey : event.shiftKey; const doingMultiSort = (multiSort || gos.get("alwaysMultiSort")) && !gos.get("suppressMultiSort"); if (!doingMultiSort) { currentDraft.sortDefsByColId.clear(); currentDraft.baselineCleared = true; } currentDraft.sortDefsByColId.set(colId, nextSortDef.direction ? nextSortDef : null); currentDraft.seq = nextSeq(this.sequence); this.sequence = currentDraft.seq; this.state.sort = currentDraft; } }; function getDraftColumns(beans, colIds) { if (!colIds) { return []; } return colIds.map((colId) => beans.colModel.getColDefCol(colId)).filter((column) => !!column); } function getDraftFunctionColumnIds(draftColIds, liveColumns, columnStatePatches, getPatchState) { const colIds = [...draftColIds ?? liveColumns?.map((column) => column.getColId()) ?? []]; if (!columnStatePatches?.size) { return colIds; } const colIdsSet = new Set(colIds); for (const [colId, patch] of columnStatePatches) { const nextState = getPatchState(patch); if (nextState === void 0) { continue; } if (nextState) { if (!colIdsSet.has(colId)) { colIds.push(colId); colIdsSet.add(colId); } continue; } if (!colIdsSet.has(colId)) { continue; } colIdsSet.delete(colId); const index = colIds.indexOf(colId); if (index >= 0) { colIds.splice(index, 1); } } return colIds; } function syncPrimaryColDefOrderFromCurrentColumns(beans) { const orderedPrimaryColumns = beans.colModel.getCols().filter((column) => isPrimaryColDefColumn(column)).map((column) => beans.colModel.getColDefCol(column.getColId())).filter((column) => !!column); syncPrimaryColDefOrder(beans, orderedPrimaryColumns); } function syncPrimaryColDefOrder(beans, orderedPrimaryColumns) { const colDefCols = getMutablePrimaryColDefCollection(beans); if (!colDefCols) { return; } const orderedSet = new Set(orderedPrimaryColumns); colDefCols.list = [ ...orderedPrimaryColumns, ...colDefCols.list.filter((col) => isPrimaryColDefColumn(col) && !orderedSet.has(col)) ]; } function getPrimaryColumnIds(beans) { return getPrimaryColumns(beans).map((column) => column.getColId()); } function getPrimaryColumns(beans) { return (beans.colModel.getColDefCols() ?? beans.colModel.getCols()).filter( (column) => isPrimaryColDefColumn(column) ); } function getMutablePrimaryColDefCollection(beans) { const colDefCols = beans.colModel.colDefCols; const colDefList = colDefCols?.list; if (!Array.isArray(colDefList)) { return void 0; } return colDefCols; } function isPrimaryColDefColumn(column) { if (!column.isPrimary()) { return false; } return !isColumnGroupAutoCol(column) && !isSpecialCol(column); } function nextSeq(sequence) { return sequence + 1; } function mergeColumnStatePatch(state, patch) { const columnState = ensureColumnStateDraft(state); const existing = columnState.patches.get(patch.colId); columnState.patches.set(patch.colId, existing ? { ...existing, ...patch } : patch); } function clearDeferredFunctionPatches(state, patchKey) { const patches = state.columnState?.patches; if (!patches?.size) { return; } for (const [colId, patch] of patches) { if (!(patchKey in patch)) { continue; } const nextPatch = { ...patch }; delete nextPatch[patchKey]; if (Object.keys(nextPatch).length === 1) { patches.delete(colId); continue; } patches.set(colId, nextPatch); } } function ensureColumnStateDraft(state) { let { columnState } = state; if (!columnState) { columnState = { patches: /* @__PURE__ */ new Map(), seq: 0, eventType: "toolPanelUi" }; state.columnState = columnState; } return columnState; } function ensureAggFuncsDraft(state) { let { aggFuncs } = state; if (!aggFuncs) { aggFuncs = { values: /* @__PURE__ */ new Map(), seq: 0, eventType: "toolPanelUi" }; state.aggFuncs = aggFuncs; } return aggFuncs; } // packages/ag-grid-enterprise/src/columnToolPanel/updates/columnStateUpdateStrategy.ts var ColumnStateUpdateStrategy = class extends BeanStub { constructor() { super(...arguments); this.beanName = "columnStateUpdateStrategy"; } applyColumnState(deferMode, state, eventType) { this.delegate("applyColumnState", deferMode, state, eventType); } commit(deferMode) { this.delegate("commit", deferMode); } hasPendingChanges(deferMode) { return this.delegate("hasPendingChanges", deferMode); } moveColumns(deferMode, columns, targetIndex, eventType) { this.delegate("moveColumns", deferMode, columns, targetIndex, eventType); } reset(deferMode) { this.delegate("reset", deferMode); } setColumnsVisible(deferMode, columns, visible, eventType) { this.delegate("setColumnsVisible", deferMode, columns, visible, eventType); } isColumnVisibleInToolPanel(deferMode, column) { return this.delegate("isColumnVisibleInToolPanel", deferMode, column); } setRowGroupColumns(deferMode, columns, eventType) { this.delegate("setRowGroupColumns", deferMode, columns, eventType); } getRowGroupColumns(deferMode) { return this.delegate("getRowGroupColumns", deferMode); } getPrimaryColumns(deferMode) { return this.delegate("getPrimaryColumns", deferMode); } hasDeferredColumnOrder(deferMode) { return this.delegate("hasDeferredColumnOrder", deferMode); } setValueColumns(deferMode, columns, eventType) { this.delegate("setValueColumns", deferMode, columns, eventType); } getValueColumns(deferMode) { return this.delegate("getValueColumns", deferMode); } setColumnAggFunc(deferMode, column, aggFunc, eventType) { this.delegate("setColumnAggFunc", deferMode, column, aggFunc, eventType); } getColumnAggFunc(deferMode, column) { return this.delegate("getColumnAggFunc", deferMode, column); } setPivotColumns(deferMode, columns, eventType) { this.delegate("setPivotColumns", deferMode, columns, eventType); } getPivotColumns(deferMode) { return this.delegate("getPivotColumns", deferMode); } setPivotMode(deferMode, pivotMode, eventType) { this.delegate("setPivotMode", deferMode, pivotMode, eventType); } getPivotMode(deferMode) { return this.delegate("getPivotMode", deferMode); } isColumnSelectedInPivotModeToolPanel(deferMode, column) { return this.delegate("isColumnSelectedInPivotModeToolPanel", deferMode, column); } progressSortFromEvent(deferMode, column, event) { this.delegate("progressSortFromEvent", deferMode, column, event); } getSortDef(deferMode, column) { return this.delegate("getSortDef", deferMode, column); } getUpdateStrategy() { return this.executionStrategy ?? (this.executionStrategy = this.createManagedBean(new ColumnStateUpdateExecutionStrategy())); } delegate(method, ...args) { const strategy = this.getUpdateStrategy(); const fn = strategy[method].bind(strategy); return fn(...args); } }; // packages/ag-grid-enterprise/src/columnToolPanel/updates/columnStateUpdateStrategyModule.ts var SharedColumnStateUpdateStrategyModule = { moduleName: "SharedColumnStateUpdateStrategy", version: VERSION2, beans: [ColumnStateUpdateStrategy], dependsOn: [EnterpriseCoreModule] }; // packages/ag-grid-enterprise/src/columnToolPanel/columnsToolPanelModule.ts var ColumnsToolPanelModule = { moduleName: "ColumnsToolPanel", version: VERSION2, beans: [ColumnToolPanelFactory], userComponents: { agColumnsToolPanel: ColumnToolPanel }, icons: { ensureColumnVisible: "column-arrow", // column tool panel tab columnsToolPanel: "columns", // "Group by {column-name}" item in column header menu menuAddRowGroup: "group", // "Un-Group by {column-name}" item in column header menu menuRemoveRowGroup: "group", // identifies the pivot drop zone pivotPanel: "pivot", // "Row groups" drop zone in column tool panel rowGroupPanel: "group", // columns tool panel Values drop zone valuePanel: "aggregation", // column tool panel column group contracted (click to expand) columnSelectClosed: "tree-closed", // column tool panel column group expanded (click to contract) columnSelectOpen: "tree-open", // column tool panel header expand/collapse all button, shown when some children are expanded and // others are collapsed columnSelectIndeterminate: "tree-indeterminate" }, dependsOn: [ EnterpriseCoreModule, SharedColumnStateUpdateStrategyModule, SideBarModule, ColumnMoveModule, SharedDragAndDropModule, PopupModule, MenuItemModule ] }; // packages/ag-grid-enterprise/src/menu/chartMenuItemMapper.ts var ChartMenuItemMapper = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartMenuItemMapper"; } getChartItems(key) { const beans = this.beans; const chartSvc = beans.chartSvc; const isPivot = key === "pivotChart"; if (!chartSvc) { return null; } const getLocaleTextFunc = this.getLocaleTextFunc.bind(this); const builder = isPivot ? new PivotMenuItemMapper(beans, chartSvc, getLocaleTextFunc) : new RangeMenuItemMapper(beans, chartSvc, getLocaleTextFunc); const isEnterprise = chartSvc.isEnterprise(); let topLevelMenuItem = builder.getMenuItem(); if (topLevelMenuItem?.subMenu && !isEnterprise) { const filterEnterpriseItems = (m) => ({ ...m, subMenu: m.subMenu?.filter((menu) => !menu._enterprise).map((menu) => filterEnterpriseItems(menu)) }); topLevelMenuItem = filterEnterpriseItems(topLevelMenuItem); } const chartGroupsDef = this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef; if (chartGroupsDef) { topLevelMenuItem = this.filterAndOrderChartMenu( topLevelMenuItem, chartGroupsDef, builder.getConfigLookup() ); } return this.cleanInternals(topLevelMenuItem); } // Remove our internal _key and _enterprise properties so this does not leak out of the class on the menu items. cleanInternals(menuItem) { if (!menuItem) { return menuItem; } const removeKeys = (m) => { delete m?._key; delete m?._enterprise; for (const s2 of m?.subMenu ?? []) { removeKeys(s2); } return m; }; return removeKeys(menuItem); } buildLookup(menuItem) { const itemLookup = {}; const addItem = (item) => { itemLookup[item._key] = item; if (item.subMenu) { for (const s2 of item.subMenu) { addItem(s2); } } }; addItem(menuItem); return itemLookup; } /** * Make the MenuItem match the charts provided and their ordering on the ChartGroupsDef config object as provided by the user. */ filterAndOrderChartMenu(topLevelMenuItem, chartGroupsDef, configLookup) { const menuItemLookup = this.buildLookup(topLevelMenuItem); const orderedAndFiltered = { ...topLevelMenuItem, subMenu: [] }; for (const group of Object.keys(chartGroupsDef)) { const chartTypes = chartGroupsDef[group]; const chartConfigGroup = configLookup[group]; if (chartConfigGroup === null) { continue; } if (chartConfigGroup == void 0) { _warn(173, { group }); continue; } const menuItem = menuItemLookup[chartConfigGroup._key]; if (menuItem) { if (menuItem.subMenu) { const subMenus = chartTypes.map((chartType) => { const itemKey = chartConfigGroup[chartType]; if (itemKey == void 0) { _warn(174, { group, chartType }); return void 0; } return menuItemLookup[itemKey]; }).filter((s2) => s2 !== void 0); if (subMenus.length > 0) { menuItem.subMenu = subMenus; orderedAndFiltered.subMenu?.push(menuItem); } } else { orderedAndFiltered.subMenu?.push(menuItem); } } } if (orderedAndFiltered.subMenu?.length == 0) { return null; } return orderedAndFiltered; } }; var PivotMenuItemMapper = class { constructor(beans, chartSvc, getLocaleTextFunc) { this.beans = beans; this.chartSvc = chartSvc; this.getLocaleTextFunc = getLocaleTextFunc; } getMenuItem() { const localeTextFunc = this.getLocaleTextFunc(); const getMenuItem = (localeKey, defaultText, chartType, key, enterprise = false) => { return { // will have a LRM character appended to ensure correct display in RTL languages name: localeTextFunc(localeKey, defaultText + "\u200E"), action: () => this.chartSvc.createPivotChart({ chartType }), _key: key, _enterprise: enterprise }; }; return { name: localeTextFunc("pivotChart", "Pivot Chart"), _key: "pivotChart", subMenu: [ { _key: "pivotColumnChart", name: localeTextFunc("columnChart", "Column"), subMenu: [ getMenuItem("groupedColumn", "Grouped", "groupedColumn", "pivotGroupedColumn"), getMenuItem("stackedColumn", "Stacked", "stackedColumn", "pivotStackedColumn"), getMenuItem("normalizedColumn", "100% Stacked", "normalizedColumn", "pivotNormalizedColumn") ] }, { _key: "pivotBarChart", name: localeTextFunc("barChart", "Bar"), subMenu: [ getMenuItem("groupedBar", "Grouped", "groupedBar", "pivotGroupedBar"), getMenuItem("stackedBar", "Stacked", "stackedBar", "pivotStackedBar"), getMenuItem("normalizedBar", "100% Stacked", "normalizedBar", "pivotNormalizedBar") ] }, { _key: "pivotPieChart", name: localeTextFunc("pieChart", "Pie"), subMenu: [ getMenuItem("pie", "Pie", "pie", "pivotPie"), getMenuItem("donut", "Donut", "donut", "pivotDonut") ] }, { _key: "pivotLineChart", name: localeTextFunc("lineChart", "Line"), subMenu: [ getMenuItem("lineChart", "Line", "line", "pivotLineChart"), getMenuItem("stackedLine", "Stacked", "stackedLine", "pivotStackedLine"), getMenuItem("normalizedLine", "100% Stacked", "normalizedLine", "pivotNormalizedLine") ] }, { _key: "pivotAreaChart", name: localeTextFunc("areaChart", "Area"), subMenu: [ getMenuItem("areaChart", "Area", "area", "pivotArea"), getMenuItem("stackedArea", "Stacked", "stackedArea", "pivotStackedArea"), getMenuItem("normalizedArea", "100% Stacked", "normalizedArea", "pivotNormalizedArea") ] }, { _key: "pivotXYChart", name: localeTextFunc("xyChart", "X Y (Scatter)"), subMenu: [ getMenuItem("scatter", "Scatter", "scatter", "pivotScatter"), getMenuItem("bubble", "Bubble", "bubble", "pivotBubble") ] }, { _key: "pivotStatisticalChart", _enterprise: false, // histogram chart is available in both community and enterprise distributions name: localeTextFunc("statisticalChart", "Statistical"), subMenu: [getMenuItem("histogramChart", "Histogram", "histogram", "pivotHistogram", false)] }, { _key: "pivotHierarchicalChart", _enterprise: true, name: localeTextFunc("hierarchicalChart", "Hierarchical"), subMenu: [ getMenuItem("treemapChart", "Treemap", "treemap", "pivotTreemap", true), getMenuItem("sunburstChart", "Sunburst", "sunburst", "pivotSunburst", true) ] }, { _key: "pivotFunnel", name: localeTextFunc("funnel", "Funnel"), subMenu: [ getMenuItem("funnel", "Funnel", "funnel", "pivotFunnel"), getMenuItem("coneFunnel", "Cone Funnel", "coneFunnel", "pivotConeFunnel"), getMenuItem("pyramid", "Pyramid", "pyramid", "pivotPyramid") ] }, { _key: "pivotCombinationChart", name: localeTextFunc("combinationChart", "Combination"), subMenu: [ getMenuItem("columnLineCombo", "Column & Line", "columnLineCombo", "pivotColumnLineCombo"), getMenuItem("AreaColumnCombo", "Area & Column", "areaColumnCombo", "pivotAreaColumnCombo") ] } ], icon: _createIconNoSpan("chart", this.beans, void 0) }; } getConfigLookup() { return { columnGroup: { _key: "pivotColumnChart", column: "pivotGroupedColumn", stackedColumn: "pivotStackedColumn", normalizedColumn: "pivotNormalizedColumn" }, barGroup: { _key: "pivotBarChart", bar: "pivotGroupedBar", stackedBar: "pivotStackedBar", normalizedBar: "pivotNormalizedBar" }, pieGroup: { _key: "pivotPieChart", pie: "pivotPie", donut: "pivotDonut", doughnut: "pivotDonut" }, lineGroup: { _key: "pivotLineChart", line: "pivotLineChart", stackedLine: "pivotStackedLine", normalizedLine: "pivotNormalizedLine" }, areaGroup: { _key: "pivotAreaChart", area: "pivotArea", stackedArea: "pivotStackedArea", normalizedArea: "pivotNormalizedArea" }, scatterGroup: { _key: "pivotXYChart", bubble: "pivotBubble", scatter: "pivotScatter" }, combinationGroup: { _key: "pivotCombinationChart", columnLineCombo: "pivotColumnLineCombo", areaColumnCombo: "pivotAreaColumnCombo", customCombo: null // Not currently supported }, hierarchicalGroup: { _key: "pivotHierarchicalChart", treemap: "pivotTreemap", sunburst: "pivotSunburst" }, statisticalGroup: { _key: "pivotStatisticalChart", histogram: "pivotHistogram", // Some statistical charts do not currently support pivot mode rangeBar: null, rangeArea: null, boxPlot: null }, funnelGroup: { _key: "pivotFunnel", funnel: "pivotFunnel", coneFunnel: "pivotConeFunnel", pyramid: "pivotPyramid" }, // Polar charts do not support pivot mode polarGroup: null, // Specialized charts do not currently support pivot mode specializedGroup: null }; } }; var RangeMenuItemMapper = class { constructor(beans, chartSvc, getLocaleTextFunc) { this.beans = beans; this.chartSvc = chartSvc; this.getLocaleTextFunc = getLocaleTextFunc; } getMenuItem() { const localeTextFunc = this.getLocaleTextFunc(); const getMenuItem = (localeKey, defaultText, chartType, key, enterprise = false) => { return { name: localeTextFunc(localeKey, defaultText), action: () => this.chartSvc.createChartFromCurrentRange(chartType), _key: key, _enterprise: enterprise }; }; return { name: localeTextFunc("chartRange", "Chart Range"), _key: "chartRange", subMenu: [ { name: localeTextFunc("columnChart", "Column"), subMenu: [ getMenuItem("groupedColumn", "Grouped", "groupedColumn", "rangeGroupedColumn"), getMenuItem("stackedColumn", "Stacked", "stackedColumn", "rangeStackedColumn"), getMenuItem("normalizedColumn", "100% Stacked", "normalizedColumn", "rangeNormalizedColumn") ], _key: "rangeColumnChart" }, { name: localeTextFunc("barChart", "Bar"), subMenu: [ getMenuItem("groupedBar", "Grouped", "groupedBar", "rangeGroupedBar"), getMenuItem("stackedBar", "Stacked", "stackedBar", "rangeStackedBar"), getMenuItem("normalizedBar", "100% Stacked", "normalizedBar", "rangeNormalizedBar") ], _key: "rangeBarChart" }, { name: localeTextFunc("pieChart", "Pie"), subMenu: [ getMenuItem("pie", "Pie", "pie", "rangePie"), getMenuItem("donut", "Donut", "donut", "rangeDonut") ], _key: "rangePieChart" }, { name: localeTextFunc("lineChart", "Line"), subMenu: [ getMenuItem("lineChart", "Line", "line", "rangeLineChart"), getMenuItem("stackedLine", "Stacked", "stackedLine", "rangeStackedLine"), getMenuItem("normalizedLine", "100% Stacked", "normalizedLine", "rangeNormalizedLine") ], _key: "rangeLineChart" }, { name: localeTextFunc("areaChart", "Area"), subMenu: [ getMenuItem("areaChart", "Area", "area", "rangeArea"), getMenuItem("stackedArea", "Stacked", "stackedArea", "rangeStackedArea"), getMenuItem("normalizedArea", "100% Stacked", "normalizedArea", "rangeNormalizedArea") ], _key: "rangeAreaChart" }, { name: localeTextFunc("xyChart", "X Y (Scatter)"), subMenu: [ getMenuItem("scatter", "Scatter", "scatter", "rangeScatter"), getMenuItem("bubble", "Bubble", "bubble", "rangeBubble") ], _key: "rangeXYChart" }, { name: localeTextFunc("polarChart", "Polar"), subMenu: [ getMenuItem("radarLine", "Radar Line", "radarLine", "rangeRadarLine"), getMenuItem("radarArea", "Radar Area", "radarArea", "rangeRadarArea"), getMenuItem("nightingale", "Nightingale", "nightingale", "rangeNightingale"), getMenuItem("radialColumn", "Radial Column", "radialColumn", "rangeRadialColumn"), getMenuItem("radialBar", "Radial Bar", "radialBar", "rangeRadialBar") ], _key: "rangePolarChart", _enterprise: true }, { name: localeTextFunc("statisticalChart", "Statistical"), subMenu: [ getMenuItem("boxPlot", "Box Plot", "boxPlot", "rangeBoxPlot", true), getMenuItem("histogramChart", "Histogram", "histogram", "rangeHistogram", false), getMenuItem("rangeBar", "Range Bar", "rangeBar", "rangeRangeBar", true), getMenuItem("rangeArea", "Range Area", "rangeArea", "rangeRangeArea", true) ], _key: "rangeStatisticalChart", _enterprise: false // histogram chart is available in both community and enterprise distributions }, { name: localeTextFunc("hierarchicalChart", "Hierarchical"), subMenu: [ getMenuItem("treemap", "Treemap", "treemap", "rangeTreemap"), getMenuItem("sunburst", "Sunburst", "sunburst", "rangeSunburst") ], _key: "rangeHierarchicalChart", _enterprise: true }, { name: localeTextFunc("specializedChart", "Specialized"), subMenu: [ getMenuItem("heatmap", "Heatmap", "heatmap", "rangeHeatmap"), getMenuItem("waterfall", "Waterfall", "waterfall", "rangeWaterfall") ], _key: "rangeSpecializedChart", _enterprise: true }, { name: localeTextFunc("funnel", "Funnel"), subMenu: [ getMenuItem("funnel", "Funnel", "funnel", "rangeFunnel"), getMenuItem("coneFunnel", "Cone Funnel", "coneFunnel", "rangeConeFunnel"), getMenuItem("pyramid", "Pyramid", "pyramid", "rangePyramid") ], _key: "rangeFunnel", _enterprise: true }, { name: localeTextFunc("combinationChart", "Combination"), subMenu: [ getMenuItem("columnLineCombo", "Column & Line", "columnLineCombo", "rangeColumnLineCombo"), getMenuItem("AreaColumnCombo", "Area & Column", "areaColumnCombo", "rangeAreaColumnCombo") ], _key: "rangeCombinationChart" } ], icon: _createIconNoSpan("chart", this.beans, void 0) }; } getConfigLookup() { return { columnGroup: { _key: "rangeColumnChart", column: "rangeGroupedColumn", stackedColumn: "rangeStackedColumn", normalizedColumn: "rangeNormalizedColumn" }, barGroup: { _key: "rangeBarChart", bar: "rangeGroupedBar", stackedBar: "rangeStackedBar", normalizedBar: "rangeNormalizedBar" }, pieGroup: { _key: "rangePieChart", pie: "rangePie", donut: "rangeDonut", doughnut: "rangeDonut" }, lineGroup: { _key: "rangeLineChart", line: "rangeLineChart", stackedLine: "rangeStackedLine", normalizedLine: "rangeNormalizedLine" }, areaGroup: { _key: "rangeAreaChart", area: "rangeArea", stackedArea: "rangeStackedArea", normalizedArea: "rangeNormalizedArea" }, scatterGroup: { _key: "rangeXYChart", bubble: "rangeBubble", scatter: "rangeScatter" }, polarGroup: { _key: "rangePolarChart", radarLine: "rangeRadarLine", radarArea: "rangeRadarArea", nightingale: "rangeNightingale", radialColumn: "rangeRadialColumn", radialBar: "rangeRadialBar" }, statisticalGroup: { _key: "rangeStatisticalChart", boxPlot: "rangeBoxPlot", histogram: "rangeHistogram", rangeBar: "rangeRangeBar", rangeArea: "rangeRangeArea" }, hierarchicalGroup: { _key: "rangeHierarchicalChart", treemap: "rangeTreemap", sunburst: "rangeSunburst" }, specializedGroup: { _key: "rangeSpecializedChart", heatmap: "rangeHeatmap", waterfall: "rangeWaterfall" }, funnelGroup: { _key: "rangeFunnel", funnel: "rangeFunnel", coneFunnel: "rangeConeFunnel", pyramid: "rangePyramid" }, combinationGroup: { _key: "rangeCombinationChart", columnLineCombo: "rangeColumnLineCombo", areaColumnCombo: "rangeAreaColumnCombo", customCombo: null // Not currently supported } }; } }; // packages/ag-grid-enterprise/src/menu/columnChooserFactory.ts var ColumnChooserFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colChooserFactory"; } createColumnSelectPanel(parent, column, draggable, params) { const columnSelectPanel = parent.createManagedBean(new AgPrimaryCols()); const columnChooserParams = params ?? column?.getColDef().columnChooserParams ?? {}; const { contractColumnSelection, suppressColumnExpandAll, suppressColumnFilter, suppressColumnSelectAll, suppressSyncLayoutWithGrid, columnLayout } = columnChooserParams; columnSelectPanel.init( !!draggable, _addGridCommonParams(this.gos, { suppressColumnMove: false, suppressValues: false, suppressPivots: false, suppressRowGroups: false, suppressPivotMode: false, contractColumnSelection: !!contractColumnSelection, suppressColumnExpandAll: !!suppressColumnExpandAll, suppressColumnFilter: !!suppressColumnFilter, suppressColumnSelectAll: !!suppressColumnSelectAll, suppressSyncLayoutWithGrid: !!columnLayout || !!suppressSyncLayoutWithGrid, onStateUpdated: () => { } }), "columnMenu" ); if (columnLayout) { columnSelectPanel.setColumnLayout(columnLayout); } return columnSelectPanel; } showColumnChooser({ column, chooserParams, eventSource, headerPosition: providedHeaderPosition }) { this.hideActiveColumnChooser(); const columnSelectPanel = this.createColumnSelectPanel(this, column, true, chooserParams); const translate = this.getLocaleTextFunc(); const beans = this.beans; const { visibleCols, focusSvc, menuUtils } = beans; const columnIndex = visibleCols.allCols.indexOf(column); const headerPosition = column ? focusSvc.focusedHeader ?? providedHeaderPosition ?? null : null; this.activeColumnChooserDialog = this.createBean( new Dialog({ title: translate("chooseColumns", "Choose Columns"), component: columnSelectPanel, width: 300, height: 300, resizable: true, movable: true, centered: true, closable: true, afterGuiAttached: () => { _findNextFocusableElement(beans, columnSelectPanel.getGui())?.focus({ preventScroll: true }); this.dispatchVisibleChangedEvent(true, column); }, closedCallback: (event) => { const eComp = this.activeColumnChooser.getGui(); this.destroyBean(this.activeColumnChooser); this.activeColumnChooser = void 0; this.activeColumnChooserDialog = void 0; this.dispatchVisibleChangedEvent(false, column); if (column) { menuUtils.restoreFocusOnClose( { column, headerPosition, columnIndex, eventSource }, eComp, event, true ); } }, postProcessPopupParams: { type: "columnChooser", column, eventSource } }) ); this.activeColumnChooser = columnSelectPanel; } hideActiveColumnChooser() { this.destroyBean(this.activeColumnChooserDialog); } dispatchVisibleChangedEvent(visible, column) { this.eventSvc.dispatchEvent({ type: "columnMenuVisibleChanged", visible, switchingTab: false, key: "columnChooser", column: column ?? null }); } }; // packages/ag-grid-enterprise/src/menu/menuItemValidations.ts var MENU_ITEM_MODULES = { pinSubMenu: "PinnedColumn", pinLeft: "PinnedColumn", pinRight: "PinnedColumn", clearPinned: "PinnedColumn", pinRowSubMenu: "PinnedRow", pinBottom: "PinnedRow", pinTop: "PinnedRow", unpinRow: "PinnedRow", valueAggSubMenu: "SharedAggregation", autoSizeThis: "ColumnAutoSize", autoSizeAll: "ColumnAutoSize", rowGroup: "SharedRowGrouping", rowUnGroup: "SharedRowGrouping", resetColumns: "CommunityCore", expandAll: ["ClientSideRowModelHierarchy", "ServerSideRowModel"], contractAll: ["ClientSideRowModelHierarchy", "ServerSideRowModel"], copy: "Clipboard", copyWithHeaders: "Clipboard", copyWithGroupHeaders: "Clipboard", cut: "Clipboard", paste: "Clipboard", export: ["CsvExport", "ExcelExport"], csvExport: "CsvExport", excelExport: "ExcelExport", separator: "CommunityCore", pivotChart: "IntegratedCharts", chartRange: "IntegratedCharts", columnFilter: "ColumnFilter", columnChooser: "ColumnMenu", sortAscending: "Sort", sortDescending: "Sort", sortAbsoluteAscending: "Sort", sortAbsoluteDescending: "Sort", sortUnSort: "Sort" }; function validateMenuItem(gos, key) { const moduleName4 = MENU_ITEM_MODULES[key]; if (moduleName4) { gos.assertModuleRegistered(moduleName4, `menu item '${key}'`); } } // packages/ag-grid-enterprise/src/menu/menuItemMapper.ts var MENU_ITEM_SEPARATOR = "separator"; function _removeRepeatsFromArray(array, object) { if (!array) { return; } for (let index = array.length - 2; index >= 0; index--) { const thisOneMatches = array[index] === object; const nextOneMatches = array[index + 1] === object; if (thisOneMatches && nextOneMatches) { array.splice(index + 1, 1); } } } var SORT_MENU_ITEM_TO_MENU_ACTION_PARAMS = { sortAscending: { fallback: "Sort Ascending", getSortDef: () => ({ type: "default", direction: "asc" }) }, sortDescending: { fallback: "Sort Descending", getSortDef: () => ({ type: "default", direction: "desc" }) }, sortAbsoluteAscending: { fallback: "Sort Absolute Ascending", getSortDef: () => ({ type: "absolute", direction: "asc" }) }, sortAbsoluteDescending: { fallback: "Sort Absolute Descending", getSortDef: () => ({ type: "absolute", direction: "desc" }) }, sortUnSort: { fallback: "Clear Sort", getSortDef: (column) => ({ type: _normalizeSortType(column.getSortDef()?.type), direction: null }) } }; var MenuItemMapper = class extends BeanStub { constructor() { super(...arguments); this.beanName = "menuItemMapper"; } mapWithStockItems(originalList, column, node, sourceElement, source) { if (!originalList) { return []; } const resultList = []; const localeTextFunc = this.getLocaleTextFunc(); const { beans, gos } = this; const { pinnedCols, colAutosize, aggFuncSvc, rowGroupColsSvc, colNames, colModel, clipboardSvc, expansionSvc, focusSvc, csvCreator, excelCreator, menuSvc, colChooserFactory, sortSvc, chartMenuItemMapper, valueColsSvc, pinnedRowModel } = beans; const getStockMenuItem = (key, column2, sourceElement2, source2) => { validateMenuItem(gos, key); switch (key) { case "pinSubMenu": return pinnedCols && column2 ? { name: localeTextFunc("pinColumn", "Pin Column"), icon: _createIconNoSpan("menuPin", beans, null), subMenu: ["clearPinned", "pinLeft", "pinRight"] } : null; case "pinLeft": return pinnedCols && column2 ? { name: localeTextFunc("pinLeft", "Pin Left"), action: () => pinnedCols.setColsPinned([column2], "left", source2), checked: !!column2 && column2.isPinnedLeft() } : null; case "pinRight": return pinnedCols && column2 ? { name: localeTextFunc("pinRight", "Pin Right"), action: () => pinnedCols.setColsPinned([column2], "right", source2), checked: !!column2 && column2.isPinnedRight() } : null; case "clearPinned": return pinnedCols && column2 ? { name: localeTextFunc("noPin", "No Pin"), action: () => pinnedCols.setColsPinned([column2], null, source2), checked: !!column2 && !column2.isPinned() } : null; case "pinRowSubMenu": { const enableRowPinning = gos.get("enableRowPinning"); const subMenu = []; const pinned = node?.rowPinned ?? node?.pinnedSibling?.rowPinned; if (pinned) { subMenu.push("unpinRow"); } if (enableRowPinning && enableRowPinning !== "bottom" && pinned != "top") { subMenu.push("pinTop"); } if (enableRowPinning && enableRowPinning !== "top" && pinned != "bottom") { subMenu.push("pinBottom"); } return pinnedRowModel?.isManual() ? { name: localeTextFunc("pinRow", "Pin Row"), icon: _createIconNoSpan("rowPin", beans, column2), subMenu } : null; } case "pinTop": return pinnedRowModel?.isManual() ? { name: localeTextFunc("pinTop", "Pin to Top"), icon: _createIconNoSpan("rowPinTop", beans, column2), action: ({ node: node2, column: column3 }) => node2 && pinnedRowModel.pinRow(node2, "top", column3) } : null; case "pinBottom": return pinnedRowModel?.isManual() ? { name: localeTextFunc("pinBottom", "Pin to Bottom"), icon: _createIconNoSpan("rowPinBottom", beans, column2), action: ({ node: node2, column: column3 }) => node2 && pinnedRowModel.pinRow(node2, "bottom", column3) } : null; case "unpinRow": return pinnedRowModel?.isManual() ? { name: localeTextFunc("unpinRow", "Unpin Row"), icon: _createIconNoSpan("rowUnpin", beans, column2), action: ({ node: node2, column: column3 }) => node2 && pinnedRowModel.pinRow(node2, null, column3) } : null; case "valueAggSubMenu": if (aggFuncSvc && valueColsSvc && (column2?.isPrimary() || column2?.getColDef().pivotValueColumn)) { return { name: localeTextFunc("valueAggregation", "Value Aggregation"), icon: _createIconNoSpan("menuValue", beans, null), subMenu: createAggregationSubMenu(column2, aggFuncSvc, valueColsSvc, localeTextFunc), disabled: gos.get("functionsReadOnly") }; } else { return null; } case "autoSizeThis": return colAutosize ? { name: localeTextFunc("autosizeThisColumn", "Autosize This Column"), action: () => column2 && colAutosize.autoSizeColumn(column2, source2, gos.get("skipHeaderOnAutoSize")) } : null; case "autoSizeAll": return colAutosize ? { name: localeTextFunc("autosizeAllColumns", "Autosize All Columns"), action: () => colAutosize.autoSizeAllColumns({ source: source2, skipHeader: gos.get("skipHeaderOnAutoSize") }) } : null; case "rowGroup": return rowGroupColsSvc ? { name: getGroupingLocaleText( localeTextFunc, "groupBy", colNames.getDisplayNameForColumn(column2, "header") ), disabled: gos.get("functionsReadOnly") || column2?.isRowGroupActive() || !column2?.getColDef().enableRowGroup, action: () => rowGroupColsSvc.addColumns([column2], source2), icon: _createIconNoSpan("menuAddRowGroup", beans, null) } : null; case "rowUnGroup": { if (rowGroupColsSvc && gos.isModuleRegistered("SharedRowGrouping")) { const showRowGroup = column2?.getColDef().showRowGroup; const lockedGroups = gos.get("groupLockGroupColumns"); let name; let disabled; let action; if (showRowGroup === true) { name = localeTextFunc("ungroupAll", "Un-Group All"); disabled = gos.get("functionsReadOnly") || lockedGroups === -1 || lockedGroups >= (rowGroupColsSvc.columns.length ?? 0); action = () => rowGroupColsSvc.setColumns(rowGroupColsSvc.columns.slice(0, lockedGroups), source2); } else if (typeof showRowGroup === "string") { const underlyingColumn = colModel.getColDefCol(showRowGroup); const ungroupByName = underlyingColumn != null ? colNames.getDisplayNameForColumn(underlyingColumn, "header") : showRowGroup; name = getGroupingLocaleText(localeTextFunc, "ungroupBy", ungroupByName); disabled = gos.get("functionsReadOnly") || isRowGroupColLocked(underlyingColumn, beans); action = () => { rowGroupColsSvc.removeColumns([showRowGroup], source2); }; } else { name = getGroupingLocaleText( localeTextFunc, "ungroupBy", colNames.getDisplayNameForColumn(column2, "header") ); disabled = gos.get("functionsReadOnly") || !column2?.isRowGroupActive() || !column2?.getColDef().enableRowGroup || isRowGroupColLocked(column2, beans); action = () => rowGroupColsSvc.removeColumns([column2], source2); } return { name, disabled, action, icon: _createIconNoSpan("menuRemoveRowGroup", beans, null) }; } else { return null; } } case "resetColumns": return { name: localeTextFunc("resetColumns", "Reset Columns"), action: () => _resetColumnState(beans, source2) }; case "expandAll": return expansionSvc ? { name: localeTextFunc("expandAll", "Expand All Row Groups"), action: () => expansionSvc.expandAll(true) } : null; case "contractAll": return expansionSvc ? { name: localeTextFunc("collapseAll", "Collapse All Row Groups"), action: () => expansionSvc.expandAll(false) } : null; case "copy": return clipboardSvc ? { name: localeTextFunc("copy", "Copy"), shortcut: localeTextFunc("ctrlC", "Ctrl+C"), icon: _createIconNoSpan("clipboardCopy", beans, null), action: () => clipboardSvc.copyToClipboard() } : null; case "copyWithHeaders": return clipboardSvc ? { name: localeTextFunc("copyWithHeaders", "Copy with Headers"), // shortcut: localeTextFunc('ctrlC','Ctrl+C'), icon: _createIconNoSpan("clipboardCopy", beans, null), action: () => clipboardSvc.copyToClipboard({ includeHeaders: true }) } : null; case "copyWithGroupHeaders": return clipboardSvc ? { name: localeTextFunc("copyWithGroupHeaders", "Copy with Group Headers"), // shortcut: localeTextFunc('ctrlC','Ctrl+C'), icon: _createIconNoSpan("clipboardCopy", beans, null), action: () => clipboardSvc.copyToClipboard({ includeHeaders: true, includeGroupHeaders: true }) } : null; case "cut": if (clipboardSvc) { const focusedCell = focusSvc.getFocusedCell(); const rowNode = focusedCell ? _getRowNode(beans, focusedCell) : null; const isEditable = rowNode ? focusedCell?.column.isCellEditable(rowNode) : false; return { name: localeTextFunc("cut", "Cut"), shortcut: localeTextFunc("ctrlX", "Ctrl+X"), icon: _createIconNoSpan("clipboardCut", beans, null), disabled: !isEditable || gos.get("suppressCutToClipboard"), action: () => clipboardSvc.cutToClipboard(void 0, "contextMenu") }; } else { return null; } case "paste": if (clipboardSvc) { const isPasteBlocked = gos.get("suppressClipboardApi") || gos.get("suppressClipboardPaste") || !column2 || !node || !column2.isCellEditable(node) || column2.isSuppressPaste(node); return { name: localeTextFunc("paste", "Paste"), shortcut: localeTextFunc("ctrlV", "Ctrl+V"), icon: _createIconNoSpan("clipboardPaste", beans, null), disabled: isPasteBlocked, action: () => clipboardSvc.pasteFromClipboard() }; } else { return null; } case "export": { const exportSubMenuItems = []; if (!gos.get("suppressCsvExport") && csvCreator) { exportSubMenuItems.push("csvExport"); } if (!gos.get("suppressExcelExport") && excelCreator) { exportSubMenuItems.push("excelExport"); } return exportSubMenuItems.length ? { name: localeTextFunc("export", "Export"), subMenu: exportSubMenuItems, icon: _createIconNoSpan("save", beans, null) } : null; } case "csvExport": return csvCreator ? { name: localeTextFunc("csvExport", "CSV Export"), icon: _createIconNoSpan("csvExport", beans, null), action: () => csvCreator.exportDataAsCsv() } : null; case "excelExport": return excelCreator ? { name: localeTextFunc("excelExport", "Excel Export"), icon: _createIconNoSpan("excelExport", beans, null), action: () => excelCreator.exportDataAsExcel() } : null; case "separator": return key; case "pivotChart": case "chartRange": return chartMenuItemMapper.getChartItems(key); case "columnFilter": return menuSvc && column2 ? { name: localeTextFunc("columnFilter", "Column Filter"), icon: _createIconNoSpan("filter", beans, null), action: () => menuSvc.showFilterMenu({ column: column2, buttonElement: sourceElement2(), containerType: "columnFilter", positionBy: "button" }) } : null; case "columnChooser": { const headerPosition = focusSvc.focusedHeader; return colChooserFactory ? { name: localeTextFunc("columnChooser", "Choose Columns"), icon: _createIconNoSpan("columns", beans, null), action: () => colChooserFactory.showColumnChooser({ column: column2, eventSource: sourceElement2(), headerPosition }) } : null; } case "sortUnSort": case "sortAscending": case "sortDescending": case "sortAbsoluteAscending": case "sortAbsoluteDescending": { if (!sortSvc || !column2) { return null; } const { fallback, getSortDef } = SORT_MENU_ITEM_TO_MENU_ACTION_PARAMS[key]; return { name: localeTextFunc(key, fallback), icon: _createIconNoSpan(key, beans, null), action: () => sortSvc.setSortForColumn(column2, getSortDef(column2), false, source2) }; } default: { _warn(176, { key }); return null; } } }; for (const menuItemOrString of originalList) { let result; if (typeof menuItemOrString === "string") { result = getStockMenuItem(menuItemOrString, column, sourceElement, source); } else { result = { ...menuItemOrString }; } if (!result) { continue; } const resultDef = result; const { subMenu } = resultDef; if (subMenu && subMenu instanceof Array) { resultDef.subMenu = this.mapWithStockItems( subMenu, column, node, sourceElement, source ); } if (result != null) { resultList.push(result); } } _removeRepeatsFromArray(resultList, MENU_ITEM_SEPARATOR); return resultList; } }; function createAggregationSubMenu(column, aggFuncSvc, valueColsSvc, localeTextFunc) { let columnToUse; if (column.isPrimary()) { columnToUse = column; } else { const pivotValueColumn = column.getColDef().pivotValueColumn; columnToUse = _exists(pivotValueColumn) ? pivotValueColumn : void 0; } const result = []; if (columnToUse) { const columnIsAlreadyAggValue = columnToUse.isValueActive(); const funcNames = aggFuncSvc.getFuncNames(columnToUse); result.push({ name: localeTextFunc("noAggregation", "None"), action: () => { valueColsSvc.removeColumns([columnToUse], "contextMenu"); valueColsSvc.setColumnAggFunc(columnToUse, void 0, "contextMenu"); }, checked: !columnIsAlreadyAggValue }); for (const funcName of funcNames) { result.push({ name: localeTextFunc(funcName, aggFuncSvc.getDefaultFuncLabel(funcName)), action: () => { valueColsSvc.setColumnAggFunc(columnToUse, funcName, "contextMenu"); valueColsSvc.addColumns([columnToUse], "contextMenu"); }, checked: columnIsAlreadyAggValue && columnToUse.getAggFunc() === funcName }); } } return result; } // packages/ag-grid-enterprise/src/menu/columnMenuFactory.ts var ColumnMenuFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "colMenuFactory"; } createMenu(parent, menuItems, column, sourceElement) { const menuList = parent.createManagedBean( new MenuList(0, { column: column ?? null, node: null, value: null }) ); const menuItemsMapped = this.beans.menuItemMapper.mapWithStockItems( menuItems, column ?? null, null, sourceElement, "columnMenu" ); menuList.addMenuItems(menuItemsMapped); return menuList; } getMenuItems(column = null, columnGroup = null) { const defaultItems = this.getDefaultMenuOptions(column); let result; const columnMainMenuItems = (column?.getColDef() ?? columnGroup?.getColGroupDef())?.mainMenuItems; if (Array.isArray(columnMainMenuItems)) { result = columnMainMenuItems; } else if (typeof columnMainMenuItems === "function") { result = columnMainMenuItems( _addGridCommonParams(this.gos, { column, columnGroup, defaultItems }) ); } else { const userFunc = this.gos.getCallback("getMainMenuItems"); if (userFunc) { result = userFunc({ column, columnGroup, defaultItems }); } else { result = defaultItems; } } _removeRepeatsFromArray(result, MENU_ITEM_SEPARATOR); return result; } getDefaultMenuOptions(column) { const result = []; const { beans, gos } = this; const { colChooserFactory, rowGroupColsSvc, colModel, expansionSvc, sortSvc, menuSvc, pinnedCols, aggFuncSvc, colAutosize } = beans; const isLegacyMenuEnabled = _isLegacyMenuEnabled(gos); const addColumnItems = () => { if (!isLegacyMenuEnabled && colChooserFactory) { result.push("columnChooser"); } result.push("resetColumns"); }; if (!column) { addColumnItems(); return result; } const { colDef } = column; const allowPinning = pinnedCols && !colDef.lockPinned; const rowGroupCount = rowGroupColsSvc?.columns.length ?? 0; const doingGrouping = rowGroupCount > 0; const grandTotalRow = _getGrandTotalRow(gos); const treeData = gos.get("treeData"); const isPrimary = column.isPrimary(); const allowValueAgg = !isPrimary || aggFuncSvc && column.isAllowValue() && (doingGrouping || grandTotalRow || treeData); if (sortSvc && !isLegacyMenuEnabled && column.isSortable()) { const { isDefaultSortAllowed, isAbsoluteSortAllowed, isAbsoluteSort, isDefaultSort, isAscending, isDescending, direction } = _getDisplaySortForColumn(column, beans); if (isDefaultSortAllowed && !(isAscending && isDefaultSort)) { result.push("sortAscending"); } if (isDefaultSortAllowed && !(isDescending && isDefaultSort)) { result.push("sortDescending"); } if (isAbsoluteSortAllowed && !(isAscending && isAbsoluteSort)) { result.push("sortAbsoluteAscending"); } if (isAbsoluteSortAllowed && !(isDescending && isAbsoluteSort)) { result.push("sortAbsoluteDescending"); } if (direction) { result.push("sortUnSort"); } result.push(MENU_ITEM_SEPARATOR); } if (menuSvc?.isFilterMenuItemEnabled(column)) { result.push("columnFilter"); result.push(MENU_ITEM_SEPARATOR); } if (allowPinning) { result.push("pinSubMenu"); } if (allowValueAgg) { result.push("valueAggSubMenu"); } if (allowPinning || allowValueAgg) { result.push(MENU_ITEM_SEPARATOR); } if (colAutosize) { if (!colDef.suppressAutoSize) { result.push("autoSizeThis"); } result.push("autoSizeAll"); result.push(MENU_ITEM_SEPARATOR); } if (rowGroupColsSvc && gos.isModuleRegistered("SharedRowGrouping")) { const numItems = result.length; const showRowGroup = colDef.showRowGroup; if (showRowGroup) { result.push("rowUnGroup"); } else if (column.isAllowRowGroup() && isPrimary) { if (column.isRowGroupActive()) { const groupLocked = isRowGroupColLocked(column, beans); if (!groupLocked) { result.push("rowUnGroup"); } } else { result.push("rowGroup"); } } if (result.length > numItems) { result.push(MENU_ITEM_SEPARATOR); } } addColumnItems(); if (expansionSvc && (_isClientSideRowModel(gos) || gos.get("ssrmExpandAllAffectsAllRows")) && (treeData || rowGroupCount > (colModel.isPivotMode() ? 1 : 0))) { result.push("expandAll"); result.push("contractAll"); } return result; } }; // packages/ag-grid-enterprise/src/menu/contextMenu.ts var CSS_CONTEXT_MENU_OPEN = "ag-context-menu-open"; var ContextMenuService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "contextMenuSvc"; this.focusedCell = null; } postConstruct() { this.menu = this.createManagedBean( new AgContextMenuService({ menuItemCallbacks: MENU_ITEM_CALLBACKS, getMenuItems: this.getMenuItems.bind(this), mapMenuItems: this.mapWithStockItems.bind(this), beforeMenuOpen: this.beforeMenuOpen.bind(this), onMenuOpen: this.onMenuOpen.bind(this), onMenuClose: this.onMenuClose.bind(this), afterMenuDestroyed: this.afterMenuDestroyed.bind(this), onVisibleChanged: this.dispatchVisibleChangedEvent.bind(this), // overlay was displayed shouldBlockMenuOpen: () => !!this.beans.overlays?.exclusive }) ); } hideActiveMenu() { this.menu.hideActiveMenu(); } getMenuItems(menuActionParams, mouseEvent) { const { column, node, value } = menuActionParams; const defaultMenuOptions = []; const { clipboardSvc, chartSvc, csvCreator, excelCreator, colModel, rangeSvc, gos } = this.beans; if (_exists(node) && clipboardSvc) { if (column) { if (!gos.get("suppressCutToClipboard")) { defaultMenuOptions.push("cut"); } defaultMenuOptions.push("copy", "copyWithHeaders", "copyWithGroupHeaders", "paste", "separator"); } } if (gos.get("enableCharts") && chartSvc) { if (colModel.isPivotMode()) { defaultMenuOptions.push("pivotChart"); } if (rangeSvc && !rangeSvc.isEmpty()) { defaultMenuOptions.push("chartRange"); } } if (_exists(node)) { const enableRowPinning = gos.get("enableRowPinning"); const isRowPinnable = gos.get("isRowPinnable"); if (enableRowPinning) { const isGroupTotalRow = node.level > -1 && node.footer; const isGrandTotalRow = node.level === -1 && node.footer; const grandTotalRow = _getGrandTotalRow(gos); const isGrandTotalRowFixed = grandTotalRow === "pinnedBottom" || grandTotalRow === "pinnedTop"; if (isGrandTotalRow && !isGrandTotalRowFixed || !isGrandTotalRow && !isGroupTotalRow) { const pinnable = isRowPinnable?.(node) ?? true; if (pinnable) { defaultMenuOptions.push("pinRowSubMenu"); } } } const suppressExcel = gos.get("suppressExcelExport") || !excelCreator; const suppressCsv = gos.get("suppressCsvExport") || !csvCreator; const onIPad = _isIOSUserAgent(); const anyExport = !onIPad && (!suppressExcel || !suppressCsv); if (anyExport) { defaultMenuOptions.push("export"); } } const defaultItems = defaultMenuOptions.length ? defaultMenuOptions : void 0; const columnContextMenuItems = column?.getColDef().contextMenuItems; if (Array.isArray(columnContextMenuItems)) { return columnContextMenuItems; } if (typeof columnContextMenuItems === "function") { return columnContextMenuItems( _addGridCommonParams(gos, { column, node, value, defaultItems, event: mouseEvent }) ); } const userFunc = gos.getCallback("getContextMenuItems"); return userFunc?.({ column, node, value, defaultItems, event: mouseEvent }) ?? defaultMenuOptions; } getContextMenuPosition(rowNode, column) { const rowCtrl = this.getRowCtrl(rowNode); const eGui = this.getCellGui(rowCtrl, column); if (!eGui) { return { x: 0, y: rowCtrl?.getRowYPosition() ?? 0 }; } const rect = eGui.getBoundingClientRect(); return { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 }; } showContextMenu(params) { const rowNode = params.rowNode ?? null; const column = params.column ?? null; let { anchorToElement, value, source } = params; if (rowNode && column && value == null) { value = this.beans.valueSvc.getValueForDisplay({ column, node: rowNode, from: "edit" }).value; } if (anchorToElement == null) { anchorToElement = this.getContextMenuAnchorElement(rowNode, column); } this.beans.menuUtils.onContextMenu({ mouseEvent: params.mouseEvent ?? null, touchEvent: params.touchEvent ?? null, showMenuCallback: (eventOrTouch) => this.menu.showMenu({ node: rowNode, column, value }, eventOrTouch, anchorToElement), source }); } handleContextMenuMouseEvent(mouseEvent, touchEvent, rowCtrl, cellCtrl) { const rowNode = cellCtrl?.rowNode ?? rowCtrl?.rowNode ?? null; const column = cellCtrl?.column ?? rowCtrl?.findFullWidthInfoForEvent(mouseEvent || touchEvent)?.column ?? null; const { valueSvc, ctrlsSvc } = this.beans; const value = column ? valueSvc.getValue(column, rowNode, "edit") : null; const gridBodyCon = ctrlsSvc.getGridBodyCtrl(); const anchorToElement = cellCtrl ? cellCtrl.eGui : gridBodyCon.eGridBody; this.showContextMenu({ mouseEvent, touchEvent, rowNode, column, value, anchorToElement, source: "ui" }); } beforeMenuOpen(menuActionParams) { if (!menuActionParams.column) { this.beans.focusSvc.clearFocusedCell(); } } onMenuOpen() { const { ctrlsSvc, focusSvc } = this.beans; ctrlsSvc.getGridBodyCtrl().eGridBody.classList.add(CSS_CONTEXT_MENU_OPEN); this.focusedCell = focusSvc.getFocusedCell(); } onMenuClose() { this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(CSS_CONTEXT_MENU_OPEN); } afterMenuDestroyed() { const { beans, focusedCell } = this; _attemptToRestoreCellFocus(beans, focusedCell); } dispatchVisibleChangedEvent(visible, source) { this.eventSvc.dispatchEvent({ type: "contextMenuVisibleChanged", visible, source }); } getRowCtrl(rowNode) { const { rowIndex, rowPinned } = rowNode || {}; if (rowIndex == null) { return; } return this.beans.rowRenderer.getRowByPosition({ rowIndex, rowPinned }) || void 0; } getCellGui(rowCtrl, column) { if (!rowCtrl || !column) { return; } const cellCtrl = rowCtrl.getCellCtrl(column); return cellCtrl?.eGui || void 0; } getContextMenuAnchorElement(rowNode, column) { const gridBodyEl = this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody; const rowCtrl = this.getRowCtrl(rowNode); if (!rowCtrl) { return gridBodyEl; } const cellGui = this.getCellGui(rowCtrl, column); if (cellGui) { return cellGui; } if (rowCtrl.isFullWidth()) { return rowCtrl.getFullWidthElement(); } return gridBodyEl; } mapWithStockItems(menuItems, menuActionParams, getGui) { const { column, node } = menuActionParams; return this.beans.menuItemMapper.mapWithStockItems( menuItems, column, node, getGui, "contextMenu" ); } }; // packages/ag-grid-enterprise/src/menu/enterpriseMenu.ts var TAB_FILTER = "filterMenuTab"; var TAB_GENERAL = "generalMenuTab"; var TAB_COLUMNS = "columnsMenuTab"; var TABS_DEFAULT = [TAB_GENERAL, TAB_FILTER, TAB_COLUMNS]; var EnterpriseMenuFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "enterpriseMenuFactory"; } hideActiveMenu() { this.destroyBean(this.activeMenu); } showMenuAfterMouseEvent(columnOrGroup, mouseEvent, containerType, onClosedCallback, filtersOnly) { const { column, columnGroup } = this.splitColumnOrGroup(columnOrGroup); const defaultTab = filtersOnly ? "filterMenuTab" : void 0; this.showMenu( column, columnGroup, (menu) => { const ePopup = menu.getGui(); this.beans.popupSvc.positionPopupUnderMouseEvent({ type: containerType, additionalParams: { column }, mouseEvent, ePopup }); if (defaultTab) { menu.showTab?.(defaultTab); } this.dispatchVisibleChangedEvent(true, false, column, columnGroup, defaultTab); }, containerType, defaultTab, void 0, mouseEvent.target, onClosedCallback ); } splitColumnOrGroup(columnOrGroup) { const colIsColumn = columnOrGroup && isColumn(columnOrGroup); const column = colIsColumn ? columnOrGroup : void 0; const columnGroup = colIsColumn ? void 0 : columnOrGroup; return { column, columnGroup }; } showMenuAfterButtonClick(columnOrGroup, eventSource, containerType, onClosedCallback, filtersOnly) { let multiplier = -1; let alignSide = "left"; if (this.gos.get("enableRtl")) { multiplier = 1; alignSide = "right"; } const defaultTab = filtersOnly ? "filterMenuTab" : void 0; const restrictToTabs = defaultTab ? [defaultTab] : void 0; const isLegacyMenuEnabled = _isLegacyMenuEnabled(this.gos); const nudgeX = (isLegacyMenuEnabled ? 9 : 4) * multiplier; const nudgeY = isLegacyMenuEnabled ? -23 : 4; const { column, columnGroup } = this.splitColumnOrGroup(columnOrGroup); this.showMenu( column, columnGroup, (menu) => { const ePopup = menu.getGui(); this.beans.popupSvc.positionPopupByComponent({ type: containerType, additionalParams: { column }, eventSource, ePopup, alignSide, nudgeX, nudgeY, position: "under", keepWithinBounds: true }); if (defaultTab) { menu.showTab?.(defaultTab); } this.dispatchVisibleChangedEvent(true, false, column, columnGroup, defaultTab); }, containerType, defaultTab, restrictToTabs, eventSource, onClosedCallback ); } showMenu(column, columnGroup, positionCallback, containerType, defaultTab, restrictToTabs, eventSource, onClosedCallback) { const menuParams = this.getMenuParams(column, columnGroup, restrictToTabs, eventSource); if (!menuParams) { return; } const { menu, eMenuGui, anchorToElement, restoreFocusParams } = menuParams; const closedFuncs = []; const { menuUtils, popupSvc } = this.beans; closedFuncs.push((e) => { const eComp = menu.getGui(); this.destroyBean(menu); if (column) { _setColMenuVisible(column, false, "contextMenu"); menuUtils.restoreFocusOnClose(restoreFocusParams, eComp, e); } onClosedCallback?.(); }); const translate = this.getLocaleTextFunc(); popupSvc.addPopup({ modal: true, eChild: eMenuGui, closeOnEsc: true, closedCallback: (e) => { for (const f of closedFuncs) { f(e); } this.dispatchVisibleChangedEvent(false, false, column, columnGroup, defaultTab); }, afterGuiAttached: (params) => menu.afterGuiAttached(Object.assign({}, { container: containerType }, params)), // if defaultTab is not present, positionCallback will be called // after `showTabBasedOnPreviousSelection` is called. positionCallback: defaultTab ? () => positionCallback(menu) : void 0, ariaLabel: translate("ariaLabelColumnMenu", "Column Menu") }); if (!defaultTab) { menu.showTabBasedOnPreviousSelection?.(); positionCallback(menu); } if (_isColumnMenuAnchoringEnabled(this.gos)) { const stopAnchoringPromise = popupSvc.setPopupPositionRelatedToElement(eMenuGui, anchorToElement); if (stopAnchoringPromise && column) { this.addStopAnchoring(stopAnchoringPromise, column, closedFuncs); } } menu.addEventListener("tabSelected", (event) => { this.dispatchVisibleChangedEvent(false, true, column); this.lastSelectedTab = event.key; this.dispatchVisibleChangedEvent(true, true, column); }); if (column) { _setColMenuVisible(column, true, "contextMenu"); } this.activeMenu = menu; menu.addEventListener("destroyed", () => { if (this.activeMenu === menu) { this.activeMenu = null; } }); } addStopAnchoring(stopAnchoringPromise, column, closedFuncsArr) { stopAnchoringPromise.then((stopAnchoringFunc) => { column.__addEventListener("leftChanged", stopAnchoringFunc); column.__addEventListener("visibleChanged", stopAnchoringFunc); closedFuncsArr.push(() => { column.__removeEventListener("leftChanged", stopAnchoringFunc); column.__removeEventListener("visibleChanged", stopAnchoringFunc); }); }); } getMenuParams(column, columnGroup, restrictToTabs, eventSource) { const { focusSvc, visibleCols, ctrlsSvc } = this.beans; const restoreFocusParams = { column, headerPosition: focusSvc.focusedHeader, columnIndex: visibleCols.allCols.indexOf(column), eventSource }; const menu = this.createMenu(column, columnGroup, restoreFocusParams, restrictToTabs, eventSource); return menu ? { menu, eMenuGui: menu.getGui(), anchorToElement: eventSource || ctrlsSvc.getGridBodyCtrl().eGridBody, restoreFocusParams } : void 0; } createMenu(column, columnGroup, restoreFocusParams, restrictToTabs, eventSource) { if (_isLegacyMenuEnabled(this.gos)) { return this.createBean( new TabbedColumnMenu(column, restoreFocusParams, this.lastSelectedTab, restrictToTabs, eventSource) ); } else { const menuItems = this.beans.colMenuFactory.getMenuItems(column, columnGroup); return menuItems.length ? this.createBean(new ColumnContextMenu(menuItems, column, restoreFocusParams, eventSource)) : void 0; } } dispatchVisibleChangedEvent(visible, switchingTab, column, columnGroup, defaultTab) { this.eventSvc.dispatchEvent({ type: "columnMenuVisibleChanged", visible, switchingTab, key: this.lastSelectedTab ?? defaultTab ?? (_isLegacyMenuEnabled(this.gos) ? TAB_GENERAL : "columnMenu"), column: column ?? null, columnGroup: columnGroup ?? null }); } isMenuEnabled(column) { if (!_isLegacyMenuEnabled(this.gos)) { return true; } const isFilterDisabled = !this.beans.filterManager?.isFilterAllowed(column); const tabs = column.getColDef().menuTabs ?? TABS_DEFAULT; const numActiveTabs = isFilterDisabled && tabs.includes(TAB_FILTER) ? tabs.length - 1 : tabs.length; return numActiveTabs > 0; } showMenuAfterContextMenuEvent(column, mouseEvent, touchEvent) { this.beans.menuUtils.onContextMenu({ mouseEvent, touchEvent, source: "ui", showMenuCallback: (eventOrTouch) => { this.showMenuAfterMouseEvent(column, eventOrTouch, "columnMenu"); return true; } }); } }; var TabbedColumnMenu = class extends BeanStub { constructor(column, restoreFocusParams, initialSelection, restrictTo, sourceElement) { super(); this.column = column; this.restoreFocusParams = restoreFocusParams; this.initialSelection = initialSelection; this.restrictTo = restrictTo; this.sourceElement = sourceElement; this.tabFactories = {}; this.includeChecks = {}; const { tabFactories, includeChecks } = this; tabFactories[TAB_GENERAL] = this.createMainPanel.bind(this); tabFactories[TAB_FILTER] = this.createFilterPanel.bind(this); tabFactories[TAB_COLUMNS] = this.createColumnsPanel.bind(this); includeChecks[TAB_GENERAL] = () => true; includeChecks[TAB_FILTER] = () => column ? !!this.beans.filterManager?.isFilterAllowed(column) : false; includeChecks[TAB_COLUMNS] = () => true; } postConstruct() { const tabs = this.getTabsToCreate().map((name) => this.createTab(name)); const tabbedLayout = new AgTabbedLayout({ items: tabs, cssClass: "ag-menu", onActiveItemClicked: this.onHidePopup.bind(this), onItemClicked: this.onTabItemClicked.bind(this) }); this.tabbedLayout = this.createBean(tabbedLayout); this.mainMenuList?.setParentComponent(tabbedLayout); this.addDestroyFunc(() => this.destroyBean(tabbedLayout)); } getTabsToCreate() { if (this.restrictTo) { return this.restrictTo; } return (this.column?.getColDef().menuTabs ?? TABS_DEFAULT).filter( (tabName) => this.isValidMenuTabItem(tabName) && this.isNotSuppressed(tabName) ); } isValidMenuTabItem(menuTabName) { let isValid = true; let itemsToConsider = TABS_DEFAULT; if (this.restrictTo != null) { isValid = this.restrictTo.indexOf(menuTabName) > -1; itemsToConsider = this.restrictTo; } isValid = isValid && TABS_DEFAULT.indexOf(menuTabName) > -1; if (!isValid) { _warn(175, { menuTabName, itemsToConsider }); } return isValid; } isNotSuppressed(menuTabName) { return this.includeChecks[menuTabName](); } createTab(name) { return this.tabFactories[name](); } showTabBasedOnPreviousSelection() { this.showTab(this.initialSelection); } showTab(toShow) { const { tabItemColumns, tabbedLayout, tabItemFilter, tabItemGeneral } = this; if (tabItemColumns && toShow === TAB_COLUMNS) { tabbedLayout.showItem(tabItemColumns); } else if (tabItemFilter && toShow === TAB_FILTER) { tabbedLayout.showItem(tabItemFilter); } else if (tabItemGeneral && toShow === TAB_GENERAL) { tabbedLayout.showItem(tabItemGeneral); } else { tabbedLayout.showFirstItem(); } } onTabItemClicked(event) { let key = null; switch (event.item) { case this.tabItemColumns: key = TAB_COLUMNS; break; case this.tabItemFilter: key = TAB_FILTER; break; case this.tabItemGeneral: key = TAB_GENERAL; break; } if (key) { this.activateTab(key); } } activateTab(tab) { const ev = { type: "tabSelected", key: tab }; this.dispatchLocalEvent(ev); } createMainPanel() { const { beans, column } = this; const colMenuFactory = beans.colMenuFactory; const mainMenuList = colMenuFactory.createMenu( this, colMenuFactory.getMenuItems(column), this.column, () => this.sourceElement ?? this.getGui() ); this.mainMenuList = mainMenuList; mainMenuList.addEventListener("closeMenu", this.onHidePopup.bind(this)); const tabItemGeneral = { title: _createIconNoSpan("legacyMenu", beans, column), titleLabel: TAB_GENERAL.replace("MenuTab", ""), bodyPromise: AgPromise.resolve(mainMenuList.getGui()), name: TAB_GENERAL }; this.tabItemGeneral = tabItemGeneral; return tabItemGeneral; } onHidePopup(event) { this.beans.menuUtils.closePopupAndRestoreFocusOnSelect( this.hidePopupFunc, this.restoreFocusParams, event ); } createFilterPanel() { const comp = this.column ? this.createBean(new FilterComp(this.column, "COLUMN_MENU")) : null; this.filterComp = comp; if (!comp?.hasFilter()) { _error(119); } const afterAttachedCallback = (params) => comp?.afterGuiAttached(params); const afterDetachedCallback = () => comp?.afterGuiDetached(); this.tabItemFilter = { title: _createIconNoSpan("filterTab", this.beans, this.column), titleLabel: TAB_FILTER.replace("MenuTab", ""), bodyPromise: AgPromise.resolve(comp?.getGui()), afterAttachedCallback, afterDetachedCallback, name: TAB_FILTER }; return this.tabItemFilter; } createColumnsPanel() { const eWrapperDiv = _createElement({ tag: "div", cls: "ag-menu-column-select-wrapper" }); const { beans, column } = this; const columnSelectPanel = beans.colChooserFactory.createColumnSelectPanel( this, column ); const columnSelectPanelGui = columnSelectPanel.getGui(); columnSelectPanelGui.classList.add("ag-menu-column-select"); eWrapperDiv.appendChild(columnSelectPanelGui); const tabItemColumns = { title: _createIconNoSpan("columns", beans, column), //createColumnsIcon(), titleLabel: TAB_COLUMNS.replace("MenuTab", ""), bodyPromise: AgPromise.resolve(eWrapperDiv), name: TAB_COLUMNS }; this.tabItemColumns = tabItemColumns; return tabItemColumns; } afterGuiAttached(params) { const { container, hidePopup } = params; this.tabbedLayout.setAfterAttachedParams({ container, hidePopup }); if (hidePopup) { this.hidePopupFunc = hidePopup; this.addDestroyFunc(hidePopup); } } getGui() { return this.tabbedLayout.getGui(); } destroy() { super.destroy(); this.destroyBean(this.filterComp); } }; var ColumnContextMenu = class extends Component { constructor(menuItems, column, restoreFocusParams, sourceElement) { super({ tag: "div", ref: "eColumnMenu", cls: "ag-menu ag-column-menu", role: "presentation" }); this.menuItems = menuItems; this.column = column; this.restoreFocusParams = restoreFocusParams; this.sourceElement = sourceElement; this.eColumnMenu = RefPlaceholder; } postConstruct() { const mainMenuList = this.beans.colMenuFactory.createMenu( this, this.menuItems, this.column, () => this.sourceElement ?? this.getGui() ); this.mainMenuList = mainMenuList; mainMenuList.addEventListener("closeMenu", this.onHidePopup.bind(this)); this.eColumnMenu.appendChild(mainMenuList.getGui()); } // eslint-disable-next-line sonarjs/no-identical-functions onHidePopup(event) { this.beans.menuUtils.closePopupAndRestoreFocusOnSelect( this.hidePopupFunc, this.restoreFocusParams, event ); } afterGuiAttached({ hidePopup }) { if (hidePopup) { this.hidePopupFunc = hidePopup; this.addDestroyFunc(hidePopup); } _focusInto(this.mainMenuList.getGui()); } }; // packages/ag-grid-enterprise/src/menu/menuApi.ts function showContextMenu(beans, params) { const { contextMenuSvc } = beans; if (!contextMenuSvc) { return; } const { rowNode, column, value, x, y } = params || {}; let { x: clientX, y: clientY } = contextMenuSvc.getContextMenuPosition(rowNode, column); if (x != null) { clientX = x; } if (y != null) { clientY = y; } contextMenuSvc.showContextMenu({ mouseEvent: new MouseEvent("mousedown", { clientX, clientY }), rowNode, column, value, source: "api" }); } function showColumnChooser(beans, params) { beans.colChooserFactory?.showColumnChooser({ chooserParams: params }); } function hideColumnChooser(beans) { beans.colChooserFactory?.hideActiveColumnChooser(); } // packages/ag-grid-enterprise/src/menu/menuUtils.ts var MenuUtils = class extends BeanStub { constructor() { super(...arguments); this.beanName = "menuUtils"; } restoreFocusOnClose(restoreFocusParams, eComp, e, restoreIfMouseEvent) { const { eventSource } = restoreFocusParams; const isKeyboardEvent = e instanceof KeyboardEvent; if (!restoreIfMouseEvent && !isKeyboardEvent || !eventSource) { return; } const activeEl = _getActiveDomElement(this.beans); if ( // focus is outside of comp !eComp.contains(activeEl) && // something else has focus !_isNothingFocused(this.beans) ) { return; } this.focusHeaderCell(restoreFocusParams); } closePopupAndRestoreFocusOnSelect(hidePopupFunc, restoreFocusParams, event) { let keyboardEvent; if (event?.keyboardEvent) { keyboardEvent = event.keyboardEvent; } hidePopupFunc(keyboardEvent && { keyboardEvent }); const beans = this.beans; const focusSvc = beans.focusSvc; const focusedCell = focusSvc.getFocusedCell(); if (_isNothingFocused(beans)) { if (focusedCell) { const { rowIndex, rowPinned, column } = focusedCell; focusSvc.setFocusedCell({ rowIndex, column, rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: true }); } else { this.focusHeaderCell(restoreFocusParams); } } } onContextMenu(params) { const { mouseEvent, touchEvent, showMenuCallback, source } = params; if (!this.gos.get("allowContextMenuWithControlKey")) { if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) { return; } } if (mouseEvent) { this.blockMiddleClickScrollsIfNeeded(mouseEvent); } if (source === "ui" && this.gos.get("suppressContextMenu")) { return; } const eventOrTouch = mouseEvent ?? touchEvent.touches[0]; if (showMenuCallback(eventOrTouch)) { const event = mouseEvent ?? touchEvent; if (event?.cancelable) { event.preventDefault(); } } } // make this async for react async focusHeaderCell(restoreFocusParams) { const { column, columnIndex, headerPosition, eventSource } = restoreFocusParams; const { visibleCols, headerNavigation, focusSvc } = this.beans; const isColumnStillVisible = await visibleCols.allCols.some((col) => col === column); if (!this.isAlive()) { return; } if (column?.isAlive() && isColumnStillVisible && eventSource && _isVisible(eventSource)) { const focusableEl = _findTabbableParent(eventSource); if (focusableEl) { headerNavigation?.scrollToColumn(column); focusableEl.focus(); } } else if (headerPosition && columnIndex !== -1) { const allColumns = visibleCols.allCols; const columnToFocus = allColumns[columnIndex] || _last(allColumns); if (columnToFocus) { focusSvc.focusHeaderPosition({ headerPosition: { headerRowIndex: headerPosition.headerRowIndex, column: columnToFocus } }); } } } blockMiddleClickScrollsIfNeeded(mouseEvent) { if (this.gos.get("suppressMiddleClickScrolls") && mouseEvent.which === 2) { mouseEvent.preventDefault(); } } }; // packages/ag-grid-enterprise/src/menu/menuModule.ts var MenuCoreModule = { moduleName: "MenuCore", version: VERSION2, beans: [MenuItemMapper, ChartMenuItemMapper, MenuUtils], icons: { // context menu chart item chart: "chart", // columns in menu (column chooser / columns tab) columns: "columns", // loading async menu items loadingMenuItems: "loading", // "Pin column" item in column header menu menuPin: "pin", // "Value aggregation" column menu item (shown on numeric columns when grouping is active)" menuValue: "aggregation", // "Group by {column-name}" item in column header menu menuAddRowGroup: "group", // "Un-Group by {column-name}" item in column header menu menuRemoveRowGroup: "group", // context menu copy item clipboardCopy: "copy", // context menu cut item clipboardCut: "cut", // context menu paste item clipboardPaste: "paste", // context menu export item save: "save", // csv export csvExport: "csv", // excel export, excelExport: "excel", // show on column header when column is sorted ascending sortAscending: "asc", // show on column header when column is sorted descending sortDescending: "desc", // show on column header when column is sorted absolute ascending sortAbsoluteAscending: "aasc", // show on column header when column is sorted absolute descending sortAbsoluteDescending: "adesc", // show on column header when column has no sort, only when enabled with colDef.unSortIcon=true sortUnSort: "none" }, dependsOn: [EnterpriseCoreModule, PopupModule, SharedMenuModule, MenuItemModule] }; var ColumnMenuModule = { moduleName: "ColumnMenu", version: VERSION2, beans: [EnterpriseMenuFactory, ColumnMenuFactory, ColumnChooserFactory], icons: { ensureColumnVisible: "column-arrow", // menu tab icon in legacy tabbed enterprise column menu legacyMenu: "menu", // filter tab icon in legacy tabbed enterprise column menu filterTab: "filter", // column tool panel column group contracted (click to expand) columnSelectClosed: "tree-closed", // column tool panel column group expanded (click to contract) columnSelectOpen: "tree-open", // column tool panel header expand/collapse all button, shown when some children are expanded and // others are collapsed columnSelectIndeterminate: "tree-indeterminate" }, apiFunctions: { showColumnChooser, hideColumnChooser }, dependsOn: [MenuCoreModule, SharedColumnStateUpdateStrategyModule, SharedDragAndDropModule, ColumnMoveModule] }; var ContextMenuModule = { moduleName: "ContextMenu", version: VERSION2, beans: [ContextMenuService], apiFunctions: { showContextMenu }, dependsOn: [MenuCoreModule] }; var MenuModule = { moduleName: "Menu", version: VERSION2, dependsOn: [ColumnMenuModule, ContextMenuModule] }; // packages/ag-grid-enterprise/src/richSelect/richSelectCellEditor.ts var DEFAULT_VALUES_PAGE_LOAD_THRESHOLD = 10; var RichSelectCellEditor = class extends AgAbstractCellEditor { constructor() { super({ tag: "div", cls: "ag-cell-edit-wrapper" }); this.pendingInitialEventKey = null; this.initialEventKeyProcessed = false; } initialiseEditor(_params) { const { cellStartedEdit, values, valuesPage, eventKey } = this.params; this.pendingInitialEventKey = null; this.initialEventKeyProcessed = false; if (_missing(values) && _missing(valuesPage)) { _warn(180); } const asyncMode = this.resolveAsyncMode(); const { params: richSelectParams, valueList } = this.buildRichSelectParams(asyncMode); const richSelect = this.createManagedBean(new AgRichSelect(richSelectParams)); this.eEditor = richSelect; richSelect.addCss("ag-cell-editor"); this.appendChild(richSelect); const asyncValuesSource = this.getAsyncValuesSource(asyncMode); if (asyncValuesSource) { richSelect.setAsyncValuesSource({ source: asyncValuesSource, thresholdRows: this.params.valuesPageLoadThreshold ?? DEFAULT_VALUES_PAGE_LOAD_THRESHOLD, useAsyncSearch: asyncMode.isFullAsync, onMisconfiguredSearchSource: asyncMode.isFullAsync ? () => _warn(294) : void 0, onFirstValuesPageLoaded: () => { if (this.pendingInitialEventKey != null) { this.consumeInitialEventKey(this.pendingInitialEventKey); this.pendingInitialEventKey = null; } } }); } this.eEditor.setValueList({ valueList, refresh: true, isInitial: true }); if (asyncMode.isValuesPaged) { this.eEditor.resetAsyncValues(""); if (asyncMode.isFullAsync) { this.consumeInitialEventKey(eventKey); } else { this.pendingInitialEventKey = eventKey; } } else if (valueList && !Array.isArray(valueList)) { valueList.then((values2) => { const searchStringCallback = this.getSearchStringCallback(values2); if (searchStringCallback) { richSelect.setSearchStringCreator(searchStringCallback); } this.consumeInitialEventKey(eventKey); }).catch((error) => { _consoleError("Rich Select", error); this.consumeInitialEventKey(eventKey); }); } this.addManagedListeners(richSelect, { fieldPickerValueSelected: this.onEditorPickerValueSelected.bind(this) }); this.focusAfterAttached = cellStartedEdit; } onEditorPickerValueSelected(e) { if (this.gos.get("editType") !== "fullRow") { setTimeout(() => this.params.stopEditing(!e.fromEnterKey)); } } getPlaceholderText(isFullAsync = this.isFullAsync()) { const { valuePlaceholder } = this.params; if (valuePlaceholder !== void 0) { return valuePlaceholder; } const translate = this.getLocaleTextFunc(); return isFullAsync ? translate("typeToSearchOoo", "Type to search...") : translate("advancedFilterBuilderSelectOption", "Select an option..."); } isFullAsync() { const { allowTyping, filterListAsync, values, valuesPage } = this.params; const hasAsyncValueSource = typeof values === "function" || typeof valuesPage === "function"; if (filterListAsync && !allowTyping) { _warn(294); return false; } if (!hasAsyncValueSource && filterListAsync) { _warn(294); return false; } return !!(allowTyping && filterListAsync && hasAsyncValueSource); } isValuesPaged() { return typeof this.params.valuesPage === "function"; } resolveAsyncMode() { return { isValuesPaged: this.isValuesPaged(), isFullAsync: this.isFullAsync() }; } getInitialValueList(asyncMode = this.resolveAsyncMode()) { const params = this.params; const { values } = params; if (asyncMode.isValuesPaged) { return; } if (!values) { return []; } if (Array.isArray(values)) { return values; } if (typeof values !== "function") { return []; } if (asyncMode.isFullAsync) { return; } return values({ ...params }); } buildRichSelectParams(asyncMode = this.resolveAsyncMode()) { const params = this.params; const { cellRenderer, cellRendererParams, cellHeight, value, values, formatValue, searchDebounceDelay, valueListGap, valueListMaxHeight, valueListMaxWidth, allowTyping, filterList, searchType, highlightMatch, eventKey, multiSelect, suppressDeselectAll, suppressMultiSelectPillRenderer } = params; const { isValuesPaged, isFullAsync } = asyncMode; const formatValueFn = formatValue ?? ((value2) => String(value2 ?? "")); const valueFormatter = (value2) => { if (Array.isArray(value2)) { return value2.map((currentValue) => formatValueFn(currentValue)).join(", "); } return formatValueFn(value2); }; const ret = { value, cellRenderer, cellRendererParams, cellRowHeight: cellHeight, searchDebounceDelay, valueFormatter, pickerAriaLabelKey: "ariaLabelRichSelectField", pickerAriaLabelValue: "Rich Select Field", pickerType: "virtual-list", pickerGap: valueListGap, allowTyping, filterList, searchType, highlightMatch, maxPickerHeight: valueListMaxHeight, maxPickerWidth: valueListMaxWidth, placeholder: this.getPlaceholderText(isFullAsync), initialInputValue: eventKey?.length === 1 ? eventKey : eventKey === KeyCode.BACKSPACE ? "" : void 0, multiSelect, suppressDeselectAll, suppressMultiSelectPillRenderer }; const valueList = this.getInitialValueList(asyncMode); const isSync = Array.isArray(values); const isValuesCallback = typeof values === "function"; if (isValuesPaged) { if (valueList) { ret.valueList = valueList; } if (isFullAsync) { ret.allowNoResultsCopy = true; ret.filterList = true; } } else if (isSync) { ret.valueList = valueList; ret.searchStringCreator = this.getSearchStringCallback(valueList); } else if (isValuesCallback && isFullAsync) { ret.allowNoResultsCopy = true; ret.filterList = true; } return { params: ret, valueList }; } getAsyncValuesSource(asyncMode = this.resolveAsyncMode()) { const { isFullAsync, isValuesPaged } = asyncMode; if (!isFullAsync && !isValuesPaged) { return; } return { searchValues: isFullAsync ? (searchString) => this.getAsyncSearchValues(searchString) : void 0, loadValuesPage: isValuesPaged ? (request) => this.getAsyncValuesPage(request) : void 0, valuesPageInitialStartRow: isValuesPaged ? (searchString) => this.resolveValuesPageInitialStartRow(searchString) : void 0, valuesPageSize: isValuesPaged ? this.params.valuesPageSize : void 0 }; } getAsyncSearchValues(searchString) { const { values } = this.params; if (typeof values !== "function") { return []; } return values({ ...this.params, search: searchString }); } getAsyncValuesPage(request) { const { valuesPage } = this.params; if (typeof valuesPage !== "function") { return { values: [] }; } return valuesPage({ ...this.params, search: request.search, startRow: request.startRow, endRow: request.endRow, cursor: request.cursor }); } resolveValuesPageInitialStartRow(searchString) { if (searchString) { return 0; } const { valuesPageInitialStartRow, value } = this.params; const startRow = typeof valuesPageInitialStartRow === "function" ? valuesPageInitialStartRow(value) : valuesPageInitialStartRow; return Math.max(Math.floor(startRow ?? 0), 0); } getSearchStringCallback(values) { if (typeof values[0] !== "object") { return; } const params = this.params; const { colDef, formatValue } = params; const formatValueFn = formatValue ?? ((value) => String(value ?? "")); if (colDef.cellEditorParams?.formatValue) { return (values2) => values2.map(formatValueFn); } const { keyCreator } = colDef; if (keyCreator) { _warn(266); const { column, node, data } = params; return (values2) => values2.map((value) => { const keyParams = _addGridCommonParams(this.gos, { value, colDef, column, node, data }); return keyCreator(keyParams); }); } return (values2) => values2.map(formatValueFn); } // we need to have the gui attached before we can draw the virtual rows, as the // virtual row logic needs info about the gui state. afterGuiAttached() { const { focusAfterAttached, params } = this; setTimeout(() => { if (!this.isAlive()) { return; } const richSelect = this.eEditor; const { allowTyping, eventKey, cellStartedEdit } = params; if (focusAfterAttached) { const focusableEl = richSelect.getFocusableElement(); focusableEl.focus(); if (allowTyping && (!eventKey || eventKey.length !== 1)) { focusableEl.select(); } } if (cellStartedEdit) { richSelect.showPicker(); } if (this.pendingInitialEventKey == null) { this.consumeInitialEventKey(eventKey); } }); } consumeInitialEventKey(eventKey) { if (!eventKey || this.initialEventKeyProcessed) { return; } this.initialEventKeyProcessed = true; this.processEventKey(eventKey); } processEventKey(eventKey) { if (!eventKey) { return; } if (eventKey === KeyCode.BACKSPACE) { this.eEditor.searchTextFromString(null); } else if (eventKey?.length === 1) { this.eEditor.searchTextFromString(eventKey); } } focusIn() { this.eEditor.getFocusableElement().focus(); } agSetEditValue(value) { this.params.value = value; this.eEditor.setValue(value ?? null, true); } getValue() { const { params } = this; const value = this.eEditor.getValue(); return params.parseValue?.(value) ?? value; } isPopup() { return false; } getValidationElement() { return this.eEditor.getAriaElement(); } getValidationErrors() { const { params } = this; const { getValidationErrors } = params; if (!getValidationErrors) { return null; } return getValidationErrors({ value: this.getValue(), internalErrors: null, cellEditorParams: params }); } }; // packages/ag-grid-enterprise/src/richSelect/richSelectModule.ts var RichSelectModule = { moduleName: "RichSelect", version: VERSION2, beans: [], userComponents: { agRichSelect: RichSelectCellEditor, agRichSelectCellEditor: RichSelectCellEditor }, icons: { // open icon for rich select editor richSelectOpen: "small-down", // remove for rich select editor pills richSelectRemove: "cancel", // loading async values richSelectLoading: "loading" }, dependsOn: [EnterpriseCoreModule, EditCoreModule] }; // packages/ag-grid-enterprise/src/setFilter/iSetDisplayValueModel.ts var SET_FILTER_SELECT_ALL = "__AG_SELECT_ALL__"; var SET_FILTER_ADD_SELECTION_TO_FILTER = "__AG_ADD_SELECTION_TO_FILTER__"; // packages/ag-grid-enterprise/src/setFilter/flatSetDisplayValueModel.ts var FlatSetDisplayValueModel = class { constructor(valueSvc, getValueFormatter, formatter, column) { this.valueSvc = valueSvc; this.getValueFormatter = getValueFormatter; this.formatter = formatter; this.column = column; /** All keys that are currently displayed, after the mini-filter has been applied. */ this.displayedKeys = []; } updateDisplayedValuesToAllAvailable(_getValue, _allKeys, availableKeys) { this.displayedKeys = Array.from(availableKeys); } updateDisplayedValuesToMatchMiniFilter(getValue, _allKeys, availableKeys, matchesFilter, nullMatchesFilter) { this.displayedKeys = []; const valueFormatter = this.getValueFormatter(); for (const key of availableKeys) { if (key == null) { if (nullMatchesFilter) { this.displayedKeys.push(key); } } else { const value = getValue(key); const valueFormatterValue = this.valueSvc.formatValue(this.column, null, value, valueFormatter, false); const textFormatterValue = this.formatter(valueFormatterValue); if (matchesFilter(textFormatterValue)) { this.displayedKeys.push(key); } } } } getDisplayedValueCount() { return this.displayedKeys.length; } getDisplayedItem(index) { return this.displayedKeys[index]; } getSelectAllItem() { return SET_FILTER_SELECT_ALL; } getAddSelectionToFilterItem() { return SET_FILTER_ADD_SELECTION_TO_FILTER; } getDisplayedKeys() { return this.displayedKeys; } forEachDisplayedKey(func) { this.displayedKeys.forEach(func); } someDisplayedKey(func) { return this.displayedKeys.some(func); } hasGroups() { return false; } refresh() { } }; // packages/ag-grid-enterprise/src/setFilter/setFilterListItem.ts var SetFilterGroupElement = { tag: "div", cls: "ag-set-filter-item", attrs: { "aria-hidden": "true" }, children: [ { tag: "span", cls: "ag-set-filter-group-icons", children: [ { tag: "span", ref: "eGroupClosedIcon", cls: "ag-set-filter-group-closed-icon" }, { tag: "span", ref: "eGroupOpenedIcon", cls: "ag-set-filter-group-opened-icon" }, { tag: "span", ref: "eGroupIndeterminateIcon", cls: "ag-set-filter-group-indeterminate-icon" } ] }, { tag: "ag-checkbox", ref: "eCheckbox", cls: "ag-set-filter-item-checkbox" } ] }; var SetFilterElement = { tag: "div", cls: "ag-set-filter-item", children: [{ tag: "ag-checkbox", ref: "eCheckbox", cls: "ag-set-filter-item-checkbox" }] }; var SetFilterListItem = class extends Component { constructor(params) { super(params.isGroup ? SetFilterGroupElement : SetFilterElement, [AgCheckboxSelector]); this.eCheckbox = RefPlaceholder; this.eGroupOpenedIcon = RefPlaceholder; this.eGroupClosedIcon = RefPlaceholder; this.eGroupIndeterminateIcon = RefPlaceholder; this.formattedValue = null; this.focusWrapper = params.focusWrapper; this.value = params.value; this.params = params.params; this.translate = params.translate; this.valueFormatter = params.valueFormatter; this.item = params.item; this.isSelected = params.isSelected; this.isTree = params.isTree; this.depth = params.depth ?? 0; this.isGroup = params.isGroup; this.groupsExist = params.groupsExist; this.isExpanded = params.isExpanded; this.hasIndeterminateExpandState = params.hasIndeterminateExpandState; } postConstruct() { this.tooltipFeature = this.createOptionalManagedBean( this.beans.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.focusWrapper, getLocation: () => "setFilterValue", shouldDisplayTooltip: () => this.shouldDisplayTooltip?.() ?? true, getAdditionalParams: () => { const { colDef, column } = this.params; const additionalParams = { colDef, column, valueFormatted: this.formattedValue ?? void 0 }; if (this.isTree) { additionalParams.level = this.depth; } return additionalParams; } }) ); this.addDestroyFunc(() => this.destroyCellRendererComponent?.()); this.render(); this.eCheckbox.setLabelEllipsis(true).setValue(this.isSelected, true).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex", "-1"); this.refreshVariableAriaLabels(); if (this.isTree) { if (this.depth > 0) { this.addCss("ag-set-filter-indent-" + this.depth); this.getGui().style.setProperty("--ag-indentation-level", String(this.depth)); } if (this.isGroup) { this.setupExpansion(); } else if (this.groupsExist) { this.addCss("ag-set-filter-add-group-indent"); } _setAriaLevel(this.getAriaElement(), this.depth + 1); } this.refreshAriaChecked(); if (this.params.readOnly) { return; } this.eCheckbox.onValueChange((value) => this.onCheckboxChanged(!!value)); } getFocusableElement() { return this.focusWrapper; } setupExpansion() { const { eGroupClosedIcon, eGroupOpenedIcon, eGroupIndeterminateIcon, hasIndeterminateExpandState, beans } = this; eGroupClosedIcon.appendChild(_createIcon("setFilterGroupClosed", beans, null)); eGroupOpenedIcon.appendChild(_createIcon("setFilterGroupOpen", beans, null)); const listener = this.onExpandOrContractClicked.bind(this); this.addManagedElementListeners(eGroupClosedIcon, { click: listener }); this.addManagedElementListeners(eGroupOpenedIcon, { click: listener }); if (hasIndeterminateExpandState) { eGroupIndeterminateIcon.appendChild(_createIcon("setFilterGroupIndeterminate", beans, null)); this.addManagedElementListeners(eGroupIndeterminateIcon, { click: listener }); } this.setExpandedIcons(); this.refreshAriaExpanded(); } onExpandOrContractClicked() { this.setExpanded(!this.isExpanded); } setExpanded(isExpanded, silent) { if (this.isGroup && isExpanded !== this.isExpanded) { this.isExpanded = isExpanded; const event = { type: "expandedChanged", isExpanded: !!isExpanded, item: this.item }; if (!silent) { this.dispatchLocalEvent(event); } this.setExpandedIcons(); this.refreshAriaExpanded(); } } setExpandedIcons() { const { isExpanded, hasIndeterminateExpandState, eGroupClosedIcon, eGroupOpenedIcon, eGroupIndeterminateIcon } = this; _setDisplayed(eGroupClosedIcon, hasIndeterminateExpandState ? isExpanded === false : !isExpanded); _setDisplayed(eGroupOpenedIcon, isExpanded === true); if (hasIndeterminateExpandState) { _setDisplayed(eGroupIndeterminateIcon, isExpanded === void 0); } } onCheckboxChanged(isSelected) { this.isSelected = isSelected; const event = { type: "selectionChanged", isSelected, item: this.item }; this.dispatchLocalEvent(event); this.refreshVariableAriaLabels(); this.refreshAriaChecked(); } toggleSelected() { if (this.params.readOnly) { return; } this.setSelected(!this.isSelected); } setSelected(isSelected, silent) { this.isSelected = isSelected; this.eCheckbox.setValue(isSelected, silent); this.refreshAriaChecked(); } refreshVariableAriaLabels() { if (!this.isTree) { return; } const translate = this.getLocaleTextFunc(); const checkboxValue = this.eCheckbox.getValue(); const state = checkboxValue === void 0 ? translate("ariaIndeterminate", "indeterminate") : checkboxValue ? translate("ariaVisible", "visible") : translate("ariaHidden", "hidden"); const visibilityLabel = translate("ariaToggleVisibility", "Press SPACE to toggle visibility"); _setAriaLabelledBy(this.eCheckbox.getInputElement(), void 0); this.eCheckbox.setInputAriaLabel(`${visibilityLabel} (${state})`); } setupFixedAriaLabels(value) { if (!this.isTree) { return; } const translate = this.getLocaleTextFunc(); const itemLabel = translate("ariaFilterValue", "Filter Value"); const ariaEl = this.getAriaElement(); _setAriaLabel(ariaEl, `${value} ${itemLabel}`); _setAriaDescribedBy(ariaEl, this.eCheckbox.getInputElement().id); } refreshAriaChecked() { const ariaEl = this.getAriaElement(); _setAriaChecked(ariaEl, this.eCheckbox.getValue()); } refreshAriaExpanded() { _setAriaExpanded(this.getAriaElement(), !!this.isExpanded); } refresh(item, isSelected, isExpanded) { this.item = item; if (isSelected !== this.isSelected) { this.setSelected(isSelected, true); } this.setExpanded(isExpanded, true); const { cellRendererComponent, cellRendererParams, beans, params } = this; if (this.valueFunction) { const value = this.valueFunction(); this.setTooltipAndCellRendererParams(value, value); if (!cellRendererComponent) { this.renderCellWithoutCellRenderer(); } } if (cellRendererComponent) { const compDetails = _getCellRendererDetails(beans.userCompFactory, params, cellRendererParams); const success = cellRendererComponent.refresh?.(compDetails?.params ?? cellRendererParams); if (!success) { const oldComponent = cellRendererComponent; this.renderCell(); this.destroyBean(oldComponent); } } } render() { const { params: { column } } = this; let { value } = this; let formattedValue = null; if (typeof value === "function") { this.valueFunction = value; formattedValue = this.valueFunction(); value = formattedValue; } else if (this.isTree) { formattedValue = _toStringOrNull(value); } else { formattedValue = this.getFormattedValue(column, value); } this.formattedValue = formattedValue; this.setTooltipAndCellRendererParams(value, formattedValue); this.renderCell(); } setTooltipAndCellRendererParams(value, formattedValue) { const gos = this.gos; if (this.params.showTooltips && (!_isShowTooltipWhenTruncated(gos) || !this.params.cellRenderer)) { const newTooltipText = formattedValue != null ? formattedValue : _toStringOrNull(value); this.shouldDisplayTooltip = _getShouldDisplayTooltip( gos, () => this.eCheckbox.getGui().querySelector(".ag-label") ); this.tooltipFeature?.setTooltipAndRefresh(newTooltipText); } this.cellRendererParams = _addGridCommonParams(gos, { value, valueFormatted: formattedValue, colDef: this.params.colDef, column: this.params.column, setTooltip: (value2, shouldDisplayTooltip) => { gos.assertModuleRegistered("Tooltip", 3); this.shouldDisplayTooltip = shouldDisplayTooltip; this.tooltipFeature?.setTooltipAndRefresh(value2); } }); } getFormattedValue(column, value) { return this.beans.valueSvc.formatValue(column, null, value, this.valueFormatter, false); } renderCell() { const compDetails = _getCellRendererDetails(this.beans.userCompFactory, this.params, this.cellRendererParams); const cellRendererPromise = compDetails?.newAgStackInstance(); if (cellRendererPromise == null) { this.renderCellWithoutCellRenderer(); return; } cellRendererPromise.then((component) => { if (component) { this.cellRendererComponent = component; this.eCheckbox.setLabel(component.getGui()); this.destroyCellRendererComponent = () => this.destroyBean(component); } }); } renderCellWithoutCellRenderer() { const { valueFormatted, value } = this.cellRendererParams; let valueToRender = (valueFormatted == null ? value : valueFormatted) ?? this.translate("blanks"); if (typeof valueToRender !== "string") { _warn(208); valueToRender = ""; } this.eCheckbox.setLabel(valueToRender); this.setupFixedAriaLabels(valueToRender); } getComponentHolder() { return this.params.column.getColDef(); } }; // packages/ag-grid-enterprise/src/setFilter/localeText.ts var DEFAULT_LOCALE_TEXT = { loadingOoo: "Loading...", blanks: "(Blanks)", searchOoo: "Search...", selectAll: "(Select All)", selectAllSearchResults: "(Select All Search Results)", addCurrentSelectionToFilter: "Add current selection to filter", noMatches: "No matches.", ariaSearchFilterValues: "Search filter values", ariaFilterList: "Filter List", filterSummaryListInactive: "is (All)", filterSummaryListSeparator: ", ", filterSummaryListShort: (variableValues) => `is (${variableValues[0]})`, filterSummaryListLong: (variableValues) => `is (${variableValues[0]}) and ${variableValues[1]} more` }; // packages/ag-grid-enterprise/src/setFilter/setFilterUtils.ts function processDataPath(dataPath, treeData, groupAllowUnbalanced) { let processedDataPath = dataPath; if (!processedDataPath) { return null; } processedDataPath = processedDataPath.map((treeKey) => _toStringOrNull(_makeNull(treeKey))); if (!treeData && groupAllowUnbalanced && processedDataPath.some((treeKey) => treeKey == null)) { if (_last(processedDataPath) == null) { return null; } return processedDataPath.filter((treeKey) => treeKey != null); } return processedDataPath; } function translateForSetFilter(bean, key, variableValues) { return _translate(bean, DEFAULT_LOCALE_TEXT, key, variableValues); } function applyExcelModeOptions(params) { if (params.excelMode === "windows") { if (!params.buttons) { params.buttons = ["apply", "cancel"]; } if (params.closeOnApply == null) { params.closeOnApply = true; } } else if (params.excelMode === "mac") { if (!params.buttons) { params.buttons = ["reset"]; } if (params.applyMiniFilterWhileTyping == null) { params.applyMiniFilterWhileTyping = true; } if (params.debounceMs == null) { params.debounceMs = 500; } } if (params.excelMode && params.defaultToNothingSelected) { params.defaultToNothingSelected = false; _warn(207); } } function createTreeDataOrGroupingComparator() { return ([_aKey, aValue], [_bKey, bValue]) => { if (aValue == null) { return bValue == null ? 0 : -1; } else if (bValue == null) { return 1; } for (let i = 0; i < aValue.length; i++) { if (i >= bValue.length) { return 1; } const diff = _defaultComparator(aValue[i], bValue[i]); if (diff !== 0) { return diff; } } return 0; }; } // packages/ag-grid-enterprise/src/setFilter/treeSetDisplayValueModel.ts var TreeSetDisplayValueModel = class { constructor(formatter, treeListPathGetter, treeListFormatter, treeDataOrGrouping) { this.formatter = formatter; this.treeListPathGetter = treeListPathGetter; this.treeListFormatter = treeListFormatter; this.treeDataOrGrouping = treeDataOrGrouping; /** all displayed items in a tree structure */ this.allDisplayedItemsTree = /* @__PURE__ */ new Map(); /** all displayed items flattened and filtered */ this.activeDisplayedItemsFlat = []; this.selectAllItem = { depth: 0, filterPasses: true, available: true, treeKey: SET_FILTER_SELECT_ALL, children: this.allDisplayedItemsTree, expanded: true, key: SET_FILTER_SELECT_ALL, parentTreeKeys: [] }; this.addSelectionToFilterItem = { depth: 0, filterPasses: true, available: true, treeKey: SET_FILTER_ADD_SELECTION_TO_FILTER, expanded: true, key: SET_FILTER_ADD_SELECTION_TO_FILTER, parentTreeKeys: [] }; } updateParams(treeListPathGetter, treeListFormatter) { this.treeListPathGetter = treeListPathGetter; this.treeListFormatter = treeListFormatter; } updateDisplayedValuesToAllAvailable(getValue, allKeys, availableKeys, source) { if (source === "reload") { this.generateItemTree(getValue, allKeys, availableKeys); } else if (source === "otherFilter") { this.updateAvailable(availableKeys); this.updateExpandAll(); } else if (source === "miniFilter") { this.resetFilter(); this.updateExpandAll(); } this.flattenItems(); } updateDisplayedValuesToMatchMiniFilter(getValue, allKeys, availableKeys, matchesFilter, nullMatchesFilter, source) { if (source === "reload") { this.generateItemTree(getValue, allKeys, availableKeys); } else if (source === "otherFilter") { this.updateAvailable(availableKeys); } this.updateFilter(matchesFilter, nullMatchesFilter); this.updateExpandAll(); this.flattenItems(); } generateItemTree(getValue, allKeys, availableKeys) { const allDisplayedItemsTree = /* @__PURE__ */ new Map(); this.allDisplayedItemsTree = allDisplayedItemsTree; let groupsExist = false; const treeListPathGetter = this.getTreeListPathGetter(getValue, availableKeys); for (const key of allKeys) { const value = getValue(key); const dataPath = treeListPathGetter(value) ?? [null]; const dataPathLength = dataPath.length; if (dataPathLength > 1) { groupsExist = true; } const available = availableKeys.has(key); let children = allDisplayedItemsTree; let item; let parentTreeKeys = []; for (let depth = 0; depth < dataPathLength; depth++) { const treeKey = dataPath[depth]; if (!children) { children = /* @__PURE__ */ new Map(); item.children = children; } const treeKeyUpper = treeKey?.toUpperCase() ?? null; item = children.get(treeKeyUpper); if (!item) { item = { treeKey, depth, filterPasses: true, expanded: false, available, parentTreeKeys }; if (depth === dataPath.length - 1) { item.key = key; } children.set(treeKeyUpper, item); } children = item.children; parentTreeKeys = [...parentTreeKeys, treeKey]; } } this.groupsExist = groupsExist; this.updateAvailable(availableKeys); this.selectAllItem.children = allDisplayedItemsTree; this.selectAllItem.expanded = false; } getTreeListPathGetter(getValue, availableKeys) { if (this.treeListPathGetter) { return this.treeListPathGetter; } if (this.treeDataOrGrouping) { return (value) => value; } let isDate = false; for (const availableKey of availableKeys) { const value = getValue(availableKey); if (value instanceof Date) { isDate = true; break; } else if (value != null) { break; } } if (isDate) { return (value) => _getDateParts(value, false); } _warn(211); return (value) => [String(value)]; } flattenItems() { this.activeDisplayedItemsFlat = []; const recursivelyFlattenDisplayedItems = (items) => { for (const item of items.values()) { if (!item.filterPasses || !item.available) { continue; } this.activeDisplayedItemsFlat.push(item); if (item.children && item.expanded) { recursivelyFlattenDisplayedItems(item.children); } } }; recursivelyFlattenDisplayedItems(this.allDisplayedItemsTree); } resetFilter() { const recursiveFilterReset = (item) => { const children = item.children; if (children) { for (const child of children.values()) { recursiveFilterReset(child); } } item.filterPasses = true; }; for (const item of this.allDisplayedItemsTree.values()) { recursiveFilterReset(item); } } updateFilter(matchesFilter, nullMatchesFilter) { const passesFilter = (item) => { if (!item.available) { return false; } if (item.treeKey == null) { return nullMatchesFilter; } return matchesFilter( this.formatter( this.treeListFormatter ? this.treeListFormatter(item.treeKey, item.depth, item.parentTreeKeys) : item.treeKey ) ); }; for (const item of this.allDisplayedItemsTree.values()) { this.recursiveItemCheck(item, false, passesFilter, "filterPasses"); } } getDisplayedValueCount() { return this.activeDisplayedItemsFlat.length; } getDisplayedItem(index) { return this.activeDisplayedItemsFlat[index]; } getSelectAllItem() { return this.selectAllItem; } getAddSelectionToFilterItem() { return this.addSelectionToFilterItem; } getDisplayedKeys() { const displayedKeys = []; this.forEachDisplayedKey((key) => displayedKeys.push(key)); return displayedKeys; } forEachDisplayedKey(func) { const recursiveForEachItem = (item, topParentExpanded) => { const children = item.children; if (children) { if (!item.expanded || !topParentExpanded) { for (const child of children.values()) { if (child.filterPasses) { recursiveForEachItem(child, false); } } } } else { func(item.key); } }; for (const item of this.activeDisplayedItemsFlat) { recursiveForEachItem(item, true); } } someDisplayedKey(func) { const recursiveSomeItem = (item, topParentExpanded) => { const children = item.children; if (children) { if (!item.expanded || !topParentExpanded) { for (const child of children.values()) { if (child.filterPasses && recursiveSomeItem(child, false)) { return true; } } return false; } } else { return func(item.key); } return false; }; return this.activeDisplayedItemsFlat.some((item) => recursiveSomeItem(item, true)); } hasGroups() { return this.groupsExist; } refresh() { this.updateExpandAll(); this.flattenItems(); } updateExpandAll() { const recursiveExpansionCheck = (items, someTrue, someFalse) => { for (const item2 of items.values()) { if (!item2.filterPasses || !item2.available || !item2.children) { continue; } someTrue = someTrue || !!item2.expanded; someFalse = someFalse || !item2.expanded; if (someTrue && someFalse) { return void 0; } const childExpanded = recursiveExpansionCheck(item2.children, someTrue, someFalse); if (childExpanded === void 0) { return void 0; } else if (childExpanded) { someTrue = true; } else { someFalse = true; } } return someTrue && someFalse ? void 0 : someTrue; }; const item = this.getSelectAllItem(); item.expanded = recursiveExpansionCheck(item.children, false, false); } recursiveItemCheck(item, parentPasses, checkFunction, itemProp) { let atLeastOneChildPassed = false; const children = item.children; if (children) { for (const child of children.values()) { const childPasses = this.recursiveItemCheck( child, parentPasses || checkFunction(item), checkFunction, itemProp ); atLeastOneChildPassed = atLeastOneChildPassed || childPasses; } } const itemPasses = parentPasses || atLeastOneChildPassed || checkFunction(item); item[itemProp] = itemPasses; return itemPasses; } updateAvailable(availableKeys) { const isAvailable = (item) => availableKeys.has(item.key); for (const item of this.allDisplayedItemsTree.values()) { this.recursiveItemCheck(item, false, isAvailable, "available"); } } }; // packages/ag-grid-enterprise/src/setFilter/setFilter.ts var SetFilter = class extends ProvidedFilter { constructor() { super("setFilter", "set-filter"); this.filterType = "set"; this.eMiniFilter = RefPlaceholder; this.eFilterLoading = RefPlaceholder; this.eFilterLoadingIcon = RefPlaceholder; this.eSetFilterList = RefPlaceholder; this.eFilterNoMatches = RefPlaceholder; this.hardRefreshVirtualList = false; this.miniFilterText = null; /** When true, in excelMode = 'windows', it adds previously selected filter items to newly checked filter selection */ this.addCurrentSelectionToFilter = false; /** Keys that have been selected for this filter. */ this.selectedKeys = /* @__PURE__ */ new Set(); } setParams(params) { super.setParams(params); const handler = this.updateHandler(params.getHandler()); const { column, textFormatter, treeList, treeListPathGetter, treeListFormatter } = params; this.formatter = textFormatter ?? ((value) => value ?? null); this.displayValueModel = treeList ? new TreeSetDisplayValueModel( this.formatter, treeListPathGetter, treeListFormatter, handler.isTreeDataOrGrouping() ) : new FlatSetDisplayValueModel( this.beans.valueSvc, () => this.handler.valueFormatter, this.formatter, column ); handler.valueModel.allKeys.then((values) => { if (!this.isAlive()) { return; } this.updateDisplayedValues("reload", values ?? []); this.resetSelectionState(values ?? []); }); if (handler.valueModel.isLoading()) { this.setIsLoading(true); } this.initialiseFilterBodyUi(); } refresh(legacyNewParams) { if (this.params.treeList !== legacyNewParams.treeList) { return false; } this.updateHandler( legacyNewParams.getHandler() ); return super.refresh(legacyNewParams); } updateParams(newParams, oldParams) { super.updateParams(newParams, oldParams); this.updateMiniFilter(); if (newParams.suppressSelectAll !== oldParams.suppressSelectAll) { this.createVirtualListModel(newParams); } const { textFormatter, treeListPathGetter, treeListFormatter } = newParams; this.formatter = textFormatter ?? ((value) => value ?? null); if (this.displayValueModel instanceof TreeSetDisplayValueModel) { this.displayValueModel.updateParams(treeListPathGetter, treeListFormatter); } this.handler.refreshFilterValues(true); } updateHandler(handler) { const oldHandler = this.handler; if (oldHandler !== handler) { for (const func of this.handlerDestroyFuncs ?? []) { func(); } this.handlerDestroyFuncs = [ ...this.addManagedListeners(handler, { anyFilterChanged: (event) => { handler.valueModel.allKeys.then((values) => { if (this.isAlive()) { this.updateDisplayedValues("otherFilter", values ?? []); if (event.updated) { this.checkAndRefreshVirtualList(); this.showOrHideResults(); } } }); }, dataChanged: ({ hardRefresh }) => { handler.valueModel.allKeys.then((values) => { if (this.isAlive()) { this.updateDisplayedValues("reload", values ?? []); this.setSelectedModel(this.state.model?.values ?? null); if (hardRefresh) { this.hardRefreshVirtualList = true; } this.checkAndRefreshVirtualList(); } }); } }), ...this.addManagedListeners(handler.valueModel, { loadingStart: () => this.setIsLoading(true), loadingEnd: () => this.setIsLoading(false) }) ]; this.handler = handler; } return handler; } updateUiVisibility() { } createBodyTemplate() { return { tag: "div", cls: "ag-set-filter", children: [ { tag: "div", ref: "eFilterLoading", cls: "ag-filter-loading ag-loading ag-hidden", children: [ { tag: "span", ref: "eFilterLoadingIcon", cls: "ag-loading-icon" }, { tag: "span", cls: "ag-loading-text", children: translateForSetFilter(this, "loadingOoo") } ] }, { tag: "ag-input-text-field", ref: "eMiniFilter", cls: "ag-mini-filter" }, { tag: "div", ref: "eFilterNoMatches", cls: "ag-filter-no-matches ag-hidden", children: translateForSetFilter(this, "noMatches") }, { tag: "div", ref: "eSetFilterList", cls: "ag-set-filter-list", role: "presentation" } ] }; } getAgComponents() { return [AgInputTextFieldSelector]; } handleKeyDown(e) { super.handleKeyDown(e); if (e.defaultPrevented) { return; } const getComponentForKeyEvent = () => { if (!this.eSetFilterList.contains(_getActiveDomElement(this.beans))) { return; } const currentItem = this.virtualList.getLastFocusedRow(); if (currentItem == null) { return; } const component = this.virtualList.getComponentAt(currentItem); if (component == null) { return; } e.preventDefault(); const { readOnly } = this.params; if (readOnly) { return; } return component; }; switch (e.key) { case KeyCode.SPACE: getComponentForKeyEvent()?.toggleSelected(); break; case KeyCode.ENTER: this.handleKeyEnter(e); break; case KeyCode.LEFT: getComponentForKeyEvent()?.setExpanded(false); break; case KeyCode.RIGHT: getComponentForKeyEvent()?.setExpanded(true); break; } } handleKeyEnter(e) { e.preventDefault(); const { excelMode, readOnly } = this.params; if (!excelMode || !!readOnly) { return; } this.params.onAction("apply", void 0, e); if (this.params.excelMode === "mac") { this.eMiniFilter.getInputElement().select(); } } setModelAndRefresh(values) { return this.setSelectedModel(values).then(() => { if (this.isAlive()) { this.checkAndRefreshVirtualList(); } }); } setModelIntoUi(model) { this.setMiniFilter(this.params.state.state?.miniFilterValue ?? null, true); const values = model == null ? null : model.values; return this.setModelAndRefresh(values); } getModelFromUi() { const values = this.getSelectedModel(); if (!values) { return null; } return { values, filterType: this.filterType }; } areNonNullModelsEqual(a, b) { return _areEqual(a.values, b.values); } setIsLoading(isLoading) { _setDisplayed(this.eFilterLoading, isLoading); if (!isLoading) { this.hardRefreshVirtualList = true; } } initialiseFilterBodyUi() { this.initVirtualList(); this.initMiniFilter(); this.initLoading(); } initLoading() { const loadingIcon = _createIconNoSpan("setFilterLoading", this.beans, this.params.column); if (loadingIcon) { this.eFilterLoadingIcon.appendChild(loadingIcon); } } initVirtualList() { const filterListName = translateForSetFilter(this, "ariaFilterList"); const isTree = !!this.params.treeList; const virtualList = this.virtualList = this.createBean( new VirtualList({ cssIdentifier: "filter", ariaRole: isTree ? "tree" : "listbox", listName: filterListName }) ); const eSetFilterList = this.eSetFilterList; if (isTree) { eSetFilterList.classList.add("ag-set-filter-tree-list"); } eSetFilterList.appendChild(virtualList.getGui()); const { cellHeight } = this.params; if (cellHeight != null) { virtualList.setRowHeight(cellHeight); } const componentCreator = (item, listItemElement) => this.createSetListItem(item, isTree, listItemElement); virtualList.setComponentCreator(componentCreator); const componentUpdater = (item, component) => this.updateSetListItem(item, component); virtualList.setComponentUpdater(componentUpdater); this.createVirtualListModel(this.params); } createVirtualListModel(params) { let model; if (params.suppressSelectAll) { model = new ModelWrapper(this.displayValueModel); } else { model = new ModelWrapperWithSelectAll( this.displayValueModel, this.showAddCurrentSelectionToFilter.bind(this) ); } if (params.treeList) { model = new TreeModelWrapper(model); } this.virtualList.setModel(model); } getSelectAllLabel() { const key = this.miniFilterText == null || !this.params.excelMode ? "selectAll" : "selectAllSearchResults"; return translateForSetFilter(this, key); } getAddSelectionToFilterLabel() { return translateForSetFilter(this, "addCurrentSelectionToFilter"); } createSetListItem(item, isTree, focusWrapper) { const groupsExist = this.displayValueModel.hasGroups(); const { isSelected, isExpanded } = this.isSelectedExpanded(item); const { value, depth, isGroup, hasIndeterminateExpandState, selectedListener, expandedListener } = this.newSetListItemAttributes(item); const itemParams = { focusWrapper, value, params: this.params, translate: (translateKey) => translateForSetFilter(this, translateKey), valueFormatter: this.handler.valueFormatter, item, isSelected, isTree, depth, groupsExist, isGroup, isExpanded, hasIndeterminateExpandState }; const listItem = this.createBean(new SetFilterListItem(itemParams)); listItem.addEventListener("selectionChanged", selectedListener); if (expandedListener) { listItem.addEventListener("expandedChanged", expandedListener); } return listItem; } newSetTreeItemAttributes(item) { const groupsExist = this.displayValueModel.hasGroups(); if (item.key === SET_FILTER_SELECT_ALL) { return { value: () => this.getSelectAllLabel(), isGroup: groupsExist, depth: item.depth, hasIndeterminateExpandState: true, selectedListener: (e) => this.onSelectAll(e.isSelected), expandedListener: (e) => this.onExpandAll(e.item, e.isExpanded) }; } if (item.key === SET_FILTER_ADD_SELECTION_TO_FILTER) { return { value: () => this.getAddSelectionToFilterLabel(), depth: item.depth, isGroup: false, hasIndeterminateExpandState: false, selectedListener: (e) => { this.addCurrentSelectionToFilter = e.isSelected; this.refreshAfterSelection(); } }; } if (item.children) { return { value: this.params.treeListFormatter?.(item.treeKey, item.depth, item.parentTreeKeys) ?? item.treeKey, depth: item.depth, isGroup: true, selectedListener: (e) => this.onGroupItemSelected(e.item, e.isSelected), expandedListener: (e) => this.onExpandedChanged(e.item, e.isExpanded) }; } return { value: this.params.treeListFormatter?.(item.treeKey, item.depth, item.parentTreeKeys) ?? item.treeKey, depth: item.depth, selectedListener: (e) => this.onItemSelected(e.item.key, e.isSelected) }; } newSetListItemAttributes(item) { if (this.isSetFilterModelTreeItem(item)) { return this.newSetTreeItemAttributes(item); } if (item === SET_FILTER_SELECT_ALL) { return { value: () => this.getSelectAllLabel(), selectedListener: (e) => this.onSelectAll(e.isSelected) }; } if (item === SET_FILTER_ADD_SELECTION_TO_FILTER) { return { value: () => this.getAddSelectionToFilterLabel(), selectedListener: (e) => { this.addCurrentSelectionToFilter = e.isSelected; this.refreshAfterSelection(); } }; } return { value: this.handler.valueModel.allValues.get(item) ?? null, selectedListener: (e) => this.onItemSelected(e.item, e.isSelected) }; } updateSetListItem(item, component) { const { isSelected, isExpanded } = this.isSelectedExpanded(item); component.refresh(item, isSelected, isExpanded); } isSelectedExpanded(item) { let isSelected; let isExpanded; if (this.isSetFilterModelTreeItem(item)) { isExpanded = item.expanded; if (item.key === SET_FILTER_SELECT_ALL) { isSelected = this.isSelectAllSelected(); } else if (item.key === SET_FILTER_ADD_SELECTION_TO_FILTER) { isSelected = this.isAddCurrentSelectionToFilterChecked(); } else if (item.children) { isSelected = this.areAllChildrenSelected(item); } else { isSelected = this.selectedKeys.has(item.key); } } else if (item === SET_FILTER_SELECT_ALL) { isSelected = this.isSelectAllSelected(); } else if (item === SET_FILTER_ADD_SELECTION_TO_FILTER) { isSelected = this.isAddCurrentSelectionToFilterChecked(); } else { isSelected = this.selectedKeys.has(item); } return { isSelected, isExpanded }; } isSetFilterModelTreeItem(item) { return item?.treeKey !== void 0; } initMiniFilter() { const { eMiniFilter } = this; this.updateMiniFilter(); eMiniFilter.onValueChange(() => this.onMiniFilterInput()); eMiniFilter.setInputAriaLabel(translateForSetFilter(this, "ariaSearchFilterValues")); this.addManagedElementListeners(eMiniFilter.getInputElement(), { keydown: (e) => this.onMiniFilterKeyDown(e) }); } updateMiniFilter() { const { eMiniFilter, miniFilterText, params } = this; eMiniFilter.setDisplayed(!params.suppressMiniFilter); eMiniFilter.setValue(miniFilterText); } // we need to have the GUI attached before we can draw the virtual rows, as the // virtual row logic needs info about the GUI state afterGuiAttached(params) { super.afterGuiAttached(params); this.resetExpansion(); this.refreshVirtualList(); const { eMiniFilter } = this; eMiniFilter.setInputPlaceholder(translateForSetFilter(this, "searchOoo")); if (!params?.suppressFocus) { if (eMiniFilter.isDisplayed()) { eMiniFilter.getFocusableElement().focus(); } else { this.virtualList.awaitStable(() => this.virtualList.focusRow(0)); } } } afterGuiDetached() { super.afterGuiDetached(); const { column, excelMode, model, onStateChange } = this.params; if (this.beans.colFilter?.shouldKeepStateOnDetach(column)) { return; } if (excelMode) { this.resetMiniFilter(); } if (excelMode || model !== this.state.model) { onStateChange({ model, state: this.getState() }); this.showOrHideResults(); } } canApply(model) { return this.params.excelMode ? model == null || model.values.length > 0 : true; } /** * @deprecated v34 Internal method - should only be called by the grid. */ onNewRowsLoaded() { } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ setFilterValues(values) { _warn(283); this.handler.setFilterValues(values); } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ resetFilterValues() { _warn(283); this.handler.resetFilterValues(); } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ refreshFilterValues() { _warn(283); this.doRefreshFilterValues(); } doRefreshFilterValues() { this.handler.refreshFilterValues(); } /** * @deprecated v34 Internal method - should only be called by the grid. */ onAnyFilterChanged() { } onMiniFilterInput(silent) { if (!this.doSetMiniFilter(this.eMiniFilter.getValue())) { return; } if (silent) { this.showOrHideResults(); return; } const { applyMiniFilterWhileTyping, readOnly, excelMode } = this.params; const updateSelections = !readOnly && (applyMiniFilterWhileTyping || !!excelMode); const apply = applyMiniFilterWhileTyping && !readOnly ? "debounce" : void 0; this.updateUiAfterMiniFilterChange(updateSelections, apply); } updateUiAfterMiniFilterChange(updateSelections, apply) { if (updateSelections) { const { excelMode, readOnly, model } = this.params; if (excelMode && !readOnly && this.miniFilterText == null) { this.setModelAndRefresh(model?.values ?? null); } else { this.selectAllMatchingMiniFilter(true); } } this.checkAndRefreshVirtualList(); this.onUiChanged(updateSelections ? apply : "prevent"); this.showOrHideResults(); } showOrHideResults() { const hideResults = this.miniFilterText != null && this.displayValueModel.getDisplayedValueCount() < 1; _setDisplayed(this.eFilterNoMatches, hideResults); _setDisplayed(this.eSetFilterList, !hideResults); } resetMiniFilter() { this.eMiniFilter.setValue(null, true); this.doSetMiniFilter(null); } onMiniFilterKeyDown(e) { const { excelMode, readOnly } = this.params; if (e.key === KeyCode.ENTER && !excelMode && !readOnly) { this.updateUiAfterMiniFilterChange(true, "immediately"); } } focusRowIfAlive(rowIndex) { if (rowIndex == null) { return Promise.resolve(); } return new Promise((res) => { window.setTimeout(() => { if (this.isAlive()) { this.virtualList.focusRow(rowIndex); } res(); }, 0); }); } onSelectAll(isSelected) { if (isSelected) { this.selectAllMatchingMiniFilter(); } else { this.deselectAllMatchingMiniFilter(); } this.refreshAfterSelection(); } onGroupItemSelected(item, isSelected) { const recursiveGroupSelection = (i) => { if (!i.filterPasses) { return; } const children = i.children; if (children) { for (const childItem of children.values()) { recursiveGroupSelection(childItem); } } else { this.setKeySelected(i.key, isSelected); } }; recursiveGroupSelection(item); this.refreshAfterSelection(); } onItemSelected(key, isSelected) { this.setKeySelected(key, isSelected); this.refreshAfterSelection(); } onExpandAll(item, isExpanded) { const recursiveExpansion = (i) => { if (i.filterPasses && i.available && i.children) { for (const childItem of i.children.values()) { recursiveExpansion(childItem); } i.expanded = isExpanded; } }; recursiveExpansion(item); this.refreshAfterExpansion(); } onExpandedChanged(item, isExpanded) { item.expanded = isExpanded; this.refreshAfterExpansion(); } refreshAfterExpansion() { const focusedRow = this.virtualList.getLastFocusedRow(); this.updateDisplayedValues("expansion"); this.checkAndRefreshVirtualList(); this.focusRowIfAlive(focusedRow); } refreshAfterSelection() { const focusedRow = this.virtualList.getLastFocusedRow(); this.checkAndRefreshVirtualList(); this.onUiChanged(); this.focusRowIfAlive(focusedRow); } setMiniFilter(newMiniFilter, silent) { this.eMiniFilter.setValue(newMiniFilter, silent); this.onMiniFilterInput(silent); } /** Sets mini filter value. Returns true if it changed from last value, otherwise false. */ doSetMiniFilter(value) { value = _makeNull(value); if (this.miniFilterText === value) { return false; } if (value === null) { this.addCurrentSelectionToFilter = false; } this.miniFilterText = value; this.updateDisplayedValues("miniFilter"); return true; } getMiniFilter() { return this.miniFilterText; } getUiChangeEventParams() { return { miniFilterValue: this.miniFilterText }; } getState() { const miniFilterValue = this.miniFilterText; return miniFilterValue ? { miniFilterValue } : void 0; } checkAndRefreshVirtualList() { this.virtualList.refresh(!this.hardRefreshVirtualList); if (this.hardRefreshVirtualList) { this.hardRefreshVirtualList = false; } } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ getFilterKeys() { _warn(283); return this.handler.getFilterKeys(); } /** * @deprecated v34 Use the same method on the filter handler (`api.getColumnFilterHandler()`) instead. */ getFilterValues() { _warn(283); return this.handler.getFilterValues(); } refreshVirtualList() { if (this.params.refreshValuesOnOpen) { this.doRefreshFilterValues(); } else { this.checkAndRefreshVirtualList(); } } isSelectAllSelected() { if (!this.params.defaultToNothingSelected) { if (this.hasSelections() && this.isNothingVisibleSelected()) { return false; } if (this.isEverythingVisibleSelected()) { return true; } } else { if (this.hasSelections() && this.isEverythingVisibleSelected()) { return true; } if (this.isNothingVisibleSelected()) { return false; } } return void 0; } areAllChildrenSelected(item) { const recursiveChildSelectionCheck = (i) => { if (i.children) { let someTrue = false; let someFalse = false; for (const child of i.children.values()) { if (!child.filterPasses || !child.available) { continue; } const childSelected = recursiveChildSelectionCheck(child); if (childSelected === void 0) { return void 0; } if (childSelected) { someTrue = true; } else { someFalse = true; } if (someTrue && someFalse) { return void 0; } } return someTrue; } else { return this.selectedKeys.has(i.key); } }; if (!this.params.defaultToNothingSelected) { return recursiveChildSelectionCheck(item); } else { return this.hasSelections() && recursiveChildSelectionCheck(item); } } resetExpansion() { if (!this.params.treeList) { return; } const selectAllItem = this.displayValueModel.getSelectAllItem(); if (this.isSetFilterModelTreeItem(selectAllItem)) { const recursiveCollapse = (i) => { const children = i.children; if (children) { for (const childItem of children.values()) { recursiveCollapse(childItem); } i.expanded = false; } }; recursiveCollapse(selectAllItem); this.updateDisplayedValues("expansion"); } } getModelAsString(model) { return this.handler.getModelAsString(model); } getPositionableElement() { return this.eSetFilterList; } updateDisplayedValues(source, allKeys) { if (source === "expansion") { this.displayValueModel.refresh(); return; } const handler = this.handler; const valueModel = handler.valueModel; if (this.miniFilterText == null) { this.displayValueModel.updateDisplayedValuesToAllAvailable( (key) => valueModel.allValues.get(key) ?? null, allKeys, valueModel.availableKeys, source ); return; } const formattedFilterText = handler.caseFormat(this.formatter(this.miniFilterText) || ""); const matchesFilter = (valueToCheck) => valueToCheck != null && handler.caseFormat(valueToCheck).includes(formattedFilterText); const nullMatchesFilter = !!this.params.excelMode && matchesFilter(translateForSetFilter(this, "blanks")); this.displayValueModel.updateDisplayedValuesToMatchMiniFilter( (key) => valueModel.allValues.get(key) ?? null, allKeys, valueModel.availableKeys, matchesFilter, nullMatchesFilter, source ); } hasSelections() { return this.params.defaultToNothingSelected ? this.selectedKeys.size > 0 : this.handler.valueModel.allValues.size !== this.selectedKeys.size; } isInWindowsExcelMode() { return this.params.excelMode === "windows"; } isAddCurrentSelectionToFilterChecked() { return this.isInWindowsExcelMode() && this.addCurrentSelectionToFilter; } showAddCurrentSelectionToFilter() { return this.isInWindowsExcelMode() && _exists(this.miniFilterText) && this.miniFilterText.length > 0; } selectAllMatchingMiniFilter(clearExistingSelection = false) { if (this.miniFilterText == null) { this.selectedKeys = new Set(this.handler.valueModel.allValues.keys()); } else { if (clearExistingSelection) { this.selectedKeys.clear(); } this.displayValueModel.forEachDisplayedKey((key) => this.selectedKeys.add(key)); } } deselectAllMatchingMiniFilter() { if (this.miniFilterText == null) { this.selectedKeys.clear(); } else { this.displayValueModel.forEachDisplayedKey((key) => this.selectedKeys.delete(key)); } } setKeySelected(key, selected) { if (selected) { this.selectedKeys.add(key); } else { if (this.params.excelMode && this.isEverythingVisibleSelected()) { this.resetSelectionState(this.displayValueModel.getDisplayedKeys()); } this.selectedKeys.delete(key); } } isEverythingVisibleSelected() { return !this.displayValueModel.someDisplayedKey((it) => !this.selectedKeys.has(it)); } isNothingVisibleSelected() { return !this.displayValueModel.someDisplayedKey((it) => this.selectedKeys.has(it)); } getSelectedModel() { if (!this.hasSelections()) { return null; } const filteringKeys = this.isAddCurrentSelectionToFilterChecked() ? this.params.model?.values : void 0; if (filteringKeys?.length) { if (this.selectedKeys) { const modelKeys = /* @__PURE__ */ new Set([...filteringKeys, ...this.selectedKeys]); return Array.from(modelKeys); } return Array.from(filteringKeys); } return Array.from(this.selectedKeys); } setSelectedModel(model) { const handler = this.handler; const valueModel = handler.valueModel; return valueModel.allKeys.then((keys) => { if (model == null) { this.resetSelectionState(keys ?? []); } else { this.selectedKeys.clear(); const existingFormattedKeys = /* @__PURE__ */ new Map(); valueModel.allValues.forEach((_value, key) => { existingFormattedKeys.set(handler.caseFormat(key), key); }); model.forEach((unformattedKey) => { const formattedKey = handler.caseFormat(_makeNull(unformattedKey)); const existingUnformattedKey = existingFormattedKeys.get(formattedKey); if (existingUnformattedKey !== void 0) { this.selectedKeys.add(existingUnformattedKey); } }); } }); } resetSelectionState(keys) { if (this.params.defaultToNothingSelected) { this.selectedKeys.clear(); } else { this.selectedKeys = new Set(keys); } } getFilterHandler() { return this.handler; } destroy() { this.virtualList = this.destroyBean(this.virtualList); for (const func of this.handlerDestroyFuncs ?? []) { func(); } this.handler = void 0; this.displayValueModel = void 0; this.selectedKeys.clear(); super.destroy(); } }; var ModelWrapper = class { constructor(model) { this.model = model; } getRowCount() { return this.model.getDisplayedValueCount(); } getRow(index) { return this.model.getDisplayedItem(index); } areRowsEqual(oldRow, newRow) { return oldRow === newRow; } }; var ModelWrapperWithSelectAll = class { constructor(model, showAddCurrentSelectionToFilter) { this.model = model; this.showAddCurrentSelectionToFilter = showAddCurrentSelectionToFilter; } getRowCount() { const showAddCurrentSelectionToFilter = this.showAddCurrentSelectionToFilter(); const outboundItems = showAddCurrentSelectionToFilter ? 2 : 1; return this.model.getDisplayedValueCount() + outboundItems; } getRow(index) { if (index === 0) { return this.model.getSelectAllItem(); } const showAddCurrentSelectionToFilter = this.showAddCurrentSelectionToFilter(); const outboundItems = showAddCurrentSelectionToFilter ? 2 : 1; if (index === 1 && showAddCurrentSelectionToFilter) { return this.model.getAddSelectionToFilterItem(); } return this.model.getDisplayedItem(index - outboundItems); } areRowsEqual(oldRow, newRow) { return oldRow === newRow; } }; var TreeModelWrapper = class { constructor(model) { this.model = model; } getRowCount() { return this.model.getRowCount(); } getRow(index) { return this.model.getRow(index); } areRowsEqual(oldRow, newRow) { if (oldRow == null && newRow == null) { return true; } return oldRow != null && newRow != null && oldRow.treeKey === newRow.treeKey && oldRow.depth === newRow.depth; } }; // packages/ag-grid-enterprise/src/setFilter/clientSideValueExtractor.ts var ClientSideValuesExtractor = class extends BeanStub { constructor(createKey, caseFormat, getValue, isTreeDataOrGrouping, isTreeData) { super(); this.createKey = createKey; this.caseFormat = caseFormat; this.getValue = getValue; this.isTreeDataOrGrouping = isTreeDataOrGrouping; this.isTreeData = isTreeData; } extractUniqueValuesAsync(predicate, existingValues) { return new AgPromise((resolve) => { if (this.beans.rowModel.rowCountReady) { resolve(this.extractUniqueValues(predicate, existingValues)); } else { const [destroyFunc] = this.addManagedEventListeners({ rowCountReady: () => { destroyFunc?.(); resolve(this.extractUniqueValues(predicate, existingValues)); } }); } }); } extractUniqueValues(predicate, existingValues) { const values = /* @__PURE__ */ new Map(); const existingFormattedKeys = this.extractExistingFormattedKeys(existingValues); const formattedKeys = /* @__PURE__ */ new Set(); const treeData = this.isTreeData(); const treeDataOrGrouping = this.isTreeDataOrGrouping(); const groupedCols = this.beans.rowGroupColsSvc?.columns; const groupAllowUnbalanced = this.gos.get("groupAllowUnbalanced"); const addValue = (unformattedKey, value) => { const formattedKey = this.caseFormat(unformattedKey); if (!formattedKeys.has(formattedKey)) { formattedKeys.add(formattedKey); let keyToAdd = unformattedKey; let valueToAdd = _makeNull(value); const existingUnformattedKey = existingFormattedKeys?.get(formattedKey); if (existingUnformattedKey != null) { keyToAdd = existingUnformattedKey; valueToAdd = existingValues.get(existingUnformattedKey); } values.set(keyToAdd, valueToAdd); } }; this.beans.rowModel.forEachLeafNode((node) => { if (!node.data || !predicate(node)) { return; } if (treeDataOrGrouping) { this.addValueForTreeDataOrGrouping(node, treeData, groupedCols, addValue, groupAllowUnbalanced); return; } const value = this.getValue(node); if (value != null && Array.isArray(value)) { for (const x of value) { addValue(this.createKey(x, node), x); } if (value.length === 0) { addValue(null, null); } } else { addValue(this.createKey(value, node), value); } }); return values; } addValueForTreeDataOrGrouping(node, treeData, groupedCols = [], addValue, groupAllowUnbalanced) { let dataPath; if (treeData) { if (node.childrenAfterGroup?.length) { return; } dataPath = node.getRoute() ?? [node.key ?? node.id]; } else { dataPath = groupedCols.map((groupCol) => this.beans.valueSvc.getKeyForNode(groupCol, node)); dataPath.push(this.getValue(node)); } const processedDataPath = processDataPath(dataPath, treeData, groupAllowUnbalanced); addValue(this.createKey(processedDataPath), processedDataPath); } extractExistingFormattedKeys(existingValues) { if (!existingValues) { return null; } const existingFormattedKeys = /* @__PURE__ */ new Map(); existingValues.forEach((_value, key) => { existingFormattedKeys.set(this.caseFormat(key), key); }); return existingFormattedKeys; } }; // packages/ag-grid-enterprise/src/setFilter/setFilterAppliedModel.ts var SetFilterAppliedModel = class { constructor(caseFormat) { this.caseFormat = caseFormat; // This attribute contains keys that are actually used for filtering. // These keys take into account case sensitivity: // - When filtering is case-insensitive, all filtering keys are converted to upper case and stored here. this.keys = null; } /** No model applied */ isNull() { return this.keys == null; } /** Nothing selected */ isEmpty() { return !this.keys?.size; } update(appliedModel) { const keys = /* @__PURE__ */ new Set(); this.keys = keys; const values = appliedModel?.values; if (values) { const caseFormat = this.caseFormat; for (let i = 0, len = values.length; i < len; i++) { keys.add(caseFormat(values[i])); } } } has(key) { return !!this.keys?.has(this.caseFormat(key)); } destroy() { this.keys = null; } }; // packages/ag-grid-enterprise/src/setFilter/setValueModel.ts var SetFilterModelValuesType = /* @__PURE__ */ ((SetFilterModelValuesType2) => { SetFilterModelValuesType2[SetFilterModelValuesType2["PROVIDED_LIST"] = 0] = "PROVIDED_LIST"; SetFilterModelValuesType2[SetFilterModelValuesType2["PROVIDED_CALLBACK"] = 1] = "PROVIDED_CALLBACK"; SetFilterModelValuesType2[SetFilterModelValuesType2["TAKEN_FROM_GRID_VALUES"] = 2] = "TAKEN_FROM_GRID_VALUES"; return SetFilterModelValuesType2; })(SetFilterModelValuesType || {}); var setValueModel_default = SetFilterModelValuesType; var SetValueModel = class extends BeanStub { constructor(clientSideValuesExtractor, caseFormat, createKey, isTreeDataOrGrouping, params) { super(); this.clientSideValuesExtractor = clientSideValuesExtractor; this.caseFormat = caseFormat; this.createKey = createKey; this.isTreeDataOrGrouping = isTreeDataOrGrouping; this.params = params; /** All possible values for the filter, sorted if required. */ this.allValues = /* @__PURE__ */ new Map(); /** Remaining keys when filters from other columns have been applied. */ this.availableKeys = /* @__PURE__ */ new Set(); this.providedValues = null; this.initialised = false; } postConstruct() { const params = this.params; const values = params.handlerParams.filterParams.values; this.updateParams(params); if (values == null) { this.valuesType = 2 /* TAKEN_FROM_GRID_VALUES */; } else { this.valuesType = Array.isArray(values) ? 0 /* PROVIDED_LIST */ : 1 /* PROVIDED_CALLBACK */; this.providedValues = values; } this.updateAllValues(); } refresh(params) { const handlerParams = params.handlerParams; if (handlerParams.source !== "colDef") { return; } const { values, suppressSorting } = handlerParams.filterParams; const currentProvidedValues = this.providedValues; const currentSuppressSorting = this.params.handlerParams.filterParams.suppressSorting; this.params = params; this.updateParams(params); this.providedValues = values ?? null; if (this.providedValues !== currentProvidedValues || suppressSorting !== currentSuppressSorting) { if (!values || values.length === 0) { this.valuesType = 2 /* TAKEN_FROM_GRID_VALUES */; this.providedValues = null; } else { this.valuesType = Array.isArray(values) ? 0 /* PROVIDED_LIST */ : 1 /* PROVIDED_CALLBACK */; } this.updateAllValues(); } } updateParams(params) { const { handlerParams: { colDef, filterParams: { comparator, treeList, treeListPathGetter } }, usingComplexObjects } = params; const keyComparator = comparator ?? colDef.comparator; const treeDataOrGrouping = this.isTreeDataOrGrouping(); let entryComparator; if (treeDataOrGrouping && !keyComparator) { entryComparator = createTreeDataOrGroupingComparator(); } else if (treeList && !treeListPathGetter && !keyComparator) { entryComparator = ([_aKey, aValue], [_bKey, bValue]) => _defaultComparator(aValue, bValue); } else { entryComparator = ([_aKey, aValue], [_bKey, bValue]) => keyComparator(aValue, bValue); } this.entryComparator = entryComparator; this.keyComparator = keyComparator ?? _defaultComparator; this.compareByValue = !!(usingComplexObjects && keyComparator || treeDataOrGrouping || treeList && !treeListPathGetter); } updateAllValues() { this.allKeys = new AgPromise((resolve) => { switch (this.valuesType) { case 2 /* TAKEN_FROM_GRID_VALUES */: this.getValuesFromRowsAsync().then((values) => resolve(this.processAllValues(values))); break; case 0 /* PROVIDED_LIST */: { resolve( this.processAllValues( this.uniqueValues(this.validateProvidedValues(this.providedValues)) ) ); break; } case 1 /* PROVIDED_CALLBACK */: { this.dispatchLocalEvent({ type: "loadingStart" }); const callback = this.providedValues; const { column, colDef } = this.params.handlerParams; const params = _addGridCommonParams(this.gos, { success: (values) => { this.dispatchLocalEvent({ type: "loadingEnd" }); resolve(this.processAllValues(this.uniqueValues(this.validateProvidedValues(values)))); }, colDef, column }); window.setTimeout(() => callback(params), 0); break; } } }); this.allKeys.then((values) => { this.updateAvailableKeys(values ?? []); this.initialised = true; }); return this.allKeys; } getAvailableValues(predicate) { return this.sortKeys(this.getValuesFromRows(predicate)); } overrideValues(valuesToUse) { return this.allKeys.then(() => { this.valuesType = 0 /* PROVIDED_LIST */; this.providedValues = valuesToUse; }); } refreshAvailable() { return new AgPromise((resolve) => { if (this.showAvailableOnly()) { this.allKeys.then((keys) => { const updatedKeys = keys ?? []; this.updateAvailableKeys(updatedKeys); resolve(true); }); return; } resolve(false); }); } refreshAll() { return new AgPromise((resolve) => { this.allKeys.then(() => { this.updateAllValues().then(() => { resolve(); }); }); }); } isLoading() { return !this.initialised && this.valuesType === 1 /* PROVIDED_CALLBACK */; } isInitialised() { return this.initialised; } getValueForFormatter(key) { return this.initialised ? this.allValues.get(key) : key; } getAvailableKeys(values) { return this.initialised ? values.filter((v) => this.availableKeys.has(v)) : values; } getParamsForValuesFromRows(removeUnavailableValues) { if (!this.clientSideValuesExtractor) { _error(113); return void 0; } const existingValues = removeUnavailableValues && !this.params.handlerParams.filterParams.caseSensitive ? this.allValues : void 0; return existingValues; } getValuesFromRows(predicate) { const existingValues = this.getParamsForValuesFromRows(true); return this.clientSideValuesExtractor?.extractUniqueValues(predicate, existingValues) ?? null; } getValuesFromRowsAsync() { const existingValues = this.getParamsForValuesFromRows(false); return this.clientSideValuesExtractor?.extractUniqueValuesAsync(() => true, existingValues) ?? AgPromise.resolve(null); } processAllValues(values) { const sortedKeys = this.sortKeys(values); this.allValues = values ?? /* @__PURE__ */ new Map(); return sortedKeys; } uniqueValues(values) { const uniqueValues = /* @__PURE__ */ new Map(); const formattedKeys = /* @__PURE__ */ new Set(); const { caseFormat, createKey } = this; for (const value of values ?? []) { const valueToUse = _makeNull(value); const unformattedKey = createKey(valueToUse); const formattedKey = caseFormat(unformattedKey); if (!formattedKeys.has(formattedKey)) { formattedKeys.add(formattedKey); uniqueValues.set(unformattedKey, valueToUse); } } return uniqueValues; } validateProvidedValues(values) { if (this.params.usingComplexObjects && values?.length) { const firstValue = values[0]; if (firstValue && typeof firstValue !== "object" && typeof firstValue !== "function") { const firstKey = this.createKey(firstValue); if (firstKey == null) { _warn(209); } else { _warn(210); } } } return values; } sortKeys(nullableValues) { const values = nullableValues ?? /* @__PURE__ */ new Map(); const filterParams = this.params.handlerParams.filterParams; if (filterParams.suppressSorting) { return Array.from(values.keys()); } let sortedKeys; if (this.compareByValue) { sortedKeys = Array.from(values.entries()).sort(this.entryComparator).map(([key]) => key); } else { sortedKeys = Array.from(values.keys()).sort(this.keyComparator); } if (filterParams.excelMode && values.has(null)) { sortedKeys = sortedKeys.filter((v) => v != null); sortedKeys.push(null); } return sortedKeys; } showAvailableOnly() { return this.valuesType === 2 /* TAKEN_FROM_GRID_VALUES */; } updateAvailableKeys(allKeys) { const availableKeys = this.showAvailableOnly() ? this.getAvailableValues((node) => this.params.handlerParams.doesRowPassOtherFilter(node)) : allKeys; this.availableKeys = new Set(availableKeys); window.setTimeout(() => { if (this.isAlive()) { this.dispatchLocalEvent({ type: "availableValuesChanged" }); } }); } }; // packages/ag-grid-enterprise/src/setFilter/setFilterHandler.ts var SetFilterHandler = class extends BeanStub { constructor() { super(...arguments); /** Used to get the filter type for filter models. */ this.filterType = "set"; this.treeDataTreeList = false; this.groupingTreeList = false; this.caseSensitive = false; this.noValueFormatterSupplied = false; } init(params) { this.updateParams(params); const isTreeDataOrGrouping = this.isTreeDataOrGrouping.bind(this); const isTreeData = () => this.treeDataTreeList; const createKey = this.createKey; const caseFormat = this.caseFormat.bind(this); const { gos, beans } = this; const clientSideValuesExtractor = _isClientSideRowModel(gos, beans.rowModel) ? this.createManagedBean( new ClientSideValuesExtractor( createKey, caseFormat, params.getValue, isTreeDataOrGrouping, isTreeData ) ) : void 0; const valueModel = this.createManagedBean( new SetValueModel(clientSideValuesExtractor, caseFormat, createKey, isTreeDataOrGrouping, { handlerParams: params, usingComplexObjects: !!(params.filterParams.keyCreator ?? params.colDef.keyCreator) }) ); this.addManagedListeners(valueModel, { availableValuesChanged: params.onModelAsStringChange }); this.valueModel = valueModel; this.appliedModel = new SetFilterAppliedModel(this.caseFormat.bind(this)); this.appliedModel.update(params.model); this.validateModel(params); this.addEventListenersForDataChanges(); } refresh(params) { this.updateParams(params); this.valueModel.refresh({ handlerParams: params, usingComplexObjects: !!(params.filterParams.keyCreator ?? params.colDef.keyCreator) }); this.appliedModel.update(params.model); this.validateModel(params); } updateParams(params) { this.params = params; const { colDef, filterParams: { caseSensitive, treeList, keyCreator, valueFormatter } } = params; this.caseSensitive = !!caseSensitive; const isGroupCol = !!colDef.showRowGroup; this.treeDataTreeList = this.gos.get("treeData") && !!treeList && isGroupCol; this.groupingTreeList = !!this.beans.rowGroupColsSvc?.columns.length && !!treeList && isGroupCol; const resolvedKeyCreator = keyCreator ?? colDef.keyCreator; this.createKey = this.generateCreateKey(resolvedKeyCreator, this.isTreeDataOrGrouping()); this.setValueFormatter(valueFormatter, resolvedKeyCreator, !!treeList, !!colDef.refData); } doesFilterPass(params) { const { appliedModel, treeDataTreeList, groupingTreeList } = this; if (appliedModel.isNull()) { return true; } if (appliedModel.isEmpty()) { return false; } const { node } = params; if (treeDataTreeList) { return this.doesFilterPassForTreeData(node); } if (groupingTreeList) { return this.doesFilterPassForGrouping(node); } const value = this.params.getValue(node); if (value != null && Array.isArray(value)) { if (value.length === 0) { return appliedModel.has(null); } return value.some((v) => appliedModel.has(this.createKey(v, node))); } return appliedModel.has(this.createKey(value, node)); } getFormattedValue(key) { let value = this.valueModel.getValueForFormatter(key); if (this.noValueFormatterSupplied && this.isTreeDataOrGrouping() && Array.isArray(value)) { value = _last(value); } const formattedValue = this.beans.valueSvc.formatValue( this.params.column, null, value, this.valueFormatter, false ); return (formattedValue == null ? _toStringOrNull(value) : formattedValue) ?? translateForSetFilter(this, "blanks"); } getModelAsString(model, source) { const { values } = model ?? {}; const forToolPanel = source === "filterToolPanel"; if (values == null) { return forToolPanel ? translateForSetFilter(this, "filterSummaryListInactive") : ""; } const availableKeys = this.valueModel.getAvailableKeys(values); const numValues = availableKeys.length; const numToDisplay = forToolPanel ? 3 : 10; const formattedValues = availableKeys.slice(0, numToDisplay).map((key) => this.getFormattedValue(key)); if (forToolPanel) { const valueList = formattedValues.join(translateForSetFilter(this, "filterSummaryListSeparator")); if (numValues > 3) { return translateForSetFilter(this, "filterSummaryListLong", [valueList, String(numValues - 3)]); } else { return translateForSetFilter(this, "filterSummaryListShort", [valueList]); } } return `(${numValues}) ${formattedValues.join(",")}${numValues > 10 ? ",..." : ""}`; } onAnyFilterChanged() { window.setTimeout(() => { if (!this.isAlive()) { return; } this.valueModel.refreshAvailable().then((updated) => { this.dispatchLocalEvent({ type: "anyFilterChanged", updated: !!updated }); }); }); } onNewRowsLoaded() { this.syncAfterDataChange(); } setFilterValues(values) { this.valueModel.overrideValues(values).then(() => { this.refreshFilterValues(); }); } resetFilterValues() { this.valueModel.valuesType = setValueModel_default.TAKEN_FROM_GRID_VALUES; this.syncAfterDataChange(); } /** * @param suppressAvailableValuesCheck when refreshing values via the API, the model will be reset if all available values are selected. * When refreshing due to internal changes, set this to `true` to do the reset check based on all values instead. */ refreshFilterValues(suppressAvailableValuesCheck) { if (!this.valueModel.isInitialised()) { return; } this.valueModel.refreshAll().then(() => { this.dispatchLocalEvent({ type: "dataChanged", hardRefresh: true }); this.validateModel(this.params, void 0, !suppressAvailableValuesCheck); }); } getFilterKeys() { return Array.from(this.valueModel.allValues.keys()); } getFilterValues() { return Array.from(this.valueModel.allValues.values()); } isTreeDataOrGrouping() { return this.treeDataTreeList || this.groupingTreeList; } caseFormat(valueToFormat) { if (valueToFormat == null || typeof valueToFormat !== "string") { return valueToFormat; } return this.caseSensitive ? valueToFormat : valueToFormat.toUpperCase(); } addEventListenersForDataChanges() { this.addManagedPropertyListeners(["groupAllowUnbalanced"], () => this.syncAfterDataChange()); const syncAfterDataChangeDebounced = _debounce(this, this.syncAfterDataChange.bind(this), 0); this.addManagedEventListeners({ cellValueChanged: (event) => { if (event.column === this.params.column) { syncAfterDataChangeDebounced(); } } }); } syncAfterDataChange() { if (!this.isValuesTakenFromGrid()) { return; } this.valueModel.refreshAll().then(() => { this.dispatchLocalEvent({ type: "dataChanged" }); this.validateModel(this.params, { afterDataChange: true }); }); } validateModel(params, additionalEventAttributes, restrictToAvailableValues) { const valueModel = this.valueModel; valueModel.allKeys.then(() => { const model = params.model; if (model == null) { return; } const existingFormattedKeys = /* @__PURE__ */ new Map(); const addKey = (key) => existingFormattedKeys.set(this.caseFormat(key), key); if (restrictToAvailableValues) { for (const key of valueModel.availableKeys) { addKey(key); } } else { valueModel.allValues.forEach((_value, key) => addKey(key)); } const newValues = []; let updated = false; for (const unformattedKey of model.values) { const formattedKey = this.caseFormat(_makeNull(unformattedKey)); const existingUnformattedKey = existingFormattedKeys.get(formattedKey); if (existingUnformattedKey !== void 0) { newValues.push(existingUnformattedKey); if (existingUnformattedKey !== unformattedKey) { updated = true; } } else { updated = true; } } const numNewValues = newValues.length; const filterParams = params.filterParams; if (numNewValues === 0 && filterParams.excelMode) { params.onModelChange(null, additionalEventAttributes); return; } const clearOnAllSelected = !filterParams.defaultToNothingSelected && (this.valueModel.valuesType === setValueModel_default.TAKEN_FROM_GRID_VALUES || !filterParams.suppressClearModelOnRefreshValues); const allSelected = clearOnAllSelected && numNewValues === existingFormattedKeys.size; if (updated || !model.filterType || allSelected) { const newModel = allSelected ? null : { filterType: this.filterType, values: newValues }; params.onModelChange(newModel, additionalEventAttributes); } }); } isValuesTakenFromGrid() { return this.valueModel.valuesType === setValueModel_default.TAKEN_FROM_GRID_VALUES; } doesFilterPassForTreeData(node) { if (node.childrenAfterGroup?.length) { return false; } const { gos, appliedModel } = this; return appliedModel.has( this.createKey( processDataPath( node.getRoute() ?? [node.key ?? node.id], true, gos.get("groupAllowUnbalanced") ) ) ); } doesFilterPassForGrouping(node) { const { appliedModel, params, gos, beans: { rowGroupColsSvc, valueSvc } } = this; const dataPath = (rowGroupColsSvc?.columns ?? []).map((groupCol) => valueSvc.getKeyForNode(groupCol, node)); dataPath.push(params.getValue(node)); return appliedModel.has( this.createKey(processDataPath(dataPath, false, gos.get("groupAllowUnbalanced"))) ); } generateCreateKey(keyCreator, treeDataOrGrouping) { if (treeDataOrGrouping && !keyCreator) { _error(250); return () => null; } if (keyCreator) { return (value, node = null) => { const params = this.getKeyCreatorParams(value, node); return _makeNull(keyCreator(params)); }; } return (value) => _makeNull(_toStringOrNull(value)); } getKeyCreatorParams(value, node = null) { const { colDef, column } = this.params; return _addGridCommonParams(this.gos, { value, colDef, column, node, data: node?.data }); } setValueFormatter(providedValueFormatter, keyCreator, treeList, isRefData) { let valueFormatter = providedValueFormatter; if (!valueFormatter) { if (keyCreator && !treeList) { _error(249); return; } this.noValueFormatterSupplied = true; if (!isRefData) { valueFormatter = (params) => _toStringOrNull(params.value); } } this.valueFormatter = valueFormatter; } getCrossFilterModel(callback) { const { createKey, valueModel, params } = this; return callback(createKey, valueModel.availableKeys, params.model?.values); } destroy() { this.appliedModel.destroy(); super.destroy(); this.valueModel = void 0; } }; // packages/ag-grid-enterprise/src/setFilter/setFloatingFilter.ts var SetFloatingFilterElement = { tag: "div", cls: "ag-floating-filter-input ag-set-floating-filter-input", role: "presentation", children: [ { tag: "ag-input-text-field", ref: "eFloatingFilterText" } ] }; var SetFloatingFilterComp = class extends Component { constructor() { super(SetFloatingFilterElement, [AgInputTextFieldSelector]); this.eFloatingFilterText = RefPlaceholder; } init(params) { this.params = params; this.eFloatingFilterText.setDisabled(true).addGuiEventListener("click", () => this.params.showParentFilter()); this.setParams(params); } setParams(params) { const displayName = this.beans.colNames.getDisplayNameForColumn(params.column, "header", true); const translate = this.getLocaleTextFunc(); this.eFloatingFilterText.setInputAriaLabel(`${displayName} ${translate("ariaFilterInput", "Filter Input")}`); if (this.gos.get("enableFilterHandlers")) { const reactiveParams = params; this.updateFloatingFilterText(reactiveParams.model); } } refresh(params) { this.params = params; this.setParams(params); } onParentModelChanged(parentModel) { this.updateFloatingFilterText(parentModel); } parentSetFilterInstance(cb) { this.params.parentFilterInstance((filter) => { if (!(filter instanceof SetFilter)) { _error(248); return; } cb(filter); }); } updateFloatingFilterText(parentModel) { if (parentModel == null) { this.eFloatingFilterText.setValue(""); } else if (this.gos.get("enableFilterHandlers")) { this.eFloatingFilterText.setValue( this.params.getHandler().getModelAsString?.(parentModel) ?? "" ); } else { this.parentSetFilterInstance((setFilter) => { this.eFloatingFilterText.setValue(setFilter.getModelAsString(parentModel)); }); } } }; // packages/ag-grid-enterprise/src/setFilter/setFilterModule.ts var SetFilterModule = { moduleName: "SetFilter", version: VERSION2, userComponents: { agSetColumnFilter: { classImp: SetFilter, params: { useForm: true }, processParams: (params) => { applyExcelModeOptions(params); return params; } }, agSetColumnFloatingFilter: SetFloatingFilterComp }, dynamicBeans: { agSetColumnFilterHandler: SetFilterHandler }, icons: { // set filter tree list group contracted (click to expand) setFilterGroupClosed: "tree-closed", // set filter tree list group expanded (click to contract) setFilterGroupOpen: "tree-open", // set filter tree list expand/collapse all button, shown when some children are expanded and // others are collapsed setFilterGroupIndeterminate: "tree-indeterminate", // set filter async values loading setFilterLoading: "loading" }, dependsOn: [EnterpriseCoreModule, ColumnFilterModule] }; // packages/ag-grid-enterprise/src/statusBar/agStatusBar.css var agStatusBar_default = ".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}"; // packages/ag-grid-enterprise/src/statusBar/agStatusBar.ts function getStatusPanelCompDetails(userCompFactory, def, params) { return userCompFactory.getCompDetails(def, StatusPanelComponent, void 0, params, true); } var StatusPanelComponent = { name: "statusPanel", optionalMethods: ["refresh"] }; var AgStatusBarValidationMap = { agAggregationComponent: { rowModels: ["clientSide", "serverSide"], warnArgs: [221] }, agFilteredRowCountComponent: { rowModels: ["clientSide"], warnArgs: [222] }, agSelectedRowCountComponent: { rowModels: ["clientSide", "serverSide"], warnArgs: [223] }, agTotalAndFilteredRowCountComponent: { rowModels: ["clientSide"], warnArgs: [224] }, agTotalRowCountComponent: { rowModels: ["clientSide"], warnArgs: [225] } }; var AgStatusBarElement = { tag: "div", cls: "ag-status-bar", children: [ { tag: "div", ref: "eStatusBarLeft", cls: "ag-status-bar-left", role: "status" }, { tag: "div", ref: "eStatusBarCenter", cls: "ag-status-bar-center", role: "status" }, { tag: "div", ref: "eStatusBarRight", cls: "ag-status-bar-right", role: "status" } ] }; var AgStatusBar = class extends Component { constructor() { super(AgStatusBarElement); this.updateQueued = false; this.panelsPromise = AgPromise.resolve(); this.eStatusBarLeft = RefPlaceholder; this.eStatusBarCenter = RefPlaceholder; this.eStatusBarRight = RefPlaceholder; this.compDestroyFunctions = {}; this.registerCSS(agStatusBar_default); } wireBeans(beans) { this.userCompFactory = beans.userCompFactory; this.statusBarSvc = beans.statusBarSvc; } postConstruct() { this.processStatusPanels(/* @__PURE__ */ new Map()); this.addManagedPropertyListeners(["statusBar"], this.handleStatusBarChanged.bind(this)); _addFocusableContainerListener(this.beans, this, this.getGui()); } getFocusableContainerName() { return "statusBar"; } getValidPanels() { const gos = this.gos; const statusPanels = gos.get("statusBar")?.statusPanels; if (!statusPanels) { return statusPanels; } return statusPanels.filter((panel) => { const { rowModels, warnArgs } = AgStatusBarValidationMap[panel.statusPanel] ?? {}; if (!rowModels) { return true; } if (rowModels.includes(gos.get("rowModelType"))) { return true; } _warn(...warnArgs); return false; }); } processStatusPanels(existingStatusPanelsToReuse) { const statusPanels = this.getValidPanels(); if (statusPanels) { const leftStatusPanelComponents = statusPanels.filter( (componentConfig) => componentConfig.align === "left" ); const centerStatusPanelComponents = statusPanels.filter( (componentConfig) => componentConfig.align === "center" ); const rightStatusPanelComponents = statusPanels.filter( (componentConfig) => !componentConfig.align || componentConfig.align === "right" ); this.panelsPromise = AgPromise.all([ this.createAndRenderComponents( leftStatusPanelComponents, this.eStatusBarLeft, existingStatusPanelsToReuse ), this.createAndRenderComponents( centerStatusPanelComponents, this.eStatusBarCenter, existingStatusPanelsToReuse ), this.createAndRenderComponents( rightStatusPanelComponents, this.eStatusBarRight, existingStatusPanelsToReuse ) ]); } else { this.setDisplayed(false); } } handleStatusBarChanged() { if (this.updateQueued) { return; } this.updateQueued = true; this.panelsPromise.then(() => { this.updateStatusBar(); this.updateQueued = false; }); } updateStatusBar() { const statusPanels = this.getValidPanels(); const validStatusBarPanelsProvided = Array.isArray(statusPanels) && statusPanels.length > 0; this.setDisplayed(validStatusBarPanelsProvided); const existingStatusPanelsToReuse = /* @__PURE__ */ new Map(); if (validStatusBarPanelsProvided) { for (const statusPanelConfig of statusPanels) { const key = statusPanelConfig.key ?? statusPanelConfig.statusPanel; const existingStatusPanel = this.statusBarSvc.getStatusPanel(key); if (existingStatusPanel?.refresh) { const newParams = _addGridCommonParams(this.gos, { ...statusPanelConfig.statusPanelParams ?? {}, key }); const hasRefreshed = existingStatusPanel.refresh(newParams); if (hasRefreshed) { existingStatusPanelsToReuse.set(key, existingStatusPanel); delete this.compDestroyFunctions[key]; _removeFromParent(existingStatusPanel.getGui()); } } } } this.resetStatusBar(); if (validStatusBarPanelsProvided) { this.processStatusPanels(existingStatusPanelsToReuse); } } resetStatusBar() { _clearElement(this.eStatusBarLeft); _clearElement(this.eStatusBarCenter); _clearElement(this.eStatusBarRight); this.destroyComponents(); this.statusBarSvc.unregisterAllComponents(); } destroy() { this.destroyComponents(); super.destroy(); } destroyComponents() { for (const func of Object.values(this.compDestroyFunctions)) { func(); } this.compDestroyFunctions = {}; } createAndRenderComponents(statusBarComponents, ePanelComponent, existingStatusPanelsToReuse) { const componentDetails = []; for (const componentConfig of statusBarComponents) { const key = componentConfig.key || componentConfig.statusPanel; const existingStatusPanel = existingStatusPanelsToReuse.get(key); let promise; if (existingStatusPanel) { promise = AgPromise.resolve(existingStatusPanel); } else { const compDetails = getStatusPanelCompDetails( this.userCompFactory, componentConfig, _addGridCommonParams(this.gos, { key }) ); if (compDetails == null) { continue; } promise = compDetails.newAgStackInstance(); } componentDetails.push({ key, promise }); } return AgPromise.all(componentDetails.map((details) => details.promise)).then(() => { for (const componentDetail of componentDetails) { componentDetail.promise.then((component) => { const destroyFunc = () => { this.destroyBean(component); }; if (this.isAlive()) { this.statusBarSvc.registerStatusPanel(componentDetail.key, component); ePanelComponent.appendChild(component.getGui()); this.compDestroyFunctions[componentDetail.key] = destroyFunc; } else { destroyFunc(); } }); } }); } }; var AgStatusBarSelector = { selector: "AG-STATUS-BAR", component: AgStatusBar }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/agNameValue.ts var AgNameValueElement = { tag: "div", cls: "ag-status-name-value", children: [ { tag: "span", ref: "eLabel" }, ":\xA0", { tag: "span", ref: "eValue", cls: "ag-status-name-value-value" } ] }; var MIN_SAFE_BIGINT = BigInt(Number.MIN_SAFE_INTEGER); var MAX_SAFE_BIGINT = BigInt(Number.MAX_SAFE_INTEGER); var AgNameValue = class extends Component { constructor() { super(AgNameValueElement); this.eLabel = RefPlaceholder; this.eValue = RefPlaceholder; } setLabel(key, defaultValue) { this.setDisplayed(false); this.eLabel.textContent = this.getLocaleTextFunc()(key, defaultValue); } setValue(value, totalRows) { let numericValue = null; let bigintValue; if (typeof value === "bigint") { bigintValue = value; if (value >= MIN_SAFE_BIGINT && value <= MAX_SAFE_BIGINT) { numericValue = Number(value); } } else { numericValue = value; } this.eValue.textContent = this.valueFormatter( _addGridCommonParams(this.gos, { value: numericValue, bigintValue, totalRows, key: this.key }) ); } }; var AgNameValueSelector = { selector: "AG-NAME-VALUE", component: AgNameValue }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/utils.ts var _getFilteredRowCount = (rowModel) => { let filteredRowCount = 0; rowModel.forEachNodeAfterFilter((node) => { if (node.data) { filteredRowCount++; } }); return filteredRowCount; }; var _getTotalRowCount = (rowModel) => { let totalRowCount = 0; rowModel.forEachNode((node) => { if (node.data) { totalRowCount++; } }); return totalRowCount; }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/aggregationComp.ts function _formatNumberTwoDecimalPlacesAndCommas(value, getLocaleTextFunc) { if (typeof value !== "number") { return ""; } return _formatNumberCommas(Math.round(value * 100) / 100, getLocaleTextFunc); } var AggregationCompElement = { tag: "div", cls: "ag-status-panel ag-status-panel-aggregations", children: [ { tag: "ag-name-value", ref: "avgAggregationComp" }, { tag: "ag-name-value", ref: "countAggregationComp" }, { tag: "ag-name-value", ref: "minAggregationComp" }, { tag: "ag-name-value", ref: "maxAggregationComp" }, { tag: "ag-name-value", ref: "sumAggregationComp" } ] }; var AggregationComp = class extends Component { constructor() { super(AggregationCompElement, [AgNameValueSelector]); this.sumAggregationComp = RefPlaceholder; this.countAggregationComp = RefPlaceholder; this.minAggregationComp = RefPlaceholder; this.maxAggregationComp = RefPlaceholder; this.avgAggregationComp = RefPlaceholder; } postConstruct() { this.avgAggregationComp.setLabel("avg", "Average"); this.countAggregationComp.setLabel("count", "Count"); this.minAggregationComp.setLabel("min", "Min"); this.maxAggregationComp.setLabel("max", "Max"); this.sumAggregationComp.setLabel("sum", "Sum"); this.addManagedEventListeners({ cellSelectionChanged: this.onCellSelectionChanged.bind(this), modelUpdated: this.onCellSelectionChanged.bind(this) }); } init(params) { this.refresh(params); } refresh(params) { this.params = params; const valueFormatter = params.valueFormatter ?? ((params2) => { const { value, bigintValue } = params2; if (bigintValue != null) { return bigintValue.toString(); } return _formatNumberTwoDecimalPlacesAndCommas(value, this.getLocaleTextFunc.bind(this)); }); const aggFuncNames = ["avg", "count", "min", "max", "sum"]; for (const key of aggFuncNames) { const comp = this.getAllowedAggregationValueComponent(key); if (comp) { comp.key = key; comp.valueFormatter = valueFormatter.bind(this); } } this.onCellSelectionChanged(); return true; } setAggregationComponentValue(aggFuncName, value, visible) { const statusBarValueComponent = this.getAllowedAggregationValueComponent(aggFuncName); const totalRow = _getTotalRowCount(this.beans.rowModel); if (_exists(statusBarValueComponent) && statusBarValueComponent) { statusBarValueComponent.setValue(value, totalRow); statusBarValueComponent.setDisplayed(visible); } else { this.getAggregationValueComponent(aggFuncName)?.setDisplayed(false); } } getAllowedAggregationValueComponent(aggFuncName) { const { aggFuncs } = this.params; if (!aggFuncs || aggFuncs.includes(aggFuncName)) { return this.getAggregationValueComponent(aggFuncName); } return null; } getAggregationValueComponent(aggFuncName) { const refComponentName = `${aggFuncName}AggregationComp`; return this[refComponentName]; } /** * Aggregation notes: * - Uses bigint aggregation when bigint values are present and all numeric values are safe integers. * - Non-integer or unsafe integer numbers fall back to number aggregation to avoid precision loss. * - Avg uses integer division when bigint aggregation is active, discarding the fractional part. * - String values are trimmed; finite numeric strings are aggregated as numbers, while integer strings beyond the * safe integer range are parsed as bigint. */ onCellSelectionChanged() { const beans = this.beans; const { rangeSvc, valueSvc } = beans; const cellRanges = rangeSvc?.getCellRanges(); let sum = 0; let sumBigint = 0n; let hasBigInt = false; let seenNonInteger = false; let count = 0; let numericCount = 0; let min = null; let max = null; let minBigint = null; let maxBigint = null; const addValue = (value) => { if (typeof value === "number") { sum += value; if (min === null || value < min) { min = value; } if (max === null || value > max) { max = value; } if (!Number.isInteger(value) || !Number.isSafeInteger(value)) { seenNonInteger = true; } else { const bigintValue = BigInt(value); sumBigint += bigintValue; if (minBigint === null || bigintValue < minBigint) { minBigint = bigintValue; } if (maxBigint === null || bigintValue > maxBigint) { maxBigint = bigintValue; } } } else { hasBigInt = true; sumBigint += value; if (minBigint === null || value < minBigint) { minBigint = value; } if (maxBigint === null || value > maxBigint) { maxBigint = value; } const numberValue = Number(value); sum += numberValue; if (min === null || numberValue < min) { min = numberValue; } if (max === null || numberValue > max) { max = numberValue; } } numericCount++; }; const cellsSoFar = {}; if (cellRanges?.length && rangeSvc) { for (let i = 0; i < cellRanges.length; i++) { const cellRange = cellRanges[i]; let currentRow = rangeSvc.getRangeStartRow(cellRange); const lastRow = rangeSvc.getRangeEndRow(cellRange); while (true) { const finishedAllRows = _missing(currentRow) || !currentRow || _isRowBefore(lastRow, currentRow); if (finishedAllRows || !currentRow || !cellRange.columns) { break; } cellRange.columns.forEach((col) => { if (currentRow === null) { return; } const cellId = _createCellId({ rowPinned: currentRow.rowPinned, column: col, rowIndex: currentRow.rowIndex }); if (cellsSoFar[cellId]) { return; } cellsSoFar[cellId] = true; const rowNode = _getRowNode(beans, currentRow); if (_missing(rowNode)) { return; } let value = valueSvc.getValue(col, rowNode, "data"); if (_missing(value) || value === "") { return; } count++; if (typeof value === "object" && "value" in value) { value = value.value; if (value === "") { return; } } if (typeof value === "string") { const trimmedValue = value.trim(); if (trimmedValue === "") { return; } const asNumber = Number(trimmedValue); if (!Number.isFinite(asNumber)) { return; } if (sum + asNumber >= Number.MAX_SAFE_INTEGER || sum + asNumber <= Number.MIN_SAFE_INTEGER || asNumber >= Number.MAX_SAFE_INTEGER || asNumber <= Number.MIN_SAFE_INTEGER) { value = _parseBigIntOrNull(trimmedValue); if (value === null) { value = asNumber; } } else { value = asNumber; } } if (typeof value === "number" && !isNaN(value) || typeof value === "bigint") { addValue(value); } }); currentRow = _getRowBelow(beans, currentRow); } } } const moreThanOneValue = count > 1; const moreThanOneNum = numericCount > 1; const useBigintAggregation = hasBigInt && !seenNonInteger; let avg; if (useBigintAggregation) { avg = sumBigint / BigInt(numericCount); } else { avg = sum / numericCount; } const sumValue = moreThanOneNum ? useBigintAggregation ? sumBigint : sum : null; const minValue = moreThanOneNum ? useBigintAggregation ? minBigint : min : null; const maxValue = moreThanOneNum ? useBigintAggregation ? maxBigint : max : null; const avgValue = moreThanOneNum ? avg : null; const showAvg = moreThanOneNum; this.setAggregationComponentValue("count", count, moreThanOneValue); this.setAggregationComponentValue("sum", sumValue, moreThanOneNum); this.setAggregationComponentValue("min", minValue, moreThanOneNum); this.setAggregationComponentValue("max", maxValue, moreThanOneNum); this.setAggregationComponentValue("avg", avgValue, showAvg); } }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/filteredRowsComp.ts var FilteredRowsComp = class extends AgNameValue { postConstruct() { this.setLabel("filteredRows", "Filtered"); this.addCss("ag-status-panel"); this.addCss("ag-status-panel-filtered-row-count"); this.setDisplayed(true); const listener = this.onDataChanged.bind(this); this.addManagedEventListeners({ modelUpdated: listener }); } onDataChanged() { const { rowModel } = this.beans; const totalRowCountValue = _getTotalRowCount(rowModel); const filteredRowCountValue = _getFilteredRowCount(rowModel); this.setValue(filteredRowCountValue, totalRowCountValue); this.setDisplayed(totalRowCountValue !== filteredRowCountValue); } init(params) { this.refresh(params); this.onDataChanged(); } updateValueFormatter(valueFormatter) { this.valueFormatter = valueFormatter ?? (({ value }) => _formatNumberCommas(value, this.getLocaleTextFunc.bind(this))); } refresh(params) { const { key, valueFormatter } = params; this.key = key; this.updateValueFormatter(valueFormatter); return true; } }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/selectedRowsComp.ts var SelectedRowsComp = class extends AgNameValue { postConstruct() { this.setLabel("selectedRows", "Selected"); this.addCss("ag-status-panel"); this.addCss("ag-status-panel-selected-row-count"); const eventListener = this.onRowSelectionChanged.bind(this); this.addManagedEventListeners({ modelUpdated: eventListener, selectionChanged: eventListener }); } onRowSelectionChanged() { const { selectionSvc, rowModel } = this.beans; const selectedRowCount = selectionSvc?.getSelectionCount() ?? 0; const totalRowCount = _getTotalRowCount(rowModel); this.setValue(selectedRowCount, totalRowCount); if (selectedRowCount < 0) { this.setDisplayed(true); return; } this.setDisplayed(selectedRowCount > 0); } init(params) { this.refresh(params); this.onRowSelectionChanged(); } updateValueFormatter(valueFormatter) { this.valueFormatter = valueFormatter ?? (({ value }) => { if (value == null || value >= 0) { return _formatNumberCommas(value, this.getLocaleTextFunc.bind(this)); } return this.getLocaleTextFunc()("statusBarLastRowUnknown", "?"); }); } refresh(params) { const { key, valueFormatter } = params; this.key = key; this.updateValueFormatter(valueFormatter); return true; } }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/totalAndFilteredRowsComp.ts var TotalAndFilteredRowsComp = class extends AgNameValue { postConstruct() { this.setLabel("totalAndFilteredRows", "Rows"); this.addCss("ag-status-panel"); this.addCss("ag-status-panel-total-and-filtered-row-count"); this.setDisplayed(true); this.addManagedEventListeners({ modelUpdated: this.onDataChanged.bind(this) }); } onDataChanged() { const { rowModel } = this.beans; const rowCount = _getFilteredRowCount(rowModel); const totalRowCount = _getTotalRowCount(rowModel); this.setValue(rowCount, totalRowCount); } init(params) { this.refresh(params); this.onDataChanged(); } updateValueFormatter(valueFormatter) { this.valueFormatter = valueFormatter ?? (({ value, totalRows }) => { const getLocaleTextFunc = this.getLocaleTextFunc.bind(this); const rowCount = _formatNumberCommas(value, getLocaleTextFunc); const totalRowCount = _formatNumberCommas(totalRows ?? value, getLocaleTextFunc); if (value === totalRows) { return rowCount; } const localeTextFunc = getLocaleTextFunc(); return `${rowCount} ${localeTextFunc("of", "of")} ${totalRowCount}`; }); } refresh(params) { const { key, valueFormatter } = params; this.key = key; this.updateValueFormatter(valueFormatter); return true; } }; // packages/ag-grid-enterprise/src/statusBar/providedPanels/totalRowsComp.ts var TotalRowsComp = class extends AgNameValue { postConstruct() { this.setLabel("totalRows", "Total Rows"); this.addCss("ag-status-panel"); this.addCss("ag-status-panel-total-row-count"); this.setDisplayed(true); this.addManagedEventListeners({ modelUpdated: this.onDataChanged.bind(this) }); } onDataChanged() { const totalRow = _getTotalRowCount(this.beans.rowModel); this.setValue(totalRow, totalRow); } init(params) { this.refresh(params); this.onDataChanged(); } updateValueFormatter(valueFormatter) { this.valueFormatter = valueFormatter ?? (({ value }) => _formatNumberCommas(value, this.getLocaleTextFunc.bind(this))); } refresh(params) { const { key, valueFormatter } = params; this.key = key; this.updateValueFormatter(valueFormatter); return true; } }; // packages/ag-grid-enterprise/src/statusBar/statusBarApi.ts function getStatusPanel(beans, key) { const comp = beans.statusBarSvc?.getStatusPanel(key); return _unwrapUserComp(comp); } // packages/ag-grid-enterprise/src/statusBar/statusBarService.ts var StatusBarService = class extends BeanStub { // tslint:disable-next-line constructor() { super(); this.beanName = "statusBarSvc"; this.comps = /* @__PURE__ */ new Map(); } registerStatusPanel(key, component) { this.comps.set(key, component); } unregisterStatusPanel(key) { this.comps.delete(key); } unregisterAllComponents() { this.comps.clear(); } getStatusPanel(key) { return this.comps.get(key); } destroy() { this.unregisterAllComponents(); super.destroy(); } }; // packages/ag-grid-enterprise/src/statusBar/statusBarModule.ts var StatusBarModule = { moduleName: "StatusBar", version: VERSION2, beans: [StatusBarService], userComponents: { agAggregationComponent: AggregationComp, agTotalRowCountComponent: TotalRowsComp, agFilteredRowCountComponent: FilteredRowsComp, agTotalAndFilteredRowCountComponent: TotalAndFilteredRowsComp, agSelectedRowCountComponent: SelectedRowsComp }, selectors: [AgStatusBarSelector], apiFunctions: { getStatusPanel }, dependsOn: [EnterpriseCoreModule, KeyboardNavigationModule] }; // packages/ag-grid-enterprise/src/excelExport/excelExportApi.ts function assertNotExcelMultiSheet(beans) { if (beans.excelCreator?.getFactoryMode() === "MULTI_SHEET") { _warn(161); return false; } return true; } function getDataAsExcel(beans, params) { if (assertNotExcelMultiSheet(beans)) { return beans.excelCreator?.getDataAsExcel(params); } return void 0; } function exportDataAsExcel(beans, params) { if (assertNotExcelMultiSheet(beans)) { beans.excelCreator?.exportDataAsExcel(params); } } function getSheetDataForExcel(beans, params) { beans.excelCreator?.setFactoryMode("MULTI_SHEET"); return beans.excelCreator?.getSheetDataForExcel(params); } function getMultipleSheetsAsExcel2(beans, params) { return beans.excelCreator?.getMultipleSheetsAsExcel(params); } function exportMultipleSheetsAsExcel2(beans, params) { beans.excelCreator?.exportMultipleSheetsAsExcel(params); } // packages/ag-grid-enterprise/src/excelExport/excelExportModule.ts var ExcelExportModule = { moduleName: "ExcelExport", version: VERSION2, beans: [ExcelCreator], apiFunctions: { getDataAsExcel, exportDataAsExcel, getSheetDataForExcel, getMultipleSheetsAsExcel: getMultipleSheetsAsExcel2, exportMultipleSheetsAsExcel: exportMultipleSheetsAsExcel2 }, dependsOn: [SharedExportModule, EnterpriseCoreModule] }; // packages/ag-grid-enterprise/src/multiFilter/multiFilterUtil.ts function getMultiFilterDefs(params) { const { filters } = params; return filters && filters.length > 0 ? filters : [{ filter: "agTextColumnFilter" }, { filter: "agSetColumnFilter" }]; } function forEachReverse(list, action) { if (list == null) { return; } for (let i = list.length - 1; i >= 0; i--) { action(list[i], i); } } function getFilterTitle(filter, filterDef) { if (filterDef.title != null) { return filterDef.title; } return filter instanceof ProvidedFilter ? filter.getFilterTitle() : "Filter"; } function getUpdatedMultiFilterModel(existingModel, numFilters, newModel, index) { const filterModels = []; const existingFilterModels = existingModel?.filterModels; for (let i = 0; i < numFilters; i++) { filterModels[i] = (i === index ? newModel : existingFilterModels?.[i]) ?? null; } return filterModels.every((childModel) => childModel == null) ? null : { filterType: "multi", filterModels }; } function getFilterModelForIndex(model, index) { return model?.filterModels?.[index] ?? null; } function updateGetValue(beans, column, filterDef, existingGetValue) { const filterValueGetter = filterDef.filterValueGetter; return filterValueGetter ? beans.colFilter.createGetValue(column, filterValueGetter) : existingGetValue; } // packages/ag-grid-enterprise/src/multiFilter/baseMultiFilter.ts var BaseMultiFilter = class extends TabGuardComp { constructor() { super({ tag: "div", cls: "ag-multi-filter ag-menu-list-compact" }); this.filterDefs = []; this.guiDestroyFuncs = []; // this could be the accordion/sub menu element depending on the display type this.filterGuis = []; this.lastActivatedMenuItem = null; } postConstruct() { this.initialiseTabGuard({ onFocusIn: (e) => this.onFocusIn(e) }); } refreshGui(container) { if (container === this.lastOpenedInContainer) { return AgPromise.resolve(); } this.tabGuardFeature.removeAllChildrenExceptTabGuards(); this.destroyChildren(); return AgPromise.all( this.getFilterWrappers().map((wrapper, index) => { if (!wrapper) { return AgPromise.resolve(null); } const filter = this.getFilterFromWrapper(wrapper); const comp = this.getCompFromWrapper(wrapper); const filterDef = this.filterDefs[index]; const filterTitle = getFilterTitle(filter, filterDef); let filterGuiPromise; if (filterDef.display === "subMenu" && container !== "toolPanel") { filterGuiPromise = this.insertFilterMenu(comp, filter, filterTitle).then( (menuItem) => menuItem.getGui() ); } else if (filterDef.display === "subMenu" || filterDef.display === "accordion") { const group = this.insertFilterGroup(filter, comp, filterTitle); filterGuiPromise = AgPromise.resolve(group.getGui()); } else { filterGuiPromise = AgPromise.resolve(comp.getGui()); } return filterGuiPromise; }) ).then((filterGuis) => { filterGuis.forEach((filterGui, index) => { if (!filterGui) { return; } if (index > 0) { this.appendChild(_createElement({ tag: "div", cls: "ag-filter-separator" })); } this.appendChild(filterGui); }); this.filterGuis = filterGuis; this.lastOpenedInContainer = container; }); } destroyChildren() { for (const func of this.guiDestroyFuncs) { func(); } this.guiDestroyFuncs.length = 0; this.filterGuis.length = 0; } insertFilterMenu(comp, filter, name) { const eGui = comp.getGui(); _setAriaRole(eGui, "dialog"); const menuItem = this.createBean(new MenuItemComponent()); const childComponent = { getGui: () => comp.getGui(), afterGuiAttached: (params) => { comp.afterGuiAttached?.(params); if (comp !== filter) { filter.afterGuiAttached?.(params); } } }; return menuItem.init({ menuItemDef: { name, subMenu: [], subMenuRole: "dialog", cssClasses: ["ag-multi-filter-menu-item"], menuItem: MenuItemRenderer, menuItemParams: { cssClassPrefix: "ag-compact-menu-option", isCompact: true } }, level: 0, isAnotherSubMenuOpen: () => false, childComponent, contextParams: { column: null, node: null, value: null } }).then(() => { menuItem.setParentComponent(this); this.guiDestroyFuncs.push(() => this.destroyBean(menuItem)); this.addManagedListeners(menuItem, { menuItemActivated: (event) => { if (this.lastActivatedMenuItem && this.lastActivatedMenuItem !== event.menuItem) { this.lastActivatedMenuItem.deactivate(); } this.lastActivatedMenuItem = event.menuItem; } }); const menuItemGui = menuItem.getGui(); menuItem.addManagedElementListeners(menuItemGui, { // `AgMenuList` normally handles keyboard navigation, so need to do here keydown: (e) => { const { key } = e; switch (key) { case KeyCode.UP: case KeyCode.RIGHT: case KeyCode.DOWN: case KeyCode.LEFT: e.preventDefault(); if (key === KeyCode.RIGHT) { menuItem.openSubMenu(true); } break; } }, focusin: () => menuItem.activate(), focusout: () => { if (!menuItem.isSubMenuOpen() && !menuItem.isSubMenuOpening()) { menuItem.deactivate(); } } }); return menuItem; }); } insertFilterGroup(filter, comp, title) { const group = this.createBean( new AgGroupComponent({ title, cssIdentifier: "multi-filter" }) ); this.guiDestroyFuncs.push(() => this.destroyBean(group)); group.addItem(comp.getGui()); group.toggleGroupExpand(false); if (filter.afterGuiAttached) { group.addManagedListeners(group, { expanded: () => filter.afterGuiAttached({ container: this.lastOpenedInContainer, suppressFocus: true, hidePopup: this.hidePopup }) }); } return group; } afterGuiAttached(params) { let refreshPromise; if (params) { this.hidePopup = params.hidePopup; refreshPromise = this.refreshGui(params.container); } else { this.hidePopup = void 0; refreshPromise = AgPromise.resolve(); } const suppressFocus = params?.suppressFocus; refreshPromise.then(() => { const { filterDefs, filterGuis, beans } = this; const wrappers = this.getFilterWrappers(); let hasFocused = !!suppressFocus; if (filterDefs) { forEachReverse(filterDefs, (filterDef, index) => { const isFirst = index === 0; const notInlineDisplayType = filterDef.display && filterDef.display !== "inline"; const suppressFocusForFilter = suppressFocus || !isFirst || notInlineDisplayType; const afterGuiAttachedParams = { ...params ?? {}, suppressFocus: suppressFocusForFilter }; const wrapper = wrappers[index]; const filter = wrapper ? this.getFilterFromWrapper(wrapper) : void 0; if (wrapper) { const comp = this.getCompFromWrapper(wrapper); if (comp !== filter) { comp.afterGuiAttached(afterGuiAttachedParams); } } if (filter) { this.executeFunctionIfExistsOnFilter(filter, "afterGuiAttached", afterGuiAttachedParams); if (isFirst && !suppressFocusForFilter) { hasFocused = true; } } if (!suppressFocus && isFirst && notInlineDisplayType) { const filterGui = filterGuis[index]; if (filterGui) { if (!_focusInto(filterGui)) { filterGui.focus({ preventScroll: true }); } hasFocused = true; } } }); } const activeEl = _getActiveDomElement(beans); if (!hasFocused && (_isNothingFocused(beans) || this.getGui().contains(activeEl))) { this.forceFocusOutOfContainer(true); } }); } afterGuiDetached() { this.executeFunctionIfExists("afterGuiDetached"); } onAnyFilterChanged() { this.executeFunctionIfExists( "onAnyFilterChanged", (wrapper) => this.executeOnWrapper(wrapper, "onAnyFilterChanged") ); } onNewRowsLoaded() { this.executeFunctionIfExists("onNewRowsLoaded", (wrapper) => this.executeOnWrapper(wrapper, "onNewRowsLoaded")); } destroy() { this.destroyChildren(); this.hidePopup = void 0; super.destroy(); } executeOnWrapper(_wrapper, _name) { } executeFunctionIfExists(name, executeOnHandler) { forEachReverse(this.getFilterWrappers(), (wrapper) => { if (wrapper) { executeOnHandler?.(wrapper); this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(wrapper), name); } }); } executeFunctionIfExistsOnFilter(filter, name, ...params) { const func = filter[name]; if (typeof func === "function") { func.apply(filter, params); } } onFocusIn(e) { const lastActivatedMenuItem = this.lastActivatedMenuItem; if (lastActivatedMenuItem != null && !lastActivatedMenuItem.getGui().contains(e.target)) { lastActivatedMenuItem.deactivate(); this.lastActivatedMenuItem = null; } } }; // packages/ag-grid-enterprise/src/multiFilter/multiFilter.ts var MultiFilter = class extends BaseMultiFilter { constructor() { super(...arguments); this.filterType = "multi"; this.wrappers = []; this.activeFilterIndices = []; this.afterFiltersReadyFuncs = []; } init(params) { this.params = params; this.filterDefs = getMultiFilterDefs(params); const initialModel = _getFilterModel(this.beans.colFilter.model, params.column.getColId()); const { filterChangedCallback } = params; this.filterChangedCallback = filterChangedCallback; const filterPromises = this.filterDefs.map( (filterDef, index) => this.createFilter(filterDef, index, initialModel) ); return new AgPromise((resolve) => { AgPromise.all(filterPromises).then((wrappers) => { this.wrappers = wrappers; this.refreshGui("columnMenu").then(() => { resolve(); }); }); }).then(() => { for (const f of this.afterFiltersReadyFuncs) { f(); } this.afterFiltersReadyFuncs.length = 0; }); } refresh(params) { this.params = params; return true; } isFilterActive() { return this.wrappers.some((wrapper) => { if (!wrapper) { return false; } const { filter, handler, model } = wrapper; if (handler) { return model != null; } return filter.isFilterActive(); }); } getLastActiveFilterIndex() { const activeFilterIndices = this.activeFilterIndices; return activeFilterIndices.length > 0 ? activeFilterIndices[activeFilterIndices.length - 1] : null; } doesFilterPass(params, indexToSkip) { return this.wrappers.every((wrapper, index) => { if (!wrapper || indexToSkip != null && index === indexToSkip) { return true; } const { handler, filter, model } = wrapper; if (handler) { return model == null || handler.doesFilterPass({ ...params, model, handlerParams: wrapper.handlerParams }); } return !filter.isFilterActive() || filter.doesFilterPass(params); }); } getModelFromUi() { const model = { filterType: this.filterType, filterModels: this.wrappers.map((wrapper) => { if (!wrapper) { return null; } const providedFilter = wrapper.filter; if (typeof providedFilter.getModelFromUi === "function") { return providedFilter.getModelFromUi(); } return null; }) }; return model; } getModel() { if (!this.isFilterActive()) { return null; } const model = { filterType: this.filterType, filterModels: this.wrappers.map((wrapper) => { if (!wrapper) { return null; } const { filter, handler, model: model2 } = wrapper; if (handler) { return model2; } return filter.isFilterActive() ? filter.getModel() : null; }) }; return model; } setModel(model) { const setFilterModel2 = (filter, filterModel) => { return new AgPromise((resolve) => { const promise = filter.setModel(filterModel); if (promise) { promise.then(resolve); } else { resolve(); } }); }; const promises = []; this.wrappers.forEach((wrapper, index) => { if (!wrapper) { return; } const modelForFilter = getFilterModelForIndex(model, index); const { filter, filterParams, handler, handlerParams, state } = wrapper; if (handler) { const newState = { model: modelForFilter, state: state?.state }; wrapper.state = newState; wrapper.model = modelForFilter; promises.push( _refreshHandlerAndUi( () => AgPromise.resolve({ filter, filterParams }), handler, handlerParams, modelForFilter, newState, "api" ).then(() => { this.updateActiveListForHandler(index, wrapper.model); }) ); } else { promises.push( setFilterModel2(filter, modelForFilter).then(() => { this.updateActiveListForFilter(index, filter); }) ); } }); return AgPromise.all(promises).then(() => { }); } applyModel(source = "api") { let result = false; for (const wrapper of this.wrappers) { if (wrapper) { const filter = wrapper.filter; if (filter instanceof ProvidedFilter) { result = filter.applyModel(source) || result; } } } return result; } getChildFilterInstance(index) { return this.wrappers[index]?.filter; } getNumChildFilters() { return this.wrappers.length; } destroy() { for (const wrapper of this.wrappers) { this.destroyBean(wrapper?.filter); this.destroyBean(wrapper?.handler); } this.wrappers.length = 0; super.destroy(); } getFilterWrappers() { return this.wrappers; } getFilterFromWrapper(wrapper) { return wrapper.filter; } getCompFromWrapper(wrapper) { return wrapper.comp; } executeOnWrapper(wrapper, name) { wrapper.handler?.[name]?.(); } createFilter(filterDef, index, initialModel) { const column = this.params.column; let initialModelForFilter = null; let createWrapperComp; const beans = this.beans; const onModelChange = (model, additionalEventAttributes) => { const wrapper = this.wrappers[index]; if (!wrapper) { return; } const newState = { model, state: wrapper.state?.state }; wrapper.state = newState; wrapper.model = model; _refreshHandlerAndUi( () => AgPromise.resolve({ filter: wrapper.filter, filterParams: wrapper.filterParams }), wrapper.handler, wrapper.handlerParams, model, newState, "ui" ).then(() => { this.onHandlerModelChanged(index, wrapper.model, additionalEventAttributes); }); }; const { compDetails, handler, handlerParams: originalHandlerParams, createFilterUi } = beans.colFilter.createFilterInstance( column, filterDef, "agTextColumnFilter", (defaultParams, isHandler) => { const updatedParams = { ...defaultParams, filterChangedCallback: isHandler ? () => { } : (additionalEventAttributes) => { this.executeWhenAllFiltersReady( () => this.onFilterModelChanged(index, additionalEventAttributes) ); }, doesRowPassOtherFilter: (node) => defaultParams.doesRowPassOtherFilter(node) && this.doesFilterPass({ node, data: node.data }, index), getValue: updateGetValue(beans, column, filterDef, defaultParams.getValue) }; if (isHandler) { initialModelForFilter = getFilterModelForIndex(initialModel, index); createWrapperComp = this.updateDisplayParams( updatedParams, index, initialModelForFilter, () => compDetails, () => handler, onModelChange ); } return updatedParams; } ); if (!createFilterUi) { return AgPromise.resolve(null); } let handlerParams; if (handler) { const { doesRowPassOtherFilter, getValue } = originalHandlerParams; handlerParams = { ...originalHandlerParams, onModelChange, doesRowPassOtherFilter: (node) => doesRowPassOtherFilter(node) && this.doesFilterPass({ node, data: node.data }, index), getValue: updateGetValue(beans, column, filterDef, getValue) }; handler.init?.({ ...handlerParams, model: initialModelForFilter, source: "init" }); } return createFilterUi().then((filter) => { if (!handler) { return { filter, comp: filter }; } const filterParams = compDetails?.params; const comp = createWrapperComp(filter); return { filter, comp, filterParams, handler, handlerParams, model: initialModelForFilter }; }); } updateDisplayParams(displayParams, index, initialModelForFilter, getCompDetails, getHandler, onModelChange) { const column = this.params.column; const eventSvc = new LocalEventService(); displayParams.model = initialModelForFilter; displayParams.state = { model: initialModelForFilter }; displayParams.onModelChange = onModelChange; displayParams.getHandler = getHandler; const updateState = (wrapper, state) => { wrapper.state = state; eventSvc.dispatchEvent({ type: "filterStateChanged", column, state }); }; displayParams.onStateChange = (state) => { const wrapper = this.wrappers[index]; if (!wrapper) { return; } updateState(wrapper, state); _refreshFilterUi(wrapper.filter, wrapper.filterParams, wrapper.model ?? null, state, "ui"); }; const updateModel = (_column, action, additionalEventAttributes) => { const wrapper = this.wrappers[index]; if (!wrapper) { return; } const getModel = () => wrapper?.model ?? null; _updateFilterModel({ action, filterParams: wrapper.filterParams, getFilterUi: () => { const promise = AgPromise.resolve(wrapper.filter); return { created: true, filterParams: wrapper.filterParams, compDetails: getCompDetails(), create: () => promise, promise }; }, getModel, getState: () => wrapper?.state ?? { model: getModel() }, updateState: (state) => updateState(wrapper, state), updateModel: (newModel) => wrapper.filterParams?.onModelChange(newModel, additionalEventAttributes), processModelToApply: wrapper.handler?.processModelToApply?.bind(wrapper.handler) }); }; displayParams.onAction = (action, additionalEventAttributes, event) => { updateModel(column, action, additionalEventAttributes); eventSvc.dispatchEvent({ type: "filterAction", column, action, event }); }; return (filter) => { const filterParams = getCompDetails()?.params; return this.createManagedBean( new FilterWrapperComp( column, { comp: filter, params: filterParams, isHandler: true }, eventSvc, updateModel, false ) ); }; } executeWhenAllFiltersReady(action) { if ((this.wrappers?.length ?? 0) > 0) { action(); } else { this.afterFiltersReadyFuncs.push(action); } } updateActiveListForFilter(index, filter) { this.updateActiveList(index, () => filter?.isFilterActive()); } updateActiveListForHandler(index, model) { this.updateActiveList(index, () => model != null); } updateActiveList(index, isActive) { const activeFilterIndices = this.activeFilterIndices; _removeFromArray(this.activeFilterIndices, index); if (isActive()) { activeFilterIndices.push(index); } } /** Only called for non-handlers */ onFilterModelChanged(index, additionalEventAttributes) { this.updateActiveListForFilter(index, this.wrappers[index]?.filter); this.filterChanged(index, additionalEventAttributes); } onHandlerModelChanged(index, model, additionalEventAttributes) { this.updateActiveListForHandler(index, model); this.filterChanged(index, additionalEventAttributes); } filterChanged(index, additionalEventAttributes) { this.filterChangedCallback(additionalEventAttributes); this.wrappers.forEach((wrapper, childIndex) => { if (index === childIndex || !wrapper) { return; } const { filter, handler } = wrapper; handler?.onAnyFilterChanged?.(); if (typeof filter.onAnyFilterChanged === "function") { filter.onAnyFilterChanged(); } }); } getModelAsString(model) { if (!model?.filterModels?.length) { return ""; } const lastActiveIndex = this.getLastActiveFilterIndex() ?? 0; const activeFilter = this.wrappers[lastActiveIndex]?.filter; return activeFilter?.getModelAsString?.(model.filterModels[lastActiveIndex]) ?? ""; } }; // packages/ag-grid-enterprise/src/multiFilter/multiFilterHandler.ts var MultiFilterHandler = class extends BeanStub { constructor() { super(...arguments); /** Used to get the filter type for filter models. */ this.filterType = "multi"; this.handlerWrappers = []; /** ui active. could still have null model */ this.activeFilterIndices = []; this.filterDefs = []; } init(params) { this.params = params; const filterDefs = getMultiFilterDefs(params.filterParams); this.filterDefs = filterDefs; filterDefs.forEach((def, index) => { const wrapper = this.beans.colFilter.createHandler(params.column, def, "agTextColumnFilter"); this.handlerWrappers.push(wrapper); if (!wrapper) { _warn(278, { colId: params.column.getColId() }); return; } const { handler, handlerParams } = wrapper; handler.init?.({ ...this.updateHandlerParams(handlerParams, index, true), model: getFilterModelForIndex(params.model, index), source: "init" }); }); this.resetActiveList(params.model); } refresh(params) { this.params = params; const { model, source, filterParams } = params; const filters = filterParams?.filters; this.handlerWrappers.forEach((wrapper, index) => { if (wrapper) { const updatedParams = this.updateHandlerParams(params, index, false, filters?.[index].filterParams); wrapper.handlerParams = updatedParams; wrapper.handler.refresh?.({ ...updatedParams, model: getFilterModelForIndex(model, index), source }); } }); if (params.source !== "floating" && params.source !== "ui") { this.resetActiveList(params.model); } if (params.additionalEventAttributes?.fromButtons) { this.onAnyFilterChanged(); } } updateHandlerParams(params, index, isInit, providedFilterParams) { const { onModelChange, doesRowPassOtherFilter, getValue } = params; const handlerParams = { ...params, onModelChange: (newModel, additionalEventAttributes) => onModelChange( getUpdatedMultiFilterModel(this.params.model, this.handlerWrappers.length, newModel, index), additionalEventAttributes ), doesRowPassOtherFilter: (node) => doesRowPassOtherFilter(node) && this.doesFilterPass({ node, data: node.data, model: this.params.model, handlerParams }, index), getValue: updateGetValue(this.beans, params.column, this.filterDefs[index], getValue), filterParams: this.updateFilterParams(params, isInit, providedFilterParams) }; return handlerParams; } updateFilterParams(params, isInit, providedFilterParams) { const originalFilterParams = params.filterParams; if (providedFilterParams?.buttons && isInit) { _warn(292, { colId: params.column.getColId() }); } const filterParamsForFilter = providedFilterParams ? { ...originalFilterParams, ...providedFilterParams } : originalFilterParams; if (!filterParamsForFilter.buttons) { return filterParamsForFilter; } if (providedFilterParams) { delete filterParamsForFilter.buttons; return filterParamsForFilter; } const { buttons: _, ...filterParamsForFilterWithoutButtons } = filterParamsForFilter; return filterParamsForFilterWithoutButtons; } doesFilterPass(params, indexToSkip) { const filterModels = params.model?.filterModels; if (filterModels == null) { return true; } return this.handlerWrappers.every((wrapper, index) => { const model = filterModels[index]; if (model == null || indexToSkip != null && index === indexToSkip) { return true; } const handler = wrapper?.handler; return !handler || handler.doesFilterPass({ ...params, model, handlerParams: wrapper.handlerParams }); }); } resetActiveList(model) { this.activeFilterIndices = []; const filterModels = model?.filterModels; if (filterModels == null) { return; } for (let i = 0; i < this.handlerWrappers.length; i++) { const isActive = filterModels[i] != null; if (isActive) { this.activeFilterIndices.push(i); } } } updateActiveList(index, childModel) { const activeFilterIndices = this.activeFilterIndices; _removeFromArray(activeFilterIndices, index); if (childModel != null) { activeFilterIndices.push(index); } } getLastActiveFilterIndex() { const activeFilterIndices = this.activeFilterIndices; return activeFilterIndices.length > 0 ? activeFilterIndices[activeFilterIndices.length - 1] : null; } getModelAsString(model, source) { const isForToolPanel = source === "filterToolPanel"; const defaultOption = () => isForToolPanel ? this.getLocaleTextFunc()("filterSummaryInactive", "is (All)") : ""; if (!model?.filterModels?.length) { return defaultOption(); } const lastActiveIndex = this.getLastActiveFilterIndex() ?? 0; const activeWrapper = this.handlerWrappers[lastActiveIndex]; return activeWrapper?.handler.getModelAsString?.(model.filterModels[lastActiveIndex], source) ?? defaultOption(); } getHandler(index) { return this.handlerWrappers[index]?.handler; } onAnyFilterChanged() { forEachReverse(this.handlerWrappers, (wrapper) => wrapper?.handler?.onAnyFilterChanged?.()); } onNewRowsLoaded() { forEachReverse(this.handlerWrappers, (wrapper) => wrapper?.handler?.onNewRowsLoaded?.()); } destroy() { for (const wrapper of this.handlerWrappers) { this.destroyBean(wrapper?.handler); } this.handlerWrappers.length = 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/multiFilter/multiFilterService.ts var MultiFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "multiFilter"; } getParamsForDataType(existingFilterParams, existingFilterValueGetter, dataTypeDefinition, formatValue) { let filters = existingFilterParams?.filters; const beans = this.beans; if (!filters) { const simpleFilter = _getDefaultSimpleFilter(dataTypeDefinition.baseDataType); filters = [{ filter: simpleFilter }, { filter: "agSetColumnFilter" }]; } const translate = this.getLocaleTextFunc(); filters = filters.map((filterDef) => { const { filter, filterParams: existingChildFilterParams, filterValueGetter: existingChildFilterValueGetter } = filterDef; if (typeof filter !== "string") { return filterDef; } const { filterParams, filterValueGetter } = _getFilterParamsForDataType( filter, existingChildFilterParams, existingChildFilterValueGetter ?? existingFilterValueGetter, dataTypeDefinition, formatValue, beans, translate ); return { ...filterDef, filterParams, filterValueGetter }; }); return { filterParams: { ...existingFilterParams, filters } }; } }; // packages/ag-grid-enterprise/src/multiFilter/multiFilterUi.ts var MultiFilterUi = class extends BaseMultiFilter { constructor() { super(...arguments); this.filterType = "multi"; this.filters = []; this.filterParams = []; this.validity = []; } init(params) { this.params = params; const filterDefs = getMultiFilterDefs(params).map((filterDef) => { if (filterDef.filterParams?.buttons) { _warn(292, { colId: params.column.getColId() }); const newParams = { ...filterDef.filterParams }; delete newParams.buttons; return { ...filterDef, filterParams: newParams }; } return filterDef; }); this.filterDefs = filterDefs; this.allState = params.state; const filterPromises = this.filterDefs.map( (filterDef, index) => this.createFilter(filterDef, index) ); return new AgPromise((resolve) => { AgPromise.all(filterPromises).then((filters) => { this.filters = filters; this.refreshGui("columnMenu").then(() => { resolve(); }); }); }); } refresh(params) { const { model, state, source } = params; if (source === "colDef") { return false; } this.params = params; const filterParams = this.filterParams; if (state === this.allState) { return true; } this.allState = state; const newAllStateState = state.state; this.filters.forEach((filter, index) => { const modelForFilter = getFilterModelForIndex(model, index); const stateForFilter = { state: newAllStateState?.[index], model: getFilterModelForIndex(state.model, index) }; _refreshFilterUi(filter, filterParams[index], modelForFilter, stateForFilter, source); }); return true; } getLastActiveFilterIndex() { return this.getHandler().getLastActiveFilterIndex?.() ?? null; } getChildFilterInstance(index) { return this.filters[index] ?? void 0; } getNumChildFilters() { return this.filters.length; } destroy() { for (const filter of this.filters) { this.destroyBean(filter); } this.filters.length = 0; super.destroy(); } getFilterWrappers() { return this.filters; } getFilterFromWrapper(wrapper) { return wrapper; } getCompFromWrapper(wrapper) { return wrapper; } createFilter(filterDef, index) { const userCompFactory = this.beans.userCompFactory; const filterParams = this.updateParams(filterDef, this.params, index); const compDetails = _getFilterDetails( userCompFactory, filterDef, filterParams, "agTextColumnFilter" ); if (!compDetails) { return AgPromise.resolve(null); } this.filterParams[index] = compDetails.params; return compDetails.newAgStackInstance(); } updateParams(filterDef, params, index) { const { doesRowPassOtherFilter, model, onModelChange, state, onStateChange, column, source, onAction, onUiChange, getValue } = params; const filterModel = getFilterModelForIndex(model, index); const filterState = state ? { model: getFilterModelForIndex(state.model, index), state: state.state?.[index] } : { model: filterModel }; const onAnyFilterChanged = () => { const handler = this.getHandler(); this.filters.forEach((filter, otherIndex) => { if (index !== otherIndex) { handler.getHandler(otherIndex)?.onAnyFilterChanged?.(); filter?.onAnyFilterChanged?.(); } }); }; const colFilter = this.beans.colFilter; return { ...colFilter.createBaseFilterParams(column), ...filterDef, doesRowPassOtherFilter: (node) => doesRowPassOtherFilter(node) && this.getHandler().doesFilterPass( { node, data: node.data, model: this.params.model, handlerParams: colFilter.getHandlerParams(column) }, index ), model: filterModel, state: filterState, onModelChange: (childModel, additionalEventAttributes) => { const { filters, params: params2 } = this; const newModel = getUpdatedMultiFilterModel(params2.model, filters.length, childModel, index); this.updateActiveList(index, childModel); onModelChange(newModel, additionalEventAttributes); onAnyFilterChanged(); }, onStateChange: (newState) => this.onStateChange(onStateChange, index, newState), getHandler: () => this.getHandler().getHandler(index), onAction: (action, additionalEventAttributes, event) => { if (_isUseApplyButton(params)) { return; } const isChange = action === "apply" || action === "reset"; if (isChange) { this.updateActiveList(index, getFilterModelForIndex(this.params.state.model, index)); } onAction(action, additionalEventAttributes, event); if (isChange) { onAnyFilterChanged(); } }, onUiChange, source, getValue: updateGetValue(this.beans, column, filterDef, getValue) }; } updateActiveList(index, childModel) { this.getHandler().updateActiveList?.(index, childModel); } getHandler() { return this.params.getHandler(); } onStateChange(onStateChange, index, newState) { const { model, state, valid } = newState; const validity = this.validity; validity[index] = valid; const allState = this.allState; const newModel = getUpdatedMultiFilterModel(allState.model, this.filters.length, model, index); const allValid = validity.every((filterValid) => filterValid !== false); const allStateState = [...allState.state ?? []]; allStateState[index] = state; const newAllState = { state: allStateState, model: newModel, valid: allValid }; this.allState = newAllState; onStateChange(newAllState); } getModelAsString(model) { return this.getHandler().getModelAsString?.(model) ?? ""; } }; // packages/ag-grid-enterprise/src/multiFilter/multiFloatingFilter.ts var MultiFloatingFilterElement = { tag: "div", cls: "ag-multi-floating-filter ag-floating-filter-input" }; var MultiFloatingFilterComp = class extends Component { constructor() { super(MultiFloatingFilterElement); this.floatingFilters = []; this.compDetailsList = []; } init(params) { this.params = params; const { compDetailsList } = this.getCompDetailsList(params); return this.setParams(compDetailsList); } setParams(compDetailsList) { const floatingFilterPromises = []; compDetailsList.forEach((compDetails) => { const floatingFilterPromise = compDetails?.newAgStackInstance(); if (floatingFilterPromise != null) { this.compDetailsList.push(compDetails); floatingFilterPromises.push(floatingFilterPromise); } }); return AgPromise.all(floatingFilterPromises).then((floatingFilters) => { floatingFilters.forEach((floatingFilter, index) => { this.floatingFilters.push(floatingFilter); const gui = floatingFilter.getGui(); this.appendChild(gui); if (index > 0) { _setDisplayed(gui, false); } }); }); } refresh(params) { this.params = params; const { compDetailsList: newCompDetailsList, floatingFilterParamsList } = this.getCompDetailsList(params); const allFloatingFilterCompsUnchanged = newCompDetailsList.length === this.compDetailsList.length && newCompDetailsList.every( (newCompDetails, index) => !this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[index], newCompDetails) ); if (allFloatingFilterCompsUnchanged) { floatingFilterParamsList.forEach((floatingFilterParams, index) => { const floatingFilter = this.floatingFilters[index]; floatingFilter.refresh?.(floatingFilterParams); }); if (this.gos.get("enableFilterHandlers")) { const reactiveParams = params; if (reactiveParams.model == null) { this.floatingFilters.forEach((filter, i) => { _setDisplayed(filter.getGui(), i === 0); }); } else { const lastActiveFloatingFilterIndex = reactiveParams.getHandler()?.getLastActiveFilterIndex?.(); this.floatingFilters.forEach((filter, i) => { const shouldShow = lastActiveFloatingFilterIndex == null ? i === 0 : i === lastActiveFloatingFilterIndex; _setDisplayed(filter.getGui(), shouldShow); }); } } } else { _clearElement(this.getGui()); this.destroyBeans(this.floatingFilters); this.floatingFilters = []; this.compDetailsList = []; this.setParams(newCompDetailsList); } } getCompDetailsList(params) { const compDetailsList = []; const floatingFilterParamsList = []; const filterParams = params.filterParams; const currentParentModel = params.currentParentModel; const filterDefs = getMultiFilterDefs(filterParams); filterDefs.forEach((filterDef, index) => { const floatingFilterParams = { ...params, // set the parent filter instance for each floating filter to the relevant child filter instance parentFilterInstance: (callback) => { this.parentMultiFilterInstance((parent) => { const child = parent.getChildFilterInstance(index); if (child == null) { return; } callback(child); }); }, // return the parent model for the specific filter currentParentModel: () => currentParentModel()?.filterModels?.[index] ?? null }; if (this.gos.get("enableFilterHandlers")) { const reactiveParams = floatingFilterParams; reactiveParams.model = reactiveParams.model?.filterModels?.[index] ?? null; const { onModelChange, getHandler } = reactiveParams; reactiveParams.onModelChange = (newModel, additionalEventAttributes) => onModelChange( getUpdatedMultiFilterModel( this.params.model, filterDefs.length, newModel, index ), additionalEventAttributes ); reactiveParams.getHandler = () => { const multiFilterHandler = getHandler(); return multiFilterHandler.getHandler(index); }; } _mergeDeep(floatingFilterParams.filterParams, filterDef.filterParams); const compDetails = this.getCompDetails(filterDef, floatingFilterParams); if (compDetails) { compDetailsList.push(compDetails); floatingFilterParamsList.push(floatingFilterParams); } }); return { compDetailsList, floatingFilterParamsList }; } onParentModelChanged(model, event) { if (event?.afterFloatingFilter) { return; } this.parentMultiFilterInstance((parent) => { if (model == null) { this.floatingFilters.forEach((filter, i) => { filter.onParentModelChanged(null, event); _setDisplayed(filter.getGui(), i === 0); }); } else { const lastActiveFloatingFilterIndex = parent.getLastActiveFilterIndex(); this.floatingFilters.forEach((filter, i) => { const filterModel = model.filterModels.length > i ? model.filterModels[i] : null; filter.onParentModelChanged(filterModel, event); const shouldShow = lastActiveFloatingFilterIndex == null ? i === 0 : i === lastActiveFloatingFilterIndex; _setDisplayed(filter.getGui(), shouldShow); }); } }); } destroy() { this.destroyBeans(this.floatingFilters); this.floatingFilters.length = 0; super.destroy(); } getCompDetails(filterDef, params) { const { colFilter, frameworkOverrides, userCompFactory } = this.beans; const defaultComponentName = _getDefaultFloatingFilterType( frameworkOverrides, filterDef, () => colFilter.getDefaultFloatingFilter(this.params.column) ) ?? "agReadOnlyFloatingFilter"; return _getFloatingFilterCompDetails(userCompFactory, filterDef, params, defaultComponentName); } parentMultiFilterInstance(cb) { this.params.parentFilterInstance((parent) => { if (!(parent instanceof MultiFilter || parent instanceof MultiFilterUi)) { _error(120); } cb(parent); }); } }; // packages/ag-grid-enterprise/src/multiFilter/multiFilterModule.ts var MultiFilterModule = { moduleName: "MultiFilter", version: VERSION2, userComponents: { agMultiColumnFilter: { getComp: (beans) => beans.gos.get("enableFilterHandlers") ? { classImp: MultiFilterUi, params: { useForm: true } } : MultiFilter }, agMultiColumnFloatingFilter: MultiFloatingFilterComp }, beans: [MultiFilterService], dynamicBeans: { agMultiColumnFilterHandler: MultiFilterHandler }, dependsOn: [EnterpriseCoreModule, ColumnFilterModule, MenuItemModule] }; // packages/ag-grid-enterprise/src/aggregation/aggColumnNameService.ts var AggColumnNameService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "aggColNameSvc"; } getHeaderName(column, headerName) { if (this.gos.get("suppressAggFuncInHeader")) { return headerName; } const { valueColsSvc, colModel, rowGroupColsSvc } = this.beans; const pivotValueColumn = column.getColDef().pivotValueColumn; const pivotActiveOnThisColumn = _exists(pivotValueColumn); let aggFunc = null; let aggFuncFound; if (pivotActiveOnThisColumn) { const valueColumns = valueColsSvc?.columns ?? []; const isCollapsedHeaderEnabled = this.gos.get("removePivotHeaderRowWhenSingleValueColumn") && valueColumns.length === 1; const isTotalColumn = column.getColDef().pivotTotalColumnIds !== void 0; if (isCollapsedHeaderEnabled && !isTotalColumn) { return headerName; } aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null; aggFuncFound = true; } else { const measureActive = column.isValueActive(); const isGrouping = rowGroupColsSvc?.columns.length !== 0; const aggregationPresent = colModel.isPivotMode() || isGrouping || this.gos.get("treeData"); if (measureActive && aggregationPresent) { aggFunc = column.getAggFunc(); aggFuncFound = true; } else { aggFuncFound = false; } } if (aggFuncFound) { const aggFuncString = typeof aggFunc === "string" ? aggFunc : "func"; const localeTextFunc = this.getLocaleTextFunc(); const aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString); return `${aggFuncStringTranslated}(${headerName})`; } return headerName; } }; // packages/ag-grid-enterprise/src/aggregation/aggFuncService.ts var defaultAggFuncNames = { sum: "Sum", first: "First", last: "Last", min: "Min", max: "Max", count: "Count", avg: "Average" }; var AggFuncService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "aggFuncSvc"; this.aggFuncsMap = {}; this.initialised = false; } postConstruct() { this.init(); } init() { if (this.initialised) { return; } this.initialiseWithDefaultAggregations(); this.addAggFuncs(this.gos.get("aggFuncs")); } initialiseWithDefaultAggregations() { const aggMap = this.aggFuncsMap; aggMap["sum"] = aggSum; aggMap["first"] = aggFirst; aggMap["last"] = aggLast; aggMap["min"] = aggMin; aggMap["max"] = aggMax; aggMap["count"] = aggCount; aggMap["avg"] = aggAvg; this.initialised = true; } isAggFuncPossible(column, func) { const allKeys = this.getFuncNames(column); const allowed = allKeys.includes(func); const funcExists = _exists(this.aggFuncsMap[func]); return allowed && funcExists; } getDefaultFuncLabel(fctName) { return defaultAggFuncNames[fctName] ?? fctName; } getDefaultAggFunc(column) { const defaultAgg = column.getColDef().defaultAggFunc; if (_exists(defaultAgg) && this.isAggFuncPossible(column, defaultAgg)) { return defaultAgg; } if (this.isAggFuncPossible(column, "sum")) { return "sum"; } const allKeys = this.getFuncNames(column); return allKeys?.length ? allKeys[0] : null; } addAggFuncs(aggFuncs) { this.init(); if (!aggFuncs) { return; } for (const key of Object.keys(aggFuncs)) { if (aggFuncs[key]) { this.aggFuncsMap[key] = aggFuncs[key]; } } } getAggFunc(name) { this.init(); return this.aggFuncsMap[name]; } getFuncNames(column) { const userAllowedFuncs = column.getColDef().allowedAggFuncs; return userAllowedFuncs == null ? Object.keys(this.aggFuncsMap).sort() : userAllowedFuncs; } clear() { this.aggFuncsMap = {}; } }; function aggSum(params) { const { values } = params; let result = null; for (let i = 0; i < values.length; i++) { const value = values[i]; if (typeof value === "number") { if (result === null) { result = value; } else { result += typeof result === "number" ? value : BigInt(value); } } else if (typeof value === "bigint") { if (result === null) { result = value; } else { result = (typeof result === "bigint" ? result : BigInt(result)) + value; } } } return result; } function aggFirst(params) { return params.values.length > 0 ? params.values[0] : null; } function aggLast(params) { return params.values.length > 0 ? _last(params.values) : null; } function aggMin(params) { const { values } = params; let result = null; for (let i = 0; i < values.length; i++) { const value = values[i]; if ((typeof value === "number" || typeof value === "bigint") && (result === null || result > value)) { result = value; } } return result; } function aggMax(params) { const { values } = params; let result = null; for (let i = 0; i < values.length; i++) { const value = values[i]; if ((typeof value === "number" || typeof value === "bigint") && (result === null || result < value)) { result = value; } } return result; } var COUNT_PROTO = Object.freeze({ // the grid by default uses toString to render values for an object, so this // is a trick to get the default cellRenderer to display the avg value toString: function() { return this.value.toString(); }, // used for sorting toNumber: function() { return this.value; } }); function aggCount(params) { const { values } = params; let count = 0; for (let i = 0; i < values.length; i++) { const value = values[i]; count += value != null && typeof value.value === "number" ? value.value : 1; } const existingAggData = params.rowNode?.aggData?.[params.column.getColId()]; if (existingAggData && existingAggData.value === count) { return existingAggData; } const result = Object.create(COUNT_PROTO); result.value = count; return result; } var AVERAGE_PROTO = Object.freeze({ // the grid by default uses toString to render values for an object, so this // is a trick to get the default cellRenderer to display the avg value toString: function() { return typeof this.value === "number" || typeof this.value === "bigint" ? this.value.toString() : ""; }, // used for sorting toNumber: function() { return this.value; } }); function aggAvg(params) { const { values } = params; let sum = 0; let count = 0; for (let i = 0; i < values.length; i++) { const currentValue = values[i]; let valueToAdd = null; if (typeof currentValue === "number" || typeof currentValue === "bigint") { valueToAdd = currentValue; count++; } else if (currentValue != null && (typeof currentValue.value === "number" || typeof currentValue.value === "bigint") && typeof currentValue.count === "number") { valueToAdd = currentValue.value * (typeof currentValue.value === "number" ? currentValue.count : BigInt(currentValue.count)); count += currentValue.count; } if (typeof valueToAdd === "number") { sum += typeof sum === "number" ? valueToAdd : BigInt(valueToAdd); } else if (typeof valueToAdd === "bigint") { sum = (typeof sum === "bigint" ? sum : BigInt(sum)) + valueToAdd; } } let value = null; if (count > 0) { value = sum / (typeof sum === "number" ? count : BigInt(count)); } const existingAggData = params.rowNode?.aggData?.[params.column?.getColId()]; if (existingAggData && existingAggData.count === count && existingAggData.value === value) { return existingAggData; } const result = Object.create(AVERAGE_PROTO); result.count = count; result.value = value; return result; } // packages/ag-grid-enterprise/src/aggregation/aggregatedChildrenSvc.ts var AggregatedChildrenSvc = class extends BeanStub { constructor() { super(...arguments); this.beanName = "aggChildrenSvc"; } getAggregatedChildren(rowNode, col, recursive) { if (!rowNode?.group) { return []; } if (rowNode.rowPinned) { rowNode = rowNode.pinnedSibling; if (!rowNode) { return []; } } const gos = this.gos; const children = getImmediateAggChildren(rowNode, col, gos); if (!recursive) { return children; } const result = []; collectLeafDescendants(children, col, gos, result); return result; } }; var getImmediateAggChildren = (rowNode, col, gos) => { const colDef = col?.colDef; const pivotKeys = colDef?.pivotKeys; if (pivotKeys) { if (rowNode.leafGroup && pivotKeys.length && !colDef.pivotTotalColumnIds) { return getNodesFromMappedSet(rowNode.childrenMapped, pivotKeys); } return rowNode.childrenAfterFilter ?? rowNode.childrenAfterGroup ?? []; } if (_getGroupAggFiltering(gos) || gos.get("suppressAggFilteredOnly")) { return rowNode.childrenAfterGroup ?? []; } return rowNode.childrenAfterFilter ?? rowNode.childrenAfterGroup ?? []; }; var collectLeafDescendants = (children, col, gos, result) => { for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; if (child.group) { collectLeafDescendants(getImmediateAggChildren(child, col, gos), col, gos, result); } else { result.push(child); } } }; // packages/ag-grid-enterprise/src/aggregation/aggregationApi.ts function addAggFuncs(beans, aggFuncs) { if (beans.aggFuncSvc) { beans.aggFuncSvc.addAggFuncs(aggFuncs); } } function clearAggFuncs(beans) { if (beans.aggFuncSvc) { beans.aggFuncSvc.clear(); } } function setColumnAggFunc(beans, key, aggFunc) { beans.valueColsSvc?.setColumnAggFunc?.(key, aggFunc, "api"); } // packages/ag-grid-enterprise/src/aggregation/aggregationStage.ts var AggregationStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "aggStage"; this.step = "aggregate"; this.refreshProps = [ "getGroupRowAgg", "alwaysAggregateAtRootLevel", "suppressAggFilteredOnly", "grandTotalRow" ]; /** Tracks whether the previous execute() call produced aggData, so we only clear once on transition. */ this.hadAgg = false; } // Stale aggData on demoted nodes is cleared by the group stage (setRowNodeGroup), not here. execute(changedPath) { const { gos, beans } = this; const userAggFunc = gos.getCallback("getGroupRowAgg"); const valueColumns = beans.valueColsSvc?.columns; if (!valueColumns?.length && !userAggFunc) { if (this.hadAgg && !changedPath) { this.hadAgg = false; const colModel2 = beans.colModel; const rowModel2 = beans.rowModel; _forEachChangedGroupDepthFirst(rowModel2.rootNode, rowModel2.hierarchical, void 0, (rowNode) => { setAggDataWithSiblings(rowNode, null, colModel2); }); } return; } this.hadAgg = true; const colModel = beans.colModel; const aggFuncSvc = beans.aggFuncSvc; const aggregateRoot = gos.get("alwaysAggregateAtRootLevel") || !!_getGrandTotalRow(gos) || colModel.isPivotMode(); const filteredOnly = !_getGroupAggFiltering(gos) && !gos.get("suppressAggFilteredOnly"); const valueSvc = beans.valueSvc; const api = beans.gridApi; const context = beans.gridOptions.context; const resolvedValueColumns = valueColumns ?? []; const colCount = resolvedValueColumns.length; const narrowedCellsPath = changedPath?.kind === "cells" ? changedPath : void 0; let cellsChangedPath; const valueCols = new Array(colCount); for (let i = 0; i < colCount; ++i) { const col = resolvedValueColumns[i]; const colSlot = narrowedCellsPath ? narrowedCellsPath.getSlot(col.colId) : -1; if (colSlot >= 0) { cellsChangedPath = narrowedCellsPath; } valueCols[i] = { column: col, colId: col.colId, colDef: col.colDef, aggFunc: resolveAggFunc(col.getAggFunc(), aggFuncSvc, col), colSlot }; } const pivotData = resolvePivotColumns(colModel, beans.pivotResultCols, aggFuncSvc); const values2d = colCount > 0 ? new Array(colCount) : null; const rowModel = beans.rowModel; _forEachChangedGroupDepthFirst(rowModel.rootNode, rowModel.hierarchical, changedPath, (rowNode) => { if (rowNode.level === -1 && !aggregateRoot) { setAggData(rowNode, null, colModel); return; } let aggResult; if (userAggFunc) { aggResult = userAggFunc({ nodes: rowNode.childrenAfterFilter }); } else if (!values2d) { aggResult = null; } else if (pivotData) { aggResult = aggregateValuesAndPivot(rowNode, pivotData, valueSvc, api, context); } else { aggResult = aggregateValuesOnly( rowNode, valueCols, colCount, values2d, cellsChangedPath, filteredOnly, valueSvc, api, context ); } setAggDataWithSiblings(rowNode, aggResult, colModel); }); } }; var aggregateValuesOnly = (rowNode, valueCols, colCount, values2d, cellsChangedPath, filteredOnly, valueSvc, api, context) => { const aggregatedChildren = (filteredOnly ? rowNode.childrenAfterFilter : rowNode.childrenAfterGroup) ?? []; const childCount = aggregatedChildren.length; const data = rowNode.data; const result = /* @__PURE__ */ Object.create(null); const rowSlot = cellsChangedPath ? cellsChangedPath.getSlot(rowNode) : -1; const oldAggData = rowSlot >= 0 ? rowNode.aggData : void 0; let changedCount = 0; for (let j = 0; j < colCount; ++j) { const vc = valueCols[j]; if (rowSlot >= 0 && !cellsChangedPath.hasCellBySlot(rowSlot, vc.colSlot)) { values2d[j] = null; if (oldAggData) { result[vc.colId] = oldAggData[vc.colId]; } } else { values2d[j] = new Array(childCount); ++changedCount; } } if (changedCount === 0) { return result; } for (let c = 0; c < childCount; ++c) { const child = aggregatedChildren[c]; const childAggData = child.aggData; if (childAggData) { for (let j = 0; j < colCount; ++j) { const colValues = values2d[j]; if (colValues !== null) { const vc = valueCols[j]; const v = childAggData[vc.colId]; colValues[c] = v !== void 0 ? v : valueSvc.getValue(vc.column, child, "data"); } } } else { for (let j = 0; j < colCount; ++j) { const colValues = values2d[j]; if (colValues !== null) { colValues[c] = valueSvc.getValue(valueCols[j].column, child, "data"); } } } } for (let j = 0; j < colCount; ++j) { const colValues = values2d[j]; if (colValues === null) { continue; } const rc = valueCols[j]; const aggFunc = rc.aggFunc; result[rc.colId] = aggFunc ? aggFunc({ values: colValues, column: rc.column, colDef: rc.colDef, rowNode, data, aggregatedChildren, api, context }) : null; } return result; }; var aggregateValuesAndPivot = (rowNode, pivotData, valueSvc, api, context) => { const pivotColCount = pivotData.length; const isLeafGroup = rowNode.leafGroup; const data = rowNode.data; const childrenMapped = rowNode.childrenMapped; const childrenAfterFilter = rowNode.childrenAfterFilter ?? []; const result = /* @__PURE__ */ Object.create(null); let prevPivotKeys; let prevPivotChildren; for (let i = 0; i < pivotColCount; ++i) { const rc = pivotData[i]; const column = rc.column; const colId = rc.colId; const totalColIds = rc.totalColIds; let values; let aggregatedChildren; if (totalColIds != null) { const tLen = totalColIds.length; values = new Array(tLen); for (let t = 0; t < tLen; ++t) { values[t] = result[totalColIds[t]]; } aggregatedChildren = childrenAfterFilter; } else if (isLeafGroup) { const pivotKeys = rc.pivotKeys; if (!prevPivotChildren || pivotKeys !== prevPivotKeys) { prevPivotKeys = pivotKeys; prevPivotChildren = getNodesFromMappedSet(childrenMapped, pivotKeys); } aggregatedChildren = prevPivotChildren; const nodeCount = aggregatedChildren.length; values = new Array(nodeCount); for (let n = 0; n < nodeCount; ++n) { values[n] = valueSvc.getValue(column, aggregatedChildren[n], "data"); } } else { aggregatedChildren = childrenAfterFilter; const nodeCount = aggregatedChildren.length; values = new Array(nodeCount); for (let n = 0; n < nodeCount; ++n) { const childNode = aggregatedChildren[n]; const childAggData = childNode.aggData; const v = childAggData ? childAggData[colId] : void 0; values[n] = v !== void 0 ? v : valueSvc.getValue(column, childNode, "data"); } } const aggFunc = rc.aggFunc; result[colId] = aggFunc ? aggFunc({ values, column, colDef: column.colDef, pivotResultColumn: rc.pivotResultCol, rowNode, data, aggregatedChildren, api, context }) : null; } return result; }; var resolveAggFunc = (aggFuncOrString, aggFuncSvc, column) => { if (typeof aggFuncOrString === "function") { return aggFuncOrString; } if (aggFuncOrString == null) { return null; } const aggFunc = aggFuncSvc.getAggFunc(aggFuncOrString); if (typeof aggFunc !== "function") { _warn(109, { inputValue: aggFuncOrString.toString(), allSuggestions: aggFuncSvc.getFuncNames(column) }); return null; } return aggFunc; }; var resolvePivotColumns = (colModel, pivotResultCols, aggFuncSvc) => { if (!colModel.isPivotActive()) { return null; } const orderedList = pivotResultCols?.getAggregationOrderedList(); if (!orderedList || orderedList.length === 0) { return null; } const len = orderedList.length; const resolved = new Array(len); let count = 0; for (let i = 0; i < len; ++i) { const pivotResultCol = orderedList[i]; const resultColDef = pivotResultCol.colDef; const valueCol = resultColDef.pivotValueColumn; if (!valueCol) { continue; } resolved[count++] = { column: valueCol, colId: resultColDef.colId, aggFunc: resolveAggFunc(valueCol.getAggFunc(), aggFuncSvc, valueCol), pivotResultCol, pivotKeys: resultColDef.pivotKeys, totalColIds: resultColDef.pivotTotalColumnIds }; } if (count === 0) { return null; } resolved.length = count; return resolved; }; // packages/ag-grid-enterprise/src/aggregation/filterAggregatesStage.ts var FilterAggregatesStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterAggStage"; this.step = "filter_aggregates"; this.refreshProps = []; /** for tree data, we include all children, groups and leafs */ this.setAllChildrenCountTreeData = (rowNode) => { const childrenAfterAggFilter = rowNode.childrenAfterAggFilter; let allChildrenCount = 0; if (childrenAfterAggFilter) { const length = childrenAfterAggFilter.length; allChildrenCount = length; for (let i = 0; i < length; ++i) { allChildrenCount += childrenAfterAggFilter[i].allChildrenCount ?? 0; } } const count = ( // Maintain the historical behaviour: // - allChildrenCount is 0 in the root if there are no children // - allChildrenCount is null in any non-root row if there are no children allChildrenCount === 0 && rowNode.level >= 0 ? null : allChildrenCount ); rowNode.setAllChildrenCount(count); rowNode.pinnedSibling?.setAllChildrenCount(count); }; /* for grid data, we only count the leafs */ this.setAllChildrenCountGridGrouping = (rowNode) => { const children = rowNode.childrenAfterAggFilter; let allChildrenCount = 0; for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; if (child.group) { allChildrenCount += child.allChildrenCount; } else { allChildrenCount++; } } rowNode.setAllChildrenCount(allChildrenCount); rowNode.pinnedSibling?.setAllChildrenCount(allChildrenCount); }; } wireBeans(beans) { this.filterManager = beans.filterManager; } execute(changedPath) { const { rowModel, colModel, groupStage } = this.beans; const { filterManager } = this; const isPivotMode2 = colModel.isPivotMode(); const isAggFilterActive = filterManager?.isAggregateFilterPresent() || filterManager?.isAggregateQuickFilterPresent(); const isTreeData = !!groupStage?.treeData; const defaultPrimaryColumnPredicate = (params) => !params.node.group; const defaultSecondaryColumnPredicate = (params) => params.node.leafGroup; const applyFilterToNode = _getGroupAggFiltering(this.gos) || (isPivotMode2 ? defaultSecondaryColumnPredicate : defaultPrimaryColumnPredicate); const setAllChildrenCount = isTreeData ? this.setAllChildrenCountTreeData : this.setAllChildrenCountGridGrouping; const preserveChildren = (node, recursive = false) => { if (node.childrenAfterFilter) { node.childrenAfterAggFilter = node.childrenAfterFilter; if (recursive) { const children = node.childrenAfterAggFilter; for (let i = 0, len = children.length; i < len; ++i) { preserveChildren(children[i], recursive); } } if (node.hasChildren()) { setAllChildrenCount(node); } else { node.setAllChildrenCount(null); node.pinnedSibling?.setAllChildrenCount(null); } } if (node.sibling) { node.sibling.childrenAfterAggFilter = node.childrenAfterAggFilter; } }; const filterChildren = (node) => { node.childrenAfterAggFilter = node.childrenAfterFilter?.filter((child) => { const shouldFilterRow = applyFilterToNode({ node: child }); if (shouldFilterRow) { const doesNodePassFilter = filterManager.doesRowPassAggregateFilters({ rowNode: child }); if (doesNodePassFilter) { preserveChildren(child, true); return true; } } const hasChildPassed = child.childrenAfterAggFilter?.length; return hasChildPassed; }) || null; if (node.hasChildren()) { setAllChildrenCount(node); } else { node.setAllChildrenCount(null); node.pinnedSibling?.setAllChildrenCount(null); } if (node.sibling) { node.sibling.childrenAfterAggFilter = node.childrenAfterAggFilter; } }; _forEachChangedGroupDepthFirst( rowModel.rootNode, rowModel.hierarchical, changedPath, isAggFilterActive ? filterChildren : preserveChildren ); } }; // packages/ag-grid-enterprise/src/aggregation/footerUtils.ts function _createRowNodeFooter(rowNode, beans) { if (rowNode.sibling) { return; } const footerNode = _createRowNodeSibling(rowNode, beans); footerNode.footer = true; footerNode.setRowTop(null); footerNode.setRowIndex(null); footerNode.oldRowTop = null; footerNode.id = "rowGroupFooter_" + rowNode.id; footerNode.sibling = rowNode; rowNode.sibling = footerNode; } function _destroyRowNodeFooter(rowNode) { const sibling = rowNode.sibling; if (!sibling) { return; } sibling._destroy(false); rowNode.sibling = void 0; sibling.sibling = void 0; } // packages/ag-grid-enterprise/src/aggregation/footerService.ts var FooterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "footerSvc"; } addTotalRows(startIndex, node, callback, includeFooterNodes, isRootNode, position) { let index = startIndex; if (isRootNode) { const grandTotal = includeFooterNodes && _getGrandTotalRow(this.gos); if (_positionMatchesGrandTotalRow(position, grandTotal)) { _createRowNodeFooter(node, this.beans); callback(node.sibling, index++); } return index; } const isGroupIncludeFooter = _getGroupTotalRowCallback(this.gos); const groupTotal = includeFooterNodes && isGroupIncludeFooter({ node }); if (groupTotal === position) { _createRowNodeFooter(node, this.beans); callback(node.sibling, index++); } return index; } getTopDisplayIndex(rowsToDisplay, topLevelIndex, childrenAfterSort, getDefaultIndex) { let adjustedIndex = topLevelIndex; if (rowsToDisplay[0].footer) { if (topLevelIndex === 0) { return 0; } adjustedIndex -= 1; } const lastRow = rowsToDisplay[rowsToDisplay.length - 1]; const indexOutsideGroupBounds = adjustedIndex >= childrenAfterSort.length; if (lastRow.footer && indexOutsideGroupBounds) { return lastRow.rowIndex; } return getDefaultIndex(adjustedIndex); } doesCellShowTotalPrefix(node, col) { if (!node.footer || !col?.getColDef().showRowGroup) { return false; } if (this.gos.get("treeData")) { return true; } if (node.level === -1) { return this.beans.showRowGroupCols?.columns[0] === col; } return !!node.rowGroupColumn && col?.isRowGroupDisplayed(node.rowGroupColumn.getId()); } applyTotalPrefix(value, formattedValue, node, column) { const totalValueGetter = column.getColDef().cellRendererParams?.totalValueGetter; if (totalValueGetter) { const valueGetterParams = _addGridCommonParams(this.gos, { column, node, value, formattedValue }); const getterType = typeof totalValueGetter; if (getterType === "function") { return totalValueGetter(valueGetterParams); } if (typeof totalValueGetter === "string") { return this.beans.expressionSvc?.evaluate(totalValueGetter, valueGetterParams); } _warn(179); } if (node.level === -1) { return this.getLocaleTextFunc()("footerTotal", "Total") + " "; } return this.getTotalValue(formattedValue ?? value) ?? ""; } getTotalValue(value) { return this.getLocaleTextFunc()("footerTotal", "Total") + " " + (value ?? ""); } }; function _positionMatchesGrandTotalRow(position, grandTotaRow) { switch (grandTotaRow) { case "top": case "pinnedTop": return position === "top"; case "bottom": case "pinnedBottom": return position === "bottom"; default: return false; } } // packages/ag-grid-enterprise/src/aggregation/valueColsSvc.ts var ValueColsSvc = class extends BaseColsService { constructor() { super(...arguments); this.beanName = "valueColsSvc"; this.eventName = "columnValueChanged"; this.columnProcessors = { set: (column, added, source) => this.setValueActive(added, column, source), add: (column, added, source) => this.setValueActive(true, column, source), remove: (column, added, source) => this.setValueActive(false, column, source) }; this.columnExtractors = { setFlagFunc: (col, flag, source) => this.setColValueActive(col, flag, source), getIndexFunc: () => void 0, getInitialIndexFunc: () => void 0, getValueFunc: (colDef) => { const aggFunc = colDef.aggFunc; if (aggFunc === null || aggFunc === "") { return null; } if (aggFunc === void 0) { return; } return !!aggFunc; }, getInitialValueFunc: (colDef) => { return colDef.initialAggFunc != null && colDef.initialAggFunc != ""; } }; this.modifyColumnsNoEventsCallbacks = { addCol: (column) => this.columns.push(column), removeCol: (column) => _removeFromArray(this.columns, column) }; } extractCols(source, oldProvidedCols) { this.columns = super.extractCols(source, oldProvidedCols); for (const col of this.columns) { const colDef = col.getColDef(); if (colDef.aggFunc != null && colDef.aggFunc != "") { this.setColAggFunc(col, colDef.aggFunc); } else if (!col.getAggFunc()) { this.setColAggFunc(col, colDef.initialAggFunc); } } return this.columns; } setColumnAggFunc(key, aggFunc, source) { if (!key) { return; } const column = this.colModel.getColDefCol(key); if (!column) { return; } this.setColAggFunc(column, aggFunc); this.dispatchColumnChangedEvent(this.eventSvc, this.eventName, [column], source); } syncColumnWithState(column, source, getValue) { const aggFunc = getValue("aggFunc").value1; if (aggFunc !== void 0) { if (typeof aggFunc === "string") { this.setColAggFunc(column, aggFunc); if (!column.isValueActive()) { this.setColValueActive(column, true, source); this.modifyColumnsNoEventsCallbacks.addCol(column); } } else { if (_exists(aggFunc)) { _warn(33); } if (column.isValueActive()) { this.setColValueActive(column, false, source); this.modifyColumnsNoEventsCallbacks.removeCol(column); } } } } setValueActive(active, column, source) { if (active === column.isValueActive()) { return; } this.setColValueActive(column, active, source); if (active && !column.getAggFunc() && this.aggFuncSvc) { const initialAggFunc = this.aggFuncSvc.getDefaultAggFunc(column); this.setColAggFunc(column, initialAggFunc); } } setColAggFunc(column, aggFunc) { column.aggFunc = aggFunc; column.dispatchStateUpdatedEvent("aggFunc"); } setColValueActive(column, value, source) { if (column.aggregationActive !== value) { column.aggregationActive = value; column.dispatchColEvent("columnValueChanged", source); } } }; // packages/ag-grid-enterprise/src/aggregation/aggregationModule.ts var SharedAggregationModule = { moduleName: "SharedAggregation", version: VERSION2, beans: [AggFuncService, AggColumnNameService, FooterService, ValueColsSvc], apiFunctions: { addAggFuncs, clearAggFuncs, setColumnAggFunc }, dependsOn: [EnterpriseCoreModule] }; var AggregationModule = { moduleName: "Aggregation", version: VERSION2, beans: [AggregationStage, FilterAggregatesStage, AggregatedChildrenSvc], rowModels: ["clientSide"], dependsOn: [SharedAggregationModule] }; // packages/ag-grid-enterprise/src/pivot/pivotColsSvc.ts var PivotColsSvc = class extends BaseColsService { constructor() { super(...arguments); this.beanName = "pivotColsSvc"; this.eventName = "columnPivotChanged"; this.columnProcessors = { set: (column, added, source) => this.setColPivotActive(column, added, source), add: (column, added, source) => this.setColPivotActive(column, true, source), remove: (column, added, source) => this.setColPivotActive(column, false, source) }; this.columnOrdering = { enableProp: "pivot", initialEnableProp: "initialPivot", indexProp: "pivotIndex", initialIndexProp: "initialPivotIndex" }; this.columnExtractors = { setFlagFunc: (col, flag, source) => this.setColPivotActive(col, flag, source), getIndexFunc: (colDef) => colDef.pivotIndex, getInitialIndexFunc: (colDef) => colDef.initialPivotIndex, getValueFunc: (colDef) => colDef.pivot, getInitialValueFunc: (colDef) => colDef.initialPivot }; this.modifyColumnsNoEventsCallbacks = { addCol: (column) => { if (!this.columns.includes(column)) { this.columns.push(column); } }, removeCol: (column) => _removeFromArray(this.columns, column) }; } syncColumnWithState(column, source, getValue, rowIndex) { const { value1: pivot, value2: pivotIndex } = getValue("pivot", "pivotIndex"); if (pivot !== void 0 || pivotIndex !== void 0) { if (typeof pivotIndex === "number" || pivot) { if (!column.isPivotActive()) { this.setColPivotActive(column, true, source); this.modifyColumnsNoEventsCallbacks.addCol(column); } if (rowIndex && typeof pivotIndex === "number") { rowIndex[column.getId()] = pivotIndex; } } else if (column.isPivotActive()) { this.setColPivotActive(column, false, source); this.modifyColumnsNoEventsCallbacks.removeCol(column); } } } setColPivotActive(column, pivot, source) { if (column.pivotActive !== pivot) { column.pivotActive = pivot; if (pivot) { const addedCols = this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns, column); addedCols?.forEach((c) => this.setColPivotActive(c, pivot, source)); } column.dispatchColEvent("columnPivotChanged", source); } column.dispatchStateUpdatedEvent("pivot"); } }; // packages/ag-grid-enterprise/src/rowGrouping/rowGroupColsSvc.ts var RowGroupColsSvc = class extends BaseColsService { constructor() { super(...arguments); this.beanName = "rowGroupColsSvc"; this.eventName = "columnRowGroupChanged"; this.columnProcessors = { set: (column, added, source) => this.setActive(added, column, source), add: (column, added, source) => this.setActive(true, column, source), remove: (column, added, source) => this.setActive(false, column, source) }; this.columnOrdering = { enableProp: "rowGroup", initialEnableProp: "initialRowGroup", indexProp: "rowGroupIndex", initialIndexProp: "initialRowGroupIndex" }; this.columnExtractors = { setFlagFunc: (col, flag, source) => this.setColRowGroupActive(col, flag, source), getIndexFunc: (colDef) => colDef.rowGroupIndex, getInitialIndexFunc: (colDef) => colDef.initialRowGroupIndex, getValueFunc: (colDef) => colDef.rowGroup, getInitialValueFunc: (colDef) => colDef.initialRowGroup }; this.modifyColumnsNoEventsCallbacks = { addCol: (column) => { if (!this.columns.includes(column)) { this.columns.push(column); } }, removeCol: (column) => _removeFromArray(this.columns, column) }; } moveColumn(fromIndex, toIndex, source) { if (this.columns.length === 0) { return; } const column = this.columns[fromIndex]; const impactedColumns = this.columns.slice(fromIndex, toIndex); this.columns.splice(fromIndex, 1); this.columns.splice(toIndex, 0, column); this.updateIndexMap(); this.eventSvc.dispatchEvent({ type: this.eventName, columns: impactedColumns, column: impactedColumns.length === 1 ? impactedColumns[0] : null, source }); } syncColumnWithState(column, source, getValue, rowIndex) { const { value1: rowGroup, value2: rowGroupIndex } = getValue("rowGroup", "rowGroupIndex"); if (rowGroup !== void 0 || rowGroupIndex !== void 0) { if (typeof rowGroupIndex === "number" || rowGroup) { if (!column.isRowGroupActive()) { this.setColRowGroupActive(column, true, source); this.modifyColumnsNoEventsCallbacks.addCol(column); } if (rowIndex && typeof rowGroupIndex === "number") { rowIndex[column.getId()] = rowGroupIndex; } } else if (column.isRowGroupActive()) { this.setColRowGroupActive(column, false, source); this.modifyColumnsNoEventsCallbacks.removeCol(column); } } } setActive(active, column, source) { if (active === column.isRowGroupActive()) { return; } this.setColRowGroupActive(column, active, source); const isGroupHierarchyCol = this.beans.groupHierarchyColSvc?.getColumn(column); if (_shouldUpdateColVisibilityAfterGroup(this.gos, active) && !isGroupHierarchyCol) { this.colModel.setColsVisible([column], !active, source); } } setColRowGroupActive(column, rowGroup, source) { if (column.rowGroupActive !== rowGroup) { column.rowGroupActive = rowGroup; if (rowGroup) { const addedCols = this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns, column); addedCols?.forEach((c) => this.setColRowGroupActive(c, rowGroup, source)); } column.dispatchColEvent("columnRowGroupChanged", source); } column.dispatchStateUpdatedEvent("rowGroup"); } }; // packages/ag-grid-enterprise/src/rowHierarchy/autoColService.ts var AutoColService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "autoColSvc"; } postConstruct() { this.addManagedPropertyListener("autoGroupColumnDef", this.updateColumns.bind(this)); this.setupGroupHideColumnsUntilExpanded(); } setupGroupHideColumnsUntilExpanded() { const updateGroupColumnVisibility = () => this.updateGroupColumnVisibility(); this.addManagedEventListeners({ // modelUpdated is fired when rowGroup events are fired so we do not duplicate work by also listening to "rowGroupOpened" and "expandOrCollapseAll" modelUpdated: updateGroupColumnVisibility }); this.addManagedPropertyListeners( ["groupHideColumnsUntilExpanded", "groupDisplayType", "groupHideOpenParents"], updateGroupColumnVisibility ); } addColumns(cols) { const { columns } = this; if (columns == null) { return; } cols.list = columns.list.concat(cols.list); cols.tree = columns.tree.concat(cols.tree); _updateColsMap(cols); } createColumns(cols, updateOrders, source) { const beans = this.beans; const { colModel, gos, rowGroupColsSvc, colGroupSvc } = beans; const isPivotMode2 = colModel.isPivotMode(); const groupFullWidthRow = _isGroupUseEntireRow(gos, isPivotMode2); const suppressAutoColumn = isPivotMode2 ? gos.get("pivotSuppressAutoColumn") : this.isSuppressAutoCol(); const rowGroupCols = rowGroupColsSvc?.columns; const groupingActive = rowGroupCols && rowGroupCols.length > 0 || gos.get("treeData"); const noAutoCols = !groupingActive || suppressAutoColumn || groupFullWidthRow; const destroyPrevious = () => { if (this.columns) { _destroyColumnTree(beans, this.columns.tree); this.columns = null; } }; if (noAutoCols) { destroyPrevious(); return; } const list = this.generateAutoCols(rowGroupCols); const autoColsSame = _areColIdsEqual(list, this.columns?.list || null); const newTreeDepth = cols.treeDepth; const oldTreeDepth = this.columns ? this.columns.treeDepth : -1; const treeDepthSame = oldTreeDepth == newTreeDepth; if (autoColsSame && treeDepthSame) { const colsMap = new Map(list.map((col) => [col.getId(), col])); for (const col of this.columns?.list ?? []) { const newDef = colsMap.get(col.getId()); if (newDef) { col.setColDef(newDef.getColDef(), null, source); } } return; } destroyPrevious(); const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0; const tree = colGroupSvc?.balanceTreeForAutoCols(list, treeDepth) ?? []; this.columns = { list, tree, treeDepth, map: {} }; const putAutoColsFirstInList = (cols2) => { if (!cols2) { return null; } const colsFiltered = cols2.filter((col) => !isColumnGroupAutoCol(col)); return [...list, ...colsFiltered]; }; updateOrders(putAutoColsFirstInList); } updateColumns(event) { const source = _convertColumnEventSourceType(event.source); this.columns?.list.forEach((col, index) => this.updateOneAutoCol(col, index, source)); } getColumn(key) { return this.columns?.list.find((groupCol) => _columnsMatch(groupCol, key)) ?? null; } getColumns() { return this.columns?.list ?? null; } generateAutoCols(rowGroupCols = []) { const autoCols = []; const { gos } = this; const doingTreeData = gos.get("treeData"); let doingMultiAutoColumn = _isGroupMultiAutoColumn(gos); if (doingTreeData && doingMultiAutoColumn) { _warn(182); doingMultiAutoColumn = false; } if (doingMultiAutoColumn) { rowGroupCols.forEach((rowGroupCol, index) => { autoCols.push(this.createOneAutoCol(rowGroupCol, index)); }); } else { autoCols.push(this.createOneAutoCol()); } return autoCols; } isSuppressAutoCol() { const gos = this.gos; const groupDisplayType = gos.get("groupDisplayType"); const isCustomRowGroups = groupDisplayType === "custom"; if (isCustomRowGroups) { return true; } const treeDataDisplayType = gos.get("treeDataDisplayType"); return treeDataDisplayType === "custom"; } // rowGroupCol and index are missing if groupDisplayType != "multipleColumns" createOneAutoCol(rowGroupCol, index) { let colId; if (rowGroupCol) { colId = `${GROUP_AUTO_COLUMN_ID}-${rowGroupCol.getId()}`; } else { colId = GROUP_AUTO_COLUMN_ID; } const colDef = this.createAutoColDef(colId, rowGroupCol, index); colDef.colId = colId; const newCol = new AgColumn(colDef, null, colId, true); this.createBean(newCol); return newCol; } /** * Refreshes an auto group col to load changes from defaultColDef or autoGroupColDef */ updateOneAutoCol(colToUpdate, index, source) { const oldColDef = colToUpdate.getColDef(); const underlyingColId = typeof oldColDef.showRowGroup == "string" ? oldColDef.showRowGroup : void 0; const beans = this.beans; const underlyingColumn = underlyingColId != null ? beans.colModel.getColDefCol(underlyingColId) : void 0; const colId = colToUpdate.getId(); const colDef = this.createAutoColDef(colId, underlyingColumn ?? void 0, index); colToUpdate.setColDef(colDef, null, source); _applyColumnState(beans, { state: [_getColumnStateFromColDef(colDef, colId)] }, source); } createAutoColDef(colId, underlyingColumn, index) { let res = this.createBaseColDef(underlyingColumn); const autoGroupColumnDef = this.gos.get("autoGroupColumnDef"); _mergeDeep(res, autoGroupColumnDef); res = _addColumnDefaultAndTypes(this.beans, res, colId, true); if (autoGroupColumnDef?.groupRowEditable == null) { res.groupRowEditable = void 0; } if (autoGroupColumnDef?.groupRowValueSetter == null) { res.groupRowValueSetter = void 0; } if (!this.gos.get("treeData")) { const noFieldOrValueGetter = _missing(res.field) && _missing(res.valueGetter) && _missing(res.filterValueGetter) && res.filter !== "agGroupColumnFilter"; if (noFieldOrValueGetter) { res.filter = false; } } if (index && index > 0) { res.headerCheckboxSelection = false; } const isSortingCoupled = _isColumnsSortingCoupledToGroup(this.gos); const hasOwnData = res.valueGetter || res.field != null; if (isSortingCoupled && !hasOwnData) { res.sortIndex = void 0; res.initialSort = void 0; } return res; } createBaseColDef(rowGroupCol) { const userDef = this.gos.get("autoGroupColumnDef"); const localeTextFunc = this.getLocaleTextFunc(); const res = { headerName: localeTextFunc("group", "Group"), showRowGroup: rowGroupCol?.getColId() ?? true }; const userHasProvidedGroupCellRenderer = userDef && (userDef.cellRenderer || userDef.cellRendererSelector); if (!userHasProvidedGroupCellRenderer) { res.cellRenderer = "agGroupCellRenderer"; } if (rowGroupCol) { res.headerName = this.beans.colNames.getDisplayNameForColumn(rowGroupCol, "header") ?? void 0; res.headerValueGetter = rowGroupCol.colDef.headerValueGetter; } return res; } getDeepestExpandedLevel(nodes, maxLevel) { let deepest = -1; if (!nodes) { return deepest; } for (const node of nodes) { if (!node.group || !node.expanded) { continue; } if (node.level > deepest) { deepest = node.level; } if (deepest >= maxLevel) { return deepest; } const childDeepest = this.getDeepestExpandedLevel(node.childrenAfterGroup, maxLevel); if (childDeepest > deepest) { deepest = childDeepest; } if (deepest >= maxLevel) { return deepest; } } return deepest; } updateGroupColumnVisibility() { const columns = this.columns?.list; if (!columns || columns.length === 0) { return; } const { gos, visibleCols, rowModel } = this.beans; const isFeatureEnabled = _isGroupHideColumnsUntilExpanded(gos); let changed = false; const setColVisible = (col, visible) => { if (visible !== col.isVisible()) { col.setVisible(visible, "api"); changed = true; } }; const setAllColumnsVisible = () => { for (const col of columns) { setColVisible(col, true); } }; if (!isFeatureEnabled) { setAllColumnsVisible(); } else if (columns.length > 1) { const maxLevel = columns.length - 2; const rootChildren = rowModel?.rootNode?.childrenAfterGroup; const deepestExpandedLevel = this.getDeepestExpandedLevel(rootChildren, maxLevel); if (deepestExpandedLevel >= maxLevel) { setAllColumnsVisible(); } else { for (let level = 0; level < columns.length - 1; level++) { setColVisible(columns[level + 1], deepestExpandedLevel >= level); } } } if (changed) { visibleCols.refresh("api"); } } destroy() { _destroyColumnTree(this.beans, this.columns?.tree); super.destroy(); } }; // packages/ag-grid-enterprise/src/rowHierarchy/sortNodesByDepthFirst.ts var _sortBuckets = null; var sortBucketsAlloc = (minBucket) => { const old = _sortBuckets; const newBuckets = new Uint32Array(1 << 32 - Math.clz32(minBucket | 63)); if (old) { newBuckets.set(old); } _sortBuckets = newBuckets; return newBuckets; }; var sortTwoLevels = (nodes, nodeCount, deepest, deepCount) => { const shallowCount = nodeCount - deepCount; const deepLevel = deepest - 1; if (shallowCount === 1) { let si2 = 0; while (nodes[si2].level === deepLevel) { ++si2; } if (si2 < nodeCount - 1) { const shallow2 = nodes[si2]; nodes.copyWithin(si2, si2 + 1); nodes[nodeCount - 1] = shallow2; } return nodes; } if (deepCount === 1) { let di2 = 0; while (nodes[di2].level !== deepLevel) { ++di2; } if (di2 > 0) { const deep = nodes[di2]; nodes.copyWithin(1, 0, di2); nodes[0] = deep; } return nodes; } const shallow = new Array(shallowCount); let di = 0; let si = 0; for (let i = 0; i < nodeCount; ++i) { const node = nodes[i]; if (node.level === deepLevel) { nodes[di++] = node; } else { shallow[si++] = node; } } for (let i = 0; i < shallowCount; ++i) { nodes[deepCount + i] = shallow[i]; } return nodes; }; var countingSort = (nodes, nodesLen) => { let deepest = nodes[0].level + 1; let shallowest = deepest; let unsorted = 0; let prevB = deepest; let buckets = _sortBuckets; if (!buckets || deepest >= buckets.length) { buckets = sortBucketsAlloc(deepest); } ++buckets[deepest]; for (let i = 1; i < nodesLen; ++i) { const b = nodes[i].level + 1; if (b > deepest) { deepest = b; if (deepest >= buckets.length) { buckets = sortBucketsAlloc(deepest); } } else if (b < shallowest) { shallowest = b; } ++buckets[b]; unsorted |= prevB - b; prevB = b; } if (unsorted >= 0) { buckets.fill(0, shallowest, deepest + 1); return nodes; } const sCount = buckets[shallowest]; const dCount = buckets[deepest]; if (sCount + dCount === nodesLen) { buckets[shallowest] = 0; buckets[deepest] = 0; return sortTwoLevels(nodes, nodesLen, deepest, dCount); } let pos = 0; for (let b = deepest; b >= shallowest; --b) { const count = buckets[b]; buckets[b] = pos; pos += count; } const output = new Array(nodesLen); for (let i = 0; i < nodesLen; ++i) { const node = nodes[i]; output[buckets[node.level + 1]++] = node; } buckets.fill(0, shallowest, deepest + 1); return output; }; var _sortNodesByDepthFirst = (nodes, nodesLen = nodes.length) => { if (nodesLen === 2) { if (nodes[0].level < nodes[1].level) { const tmp = nodes[0]; nodes[0] = nodes[1]; nodes[1] = tmp; } return nodes; } if (nodesLen > 16) { return countingSort(nodes, nodesLen); } for (let i = 1; i < nodesLen; i++) { const value = nodes[i]; const valueLevel = value.level; let j = i - 1; if (nodes[j].level < valueLevel) { let k = i; do { nodes[k] = nodes[j]; k = j--; } while (j >= 0 && nodes[j].level < valueLevel); nodes[k] = value; } } return nodes; }; // packages/ag-grid-enterprise/src/rowHierarchy/changedPathImpl/changedCellsPath.ts var ChangedCellsPathImpl = class { constructor() { this.kind = "cells"; /** * All tracked rows, lazily sorted by depth-first when `getSortedRows` is called. * Space: O(R) where R = number of tracked rows (including ancestors). */ this.rows = []; /** * True when `rows` needs resorting, set after new tracked rows are added. * Space: O(1). */ this.unsorted = false; /** * Maps RowNode to row slot (or -1 for all-columns) and colId string to column slot. * Used also to check if a row is tracked (has a slot) in O(1). * RowNode keys never collide with string keys in a Map. * Space: O(R + C) where R = number of tracked rows (including ancestors), C = number of tracked columns. */ this.slots = /* @__PURE__ */ new Map(); /** * Bitmask array for the first 32 columns. Always present. * Space: O(R) where R = number of tracked rows (including ancestors). */ this.bits = []; /** * Extra bitmask arrays for columns 32+. `null` when C ≤ 32; `extraBits[0]` covers columns 32–63, etc. * Space: O(R × max(0, ⌈C/32⌉ − 1)) where R = number of tracked rows (including ancestors), C = number of tracked columns. */ this.extraBits = null; /** * Number of distinct column IDs added via `addCell`, used to assign column slots. * Does not include columns tracked via `addRow` (all-columns). Time: O(1). * Space: O(1). */ this.colCount = 0; } /** {@inheritDoc ChangedCellsPath.addRow} Time: O(D), D = depth. */ addRow(rowNode) { let node = rowNode; if (node == null) { return; } const slots = this.slots; if (slots.get(node) !== void 0) { while (node != null && slots.get(node) >= 0) { slots.set(node, -1); node = node.parent; } return; } const rows = this.rows; do { slots.set(node, -1); rows.push(node); node = node.parent; } while (node != null && !slots.has(node)); this.unsorted = true; } /** {@inheritDoc ChangedCellsPath.addCell} Time: O(D × ⌈C/32⌉), D = depth, C = tracked columns. */ addCell(rowNode, colId) { if (colId == null) { this.addRow(rowNode); return; } if (rowNode == null) { return; } const slots = this.slots; const bits = this.bits; const colSlot = slots.get(colId) ?? this.ensureCol(colId); let rowSlot = slots.get(rowNode); if (rowSlot === void 0) { rowSlot = this.ensureRow(rowNode); } else if (rowSlot < 0) { return; } const word = colSlot < 32 ? bits : this.extraBits[(colSlot >>> 5) - 1]; const bit = 1 << (colSlot & 31); const rowBits = word[rowSlot]; if ((rowBits & bit) !== 0) { return; } word[rowSlot] = rowBits | bit; let parent = rowNode.parent; while (parent != null) { const pSlot = slots.get(parent); if (pSlot < 0) { break; } const pBits = word[pSlot]; if ((pBits & bit) !== 0) { break; } word[pSlot] = pBits | bit; parent = parent.parent; } } /** {@inheritDoc ChangedCellsPath.hasRow} Time: O(1). */ hasRow(rowNode) { return this.slots.has(rowNode); } /** {@inheritDoc ChangedCellsPath.getSortedRows} Time: O(1) cached, O(R) if sort was invalidated. */ getSortedRows() { if (!this.unsorted) { return this.rows; } this.unsorted = false; const rows = _sortNodesByDepthFirst(this.rows); this.rows = rows; return rows; } /** {@inheritDoc ChangedCellsPath.getSlot} Read-only — does not allocate slots. Time: O(1). */ getSlot(key) { return this.slots.get(key) ?? -1; } /** {@inheritDoc ChangedCellsPath.hasCellBySlot} Time: O(1). */ hasCellBySlot(rowSlot, colSlot) { if (rowSlot < 0) { return true; } if (colSlot < 32) { return colSlot >= 0 && (this.bits[rowSlot] & 1 << colSlot) !== 0; } return (this.extraBits[(colSlot >>> 5) - 1][rowSlot] & 1 << (colSlot & 31)) !== 0; } /** Registers a new row and all its unregistered ancestors. Returns the row's bitmask index. * Time: O(D × ⌈C/32⌉) where D = depth, C = number of tracked columns. In practice O(D) because * C < 32 is the common case (single bitmask word per row, no extraBits loop). * Space: O(D × ⌈C/32⌉). */ ensureRow(rowNode) { const slots = this.slots; const rows = this.rows; const bits = this.bits; const extraBits = this.extraBits; let nextSlot = bits.push(0); const originSlot = nextSlot - 1; if (extraBits !== null) { for (let w = 0, len = extraBits.length; w < len; ++w) { extraBits[w].push(0); } } slots.set(rowNode, originSlot); rows.push(rowNode); this.unsorted = true; let p = rowNode.parent; while (p != null && !slots.has(p)) { slots.set(p, nextSlot); rows.push(p); nextSlot = bits.push(0); if (extraBits !== null) { for (let w = 0, len = extraBits.length; w < len; ++w) { extraBits[w].push(0); } } p = p.parent; } return originSlot; } /** * Assigns a new column slot. Appends a bitmask array when crossing a 32-column boundary. * Time: O(1) amortised, O(R) when crossing a 32-column boundary, where R = number of tracked rows (including ancestors) due to array extension and copying. * Space: O(R) when crossing a 32-column boundary. */ ensureCol(colId) { const colSlot = this.colCount++; this.slots.set(colId, colSlot); if (colSlot >= 32) { const extraBitsIndex = (colSlot >>> 5) - 1; let extraBits = this.extraBits; if (extraBits === null) { extraBits = []; this.extraBits = extraBits; } if (extraBitsIndex >= extraBits.length) { extraBits.push(new Array(this.bits.length).fill(0)); } } return colSlot; } }; // packages/ag-grid-enterprise/src/rowHierarchy/changedPathImpl/changedRowsPath.ts var ChangedRowsPathImpl = class { constructor() { this.kind = "rows"; /** * All tracked rows, lazily sorted by depth-first when `getSortedRows` is called. * Space: O(R) where R = number of tracked rows (including ancestors). */ this.rows = []; /** * True when `rows` needs resorting, set after new tracked rows are added. * Space: O(1). */ this.unsorted = false; /** * Hash set that keeps track of which rows are in `rows` for O(1) lookup. * Space: O(R) where R = number of tracked rows (including ancestors). */ this.rowSet = /* @__PURE__ */ new Set(); } /** {@inheritDoc ChangedRowsPath.addRow} Time: O(D), D = depth. */ addRow(rowNode) { let node = rowNode; if (node == null) { return; } const rowSet = this.rowSet; if (rowSet.has(node)) { return; } const rows = this.rows; do { rowSet.add(node); rows.push(node); node = node.parent; } while (node != null && !rowSet.has(node)); this.unsorted = true; } /** {@inheritDoc ChangedRowsPath.addCell} */ addCell(rowNode, _colId) { this.addRow(rowNode); } /** {@inheritDoc ChangedRowsPath.hasRow} Time: O(1). */ hasRow(rowNode) { return this.rowSet.has(rowNode); } /** {@inheritDoc ChangedRowsPath.getSortedRows} Time: O(1) cached, O(R) if sort was invalidated. */ getSortedRows() { if (!this.unsorted) { return this.rows; } this.unsorted = false; const rows = _sortNodesByDepthFirst(this.rows); this.rows = rows; return rows; } }; // packages/ag-grid-enterprise/src/rowHierarchy/changedPathImpl/changedPathFactory.ts var ChangedPathFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "changedPathFactory"; } /** {@inheritDoc IChangedPathFactory.newPath} */ newPath(trackCells) { return trackCells ? new ChangedCellsPathImpl() : new ChangedRowsPathImpl(); } /** {@inheritDoc IChangedPathFactory.ensureRowsPath} */ ensureRowsPath(params) { let changedPath = params.changedPath; if (!changedPath && params.changedRowNodes && !params.newData) { const rowModel = this.beans.rowModel; if (rowModel.hierarchical) { changedPath = new ChangedRowsPathImpl(); params.changedPath = changedPath; changedPath.addRow(rowModel.rootNode); } } return changedPath; } }; // packages/ag-grid-enterprise/src/rowHierarchy/baseExpansionService.ts var BaseExpansionService = class extends BeanStub { addExpandedCss(classes, rowNode) { if (rowNode.isExpandable()) { classes.push("ag-row-group"); classes.push(rowNode.expanded ? "ag-row-group-expanded" : "ag-row-group-contracted"); } } getRowExpandedListeners(rowCtrl) { const { rowNode } = rowCtrl; const updateExpandedCss = this.updateExpandedCss.bind(this, rowCtrl, rowNode); return { expandedChanged: updateExpandedCss, hasChildrenChanged: updateExpandedCss }; } setExpanded(rowNode, expanded, e, forceSync) { if (rowNode.expanded === expanded) { return; } rowNode._expanded = expanded; rowNode.dispatchRowEvent("expandedChanged"); const event = { ..._createGlobalRowEvent(rowNode, this.gos, "rowGroupOpened"), expanded, event: e || null }; this.dispatchExpandedEvent(event, forceSync); } defaultExpanded(rowNode) { const beans = this.beans; const gos = beans.gos; const level = rowNode.level ?? 0; const isGroupOpenByDefault = rowNode.group && gos.get("isGroupOpenByDefault"); if (!isGroupOpenByDefault) { const groupDefaultExpanded = gos.get("groupDefaultExpanded"); return groupDefaultExpanded === -1 || level < groupDefaultExpanded; } const params = _addGridCommonParams(gos, { rowNode, field: rowNode.field, key: rowNode.key, level, rowGroupColumn: rowNode.rowGroupColumn }); return !!isGroupOpenByDefault(params); } isExpandable(rowNode) { if (rowNode.footer) { return false; } if (this.beans.colModel.isPivotMode()) { return rowNode.hasChildren() && !rowNode.leafGroup; } return rowNode.hasChildren() || rowNode.master; } updateExpandedCss(rowCtrl, rowNode) { const expandable = rowNode.isExpandable(); const expanded = rowNode.expanded == true; rowCtrl.forEachGui(void 0, (gui) => { const rowComp = gui.rowComp; rowComp.toggleCss("ag-row-group", expandable); rowComp.toggleCss("ag-row-group-expanded", expandable && expanded); rowComp.toggleCss("ag-row-group-contracted", expandable && !expanded); _setAriaExpanded(gui.element, expandable && expanded); }); } dispatchStateUpdatedEvent() { this.eventSvc.dispatchEvent({ type: "rowExpansionStateChanged" }); } }; // packages/ag-grid-enterprise/src/rowHierarchy/clientSideExpansionService.ts var ClientSideExpansionService = class extends BaseExpansionService { constructor() { super(...arguments); this.beanName = "expansionSvc"; this.events = null; this.dispatchExpandedDebounced = null; } destroy() { super.destroy(); this.events = null; this.dispatchExpandedDebounced = null; } setExpansionState(state) { const rowIdsToExpandSet = new Set(state.expandedRowGroupIds); this.beans.rowModel.forEachNode((node) => { const id = node.id; if (!id) { return; } node._expanded = rowIdsToExpandSet.has(id); }); this.onGroupExpandedOrCollapsed(); } getInternalExpansionState(allowCollapsed = false) { const expandedRowGroupIds = []; const collapsedRowGroupIds = []; this.beans.rowModel.forEachNode((node) => { const id = node.id; if (!id) { return; } if (node.expanded) { expandedRowGroupIds.push(id); } else if (allowCollapsed && node.isExpandable()) { collapsedRowGroupIds.push(id); } }); return { expandedRowGroupIds, collapsedRowGroupIds }; } getExpansionState() { return this.getInternalExpansionState(); } isExpanded(rowNode) { if (rowNode.footer) { return !!rowNode._expanded; } if (!(rowNode.group || rowNode.master) || rowNode.leafGroup && this.beans.colModel.isPivotMode()) { return false; } let value = rowNode._expanded; if (value === null) { value = this.defaultExpanded(rowNode) ?? false; rowNode._expanded = value; } return !!value; } resetExpansion() { const { rowModel } = this.beans; rowModel.forEachNode((node) => { if (!node.group && !node.master) { return; } node._expanded = null; }); this.onGroupExpandedOrCollapsed(); } expandAll(expand) { const { gos, rowModel, colModel, eventSvc } = this.beans; const usingTreeData = gos.get("treeData"); const usingPivotMode = colModel.isPivotActive(); const recursiveExpandOrCollapse = (rowNodes) => { if (!rowNodes) { return; } for (const rowNode of rowNodes) { const actionRow = () => { rowNode._expanded = expand; recursiveExpandOrCollapse(rowNode.childrenAfterGroup); }; if (rowNode.master) { actionRow(); continue; } if (usingTreeData) { const hasChildren = _exists(rowNode.childrenAfterGroup); if (hasChildren) { actionRow(); } continue; } if (usingPivotMode) { const notLeafGroup = !rowNode.leafGroup; if (notLeafGroup) { actionRow(); } continue; } const isRowGroup = rowNode.group; if (isRowGroup) { actionRow(); } } }; const rootNode = rowModel.rootNode; if (rootNode) { recursiveExpandOrCollapse(rootNode.childrenAfterGroup); } this.onGroupExpandedOrCollapsed(); eventSvc.dispatchEvent({ type: "expandOrCollapseAll", source: expand ? "expandAll" : "collapseAll" }); } onGroupExpandedOrCollapsed() { this.dispatchStateUpdatedEvent(); this.beans.rowModel.reMapRows(); } setDetailsExpansionState(detailGridApi) { const expansionState = this.getInternalExpansionState(true); const allExpanded = expansionState.collapsedRowGroupIds.length === 0; const allCollapsed = expansionState.expandedRowGroupIds.length === 0; if (allCollapsed === allExpanded) { return; } return allExpanded ? detailGridApi.expandAll() : detailGridApi.collapseAll(); } /** * because the user can call rowNode.setExpanded() many times in one VM turn, * we throttle the calls to ClientSideRowModel using animationFrameSvc. this means for 100 * row nodes getting expanded, we only update the CSRM once, and then we fire all events after * CSRM has updated. * * if we did not do this, then the user could call setExpanded on 100+ rows, causing the grid * to re-render 100+ times, which would be a performance lag. * * we use animationFrameService * rather than debounce() so this will get done if anyone flushes the animationFrameService * (eg user calls api.ensureRowVisible(), which in turn flushes ). */ dispatchExpandedEvent(event, forceSync) { (this.events ?? (this.events = [])).push(event); if (forceSync) { this.dispatchExpandedEvents(); return; } let dispatch = this.dispatchExpandedDebounced; if (!dispatch) { if (!this.isAlive()) { return; } dispatch = this.debounce(() => this.dispatchExpandedEvents()); this.dispatchExpandedDebounced = dispatch; } dispatch(); } dispatchExpandedEvents() { const { eventSvc, rowRenderer } = this.beans; const eventsToDispatch = this.events; const eventsLen = eventsToDispatch?.length; if (!eventsLen) { return; } this.events = null; const rowNodes = new Array(eventsLen); for (let i = 0; i < eventsLen; ++i) { rowNodes[i] = eventsToDispatch[i].node; eventSvc.dispatchEvent(eventsToDispatch[i]); } this.dispatchStateUpdatedEvent(); rowRenderer.refreshCells({ rowNodes }); } // the advantage over normal debounce is the client can call flushAllFrames() // to make sure all rendering is complete. we don't wait any milliseconds, // as this is intended to batch calls in one VM turn. debounce(func) { const animationFrameSvc = this.beans.animationFrameSvc; if (!animationFrameSvc) { return () => window.setTimeout(func, 0); } let pending = false; return () => { if (!animationFrameSvc.active) { window.setTimeout(func, 0); return; } if (pending) { return; } pending = true; animationFrameSvc.addDestroyTask(() => { pending = false; func(); }); }; } }; // packages/ag-grid-enterprise/src/rowHierarchy/flattenUtils.ts function _getFlattenDetails(gos) { let groupHideParentOfSingleChild = gos.get("groupHideParentOfSingleChild"); if (!groupHideParentOfSingleChild) { groupHideParentOfSingleChild = gos.get("groupRemoveSingleChildren"); if (!groupHideParentOfSingleChild && gos.get("groupRemoveLowestSingleChildren")) { groupHideParentOfSingleChild = "leafGroupsOnly"; } } return { groupHideParentOfSingleChild, isGroupMultiAutoColumn: _isGroupMultiAutoColumn(gos), hideOpenParents: gos.get("groupHideOpenParents"), grandTotalRow: _getGrandTotalRow(gos), groupTotalRow: _getGroupTotalRowCallback(gos) }; } function _isRemovedSingleChildrenGroup(details, rowNode, isParent) { return details.groupHideParentOfSingleChild === true && isParent && rowNode.childrenAfterGroup.length === 1; } function _isRemovedLowestSingleChildrenGroup(details, rowNode, isParent) { return details.groupHideParentOfSingleChild === "leafGroupsOnly" && isParent && rowNode.leafGroup && rowNode.childrenAfterGroup.length === 1; } function _shouldRowBeRendered(details, rowNode, isParent, skipLeafNodes, isRemovedSingleChildrenGroup, isRemovedLowestSingleChildrenGroup) { if (skipLeafNodes && !isParent) { return false; } if (isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup) { return false; } if (!details.hideOpenParents) { return true; } if (rowNode.master || rowNode.level === -1) { return true; } const neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; if (!neverAllowToExpand && rowNode.expanded) { return false; } return true; } // packages/ag-grid-enterprise/src/rowHierarchy/flattenStage.ts var FlattenStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "flattenStage"; this.step = "map"; this.refreshProps = [ "groupHideParentOfSingleChild", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupTotalRow", "masterDetail" ]; } execute() { const { beans, gos } = this; const result = []; const rootNode = beans.rowModel.rootNode; if (!rootNode) { return result; } const skipLeafNodes = beans.colModel.isPivotMode(); const showRootNode = skipLeafNodes && rootNode.leafGroup && rootNode.aggData; const topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort; const details = _getFlattenDetails(gos); this.recursivelyAddToRowsToDisplay(details, topList, result, skipLeafNodes, 0); const atLeastOneRowPresent = result.length > 0; const grandTotalRow = details.grandTotalRow; const includeGrandTotalRow = !showRootNode && // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups) atLeastOneRowPresent && grandTotalRow; if (includeGrandTotalRow) { _createRowNodeFooter(rootNode, beans); if (grandTotalRow === "pinnedBottom" || grandTotalRow === "pinnedTop") { this.beans.pinnedRowModel?.setGrandTotalPinned(grandTotalRow === "pinnedBottom" ? "bottom" : "top"); } else { const addToTop = grandTotalRow === "top"; this.addRowNodeToRowsToDisplay(details, rootNode.sibling, result, 0, addToTop); } } return result; } recursivelyAddToRowsToDisplay(details, rowsToFlatten, result, skipLeafNodes, uiLevel) { if (!rowsToFlatten?.length) { return; } const masterDetailSvc = this.beans.masterDetailSvc; for (let i = 0; i < rowsToFlatten.length; i++) { const rowNode = rowsToFlatten[i]; const isParent = rowNode.hasChildren(); const isRemovedSingleChildrenGroup = _isRemovedSingleChildrenGroup(details, rowNode, isParent); const isRemovedLowestSingleChildrenGroup = _isRemovedLowestSingleChildrenGroup(details, rowNode, isParent); const thisRowShouldBeRendered = _shouldRowBeRendered( details, rowNode, isParent, skipLeafNodes, isRemovedSingleChildrenGroup, isRemovedLowestSingleChildrenGroup ); if (thisRowShouldBeRendered) { this.addRowNodeToRowsToDisplay(details, rowNode, result, uiLevel); } if (skipLeafNodes && rowNode.leafGroup) { continue; } if (isParent) { const excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup; if (rowNode.expanded || excludedParent) { const doesRowShowFooter = details.groupTotalRow({ node: rowNode }); if (!doesRowShowFooter) { _destroyRowNodeFooter(rowNode); } const uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1; if (doesRowShowFooter === "top") { _createRowNodeFooter(rowNode, this.beans); this.addRowNodeToRowsToDisplay(details, rowNode.sibling, result, uiLevelForChildren); } const detailNode = masterDetailSvc?.getDetail(rowNode); if (detailNode) { this.addRowNodeToRowsToDisplay(details, detailNode, result, uiLevel); } this.recursivelyAddToRowsToDisplay( details, rowNode.childrenAfterSort, result, skipLeafNodes, uiLevelForChildren ); if (doesRowShowFooter === "bottom") { _createRowNodeFooter(rowNode, this.beans); this.addRowNodeToRowsToDisplay(details, rowNode.sibling, result, uiLevelForChildren); } } } else { const detailNode = masterDetailSvc?.getDetail(rowNode); if (detailNode) { this.addRowNodeToRowsToDisplay(details, detailNode, result, uiLevel); } } } } // duplicated method, it's also in floatingRowModel addRowNodeToRowsToDisplay(details, rowNode, result, uiLevel, addToTop) { if (addToTop) { result.unshift(rowNode); } else { result.push(rowNode); } rowNode.setUiLevel(details.isGroupMultiAutoColumn ? 0 : uiLevel); } }; // packages/ag-grid-enterprise/src/rowHierarchy/groupEditService.ts var GroupEditService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "groupEditSvc"; this.pendingEditRefresh = null; this.dropGroupTarget = null; this.dropGroupTimer = null; this.dropGroupThrottled = false; this.draggingGroups = null; } postConstruct() { if (_isClientSideRowModel(this.gos)) { this.addManagedListeners(this.eventSvc, { cellValueChanged: (event) => this.onCsrmCellChange(event), batchEditingStopped: () => this.flushGroupEdits() }); } } destroy() { this.stopDragging(true); super.destroy(); } /** Checks if the drop operation described by `rowsDrop` is a grouping edit */ isGroupingDrop(rowsDrop) { if (!rowsDrop.rowDragManaged || !rowsDrop.sameGrid) { return false; } if (!this.gos.get("refreshAfterGroupEdit")) { return false; } return !!this.beans.rowGroupColsSvc?.columns?.length && !this.beans.colModel.isPivotMode(); } initDraggingGroups(rowsDrop) { const structure = /* @__PURE__ */ new Map(); const recurse = (row) => { const childrenAfterGroup = row.childrenAfterGroup; if (childrenAfterGroup) { if (structure.has(row)) { return; } const children = childrenAfterGroup.slice(); structure.set(row, children); for (const child of children) { recurse(child); } } }; for (const row of rowsDrop.rows) { if (row.group) { recurse(row); } } this.draggingGroups = structure; } /** Checks if the drop operation described by `rowsDrop` can set a new parent */ canSetParent(rowsDrop) { if (!rowsDrop.sameGrid) { return false; } if (this.beans.groupStage?.treeData) { return true; } if (rowsDrop.rowDragManaged && !this.gos.get("refreshAfterGroupEdit")) { return false; } return !!this.beans.rowGroupColsSvc?.columns?.length; } canDropRow(rowNode, rowsDrop) { if (this.beans.groupStage?.treeData) { return !wouldCycle(rowNode, rowsDrop.newParent); } const { position, target, newParent, rootNode } = rowsDrop; const currentParent = rowNode.parent; if (rowNode.group && (isAncestorOrSelf(rowNode, target) || isAncestorOrSelf(rowNode, newParent))) { return false; } if (position === "inside") { return true; } if (newParent && newParent !== currentParent) { return newParent !== rootNode || currentParent === rootNode; } const comparisonParent = newParent ?? target?.parent ?? rootNode; if (comparisonParent !== currentParent) { return false; } const sourceLevel = rowNode.group ? rowNode.level : currentParent.level ?? -1; let targetLevel = -1; if (target) { targetLevel = target.group ? target.level : target.parent?.level ?? -1; } else if (comparisonParent) { targetLevel = comparisonParent.level; } if (sourceLevel >= 0 && targetLevel >= 0 && targetLevel !== sourceLevel) { return false; } return true; } fixRowsDrop(rowsDrop, canSetParent, fromNudge, yDelta) { const treeData = !!this.beans.groupStage?.treeData; rowsDrop.treeData = treeData; const isRowGrouping = !!this.beans.rowGroupColsSvc?.columns?.length || this.gos.get("pivotMode"); if (!isRowGrouping && !treeData) { return; } if (!this.draggingGroups && this.isGroupingDrop(rowsDrop) && !rowsDrop.suppressMoveWhenRowDragging) { this.initDraggingGroups(rowsDrop); } let target = rowsDrop.target; let newParent = null; let inside = false; const rootNode = rowsDrop.rootNode; const rowModel = this.beans.rowModel; const canStartGroup = this.canStartGroup(target, treeData); this.updateDropTarget(rowsDrop, fromNudge, canStartGroup); const lastRowIndex = this.beans.pageBounds?.getLastRow?.() ?? rowModel.getRowCount() - 1; if (canSetParent) { if (!target || yDelta >= 0.5 && target.rowIndex === lastRowIndex) { newParent = rootNode; } else if (rowsDrop.moved && target && this.dropGroupThrottled && this.shouldDropTargetBeParent(rowsDrop)) { newParent = target; } if (!newParent) { newParent = target?.parent ?? rootNode; } } if (!fromNudge && target && canStartGroup && !(target.group && target.expanded)) { this.startDropGroupDelay(target); } if (newParent) { if (target && newParent === target && newParent !== rootNode) { const firstRow = newParent.expanded ? _prevOrNextDisplayedRow(rowModel, 1, target) : null; if (firstRow?.parent === newParent) { target = firstRow; yDelta = -0.5; } else { inside = true; } } if (target && !inside) { let current = target; while (current && current !== rootNode && current !== newParent) { target = current; current = current.parent; } } } rowsDrop.target = target; rowsDrop.newParent = newParent; rowsDrop.yDelta = yDelta; rowsDrop.inside = inside; } clearNewSameParent(rowsDrop, canSetParent) { const newParent = rowsDrop.newParent; if (newParent && (!canSetParent || rowsHaveSameParent(rowsDrop.rows, newParent))) { rowsDrop.newParent = null; } } updateDropTarget(rowsDrop, fromNudge, canStartGroup) { const target = canStartGroup ? rowsDrop.target : null; if (this.dropGroupTarget && this.dropGroupTarget !== target) { this.resetDragGroup(); } if (!target?.childrenAfterSort?.length) { return; } if (fromNudge && this.dropGroupThrottled && !target.expanded && target.isExpandable?.()) { target.setExpanded(true, void 0, true); } if (this.canDropInTarget(target, rowsDrop)) { this.dropGroupThrottled = true; this.dropGroupTarget = target; } } canDropInTarget(target, rowsDrop) { if (target.expanded) { return true; } if (!target.group) { return false; } if (rowsDrop.pointerPos === "inside") { return true; } if (rowsDrop.treeData) { return false; } const rows = rowsDrop.rows; const targetLevel = target.level; for (let i = 0, len = rows.length; i < len; ++i) { const row = rows[i]; if (row !== target && row.group && row.level !== targetLevel) { return false; } } return true; } startDropGroupDelay(target) { if (this.dropGroupTarget && this.dropGroupTarget !== target) { this.resetDragGroup(); } this.dropGroupTarget = target; if (this.dropGroupTimer !== null) { return; } const delay = this.gos.get("rowDragInsertDelay"); this.dropGroupTimer = window.setTimeout(() => { this.dropGroupTimer = null; this.dropGroupThrottled = true; this.beans.dragAndDrop?.nudge(); }, delay); } resetDragGroup() { if (this.dropGroupTimer !== null) { window.clearTimeout(this.dropGroupTimer); this.dropGroupTimer = null; } this.dropGroupTarget = null; this.dropGroupThrottled = false; } stopDragging(final) { if (final) { this.draggingGroups = null; } this.resetDragGroup(); } shouldDropTargetBeParent({ target, rows, pointerPos, treeData }) { if (!target || pointerPos === "none") { return false; } if (pointerPos === "inside") { return true; } if (!treeData && target.group && !target.expanded) { return true; } if (pointerPos === "above") { return false; } const rowModel = this.beans.rowModel; const targetRowIndex = target.rowIndex; let nextRowIndex = targetRowIndex + 1; let nextRow; do { nextRow = rowModel.getRow(nextRowIndex++); } while (nextRow?.footer); const childrenAfterGroup = this.draggingGroups?.get(target) ?? target.childrenAfterGroup; if (nextRow && nextRow.parent === target && childrenAfterGroup?.length) { const rowsSet = new Set(rows); for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) { const child = childrenAfterGroup[i]; if (child.rowIndex !== null && !rowsSet.has(child)) { return true; } } } return false; } /** Performs the grouping edit described by `rowsDrop` */ dropGroupEdit(rowsDrop) { const { beans } = this; const position = rowsDrop.position; const target = rowsDrop.target ?? null; const rootNode = rowsDrop.rootNode; const parentForValues = rowsDrop.newParent ?? target?.parent ?? rootNode; const focusSvc = beans.focusSvc; const cellPosition = focusSvc.getFocusedCell(); const cellCtrl = cellPosition && _getCellByPosition(beans, cellPosition); const leafs = /* @__PURE__ */ new Set(); const changedRowNodes = new ChangedRowNodes(); const updates = changedRowNodes.updates; let newGroupValues; const processLeaf = (leafRow) => { if (leafs.has(leafRow)) { return; } leafs.add(leafRow); newGroupValues ?? (newGroupValues = this.newGroupValues(parentForValues)); if (this.setRowGroup(leafRow, newGroupValues)) { updates.add(leafRow); } }; const visitGroupedChildren = (groupNode) => { const children = this.draggingGroups?.get(groupNode) ?? groupNode.childrenAfterGroup; const childrenLen = children?.length; if (childrenLen) { for (let i = 0; i < childrenLen; ++i) { const child = children[i]; if (child.sourceRowIndex >= 0) { processLeaf(child); } else { visitGroupedChildren(child); } } } }; for (const row of rowsDrop.rows) { if (row.group) { visitGroupedChildren(row); } else { const firstLeaf = row.sourceRowIndex >= 0 && !row.destroyed ? row : this.csrmFirstLeaf(row); if (firstLeaf) { processLeaf(firstLeaf); } } } const reorderPosition = position === "inside" ? "above" : position; const reorderTarget = position === "inside" ? this.findFirstLeafForParent(parentForValues, leafs) ?? target : target; let orderChanged = false; if (leafs.size && reorderPosition !== "none") { orderChanged = _csrmReorderAllLeafs(rootNode._leafs, leafs, reorderTarget, reorderPosition === "above"); } if (!updates.size && !orderChanged) { return false; } changedRowNodes.reordered = orderChanged; for (const leaf of leafs) { changedRowNodes.updates.add(leaf); } this.csrmRefresh(changedRowNodes); if (cellCtrl) { cellCtrl.focusCell(); } else { focusSvc.clearFocusedCell(); } return true; } canStartGroup(target, treeData) { if (!target || target.level < 0 || target.footer || target.detail) { return false; } if (target.group) { return true; } return treeData; } /** Flushes any pending group edits for batch processing */ flushGroupEdits() { const pending = this.pendingEditRefresh; if (pending) { this.pendingEditRefresh = null; this.csrmRefresh(pending); } } /** Refreshes the grouping for the provided rows */ csrmRefresh(changedRowNodes) { const clientSideRowModel = this.beans.rowModel; const rootNode = clientSideRowModel.rootNode; if (!rootNode) { return; } clientSideRowModel.refreshModel({ step: "group", keepRenderedRows: true, animate: !this.gos.get("suppressAnimationFrame"), changedRowNodes }); } newGroupValues(parent) { const columns = this.beans.rowGroupColsSvc?.columns ?? []; const values = new Array(columns.length); let maxLevel = -1; let current = parent; while (current && current.level >= 0) { const column = columns[current.level]; if (column) { const colId = column.getColId(); const level = current.level; values[level] = current.groupData?.[colId] ?? current.key ?? void 0; if (level > maxLevel) { maxLevel = level; } } current = current.parent; } return { values, columns, maxLevel }; } setRowGroup(row, { values, columns, maxLevel }) { if (maxLevel < 0) { return false; } const { valueSvc, changeDetectionSvc } = this.beans; let changed = false; changeDetectionSvc?.beginDeferred(); try { for (let level = 0; level < columns.length; ++level) { const column = columns[level]; if (!column || level > maxLevel) { continue; } const newValue = values[level]; const currentValue = valueSvc.getValue(column, row, "data"); if (currentValue === newValue || currentValue == null && newValue == null) { continue; } let valueToSet = newValue; const parsedValue = valueSvc.parseValue(column, row, newValue, currentValue); if (parsedValue !== void 0) { valueToSet = parsedValue; } const updated = row.setDataValue(column, valueToSet, "rowDrag"); if (updated) { changed = true; } } } finally { changeDetectionSvc?.endDeferred(); } return changed; } onCsrmCellChange(event) { const { column, node, source } = event; if (!this.gos.get("refreshAfterGroupEdit")) { return; } if (source === "rowDrag") { return; } if (!column?.isRowGroupActive()) { return; } if (node.group || !node.data) { return; } const editSvc = this.beans.editSvc; if (editSvc?.isBatchEditing()) { let pending = this.pendingEditRefresh; if (!pending) { pending = newEditChangedRowNodes(); this.pendingEditRefresh = pending; } pending.updates.add(node); } else { const changedRowNodes = newEditChangedRowNodes(); changedRowNodes.updates.add(node); this.csrmRefresh(changedRowNodes); } } csrmFirstLeaf(parent) { if (!parent) { return null; } const draggingGroups = this.draggingGroups; let children = draggingGroups?.get(parent) ?? parent.childrenAfterGroup; while (children?.length) { const child = children[0]; if (child.sourceRowIndex >= 0) { if (!child.destroyed) { return child; } return this.firstAliveChildLeaf(child); } children = draggingGroups?.get(child) ?? child.childrenAfterGroup; } return _csrmFirstLeaf(parent); } firstAliveChildLeaf(parent) { const children = this.draggingGroups?.get(parent) ?? parent.childrenAfterGroup; if (children) { for (const grandChild of children) { if (grandChild.sourceRowIndex >= 0 && !grandChild.destroyed) { return grandChild; } } } return null; } findFirstLeafForParent(parent, exclude) { if (!parent) { return null; } const children = this.draggingGroups?.get(parent) ?? parent?.childrenAfterGroup; if (!children) { return null; } for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; if (child.sourceRowIndex >= 0 && !exclude.has(child)) { return child; } const found = this.findFirstLeafForParent(child, exclude); if (found !== null) { return found; } } return null; } }; var newEditChangedRowNodes = () => { const result = new ChangedRowNodes(); result.reordered = true; return result; }; var isAncestorOrSelf = (candidate, node) => { if (!candidate || !node) { return false; } let current = node; while (current) { if (current === candidate) { return true; } current = current.parent; } return false; }; var wouldCycle = (row, newParent) => { if (!newParent || row.parent === newParent) { return false; } let current = newParent; const rowId = row.id; while (current) { if (current === row) { return true; } if (rowId != null && current.id === rowId) { return true; } current = current.parent; } return false; }; var rowsHaveSameParent = (rows, newParent) => { for (let i = 0, len = rows.length; i < len; ++i) { if (rows[i].parent !== newParent) { return false; } } return true; }; // packages/ag-grid-enterprise/src/rowHierarchy/groupStage.ts var GroupStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "groupStage"; this.step = "group"; this.refreshProps = [ "groupAllowUnbalanced", "groupDefaultExpanded", "groupDisplayType", "groupHideOpenParents", "initialGroupOrderComparator", "treeData", "treeDataChildrenField", "treeDataParentIdField" ]; this.treeData = false; this.grouping = false; this.gosTreeData = false; this.pivotMode = false; this.hasTreeData = false; this.hasRowGrouping = false; this.needReset = false; this.nested = false; this.strategy = void 0; this.strategyType = void 0; this.columnsInvalidated = false; } postConstruct() { const gos = this.gos; this.hasRowGrouping = gos.isModuleRegistered("RowGrouping"); if (gos.isModuleRegistered("TreeData")) { this.hasTreeData = true; this.gosTreeData = gos.get("treeData"); } this.addManagedEventListeners({ showRowGroupColsSetChanged: () => this.strategy?.onShowRowGroupColsSetChanged() }); } invalidateGroupCols() { this.columnsInvalidated = true; this.strategy?.invalidateGroupCols?.(); } destroy() { this.strategy = this.destroyBean(this.strategy); super.destroy(); } getNonLeaf(id) { return this.strategy?.nonLeafsById?.get(id); } getNestedDataGetter() { return this.getStrategy()?.nestedDataGetter; } onPropChange(changedProps) { const gos = this.gos; const oldNestedDataGetter = this.strategy?.nestedDataGetter; if (changedProps.has("treeData")) { this.gosTreeData = gos.get("treeData") && this.hasTreeData; this.columnsInvalidated = true; } this.strategy?.onPropChange?.(changedProps); return this.getNestedDataGetter() !== oldNestedDataGetter; } extractData() { const rootNode = this.beans.rowModel.rootNode; const nodes = this.nested ? rootNode?.childrenAfterGroup : rootNode?._leafs; if (!nodes) { return this.gos.get("rowData") ?? []; } const len = nodes.length; const result = new Array(len); let writeIdx = 0; for (let i = 0; i < len; ++i) { const data = nodes[i].data; if (data != null) { result[writeIdx++] = data; } } result.length = writeIdx; return result; } execute(params) { const beans = this.beans; const rowModel = beans.rowModel; const rootNode = rowModel.rootNode; if (!rootNode) { return false; } const strategy = this.getStrategy(); const nested = !!strategy?.nestedDataGetter; const needReset = this.needReset; this.nested = nested; if (needReset) { this.needReset = false; beans.rowDragSvc?.cancelRowDrag(); params.animate = false; resetGrouping(rootNode, !nested, beans); } if (!strategy) { rowModel.hierarchical = false; return void 0; } rowModel.hierarchical = true; beans.changedPathFactory?.ensureRowsPath(params, rootNode); const executeResult = strategy.execute(rootNode, params); return executeResult || needReset; } loadLeafs(node) { return node.footer ? loadFooterLeafs(node) : loadRealLeafs(node); } loadGroupData(node) { const strategy = this.getStrategy(); if (strategy) { return strategy.loadGroupData(node); } node._groupData = null; return null; } clearNonLeafs() { this.strategy?.clearNonLeafs(); } getWantedStrategyType() { if (this.isAlive()) { if (this.gosTreeData) { return "tree"; } if (this.hasRowGrouping && (this.beans.rowGroupColsSvc?.columns?.length || this.pivotMode)) { return "group"; } } return "none"; } getStrategy() { let strategy = this.strategy; const pivotMode = this.beans.colModel.isPivotMode(); if (pivotMode !== this.pivotMode) { this.pivotMode = pivotMode; this.columnsInvalidated = true; } if (strategy !== void 0 && !this.columnsInvalidated && this.isAlive()) { return strategy; } this.columnsInvalidated = false; const wantedType = this.getWantedStrategyType(); if (wantedType === this.strategyType) { if (strategy !== void 0) { return strategy; } this.strategy = null; return null; } if (strategy) { this.strategy = this.destroyBean(strategy); this.needReset = true; } this.strategyType = wantedType; this.treeData = wantedType === "tree"; this.grouping = wantedType === "group"; if (wantedType === "none") { this.strategy = null; return null; } const beanName = wantedType === "tree" ? "treeGroupStrategy" : "groupStrategy"; strategy = this.beans.registry.createDynamicBean(beanName, false) ?? null; this.strategy = strategy && this.createBean(strategy); return strategy; } }; var loadFooterLeafs = (node) => { const sibling = node.sibling; if (!sibling) { return null; } const siblingLeafs = sibling._leafs; if (siblingLeafs !== void 0) { return siblingLeafs; } return loadRealLeafs(sibling); }; var loadRealLeafs = (node) => { const childrenAfterGroup = node.childrenAfterGroup; const childrenAfterGroupLen = childrenAfterGroup?.length; node._leafs = null; if (!childrenAfterGroupLen) { return null; } let leafs; const onlyChild = childrenAfterGroupLen === 1 ? childrenAfterGroup[0] : null; if (onlyChild?.group && onlyChild.sourceRowIndex < 0) { leafs = onlyChild._leafs; if (leafs === void 0) { leafs = loadRealLeafs(onlyChild); } } else if (node.leafGroup) { leafs = childrenAfterGroup; } else { leafs = []; for (let i = 0; i < childrenAfterGroupLen; ++i) { const child = childrenAfterGroup[i]; if (child.sourceRowIndex >= 0) { leafs.push(child); } if (!child.group) { continue; } let childLeafs = child._leafs; if (childLeafs === void 0) { childLeafs = loadRealLeafs(child); } if (childLeafs) { for (let j = 0, len = childLeafs.length; j < len; ++j) { leafs.push(childLeafs[j]); } } } } node._leafs = leafs; return leafs; }; var resetGrouping = (rootNode, canResetTreeNode, beans) => { const allLeafs = rootNode._leafs; const rootSibling = rootNode.sibling; rootNode.treeNodeFlags = 0; rootNode.childrenAfterGroup = allLeafs; rootNode.childrenMapped = null; rootNode._groupData = void 0; rootNode.aggData = null; if (rootSibling) { rootSibling.childrenAfterGroup = rootNode.childrenAfterGroup; rootSibling.childrenAfterAggFilter = rootNode.childrenAfterAggFilter; rootSibling.childrenAfterFilter = rootNode.childrenAfterFilter; rootSibling.childrenAfterSort = rootNode.childrenAfterSort; rootSibling.childrenMapped = null; rootSibling._groupData = void 0; rootSibling.aggData = null; } for (let i = 0, allLeafsLen = allLeafs.length ?? 0; i < allLeafsLen; ++i) { const row = allLeafs[i]; const sibling = row.sibling; row._leafs = void 0; resetChildRowGrouping(row); if (sibling) { resetChildRowGrouping(sibling); } row.parent = rootNode; if (canResetTreeNode) { row.treeParent = null; } setRowNodeGroup(row, beans, false); } rootNode.updateHasChildren(); }; var resetChildRowGrouping = (row) => { row.key = null; row.treeNodeFlags = 0; row.allChildrenCount = null; row.childrenAfterGroup = null; row.childrenAfterAggFilter = null; row.childrenAfterFilter = null; row.childrenAfterSort = null; row.childrenMapped = null; row.level = 0; row._groupData = void 0; }; // packages/ag-grid-enterprise/src/rowHierarchy/rowHierarchyUtils.ts function _isHiddenParent(node, ancestor, gos) { let currentNode = node; const levelDiff = currentNode.level - ancestor.level; if (levelDiff <= 0) { return false; } const isHideOpenParents = gos.get("groupHideOpenParents"); if (!isHideOpenParents) { return false; } for (let i = 0; i < levelDiff; i++) { const isFirstChild = currentNode.parent?.getFirstChild() === currentNode; if (!isFirstChild) { return false; } currentNode = currentNode.parent; } return currentNode === ancestor; } // packages/ag-grid-enterprise/src/rowHierarchy/rendering/groupCellRendererCtrl.ts var GroupCellRendererCtrl = class extends BeanStub { constructor() { super(...arguments); // keep reference to this, so we can remove again when indent changes this.indentClass = null; } init(comp, eGui, eCheckbox, eExpanded, eContracted, compClass, params) { this.params = params; this.eGui = eGui; this.eCheckbox = eCheckbox; this.eExpanded = eExpanded; this.eContracted = eContracted; this.comp = comp; this.compClass = compClass; const { node, column } = params; this.node = node; this.displayedNode = node; const embeddedRowMismatch = this.isEmbeddedRowMismatch(); if (embeddedRowMismatch) { return; } if (node.footer) { this.initFooterCell(); return; } if (!column) { this.initFullWidthCell(); return; } this.displayedNode = this.beans.showRowGroupColValueSvc?.getDisplayedNode(node, column) ?? this.node; this.setupExpand(); this.setupCheckbox(); this.addGroupValue(); this.setupIndent(); } initFooterCell() { const { node } = this.params; this.addGroupValue(); this.setupIndent(); const isGrandTotal = node.level === -1; if (!isGrandTotal) { this.comp.toggleCss("ag-row-group-leaf-indent", true); } } initFullWidthCell() { const setupDragger = () => { const { rowDragSvc } = this.beans; if (!this.params.rowDrag || !rowDragSvc) { return; } const rowDragComp = rowDragSvc.createRowDragComp(() => this.params.value, this.params.node); this.createManagedBean(rowDragComp); this.eGui.insertAdjacentElement("afterbegin", rowDragComp.getGui()); }; this.setupExpand(); setupDragger(); this.setupCheckbox(); this.addGroupValue(); this.setupIndent(); } /** * Returns an aria "role" to place on full width group cells, or the parent wrapper. * @returns the aria role to place on the parent wrapper */ getCellAriaRole() { const colDefAriaRole = this.params.colDef?.cellAriaRole; const columnColDefAriaRole = this.params.column?.getColDef().cellAriaRole; return colDefAriaRole || columnColDefAriaRole || "gridcell"; } /** * Determines if this cell should be rendered, as when using embeddedFullWidthRows * only one group cell should be rendered. * * if [enableRTL] all but pinned right cells should be skipped if available * otherwise prioritise pinned left cell if available * otherwise center viewport. * * @returns whether the cell should be skipped due to embedded full width rows */ isEmbeddedRowMismatch() { if (!this.params.fullWidth || !this.gos.get("embedFullWidthRows")) { return false; } const { visibleCols } = this.beans; const pinnedLeftCell = this.params.pinned === "left"; const pinnedRightCell = this.params.pinned === "right"; const bodyCell = !pinnedLeftCell && !pinnedRightCell; if (this.gos.get("enableRtl")) { if (visibleCols.isPinningLeft()) { return !pinnedRightCell; } return !bodyCell; } if (visibleCols.isPinningLeft()) { return !pinnedLeftCell; } return !bodyCell; } /** * Displays the group value for the displayed node */ addGroupValue() { const { params: { value, valueFormatted } } = this; const innerCompDetails = this.getInnerCompDetails(); this.comp.setInnerRenderer(innerCompDetails, valueFormatted ?? value ?? null); } /** * Sets up expand/collapse: * Chevron * Aria-expanded * Child count */ setupExpand() { const { colModel } = this.beans; const { eGridCell, suppressDoubleClickExpand } = this.params; const addIconToDom = (iconName, element) => { const icon = _createIconNoSpan(iconName, this.beans, null); if (icon) { element.appendChild(icon); this.addDestroyFunc(() => icon.remove()); } }; addIconToDom("groupExpanded", this.eExpanded); addIconToDom("groupContracted", this.eContracted); const comp = this.comp; const onExpandedChanged = () => { const expandable = this.isExpandable(); if (!expandable) { return; } const expanded = !!this.displayedNode.expanded; comp.setExpandedDisplayed(expanded); comp.setContractedDisplayed(!expanded); _setAriaExpanded(eGridCell, expanded); }; const onExpandableChanged = () => { const expandable = this.isExpandable(); comp.toggleCss("ag-cell-expandable", expandable); comp.toggleCss("ag-row-group", expandable); const pivotModeAndLeaf = !expandable && colModel.isPivotMode(); comp.toggleCss("ag-pivot-leaf-group", pivotModeAndLeaf); const normalModeNotTotalFooter = !colModel.isPivotMode() && (!this.displayedNode.footer || this.displayedNode.level !== -1); comp.toggleCss("ag-row-group-leaf-indent", !expandable && normalModeNotTotalFooter); const count = this.getChildCount(); const countString = count > 0 ? `(${count})` : ``; comp.setChildCount(countString); if (!expandable) { comp.setExpandedDisplayed(false); comp.setContractedDisplayed(false); _removeAriaExpanded(eGridCell); } else { onExpandedChanged(); } }; const setupListeners = () => { if (!suppressDoubleClickExpand && !this.isGroupCellEditable(this.displayedNode)) { this.addManagedListeners(eGridCell, { dblclick: this.onCellDblClicked.bind(this) }); } this.addManagedListeners(this.eExpanded, { click: this.onExpandClicked.bind(this) }); this.addManagedListeners(this.eContracted, { click: this.onExpandClicked.bind(this) }); this.addManagedListeners(eGridCell, { keydown: this.onKeyDown.bind(this) }); this.addManagedListeners(this.displayedNode, { // Expandable state has changed allChildrenCountChanged: onExpandableChanged, masterChanged: onExpandableChanged, groupChanged: onExpandableChanged, hasChildrenChanged: onExpandableChanged, // Node expanded changed expandedChanged: onExpandedChanged }); }; setupListeners(); onExpandableChanged(); } /** * Return the inner renderer details for the cell * * Prioritises: * 1. Group row renderer for group rows * 2. agFindCellRenderer for find results in group rows * 3. Provided innerRenderer (i.e, cellRendererParams.innerRenderer) * 4. Cell renderer of the grouped column * 5. Inner renderer of the grouped column * 6. agFindCellRenderer for find results */ getInnerCompDetails() { const { userCompFactory, findSvc } = this.beans; const params = this.params; if (params.fullWidth) { const groupRowRendererParams = this.gos.get("groupRowRendererParams"); const groupRowInnerCompDetails = _getInnerCellRendererDetails( userCompFactory, groupRowRendererParams, params ); if (groupRowInnerCompDetails) { return groupRowInnerCompDetails; } if (findSvc?.isMatch(params.node, null)) { return _getInnerCellRendererDetails( userCompFactory, { ...groupRowRendererParams, innerRenderer: "agFindCellRenderer" }, params ); } return void 0; } const isGroupRowRenderer = (details) => details && details.componentClass == this.compClass; const innerCompDetails = _getInnerCellRendererDetails(userCompFactory, params, params); if (innerCompDetails && !isGroupRowRenderer(innerCompDetails)) { return innerCompDetails; } const { displayedNode: { rowGroupColumn } } = this; const relatedColDef = rowGroupColumn?.colDef; const isShowingThisCol = rowGroupColumn && params.column?.isRowGroupDisplayed(rowGroupColumn.getId()); if (relatedColDef && isShowingThisCol) { const relatedCompDetails = _getCellRendererDetails(userCompFactory, relatedColDef, params); if (relatedCompDetails) { if (isGroupRowRenderer(relatedCompDetails)) { if (relatedColDef?.cellRendererParams?.innerRenderer) { return _getInnerCellRendererDetails( userCompFactory, relatedColDef.cellRendererParams, params ); } } else { return relatedCompDetails; } } } if (findSvc?.isMatch(params.node, params.column)) { return _getCellRendererDetails( userCompFactory, { ...relatedColDef ?? params.colDef, cellRenderer: "agFindCellRenderer" }, params ); } } /** * Get the allChildCount of a given node * @param node the node to return the count for * @returns 0 if the count should not be displayed, otherwise the count */ getChildCount() { const { column, suppressCount } = this.params; if (suppressCount) { return 0; } const { allChildrenCount, rowGroupColumn } = this.displayedNode; const isDisplayingRowGroupCell = (allChildrenCount ?? 0) > 0 && (!rowGroupColumn || !column || column?.isRowGroupDisplayed(rowGroupColumn.getId())); if (!isDisplayingRowGroupCell) { return 0; } const isRepresentingOtherNode = this.gos.get("showOpenedGroup") && this.displayedNode !== this.node; if (isRepresentingOtherNode && !_isHiddenParent(this.node, this.displayedNode, this.gos)) { return 0; } return allChildrenCount ?? 0; } /** * Checks whether the current cell is expandable, either due to [groupHideOpenParent] control or otherwise. * @returns whether this cell is expandable */ isExpandable() { const { node, column, colDef } = this.params; if (!this.displayedNode.isExpandable()) { return false; } if (node.rowPinned) { return false; } const isFullWidth = !column; if (isFullWidth) { return true; } const hasChildren = node.hasChildren(); if (hasChildren && colDef) { const { showRowGroup } = colDef; if (!showRowGroup) { return false; } if (showRowGroup === true) { return true; } } if (node === this.displayedNode) { if (node.rowGroupColumn) { const showingThisRowGroup = column?.isRowGroupDisplayed(node.rowGroupColumn.getId()); if (showingThisRowGroup) { return true; } } if (node.master) { return colDef?.showRowGroup === true || colDef?.showRowGroup == null; } return false; } return _isHiddenParent(this.node, this.displayedNode, this.gos); } /** * For full width group cells & single group column, indents child groups based on uiLevel */ setupIndent() { const { suppressPadding, node, colDef } = this.params; if (suppressPadding) { return; } const setIndent = () => { let level = node.uiLevel; if (colDef && colDef.showRowGroup !== true) { level = 0; } const newIndentClass = "ag-row-group-indent-" + level; if (newIndentClass === this.indentClass) { return; } if (this.indentClass) { this.comp.toggleCss(this.indentClass, false); } this.indentClass = newIndentClass; this.comp.toggleCss(newIndentClass, true); this.eGui.style.setProperty("--ag-indentation-level", String(level)); }; this.addManagedListeners(node, { uiLevelChanged: setIndent.bind(this) }); setIndent(); } /** * Selection checkboxes */ setupCheckbox() { const { node } = this.params; const isRowSelectable = !node.footer && !node.rowPinned && !node.detail; if (!isRowSelectable) { return; } this.addManagedPropertyListener("rowSelection", ({ currentValue, previousValue }) => { const curr = typeof currentValue === "object" ? currentValue : void 0; const prev = typeof previousValue === "object" ? previousValue : void 0; if (curr?.checkboxLocation !== prev?.checkboxLocation) { this.destroyCheckbox(); this.addCheckbox(); } }); this.addCheckbox(); } addCheckbox() { const { selectionSvc } = this.beans; if (!selectionSvc || !_isRowSelection(this.gos)) { return; } const { node, column } = this.params; const rowSelection = this.gos.get("rowSelection"); const checkboxLocation = _getCheckboxLocation(rowSelection); if (checkboxLocation === "selectionColumn") { return; } if (checkboxLocation === "autoGroupColumn") { const isGroupColumn = column?.getColDef().showRowGroup != null; const isFullWidthGroupRow = !column && node.group; const isApplicableCell = isGroupColumn || isFullWidthGroupRow; if (!isApplicableCell) { return; } } const checkboxes = typeof rowSelection === "object" ? _getCheckboxes(rowSelection) : this.params.checkbox; const userWantsCheckboxes = typeof checkboxes === "function" || checkboxes === true; if (!userWantsCheckboxes) { return; } const isMultiAutoCol = typeof column?.getColDef().showRowGroup === "string"; if (isMultiAutoCol && !this.isExpandable()) { this.comp.setCheckboxSpacing(true); return; } const cbSelectionComponent = selectionSvc.createCheckboxSelectionComponent(); this.cbComp = cbSelectionComponent; this.createBean(cbSelectionComponent); cbSelectionComponent.init({ rowNode: node, // when groupHideOpenParents = true and group expanded, we want the checkbox to refer to leaf node state (not group node state) column, overrides: { isVisible: checkboxes, callbackParams: this.params, removeHidden: true } }); this.eCheckbox.appendChild(cbSelectionComponent.getGui()); this.comp.setCheckboxVisible(true); } destroyCheckbox() { this.comp.setCheckboxSpacing(false); this.comp.setCheckboxVisible(false); this.cbComp?.getGui().remove(); this.cbComp = this.destroyBean(this.cbComp); } /** Whether the group cell is editable via groupRowEditable or enableGroupEdit. */ isGroupCellEditable(node) { const column = this.params.column; return !!column && (!!column.getColDef().groupRowEditable || this.gos.get("enableGroupEdit")) && column.isCellEditable(node); } /** * Called when the expand / contract icon is clicked. */ onExpandClicked(mouseEvent) { if (_isStopPropagationForAgGrid(mouseEvent)) { return; } _stopPropagationForAgGrid(mouseEvent); this.onExpandOrContract(mouseEvent); } /** * Called on cell key press - only handles 'Enter' key for expand/collapse */ onKeyDown(event) { const isEnterKey = event.key === KeyCode.ENTER; if (!isEnterKey || this.params.suppressEnterExpand) { return; } if (this.isGroupCellEditable(this.params.node)) { return; } this.onExpandOrContract(event); } /** * Called on cell double click - only expands/collapses if the event is not on the expand / contract icon */ onCellDblClicked(mouseEvent) { if (_isStopPropagationForAgGrid(mouseEvent)) { return; } const targetIsExpandIcon = _isElementInEventPath(this.eExpanded, mouseEvent) || _isElementInEventPath(this.eContracted, mouseEvent); if (!targetIsExpandIcon) { this.onExpandOrContract(mouseEvent); } } /** * Called when expand or contract is attempted, to scroll the row and update the node state * @param e originating event */ onExpandOrContract(e) { if (!this.isExpandable()) { return; } const rowNode = this.displayedNode; const nextExpandState = !rowNode.expanded; if (!nextExpandState && rowNode.sticky) { this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(rowNode.rowTop - rowNode.stickyRowTop); } rowNode.setExpanded(nextExpandState, e); } destroy() { super.destroy(); this.destroyCheckbox(); } }; // packages/ag-grid-enterprise/src/rowHierarchy/rendering/groupCellRenderer.ts var GroupCellRendererElement = { tag: "span", cls: "ag-cell-wrapper", children: [ { tag: "span", ref: "eExpanded", cls: "ag-group-expanded ag-hidden" }, { tag: "span", ref: "eContracted", cls: "ag-group-contracted ag-hidden" }, { tag: "span", ref: "eCheckbox", cls: "ag-group-checkbox ag-invisible" }, { tag: "span", ref: "eValue", cls: "ag-group-value" }, { tag: "span", ref: "eChildCount", cls: "ag-group-child-count" } ] }; var GroupCellRenderer = class extends Component { constructor() { super(GroupCellRendererElement); this.eExpanded = RefPlaceholder; this.eContracted = RefPlaceholder; this.eCheckbox = RefPlaceholder; this.eValue = RefPlaceholder; this.eChildCount = RefPlaceholder; } init(params) { const compProxy = { setInnerRenderer: (compDetails, valueToDisplay) => this.setRenderDetails(compDetails, valueToDisplay), setChildCount: (count) => this.eChildCount.textContent = count, toggleCss: (cssClass, value) => this.toggleCss(cssClass, value), setContractedDisplayed: (expanded) => _setDisplayed(this.eContracted, expanded), setExpandedDisplayed: (expanded) => _setDisplayed(this.eExpanded, expanded), setCheckboxVisible: (visible) => this.eCheckbox.classList.toggle("ag-invisible", !visible), setCheckboxSpacing: (add) => this.eCheckbox.classList.toggle("ag-group-checkbox-spacing", add) }; const ctrl = this.createManagedBean(new GroupCellRendererCtrl()); const fullWidth = !params.colDef; const eGui = this.getGui(); ctrl.init(compProxy, eGui, this.eCheckbox, this.eExpanded, this.eContracted, this.constructor, params); if (fullWidth) { _setAriaRole(eGui, ctrl.getCellAriaRole()); } } setRenderDetails(compDetails, valueToDisplay) { if (compDetails) { compDetails.newAgStackInstance().then((comp) => { if (!comp) { return; } const destroyComp = () => this.destroyBean(comp); if (this.isAlive()) { this.eValue.appendChild(comp.getGui()); this.addDestroyFunc(destroyComp); } else { destroyComp(); } }); } else { this.eValue.innerText = valueToDisplay; } } destroy() { this.destroyBean(this.innerCellRenderer); super.destroy(); } refresh() { return false; } }; // packages/ag-grid-enterprise/src/rowHierarchy/rendering/groupCellStyles.css var groupCellStyles_default = ".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}"; // packages/ag-grid-enterprise/src/rowHierarchy/showRowGroupColValueService.ts var ShowRowGroupColValueService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "showRowGroupColValueSvc"; } /** * Get the value for display in the group column. Also returns the displayedNode from which the value was * taken in cases of groupHideOpenParents and showOpenedGroup. * * Always uses 'data' mode because group column values represent structural position in the row hierarchy. * The actual grouping (via getKeyForNode) uses committed data, so the display should match - showing * a different group value while the row is still in its original group would be misleading. */ getGroupValue(node, column, ignoreAggData) { if (!column) { if (!node.group) { return null; } return { displayedNode: node, value: node.groupValue }; } const valueSvc = this.beans.valueSvc; const rowGroupColId = column.colDef.showRowGroup; if (!rowGroupColId) { return null; } if (node.level === -1 && node.footer) { return { displayedNode: node, value: null }; } if (typeof rowGroupColId === "string") { const colRowGroupIndex = this.beans.rowGroupColsSvc?.getColumnIndex(rowGroupColId) ?? -1; if (colRowGroupIndex > node.level) { return null; } const hideOpenParentsNode = this.getDisplayedNode(node, column, true); if (hideOpenParentsNode) { return { displayedNode: hideOpenParentsNode, value: valueSvc.getValue(column, hideOpenParentsNode, "data", ignoreAggData) }; } } const value = valueSvc.getValue(column, node, "data", ignoreAggData); if (value == null) { const displayedNode = this.getDisplayedNode(node, column); if (displayedNode) { return { displayedNode, value: valueSvc.getValue(column, displayedNode, "data", ignoreAggData) }; } } return { displayedNode: node, value }; } /** * Formats a group col value, and prefixes it with the "Total" prefix if applicable */ formatAndPrefixGroupColValue(groupValue, column, exporting = false) { const formattedValue = this.formatGroupColValue(groupValue, column, exporting); const { value, displayedNode } = groupValue; const footerSvc = this.beans.footerSvc; if (footerSvc?.doesCellShowTotalPrefix(displayedNode, column)) { const footerValue = footerSvc.applyTotalPrefix(value, formattedValue, displayedNode, column); return footerValue; } if (displayedNode.footer && displayedNode.level === -1) { return null; } return formattedValue; } /** * Formats the group col value using the underlying column's value formatter */ formatGroupColValue(groupValue, column, exporting = false) { const valueSvc = this.beans.valueSvc; const { displayedNode, value } = groupValue; const groupedCol = displayedNode.rowGroupColumn; const isFullWidthGroup = displayedNode.group && !column; const isShowingGroupCell = groupedCol && (isFullWidthGroup || column?.isRowGroupDisplayed(groupedCol.colId)); if (isShowingGroupCell) { if (exporting && groupedCol.colDef.useValueFormatterForExport === false) { return null; } const formattedValue = valueSvc.formatValue(groupedCol, displayedNode, value); if (formattedValue == null && displayedNode.key === "") { const localeTextFunc = this.getLocaleTextFunc(); return localeTextFunc("blanks", "(Blanks)"); } return formattedValue; } if (!column || displayedNode.group) { return null; } if (exporting && column.colDef.useValueFormatterForExport === false) { return null; } return valueSvc.formatValue(column, displayedNode, value); } /** * Checks if the node has a value to inherit from the parent node for display in the given column * * This is used when [groupHideOpenParents] or [showOpenedGroup] are enabled * * @param node node to check for preferential nodes to display * @param column column to get the displayed node for * @returns a parent node of node to display the value from, or undefined if no value will be inherited */ getDisplayedNode(node, column, onlyHideOpenParents = false) { const gos = this.gos; const isGroupHideOpenParents = gos.get("groupHideOpenParents"); const isShowOpenedGroupValue = gos.get("showOpenedGroup") && !onlyHideOpenParents; if (!isGroupHideOpenParents && !isShowOpenedGroupValue) { return void 0; } const showRowGroup = column.colDef.showRowGroup; if (showRowGroup === true) { if (node.group) { return void 0; } return node.parent ?? void 0; } let pointer = node; while (pointer && pointer.rowGroupColumn?.getId() != showRowGroup) { const isFirstChild = pointer === pointer.parent?.getFirstChild(); if (!isShowOpenedGroupValue && !isFirstChild) { return void 0; } pointer = pointer.parent; } if (pointer === node) { return void 0; } return pointer ?? void 0; } }; // packages/ag-grid-enterprise/src/rowHierarchy/showRowGroupColsService.ts var ShowRowGroupColsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "showRowGroupCols"; this.columns = []; this.colsSet = /* @__PURE__ */ new Set(); this.colsMap = /* @__PURE__ */ new Map(); } destroy() { super.destroy(); this.columns.length = 0; this.colsSet.clear(); this.colsMap.clear(); } refresh() { const { colModel, rowGroupColsSvc } = this.beans; const showRowGroupCols = this.columns; const showRowGroupColsSet = this.colsSet; const showRowGroupColsMap = this.colsMap; showRowGroupColsMap.clear(); const oldShowRowGroupColsLLen = showRowGroupCols.length; let showRowGroupColsCount = 0; let showRowGroupColsSetChanged = false; const cols = colModel.getCols(); for (let colIdx = 0, colsLen = cols.length; colIdx < colsLen; ++colIdx) { const col = cols[colIdx]; const colDef = col.getColDef(); const showRowGroup = colDef.showRowGroup; if (typeof showRowGroup === "string") { showRowGroupColsMap.set(showRowGroup, col); } else if (showRowGroup === true) { const groupColumns = rowGroupColsSvc?.columns; if (groupColumns) { for (let grpColIdx = 0, grpColsLen = groupColumns.length; grpColIdx < grpColsLen; ++grpColIdx) { showRowGroupColsMap.set(groupColumns[grpColIdx].getId(), col); } } } else { continue; } showRowGroupColsSetChanged || (showRowGroupColsSetChanged = showRowGroupColsCount >= oldShowRowGroupColsLLen || !showRowGroupColsSet.has(col)); showRowGroupCols[showRowGroupColsCount++] = col; } showRowGroupColsSetChanged || (showRowGroupColsSetChanged = showRowGroupColsCount !== oldShowRowGroupColsLLen); if (showRowGroupColsSetChanged) { showRowGroupCols.length = showRowGroupColsCount; showRowGroupColsSet.clear(); for (let j = 0; j < showRowGroupColsCount; ++j) { showRowGroupColsSet.add(showRowGroupCols[j]); } this.eventSvc.dispatchEvent({ type: "showRowGroupColsSetChanged" }); } } getShowRowGroupCol(id) { return this.colsMap.get(id); } getSourceColumnsForGroupColumn(groupCol) { const sourceColumnId = groupCol.getColDef().showRowGroup; if (!sourceColumnId) { return null; } const { rowGroupColsSvc, colModel } = this.beans; if (sourceColumnId === true && rowGroupColsSvc) { return rowGroupColsSvc.columns; } const column = colModel.getColDefCol(sourceColumnId); return column ? [column] : null; } isRowGroupDisplayed(column, colId) { const showRowGroup = column.getColDef()?.showRowGroup; return showRowGroup === true || showRowGroup != null && showRowGroup === colId; } }; // packages/ag-grid-enterprise/src/rowHierarchy/stickyRowFeature.ts var StickyRowFeature = class extends BeanStub { constructor(createRowCon, destroyRowCtrls) { super(); this.createRowCon = createRowCon; this.destroyRowCtrls = destroyRowCtrls; this.stickyTopRowCtrls = []; this.stickyBottomRowCtrls = []; // sticky rows pulls in extra rows from other pages which impacts row position this.extraTopHeight = 0; this.extraBottomHeight = 0; } postConstruct() { this.isClientSide = _isClientSideRowModel(this.gos); this.beans.ctrlsSvc.whenReady(this, (params) => { this.gridBodyCtrl = params.gridBodyCtrl; }); this.resetStickyContainers(); } setOffsetTop(offset) { if (this.extraTopHeight === offset) { return; } this.extraTopHeight = offset; this.eventSvc.dispatchEvent({ type: "stickyTopOffsetChanged", offset }); } setOffsetBottom(offset) { if (this.extraBottomHeight === offset) { return; } this.extraBottomHeight = offset; } resetOffsets() { this.setOffsetBottom(0); this.setOffsetTop(0); } /** * Get the last pixel of the group, this pixel is used to push the sticky node up out of the viewport. */ getLastPixelOfGroup(row) { return this.isClientSide ? getClientSideLastPixelOfGroup(row) : getServerSideLastPixelOfGroup(row); } /** * Get the first pixel of the group, this pixel is used to push the sticky node down out of the viewport */ getFirstPixelOfGroup(row) { if (row.footer) { return row.sibling.rowTop + row.sibling.rowHeight - 1; } if (row.hasChildren()) { return row.rowTop - 1; } return 0; } updateStickyRows(container) { const isTop = container === "top"; let newStickyContainerHeight = 0; if (!this.canRowsBeSticky()) { return this.refreshNodesAndContainerHeight(container, /* @__PURE__ */ new Set(), newStickyContainerHeight); } const newStickyRows = /* @__PURE__ */ new Set(); const { rowModel, rowRenderer, pinnedRowModel, pageBounds, rowContainerHeight } = this.beans; const { pageFirstPixel, pageLastPixel } = pageBounds.getCurrentPagePixelRange(); const pixelAtContainerBoundary = isTop ? rowRenderer.firstVisibleVPixel - this.extraTopHeight : rowRenderer.lastVisibleVPixel - this.extraTopHeight; const divStretchOffset = rowContainerHeight.divStretchOffset ?? 0; const pageFirstPixelWithOffset = pageFirstPixel + divStretchOffset; const pageLastPixelWithOffset = pageLastPixel + divStretchOffset; const addStickyRow = (stickyRow) => { newStickyRows.add(stickyRow); if (isTop) { const lastChildBottom = this.getLastPixelOfGroup(stickyRow); const stickRowBottom = pixelAtContainerBoundary + newStickyContainerHeight + stickyRow.rowHeight; if (lastChildBottom < stickRowBottom) { stickyRow.stickyRowTop = newStickyContainerHeight + (lastChildBottom - stickRowBottom); } else { stickyRow.stickyRowTop = newStickyContainerHeight; } } else { const lastChildBottom = this.getFirstPixelOfGroup(stickyRow); const stickRowTop = pixelAtContainerBoundary - (newStickyContainerHeight + stickyRow.rowHeight); if (lastChildBottom > stickRowTop) { stickyRow.stickyRowTop = newStickyContainerHeight - (lastChildBottom - stickRowTop); } else { stickyRow.stickyRowTop = newStickyContainerHeight; } } newStickyContainerHeight = 0; newStickyRows.forEach((rowNode) => { const thisRowLastPx = rowNode.stickyRowTop + rowNode.rowHeight; if (newStickyContainerHeight < thisRowLastPx) { newStickyContainerHeight = thisRowLastPx; } }); }; const suppressFootersSticky = this.areFooterRowsStickySuppressed(); const suppressGroupsSticky = this.gos.get("suppressGroupRowsSticky"); const isRowSticky = (row) => { if (!row.displayed) { return false; } if (row.footer) { if (suppressFootersSticky === true) { return false; } if (suppressFootersSticky === "grand" && row.level === -1) { return false; } if (suppressFootersSticky === "group" && row.level > -1) { return false; } const isFooterFirstRowInGroup = row.sibling.rowIndex ? row.sibling.rowIndex + 1 === row.rowIndex : false; if (container === "bottom" && isFooterFirstRowInGroup) { return false; } if (row.level === -1 && pinnedRowModel?.getGrandTotalPinned()) { return false; } const alreadySticking = newStickyRows.has(row); return !alreadySticking; } if (row.isExpandable()) { if (suppressGroupsSticky === true) { return false; } if (container === "bottom") { return false; } const alreadySticking = newStickyRows.has(row); return !alreadySticking && !!row.expanded; } return false; }; for (let i = 0; i < 100; i++) { let firstPixelAfterStickyRows = pixelAtContainerBoundary + newStickyContainerHeight; if (!isTop) { firstPixelAfterStickyRows = pixelAtContainerBoundary - newStickyContainerHeight; } if (isTop && firstPixelAfterStickyRows < pageFirstPixelWithOffset) { firstPixelAfterStickyRows = pageFirstPixelWithOffset; } else if (!isTop && firstPixelAfterStickyRows > pageLastPixelWithOffset) { firstPixelAfterStickyRows = pageLastPixelWithOffset; } const firstIndex = rowModel.getRowIndexAtPixel(firstPixelAfterStickyRows); const firstRow = rowModel.getRow(firstIndex); if (firstRow == null) { break; } const ancestors = this.getStickyAncestors(firstRow); const firstMissingParent = ancestors.find( (parent) => (isTop ? parent.rowIndex < firstIndex : parent.rowIndex > firstIndex) && isRowSticky(parent) ); if (firstMissingParent) { addStickyRow(firstMissingParent); continue; } const isFirstRowOutsideViewport = isTop ? firstRow.rowTop < firstPixelAfterStickyRows : firstRow.rowTop + firstRow.rowHeight > firstPixelAfterStickyRows; if (isFirstRowOutsideViewport && isRowSticky(firstRow)) { addStickyRow(firstRow); continue; } break; } if (!isTop) { newStickyRows.forEach((rowNode) => { rowNode.stickyRowTop = newStickyContainerHeight - (rowNode.stickyRowTop + rowNode.rowHeight); }); } return this.refreshNodesAndContainerHeight(container, newStickyRows, newStickyContainerHeight); } areFooterRowsStickySuppressed() { const suppressFootersSticky = this.gos.get("suppressStickyTotalRow"); if (suppressFootersSticky === true) { return true; } const suppressGroupRows = suppressFootersSticky === "group"; const suppressGrandRows = suppressFootersSticky === "grand"; if (suppressGroupRows && suppressGrandRows) { return true; } if (suppressGrandRows) { return "grand"; } if (suppressGroupRows) { return "group"; } return false; } canRowsBeSticky() { const isStickyEnabled = _isGroupRowsSticky(this.gos); const suppressFootersSticky = this.areFooterRowsStickySuppressed(); const suppressGroupsSticky = this.gos.get("suppressGroupRowsSticky"); return isStickyEnabled && (!suppressFootersSticky || !suppressGroupsSticky); } getStickyAncestors(rowNode) { const ancestors = []; let p = rowNode.footer ? rowNode.sibling : rowNode.parent; while (p) { if (p.sibling) { ancestors.push(p.sibling); } ancestors.push(p); p = p.parent; } return ancestors.reverse(); } checkStickyRows() { const hasTopUpdated = this.updateStickyRows("top"); const hasBottomUpdated = this.updateStickyRows("bottom"); return hasTopUpdated || hasBottomUpdated; } destroyStickyCtrls() { this.resetStickyContainers(); } resetStickyContainers() { this.refreshNodesAndContainerHeight("top", /* @__PURE__ */ new Set(), 0); this.refreshNodesAndContainerHeight("bottom", /* @__PURE__ */ new Set(), 0); } refreshStickyNode(stickRowNode) { const allStickyNodes = /* @__PURE__ */ new Set(); if (this.stickyTopRowCtrls.some((ctrl) => ctrl.rowNode === stickRowNode)) { for (let i = 0; i < this.stickyTopRowCtrls.length; i++) { const currentNode = this.stickyTopRowCtrls[i].rowNode; if (currentNode !== stickRowNode) { allStickyNodes.add(currentNode); } } if (this.refreshNodesAndContainerHeight("top", allStickyNodes, this.topContainerHeight)) { this.checkStickyRows(); } return; } for (let i = 0; i < this.stickyBottomRowCtrls.length; i++) { const currentNode = this.stickyBottomRowCtrls[i].rowNode; if (currentNode !== stickRowNode) { allStickyNodes.add(currentNode); } } if (this.refreshNodesAndContainerHeight("bottom", allStickyNodes, this.bottomContainerHeight)) { this.checkStickyRows(); } } /** * Destroy old ctrls and create new ctrls where necessary. */ refreshNodesAndContainerHeight(container, newStickyNodes, height) { const isTop = container === "top"; const previousCtrls = isTop ? this.stickyTopRowCtrls : this.stickyBottomRowCtrls; const removedCtrlsMap = {}; const remainingCtrls = []; for (let i = 0; i < previousCtrls.length; i++) { const node = previousCtrls[i].rowNode; const hasBeenRemoved = !newStickyNodes.has(node); if (hasBeenRemoved) { removedCtrlsMap[node.id] = previousCtrls[i]; node.sticky = false; continue; } remainingCtrls.push(previousCtrls[i]); } const existingNodes = /* @__PURE__ */ new Set(); for (let i = 0; i < remainingCtrls.length; i++) { existingNodes.add(remainingCtrls[i].rowNode); } const newCtrls = []; newStickyNodes.forEach((node) => { if (existingNodes.has(node)) { return; } node.sticky = true; newCtrls.push(this.createRowCon(node, false, false)); }); let hasSomethingChanged = !!newCtrls.length || remainingCtrls.length !== previousCtrls.length; if (isTop) { if (this.topContainerHeight !== height) { this.topContainerHeight = height; this.gridBodyCtrl.setStickyTopHeight(height); hasSomethingChanged = true; } } else if (this.bottomContainerHeight !== height) { this.bottomContainerHeight = height; this.gridBodyCtrl.setStickyBottomHeight(height); hasSomethingChanged = true; } this.destroyRowCtrls(removedCtrlsMap, false); const newCtrlsList = [...remainingCtrls, ...newCtrls]; newCtrlsList.sort((a, b) => b.rowNode.rowIndex - a.rowNode.rowIndex); if (!isTop) { newCtrlsList.reverse(); } for (const ctrl of newCtrlsList) { ctrl.setRowTop(ctrl.rowNode.stickyRowTop); } const pageBounds = this.beans.pageBounds; let extraHeight = 0; if (isTop) { for (const node of newStickyNodes) { if (node.rowIndex < pageBounds.getFirstRow()) { extraHeight += node.rowHeight; } } if (extraHeight > this.topContainerHeight) { extraHeight = this.topContainerHeight; } this.setOffsetTop(extraHeight); } else { for (const node of newStickyNodes) { if (node.rowIndex > pageBounds.getLastRow()) { extraHeight += node.rowHeight; } } if (extraHeight > this.bottomContainerHeight) { extraHeight = this.bottomContainerHeight; } this.setOffsetBottom(extraHeight); } if (!hasSomethingChanged) { return false; } if (isTop) { this.stickyTopRowCtrls = newCtrlsList; } else { this.stickyBottomRowCtrls = newCtrlsList; } return true; } ensureRowHeightsValid() { let anyChange = false; const updateRowHeight = (ctrl) => { const rowNode = ctrl.rowNode; if (rowNode.rowHeightEstimated) { const rowHeight = _getRowHeightForNode(this.beans, rowNode); rowNode.setRowHeight(rowHeight.height); anyChange = true; } }; this.stickyTopRowCtrls.forEach(updateRowHeight); this.stickyBottomRowCtrls.forEach(updateRowHeight); return anyChange; } }; function getServerSideLastPixelOfGroup(row) { if (row.isExpandable() || row.footer) { if (row.master && row.detailNode) { return row.detailNode.rowTop + row.detailNode.rowHeight; } const noOrContiguousSiblings = !row.sibling || Math.abs(row.sibling.rowIndex - row.rowIndex) === 1; if (noOrContiguousSiblings) { let storeBounds = row.childStore?.getStoreBounds(); if (row.footer) { storeBounds = row.sibling.childStore?.getStoreBounds(); } return (storeBounds?.heightPx ?? 0) + (storeBounds?.topPx ?? 0); } if (row.footer) { return row.rowTop + row.rowHeight; } return row.sibling.rowTop + row.sibling.rowHeight; } return Number.MAX_SAFE_INTEGER; } function getClientSideLastPixelOfGroup(row) { if (row.isExpandable() || row.footer) { const grandTotalAtTop = row.footer && row.rowIndex === 0; if (grandTotalAtTop) { return Number.MAX_SAFE_INTEGER; } const noOrContiguousSiblings = !row.sibling || Math.abs(row.sibling.rowIndex - row.rowIndex) === 1; if (noOrContiguousSiblings) { let lastAncestor = row.footer ? row.sibling : row; while (lastAncestor.isExpandable() && lastAncestor.expanded) { if (lastAncestor.master && lastAncestor.detailNode) { lastAncestor = lastAncestor.detailNode; } else if (lastAncestor.childrenAfterSort) { if (lastAncestor.childrenAfterSort.length === 0) { break; } lastAncestor = _last(lastAncestor.childrenAfterSort); } } return lastAncestor.rowTop + lastAncestor.rowHeight; } if (row.footer) { return row.rowTop + row.rowHeight; } return row.sibling.rowTop + row.sibling.rowHeight; } return Number.MAX_SAFE_INTEGER; } // packages/ag-grid-enterprise/src/rowHierarchy/stickyRowService.ts var StickyRowService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "stickyRowSvc"; } createStickyRowFeature(ctrl, createRowCon, destroyRowCtrls) { const gos = this.gos; if (_isGroupRowsSticky(gos) && _isClientSideRowModel(gos) || _isServerSideRowModel(gos)) { return ctrl.createManagedBean(new StickyRowFeature(createRowCon, destroyRowCtrls)); } return void 0; } }; // packages/ag-grid-enterprise/src/rowHierarchy/rowHierarchyModule.ts var GroupCellRendererModule = { moduleName: "GroupCellRenderer", version: VERSION2, userComponents: { agGroupRowRenderer: GroupCellRenderer, agGroupCellRenderer: GroupCellRenderer }, dynamicBeans: { groupCellRendererCtrl: GroupCellRendererCtrl }, icons: { // shown on row group when contracted (click to expand) groupContracted: "tree-closed", // shown on row group when expanded (click to contract) groupExpanded: "tree-open" }, css: [groupCellStyles_default], dependsOn: [EnterpriseCoreModule] }; var GroupColumnModule = { moduleName: "GroupColumn", version: VERSION2, beans: [ AutoColService, ShowRowGroupColsService, ShowRowGroupColValueService, RowGroupColsSvc, PivotColsSvc, ValueColsSvc ], dependsOn: [EnterpriseCoreModule, GroupCellRendererModule] }; var ChangedPathModule = { moduleName: "ChangedPath", version: VERSION2, beans: [ChangedPathFactory], dependsOn: [EnterpriseCoreModule] }; var ClientSideRowModelHierarchyModule = { moduleName: "ClientSideRowModelHierarchy", version: VERSION2, rowModels: ["clientSide"], beans: [GroupStage, FlattenStage, ClientSideExpansionService], dependsOn: [EnterpriseCoreModule, ChangedPathModule] }; var StickyRowModule = { moduleName: "StickyRow", version: VERSION2, beans: [StickyRowService] }; var GroupEditModule = { moduleName: "GroupEdit", version: VERSION2, beans: [GroupEditService], dependsOn: [EnterpriseCoreModule, ClientSideRowModelHierarchyModule] }; // packages/ag-grid-enterprise/src/groupHierarchy/groupHierarchyUtils.ts var getDate = ({ valueSvc, dataTypeSvc }, sourceCol, node) => { const innerValue = valueSvc.getValue(sourceCol, node, "data"); let date = null; if (innerValue instanceof Date) { date = innerValue; } else if (typeof innerValue === "string") { const parseDate = dataTypeSvc?.getDateParserFunction(sourceCol) ?? _parseDateTimeFromString; date = parseDate(innerValue) ?? null; } return date; }; var getDatePartValueGetter = (beans, col, index, map) => (params) => { const date = getDate(beans, col, params.node); const parts = _getDateParts(date); if (!parts) { return null; } return map?.(parts[index]) ?? parts[index]; }; var getHeaderValueGetter = ({ colNames }, col, part) => (params) => { const sourceName = colNames.getDisplayNameForColumn(col, params.location); if (sourceName) { return `${sourceName} (${part})`; } return ""; }; var MONTH_TO_LOCALE_KEY = Object.fromEntries(MONTHS.map((m) => [m, m.toLowerCase()])); var numericalMonthToNamedMonth = (monthStr) => { const month = MONTHS[Number.parseInt(monthStr, 10) - 1] ?? monthStr; const localeKey = MONTH_TO_LOCALE_KEY[month] ?? monthStr; return { month, localeKey }; }; function _getGroupHierarchy(colDef) { return colDef.groupHierarchy ?? colDef.rowGroupingHierarchy; } // packages/ag-grid-enterprise/src/groupHierarchy/groupHierarchyColService.ts var GroupHierarchyColService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "groupHierarchyColSvc"; this.columns = null; /** Map from primary column to virtual (i.e. generated) columns */ this.sourceColumnMap = /* @__PURE__ */ new WeakMap(); /** Map from virtual column to associated primary column. Inverse of `sourceColumnMap` */ this.inverseColumnMap = /* @__PURE__ */ new WeakMap(); } addColumns(cols) { const groupHierarchyCols = this.columns; if (groupHierarchyCols == null) { return; } cols.list = groupHierarchyCols.list.filter((col) => !cols.list.some((c) => c.getColId() === col.getColId())).concat(cols.list); cols.tree = groupHierarchyCols.tree.filter((col) => !cols.tree.some((c) => c.getId() === col.getId())).concat(cols.tree); _updateColsMap(cols); } createColumns(cols) { const newSourceColumnMap = /* @__PURE__ */ new WeakMap(); const newInverseColumnMap = /* @__PURE__ */ new WeakMap(); const list = this.createGroupHierarchyColumns(cols, newSourceColumnMap, newInverseColumnMap); const areSame = _areColIdsEqual(list, this.columns?.list ?? []); if (areSame) { return; } _destroyColumnTree(this.beans, this.columns?.tree); this.columns = null; const { colGroupSvc } = this.beans; const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0; const tree = colGroupSvc?.balanceTreeForAutoCols(list, treeDepth) ?? []; this.columns = { list, tree, treeDepth, map: {} }; this.sourceColumnMap = newSourceColumnMap; this.inverseColumnMap = newInverseColumnMap; } updateColumns(_event) { } getColumn(key) { return this.columns?.list.find((col) => _columnsMatch(col, key)) ?? null; } getColumns() { return this.columns?.list ?? null; } expandColumnInto(target, col) { const expanded = this.getVirtualColumnsForColumn(col).concat(col); for (const expandedCol of expanded) { if (!target.some((_c) => _columnsMatch(_c, expandedCol) || _c.getColId() === expandedCol.getColId())) { target.push(expandedCol); } } } compareVirtualColumns(colA, colB) { const sourceA = this.inverseColumnMap.get(colA); const sourceB = this.inverseColumnMap.get(colB); if (sourceA && sourceA === sourceB) { const hierarchyCols = this.sourceColumnMap.get(sourceA) ?? []; return hierarchyCols?.indexOf(colA) - hierarchyCols?.indexOf(colB); } if (this.sourceColumnMap.get(colA)?.includes(colB)) { return 1; } if (this.sourceColumnMap.get(colB)?.includes(colA)) { return -1; } return null; } insertVirtualColumnsForCol(columns, col) { const hierarchyCols = this.getVirtualColumnsForColumn(col); if (!hierarchyCols) { return []; } let idxCol = columns.indexOf(col); if (idxCol < 0) { idxCol = columns.length - 1; } _removeAllFromArray(columns, hierarchyCols); columns.splice(idxCol, 0, ...hierarchyCols); return hierarchyCols; } getVirtualColumnsForColumn(col) { if (this.isGroupHierarchyColsEnabledForCol(col)) { return this.sourceColumnMap.get(col) ?? []; } return []; } isGroupHierarchyColsEnabled(cols) { return cols.list.some((col) => this.isGroupHierarchyColsEnabledForCol(col)); } isGroupHierarchyColsEnabledForCol(col) { const def = col.getColDef(); const groupHierarchy = _getGroupHierarchy(def); return !!(groupHierarchy && (def.rowGroup || def.enableRowGroup || def.rowGroupIndex != null || def.pivot || def.enablePivot || def.pivotIndex != null)); } createGroupHierarchyColDefs(sourceCol) { const colDefs = []; const sourceColDef = sourceCol.getColDef(); const groupHierarchy = _getGroupHierarchy(sourceColDef); if (!groupHierarchy) { return colDefs; } if (!this.isGroupHierarchyColsEnabledForCol(sourceCol)) { return colDefs; } for (const part of groupHierarchy) { let colDef = null; if (typeof part === "string") { colDef = this.createColDefForPart(part, sourceCol, sourceColDef); } else { colDef = part; } if (colDef) { colDefs.push(colDef); } } return colDefs; } createGroupHierarchyColumns(cols, sourceColMap, inverseColMap) { if (!this.isGroupHierarchyColsEnabled(cols)) { return []; } const newCols = []; for (const col of cols.list) { for (const colDef of this.createGroupHierarchyColDefs(col)) { const colId = colDef.colId; this.gos.validateColDef(colDef, colId, true); const newCol = new AgColumn(colDef, null, colId, true); this.createBean(newCol); newCols.push(newCol); updateMap(sourceColMap, col, newCol); inverseColMap.set(newCol, col); } } return newCols; } createColDefForPart(part, sourceCol, sourceColDef) { const { beans, gos } = this; const colId = `${GROUP_HIERARCHY_COLUMN_ID_PREFIX}-${sourceCol.getColId()}-${part}`; const defaults = { enableRowGroup: sourceColDef.enableRowGroup, rowGroup: sourceColDef.rowGroup, enablePivot: sourceColDef.enablePivot, hide: true, editable: false }; const groupHierarchyConfig = gos.get("groupHierarchyConfig") ?? {}; if (part in groupHierarchyConfig) { const colDef = { ...defaults, ...groupHierarchyConfig[part] }; colDef.colId ?? (colDef.colId = colId); return _addColumnDefaultAndTypes(beans, colDef, colDef.colId, true); } const base = _addColumnDefaultAndTypes(beans, { colId, ...defaults }, colId, true); const translate = this.getLocaleTextFunc(); const translatePart = (part2, fallback) => translate?.(part2, fallback) ?? fallback; switch (part) { case "year": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Year")), valueGetter: getDatePartValueGetter(beans, sourceCol, 0) }; case "quarter": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Quarter")), valueGetter: getDatePartValueGetter( beans, sourceCol, 1, (month) => (Math.floor(Number(month) / 4) + 1).toString() ) }; case "month": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Month")), valueGetter: getDatePartValueGetter(beans, sourceCol, 1) }; case "formattedMonth": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart("month", "Month")), valueGetter: getDatePartValueGetter(beans, sourceCol, 1, (month) => { const nm = numericalMonthToNamedMonth(month); return translatePart(nm.localeKey, nm.month); }) }; case "day": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Day")), valueGetter: getDatePartValueGetter(beans, sourceCol, 2) }; case "hour": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Hour")), valueGetter: getDatePartValueGetter(beans, sourceCol, 3) }; case "minute": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Minute")), valueGetter: getDatePartValueGetter(beans, sourceCol, 4) }; case "second": return { ...base, headerValueGetter: getHeaderValueGetter(beans, sourceCol, translatePart(part, "Second")), valueGetter: getDatePartValueGetter(beans, sourceCol, 5) }; default: return null; } } }; function updateMap(wm, key, value) { const existing = wm.get(key); wm.set(key, (existing ?? []).concat(value)); } // packages/ag-grid-enterprise/src/groupHierarchy/groupHierarchyModule.ts var GroupHierarchyModule = { moduleName: "GroupHierarchy", version: VERSION2, beans: [GroupHierarchyColService], dependsOn: [ChangedPathModule] }; // packages/ag-grid-enterprise/src/rowGrouping/columnDropZones/agGridHeaderDropZones.ts var AgGridHeaderDropZones = class extends Component { constructor() { super(); } postConstruct() { this.setGui(this.createNorthPanel()); const onRowGroupChanged = this.onRowGroupChanged.bind(this); this.addManagedEventListeners({ columnRowGroupChanged: onRowGroupChanged, newColumnsLoaded: onRowGroupChanged }); this.addManagedPropertyListener("rowGroupPanelShow", onRowGroupChanged); this.addManagedPropertyListener("pivotPanelShow", () => this.onPivotPanelShow()); this.onRowGroupChanged(); } createNorthPanel() { const topPanelGui = _createElement({ tag: "div", cls: "ag-column-drop-wrapper", role: "presentation" }); const rowGroupComp = new RowGroupDropZonePanel(true); this.rowGroupComp = this.createManagedBean(rowGroupComp); const pivotComp = new PivotDropZonePanel(true); this.pivotComp = this.createManagedBean(pivotComp); topPanelGui.appendChild(rowGroupComp.getGui()); topPanelGui.appendChild(pivotComp.getGui()); const listener = this.onDropPanelVisible.bind(this); this.addManagedListeners(rowGroupComp, { displayChanged: listener }); this.addManagedListeners(pivotComp, { displayChanged: listener }); this.onDropPanelVisible(); return topPanelGui; } onDropPanelVisible() { const { rowGroupComp, pivotComp } = this; const bothDisplayed = rowGroupComp.isDisplayed() && pivotComp.isDisplayed(); const classStr = "ag-column-drop-horizontal-half-width"; rowGroupComp.toggleCss(classStr, bothDisplayed); pivotComp.toggleCss(classStr, bothDisplayed); } onRowGroupChanged() { const rowGroupComp = this.rowGroupComp; if (!rowGroupComp) { return; } const rowGroupPanelShow = this.gos.get("rowGroupPanelShow"); if (rowGroupPanelShow === "always") { rowGroupComp.setDisplayed(true); } else if (rowGroupPanelShow === "onlyWhenGrouping") { const grouping = this.beans.rowGroupColsSvc?.columns?.length !== 0; rowGroupComp.setDisplayed(grouping); } else { rowGroupComp.setDisplayed(false); } } onPivotPanelShow() { const pivotComp = this.pivotComp; if (!pivotComp) { return; } const pivotPanelShow = this.gos.get("pivotPanelShow"); if (pivotPanelShow === "always") { pivotComp.setDisplayed(true); } else if (pivotPanelShow === "onlyWhenPivoting") { const pivoting = this.beans.colModel.isPivotActive(); pivotComp.setDisplayed(pivoting); } else { pivotComp.setDisplayed(false); } } getFocusableContainers() { return [this.rowGroupComp, this.pivotComp].filter((comp) => !!comp); } }; var AgGridHeaderDropZonesSelector = { selector: "AG-GRID-HEADER-DROP-ZONES", component: AgGridHeaderDropZones }; // packages/ag-grid-enterprise/src/rowGrouping/groupFilter/groupFilter.ts function processGroupFilterParams(params) { if (params.buttons) { params.buttons = []; } return params; } var GroupFilterElement = { tag: "div", cls: "ag-group-filter", children: [ { tag: "div", ref: "eGroupField" }, { tag: "div", ref: "eUnderlyingFilter" } ] }; var GroupFilter = class extends TabGuardComp { constructor() { super(GroupFilterElement); this.filterType = "group"; this.eGroupField = RefPlaceholder; this.eUnderlyingFilter = RefPlaceholder; } wireBeans(beans) { this.groupFilterSvc = beans.groupFilter; } postConstruct() { this.initialiseTabGuard({}); } init(legacyParams) { this.params = legacyParams; return this.updateParams().then(() => { this.addHandlerListeners(this.updateGroups.bind(this)); }); } refresh(legacyParams) { const params = legacyParams; this.params = params; if (params.source === "colDef") { this.updateParams(); } return true; } updateParams() { this.validateParams(); return this.updateGroups(); } validateParams() { const { colDef } = this.params; if (colDef.field) { _warn(234); } if (colDef.filterValueGetter) { _warn(235); } if (colDef.filterParams) { _warn(236); } } addHandlerListeners(listener) { const destroyFunctions = this.addManagedListeners(this.getHandler(), { sourceColumnsChanged: () => { this.updateGroups(); }, destroyed: () => { for (const func of destroyFunctions) { func(); } this.addHandlerListeners(listener); } }); } updateGroups() { const { sourceColumns, selectedColumn } = this.updateGroupField(); this.dispatchLocalEvent({ type: "columnsChanged" }); return this.getUnderlyingFilters(sourceColumns, selectedColumn); } updateGroupField() { this.groupColumn = this.params.column; const handler = this.getHandler(); if (!handler) { return { sourceColumns: null }; } const { sourceColumns, hasMultipleColumns, selectedColumn } = handler; const eGroupField = this.eGroupField; _clearElement(eGroupField); if (this.eGroupFieldSelect) { this.destroyBean(this.eGroupFieldSelect); } if (hasMultipleColumns && sourceColumns) { this.createGroupFieldSelectElement(sourceColumns, selectedColumn); eGroupField.appendChild(this.eGroupFieldSelect.getGui()); eGroupField.appendChild(_createElement({ tag: "div", cls: "ag-filter-separator" })); } _setDisplayed(eGroupField, hasMultipleColumns); return { sourceColumns, selectedColumn }; } createGroupFieldSelectElement(sourceColumns, selectedColumn) { const eGroupFieldSelect = this.createManagedBean(new AgSelect()); this.eGroupFieldSelect = eGroupFieldSelect; const localeTextFunc = this.getLocaleTextFunc(); eGroupFieldSelect.setLabel(localeTextFunc("groupFilterSelect", "Select field:")); eGroupFieldSelect.setLabelAlignment("top"); eGroupFieldSelect.addOptions( sourceColumns.map((sourceColumn) => ({ value: sourceColumn.getColId(), text: this.beans.colNames.getDisplayNameForColumn(sourceColumn, "groupFilter", false) ?? void 0 })) ); eGroupFieldSelect.setValue(selectedColumn.getColId()); eGroupFieldSelect.onValueChange((newValue) => this.updateSelectedColumn(newValue)); eGroupFieldSelect.addCss("ag-group-filter-field-select-wrapper"); if (sourceColumns.length === 1) { eGroupFieldSelect.setDisabled(true); } } getUnderlyingFilters(sourceColumns, selectedColumn) { if (!sourceColumns) { this.filterColumnPairs = void 0; this.selectedFilter = void 0; return AgPromise.resolve(); } const filterPromises = []; const filterColumnPairs = []; const colFilter = this.beans.colFilter; for (const column of sourceColumns) { const filterPromise = colFilter.getOrCreateFilterUi(column); if (filterPromise) { filterPromises.push( filterPromise.then((filter) => { if (filter) { filterColumnPairs.push({ filter, column }); } if (column.getColId() === selectedColumn.getColId()) { this.selectedFilter = filter ?? void 0; } }) ); } } return AgPromise.all(filterPromises).then(() => { this.filterColumnPairs = filterColumnPairs; }); } addUnderlyingFilterElement(selectedColumn) { _clearElement(this.eUnderlyingFilter); if (!selectedColumn) { return AgPromise.resolve(); } const comp = this.createManagedBean(new FilterComp(selectedColumn, "COLUMN_MENU")); this.filterComp = comp; if (!comp.hasFilter()) { return AgPromise.resolve(); } this.eUnderlyingFilter.appendChild(comp.getGui()); return comp.getFilter()?.then(() => { comp.afterGuiAttached?.(this.afterGuiAttachedParams); if (!this.afterGuiAttachedParams?.suppressFocus && this.eGroupFieldSelect && !this.eGroupFieldSelect.isDisabled()) { this.eGroupFieldSelect.getFocusableElement().focus(); } }) ?? AgPromise.resolve(); } updateSelectedColumn(columnId) { if (!columnId) { return; } this.filterComp?.afterGuiDetached(); this.destroyBean(this.filterComp); const selectedFilterColumnPair = this.getFilterColumnPair(columnId); const selectedColumn = selectedFilterColumnPair?.column; this.selectedFilter = selectedFilterColumnPair?.filter; this.getHandler().setSelectedColumn(selectedColumn); this.dispatchLocalEvent({ type: "columnsChanged" }); this.addUnderlyingFilterElement(selectedColumn); } isFilterActive() { return this.groupFilterSvc.isFilterActive(this.groupColumn); } doesFilterPass() { return true; } getModel() { return null; } setModel() { } afterGuiAttached(params) { this.afterGuiAttachedParams = params; this.addUnderlyingFilterElement(this.getHandler().selectedColumn); } afterGuiDetached() { _clearElement(this.eUnderlyingFilter); this.selectedFilter?.afterGuiDetached?.(); } getSelectedColumn() { return this.getHandler().selectedColumn; } getHandler() { return this.params.getHandler(); } getFilterColumnPair(columnId) { if (!columnId) { return void 0; } return this.filterColumnPairs?.find(({ column }) => column.getColId() === columnId); } }; // packages/ag-grid-enterprise/src/rowGrouping/groupFilter/groupFilterHandler.ts var GroupFilterHandler = class extends BeanStub { init(params) { this.params = params; this.validateModel(params); this.updateColumns(); this.addManagedEventListeners({ columnRowGroupChanged: this.updateColumns.bind(this), filterDestroyed: (event) => this.onFilterDestroyed(event) }); } refresh(params) { this.params = params; this.validateModel(params); if (params.source === "colDef") { this.updateColumns(); } } doesFilterPass() { return true; } setSelectedColumn(selectedColumn) { this.selectedColumn = selectedColumn; this.dispatchLocalEvent({ type: "selectedColumnChanged" }); } validateModel(params) { if (params.model != null) { params.onModelChange(null); } } getSourceColumns() { const groupColumn = this.params.column; if (this.gos.get("treeData")) { _warn(237); return []; } const sourceColumns = this.beans.groupFilter.getSourceColumns(groupColumn); if (!sourceColumns) { _warn(183); return []; } return sourceColumns; } updateColumns() { const allSourceColumns = this.getSourceColumns(); const sourceColumns = allSourceColumns.filter((sourceColumn) => sourceColumn.isFilterAllowed()); this.sourceColumns = sourceColumns; let selectedColumn; let hasMultipleColumns; if (!sourceColumns.length) { selectedColumn = void 0; hasMultipleColumns = false; } else if (allSourceColumns.length === 1) { selectedColumn = sourceColumns[0]; hasMultipleColumns = false; } else { selectedColumn = this.selectedColumn; if (!selectedColumn || !sourceColumns.some((column) => column.getId() === selectedColumn.getId())) { selectedColumn = sourceColumns[0]; } hasMultipleColumns = true; } this.selectedColumn = selectedColumn; this.hasMultipleColumns = hasMultipleColumns; this.dispatchLocalEvent({ type: "sourceColumnsChanged" }); } onFilterDestroyed({ column: eventColumn, source }) { if (source === "gridDestroyed") { return; } const colId = eventColumn.getColId(); if (this.sourceColumns?.some((column) => column.getColId() === colId)) { setTimeout(() => { if (this.isAlive()) { this.updateColumns(); } }); } } }; // packages/ag-grid-enterprise/src/rowGrouping/groupFilter/groupFilterService.ts var GroupFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "groupFilter"; } postConstruct() { this.addManagedEventListeners({ columnRowGroupChanged: () => this.updateFilterFlags("columnRowGroupChanged") }); } isGroupFilter(column) { return column.getColDef().filter === "agGroupColumnFilter"; } isFilterAllowed(column) { const colFilter = this.beans.colFilter; return !!this.getSourceColumns(column)?.some((column2) => colFilter?.isFilterAllowed(column2)); } isFilterActive(column) { const colFilter = this.beans.colFilter; return !!this.getSourceColumns(column)?.some((column2) => colFilter?.isFilterActive(column2)); } getSourceColumns(column) { return this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(column); } updateFilterFlags(source, additionalEventAttributes) { const { autoColSvc, colFilter } = this.beans; autoColSvc?.getColumns()?.forEach((groupColumn) => { if (this.isGroupFilter(groupColumn)) { colFilter?.setColFilterActive( groupColumn, this.isFilterActive(groupColumn), source, additionalEventAttributes ); } }); } }; // packages/ag-grid-enterprise/src/rowGrouping/groupFilter/groupFloatingFilter.ts var GroupFloatingFilterElement = { tag: "div", ref: "eFloatingFilter", cls: "ag-group-floating-filter ag-floating-filter-input", role: "presentation" }; var GroupFloatingFilterComp = class extends Component { constructor() { super(GroupFloatingFilterElement); this.eFloatingFilter = RefPlaceholder; this.haveAddedColumnListeners = false; } init(params) { this.params = params; const canShowUnderlyingFloatingFilter = _isGroupMultiAutoColumn(this.gos); const onColChange = this.onColChange.bind(this); const setupFilterElement = (resolve) => { if (canShowUnderlyingFloatingFilter) { this.setupUnderlyingFloatingFilterElement().then(() => resolve()); } else { this.setupReadOnlyFloatingFilterElement(); resolve(); } }; if (this.gos.get("enableFilterHandlers")) { return new AgPromise((resolve) => setupFilterElement(resolve)).then(() => { this.addHandlerListeners(params, onColChange); }); } else { return new AgPromise((resolve) => { this.params.parentFilterInstance((parentFilterInstance) => { this.parentFilterInstance = parentFilterInstance; setupFilterElement(resolve); }); }).then(() => { this.addManagedListeners(this.parentFilterInstance, { columnsChanged: onColChange }); }); } } refresh(params) { this.params = params; this.setParams(); if (this.gos.get("enableFilterHandlers")) { if (this.showingUnderlyingFloatingFilter) { const column = this.getSelectedColumn(); const compDetails = this.beans.colFilter.getFloatingFilterCompDetails( column, this.params.showParentFilter ); this.underlyingFloatingFilter?.refresh?.(compDetails?.params); } else { this.updateDisplayedValue(); } } } setParams() { const displayName = this.beans.colNames.getDisplayNameForColumn(this.params.column, "header", true); const translate = this.getLocaleTextFunc(); this.eFloatingFilterText?.setInputAriaLabel(`${displayName} ${translate("ariaFilterInput", "Filter Input")}`); } addHandlerListeners(params, listener) { const destroyFunctions = this.addManagedListeners(params.getHandler(), { selectedColumnChanged: listener, sourceColumnsChanged: listener, destroyed: () => { for (const func of destroyFunctions) { func(); } this.addHandlerListeners(this.params, listener); } }); } setupReadOnlyFloatingFilterElement() { if (!this.eFloatingFilterText) { this.eFloatingFilterText = this.createManagedBean(new AgInputTextField()); this.eFloatingFilterText.setDisabled(true).addGuiEventListener("click", () => this.params.showParentFilter()); this.setParams(); } this.updateDisplayedValue(); this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui()); } setupUnderlyingFloatingFilterElement() { this.showingUnderlyingFloatingFilter = false; this.underlyingFloatingFilter = void 0; _clearElement(this.eFloatingFilter); const column = this.getSelectedColumn(); if (column && !column.isVisible()) { const colFilter = this.beans.colFilter; const compDetails = colFilter.getFloatingFilterCompDetails(column, this.params.showParentFilter); if (compDetails) { if (!this.haveAddedColumnListeners) { this.haveAddedColumnListeners = true; this.addManagedListeners(column, { visibleChanged: this.onColumnVisibleChanged.bind(this), colDefChanged: this.onColDefChanged.bind(this) }); } return compDetails.newAgStackInstance().then((floatingFilter) => { this.underlyingFloatingFilter = floatingFilter; this.underlyingFloatingFilter?.onParentModelChanged(colFilter.getModelForColumn(column)); this.appendChild(floatingFilter.getGui()); this.showingUnderlyingFloatingFilter = true; }); } } this.setupReadOnlyFloatingFilterElement(); return AgPromise.resolve(); } getSelectedColumn() { if (this.gos.get("enableFilterHandlers")) { const reactiveParams = this.params; return reactiveParams.getHandler().selectedColumn; } else { return this.parentFilterInstance.getSelectedColumn(); } } onColumnVisibleChanged() { this.setupUnderlyingFloatingFilterElement(); } onColDefChanged(event) { if (!event.column) { return; } const compDetails = this.beans.colFilter.getFloatingFilterCompDetails( event.column, this.params.showParentFilter ); if (compDetails) { this.underlyingFloatingFilter?.refresh?.(compDetails.params); } } onParentModelChanged(_model, event) { if (this.showingUnderlyingFloatingFilter) { this.underlyingFloatingFilter?.onParentModelChanged( this.beans.colFilter.getModelForColumn(this.getSelectedColumn()), event ); } else { this.updateDisplayedValue(); } } updateDisplayedValue() { const eFloatingFilterText = this.eFloatingFilterText; if (!eFloatingFilterText) { return; } const colFilter = this.beans.colFilter; const column = this.getSelectedColumn(); const updateText = (filterOrHandler) => { if (!filterOrHandler) { eFloatingFilterText.setValue(""); eFloatingFilterText.setDisplayed(false); } else { const model = column ? colFilter.getModelForColumn(column) : null; eFloatingFilterText.setValue(model == null ? "" : filterOrHandler.getModelAsString?.(model) ?? ""); eFloatingFilterText.setDisplayed(true); } }; if (!column) { updateText(); } else if (this.gos.get("enableFilterHandlers")) { updateText(colFilter.getHandler(column)); } else { colFilter.getOrCreateFilterUi(column)?.then((filter) => { updateText(filter); }); } } onColChange() { if (!this.showingUnderlyingFloatingFilter) { this.updateDisplayedValue(); } } }; // packages/ag-grid-enterprise/src/rowGrouping/groupStrategy/groupColumns.ts var makeGroupColumns = (columns, result) => { if (!columns) { result.length = 0; return; } const len = columns.length; result.length = len; for (let i = 0; i < len; i++) { const col = columns[i]; const colDef = col.getColDef(); result[i] = { col, field: colDef.field, type: colDef.type, keyCreator: colDef.keyCreator, valueGetter: colDef.valueGetter }; } }; var groupColumnsChanged = (groupColumns, columns) => { const len = groupColumns.length; if (len !== columns?.length) { return true; } for (let i = 0; i < len; i++) { const a = groupColumns[i]; const b = columns[i]; if (a.col !== b) { return true; } const bColDef = b.getColDef(); if (a.field !== bColDef.field || a.type !== bColDef.type || a.valueGetter !== bColDef.valueGetter || a.keyCreator !== bColDef.keyCreator) { return true; } } return false; }; // packages/ag-grid-enterprise/src/rowGrouping/groupStrategy/sortGroupChildren.ts function sortGroupChildren(rowNodes) { if (!rowNodes) { return false; } const length = rowNodes.length; if (length < 2) { return false; } let atLeastOneOutOfOrder = false; for (let i = 1; i < length; i++) { if (compareGroupChildren(rowNodes[i - 1], rowNodes[i]) > 0) { atLeastOneOutOfOrder = true; break; } } if (!atLeastOneOutOfOrder) { return false; } rowNodes.sort(compareGroupChildren); return true; } function compareGroupChildren(nodeA, nodeB) { const positionA = nodeA.sourceRowIndex; const positionB = nodeB.sourceRowIndex; const aHasIndex = positionA >= 0; const bHasIndex = positionB >= 0; const bothNodesAreUserNodes = aHasIndex && bHasIndex; const bothNodesAreFillerNodes = !aHasIndex && !bHasIndex; if (bothNodesAreUserNodes) { return positionA - positionB; } if (bothNodesAreFillerNodes) { return nodeA.__objectId - nodeB.__objectId; } if (aHasIndex) { return 1; } return -1; } // packages/ag-grid-enterprise/src/rowGrouping/groupStrategy/groupStrategy.ts var GroupStrategy = class extends BeanStub { constructor() { super(...arguments); // when grouping, these items are of note: // rowNode.parent: RowNode: set to the parent // rowNode.childrenAfterGroup: RowNode[] = the direct children of this group // rowNode.childrenMapped: string=>RowNode = children mapped by group key (when groups) or an empty map if leaf group (this is then used by pivot) // for leaf groups, rowNode.childrenAfterGroup = rowNode.allLeafChildren; this.groupCols = []; this.nonLeafsById = /* @__PURE__ */ new Map(); this.checkGroupCols = true; this.pivotMode = false; this.groupEmpty = false; } invalidateGroupCols() { this.checkGroupCols = true; } destroy() { super.destroy(); this.groupCols.length = 0; this.nonLeafsById.clear(); } clearNonLeafs() { const nonLeafsById = this.nonLeafsById; for (const node of nonLeafsById.values()) { node._destroy(false); } nonLeafsById.clear(); } loadGroupData(node) { if (!node.group) { node._groupData = null; return null; } const rowGroupCol = node.rowGroupColumn; const { valueSvc, showRowGroupCols } = this.beans; const groupData = {}; node._groupData = groupData; if (!rowGroupCol) { return groupData; } const leafNode = _csrmFirstLeaf(node); const rowGroupColId = rowGroupCol.getId(); if (!showRowGroupCols) { return groupData; } const groupDisplayCols = showRowGroupCols.columns; for (let i = 0, len = groupDisplayCols.length; i < len; ++i) { const col = groupDisplayCols[i]; if (col.isRowGroupDisplayed(rowGroupColId)) { groupData[col.getColId()] = valueSvc.getValue(rowGroupCol, leafNode, "data"); } } return groupData; } execute(rootNode, params) { const changedPath = params.changedPath; const refreshResult = this.initRefresh(params); if (refreshResult !== "skip") { const changedRowNodes = params.changedRowNodes; if (changedRowNodes) { this.handleDeltaUpdate(rootNode, changedPath, changedRowNodes, !!params.animate); } else { this.shotgunResetEverything(rootNode); } } this.positionLeafsAndGroups(rootNode, changedPath); this.orderGroups(rootNode); this.beans.selectionSvc?.updateSelectableAfterGrouping(changedPath); } positionLeafsAndGroups(rootNode, changedPath) { _forEachChangedGroupDepthFirst(rootNode, true, changedPath, (group) => { const children = group.childrenAfterGroup; const childrenLen = children?.length; if (!childrenLen) { return; } const newChildren = new Array(childrenLen); let writeIdx = 0; let changed = false; let unbalancedNode; for (let readIdx = 0; readIdx < childrenLen; ++readIdx) { const node = children[readIdx]; if (!node.childrenAfterGroup?.length) { changed || (changed = writeIdx !== readIdx); newChildren[writeIdx++] = node; } else if (!unbalancedNode && node.key === "") { unbalancedNode = node; const last = childrenLen - 1; changed || (changed = readIdx !== last); newChildren[last] = node; } } if (changed) { for (let readIdx = 0; readIdx < childrenLen; ++readIdx) { const node = children[readIdx]; if (node.childrenAfterGroup?.length && node !== unbalancedNode) { newChildren[writeIdx++] = node; } } group.childrenAfterGroup = newChildren; const sibling = group.sibling; if (sibling) { sibling.childrenAfterGroup = newChildren; } } }); } initRefresh(params) { const { rowGroupColsSvc, colModel, gos } = this.beans; this.pivotMode = colModel.isPivotMode(); this.groupEmpty = this.pivotMode || !gos.get("groupAllowUnbalanced"); const cols = rowGroupColsSvc?.columns; const groupCols = this.groupCols; const afterColumnsChanged = params.afterColumnsChanged; if (afterColumnsChanged || !groupCols || this.checkGroupCols) { this.checkGroupCols = false; if (groupCols && !groupColumnsChanged(groupCols, cols)) { if (afterColumnsChanged) { return "skip"; } } else { params.animate = false; const topLevelChanged = groupCols[0]?.col.getId() !== cols?.[0]?.getId(); makeGroupColumns(cols, groupCols); return topLevelChanged ? "refresh" : "groupColsChanged"; } } return "refresh"; } handleDeltaUpdate(rootNode, changedPath, { removals, updates, adds, reordered }, animate) { const parentsWithRemovals = /* @__PURE__ */ new Set(); for (let i = 0, len = removals.length; i < len; ++i) { const rowNode = removals[i]; const oldParent = this.removeFromParent(rowNode); if (!parentsWithRemovals.has(oldParent)) { parentsWithRemovals.add(oldParent); changedPath?.addRow(oldParent); } } for (const rowNode of updates) { const oldParent = rowNode.parent; changedPath?.addRow(oldParent); if (this.moveNodeInWrongPath(rootNode, rowNode)) { parentsWithRemovals.add(oldParent); const newParent = rowNode.parent; changedPath?.addRow(newParent); reordered || (reordered = (newParent?.childrenAfterGroup?.length ?? 0) > 1); } } if (adds.size) { for (const rowNode of adds) { this.insertOneNode(rootNode, rowNode); const newParent = rowNode.parent; changedPath?.addRow(newParent); reordered || (reordered = (newParent?.childrenAfterGroup?.length ?? 0) > 1); } } if (parentsWithRemovals.size) { batchedRemove(parentsWithRemovals); this.removeEmptyGroups(parentsWithRemovals, animate); } if (reordered) { this.sortChildren(rootNode, changedPath); } } // this is used when doing delta updates, eg Redux, keeps nodes in right order sortChildren(rootNode, changedPath) { _forEachChangedGroupDepthFirst(rootNode, true, void 0, (node) => { const didSort = sortGroupChildren(node.childrenAfterGroup); if (didSort) { changedPath?.addRow(node); } }); } orderGroups(rootNode) { const initialGroupOrderComparator = this.gos.getCallback("initialGroupOrderComparator"); if (!initialGroupOrderComparator) { return; } const beans = this.beans; const api = beans.gridApi; const context = beans.gridOptions.context; const comparer = (nodeA, nodeB) => initialGroupOrderComparator({ api, context, nodeA, nodeB }); const recursiveSort = (rowNode) => { const childrenAfterGroup = rowNode.childrenAfterGroup; const childrenAfterGroupLen = childrenAfterGroup?.length; if (!childrenAfterGroupLen || rowNode.leafGroup) { return; } if (childrenAfterGroupLen > 1) { childrenAfterGroup.sort(comparer); } for (let i = 0, len = childrenAfterGroupLen; i < len; ++i) { recursiveSort(childrenAfterGroup[i]); } }; recursiveSort(rootNode); } moveNodeInWrongPath(rootNode, childNode) { const { valueSvc } = this.beans; const createGroupForEmpty = this.groupEmpty; let ancestor = childNode.parent; let changed = false; const groupCols = this.groupCols; if (!groupCols) { return false; } for (let idx = groupCols.length - 1; idx >= 0; --idx) { const { col } = groupCols[idx]; let key = valueSvc.getKeyForNode(col, childNode); if (key == null || key === "") { if (!createGroupForEmpty) { continue; } key = ""; } if (!ancestor?.parent || ancestor.key !== key) { changed = true; break; } ancestor = ancestor.parent; } changed || (changed = !!ancestor?.parent); if (!changed) { return false; } this.removeFromParent(childNode); this.insertOneNode(rootNode, childNode); childNode.setData(childNode.data); return true; } groupShouldBeRemoved(rowNode) { const mapKey = this.getChildrenMappedKey(rowNode.key, rowNode.rowGroupColumn); const parentChildrenMapped = rowNode.parent?.childrenMapped; const groupAlreadyRemoved = parentChildrenMapped ? !parentChildrenMapped[mapKey] : true; if (groupAlreadyRemoved) { return false; } return !!rowNode.group && (rowNode.childrenAfterGroup?.length ?? 0) === 0; } removeEmptyGroups(parents, animate) { const selectionSvc = this.beans.selectionSvc; let nodesToUnselect; const possibleEmptyGroups = Array.from(parents); const groupsById = this.nonLeafsById; do { parents.clear(); for (let idx = 0; idx < possibleEmptyGroups.length; ++idx) { let pointer = possibleEmptyGroups[idx]; while (pointer) { const parent = pointer.parent; if (pointer.destroyed) { possibleEmptyGroups[idx] = parent; pointer = parent; continue; } if (!parent) { break; } if (!this.groupShouldBeRemoved(pointer)) { pointer = parent; continue; } parents.add(parent); this.removeFromParent(pointer); if (selectionSvc && pointer.isSelected()) { nodesToUnselect ?? (nodesToUnselect = []); nodesToUnselect.push(pointer); } possibleEmptyGroups[idx] = parent; groupsById.delete(pointer.id); pointer._destroy(animate); pointer = parent; } } batchedRemove(parents); } while (parents.size); if (nodesToUnselect) { selectionSvc.setNodesSelected({ nodes: nodesToUnselect, newValue: false, source: "rowGroupChanged" }); } } // removes the node from the parent by: // a) removing from childrenAfterGroup (using batchRemover if present, otherwise immediately) // b) removing from childrenMapped (immediately) // c) setRowTop(null) - as the rowRenderer uses this to know the RowNode is no longer needed // d) setRowIndex(null) - as the rowNode will no longer be displayed. removeFromParent(child) { const oldParent = child.parent; if (oldParent) { const mapKey = this.getChildrenMappedKey(child.key, child.rowGroupColumn); const childParentChildrenMapped = oldParent.childrenMapped; if (childParentChildrenMapped) { delete childParentChildrenMapped[mapKey]; } } child.setRowTop(null); child.setRowIndex(null); return oldParent; } /** * This is idempotent, but relies on the `key` field being the same throughout a RowNode's lifetime */ addToParent(child, parent) { const childrenMapped = parent.childrenMapped ?? (parent.childrenMapped = {}); const mapKey = this.getChildrenMappedKey(child.key, child.rowGroupColumn); if (childrenMapped[mapKey] !== child) { childrenMapped[mapKey] = child; let childrenAfterGroup = parent.childrenAfterGroup; if (!childrenAfterGroup) { parent.childrenAfterGroup = childrenAfterGroup = []; const sibling = parent.sibling; if (sibling) { sibling.childrenAfterGroup = parent.childrenAfterGroup; } } childrenAfterGroup.push(child); setRowNodeGroup(parent, this.beans, true); invalidateAllLeafChildren(parent); } } shotgunResetEverything(rootNode) { const groupsById = this.nonLeafsById; for (const node of groupsById.values()) { node.childrenAfterGroup = null; node.childrenMapped = null; } rootNode.leafGroup = !this.groupCols?.length; rootNode.childrenAfterGroup = []; rootNode.childrenMapped = {}; rootNode.updateHasChildren(); const sibling = rootNode.sibling; if (sibling) { sibling.childrenAfterGroup = rootNode.childrenAfterGroup; sibling.childrenMapped = rootNode.childrenMapped; } const allLeafs = rootNode._leafs; for (let i = 0, len = allLeafs.length; i < len; ++i) { this.insertOneNode(rootNode, allLeafs[i]); } this.destroyStaleGroups(groupsById); } /** Remove and destroy group nodes that were not reused (still have childrenAfterGroup === null) */ destroyStaleGroups(groupsById) { const selectionSvc = this.beans.selectionSvc; let nodesToDeselect; for (const [id, node] of groupsById) { if (node.childrenAfterGroup !== null) { continue; } if (selectionSvc && node.isSelected()) { (nodesToDeselect ?? (nodesToDeselect = [])).push(node); } groupsById.delete(id); node._destroy(false); } if (nodesToDeselect) { selectionSvc.setNodesSelected({ nodes: nodesToDeselect, newValue: false, source: "rowGroupChanged" }); } } insertOneNode(rootNode, childNode) { let parentGroup = rootNode; const { beans, groupCols, groupEmpty } = this; const valueSvc = beans.valueSvc; if (!groupCols) { return; } const len = groupCols.length; for (let i = 0; i < len; ++i) { const groupCol = groupCols[i]; const col = groupCol.col; let key = valueSvc.getKeyForNode(col, childNode); if (key == null || key === "") { if (!groupEmpty) { continue; } key = ""; } const existingGroup = parentGroup.childrenMapped?.[this.getChildrenMappedKey(key, col)]; if (existingGroup) { parentGroup = existingGroup; continue; } const nextLevel = parentGroup.level + 1; const isLeafLevel = nextLevel >= len - 1; const newGroup = this.createGroup(parentGroup, groupCol, key, nextLevel, isLeafLevel, childNode); this.addToParent(newGroup, parentGroup); parentGroup = newGroup; } if (!parentGroup.group) { _warn(184, { parentGroupData: parentGroup.data, childNodeData: childNode.data }); } childNode.parent = parentGroup; childNode.level = parentGroup.level + 1; parentGroup.childrenAfterGroup.push(childNode); parentGroup.updateHasChildren(); invalidateAllLeafChildren(parentGroup); } createGroup(parent, groupCol, key, level, isLeafLevel, leafNode) { const col = groupCol.col; const id = (parent.level >= 0 ? parent.id + "-" : "row-group-") + (col.getColId() + "-" + key); const groupsById = this.nonLeafsById; let node = groupsById.get(id); let singleUse = true; if (node) { if (node.childrenAfterGroup !== null) { node._expanded ?? (node._expanded = null); return node; } singleUse = false; invalidateAllLeafChildren(node); } else { node = new RowNode(this.beans); node.group = true; node.key = key; node.id = id; node.aggData = null; groupsById.set(id, node); } const applyValuesToNode = (n) => { n.childrenAfterGroup = children; n.childrenMapped = mapped; n.parent = parent; n.level = level; n.rowGroupIndex = level; n.leafGroup = isLeafLevel; }; const children = []; const mapped = {}; applyValuesToNode(node); node.field = groupCol.field ?? null; node.rowGroupColumn = col; node.groupValue = this.beans.valueSvc.getValue(col, leafNode, "data"); node._expanded ?? (node._expanded = null); if (singleUse) { node.setAllChildrenCount(0); node.updateHasChildren(); return node; } const sibling = node.sibling; if (sibling) { applyValuesToNode(sibling); } node.dispatchRowEvent("hasChildrenChanged"); return node; } getChildrenMappedKey(key, rowGroupColumn) { return rowGroupColumn ? rowGroupColumn.getId() + "-" + key : key; } onShowRowGroupColsSetChanged() { const { rowModel, valueSvc } = this.beans; for (const groupNode of this.nonLeafsById.values()) { groupNode._groupData = void 0; const rowGroupColumn = groupNode.rowGroupColumn; const leafNode = rowGroupColumn && _csrmFirstLeaf(groupNode); groupNode.groupValue = leafNode && valueSvc.getValue(rowGroupColumn, leafNode, "data"); } const allLeafs = rowModel.rootNode?._leafs; if (allLeafs) { for (let i = 0, len = allLeafs.length; i < len; ++i) { const leafNode = allLeafs[i]; leafNode.parent._groupData = void 0; } } } }; var batchedRemove = (parents) => { for (const parent of parents) { const childrenAfterGroup = parent?.childrenAfterGroup; if (!childrenAfterGroup) { continue; } const childrenAfterGroupLen = childrenAfterGroup.length; let writeIdx = 0; for (let readIdx = 0; readIdx < childrenAfterGroupLen; ++readIdx) { const item = childrenAfterGroup[readIdx]; if (item.parent === parent && !item.destroyed) { if (writeIdx !== readIdx) { childrenAfterGroup[writeIdx] = item; } ++writeIdx; } } if (childrenAfterGroupLen !== writeIdx) { childrenAfterGroup.length = writeIdx; parent.updateHasChildren(); invalidateAllLeafChildren(parent); } } }; var invalidateAllLeafChildren = (node) => { while (node._leafs !== void 0) { const parent = node.parent; if (!parent) { break; } node._leafs = void 0; node = parent; } }; // packages/ag-grid-enterprise/src/rowGrouping/rowGroupingApi.ts function setRowGroupColumns(beans, colKeys) { beans.rowGroupColsSvc?.setColumns(colKeys, "api"); } function removeRowGroupColumns(beans, colKeys) { beans.rowGroupColsSvc?.removeColumns(colKeys, "api"); } function addRowGroupColumns(beans, colKeys) { beans.rowGroupColsSvc?.addColumns(colKeys, "api"); } function moveRowGroupColumn(beans, fromIndex, toIndex) { beans.rowGroupColsSvc?.moveColumn?.(fromIndex, toIndex, "api"); } function getRowGroupColumns(beans) { return beans.rowGroupColsSvc?.columns ?? []; } // packages/ag-grid-enterprise/src/rowGrouping/rowGroupingModule.ts var SharedRowGroupingModule = { moduleName: "SharedRowGrouping", version: VERSION2, apiFunctions: { setRowGroupColumns, removeRowGroupColumns, addRowGroupColumns, getRowGroupColumns, moveRowGroupColumn }, dependsOn: [ EnterpriseCoreModule, SharedAggregationModule, GroupColumnModule, StickyRowModule, GroupHierarchyModule ] }; var RowGroupingModule = { moduleName: "RowGrouping", version: VERSION2, dynamicBeans: { groupStrategy: GroupStrategy }, rowModels: ["clientSide"], dependsOn: [SharedRowGroupingModule, AggregationModule, ClientSideRowModelHierarchyModule, GroupEditModule] }; var RowGroupingPanelModule = { moduleName: "RowGroupingPanel", version: VERSION2, selectors: [AgGridHeaderDropZonesSelector], icons: { // identifies the pivot drop zone pivotPanel: "pivot", // "Row groups" drop zone in column tool panel rowGroupPanel: "group", // separator between column 'pills' when you add multiple columns to the header drop zone panelDelimiter: "small-right", // version of panelDelimiter used in RTL mode panelDelimiterRtl: "small-left" }, dependsOn: [SharedColumnStateUpdateStrategyModule, PopupModule] }; var GroupFilterModule = { moduleName: "GroupFilter", version: VERSION2, userComponents: { agGroupColumnFilter: { classImp: GroupFilter, processParams: processGroupFilterParams }, agGroupColumnFloatingFilter: GroupFloatingFilterComp }, beans: [GroupFilterService], dynamicBeans: { agGroupColumnFilterHandler: GroupFilterHandler }, dependsOn: [EnterpriseCoreModule, ColumnFilterModule] }; // packages/ag-grid-enterprise/src/viewportRowModel/viewportRowModel.ts var ViewportRowModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowModel"; this.hierarchical = false; // rowRenderer tells us these this.firstRow = -1; this.lastRow = -1; // datasource tells us this this.rowCount = -1; this.rowNodesByIndex = {}; /** Dummy root node */ this.rootNode = null; /** * Used to see if setRowData has been called inside of the viewportChanged event context, * if so the new rows are already being calculated, and the model does not need updated * otherwise, a new model event needs to fire as rows have changed externally. */ this.viewportChangedContext = false; } // we don't implement as lazy row heights is not supported in this row model ensureRowHeightsValid(_startPixel, _endPixel, _startLimitIndex, _endLimitIndex) { return false; } postConstruct() { const beans = this.beans; const rootNode = new RowNode(beans); this.rootNode = rootNode; rootNode.level = -1; this.rowHeight = _getRowHeightAsNumber(beans); this.addManagedEventListeners({ viewportChanged: this.onViewportChanged.bind(this) }); this.addManagedPropertyListener("viewportDatasource", () => this.updateDatasource()); this.addManagedPropertyListener("rowHeight", () => { this.rowHeight = _getRowHeightAsNumber(beans); this.updateRowHeights(); }); } start() { this.updateDatasource(); } isLastRowIndexKnown() { return true; } destroy() { this.destroyDatasource(); super.destroy(); this.rootNode = null; } destroyDatasource() { const datasource = this.datasource; if (!datasource) { return; } datasource.destroy?.(); this.beans.rowRenderer.datasourceChanged(); this.firstRow = -1; this.lastRow = -1; } updateDatasource() { const datasource = this.gos.get("viewportDatasource"); if (datasource) { this.setViewportDatasource(datasource); } } getPageSize() { return this.gos.get("viewportRowModelPageSize"); } getBufferSize() { return this.gos.get("viewportRowModelBufferSize"); } calculateFirstRow(firstRenderedRow) { const bufferSize = this.getBufferSize(); const pageSize = this.getPageSize(); const afterBuffer = firstRenderedRow - bufferSize; if (afterBuffer < 0) { return 0; } return Math.floor(afterBuffer / pageSize) * pageSize; } calculateLastRow(lastRenderedRow) { if (lastRenderedRow === -1) { return lastRenderedRow; } const bufferSize = this.getBufferSize(); const pageSize = this.getPageSize(); const afterBuffer = lastRenderedRow + bufferSize; const result = Math.ceil(afterBuffer / pageSize) * pageSize; const lastRowIndex = this.rowCount - 1; return Math.min(result, lastRowIndex); } onViewportChanged(event) { const newFirst = this.calculateFirstRow(event.firstRow); const newLast = this.calculateLastRow(event.lastRow); if (this.firstRow !== newFirst || this.lastRow !== newLast) { this.firstRow = newFirst; this.lastRow = newLast; this.purgeRowsNotInViewport(); this.viewportChangedContext = true; this.datasource?.setViewportRange(this.firstRow, this.lastRow); this.viewportChangedContext = false; } } purgeRowsNotInViewport() { const rowNodesByIndex = this.rowNodesByIndex; for (const indexStr of Object.keys(rowNodesByIndex)) { const index = parseInt(indexStr, 10); if (index < this.firstRow || index > this.lastRow) { if (this.isRowFocused(index) || this.beans.editSvc?.isRowEditing(rowNodesByIndex[index])) { continue; } delete rowNodesByIndex[index]; } } } isRowFocused(rowIndex) { const focusedCell = this.beans.focusSvc.getFocusCellToUseAfterRefresh(); if (!focusedCell) { return false; } if (focusedCell.rowPinned != null) { return false; } const hasFocus = focusedCell.rowIndex === rowIndex; return hasFocus; } setViewportDatasource(viewportDatasource) { this.destroyDatasource(); this.datasource = viewportDatasource; this.rowCount = -1; if (!viewportDatasource.init) { _warn(226); } else { viewportDatasource.init( _addGridCommonParams(this.gos, { setRowCount: this.setRowCount.bind(this), setRowData: this.setRowData.bind(this), getRow: this.getRow.bind(this) }) ); } } getType() { return "viewport"; } getRow(rowIndex) { if (!this.rowNodesByIndex[rowIndex]) { this.rowNodesByIndex[rowIndex] = this.createBlankRowNode(rowIndex); } return this.rowNodesByIndex[rowIndex]; } getRowNode(id) { let result; this.forEachNode((rowNode) => { if (rowNode.id === id) { result = rowNode; } }); return result; } getRowCount() { return this.rowCount === -1 ? 0 : this.rowCount; } getRowIndexAtPixel(pixel) { if (this.rowHeight !== 0) { return Math.floor(pixel / this.rowHeight); } return 0; } /** Viewport row model does not support dynamic row heights by design and while it is possible to implement this feature, it leads to view-model desync due to data being not isotropic in time */ resetRowHeights() { } /** Viewport row model does not support dynamic row heights by design and while it is possible to implement this feature, it leads to view-model desync due to data being not isotropic in time */ onRowHeightChanged() { } getRowBounds(index) { const rowHeight = this.rowHeight; return { rowHeight, rowTop: rowHeight * index }; } updateRowHeights() { const rowHeight = this.rowHeight; this.forEachNode((node) => { node.setRowHeight(rowHeight); node.setRowTop(rowHeight * node.rowIndex); }); this.eventSvc.dispatchEvent({ type: "modelUpdated", newData: false, newPage: false, keepRenderedRows: true, animate: false }); } getTopLevelRowCount() { return this.getRowCount(); } getTopLevelRowDisplayedIndex(topLevelIndex) { return topLevelIndex; } isEmpty() { return this.rowCount > 0; } getOverlayType() { return null; } isRowsToRender() { return this.rowCount > 0; } getNodesInRangeForSelection(firstInRange, lastInRange) { const firstIndex = firstInRange.rowIndex; const lastIndex = lastInRange.rowIndex; const firstNodeOutOfRange = firstIndex < this.firstRow || firstIndex > this.lastRow; const lastNodeOutOfRange = lastIndex < this.firstRow || lastIndex > this.lastRow; if (firstNodeOutOfRange || lastNodeOutOfRange) { return []; } const result = []; const startIndex = firstIndex <= lastIndex ? firstIndex : lastIndex; const endIndex = firstIndex <= lastIndex ? lastIndex : firstIndex; for (let i = startIndex; i <= endIndex; i++) { result.push(this.rowNodesByIndex[i]); } return result; } forEachNode(callback) { let callbackCount = 0; for (const indexStr of Object.keys(this.rowNodesByIndex)) { const index = parseInt(indexStr, 10); const rowNode = this.rowNodesByIndex[index]; callback(rowNode, callbackCount); callbackCount++; } } setRowData(rowData) { const getRowIdFunc = _getRowIdCallback(this.beans.gos); const existingNodesById = /* @__PURE__ */ new Map(); if (getRowIdFunc) { for (const row of Object.values(this.rowNodesByIndex)) { existingNodesById.set(row.id, row); } } for (let i = this.firstRow; i <= this.lastRow; i++) { const data = rowData[i]; if (!data) { continue; } let rowId; let row; if (getRowIdFunc) { rowId = getRowIdFunc({ data, rowPinned: void 0, level: 0, parentKeys: void 0 }); row = existingNodesById.get(rowId); } else { row = this.rowNodesByIndex[i]; } if (row) { row.updateData(data); row.setRowIndex(i); row.setRowTop(this.rowHeight * i); } else { row = this.createBlankRowNode(i); row.setDataAndId(data, rowId ?? i.toString()); } this.rowNodesByIndex[i] = row; } if (!this.viewportChangedContext) { this.eventSvc.dispatchEvent({ type: "modelUpdated", newData: false, newPage: false, keepRenderedRows: true, animate: false }); } } createBlankRowNode(rowIndex) { const rowNode = new RowNode(this.beans); const rowHeight = this.rowHeight; rowNode.setRowHeight(rowHeight); rowNode.setRowTop(rowHeight * rowIndex); rowNode.setRowIndex(rowIndex); return rowNode; } setRowCount(rowCount, keepRenderedRows = false) { if (rowCount === this.rowCount) { return; } this.rowCount = rowCount; const eventSvc = this.eventSvc; eventSvc.dispatchEventOnce({ type: "rowCountReady" }); eventSvc.dispatchEvent({ type: "modelUpdated", newData: false, newPage: false, keepRenderedRows, animate: false }); } isRowPresent(rowNode) { const foundRowNode = this.getRowNode(rowNode.id); return !!foundRowNode; } }; // packages/ag-grid-enterprise/src/viewportRowModel/viewportRowModelModule.ts var ViewportRowModelModule = { moduleName: "ViewportRowModel", version: VERSION2, rowModels: ["viewport"], beans: [ViewportRowModel], dependsOn: [EnterpriseCoreModule] }; // packages/ag-grid-enterprise/src/clipboard/clipboardApi.ts function copyToClipboard(beans, params) { beans.clipboardSvc?.copyToClipboard(params); } function cutToClipboard(beans, params) { beans.clipboardSvc?.cutToClipboard(params); } function copySelectedRowsToClipboard(beans, params) { beans.clipboardSvc?.copySelectedRowsToClipboard(params); } function copySelectedRangeToClipboard(beans, params) { beans.clipboardSvc?.copySelectedRangeToClipboard(params); } function copySelectedRangeDown(beans) { beans.clipboardSvc?.copyRangeDown(); } function pasteFromClipboard(beans) { beans.clipboardSvc?.pasteFromClipboard(); } // packages/ag-grid-enterprise/src/clipboard/clipboardService.ts var SOURCE_PASTE2 = "paste"; var EXPORT_TYPE_DRAG_COPY = "dragCopy"; var EXPORT_TYPE_CLIPBOARD = "clipboard"; function stringToArray(strData, delimiter = ",") { const data = []; const isNewline = (char) => char === "\r" || char === "\n"; let insideQuotedField = false; if (strData === "") { return [[""]]; } for (let row = 0, column = 0, position = 0; position < strData.length; position++) { const previousChar = strData[position - 1]; const currentChar = strData[position]; const nextChar = strData[position + 1]; const ensureDataExists = () => { if (!data[row]) { data[row] = []; } if (!data[row][column]) { data[row][column] = ""; } }; ensureDataExists(); if (currentChar === '"') { if (insideQuotedField) { if (nextChar === '"') { data[row][column] += '"'; position++; } else { insideQuotedField = false; } } else if (previousChar === void 0 || previousChar === delimiter || isNewline(previousChar)) { insideQuotedField = true; } } if (!insideQuotedField && currentChar !== '"') { if (currentChar === delimiter) { column++; ensureDataExists(); continue; } else if (isNewline(currentChar)) { column = 0; row++; ensureDataExists(); if (currentChar === "\r" && nextChar === "\n") { position++; } continue; } } data[row][column] += currentChar; } return data; } var ClipboardService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "clipboardSvc"; this.clientSideRowModel = null; this.gridCtrl = null; this.lastPasteOperationTime = 0; this.navigatorApiFailed = false; } postConstruct() { const { gos, rowModel, ctrlsSvc } = this.beans; if (_isClientSideRowModel(gos, rowModel)) { this.clientSideRowModel = rowModel; } ctrlsSvc.whenReady(this, (p) => { this.gridCtrl = p.gridCtrl; }); } destroy() { super.destroy(); this.clientSideRowModel = null; this.gridCtrl = null; } pasteFromClipboard() { const allowNavigator = !this.gos.get("suppressClipboardApi"); if (allowNavigator && !this.navigatorApiFailed && navigator.clipboard?.readText) { navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((e) => { _warn(40, { e, method: "readText" }); this.navigatorApiFailed = true; this.pasteFromClipboardLegacy(); }); } else { this.pasteFromClipboardLegacy(); } } pasteFromClipboardLegacy() { let defaultPrevented = false; const handlePasteEvent = (e) => { const currentPastOperationTime = Date.now(); if (currentPastOperationTime - this.lastPasteOperationTime < 50) { defaultPrevented = true; e.preventDefault(); } this.lastPasteOperationTime = currentPastOperationTime; }; this.executeOnTempElement( (textArea) => { textArea.addEventListener("paste", handlePasteEvent); textArea.focus({ preventScroll: true }); }, (element) => { const data = element.value; if (!defaultPrevented) { this.processClipboardData(data); } else { this.refocusLastFocusedCell(); } element.removeEventListener("paste", handlePasteEvent); } ); } refocusLastFocusedCell() { const { focusSvc } = this.beans; const focusedCell = focusSvc.getFocusedCell(); if (focusedCell) { focusSvc.setFocusedCell({ rowIndex: focusedCell.rowIndex, column: focusedCell.column, rowPinned: focusedCell.rowPinned, forceBrowserFocus: true }); } } getClipboardDelimiter() { const delimiter = this.gos.get("clipboardDelimiter"); return _exists(delimiter) ? delimiter : " "; } processClipboardData(data) { if (data == null) { return; } let parsedData = stringToArray(data, this.getClipboardDelimiter()); const userFunc = this.gos.getCallback("processDataFromClipboard"); if (userFunc) { parsedData = userFunc({ data: parsedData }); } if (parsedData == null) { return; } if (this.gos.get("suppressLastEmptyLineOnPaste")) { this.removeLastLineIfBlank(parsedData); } const { rangeSvc, editSvc } = this.beans; const pasteOperation = (cellsToFlash, updatedRowNodes, focusedCell, changedPath) => { const rangeActive = rangeSvc?.isMoreThanOneCell(); const pasteIntoRange = rangeActive && !this.hasOnlyOneValueToPaste(parsedData); if (pasteIntoRange) { this.pasteIntoActiveRange(parsedData, cellsToFlash, updatedRowNodes, changedPath); } else { this.pasteStartingFromFocusedCell(parsedData, cellsToFlash, updatedRowNodes, focusedCell, changedPath); } editSvc?.stopEditing(void 0, { source: SOURCE_PASTE2 }); }; this.doPasteOperation(pasteOperation); } // common code to paste operations, e.g. paste to cell, paste to range, and copy range down doPasteOperation(pasteOperationFunc) { const source = "clipboard"; const { eventSvc, focusSvc, rowRenderer, gos } = this.beans; eventSvc.dispatchEvent({ type: "pasteStart", source }); const { clientSideRowModel } = this; const rootNode = clientSideRowModel?.rootNode; const changedPath = rootNode && this.beans.changedPathFactory?.newPath(gos.get("aggregateOnlyChangedColumns")); const cellsToFlash = {}; const updatedRowNodes = []; const focusedCell = focusSvc.getFocusedCell(); pasteOperationFunc(cellsToFlash, updatedRowNodes, focusedCell, changedPath); const nodesToRefresh = updatedRowNodes.slice(); if (changedPath) { clientSideRowModel.doAggregate(changedPath); _forEachChangedGroupDepthFirst(rootNode, clientSideRowModel.hierarchical, changedPath, (rowNode) => { nodesToRefresh.push(rowNode); }); } rowRenderer.refreshCells({ rowNodes: nodesToRefresh }); this.dispatchFlashCells(cellsToFlash); this.fireRowChanged(updatedRowNodes); this.refocusLastFocusedCell(); eventSvc.dispatchEvent({ type: "pasteEnd", source }); } getPreProcessRangeCallback(clipboardData) { return (cellRange) => { const { rangeSvc } = this.beans; if (!rangeSvc) { return; } const { rowDiff, colDiff } = this.getAdjustedRangeDimensionForPaste(cellRange, clipboardData); if (rowDiff !== 0) { rangeSvc.extendRangeRowCountBy(cellRange, rowDiff); } if (colDiff !== 0) { rangeSvc.extendRangeColumnCountBy(cellRange, colDiff); } }; } getAdjustedRangeDimensionForPaste(cellRange, clipboardData) { const rangeSvc = this.beans.rangeSvc; const clipboardRowCount = clipboardData.length; const rangeRowCount = rangeSvc.getRangeRowCount(cellRange); const isRowMultiple = rangeRowCount >= clipboardRowCount && rangeRowCount % clipboardRowCount === 0; const clipboardColCount = clipboardData[0].length; const rangeColCount = cellRange.columns.length; const isColMultiple = rangeColCount >= clipboardColCount && rangeColCount % clipboardColCount === 0; return { rowDiff: isRowMultiple ? 0 : clipboardRowCount - rangeRowCount, colDiff: isColMultiple ? 0 : clipboardColCount - rangeColCount }; } pasteIntoActiveRange(clipboardData, cellsToFlash, updatedRowNodes, changedPath) { let indexOffset = 0; let dataRowIndex = 0; const rowCallback = (currentRow, rowNode, range, rangeIndex) => { const atEndOfClipboardData = rangeIndex - indexOffset >= clipboardData.length; if (atEndOfClipboardData) { if (rangeIndex % clipboardData.length !== 0) { return; } indexOffset += dataRowIndex; dataRowIndex = 0; } const currentRowData = clipboardData[rangeIndex - indexOffset]; updatedRowNodes.push(rowNode); const processCellFromClipboardFunc = this.gos.getCallback("processCellFromClipboard"); const columns = range.columns; const selectionColIdx = columns.findIndex(isColumnSelectionCol); if (selectionColIdx !== -1) { columns.splice(selectionColIdx, 1); } for (let idx = 0; idx < columns.length; idx++) { const column = columns[idx]; if (!column.isCellEditable(rowNode) || column.isSuppressPaste(rowNode)) { continue; } let calculatedIdx = idx; if (idx >= currentRowData.length) { calculatedIdx = idx % currentRowData.length; } const newValue = this.processCell( rowNode, column, currentRowData[calculatedIdx], EXPORT_TYPE_DRAG_COPY, processCellFromClipboardFunc, true ); rowNode.setDataValue(column, newValue, SOURCE_PASTE2); changedPath?.addCell(rowNode.parent, column.getId()); const { rowIndex, rowPinned } = currentRow; const cellId = _createCellId({ rowIndex, column, rowPinned }); cellsToFlash[cellId] = true; } dataRowIndex++; }; this.iterateActiveRanges(rowCallback, false, this.getPreProcessRangeCallback(clipboardData)); } getDisplayedColumnsStartingAt(column) { let currentColumn = column; const columns = []; const { visibleCols } = this.beans; while (currentColumn && isSpecialCol(currentColumn)) { currentColumn = visibleCols.getColAfter(currentColumn); } while (currentColumn != null) { columns.push(currentColumn); currentColumn = visibleCols.getColAfter(currentColumn); } return columns; } pasteStartingFromFocusedCell(parsedData, cellsToFlash, updatedRowNodes, focusedCell, changedPath) { if (!focusedCell) { return; } const currentRow = { rowIndex: focusedCell.rowIndex, rowPinned: focusedCell.rowPinned }; const columnsToPasteInto = this.getDisplayedColumnsStartingAt(focusedCell.column); if (this.isPasteSingleValueIntoRange(parsedData)) { this.pasteSingleValueIntoRange(parsedData, updatedRowNodes, cellsToFlash, changedPath); } else { this.pasteMultipleValues( parsedData, currentRow, updatedRowNodes, columnsToPasteInto, cellsToFlash, EXPORT_TYPE_CLIPBOARD, changedPath ); } } // if range is active, and only one cell, then we paste this cell into all cells in the active range. isPasteSingleValueIntoRange(parsedData) { const rangeSvc = this.beans.rangeSvc; return this.hasOnlyOneValueToPaste(parsedData) && !!rangeSvc && !rangeSvc.isEmpty(); } pasteSingleValueIntoRange(parsedData, updatedRowNodes, cellsToFlash, changedPath) { const value = parsedData[0][0]; const rowCallback = (currentRow, rowNode, range) => { updatedRowNodes.push(rowNode); range.columns.forEach( (column) => this.updateCellValue(rowNode, column, value, cellsToFlash, EXPORT_TYPE_CLIPBOARD, changedPath) ); }; this.iterateActiveRanges(rowCallback); } hasOnlyOneValueToPaste(parsedData) { return parsedData.length === 1 && parsedData[0].length === 1; } copyRangeDown() { const { rangeSvc, gos, formula, valueSvc } = this.beans; if (!rangeSvc || rangeSvc.isEmpty()) { return; } const firstRowValues = []; const pasteOperation = (cellsToFlash, updatedRowNodes, focusedCell, changedPath) => { const processCellForClipboardFunc = gos.getCallback("processCellForClipboard"); const processCellFromClipboardFunc = gos.getCallback("processCellFromClipboard"); const rowCallback = (currentRow, rowNode, range) => { const { columns } = range; if (!firstRowValues.length) { columns.forEach((column) => { const value = this.processCell( rowNode, column, valueSvc.getValue(column, rowNode, "batch"), EXPORT_TYPE_DRAG_COPY, processCellForClipboardFunc, false, true ); firstRowValues.push(value); }); } else { updatedRowNodes.push(rowNode); columns.forEach((column, index) => { if (!column.isCellEditable(rowNode) || column.isSuppressPaste(rowNode)) { return; } const isFormula = column.isAllowFormula() && formula?.isFormula(firstRowValues[index]); if (isFormula) { firstRowValues[index] = formula?.updateFormulaByOffset({ value: firstRowValues[index], rowDelta: 1 }); } const firstRowValue = this.processCell( rowNode, column, firstRowValues[index], EXPORT_TYPE_DRAG_COPY, processCellFromClipboardFunc, true ); rowNode.setDataValue(column, firstRowValue, SOURCE_PASTE2); changedPath?.addCell(rowNode.parent, column.getId()); const { rowIndex, rowPinned } = currentRow; const cellId = _createCellId({ rowIndex, column, rowPinned }); cellsToFlash[cellId] = true; }); } }; this.iterateActiveRanges(rowCallback, true); }; this.doPasteOperation(pasteOperation); } removeLastLineIfBlank(parsedData) { const lastLine = _last(parsedData); const lastLineIsBlank = lastLine && lastLine.length === 1 && lastLine[0] === ""; if (lastLineIsBlank) { if (parsedData.length === 1) { return; } _removeFromArray(parsedData, lastLine); } } fireRowChanged(rowNodes) { if (this.gos.get("editType") !== "fullRow") { return; } for (const rowNode of rowNodes) { this.eventSvc.dispatchEvent({ type: "rowValueChanged", node: rowNode, data: rowNode.data, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned }); } } /** Returns true when a row should be skipped during paste. */ shouldSkipPasteRow(row, columns, skipGroupRows) { if (row.detail || row.footer) { return true; } if (skipGroupRows && row.group) { for (const col of columns) { if (col.isCellEditable(row)) { return false; } } return true; } return false; } pasteMultipleValues(clipboardGridData, currentRow, updatedRowNodes, columnsToPasteInto, cellsToFlash, type, changedPath) { let rowPointer = currentRow; const beans = this.beans; const { gos } = beans; const skipGroupRows = this.clientSideRowModel != null && !gos.get("enableGroupEdit") && !gos.get("treeData"); const getNextGoodRowNode = () => { while (rowPointer) { const res = _getRowNode(beans, rowPointer); rowPointer = _getRowBelow(beans, { rowPinned: rowPointer.rowPinned, rowIndex: rowPointer.rowIndex }); if (res != null && !this.shouldSkipPasteRow(res, columnsToPasteInto, skipGroupRows)) { return res; } } return null; }; for (const clipboardRowData of clipboardGridData) { const rowNode = getNextGoodRowNode(); if (!rowNode) { continue; } clipboardRowData.forEach( (value, index) => this.updateCellValue(rowNode, columnsToPasteInto[index], value, cellsToFlash, type, changedPath) ); updatedRowNodes.push(rowNode); } } updateCellValue(rowNode, column, value, cellsToFlash, type, changedPath) { if (!rowNode || !column?.isCellEditable(rowNode) || column?.isSuppressPaste(rowNode)) { return; } const processedValue = this.processCell( rowNode, column, value, type, this.gos.getCallback("processCellFromClipboard"), true ); rowNode.setDataValue(column, processedValue, SOURCE_PASTE2); const { rowIndex, rowPinned } = rowNode; const cellId = _createCellId({ rowIndex, column, rowPinned }); cellsToFlash[cellId] = true; changedPath?.addCell(rowNode.parent, column.getId()); } copyToClipboard(params = {}) { this.copyOrCutToClipboard(params); } cutToClipboard(params = {}, source = "api") { if (this.gos.get("suppressCutToClipboard")) { return; } this.eventSvc.dispatchEvent({ type: "cutStart", source }); this.copyOrCutToClipboard(params, true); this.eventSvc.dispatchEvent({ type: "cutEnd", source }); } copyOrCutToClipboard(params, cut) { let { includeHeaders, includeGroupHeaders } = params; const { gos, focusSvc } = this.beans; if (includeHeaders == null) { includeHeaders = gos.get("copyHeadersToClipboard"); } if (includeGroupHeaders == null) { includeGroupHeaders = gos.get("copyGroupHeadersToClipboard"); } const copyParams = { includeHeaders, includeGroupHeaders }; const rowSelection = gos.get("rowSelection"); const cellSelection = gos.get("cellSelection"); let cellClearType = null; if (this.shouldCopyCells(cellSelection, rowSelection)) { this.copySelectedRangeToClipboard(copyParams); cellClearType = 0 /* CellRange */; } else if (this.shouldCopyRows(rowSelection)) { this.copySelectedRowsToClipboard(copyParams); cellClearType = 1 /* SelectedRows */; } else if (focusSvc.isAnyCellFocused()) { this.copyFocusedCellToClipboard(copyParams); cellClearType = 2 /* FocusedCell */; } if (cut && cellClearType !== null) { this.clearCellsAfterCopy(cellClearType); } } shouldCopyCells(cellSelection, rowSelection) { const { rangeSvc, selectionSvc, gos } = this.beans; if (!rangeSvc || rangeSvc.isEmpty()) { return false; } if (cellSelection) { const shouldCopyRowsInstead = typeof rowSelection === "object" && rowSelection.copySelectedRows && !selectionSvc?.isEmpty(); return !shouldCopyRowsInstead; } else { const suppressCopySingleCellRanges = gos.get("suppressCopySingleCellRanges"); const shouldSkip = !rangeSvc.isMoreThanOneCell() && suppressCopySingleCellRanges; return !shouldSkip; } } shouldCopyRows(rowSelection) { const { selectionSvc, gos } = this.beans; if (selectionSvc?.isEmpty() ?? true) { return false; } if (rowSelection && typeof rowSelection !== "string") { return rowSelection.copySelectedRows ?? false; } else { return !gos.get("suppressCopyRowsToClipboard"); } } clearCellsAfterCopy(type) { const beans = this.beans; const { rangeSvc, focusSvc, eventSvc } = beans; eventSvc.dispatchEvent({ type: "keyShortcutChangedCellStart" }); if (type === 0 /* CellRange */) { rangeSvc.clearCellRangeCellValues({ cellEventSource: "clipboardSvc" }); } else if (type === 1 /* SelectedRows */) { this.clearSelectedRows(); } else { const focusedCell = focusSvc.getFocusedCell(); if (focusedCell == null) { return; } const rowNode = _getRowNode(beans, focusedCell); if (rowNode) { this.clearCellValue(rowNode, focusedCell.column); } } eventSvc.dispatchEvent({ type: "keyShortcutChangedCellEnd" }); } clearSelectedRows() { const { selectionSvc, visibleCols } = this.beans; const selected = selectionSvc?.getSelectedNodes() ?? []; const columns = visibleCols.allCols; for (const row of selected) { for (const col of columns) { this.clearCellValue(row, col); } } } clearCellValue(rowNode, column) { if (!column.isCellEditable(rowNode)) { return; } const deleteValue = this.beans.valueSvc.getDeleteValue(column, rowNode); rowNode.setDataValue(column, deleteValue, "clipboardSvc"); } iterateActiveRanges(rowCallback, onlyFirst, preProcessRange) { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc || rangeSvc.isEmpty()) { return; } const currentCellRanges = rangeSvc.getCellRanges(); const cellRanges = onlyFirst ? [currentCellRanges[0]] : currentCellRanges; for (const cellRange of cellRanges) { this.iterateActiveRange({ cellRange, rowCallback, preProcessRange }); } } iterateActiveRange(params) { const { cellRange, preProcessRange, rowCallback } = params; const { beans } = this; const { rangeSvc } = beans; if (!rangeSvc) { return; } if (preProcessRange) { preProcessRange(cellRange); } let currentRow = rangeSvc.getRangeStartRow(cellRange); const lastRow = rangeSvc.getRangeEndRow(cellRange); let rangeIndex = 0; let isLastRow = false; while (!isLastRow && currentRow != null) { const rowNode = _getRowNode(beans, currentRow); isLastRow = _isSameRow(currentRow, lastRow); rowCallback(currentRow, rowNode, cellRange, rangeIndex++); currentRow = _getRowBelow(beans, currentRow); } } copySelectedRangeToClipboard(params = {}) { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc || rangeSvc.isEmpty()) { return; } const allRangesMerge = rangeSvc.areAllRangesAbleToMerge(); const { data, cellsToFlash } = allRangesMerge ? this.buildDataFromMergedRanges(rangeSvc, params) : this.buildDataFromRanges(rangeSvc, params); this.copyDataToClipboard(data); this.dispatchFlashCells(cellsToFlash); } buildDataFromMergedRanges(rangeSvc, params) { const columnsSet = /* @__PURE__ */ new Set(); const ranges = rangeSvc.getCellRanges(); const rowPositionsMap = /* @__PURE__ */ new Map(); const allRowPositions = []; const allCellsToFlash = {}; const isClientSideRowModel = _isClientSideRowModel(this.gos, this.beans.rowModel); const flatCache = /* @__PURE__ */ new Set(); if (!isClientSideRowModel) { this.beans.rowModel.forEachNode((node) => { flatCache.add(node.rowIndex); }); } for (const range of ranges) { range.columns.forEach((col) => columnsSet.add(col)); const { rowPositions, cellsToFlash } = this.getRangeRowPositionsAndCellsToFlash(rangeSvc, range); for (const rowPosition of rowPositions) { const isInCache = flatCache.has(rowPosition.rowIndex); if (!isClientSideRowModel && !isInCache) { continue; } const rowPositionAsString = `${rowPosition.rowIndex}-${rowPosition.rowPinned || "null"}`; if (!rowPositionsMap.get(rowPositionAsString)) { rowPositionsMap.set(rowPositionAsString, true); allRowPositions.push(rowPosition); } } Object.assign(allCellsToFlash, cellsToFlash); } const allColumns = this.beans.visibleCols.allCols; const exportedColumns = Array.from(columnsSet); exportedColumns.sort((a, b) => { const posA = allColumns.indexOf(a); const posB = allColumns.indexOf(b); return posA - posB; }); const data = this.buildExportParams({ columns: exportedColumns, rowPositions: allRowPositions, includeHeaders: params.includeHeaders, includeGroupHeaders: params.includeGroupHeaders }); return { data, cellsToFlash: allCellsToFlash }; } buildDataFromRanges(rangeSvc, params) { const ranges = rangeSvc.getCellRanges(); const data = []; const allCellsToFlash = {}; for (const range of ranges) { const { rowPositions, cellsToFlash } = this.getRangeRowPositionsAndCellsToFlash(rangeSvc, range); Object.assign(allCellsToFlash, cellsToFlash); data.push( this.buildExportParams({ columns: range.columns, rowPositions, includeHeaders: params.includeHeaders, includeGroupHeaders: params.includeGroupHeaders }) ); } return { data: data.join("\n"), cellsToFlash: allCellsToFlash }; } getRangeRowPositionsAndCellsToFlash(rangeSvc, range) { const rowPositions = []; const cellsToFlash = {}; const startRow = rangeSvc.getRangeStartRow(range); const lastRow = rangeSvc.getRangeEndRow(range); let node = startRow; while (node) { rowPositions.push(node); for (const column of range.columns) { const { rowIndex, rowPinned } = node; const cellId = _createCellId({ rowIndex, column, rowPinned }); cellsToFlash[cellId] = true; } if (_isSameRow(node, lastRow)) { break; } node = _getRowBelow(this.beans, node); } return { rowPositions, cellsToFlash }; } getCellsToFlashFromRowNodes(rowNodes) { const allDisplayedColumns = this.beans.visibleCols.allCols; const cellsToFlash = {}; for (let i = 0; i < rowNodes.length; i++) { const { level, rowIndex: index, rowPinned, sibling } = rowNodes[i]; const rowIndex = level === -1 ? sibling.rowIndex : index; if (rowIndex == null) { continue; } for (let j = 0; j < allDisplayedColumns.length; j++) { const column = allDisplayedColumns[j]; const cellId = _createCellId({ rowIndex, column, rowPinned }); cellsToFlash[cellId] = true; } } return cellsToFlash; } copyFocusedCellToClipboard(params = {}) { let focusedCell = this.beans.focusSvc.getFocusedCell(); if (focusedCell == null) { return; } focusedCell = this.beans.rowSpanSvc?.getCellStart(focusedCell) ?? focusedCell; const cellId = _createCellId(focusedCell); const currentRow = { rowPinned: focusedCell.rowPinned, rowIndex: focusedCell.rowIndex }; const column = focusedCell.column; const data = this.buildExportParams({ columns: [column], rowPositions: [currentRow], includeHeaders: params.includeHeaders, includeGroupHeaders: params.includeGroupHeaders }); this.copyDataToClipboard(data); this.dispatchFlashCells({ [cellId]: true }); } copySelectedRowsToClipboard(params = {}) { const { columnKeys, includeHeaders, includeGroupHeaders } = params; const data = this.buildExportParams({ columns: columnKeys, includeHeaders, includeGroupHeaders }); this.copyDataToClipboard(data); const rowNodes = this.beans.selectionSvc?.getSelectedNodes() || []; this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(rowNodes)); } buildExportParams(params) { const { columns, rowPositions, includeHeaders = false, includeGroupHeaders = false } = params; const { gos, csvCreator } = this.beans; const processRowGroupCallback = ({ node, column }) => { const { value, valueFormatted } = this.beans.valueSvc.getValueForDisplay({ column, node, includeValueFormatted: true, from: "batch" }); const val = valueFormatted ?? value ?? ""; const cb = gos.getCallback("processCellForClipboard"); if (!cb) { return val; } return cb({ column, node, value: val, type: EXPORT_TYPE_CLIPBOARD, formatValue: (valueToFormat) => this.beans.valueSvc.formatValue(column, node, valueToFormat) ?? valueToFormat, parseValue: (valueToParse) => this.beans.valueSvc.parseValue(column, node, valueToParse, value) ?? valueToParse }); }; const exportParams = { columnKeys: columns, rowPositions, skipColumnHeaders: !includeHeaders, skipColumnGroupHeaders: !includeGroupHeaders, suppressQuotes: true, columnSeparator: this.getClipboardDelimiter(), onlySelected: !rowPositions, valueFrom: "batch", processCellCallback: gos.getCallback("processCellForClipboard"), processRowGroupCallback, processHeaderCallback: gos.getCallback("processHeaderForClipboard"), processGroupHeaderCallback: gos.getCallback("processGroupHeaderForClipboard") }; return csvCreator.getDataAsCsv(exportParams, true); } // eslint-disable-next-line @typescript-eslint/ban-types dispatchFlashCells(cellsToFlash) { window.setTimeout(() => { this.eventSvc.dispatchEvent({ type: "flashCells", cells: cellsToFlash }); }, 0); } processCell(rowNode, column, value, type, func, canParse, canFormat) { const { valueSvc, formula } = this.beans; if (func) { const params = { column, node: rowNode, value, type, formatValue: (valueToFormat) => valueSvc.formatValue(column, rowNode ?? null, valueToFormat) ?? valueToFormat, parseValue: (valueToParse) => valueSvc.parseValue( column, rowNode ?? null, valueToParse, valueSvc.getValue(column, rowNode, "edit") ) }; return func(params); } if (canParse && column.getColDef().useValueParserForImport !== false) { return valueSvc.parseValue(column, rowNode ?? null, value, valueSvc.getValue(column, rowNode, "edit")); } if (canFormat && column.getColDef().useValueFormatterForExport !== false) { if (formula?.isFormula(value)) { return value; } return valueSvc.formatValue(column, rowNode ?? null, value) ?? value; } return value; } copyDataToClipboard(data) { const userProvidedFunc = this.gos.getCallback("sendToClipboard"); if (userProvidedFunc) { userProvidedFunc({ data }); return; } const allowNavigator = !this.gos.get("suppressClipboardApi"); if (allowNavigator && navigator.clipboard) { navigator.clipboard.writeText(data).catch((e) => { _warn(40, { e, method: "writeText" }); this.copyDataToClipboardLegacy(data); }); return; } this.copyDataToClipboardLegacy(data); } copyDataToClipboardLegacy(data) { this.executeOnTempElement((element) => { const eDocument = _getDocument(this.beans); const focusedElementBefore = _getActiveDomElement(this.beans); element.value = data || " "; element.select(); element.focus({ preventScroll: true }); const result = eDocument.execCommand("copy"); if (!result) { _warn(41); } if (focusedElementBefore?.focus != null) { focusedElementBefore.focus({ preventScroll: true }); } }); } executeOnTempElement(callbackNow, callbackAfter) { if (!this.gridCtrl) { return; } const eDoc = _getDocument(this.beans); const eTempInput = eDoc.createElement("textarea"); const style = eTempInput.style; style.width = "1px"; style.height = "1px"; const documentElement = eDoc.documentElement; style.top = documentElement.scrollTop + "px"; style.left = documentElement.scrollLeft + "px"; style.position = "absolute"; style.opacity = "0"; const guiRoot = this.gridCtrl.getGui(); guiRoot.appendChild(eTempInput); try { callbackNow(eTempInput); } catch (err) { _warn(42); } if (callbackAfter) { window.setTimeout(() => { callbackAfter(eTempInput); eTempInput.remove(); }, 100); } else { eTempInput.remove(); } } }; // packages/ag-grid-enterprise/src/clipboard/clipboardModule.ts var ClipboardModule = { moduleName: "Clipboard", version: VERSION2, beans: [ClipboardService], apiFunctions: { copyToClipboard, cutToClipboard, copySelectedRowsToClipboard, copySelectedRangeToClipboard, copySelectedRangeDown, pasteFromClipboard }, dependsOn: [EnterpriseCoreModule, CsvExportModule, KeyboardNavigationModule, HighlightChangesModule] }; // packages/ag-grid-enterprise/src/rowNumbers/rowNumbers.css var rowNumbers_default = '.ag-row-number-cell{background-color:var(--ag-header-background-color);border:none;color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}.ag-row-numbers-resizer{bottom:-2px;cursor:ns-resize;height:4px;position:absolute;width:100%}:where(.ag-ltr) .ag-row-numbers-resizer{left:0}:where(.ag-rtl) .ag-row-numbers-resizer{right:0}.ag-floating-bottom .ag-row-numbers-resizer{bottom:unset;top:-2px}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}'; // packages/ag-grid-enterprise/src/rowNumbers/rowNumbersRowResizer.ts var RowNumbersRowResizerElement = { tag: "div", cls: "ag-row-numbers-resizer" }; var AgRowNumbersRowResizer = class extends Component { constructor(cellCtrl) { super(RowNumbersRowResizerElement); this.cellCtrl = cellCtrl; this.initialYPosition = -1; this.dragging = false; } postConstruct() { const { beans, cellCtrl } = this; const { dragSvc, environment } = beans; this.defaultRowHeight = environment.getDefaultRowHeight(); dragSvc.addDragSource({ dragStartPixels: 0, eElement: this.getGui(), onDragStart: this.onDragStart.bind(this), onDragging: this.onDragging.bind(this), onDragStop: this.onDragStop.bind(this), onDragCancel: this.onDragCancel.bind(this), includeTouch: true, stopPropagationForTouch: true }); const rowPosition = cellCtrl.getRowPosition(); this.node = _getRowNode(this.beans, rowPosition); } onDragStart(mouseEvent) { if (!this.node) { return; } const { beans: { ctrlsSvc, eventSvc } } = this; const ctrl = ctrlsSvc.get("gridCtrl"); ctrl.setResizeCursor(Direction.Vertical); this.dragging = true; this.initialHeight = this.node.rowHeight; eventSvc.dispatchEvent({ type: "rowResizeStarted", node: this.node, event: mouseEvent, rowHeight: this.initialHeight }); } onDragging(mouseEvent) { let { clientY } = mouseEvent; if (this.cellCtrl.rowNode.rowPinned === "bottom") { clientY *= -1; } if (this.initialYPosition === -1 || !this.dragging) { this.initialYPosition = clientY; return; } const { beans, initialHeight, initialYPosition, defaultRowHeight, node } = this; if (initialHeight == null) { return; } const currentSize = node?.rowHeight; const newSize = Math.max(initialHeight - (initialYPosition - clientY), defaultRowHeight); if (currentSize === newSize) { return; } node?.setRowHeight(newSize); const { rowRenderer, rowModel, pinnedRowModel } = beans; const pinned = !!node?.rowPinned; if (pinned) { rowRenderer.redraw({ afterScroll: true }); } if (!pinned || pinnedRowModel?.isManual()) { rowModel.onRowHeightChanged({ animate: false }); } } onDragStop(mouseEvent) { this.beans.eventSvc.dispatchEvent({ type: "rowResizeEnded", node: this.node, event: mouseEvent, rowHeight: this.node?.rowHeight }); this.clearDragDetails(true); } onDragCancel() { this.clearDragDetails(true); } clearDragDetails(fromDragEvent) { this.initialYPosition = -1; this.initialHeight = null; this.dragging = false; if (fromDragEvent) { const ctrl = this.beans.ctrlsSvc.get("gridCtrl"); ctrl.setResizeCursor(false); } } destroy() { this.clearDragDetails(false); this.node = void 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/rowNumbers/rowNumbersRowResizeFeature.ts function _isRowNumbersResizerEnabled(beans) { const rowNumbers = _isRowNumbers(beans); return !(!rowNumbers || typeof rowNumbers !== "object" || !rowNumbers.enableRowResizer); } var RowNumbersRowResizeFeature = class { constructor(beans, cellCtrl) { this.beans = beans; this.cellCtrl = cellCtrl; } refreshRowResizer() { if (!_isRowNumbersResizerEnabled(this.beans) || !this.isRowResizeSupported(this.cellCtrl.rowNode)) { this.removeRowResizerFromCellComp(); } else { this.addResizerToCellComp(); } } isRowResizeSupported(node) { const { pinnedRowModel, rowModel, visibleCols } = this.beans; const rowModelModelHasOnRowHeightChanged = !!rowModel.onRowHeightChanged; if (visibleCols.autoHeightCols.length) { _warn(276); return false; } if (node.rowPinned != null) { return pinnedRowModel?.isManual() ? rowModelModelHasOnRowHeightChanged : true; } return rowModelModelHasOnRowHeightChanged; } addResizerToCellComp() { const { beans, cellCtrl } = this; let { rowResizer } = this; if (!rowResizer) { rowResizer = beans.registry.createDynamicBean( "rowNumberRowResizer", false, cellCtrl ); if (!rowResizer) { return; } this.rowResizer = beans.context.createBean(rowResizer); } cellCtrl.comp.setRowResizerElement(rowResizer.getGui()); } removeRowResizerFromCellComp() { const { rowResizer, beans: { context }, cellCtrl } = this; if (!rowResizer) { return; } cellCtrl.comp?.setRowResizerElement(null); this.rowResizer = context.destroyBean(rowResizer); } destroy() { this.removeRowResizerFromCellComp(); } }; // packages/ag-grid-enterprise/src/rowNumbers/rowNumbersService.ts var RowNumbersService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowNumbersSvc"; this.isIntegratedWithSelection = false; this.lastColumnResized = 0; } postConstruct() { const refreshCells_debounced = _debounce(this, this.refreshCells.bind(this), 10); this.addManagedEventListeners({ columnResized: () => { this.lastColumnResized = Date.now(); }, cellFocused: this.onGridCellFocused.bind(this), modelUpdated: (params) => { refreshCells_debounced(false, !params.keepRenderedRows); }, rangeSelectionChanged: () => this.refreshCells(true), pinnedRowsChanged: () => refreshCells_debounced(false, true) }); this.addManagedPropertyListeners(["rowNumbers", "cellSelection"], (e) => { this.updateColumns(e); }); this.refreshSelectionIntegration(); this.registerRangeSelectionExtension(); } shouldSkipColumn(column) { return _isRowNumbers(this.beans) && isRowNumberCol(column); } isAllColumnsSelectionCell(cellPosition) { return _isRowNumbers(this.beans) && isRowNumberCol(cellPosition.column); } isAllColumnsRange(range, allColumns) { if (!_isRowNumbers(this.beans) || allColumns.length === 0) { return false; } return range.columns.length === allColumns.length && allColumns.every((column) => range.columns.includes(column)); } registerRangeSelectionExtension() { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc) { return; } rangeSvc.registerRangeSelectionExtension(this); this.addDestroyFunc(() => rangeSvc.unregisterRangeSelectionExtension?.(this)); } addColumns(cols) { if (this.columns == null) { return; } cols.list = this.columns.list.concat(cols.list); cols.tree = this.columns.tree.concat(cols.tree); _updateColsMap(cols); } createColumns(cols, updateOrders) { const destroyCollection = () => { _destroyColumnTree(this.beans, this.columns?.tree); this.columns = null; }; const { beans } = this; if (!_isRowNumbers(beans)) { destroyCollection(); return; } const newTreeDepth = cols.treeDepth; const oldTreeDepth = this.columns?.treeDepth ?? -1; const treeDepthSame = oldTreeDepth == newTreeDepth; const list = this.generateRowNumberCols(); const areSame = _areColIdsEqual(list, this.columns?.list ?? []); if (areSame && treeDepthSame) { return; } destroyCollection(); const { colGroupSvc } = this.beans; const treeDepth = colGroupSvc?.findDepth(cols.tree) ?? 0; const tree = colGroupSvc?.balanceTreeForAutoCols(list, treeDepth) ?? []; this.columns = { list, tree, treeDepth, map: {} }; const putRowNumbersColsFirstInList = (cols2) => { if (!cols2) { return null; } const colsFiltered = cols2.filter((col) => !isRowNumberCol(col)); return [...list, ...colsFiltered]; }; updateOrders(putRowNumbersColsFirstInList); } handleMouseDownOnCell(cellPosition, mouseEvent) { if (!this.isIntegratedWithSelection || mouseEvent.target.classList.contains("ag-row-numbers-resizer")) { if (this.beans.rangeSvc) { mouseEvent.preventDefault(); } mouseEvent.stopImmediatePropagation(); return false; } if (!mouseEvent.shiftKey && !_interpretAsRightClick(this.beans, mouseEvent)) { this.focusFirstRenderedCellAtRowPosition(cellPosition); } return true; } handleKeyDownOnCell(cellPosition, event) { if (!this.isIntegratedWithSelection) { return false; } if (event.key === KeyCode.ENTER) { this.selectRowCells(cellPosition, event); event.preventDefault(); return true; } return false; } selectRowCells(cellPosition, keyboardEvent) { const { rangeSvc } = this.beans; if (!rangeSvc) { return; } rangeSvc.handleCellKeyboardSelect(keyboardEvent, cellPosition); } updateColumns(event) { const source = _convertColumnEventSourceType(event.source); this.refreshSelectionIntegration(); for (const col of this.columns?.list ?? []) { const colDef = this.createRowNumbersColDef(); col.setColDef(colDef, null, source); _applyColumnState(this.beans, { state: [_getColumnStateFromColDef(colDef, col.getColId())] }, source); } } getColumn() { return this.columns?.list.find(isRowNumberCol) ?? null; } getColumns() { return this.columns?.list ?? null; } setupForHeader(comp) { const { column, eGridHeader } = comp.params; if (!isRowNumberCol(column)) { return; } _setAriaLabel(eGridHeader, "Row Number"); this.addManagedElementListeners(eGridHeader, { click: this.onHeaderClick.bind(this), keydown: this.onHeaderKeyDown.bind(this), focus: this.onHeaderFocus.bind(this) }); } onGridCellFocused(event) { if (!this.isIntegratedWithSelection || event.rowIndex == null || !event.column || !isRowNumberCol(event.column)) { return; } const translate = this.getLocaleTextFunc(); const message = translate("ariaSelectAllRowCells", "Press Enter to select all cells on this row"); this.beans.ariaAnnounce?.announceValue(message, "ariaSelectAllRowCells"); } createRowNumbersRowResizerFeature(ctrl) { if (!_isRowNumbersResizerEnabled(this.beans)) { return void 0; } return new RowNumbersRowResizeFeature(this.beans, ctrl); } refreshSelectionIntegration() { const { beans } = this; const { gos, rangeSvc } = beans; const cellSelection = gos.get("cellSelection"); this.refreshRowNumberOverrides(); this.isIntegratedWithSelection = !!rangeSvc && !!cellSelection && !this.isSuppressCellSelectionIntegration; } refreshRowNumberOverrides() { const rowNumbers = _isRowNumbers(this.beans); this.rowNumberOverrides = {}; this.isSuppressCellSelectionIntegration = false; if (!rowNumbers || typeof rowNumbers !== "object") { return; } if (rowNumbers.suppressCellSelectionIntegration) { this.isSuppressCellSelectionIntegration = true; } const colDefValidProps = [ "contextMenuItems", "context", "onCellClicked", "onCellContextMenu", "onCellDoubleClicked", "headerTooltip", "headerStyle", "headerComponent", "headerComponentParams", "suppressHeaderKeyboardEvent", "suppressNavigable", "tooltipField", "tooltipValueGetter", "tooltipComponent", "tooltipComponentParams", "tooltipComponentSelector", "valueGetter", "valueFormatter", "width", "maxWidth", "minWidth", "resizable", "cellRenderer", "cellRendererSelector", "cellRendererParams" ]; for (const prop of colDefValidProps) { if (rowNumbers[prop] != null) { this.rowNumberOverrides[prop] = rowNumbers[prop]; } } } onHeaderFocus() { if (!this.isIntegratedWithSelection) { return; } const translate = this.getLocaleTextFunc(); const message = translate("ariaSelectAllCells", "Press Space or Enter to select all cells"); this.beans.ariaAnnounce?.announceValue(message, "ariaSelectAllCells"); } onHeaderKeyDown(e) { if (!this.isIntegratedWithSelection || e.key !== KeyCode.SPACE && e.key !== KeyCode.ENTER) { return; } e.preventDefault(); this.selectAllCellsFromHeader(); } onHeaderClick(_e) { if (Date.now() - this.lastColumnResized < 100 || !this.isIntegratedWithSelection || this.getColumn()?.resizing) { return; } this.focusAllCellsFromHeaderClick(); } selectAllCellsFromHeader() { _selectAllCells(this.beans); } focusAllCellsFromHeaderClick() { this.selectAllCellsFromHeader(); this.focusFirstRenderedCellAtRowPosition(); } refreshCells(force, runAutoSize) { const column = this.getColumn(); if (!column) { return; } if (runAutoSize) { const width = this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(column)], 2); if (width != null) { this.beans.colResize?.setColumnWidths( [{ key: column, newWidth: width }], false, true, "rowNumbersService" ); } } this.beans.rowRenderer.refreshCells({ columns: [column], force }); } createDummyElement(column) { const div = _createElement({ tag: "div", cls: "ag-cell-value ag-cell" }); let value = String(this.beans.rowModel.getRowCount() + 1); if (typeof this.rowNumberOverrides.valueFormatter === "function") { const valueFormatterParams = _addGridCommonParams(this.beans.gos, { data: void 0, value, node: null, column, colDef: column.colDef }); value = this.rowNumberOverrides.valueFormatter(valueFormatterParams); } div.textContent = value; return div; } createRowNumbersColDef() { const { gos, contextMenuSvc } = this.beans; const enableRTL = gos.get("enableRtl"); return { // overridable properties minWidth: 60, width: 60, resizable: false, valueGetter: this.valueGetter.bind(this), contextMenuItems: this.isIntegratedWithSelection || !contextMenuSvc ? void 0 : () => [], // overrides ...this.rowNumberOverrides, // non-overridable properties colId: ROW_NUMBERS_COLUMN_ID, chartDataType: "excluded", suppressHeaderMenuButton: true, sortable: false, suppressMovable: true, lockPinned: true, pinned: enableRTL ? "right" : "left", lockPosition: enableRTL ? "right" : "left", editable: false, suppressFillHandle: true, suppressAutoSize: true, suppressSizeToFit: true, suppressHeaderContextMenu: true, headerClass: this.getHeaderClass(), cellClass: this.getCellClass.bind(this), cellAriaRole: "rowheader" }; } valueGetter(params) { const node = params.node; const isFormulasActive = this.beans.formula?.active; const pinnedSibling = node?.pinnedSibling; if (node?.rowPinned && pinnedSibling) { const rowIndex = isFormulasActive ? pinnedSibling.formulaRowIndex : pinnedSibling.rowIndex; return `${rowIndex == null ? "-" : rowIndex + 1}`; } return String(((isFormulasActive ? node?.formulaRowIndex : node?.rowIndex) || 0) + 1); } getHeaderClass() { const cssClass = ["ag-row-number-header"]; if (this.isIntegratedWithSelection) { cssClass.push("ag-row-number-selection-enabled"); } return cssClass; } getCellClass(params) { const { beans } = this; const { rangeSvc, gos } = beans; const { node } = params; const cssClasses = ["ag-row-number-cell"]; const cellSelection = gos.get("cellSelection"); if (!rangeSvc || !cellSelection) { return cssClasses; } if (this.isIntegratedWithSelection) { cssClasses.push("ag-row-number-selection-enabled"); } const ranges = rangeSvc.getCellRanges(); if (!ranges.length) { return cssClasses; } const allColsLen = this.beans.visibleCols.allCols.length - 1; const shouldHighlight = typeof cellSelection === "object" && cellSelection.enableHeaderHighlight; for (const range of ranges) { if (rangeSvc.isRowInRange({ rowIndex: node.rowIndex, rowPinned: node.rowPinned }, range)) { if (shouldHighlight) { cssClasses.push("ag-row-number-range-highlight"); } if (range.columns.length === allColsLen) { cssClasses.push("ag-row-number-range-selected"); } } } return cssClasses; } generateRowNumberCols() { const { gos, beans } = this; if (!_isRowNumbers(beans)) { return []; } const colDef = this.createRowNumbersColDef(); const colId = colDef.colId; gos.validateColDef(colDef, colId, true); const col = new AgColumn(colDef, null, colId, false); this.createBean(col); return [col]; } focusFirstRenderedCellAtRowPosition(rowPosition) { const editSvc = this.beans.editSvc; if (editSvc?.isEditing() && editSvc.isRangeSelectionEnabledWhileEditing?.()) { return; } if (!rowPosition) { rowPosition = _getFirstRow(this.beans); if (!rowPosition) { return; } } const { beans, gos } = this; const { visibleCols, colViewport } = beans; const pinnedCols = gos.get("enableRtl") ? visibleCols.rightCols : visibleCols.leftCols; let columns; if (pinnedCols.length == 1) { const rowNode = _getRowNode(beans, rowPosition); if (!rowNode) { return; } columns = colViewport.getColsWithinViewport(rowNode); } else { columns = pinnedCols; } const column = columns.find((col) => !isRowNumberCol(col)); if (!column) { return; } const { rowPinned, rowIndex } = rowPosition; setTimeout(() => { beans.focusSvc.setFocusedCell({ rowIndex, rowPinned, column, forceBrowserFocus: true, preventScrollOnBrowserFocus: true }); }); } destroy() { _destroyColumnTree(this.beans, this.columns?.tree); this.rowNumberOverrides = null; super.destroy(); } }; // packages/ag-grid-enterprise/src/rowNumbers/rowNumbersModule.ts var RowNumbersModule = { moduleName: "RowNumbers", version: VERSION2, beans: [RowNumbersService], dynamicBeans: { rowNumberRowResizer: AgRowNumbersRowResizer }, dependsOn: [EnterpriseCoreModule, CellStyleModule, SharedDragAndDropModule], css: [rowNumbers_default] }; // packages/ag-grid-enterprise/src/filterToolPanel/agFiltersToolPanelHeader.ts var AgFiltersToolPanelHeaderElement = { tag: "div", cls: "ag-filter-toolpanel-search", role: "presentation", children: [ { tag: "div", ref: "eExpand", cls: "ag-filter-toolpanel-expand" }, { tag: "ag-input-text-field", ref: "eFilterTextField", cls: "ag-filter-toolpanel-search-input" } ] }; var AgFiltersToolPanelHeader = class extends Component { constructor() { super(...arguments); this.eExpand = RefPlaceholder; this.eFilterTextField = RefPlaceholder; } postConstruct() { this.setTemplate(AgFiltersToolPanelHeaderElement, [AgInputTextFieldSelector]); const translate = this.getLocaleTextFunc(); this.eFilterTextField.setAutoComplete(false).setInputAriaLabel(translate("ariaFilterColumnsInput", "Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)); this.createExpandIcons(); this.setExpandState(0 /* EXPANDED */); this.addManagedElementListeners(this.eExpand, { click: this.onExpandClicked.bind(this) }); this.addManagedEventListeners({ newColumnsLoaded: this.showOrHideOptions.bind(this) }); } init(params) { this.params = params; if (this.beans.colModel.ready) { this.showOrHideOptions(); } } createExpandIcons() { const { eExpand, beans } = this; eExpand.appendChild(this.eExpandChecked = _createIconNoSpan("accordionOpen", beans)); eExpand.appendChild(this.eExpandUnchecked = _createIconNoSpan("accordionClosed", beans)); eExpand.appendChild(this.eExpandIndeterminate = _createIconNoSpan("accordionIndeterminate", beans)); } // we only show expand / collapse if we are showing filters showOrHideOptions() { const { params, eFilterTextField } = this; const showFilterSearch = !params.suppressFilterSearch; const showExpand = !params.suppressExpandAll; const translate = this.getLocaleTextFunc(); eFilterTextField.setInputPlaceholder(translate("searchOoo", "Search...")); const isFilterGroupPresent = (col) => col.getOriginalParent() && col.isFilterAllowed(); const filterGroupsPresent = this.beans.colModel.getCols().some(isFilterGroupPresent); _setDisplayed(eFilterTextField.getGui(), showFilterSearch); _setDisplayed(this.eExpand, showExpand && filterGroupsPresent); } onSearchTextChanged() { if (!this.onSearchTextChangedDebounced) { this.onSearchTextChangedDebounced = _debounce( this, () => this.dispatchLocalEvent({ type: "searchChanged", searchText: this.eFilterTextField.getValue() }), 300 ); } this.onSearchTextChangedDebounced(); } onExpandClicked() { const event = this.currentExpandState === 0 /* EXPANDED */ ? { type: "collapseAll" } : { type: "expandAll" }; this.dispatchLocalEvent(event); } setExpandState(state) { this.currentExpandState = state; _setDisplayed(this.eExpandChecked, state === 0 /* EXPANDED */); _setDisplayed(this.eExpandUnchecked, state === 1 /* COLLAPSED */); _setDisplayed(this.eExpandIndeterminate, state === 2 /* INDETERMINATE */); } }; var AgFiltersToolPanelHeaderSelector = { selector: "AG-FILTERS-TOOL-PANEL-HEADER", component: AgFiltersToolPanelHeader }; // packages/ag-grid-enterprise/src/filterToolPanel/toolPanelFilterComp.ts var ToolPanelFilterElement = { tag: "div", cls: "ag-filter-toolpanel-instance", children: [ { tag: "div", ref: "eFilterToolPanelHeader", cls: "ag-filter-toolpanel-header ag-filter-toolpanel-instance-header", role: "button", attrs: { "aria-expanded": "false" }, children: [ { tag: "div", ref: "eExpand", cls: "ag-filter-toolpanel-expand" }, { tag: "span", ref: "eFilterName", cls: "ag-header-cell-text" }, { tag: "span", ref: "eFilterIcon", cls: "ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" } ] }, { tag: "div", ref: "agFilterToolPanelBody", cls: "ag-filter-toolpanel-instance-body ag-filter" } ] }; var ToolPanelFilterComp = class extends Component { constructor(hideHeader, expandedCallback) { super(ToolPanelFilterElement); this.hideHeader = hideHeader; this.expandedCallback = expandedCallback; this.eFilterToolPanelHeader = RefPlaceholder; this.eFilterName = RefPlaceholder; this.agFilterToolPanelBody = RefPlaceholder; this.eFilterIcon = RefPlaceholder; this.eExpand = RefPlaceholder; this.expanded = false; } postConstruct() { const { beans, eExpand, eFilterIcon } = this; const eExpandChecked = _createIconNoSpan("accordionOpen", beans); this.eExpandChecked = eExpandChecked; const eExpandUnchecked = _createIconNoSpan("accordionClosed", beans); this.eExpandUnchecked = eExpandUnchecked; eExpand.appendChild(eExpandChecked); eExpand.appendChild(eExpandUnchecked); const translate = this.getLocaleTextFunc(); _setAriaLabel(eFilterIcon, translate("ariaFilterActive", "Filter Active")); _setAriaRole(eFilterIcon, "img"); } setColumn(column) { this.column = column; const { beans, eFilterToolPanelHeader, eFilterIcon, eExpandChecked, hideHeader } = this; this.eFilterName.innerText = beans.colNames.getDisplayNameForColumn(column, "filterToolPanel", false) || ""; this.addManagedListeners(eFilterToolPanelHeader, { click: this.toggleExpanded.bind(this), keydown: this.onKeyDown.bind(this) }); this.addManagedEventListeners({ filterOpened: this.onFilterOpened.bind(this) }); this.addInIcon("filterActive", eFilterIcon, column); _setDisplayed(eFilterIcon, this.isFilterActive()); _setDisplayed(eExpandChecked, false); if (hideHeader) { _setDisplayed(eFilterToolPanelHeader, false); eFilterToolPanelHeader.removeAttribute("tabindex"); } else { eFilterToolPanelHeader.setAttribute("tabindex", "0"); } this.addManagedListeners(column, { filterChanged: this.onFilterChanged.bind(this) }); } onKeyDown(e) { const { key } = e; const { ENTER, SPACE, LEFT, RIGHT } = KeyCode; if (key !== ENTER && key !== SPACE && key !== LEFT && key !== RIGHT) { return; } e.preventDefault(); if (key === ENTER || key === SPACE) { this.toggleExpanded(); } else if (key === KeyCode.LEFT) { this.collapse(); } else { this.expand(); } } getColumn() { return this.column; } getColumnFilterName() { return this.beans.colNames.getDisplayNameForColumn(this.column, "filterToolPanel", false); } addCssClassToTitleBar(cssClass) { this.eFilterToolPanelHeader.classList.add(cssClass); } addInIcon(iconName, eParent, column) { if (eParent == null) { return; } const eIcon = _createIconNoSpan(iconName, this.beans, column); eParent.appendChild(eIcon); } isFilterActive() { return !!this.beans.colFilter?.isFilterActive(this.column); } onFilterChanged() { _setDisplayed(this.eFilterIcon, this.isFilterActive()); this.dispatchLocalEvent({ type: "filterChanged" }); } toggleExpanded() { if (this.expanded) { this.collapse(); } else { this.expand(); } } expand() { if (this.expanded) { return; } this.expanded = true; _setAriaExpanded(this.eFilterToolPanelHeader, true); _setDisplayed(this.eExpandChecked, true); _setDisplayed(this.eExpandUnchecked, false); this.addFilterElement(); this.expandedCallback(); } addFilterElement(suppressFocus) { const filterPanelWrapper = _createElement({ tag: "div", cls: "ag-filter-toolpanel-instance-filter" }); const comp = this.createManagedBean(new FilterComp(this.column, "TOOLBAR")); this.filterComp = comp; if (!comp.hasFilter()) { return; } comp.getFilter()?.then((filter) => { this.underlyingFilter = filter; if (!filter) { return; } filterPanelWrapper.appendChild(comp.getGui()); this.agFilterToolPanelBody.appendChild(filterPanelWrapper); comp.afterGuiAttached({ container: "toolPanel", suppressFocus }); }); } collapse() { if (!this.expanded) { return; } this.expanded = false; _setAriaExpanded(this.eFilterToolPanelHeader, false); this.removeFilterElement(); _setDisplayed(this.eExpandChecked, false); _setDisplayed(this.eExpandUnchecked, true); const filterComp = this.filterComp; filterComp?.afterGuiDetached(); this.destroyBean(filterComp); this.expandedCallback(); } removeFilterElement() { _clearElement(this.agFilterToolPanelBody); } isExpanded() { return this.expanded; } onPanelHidden() { if (!this.expanded) { return; } const filter = this.underlyingFilter; if (!filter) { return; } filter.afterGuiDetached?.(); } onFilterOpened(event) { if (event.source !== "COLUMN_MENU") { return; } if (event.column !== this.column) { return; } if (!this.expanded) { return; } this.collapse(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/toolPanelFilterGroupComp.ts var ToolPanelFilterGroupComp = class extends Component { constructor(columnGroup, childFilterComps, expandedCallback, depth, showingColumn) { super(); this.columnGroup = columnGroup; this.childFilterComps = childFilterComps; this.expandedCallback = expandedCallback; this.depth = depth; this.showingColumn = showingColumn; this.filterGroupComp = RefPlaceholder; } postConstruct() { const groupParams = { cssIdentifier: "filter-toolpanel", direction: "vertical" }; this.setTemplate( { tag: "div", cls: "ag-filter-toolpanel-group-wrapper", children: [{ tag: "ag-group-component", ref: "filterGroupComp" }] }, [AgGroupComponentSelector], { filterGroupComp: groupParams } ); this.setGroupTitle(); const { filterGroupComp, depth, childFilterComps, gos } = this; filterGroupComp.setAlignItems("stretch"); filterGroupComp.addCss(`ag-filter-toolpanel-group-level-${depth}`); filterGroupComp.getGui().style.setProperty("--ag-indentation-level", String(depth)); filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${depth}-header`); for (const filterComp of childFilterComps) { filterGroupComp.addItem(filterComp); filterComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${depth + 1}-header`); filterComp.getGui().style.setProperty("--ag-indentation-level", String(depth + 1)); } const column = this.showingColumn ? this.columnGroup : void 0; this.tooltipFeature = this.createOptionalManagedBean( this.beans.registry.createDynamicBean("tooltipFeature", false, { getGui: () => this.getGui(), getLocation: () => "filterToolPanelColumnGroup", shouldDisplayTooltip: _getShouldDisplayTooltip( gos, () => filterGroupComp.getGui().querySelector(".ag-group-title") ), getAdditionalParams: () => ({ colDef: column?.getColDef(), column }) }) ); this.refreshFilterClass(); this.addExpandCollapseListeners(); this.addFilterChangedListeners(); this.setupTooltip(); this.addInIcon("filterActive"); } setupTooltip() { if (!this.showingColumn) { return; } const refresh = () => { this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip); }; refresh(); this.addManagedEventListeners({ newColumnsLoaded: refresh }); } addCssClassToTitleBar(cssClass) { this.filterGroupComp.addCssClassToTitleBar(cssClass); } onPanelHidden() { for (const filterComp of this.childFilterComps) { filterComp.onPanelHidden(); } } isColumnGroup() { return isProvidedColumnGroup(this.columnGroup); } isExpanded() { return this.filterGroupComp.isExpanded(); } getChildren() { return this.childFilterComps; } getFilterGroupName() { return this.filterGroupName ?? ""; } getFilterGroupId() { return this.columnGroup.getId(); } hideGroupItem(hide, index) { this.filterGroupComp.hideItem(hide, index); } hideGroup(hide) { this.setDisplayed(!hide); } addInIcon(iconName) { const eIcon = _createIconNoSpan(iconName, this.beans); if (eIcon) { eIcon.classList.add("ag-filter-toolpanel-group-instance-header-icon"); const translate = this.getLocaleTextFunc(); _setAriaLabel(eIcon, translate("ariaFilterActive", "Filter Active")); _setAriaRole(eIcon, "img"); } this.filterGroupComp.addTitleBarWidget(eIcon); } forEachToolPanelFilterChild(action) { for (const filterComp of this.childFilterComps) { if (filterComp instanceof ToolPanelFilterComp) { action(filterComp); } } } addExpandCollapseListeners() { const expandListener = this.isColumnGroup() ? () => this.expandedCallback() : () => this.forEachToolPanelFilterChild((filterComp) => filterComp.expand()); const collapseListener = this.isColumnGroup() ? () => this.expandedCallback() : () => this.forEachToolPanelFilterChild((filterComp) => filterComp.collapse()); this.addManagedListeners(this.filterGroupComp, { expanded: expandListener, collapsed: collapseListener }); } getColumns() { if (isProvidedColumnGroup(this.columnGroup)) { return this.columnGroup.getLeafColumns(); } return [this.columnGroup]; } addFilterChangedListeners() { for (const column of this.getColumns()) { this.addManagedListeners(column, { filterChanged: () => this.refreshFilterClass() }); } if (!isProvidedColumnGroup(this.columnGroup)) { this.addManagedEventListeners({ filterOpened: this.onFilterOpened.bind(this) }); } } refreshFilterClass() { const columns = this.getColumns(); const anyChildFiltersActive = () => columns.some((col) => col.isFilterActive()); this.filterGroupComp.toggleCss("ag-has-filter", anyChildFiltersActive()); } onFilterOpened(event) { if (event.source !== "COLUMN_MENU") { return; } if (event.column !== this.columnGroup) { return; } if (!this.isExpanded()) { return; } this.collapse(); } expand() { this.filterGroupComp.toggleGroupExpand(true); } collapse() { this.filterGroupComp.toggleGroupExpand(false); } setGroupTitle() { const columnGroup = this.columnGroup; const filterGroupName = isProvidedColumnGroup(columnGroup) ? this.getColumnGroupName(columnGroup) : this.getColumnName(columnGroup); this.filterGroupName = filterGroupName; this.filterGroupComp.setTitle(filterGroupName || ""); } getColumnGroupName(columnGroup) { return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null, columnGroup, "filterToolPanel"); } getColumnName(column) { return this.beans.colNames.getDisplayNameForColumn(column, "filterToolPanel", false); } destroyFilters() { this.childFilterComps = this.destroyBeans(this.childFilterComps); _clearElement(this.getGui()); } destroy() { this.destroyFilters(); super.destroy(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/agFiltersToolPanelList.ts var AgFiltersToolPanelList = class extends Component { constructor() { super({ tag: "div", cls: "ag-filter-list-panel" }); this.initialised = false; this.hasLoadedInitialState = false; this.isInitialState = false; this.filterGroupComps = []; // If a column drag is happening, we suppress handling the event until it has completed this.suppressOnColumnsChanged = false; this.onColumnsChangedPending = false; } wireBeans(beans) { this.colModel = beans.colModel; } init(params) { this.initialised = true; const defaultParams = _addGridCommonParams(this.gos, { suppressExpandAll: false, suppressFilterSearch: false, suppressSyncLayoutWithGrid: false }); _mergeDeep(defaultParams, params); this.params = defaultParams; if (!defaultParams.suppressSyncLayoutWithGrid) { this.addManagedEventListeners({ columnMoved: () => this.onColumnsChanged() }); } this.addManagedEventListeners({ newColumnsLoaded: () => this.onColumnsChanged(), toolPanelVisibleChanged: (event) => { if (event.key === "filters" && !event.visible) { this.onPanelHidden(); } }, dragStarted: () => { this.suppressOnColumnsChanged = true; }, dragStopped: () => { this.suppressOnColumnsChanged = false; if (this.onColumnsChangedPending) { this.onColumnsChangedPending = false; this.onColumnsChanged(); } } }); if (this.colModel.ready) { this.onColumnsChanged(); } } onColumnsChanged() { if (this.suppressOnColumnsChanged) { this.onColumnsChangedPending = true; return; } const pivotModeActive = this.colModel.isPivotMode(); const shouldSyncColumnLayoutWithGrid = !this.params.suppressSyncLayoutWithGrid && !pivotModeActive; if (shouldSyncColumnLayoutWithGrid) { this.syncFilterLayout(); } else { this.buildTreeFromProvidedColumnDefs(); } this.refreshAriaLabel(); } syncFilterLayout() { syncLayoutWithGrid(this.colModel, this.setFiltersLayout.bind(this)); this.refreshAriaLabel(); } buildTreeFromProvidedColumnDefs() { const columnTree = this.colModel.getColDefColTree(); this.recreateFilters(columnTree); } setFiltersLayout(colDefs) { const columnTree = toolPanelCreateColumnTree(this.colModel, colDefs); this.recreateFilters(columnTree); } recreateFilters(columnTree) { const activeElement = _getActiveDomElement(this.beans); if (!this.hasLoadedInitialState) { this.hasLoadedInitialState = true; this.isInitialState = !!this.params.initialState; } const expansionState = this.getExpansionState(); this.destroyFilters(); const filterGroupComps = this.recursivelyAddComps(columnTree, 0, expansionState); this.filterGroupComps = filterGroupComps; const len = filterGroupComps.length; if (len) { for (const comp of filterGroupComps) { this.appendChild(comp); } this.setFirstAndLastVisible(0, len - 1); } const searchFilterText = this.searchFilterText; if (_exists(searchFilterText)) { this.searchFilters(searchFilterText); } this.fireExpandedEvent(); if (this.getGui().contains(activeElement)) { activeElement.focus(); } this.isInitialState = false; this.refreshAriaLabel(); } recursivelyAddComps(tree, depth, expansionState) { return tree.map((child) => { if (isProvidedColumnGroup(child)) { return this.recursivelyAddFilterGroupComps(child, depth, expansionState)?.flatMap((a) => a) ?? []; } const column = child; if (!this.shouldDisplayFilter(column)) { return []; } const hideFilterCompHeader = depth === 0; const filterComp = new ToolPanelFilterComp(hideFilterCompHeader, () => this.onFilterExpanded()); this.createBean(filterComp); filterComp.setColumn(column); if (expansionState.get(column.getId())) { filterComp.expand(); } if (depth > 0) { return filterComp; } const filterGroupComp = this.createBean( new ToolPanelFilterGroupComp(column, [filterComp], this.onGroupExpanded.bind(this), depth, true) ); filterGroupComp.addCssClassToTitleBar("ag-filter-toolpanel-header"); if (!expansionState.get(filterGroupComp.getFilterGroupId())) { filterGroupComp.collapse(); } return filterGroupComp; }).flatMap((a) => a); } refreshAriaLabel() { const translate = this.getLocaleTextFunc(); const filterListName = translate("ariaFilterPanelList", "Filter List"); const localeFilters = translate("filters", "Filters"); const eGui = this.getGui(); const groupSelector = ".ag-filter-toolpanel-group-wrapper"; const itemSelector = ".ag-filter-toolpanel-group-item"; const hiddenSelector = ".ag-hidden"; const visibleItems = eGui.querySelectorAll(`${itemSelector}:not(${groupSelector}, ${hiddenSelector})`); const totalVisibleItems = visibleItems.length; _setAriaLabel(this.getAriaElement(), `${filterListName} ${totalVisibleItems} ${localeFilters}`); } recursivelyAddFilterGroupComps(columnGroup, depth, expansionState) { if (!this.filtersExistInChildren(columnGroup.getChildren())) { return; } const colGroupDef = columnGroup.getColGroupDef(); if (colGroupDef?.suppressFiltersToolPanel) { return []; } const newDepth = columnGroup.isPadding() ? depth : depth + 1; const childFilterComps = this.recursivelyAddComps(columnGroup.getChildren(), newDepth, expansionState).flatMap( (a) => a ); if (columnGroup.isPadding()) { return childFilterComps; } const filterGroupComp = new ToolPanelFilterGroupComp( columnGroup, childFilterComps, this.onGroupExpanded.bind(this), depth, false ); this.createBean(filterGroupComp); filterGroupComp.addCssClassToTitleBar("ag-filter-toolpanel-header"); const expansionStateValue = expansionState.get(filterGroupComp.getFilterGroupId()); if (this.isInitialState && !expansionStateValue || expansionStateValue === false) { filterGroupComp.collapse(); } return [filterGroupComp]; } filtersExistInChildren(tree) { return tree.some((child) => { if (isProvidedColumnGroup(child)) { return this.filtersExistInChildren(child.getChildren()); } return this.shouldDisplayFilter(child); }); } shouldDisplayFilter(column) { const suppressFiltersToolPanel = column.getColDef()?.suppressFiltersToolPanel; return column.isFilterAllowed() && !suppressFiltersToolPanel; } getExpansionState() { const expansionState = /* @__PURE__ */ new Map(); if (this.isInitialState) { const { expandedColIds, expandedGroupIds } = this.params.initialState; for (const id of expandedColIds) { expansionState.set(id, true); } for (const id of expandedGroupIds) { expansionState.set(id, true); } return expansionState; } const recursiveGetExpansionState = (filterGroupComp) => { expansionState.set(filterGroupComp.getFilterGroupId(), filterGroupComp.isExpanded()); for (const child of filterGroupComp.getChildren()) { if (child instanceof ToolPanelFilterGroupComp) { recursiveGetExpansionState(child); } else { expansionState.set(child.getColumn().getId(), child.isExpanded()); } } }; this.filterGroupComps.forEach(recursiveGetExpansionState); return expansionState; } refresh() { } // lazy initialise the panel setVisible(visible) { super.setDisplayed(visible); if (visible && !this.initialised) { this.init(this.params); } } expandFilterGroups(expand, groupIds) { const updatedGroupIds = []; const updateGroupExpandState = (filterGroup) => { const groupId = filterGroup.getFilterGroupId(); const shouldExpandOrCollapse = !groupIds || groupIds.includes(groupId); if (shouldExpandOrCollapse) { if (expand && filterGroup.isColumnGroup()) { filterGroup.expand(); } else { filterGroup.collapse(); } updatedGroupIds.push(groupId); } for (const child of filterGroup.getChildren()) { if (child instanceof ToolPanelFilterGroupComp) { updateGroupExpandState(child); } } }; this.filterGroupComps.forEach(updateGroupExpandState); this.onGroupExpanded(); if (groupIds) { const unrecognisedGroupIds = groupIds.filter((groupId) => updatedGroupIds.indexOf(groupId) < 0); if (unrecognisedGroupIds.length > 0) { _warn(166, { unrecognisedGroupIds }); } } } expandFilters(expand, colIds) { const updatedColIds = []; const updateGroupExpandState = (filterComp) => { if (filterComp instanceof ToolPanelFilterGroupComp) { let anyChildrenChanged = false; for (const child of filterComp.getChildren()) { const childUpdated = updateGroupExpandState(child); if (childUpdated) { if (expand) { filterComp.expand(); anyChildrenChanged = true; } else if (!filterComp.isColumnGroup()) { filterComp.collapse(); } } } return anyChildrenChanged; } const colId = filterComp.getColumn().getColId(); const updateFilterExpandState = !colIds || colIds.includes(colId); if (updateFilterExpandState) { if (expand) { filterComp.expand(); } else { filterComp.collapse(); } updatedColIds.push(colId); } return updateFilterExpandState; }; this.filterGroupComps.forEach(updateGroupExpandState); this.onGroupExpanded(); if (colIds) { const unrecognisedColIds = colIds.filter((colId) => updatedColIds.indexOf(colId) < 0); if (unrecognisedColIds.length > 0) { _warn(167, { unrecognisedColIds }); } } } onGroupExpanded() { this.fireExpandedEvent(); } onFilterExpanded() { this.dispatchLocalEvent({ type: "filterExpanded" }); } fireExpandedEvent() { let expandedCount = 0; let notExpandedCount = 0; const updateExpandCounts = (filterGroup) => { if (!filterGroup.isColumnGroup()) { return; } if (filterGroup.isExpanded()) { expandedCount++; } else { notExpandedCount++; } for (const child of filterGroup.getChildren()) { if (child instanceof ToolPanelFilterGroupComp) { updateExpandCounts(child); } } }; this.filterGroupComps.forEach(updateExpandCounts); let state; if (expandedCount > 0 && notExpandedCount > 0) { state = 2 /* INDETERMINATE */; } else if (notExpandedCount > 0) { state = 1 /* COLLAPSED */; } else { state = 0 /* EXPANDED */; } this.dispatchLocalEvent({ type: "groupExpanded", state }); } performFilterSearch(searchText) { this.searchFilterText = _exists(searchText) ? searchText.toLowerCase() : null; this.searchFilters(this.searchFilterText); } searchFilters(searchFilter) { const passesFilter = (groupName) => { return !_exists(searchFilter) || groupName.toLowerCase().indexOf(searchFilter) !== -1; }; const recursivelySearch = (filterItem, parentPasses) => { if (!(filterItem instanceof ToolPanelFilterGroupComp)) { return passesFilter(filterItem.getColumnFilterName() || ""); } const children = filterItem.getChildren(); const groupNamePasses = passesFilter(filterItem.getFilterGroupName()); const alreadyPassed = parentPasses || groupNamePasses; if (alreadyPassed) { filterItem.hideGroup(false); for (let i = 0; i < children.length; i++) { recursivelySearch(children[i], alreadyPassed); filterItem.hideGroupItem(false, i); } return true; } let anyChildPasses = false; children.forEach((child, index) => { const childPasses = recursivelySearch(child, parentPasses); filterItem.hideGroupItem(!childPasses, index); if (childPasses) { anyChildPasses = true; } }); filterItem.hideGroup(!anyChildPasses); return anyChildPasses; }; let firstVisible; let lastVisible; this.filterGroupComps.forEach((filterGroup, idx) => { recursivelySearch(filterGroup, false); const isHidden = filterGroup.getGui()?.classList.contains("ag-hidden"); if (firstVisible === void 0) { if (!isHidden) { firstVisible = idx; lastVisible = idx; } } else if (!isHidden && lastVisible !== idx) { lastVisible = idx; } }); this.setFirstAndLastVisible(firstVisible, lastVisible); this.refreshAriaLabel(); } setFirstAndLastVisible(firstIdx, lastIdx) { this.filterGroupComps.forEach((filterGroup, idx) => { filterGroup.removeCss("ag-first-group-visible"); filterGroup.removeCss("ag-last-group-visible"); if (idx === firstIdx) { filterGroup.addCss("ag-first-group-visible"); } if (idx === lastIdx) { filterGroup.addCss("ag-last-group-visible"); } }); } onPanelHidden() { for (const filterGroupComp of this.filterGroupComps) { filterGroupComp.onPanelHidden(); } } getExpandedFiltersAndGroups() { const expandedGroupIds = []; const expandedColIds = /* @__PURE__ */ new Set(); const getExpandedFiltersAndGroups = (filterComp) => { if (filterComp instanceof ToolPanelFilterGroupComp) { for (const child of filterComp.getChildren()) { getExpandedFiltersAndGroups(child); } const groupId = filterComp.getFilterGroupId(); if (filterComp.isExpanded() && !expandedColIds.has(groupId)) { expandedGroupIds.push(groupId); } } else if (filterComp.isExpanded()) { expandedColIds.add(filterComp.getColumn().getColId()); } }; this.filterGroupComps.forEach(getExpandedFiltersAndGroups); return { expandedGroupIds, expandedColIds: Array.from(expandedColIds) }; } destroyFilters() { this.filterGroupComps = this.destroyBeans(this.filterGroupComps); _clearElement(this.getGui()); } destroy() { this.destroyFilters(); super.destroy(); } }; var AgFiltersToolPanelListSelector = { selector: "AG-FILTERS-TOOL-PANEL-LIST", component: AgFiltersToolPanelList }; // packages/ag-grid-enterprise/src/filterToolPanel/filtersToolPanel.css var filtersToolPanel_default = ".ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>:where(.ag-filter-icon),>:where(.ag-filter-toolpanel-expand),>:where(.ag-filter-toolpanel-search-input),>:where(.ag-header-cell-text){align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}"; // packages/ag-grid-enterprise/src/filterToolPanel/filtersToolPanel.ts var FiltersToolPanelElement = { tag: "div", cls: "ag-filter-toolpanel", children: [ { tag: "ag-filters-tool-panel-header", ref: "filtersToolPanelHeaderPanel" }, { tag: "ag-filters-tool-panel-list", ref: "filtersToolPanelListPanel" } ] }; var FiltersToolPanel = class extends Component { constructor() { super(FiltersToolPanelElement, [AgFiltersToolPanelHeaderSelector, AgFiltersToolPanelListSelector]); this.filtersToolPanelHeaderPanel = RefPlaceholder; this.filtersToolPanelListPanel = RefPlaceholder; this.initialised = false; this.listenerDestroyFuncs = []; this.registerCSS(filtersToolPanel_default); } init(params) { if (this.initialised) { for (const func of this.listenerDestroyFuncs) { func(); } this.listenerDestroyFuncs = []; } this.initialised = true; const defaultParams = { suppressExpandAll: false, suppressFilterSearch: false, suppressSyncLayoutWithGrid: false }; const newParams = { ...defaultParams, ...params }; this.params = newParams; const { filtersToolPanelHeaderPanel, filtersToolPanelListPanel } = this; filtersToolPanelHeaderPanel.init(newParams); filtersToolPanelListPanel.init(newParams); const { suppressExpandAll: hideExpand, suppressFilterSearch: hideSearch } = newParams; if (hideExpand && hideSearch) { filtersToolPanelHeaderPanel.setDisplayed(false); } this.listenerDestroyFuncs.push( ...this.addManagedListeners(filtersToolPanelHeaderPanel, { expandAll: () => filtersToolPanelListPanel.expandFilterGroups(true), collapseAll: () => filtersToolPanelListPanel.expandFilterGroups(false), searchChanged: (event) => filtersToolPanelListPanel.performFilterSearch(event.searchText) }), ...this.addManagedListeners(filtersToolPanelListPanel, { filterExpanded: newParams.onStateUpdated, groupExpanded: (event) => { filtersToolPanelHeaderPanel.setExpandState(event.state); newParams.onStateUpdated(); } }) ); } // lazy initialise the panel setVisible(visible) { super.setDisplayed(visible); if (visible && !this.initialised) { this.init(this.params); } } setFilterLayout(colDefs) { this.filtersToolPanelListPanel.setFiltersLayout(colDefs); } expandFilterGroups(groupIds) { this.filtersToolPanelListPanel.expandFilterGroups(true, groupIds); } collapseFilterGroups(groupIds) { this.filtersToolPanelListPanel.expandFilterGroups(false, groupIds); } expandFilters(colIds) { this.filtersToolPanelListPanel.expandFilters(true, colIds); } collapseFilters(colIds) { this.filtersToolPanelListPanel.expandFilters(false, colIds); } syncLayoutWithGrid() { this.filtersToolPanelListPanel.syncFilterLayout(); } refresh(params) { this.init(params); return true; } getState() { return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterPanelService.ts var FilterPanelService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "filterPanelSvc"; this.states = /* @__PURE__ */ new Map(); this.orderedStates = []; this.initialStateApplied = false; this.columnsLoaded = false; this.isActive = false; } postConstruct() { if (!this.gos.get("enableFilterHandlers")) { return; } const updateFilterStates = this.updateFilterStates.bind(this); const updateApplyButton = () => this.dispatchStatesUpdates(void 0, true); const onFilterDestroyed = this.onFilterDestroyed.bind(this); this.addManagedEventListeners({ newColumnsLoaded: () => { this.columnsLoaded = true; if (!this.initialStateApplied) { this.applyState(); } updateFilterStates(); }, dataTypesInferred: updateFilterStates, filterChanged: updateFilterStates, filterDestroyed: onFilterDestroyed, filterHandlerDestroyed: onFilterDestroyed, filterOpened: updateApplyButton, filterClosed: updateApplyButton }); const refreshForColumn = ({ column }) => { this.states.get(column.getColId())?.refresh?.(); updateApplyButton(); }; this.addManagedListeners(this.beans.colFilter, { filterStateChanged: refreshForColumn, filterModelAsStringChanged: refreshForColumn }); } updateParams(params, state) { this.params = params; let dispatchedStateUpdates = false; if (state) { this.currState = state; if (this.columnsLoaded) { const newIds = new Set(state.filters?.map((f) => f.colId)); for (const id of this.getIds()) { if (!newIds.has(id)) { this.remove(id); } } this.clear(); this.applyState(); this.updateFilterStates(); dispatchedStateUpdates = true; } } if (!dispatchedStateUpdates) { this.dispatchStatesUpdates(); } this.beans.colFilter?.setGlobalButtons(!!params.buttons?.length); } getIds() { return Array.from(this.states.keys()); } getAvailable() { const beans = this.beans; const availableFilters = []; for (const column of beans.colModel.getColDefCols() ?? []) { const id = column.getColId(); if (column.isFilterAllowed() && !column.colDef.suppressFiltersToolPanel && !this.states.get(id)) { availableFilters.push({ id, name: getDisplayName(beans, column) }); } } return availableFilters; } add(id) { this.createFilter(id, true); this.dispatchStatesUpdates(id); } remove(id) { const { states, orderedStates, beans: { colFilter, selectableFilter } } = this; const state = states.get(id); if (!state) { return; } state.destroy?.(); const column = state.state.column; states.delete(id); selectableFilter?.clearActive(id); colFilter?.destroyFilter(column); this.eventSvc.dispatchEvent({ type: "filterSwitched", column }); const index = orderedStates.indexOf(id); orderedStates.splice(index, 1); const newActiveId = orderedStates[index]; this.dispatchStatesUpdates(newActiveId); } getState(id) { return this.states.get(id)?.state; } updateFilterState(id, key, value, suppressEvents) { const filterState = this.getState(id); if (!filterState) { return; } filterState[key] = value; if (!suppressEvents) { this.dispatchLocalEvent({ type: "filterPanelStateChanged", id, state: filterState }); } } expand(id, expanded) { const existingFilterState = this.states.get(id); if (!existingFilterState) { return; } existingFilterState.destroy?.(); const { handler, state: { column } } = existingFilterState; const newFilterState = this.createFilterState(column, handler, expanded); this.states.set(id, newFilterState); this.dispatchLocalEvent({ type: "filterPanelStateChanged", id, state: newFilterState.state }); } updateType(id, filterDef) { const stateWrapper = this.states.get(id); if (!stateWrapper) { return; } const state = stateWrapper.state; if (state.expanded === false) { return; } const filterDefs = state.filterDefs; if (!filterDefs) { return; } const { colFilter, selectableFilter } = this.beans; selectableFilter?.setActive(id, filterDefs, filterDef); colFilter.filterParamsChanged(id, "columnFilter"); const column = state.column; this.eventSvc.dispatchEvent({ type: "filterSwitched", column }); const newStateWrapper = this.states.get(id); if (!newStateWrapper) { return; } const newState = newStateWrapper.state; this.dispatchLocalEvent({ type: "filterPanelStateChanged", id, state: newState }); } getActions() { const actions = this.params?.buttons; if (!actions?.length) { return void 0; } const canApply = !!this.beans.colFilter?.canApplyAll(); return { actions, canApply }; } doAction(action) { this.beans.colFilter?.updateAllModels(action); } getGridState() { const filters = []; this.states.forEach((stateWrapper, colId) => { filters.push({ colId, expanded: stateWrapper.state.expanded }); }); return { filters }; } createFilter(id, expanded) { const stateWrapper = this.createFilterStateWrapper(id, expanded); if (stateWrapper) { this.states.set(id, stateWrapper); this.orderedStates.push(id); } } createFilterStateWrapper(id, expanded) { const { colModel, colFilter } = this.beans; const column = colModel.getColDefCol(id); if (column && !column.colDef.suppressFiltersToolPanel) { const handler = colFilter.getHandler(column, true); if (handler) { return this.createFilterState(column, handler, expanded); } } return void 0; } updateFilterStates() { if (!this.params) { return; } const filterModel = this.beans.colFilter.getModel(); const processedIds = /* @__PURE__ */ new Set(); for (const id of Object.keys(filterModel)) { const existingState = this.states.get(id); if (!existingState) { this.createFilter(id); } else { existingState.refresh?.(); } processedIds.add(id); } this.states.forEach((state, id) => { if (!processedIds.has(id)) { state.refresh?.(); } }); this.dispatchStatesUpdates(); } createFilterState(column, handler, expanded) { const beans = this.beans; const { colFilter, selectableFilter } = beans; const name = getDisplayName(beans, column); const colId = column.getColId(); const getIsEditing = () => !!this.params?.buttons && colFilter.hasUnappliedModel(colId); const isEditing2 = getIsEditing(); if (expanded) { const colDef = column.colDef; const { filterDefs, activeFilterDef } = selectableFilter?.getDefs(column, colDef) ?? {}; const filterComp = this.createBean(new FilterComp(column, "TOOLBAR", true)); return { state: { column, name, isEditing: isEditing2, expanded, detail: filterComp.getGui(), activeFilterDef, filterDefs, afterGuiAttached: filterComp.afterGuiAttached.bind(filterComp), afterGuiDetached: filterComp.afterGuiDetached.bind(filterComp) }, handler, refresh: () => { this.updateFilterState(colId, "isEditing", getIsEditing()); }, destroy: () => this.destroyBean(filterComp) }; } else { const colId2 = column.getColId(); const getSummary = () => handler.getModelAsString?.(colFilter.getStateForColumn(colId2).model, "filterToolPanel") ?? ""; return { state: { column, name, isEditing: isEditing2, expanded: false, summary: getSummary() }, handler, refresh: () => { this.updateFilterState(colId2, "isEditing", getIsEditing(), true); this.updateFilterState(colId2, "summary", getSummary()); } }; } } onFilterDestroyed({ column, source }) { const { colFilter, filterManager } = this.beans; if (!colFilter?.isAlive() || !filterManager?.isFilterAllowed(column)) { return; } const states = this.states; const id = column.getColId(); const existingState = states.get(id); if (existingState) { const stateWrapper = this.createFilterStateWrapper(id, existingState.state.expanded); if (stateWrapper) { existingState.destroy?.(); states.set(id, stateWrapper); } else { this.remove(id); } if (source === "api") { this.dispatchStatesUpdates(); } } } dispatchStatesUpdates(activeId, action) { this.dispatchLocalEvent({ type: "filterPanelStatesChanged", activeId, action }); } applyState() { if (this.params && this.columnsLoaded) { this.initialStateApplied = true; for (const { colId, expanded } of this.currState?.filters ?? []) { this.createFilter(colId, expanded); } } } destroy() { this.clear(); this.params = void 0; this.currState = void 0; super.destroy(); } clear() { const { states, orderedStates } = this; states.forEach((state) => state.destroy?.()); states.clear(); orderedStates.length = 0; } }; function getDisplayName(beans, column) { return beans.colNames.getDisplayNameForColumn(column, "filterToolPanel") ?? column.getColId(); } // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterPanelUtils.ts var DEFAULT_LOCALE_TEXT2 = { addFilterCard: "Add Filter", ariaLabelAddFilterField: "Add Filter Field", ariaLabelFilterCardDelete: "Delete Filter", ariaLabelFilterCardHasEdits: "Has Edits", agTextColumnFilterDisplayName: "Simple Filter", agNumberColumnFilterDisplayName: "Simple Filter", agDateColumnFilterDisplayName: "Simple Filter", agSetColumnFilterDisplayName: "Selection Filter", agMultiColumnFilterDisplayName: "Combo Filter", addFilterPlaceholder: "Search columns..." }; function translateForFilterPanel(bean, key) { return _translate(bean, DEFAULT_LOCALE_TEXT2, key); } function compareAndUpdateListsInDom(eContainer, eNewItems, ePrevItems) { let newIndex = 0; for (let prevIndex = 0; prevIndex < ePrevItems.length; prevIndex++) { const ePrevItem = ePrevItems[prevIndex]; if (ePrevItem === eNewItems[newIndex]) { newIndex++; } else { _removeFromParent(ePrevItem); } } while (newIndex < eNewItems.length) { eContainer.appendChild(eNewItems[newIndex++]); } } // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/selectableFilterService.ts var SelectableFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "selectableFilter"; this.selectedFilters = /* @__PURE__ */ new Map(); this.valueGetters = /* @__PURE__ */ new Map(); } postConstruct() { const { gos, selectedFilters } = this; const initialState = gos.get("initialState")?.filter?.selectableFilters ?? {}; for (const colId of Object.keys(initialState)) { selectedFilters.set(colId, initialState[colId]); } } getFilterValueGetter(colId) { return this.valueGetters.get(colId); } isSelectable(filterDef) { return filterDef.filter === "agSelectableColumnFilter"; } getFilterDef(column, filterDef) { return this.getDefs(column, filterDef).activeFilterDef; } getDefs(column, filterDef, overrideIndex) { if (!this.isSelectable(filterDef)) { return void 0; } const beans = this.beans; const { gos, dataTypeSvc, colFilter } = beans; let filterParams = filterDef.filterParams; const colDef = column.colDef; if (typeof filterParams === "function") { filterParams = filterParams( _addGridCommonParams(gos, { column, colDef }) ); } const cellDataType = dataTypeSvc?.getBaseDataType(column); const dataTypeDefinition = dataTypeSvc?.getDataTypeDefinition(column); const formatValue = dataTypeSvc?.getFormatValue(cellDataType); const { filters, defaultFilterParams, defaultFilterIndex } = filterParams ?? {}; const updateDef = (def) => { const { filter, filterParams: defFilterParams, name, filterValueGetter = colDef.filterValueGetter } = def; const userParams = defaultFilterParams ? { ...defaultFilterParams, ...defFilterParams } : defFilterParams; let updatedParams; if (dataTypeDefinition && formatValue) { if (filter === "agMultiColumnFilter") { updatedParams = beans.multiFilter?.getParamsForDataType( userParams, filterValueGetter, dataTypeDefinition, formatValue ); } else { updatedParams = _getFilterParamsForDataType( filter, userParams, filterValueGetter, dataTypeDefinition, formatValue, beans, this.getLocaleTextFunc() ); } } let updatedName; if (!name) { let filterString = filter; if (typeof filter === "boolean") { filterString = colFilter?.getDefaultFilterFromDataType(() => cellDataType); } if (typeof filterString === "string") { updatedName = translateForFilterPanel(this, `${filterString}DisplayName`); } else { _warn(280, { colId: column.getColId() }); updatedName = ""; } } if (defaultFilterParams || updatedParams || updatedName) { return { ...def, filterParams: userParams, name: updatedName ?? name, ...updatedParams }; } return def; }; const filterDefs = (filters ?? this.getDefaultFilters(column)).map(updateDef); let index = overrideIndex ?? // provided override this.selectedFilters.get(column.getColId()) ?? // UI selected value defaultFilterIndex ?? // col def value (!filters && _isSetFilterByDefault(gos) ? 1 : 0); if (index >= filterDefs.length) { index = 0; } const activeFilterDef = filterDefs[index]; return { filterDefs, activeFilterDef }; } setActive(colId, filterDefs, activeFilterDef, silent) { const index = filterDefs.indexOf(activeFilterDef); if (index < 0) { return; } const { selectedFilters, valueGetters } = this; selectedFilters.set(colId, index); const filterValueGetter = activeFilterDef.filterValueGetter; if (filterValueGetter) { valueGetters.set(colId, filterValueGetter); } else { valueGetters.delete(colId); } if (!silent) { this.onChange(); } } clearActive(colId) { const { selectedFilters, valueGetters } = this; selectedFilters.delete(colId); valueGetters.delete(colId); this.onChange(); } getState() { return Object.fromEntries(this.selectedFilters); } setState(state) { this.clearAll(); const colModel = this.beans.colModel; for (const colId of Object.keys(state)) { const column = colModel.getColDefCol(colId); if (column) { const defs = this.getDefs(column, column.colDef, state[colId]); if (defs) { this.setActive(colId, defs.filterDefs, defs.activeFilterDef, true); } } } } destroy() { this.clearAll(); super.destroy(); } clearAll() { const { selectedFilters, valueGetters } = this; selectedFilters.clear(); valueGetters.clear(); } onChange() { this.dispatchLocalEvent({ type: "selectedFilterChanged" }); } getDefaultFilters(column) { const beans = this.beans; const { gos, dataTypeSvc } = beans; const isMultiFilterEnabled = gos.isModuleRegistered("MultiFilter"); const cellDataType = dataTypeSvc?.getBaseDataType(column); const simpleFilter = _getDefaultSimpleFilter(cellDataType, false); return [ { filter: simpleFilter }, { filter: "agSetColumnFilter" }, ...isMultiFilterEnabled ? [ { filter: "agMultiColumnFilter" } ] : [] ]; } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/addFilterComp.ts var AddFilterElement = { tag: "div", cls: "ag-filter-card ag-filter-card-add" }; var AddFilterComp = class extends Component { constructor(options) { super(AddFilterElement); this.options = /* @__PURE__ */ new Map(); this.setOptions(options); } postConstruct() { this.showButton(); } refresh(newOptions) { this.setOptions(newOptions); const { eSelect, options } = this; if (eSelect) { eSelect.setValueList({ valueList: Array.from(options.keys()), refresh: true }); } } showButton() { _clearElement(this.getGui()); this.destroySelect(); const eButton = _createElement({ tag: "button", cls: "ag-button ag-standard-button ag-filter-add-button", children: [ { tag: "span", children: [() => _createIconNoSpan("filterAdd", this.beans)] }, { tag: "span", cls: "ag-filter-add-button-label", children: translateForFilterPanel(this, "addFilterCard") } ] }); this.activateTabIndex([eButton]); const clickListener = this.showSelect.bind(this); eButton.addEventListener("click", clickListener); this.removeButton = () => { eButton.removeEventListener("click", clickListener); }; this.appendChild(eButton); eButton.focus(); } showSelect() { _clearElement(this.getGui()); this.destroyButton(); const pickerAriaLabelKey = "ariaLabelAddFilterField"; const selectParams = { className: "ag-filter-add-select", pickerType: "virtual-list", pickerAriaLabelKey, pickerAriaLabelValue: translateForFilterPanel(this, pickerAriaLabelKey), placeholder: translateForFilterPanel(this, "addFilterPlaceholder"), value: "", valueList: Array.from(this.options.keys()), searchType: "matchAny", allowTyping: true, filterList: true, highlightMatch: true, valueFormatter: (value) => this.options.get(value) }; const eSelect = this.createManagedBean(new AgRichSelect(selectParams)); this.eSelect = eSelect; this.appendChild(eSelect.getGui()); eSelect.showPicker(); eSelect.getFocusableElement().focus(); eSelect.addManagedListeners(eSelect, { fieldPickerValueSelected: ({ value: id }) => this.dispatchLocalEvent({ type: "filterSelected", id }), pickerHidden: () => { this.showButton(); } }); } setOptions(newOptions) { const options = this.options; options.clear(); for (const { id, name } of newOptions) { options.set(id, name); } } destroySelect() { this.eSelect = this.destroyBean(this.eSelect); } destroyButton() { this.removeButton = this.removeButton?.(); } destroy() { this.destroySelect(); this.destroyButton(); super.destroy(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterDetailComp.ts var FilterDetailElement = { tag: "div", cls: "ag-filter-card-body", children: [{ tag: "ag-select", cls: "ag-filter-type-select", ref: "eFilterType" }] }; var FilterDetailComp = class extends Component { constructor() { super(...arguments); this.eFilterType = RefPlaceholder; } postConstruct() { const eFilterTypeParams = { onValueChange: (filterDef) => this.dispatchLocalEvent({ type: "filterTypeChanged", filterDef }) }; this.setTemplate(FilterDetailElement, [AgSelectSelector], { eFilterType: eFilterTypeParams }); this.eFilterType.setDisplayed(false); } refresh(newState) { const oldState = this.state; this.state = newState; const { activeFilterDef: newActiveFilterDef, filterDefs: newFilterDefs, detail: newDetail, afterGuiAttached, afterGuiDetached } = newState; const { activeFilterDef: oldActiveFilterDef, filterDefs: oldFilterDefs, detail: oldDetail } = oldState ?? {}; const eFilterType = this.eFilterType; if (newFilterDefs !== oldFilterDefs) { eFilterType.clearOptions(); const options = newFilterDefs?.map((filterDef) => ({ value: filterDef, text: filterDef.name })); if (options) { eFilterType.clearOptions().addOptions(options).setValue(newActiveFilterDef, true); } eFilterType.setDisplayed(!!options); } else if (newActiveFilterDef !== oldActiveFilterDef) { eFilterType.setValue(newActiveFilterDef, true); } if (newDetail !== oldDetail) { if (oldDetail) { _removeFromParent(oldDetail); afterGuiDetached(); } this.appendChild(newDetail); afterGuiAttached({ container: "newFiltersToolPanel", suppressFocus: true }); } } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterSummaryComp.ts var FilterSummaryElement = { tag: "div", cls: "ag-filter-card-summary", attrs: { "aria-hidden": "true" } }; var FilterSummaryComp = class extends Component { constructor() { super(FilterSummaryElement); } refresh(state) { this.getGui().textContent = state.summary; } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterCardComp.ts var FilterCardElement = { tag: "div", cls: "ag-filter-card", children: [ { tag: "div", cls: "ag-filter-card-header", role: "presentation", children: [ { tag: "div", cls: "ag-filter-card-heading", role: "heading", attrs: { "aria-level": "2" }, children: [ { tag: "button", ref: "eExpand", cls: "ag-button ag-filter-card-expand", children: [ { tag: "span", ref: "eTitle", cls: "ag-filter-card-title" }, { tag: "span", ref: "eEditing", cls: "ag-filter-card-editing-icon" }, { tag: "span", ref: "eExpandIcon", cls: "ag-filter-card-expand-icon" } ] } ] }, { tag: "button", ref: "eDelete", cls: "ag-button ag-filter-card-delete", children: [{ tag: "span", ref: "eDeleteIcon", cls: "ag-filter-card-delete-icon" }] } ] } ] }; var FilterCardComp = class extends Component { constructor(id) { super(FilterCardElement); this.id = id; this.eTitle = RefPlaceholder; this.eExpand = RefPlaceholder; this.eDelete = RefPlaceholder; this.eExpandIcon = RefPlaceholder; this.eDeleteIcon = RefPlaceholder; this.eEditing = RefPlaceholder; } postConstruct() { const { beans, eDelete, eExpand, eDeleteIcon, eEditing, id } = this; const filterPanelService = beans.filterPanelSvc; _setAriaLabel(eDelete, translateForFilterPanel(this, "ariaLabelFilterCardDelete")); eDeleteIcon.appendChild(_createIcon("close", beans, null)); this.activateTabIndex([eExpand, eDelete]); this.addManagedElementListeners(eExpand, { click: () => filterPanelService.expand(id, !this.state?.expanded) }); this.addManagedElementListeners(eDelete, { click: () => filterPanelService.remove(id) }); this.addManagedEventListeners({ filterOpened: this.onFilterOpened.bind(this) }); eEditing.appendChild(_createIcon("filterCardEditing", beans, null)); } refresh(newState) { const { eExpand, eEditing, state: oldState, beans } = this; this.state = newState; const { name, expanded, isEditing: isEditing2 } = newState; this.eTitle.textContent = name; _setDisplayed(eEditing, isEditing2); if (!oldState || expanded !== oldState.expanded) { this.toggleExpand(newState); } let ariaLabel = expanded ? null : `${name} ${newState.summary}`; if (isEditing2) { ariaLabel = `${ariaLabel ?? name}. ${translateForFilterPanel(this, "ariaLabelFilterCardHasEdits")}`; } _setAriaLabel(eExpand, ariaLabel); const removeComp = (comp) => { if (!comp) { return; } _removeFromParent(comp.getGui()); return this.destroyBean(comp); }; const createOrRefreshComp = (comp, FilterComp2, postCreateFunc) => { if (!comp) { comp = this.createBean(new FilterComp2()); postCreateFunc?.(comp); this.appendChild(comp.getGui()); } comp.refresh(newState); return comp; }; if (newState.expanded) { this.summaryComp = removeComp(this.summaryComp); const detailComp = createOrRefreshComp( this.detailComp, FilterDetailComp, (comp) => comp.addManagedListeners(comp, { filterTypeChanged: ({ filterDef }) => beans.filterPanelSvc.updateType(this.id, filterDef) }) ); this.detailComp = detailComp; const detailId = `ag-${this.getCompId()}-filter`; detailComp.getGui().id = detailId; _setAriaControls(eExpand, detailId); } else { this.detailComp = removeComp(this.detailComp); this.summaryComp = createOrRefreshComp(this.summaryComp, FilterSummaryComp); _setAriaControls(eExpand, null); } } toggleExpand(state) { const expanded = !!state.expanded; const { eExpandIcon, eExpand, beans } = this; _clearElement(eExpandIcon); eExpandIcon.appendChild(_createIcon(expanded ? "filterCardCollapse" : "filterCardExpand", beans, null)); _setAriaExpanded(eExpand, expanded); } onFilterOpened(event) { const { state, beans, id } = this; if (event.source === "COLUMN_MENU" && event.column === state?.column && state?.expanded) { beans.filterPanelSvc.expand(id, false); } } destroy() { this.detailComp = this.destroyBean(this.detailComp); this.summaryComp = this.destroyBean(this.summaryComp); this.state = void 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/filterPanel.ts function isSingleRefresh(params) { return !!params?.id; } function isActionRefresh(params) { return !!params?.action; } var FilterPanelElement = { tag: "div", cls: "ag-filter-panel", children: [{ tag: "div", cls: "ag-filter-panel-container", ref: "eContainer" }] }; var FilterPanel = class extends Component { constructor() { super(FilterPanelElement); this.eContainer = RefPlaceholder; this.filters = /* @__PURE__ */ new Map(); } refresh(params) { if (isActionRefresh(params)) { this.refreshActions(); return; } if (isSingleRefresh(params)) { this.filters.get(params.id)?.refresh(params.state); return; } const { eContainer, filters: existingFilters, beans } = this; const filterPanelSvc = beans.filterPanelSvc; const filterIds = filterPanelSvc.getIds(); const newFilters = /* @__PURE__ */ new Map(); const somethingIsFocused = !_isNothingFocused(beans); const activeElement = somethingIsFocused ? _getActiveDomElement(beans) : void 0; const containerHasFocus = somethingIsFocused && eContainer.contains(activeElement); const ePrevItems = []; const eNewItems = []; for (const id of filterIds) { const newFilter = existingFilters.get(id) ?? this.createBean(new FilterCardComp(id)); newFilter.refresh(filterPanelSvc.getState(id)); newFilters.set(id, newFilter); eNewItems.push(newFilter.getGui()); } this.filters = newFilters; const compsToDestroy = []; existingFilters.forEach((existingFilter, id) => { ePrevItems.push(existingFilter.getGui()); if (!newFilters.has(id)) { compsToDestroy.push(existingFilter); } }); let addFilterComp = this.addFilterComp; if (addFilterComp) { ePrevItems.push(addFilterComp.getGui()); } const addFilterOptions = filterPanelSvc.getAvailable(); if (addFilterOptions.length) { if (!addFilterComp) { addFilterComp = this.createBean(new AddFilterComp(addFilterOptions)); addFilterComp.addManagedListeners(addFilterComp, { filterSelected: ({ id }) => filterPanelSvc.add(id) }); } addFilterComp.refresh(addFilterOptions); eNewItems.push(addFilterComp.getGui()); } else { addFilterComp = this.destroyBean(addFilterComp); } this.addFilterComp = addFilterComp; compareAndUpdateListsInDom(eContainer, eNewItems, ePrevItems); for (const comp of compsToDestroy) { this.destroyBean(comp); } const activeId = params?.activeId; const activeItemToFocus = activeId && newFilters.get(activeId)?.getGui(); if (activeItemToFocus) { _focusInto(activeItemToFocus); } else if (containerHasFocus && _isNothingFocused(beans)) { _focusInto(eNewItems[eNewItems.length - 1] ?? eContainer); } this.refreshActions(); } refreshActions() { const filterPanelSvc = this.beans.filterPanelSvc; const { actions, canApply } = filterPanelSvc.getActions() ?? {}; let buttonComp = this.buttonComp; if (actions?.length) { const buttons = actions.map((type) => ({ type, label: translateForFilter(this, `${type}Filter`) })); if (!buttonComp) { buttonComp = this.createBean(new FilterButtonComp({ className: "ag-filter-panel-buttons" })); this.getGui().appendChild(buttonComp.getGui()); const listeners = {}; for (const action of ["apply", "clear", "reset", "cancel"]) { listeners[action] = () => filterPanelSvc.doAction(action); } buttonComp.addManagedListeners(buttonComp, listeners); } buttonComp.updateButtons(buttons); buttonComp.updateValidity(canApply !== false); } else if (buttonComp) { _removeFromParent(buttonComp.getGui()); buttonComp = this.destroyBean(buttonComp); } this.buttonComp = buttonComp; } destroy() { this.beans.filterPanelSvc?.clear?.(); this.addFilterComp = this.destroyBean(this.addFilterComp); this.buttonComp = this.destroyBean(this.buttonComp); const filters = this.filters; filters.forEach((filter) => this.destroyBean(filter)); filters.clear(); super.destroy(); } }; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/newFiltersToolPanel.css var newFiltersToolPanel_default = ".ag-filter-panel{display:flex;flex-direction:column;width:100%;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-filter-panel .ag-simple-filter-body-wrapper{padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel .ag-mini-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-vertical-spacing)}.ag-filter-panel-container{display:flex;flex:1;flex-direction:column;gap:var(--ag-widget-container-vertical-padding);overflow:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-card{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius)}.ag-filter-card-header{align-items:center;display:flex;flex-direction:row;gap:var(--ag-spacing);padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-heading{flex:1;overflow:hidden;padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));padding-top:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing))}:where(.ag-ltr) .ag-filter-card-heading{padding-left:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-heading{padding-right:var(--ag-widget-horizontal-spacing)}.ag-filter-card-expand{align-items:center;display:flex;flex-direction:row;width:100%}.ag-filter-card-title{font-weight:var(--ag-header-font-weight);overflow:hidden;text-overflow:ellipsis}.ag-filter-card-expand-icon{display:flex;flex:1;justify-content:end}.ag-filter-card-editing-icon{margin:0 var(--ag-spacing)}.ag-filter-card-delete-icon,.ag-filter-card-editing-icon,.ag-filter-card-expand-icon,.ag-filter-card-summary{color:var(--ag-filter-panel-card-subtle-color)}.ag-filter-card-delete-icon,.ag-filter-card-expand-icon{transition:color .25s ease-in-out}.ag-filter-card-delete-icon:hover,.ag-filter-card-expand-icon:hover,.ag-filter-card-heading:hover .ag-filter-card-expand-icon{color:var(--ag-filter-panel-card-subtle-hover-color)}.ag-filter-add-button,.ag-filter-card-delete,.ag-filter-card-expand{border-radius:var(--ag-button-border-radius)}.ag-filter-card-summary,.ag-filter-type-select{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-filter-card-delete{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-filter-card-delete{margin-left:var(--ag-widget-horizontal-spacing)}.ag-filter-card-summary{margin-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-type-select{padding-top:var(--ag-widget-vertical-spacing)}.ag-filter-card-add{border:0;padding:0}.ag-filter-add-button{align-items:center;display:flex;flex-direction:row;line-height:1.5;width:100%}:where(.ag-ltr) .ag-filter-add-button-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-add-button-label{margin-right:var(--ag-spacing)}.ag-filter-add-select{border:0;.ag-rich-select-value{border:0;padding:calc(((1.5*var(--ag-font-size) + 2*var(--ag-button-vertical-padding)) - var(--ag-input-height))/2) var(--ag-spacing)}}:where(.ag-ltr) .ag-filter-add-select{.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)!important}}:where(.ag-rtl) .ag-filter-add-select{.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)!important}}.ag-filter-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0}.ag-filter-panel-buttons-button{line-height:1.5}.ag-filter-panel .ag-filter-panel-buttons-apply-button{background-color:var(--ag-filter-panel-apply-button-background-color);color:var(--ag-filter-panel-apply-button-color)}.ag-filter-panel-buttons:where(:last-child),.ag-filter-panel-container:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-filter-panel .ag-set-filter-body-wrapper,.ag-filter-panel .ag-simple-filter-body-wrapper{padding-bottom:var(--ag-widget-container-vertical-padding)}"; // packages/ag-grid-enterprise/src/filterToolPanel/newFilterToolPanel/wrapperToolPanel.ts var WrapperToolPanel = class extends Component { constructor() { super(); this.registerCSS(newFiltersToolPanel_default); } init(params) { if (!this.gos.get("enableFilterHandlers")) { _warn(282); return; } const filterPanelSvc = this.beans.filterPanelSvc; filterPanelSvc.isActive = true; this.addDestroyFunc(() => { filterPanelSvc.isActive = false; }); this.updateParams(params, params.initialState); const filterPanel = this.createManagedBean(new FilterPanel()); this.filterPanel = filterPanel; const refresh = (event) => { filterPanel.refresh(event); params.onStateUpdated(); }; refresh(); this.addManagedListeners(filterPanelSvc, { filterPanelStatesChanged: refresh, filterPanelStateChanged: refresh }); } getGui() { return this.filterPanel?.getGui(); } refresh(params) { this.updateParams(params, params.initialState); return true; } updateParams(params, initialState) { this.beans.filterPanelSvc?.updateParams(params, initialState); } getState() { return this.beans.filterPanelSvc?.getGridState() ?? {}; } }; // packages/ag-grid-enterprise/src/filterToolPanel/filtersToolPanelModule.ts var FiltersToolPanelModule = { moduleName: "FiltersToolPanel", version: VERSION2, userComponents: { agFiltersToolPanel: FiltersToolPanel }, icons: { // filter tool panel tab filtersToolPanel: "filter" }, dependsOn: [SideBarModule, EnterpriseCoreModule, ColumnFilterModule] }; var NewFiltersToolPanelModule = { moduleName: "NewFiltersToolPanel", version: VERSION2, userComponents: { agNewFiltersToolPanel: WrapperToolPanel }, beans: [FilterPanelService, SelectableFilterService], icons: { // filter add button in new filter tool panel filterAdd: "filter-add", // filter tool panel tab filtersToolPanel: "filter", // open icon for rich select richSelectOpen: "small-down", // remove for rich select editor pills richSelectRemove: "cancel", // loading async values richSelectLoading: "loading", // button to expand filter card in new filter tool panel filterCardExpand: "chevron-down", // button to collapse filter card in new filter tool panel filterCardCollapse: "chevron-up", // indicates filter card in new filter tool panel has edits filterCardEditing: "edit" }, dependsOn: [SideBarModule, EnterpriseCoreModule, ColumnFilterModule] }; // packages/ag-grid-enterprise/src/masterDetail/detailCellRendererCtrl.ts var DetailCellRendererCtrl = class extends BeanStub { constructor() { super(...arguments); this.loadRowDataVersion = 0; } wireBeans(beans) { this.environment = beans.environment; } init(comp, params) { this.params = params; this.comp = comp; const doNothingBecauseInsidePinnedSection = params.pinned != null; if (doNothingBecauseInsidePinnedSection) { return; } this.setAutoHeightClasses(); this.setupRefreshStrategy(); this.createDetailGrid(); this.loadRowData(); this.addManagedEventListeners({ fullWidthRowFocused: this.onFullWidthRowFocused.bind(this) }); } onFullWidthRowFocused(e) { const params = this.params; const row = { rowIndex: params.node.rowIndex, rowPinned: params.node.rowPinned }; const eventRow = { rowIndex: e.rowIndex, rowPinned: e.rowPinned }; const isSameRow = _isSameRow(row, eventRow); if (!isSameRow) { return; } _focusInto(this.comp.getGui(), e.fromBelow); } setAutoHeightClasses() { const autoHeight = this.gos.get("detailRowAutoHeight"); const parentClass = autoHeight ? "ag-details-row-auto-height" : "ag-details-row-fixed-height"; const detailClass = autoHeight ? "ag-details-grid-auto-height" : "ag-details-grid-fixed-height"; const comp = this.comp; comp.toggleCss(parentClass, true); comp.toggleDetailGridCss(detailClass, true); } setupRefreshStrategy() { const providedStrategy = this.params.refreshStrategy; const validSelection = providedStrategy == "everything" || providedStrategy == "nothing" || providedStrategy == "rows"; if (validSelection) { this.refreshStrategy = providedStrategy; return; } if (providedStrategy != null) { _warn(170, { providedStrategy }); } this.refreshStrategy = "rows"; } createDetailGrid() { const { params, gos } = this; if (_missing(params.detailGridOptions)) { _warn(171); return; } const masterTheme = gos.get("theme"); const detailTheme = params.detailGridOptions.theme; if (detailTheme && detailTheme !== masterTheme) { _warn(267); } const gridOptions = { themeStyleContainer: this.environment.eStyleContainer, ...params.detailGridOptions, theme: masterTheme }; const autoHeight = gos.get("detailRowAutoHeight"); if (autoHeight) { gridOptions.domLayout = "autoHeight"; } this.comp.setDetailGrid(gridOptions); } registerDetailWithMaster(api) { const { params, beans: { selectionSvc, findSvc, expansionSvc } } = this; const rowId = params.node.id; const masterGridApi = params.api; const gridInfo = { id: rowId, api }; const rowNode = params.node; if (masterGridApi.isDestroyed()) { return; } masterGridApi.addDetailGridInfo(rowId, gridInfo); rowNode.detailGridInfo = gridInfo; const masterNode = rowNode.parent; findSvc?.registerDetailGrid(rowNode, api); function onDetailSelectionChanged() { if (masterNode) { selectionSvc?.refreshMasterNodeState(masterNode); } } function adjustDetailsOnExpandOrCollapseAll({ source }) { if (source === "expandAll") { return api.expandAll(); } if (source === "collapseAll") { return api.collapseAll(); } } function onMasterRowSelected({ node, source }) { if (node !== masterNode || source === "masterDetail" || api.isDestroyed()) { return; } selectionSvc?.setDetailSelectionState(masterNode, params.detailGridOptions, api); } api.addEventListener("firstDataRendered", () => { if (api.isDestroyed() || masterGridApi.isDestroyed()) { return; } selectionSvc?.setDetailSelectionState(masterNode, params.detailGridOptions, api); api.addEventListener("selectionChanged", onDetailSelectionChanged); masterGridApi.addEventListener("rowSelected", onMasterRowSelected); const sharedApiModuleName = "CsrmSsrmSharedApi"; const asAgModuleName = `${sharedApiModuleName}Module`; if (api.isModuleRegistered(asAgModuleName)) { masterGridApi.addEventListener("expandOrCollapseAll", adjustDetailsOnExpandOrCollapseAll); expansionSvc?.setDetailsExpansionState(api); } }); this.addManagedListeners(masterNode, { masterChanged: (event) => { if (!event.node.master) { this.onDestroy(gridInfo); } } }); this.addDestroyFunc(() => this.onDestroy(gridInfo)); } onDestroy(gridInfo) { const { params } = this; const rowNode = params.node; const masterGridApi = params.api; if (rowNode.detailGridInfo !== gridInfo) { return; } if (!masterGridApi.isDestroyed()) { masterGridApi.removeDetailGridInfo(rowNode.id); } rowNode.detailGridInfo = null; } loadRowData() { this.loadRowDataVersion++; const versionThisCall = this.loadRowDataVersion; const params = this.params; if (params.detailGridOptions?.rowModelType === "serverSide") { const node = params.node; node.detailGridInfo?.api?.refreshServerSide({ purge: true }); return; } const userFunc = params.getDetailRowData; if (!userFunc) { _warn(172); return; } const successCallback = (rowData) => { const mostRecentCall = this.loadRowDataVersion === versionThisCall; if (mostRecentCall) { this.comp.setRowData(rowData); } }; const funcParams = { node: params.node, // we take data from node, rather than params.data // as the data could have been updated with new instance data: params.node.data, successCallback, context: _addGridCommonParams(this.gos, {}).context }; userFunc(funcParams); } refresh() { const GET_GRID_TO_REFRESH = false; const GET_GRID_TO_DO_NOTHING = true; switch (this.refreshStrategy) { case "nothing": return GET_GRID_TO_DO_NOTHING; case "everything": return GET_GRID_TO_REFRESH; } this.loadRowData(); return GET_GRID_TO_DO_NOTHING; } }; // packages/ag-grid-enterprise/src/masterDetail/detailFrameworkComponentWrapper.ts var DetailFrameworkComponentWrapper = class { constructor(parentWrapper) { this.parentWrapper = parentWrapper; } wrap(frameworkComponent, mandatoryMethods, optionalMethods, componentType) { return this.parentWrapper.wrap(frameworkComponent, mandatoryMethods, optionalMethods, componentType); } }; // packages/ag-grid-enterprise/src/masterDetail/detailCellRenderer.ts var PinnedDetailCellRendererElement = { tag: "div", cls: "ag-details-row" }; var DetailCellRendererElement = { tag: "div", cls: "ag-details-row", role: "gridcell", children: [{ tag: "div", ref: "eDetailGrid", cls: "ag-details-grid", role: "presentation" }] }; var DetailCellRenderer = class extends Component { constructor() { super(...arguments); this.eDetailGrid = RefPlaceholder; } wireBeans(beans) { this.context = beans.context; } init(params) { this.params = params; this.selectAndSetTemplate(); const compProxy = { toggleCss: (cssClassName, on) => this.toggleCss(cssClassName, on), toggleDetailGridCss: (cssClassName, on) => this.eDetailGrid.classList.toggle(cssClassName, on), setDetailGrid: (gridOptions) => this.setDetailGrid(gridOptions), setRowData: (rowData) => this.setRowData(rowData), getGui: () => this.eDetailGrid }; this.ctrl = this.createManagedBean(new DetailCellRendererCtrl()); this.ctrl.init(compProxy, params); } refresh() { return this.ctrl?.refresh() ?? false; } selectAndSetTemplate() { const params = this.params; if (params.pinned) { this.setTemplate(PinnedDetailCellRendererElement); return; } const setDefaultTemplate = () => { this.setTemplate(DetailCellRendererElement); }; if (_missing(params.template)) { setDefaultTemplate(); } else if (typeof params.template === "string") { this.setTemplate(params.template, []); } else if (typeof params.template === "function") { const templateFunc = params.template; const template = templateFunc(params); this.setTemplate(template, []); } else { _warn(168); setDefaultTemplate(); } if (this.eDetailGrid == null) { _warn(169); } } setDetailGrid(gridOptions) { if (!this.eDetailGrid) { return; } const parentFrameworkComponentWrapper = this.context.getBean("frameworkCompWrapper"); const frameworkCompWrapper = new DetailFrameworkComponentWrapper(parentFrameworkComponentWrapper); const { frameworkOverrides } = this.beans; const api = createGrid(this.eDetailGrid, gridOptions, { frameworkOverrides, providedBeanInstances: { frameworkCompWrapper }, modules: _getGridRegisteredModules(this.params.api.getGridId(), gridOptions.rowModelType ?? "clientSide") }); this.detailApi = api; this.ctrl?.registerDetailWithMaster(api); this.addDestroyFunc(() => { api.destroy(); }); } setRowData(rowData) { this.detailApi?.setGridOption("rowData", rowData); } }; // packages/ag-grid-enterprise/src/masterDetail/masterDetailApi.ts function operateOnStore(beans, callback) { const store = beans.masterDetailSvc?.store; return store ? callback(store) : void 0; } function addDetailGridInfo(beans, id, gridInfo) { operateOnStore(beans, (store) => { store[id] = gridInfo; }); } function removeDetailGridInfo(beans, id) { operateOnStore(beans, (store) => { delete store[id]; }); } function getDetailGridInfo(beans, id) { return operateOnStore(beans, (store) => store[id]); } function forEachDetailGridInfo(beans, callback) { operateOnStore(beans, (store) => { let index = 0; Object.values(store).forEach((gridInfo) => { if (gridInfo) { callback(gridInfo, index++); } }); }); } // packages/ag-grid-enterprise/src/masterDetail/masterDetailModule.css var masterDetailModule_default = ".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}"; // packages/ag-grid-enterprise/src/masterDetail/masterDetailService.ts var MasterDetailService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "masterDetailSvc"; this.store = {}; } isEnabled() { return this.gos.get("masterDetail"); } postConstruct() { const gos = this.gos; if (_isClientSideRowModel(gos)) { this.enabled = this.isEnabled(); } if (_isServerSideRowModel(gos)) { this.addEventListeners(); } } addEventListeners() { const rowNodeDataChanged = (event) => { this.setMaster(event.node, false, true); }; let removeListeners; const addOrRemoveListeners = () => { if (removeListeners) { for (const removeListener of removeListeners) { removeListener(); } removeListeners = void 0; } if (this.isEnabled()) { removeListeners = this.addManagedListeners(this.beans.eventSvc, { rowNodeDataChanged }); } }; addOrRemoveListeners(); this.gos.addPropertyEventListener("masterDetail", addOrRemoveListeners); } refreshModel(params) { if (params.changedProps) { const enabled = this.isEnabled(); if (this.enabled !== enabled) { this.setMasters(null); return; } } if (params.rowDataUpdated) { this.setMasters(params.changedRowNodes); } } setMaster(row, created, updated) { const oldMaster = row.master; const enabled = this.isEnabled(); let newMaster = enabled; const gos = this.gos; const isRowMaster = gos.get("isRowMaster"); const treeData = gos.get("treeData"); if (enabled) { if (created || updated) { if (isRowMaster) { const data = row.data; newMaster = !!data && !!isRowMaster(data); } } else { newMaster = oldMaster; } } if (!treeData) { if (newMaster && created || // if changing AWAY from master, forget current state !newMaster && oldMaster) { row._expanded ?? (row._expanded = null); } } if (newMaster !== oldMaster) { row.master = newMaster; row.dispatchRowEvent("masterChanged"); } } setMasters(changedRowNodes) { this.enabled = this.isEnabled(); if (changedRowNodes) { for (const node of changedRowNodes.updates) { this.setMaster(node, false, true); } for (const node of changedRowNodes.adds) { this.setMaster(node, true, false); } } else { const allLeafChildren = _getClientSideRowModel(this.beans)?.rootNode?._leafs; if (allLeafChildren) { for (let i = 0, len = allLeafChildren.length; i < len; ++i) { this.setMaster(allLeafChildren[i], true, false); } } } } /** Used by flatten stage to get or create a detail node from a master node */ getDetail(masterNode) { if (!masterNode.master || !masterNode.expanded) { return null; } let detailNode = masterNode.detailNode; if (detailNode) { return detailNode; } detailNode = new RowNode(this.beans); detailNode.detail = true; detailNode.selectable = false; detailNode.parent = masterNode; if (_exists(masterNode.id)) { detailNode.id = "detail_" + masterNode.id; } detailNode.data = masterNode.data; detailNode.level = masterNode.level + 1; masterNode.detailNode = detailNode; return detailNode; } setupDetailRowAutoHeight(rowCtrl, eDetailGui) { const { gos, beans } = this; if (!gos.get("detailRowAutoHeight")) { return; } const checkRowSizeFunc = () => { const clientHeight = eDetailGui.clientHeight; if (clientHeight != null && clientHeight > 0) { const updateRowHeightFunc = () => { const { rowModel } = this.beans; const { rowNode } = rowCtrl; rowNode.setRowHeight(clientHeight); if (_isClientSideRowModel(gos, rowModel) || _isServerSideRowModel(gos, rowModel)) { rowModel.onRowHeightChanged(); } }; window.setTimeout(updateRowHeightFunc, 0); } }; const resizeObserverDestroyFunc = _observeResize(beans, eDetailGui, checkRowSizeFunc); rowCtrl.addDestroyFunc(resizeObserverDestroyFunc); checkRowSizeFunc(); } destroy() { this.store = {}; super.destroy(); } }; // packages/ag-grid-enterprise/src/masterDetail/masterDetailModule.ts var SharedMasterDetailModule = { moduleName: "SharedMasterDetail", version: VERSION2, beans: [MasterDetailService], userComponents: { agDetailCellRenderer: DetailCellRenderer }, dynamicBeans: { detailCellRendererCtrl: DetailCellRendererCtrl }, apiFunctions: { addDetailGridInfo, removeDetailGridInfo, getDetailGridInfo, forEachDetailGridInfo }, dependsOn: [EnterpriseCoreModule, GroupCellRendererModule, StickyRowModule], css: [masterDetailModule_default] }; var MasterDetailModule = { moduleName: "MasterDetail", version: VERSION2, dependsOn: [SharedMasterDetailModule, ClientSideRowModelHierarchyModule, EventApiModule] }; // packages/ag-grid-enterprise/src/rangeSelection/abstractSelectionHandle.ts var AbstractSelectionHandle = class extends Component { constructor() { super(...arguments); this.changedCalculatedValues = false; this.dragging = false; this.shouldDestroyOnEndDragging = false; } postConstruct() { this.beans.dragSvc.addDragSource({ dragStartPixels: 0, eElement: this.getGui(), onDragging: (e) => { let startingMove = false; if (!this.dragging) { startingMove = true; this.dragging = true; const pageBody = _getPageBody(this.beans); pageBody.classList?.add(this.getDraggingCssClass()); } this.updateValuesOnMove(e); if (startingMove) { this.changedCalculatedValues = false; return; } this.beans.rangeSvc.autoScrollService.check(e); if (this.changedCalculatedValues) { this.onDrag(e); this.changedCalculatedValues = false; } }, onDragStop: (e) => { this.dragging = false; this.onDragEnd(e); this.clearDragProperties(); }, onDragCancel: () => { this.dragging = false; this.onDragCancel(); this.clearDragProperties(); } }); this.addManagedEventListeners({ cellSelectionChanged: this.updateLocalRangeIfNeeded.bind(this) }); this.addManagedElementListeners(this.getGui(), { pointerdown: stopEventPropagation, mousedown: stopEventPropagation }); } getLastCellHovered() { return this.lastCellHovered; } getDraggingCssClass() { return `ag-dragging-${this.type === 0 /* FILL */ ? "fill" : "range"}-handle`; } updateValuesOnMove(e) { const cell = _getCellPositionForEvent(this.gos, e); if (!cell || this.shouldSkipCell(cell) || this.lastCellHovered && _areCellsEqual(cell, this.lastCellHovered)) { return; } this.lastCellHovered = cell; this.changedCalculatedValues = true; } clearDragProperties() { this.clearValues(); this.beans.rangeSvc.autoScrollService.ensureCleared(); const pageBody = _getPageBody(this.beans); pageBody.classList?.remove(this.getDraggingCssClass()); if (this.shouldDestroyOnEndDragging) { this.destroy(); } } getType() { return this.type; } refresh(cellCtrl, cellRange) { const oldCellComp = this.cellCtrl; const eGui = this.getGui(); const cellRangeToUse = cellRange ?? _last(this.beans.rangeSvc.getCellRanges()); const start = cellRangeToUse.startRow; const end = cellRangeToUse.endRow; if (start && end) { const isBefore = _isRowBefore(end, start); if (isBefore) { this.rangeStartRow = end; this.rangeEndRow = start; } else { this.rangeStartRow = start; this.rangeEndRow = end; } } if (oldCellComp !== cellCtrl || !_isVisible(eGui)) { this.cellCtrl = cellCtrl; const eParentOfValue = cellCtrl.comp.getParentOfValue(); if (eParentOfValue) { eParentOfValue.appendChild(eGui); } } this.cellRange = cellRangeToUse; } clearValues() { this.lastCellHovered = void 0; } destroy() { if (!this.shouldDestroyOnEndDragging && this.dragging) { _setDisplayed(this.getGui(), false); this.shouldDestroyOnEndDragging = true; return; } this.shouldDestroyOnEndDragging = false; super.destroy(); this.getGui()?.remove(); } updateLocalRangeIfNeeded(event) { if (!this.cellRange) { return; } const { id, type } = this.cellRange; if (!id || id !== event.id) { return; } const newRange = this.beans.rangeSvc?.getCellRanges().find((range) => range.id === id && range.type === type); if (newRange && newRange !== this.cellRange) { this.cellRange = newRange; } } }; var stopEventPropagation = (e) => { e.stopPropagation(); }; // packages/ag-grid-enterprise/src/rangeSelection/utils.ts function findLineByLeastSquares(values) { const len = values.length; let maxDecimals = 0; if (len <= 1) { return values; } for (let i = 0; i < values.length; i++) { const value = values[i]; const splitExponent = value.toString().split("e-"); if (splitExponent.length > 1) { maxDecimals = Math.max(maxDecimals, parseInt(splitExponent[1], 10)); continue; } if (Math.floor(value) === value) { continue; } maxDecimals = Math.max(maxDecimals, value.toString().split(".")[1].length); } let sum_x = 0; let sum_y = 0; let sum_xy = 0; let sum_xx = 0; let y = 0; for (let x = 0; x < len; x++) { y = values[x]; sum_x += x; sum_y += y; sum_xx += x * x; sum_xy += x * y; } const m = (len * sum_xy - sum_x * sum_y) / (len * sum_xx - sum_x * sum_x); const b = sum_y / len - m * sum_x / len; const result = []; for (let x = 0; x <= len; x++) { result.push(parseFloat((x * m + b).toFixed(maxDecimals))); } return result; } // packages/ag-grid-enterprise/src/rangeSelection/agFillHandle.ts var FillHandleElement = { tag: "div", cls: "ag-fill-handle" }; var AgFillHandle = class extends AbstractSelectionHandle { constructor() { super(FillHandleElement); this.markedCells = []; this.cellValues = []; this.isUp = false; this.isLeft = false; this.isReduce = false; this.type = 0 /* FILL */; } postConstruct() { super.postConstruct(); this.addManagedElementListeners(this.getGui(), { dblclick: this.onDblClick.bind(this) }); } onDblClick(e) { _stopPropagationForAgGrid(e); const { cellRange: initialRange, rangeStartRow, beans } = this; const { rangeSvc, visibleCols } = beans; const lastRow = _getLastRow(beans); if (!lastRow) { return; } const fillHandleDirection = this.getFillHandleDirection(); this.dragAxis = fillHandleDirection === "xy" ? "y" : fillHandleDirection; const finalRange = rangeSvc?.createCellRangeFromCellRangeParams({ rowStartIndex: rangeStartRow.rowIndex, rowStartPinned: rangeStartRow.rowPinned, columnStart: initialRange.columns[0], rowEndIndex: this.dragAxis === "x" ? initialRange.endRow?.rowIndex ?? null : lastRow.rowIndex, rowEndPinned: this.dragAxis === "x" ? initialRange.endRow?.rowPinned : lastRow.rowPinned, columnEnd: this.dragAxis === "x" ? _last(visibleCols.allCols) : _last(initialRange.columns) }); this.isUp = false; this.isLeft = false; if (finalRange) { this.performFill({ event: e, initialRange, finalRange }); } this.dragAxis = void 0; } updateValuesOnMove(e) { super.updateValuesOnMove(e); if (!this.initialXY) { this.initialXY = _getNormalisedMousePosition(this.beans, e); } const { x, y } = this.initialXY; const { x: newX, y: newY } = _getNormalisedMousePosition(this.beans, e); const diffX = Math.abs(x - newX); const diffY = Math.abs(y - newY); const allowedDirection = this.getFillHandleDirection(); let direction; if (allowedDirection === "xy") { direction = diffX > diffY ? "x" : "y"; } else { direction = allowedDirection; } if (direction !== this.dragAxis) { this.dragAxis = direction; this.changedCalculatedValues = true; } } shouldSkipCell(cell) { return isRowNumberCol(cell.column); } onDrag(_) { if (!this.initialPosition) { const cellCtrl = this.cellCtrl; if (!cellCtrl) { return; } this.initialPosition = cellCtrl.cellPosition; } const lastCellHovered = this.getLastCellHovered(); if (lastCellHovered) { this.markPathFrom(this.initialPosition, lastCellHovered); } } onDragEnd(e) { this.initialXY = null; if (!this.markedCells.length) { return; } const isX = this.dragAxis === "x"; const { cellRange: initialRange, rangeStartRow, rangeEndRow, beans: { rangeSvc } } = this; const colLen = initialRange.columns.length; let finalRange; if (!this.isUp && !this.isLeft) { finalRange = rangeSvc.createCellRangeFromCellRangeParams({ rowStartIndex: rangeStartRow.rowIndex, rowStartPinned: rangeStartRow.rowPinned, columnStart: initialRange.columns[0], rowEndIndex: isX ? rangeEndRow.rowIndex : this.lastCellMarked.rowIndex, rowEndPinned: isX ? rangeEndRow.rowPinned : this.lastCellMarked.rowPinned, columnEnd: isX ? this.lastCellMarked.column : initialRange.columns[colLen - 1] }); } else { const startRow = isX ? rangeStartRow : this.lastCellMarked; finalRange = rangeSvc.createCellRangeFromCellRangeParams({ rowStartIndex: startRow.rowIndex, rowStartPinned: startRow.rowPinned, columnStart: isX ? this.lastCellMarked.column : initialRange.columns[0], rowEndIndex: rangeEndRow.rowIndex, rowEndPinned: rangeEndRow.rowPinned, columnEnd: initialRange.columns[colLen - 1] }); } if (finalRange) { this.performFill({ event: e, initialRange, finalRange, shouldUpdateRange: true }); } } onDragCancel() { this.initialXY = null; if (!this.markedCells.length) { return; } this.clearMarkedPath(); } performFill({ event, initialRange, finalRange, shouldUpdateRange }) { const { eventSvc, rangeSvc } = this.beans; eventSvc.dispatchEvent({ type: "fillStart" }); this.handleValueChanged(initialRange, finalRange, event); if (shouldUpdateRange) { rangeSvc.setCellRanges([finalRange]); } eventSvc.dispatchEvent({ type: "fillEnd", initialRange, finalRange }); } getFillHandleDirection() { const direction = _getFillHandle(this.gos)?.direction; if (!direction) { return "xy"; } if (direction !== "x" && direction !== "y" && direction !== "xy") { _warn(177); return "xy"; } return direction; } handleValueChanged(initialRange, finalRange, e) { const { beans } = this; const { rangeSvc, gos, valueSvc } = beans; const initialRangeEndRow = rangeSvc.getRangeEndRow(initialRange); const initialRangeStartRow = rangeSvc.getRangeStartRow(initialRange); const finalRangeEndRow = rangeSvc.getRangeEndRow(finalRange); const finalRangeStartRow = rangeSvc.getRangeStartRow(finalRange); const isVertical = this.dragAxis === "y"; if (this.isReduce && !_getFillHandle(gos)?.suppressClearOnFillReduction) { const columns = isVertical ? initialRange.columns : initialRange.columns.filter((col) => finalRange.columns.indexOf(col) < 0); const startRow = isVertical ? _getRowBelow(beans, finalRangeEndRow) : finalRangeStartRow; if (startRow) { this.clearCellsInRange(startRow, initialRangeEndRow, columns); } return; } const values = []; const initialValues = []; const initialNonAggregatedValues = []; const initialFormattedValues = []; let withinInitialRange = true; let idx = 0; const resetValues = () => { values.length = 0; initialValues.length = 0; initialNonAggregatedValues.length = 0; initialFormattedValues.length = 0; idx = 0; }; const iterateAcrossCells = (column, columns) => { let currentRow = this.isUp ? initialRangeEndRow : initialRangeStartRow; let finished = false; if (isVertical) { withinInitialRange = true; resetValues(); } while (!finished && currentRow) { const rowNode = _getRowNode(beans, currentRow); if (!rowNode) { break; } if (isVertical && column) { fillValues( values, column, rowNode, () => !_isSameRow(currentRow, this.isUp ? initialRangeStartRow : initialRangeEndRow) ); } else if (columns) { withinInitialRange = true; resetValues(); for (const col of columns) { fillValues( values, col, rowNode, () => col !== (this.isLeft ? initialRange.columns[0] : _last(initialRange.columns)) ); } } finished = _isSameRow(currentRow, this.isUp ? finalRangeStartRow : finalRangeEndRow); currentRow = this.isUp ? _getRowAbove(this.beans, currentRow) : _getRowBelow(beans, currentRow); } }; const fillValues = (currentValues, col, rowNode, updateInitialSet) => { let currentValue; let skipValue = false; if (withinInitialRange) { currentValue = valueSvc.getValue(col, rowNode, "edit"); initialValues.push(currentValue); initialNonAggregatedValues.push(valueSvc.getValue(col, rowNode, "edit", true)); initialFormattedValues.push( valueSvc.getValueForDisplay({ column: col, node: rowNode, from: "edit" }).valueFormatted ); withinInitialRange = updateInitialSet(); } else { const { value, fromUserFunction, sourceCol, sourceRowNode } = this.processValues({ event: e, values: currentValues, initialValues, initialNonAggregatedValues, initialFormattedValues, col, rowNode, idx: idx++ }); currentValue = value; if (col.isCellEditable(rowNode)) { const cellValue = valueSvc.getValue(col, rowNode, "edit"); if (!fromUserFunction) { if (sourceCol) { const sourceColDef = sourceCol.getColDef(); if (sourceColDef.useValueFormatterForExport !== false && sourceColDef.valueFormatter) { const formattedValue = valueSvc.getValueForDisplay({ column: sourceCol, node: sourceRowNode, includeValueFormatted: true, from: "edit" }).valueFormatted; if (formattedValue != null) { currentValue = formattedValue; } } } if (col.getColDef().useValueParserForImport !== false) { currentValue = valueSvc.parseValue( col, rowNode, // if no sourceCol, then currentValue is a number sourceCol ? currentValue : _toStringOrNull(currentValue), cellValue ); } } if (!fromUserFunction || cellValue !== currentValue) { rowNode.setDataValue(col, currentValue, "rangeSvc"); } else { skipValue = true; } } } if (!skipValue) { currentValues.push({ value: currentValue, column: col, rowNode }); } }; const { changeDetectionSvc } = this.beans; changeDetectionSvc?.beginDeferred(); try { if (isVertical) { initialRange.columns.forEach((col) => { iterateAcrossCells(col); }); } else { const columns = this.isLeft ? [...finalRange.columns].reverse() : finalRange.columns; iterateAcrossCells(void 0, columns); } this.beans.editSvc?.stopEditing(void 0, { source: "fillHandle" }); } finally { changeDetectionSvc?.endDeferred(); } } clearCellsInRange(startRow, endRow, columns) { const cellRange = { startRow, endRow, columns, startColumn: columns[0] }; this.beans.rangeSvc.clearCellRangeCellValues({ cellRanges: [cellRange], restoreSourceInBatch: true }); } processValues(params) { const { formula, valueSvc } = this.beans; const { event, values, initialValues, initialNonAggregatedValues, initialFormattedValues, col, rowNode, idx } = params; const userFillOperation = _getFillHandle(this.gos)?.setFillValue; const isVertical = this.dragAxis === "y"; let direction; if (isVertical) { direction = this.isUp ? "up" : "down"; } else { direction = this.isLeft ? "left" : "right"; } if (userFillOperation) { const params2 = _addGridCommonParams(this.gos, { event, values: values.map(({ value }) => value), initialValues, initialNonAggregatedValues, initialFormattedValues, currentIndex: idx, currentCellValue: valueSvc.getValue(col, rowNode, "edit"), direction, column: col, rowNode }); const userResult = userFillOperation(params2); if (userResult !== false) { return { value: userResult, fromUserFunction: true }; } } const isNumeric2 = (v) => typeof v === "number" && Number.isFinite(v) || typeof v === "string" && /^[+-]?\d+(?:\.\d+)?$/.test(v.trim()); const allNumbers = values.every(({ value }) => isNumeric2(value)); if (event.altKey || !allNumbers) { const valueForFunctions = String(_last(values)?.value ?? ""); if (allNumbers && initialValues.length === 1) { const multiplier = this.isUp || this.isLeft ? -1 : 1; return { value: parseFloat(valueForFunctions) + 1 * multiplier, fromUserFunction: false }; } const { value: cyclicValue, column: sourceCol, rowNode: sourceRowNode } = values[idx % values.length]; let processedValue; const fromFormula = sourceCol.isAllowFormula() && formula?.isFormula(valueForFunctions); if (fromFormula) { const rowDelta = direction === "up" ? -1 : direction === "down" ? 1 : 0; const columnDelta = direction === "left" ? -1 : direction === "right" ? 1 : 0; processedValue = formula.updateFormulaByOffset({ value: valueForFunctions, rowDelta, columnDelta }); } else { processedValue = cyclicValue; } return { value: processedValue, fromUserFunction: false, sourceCol: fromFormula ? void 0 : sourceCol, sourceRowNode }; } return { value: _last(findLineByLeastSquares(values.map(({ value }) => Number(value)))), fromUserFunction: false }; } clearValues() { this.clearMarkedPath(); this.clearCellValues(); this.lastCellMarked = void 0; super.clearValues(); } clearMarkedPath() { for (const cell of this.markedCells) { if (!cell.isAlive()) { continue; } const { comp } = cell; comp.toggleCss("ag-selection-fill-top", false); comp.toggleCss("ag-selection-fill-right", false); comp.toggleCss("ag-selection-fill-bottom", false); comp.toggleCss("ag-selection-fill-left", false); } this.markedCells.length = 0; this.isUp = false; this.isLeft = false; this.isReduce = false; } clearCellValues() { this.cellValues.length = 0; } markPathFrom(initialPosition, currentPosition) { this.clearMarkedPath(); this.clearCellValues(); if (this.dragAxis === "y") { if (_isSameRow(currentPosition, initialPosition)) { return; } const isBefore = _isRowBefore(currentPosition, initialPosition); const { rangeStartRow, rangeEndRow } = this; if (isBefore && (currentPosition.rowPinned == rangeStartRow.rowPinned && currentPosition.rowIndex >= rangeStartRow.rowIndex || rangeStartRow.rowPinned != rangeEndRow.rowPinned && currentPosition.rowPinned == rangeEndRow.rowPinned && currentPosition.rowIndex <= rangeEndRow.rowIndex)) { this.reduceVertical(initialPosition, currentPosition); this.isReduce = true; } else { this.extendVertical(initialPosition, currentPosition, isBefore); this.isReduce = false; } } else { const initialColumn = initialPosition.column; const currentColumn = currentPosition.column; if (initialColumn === currentColumn) { return; } const displayedColumns = this.beans.visibleCols.allCols; const initialIndex = displayedColumns.indexOf(initialColumn); const currentIndex = displayedColumns.indexOf(currentColumn); if (currentIndex <= initialIndex && currentIndex >= displayedColumns.indexOf(this.cellRange.columns[0])) { this.reduceHorizontal(initialPosition, currentPosition); this.isReduce = true; } else { this.extendHorizontal(initialPosition, currentPosition, currentIndex < initialIndex); this.isReduce = false; } } this.lastCellMarked = currentPosition; } extendVertical(initialPosition, endPosition, isMovingUp) { const beans = this.beans; const { rangeSvc } = beans; let row = initialPosition; do { const cellRange = this.cellRange; const colLen = cellRange.columns.length; for (let i = 0; i < colLen; i++) { const column = cellRange.columns[i]; const rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned }; const cellPos = { ...rowPos, column }; const cellInRange = rangeSvc.isCellInSpecificRange(cellPos, cellRange); const isInitialRow = _isSameRow(row, initialPosition); if (isMovingUp) { this.isUp = true; } if (!isInitialRow) { const cell = _getCellByPosition(beans, cellPos); if (cell) { this.markedCells.push(cell); const cellComp = cell.comp; if (!cellInRange) { cellComp.toggleCss("ag-selection-fill-left", i === 0); cellComp.toggleCss("ag-selection-fill-right", i === colLen - 1); } cellComp.toggleCss( isMovingUp ? "ag-selection-fill-top" : "ag-selection-fill-bottom", _isSameRow(row, endPosition) ); } } } if (_isSameRow(row, endPosition)) { break; } } while ( // tslint:disable-next-line row = isMovingUp ? _getRowAbove(this.beans, row) : _getRowBelow(beans, row) ); } reduceVertical(initialPosition, endPosition) { let row = initialPosition; const beans = this.beans; do { const cellRange = this.cellRange; const colLen = cellRange.columns.length; const isLastRow = _isSameRow(row, endPosition); for (let i = 0; i < colLen; i++) { const rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned }; const celPos = { ...rowPos, column: cellRange.columns[i] }; const cell = _getCellByPosition(beans, celPos); if (cell) { this.markedCells.push(cell); cell.comp.toggleCss("ag-selection-fill-bottom", _isSameRow(row, endPosition)); } } if (isLastRow) { break; } } while (row = _getRowAbove(beans, row)); } extendHorizontal(initialPosition, endPosition, isMovingLeft) { const beans = this.beans; const { visibleCols } = beans; const allCols = visibleCols.allCols; const startCol = allCols.indexOf(isMovingLeft ? endPosition.column : initialPosition.column); const endCol = allCols.indexOf(isMovingLeft ? this.cellRange.columns[0] : endPosition.column); const offset = isMovingLeft ? 0 : 1; const colsToMark = allCols.slice(startCol + offset, endCol + offset); const { rangeStartRow, rangeEndRow } = this; for (const column of colsToMark) { let row = rangeStartRow; let isLastRow = false; do { isLastRow = _isSameRow(row, rangeEndRow); const cell = _getCellByPosition(beans, { rowIndex: row.rowIndex, rowPinned: row.rowPinned, column }); if (cell) { this.markedCells.push(cell); const cellComp = cell.comp; cellComp.toggleCss("ag-selection-fill-top", _isSameRow(row, rangeStartRow)); cellComp.toggleCss("ag-selection-fill-bottom", _isSameRow(row, rangeEndRow)); if (isMovingLeft) { this.isLeft = true; cellComp.toggleCss("ag-selection-fill-left", column === colsToMark[0]); } else { cellComp.toggleCss("ag-selection-fill-right", column === _last(colsToMark)); } } row = _getRowBelow(beans, row); } while (!isLastRow); } } reduceHorizontal(initialPosition, endPosition) { const beans = this.beans; const { visibleCols } = beans; const allCols = visibleCols.allCols; const startCol = allCols.indexOf(endPosition.column); const endCol = allCols.indexOf(initialPosition.column); const colsToMark = allCols.slice(startCol, endCol); const { rangeStartRow, rangeEndRow } = this; for (const column of colsToMark) { let row = rangeStartRow; let isLastRow = false; do { isLastRow = _isSameRow(row, rangeEndRow); const cell = _getCellByPosition(this.beans, { rowIndex: row.rowIndex, rowPinned: row.rowPinned, column }); if (cell) { this.markedCells.push(cell); cell.comp.toggleCss("ag-selection-fill-right", column === colsToMark[0]); } row = _getRowBelow(beans, row); } while (!isLastRow); } } refresh(cellCtrl, cellRange) { const cellRangeToUse = cellRange ?? this.beans.rangeSvc.getCellRanges()[0]; const isColumnRange = !cellRangeToUse.startRow || !cellRangeToUse.endRow; if (isColumnRange) { this.destroy(); return; } super.refresh(cellCtrl, cellRangeToUse); } }; // packages/ag-grid-enterprise/src/rangeSelection/agRangeHandle.ts var AgRangeHandle = class extends AbstractSelectionHandle { constructor() { super({ tag: "div", cls: "ag-range-handle" }); this.type = 1 /* RANGE */; this.rangeFixed = false; } onDrag(_) { const lastCellHovered = this.getLastCellHovered(); if (!lastCellHovered) { return; } const rangeSvc = this.beans.rangeSvc; const targetRange = this.cellRange ?? _last(rangeSvc.getCellRanges()); if (!targetRange) { return; } if (!this.rangeFixed) { this.fixRangeStartEnd(targetRange); this.rangeFixed = true; } this.endPosition = { rowIndex: lastCellHovered.rowIndex, rowPinned: lastCellHovered.rowPinned, column: lastCellHovered.column }; if (rangeSvc.getCellRanges().length === 2 && rangeSvc.getCellRanges()[0].type === CellRangeType.DIMENSION && targetRange.type === CellRangeType.VALUE) { const rowChanged = !_isSameRow(this.endPosition, rangeSvc.getRangeEndRow(targetRange)); if (rowChanged) { rangeSvc.updateRangeRowBoundary({ cellRange: rangeSvc.getCellRanges()[0], boundary: "end", cellPosition: { ...this.endPosition, column: rangeSvc.getCellRanges()[0].columns[0] }, silent: true }); } } rangeSvc.extendRangeToCell(targetRange, this.endPosition); } shouldSkipCell(_) { return false; } onDragEnd(_) { const cellRange = this.cellRange ?? _last(this.beans.rangeSvc.getCellRanges()); if (!cellRange) { return; } this.fixRangeStartEnd(cellRange); this.rangeFixed = false; } onDragCancel() { this.rangeFixed = false; } fixRangeStartEnd(cellRange) { const rangeSvc = this.beans.rangeSvc; const startRow = rangeSvc.getRangeStartRow(cellRange); const endRow = rangeSvc.getRangeEndRow(cellRange); const column = cellRange.columns[0]; cellRange.startRow = startRow; cellRange.endRow = endRow; cellRange.startColumn = column; } }; // packages/ag-grid-enterprise/src/rangeSelection/rangeSelection.css var rangeSelection_default = ".ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing),.ag-cell-range-selected.ag-cell-range-chart,.ag-cell-range-selected:not(.ag-cell-focus){background-color:var(--ag-range-selection-background-color);&.ag-cell-range-chart{background-color:var(--ag-range-selection-chart-background-color)!important;&.ag-cell-range-chart-category{background-color:var(--ag-range-selection-chart-category-background-color)!important}}}.ag-cell-range-selected-1.ag-cell-range-chart,.ag-cell-range-selected-1.ag-formula-range,.ag-cell-range-selected-1:not(.ag-cell-focus),.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing){background-color:var(--ag-range-selection-background-color)}.ag-cell-range-selected-2.ag-cell-range-chart,.ag-cell-range-selected-2.ag-formula-range,.ag-cell-range-selected-2:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-3.ag-cell-range-chart,.ag-cell-range-selected-3.ag-formula-range,.ag-cell-range-selected-3:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-4.ag-cell-range-chart,.ag-cell-range-selected-4.ag-formula-range,.ag-cell-range-selected-4:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell){&.ag-cell-range-top{border-top-color:var(--ag-range-selection-border-color);border-top-style:var(--ag-range-selection-border-style)}&.ag-cell-range-right{border-right-color:var(--ag-range-selection-border-color);border-right-style:var(--ag-range-selection-border-style)}&.ag-cell-range-bottom{border-bottom-color:var(--ag-range-selection-border-color);border-bottom-style:var(--ag-range-selection-border-style)}&.ag-cell-range-left{border-left-color:var(--ag-range-selection-border-color);border-left-style:var(--ag-range-selection-border-style)}}.ag-cell.ag-selection-fill-top,.ag-cell.ag-selection-fill-top.ag-cell-range-selected{border-top:1px dashed;border-top-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-right,:where(.ag-ltr) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-right,:where(.ag-rtl) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}.ag-cell.ag-selection-fill-bottom,.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected{border-bottom:1px dashed;border-bottom-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-left,:where(.ag-ltr) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-left,:where(.ag-rtl) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}.ag-fill-handle,.ag-range-handle{background-color:var(--ag-range-selection-border-color);bottom:-1px;height:6px;position:absolute;width:6px}:where(.ag-ltr) .ag-fill-handle,:where(.ag-ltr) .ag-range-handle{right:-1px}:where(.ag-rtl) .ag-fill-handle,:where(.ag-rtl) .ag-range-handle{left:-1px}.ag-fill-handle{cursor:crosshair}:where(.ag-ltr) .ag-range-handle{cursor:nwse-resize}:where(.ag-rtl) .ag-range-handle{cursor:nesw-resize}"; // packages/ag-grid-enterprise/src/rangeSelection/rangeSelectionApi.ts function getCellRanges(beans) { return beans.rangeSvc?.getCellRanges() ?? null; } function addCellRange(beans, params) { beans.rangeSvc?.addCellRange(params); } function clearRangeSelection(beans) { beans.rangeSvc?.removeAllCellRanges(); } // packages/ag-grid-enterprise/src/rangeSelection/cellRangeFeature.ts var CSS_CELL_RANGE_SELECTED = "ag-cell-range-selected"; var CSS_CELL_RANGE_CHART = "ag-cell-range-chart"; var CSS_CELL_RANGE_SINGLE_CELL = "ag-cell-range-single-cell"; var CSS_CELL_RANGE_CHART_CATEGORY = "ag-cell-range-chart-category"; var CSS_CELL_RANGE_HANDLE = "ag-cell-range-handle"; var CSS_CELL_RANGE_TOP = "ag-cell-range-top"; var CSS_CELL_RANGE_RIGHT = "ag-cell-range-right"; var CSS_CELL_RANGE_BOTTOM = "ag-cell-range-bottom"; var CSS_CELL_RANGE_LEFT = "ag-cell-range-left"; function _isRangeHandleEnabled(gos) { const selection = gos.get("cellSelection"); const useNewAPI = selection !== void 0; if (!useNewAPI) { return gos.get("enableRangeHandle"); } return typeof selection !== "boolean" ? selection.handle?.mode === "range" : false; } function _isFillHandleEnabled(gos) { const selection = gos.get("cellSelection"); const useNewAPI = selection !== void 0; if (!useNewAPI) { return gos.get("enableFillHandle"); } return typeof selection !== "boolean" ? selection.handle?.mode === "fill" : false; } var CellRangeFeature = class { constructor(beans, cellCtrl) { this.beans = beans; this.cellCtrl = cellCtrl; this.rangeColorClass = null; this.handleColorClass = null; this.rangeSvc = beans.rangeSvc; } setComp(cellComp) { this.cellComp = cellComp; this.eGui = this.cellCtrl.eGui; this.onCellSelectionChanged(); } unsetComp() { this.beans.context.destroyBean(this.selectionHandle); } onCellSelectionChanged() { const cellComp = this.cellComp; if (!cellComp) { return; } const { rangeSvc, cellCtrl, eGui } = this; const rangeCount = rangeSvc.getCellRangeCount(cellCtrl.cellPosition); this.rangeCount = rangeCount; const hasChartRange = this.getHasChartRange(); this.hasChartRange = hasChartRange; cellComp.toggleCss(CSS_CELL_RANGE_SELECTED, rangeCount !== 0); cellComp.toggleCss(`${CSS_CELL_RANGE_SELECTED}-1`, rangeCount === 1); cellComp.toggleCss(`${CSS_CELL_RANGE_SELECTED}-2`, rangeCount === 2); cellComp.toggleCss(`${CSS_CELL_RANGE_SELECTED}-3`, rangeCount === 3); cellComp.toggleCss(`${CSS_CELL_RANGE_SELECTED}-4`, rangeCount >= 4); cellComp.toggleCss(CSS_CELL_RANGE_CHART, hasChartRange); _setAriaSelected(eGui, rangeCount > 0 ? true : void 0); cellComp.toggleCss(CSS_CELL_RANGE_SINGLE_CELL, this.isSingleCell()); this.updateRangeBorders(); this.refreshRangeStyleAndHandle(); } updateRangeBorders() { const rangeBorders = this.getRangeBorders(); const isSingleCell = this.isSingleCell(); const isTop = !isSingleCell && rangeBorders.top; const isRight = !isSingleCell && rangeBorders.right; const isBottom = !isSingleCell && rangeBorders.bottom; const isLeft = !isSingleCell && rangeBorders.left; const cellComp = this.cellComp; cellComp.toggleCss(CSS_CELL_RANGE_TOP, isTop); cellComp.toggleCss(CSS_CELL_RANGE_RIGHT, isRight); cellComp.toggleCss(CSS_CELL_RANGE_BOTTOM, isBottom); cellComp.toggleCss(CSS_CELL_RANGE_LEFT, isLeft); } isSingleCell() { const { rangeSvc } = this; return this.rangeCount === 1 && !!rangeSvc && !rangeSvc.isMoreThanOneCell(); } getHasChartRange() { const { rangeSvc } = this; if (!this.rangeCount || !rangeSvc) { return false; } const cellRanges = rangeSvc.getCellRanges(); return cellRanges.length > 0 && cellRanges.every((range) => [CellRangeType.DIMENSION, CellRangeType.VALUE].includes(range.type)); } updateRangeBordersIfRangeCount() { if (this.rangeCount > 0) { this.updateRangeBorders(); this.refreshRangeStyleAndHandle(); } } getRangeBorders() { const isRtl = this.beans.gos.get("enableRtl"); let top = false; let right = false; let bottom = false; let left = false; const { rangeSvc, beans: { visibleCols }, cellCtrl: { cellPosition } } = this; const thisCol = cellPosition.column; const ranges = rangeSvc.getCellRanges().filter((range) => rangeSvc.isCellInSpecificRange(cellPosition, range)); if (!ranges.length) { return { top, right, bottom, left }; } let leftCol; let rightCol; if (isRtl) { leftCol = visibleCols.getColAfter(thisCol); rightCol = visibleCols.getColBefore(thisCol); } else { leftCol = visibleCols.getColBefore(thisCol); rightCol = visibleCols.getColAfter(thisCol); } if (!leftCol) { left = true; } if (!rightCol) { right = true; } for (let i = 0; i < ranges.length; i++) { if (top && right && bottom && left) { break; } const range = ranges[i]; const startRow = rangeSvc.getRangeStartRow(range); const endRow = rangeSvc.getRangeEndRow(range); if (!top && _isSameRow(startRow, cellPosition)) { top = true; } if (!bottom && _isSameRow(endRow, cellPosition)) { bottom = true; } if (!left && leftCol && range.columns.indexOf(leftCol) < 0) { left = true; } if (!right && rightCol && range.columns.indexOf(rightCol) < 0) { right = true; } } return { top, right, bottom, left }; } refreshRangeStyleAndHandle() { const { context } = this.beans; if (context.isDestroyed()) { return; } this.styleCellForRangeType(); const rangeForHandle = this.getRangeForHandle(); if (this.selectionHandle && !rangeForHandle) { this.selectionHandle = context.destroyBean(this.selectionHandle); } if (rangeForHandle) { this.addSelectionHandle(rangeForHandle); } this.refreshHandleColor(rangeForHandle); this.cellComp.toggleCss(CSS_CELL_RANGE_HANDLE, !!this.selectionHandle); } styleCellForRangeType() { if (this.hasChartRange) { const { rangeSvc } = this; const dimensionRange = rangeSvc.getCellRanges()[0]; const hasCategoryRange = dimensionRange.type === CellRangeType.DIMENSION; const isCategoryCell = hasCategoryRange && rangeSvc.isCellInSpecificRange(this.cellCtrl.cellPosition, dimensionRange); this.cellComp.toggleCss(CSS_CELL_RANGE_CHART_CATEGORY, isCategoryCell); } else { this.cellComp.toggleCss(CSS_CELL_RANGE_CHART_CATEGORY, false); this.applyRangeColor(this.getRangeColorClass()); } } applyRangeColor(nextClass) { if (this.rangeColorClass && this.rangeColorClass !== nextClass) { this.cellComp.toggleCss(this.rangeColorClass, false); this.cellComp.toggleCss("ag-formula-range", false); } if (nextClass) { this.cellComp.toggleCss(nextClass, true); this.cellComp.toggleCss("ag-formula-range", nextClass.startsWith("ag-formula-range")); } this.rangeColorClass = nextClass ?? null; } getRangeColorClass() { const { rangeSvc, rangeCount } = this; if (!rangeSvc || !rangeCount) { return null; } const ranges = rangeSvc.getCellRanges(); for (let i = ranges.length - 1; i >= 0; i--) { const range = ranges[i]; const colorClass = range.colorClass; if (!colorClass) { continue; } if (rangeSvc.isCellInSpecificRange(this.cellCtrl.cellPosition, range)) { return colorClass; } } return null; } refreshHandleColor(rangeForHandle) { const handleGui = this.selectionHandle?.getGui?.(); const nextClass = rangeForHandle?.colorClass ?? null; if (!handleGui) { this.handleColorClass = null; return; } if (this.handleColorClass && this.handleColorClass !== nextClass) { handleGui.classList.remove(this.handleColorClass); } if (nextClass) { handleGui.classList.add(nextClass); } else if (this.handleColorClass) { handleGui.classList.remove(this.handleColorClass); } this.handleColorClass = nextClass ?? null; } getRangeForHandle() { const { gos, editSvc } = this.beans; const rangeSvc = this.rangeSvc; const allRanges = rangeSvc.getCellRanges(); const rangesLen = allRanges.length; if (this.rangeCount < 1 || rangesLen < 1) { return null; } const isRangeSelectionEnabledWhileEditing = editSvc?.isRangeSelectionEnabledWhileEditing(); const rangesToRefreshHandle = isRangeSelectionEnabledWhileEditing ? allRanges : [_last(allRanges)]; for (const cellRange of rangesToRefreshHandle) { const { cellPosition, column } = this.cellCtrl; const isFillHandleAvailable = _isFillHandleEnabled(gos) && !column.isSuppressFillHandle(); const isRangeHandleAvailable = _isRangeHandleEnabled(gos); const isCellEditing = editSvc?.isEditing(this.cellCtrl, { withOpenEditor: true }); let handleIsAvailable = !isCellEditing && (isRangeSelectionEnabledWhileEditing || rangesLen === 1 && (isFillHandleAvailable || isRangeHandleAvailable)); if (this.hasChartRange) { handleIsAvailable = cellRange.type === CellRangeType.VALUE; } if (handleIsAvailable && cellRange.endRow != null && rangeSvc.isContiguousRange(cellRange) && rangeSvc.isBottomRightCell(cellRange, cellPosition)) { return cellRange; } } return null; } addSelectionHandle(cellRange) { const { beans } = this; const isRangeSelectionEnabledWhileEditing = beans.editSvc?.isRangeSelectionEnabledWhileEditing(); const cellRangeType = cellRange.type; const selectionHandleFill = !isRangeSelectionEnabledWhileEditing && _isFillHandleEnabled(beans.gos) && _missing(cellRangeType); const type = selectionHandleFill ? 0 /* FILL */ : 1 /* RANGE */; if (this.selectionHandle && this.selectionHandle.getType() !== type) { this.selectionHandle = beans.context.destroyBean(this.selectionHandle); } if (!this.selectionHandle) { const selectionHandle = beans.registry.createDynamicBean( type === 0 /* FILL */ ? "fillHandle" : "rangeHandle", false ); if (selectionHandle) { this.selectionHandle = beans.context.createBean(selectionHandle); } } this.selectionHandle?.refresh(this.cellCtrl, cellRange); } destroy() { this.unsetComp(); } }; // packages/ag-grid-enterprise/src/rangeSelection/dragListenerFeature.ts var DragListenerFeature = class extends BeanStub { constructor(eContainer) { super(); this.eContainer = eContainer; } postConstruct() { const { beans, gos, eContainer } = this; const rangeSvc = beans.rangeSvc; const params = { eElement: eContainer, onDragStart: rangeSvc.onDragStart.bind(rangeSvc), onDragStop: rangeSvc.onDragStop.bind(rangeSvc), onDragging: rangeSvc.onDragging.bind(rangeSvc) }; const dragSvc = beans.dragSvc; const enableFeature = dragSvc.addDragSource.bind(dragSvc, params); const disableFeature = dragSvc.removeDragSource.bind(dragSvc, params); this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => { if (_isCellSelectionEnabled(gos)) { enableFeature(); } else { disableFeature(); } }); this.addDestroyFunc(disableFeature); if (_isCellSelectionEnabled(gos)) { enableFeature(); } } }; // packages/ag-grid-enterprise/src/rangeSelection/headerGroupCellMouseListenerFeature.ts var HeaderGroupCellMouseListenerFeature = class extends BeanStub { constructor(column, eGui) { super(); this.column = column; this.eGui = eGui; } postConstruct() { this.addManagedElementListeners(this.eGui, { click: (e) => e && this.onClick(e) }); } onClick(event) { this.beans.rangeSvc?.handleColumnSelection(this.column, event); } }; // packages/ag-grid-enterprise/src/rangeSelection/rangeHeaderHighlightFeature.ts var RangeHeaderHighlightFeature = class extends BeanStub { constructor(column, comp) { super(); this.column = column; this.comp = comp; this.columnMap = /* @__PURE__ */ new Map(); this.isActive = false; this.resetColumnMap(); } postConstruct() { this.addManagedPropertyListener("cellSelection", () => { this.refreshActive(); }); this.refreshActive(); this.setupRangeHeaderHighlight(); } resetColumnMap() { this.columnMap.clear(); let columns; if (this.column.isColumn) { columns = [this.column]; } else { columns = this.column.getDisplayedLeafColumns(); } for (const column of columns) { this.columnMap.set(column, false); } } refreshActive() { const { gos, rangeSvc } = this.beans; const selection = gos.get("cellSelection"); this.isActive = !!(selection && rangeSvc && typeof selection === "object" && selection.enableHeaderHighlight); } setupRangeHeaderHighlight() { const listener = this.onRangeSelectionChanged.bind(this); this.addManagedEventListeners({ rangeSelectionChanged: listener, columnPinned: listener, columnMoved: listener, columnGroupOpened: listener }); listener(); } onRangeSelectionChanged() { if (!this.isActive) { return; } this.resetColumnMap(); const ranges = this.beans.rangeSvc.getCellRanges(); let hasRange = false; let isAllColumnRange = true; for (const range of ranges) { if (hasRange) { break; } for (const column of range.columns) { if (this.columnMap.has(column)) { this.columnMap.set(column, true); hasRange || (hasRange = true); } } } for (const value of Array.from(this.columnMap.values())) { if (value === false) { isAllColumnRange = false; break; } } this.comp.toggleCss("ag-header-range-highlight", hasRange && isAllColumnRange); } destroy() { super.destroy(); this.comp = null; this.column = null; } }; // packages/ag-grid-enterprise/src/rangeSelection/rangeService.ts var RangeService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rangeSvc"; this.rangeSelectionExtensions = []; this.cellRanges = []; this.bodyScrollListener = this.onBodyScroll.bind(this); this.dragging = false; /** When dragging ends, the current range will be used to intersect all other ranges */ this.intersectionRange = false; this.columnRangeSelectionCtx = {}; } wireBeans(beans) { this.rowModel = beans.rowModel; this.dragSvc = beans.dragSvc; this.colModel = beans.colModel; this.visibleCols = beans.visibleCols; this.cellNavigation = beans.cellNavigation; this.ctrlsSvc = beans.ctrlsSvc; } postConstruct() { const onColumnsChanged = this.onColumnsChanged.bind(this); const removeAllCellRanges = () => this.removeAllCellRanges(); const refreshLastRangeStart = this.refreshLastRangeStart.bind(this); this.addManagedEventListeners({ newColumnsLoaded: onColumnsChanged, columnVisible: onColumnsChanged, columnValueChanged: onColumnsChanged, columnPivotModeChanged: removeAllCellRanges, columnRowGroupChanged: removeAllCellRanges, columnPivotChanged: removeAllCellRanges, columnGroupOpened: refreshLastRangeStart, columnMoved: refreshLastRangeStart, columnPinned: refreshLastRangeStart }); this.ctrlsSvc.whenReady(this, (p) => { const gridBodyCtrl = p.gridBodyCtrl; this.autoScrollService = new AutoScrollService({ scrollContainer: gridBodyCtrl.eBodyViewport, scrollAxis: "xy", getVerticalPosition: () => gridBodyCtrl.scrollFeature.getVScrollPosition().top, setVerticalPosition: (position) => gridBodyCtrl.scrollFeature.setVerticalScrollPosition(position), getHorizontalPosition: () => gridBodyCtrl.scrollFeature.getHScrollPosition().left, setHorizontalPosition: (position) => gridBodyCtrl.scrollFeature.setHorizontalScrollPosition(position), shouldSkipVerticalScroll: () => !_isDomLayout(this.gos, "normal"), shouldSkipHorizontalScroll: () => !gridBodyCtrl.scrollFeature.isHorizontalScrollShowing() }); }); } registerRangeSelectionExtension(extension) { if (this.rangeSelectionExtensions.includes(extension)) { return; } this.rangeSelectionExtensions.push(extension); } unregisterRangeSelectionExtension(extension) { _removeFromArray(this.rangeSelectionExtensions, extension); } shouldSuppressRangeSelection(eventTarget) { return this.rangeSelectionExtensions.some((extension) => extension.shouldSuppressRangeSelection?.(eventTarget)); } shouldSkipColumn(column) { return this.rangeSelectionExtensions.some((extension) => extension.shouldSkipColumn?.(column)); } isAllColumnsSelectionCell(cellPosition) { return this.rangeSelectionExtensions.some((extension) => extension.isAllColumnsSelectionCell?.(cellPosition)); } isAllColumnsRange(range, allColumns) { return this.rangeSelectionExtensions.some((extension) => extension.isAllColumnsRange?.(range, allColumns)); } updateSelectionModeForCell(cellPosition) { this.setSelectionMode(this.isAllColumnsSelectionCell(cellPosition)); } // Drag And Drop Target Methods onDragStart(mouseEvent) { const gos = this.gos; const target = mouseEvent.target; if (!_isCellSelectionEnabled(gos) || _getRowCtrlForEventTarget(gos, target)?.isSuppressMouseEvent(mouseEvent)) { return; } if (this.shouldSuppressRangeSelection(target)) { return; } const { shiftKey } = mouseEvent; const isMultiRange = this.isMultiRange(mouseEvent); const extendRange = shiftKey && !!this.cellRanges?.length; if (!isMultiRange && (!extendRange || _exists(_last(this.cellRanges).type))) { this.removeAllCellRanges(true); } const startTarget = this.dragSvc.startTarget; if (startTarget) { this.updateValuesOnMove(startTarget); } if (!this.lastCellHovered) { return; } this.dragging = true; this.lastMouseEvent = mouseEvent; this.intersectionRange = isMultiRange && this.getCellRangeCount(this.lastCellHovered) > 1; if (!extendRange) { this.setNewestRangeStartCell(this.lastCellHovered); } if (this.cellRanges.length > 0) { this.draggingRange = _last(this.cellRanges); } else { const mouseRowPosition = { rowIndex: this.lastCellHovered.rowIndex, rowPinned: this.lastCellHovered.rowPinned }; const columns = this.getColumnsFromModel([this.lastCellHovered.column]); if (!columns?.length) { return; } this.draggingRange = { startRow: mouseRowPosition, endRow: mouseRowPosition, columns, startColumn: this.newestRangeStartCell.column }; this.cellRanges.push(this.draggingRange); } this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll", this.bodyScrollListener, { passive: true }); this.dispatchChangedEvent(true, false, this.draggingRange.id); } onDragging(mouseEvent) { const { dragging, lastCellHovered, newestRangeStartCell, autoScrollService, cellHasChanged } = this; if (!dragging || !mouseEvent) { return; } this.updateValuesOnMove(mouseEvent.target); this.lastMouseEvent = mouseEvent; const isMouseAndStartInPinned = (position) => lastCellHovered && lastCellHovered.rowPinned === position && newestRangeStartCell.rowPinned === position; const skipVerticalScroll = isMouseAndStartInPinned("top") || isMouseAndStartInPinned("bottom"); autoScrollService.check(mouseEvent, skipVerticalScroll); if (!cellHasChanged || !lastCellHovered) { return; } const startColumn = newestRangeStartCell?.column; const currentColumn = lastCellHovered?.column; const columns = this.calculateColumnsBetween(startColumn, currentColumn); if (!columns) { return; } const { rowIndex, rowPinned } = lastCellHovered; this.draggingRange.endRow = { rowIndex, rowPinned }; this.draggingRange.columns = columns; this.dispatchChangedEvent(false, false, this.draggingRange.id); } onDragStop() { if (!this.dragging) { return; } const { id } = this.draggingRange; this.autoScrollService.ensureCleared(); this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll", this.bodyScrollListener); this.lastMouseEvent = null; this.dragging = false; this.draggingRange = void 0; this.lastCellHovered = void 0; if (this.intersectionRange) { this.intersectionRange = false; this.intersectLastRange(); } this.dispatchChangedEvent(false, true, id); } // Called for both columns loaded and column visibility events onColumnsChanged() { this.refreshLastRangeStart(); const allColumns = this.visibleCols.allCols; for (const cellRange of this.cellRanges) { const beforeCols = cellRange.columns; cellRange.columns = cellRange.columns.filter( (col) => col.isVisible() && allColumns.indexOf(col) !== -1 ); const colsInRangeChanged = !_areEqual(beforeCols, cellRange.columns); if (colsInRangeChanged) { this.dispatchChangedEvent(false, true, cellRange.id); } } const countBefore = this.cellRanges.length; this.cellRanges = this.cellRanges.filter((range) => range.columns.length > 0); if (countBefore > this.cellRanges.length) { this.dispatchChangedEvent(false, true); } } refreshLastRangeStart() { const lastRange = _last(this.cellRanges); if (!lastRange) { return; } this.refreshRangeStart(lastRange); } isContiguousRange(cellRange) { const rangeColumns = cellRange.columns; if (!rangeColumns.length) { return false; } const allColumns = this.visibleCols.allCols; const allPositions = rangeColumns.map((c) => allColumns.indexOf(c)).sort((a, b) => a - b); return _last(allPositions) - allPositions[0] + 1 === rangeColumns.length; } getRangeStartRow(cellRange) { if (cellRange.startRow && cellRange.endRow) { return _isRowBefore(cellRange.startRow, cellRange.endRow) ? cellRange.startRow : cellRange.endRow; } const pinnedTopRowCount = this.beans.pinnedRowModel?.getPinnedTopRowCount() ?? 0; const rowPinned = pinnedTopRowCount > 0 ? "top" : null; return { rowIndex: 0, rowPinned }; } getRangeEndRow(cellRange) { if (cellRange.startRow && cellRange.endRow) { return _isRowBefore(cellRange.startRow, cellRange.endRow) ? cellRange.endRow : cellRange.startRow; } const pinnedBottomRowCount = this.beans.pinnedRowModel?.getPinnedBottomRowCount() ?? 0; const pinnedBottom = pinnedBottomRowCount > 0; if (pinnedBottom) { return { rowIndex: pinnedBottomRowCount - 1, rowPinned: "bottom" }; } return { rowIndex: this.rowModel.getRowCount() - 1, rowPinned: null }; } getRangeRowCount(cellRange) { const beans = this.beans; const start = this.getRangeStartRow(cellRange); const end = this.getRangeEndRow(cellRange); const startIndex = _getAbsoluteRowIndex(beans, start); const endIndex = _getAbsoluteRowIndex(beans, end); return endIndex - startIndex + 1; } handleCellMouseDown(event, cell) { const isMultiKey = event.ctrlKey || event.metaKey; this.handleCellSelectionInput(cell, { target: event.target, shiftKey: event.shiftKey, isRightClick: _interpretAsRightClick(this.beans, event), isMultiRange: this.isMultiRange(event), isMultiKey, preventDefault: () => event.preventDefault() }); } handleCellKeyboardSelect(event, cell) { const isMultiKey = event.ctrlKey || event.metaKey; this.handleCellSelectionInput(cell, { target: event.target, shiftKey: event.shiftKey, // keyboard selection should never be interpreted as a right click. isRightClick: false, isMultiRange: this.isMultiRangeForKeyState(isMultiKey), isMultiKey, preventDefault: () => event.preventDefault() }); } handleCellSelectionInput(cell, params) { const { target, shiftKey, isRightClick, isMultiRange, isMultiKey, preventDefault } = params; if (this.shouldSuppressRangeSelection(target)) { return; } const isAllColumnsCell = this.isAllColumnsSelectionCell(cell); if (isAllColumnsCell) { preventDefault(); } if (shiftKey) { return this.extendLatestRangeToCell(cell); } if (isAllColumnsCell && isRightClick) { return; } this.updateSelectionModeForCell(cell); const columns = this.calculateColumnsBetween(cell.column, cell.column); if (!columns) { return; } const containingRange = isAllColumnsCell ? this.findContainingRange({ columns, startRow: cell, endRow: cell }) : void 0; const isMultiRangeRemoval = isAllColumnsCell && !!containingRange && isMultiRange && isMultiKey; if (isMultiRangeRemoval && containingRange) { this.removeRowFromAllColumnsRange(cell, containingRange); } else { this.setRangeToCell(cell, isMultiRange); } } isMultiRange(event) { return this.isMultiRangeForKeyState(event.ctrlKey || event.metaKey); } isMultiRangeForKeyState(isMultiKey) { const { editingWithRanges, allowMulti } = this.getMultiRangeContext(); return editingWithRanges || (allowMulti ? isMultiKey : false); } getMultiRangeContext() { const { gos, editSvc } = this.beans; const editingWithRanges = !!editSvc?.isEditing() && !!editSvc?.isRangeSelectionEnabledWhileEditing(); const suppressMultiRanges = _getSuppressMultiRanges(gos) && !editingWithRanges; return { editingWithRanges, suppressMultiRanges, allowMulti: !suppressMultiRanges }; } removeRowFromAllColumnsRange(cell, containingRange) { const { beans, cellRanges } = this; const firstRow = _getFirstRow(beans); const lastRow = _getLastRow(beans); const startRow = this.getRangeStartRow(containingRange); const endRow = this.getRangeEndRow(containingRange); if (!startRow && _isSameRow(firstRow, cell)) { replaceEdgeRow(containingRange, _getRowBelow(beans, firstRow), "top"); } else if (!endRow && _isSameRow(lastRow, cell)) { replaceEdgeRow(containingRange, _getRowAbove(beans, lastRow), "bottom"); } else if (_isSameRow(startRow, endRow)) { _removeFromArray(cellRanges, containingRange); } else if (_isSameRow(startRow, cell)) { replaceEdgeRow(containingRange, _getRowBelow(beans, cell), "top"); } else if (_isSameRow(endRow, cell)) { replaceEdgeRow(containingRange, _getRowAbove(beans, cell), "bottom"); } else { const rowAbove = _getRowAbove(beans, cell); const rowBelow = _getRowBelow(beans, cell); containingRange.startRow = startRow; containingRange.endRow = rowAbove ?? void 0; cellRanges.push({ ...containingRange, startRow: rowBelow ?? void 0, endRow }); } this.dispatchChangedEvent(true, true); } setRangeToCell(cell, appendRange = false) { const { gos } = this; if (!_isCellSelectionEnabled(gos)) { return; } this.updateSelectionModeForCell(cell); const columns = this.calculateColumnsBetween(cell.column, cell.column); if (!columns) { return; } const { suppressMultiRanges } = this.getMultiRangeContext(); if (suppressMultiRanges || !appendRange || _missing(this.cellRanges)) { this.removeAllCellRanges(true); } const rowForCell = { rowIndex: cell.rowIndex, rowPinned: cell.rowPinned }; const cellRange = { startRow: rowForCell, endRow: rowForCell, columns, startColumn: cell.column }; const startColumn = this.ensureRangeStartColumn(cellRange); if (!startColumn) { return; } this.cellRanges.push(cellRange); this.setNewestRangeStartCell({ ...cell, column: startColumn }); this.onDragStop(); this.dispatchChangedEvent(true, true); } getRangeLastColumn(cellRange) { const firstCol = cellRange.columns[0]; const lastCol = _last(cellRange.columns); return this.newestRangeStartCell?.column === firstCol ? lastCol : firstCol; } extendRangeRowCountBy(cellRange, targetCount) { const { beans } = this; const { startRow, endRow } = cellRange; if (!startRow || !endRow) { return; } let stepsMoved = 0; let currentRow; const isBottomUp = _isRowBefore(endRow, startRow); if (isBottomUp) { currentRow = startRow; } else { currentRow = endRow; } const stepFn = targetCount > 0 ? _getRowBelow : _getRowAbove; const stepCount = Math.abs(targetCount); while (stepsMoved < stepCount) { const nextRow = stepFn(beans, currentRow); if (!nextRow) { break; } currentRow = nextRow; stepsMoved++; } if (stepsMoved !== stepCount) { return; } const cellPosition = { ...currentRow, column: this.getRangeLastColumn(cellRange) }; this.updateRangeRowBoundary({ cellRange, boundary: isBottomUp ? "start" : "end", cellPosition }); } extendRangeColumnCountBy(cellRange, delta) { const { columns } = cellRange; if (delta === 0) { return; } const allColumns = this.getColumnsFromModel(); if (!allColumns) { return; } const rangeStartColumn = this.ensureRangeStartColumn(cellRange); if (!rangeStartColumn) { return; } const lastColumn = _last(columns); const endColumn = rangeStartColumn === columns[0] ? lastColumn : columns[0]; if (!lastColumn || !endColumn) { return; } let startIdx = allColumns.indexOf(rangeStartColumn); const endIdx = allColumns.indexOf(endColumn); const isRtlRange = endIdx < startIdx; if (isRtlRange) { startIdx = endIdx; } const currentLength = columns.length; const targetLength = currentLength + delta; if (targetLength <= 0) { return; } const newColumns = []; for (let i = startIdx; i < startIdx + targetLength; i++) { const col = allColumns[i]; if (!col) { break; } newColumns.push(col); } if (newColumns.length === targetLength) { if (isRtlRange) { const newColumnToFocus = _last(newColumns); cellRange.startColumn = newColumnToFocus; this.focusCellOnNewColumn(cellRange, newColumnToFocus); } cellRange.columns = newColumns; this.dispatchChangedEvent(true, true, cellRange.id); } } extendLatestRangeToCell(cellPosition) { if (this.isEmpty() || !this.newestRangeStartCell) { return; } const cellRange = _last(this.cellRanges); this.updateSelectionModeForCell(cellPosition); this.updateRangeRowBoundary({ cellRange, boundary: "end", cellPosition }); } extendRangeToCell(cellRange, cellPosition) { if (!cellRange) { return; } this.updateSelectionModeForCell(cellPosition); this.updateRangeRowBoundary({ cellRange, boundary: "end", cellPosition }); } updateRangeRowBoundary(params) { const { cellRange, boundary, cellPosition, silent = false } = params; const endColumn = cellPosition.column; const startColumn = this.ensureRangeStartColumn(cellRange); if (!startColumn) { return; } const colsToAdd = this.calculateColumnsBetween(startColumn, endColumn); if (!colsToAdd || isLastCellOfRange(cellRange, cellPosition)) { return; } if (boundary === "start") { this.focusCellOnNewRow(cellRange, cellPosition); } cellRange.columns = colsToAdd; cellRange[boundary === "start" ? "startRow" : "endRow"] = { rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned }; if (!silent) { this.dispatchChangedEvent(true, true, cellRange.id); } } getRangeEdgeColumns(cellRange) { const allColumns = this.visibleCols.allCols; const allIndices = cellRange.columns.map((c) => allColumns.indexOf(c)).filter((i) => i > -1).sort((a, b) => a - b); return { left: allColumns[allIndices[0]], right: allColumns[_last(allIndices)] }; } // returns true if successful, false if not successful extendLatestRangeInDirection(event) { if (this.isEmpty() || !this.newestRangeStartCell) { return; } const key = event.key; const ctrlKey = event.ctrlKey || event.metaKey; const lastRange = _last(this.cellRanges); const startCell = this.newestRangeStartCell; const endCellIndex = lastRange.endRow.rowIndex; const endCellFloating = lastRange.endRow.rowPinned; const endCellColumn = this.getRangeLastColumn(lastRange); const endCell = { column: endCellColumn, rowIndex: endCellIndex, rowPinned: endCellFloating }; const newEndCell = this.cellNavigation.getNextCellToFocus(key, endCell, ctrlKey); if (!newEndCell) { return; } if (this.shouldSkipColumn(newEndCell.column)) { return; } this.setCellRange({ rowStartIndex: startCell.rowIndex, rowStartPinned: startCell.rowPinned, rowEndIndex: newEndCell.rowIndex, rowEndPinned: newEndCell.rowPinned, columnStart: startCell.column, columnEnd: newEndCell.column }); return newEndCell; } setCellRange(params) { if (!_isCellSelectionEnabled(this.gos)) { return; } this.removeAllCellRanges(true); this.addCellRange(params); } setCellRanges(cellRanges) { if (_areEqual(this.cellRanges, cellRanges)) { return; } if (!this.verifyCellRanges(this.gos)) { return; } this.setSelectionMode(false); this.removeAllCellRanges(true); const allDataColumns = this.getColumnsFromModel(this.visibleCols.allCols) ?? []; let hasAllColumnsRange = false; for (const cellRange of cellRanges) { if (cellRange.columns && cellRange.startRow) { const columns = this.getColumnsFromModel(cellRange.columns); if (!columns || columns.length === 0) { continue; } cellRange.columns = columns; const { startRow } = cellRange; this.setNewestRangeStartCell({ rowIndex: startRow.rowIndex, rowPinned: startRow.rowPinned, column: cellRange.columns[0] }); } if (!hasAllColumnsRange && allDataColumns.length > 0 && this.isAllColumnsRange(cellRange, allDataColumns)) { hasAllColumnsRange = true; } this.cellRanges.push(cellRange); } this.setSelectionMode(hasAllColumnsRange); this.dispatchChangedEvent(false, true); } clearCellRangeCellValues(params) { const { beans, eventSvc } = this; const { cellEventSource = "rangeSvc", dispatchWrapperEvents, wrapperEventSource = "deleteKey", restoreSourceInBatch } = params; let { cellRanges } = params; if (dispatchWrapperEvents) { eventSvc.dispatchEvent({ type: "cellSelectionDeleteStart", source: wrapperEventSource }); eventSvc.dispatchEvent({ type: "rangeDeleteStart", source: wrapperEventSource }); } if (!cellRanges) { cellRanges = this.cellRanges; } const { valueSvc, editSvc } = beans; const batch = !!editSvc?.isBatchEditing(); const { changeDetectionSvc } = beans; changeDetectionSvc?.beginDeferred(); try { this.forEachEditableCellInRanges(cellRanges, (rowNode, column) => { if (restoreSourceInBatch && batch) { editSvc?.batchResetToSourceValue({ rowNode, column }); return; } const deleteValue = valueSvc.getDeleteValue(column, rowNode); rowNode.setDataValue(column, deleteValue, cellEventSource); }); } finally { changeDetectionSvc?.endDeferred(); } if (dispatchWrapperEvents) { eventSvc.dispatchEvent({ type: "cellSelectionDeleteEnd", source: wrapperEventSource }); eventSvc.dispatchEvent({ type: "rangeDeleteEnd", source: wrapperEventSource }); } } createCellRangeFromCellRangeParams(params) { return this.createPartialCellRangeFromRangeParams(params, false); } // range service can't normally support a range without columns, but charts can createPartialCellRangeFromRangeParams(params, allowEmptyColumns) { const { columns: paramColumns, columnStart, columnEnd, rowStartIndex, rowStartPinned, rowEndIndex, rowEndPinned } = params; const columnInfo = this.getColumnsFromParams( paramColumns, columnStart, columnEnd ); if (!columnInfo || !allowEmptyColumns && columnInfo.columns.length === 0) { return; } const { columns, startsOnTheRight } = columnInfo; const startRow = createRowPosition(rowStartIndex, rowStartPinned); const endRow = createRowPosition(rowEndIndex, rowEndPinned); return { startRow, endRow, columns, startColumn: this.getColumnFromModel(columnStart) ?? (startsOnTheRight ? _last(columns) : columns[0]) }; } addCellRange(params) { const gos = this.gos; if (!_isCellSelectionEnabled(gos) || !this.verifyCellRanges(gos)) { return; } this.setSelectionMode(false); const newRange = this.createCellRangeFromCellRangeParams(params); if (newRange) { if (newRange.startRow) { this.setNewestRangeStartCell({ rowIndex: newRange.startRow.rowIndex, rowPinned: newRange.startRow.rowPinned, column: newRange.startColumn }); } this.cellRanges.push(newRange); this.dispatchChangedEvent(false, true, newRange.id); return newRange; } } getCellRanges() { return this.cellRanges; } isEmpty() { return this.cellRanges.length === 0; } isMoreThanOneCell() { const len = this.cellRanges.length; if (len === 0) { return false; } if (len > 1) { return true; } const range = this.cellRanges[0]; const startRow = this.getRangeStartRow(range); const endRow = this.getRangeEndRow(range); return startRow.rowPinned !== endRow.rowPinned || startRow.rowIndex !== endRow.rowIndex || range.columns.length !== 1; } areAllRangesAbleToMerge() { const rowToColumnMap = /* @__PURE__ */ new Map(); const len = this.cellRanges.length; if (len <= 1) { return true; } for (const range of this.cellRanges) { this.forEachRowInRange(range, (row) => { const rowName = `${row.rowPinned || "normal"}_${row.rowIndex}`; const columns = rowToColumnMap.get(rowName); const currentRangeColIds = range.columns.map((col) => col.getId()); if (columns) { const filteredColumns = currentRangeColIds.filter((col) => columns.indexOf(col) === -1); columns.push(...filteredColumns); } else { rowToColumnMap.set(rowName, currentRangeColIds); } }); } let columnsString; for (const val of rowToColumnMap.values()) { const currentValString = val.sort().join(); if (columnsString === void 0) { columnsString = currentValString; continue; } if (columnsString !== currentValString) { return false; } } return true; } removeAllCellRanges(silent) { if (this.isEmpty()) { return; } this.onDragStop(); this.cellRanges.length = 0; if (!silent) { this.dispatchChangedEvent(false, true); } } isCellInAnyRange(cell) { return this.getCellRangeCount(cell) > 0; } isCellInSpecificRange(cell, range) { const columnInRange = range.columns?.includes(cell.column); const rowInRange = this.isRowInRange(cell, range); return columnInRange && rowInRange; } isColumnInAnyRange(column) { const { beans } = this; const firstRow = _getFirstRow(beans); const lastRow = _getLastRow(beans); if (!firstRow || !lastRow) { return false; } const columns = column.isColumn ? [column] : column.getDisplayedLeafColumns(); return this.findContainingRange({ columns, startRow: firstRow, endRow: lastRow }, true) != null; } findContainingRange({ columns, startRow, endRow }, matchOnly = false) { const ranges = this.cellRanges; for (let i = ranges.length - 1; i >= 0; i--) { const range = ranges[i]; const hasCols = columns.every((c) => range.columns.includes(c)); let condition = false; if (matchOnly) { condition = _isSameRow(range.startRow, startRow) && _isSameRow(range.endRow, endRow); } else { const isStartBeforeOrEqual = startRow && this.isRowInRange(startRow, range); const isEndAfterOrEqual = endRow && this.isRowInRange(endRow, range); condition = !!isStartBeforeOrEqual && !!isEndAfterOrEqual; } if (hasCols && condition) { return range; } } } isBottomRightCell(cellRange, cell) { const allColumns = this.visibleCols.allCols; const allPositions = cellRange.columns.map((c) => allColumns.indexOf(c)).sort((a, b) => a - b); const { startRow, endRow } = cellRange; const lastRow = _isRowBefore(startRow, endRow) ? endRow : startRow; const isRightColumn = allColumns.indexOf(cell.column) === _last(allPositions); const isLastRow = cell.rowIndex === lastRow.rowIndex && _makeNull(cell.rowPinned) === _makeNull(lastRow.rowPinned); return isRightColumn && isLastRow; } // returns the number of ranges this cell is in getCellRangeCount(cell) { return this.cellRanges.filter((cellRange) => this.isCellInSpecificRange(cell, cellRange)).length; } isRowInRange(thisRow, cellRange) { const firstRow = this.getRangeStartRow(cellRange); const lastRow = this.getRangeEndRow(cellRange); const equalsFirstRow = _isSameRow(thisRow, firstRow); const equalsLastRow = _isSameRow(thisRow, lastRow); if (equalsFirstRow || equalsLastRow) { return true; } const afterFirstRow = !_isRowBefore(thisRow, firstRow); const beforeLastRow = _isRowBefore(thisRow, lastRow); return afterFirstRow && beforeLastRow; } intersectLastRange(fromMouseClick) { const { editingWithRanges, suppressMultiRanges } = this.getMultiRangeContext(); if (editingWithRanges || suppressMultiRanges || fromMouseClick && this.dragging || this.isEmpty()) { return; } const lastRange = _last(this.cellRanges); const intersectionStartRow = this.getRangeStartRow(lastRange); const intersectionEndRow = this.getRangeEndRow(lastRange); const newRanges = []; for (const range of this.cellRanges.slice(0, -1)) { const startRow = this.getRangeStartRow(range); const endRow = this.getRangeEndRow(range); const cols = range.columns; const intersectCols = cols.filter((col) => lastRange.columns.indexOf(col) === -1); if (intersectCols.length === cols.length) { newRanges.push(range); continue; } if (_isRowBefore(intersectionEndRow, startRow) || _isRowBefore(endRow, intersectionStartRow)) { newRanges.push(range); continue; } const rangeCountBefore = newRanges.length; if (_isRowBefore(startRow, intersectionStartRow)) { const top = { columns: [...cols], startColumn: lastRange.startColumn, startRow: { ...startRow }, endRow: _getRowAbove(this.beans, intersectionStartRow) }; newRanges.push(top); } if (intersectCols.length > 0) { const middle = { columns: intersectCols, startColumn: intersectCols.includes(lastRange.startColumn) ? lastRange.startColumn : intersectCols[0], startRow: rowMax([{ ...intersectionStartRow }, { ...startRow }]), endRow: rowMin([{ ...intersectionEndRow }, { ...endRow }]) }; newRanges.push(middle); } if (_isRowBefore(intersectionEndRow, endRow)) { newRanges.push({ columns: [...cols], startColumn: lastRange.startColumn, startRow: _getRowBelow(this.beans, intersectionEndRow), endRow: { ...endRow } }); } if (newRanges.length - rangeCountBefore === 1) { newRanges[newRanges.length - 1].id = range.id; } } this.cellRanges = newRanges; if (fromMouseClick) { this.dispatchChangedEvent(false, true); } } createRangeHighlightFeature(compBean, column, headerComp) { compBean.createManagedBean(new RangeHeaderHighlightFeature(column, headerComp)); } setSelectionMode(allColumns) { this.selectionMode = allColumns ? 1 /* ALL_COLUMNS */ : 0 /* NORMAL */; } refreshRangeStart(cellRange) { const { columns } = cellRange; const startColumn = this.ensureRangeStartColumn(cellRange); if (!startColumn) { return; } const moveColInCellRange = (colToMove, moveToFront) => { const otherCols = cellRange.columns.filter((col) => col !== colToMove); if (colToMove) { cellRange.startColumn = colToMove; cellRange.columns = moveToFront ? [colToMove, ...otherCols] : [...otherCols, colToMove]; } else { cellRange.columns = otherCols; } }; const { left, right } = this.getRangeEdgeColumns(cellRange); const shouldMoveLeftCol = startColumn === columns[0] && startColumn !== left; if (shouldMoveLeftCol) { moveColInCellRange(left, true); return; } const shouldMoveRightCol = startColumn === _last(columns) && startColumn === right; if (shouldMoveRightCol) { moveColInCellRange(right, false); } } setNewestRangeStartCell(position) { this.newestRangeStartCell = position; } getColumnsFromParams(columns, columnA, columnB) { const noColsInfo = !columns && !columnA && !columnB; let processedColumns; let startsOnTheRight = false; if (noColsInfo || columns) { processedColumns = this.getColumnsFromModel(noColsInfo ? void 0 : columns); } else if (columnA && columnB) { processedColumns = this.calculateColumnsBetween(columnA, columnB); if (processedColumns?.length) { startsOnTheRight = processedColumns[0] !== this.getColumnFromModel(columnA); } } return processedColumns ? { columns: processedColumns, startsOnTheRight } : void 0; } verifyCellRanges(gos) { const { suppressMultiRanges } = this.getMultiRangeContext(); const invalid = _isUsingNewCellSelectionAPI(gos) && suppressMultiRanges && this.cellRanges.length > 1; if (invalid) { _warn(93); } return !invalid; } forEachRowInRange(cellRange, callback) { const topRow = this.getRangeStartRow(cellRange); const bottomRow = this.getRangeEndRow(cellRange); let currentRow = topRow; while (currentRow) { callback(currentRow); if (_isSameRow(currentRow, bottomRow)) { break; } currentRow = _getRowBelow(this.beans, currentRow); } } forEachEditableCellInRanges(cellRanges, callback) { const { beans } = this; for (const cellRange of cellRanges) { this.forEachRowInRange(cellRange, (rowPosition) => { const rowNode = _getRowNode(beans, rowPosition); if (!rowNode) { return; } for (let i = 0; i < cellRange.columns.length; i++) { const column = this.getColumnFromModel(cellRange.columns[i]); if (!column?.isCellEditable(rowNode)) { continue; } callback(rowNode, column); } }); } } // as the user is dragging outside of the panel, the div starts to scroll, which in turn // means we are selecting more (or less) cells, but the mouse isn't moving, so we recalculate // the selection by mimicking a new mouse event onBodyScroll() { if (this.dragging && this.lastMouseEvent) { this.onDragging(this.lastMouseEvent); } } updateValuesOnMove(eventTarget) { const cellCtrl = _getCellCtrlForEventTarget(this.gos, eventTarget); const cell = cellCtrl?.cellPosition; this.cellHasChanged = false; if (!cell || this.lastCellHovered && _areCellsEqual(cell, this.lastCellHovered)) { return; } const editSvc = this.beans.editSvc; const editing = editSvc?.isEditing(cellCtrl, { withOpenEditor: true }); if (editing && !editSvc?.isRangeSelectionEnabledWhileEditing()) { this.dragSvc.cancelDrag(eventTarget); return; } if (this.lastCellHovered) { this.cellHasChanged = true; } this.lastCellHovered = cell; } dispatchChangedEvent(started, finished, id) { this.eventSvc.dispatchEvent({ type: "cellSelectionChanged", started, finished, id }); this.eventSvc.dispatchEvent({ type: "rangeSelectionChanged", started, finished, id }); } getColumnFromModel(col) { return typeof col === "string" ? this.colModel.getCol(col) : col; } getColumnsFromModel(cols) { const { visibleCols, selectionMode } = this; if (!cols || selectionMode === 1 /* ALL_COLUMNS */) { cols = visibleCols.allCols; } const columns = []; for (const col of cols) { const column = this.getColumnFromModel(col); if (!column || this.shouldSkipColumn(column)) { continue; } columns.push(column); } return columns.length ? columns : void 0; } ensureRangeStartColumn(cellRange) { const startColumn = this.getRangeStartColumn( cellRange.columns, cellRange.startColumn ); if (!startColumn) { return; } cellRange.startColumn = startColumn; return startColumn; } getRangeStartColumn(columns, preferredStartColumn) { const firstColumn = columns[0]; const lastColumn = _last(columns); if (!firstColumn || !lastColumn) { return; } if (!preferredStartColumn || columns.includes(preferredStartColumn)) { return preferredStartColumn ?? firstColumn; } const allColumns = this.visibleCols.allCols; const preferredStartIndex = allColumns.indexOf(preferredStartColumn); const firstIndex = allColumns.indexOf(firstColumn); const lastIndex = allColumns.indexOf(lastColumn); if (preferredStartIndex < 0 || firstIndex < 0 || lastIndex < 0) { return firstColumn; } return preferredStartIndex - firstIndex <= lastIndex - preferredStartIndex ? firstColumn : lastColumn; } calculateColumnsBetween(columnA, columnB) { const allColumns = this.visibleCols.allCols; const fromColumn = this.getColumnFromModel(columnA); const toColumn = this.getColumnFromModel(columnB); const isSameColumn = fromColumn === toColumn; const fromIndex = allColumns.indexOf(fromColumn); if (fromIndex < 0) { _warn(178, { colId: fromColumn.getId() }); return; } const toIndex = isSameColumn ? fromIndex : allColumns.indexOf(toColumn); if (toIndex < 0) { _warn(178, { colId: toColumn.getId() }); return; } if (isSameColumn || this.selectionMode === 1 /* ALL_COLUMNS */) { return this.getColumnsFromModel([fromColumn]); } const firstIndex = Math.min(fromIndex, toIndex); const lastIndex = firstIndex === fromIndex ? toIndex : fromIndex; return this.getColumnsFromModel(allColumns.slice(firstIndex, lastIndex + 1)); } focusCellOnNewColumn(currentRange, column) { const { focusSvc } = this.beans; const focusedCell = focusSvc.getFocusedCell(); if (!focusedCell) { return; } if (this.isCellInSpecificRange(focusedCell, currentRange)) { focusSvc.setFocusedCell({ ...focusedCell, column, forceBrowserFocus: true, preventScrollOnBrowserFocus: true }); } } focusCellOnNewRow(currentRange, row) { const { focusSvc } = this.beans; const focusedCell = focusSvc.getFocusedCell(); if (!focusedCell) { return; } if (this.isCellInSpecificRange(focusedCell, currentRange)) { focusSvc.setFocusedCell({ ...row, column: focusedCell.column, forceBrowserFocus: true, preventScrollOnBrowserFocus: true }); } } createDragListenerFeature(eContainer) { return new DragListenerFeature(eContainer); } createCellRangeFeature(ctrl) { return new CellRangeFeature(this.beans, ctrl); } createHeaderGroupCellMouseListenerFeature(column, eGui) { return new HeaderGroupCellMouseListenerFeature(column, eGui); } /** * Handle a user clicking column header to (de)select one or more column of cells * CTRL-clicking for toggling column selection + CTRL-SHIFT-clicking supported for selecting ranges of columns */ handleColumnSelection(clickedColumn, event) { const { gos, beans, columnRangeSelectionCtx: ctx, cellRanges } = this; if (!_getEnableColumnSelection(gos)) { return; } const { suppressMultiRanges, editingWithRanges } = this.getMultiRangeContext(); const hasRanges = cellRanges.length > 0; const isMeta = event.ctrlKey || event.metaKey; const allowToggle = !editingWithRanges || isMeta; const firstRow = _getFirstRow(beans); const lastRow = _getLastRow(beans); if (!firstRow || !lastRow) { return; } if (event.key === KeyCode.ENTER) { event.preventDefault(); } if (event.shiftKey) { const root = ctx.root; if (!root) { return; } const column = clickedColumn.isColumn ? clickedColumn : _last(clickedColumn.getLeafColumns()); const range = this.findContainingRange({ columns: [root], startRow: firstRow, endRow: lastRow }, true); if (!range) { _removeFromArray(cellRanges, ctx.lastCellRange); this.selectColumns(this.calculateColumnsBetween(root, column), firstRow, lastRow); return; } this.updateRangeRowBoundary({ cellRange: range, boundary: "end", cellPosition: { column, ...lastRow } }); return; } if (hasRanges && (suppressMultiRanges || !isMeta && !editingWithRanges)) { this.removeAllCellRanges(true); } const toggleColumns = (columns, root) => { const foundRange = this.findContainingRange({ columns, startRow: firstRow, endRow: lastRow }, true); if (foundRange && allowToggle) { this.deselectColumnsFromRange(foundRange, columns); } else { const addedRange = this.selectColumns(columns, firstRow, lastRow); if (addedRange) { ctx.lastCellRange = addedRange; } } ctx.root = root; }; if (clickedColumn.isColumn) { toggleColumns([clickedColumn], clickedColumn); } else { const leafCols = clickedColumn.getDisplayedLeafColumns(); toggleColumns(leafCols, leafCols[0]); } } deselectColumnsFromRange(range, columns) { _removeAllFromArray(range.columns, columns); if (columns.includes(range.startColumn)) { range.startColumn = range.columns[0]; } if (range.columns.length === 0) { _removeFromArray(this.cellRanges, range); } this.dispatchChangedEvent(true, true); } selectColumns(columns, startRow, endRow) { return this.addCellRange({ columns, columnStart: columns[0], columnEnd: _last(columns), rowStartIndex: startRow.rowIndex, rowStartPinned: startRow.rowPinned, rowEndIndex: endRow.rowIndex, rowEndPinned: endRow.rowPinned }); } }; function createRowPosition(rowIndex, rowPinned) { return rowIndex != null ? { rowIndex, rowPinned } : void 0; } function rowMax(rows) { let max; for (const row of rows) { if (max === void 0 || _isRowBefore(max, row)) { max = row; } } return max; } function rowMin(rows) { let min; for (const row of rows) { if (min === void 0 || _isRowBefore(row, min)) { min = row; } } return min; } function isLastCellOfRange(cellRange, cell) { const { startRow, endRow } = cellRange; const lastRow = _isRowBefore(startRow, endRow) ? endRow : startRow; const isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned; const rangeFirstIndexColumn = cellRange.columns[0]; const rangeLastIndexColumn = _last(cellRange.columns); const lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn; const isLastColumn = cell.column === lastRangeColumn; return isLastColumn && isLastRow; } function replaceEdgeRow(range, row, topOrBottom) { let key; if (topOrBottom === "top") { key = !range.startRow || !range.endRow || _isRowBefore(range.startRow, range.endRow) ? "startRow" : "endRow"; } else { key = !range.startRow || !range.endRow || _isRowBefore(range.startRow, range.endRow) ? "endRow" : "startRow"; } range[key] = row ?? void 0; } // packages/ag-grid-enterprise/src/rangeSelection/rangeSelectionModule.ts var CellSelectionModule = { moduleName: "CellSelection", version: VERSION2, beans: [RangeService], dynamicBeans: { fillHandle: AgFillHandle, rangeHandle: AgRangeHandle }, apiFunctions: { getCellRanges, addCellRange, clearRangeSelection, clearCellSelection: clearRangeSelection }, dependsOn: [EnterpriseCoreModule, KeyboardNavigationModule, DragModule], css: [rangeSelection_default] }; var RangeSelectionModule = { moduleName: "RangeSelection", version: VERSION2, dependsOn: [CellSelectionModule] }; // packages/ag-grid-enterprise/src/cellRenderers/loadingCellRenderer.ts var LoadingCellRendererElement = { tag: "div", cls: "ag-loading", children: [ { tag: "span", ref: "eLoadingIcon", cls: "ag-loading-icon" }, { tag: "span", ref: "eLoadingText", cls: "ag-loading-text" } ] }; var LoadingCellRenderer = class extends Component { constructor() { super(LoadingCellRendererElement); this.eLoadingIcon = RefPlaceholder; this.eLoadingText = RefPlaceholder; } init(params) { if (params.node.failedLoad) { this.setupFailed(); } else { this.setupLoading(); } } setupFailed() { this.eLoadingText.textContent = this.getLocaleTextFunc()("loadingError", "ERR"); } setupLoading() { const eLoadingIcon = _createIconNoSpan("groupLoading", this.beans, null); if (eLoadingIcon) { this.eLoadingIcon.appendChild(eLoadingIcon); } this.eLoadingText.textContent = this.getLocaleTextFunc()("loadingOoo", "Loading..."); } refresh(_params) { return false; } }; // packages/ag-grid-enterprise/src/cellRenderers/enterpriseCellRendererModule.ts var LoadingCellRendererModule = { moduleName: "LoadingCellRenderer", version: VERSION2, userComponents: { agLoadingCellRenderer: LoadingCellRenderer }, icons: { // rotating spinner shown by the loading cell renderer groupLoading: "loading" }, dependsOn: [EnterpriseCoreModule] }; // packages/ag-grid-enterprise/src/pivot/pivotApi.ts function isPivotMode(beans) { return beans.colModel.isPivotMode(); } function getPivotResultColumn(beans, pivotKeys, valueColKey) { return beans.pivotResultCols?.lookupPivotResultCol(pivotKeys, valueColKey) ?? null; } function setValueColumns(beans, colKeys) { beans.valueColsSvc?.setColumns(colKeys, "api"); } function getValueColumns(beans) { return beans.valueColsSvc?.columns ?? []; } function removeValueColumns(beans, colKeys) { beans.valueColsSvc?.removeColumns(colKeys, "api"); } function addValueColumns(beans, colKeys) { beans.valueColsSvc?.addColumns(colKeys, "api"); } function setPivotColumns(beans, colKeys) { beans.pivotColsSvc?.setColumns(colKeys, "api"); } function removePivotColumns(beans, colKeys) { beans.pivotColsSvc?.removeColumns(colKeys, "api"); } function addPivotColumns(beans, colKeys) { beans.pivotColsSvc?.addColumns(colKeys, "api"); } function getPivotColumns(beans) { return beans.pivotColsSvc?.columns ?? []; } function setPivotResultColumns(beans, colDefs) { beans.pivotResultCols?.setPivotResultCols(colDefs, "api"); } function getPivotResultColumns(beans) { const pivotResultCols = beans.pivotResultCols?.getPivotResultCols(); return pivotResultCols ? pivotResultCols.list : null; } // packages/ag-grid-enterprise/src/pivot/pivotColDefService.ts var PIVOT_ROW_TOTAL_PREFIX = "PivotRowTotal_"; var headerNameComparator = ({ headerName: a }, { headerName: b }) => { if (a && !b) { return 1; } else if (!a && b) { return -1; } else if (!a && !b) { return 0; } if (a < b) { return -1; } else if (a > b) { return 1; } else { return 0; } }; var convertToHeaderNameComparator = (comparator) => (a, b) => comparator(a.headerName, b.headerName); var PivotColDefService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pivotColDefSvc"; } wireBeans(beans) { this.colModel = beans.colModel; this.pivotColsSvc = beans.pivotColsSvc; this.valueColsSvc = beans.valueColsSvc; this.colNames = beans.colNames; } postConstruct() { const getFieldSeparator = () => this.gos.get("serverSidePivotResultFieldSeparator") ?? "_"; this.fieldSeparator = getFieldSeparator(); this.addManagedPropertyListener("serverSidePivotResultFieldSeparator", () => { this.fieldSeparator = getFieldSeparator(); }); const getPivotDefaultExpanded = () => this.gos.get("pivotDefaultExpanded"); this.pivotDefaultExpanded = getPivotDefaultExpanded(); this.addManagedPropertyListener("pivotDefaultExpanded", () => { this.pivotDefaultExpanded = getPivotDefaultExpanded(); }); } createPivotColumnDefs(uniqueValues) { const pivotColumnGroupDefs = this.createPivotColumnsFromUniqueValues(uniqueValues); function extractColDefs(input, arr = []) { input.forEach((def) => { if (def.children !== void 0) { extractColDefs(def.children, arr); } else { arr.push(def); } }); return arr; } const pivotColumnDefs = extractColDefs(pivotColumnGroupDefs); this.addRowGroupTotals(pivotColumnGroupDefs, pivotColumnDefs); this.addExpandablePivotGroups(pivotColumnGroupDefs, pivotColumnDefs); this.addPivotTotalsToGroups(pivotColumnGroupDefs, pivotColumnDefs); return pivotColumnGroupDefs; } createPivotColumnsFromUniqueValues(uniqueValues) { const pivotColumns = this.pivotColsSvc?.columns ?? []; const maxDepth = pivotColumns.length; const pivotColumnGroupDefs = this.recursivelyBuildGroup( 0, uniqueValues, [], maxDepth, pivotColumns ); return pivotColumnGroupDefs; } recursivelyBuildGroup(index, uniqueValue, pivotKeys, maxDepth, primaryPivotColumns) { if (index >= maxDepth) { return this.buildMeasureCols(pivotKeys); } const { pivotComparator } = primaryPivotColumns[index].getColDef(); const comparator = pivotComparator ? convertToHeaderNameComparator(pivotComparator) : headerNameComparator; const measureColumns = this.valueColsSvc?.columns; if (measureColumns?.length === 1 && this.gos.get("removePivotHeaderRowWhenSingleValueColumn") && index === maxDepth - 1) { const leafCols = []; for (const key of uniqueValue.keys()) { const newPivotKeys = [...pivotKeys, key]; const colDef = this.createColDef(measureColumns[0], key, newPivotKeys); colDef.columnGroupShow = "open"; leafCols.push(colDef); } leafCols.sort(comparator); return leafCols; } const groups = []; for (const key of uniqueValue.keys()) { const openByDefault = this.pivotDefaultExpanded === -1 || index < this.pivotDefaultExpanded; const newPivotKeys = [...pivotKeys, key]; groups.push({ children: this.recursivelyBuildGroup( index + 1, uniqueValue.get(key), newPivotKeys, maxDepth, primaryPivotColumns ), headerName: key, pivotKeys: newPivotKeys, columnGroupShow: "open", openByDefault, groupId: this.generateColumnGroupId(newPivotKeys) }); } groups.sort(comparator); return groups; } buildMeasureCols(pivotKeys) { const measureColumns = this.valueColsSvc?.columns ?? []; if (measureColumns.length === 0) { return [this.createColDef(null, "-", pivotKeys)]; } return measureColumns.map((measureCol) => { const columnName = this.colNames.getDisplayNameForColumn(measureCol, "header"); const colDef = this.createColDef(measureCol, columnName, pivotKeys); colDef.columnGroupShow = "open"; return colDef; }); } addExpandablePivotGroups(pivotColumnGroupDefs, pivotColumnDefs) { const isSuppressExpand = this.gos.get("suppressExpandablePivotGroups"); if (isSuppressExpand || this.gos.get("pivotColumnGroupTotals")) { return; } const recursivelyAddSubTotals = (def, currentPivotColumnDefs, acc) => { if ("children" in def) { const { valueColsSvc } = this; const { columns: valueCols = [] } = valueColsSvc ?? {}; const childAcc = /* @__PURE__ */ new Map(); def.children.forEach((grp) => { recursivelyAddSubTotals(grp, currentPivotColumnDefs, childAcc); }); const leafGroup = !def.children.some((child) => child.children); const hasCollapsedLeafGroup = leafGroup && valueCols.length === 1 && this.gos.get("removePivotHeaderRowWhenSingleValueColumn"); for (const valueColumn of valueCols) { const columnName = this.colNames.getDisplayNameForColumn(valueColumn, "header"); const totalColDef = this.createColDef(valueColumn, columnName, def.pivotKeys); totalColDef.pivotTotalColumnIds = childAcc.get(valueColumn.getColId()); totalColDef.columnGroupShow = !isSuppressExpand ? "closed" : "open"; totalColDef.aggFunc = valueColumn.getAggFunc(); if (!leafGroup || hasCollapsedLeafGroup) { const children = def.children; children.push(totalColDef); currentPivotColumnDefs.push(totalColDef); } } this.merge(acc, childAcc); return; } if (!def.pivotValueColumn) { return; } const pivotValueColId = def.pivotValueColumn.getColId(); const exists = acc.has(pivotValueColId); if (exists) { const arr = acc.get(pivotValueColId); arr.push(def.colId); } else { acc.set(pivotValueColId, [def.colId]); } }; pivotColumnGroupDefs.forEach((groupDef) => { recursivelyAddSubTotals(groupDef, pivotColumnDefs, /* @__PURE__ */ new Map()); }); } addPivotTotalsToGroups(pivotColumnGroupDefs, pivotColumnDefs) { if (!this.gos.get("pivotColumnGroupTotals")) { return; } const insertAfter = this.gos.get("pivotColumnGroupTotals") === "after"; const valueCols = this.valueColsSvc?.columns; const aggFuncs = valueCols?.map((valueCol) => valueCol.getAggFunc()); if (!aggFuncs || aggFuncs.length < 1 || !this.sameAggFuncs(aggFuncs)) { return; } if (valueCols) { const valueColumn = valueCols[0]; pivotColumnGroupDefs.forEach((groupDef) => { this.recursivelyAddPivotTotal(groupDef, pivotColumnDefs, valueColumn, insertAfter); }); } } recursivelyAddPivotTotal(groupDef, pivotColumnDefs, valueColumn, insertAfter) { const group = groupDef; if (!group.children) { const def = groupDef; return def.colId ? [def.colId] : null; } let colIds = []; group.children.forEach((grp) => { const childColIds = this.recursivelyAddPivotTotal(grp, pivotColumnDefs, valueColumn, insertAfter); if (childColIds) { colIds = colIds.concat(childColIds); } }); if (group.children.length > 1) { const localeTextFunc = this.getLocaleTextFunc(); const headerName = localeTextFunc("pivotColumnGroupTotals", "Total"); const totalColDef = this.createColDef(valueColumn, headerName, groupDef.pivotKeys, true); totalColDef.pivotTotalColumnIds = colIds; totalColDef.aggFunc = valueColumn.getAggFunc(); totalColDef.columnGroupShow = this.gos.get("suppressExpandablePivotGroups") ? "open" : void 0; const children = groupDef.children; if (insertAfter) { children.push(totalColDef); } else { children.unshift(totalColDef); } pivotColumnDefs.push(totalColDef); } return colIds; } addRowGroupTotals(pivotColumnGroupDefs, pivotColumnDefs) { if (!this.gos.get("pivotRowTotals")) { return; } const insertAtEnd = this.gos.get("pivotRowTotals") === "after"; const valueColumns = this.valueColsSvc?.columns ?? []; const valueCols = valueColumns.slice(); if (!insertAtEnd) { valueCols.reverse(); } const isCreateTotalGroups = valueCols.length > 1 || !this.gos.get("removePivotHeaderRowWhenSingleValueColumn"); for (let i = 0; i < valueCols.length; i++) { const valueCol = valueCols[i]; const columnName = this.colNames.getDisplayNameForColumn(valueCol, "header"); const colDef = this.createColDef(valueCol, columnName, []); const colIds = []; for (let i2 = 0; i2 < pivotColumnDefs.length; i2++) { const colDef2 = pivotColumnDefs[i2]; if (colDef2.pivotValueColumn === valueCol) { colIds.push(colDef2.colId); } } colDef.pivotTotalColumnIds = colIds; colDef.colId = PIVOT_ROW_TOTAL_PREFIX + colDef.colId; const valueGroup = isCreateTotalGroups ? { children: [colDef], pivotKeys: [], groupId: `${PIVOT_ROW_TOTAL_PREFIX}_pivotGroup_${valueCol.getColId()}` } : colDef; pivotColumnDefs.push(colDef); if (insertAtEnd) { pivotColumnGroupDefs.push(valueGroup); } else { pivotColumnGroupDefs.unshift(valueGroup); } } } /** * Recreate a pivot colDef to update from a changed valueColumn colDef */ recreateColDef(colDef) { const { pivotValueColumn, headerName, pivotKeys, pivotTotalColumnIds, columnGroupShow, colId, valueGetter, aggFunc } = colDef; if (!pivotValueColumn) { return colDef; } const newColDef = this.createColDef(pivotValueColumn, headerName, pivotKeys, !!pivotTotalColumnIds); newColDef.columnGroupShow = columnGroupShow; newColDef.colId = colId; newColDef.valueGetter = valueGetter; newColDef.aggFunc = aggFunc; newColDef.pivotTotalColumnIds = pivotTotalColumnIds; this.gos.get("processPivotResultColDef")?.(newColDef); return newColDef; } createColDef(valueColumn, headerName, pivotKeys, totalColumn = false) { const colDef = {}; if (valueColumn) { const colDefToCopy = valueColumn.getColDef(); Object.assign(colDef, colDefToCopy); colDef.hide = false; } colDef.headerName = headerName; colDef.colId = this.generateColumnId( pivotKeys || [], valueColumn && !totalColumn ? valueColumn.getColId() : "" ); colDef.field = colDef.colId; colDef.valueGetter = (params) => params.data?.[params.colDef.field]; colDef.pivotKeys = pivotKeys; colDef.pivotValueColumn = valueColumn; if (colDef.filter === true) { colDef.filter = "agNumberColumnFilter"; } return colDef; } sameAggFuncs(aggFuncs) { if (aggFuncs.length == 1) { return true; } for (let i = 1; i < aggFuncs.length; i++) { if (aggFuncs[i] !== aggFuncs[0]) { return false; } } return true; } merge(m1, m2) { m2.forEach((value, key) => { const existingList = m1.has(key) ? m1.get(key) : []; const updatedList = [...existingList, ...value]; m1.set(key, updatedList); }); } generateColumnGroupId(pivotKeys) { const pivotCols = (this.pivotColsSvc?.columns ?? []).map((col) => col.getColId()); return `pivotGroup_${pivotCols.join("-")}_${pivotKeys.join("-")}`; } generateColumnId(pivotKeys, measureColumnId) { const pivotCols = (this.pivotColsSvc?.columns ?? []).map((col) => col.getColId()); return `pivot_${pivotCols.join("-")}_${pivotKeys.join("-")}_${measureColumnId}`; } /** * Used by the SSRM to create secondary columns from provided fields * @param fields */ createColDefsFromFields(fields) { const uniqueValues = /* @__PURE__ */ new Map(); for (let i = 0; i < fields.length; i++) { const field = fields[i]; const parts = field.split(this.fieldSeparator); let level = uniqueValues; for (let p = 0; p < parts.length; p++) { const part = parts[p]; let map = level.get(part); if (!map) { map = /* @__PURE__ */ new Map(); level.set(part, map); } level = map; } } const uniqueValuesToGroups = (id, key, uniqueValues2, depth) => { const children = []; for (const [key2, item] of uniqueValues2) { const child = uniqueValuesToGroups(`${id}${this.fieldSeparator}${key2}`, key2, item, depth + 1); children.push(child); } if (children.length === 0) { const potentialAggCol = this.colModel.getColDefCol(key); if (potentialAggCol) { const headerName = this.colNames.getDisplayNameForColumn(potentialAggCol, "header") ?? key; const colDef = this.createColDef(potentialAggCol, headerName, void 0, false); colDef.colId = id; colDef.aggFunc = potentialAggCol.getAggFunc(); colDef.valueGetter = (params) => params.data?.[id]; return colDef; } const col = { colId: id, headerName: key, // this is to support using pinned rows, normally the data will be extracted from the aggData object using the colId // however pinned rows still access the data object by field, this prevents values with dots from being treated as complex objects valueGetter: (params) => params.data?.[id] }; return col; } const collapseSingleChildren = this.gos.get("removePivotHeaderRowWhenSingleValueColumn"); if (collapseSingleChildren && children.length === 1 && "colId" in children[0]) { children[0].headerName = key; return children[0]; } const group = { openByDefault: this.pivotDefaultExpanded === -1 || depth < this.pivotDefaultExpanded, groupId: id, headerName: key, children }; return group; }; const res = []; for (const [key, item] of uniqueValues) { const col = uniqueValuesToGroups(key, key, item, 0); res.push(col); } return res; } }; // packages/ag-grid-enterprise/src/pivot/pivotResultColsService.ts var PivotResultColsService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pivotResultCols"; } wireBeans(beans) { this.colModel = beans.colModel; this.visibleCols = beans.visibleCols; } destroy() { _destroyColumnTree(this.beans, this.pivotResultCols?.tree); super.destroy(); } isPivotResultColsPresent() { return this.pivotResultCols != null; } lookupPivotResultCol(pivotKeys, valueColKey) { if (this.pivotResultCols == null) { return null; } const valueColumnToFind = this.colModel.getColDefCol(valueColKey); let foundColumn = null; for (const column of this.pivotResultCols.list) { const thisPivotKeys = column.getColDef().pivotKeys; const pivotValueColumn = column.getColDef().pivotValueColumn; const pivotKeyMatches = _areEqual(thisPivotKeys, pivotKeys); const pivotValueMatches = pivotValueColumn === valueColumnToFind; if (pivotKeyMatches && pivotValueMatches) { foundColumn = column; } } return foundColumn; } getPivotResultCols() { return this.pivotResultCols; } getPivotResultCol(key) { if (!this.pivotResultCols) { return null; } return this.colModel.getColFromCollection(key, this.pivotResultCols); } getAggregationOrderedList() { let result = this.aggOrderedList; if (result !== void 0) { return result; } const list = this.pivotResultCols?.list; if (!list || list.length === 0) { this.aggOrderedList = null; return null; } let hasAnyTotals = false; for (let i = 0; i < list.length; ++i) { if (list[i].getColDef().pivotTotalColumnIds != null) { hasAnyTotals = true; break; } } if (!hasAnyTotals) { result = list; } else { const regular = []; const totals = []; for (let i = 0; i < list.length; ++i) { const col = list[i]; if (col.getColDef().pivotTotalColumnIds != null) { totals.push(col); } else { regular.push(col); } } result = regular.concat(totals); } this.aggOrderedList = result; return result; } setPivotResultCols(colDefs, source) { this.aggOrderedList = void 0; if (!this.colModel.ready) { return; } if (colDefs == null && this.pivotResultCols == null) { return; } if (colDefs) { this.processPivotResultColDef(colDefs); const createColTreeFunc = source === "api" ? _createColumnTree : _createColumnTreeWithIds; const balancedTreeResult = createColTreeFunc( this.beans, colDefs, false, this.pivotResultCols?.tree || this.previousPivotResultCols || void 0, source ); _destroyColumnTree(this.beans, this.pivotResultCols?.tree, balancedTreeResult.columnTree); const tree = balancedTreeResult.columnTree; const treeDepth = balancedTreeResult.treeDepth; const list = _getColumnsFromTree(tree); const map = {}; this.pivotResultCols = { tree, treeDepth, list, map }; for (const col of this.pivotResultCols.list) { this.pivotResultCols.map[col.getId()] = col; } const hasPreviousCols = !!this.previousPivotResultCols; this.previousPivotResultCols = null; this.colModel.refreshCols(!hasPreviousCols, source); } else { this.previousPivotResultCols = this.pivotResultCols ? this.pivotResultCols.tree : null; this.pivotResultCols = null; this.colModel.refreshCols(false, source); } this.visibleCols.refresh(source); } processPivotResultColDef(colDefs) { const columnCallback = this.gos.get("processPivotResultColDef"); const groupCallback = this.gos.get("processPivotResultColGroupDef"); if (!columnCallback && !groupCallback) { return void 0; } const searchForColDefs = (colDefs2) => { colDefs2.forEach((abstractColDef) => { const isGroup = _exists(abstractColDef.children); if (isGroup) { const colGroupDef = abstractColDef; if (groupCallback) { groupCallback(colGroupDef); } searchForColDefs(colGroupDef.children); } else { const colDef = abstractColDef; if (columnCallback) { columnCallback(colDef); } } }); }; if (colDefs) { searchForColDefs(colDefs); } } }; // packages/ag-grid-enterprise/src/pivot/pivotStage.ts var EXCEEDED_MAX_UNIQUE_VALUES = "Exceeded maximum allowed pivot column count."; var mapToObject = (map) => { const obj = {}; map.forEach((value, key) => obj[key] = value instanceof Map ? mapToObject(value) : value); return obj; }; var PivotStage = class extends BeanStub { constructor() { super(...arguments); this.beanName = "pivotStage"; this.step = "pivot"; this.refreshProps = [ "removePivotHeaderRowWhenSingleValueColumn", "pivotRowTotals", "pivotColumnGroupTotals", "suppressExpandablePivotGroups" ]; this.uniqueValues = /* @__PURE__ */ new Map(); this.lastTimeFailed = false; this.maxUniqueValues = -1; this.currentUniqueCount = 0; } wireBeans(beans) { this.valueSvc = beans.valueSvc; this.colModel = beans.colModel; this.pivotResultCols = beans.pivotResultCols; this.rowGroupColsSvc = beans.rowGroupColsSvc; this.valueColsSvc = beans.valueColsSvc; this.pivotColsSvc = beans.pivotColsSvc; this.pivotColDefSvc = beans.pivotColDefSvc; } /** Returns `true` if the changedPath should be deactivated (e.g. pivot columns changed). */ execute(changedPath) { if (this.colModel.isPivotActive()) { return this.executePivotOn(changedPath); } else { return this.executePivotOff(); } } executePivotOff() { this.aggregationColumnsHashLastTime = null; this.uniqueValues = /* @__PURE__ */ new Map(); if (this.pivotResultCols.isPivotResultColsPresent()) { this.pivotResultCols.setPivotResultCols(null, "rowModelUpdated"); return true; } return false; } executePivotOn(changedPath) { const numberOfAggregationColumns = this.valueColsSvc?.columns.length ?? 1; const configuredMaxCols = this.gos.get("pivotMaxGeneratedColumns"); this.maxUniqueValues = configuredMaxCols === -1 ? -1 : configuredMaxCols / numberOfAggregationColumns; let uniqueValues; try { uniqueValues = this.bucketUpRowNodes(changedPath); } catch (e) { if (e.message === EXCEEDED_MAX_UNIQUE_VALUES) { this.pivotResultCols.setPivotResultCols([], "rowModelUpdated"); this.eventSvc.dispatchEvent({ type: "pivotMaxColumnsExceeded", message: e.message }); this.lastTimeFailed = true; return false; } throw e; } const uniqueValuesChanged = this.setUniqueValues(uniqueValues); const aggregationColumns = this.valueColsSvc?.columns ?? []; const aggregationColumnsHash = aggregationColumns.map((column) => `${column.getId()}-${column.getColDef().headerName}`).join("#"); const aggregationFuncsHash = aggregationColumns.map((column) => column.getAggFunc().toString()).join("#"); const aggregationColumnsChanged = this.aggregationColumnsHashLastTime !== aggregationColumnsHash; const aggregationFuncsChanged = this.aggregationFuncsHashLastTime !== aggregationFuncsHash; this.aggregationColumnsHashLastTime = aggregationColumnsHash; this.aggregationFuncsHashLastTime = aggregationFuncsHash; const groupColumnsHash = (this.rowGroupColsSvc?.columns ?? []).map((column) => column.getId()).join("#"); const groupColumnsChanged2 = groupColumnsHash !== this.groupColumnsHashLastTime; this.groupColumnsHashLastTime = groupColumnsHash; const pivotRowTotals = this.gos.get("pivotRowTotals"); const pivotColumnGroupTotals = this.gos.get("pivotColumnGroupTotals"); const suppressExpandablePivotGroups = this.gos.get("suppressExpandablePivotGroups"); const removePivotHeaderRowWhenSingleValueColumn = this.gos.get("removePivotHeaderRowWhenSingleValueColumn"); const anyGridOptionsChanged = pivotRowTotals !== this.pivotRowTotalsLastTime || pivotColumnGroupTotals !== this.pivotColumnGroupTotalsLastTime || suppressExpandablePivotGroups !== this.suppressExpandablePivotGroupsLastTime || removePivotHeaderRowWhenSingleValueColumn !== this.removePivotHeaderRowWhenSingleValueColumnLastTime; this.pivotRowTotalsLastTime = pivotRowTotals; this.pivotColumnGroupTotalsLastTime = pivotColumnGroupTotals; this.suppressExpandablePivotGroupsLastTime = suppressExpandablePivotGroups; this.removePivotHeaderRowWhenSingleValueColumnLastTime = removePivotHeaderRowWhenSingleValueColumn; if (this.lastTimeFailed || uniqueValuesChanged || aggregationColumnsChanged || groupColumnsChanged2 || aggregationFuncsChanged || anyGridOptionsChanged) { const pivotColumnGroupDefs = this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues); this.pivotResultCols.setPivotResultCols(pivotColumnGroupDefs, "rowModelUpdated"); this.lastTimeFailed = false; return true; } this.lastTimeFailed = false; return false; } setUniqueValues(newValues) { const uniqueValuesChanged = !_jsonEquals(mapToObject(this.uniqueValues), mapToObject(newValues)); if (uniqueValuesChanged) { this.uniqueValues = newValues; return true; } return false; } bucketUpRowNodes(changedPath) { this.currentUniqueCount = 0; const uniqueValues = /* @__PURE__ */ new Map(); _forEachChangedGroupDepthFirst( this.beans.rowModel.rootNode, this.beans.rowModel.hierarchical, changedPath, (node) => { if (node.leafGroup) { node.childrenMapped = null; } } ); const recursivelyBucketFilteredChildren = (node) => { if (node.leafGroup) { this.bucketRowNode(node, uniqueValues); } else { const children = node.childrenAfterFilter; if (children) { for (let i = 0, len = children.length; i < len; ++i) { recursivelyBucketFilteredChildren(children[i]); } } } }; recursivelyBucketFilteredChildren(this.beans.rowModel.rootNode); return uniqueValues; } bucketRowNode(rowNode, uniqueValues) { const pivotColumns = this.pivotColsSvc?.columns; if (pivotColumns?.length === 0) { rowNode.childrenMapped = null; } else { rowNode.childrenMapped = mapToObject( this.bucketChildren(rowNode.childrenAfterFilter, pivotColumns, 0, uniqueValues) ); } if (rowNode.sibling) { rowNode.sibling.childrenMapped = rowNode.childrenMapped; } } bucketChildren(children, pivotColumns = [], pivotIndex, uniqueValues) { const mappedChildren = /* @__PURE__ */ new Map(); const pivotColumn = pivotColumns[pivotIndex]; const doesGeneratedColMaxExist = this.maxUniqueValues !== -1; for (let i = 0, len = children.length; i < len; ++i) { const child = children[i]; let key = this.valueSvc.getKeyForNode(pivotColumn, child); if (_missing(key)) { key = ""; } if (!uniqueValues.get(key)) { this.currentUniqueCount += 1; uniqueValues.set(key, /* @__PURE__ */ new Map()); const hasExceededColMax = this.currentUniqueCount > this.maxUniqueValues; if (doesGeneratedColMaxExist && hasExceededColMax) { throw new Error(EXCEEDED_MAX_UNIQUE_VALUES); } } if (!mappedChildren.has(key)) { mappedChildren.set(key, []); } mappedChildren.get(key).push(child); } if (pivotIndex === pivotColumns.length - 1) { return mappedChildren; } const result = /* @__PURE__ */ new Map(); for (const key of mappedChildren.keys()) { result.set( key, this.bucketChildren(mappedChildren.get(key), pivotColumns, pivotIndex + 1, uniqueValues.get(key)) ); } return result; } }; // packages/ag-grid-enterprise/src/pivot/pivotModule.ts var SharedPivotModule = { moduleName: "SharedPivot", version: VERSION2, beans: [PivotResultColsService, PivotColDefService, PivotColsSvc], apiFunctions: { isPivotMode, getPivotResultColumn, setValueColumns, getValueColumns, removeValueColumns, addValueColumns, setPivotColumns, removePivotColumns, addPivotColumns, getPivotColumns, setPivotResultColumns, getPivotResultColumns }, dependsOn: [SharedRowGroupingModule, ColumnGroupModule] }; var PivotModule = { moduleName: "Pivot", version: VERSION2, rowModels: ["clientSide"], beans: [PivotStage], dependsOn: [SharedPivotModule, RowGroupingModule, ClientSideRowModelHierarchyModule] }; // packages/ag-grid-enterprise/src/treeData/fieldAccess.ts var fieldGetter = (path) => { const segments = path.split("."); if (segments.includes("__proto__")) { return () => { }; } const len = segments.length; if (len < 2) { return (data) => data?.[path]; } return (data) => { let i = 0; do { data = data?.[segments[i++]]; if (i === len) { return data; } } while (typeof data === "object"); }; }; // packages/ag-grid-enterprise/src/treeData/treeGroupStrategy.ts var FLAG_CHILDREN_CHANGED = 2147483648; var FLAG_CHANGED = 1073741824; var FLAG_MARKED_FILLER = 536870912; var MASK_CHILDREN_LEN = 268435455; var PATH_KEY_SEPARATOR = String.fromCodePoint(31, 41150, 8291); var PATH_KEY_SEPARATOR_LEN = 3; var TreeGroupStrategy = class extends BeanStub { constructor() { super(...arguments); this.nestedDataGetter = null; this.parentIdGetter = null; this.nonLeafsById = null; this.nodesToUnselect = null; this.fullReload = false; } postConstruct() { this.onPropChange(null); } onPropChange(changedProps) { const gos = this.gos; if (!changedProps || changedProps.has("treeDataParentIdField")) { const parentIdField = gos.get("treeDataParentIdField"); const getter = parentIdField ? fieldGetter(parentIdField) : null; this.fullReload || (this.fullReload = this.parentIdGetter !== getter); this.parentIdGetter = getter; if (getter) { this.nestedDataGetter = null; } } if (!changedProps || changedProps.has("treeDataChildrenField")) { const childrenField = this.parentIdGetter ? "" : gos.get("treeDataChildrenField"); const getter = childrenField ? fieldGetter(childrenField) : null; this.fullReload || (this.fullReload = this.nestedDataGetter !== getter); this.nestedDataGetter = getter; } } destroy() { this.nodesToUnselect = null; this.reset(); super.destroy(); } reset() { this.clearNonLeafs(); this.deselectHiddenNodes(false); this.fullReload = true; } clearNonLeafs() { const fillers = this.nonLeafsById; if (fillers) { for (const node of fillers.values()) { node._destroy(false); } fillers.clear(); this.nonLeafsById = null; } } getNonLeaf(id) { return this.nonLeafsById?.get(id); } loadGroupData(node) { const key = node.key; if (key == null) { node._groupData = null; return null; } const groupData = {}; node._groupData = groupData; const groupDisplayCols = this.beans.showRowGroupCols?.columns; if (groupDisplayCols) { for (let i = 0, len = groupDisplayCols.length; i < len; ++i) { groupData[groupDisplayCols[i].getColId()] = key; } } return groupData; } execute(rootNode, params) { if (this.fullReload) { this.reset(); } const { changedRowNodes, changedPath } = params; const fullReload = this.fullReload || !changedRowNodes && !changedPath; const hasUpdates = !!changedRowNodes && this.flagUpdatedNodes(changedRowNodes); if (fullReload || hasUpdates) { this.fullReload = false; if (this.parentIdGetter) { this.loadSelfRef(rootNode, fullReload); } else if (this.nestedDataGetter) { this.loadNested(rootNode, changedRowNodes, fullReload); } else { this.loadDataPath(rootNode, fullReload); } } const parentsChanged = this.initRowsParents(rootNode); this.destroyFillerRows(!!params.animate); this.initRowsChildrenSize(rootNode); let preprocessedCount = this.preprocessRows(rootNode); const treeChanged = parentsChanged || (preprocessedCount & FLAG_CHILDREN_CHANGED) !== 0; preprocessedCount &= ~FLAG_CHILDREN_CHANGED; const traverseCount = this.traverseRoot(rootNode, changedPath); if (preprocessedCount > 0 && preprocessedCount !== traverseCount) { this.handleCycles(rootNode); this.traverseRoot(rootNode, changedPath); } rootNode.treeNodeFlags = 0; this.deselectHiddenNodes(parentsChanged || fullReload); return treeChanged; } flagUpdatedNodes(changedRowNodes) { const { adds, updates, removals } = changedRowNodes; let hasUpdates = removals.length > 0; if (adds.size > 0) { hasUpdates = true; for (const node of adds) { node.treeNodeFlags |= FLAG_CHANGED; } } if (updates.size > 0) { hasUpdates = true; for (const node of updates) { node.treeNodeFlags |= FLAG_CHANGED; } } return hasUpdates; } initRowsParents(rootNode) { const allLeafs = rootNode._leafs; const allLeafsLen = allLeafs.length; let parentsChanged = false; for (let i = 0; i < allLeafsLen; ++i) { if (this.initRowParent(allLeafs[i])) { parentsChanged = true; } } return parentsChanged; } initRowParent(current) { let parentsChanged = false; while (true) { const oldParent = current.parent; const parent = current.treeParent; if (parent === null) { if (oldParent) { parentsChanged = true; this.hideRow(current); } break; } let parentFlags = parent.treeNodeFlags + 1; const parentChanged = oldParent !== parent; if (parentChanged) { parentsChanged = true; parentFlags |= FLAG_CHANGED; current.parent = parent; } if (parentChanged && oldParent) { if (oldParent.destroyed) { maybeExpandFromRemovedParent(parent, oldParent); } oldParent.treeNodeFlags |= FLAG_CHANGED; } if (parent.sourceRowIndex >= 0 || parent.treeNodeFlags & FLAG_MARKED_FILLER || parent.treeParent === null) { parent.treeNodeFlags = parentFlags; break; } parent.treeNodeFlags = parentFlags | FLAG_MARKED_FILLER | current.treeNodeFlags & FLAG_CHANGED; current = parent; } return parentsChanged; } destroyFillerRows(animate) { const nonLeafsById = this.nonLeafsById; if (nonLeafsById) { for (const node of nonLeafsById.values()) { if (node.treeParent === null || (node.treeNodeFlags & MASK_CHILDREN_LEN) === 0) { nonLeafsById.delete(node.id); node._destroy(animate); this.hideRow(node); } } if (nonLeafsById.size === 0) { this.nonLeafsById = null; } } } initRowsChildrenSize(rootNode) { this.initRowChildrenSize(rootNode); const allLeafs = rootNode._leafs; const allLeafsLen = allLeafs.length; for (let i = 0; i < allLeafsLen; ++i) { this.initRowChildrenSize(allLeafs[i]); } const nonLeafsById = this.nonLeafsById; if (nonLeafsById !== null) { for (const filler of nonLeafsById.values()) { this.initRowChildrenSize(filler); } } } initRowChildrenSize(row) { let { childrenAfterGroup, _leafs: rowLeafs, treeNodeFlags } = row; const oldLen = childrenAfterGroup?.length; const len = treeNodeFlags & MASK_CHILDREN_LEN; row.treeNodeFlags = treeNodeFlags & ~MASK_CHILDREN_LEN | ((oldLen || 0) === len ? 0 : FLAG_CHILDREN_CHANGED); if (len === 0 && row.level >= 0) { if (childrenAfterGroup !== null) { row.childrenAfterGroup = null; row.childrenAfterFilter = null; row.childrenAfterAggFilter = null; row.childrenAfterSort = null; const sibling = row.sibling; if (sibling) { sibling.childrenAfterGroup = null; sibling.childrenAfterFilter = null; sibling.childrenAfterAggFilter = null; sibling.childrenAfterSort = null; } } } else if (oldLen !== len || childrenAfterGroup === rowLeafs) { if (!childrenAfterGroup || childrenAfterGroup === rowLeafs) { row.childrenAfterGroup = childrenAfterGroup = new Array(len); const sibling = row.sibling; if (sibling) { sibling.childrenAfterGroup = childrenAfterGroup; } } else { childrenAfterGroup.length = len; } } } preprocessRows(rootNode) { const allLeafs = rootNode._leafs; const allLeafsLen = allLeafs.length; let preprocessedCount = 0; let treeChanged = false; for (let i = 0; i < allLeafsLen; ++i) { let current = allLeafs[i]; while (true) { const parent = current.treeParent; if (parent === null) { break; } ++preprocessedCount; let parentFlags = parent.treeNodeFlags; const parentChildren = parent.childrenAfterGroup; const indexInParent = parentFlags & MASK_CHILDREN_LEN; parentFlags = parentFlags & ~MASK_CHILDREN_LEN | indexInParent + 1; if (parentFlags & FLAG_CHILDREN_CHANGED || parentChildren[indexInParent] !== current) { parentFlags |= FLAG_CHILDREN_CHANGED; parentChildren[indexInParent] = current; treeChanged = true; } parent.treeNodeFlags = parentFlags; if (parent.data || (parent.treeNodeFlags & FLAG_MARKED_FILLER) === 0 || parent.treeParent === null) { break; } parent.treeNodeFlags = parentFlags & ~FLAG_MARKED_FILLER | current.treeNodeFlags & FLAG_CHANGED; current = parent; } } return preprocessedCount | (treeChanged ? FLAG_CHILDREN_CHANGED : 0); } traverseRoot(rootNode, activeChangedPath) { let traverseCount = 0; const rootChildrenAfterGroup = rootNode.childrenAfterGroup; for (let i = 0, len = rootChildrenAfterGroup.length; i < len; ++i) { traverseCount += this.traverse(rootChildrenAfterGroup[i], 0, false, activeChangedPath); } return traverseCount & ~FLAG_CHILDREN_CHANGED; } /** * After all the rows are initialized and treeParent is set and childrenAfterGroup is filled, * we traverse the tree to finalize it * @returns the number of leaf nodes processed, which is used to detect cycles in the tree, and a flag set if leaf children were changed. */ traverse(row, level, collapsed, activeChangedPath) { const children = row.childrenAfterGroup; const len = children?.length ?? 0; let flags = row.treeNodeFlags; row.treeNodeFlags = 0; row.level = level; if (row.group !== !!len) { setRowNodeGroup(row, this.beans, !!len); flags |= FLAG_CHANGED; } else if (row.hasChildren() !== !!len) { row.updateHasChildren(); flags |= FLAG_CHANGED; } const selfChanged = (flags & (FLAG_CHANGED | FLAG_CHILDREN_CHANGED)) !== 0; const canBeExpanded = len !== 0 || row.master; if (!canBeExpanded) { row._expanded = void 0; } else { row._expanded ?? (row._expanded = null); } if (collapsed && row.rowIndex !== null) { row.clearRowTopAndRowIndex(); } collapsed || (collapsed = !row.expanded); ++level; flags &= FLAG_CHILDREN_CHANGED; for (let i = 0; i < len; ++i) { const child = children[i]; const childFlags = this.traverse(child, level, collapsed, activeChangedPath); flags = flags + (childFlags & ~FLAG_CHILDREN_CHANGED) | childFlags & FLAG_CHILDREN_CHANGED; } if (selfChanged) { flags |= FLAG_CHILDREN_CHANGED; } if (flags & FLAG_CHILDREN_CHANGED) { if (len > 0) { activeChangedPath?.addRow(row); } row._leafs = void 0; } return flags + 1; } /** Handle cycles in a tree. Is not optimal for performance but this is an edge case that shouldn't happen as is a warning. */ handleCycles(rootNode) { const marked = /* @__PURE__ */ new Set(); const mark = (row) => { if (marked.has(row)) { return false; } marked.add(row); for (const child of row.childrenAfterGroup ?? []) { mark(child); } return true; }; mark(rootNode); const rootChildrenAfterGroup = rootNode.childrenAfterGroup; rootChildrenAfterGroup.length = 0; const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const row = allLeafs[i]; const parent = row.treeParent; if (parent && mark(row)) { parent.treeNodeFlags |= FLAG_CHILDREN_CHANGED | FLAG_CHANGED; row.parent = rootNode; const parentChildren = parent.childrenAfterGroup; _removeFromArray(parentChildren, row); if (parentChildren.length === 0) { parent.childrenAfterGroup = null; } rootChildrenAfterGroup.push(row); _warn(270, { id: row.id, parentId: parent?.id ?? "" }); } else if (parent === rootNode) { rootChildrenAfterGroup.push(row); } } } /** Load the tree structure for nested groups, aka children property */ loadNested(rootNode, changedRowNodes, fullReload) { if (!fullReload && changedRowNodes) { for (const row of changedRowNodes.adds) { row.key = row.id; } return; } const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const row = allLeafs[i]; const id = row.id; if (row.key !== id) { updateNodeKey(row, id); } } } /** Load the tree structure for self-referencing data, aka parentId field */ loadSelfRef(rootNode, reload) { const allLeafs = rootNode._leafs; const allLeafsLen = allLeafs.length; const gos = this.gos; if (!gos.get("getRowId")) { for (let i = 0; i < allLeafsLen; i++) { allLeafs[i].treeParent = null; } return; } const rowModel = this.beans.rowModel; const parentIdGetter = this.parentIdGetter; for (let i = 0; i < allLeafsLen; i++) { const row = allLeafs[i]; if (reload || row.treeNodeFlags & FLAG_CHANGED || row.treeParent?.destroyed) { let newParent; const parentId = parentIdGetter?.(row.data); if (parentId !== null && parentId !== void 0) { newParent = rowModel.getRowNode(parentId); if (!newParent) { _warn(271, { id: row.id, parentId }); } } row.treeParent = newParent ?? rootNode; const id = row.id; if (row.key !== id) { updateNodeKey(row, id); } } else { row.treeParent ?? (row.treeParent = rootNode); } } } loadFlattened(rootNode) { const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const row = allLeafs[i]; row.treeParent = rootNode; const id = row.id; if (row.key !== id) { updateNodeKey(row, id); } } } /** Load the tree structure for data paths, aka getDataPath callback */ loadDataPath(rootNode, fullReload) { const getDataPath = this.gos.get("getDataPath"); if (!getDataPath) { this.loadFlattened(rootNode); return; } const nodesByPath = /* @__PURE__ */ new Map(); const paths = /* @__PURE__ */ new Map(); let dupPaths; if (!fullReload) { dupPaths = this.loadExistingDataPath(rootNode, nodesByPath, paths); } const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const node = allLeafs[i]; if (!fullReload && node.treeParent !== null && (node.treeNodeFlags & FLAG_CHANGED) === 0) { continue; } const path = getDataPath(node.data); const pathLen = path?.length; if (!pathLen) { _warn(185, { data: node.data }); continue; } const key = path[pathLen - 1]; if (node.key !== key) { updateNodeKey(node, key); } const pathKey = path.join(PATH_KEY_SEPARATOR); paths.set(node, pathKey); const existing = nodesByPath.get(pathKey); if (existing === void 0) { nodesByPath.set(pathKey, node); } else if (existing !== node) { dupPaths = this.duplicatedPath(nodesByPath, dupPaths, existing, node, pathKey); } } if (dupPaths) { this.processDuplicatePaths(dupPaths, paths); } this.buildFromPaths(rootNode, nodesByPath, paths); } loadExistingDataPath(rootNode, nodesByPath, paths) { let dupPaths; const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const node = allLeafs[i]; const treeParent = node.treeParent; if (treeParent === null || (node.treeNodeFlags & FLAG_CHANGED) !== 0) { continue; } let pathKey = node.key; let current = treeParent; while (current && current !== rootNode && current !== node) { pathKey = PATH_KEY_SEPARATOR + pathKey; const existingPathKey = paths.get(current); if (existingPathKey !== void 0) { pathKey = existingPathKey + pathKey; break; } pathKey = current.key + pathKey; current = current.treeParent; } if (current !== node) { paths.set(node, pathKey); const existing = nodesByPath.get(pathKey); if (existing === void 0) { nodesByPath.set(pathKey, node); } else if (existing !== node) { dupPaths = this.duplicatedPath(nodesByPath, dupPaths, existing, node, pathKey); } } } return dupPaths; } duplicatedPath(nodesByPath, dupPaths, existing, node, pathKey) { if (node.sourceRowIndex < existing.sourceRowIndex) { nodesByPath.set(pathKey, node); } const duplicates = (dupPaths ?? (dupPaths = /* @__PURE__ */ new Map())).get(pathKey); if (duplicates === void 0) { dupPaths.set(pathKey, [existing, node]); } else { duplicates.push(node); } return dupPaths; } buildFromPaths(rootNode, nodesByPath, paths) { const segments = new Array(48); const allLeafs = rootNode._leafs; for (let i = 0, allLeafsLen = allLeafs.length; i < allLeafsLen; ++i) { const node = allLeafs[i]; const pathKey = paths.get(node); if (pathKey === void 0) { continue; } const segmentsLen = this.splitPathKey(segments, pathKey); let startLevel = 0; let treeParent = rootNode; for (let level = segmentsLen - 1; level >= 0; --level) { const existing = nodesByPath.get(pathKey.slice(0, segments[level])); if (existing) { treeParent = existing; startLevel = level + 1; break; } } if (startLevel < segmentsLen) { treeParent = this.buildMissingFillers( nodesByPath, pathKey, segments, segmentsLen, startLevel, treeParent ); } node.treeParent = treeParent; } } /** Collect separators positions, fast string split without allocations */ splitPathKey(segments, pathKey) { let segmentsLen = 0; let scanPos = 0; const pathKeyLen = pathKey.length; while (scanPos < pathKeyLen) { const sepPos = pathKey.indexOf(PATH_KEY_SEPARATOR, scanPos); if (sepPos === -1) { break; } segments[segmentsLen++] = sepPos; scanPos = sepPos + PATH_KEY_SEPARATOR_LEN; } return segmentsLen; } /** Walk forward from startLevel to segmentsLen creating missing filler nodes and return the final parent. */ buildMissingFillers(nodesByPath, pathKey, segments, segmentsLen, level, treeParent) { let fillerLevel = 0; let fillerId = "row-group"; if (treeParent.sourceRowIndex < 0 && treeParent.treeParent) { fillerLevel = level; fillerId = treeParent.id; } do { const start = level === 0 ? 0 : segments[level - 1] + PATH_KEY_SEPARATOR_LEN; const end = segments[level]; const subPath = pathKey.slice(0, end); let current = nodesByPath.get(subPath); if (current === void 0) { const fillerKey = start === 0 ? subPath : pathKey.slice(start, end); fillerId = this.makeFillerIdBase(pathKey, segments, level, fillerId, fillerLevel) + fillerKey; current = this.getOrCreateFiller(fillerKey, fillerId); nodesByPath.set(subPath, current); fillerLevel = level + 1; } else if (current.sourceRowIndex < 0) { fillerId = current.id; fillerLevel = level + 1; } current.treeParent = treeParent; treeParent = current; ++level; } while (level < segmentsLen); return treeParent; } processDuplicatePaths(duplicatePaths, paths) { for (const duplicates of duplicatePaths.values()) { duplicates.sort(compareSourceRowIndex); const len = duplicates.length; const duplicateRowsData = new Array(len - 1); for (let i = 1; i < len; ++i) { const node = duplicates[i]; paths.delete(node); node.treeParent = null; duplicateRowsData[i - 1] = node.data; } const first = duplicates[0]; _warn(186, { rowId: first.id, rowData: first.data, duplicateRowsData }); } } getOrCreateFiller(key, id) { const nonLeafsById = this.nonLeafsById ?? (this.nonLeafsById = /* @__PURE__ */ new Map()); let node = nonLeafsById.get(id); if (node === void 0) { node = new RowNode(this.beans); node.id = id; node.key = key; node.group = true; node.leafGroup = false; node.rowGroupIndex = null; nonLeafsById.set(id, node); } return node; } /** * Build the base filler ID up to the given 'level' and include the final level separator prefix. * Caller should append only the 'fillerKey' after this base. * Result format: * - With no prefix and level === 0: _ROW_ID_PREFIX_ROW_GROUP + '0-' * - With no prefix and level > 0: _ROW_ID_PREFIX_ROW_GROUP + '0-key0-1-key1-...-(level-1)-key(level-1)-level-' * - With prefix present: prefixId + '-level-' */ makeFillerIdBase(pathKey, segments, level, prefix, prefixLevel) { while (prefixLevel < level) { const start = prefixLevel > 0 ? segments[prefixLevel - 1] + PATH_KEY_SEPARATOR_LEN : 0; const end = segments[prefixLevel]; prefix += "-" + prefixLevel + "-" + pathKey.slice(start, end); ++prefixLevel; } return prefix + "-" + level + "-"; } deselectHiddenNodes(updated) { const selectionSvc = this.beans.selectionSvc; const nodes = this.nodesToUnselect; const source = "rowDataChanged"; if (nodes) { this.nodesToUnselect = null; selectionSvc?.setNodesSelected({ newValue: false, nodes, suppressFinishActions: true, source }); } if (nodes || updated) { selectionSvc?.updateGroupsFromChildrenSelections?.(source); } if (nodes) { const selectedNodes = selectionSvc?.getSelectedNodes() ?? null; this.eventSvc.dispatchEvent({ type: "selectionChanged", source, selectedNodes, serverSideState: null }); } } hideRow(row) { if (row.isSelected()) { (this.nodesToUnselect ?? (this.nodesToUnselect = [])).push(row); } row.parent = null; row.group = false; row.treeParent = null; row.treeNodeFlags = 0; row.childrenAfterGroup = null; row.childrenAfterFilter = null; row.childrenAfterAggFilter = null; row.childrenAfterSort = null; row._leafs = void 0; row._groupData = null; row.aggData = null; const sibling = row.sibling; if (sibling) { sibling.childrenAfterGroup = null; sibling.childrenAfterFilter = null; sibling.childrenAfterAggFilter = null; sibling.childrenAfterSort = null; } row.updateHasChildren(); if (row.rowIndex !== null) { row.clearRowTopAndRowIndex(); } } onShowRowGroupColsSetChanged() { const allLeafs = this.beans.rowModel.rootNode._leafs; if (!allLeafs) { return; } for (let i = 0, len = allLeafs.length; i < len; ++i) { allLeafs[i]._groupData = void 0; } const fillers = this.nonLeafsById; if (fillers) { for (const rowNode of fillers.values()) { rowNode._groupData = void 0; } } } }; var compareSourceRowIndex = (a, b) => a.sourceRowIndex - b.sourceRowIndex; var maybeExpandFromRemovedParent = (parent, oldParent) => { if (oldParent._expanded !== void 0 && parent._expanded === void 0 && parent.treeParent !== null && parent.sourceRowIndex < 0) { parent._expanded = oldParent._expanded; } }; var updateNodeKey = (node, key) => { const hadData = node._groupData !== void 0; node.key = key; node.groupValue = key; const sibling = node.sibling; if (sibling) { sibling.key = key; } if (hadData) { node._groupData = void 0; node.setData(node.data); } }; // packages/ag-grid-enterprise/src/treeData/treeDataModule.ts var SharedTreeDataModule = { moduleName: "SharedTreeData", version: VERSION2, dependsOn: [EnterpriseCoreModule, SharedAggregationModule, GroupColumnModule, ChangedPathModule, StickyRowModule] }; var TreeDataModule = { moduleName: "TreeData", version: VERSION2, dynamicBeans: { treeGroupStrategy: TreeGroupStrategy }, rowModels: ["clientSide"], dependsOn: [SharedTreeDataModule, AggregationModule, ClientSideRowModelHierarchyModule, GroupEditModule] }; // packages/ag-grid-enterprise/src/serverSideRowModel/blocks/blockUtils.ts var GROUP_MISSING_KEY_ID = "ag-Grid-MissingKey"; var BlockUtils = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmBlockUtils"; } wireBeans(beans) { this.valueSvc = beans.valueSvc; this.showRowGroupCols = beans.showRowGroupCols; this.nodeManager = beans.ssrmNodeManager; this.expansionSvc = beans.expansionSvc; this.serverSideRowModel = beans.rowModel; this.storeFactory = beans.ssrmStoreFactory; } createRowNode(params) { const rowNode = new RowNode(this.beans); const rowHeight = params.rowHeight != null ? params.rowHeight : _getRowHeightAsNumber(this.beans); rowNode.setRowHeight(rowHeight); rowNode.group = params.group; rowNode.leafGroup = params.leafGroup; rowNode.level = params.level; rowNode.uiLevel = params.level; rowNode.parent = params.parent; rowNode.stub = true; rowNode.__needsRefreshWhenVisible = false; if (rowNode.group) { rowNode.expanded = false; rowNode.field = params.field; rowNode.rowGroupColumn = params.rowGroupColumn; rowNode.rowGroupIndex = params.level; } return rowNode; } destroyRowNode(rowNode, preserveStore = false) { if (rowNode.childStore && !preserveStore) { this.destroyBean(rowNode.childStore); rowNode.childStore = null; } const sibling = rowNode.sibling; if (sibling && !rowNode.footer) { this.destroyRowNode(sibling, false); } rowNode._destroy(true); if (rowNode.id != null) { this.nodeManager.removeNode(rowNode); } } setTreeGroupInfo(rowNode) { rowNode.updateHasChildren(); const getKeyFunc = this.gos.get("getServerSideGroupKey"); const hasChildren = rowNode.hasChildren(); if (hasChildren && getKeyFunc != null) { rowNode.key = getKeyFunc(rowNode.data); } if (!hasChildren && rowNode.childStore != null) { this.destroyBean(rowNode.childStore); rowNode.childStore = null; if (!rowNode.master) { rowNode.expanded = false; } } } setRowGroupInfo(rowNode) { rowNode.key = this.valueSvc.getValue(rowNode.rowGroupColumn, rowNode, "data"); if (rowNode.key === null || rowNode.key === void 0) { _doOnce(() => { _warn(190, { rowGroupId: rowNode.rowGroupColumn?.getId(), data: rowNode.data }); }, "SSBlock-BadKey"); } const isUnbalancedGroup = this.gos.get("groupAllowUnbalanced") && rowNode.key === ""; if (isUnbalancedGroup) { const storeParams = this.serverSideRowModel.getParams(); rowNode.childStore = this.createBean(this.storeFactory.createStore(storeParams, rowNode)); } const getGroupIncludeFooter = _getGroupTotalRowCallback(this.beans.gos); const doesRowShowFooter = getGroupIncludeFooter({ node: rowNode }); if (doesRowShowFooter) { _createRowNodeFooter(rowNode, this.beans); if (rowNode.sibling) { rowNode.sibling.uiLevel = rowNode.uiLevel + 1; } } } setMasterDetailInfo(rowNode) { const isMasterFunc = this.gos.get("isRowMaster"); if (isMasterFunc != null) { rowNode.master = isMasterFunc(rowNode.data); } else { rowNode.master = true; } } updateDataIntoRowNode(rowNode, data) { rowNode.updateData(data); if (this.gos.get("treeData")) { this.setTreeGroupInfo(rowNode); this.setChildCountIntoRowNode(rowNode); this.updateRowFooter(rowNode); } else if (rowNode.group) { this.setChildCountIntoRowNode(rowNode); this.updateRowFooter(rowNode); } else if (this.gos.get("masterDetail")) { } } updateRowFooter(rowNode) { if (rowNode.footer) { return; } if (rowNode.group) { const getGroupIncludeFooter = _getGroupTotalRowCallback(this.beans.gos); const shouldRowShowFooter = getGroupIncludeFooter({ node: rowNode }); if (shouldRowShowFooter && !rowNode.sibling) { _createRowNodeFooter(rowNode, this.beans); return; } } if (rowNode.sibling) { _destroyRowNodeFooter(rowNode); } } setDataIntoRowNode(rowNode, data, defaultId, cachedRowHeight) { rowNode.stub = false; const treeData = this.gos.get("treeData"); rowNode.setDataAndId(data, defaultId); const group = rowNode.group; if ((treeData || !group) && this.gos.get("masterDetail")) { this.setMasterDetailInfo(rowNode); } if (treeData) { this.setTreeGroupInfo(rowNode); } else if (group) { this.setRowGroupInfo(rowNode); } if (treeData || group) { this.setGroupDataIntoRowNode(rowNode); this.setChildCountIntoRowNode(rowNode); } if (_exists(data)) { rowNode.setRowHeight(_getRowHeightForNode(this.beans, rowNode, false, cachedRowHeight).height); rowNode.sibling?.setRowHeight( _getRowHeightForNode(this.beans, rowNode.sibling, false, cachedRowHeight).height ); } } setChildCountIntoRowNode(rowNode) { const getChildCount = this.gos.get("getChildCount"); if (getChildCount) { rowNode.setAllChildrenCount(getChildCount(rowNode.data)); } } setGroupDataIntoRowNode(rowNode) { const key = rowNode.key; rowNode.groupValue = key; if (rowNode.sibling) { rowNode.sibling.groupValue = key; } const groupDisplayCols = this.showRowGroupCols?.columns; if (!groupDisplayCols) { return; } const usingTreeData = this.gos.get("treeData"); for (const col of groupDisplayCols) { let groupData = rowNode._groupData; if (!groupData) { groupData = {}; rowNode._groupData = groupData; } if (usingTreeData) { groupData[col.getColId()] = key; } else if (col.isRowGroupDisplayed(rowNode.rowGroupColumn.getId())) { const groupValue = this.valueSvc.getValue(rowNode.rowGroupColumn, rowNode, "data"); groupData[col.getColId()] = groupValue; } } } clearDisplayIndex(rowNode) { rowNode.clearRowTopAndRowIndex(); const hasChildStore = rowNode.hasChildren() && !!rowNode.childStore; if (hasChildStore) { rowNode.childStore?.clearDisplayIndexes(); } const hasDetailNode = rowNode.master && rowNode.detailNode; if (hasDetailNode) { rowNode.detailNode?.clearRowTopAndRowIndex(); } } setDisplayIndex(rowNode, displayIndexSeq, nextRowTop, uiLevel) { const isUnbalancedGroup = this.gos.get("groupAllowUnbalanced") && rowNode.group && rowNode.key === ""; const isHiddenOpenGroup = this.gos.get("groupHideOpenParents") && rowNode.group && rowNode.expanded; if (isHiddenOpenGroup || isUnbalancedGroup) { rowNode.setRowIndex(null); rowNode.setRowTop(null); } else { rowNode.setRowIndex(displayIndexSeq.value++); rowNode.setRowTop(nextRowTop.value); nextRowTop.value += rowNode.rowHeight; } rowNode.setUiLevel(uiLevel); if (rowNode.footer) { return; } const hasDetailRow = rowNode.master; if (hasDetailRow) { if (rowNode.expanded && rowNode.detailNode) { rowNode.detailNode.setRowIndex(displayIndexSeq.value++); rowNode.detailNode.setRowTop(nextRowTop.value); nextRowTop.value += rowNode.detailNode.rowHeight; } else if (rowNode.detailNode) { rowNode.detailNode.clearRowTopAndRowIndex(); } } const hasChildStore = rowNode.hasChildren() && !!rowNode.childStore; if (hasChildStore) { const childStore = rowNode.childStore; if (rowNode.expanded || isUnbalancedGroup) { childStore.setDisplayIndexes(displayIndexSeq, nextRowTop, isUnbalancedGroup ? uiLevel : uiLevel + 1); } else { childStore.clearDisplayIndexes(); } } } extractRowBounds(rowNode, index) { const extractRowBounds = (currentRowNode) => ({ rowHeight: currentRowNode.rowHeight, rowTop: currentRowNode.rowTop }); if (rowNode.rowIndex === index) { return extractRowBounds(rowNode); } if (rowNode.hasChildren() && rowNode.expanded && !!rowNode.childStore) { const childStore = rowNode.childStore; if (childStore.isDisplayIndexInStore(index)) { return childStore.getRowBounds(index); } } else if (rowNode.master && rowNode.expanded && rowNode.detailNode) { if (rowNode.detailNode.rowIndex === index) { return extractRowBounds(rowNode.detailNode); } } } isPixelInNodeRange(node, pixel) { if (!_exists(node.rowTop) || !_exists(node.rowHeight)) { return false; } return pixel >= node.rowTop && pixel < node.rowTop + node.rowHeight; } getIndexAtPixel(rowNode, pixel) { if (this.isPixelInNodeRange(rowNode, pixel)) { return rowNode.rowIndex; } const expandedMasterRow = rowNode.master && rowNode.expanded; const detailNode = rowNode.detailNode; if (expandedMasterRow && detailNode && this.isPixelInNodeRange(detailNode, pixel)) { return detailNode.rowIndex; } if (rowNode.hasChildren() && rowNode.expanded && !!rowNode.childStore) { const childStore = rowNode.childStore; if (childStore.isPixelInRange(pixel)) { return childStore.getRowIndexAtPixel(pixel); } } return null; } createNodeIdPrefix(parentRowNode) { const parts = []; let rowNode = parentRowNode; while (rowNode && rowNode.level >= 0) { if (rowNode.key === "") { parts.push(GROUP_MISSING_KEY_ID); } else { parts.push(rowNode.key); } rowNode = rowNode.parent; } if (parts.length > 0) { return parts.reverse().join("-"); } return void 0; } checkOpenByDefault(rowNode) { const expanded = !!this.expansionSvc?.isNodeExpanded(rowNode); const oldExpanded = rowNode._expanded; if (!!oldExpanded !== expanded) { rowNode.setExpanded(expanded); } else if (oldExpanded === void 0) { rowNode._expanded = expanded; } } }; // packages/ag-grid-enterprise/src/serverSideRowModel/listeners/expandListener.ts var ExpandListener = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmExpandListener"; } postConstruct() { if (!_isServerSideRowModel(this.gos)) { return; } this.addManagedEventListeners({ rowExpansionStateChanged: this.onRowExpandStateChanged.bind(this) }); } onRowExpandStateChanged() { const beans = this.beans; const expansionSvx = beans.expansionSvc; beans.rowModel.forEachNode((rowNode) => { expansionSvx.updateExpandedState(rowNode); }); this.eventSvc.dispatchEvent({ type: "storeUpdated" }); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/listeners/filterListener.ts var FilterListener = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmFilterListener"; } wireBeans(beans) { this.serverSideRowModel = beans.rowModel; this.filterManager = beans.filterManager; this.listenerUtils = beans.ssrmListenerUtils; } postConstruct() { if (!_isServerSideRowModel(this.gos)) { return; } this.addManagedEventListeners({ advancedFilterEnabledChanged: () => this.onFilterChanged(true), filterChanged: () => this.onFilterChanged() }); } onFilterChanged(advancedFilterEnabledChanged) { const storeParams = this.serverSideRowModel.getParams(); if (!storeParams) { return; } const oldModel = storeParams.filterModel; let newModel; let changedColumns; if (this.filterManager?.isAdvFilterEnabled()) { newModel = this.filterManager.getAdvFilterModel(); const oldColumns = advancedFilterEnabledChanged ? Object.keys(oldModel ?? {}) : this.getAdvancedFilterColumns(oldModel); const newColumns = this.getAdvancedFilterColumns(newModel); for (const column of oldColumns) { newColumns.add(column); } changedColumns = Array.from(newColumns); } else { newModel = this.filterManager?.getFilterModel() ?? {}; if (advancedFilterEnabledChanged) { const oldColumns = this.getAdvancedFilterColumns(oldModel); for (const column of Object.keys(newModel)) { oldColumns.add(column); } changedColumns = Array.from(oldColumns); } else { changedColumns = this.findChangedColumns(oldModel, newModel); } } const valueColChanged = this.listenerUtils.isSortingWithValueColumn(changedColumns); const secondaryColChanged = this.listenerUtils.isSortingWithSecondaryColumn(changedColumns); const params = { valueColChanged, secondaryColChanged, changedColumns }; this.serverSideRowModel.refreshAfterFilter(newModel, params); } findChangedColumns(oldModel, newModel) { const allColKeysMap = {}; for (const key of Object.keys(oldModel)) { allColKeysMap[key] = true; } for (const key of Object.keys(newModel)) { allColKeysMap[key] = true; } const res = []; for (const key of Object.keys(allColKeysMap)) { const filterChanged = !_jsonEquals(oldModel[key], newModel[key]); if (filterChanged) { res.push(key); } } return res; } getAdvancedFilterColumns(model) { const columns = /* @__PURE__ */ new Set(); if (!model) { return columns; } const processAdvancedFilterModel = (filterModel) => { if (filterModel.filterType === "join") { for (const condition of filterModel.conditions) { processAdvancedFilterModel(condition); } } else { columns.add(filterModel.colId); } }; processAdvancedFilterModel(model); return columns; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/listeners/listenerUtils.ts var ListenerUtils = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmListenerUtils"; } wireBeans(beans) { this.pivotResultCols = beans.pivotResultCols; this.valueColsSvc = beans.valueColsSvc; } isSortingWithValueColumn(changedColumnsInSort) { const valueColIds = (this.valueColsSvc?.columns ?? []).map((col) => col.getColId()); for (let i = 0; i < changedColumnsInSort.length; i++) { if (valueColIds.indexOf(changedColumnsInSort[i]) > -1) { return true; } } return false; } isSortingWithSecondaryColumn(changedColumnsInSort) { const pivotResultCols = this.pivotResultCols?.getPivotResultCols(); if (!pivotResultCols) { return false; } const secondaryColIds = pivotResultCols.list.map((col) => col.getColId()); for (let i = 0; i < changedColumnsInSort.length; i++) { if (secondaryColIds.indexOf(changedColumnsInSort[i]) > -1) { return true; } } return false; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/listeners/sortListener.ts var SortListener = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmSortSvc"; } wireBeans(beans) { this.sortSvc = beans.sortSvc; this.serverSideRowModel = beans.rowModel; this.listenerUtils = beans.ssrmListenerUtils; } postConstruct() { if (!_isServerSideRowModel(this.gos)) { return; } this.addManagedEventListeners({ sortChanged: this.onSortChanged.bind(this) }); } onSortChanged() { const storeParams = this.serverSideRowModel.getParams(); if (!storeParams) { return; } const newSortModel = this.sortSvc.getSortModel(); const oldSortModel = storeParams.sortModel; const changedColumns = this.findChangedColumnsInSort(newSortModel, oldSortModel); const valueColChanged = this.listenerUtils.isSortingWithValueColumn(changedColumns); const secondaryColChanged = this.listenerUtils.isSortingWithSecondaryColumn(changedColumns); const params = { valueColChanged, secondaryColChanged, changedColumns }; this.serverSideRowModel.refreshAfterSort(newSortModel, params); } // returns back all the cols that were effected by the sorting. eg if we were sorting by col A, // and now we are sorting by col B, the list of impacted cols should be A and B. so if a cache // is impacted by sorting on A or B then it needs to be refreshed. this includes where the cache // was previously sorted by A and then the A sort now needs to be cleared. findChangedColumnsInSort(newSortModel, oldSortModel) { let allColsInBothSorts = []; for (const sortModel of [newSortModel, oldSortModel]) { if (sortModel) { const ids = sortModel.map((sm) => sm.colId); allColsInBothSorts = allColsInBothSorts.concat(ids); } } const differentSorts = (oldSortItem, newSortItem) => { const oldSort = oldSortItem ? oldSortItem.sort : null; const newSort = newSortItem ? newSortItem.sort : null; return oldSort !== newSort; }; const differentIndexes = (oldSortItem, newSortItem) => { const oldIndex = oldSortItem ? oldSortModel.indexOf(oldSortItem) : -1; const newIndex = newSortItem ? newSortModel.indexOf(newSortItem) : -1; return oldIndex !== newIndex; }; return allColsInBothSorts.filter((colId) => { const oldSortItem = oldSortModel.find((sm) => sm.colId === colId); const newSortItem = newSortModel.find((sm) => sm.colId === colId); return differentSorts(oldSortItem, newSortItem) || differentIndexes(oldSortItem, newSortItem); }); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/nodeManager.ts var NodeManager = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmNodeManager"; this.rowNodes = /* @__PURE__ */ new Map(); } addRowNode(rowNode) { const id = rowNode.id; if (this.rowNodes.has(id)) { _warn(187, { rowId: id, firstData: this.rowNodes.get(id).data, secondData: rowNode.data }); } this.rowNodes.set(id, rowNode); } removeNode(rowNode) { const id = rowNode.id; this.rowNodes.delete(id); } destroy() { this.clear(); super.destroy(); } clear() { this.rowNodes.clear(); super.destroy(); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/serverSideRowModel.ts var ServerSideRowModel = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowModel"; this.hierarchical = true; this.started = false; this.managingPivotResultColumns = false; this.onRowHeightChanged_debounced = _debounce(this, this.onRowHeightChanged.bind(this), 100); } wireBeans(beans) { this.colModel = beans.colModel; this.colNames = beans.colNames; this.pivotResultCols = beans.pivotResultCols; this.rowGroupColsSvc = beans.rowGroupColsSvc; this.pivotColsSvc = beans.pivotColsSvc; this.valueColsSvc = beans.valueColsSvc; this.filterManager = beans.filterManager; this.sortSvc = beans.sortSvc; this.rowRenderer = beans.rowRenderer; this.nodeManager = beans.ssrmNodeManager; this.storeFactory = beans.ssrmStoreFactory; this.pivotColDefSvc = beans.pivotColDefSvc; } // we don't implement as lazy row heights is not supported in this row model ensureRowHeightsValid() { return false; } start() { this.started = true; this.updateDatasource(); } destroyDatasource() { if (!this.datasource) { return; } if (this.datasource.destroy) { this.datasource.destroy(); } this.rowRenderer.datasourceChanged(); this.datasource = void 0; } postConstruct() { const resetListener = this.resetRootStore.bind(this); this.addManagedEventListeners({ newColumnsLoaded: this.onColumnEverything.bind(this), storeUpdated: this.onStoreUpdated.bind(this), columnValueChanged: resetListener, columnPivotChanged: resetListener, columnRowGroupChanged: resetListener, columnPivotModeChanged: resetListener }); this.addManagedPropertyListeners( [ /** * Following properties omitted as they are likely to come with undesired side effects. * 'getRowId', 'isRowMaster', 'getRowHeight', 'isServerSideGroup', 'getServerSideGroupKey', * */ "masterDetail", "treeData", "removePivotHeaderRowWhenSingleValueColumn", "cacheBlockSize" ], resetListener ); this.addManagedPropertyListeners(["groupAllowUnbalanced", "groupTotalRow"], () => this.onStoreUpdated()); this.addManagedPropertyListener("rowHeight", () => this.resetRowHeights()); this.verifyProps(); this.addManagedPropertyListener("serverSideDatasource", () => this.updateDatasource()); } updateDatasource() { const datasource = this.gos.get("serverSideDatasource"); if (datasource) { this.setDatasource(datasource); } } verifyProps() { if (_isRowSelection(this.gos) && !this.gos.exists("getRowId")) { _warn(188, { feature: "selection" }); } } setDatasource(datasource) { if (!this.started) { return; } this.destroyDatasource(); this.datasource = datasource; this.resetRootStore(); } applyRowData(rowDataParams, startRow, route) { const rootStore = this.getRootStore(); if (!rootStore) { return; } const storeToExecuteOn = rootStore.getChildStore(route); if (!storeToExecuteOn) { return; } storeToExecuteOn.applyRowData(rowDataParams, startRow, rowDataParams.rowData.length); } isLastRowIndexKnown() { const cache = this.getRootStore(); if (!cache) { return false; } return cache.isLastRowIndexKnown(); } onColumnEverything() { if (!this.storeParams) { this.resetRootStore(); return; } const rowGroupColumnVos = this.columnsToValueObjects(this.rowGroupColsSvc?.columns); const valueColumnVos = this.columnsToValueObjects(this.valueColsSvc?.columns); const pivotColumnVos = this.columnsToValueObjects(this.pivotColsSvc?.columns); const areColsSame = (params) => { const oldColsMap = {}; for (const col of params.oldCols) { oldColsMap[col.id] = col; } const allColsUnchanged = params.newCols.every((col) => { const equivalentCol = oldColsMap[col.id]; if (equivalentCol) { delete oldColsMap[col.id]; } return equivalentCol && equivalentCol.field === col.field && equivalentCol.aggFunc === col.aggFunc; }); const missingCols = !params.allowRemovedColumns && !!Object.values(oldColsMap).length; return allColsUnchanged && !missingCols; }; const sortModelDifferent = !_jsonEquals(this.storeParams.sortModel, this.sortSvc?.getSortModel() ?? []); const rowGroupDifferent = !areColsSame({ oldCols: this.storeParams.rowGroupCols, newCols: rowGroupColumnVos }); const pivotDifferent = !areColsSame({ oldCols: this.storeParams.pivotCols, newCols: pivotColumnVos }); const valuesDifferent = !!rowGroupColumnVos?.length && !areColsSame({ oldCols: this.storeParams.valueCols, newCols: valueColumnVos, allowRemovedColumns: true }); const resetRequired = sortModelDifferent || rowGroupDifferent || pivotDifferent || valuesDifferent; if (resetRequired) { this.resetRootStore(); } else { const newParams = this.createStoreParams(); this.storeParams.rowGroupCols = newParams.rowGroupCols; this.storeParams.pivotCols = newParams.pivotCols; this.storeParams.valueCols = newParams.valueCols; } } destroyRootStore() { if (!this.rootNode?.childStore) { return; } this.rootNode.childStore = this.destroyBean(this.rootNode.childStore); this.nodeManager.clear(); } refreshAfterSort(newSortModel, params) { if (this.storeParams) { this.storeParams.sortModel = newSortModel; } const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.refreshAfterSort(params); this.onStoreUpdated(); } generateSecondaryColumns(pivotFields) { if (!this.pivotColDefSvc) { this.gos.assertModuleRegistered("SharedPivot", 2); return; } const pivotColumnGroupDefs = this.pivotColDefSvc.createColDefsFromFields(pivotFields); this.managingPivotResultColumns = true; this.pivotResultCols?.setPivotResultCols(pivotColumnGroupDefs, "rowModelUpdated"); } resetRowHeights() { const atLeastOne = this.resetRowHeightsForAllRowNodes(); const rootNodeHeight = _getRowHeightForNode(this.beans, this.rootNode); this.rootNode.setRowHeight(rootNodeHeight.height, rootNodeHeight.estimated); if (this.rootNode.sibling) { const rootNodeSibling = _getRowHeightForNode(this.beans, this.rootNode.sibling); this.rootNode.sibling.setRowHeight(rootNodeSibling.height, rootNodeSibling.estimated); } if (atLeastOne) { this.onRowHeightChanged(); } } resetRowHeightsForAllRowNodes() { let atLeastOne = false; this.forEachNode((rowNode) => { const rowHeightForNode = _getRowHeightForNode(this.beans, rowNode); rowNode.setRowHeight(rowHeightForNode.height, rowHeightForNode.estimated); const detailNode = rowNode.detailNode; if (detailNode) { const detailRowHeight = _getRowHeightForNode(this.beans, detailNode); detailNode.setRowHeight(detailRowHeight.height, detailRowHeight.estimated); } if (rowNode.sibling) { const siblingRowHeight = _getRowHeightForNode(this.beans, rowNode.sibling); detailNode?.setRowHeight(siblingRowHeight.height, siblingRowHeight.estimated); } atLeastOne = true; }); return atLeastOne; } resetRootStore() { this.destroyRootStore(); this.rootNode = new RowNode(this.beans); this.rootNode.group = true; this.rootNode.level = -1; if (this.datasource) { this.storeParams = this.createStoreParams(); this.rootNode.childStore = this.createBean(this.storeFactory.createStore(this.storeParams, this.rootNode)); this.updateRowIndexesAndBounds(); } if (this.managingPivotResultColumns) { this.pivotResultCols?.setPivotResultCols(null, "api"); this.managingPivotResultColumns = false; } this.dispatchModelUpdated(true); } columnsToValueObjects(columns = []) { return columns.map( (col) => ({ id: col.getId(), aggFunc: col.getAggFunc(), displayName: this.colNames.getDisplayNameForColumn(col, "model"), field: col.getColDef().field }) ); } createStoreParams() { const rowGroupColumnVos = this.columnsToValueObjects(this.rowGroupColsSvc?.columns); const valueColumnVos = this.columnsToValueObjects(this.valueColsSvc?.columns); const pivotColumnVos = this.columnsToValueObjects(this.pivotColsSvc?.columns); const dynamicRowHeight = _isGetRowHeightFunction(this.gos); const params = { // the columns the user has grouped and aggregated by valueCols: valueColumnVos, rowGroupCols: rowGroupColumnVos, pivotCols: pivotColumnVos, pivotMode: this.colModel.isPivotMode(), // sort and filter model filterModel: this.filterManager?.isAdvFilterEnabled() ? this.filterManager?.getAdvFilterModel() : this.filterManager?.getFilterModel() ?? {}, sortModel: this.sortSvc?.getSortModel() ?? [], datasource: this.datasource, lastAccessedSequence: { value: 0 }, // blockSize: blockSize == null ? 100 : blockSize, dynamicRowHeight }; return params; } getParams() { return this.storeParams; } dispatchModelUpdated(reset = false) { this.eventSvc.dispatchEvent({ type: "modelUpdated", animate: !reset, keepRenderedRows: !reset, newPage: false, newData: false }); } onStoreUpdated() { this.updateRowIndexesAndBounds(); this.dispatchModelUpdated(); } onRowHeightChanged() { this.updateRowIndexesAndBounds(); this.dispatchModelUpdated(); } updateRowIndexesAndBounds() { const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.setDisplayIndexes({ value: 0 }, { value: 0 }, 0); } retryLoads() { const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.retryLoads(); this.onStoreUpdated(); } getRow(index) { const rootStore = this.getRootStore(); if (!rootStore) { return void 0; } return rootStore.getRowUsingDisplayIndex(index); } refreshAfterFilter(newFilterModel, params) { if (this.storeParams) { this.storeParams.filterModel = newFilterModel; } const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.refreshAfterFilter(params); this.onStoreUpdated(); } getRootStore() { return this.rootNode?.childStore; } getRowCount() { const rootStore = this.getRootStore(); if (!rootStore) { return 0; } return rootStore.getDisplayIndexEnd(); } getTopLevelRowCount() { const rootStore = this.getRootStore(); if (!rootStore) { return 1; } return rootStore.getRowCount(); } getTopLevelRowDisplayedIndex(topLevelIndex) { const rootStore = this.getRootStore(); if (!rootStore) { return topLevelIndex; } return rootStore.getTopLevelRowDisplayedIndex(topLevelIndex); } getRowBounds(index) { const rootStore = this.getRootStore(); if (!rootStore) { const rowHeight = _getRowHeightAsNumber(this.beans); return { rowTop: 0, rowHeight }; } return rootStore.getRowBounds(index); } getBlockStates() { const root = this.getRootStore(); if (!root) { return void 0; } const states = {}; root.forEachStoreDeep((store) => { const blockStates = store.getBlockStates(); for (const block of Object.keys(blockStates)) { states[block] = blockStates[block]; } }); return states; } getRowIndexAtPixel(pixel) { const rootStore = this.getRootStore(); if (pixel <= 0 || !rootStore) { return 0; } return rootStore.getRowIndexAtPixel(pixel); } isEmpty() { return false; } getOverlayType() { const rootStore = this.getRootStore(); if (rootStore?.getDisplayIndexEnd() === 0) { return this.filterManager?.isAnyFilterPresent() ? "noMatchingRows" : "noRows"; } return null; } isRowsToRender() { return this.getRootStore() != null && this.getRowCount() > 0; } getType() { return "serverSide"; } forEachNode(callback) { const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.forEachNodeDeep(callback); } forEachDisplayedNode(callback) { const wrappedCallback = (node, index) => { if (node.stub || !node.displayed) { return; } callback(node, index); }; this.forEachNode(wrappedCallback); } forEachNodeAfterFilterAndSort(callback, includeFooterNodes = false) { const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.forEachNodeDeepAfterFilterAndSort(callback, void 0, includeFooterNodes); } /** @returns false if store hasn't started */ executeOnStore(route, callback) { if (!this.started) { return false; } const rootStore = this.getRootStore(); if (!rootStore) { return true; } const storeToExecuteOn = rootStore.getChildStore(route); if (storeToExecuteOn) { callback(storeToExecuteOn); } return true; } refreshStore(params = {}) { const route = params.route ? params.route : []; this.executeOnStore(route, (store) => store.refreshStore(params.purge == true)); } getStoreState() { const res = []; const rootStore = this.getRootStore(); if (rootStore) { rootStore.addStoreStates(res); } return res; } getNodesInRangeForSelection(firstInRange, lastInRange) { const startIndex = firstInRange.rowIndex; const endIndex = lastInRange.rowIndex; if (startIndex === null && endIndex === null) { return []; } if (endIndex === null) { return firstInRange ? [firstInRange] : []; } if (startIndex === null) { return [lastInRange]; } const nodeRange = []; const [firstIndex, lastIndex] = [startIndex, endIndex].sort((a, b) => a - b); this.forEachNode((node) => { const thisRowIndex = node.rowIndex; if (thisRowIndex == null || node.stub) { return; } if (thisRowIndex >= firstIndex && thisRowIndex <= lastIndex) { nodeRange.push(node); } }); if (nodeRange.length !== lastIndex - firstIndex + 1) { return null; } return nodeRange; } getRowNode(id) { let result; this.forEachNode((rowNode) => { if (rowNode.id === id) { result = rowNode; } if (rowNode.detailNode && rowNode.detailNode.id === id) { result = rowNode.detailNode; } }); return result; } isRowPresent(rowNode) { const foundRowNode = this.getRowNode(rowNode.id); return !!foundRowNode; } setRowCount(rowCount, lastRowIndexKnown) { const rootStore = this.getRootStore(); if (!rootStore) { return; } rootStore.setRowCount(rowCount, lastRowIndexKnown); } destroy() { this.destroyDatasource(); this.destroyRootStore(); super.destroy(); } /** * @deprecated v33.1 */ onRowHeightChangedDebounced() { this.onRowHeightChanged_debounced(); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/serverSideRowModelApi.ts function getServerSideSelectionState(beans) { return beans.selectionSvc?.getSelectionState() ?? null; } function setServerSideSelectionState(beans, state) { beans.selectionSvc?.setSelectionState(state, "api"); } function applyServerSideTransaction(beans, transaction) { return beans.ssrmTxnManager?.applyTransaction(transaction); } function applyServerSideRowData(beans, params) { const startRow = params.startRow ?? 0; const route = params.route ?? []; if (startRow < 0) { _warn(189, { startRow }); return; } _getServerSideRowModel(beans)?.applyRowData(params.successParams, startRow, route); } function applyServerSideTransactionAsync(beans, transaction, callback) { return beans.ssrmTxnManager?.applyTransactionAsync(transaction, callback); } function retryServerSideLoads(beans) { _getServerSideRowModel(beans)?.retryLoads(); } function flushServerSideAsyncTransactions(beans) { return beans.ssrmTxnManager?.flushAsyncTransactions(); } function refreshServerSide(beans, params) { _getServerSideRowModel(beans)?.refreshStore(params); } function getServerSideGroupLevelState(beans) { return _getServerSideRowModel(beans)?.getStoreState() ?? []; } // packages/ag-grid-enterprise/src/serverSideRowModel/services/expansion/strategies/defaultStrategy.ts var ExpandStrategy = class extends BeanStub { constructor() { super(...arguments); this.name = "expand"; this.expanded = /* @__PURE__ */ new Set(); this.collapsed = /* @__PURE__ */ new Set(); this.initialState = /* @__PURE__ */ new Map(); } /** * Set the expanded and collapsed rows. * @param expandedRows the rows to expand * @param touchedRows the rows that have been touched */ setExpandedState({ expandedRowGroupIds, collapsedRowGroupIds }) { this.expanded = new Set(expandedRowGroupIds); this.collapsed = new Set(collapsedRowGroupIds); for (const node of this.expanded) { this.initialState.set(node, false); } for (const node of this.collapsed) { this.initialState.set(node, true); } } /** * Get the serializable expanded state * @returns an object containing the expanded and collapsed rows */ getExpandedState() { return { expandedRowGroupIds: Array.from(this.expanded), collapsedRowGroupIds: Array.from(this.collapsed) }; } /** * Set the expanded state for a row. * @param row the row to expand/collapse * @param expanded true to expand the row, false to collapse it */ setRowExpanded(row, expanded) { const id = row.id; const stateIsDefault = this.initialState.get(id) === expanded; if (expanded) { this.collapsed.delete(id); if (!stateIsDefault) { this.expanded.add(id); } return; } this.expanded.delete(id); if (!stateIsDefault) { this.collapsed.add(id); } } /** * Check if a row is expanded. * @param rowId the row id to check * @returns true if the row is expanded */ isRowExpanded(node) { const rowId = node.id; if (this.expanded.has(rowId)) { return true; } if (this.collapsed.has(rowId)) { return false; } const initialVal = this.initialState.get(rowId); if (initialVal != null) { return initialVal; } const initial = this.getInitialRowState(node); this.initialState.set(rowId, initial); return initial; } /** * This is different from just checking expandedState.isExpanded(rowNode.id), * as this correctly prioritizes user interaction over the user-defined initial state. * Plus sanity checks that the rowNode is actually expandable. */ getInitialRowState(rowNode) { if (!rowNode.isExpandable()) { return false; } const userFunc = this.gos.getCallback("isServerSideGroupOpenByDefault"); if (!userFunc) { return false; } const params = { data: rowNode.data, rowNode }; return userFunc(params); } /** * if the row is expanded or has been collapsed intentionally, do not apply initial state. * @param rowId the row id to check * @returns true if the row has been toggled */ isRowInitialised(rowId) { return this.initialState.has(rowId); } /** * Expand or collapse all loaded rows. * @param expanded true to expand all rows, false to collapse all rows */ expandAll(expanded) { this.beans.rowModel.forEachNode((node) => { this.setRowExpanded(node, expanded); }); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/services/expansion/strategies/expandAllStrategy.ts var ExpandAllStrategy = class extends BeanStub { constructor() { super(...arguments); this.name = "expandAll"; this.allExpanded = void 0; this.flipped = /* @__PURE__ */ new Set(); } setExpandedState(state) { this.allExpanded = state.expandAll; this.flipped = new Set(state.invertedRowGroupIds); } getExpandedState() { return { expandAll: this.allExpanded, invertedRowGroupIds: Array.from(this.flipped) }; } setRowExpanded(row, expanded) { const id = row.id; if (expanded === this.allExpanded) { this.flipped.delete(id); return; } this.flipped.add(id); } isRowExpanded(node) { const rowId = node.id; return this.allExpanded !== this.flipped.has(rowId); } isRowInitialised() { return true; } expandAll(expanded) { this.allExpanded = expanded; this.flipped.clear(); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/services/serverSideExpansionService.ts var ServerSideExpansionService = class extends BaseExpansionService { constructor() { super(...arguments); this.beanName = "expansionSvc"; } wireBeans(beans) { this.serverSideRowModel = beans.rowModel; this.storeFactory = beans.ssrmStoreFactory; } setStrategy(strategy) { this.destroyBean(this.strategy); this.strategy = this.createManagedBean(strategy); } postConstruct() { const setDefaultExpand = () => { this.setStrategy(new ExpandStrategy()); }; this.addManagedEventListeners({ // when row grouping / pivot changes, the old expand all state is no longer valid as rows changed columnRowGroupChanged: setDefaultExpand, columnPivotChanged: setDefaultExpand, columnPivotModeChanged: setDefaultExpand }); this.addManagedPropertyListener("ssrmExpandAllAffectsAllRows", (p) => { if (!p.currentValue) { this.setStrategy(new ExpandStrategy()); this.updateAllNodes(); this.dispatchStateUpdatedEvent(); } }); setDefaultExpand(); } setExpansionState(state) { const isExpandAllState = "expandAll" in state; const isExpandAllStrategy = this.isExpandAllStrategy(this.strategy); if (isExpandAllState !== isExpandAllStrategy) { this.setStrategy(isExpandAllState ? new ExpandAllStrategy() : new ExpandStrategy()); } this.strategy.setExpandedState(state); this.dispatchStateUpdatedEvent(); this.updateAllNodes(); } getExpansionState() { return this.strategy.getExpandedState(); } /** * Updates all nodes to the correct expanded/collapsed state. */ updateAllNodes() { this.serverSideRowModel.forEachNode((node) => { super.setExpanded(node, this.isNodeExpanded(node)); }); } isExpanded(rowNode) { let value = rowNode._expanded; if (value === null) { value = this.defaultExpanded(rowNode); rowNode._expanded = value; } return value; } isNodeExpanded(node) { return this.strategy.isRowExpanded(node); } setExpanded(node, expanded, e, _) { this.strategy.setRowExpanded(node, expanded); super.setExpanded(node, expanded, e); this.dispatchStateUpdatedEvent(); this.updateExpandedState(node); } resetExpansion() { this.setStrategy(new ExpandStrategy()); this.updateAllNodes(); this.dispatchStateUpdatedEvent(); } expandAll(expanded) { const ssrmExpandAllAffectsAllRows = this.beans.gos.get("ssrmExpandAllAffectsAllRows"); const shouldUseExpandAllStrategy = !this.isExpandAllStrategy(this.strategy) && ssrmExpandAllAffectsAllRows; if (shouldUseExpandAllStrategy) { this.setStrategy(new ExpandAllStrategy()); } this.strategy.expandAll(expanded); this.updateAllNodes(); this.dispatchStateUpdatedEvent(); this.beans.eventSvc.dispatchEvent({ type: "expandOrCollapseAll", source: expanded ? "expandAll" : "collapseAll" }); } isExpandAllStrategy(strategy) { return strategy.name === "expandAll"; } onGroupExpandedOrCollapsed() { } setDetailsExpansionState(detailGridApi) { const { gos: masterGos } = this.beans; if (!masterGos.get("ssrmExpandAllAffectsAllRows")) { return; } const masterExpansionState = this.getExpansionState(); const isInitial = masterExpansionState.expandAll === void 0; if (isInitial) { return; } const allExpanded = masterExpansionState.expandAll && masterExpansionState.invertedRowGroupIds.length === 0; const allCollapsed = !masterExpansionState.expandAll && masterExpansionState.invertedRowGroupIds.length === 0; if (allCollapsed === allExpanded) { return; } return allExpanded ? detailGridApi.expandAll() : detailGridApi.collapseAll(); } dispatchExpandedEvent(event) { this.eventSvc.dispatchEvent(event); this.beans.rowRenderer.refreshRowByNode(event.node); } updateExpandedState(rowNode) { const oldChildStore = rowNode.childStore; if (rowNode.expanded) { if (rowNode.master && !rowNode.detailNode) { rowNode.detailNode = this.createDetailNode(rowNode); } if (!oldChildStore && rowNode.hasChildren()) { const storeParams = this.serverSideRowModel.getParams(); rowNode.childStore = this.createBean(this.storeFactory.createStore(storeParams, rowNode)); } } else if (oldChildStore && this.gos.get("purgeClosedRowNodes")) { rowNode.childStore = this.destroyBean(oldChildStore); } } createDetailNode(masterNode) { const detailNode = new RowNode(this.beans); detailNode.detail = true; detailNode.selectable = false; detailNode.parent = masterNode; if (_exists(masterNode.id)) { detailNode.id = "detail_" + masterNode.id; } detailNode.data = masterNode.data; detailNode.level = masterNode.level + 1; const defaultDetailRowHeight = 200; const rowHeight = _getRowHeightForNode(this.beans, detailNode).height; detailNode.rowHeight = rowHeight ? rowHeight : defaultDetailRowHeight; return detailNode; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/services/selection/strategies/defaultStrategy.ts var DefaultStrategy = class extends BeanStub { constructor(selectionCtx) { super(); this.selectionCtx = selectionCtx; this.selectedState = { selectAll: false, toggledNodes: /* @__PURE__ */ new Set() }; /** * Whether select-all functionality has ever been used. Used only to print warnings in `getSelectedNodes` for users. * We print a warning even if not currently selecting all because we want users to be aware of the potential * for unexpected behaviour when these two features are used together. */ this.selectAllUsed = false; /** This is to prevent regressions, default selectionSvc retains reference of selected nodes. */ this.selectedNodes = {}; } getSelectedState() { return { selectAll: this.selectedState.selectAll, toggledNodes: [...this.selectedState.toggledNodes] }; } setSelectedState(state) { if (typeof state !== "object") { _error(116); return; } if (!("selectAll" in state)) { _error(116); return; } if (typeof state.selectAll !== "boolean") { _error(117); return; } if (!("toggledNodes" in state) || !Array.isArray(state.toggledNodes)) { return _warn(197); } const newState = { selectAll: state.selectAll, toggledNodes: /* @__PURE__ */ new Set() }; state.toggledNodes.forEach((key) => { if (typeof key === "string") { newState.toggledNodes.add(key); } else { _warn(196, { key }); } }); const isSelectingMultipleRows = newState.selectAll || newState.toggledNodes.size > 1; if (_isUsingNewRowSelectionAPI(this.gos) && !_isMultiRowSelection(this.gos) && isSelectingMultipleRows) { _warn(130); return; } this.selectedState = newState; } deleteSelectionStateFromParent(parentPath, removedNodeIds) { if (this.selectedState.toggledNodes.size === 0) { return false; } let anyNodesToggled = false; for (const id of removedNodeIds) { if (this.selectedState.toggledNodes.delete(id)) { anyNodesToggled = true; } } return anyNodesToggled; } setNodesSelected(params) { const { nodes, clearSelection, newValue, source } = params; if (nodes.length === 0) { return 0; } const onlyThisNode = clearSelection && newValue; if (!_isMultiRowSelection(this.gos) || onlyThisNode) { if (nodes.length > 1) { _error(130); return 0; } const rowNode = nodes[0]; const node = rowNode.footer ? rowNode.sibling : rowNode; if (newValue && node.selectable) { this.selectedNodes = { [node.id]: node }; this.selectedState = { selectAll: false, toggledNodes: /* @__PURE__ */ new Set([node.id]) }; } else { this.selectedNodes = {}; this.selectedState = { selectAll: false, toggledNodes: /* @__PURE__ */ new Set() }; } return 1; } const updateNodeState = (rowNode, value = newValue) => { const node = rowNode.footer ? rowNode.sibling : rowNode; if (value && node.selectable) { this.selectedNodes[node.id] = node; } else { delete this.selectedNodes[node.id]; } const doesNodeConform = value === this.selectedState.selectAll; if (doesNodeConform || !node.selectable) { this.selectedState.toggledNodes.delete(node.id); } else { this.selectedState.toggledNodes.add(node.id); } }; for (const node of nodes) { updateNodeState(node); } if (nodes.length === 1 && source === "api") { this.selectionCtx.setRoot(nodes[0].footer ? nodes[0].sibling : nodes[0]); } return 1; } processNewRow(node) { if (this.selectedNodes[node.id]) { this.selectedNodes[node.id] = node; } } isNodeSelected(node) { const isToggled = this.selectedState.toggledNodes.has(node.id); return this.selectedState.selectAll ? !isToggled : isToggled; } getSelectedNodes(nullWhenSelectAll = false, warnWhenSelectAll = true) { const { selectedState: { selectAll: selectAll2 }, selectedNodes, selectAllUsed } = this; if (warnWhenSelectAll && selectAllUsed) { _warn(199); } return nullWhenSelectAll && selectAll2 ? null : Object.values(selectedNodes); } getSelectedRows() { return (this.getSelectedNodes() ?? []).map((node) => node.data); } getSelectionCount() { if (this.selectedState.selectAll) { return -1; } return this.selectedState.toggledNodes.size; } isEmpty() { return !this.selectedState.selectAll && !this.selectedState.toggledNodes?.size; } selectAllRowNodes() { this.reset(true); } deselectAllRowNodes() { this.reset(false); } reset(selectAll2) { this.selectedState = { selectAll: selectAll2, toggledNodes: /* @__PURE__ */ new Set() }; this.selectedNodes = {}; this.selectAllUsed || (this.selectAllUsed = selectAll2); } getSelectAllState() { if (this.selectedState.selectAll) { if (this.selectedState.toggledNodes.size > 0) { return null; } return true; } if (this.selectedState.toggledNodes.size > 0) { return null; } return false; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/services/selection/strategies/groupSelectsChildrenStrategy.ts var GroupSelectsChildrenStrategy = class extends BeanStub { constructor(selectionCtx) { super(); this.selectionCtx = selectionCtx; this.selectedState = { selectAllChildren: false, toggledNodes: /* @__PURE__ */ new Map() }; } wireBeans(beans) { this.rowModel = beans.rowModel; this.rowGroupColsSvc = beans.rowGroupColsSvc; this.filterManager = beans.filterManager; this.selectionSvc = beans.selectionSvc; } postConstruct() { this.addManagedEventListeners({ // if model has updated, a store may now be fully loaded to clean up indeterminate states modelUpdated: () => this.removeRedundantState(), // when the grouping changes, the state no longer makes sense, so reset the state. columnRowGroupChanged: () => this.selectionSvc.reset("rowGroupChanged") }); } getSelectedState() { const { gos, rowGroupColsSvc, selectedState } = this; const treeData = gos.get("treeData"); const recursivelySerializeState = (state, level, nodeId) => { const normalisedState = { nodeId }; if (treeData || rowGroupColsSvc && level <= rowGroupColsSvc.columns.length) { normalisedState.selectAllChildren = state.selectAllChildren; } if (state.toggledNodes.size) { const toggledNodes = []; state.toggledNodes.forEach((value, key) => { const newState = recursivelySerializeState(value, level + 1, key); toggledNodes.push(newState); }); normalisedState.toggledNodes = toggledNodes; } return normalisedState; }; return recursivelySerializeState(selectedState, 0); } setSelectedState(state) { if ("selectAll" in state) { _error(111); return; } const recursivelyDeserializeState = (normalisedState, parentSelected) => { if (typeof normalisedState !== "object") { _error(243); throw new Error(); } if ("selectAllChildren" in normalisedState && typeof normalisedState.selectAllChildren !== "boolean") { _error(244); throw new Error(); } if ("toggledNodes" in normalisedState) { if (!Array.isArray(normalisedState.toggledNodes)) { _error(245); throw new Error(); } const allHaveIds = normalisedState.toggledNodes.every( (innerState) => typeof innerState === "object" && "nodeId" in innerState && typeof innerState.nodeId === "string" ); if (!allHaveIds) { _error(246); throw new Error(); } } const isThisNodeSelected = normalisedState.selectAllChildren ?? !parentSelected; const convertedChildren = normalisedState.toggledNodes?.map((innerState) => [ innerState.nodeId, recursivelyDeserializeState(innerState, isThisNodeSelected) ]); const doesRedundantStateExist = convertedChildren?.some( ([, innerState]) => isThisNodeSelected === innerState.selectAllChildren && innerState.toggledNodes.size === 0 ); if (doesRedundantStateExist) { _error(247); throw new Error(); } return { selectAllChildren: isThisNodeSelected, toggledNodes: new Map(convertedChildren) }; }; try { this.selectedState = recursivelyDeserializeState(state, !!state.selectAllChildren); } catch (e) { } } deleteSelectionStateFromParent(parentRoute, removedNodeIds) { let parentState = this.selectedState; const remainingRoute = [...parentRoute]; while (parentState && remainingRoute.length) { parentState = parentState.toggledNodes.get(remainingRoute.pop()); } if (!parentState) { return false; } let anyStateChanged = false; for (const id of removedNodeIds) { if (parentState?.toggledNodes.delete(id)) { anyStateChanged = true; } } if (anyStateChanged) { this.removeRedundantState(); } return anyStateChanged; } setNodesSelected({ nodes, newValue, clearSelection, source }) { if (nodes.length === 0) { return 0; } const onlyThisNode = clearSelection && newValue; if (!_isMultiRowSelection(this.gos) || onlyThisNode) { if (nodes.length > 1) { _error(130); return 0; } this.deselectAllRowNodes(); } for (const rowNode of nodes) { const node = rowNode.footer ? rowNode.sibling : rowNode; const idPathToNode = this.getRouteToNode(node); this.recursivelySelectNode(idPathToNode, this.selectedState, newValue); } this.removeRedundantState(); if (nodes.length === 1 && source === "api") { this.selectionCtx.setRoot(nodes[0].footer ? nodes[0].sibling : nodes[0]); } return 1; } isNodeSelected(node) { const path = this.getRouteToNode(node); return this.isNodePathSelected(path, this.selectedState); } isNodePathSelected([nextNode, ...nodes], state) { if (nodes.length === 0) { const isToggled = state.toggledNodes.has(nextNode.id); if (nextNode.hasChildren()) { const groupState = state.toggledNodes.get(nextNode.id); if (groupState?.toggledNodes.size) { return void 0; } } return state.selectAllChildren ? !isToggled : isToggled; } if (state.toggledNodes.has(nextNode.id)) { const nextState = state.toggledNodes.get(nextNode.id); if (nextState) { return this.isNodePathSelected(nodes, nextState); } } return state.selectAllChildren; } getRouteToNode(node) { const pathToNode = []; let tempNode = node; while (tempNode.parent) { pathToNode.push(tempNode); tempNode = tempNode.parent; } return pathToNode.reverse(); } removeRedundantState() { if (this.filterManager?.isAnyFilterPresent()) { return; } const forEachNodeStateDepthFirst = (state = this.selectedState, thisKey, parentState) => { state.toggledNodes.forEach((value, key) => { forEachNodeStateDepthFirst(value, key, state); }); if (thisKey) { const thisRow = this.rowModel.getRowNode(thisKey); const thisRowStore = thisRow?.childStore; const isStoreSizeKnown = thisRowStore?.isLastRowIndexKnown(); if (isStoreSizeKnown) { const possibleAllNodesToggled = state.toggledNodes.size >= thisRowStore.getRowCount(); if (possibleAllNodesToggled) { for (const childState of state.toggledNodes.entries()) { const [key, value] = childState; if (value.toggledNodes.size > 0) { return; } const rowDoesNotExist = !this.rowModel.getRowNode(key); if (rowDoesNotExist) { return; } } state.selectAllChildren = !state.selectAllChildren; state.toggledNodes.clear(); } } } const hasNoToggledRows = state.toggledNodes.size === 0; const isIdenticalToParent = parentState?.selectAllChildren === state.selectAllChildren; if (hasNoToggledRows && isIdenticalToParent) { parentState?.toggledNodes.delete(thisKey); } }; forEachNodeStateDepthFirst(); } recursivelySelectNode([nextNode, ...nodes], selectedState, newValue) { if (!nextNode) { return; } const isLastNode = !nodes.length; if (isLastNode) { const isNodeSelectable = nextNode.selectable; const doesNodeConform = selectedState.selectAllChildren === newValue; if (doesNodeConform || !isNodeSelectable) { selectedState.toggledNodes.delete(nextNode.id); return; } const newState = { selectAllChildren: newValue, toggledNodes: /* @__PURE__ */ new Map() }; selectedState.toggledNodes.set(nextNode.id, newState); return; } const doesStateAlreadyExist = selectedState.toggledNodes.has(nextNode.id); const childState = selectedState.toggledNodes.get(nextNode.id) ?? { selectAllChildren: selectedState.selectAllChildren, toggledNodes: /* @__PURE__ */ new Map() }; if (!doesStateAlreadyExist) { selectedState.toggledNodes.set(nextNode.id, childState); } this.recursivelySelectNode(nodes, childState, newValue); if (selectedState.selectAllChildren === childState.selectAllChildren && childState.toggledNodes.size === 0) { selectedState.toggledNodes.delete(nextNode.id); } } getSelectedNodes(nullWhenSelectAll = false) { _warn(202); if (this.selectedState.selectAllChildren && nullWhenSelectAll) { return null; } const selectedNodes = []; this.rowModel.forEachNode((node) => { if (node.isSelected()) { selectedNodes.push(node); } }); return selectedNodes; } processNewRow() { } getSelectedRows() { return this.getSelectedNodes()?.map((node) => node.data) ?? []; } getSelectionCount() { return -1; } isEmpty() { return !this.selectedState.selectAllChildren && !this.selectedState.toggledNodes?.size; } selectAllRowNodes() { this.reset(true); } deselectAllRowNodes() { this.reset(false); } reset(selectAllChildren2) { this.selectedState = { selectAllChildren: selectAllChildren2, toggledNodes: /* @__PURE__ */ new Map() }; } getSelectAllState() { if (this.selectedState.selectAllChildren) { if (this.selectedState.toggledNodes.size > 0) { return null; } return true; } if (this.selectedState.toggledNodes.size > 0) { return null; } return false; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/services/serverSideSelectionService.ts var ServerSideSelectionService = class extends BaseSelectionService { constructor() { super(...arguments); this.beanName = "selectionSvc"; } postConstruct() { super.postConstruct(); this.addManagedPropertyListeners(["groupSelectsChildren", "rowSelection"], () => { const groupSelectsChildren2 = _getGroupSelectsDescendants(this.gos); const Strategy2 = groupSelectsChildren2 && this.selectionStrategy instanceof DefaultStrategy ? GroupSelectsChildrenStrategy : !groupSelectsChildren2 && this.selectionStrategy instanceof GroupSelectsChildrenStrategy ? DefaultStrategy : void 0; if (Strategy2) { this.destroyBean(this.selectionStrategy); this.selectionStrategy = this.createManagedBean(new Strategy2(this.selectionCtx)); this.shotgunResetNodeSelectionState(); this.dispatchSelectionChanged("api"); } }); this.addManagedPropertyListeners(["rowSelection"], () => { const rowSelection = _getRowSelectionMode(this.gos); if (rowSelection !== this.selectionMode) { this.selectionMode = rowSelection; this.deselectAllRowNodes({ source: "api" }); } }); this.selectionMode = _getRowSelectionMode(this.gos); const groupSelectsChildren = _getGroupSelectsDescendants(this.gos); const Strategy = !groupSelectsChildren ? DefaultStrategy : GroupSelectsChildrenStrategy; this.selectionStrategy = this.createManagedBean(new Strategy(this.selectionCtx)); } handleSelectionEvent(event, rowNode, source) { if (this.isRowSelectionBlocked(rowNode)) { return 0; } let updatedRows = 0; const selection = this.inferNodeSelections(rowNode, event.shiftKey, event.metaKey || event.ctrlKey, source); if (selection == null) { return 0; } this.selectionCtx.selectAll = false; if ("select" in selection) { if (selection.reset) { this.selectionStrategy.deselectAllRowNodes({ source: "api" }); } else { this.selectionStrategy.setNodesSelected({ nodes: selection.deselect, newValue: false, source }); } updatedRows = this.selectionStrategy.setNodesSelected({ nodes: selection.select, newValue: true, source }); } else { updatedRows = this.selectionStrategy.setNodesSelected({ nodes: [selection.node], newValue: selection.newValue, clearSelection: selection.clearSelection, event, source }); } this.shotgunResetNodeSelectionState(source); this.dispatchSelectionChanged(source); return updatedRows; } getSelectionState() { return this.selectionStrategy.getSelectedState(); } setSelectionState(state, source) { if (!_isRowSelection(this.gos)) { if (state) { _warn(132); } return; } if (Array.isArray(state)) { return; } if (state) { this.selectionStrategy.setSelectedState(state); this.shotgunResetNodeSelectionState(); this.dispatchSelectionChanged(source); } else { this.deselectAllRowNodes({ source }); } } setNodesSelected(params) { if (!_isRowSelection(this.gos) && params.newValue) { _warn(132); return 0; } const { nodes, ...otherParams } = params; if (nodes.length > 1 && this.selectionMode !== "multiRow") { _warn(130); return 0; } const adjustedParams = { nodes: nodes.filter((node) => node.selectable), ...otherParams }; if (!adjustedParams.nodes.length) { return 0; } const changedNodes = this.selectionStrategy.setNodesSelected(adjustedParams); this.shotgunResetNodeSelectionState(adjustedParams.source); this.dispatchSelectionChanged(adjustedParams.source); return changedNodes; } /** * Deletes the selection state for a set of nodes, for use after deleting nodes via * transaction. As this is designed for transactions, all nodes should belong to the same group. */ deleteSelectionStateFromParent(storeRoute, removedNodeIds) { const stateChanged = this.selectionStrategy.deleteSelectionStateFromParent(storeRoute, removedNodeIds); if (!stateChanged) { return; } this.shotgunResetNodeSelectionState(); this.dispatchSelectionChanged("api"); } shotgunResetNodeSelectionState(source) { this.beans.rowModel.forEachNode((node) => { if (node.stub) { return; } const isNodeSelected = this.selectionStrategy.isNodeSelected(node); if (isNodeSelected !== node.isSelected()) { this.selectRowNode(node, isNodeSelected, void 0, source); } }); } getSelectedNodes() { return this.selectionStrategy.getSelectedNodes() ?? []; } getSelectedRows() { return this.selectionStrategy.getSelectedRows(); } getSelectionCount() { return this.selectionStrategy.getSelectionCount(); } syncInRowNode(rowNode) { this.selectionStrategy.processNewRow(rowNode); const isNodeSelected = this.selectionStrategy.isNodeSelected(rowNode); if (isNodeSelected != false && !rowNode.selectable) { this.selectionStrategy.setNodesSelected({ nodes: [rowNode], newValue: false, source: "api" }); this.shotgunResetNodeSelectionState(); this.dispatchSelectionChanged("api"); return; } rowNode.__selected = isNodeSelected; } reset() { this.selectionStrategy.deselectAllRowNodes({ source: "api" }); this.selectionCtx.reset(); } isEmpty() { return this.selectionStrategy.isEmpty(); } hasNodesToSelect() { return true; } selectAllRowNodes(params) { if (!_isRowSelection(this.gos)) { _warn(132); return; } validateSelectionParameters(params); if (_isUsingNewRowSelectionAPI(this.gos) && !_isMultiRowSelection(this.gos)) { return _warn(130); } this.selectionStrategy.selectAllRowNodes(params); this.selectionCtx.selectAll = true; this.beans.rowModel.forEachNode((node) => { if (node.stub) { return; } this.selectRowNode(node, true, void 0, params.source); }); this.dispatchSelectionChanged(params.source); } deselectAllRowNodes(params) { validateSelectionParameters(params); this.selectionStrategy.deselectAllRowNodes(params); this.selectionCtx.selectAll = false; this.beans.rowModel.forEachNode((node) => { if (node.stub) { return; } this.selectRowNode(node, false, void 0, params.source); }); this.dispatchSelectionChanged(params.source); } getSelectAllState(selectAll2) { return this.selectionStrategy.getSelectAllState(selectAll2); } // used by CSRM getBestCostNodeSelection() { return _warn(194, { method: "getBestCostNodeSelection" }); } /** * Updates the selectable state for a node by invoking isRowSelectable callback. * If the node is not selectable, it will be deselected. * * Callers: * - property isRowSelectable changed * - after grouping / treeData */ updateSelectable() { if (!_isRowSelection(this.gos)) { return; } const nodesToDeselect = []; this.beans.rowModel.forEachNode((node) => { const rowSelectable = this.updateRowSelectable(node, true); if (!rowSelectable && node.isSelected()) { nodesToDeselect.push(node); } }); if (nodesToDeselect.length) { this.setNodesSelected({ nodes: nodesToDeselect, newValue: false, source: "selectableChanged" }); } } dispatchSelectionChanged(source) { this.eventSvc.dispatchEvent({ type: "selectionChanged", source, selectedNodes: this.selectionStrategy instanceof GroupSelectsChildrenStrategy ? null : this.selectionStrategy.getSelectedNodes(true, false), serverSideState: this.getSelectionState() }); } updateSelectableAfterGrouping() { return _error(194, { method: "updateSelectableAfterGrouping" }); } refreshMasterNodeState() { } setDetailSelectionState() { return; } }; function validateSelectionParameters({ selectAll: selectAll2 }) { if (selectAll2 === "filtered" || selectAll2 === "currentPage") { _warn(195, { justCurrentPage: selectAll2 === "currentPage" }); } } // packages/ag-grid-enterprise/src/serverSideRowModel/services/ssrmRowChildrenService.ts var SsrmRowChildrenService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowChildrenSvc"; } getHasChildrenValue(rowNode) { const isTreeData = this.gos.get("treeData"); const isGroupFunc = this.gos.get("isServerSideGroup"); return !rowNode.stub && !rowNode.footer && (isTreeData ? !!isGroupFunc && isGroupFunc(rowNode.data) : !!rowNode.group); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/lazy/lazyBlockLoadingService.ts var LazyBlockLoadingService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "lazyBlockLoadingSvc"; this.outboundRequests = 0; // a map of caches to loading nodes this.cacheLoadingNodesMap = /* @__PURE__ */ new Map(); // if a check is queued to happen this cycle this.isCheckQueued = false; // this is cached for blockLoadDebounce this.nextBlockToLoad = void 0; } wireBeans(beans) { this.rowRenderer = beans.rowRenderer; this.rowModel = beans.rowModel; } postConstruct() { this.maxOutboundRequests = _getMaxConcurrentDatasourceRequests(this.gos); } subscribe(cache) { this.cacheLoadingNodesMap.set(cache, /* @__PURE__ */ new Set()); } unsubscribe(cache) { this.cacheLoadingNodesMap.delete(cache); } /** * Queues a microtask to check if any blocks need to be loaded. */ queueLoadCheck() { if (this.isCheckQueued) { return; } this.isCheckQueued = true; setTimeout(() => { this.queueLoadAction(); this.isCheckQueued = false; }); } onLoadComplete() { this.outboundRequests -= 1; this.queueLoadCheck(); } hasAvailableLoadBandwidth() { if (this.maxOutboundRequests === void 0) { return true; } return this.outboundRequests < this.maxOutboundRequests; } queueLoadAction() { const nextBlockToLoad = this.getBlockToLoad(); if (!nextBlockToLoad) { return; } const isSameBlock = this.nextBlockToLoad && this.nextBlockToLoad.cache === nextBlockToLoad.cache && this.nextBlockToLoad.index === nextBlockToLoad.index; if (isSameBlock) { return; } if (!this.nextBlockToLoad || !isSameBlock) { this.nextBlockToLoad = nextBlockToLoad; window.clearTimeout(this.loaderTimeout); const startRow = Number(this.nextBlockToLoad.index); const cache = this.nextBlockToLoad.cache; const endRow = nextBlockToLoad.index + nextBlockToLoad.cache.getBlockSize(); this.loaderTimeout = window.setTimeout(() => { if (!cache.isAlive()) { return; } this.loaderTimeout = void 0; this.attemptLoad(cache, startRow, endRow); this.nextBlockToLoad = void 0; }, this.gos.get("blockLoadDebounceMillis")); } } attemptLoad(cache, start, end) { const hasBandwidth = this.hasAvailableLoadBandwidth(); if (!hasBandwidth) { return; } this.executeLoad(cache, start, end); this.queueLoadCheck(); } executeLoad(cache, startRow, endRow) { const ssrmParams = cache.getSsrmParams(); const request = { startRow, endRow, rowGroupCols: ssrmParams.rowGroupCols, valueCols: ssrmParams.valueCols, pivotCols: ssrmParams.pivotCols, pivotMode: ssrmParams.pivotMode, groupKeys: cache.store.getParentNode().getRoute() ?? [], filterModel: ssrmParams.filterModel, sortModel: ssrmParams.sortModel }; const loadingNodes = this.cacheLoadingNodesMap.get(cache); const removeNodesFromLoadingMap = () => { for (let i = 0; i < endRow - startRow; i++) { loadingNodes.delete(startRow + i); } }; const addNodesToLoadingMap = () => { for (let i = 0; i < endRow - startRow; i++) { loadingNodes.add(startRow + i); } }; const success = (params2) => { this.onLoadComplete(); cache.onLoadSuccess(startRow, endRow - startRow, params2); removeNodesFromLoadingMap(); }; const fail = () => { this.onLoadComplete(); cache.onLoadFailed(startRow, endRow - startRow); removeNodesFromLoadingMap(); }; const params = _addGridCommonParams(this.gos, { request, success, fail, parentNode: cache.store.getParentNode() }); addNodesToLoadingMap(); this.outboundRequests += 1; cache.getSsrmParams().datasource?.getRows(params); } getBlockToLoad() { const firstRowInViewport = this.rowRenderer.firstRenderedRow; const lastRowInViewport = this.rowRenderer.lastRenderedRow; for (let i = firstRowInViewport; i <= lastRowInViewport; i++) { const row = this.rowModel.getRow(i); if (!row) { continue; } const store = row.parent?.childStore; if (!store) { continue; } const cache = store.getCache(); const lazyNode = cache.getNodes().getBy("node", row); if (!lazyNode) { continue; } const loadingNodes = this.cacheLoadingNodesMap.get(cache); if (loadingNodes?.has(lazyNode.index)) { continue; } if (row.__needsRefreshWhenVisible || row.stub && !row.failedLoad) { return { cache, index: cache.getBlockStartIndex(lazyNode.index) }; } } let cacheToRefresh = null; let nodeToRefresh = null; let nodeToRefreshDist = Number.MAX_SAFE_INTEGER; for (const cache of this.cacheLoadingNodesMap.keys()) { const nodesToRefresh = cache.getNodesToRefresh(); nodesToRefresh.forEach((node) => { if (node.rowIndex == null) { nodeToRefresh = node; cacheToRefresh = cache; return; } const lazyNode = cache.getNodes().getBy("node", node); if (!lazyNode) { return; } const loadingNodes = this.cacheLoadingNodesMap.get(cache); if (loadingNodes?.has(lazyNode.index)) { return; } const distToViewportTop = Math.abs(firstRowInViewport - node.rowIndex); const distToViewportBottom = Math.abs(node.rowIndex - lastRowInViewport); if (distToViewportTop < nodeToRefreshDist) { nodeToRefresh = node; nodeToRefreshDist = distToViewportTop; cacheToRefresh = cache; } if (distToViewportBottom < nodeToRefreshDist) { nodeToRefresh = node; nodeToRefreshDist = distToViewportBottom; cacheToRefresh = cache; } }); } if (!cacheToRefresh) { return void 0; } const lazyCache = cacheToRefresh; const lazyIndex = lazyCache.getNodes().getBy("node", nodeToRefresh)?.index; return lazyIndex == null ? void 0 : { cache: lazyCache, index: lazyCache.getBlockStartIndex(lazyIndex) }; } isRowLoading(cache, index) { return this.cacheLoadingNodesMap.get(cache)?.has(index) ?? false; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/lazy/multiIndexMap.ts var MultiIndexMap = class { constructor(...indexes) { this.indexes = indexes; this.maps = new Map(this.indexes.map((index) => [index, /* @__PURE__ */ new Map()])); } getSize() { return this.maps.get(this.indexes[0]).size; } getBy(index, key) { const map = this.maps.get(index); return map.get(key); } set(item) { for (const index of this.indexes) { const map = this.maps.get(index); map.set(item[index], item); } } delete(item) { for (const index of this.indexes) { const map = this.maps.get(index); map.delete(item[index]); } } clear() { this.maps.forEach((map) => map.clear()); } getIterator(index) { const map = this.maps.get(index); return map.values(); } forEach(callback) { const iterator = this.getIterator(this.indexes[0]); let pointer; while (pointer = iterator.next()) { if (pointer.done) { break; } callback(pointer.value); } } find(callback) { const iterator = this.getIterator(this.indexes[0]); let pointer; while (pointer = iterator.next()) { if (pointer.done) { break; } if (callback(pointer.value)) { return pointer.value; } } } filter(predicate) { const iterator = this.getIterator(this.indexes[0]); let pointer; const result = []; while (pointer = iterator.next()) { if (pointer.done) { break; } if (predicate(pointer.value)) { result.push(pointer.value); } } return result; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/lazy/lazyCache.ts var DEFAULT_BLOCK_SIZE = 100; var LazyCache = class extends BeanStub { constructor(store, numberOfRows, isLastRowKnown, storeParams) { super(); /** * Indicates whether this is still the live dataset for this store (used for ignoring old requests after purge) */ this.live = true; /** * A cache of removed group nodes, this is retained for preserving group * state when the node moves in and out of the cache. Generally caused by * rows moving blocks. */ this.removedNodeCache = /* @__PURE__ */ new Map(); this.store = store; this.numberOfRows = numberOfRows; this.isLastRowKnown = isLastRowKnown; this.storeParams = storeParams; } wireBeans(beans) { this.rowRenderer = beans.rowRenderer; this.blockUtils = beans.ssrmBlockUtils; this.focusSvc = beans.focusSvc; this.nodeManager = beans.ssrmNodeManager; this.serverSideRowModel = beans.rowModel; this.rowNodeSorter = beans.rowNodeSorter; this.sortSvc = beans.sortSvc; this.lazyBlockLoadingSvc = beans.lazyBlockLoadingSvc; this.colModel = beans.colModel; } postConstruct() { this.lazyBlockLoadingSvc.subscribe(this); this.nodeMap = new MultiIndexMap("index", "id", "node"); this.nodeDisplayIndexMap = /* @__PURE__ */ new Map(); this.nodesToRefresh = /* @__PURE__ */ new Set(); const { blockUtils, gos, store } = this; this.defaultNodeIdPrefix = blockUtils.createNodeIdPrefix(store.getParentNode()); this.getRowIdFunc = _getRowIdCallback(gos); this.isMasterDetail = gos.get("masterDetail"); } destroy() { this.lazyBlockLoadingSvc.unsubscribe(this); this.numberOfRows = 0; this.nodeMap.forEach((node) => this.blockUtils.destroyRowNode(node.node)); this.nodeMap.clear(); this.nodeDisplayIndexMap.clear(); this.nodesToRefresh.clear(); this.live = false; super.destroy(); } /** * Get the row node for a specific display index from this store * @param displayIndex the display index of the node to find * @returns undefined if the node is not in the store bounds, otherwise will always return a node */ getRowByDisplayIndex(displayIndex) { if (!this.store.isDisplayIndexInStore(displayIndex)) { return void 0; } const node = this.nodeDisplayIndexMap.get(displayIndex); if (node) { if (node.stub || node.__needsRefreshWhenVisible) { this.lazyBlockLoadingSvc.queueLoadCheck(); } return node; } const hideOpenGroups = this.gos.get("groupHideOpenParents") || this.gos.get("groupAllowUnbalanced"); if (hideOpenGroups) { const nextParent = this.nodeMap.find( (lazyNode) => !!lazyNode.node.childStore?.isDisplayIndexInStore(displayIndex) ); if (nextParent) { return nextParent.node.childStore?.getRowUsingDisplayIndex(displayIndex); } } if (displayIndex === this.store.getDisplayIndexStart()) { return this.createStubNode(0, displayIndex); } const contiguouslyPreviousNode = this.nodeDisplayIndexMap.get(displayIndex - 1); if (contiguouslyPreviousNode) { if (this.isMasterDetail && contiguouslyPreviousNode.master && contiguouslyPreviousNode.expanded) { return contiguouslyPreviousNode.detailNode; } if (contiguouslyPreviousNode.expanded && contiguouslyPreviousNode.childStore?.isDisplayIndexInStore(displayIndex)) { return contiguouslyPreviousNode.childStore?.getRowUsingDisplayIndex( displayIndex ); } const lazyCacheNode = this.nodeMap.getBy("node", contiguouslyPreviousNode); return this.createStubNode(lazyCacheNode.index + 1, displayIndex); } const adjacentNodes = this.getSurroundingNodesByDisplayIndex(displayIndex); if (adjacentNodes == null) { const storeIndexFromEndIndex2 = this.store.getRowCount() - (this.store.getDisplayIndexEnd() - displayIndex); return this.createStubNode(storeIndexFromEndIndex2, displayIndex); } const { previousNode, nextNode } = adjacentNodes; if (previousNode?.node.expanded && previousNode.node.childStore?.isDisplayIndexInStore(displayIndex)) { return previousNode.node.childStore?.getRowUsingDisplayIndex(displayIndex); } if (nextNode) { const displayIndexDiff = nextNode.node.rowIndex - displayIndex; const newStoreIndex = nextNode.index - displayIndexDiff; return this.createStubNode(newStoreIndex, displayIndex); } const storeIndexFromEndIndex = this.store.getRowCount() - (this.store.getDisplayIndexEnd() - displayIndex); return this.createStubNode(storeIndexFromEndIndex, displayIndex); } /** * Used for creating and positioning a stub node without firing a store updated event */ createStubNode(storeIndex, displayIndex) { const rowBounds = this.store.getRowBounds(displayIndex); const newNode = this.createRowAtIndex(storeIndex, null, (node) => { node.setRowIndex(displayIndex); node.setRowTop(rowBounds.rowTop); this.nodeDisplayIndexMap.set(displayIndex, node); }); if (storeIndex === 0 && this.gos.get("groupHideOpenParents")) { const parentGroupData = this.store.getParentNode().groupData; if (parentGroupData) { for (const key of Object.keys(parentGroupData)) { setRowNodeGroupValue(newNode, this.colModel, key, parentGroupData[key]); } } } this.lazyBlockLoadingSvc.queueLoadCheck(); return newNode; } /** * @param index The row index relative to this store * @returns A rowNode at the given store index */ getRowByStoreIndex(index) { return this.nodeMap.getBy("index", index)?.node; } /** * Given a number of rows, skips through the given sequence & row top reference (using default row height) * @param numberOfRowsToSkip number of rows to skip over in the given sequence * @param displayIndexSeq the sequence in which to skip * @param nextRowTop the row top reference in which to skip */ skipDisplayIndexes(numberOfRowsToSkip, displayIndexSeq, nextRowTop) { if (numberOfRowsToSkip === 0) { return; } const defaultRowHeight = _getRowHeightAsNumber(this.beans); displayIndexSeq.value += numberOfRowsToSkip; nextRowTop.value += numberOfRowsToSkip * defaultRowHeight; } /** * @param displayIndexSeq the number sequence for generating the display index of each row * @param nextRowTop an object containing the next row top value intended to be modified by ref per row */ setDisplayIndexes(displayIndexSeq, nextRowTop, uiLevel) { this.nodeDisplayIndexMap.clear(); const orderedMap = {}; this.nodeMap.forEach((lazyNode) => { orderedMap[lazyNode.index] = lazyNode.node; }); let lastIndex = -1; for (const stringIndex of Object.keys(orderedMap)) { const node = orderedMap[stringIndex]; const numericIndex = Number(stringIndex); const numberOfRowsToSkip2 = numericIndex - 1 - lastIndex; this.skipDisplayIndexes(numberOfRowsToSkip2, displayIndexSeq, nextRowTop); const isFirstChild = numericIndex === 0; if (node.firstChild !== isFirstChild) { node.firstChild = isFirstChild; node.dispatchRowEvent("firstChildChanged"); } if (isFirstChild && this.gos.get("groupHideOpenParents")) { const parentGroupData = this.store.getParentNode().groupData; if (parentGroupData) { for (const key of Object.keys(parentGroupData)) { setRowNodeGroupValue(node, this.colModel, key, isFirstChild ? parentGroupData[key] : void 0); } } } this.blockUtils.setDisplayIndex(node, displayIndexSeq, nextRowTop, uiLevel); if (node.rowIndex != null) { this.nodeDisplayIndexMap.set(node.rowIndex, node); } lastIndex = numericIndex; } const numberOfRowsToSkip = this.numberOfRows - 1 - lastIndex; this.skipDisplayIndexes(numberOfRowsToSkip, displayIndexSeq, nextRowTop); this.purgeExcessRows(); } getRowCount() { return this.numberOfRows; } setRowCount(rowCount, isLastRowIndexKnown2) { this.numberOfRows = rowCount; if (isLastRowIndexKnown2 != null) { this.isLastRowKnown = isLastRowIndexKnown2; if (isLastRowIndexKnown2 === false) { this.numberOfRows += 1; } } this.fireStoreUpdatedEvent(); } getNodes() { return this.nodeMap; } getNodeCachedByDisplayIndex(displayIndex) { return this.nodeDisplayIndexMap.get(displayIndex) ?? null; } getNodesToRefresh() { return this.nodesToRefresh; } /** * @returns the previous and next loaded row nodes surrounding the given display index */ getSurroundingNodesByDisplayIndex(displayIndex) { let nextNode; let previousNode; this.nodeMap.forEach((lazyNode) => { if (displayIndex > lazyNode.node.rowIndex) { if (previousNode == null || previousNode.node.rowIndex < lazyNode.node.rowIndex) { previousNode = lazyNode; } return; } if (nextNode == null || nextNode.node.rowIndex > lazyNode.node.rowIndex) { nextNode = lazyNode; } }); if (!previousNode && !nextNode) { return null; } return { previousNode, nextNode }; } /** * Get or calculate the display index for a given store index * @param storeIndex the rows index within this store * @returns the rows visible display index relative to the grid */ getDisplayIndexFromStoreIndex(storeIndex) { const nodeAtIndex = this.nodeMap.getBy("index", storeIndex); if (nodeAtIndex) { return nodeAtIndex.node.rowIndex; } let nextNode; let previousNode; this.nodeMap.forEach((lazyNode) => { if (storeIndex > lazyNode.index) { if (previousNode == null || previousNode.index < lazyNode.index) { previousNode = lazyNode; } return; } if (nextNode == null || nextNode.index > lazyNode.index) { nextNode = lazyNode; } }); if (!nextNode) { return this.store.getDisplayIndexEnd() - (this.numberOfRows - storeIndex); } if (!previousNode) { return this.store.getDisplayIndexStart() + storeIndex; } const storeIndexDiff = storeIndex - previousNode.index; const previousDisplayIndex = previousNode.node.childStore?.getDisplayIndexEnd() ?? previousNode.node.rowIndex; return previousDisplayIndex + storeIndexDiff; } /** * Creates a new row and inserts it at the given index * @param atStoreIndex the node index relative to this store * @param data the data object to populate the node with * @returns the new row node */ createRowAtIndex(atStoreIndex, data, createNodeCallback) { const lazyNode = this.nodeMap.getBy("index", atStoreIndex); if (lazyNode) { const { node } = lazyNode; node.__needsRefreshWhenVisible = false; if (this.doesNodeMatch(data, node)) { this.blockUtils.updateDataIntoRowNode(node, data); this.nodesToRefresh.delete(node); return node; } if (this.getRowIdFunc == null && node.hasChildren() && node.expanded) { this.nodesToRefresh.delete(node); return node; } this.destroyRowAtIndex(atStoreIndex); } if (data && this.getRowIdFunc != null) { const id = this.getRowId(data); const deletedNode = id && this.removedNodeCache?.get(id); if (deletedNode) { this.removedNodeCache?.delete(id); this.blockUtils.updateDataIntoRowNode(deletedNode, data); this.nodeMap.set({ id: deletedNode.id, node: deletedNode, index: atStoreIndex }); this.nodesToRefresh.delete(deletedNode); deletedNode.__needsRefreshWhenVisible = false; return deletedNode; } const lazyNode2 = this.nodeMap.getBy("id", id); if (lazyNode2) { this.nodeMap.delete(lazyNode2); const { node, index } = lazyNode2; this.blockUtils.updateDataIntoRowNode(node, data); this.nodeMap.set({ id: node.id, node, index: atStoreIndex }); this.nodesToRefresh.delete(node); node.__needsRefreshWhenVisible = false; if (this.getBlockStartIndex(index) === this.getBlockStartIndex(atStoreIndex)) { return node; } this.markBlockForVerify(index); return node; } } const newNode = this.blockUtils.createRowNode(this.store.getRowDetails()); if (data != null) { const defaultId = this.getPrefixedId(this.store.getIdSequence().value++); this.blockUtils.setDataIntoRowNode(newNode, data, defaultId, void 0); this.blockUtils.checkOpenByDefault(newNode); this.nodeManager.addRowNode(newNode); } this.nodeMap.set({ id: newNode.id, node: newNode, index: atStoreIndex }); if (createNodeCallback) { createNodeCallback(newNode); } return newNode; } getBlockStates() { const blockCounts = {}; const blockStates = {}; this.nodeMap.forEach(({ node, index }) => { const blockStart = this.getBlockStartIndex(index); if (!node.stub && !node.failedLoad) { blockCounts[blockStart] = (blockCounts[blockStart] ?? 0) + 1; } let rowState = "loaded"; if (node.failedLoad) { rowState = "failed"; } else if (this.lazyBlockLoadingSvc.isRowLoading(this, blockStart)) { rowState = "loading"; } else if (this.nodesToRefresh.has(node) || node.stub) { rowState = "needsLoading"; } if (!blockStates[blockStart]) { blockStates[blockStart] = /* @__PURE__ */ new Set(); } blockStates[blockStart].add(rowState); }); const statePriorityMap = { loading: 4, failed: 3, needsLoading: 2, loaded: 1 }; const blockPrefix = this.blockUtils.createNodeIdPrefix(this.store.getParentNode()); const results = {}; for (const blockStart of Object.keys(blockStates)) { const sortedStates = [...blockStates[blockStart]].sort( (a, b) => (statePriorityMap[a] ?? 0) - (statePriorityMap[b] ?? 0) ); const priorityState = sortedStates[0]; const blockNumber = Number(blockStart) / this.getBlockSize(); const blockId = blockPrefix ? `${blockPrefix}-${blockNumber}` : String(blockNumber); results[blockId] = { blockNumber, startRow: Number(blockStart), endRow: Number(blockStart) + this.getBlockSize(), pageStatus: priorityState, loadedRowCount: blockCounts[blockStart] ?? 0 }; } return results; } destroyRowAtIndex(atStoreIndex) { const lazyNode = this.nodeMap.getBy("index", atStoreIndex); if (!lazyNode) { return; } this.nodeMap.delete(lazyNode); this.nodeDisplayIndexMap.delete(lazyNode.node.rowIndex); if (this.nodesToRefresh.size > 0) { this.removedNodeCache.set(lazyNode.node.id, lazyNode.node); } else { this.blockUtils.destroyRowNode(lazyNode.node); } this.nodesToRefresh.delete(lazyNode.node); } getSsrmParams() { return this.store.getSsrmParams(); } /** * @param id the base id to be prefixed * @returns a node id with prefix if required */ getPrefixedId(id) { if (this.defaultNodeIdPrefix) { return this.defaultNodeIdPrefix + "-" + id; } else { return id.toString(); } } markBlockForVerify(rowIndex) { const [start, end] = this.getBlockBounds(rowIndex); const lazyNodesInRange = this.nodeMap.filter((lazyNode) => lazyNode.index >= start && lazyNode.index < end); lazyNodesInRange.forEach(({ node }) => { node.__needsRefreshWhenVisible = true; }); } doesNodeMatch(data, node) { if (node.stub) { return false; } const id = this.getRowId(data); return id === null ? node.data === data : node.id === id; } /** * Deletes any stub nodes not within the given range */ purgeStubsOutsideOfViewport() { const { firstRenderedRow, lastRenderedRow } = this.rowRenderer; const firstRowBlockStart = this.getBlockStartIndex(firstRenderedRow); const [, lastRowBlockEnd] = this.getBlockBounds(lastRenderedRow); this.nodeMap.forEach((lazyNode) => { if (this.lazyBlockLoadingSvc.isRowLoading(this, lazyNode.index) || lazyNode.node.failedLoad) { return; } if (lazyNode.node.stub && (lazyNode.index < firstRowBlockStart || lazyNode.index > lastRowBlockEnd)) { this.destroyRowAtIndex(lazyNode.index); } }); } getBlocksDistanceFromRow(nodes, otherDisplayIndex) { const blockDistanceToMiddle = {}; nodes.forEach(({ node, index }) => { const [blockStart, blockEnd] = this.getBlockBounds(index); if (blockStart in blockDistanceToMiddle) { return; } const distStart = Math.abs(node.rowIndex - otherDisplayIndex); let distEnd; const lastLazyNode = this.nodeMap.getBy("index", [blockEnd - 1]); if (lastLazyNode) { distEnd = Math.abs(lastLazyNode.node.rowIndex - otherDisplayIndex); } const farthest = distEnd == null || distStart < distEnd ? distStart : distEnd; blockDistanceToMiddle[blockStart] = farthest; }); return Object.entries(blockDistanceToMiddle); } purgeExcessRows() { this.purgeStubsOutsideOfViewport(); if (this.store.getDisplayIndexEnd() == null || this.storeParams.maxBlocksInCache == null) { return; } const { firstRenderedRow, lastRenderedRow } = this.rowRenderer; const allLoadedBlocks = /* @__PURE__ */ new Set(); const blocksInViewport = /* @__PURE__ */ new Set(); this.nodeMap.forEach(({ index, node }) => { const blockStart = this.getBlockStartIndex(index); allLoadedBlocks.add(blockStart); const isInViewport = node.rowIndex >= firstRenderedRow && node.rowIndex <= lastRenderedRow; if (isInViewport) { blocksInViewport.add(blockStart); } }); const numberOfBlocksToRetain = Math.max(blocksInViewport.size, this.storeParams.maxBlocksInCache ?? 0); const loadedBlockCount = allLoadedBlocks.size; const blocksToRemove = loadedBlockCount - numberOfBlocksToRetain; if (blocksToRemove <= 0) { return; } let firstRowBlockStart = Number.MAX_SAFE_INTEGER; let lastRowBlockStart = Number.MIN_SAFE_INTEGER; blocksInViewport.forEach((blockStart) => { if (firstRowBlockStart > blockStart) { firstRowBlockStart = blockStart; } if (lastRowBlockStart < blockStart) { lastRowBlockStart = blockStart; } }); const disposableNodes = this.nodeMap.filter(({ node, index }) => { const rowBlockStart = this.getBlockStartIndex(index); const rowBlockInViewport = rowBlockStart >= firstRowBlockStart && rowBlockStart <= lastRowBlockStart; return !rowBlockInViewport && !this.isNodeCached(node); }); if (disposableNodes.length === 0) { return; } const midViewportRow = firstRenderedRow + (lastRenderedRow - firstRenderedRow) / 2; const blockDistanceArray = this.getBlocksDistanceFromRow(disposableNodes, midViewportRow); const blockSize = this.getBlockSize(); blockDistanceArray.sort((a, b) => Math.sign(b[1] - a[1])); for (let i = 0; i < Math.min(blocksToRemove, blockDistanceArray.length); i++) { const blockStart = Number(blockDistanceArray[i][0]); for (let x = blockStart; x < blockStart + blockSize; x++) { const lazyNode = this.nodeMap.getBy("index", x); if (!lazyNode || this.isNodeCached(lazyNode.node)) { continue; } this.destroyRowAtIndex(x); } } } isNodeFocused(node) { const focusedCell = this.focusSvc.getFocusCellToUseAfterRefresh(); if (!focusedCell) { return false; } if (focusedCell.rowPinned != null) { return false; } const hasFocus = focusedCell.rowIndex === node.rowIndex; return hasFocus; } isNodeCached(node) { const isExpandedGroup = node.isExpandable() && node.expanded; const isUnbalancedNode = this.gos.get("groupAllowUnbalanced") && node.key === ""; const isEditing2 = !!this.beans.editSvc?.isRowEditing(node); return isExpandedGroup || this.isNodeFocused(node) || isUnbalancedNode || isEditing2; } extractDuplicateIds(rows) { if (this.getRowIdFunc == null) { return []; } const newIds = /* @__PURE__ */ new Set(); const duplicates = /* @__PURE__ */ new Set(); rows.forEach((data) => { const id = this.getRowId(data); if (newIds.has(id)) { duplicates.add(id); return; } newIds.add(id); }); return [...duplicates]; } onLoadSuccess(firstRowIndex, numberOfRowsExpected, response) { if (!this.live) { return; } const info = response.groupLevelInfo; this.store.setStoreInfo(info); if (this.getRowIdFunc != null) { const duplicates = this.extractDuplicateIds(response.rowData); if (duplicates.length > 0) { const duplicateIdText = duplicates.join(", "); _warn(205, { duplicateIdText }); this.onLoadFailed(firstRowIndex, numberOfRowsExpected); return; } } if (response.pivotResultFields) { this.serverSideRowModel.generateSecondaryColumns(response.pivotResultFields); } const wasRefreshing = this.nodesToRefresh.size > 0; response.rowData.forEach((data, responseRowIndex) => { const rowIndex = firstRowIndex + responseRowIndex; const nodeFromCache = this.nodeMap.getBy("index", rowIndex); if (nodeFromCache?.node?.stub) { this.createRowAtIndex(rowIndex, data); return; } if (nodeFromCache && this.doesNodeMatch(data, nodeFromCache.node)) { this.blockUtils.updateDataIntoRowNode(nodeFromCache.node, data); this.nodesToRefresh.delete(nodeFromCache.node); nodeFromCache.node.__needsRefreshWhenVisible = false; return; } this.createRowAtIndex(rowIndex, data); }); if (response.rowCount != void 0 && response.rowCount !== -1) { this.numberOfRows = response.rowCount; this.isLastRowKnown = true; } else if (numberOfRowsExpected > response.rowData.length) { this.numberOfRows = firstRowIndex + response.rowData.length; this.isLastRowKnown = true; } else if (!this.isLastRowKnown) { const lastInferredRow = firstRowIndex + response.rowData.length + 1; if (lastInferredRow > this.numberOfRows) { this.numberOfRows = lastInferredRow; } } if (this.isLastRowKnown) { const lazyNodesAfterStoreEnd = this.nodeMap.filter((lazyNode) => lazyNode.index >= this.numberOfRows); lazyNodesAfterStoreEnd.forEach((lazyNode) => this.destroyRowAtIndex(lazyNode.index)); } this.fireStoreUpdatedEvent(); const finishedRefreshing = this.nodesToRefresh.size === 0; if (wasRefreshing && finishedRefreshing) { this.fireRefreshFinishedEvent(); } } fireRefreshFinishedEvent() { const finishedRefreshing = this.nodesToRefresh.size === 0; if (!finishedRefreshing) { return; } this.removedNodeCache.forEach((node) => { this.blockUtils.destroyRowNode(node); }); this.removedNodeCache = /* @__PURE__ */ new Map(); this.store.fireRefreshFinishedEvent(); } /** * @returns true if all rows are loaded */ isStoreFullyLoaded() { const knowsSize = this.isLastRowKnown; const hasCorrectRowCount = this.nodeMap.getSize() === this.numberOfRows; if (!knowsSize || !hasCorrectRowCount) { return; } if (this.nodesToRefresh.size > 0) { return; } let index = -1; const firstOutOfPlaceNode = this.nodeMap.find((lazyNode) => { index += 1; if (lazyNode.index !== index) { return true; } if (lazyNode.node.__needsRefreshWhenVisible) { return true; } if (lazyNode.node.stub) { return true; } return false; }); return firstOutOfPlaceNode == null; } isLastRowIndexKnown() { return this.isLastRowKnown; } onLoadFailed(firstRowIndex, numberOfRowsExpected) { if (!this.live) { return; } const wasRefreshing = this.nodesToRefresh.size > 0; for (let i = firstRowIndex; i < firstRowIndex + numberOfRowsExpected && i < this.getRowCount(); i++) { let { node } = this.nodeMap.getBy("index", i) ?? {}; if (node) { this.nodesToRefresh.delete(node); } if (!node?.stub) { if (node && !node.stub) { this.destroyRowAtIndex(i); } node = this.createRowAtIndex(i); } node.__needsRefreshWhenVisible = false; node.failedLoad = true; } const finishedRefreshing = this.nodesToRefresh.size === 0; if (wasRefreshing && finishedRefreshing) { this.fireRefreshFinishedEvent(); } this.fireStoreUpdatedEvent(); } markNodesForRefresh() { this.nodeMap.forEach((lazyNode) => { if (lazyNode.node.stub && !lazyNode.node.failedLoad) { return; } this.nodesToRefresh.add(lazyNode.node); }); this.lazyBlockLoadingSvc.queueLoadCheck(); if (this.isLastRowKnown && this.numberOfRows === 0) { this.numberOfRows = 1; this.isLastRowKnown = false; this.fireStoreUpdatedEvent(); } } isNodeInCache(id) { return !!this.nodeMap.getBy("id", id); } // gets called 1) row count changed 2) cache purged 3) items inserted fireStoreUpdatedEvent() { if (!this.live) { return; } this.store.fireStoreUpdatedEvent(); } getRowId(data) { if (this.getRowIdFunc == null) { return null; } const { level } = this.store.getRowDetails(); const parentKeys = this.store.getParentNode().getRoute() ?? []; return this.getRowIdFunc({ data, parentKeys: parentKeys.length > 0 ? parentKeys : void 0, level }); } getOrderedNodeMap() { const obj = {}; this.nodeMap.forEach((node) => obj[node.index] = node); return obj; } clearDisplayIndexes() { this.nodeDisplayIndexMap.clear(); } /** * Client side sorting */ clientSideSortRows() { const sortOptions = this.sortSvc?.getSortOptions() ?? []; const isAnySort = sortOptions.some((opt) => opt.sort != null); const rowNodeSorter = this.rowNodeSorter; if (!isAnySort || !rowNodeSorter) { return; } const allNodes = new Array(this.nodeMap.getSize()); const nodesMap = this.nodeMap; nodesMap.forEach((lazyNode) => allNodes[lazyNode.index] = lazyNode.node); nodesMap.clear(); const sortedNodes = rowNodeSorter.doFullSortInPlace(allNodes, sortOptions); for (let i = 0, len = sortedNodes.length; i < len; ++i) { const node = sortedNodes[i]; nodesMap.set({ id: node.id, node, index: i }); } } /** * Transaction Support here */ updateRowNodes(updates) { const updatedNodes = []; updates.forEach((data) => { const id = this.getRowId(data); const lazyNode = this.nodeMap.getBy("id", id); if (lazyNode) { this.blockUtils.updateDataIntoRowNode(lazyNode.node, data); updatedNodes.push(lazyNode.node); } }); return updatedNodes; } insertRowNodes(inserts, indexToAdd) { const realRowCount = this.store.getRowCount() - (this.store.getParentNode().sibling ? 1 : 0); const addIndex = indexToAdd == null && this.isLastRowKnown ? realRowCount : indexToAdd; if (addIndex == null || realRowCount < addIndex) { return []; } const uniqueInsertsMap = {}; inserts.forEach((data) => { const dataId = this.getRowId(data); if (dataId && this.isNodeInCache(dataId)) { return; } uniqueInsertsMap[dataId] = data; }); const uniqueInserts = Object.values(uniqueInsertsMap); const numberOfInserts = uniqueInserts.length; if (numberOfInserts === 0) { return []; } const nodesToMove = this.nodeMap.filter((node) => node.index >= addIndex); nodesToMove.forEach((lazyNode) => this.nodeMap.delete(lazyNode)); nodesToMove.forEach((lazyNode) => { this.nodeMap.set({ node: lazyNode.node, index: lazyNode.index + numberOfInserts, id: lazyNode.id }); }); this.numberOfRows += numberOfInserts; return uniqueInserts.map( (data, uniqueInsertOffset) => this.createRowAtIndex(addIndex + uniqueInsertOffset, data) ); } removeRowNodes(idsToRemove, newRowCount) { const removedNodes = []; const nodesToVerify = []; let deletedNodeCount = 0; const remainingIdsToRemove = [...idsToRemove]; const allNodes = this.getOrderedNodeMap(); let contiguousIndex = -1; for (const stringIndex of Object.keys(allNodes)) { contiguousIndex += 1; const node = allNodes[stringIndex]; const matchIndex = remainingIdsToRemove.findIndex((idToRemove) => idToRemove === node.id); if (matchIndex !== -1) { remainingIdsToRemove.splice(matchIndex, 1); this.destroyRowAtIndex(Number(stringIndex)); removedNodes.push(node.node); deletedNodeCount += 1; continue; } if (deletedNodeCount === 0) { continue; } const numericStoreIndex = Number(stringIndex); if (contiguousIndex !== numericStoreIndex) { nodesToVerify.push(node.node); } this.nodeMap.delete(node); this.nodeMap.set({ id: node.id, node: node.node, index: numericStoreIndex - deletedNodeCount }); } const isNewRowCountValid = newRowCount != null && newRowCount >= 0; if (isNewRowCountValid) { this.numberOfRows = newRowCount; this.isLastRowKnown = true; } else { this.numberOfRows -= deletedNodeCount; } if (remainingIdsToRemove.length > 0 && nodesToVerify.length > 0) { nodesToVerify.forEach((node) => node.__needsRefreshWhenVisible = true); this.lazyBlockLoadingSvc.queueLoadCheck(); } return removedNodes; } /** * Return the block size configured for this cache */ getBlockSize() { return this.storeParams.cacheBlockSize || DEFAULT_BLOCK_SIZE; } /** * Get the start index of the loading block for a given index */ getBlockStartIndex(storeIndex) { const blockSize = this.getBlockSize(); return storeIndex - storeIndex % blockSize; } /** * Get the start and end index of a block, given a row store index */ getBlockBounds(storeIndex) { const startOfBlock = this.getBlockStartIndex(storeIndex); const blockSize = this.getBlockSize(); return [startOfBlock, startOfBlock + blockSize]; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/lazy/lazyStore.ts var LazyStore = class extends BeanStub { constructor(ssrmParams, storeParams, parentRowNode) { super(); this.idSequence = { value: 0 }; this.ssrmParams = ssrmParams; this.parentRowNode = parentRowNode; this.storeParams = storeParams; this.level = parentRowNode.level + 1; this.group = ssrmParams.rowGroupCols ? this.level < ssrmParams.rowGroupCols.length : false; this.leafGroup = ssrmParams.rowGroupCols ? this.level === ssrmParams.rowGroupCols.length - 1 : false; this.info = {}; } wireBeans(beans) { this.blockUtils = beans.ssrmBlockUtils; this.storeUtils = beans.ssrmStoreUtils; this.selectionSvc = beans.selectionSvc; this.rowGroupColsSvc = beans.rowGroupColsSvc; } postConstruct() { let numberOfRows = 1; if (this.level === 0) { numberOfRows = this.storeUtils.getServerSideInitialRowCount() ?? 1; this.eventSvc.dispatchEventOnce({ type: "rowCountReady" }); } this.cache = this.createManagedBean(new LazyCache(this, numberOfRows, false, this.storeParams)); const usingTreeData = this.gos.get("treeData"); if (!usingTreeData && this.group && this.rowGroupColsSvc) { const groupColVo = this.ssrmParams.rowGroupCols[this.level]; this.groupField = groupColVo.field; this.rowGroupColumn = this.rowGroupColsSvc.columns[this.level]; } } destroy() { this.displayIndexStart = void 0; this.displayIndexEnd = void 0; this.destroyBean(this.cache); super.destroy(); } /** * Given a server response, ingest the rows outside of the data source lifecycle. * * @param rowDataParams the server response containing the rows to ingest * @param startRow the index to start ingesting rows * @param expectedRows the expected number of rows in the response (used to determine if the last row index is known) */ applyRowData(rowDataParams, startRow, expectedRows) { this.cache.onLoadSuccess(startRow, expectedRows, rowDataParams); } /** * Applies a given transaction to the data set within this store * * @param transaction an object containing delta instructions determining the changes to apply to this store * @returns an object determining the status of this transaction and effected nodes */ applyTransaction(transaction) { const idFunc = _getRowIdCallback(this.gos); if (!idFunc) { _warn(206); return { status: ServerSideTransactionResultStatus.Cancelled }; } const applyCallback = this.gos.getCallback("isApplyServerSideTransaction"); if (applyCallback) { const params = { transaction, parentNode: this.parentRowNode, groupLevelInfo: this.info }; const apply = applyCallback(params); if (!apply) { return { status: ServerSideTransactionResultStatus.Cancelled }; } } const allRowsLoaded = this.cache.isStoreFullyLoaded(); let updatedNodes = void 0; if (transaction.update?.length) { updatedNodes = this.cache.updateRowNodes(transaction.update); } let insertedNodes = void 0; if (transaction.add?.length) { let addIndex = transaction.addIndex; if (addIndex != null && addIndex < 0) { addIndex = void 0; } insertedNodes = this.cache.insertRowNodes(transaction.add, addIndex); } let removedNodes = void 0; if (transaction.remove?.length) { const allIdsToRemove = transaction.remove.map( (data) => idFunc({ level: this.level, parentKeys: this.parentRowNode.getRoute() ?? [], data }) ); const allUniqueIdsToRemove = [...new Set(allIdsToRemove)]; removedNodes = this.cache.removeRowNodes(allUniqueIdsToRemove, transaction.rowCount); } const isClientSideSortingEnabled = this.gos.get("serverSideEnableClientSideSort"); const isUpdateOrAdd = updatedNodes?.length || insertedNodes?.length; const isClientSideSort = allRowsLoaded && isClientSideSortingEnabled; if (isClientSideSort && isUpdateOrAdd) { this.cache.clientSideSortRows(); } this.updateSelectionAfterTransaction(updatedNodes, removedNodes); return { status: ServerSideTransactionResultStatus.Applied, update: updatedNodes, add: insertedNodes, remove: removedNodes }; } updateSelectionAfterTransaction(updatedNodes, removedNodes) { if (!this.selectionSvc) { return; } const nodesToDeselect = []; for (const node of updatedNodes ?? []) { if (node.isSelected() && !node.selectable) { nodesToDeselect.push(node); } } for (const node of removedNodes ?? []) { if (node.isSelected()) { nodesToDeselect.push(node); } } if (nodesToDeselect.length) { this.selectionSvc.setNodesSelected({ newValue: false, clearSelection: false, nodes: nodesToDeselect, source: "rowDataChanged" }); } } /** * Clear the display indexes, used for fading rows out when stores are not being destroyed */ clearDisplayIndexes() { this.displayIndexStart = void 0; this.displayIndexEnd = void 0; this.cache.getNodes().forEach((lazyNode) => this.blockUtils.clearDisplayIndex(lazyNode.node)); if (this.parentRowNode.sibling) { this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling); } this.cache.clearDisplayIndexes(); } /** * @returns an index representing the last sequentially displayed row in the grid for this store */ getDisplayIndexStart() { return this.displayIndexStart; } /** * @returns the index representing one after the last sequentially displayed row in the grid for this store */ getDisplayIndexEnd() { return this.displayIndexEnd; } /** * @returns the virtual size of this store */ getRowCount() { if (this.parentRowNode.sibling) { return this.cache.getRowCount() + 1; } return this.cache.getRowCount(); } /** * Sets the current row count of the store, and whether the last row index is known */ setRowCount(rowCount, isLastRowIndexKnown2) { this.cache.setRowCount(rowCount, isLastRowIndexKnown2); } /** * Given a display index, returns whether that row is within this store or a child store of this store * * @param displayIndex the visible index of a row * @returns whether or not the row exists within this store */ isDisplayIndexInStore(displayIndex) { if (this.cache.getRowCount() === 0) { return false; } return this.displayIndexStart <= displayIndex && displayIndex < this.getDisplayIndexEnd(); } /** * Recursively sets up the display indexes and top position of every node belonging to this store. * * Called after a row height changes, or a store updated event. * * @param displayIndexSeq the number sequence for generating the display index of each row * @param nextRowTop an object containing the next row top value intended to be modified by ref per row */ setDisplayIndexes(displayIndexSeq, nextRowTop, uiLevel) { this.displayIndexStart = displayIndexSeq.value; this.topPx = nextRowTop.value; const footerNode = this.parentRowNode.level > -1 && _getGroupTotalRowCallback(this.gos)({ node: this.parentRowNode }); if (!footerNode) { _destroyRowNodeFooter(this.parentRowNode); } if (footerNode === "top") { _createRowNodeFooter(this.parentRowNode, this.beans); this.blockUtils.setDisplayIndex(this.parentRowNode.sibling, displayIndexSeq, nextRowTop, uiLevel); } this.cache.setDisplayIndexes(displayIndexSeq, nextRowTop, uiLevel); if (footerNode === "bottom") { _createRowNodeFooter(this.parentRowNode, this.beans); this.blockUtils.setDisplayIndex(this.parentRowNode.sibling, displayIndexSeq, nextRowTop, uiLevel); } this.displayIndexEnd = displayIndexSeq.value; this.heightPx = nextRowTop.value - this.topPx; } /** * Recursively applies a provided function to every node * * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeepAfterFilterAndSort */ forEachStoreDeep(callback, sequence = { value: 0 }) { callback(this, sequence.value++); this.cache.getNodes().forEach((lazyNode) => { const childCache = lazyNode.node.childStore; if (childCache) { childCache.forEachStoreDeep(callback, sequence); } }); } /** * Recursively applies a provided function to every node * * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeepAfterFilterAndSort */ forEachNodeDeep(callback, sequence = { value: 0 }) { this.cache.getNodes().forEach((lazyNode) => { callback(lazyNode.node, sequence.value++); const childCache = lazyNode.node.childStore; if (childCache) { childCache.forEachNodeDeep(callback, sequence); } }); } /** * Recursively applies a provided function to every node * * For the purpose of exclusively server side filtered stores, this is the same as getNodes().forEachDeep */ forEachNodeDeepAfterFilterAndSort(callback, sequence = { value: 0 }, includeFooterNodes = false) { const footerNode = this.parentRowNode.level > -1 && _getGroupTotalRowCallback(this.gos)({ node: this.parentRowNode }); if (footerNode === "top") { callback(this.parentRowNode.sibling, sequence.value++); } const orderedNodes = this.cache.getOrderedNodeMap(); for (const lazyNode of Object.values(orderedNodes)) { callback(lazyNode.node, sequence.value++); const childCache = lazyNode.node.childStore; if (childCache) { childCache.forEachNodeDeepAfterFilterAndSort(callback, sequence, includeFooterNodes); } } if (footerNode === "bottom") { callback(this.parentRowNode.sibling, sequence.value++); } } /** * Removes the failed status from all nodes, and marks them as stub to encourage reloading */ retryLoads() { this.cache.getNodes().forEach(({ node }) => { if (node.failedLoad) { node.failedLoad = false; node.__needsRefreshWhenVisible = true; node.stub = true; } }); this.forEachChildStoreShallow((store) => store.retryLoads()); this.fireStoreUpdatedEvent(); } /** * Given a display index, returns the row at that location. * * @param displayRowIndex the displayed index within the grid to search for * @returns the row node if the display index falls within the store, if it didn't exist this will create a new stub to return */ getRowUsingDisplayIndex(displayRowIndex) { if (this.parentRowNode.sibling && displayRowIndex === this.parentRowNode.sibling.rowIndex) { return this.parentRowNode.sibling; } return this.cache.getRowByDisplayIndex(displayRowIndex); } /** * Given a display index, returns the row top and height for the row at that index. * * @param displayIndex the display index of the node * @returns an object containing the rowTop and rowHeight of the node at the given displayIndex */ getRowBounds(displayIndex) { if (!this.isDisplayIndexInStore(displayIndex)) { return null; } const thisNode = this.cache.getNodeCachedByDisplayIndex(displayIndex); if (thisNode) { const boundsFromRow = this.blockUtils.extractRowBounds(thisNode, displayIndex); if (boundsFromRow) { return boundsFromRow; } } const { previousNode, nextNode } = this.cache.getSurroundingNodesByDisplayIndex(displayIndex) ?? {}; if (previousNode) { const boundsFromRow = this.blockUtils.extractRowBounds(previousNode.node, displayIndex); if (boundsFromRow != null) { return boundsFromRow; } } const defaultRowHeight = _getRowHeightAsNumber(this.beans); if (nextNode) { const numberOfRowDiff2 = (nextNode.node.rowIndex - displayIndex) * defaultRowHeight; return { rowTop: nextNode.node.rowTop - numberOfRowDiff2, rowHeight: defaultRowHeight }; } const lastTop = this.topPx + this.heightPx; const numberOfRowDiff = (this.getDisplayIndexEnd() - displayIndex) * defaultRowHeight; return { rowTop: lastTop - numberOfRowDiff, rowHeight: defaultRowHeight }; } /** * Given a vertical pixel, determines whether this store contains a row at that pixel * * @param pixel a vertical pixel position from the grid * @returns whether that pixel points to a virtual space belonging to this store */ isPixelInRange(pixel) { return pixel >= this.topPx && pixel < this.topPx + this.heightPx; } /** * Given a vertical pixel, returns the row existing at that pixel location * * @param pixel a vertical pixel position from the grid * @returns the display index at the given pixel location */ getRowIndexAtPixel(pixel) { if (pixel < this.topPx) { return this.getDisplayIndexStart(); } if (pixel >= this.topPx + this.heightPx) { return this.getDisplayIndexEnd() - 1; } if (this.parentRowNode.sibling && pixel > this.parentRowNode.sibling.rowTop && pixel < this.parentRowNode.sibling.rowTop + this.parentRowNode.sibling.rowHeight) { return this.parentRowNode.sibling.rowIndex; } let distToPreviousNodeTop = Number.MAX_SAFE_INTEGER; let previousNode = null; let distToNextNodeTop = Number.MAX_SAFE_INTEGER; let nextNode = null; this.cache.getNodes().forEach(({ node }) => { const distBetween = Math.abs(pixel - node.rowTop); if (node.rowTop < pixel) { if (distBetween < distToPreviousNodeTop) { distToPreviousNodeTop = distBetween; previousNode = node; } return; } if (distBetween < distToNextNodeTop) { distToNextNodeTop = distBetween; nextNode = node; } }); previousNode = previousNode; nextNode = nextNode; if (previousNode) { const indexOfRow = this.blockUtils.getIndexAtPixel(previousNode, pixel); if (indexOfRow != null) { return indexOfRow; } } const defaultRowHeight = _getRowHeightAsNumber(this.beans); if (nextNode) { const nextTop2 = nextNode.rowTop; const numberOfRowDiff2 = Math.ceil((nextTop2 - pixel) / defaultRowHeight); return nextNode.rowIndex - numberOfRowDiff2; } const nextTop = this.topPx + this.heightPx; const numberOfRowDiff = Math.floor((nextTop - pixel) / defaultRowHeight); return this.getDisplayIndexEnd() - numberOfRowDiff; } /** * Given a path of group keys, returns the child store for that group. * * @param keys the grouping path to the desired store * @returns the child store for the given keys, or null if not found */ getChildStore(keys) { return this.storeUtils.getChildStore(keys, this, (key) => { const lazyNode = this.cache.getNodes().find((lazyNode2) => lazyNode2.node.key == key); if (!lazyNode) { return null; } return lazyNode.node; }); } /** * Executes a provided callback on each child store belonging to this store * * @param cb the callback to execute */ forEachChildStoreShallow(cb) { this.cache.getNodes().forEach(({ node }) => { if (node.childStore) { cb(node.childStore); } }); } /** * Executes after a change to sorting, determines recursively whether this store or a child requires refreshed. * * If a purge refresh occurs, the row count is preserved. * * @param params a set of properties pertaining to the sort changes */ refreshAfterSort(params) { const serverSortsAllLevels = this.storeUtils.isServerSideSortAllLevels(); if (serverSortsAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) { const allRowsLoaded = this.cache.isStoreFullyLoaded(); const isClientSideSortingEnabled = this.gos.get("serverSideEnableClientSideSort"); const isClientSideSort = allRowsLoaded && isClientSideSortingEnabled; if (!isClientSideSort) { const oldCount = this.cache.getRowCount(); const lastKnown = this.cache.isLastRowIndexKnown(); this.destroyBean(this.cache); this.cache = this.createManagedBean(new LazyCache(this, oldCount, lastKnown, this.storeParams)); return; } this.cache.clientSideSortRows(); } this.forEachChildStoreShallow((store) => store.refreshAfterSort(params)); } /** * Executes after a change to filtering, determines recursively whether this store or a child requires refreshed. * * If a refresh occurs, the row count is reset. * * @param params a set of properties pertaining to the filter changes */ refreshAfterFilter(params) { const serverFiltersAllLevels = !this.storeUtils.isServerSideOnlyRefreshFilteredGroups(); if (serverFiltersAllLevels || this.storeUtils.isServerRefreshNeeded(this.parentRowNode, this.ssrmParams.rowGroupCols, params)) { this.refreshStore(true); return; } this.forEachChildStoreShallow((store) => store.refreshAfterFilter(params)); } /** * Marks all existing nodes as requiring reloaded, and triggers a load check * * @param purge whether to remove all nodes and data in favour of stub nodes */ refreshStore(purge) { if (purge) { this.destroyBean(this.cache); this.cache = this.createManagedBean(new LazyCache(this, 1, false, this.storeParams)); this.fireStoreUpdatedEvent(); return; } this.cache.markNodesForRefresh(); } /** * Used for pagination, given a local/store index, returns the display index of that row * * @param topLevelIndex the store index of a row * @returns the display index for the given store index */ getTopLevelRowDisplayedIndex(topLevelIndex) { const displayIndex = this.cache.getDisplayIndexFromStoreIndex(topLevelIndex); return displayIndex ?? topLevelIndex; } /** * Used for pagination to determine if the last page is known, and for aria to determine if the last grid row is known * * @returns whether the last index of this store is known, or if lazy loading still required */ isLastRowIndexKnown() { return this.cache.isLastRowIndexKnown(); } /** * Used by the selection service to select a range of nodes * * @param firstInRange the first node in the range to find * @param lastInRange the last node in the range to find * @returns a range of nodes between firstInRange and lastInRange inclusive */ getRowNodesInRange(firstInRange, lastInRange) { return this.cache.getNodes().filter(({ node }) => { return node.rowIndex >= firstInRange.rowIndex && node.rowIndex <= lastInRange.rowIndex; }).map(({ node }) => node); } /** * Mutates a given array to add this stores state, and recursively add all the children store states. * * @param result a mutable results array */ addStoreStates(result) { result.push({ route: this.parentRowNode.getRoute() ?? [], rowCount: this.getRowCount(), lastRowIndexKnown: this.isLastRowIndexKnown(), info: this.info, maxBlocksInCache: this.storeParams.maxBlocksInCache, cacheBlockSize: this.storeParams.cacheBlockSize }); this.forEachChildStoreShallow((childStore) => childStore.addStoreStates(result)); } getIdSequence() { return this.idSequence; } getParentNode() { return this.parentRowNode; } getRowDetails() { return { field: this.groupField, group: this.group, leafGroup: this.leafGroup, level: this.level, parent: this.parentRowNode, rowGroupColumn: this.rowGroupColumn }; } getSsrmParams() { return this.ssrmParams; } setStoreInfo(info) { if (info) { Object.assign(this.info, info); } } // gets called 1) row count changed 2) cache purged fireStoreUpdatedEvent() { this.eventSvc.dispatchEvent({ type: "storeUpdated" }); } // gets called when row data updated, and no more refreshing needed fireRefreshFinishedEvent() { this.eventSvc.dispatchEvent({ type: "storeRefreshed", route: this.parentRowNode.getRoute() }); } getBlockStates() { return this.cache.getBlockStates(); } getStoreBounds() { return { topPx: this.topPx, heightPx: this.heightPx }; } getCache() { return this.cache; } getFirstNode() { const firstNode = this.cache.getNodes().getBy("index", 0); return firstNode?.node ?? null; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/storeFactory.ts var StoreFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmStoreFactory"; } wireBeans(beans) { this.colModel = beans.colModel; this.rowGroupColsSvc = beans.rowGroupColsSvc; this.pivotColsSvc = beans.pivotColsSvc; this.rowAutoHeight = beans.rowAutoHeight; } createStore(ssrmParams, parentNode) { const storeParams = this.getStoreParams(ssrmParams, parentNode); return new LazyStore(ssrmParams, storeParams, parentNode); } getStoreParams(ssrmParams, parentNode) { const userStoreParams = this.getLevelSpecificParams(parentNode); const cacheBlockSize = this.getBlockSize(userStoreParams); const maxBlocksInCache = this.getMaxBlocksInCache(ssrmParams, userStoreParams); const storeParams = { cacheBlockSize, maxBlocksInCache }; return storeParams; } getMaxBlocksInCache(ssrmParams, userStoreParams) { const maxBlocksInCache = userStoreParams?.maxBlocksInCache != null ? userStoreParams.maxBlocksInCache : this.gos.get("maxBlocksInCache"); const maxBlocksActive = maxBlocksInCache != null && maxBlocksInCache >= 0; if (!maxBlocksActive) { return; } if (ssrmParams.dynamicRowHeight) { _warn(203); return; } if (this.rowAutoHeight?.active) { _warn(204); return void 0; } return maxBlocksInCache; } getBlockSize(userStoreParams) { const blockSize = userStoreParams?.cacheBlockSize != null ? userStoreParams.cacheBlockSize : this.gos.get("cacheBlockSize"); if (blockSize != null && blockSize > 0) { return blockSize; } else { return 100; } } getLevelSpecificParams(parentNode) { const callback = this.gos.getCallback("getServerSideGroupLevelParams"); if (!callback) { return void 0; } const params = { level: parentNode.level + 1, parentRowNode: parentNode.level >= 0 ? parentNode : void 0, rowGroupColumns: this.rowGroupColsSvc?.columns ?? [], pivotColumns: this.pivotColsSvc?.columns ?? [], pivotMode: this.colModel.isPivotMode() }; const res = callback(params); return res; } }; // packages/ag-grid-enterprise/src/serverSideRowModel/stores/storeUtils.ts var StoreUtils = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmStoreUtils"; } wireBeans(beans) { this.colModel = beans.colModel; this.serverSideRowModel = beans.rowModel; this.storeFactory = beans.ssrmStoreFactory; } getChildStore(keys, currentCache, findNodeFunc) { if (!keys?.length) { return currentCache; } const nextKey = keys[0]; const nextNode = findNodeFunc(nextKey); if (nextNode) { if (keys.length === 1 && !nextNode.childStore) { const storeParams = this.serverSideRowModel.getParams(); nextNode.childStore = this.createBean(this.storeFactory.createStore(storeParams, nextNode)); } const keyListForNextLevel = keys.slice(1, keys.length); const nextStore = nextNode.childStore; return nextStore ? nextStore.getChildStore(keyListForNextLevel) : null; } return null; } isServerRefreshNeeded(parentRowNode, rowGroupCols, params) { if (params.valueColChanged || params.secondaryColChanged) { return true; } const level = parentRowNode.level + 1; const grouping = level < rowGroupCols.length; const leafNodes = !grouping; if (leafNodes) { return true; } const colIdThisGroup = rowGroupCols[level].id; const actionOnThisGroup = params.changedColumns.indexOf(colIdThisGroup) > -1; if (actionOnThisGroup) { return true; } const allCols = this.colModel.getCols(); const affectedGroupCols = allCols.filter((col) => col.getColDef().showRowGroup && params.changedColumns.includes(col.getId())).map((col) => col.getColDef().showRowGroup).some((group) => group === true || group === colIdThisGroup); return affectedGroupCols; } getServerSideInitialRowCount() { return this.gos.get("serverSideInitialRowCount"); } isServerSideSortAllLevels() { return this.gos.get("serverSideSortAllLevels") && _isServerSideRowModel(this.gos); } isServerSideOnlyRefreshFilteredGroups() { return this.gos.get("serverSideOnlyRefreshFilteredGroups") && _isServerSideRowModel(this.gos); } }; // packages/ag-grid-enterprise/src/serverSideRowModel/transactionManager.ts var TransactionManager = class extends BeanStub { constructor() { super(...arguments); this.beanName = "ssrmTxnManager"; this.asyncTransactions = []; } wireBeans(beans) { this.valueCache = beans.valueCache; this.serverSideRowModel = beans.rowModel; this.selectionSvc = beans.selectionSvc; } applyTransactionAsync(transaction, callback) { if (this.asyncTransactionsTimeout == null) { this.scheduleExecuteAsync(); } this.asyncTransactions.push({ transaction, callback }); } scheduleExecuteAsync() { const waitMillis = this.gos.get("asyncTransactionWaitMillis"); this.asyncTransactionsTimeout = window.setTimeout(() => { this.executeAsyncTransactions(); }, waitMillis); } executeAsyncTransactions() { if (!this.asyncTransactions) { return; } const resultFuncs = []; const resultsForEvent = []; const transactionsToRetry = []; let atLeastOneTransactionApplied = false; for (const txWrapper of this.asyncTransactions) { let result; const hasStarted = this.serverSideRowModel.executeOnStore(txWrapper.transaction.route, (cache) => { result = cache.applyTransaction(txWrapper.transaction); }); if (!hasStarted) { result = { status: ServerSideTransactionResultStatus.StoreNotStarted }; } else if (result == void 0) { result = { status: ServerSideTransactionResultStatus.StoreNotFound }; } resultsForEvent.push(result); const retryTransaction = result.status == ServerSideTransactionResultStatus.StoreLoading; if (retryTransaction) { transactionsToRetry.push(txWrapper); continue; } if (txWrapper.callback) { resultFuncs.push(() => txWrapper.callback(result)); } if (result.status === ServerSideTransactionResultStatus.Applied) { atLeastOneTransactionApplied = true; } } if (resultFuncs.length > 0) { window.setTimeout(() => { for (const func of resultFuncs) { func(); } }, 0); } this.asyncTransactionsTimeout = void 0; this.asyncTransactions = transactionsToRetry; if (atLeastOneTransactionApplied) { this.valueCache?.onDataChanged(); this.eventSvc.dispatchEvent({ type: "storeUpdated" }); } if (resultsForEvent.length > 0) { this.eventSvc.dispatchEvent({ type: "asyncTransactionsFlushed", results: resultsForEvent }); } } flushAsyncTransactions() { if (this.asyncTransactionsTimeout != null) { clearTimeout(this.asyncTransactionsTimeout); } this.executeAsyncTransactions(); } applyTransaction(transaction) { let res; const hasStarted = this.serverSideRowModel.executeOnStore(transaction.route, (store) => { res = store.applyTransaction(transaction); }); if (!hasStarted) { return { status: ServerSideTransactionResultStatus.StoreNotStarted }; } else if (res) { this.valueCache?.onDataChanged(); if (res.remove && this.selectionSvc) { const removedRowIds = res.remove.map((row) => row.id); this.selectionSvc.deleteSelectionStateFromParent(transaction.route || [], removedRowIds); } this.eventSvc.dispatchEvent({ type: "storeUpdated" }); return res; } else { return { status: ServerSideTransactionResultStatus.StoreNotFound }; } } }; // packages/ag-grid-enterprise/src/serverSideRowModel/serverSideRowModelModule.ts var ServerSideRowModelModule = { moduleName: "ServerSideRowModel", version: VERSION2, rowModels: ["serverSide"], beans: [ ServerSideRowModel, ExpandListener, StoreUtils, BlockUtils, NodeManager, TransactionManager, FilterListener, StoreFactory, ListenerUtils, ServerSideSelectionService, LazyBlockLoadingService, SsrmRowChildrenService, ServerSideExpansionService, SortListener ], dependsOn: [ EnterpriseCoreModule, SortModule, SharedRowSelectionModule, SharedPivotModule, SharedTreeDataModule, LoadingCellRendererModule ] }; var ServerSideRowModelApiModule = { moduleName: "ServerSideRowModelApi", version: VERSION2, apiFunctions: { getServerSideSelectionState, setServerSideSelectionState, applyServerSideTransaction, applyServerSideTransactionAsync, applyServerSideRowData, retryServerSideLoads, flushServerSideAsyncTransactions, refreshServerSide, getServerSideGroupLevelState, resetRowHeights, onRowHeightChanged }, dependsOn: [EnterpriseCoreModule, RowModelSharedApiModule, CsrmSsrmSharedApiModule, SsrmInfiniteSharedApiModule] }; // packages/ag-grid-enterprise/src/formula/refUtils.ts var CELL_OR_RANGE_REGEX = /\$?[A-Za-z]+\$?[0-9]+(?::\$?[A-Za-z]+\$?[0-9]+)?/g; var FULL_CELL_OR_RANGE_REGEX = /^(\$?)([A-Za-z]+)(\$?)([0-9]+)(?::(\$?)([A-Za-z]+)(\$?)([0-9]+))?$/; var WORD_CHAR_REGEX = /[A-Za-z0-9]/; var isFormulaIdentChar = (char) => { return !!char && WORD_CHAR_REGEX.test(char); }; var isFormulaIdentStart = (char) => { return !!char && /[A-Za-z]/.test(char); }; var isWordChar = (char) => { return isFormulaIdentChar(char ?? void 0); }; var isStandaloneRefToken = (text, matchIndex, ref) => { const prevChar = matchIndex > 0 ? text[matchIndex - 1] : null; if (isWordChar(prevChar)) { return false; } if (ref.endsWith(":")) { return true; } const nextIndex = matchIndex + ref.length; const nextChar = nextIndex < text.length ? text[nextIndex] : null; return !isWordChar(nextChar); }; var parseA1Ref = (ref, options = {}) => { const allowTrailingColon = options.allowTrailingColon ?? false; const normalizedRef = allowTrailingColon && ref.endsWith(":") ? ref.slice(0, -1) : ref; const match = FULL_CELL_OR_RANGE_REGEX.exec(normalizedRef); if (!match) { return null; } const [, absCol1, col1, absRow1, row1, absCol2, col2, absRow2, row2] = match; const hasEnd = !!(col2 && row2); return { startCol: col1, startRow: row1, startColAbsolute: absCol1 === "$", startRowAbsolute: absRow1 === "$", ...hasEnd ? { endCol: col2, endRow: row2, endColAbsolute: absCol2 === "$", endRowAbsolute: absRow2 === "$" } : null }; }; var getRefTokenMatches = (text) => { const matches = []; let match; let index = 0; CELL_OR_RANGE_REGEX.lastIndex = 0; while ((match = CELL_OR_RANGE_REGEX.exec(text)) != null) { let ref = match[0]; const start = match.index ?? 0; const endIndex = start + ref.length; if (endIndex < text.length && text[endIndex] === ":") { ref += ":"; } if (!isStandaloneRefToken(text, start, ref)) { continue; } matches.push({ ref, start, end: start + ref.length, index }); index += 1; } return matches; }; // packages/ag-grid-enterprise/src/widgets/agFormulaInputField.css var agFormulaInputField_default = ".ag-formula-token{line-height:var(--ag-line-height,1.6)}.ag-formula-token-color-1{color:var(--ag-formula-token-1-color)}.ag-formula-token-color-2{color:var(--ag-formula-token-2-color)}.ag-formula-token-color-3{color:var(--ag-formula-token-3-color)}.ag-formula-token-color-4{color:var(--ag-formula-token-4-color)}.ag-formula-token-color-5{color:var(--ag-formula-token-5-color)}.ag-formula-token-color-6{color:var(--ag-formula-token-6-color)}.ag-formula-token-color-7{color:var(--ag-formula-token-7-color)}.ag-formula-range-color-1{--ag-range-selection-border-color:var(--ag-formula-token-1-color);--ag-range-selection-background-color:var(--ag-formula-token-1-background-color)}.ag-formula-range-color-2{--ag-range-selection-border-color:var(--ag-formula-token-2-color);--ag-range-selection-background-color:var(--ag-formula-token-2-background-color)}.ag-formula-range-color-3{--ag-range-selection-border-color:var(--ag-formula-token-3-color);--ag-range-selection-background-color:var(--ag-formula-token-3-background-color)}.ag-formula-range-color-4{--ag-range-selection-border-color:var(--ag-formula-token-4-color);--ag-range-selection-background-color:var(--ag-formula-token-4-background-color)}.ag-formula-range-color-5{--ag-range-selection-border-color:var(--ag-formula-token-5-color);--ag-range-selection-background-color:var(--ag-formula-token-5-background-color)}.ag-formula-range-color-6{--ag-range-selection-border-color:var(--ag-formula-token-6-color);--ag-range-selection-background-color:var(--ag-formula-token-6-background-color)}.ag-formula-range-color-7{--ag-range-selection-border-color:var(--ag-formula-token-7-color);--ag-range-selection-background-color:var(--ag-formula-token-7-background-color)}.ag-fill-handle.ag-formula-range-color-1,.ag-range-handle.ag-formula-range-color-1{background-color:var(--ag-formula-token-1-color)}.ag-fill-handle.ag-formula-range-color-2,.ag-range-handle.ag-formula-range-color-2{background-color:var(--ag-formula-token-2-color)}.ag-fill-handle.ag-formula-range-color-3,.ag-range-handle.ag-formula-range-color-3{background-color:var(--ag-formula-token-3-color)}.ag-fill-handle.ag-formula-range-color-4,.ag-range-handle.ag-formula-range-color-4{background-color:var(--ag-formula-token-4-color)}.ag-fill-handle.ag-formula-range-color-5,.ag-range-handle.ag-formula-range-color-5{background-color:var(--ag-formula-token-5-color)}.ag-fill-handle.ag-formula-range-color-6,.ag-range-handle.ag-formula-range-color-6{background-color:var(--ag-formula-token-6-color)}"; // packages/ag-grid-enterprise/src/widgets/formulaInputTokenUtils.ts var TOKEN_INSERT_AFTER_CHARS = /* @__PURE__ */ new Set(["=", "+", "-", "*", "/", "^", ",", "(", ";", "<", ">", "&"]); var getPreviousNonSpaceChar = (value, offset) => { for (let i = offset - 1; i >= 0; i--) { const char = value[i]; if (char != null && char.trim() !== "") { return char; } } return null; }; // packages/ag-grid-enterprise/src/widgets/formulaRangeUtils.ts var FORMULA_TOKEN_COLOR_CLASS = "ag-formula-token-color"; var FORMULA_RANGE_COLOR_CLASS = "ag-formula-range-color"; var getColorClassesForRef = (_ref, colorIndexOverride) => { const index = colorIndexOverride ?? 0; return { tokenClass: `${FORMULA_TOKEN_COLOR_CLASS}-${index + 1}`, rangeClass: `${FORMULA_RANGE_COLOR_CLASS}-${index + 1}`, colorIndex: index }; }; var getRangeColorIndexFromClass = (colorClass) => { if (!colorClass) { return null; } const match = /ag-formula-range-color-(\d+)/.exec(colorClass); if (!match) { return null; } const parsed = parseInt(match[1], 10); return Number.isFinite(parsed) ? parsed - 1 : null; }; var tagRangeWithFormulaColor = (range, ref, colorIndex) => { if (!range) { return; } const { rangeClass } = getColorClassesForRef(ref, colorIndex); range.colorClass = rangeClass; }; var getCellRangeParams = (beans, ref) => { const parsed = parseA1Ref(ref, { allowTrailingColon: true }); if (!parsed) { return null; } const { formula } = beans; const { startCol, startRow, endCol, endRow } = parsed; const startColRef = startCol; const endColRef = endCol ?? startCol; const startColMatch = formula?.getColByRef(startColRef); const endColMatch = formula?.getColByRef(endColRef); if (!startColMatch || !endColMatch) { return null; } const rowStartIndex = parseInt(startRow, 10) - 1; const rowEndIndex = endRow ? parseInt(endRow, 10) - 1 : rowStartIndex; if (rowStartIndex < 0 || rowEndIndex < 0) { return null; } const rowModel = beans.rowModel; if (!rowModel?.getFormulaRow(rowStartIndex) || !rowModel.getFormulaRow(rowEndIndex)) { return null; } return { rowStartIndex, rowEndIndex, columnStart: startColMatch, columnEnd: endColMatch }; }; var getLatestRangeRef = (beans) => { const ranges = beans.rangeSvc?.getCellRanges(); const latest = ranges?.length ? ranges[ranges.length - 1] : null; if (!latest) { return null; } return rangeToRef(beans, latest); }; var rangeToRef = (beans, range) => { const { rangeSvc, formula } = beans; if (!rangeSvc || !formula) { return null; } const startRow = rangeSvc.getRangeStartRow(range); const endRow = rangeSvc.getRangeEndRow(range); if (!startRow || !endRow || startRow.rowPinned || endRow.rowPinned) { return null; } const rowStartIndex = Math.min(startRow.rowIndex, endRow.rowIndex) + 1; const rowEndIndex = Math.max(startRow.rowIndex, endRow.rowIndex) + 1; const columns = range.columns?.filter((col) => !isSpecialCol(col) && !!formula.getColRef(col)); if (!columns?.length) { return null; } const sorted = [...columns]; const startCol = sorted[0]; const endCol = sorted[sorted.length - 1]; const colStartRef = formula.getColRef(startCol); const colEndRef = formula.getColRef(endCol); if (!colStartRef || !colEndRef) { return null; } const sameCol = colStartRef === colEndRef; const sameRow = rowStartIndex === rowEndIndex; if (sameCol && sameRow) { return `${colStartRef}${rowStartIndex}`; } return `${colStartRef}${rowStartIndex}:${colEndRef}${rowEndIndex}`; }; var getRefTokenMatchesForFormula = (beans, text) => { const matches = getRefTokenMatches(text); const { formula } = beans; if (!formula) { return matches; } const valid = []; let index = 0; for (const match of matches) { if (!getCellRangeParams(beans, match.ref)) { continue; } valid.push({ ...match, index }); index += 1; } return valid; }; var getRefTokensFromText = (beans, text) => { const matches = getRefTokenMatchesForFormula(beans, text); return matches.map(({ ref, index }) => ({ ref, index })); }; // packages/ag-grid-enterprise/src/widgets/formulaInputAutocompleteFeature.ts var FormulaInputAutocompleteFeature = class extends BeanStub { constructor(field) { super(); this.field = field; this.functionAutocompleteList = null; this.functionAutocompleteToken = null; this.functionAutocompleteEntries = null; this.functionAutocompleteSearch = null; } postConstruct() { this.addManagedElementListeners(this.field.getContentElement(), { keydown: this.onContentKeyDown.bind(this), mouseup: this.updateFunctionAutocomplete.bind(this), focusin: this.updateFunctionAutocomplete.bind(this), focusout: this.closeFunctionAutocomplete.bind(this) }); this.addDestroyFunc(() => this.closeFunctionAutocomplete()); } onPlainValueUpdated() { this.closeFunctionAutocomplete(); } onFormulaValueUpdated() { this.updateFunctionAutocomplete(); } onContentKeyDown(event) { if (this.functionAutocompleteList) { switch (event.key) { case KeyCode.ENTER: case KeyCode.TAB: event.preventDefault(); event.stopPropagation(); this.confirmFunctionAutocomplete(); return; case KeyCode.ESCAPE: event.preventDefault(); event.stopPropagation(); this.closeFunctionAutocomplete(); return; case KeyCode.UP: case KeyCode.DOWN: this.functionAutocompleteList.onNavigationKeyDown(event, event.key); return; } } switch (event.key) { case KeyCode.LEFT: case KeyCode.RIGHT: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: this.scheduleFunctionAutocompleteUpdate(); break; } } scheduleFunctionAutocompleteUpdate() { setTimeout(() => { if (!this.isAlive()) { return; } this.updateFunctionAutocomplete(); }); } updateFunctionAutocomplete() { if (!this.isContentFocused()) { this.closeFunctionAutocomplete(); return; } const { field, beans } = this; const value = field.getCurrentValue(); const hasFormulaPrefix = value.trimStart().startsWith("="); if (!hasFormulaPrefix) { this.closeFunctionAutocomplete(); return; } const caretOffsets = field.getCaretOffsetsForAutocomplete(value); if (!caretOffsets) { this.closeFunctionAutocomplete(); return; } if (isCaretInsideRefToken(beans, value, caretOffsets.valueOffset)) { this.closeFunctionAutocomplete(); return; } const token = getFunctionTokenAtOffset(value, caretOffsets.valueOffset, beans.formula ?? null); if (!token) { this.closeFunctionAutocomplete(); return; } const { prefix } = token; if (!prefix.length) { this.closeFunctionAutocomplete(); return; } const entries = this.getFunctionAutocompleteEntries(); if (!entries.length) { this.closeFunctionAutocomplete(); return; } const searchLower = prefix.toLocaleLowerCase(); const hasMatch = entries.some(({ key }) => key.toLocaleLowerCase().startsWith(searchLower)); if (!hasMatch) { this.closeFunctionAutocomplete(); return; } this.functionAutocompleteToken = token; this.openFunctionAutocomplete(entries); if (this.functionAutocompleteList && this.functionAutocompleteSearch !== prefix) { this.functionAutocompleteList.setSearch(prefix); this.functionAutocompleteSearch = prefix; } } getFunctionAutocompleteEntries() { const formula = this.beans.formula; const names = formula?.active ? formula.getFunctionNames?.() ?? [] : []; if (!this.functionAutocompleteEntries || this.functionAutocompleteEntries.length !== names.length) { this.functionAutocompleteEntries = names.map((name) => ({ key: name })); } return this.functionAutocompleteEntries; } openFunctionAutocomplete(entries) { if (this.functionAutocompleteList || !entries.length) { return; } const popupSvc = this.beans.popupSvc; if (!popupSvc) { return; } let positionParams = null; const repositionList = () => { if (this.functionAutocompleteList && positionParams) { popupSvc.positionPopupByComponent(positionParams); } }; this.functionAutocompleteList = this.createManagedBean( new AgAutocompleteList({ autocompleteEntries: entries, onConfirmed: () => this.confirmFunctionAutocomplete(), useStartsWithSearch: true, autoSizeList: true, maxVisibleItems: 10, onListHeightChanged: repositionList }) ); const ePopupGui = this.functionAutocompleteList.getGui(); positionParams = { ePopup: ePopupGui, type: "autocomplete", eventSource: this.field.getGui(), position: "under", alignSide: this.gos.get("enableRtl") ? "right" : "left", keepWithinBounds: true }; const addPopupRes = popupSvc.addPopup({ eChild: ePopupGui, anchorToElement: this.field.getGui(), positionCallback: repositionList, ariaLabel: "Formula functions" }); this.functionAutocompleteHidePopup = addPopupRes.hideFunc; this.functionAutocompleteList.afterGuiAttached(); } closeFunctionAutocomplete() { this.functionAutocompleteToken = null; this.functionAutocompleteSearch = null; if (!this.functionAutocompleteList) { return; } this.functionAutocompleteHidePopup?.(); this.functionAutocompleteHidePopup = void 0; this.destroyBean(this.functionAutocompleteList); this.functionAutocompleteList = null; } confirmFunctionAutocomplete() { const token = this.functionAutocompleteToken; const selected = this.functionAutocompleteList?.getSelectedValue(); if (!token || !selected) { this.closeFunctionAutocomplete(); return; } const { field } = this; const value = field.getCurrentValue(); const functionName = selected.key; const baseValue = value.slice(0, token.start) + functionName + value.slice(token.end); const insertPos = token.start + functionName.length; const nextValue = baseValue[insertPos] === "(" ? baseValue : baseValue.slice(0, insertPos) + "(" + baseValue.slice(insertPos); field.getContentElement().focus({ preventScroll: true }); field.applyFormulaValueChange({ currentValue: value, nextValue, caret: insertPos + 1 }); this.closeFunctionAutocomplete(); } isContentFocused() { return _getDocument(this.beans).activeElement === this.field.getContentElement(); } }; var getFunctionTokenAtOffset = (value, caretOffset, formula) => { if (caretOffset < 0 || caretOffset > value.length || isInsideStringLiteral(value, caretOffset)) { return null; } let start = caretOffset; while (start > 0 && isFormulaIdentChar(value[start - 1])) { start--; } let end = caretOffset; while (end < value.length && isFormulaIdentChar(value[end])) { end++; } if (start === end) { return null; } let tokenEnd = end; if (caretOffset !== end) { const suffix = value.slice(caretOffset, end); const parsed = parseA1Ref(suffix); const isRefSuffix = !!parsed && (!formula || !!formula.getColByRef(parsed.startCol)); if (isRefSuffix) { tokenEnd = caretOffset; } } const token = value.slice(start, tokenEnd); if (!token || !isFormulaIdentStart(token[0])) { return null; } if (value[start - 1] === "$") { return null; } const previousChar = getPreviousNonSpaceChar(value, start); if (previousChar != null && !TOKEN_INSERT_AFTER_CHARS.has(previousChar)) { return null; } return { start, end: tokenEnd, prefix: value.slice(start, caretOffset) }; }; var isCaretInsideRefToken = (beans, value, caretOffset) => { for (const match of getRefTokenMatchesForFormula(beans, value)) { if (caretOffset >= match.start && caretOffset <= match.end) { return true; } } return false; }; var isInsideStringLiteral = (value, offset) => { let inString = false; for (let i = 0; i < offset && i < value.length; i++) { if (value[i] !== '"') { continue; } if (value[i + 1] === '"') { i++; continue; } inString = !inString; } return inString; }; // packages/ag-grid-enterprise/src/widgets/formulaInputRangeSyncFeature.ts var FormulaInputRangeSyncFeature = class extends BeanStub { constructor(field) { super(); this.field = field; // local mirror of editSvc range selection state while formula editing is active. this.rangeSelectionEnabled = false; // refs found in the formula that should have matching grid ranges (counts handle duplicates). this.trackedRangeRefs = /* @__PURE__ */ new Map(); // ranges we are actively tracking and their current ref string. this.trackedRanges = /* @__PURE__ */ new Map(); // prevents our own range changes from re-entering the selection handler. this.suppressRangeEvents = false; // skips the synthetic refresh event we dispatch after re-tagging ranges. this.ignoreNextRangeEvent = false; // avoids a value update loop when we re-render on enabling range selection. this.skipNextValueUpdate = false; // suppress selection handling while keyboard navigation updates the focus range. this.suppressSelectionChangeHandling = false; // keep a stable callback so the input manager can deactivate the previous editor. this.handleEditorDeactivated = () => { this.rangeSelectionEnabled = false; this.suppressRangeEvents = false; this.ignoreNextRangeEvent = false; this.skipNextValueUpdate = false; this.clearTrackedRanges(true); }; } postConstruct() { this.addManagedEventListeners({ cellSelectionChanged: this.onCellSelectionChanged.bind(this) }); this.addDestroyFunc(() => this.disableRangeSelectionWhileEditing()); this.addDestroyFunc(() => this.unregisterActiveEditor()); } onValueUpdated(value, hasFormulaPrefix) { if (this.skipNextValueUpdate) { this.skipNextValueUpdate = false; return; } if (!this.isActiveEditor()) { return; } if (hasFormulaPrefix) { const newlyEnabled = this.enableRangeSelectionWhileEditing(); if (newlyEnabled) { this.skipNextValueUpdate = true; this.field.setValue(value, true); } this.syncRangesFromFormula(value); return; } this.disableRangeSelectionWhileEditing(); } setEditingCellRef(column, rowIndex, editingCellRef) { this.editingColumn = column; this.editingRowIndex = rowIndex ?? void 0; this.editingCellRef = editingCellRef; } setEditorActive(active) { if (active) { this.registerActiveEditor(); return; } this.unregisterActiveEditor(); } withSelectionChangeHandlingSuppressed(action) { const previous = this.suppressSelectionChangeHandling; this.suppressSelectionChangeHandling = true; try { action(); } finally { this.suppressSelectionChangeHandling = previous; } } deactivateForFocusLoss() { if (!this.isActiveEditor()) { return; } this.handleEditorDeactivated(); this.beans.editSvc?.disableRangeSelectionWhileEditing?.(); this.unregisterActiveEditor(); } registerActiveEditor() { const fieldId = this.field.getCompId(); const { formulaInputManager } = this.beans; if (!formulaInputManager) { return; } const becameActive = formulaInputManager.registerActiveEditor(fieldId, this.handleEditorDeactivated); if (!becameActive) { return; } this.rangeSelectionEnabled = false; this.suppressRangeEvents = false; this.ignoreNextRangeEvent = false; this.skipNextValueUpdate = false; this.clearTrackedRanges(false); const value = this.field.getCurrentValue(); const hasFormulaPrefix = value.trimStart().startsWith("="); this.onValueUpdated(value, hasFormulaPrefix); } unregisterActiveEditor() { const fieldId = this.field.getCompId(); const { formulaInputManager } = this.beans; if (!formulaInputManager) { return; } formulaInputManager.unregisterActiveEditor(fieldId, this.handleEditorDeactivated); } isActiveEditor() { const fieldId = this.field.getCompId(); const { formulaInputManager } = this.beans; return !!formulaInputManager && formulaInputManager.isActiveEditor(fieldId); } getTrackedRefCount(ref) { return this.trackedRangeRefs.get(ref) ?? 0; } hasTrackedRef(ref) { return this.getTrackedRefCount(ref) > 0; } addTrackedRef(ref) { this.trackedRangeRefs.set(ref, this.getTrackedRefCount(ref) + 1); } removeTrackedRef(ref) { const next = this.getTrackedRefCount(ref) - 1; if (next <= 0) { this.trackedRangeRefs.delete(ref); return; } this.trackedRangeRefs.set(ref, next); } enableRangeSelectionWhileEditing() { if (this.rangeSelectionEnabled) { return false; } this.rangeSelectionEnabled = true; this.beans.editSvc?.enableRangeSelectionWhileEditing?.(); return true; } disableRangeSelectionWhileEditing() { if (!this.rangeSelectionEnabled && !this.trackedRangeRefs.size) { return; } this.rangeSelectionEnabled = false; this.beans.editSvc?.disableRangeSelectionWhileEditing?.(); this.clearTrackedRanges(this.isActiveEditor()); } clearTrackedRanges(clearGridRanges = true) { if (clearGridRanges) { const refs = Array.from(this.trackedRangeRefs.keys()); refs.forEach((ref) => this.removeRangeForRef(ref)); } this.trackedRangeRefs.clear(); this.trackedRanges.clear(); } getLiveRanges() { return this.beans.rangeSvc?.getCellRanges() ?? []; } withSuppressedRangeEvents(action) { this.suppressRangeEvents = true; action(); this.suppressRangeEvents = false; } setCellRangesSilently(ranges) { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc) { return; } this.withSuppressedRangeEvents(() => rangeSvc.setCellRanges(ranges)); } getColorIndexForTokenOrRef(ref, tokenIndex) { return this.field.getColorIndexForToken(tokenIndex ?? null) ?? this.field.getColorIndexForRef(ref); } normaliseRefForComparison(ref) { if (!ref) { return null; } const trimmed = ref.endsWith(":") ? ref.slice(0, -1) : ref; return trimmed.replace(/\$/g, "").toUpperCase(); } tagRangeColor(range, ref, colorIndex) { const { rangeClass } = getColorClassesForRef(ref, colorIndex); if (range.colorClass === rangeClass) { return false; } tagRangeWithFormulaColor(range, ref, colorIndex); return true; } trackRange(range, ref, tokenIndex) { const existing = this.trackedRanges.get(range); const nextTokenIndex = tokenIndex !== void 0 ? tokenIndex : existing?.tokenIndex ?? null; if (!existing) { this.addTrackedRef(ref); } else if (existing.ref !== ref) { this.removeTrackedRef(existing.ref); this.addTrackedRef(ref); } this.trackedRanges.set(range, { ref, tokenIndex: nextTokenIndex }); } getUntrackedFormulaRangesByRef() { const rangesByRef = /* @__PURE__ */ new Map(); const ranges = this.getLiveRanges(); for (const range of ranges) { if (this.trackedRanges.has(range)) { continue; } if (getRangeColorIndexFromClass(range.colorClass) == null) { continue; } const ref = rangeToRef(this.beans, range); if (!ref || ref === this.editingCellRef) { continue; } const existing = rangesByRef.get(ref); if (existing) { existing.push(range); } else { rangesByRef.set(ref, [range]); } } return rangesByRef; } syncRangesFromFormula(value) { const text = value ?? this.field.getCurrentValue() ?? ""; if (!this.rangeSelectionEnabled) { this.clearTrackedRanges(); return; } const refTokens = getRefTokensFromText(this.beans, text); const desiredByRef = /* @__PURE__ */ new Map(); for (const token of refTokens) { const { ref, index } = token; if (ref === this.editingCellRef) { continue; } const list = desiredByRef.get(ref) ?? []; list.push(index); desiredByRef.set(ref, list); } for (const ref of Array.from(this.trackedRangeRefs.keys())) { if (!desiredByRef.has(ref)) { this.removeRangeForRef(ref); } } const rangeSvc = this.beans.rangeSvc; if (!rangeSvc) { return; } const liveRanges = new Set(this.getLiveRanges()); for (const [range, tracked] of this.trackedRanges.entries()) { if (!liveRanges.has(range)) { this.trackedRanges.delete(range); this.removeTrackedRef(tracked.ref); } } const untrackedFormulaRanges = this.getUntrackedFormulaRangesByRef(); let reTagged = false; for (const [ref, tokenIndices] of desiredByRef.entries()) { const rangesForRef = []; for (const [range, tracked] of this.trackedRanges.entries()) { if (tracked.ref === ref) { rangesForRef.push(range); } } const reuseCandidates = untrackedFormulaRanges.get(ref); while (rangesForRef.length < tokenIndices.length && reuseCandidates?.length) { const candidate = reuseCandidates.shift(); if (candidate) { rangesForRef.push(candidate); } } while (rangesForRef.length > tokenIndices.length) { const range = rangesForRef.pop(); if (range) { this.removeTrackedRange(range); } } while (rangesForRef.length < tokenIndices.length) { const tokenIndex = tokenIndices[rangesForRef.length]; const added = this.addRangeForRef(ref, false, tokenIndex); if (!added) { break; } rangesForRef.push(added); } for (let i = 0; i < rangesForRef.length && i < tokenIndices.length; i++) { const range = rangesForRef[i]; const tokenIndex = tokenIndices[i]; this.trackRange(range, ref, tokenIndex); const colorIndex = this.getColorIndexForTokenOrRef(ref, tokenIndex); if (this.tagRangeColor(range, ref, colorIndex)) { reTagged = true; } } } const unusedFormulaRanges = []; for (const ranges of untrackedFormulaRanges.values()) { if (ranges.length) { unusedFormulaRanges.push(...ranges); } } if (unusedFormulaRanges.length) { const currentRanges = this.getLiveRanges(); const remaining = currentRanges.filter((range) => !unusedFormulaRanges.includes(range)); if (remaining.length !== currentRanges.length) { this.setCellRangesSilently(remaining); reTagged = true; } } if (reTagged) { this.refreshRangeStyling(); } } onCellSelectionChanged(event) { if (!this.isActiveEditor() || !this.rangeSelectionEnabled || !this.beans.editSvc?.isRangeSelectionEnabledWhileEditing?.()) { return; } if (this.ignoreNextRangeEvent) { this.ignoreNextRangeEvent = false; return; } if (this.suppressSelectionChangeHandling) { return; } const { finished, started } = event; const liveRanges = this.getLiveRanges(); const nonSpecialRanges = liveRanges.filter((range) => !this.isSpecialOnlyRange(range)); if (nonSpecialRanges.length !== liveRanges.length) { this.setCellRangesSilently(nonSpecialRanges); this.refocusEditingCell(); return; } const latestRange = liveRanges.length ? _last(liveRanges) : null; const latestRef = latestRange ? rangeToRef(this.beans, latestRange) : null; const hasInsertCandidate = !!latestRange && !this.trackedRanges.has(latestRange) && !!latestRef && latestRef !== this.editingCellRef; const shouldInsert = finished && (started || hasInsertCandidate); const reTagged = this.ensureTrackedRangeColors(); if (this.suppressRangeEvents) { if (reTagged) { this.refreshRangeStyling(); } return; } if (started || hasInsertCandidate) { this.field.rememberCaret(); } if (!hasInsertCandidate && this.handleRemovedRangeTokens()) { this.field.restoreCaretAfterToken(); this.refocusEditingCell(); return; } if (this.updateTrackedRangeTokens()) { return; } const ref = getLatestRangeRef(this.beans); if (!ref || ref === this.editingCellRef) { this.refocusEditingCell(); return; } if (shouldInsert) { const { action, previousRef, tokenIndex } = this.field.applyRangeInsert(ref); if (action === "none") { this.keepLatestSelectionOnly(latestRange); this.beans.editSvc?.stopEditing(void 0, { source: "edit" }); return; } if (action === "replace" && previousRef === ref) { this.discardLatestRangeForRef(ref); this.field.restoreCaretAfterToken(); this.refocusEditingCell(); return; } this.tagLatestRangeForRef(ref, tokenIndex); this.handleRangeTokenUpdate(previousRef, ref, true, action === "insert", tokenIndex); this.syncRangesFromFormula(this.field.getCurrentValue()); this.field.restoreCaretAfterToken(); this.refocusEditingCell(); return; } if (!started && !finished) { const { previousRef, tokenIndex } = this.field.insertOrReplaceToken(ref, false); this.tagLatestRangeForRef(ref, tokenIndex); this.handleRangeTokenUpdate(previousRef, ref, false, false); this.refocusEditingCell(); return; } this.tagLatestRangeForRef(ref); if (finished) { this.field.restoreCaretAfterToken(); this.refocusEditingCell(); } } keepLatestSelectionOnly(latestRange) { if (!latestRange || this.getLiveRanges().length <= 1) { return; } this.setCellRangesSilently([latestRange]); } isSpecialOnlyRange(range) { const columns = range.columns; return !!columns?.length && columns.every((col) => isSpecialCol(col)); } handleRangeTokenUpdate(previousRef, ref, manageRanges, isNew, tokenIndex) { if (manageRanges) { if (!isNew && previousRef && previousRef !== ref) { this.removeRangeForRef(previousRef, tokenIndex); } this.addRangeForRef(ref, true, tokenIndex); return; } if (isNew || !previousRef) { this.addTrackedRef(ref); return; } if (previousRef !== ref) { this.removeTrackedRef(previousRef); this.addTrackedRef(ref); } } addRangeForRef(ref, skipAddCellRange, tokenIndex) { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc) { return void 0; } let created; if (!skipAddCellRange) { const params = getCellRangeParams(this.beans, ref); if (!params) { return void 0; } this.withSuppressedRangeEvents(() => { created = rangeSvc.addCellRange(params); }); } else { created = this.findLatestRangeForRef(ref, true) ?? this.findLatestRangeForRef(ref, false); } if (created) { const colorIndex = this.getColorIndexForTokenOrRef(ref, tokenIndex); this.tagRangeColor(created, ref, colorIndex); this.trackRange(created, ref, tokenIndex); this.refreshRangeStyling(); } return created; } findLatestRangeForRef(ref, skipTracked) { const ranges = this.getLiveRanges(); for (let i = ranges.length - 1; i >= 0; i--) { const range = ranges[i]; if (rangeToRef(this.beans, range) !== ref) { continue; } if (skipTracked && this.trackedRanges.has(range)) { continue; } return range; } return void 0; } tagLatestRangeForRef(ref, tokenIndex) { const { trackedRanges } = this; const ranges = this.getLiveRanges(); const latest = ranges.length ? _last(ranges) : null; if (!latest) { return; } const trackedIndex = trackedRanges.get(latest)?.tokenIndex ?? null; const colorIndex = this.getColorIndexForTokenOrRef(ref, tokenIndex ?? trackedIndex); this.tagRangeColor(latest, ref, colorIndex); this.refreshRangeStyling(); } discardLatestRangeForRef(ref) { const ranges = this.getLiveRanges(); if (!ranges.length) { return; } const latest = _last(ranges); if (rangeToRef(this.beans, latest) !== ref) { return; } if (this.trackedRanges.has(latest)) { this.removeTrackedRange(latest); return; } this.setCellRangesSilently(ranges.slice(0, -1)); } ensureTrackedRangeColors() { const ranges = this.getLiveRanges(); if (!ranges.length) { return false; } let reTagged = false; for (const range of ranges) { const tracked = this.trackedRanges.get(range); const ref = tracked?.ref ?? rangeToRef(this.beans, range); if (!ref || !this.hasTrackedRef(ref)) { continue; } const tokenIndex = tracked?.tokenIndex ?? null; const tokenColorIndex = this.field.getColorIndexForToken(tokenIndex); const inferredColorIndex = getRangeColorIndexFromClass(range.colorClass); const colorIndex = tokenColorIndex ?? (this.field.hasColorForRef(ref) ? this.field.getColorIndexForRef(ref) : this.field.moveColorToRef(void 0, ref, inferredColorIndex ?? void 0)); if (colorIndex == null) { continue; } if (this.tagRangeColor(range, ref, colorIndex)) { reTagged = true; } if (!this.trackedRanges.has(range)) { this.trackRange(range, ref, tokenIndex); } } return reTagged; } handleRemovedRangeTokens() { if (!this.beans.rangeSvc || this.trackedRanges.size === 0) { return false; } const value = this.field.getCurrentValue(); const tokens = getRefTokensFromText(this.beans, value).filter(({ ref }) => ref !== this.editingCellRef); if (!tokens.length) { return false; } const liveRanges = this.getLiveRanges(); const liveSet = new Set(liveRanges); const liveCounts = /* @__PURE__ */ new Map(); for (const range of liveRanges) { const ref = rangeToRef(this.beans, range); if (!ref || ref === this.editingCellRef) { continue; } liveCounts.set(ref, (liveCounts.get(ref) ?? 0) + 1); } const pendingRemovals = /* @__PURE__ */ new Map(); for (const token of tokens) { const { ref } = token; pendingRemovals.set(ref, (pendingRemovals.get(ref) ?? 0) + 1); } for (const [ref, tokenCount] of Array.from(pendingRemovals.entries())) { const liveCount = liveCounts.get(ref) ?? 0; const remaining = tokenCount - liveCount; if (remaining > 0) { pendingRemovals.set(ref, remaining); } else { pendingRemovals.delete(ref); } } if (!pendingRemovals.size) { return false; } const removals = []; for (const [range, tracked] of Array.from(this.trackedRanges.entries())) { if (liveSet.has(range)) { continue; } const { ref } = tracked; const remaining = pendingRemovals.get(ref) ?? 0; if (remaining <= 0) { continue; } pendingRemovals.set(ref, remaining - 1); removals.push({ range, tracked }); } if (!removals.length) { return false; } removals.sort((a, b) => (b.tracked.tokenIndex ?? -1) - (a.tracked.tokenIndex ?? -1)); let removed = false; for (const { range, tracked } of removals) { const { ref, tokenIndex } = tracked; removed = this.field.removeTokenRef(ref, tokenIndex ?? null) || removed; this.trackedRanges.delete(range); this.removeTrackedRef(ref); } if (removed) { this.syncRangesFromFormula(this.field.getCurrentValue()); } return removed; } refreshRangeStyling() { const { eventSvc } = this.beans; if (!eventSvc) { return; } this.ensureTrackedRangeColors(); this.ignoreNextRangeEvent = true; eventSvc.dispatchEvent({ type: "cellSelectionChanged", started: false, finished: false }); } refocusEditingCell() { const { focusSvc } = this.beans; const { editingColumn, editingRowIndex } = this; if (!focusSvc || editingColumn == null || editingRowIndex == null) { return; } focusSvc.setFocusedCell({ column: editingColumn, rowIndex: editingRowIndex, rowPinned: null, preventScrollOnBrowserFocus: true }); } removeTrackedRange(range) { const tracked = this.trackedRanges.get(range); if (!tracked) { return; } const ranges = this.getLiveRanges(); const remaining = ranges.filter((candidate) => candidate !== range); if (remaining.length !== ranges.length) { this.setCellRangesSilently(remaining); } this.trackedRanges.delete(range); this.removeTrackedRef(tracked.ref); } removeRangeForRef(ref, tokenIndex) { if (!ref || !this.hasTrackedRef(ref)) { return; } if (tokenIndex != null) { let removed = false; for (const [range, tracked] of Array.from(this.trackedRanges.entries())) { const { ref: trackedRef, tokenIndex: trackedTokenIndex } = tracked; if (trackedRef !== ref || trackedTokenIndex !== tokenIndex) { continue; } this.removeTrackedRange(range); removed = true; break; } if (!removed) { for (const [range, tracked] of Array.from(this.trackedRanges.entries())) { if (tracked.ref === ref) { this.removeTrackedRange(range); break; } } } return; } for (const [range, tracked] of Array.from(this.trackedRanges.entries())) { if (tracked.ref === ref) { this.removeTrackedRange(range); } } } updateTrackedRangeTokens() { if (!this.beans.rangeSvc) { return false; } const ranges = this.getLiveRanges(); const editingRef = this.normaliseRefForComparison(this.editingCellRef); let updated = false; for (const range of ranges) { const tracked = this.trackedRanges.get(range); if (!tracked) { continue; } const { ref: previousRef, tokenIndex } = tracked; const nextRef = rangeToRef(this.beans, range); const normalisedPrevious = this.normaliseRefForComparison(previousRef); const normalisedNext = this.normaliseRefForComparison(nextRef); if (!nextRef || !normalisedNext || normalisedNext === normalisedPrevious || normalisedNext === editingRef) { continue; } const { colorClass } = range; const tokenColorIndex = this.field.getColorIndexForToken(tokenIndex ?? null); const colorIndex = tokenColorIndex ?? this.field.moveColorToRef(previousRef, nextRef, getRangeColorIndexFromClass(colorClass) ?? void 0); const replacedIndex = this.field.replaceTokenRef(previousRef, nextRef, colorIndex, tokenIndex); if (replacedIndex == null) { continue; } this.tagRangeColor(range, nextRef, colorIndex); this.trackRange(range, nextRef, replacedIndex ?? tokenIndex ?? null); updated = true; } if (updated) { this.refreshRangeStyling(); } return updated; } }; // packages/ag-grid-enterprise/src/widgets/agFormulaInputField.ts var FORMULA_TOKEN_COLOR_COUNT = 7; var DISPLAY_OPERATOR_LOOKUP = { "/": "\xF7", "*": "\xD7" }; var VALUE_OPERATOR_LOOKUP = { "\xF7": "/", "\xD7": "*" }; var AgFormulaInputField = class extends AgContentEditableField { constructor() { super({ renderValueToElement: false, className: "ag-formula-input-field" }); this.currentValue = ""; // caret / token bookkeeping so range updates can re-render without losing position. this.selectionCaretOffset = null; this.lastTokenValueOffset = null; this.lastTokenValueLength = null; this.lastTokenCaretOffset = null; // record mouse focus so we don't jump the caret to the end after a click. this.focusFromMouseTime = null; // skip auto-caret placement when we are restoring a caret programmatically. this.suppressNextFocusCaretPlacement = false; // fallback color assignment per ref when a token index is unavailable. this.formulaColorByRef = /* @__PURE__ */ new Map(); this.registerCSS(agFormulaInputField_default); this.registerCSS(agAutocomplete_default); } postConstruct() { super.postConstruct(); this.rangeSyncFeature = this.createManagedBean(new FormulaInputRangeSyncFeature(this)); this.autocompleteFeature = this.createManagedBean(new FormulaInputAutocompleteFeature(this)); this.addManagedElementListeners(this.getContentElement(), { input: this.onContentInput.bind(this), focus: this.onContentFocus.bind(this), blur: this.onContentBlur.bind(this), mousedown: this.onContentMouseDown.bind(this) }); } setValue(value, silent) { const text = value == null ? "" : String(value); const { isFormula, hasFormulaPrefix } = this.getFormulaState(text); if (!isFormula) { this.applyPlainValue(text, { silent, dispatch: true }); this.rangeSyncFeature?.onValueUpdated(text, hasFormulaPrefix); return this; } this.applyFormulaValue(text, { currentValue: this.getCurrentValue(), silent }); this.rangeSyncFeature?.onValueUpdated(text, hasFormulaPrefix); return this; } getCurrentValue() { const liveValue = serializeContent(this.getContentElement()); if (liveValue !== this.currentValue) { this.setEditorValue(liveValue, true); } return this.currentValue; } setEditingCellRef(column, rowIndex) { const colRef = column ? this.beans.formula?.getColRef(column) : void 0; const editingCellRef = colRef && rowIndex != null && rowIndex !== void 0 ? `${colRef}${rowIndex + 1}` : void 0; if (!editingCellRef) { this.rangeSyncFeature?.setEditingCellRef(void 0, void 0, void 0); return; } this.rangeSyncFeature?.setEditingCellRef(column, rowIndex, editingCellRef); } rememberCaret() { const caretOffset = getCaretOffset(this.beans, this.getContentElement(), this.getCurrentValue()); this.selectionCaretOffset = caretOffset ?? this.currentValue.length; } setEditorValue(value, silent = false) { this.currentValue = value; super.setValue(value, silent); return this; } renderFormula(params) { renderFormula({ beans: this.beans, contentElement: this.getContentElement(), getColorIndexForToken: this.getColorIndexForToken.bind(this), ...params }); } renderPlainValue(value, caret) { const contentElement = this.getContentElement(); const caretOffset = caret ?? getCaretOffset(this.beans, contentElement, this.currentValue); contentElement.textContent = value ?? ""; const targetCaret = caretOffset != null ? Math.min(caretOffset, value.length) : null; restoreCaret(this.beans, contentElement, targetCaret); } withSelectionChangeHandlingSuppressed(action) { if (!this.rangeSyncFeature) { action(); return; } this.rangeSyncFeature.withSelectionChangeHandlingSuppressed(action); } getColorIndexForRef(ref) { if (!shouldUseTokenColors(this.beans)) { return null; } const existing = this.formulaColorByRef.get(ref); if (existing != null) { return existing; } const next = this.formulaColorByRef.size % FORMULA_TOKEN_COLOR_COUNT; this.formulaColorByRef.set(ref, next); return next; } getColorIndexForToken(tokenIndex) { if (!shouldUseTokenColors(this.beans) || tokenIndex == null) { return null; } return tokenIndex % FORMULA_TOKEN_COLOR_COUNT; } hasColorForRef(ref) { return this.formulaColorByRef.has(ref); } moveColorToRef(fromRef, toRef, fallback) { const colorIndex = fromRef && this.formulaColorByRef.has(fromRef) ? this.getColorIndexForRef(fromRef) : fallback ?? this.formulaColorByRef.get(toRef) ?? this.getColorIndexForRef(toRef); if (fromRef && fromRef !== toRef) { this.formulaColorByRef.delete(fromRef); } if (colorIndex == null) { return null; } this.formulaColorByRef.set(toRef, colorIndex); return colorIndex; } updateFormulaColorsFromValue(value) { value = value == null ? "" : String(value); if (!shouldUseTokenColors(this.beans)) { this.formulaColorByRef.clear(); return; } const refsInOrder = getOrderedRefs(this.beans, value); let changed = refsInOrder.length !== this.formulaColorByRef.size; const nextColors = /* @__PURE__ */ new Map(); refsInOrder.forEach((ref, index) => { const colorIndex = index % FORMULA_TOKEN_COLOR_COUNT; nextColors.set(ref, colorIndex); if (this.formulaColorByRef.get(ref) !== colorIndex) { changed = true; } }); if (!changed) { return; } this.formulaColorByRef.clear(); nextColors.forEach((colorIndex, ref) => this.formulaColorByRef.set(ref, colorIndex)); } onContentInput() { const contentElement = this.getContentElement(); const currentValue = this.getCurrentValue(); const caret = getCaretOffset(this.beans, contentElement, currentValue); const serialized = serializeContent(contentElement); const { isFormula, hasFormulaPrefix } = this.getFormulaState(serialized); if (!isFormula) { this.applyPlainValue(serialized, { caret, dispatch: true }); this.rangeSyncFeature?.onValueUpdated(serialized, hasFormulaPrefix); return; } this.applyFormulaValue(serialized, { currentValue, caret: caret ?? void 0, dispatch: true }); this.rangeSyncFeature?.onValueUpdated(serialized, hasFormulaPrefix); } onContentFocus() { this.rangeSyncFeature?.setEditorActive(true); if (this.suppressNextFocusCaretPlacement) { this.suppressNextFocusCaretPlacement = false; return; } const { focusFromMouseTime } = this; const focusFromMouse = focusFromMouseTime != null; this.focusFromMouseTime = null; if (focusFromMouse) { return; } _placeCaretAtEnd(this.beans, this.getContentElement()); } onContentBlur(event) { this.focusFromMouseTime = null; const nextTarget = event.relatedTarget; const editorTarget = nextTarget?.closest(".ag-cell-editor"); const cellTarget = nextTarget?.closest(".ag-cell"); if (!nextTarget || this.getGui().contains(nextTarget) || !editorTarget || !cellTarget) { return; } this.rangeSyncFeature?.deactivateForFocusLoss(); } onContentMouseDown() { this.focusFromMouseTime = Date.now(); } insertOrReplaceToken(ref, isNew) { const offsets = this.getTokenInsertOffsets(isNew); if (!offsets) { return {}; } const { caretOffset, valueOffset } = offsets; const replaceLen = isNew || this.lastTokenValueLength == null ? 0 : this.lastTokenValueLength; const value = this.getCurrentValue(); const updatedValue = value.slice(0, valueOffset) + ref + value.slice(valueOffset + replaceLen); const tokenIndex = getTokenMatchAtOffset(this.beans, updatedValue, valueOffset)?.index ?? null; let previousRef; this.applyFormulaValueChange({ currentValue: value, nextValue: updatedValue, caret: caretOffset + ref.length, updateTracking: () => { previousRef = this.updateLastTokenTracking(ref, caretOffset, valueOffset); } }); return { previousRef, tokenIndex }; } removeTokenRef(ref, tokenIndex) { const value = this.getCurrentValue(); const matches = getRefTokenMatchesForFormula(this.beans, value); let token; if (tokenIndex != null) { token = matches.find((match) => match.index === tokenIndex); if (token && token.ref !== ref) { token = void 0; } } if (!token) { token = matches.find((match) => match.ref === ref); } if (!token) { return false; } const updated = value.slice(0, token.start) + value.slice(token.end); const caretBase = this.selectionCaretOffset ?? token.start; const caret = Math.min(caretBase, updated.length); this.applyFormulaValueChange({ currentValue: value, nextValue: updated, caret, updateTracking: () => { this.lastTokenValueOffset = null; this.lastTokenValueLength = null; this.lastTokenCaretOffset = caret; this.lastTokenRef = void 0; } }); return true; } applyRangeInsert(ref) { const value = this.getCurrentValue(); const caretOffsets = this.getCaretOffsets(value); if (!caretOffsets) { const { previousRef: previousRef2, tokenIndex: tokenIndex2 } = this.insertOrReplaceToken(ref, true); return { action: "insert", previousRef: previousRef2, tokenIndex: tokenIndex2 }; } const { valueOffset } = caretOffsets; const tokenMatch = getTokenMatchAtOffset(this.beans, value, valueOffset); if (tokenMatch) { const { end: tokenEnd, ref: tokenRef } = tokenMatch; if (tokenRef.endsWith(":") && valueOffset === tokenEnd) { const { previousRef: previousRef3, tokenIndex: tokenIndex3 } = this.insertOrReplaceToken(ref, true); return { action: "insert", previousRef: previousRef3, tokenIndex: tokenIndex3 }; } const { previousRef: previousRef2, tokenIndex: tokenIndex2 } = this.replaceTokenAtMatch(tokenMatch, ref); return { action: "replace", previousRef: previousRef2, tokenIndex: tokenIndex2 }; } const rawTokenMatch = getRawTokenMatchAtOffset(value, valueOffset); if (rawTokenMatch) { const updated = value.slice(0, rawTokenMatch.start) + ref + value.slice(rawTokenMatch.end); const tokenIndex2 = getTokenMatchAtOffset(this.beans, updated, rawTokenMatch.start)?.index ?? null; const { previousRef: previousRef2 } = this.replaceTokenAtMatch(rawTokenMatch, ref, tokenIndex2); return { action: "replace", previousRef: previousRef2, tokenIndex: tokenIndex2 }; } if (!shouldInsertTokenAtOffset(value, valueOffset)) { return { action: "none" }; } const { previousRef, tokenIndex } = this.insertOrReplaceToken(ref, true); return { action: "insert", previousRef, tokenIndex }; } restoreCaretAfterToken() { const caretBase = this.lastTokenCaretOffset ?? getCaretOffset(this.beans, this.getContentElement(), this.getCurrentValue()) ?? this.currentValue.length; const caret = caretBase + (this.lastTokenValueLength ?? 0); this.selectionCaretOffset = null; this.suppressNextFocusCaretPlacement = true; setTimeout(() => { if (!this.isAlive()) { return; } this.getContentElement().focus({ preventScroll: true }); if (_getDocument(this.beans).activeElement === this.getContentElement()) { this.suppressNextFocusCaretPlacement = false; } restoreCaret(this.beans, this.getContentElement(), caret); }); } replaceTokenAtMatch(token, nextRef, tokenIndexOverride) { const value = this.getCurrentValue(); const updated = value.slice(0, token.start) + nextRef + value.slice(token.end); this.applyFormulaValueChange({ currentValue: value, nextValue: updated, caret: token.start + nextRef.length, updateTracking: () => { this.updateLastTokenTracking(nextRef, token.start, token.start); } }); return { previousRef: token.ref, tokenIndex: tokenIndexOverride ?? token.index }; } getValueOffsetFromCaret(caretOffset) { const container = this.getContentElement(); let caretRemaining = caretOffset; let valueOffset = 0; for (const child of Array.from(container.childNodes)) { const caretLen = _getNodeTextLength(child); const valueLen = getNodeText(child).length; if (caretRemaining <= caretLen) { return valueOffset + (caretLen === valueLen ? caretRemaining : 0); } caretRemaining -= caretLen; valueOffset += valueLen; } return this.currentValue.length; } getTokenInsertOffsets(isNew) { return this.getCaretOffsets(this.getCurrentValue(), { useCachedCaret: true, useCachedValueOffset: !isNew }); } getCaretOffsetsForAutocomplete(value) { return this.getCaretOffsets(value); } getCaretOffsets(value, options = { useCachedCaret: false, useCachedValueOffset: false }) { const { beans } = this; const { useCachedCaret, useCachedValueOffset } = options; const contentElement = this.getContentElement(); const caretOffset = useCachedCaret ? this.selectionCaretOffset ?? getCaretOffset(beans, contentElement, value) ?? this.currentValue.length : getCaretOffset(beans, contentElement, value); if (caretOffset == null) { return null; } const valueOffset = useCachedValueOffset && this.lastTokenValueOffset != null ? this.lastTokenValueOffset : this.getValueOffsetFromCaret(caretOffset); if (valueOffset == null) { return null; } return { caretOffset, valueOffset }; } updateLastTokenTracking(ref, caretOffset, valueOffset) { const previousRef = this.lastTokenRef; this.lastTokenValueOffset = valueOffset; this.lastTokenValueLength = ref.length; this.lastTokenCaretOffset = caretOffset; this.lastTokenRef = ref; return previousRef; } getFormulaState(text) { const hasFormulaPrefix = text.trimStart().startsWith("="); const isFormula = this.beans.formula?.isFormula(text) ?? hasFormulaPrefix; return { isFormula, hasFormulaPrefix }; } dispatchValueChanged() { this.dispatchLocalEvent({ type: "fieldValueChanged" }); } applyPlainValue(value, params) { this.formulaColorByRef.clear(); this.renderPlainValue(value, params.caret); this.setEditorValue(value, params.silent); if (params.dispatch) { this.dispatchValueChanged(); } this.autocompleteFeature?.onPlainValueUpdated(); } applyFormulaValue(value, params) { this.updateFormulaColorsFromValue(value); this.renderFormula({ value, currentValue: params.currentValue ?? this.getCurrentValue(), caret: params.caret ?? void 0 }); this.setEditorValue(value, params.silent); if (params.dispatch) { this.dispatchValueChanged(); } this.autocompleteFeature?.onFormulaValueUpdated(); } applyFormulaValueChange(params) { const { currentValue, nextValue, caret } = params; this.updateFormulaColorsFromValue(nextValue); params.updateTracking?.(); this.setEditorValue(nextValue); this.renderFormula({ currentValue, value: nextValue, caret }); this.dispatchValueChanged(); this.autocompleteFeature?.onFormulaValueUpdated(); } replaceTokenRef(previousRef, nextRef, colorIndex, tokenIndex) { const contentElement = this.getContentElement(); let token; if (tokenIndex != null) { token = contentElement.querySelector( `.ag-formula-token[data-formula-token-index="${tokenIndex}"]` ) ?? void 0; if (token && getTokenRef(token) !== previousRef) { token = void 0; } } if (!token) { token = Array.from(contentElement.querySelectorAll(".ag-formula-token")).find( (node) => getTokenRef(node) === previousRef ); } if (!token) { return null; } const caretOffset = getOffsetBeforeNode(contentElement, token); const valueOffset = getOffsetBeforeNode(contentElement, token, true); if (caretOffset == null || valueOffset == null) { return null; } const value = this.getCurrentValue(); if (colorIndex != null) { this.formulaColorByRef.set(nextRef, colorIndex); } const updated = value.slice(0, valueOffset) + nextRef + value.slice(valueOffset + previousRef.length); const resolvedIndex = getTokenIndex(token); this.applyFormulaValueChange({ currentValue: value, nextValue: updated, caret: caretOffset + nextRef.length, updateTracking: () => { this.updateLastTokenTracking(nextRef, caretOffset, valueOffset); } }); return resolvedIndex ?? tokenIndex ?? null; } }; var shouldUseTokenColors = (beans) => { const { gos, rangeSvc } = beans; const canCreateRanges = !!rangeSvc && !!gos.get("cellSelection"); return canCreateRanges; }; var getOrderedRefs = (beans, value) => { const refsInOrder = []; const seen = /* @__PURE__ */ new Set(); for (const match of getRefTokenMatchesForFormula(beans, value)) { const ref = match.ref; if (seen.has(ref)) { continue; } seen.add(ref); refsInOrder.push(ref); } return refsInOrder; }; var getTokenMatchAtOffset = (beans, value, offset) => { for (const match of getRefTokenMatchesForFormula(beans, value)) { if (offset >= match.start && offset <= match.end) { return { ref: match.ref, start: match.start, end: match.end, index: match.index }; } } return null; }; var getRawTokenMatchAtOffset = (value, offset) => { for (const match of getRefTokenMatches(value)) { if (offset >= match.start && offset <= match.end) { return { ref: match.ref, start: match.start, end: match.end, index: match.index }; } } return null; }; var shouldInsertTokenAtOffset = (value, offset) => { const previousChar = getPreviousNonSpaceChar(value, offset); return previousChar == null || TOKEN_INSERT_AFTER_CHARS.has(previousChar); }; var tokenize = (beans, value, getColorIndexForToken) => { const nodes = []; let lastIndex = 0; const matches = getRefTokenMatchesForFormula(beans, value); const doc = _getDocument(beans); for (const match of matches) { if (match.start > lastIndex) { nodes.push(doc.createTextNode(formatForDisplay(value.slice(lastIndex, match.start)))); } const colorIndex = getColorIndexForToken(match.index); nodes.push(createReferenceNode(match.ref, colorIndex, colorIndex != null, match.index)); lastIndex = match.end; } if (lastIndex < value.length) { nodes.push(doc.createTextNode(formatForDisplay(value.slice(lastIndex)))); } if (!nodes.length) { nodes.push(doc.createTextNode("")); } return nodes; }; var createReferenceNode = (ref, colorIndex, useTokenColors, tokenIndex) => { const attrs = { "aria-label": ref, "data-formula-ref": ref, "data-formula-token-index": tokenIndex.toString() }; let tokenClass; if (useTokenColors && colorIndex != null) { const classes = getColorClassesForRef(ref, colorIndex); tokenClass = classes.tokenClass; attrs["data-formula-range-class"] = classes.rangeClass; } const node = _createElement({ tag: "span", cls: "ag-formula-token", attrs, children: ref }); if (tokenClass) { node.classList.add(tokenClass); } return node; }; var renderFormula = (params) => { const { beans, contentElement, currentValue, value, getColorIndexForToken, caret } = params; const caretOffset = caret ?? getCaretOffset(beans, contentElement, currentValue); const maxCaret = value.length; contentElement.textContent = ""; for (const node of tokenize(beans, value, getColorIndexForToken)) { contentElement.append(node); } const targetCaret = caretOffset != null ? Math.min(caretOffset, maxCaret) : null; restoreCaret(beans, contentElement, targetCaret); }; var getOffsetBeforeNode = (container, node, useValueLength = false) => { if (!container.contains(node)) { return null; } let offset = 0; for (const child of Array.from(container.childNodes)) { if (child === node) { return offset; } offset += useValueLength ? getNodeText(child).length : _getNodeTextLength(child); } return null; }; var serializeContent = (contentElement) => { let output = ""; contentElement.childNodes.forEach((child) => { output += getNodeText(child); }); return output; }; var getNodeText = (node) => { if (node.nodeType === Node.TEXT_NODE) { return formatForValue(node.textContent ?? ""); } if (node.nodeType === Node.ELEMENT_NODE) { return Array.from(node.childNodes).map((child) => getNodeText(child)).join(""); } return ""; }; var _getNodeTextLength = (node) => { if (node.nodeType === Node.TEXT_NODE) { return node.textContent?.length ?? 0; } if (node.nodeType === Node.ELEMENT_NODE) { return Array.from(node.childNodes).reduce((sum, child) => sum + _getNodeTextLength(child), 0); } return 0; }; var findNodeAtOffset = (root, offset) => { let remaining = offset; for (let i = 0; i < root.childNodes.length; i++) { const child = root.childNodes[i]; const length = _getNodeTextLength(child); if (remaining > length) { remaining -= length; continue; } if (child.nodeType === Node.TEXT_NODE) { return { node: child, localOffset: remaining }; } return findNodeAtOffset(child, remaining); } return { node: root, localOffset: root.childNodes.length }; }; var restoreCaret = (beans, contentElement, offset) => { if (offset == null) { return; } const win = _getWindow(beans); const doc = _getDocument(beans); const selection = win.getSelection(); const range = doc.createRange(); const { node, localOffset } = findNodeAtOffset(contentElement, offset); if (!node || !selection || !contentElement.isConnected || !node.isConnected) { return; } range.setStart(node, localOffset); range.collapse(true); selection.removeAllRanges(); try { selection.addRange(range); } catch { } }; var getCaretOffset = (beans, contentElement, currentValue) => { const win = _getWindow(beans); const selection = win.getSelection(); if (!selection || selection.rangeCount === 0) { return currentValue?.length ?? null; } const range = selection.getRangeAt(0); if (!contentElement.contains(range.startContainer)) { return currentValue?.length ?? null; } if (range.startContainer === contentElement) { let offset2 = 0; for (let i = 0; i < range.startOffset; i++) { offset2 += _getNodeTextLength(contentElement.childNodes[i]); } return offset2; } let offset = range.startOffset; let node = range.startContainer; while (node && node !== contentElement) { let sibling = node.previousSibling; while (sibling) { offset += _getNodeTextLength(sibling); sibling = sibling.previousSibling; } node = node.parentNode; } return offset; }; var getTokenRef = (tokenEl) => formatForValue(tokenEl.textContent ?? tokenEl.dataset.formulaRef ?? ""); var getTokenIndex = (tokenEl) => { const raw = tokenEl.dataset.formulaTokenIndex; if (!raw) { return null; } const parsed = parseInt(raw, 10); return Number.isFinite(parsed) ? parsed : null; }; var formatForDisplay = (text) => text.replace(/[/*]/g, (match) => DISPLAY_OPERATOR_LOOKUP[match] ?? match); var formatForValue = (text) => text.replace(/[÷×]/g, (match) => VALUE_OPERATOR_LOOKUP[match] ?? match); // packages/ag-grid-enterprise/src/formula/i18n.ts var FORMULA_ERRORS = { 1: ["invalidFormulaValidation", "Invalid formula."], 2: ["formulaParseInvalidCellReference", "Invalid cell reference: ${variable}."], 3: ["formulaParseInvalidRangeEndReference", "Invalid range end reference."], 4: ["formulaParseUnterminatedString", "Unterminated string."], 5: ["formulaParseUnexpectedCharacter", "Unexpected character: ${variable}."], 6: ["formulaParseOperatorStackUnderflow", "Operator stack underflow."], 7: ["formulaParseMissingOperand", "Missing operand for '${variable}'."], 8: ["formulaParseInternalUnexpectedFrameDuringReduction", "Internal error: unexpected frame during reduction."], 9: ["formulaParseInternalUnexpectedFrameBeforeOpenParen", "Internal error: unexpected frame before '('."], 10: ["formulaParseMisplacedComma", "Misplaced comma."], 11: ["formulaParseCommaOutsideFunctionCall", "Comma outside of a function call."], 12: ["formulaParseInternalUnexpectedFrameBeforeCloseParen", "Internal error: unexpected frame before ')'."], 13: ["formulaParseMismatchedParentheses", "Mismatched parentheses."], 14: ["formulaParseUnsupportedOperand", "Unsupported operand: ${variable}."], 15: [ "formulaParseMismatchedParenthesesOrUnfinishedFunctionCall", "Mismatched parentheses or unfinished function call." ], 16: ["formulaParseInvalidExpression", "Invalid expression."], 17: ["formulaParseFormulasMustBeginWithEquals", "Formulas must begin with =."], 18: [ "formulaSerializeStringContainsQuote", 'String contains a quote (") which the tokenizer does not support.', "#PARSE!" ], 19: [ "formulaSerializeCannotProduceAbsoluteColumnLabelFromId", "Cannot produce absolute COLUMN label from id '${variable}'." ], 20: [ "formulaSerializeCannotProduceAbsoluteRowIndexFromId", "Cannot produce absolute ROW index from id '${variable}'." ], 21: ["formulaSerializeCannotProduceRowIndexFromId", "Cannot produce ROW index from id '${variable}'."], 22: ["formulaSerializeCannotMapColumnIdToA1Label", "Cannot map column id '${variable}' to A1 label."], 23: ["formulaSerializeCannotParseAbsoluteRowIndex", "Cannot parse absolute row index '${variable}'."], 24: ["formulaSerializeCannotMapRowIdToA1Index", "Cannot map row id '${variable}' to A1 index."], 25: ["formulaEvalRangeNotAllowedInScalarContext", "Range is not allowed in scalar context."], 26: ["formulaEvalUnknownReferenceToCell", "Unknown reference to cell.", "#REF!"], 27: ["formulaEvalUnsupportedOperation", "Unsupported operation ${variable}.", "#NAME?"], 28: ["formulaEvalInvalidAbsoluteRow", "Invalid absolute row.", "#REF!"], 29: ["formulaEvalUnrecognisedRowId", "Unrecognised row id.", "#REF!"], 30: ["formulaEvalInvalidAbsoluteColumn", "Invalid absolute column.", "#REF!"], 31: ["formulaEvalUnrecognisedColumnId", "Unrecognised column id.", "#REF!"], 32: ["formulaEvalUnrecognisedRowInRange", "Unrecognised row in range.", "#REF!"], 33: ["formulaEvalUnrecognisedReferenceToCell", "Unrecognised reference to cell.", "#REF!"], 34: ["formulaEvalIncompleteRangeReference", "Incomplete range reference.", "#REF!"], 35: ["formulaFunctionExpectedExactlyArguments", "${variable}: expected exactly ${variable} arguments."], 36: ["formulaFunctionExpectedAtMostArguments", "${variable}: expected at most ${variable} arguments."], 37: ["formulaFunctionExpectedAtLeastArguments", "${variable}: expected at least ${variable} arguments."], 38: [ "formulaFunctionInvalidCriteriaWildcardsWithComparator", "Invalid criteria: wildcards with comparator.", "#VALUE!" ], 39: ["formulaFunctionNonNumericArgument", "${variable}: non-numeric argument.", "#VALUE!"], 40: ["formulaFunctionDivisionByZero", "${variable}: division by zero.", "#DIV/0!"], 41: ["formulaFunctionCannotCombineDatesWithBigInt", "${variable}: cannot combine dates with BigInt.", "#VALUE!"], 42: [ "formulaFunctionRequiresAtLeastOneNumericValue", "${variable}: requires at least one numeric value.", "#PARSE!" ], 43: ["formulaFunctionRequiresAtLeastOneValue", "${variable}: requires at least one value."], 44: ["formulaFunctionAllValuesMustBeNumbers", "${variable}: all values must be numbers.", "#VALUE!"], 45: ["formulaFunctionArgumentMustBeRange", "${variable}: ${variable} argument must be a range.", "#VALUE!"], 46: ["formulaFunctionArgumentMustBeValue", "${variable}: ${variable} argument must be a value.", "#VALUE!"], 47: ["formulaFunctionRangesHaveDifferentSizes", "${variable}: ranges have different sizes.", "#VALUE!"], 48: ["formulaFunctionValuesMustBeNumeric", "${variable}: values must be numeric.", "#VALUE!"], 49: ["formulaFunctionValuesMustBeIntegers", "${variable}: values must be integers.", "#VALUE!"], 50: ["formulaFunctionUnsupportedValueType", "${variable}: unsupported value type.", "#VALUE!"], 51: ["formulaServiceCircularReference", "Circular reference.", "#CIRCREF!"], 52: ["formulaServiceExpectedParsableFormula", "Expected parsable formula.", "#PARSE!"], 53: ["formulaServiceInternalSchedulingError", "Internal scheduling error."], 54: ["formulaFunctionDivNonNumericArgument", "DIV: non-numeric argument.", "#VALUE!"], 55: ["formulaFunctionDivDivisionByZero", "DIV: division by zero.", "#DIV/0!"], 56: ["formulaFunctionSumCannotCombineDatesWithBigInt", "SUM: cannot combine dates with BigInt.", "#VALUE!"], 57: ["formulaFunctionSumRequiresAtLeastOneNumericValue", "SUM: requires at least one numeric value.", "#PARSE!"], 58: ["formulaFunctionAvgRequiresAtLeastOneValue", "AVG: requires at least one value."], 59: ["formulaFunctionMedianAllValuesMustBeNumbers", "MEDIAN: all values must be numbers.", "#VALUE!"], 60: ["formulaFunctionMedianRequiresAtLeastOneValue", "MEDIAN: requires at least one value."], 61: ["formulaFunctionSumifFirstArgumentMustBeRange", "SUMIF: first argument must be a range.", "#VALUE!"], 62: [ "formulaFunctionSumifSecondArgumentMustBeValue", "SUMIF: second argument must be a value (criteria).", "#VALUE!" ], 63: [ "formulaFunctionSumifThirdArgumentMustBeRange", "SUMIF: third argument must be a range (sum_range).", "#VALUE!" ], 64: ["formulaFunctionSumifRangesHaveDifferentSizes", "SUMIF: ranges have different sizes.", "#VALUE!"], 65: ["formulaFunctionCountifFirstArgumentMustBeRange", "COUNTIF: first argument must be a range.", "#VALUE!"], 66: [ "formulaFunctionCountifSecondArgumentMustBeValue", "COUNTIF: second argument must be a value (criteria).", "#VALUE!" ], 67: ["formulaFunctionConcatUnsupportedValueType", "CONCAT: unsupported value type.", "#VALUE!"], 68: ["formulaFunctionMinRequiresAtLeastOneValue", "MIN: requires at least one value."], 69: ["formulaFunctionMaxRequiresAtLeastOneValue", "MAX: requires at least one value."], 70: ["formulaFunctionPercentNonNumericArgument", "PERCENT: non-numeric argument.", "#VALUE!"], 71: ["formulaFunctionPowerNonNumericArgument", "POWER: non-numeric argument.", "#VALUE!"] }; var interpolateVariables = (template, variableValues) => { if (!variableValues?.length) { return template; } let localisedText = template; let found = 0; while (found < variableValues.length) { const idx = localisedText.indexOf("${variable}"); if (idx === -1) { break; } localisedText = localisedText.replace("${variable}", variableValues[found++]); } return localisedText; }; var normaliseVariableValues = (values) => { if (!values?.length) { return void 0; } return values.map((value) => String(value)); }; var getFormulaErrorDefinition = (errorId) => { return FORMULA_ERRORS[errorId]; }; var getFormulaErrorDefaultMessage = (errorId, variableValues) => { const [, defaultMessage] = getFormulaErrorDefinition(errorId); return interpolateVariables(defaultMessage, normaliseVariableValues(variableValues)); }; var translateFormulaError = (translate, errorId, variableValues) => { const [localeKey, defaultMessage] = getFormulaErrorDefinition(errorId); const normalizedVariableValues = normaliseVariableValues(variableValues); return translate(localeKey, defaultMessage, normalizedVariableValues); }; // packages/ag-grid-enterprise/src/formula/editor/formulaCellEditor.ts var FormulaCellEditor = class extends AgAbstractCellEditor { constructor() { super({ tag: "div", cls: "ag-cell-edit-wrapper" }); this.eEditor = RefPlaceholder; this.focusAfterAttached = false; } initialiseEditor(params) { const formulaInputField = this.createManagedBean(new AgFormulaInputField()); this.eEditor = formulaInputField; formulaInputField.addCss("ag-cell-editor"); this.appendChild(formulaInputField); this.addManagedElementListeners(formulaInputField.getContentElement(), { keydown: (event) => this.onFormulaInputKeyDown(event, params.onKeyDown) }); const { eventKey, cellStartedEdit } = params; let startValue; if (cellStartedEdit) { this.focusAfterAttached = true; if (eventKey === KeyCode.BACKSPACE || eventKey === KeyCode.DELETE) { startValue = ""; } else if (eventKey && eventKey.length === 1) { startValue = eventKey; } else { startValue = this.getStartValue(params); } } else { startValue = this.getStartValue(params); } const initialValue = startValue == null ? "" : String(startValue); this.eEditor.setEditingCellRef(params.column, params.rowIndex); this.eEditor.setValue(initialValue, true); } onFormulaInputKeyDown(event, onKeyDown) { const { key } = event; if (key !== KeyCode.TAB || event.defaultPrevented) { return; } const { focusSvc } = this.beans; const prevFocus = focusSvc?.getFocusedCell(); this.eEditor.withSelectionChangeHandlingSuppressed(() => { onKeyDown?.(event); }); const nextFocus = focusSvc?.getFocusedCell(); let focusChanged = false; if (prevFocus && nextFocus) { const { rowIndex: prevRowIndex, rowPinned: prevRowPinned, column: prevColumn } = prevFocus; const { rowIndex: nextRowIndex, rowPinned: nextRowPinned, column: nextColumn } = nextFocus; focusChanged = prevRowIndex !== nextRowIndex || prevRowPinned !== nextRowPinned || prevColumn !== nextColumn; } const { defaultPrevented } = event; if (defaultPrevented || focusChanged) { event.preventDefault(); } event.stopPropagation(); } getStartValue(params) { const { value } = params; return value?.toString() ?? value; } agSetEditValue(value) { this.params.value = value; const startValue = this.getStartValue(this.params); this.eEditor.setValue(startValue ?? "", true); } isPopup() { return false; } afterGuiAttached() { if (!this.focusAfterAttached) { return; } const { beans, eEditor } = this; if (!_isBrowserSafari()) { this.focusIn(); } _placeCaretAtEnd(beans, eEditor.getContentElement()); } focusIn() { this.eEditor.getContentElement().focus({ preventScroll: true }); } getValue() { const rawValue = this.eEditor.getCurrentValue(); const { value, parseValue } = this.params; if (typeof rawValue === "string" && this.isFormulaText(rawValue)) { return rawValue; } if (rawValue == null && value == null) { return value; } return parseValue(String(rawValue)); } getValidationElement() { return this.eEditor.getContentElement(); } getValidationErrors() { const { params } = this; const rawValue = this.eEditor.getCurrentValue(); const translate = this.getLocaleTextFunc(); const { getValidationErrors, validateFormulas } = params; let internalErrors = null; const shouldValidate = validateFormulas === true || !!getValidationErrors; if (shouldValidate && typeof rawValue === "string" && this.isFormulaText(rawValue)) { const normalised = this.beans.formula?.normaliseFormula(rawValue, true); if (!normalised) { internalErrors = [translateFormulaError(translate, 1)]; } } if (getValidationErrors) { return getValidationErrors({ value: this.getValue(), internalErrors, cellEditorParams: params }); } return internalErrors; } isFormulaText(value) { const text = value == null ? "" : String(value); return this.beans.formula?.isFormula(text) ?? text.trimStart().startsWith("="); } }; // packages/ag-grid-enterprise/src/formula/formula.css var formula_default = '.formula-error:after{background-color:var(--ag-invalid-color);content:"";height:12px;position:absolute;top:-6px;width:12px}:where(.ag-ltr) .formula-error:after{right:-6px;transform:rotate(45deg)}:where(.ag-rtl) .formula-error:after{left:-6px;transform:rotate(-45deg)}'; // packages/ag-grid-enterprise/src/formula/formulaDataService.ts var FormulaDataService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "formulaDataSvc"; this.hasSource = false; } postConstruct() { const dataSource = this.gos.get("formulaDataSource"); if (dataSource) { this.setDataSource(dataSource); } } hasDataSource() { return this.hasSource; } getFormula(params) { const formula = this.dataSource?.getFormula(params); return _isExpressionString(formula) ? formula : void 0; } setFormula(params) { this.dataSource?.setFormula(params); } setDataSource(dataSource) { this.dataSource = dataSource; this.hasSource = true; dataSource.init?.(this.createInitParams()); } createInitParams() { return _addGridCommonParams(this.gos, {}); } destroy() { this.dataSource?.destroy?.(); super.destroy(); } }; // packages/ag-grid-enterprise/src/formula/formulaInputManagerService.ts var FormulaInputManagerService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "formulaInputManager"; this.activeEditor = null; this.activeEditorDeactivate = null; } postConstruct() { this.registerRangeSelectionExtension(); } registerActiveEditor(editorId, onDeactivate) { if (this.activeEditor === editorId && this.activeEditorDeactivate === onDeactivate) { return false; } const previousDeactivate = this.activeEditorDeactivate; if (previousDeactivate && previousDeactivate !== onDeactivate) { previousDeactivate(); } this.activeEditor = editorId; this.activeEditorDeactivate = onDeactivate; return true; } unregisterActiveEditor(editorId, onDeactivate) { if (this.activeEditor === editorId && this.activeEditorDeactivate === onDeactivate) { this.activeEditor = null; this.activeEditorDeactivate = null; } } isActiveEditor(editorId) { return this.activeEditor === editorId; } shouldSuppressRangeSelection(eventTarget) { const target = eventTarget; if (!target?.closest) { return false; } if (this.activeEditor != null) { return !!target.closest(".ag-cell-editor"); } return !!target.closest(".ag-formula-input-field"); } registerRangeSelectionExtension() { const rangeSvc = this.beans.rangeSvc; if (!rangeSvc) { return; } rangeSvc.registerRangeSelectionExtension(this); this.addDestroyFunc(() => rangeSvc.unregisterRangeSelectionExtension?.(this)); } }; // packages/ag-grid-enterprise/src/formula/ast/operators.ts var OP_DEFS = [ { symbol: "%", fixity: "postfix", precedence: 100 }, { symbol: "-", fixity: "prefix", precedence: 90 }, { symbol: "+", fixity: "prefix", precedence: 90 }, { symbol: "^", fixity: "infix", precedence: 80, associativity: "right" }, { symbol: "*", fixity: "infix", precedence: 70, associativity: "left", isAssociative: true }, { symbol: "/", fixity: "infix", precedence: 70, associativity: "left" }, { symbol: "+", fixity: "infix", precedence: 60, associativity: "left", isAssociative: true }, { symbol: "-", fixity: "infix", precedence: 60, associativity: "left" }, { symbol: "&", fixity: "infix", precedence: 55, associativity: "left", isAssociative: true }, { symbol: "=", fixity: "infix", precedence: 50, associativity: "left" }, { symbol: "<>", fixity: "infix", precedence: 50, associativity: "left" }, { symbol: ">=", fixity: "infix", precedence: 50, associativity: "left" }, { symbol: "<=", fixity: "infix", precedence: 50, associativity: "left" }, { symbol: ">", fixity: "infix", precedence: 50, associativity: "left" }, { symbol: "<", fixity: "infix", precedence: 50, associativity: "left" } ]; var symbolOperatorMap = /* @__PURE__ */ new Map(); for (const d of OP_DEFS) { const s2 = symbolOperatorMap.get(d.symbol) ?? []; s2.push(d); symbolOperatorMap.set(d.symbol, s2); } function getDefBySymbol(symbol, fixity) { const arr = symbolOperatorMap.get(symbol) ?? []; return fixity ? arr.find((d) => d.fixity === fixity) : arr[0]; } var OP_SYMBOLS_DESC = [...new Set(OP_DEFS.map((d) => d.symbol))].sort((a, b) => b.length - a.length); var OP_BY_SYMBOL = symbolOperatorMap; // packages/ag-grid-enterprise/src/formula/ast/utils.ts var normaliseVariableValues2 = (values) => { if (!values?.length) { return void 0; } return values.map((value) => String(value)); }; var FormulaError = class extends Error { constructor(messageOrErrorId, typeOrVariableValues, typeOverride) { const isMessage = typeof messageOrErrorId === "string"; const variableValues = !isMessage && Array.isArray(typeOrVariableValues) ? normaliseVariableValues2(typeOrVariableValues) : void 0; const resolvedMessage = isMessage ? messageOrErrorId : getFormulaErrorDefaultMessage(messageOrErrorId, variableValues); super(resolvedMessage); this.name = "FormulaError"; if (isMessage) { this.type = typeof typeOrVariableValues === "string" ? typeOrVariableValues : "#ERROR!"; this.errorId = null; this.localeKey = null; this.defaultMessage = messageOrErrorId; this.variableValues = void 0; } else { const [localeKey, defaultMessage, defaultType] = getFormulaErrorDefinition(messageOrErrorId); this.type = typeOverride ?? defaultType ?? "#ERROR!"; this.errorId = messageOrErrorId; this.localeKey = localeKey; this.defaultMessage = defaultMessage; this.variableValues = variableValues; } } getTranslatedMessage(translate) { if (!this.localeKey) { return this.message; } return translate(this.localeKey, this.defaultMessage, this.variableValues); } }; var FormulaParseError = class extends FormulaError { constructor(errorId, errorStart, errorEnd, variableValues) { super(errorId, variableValues, "#PARSE!"); this.errorStart = errorStart; this.errorEnd = errorEnd; } }; // packages/ag-grid-enterprise/src/formula/ast/parsers.ts var parseOperand = (beans, operand, unsafe) => { const trimmed = operand.trim(); if (trimmed.startsWith('"') && trimmed.endsWith('"') && trimmed.length > 2) { return trimmed.slice(1, -1); } if (trimmed.toLowerCase() === "true") { return true; } if (trimmed.toLowerCase() === "false") { return false; } const num = Number(trimmed); if (!isNaN(num)) { return num; } const parsed = parseA1Ref(trimmed); if (parsed) { const { startCol, startRow, startColAbsolute, startRowAbsolute, endCol, endRow, endColAbsolute, endRowAbsolute } = parsed; const toCell = (colAbs, colStr, rowAbs, rowStr, unsafe2) => { const col = colAbs || unsafe2 ? colStr.toUpperCase() : beans.formula?.getColByRef(colStr)?.colId; const row = rowAbs || unsafe2 ? rowStr : _getClientSideRowModel(beans)?.getFormulaRow(Number(rowStr) - 1)?.id; if (col == null || row == null) { throw new FormulaParseError(2, 0, 0, [trimmed]); } return { column: { id: col, absolute: colAbs }, row: { id: row, absolute: rowAbs } }; }; const start = toCell(startColAbsolute, startCol, startRowAbsolute, startRow, unsafe); if (endCol && endRow) { const end = toCell(endColAbsolute ?? false, endCol, endRowAbsolute ?? false, endRow, unsafe); start.endColumn = end.column; start.endRow = end.row; } return start; } return null; }; function tokenize2(expr) { const tokens = []; let i = 0; const lexCellRange = (s2, start) => { let j = start; const dollar = () => s2[j] === "$" ? (j++, true) : false; const letters = () => { const k = j; while (j < s2.length && /[A-Za-z]/.test(s2[j])) { j++; } return j > k; }; const digits = () => { const k = j; while (j < s2.length && /[0-9]/.test(s2[j])) { j++; } return j > k; }; const parseCell = () => { const j0 = j; dollar(); if (!letters()) { j = j0; return false; } dollar(); if (!digits()) { j = j0; return false; } return true; }; if (!parseCell()) { return 0; } if (s2[j] === ":") { const colonPos = j; j++; if (!parseCell()) { throw new FormulaParseError(3, colonPos, j); } } const ref = s2.slice(start, j); if (!isStandaloneRefToken(s2, start, ref)) { return 0; } return j - start; }; while (i < expr.length) { const ch = expr[i]; if (/\s/.test(ch)) { i++; continue; } if (ch === '"') { let j = i + 1; while (j < expr.length && expr[j] !== '"') { j++; } if (j >= expr.length) { throw new FormulaParseError(4, i, expr.length); } tokens.push(expr.slice(i, j + 1)); i = j + 1; continue; } if (/[0-9]/.test(ch) || ch === "." && /[0-9]/.test(expr[i + 1])) { let j = i + 1; while (j < expr.length && /[0-9.]/.test(expr[j])) { j++; } tokens.push(expr.slice(i, j)); i = j; continue; } if (ch === "$" || isFormulaIdentStart(ch)) { const len = lexCellRange(expr, i); if (len > 0) { tokens.push(expr.slice(i, i + len)); i += len; continue; } let j = i + 1; while (j < expr.length && isFormulaIdentChar(expr[j])) { j++; } tokens.push(expr.slice(i, j)); i = j; continue; } if (ch === "(" || ch === ")" || ch === ",") { tokens.push(ch); i++; continue; } const firstMatch = OP_SYMBOLS_DESC.find((sym) => expr.startsWith(sym, i)); if (!firstMatch) { throw new FormulaParseError(5, i, i + 1, [ch]); } tokens.push(firstMatch); i += firstMatch.length; } return tokens; } function shouldReduce(top, incoming) { if (top.fixity !== "infix" || incoming.fixity !== "infix") { return true; } if (top.associativity === "right" && top.precedence === incoming.precedence) { return false; } return top.precedence >= incoming.precedence; } function pickOpDefForContext(symbol, prevToken) { const defs = OP_BY_SYMBOL.get(symbol); if (!defs) { return null; } const prevIsOperator = prevToken !== void 0 && OP_BY_SYMBOL.has(prevToken); const prevIsOpenOrComma = prevToken === "(" || prevToken === ","; const prevIsValueLike = prevToken !== void 0 && !prevIsOperator && !prevIsOpenOrComma && prevToken !== "("; if (prevIsValueLike || prevToken === ")") { return defs.find((d) => d.fixity === "postfix") ?? defs.find((d) => d.fixity === "infix") ?? null; } return defs.find((d) => d.fixity === "prefix") ?? defs.find((d) => d.fixity === "infix") ?? null; } function parseExpression(beans, expr, unsafe) { const tokens = tokenize2(expr); const output = []; const ops = []; const applyTop = () => { const frame = ops.pop(); if (!frame) { throw new FormulaParseError(6, 0, 0); } if (frame.kind === "op") { const def = frame.def; if (def.fixity !== "infix") { const right2 = output.pop(); if (!right2) { throw new FormulaParseError(7, 0, 0, [def.symbol]); } if (def.symbol === "+" && def.fixity === "prefix") { output.push(right2); return; } if (def.fixity === "postfix" && def.symbol === "%") { output.push({ type: "operation", operation: def.symbol, operands: [right2] }); return; } if (def.symbol === "-" && def.fixity === "prefix") { output.push({ type: "operation", operation: "-", operands: [{ type: "operand", value: 0 }, right2] }); } else { output.push({ type: "operation", operation: def.symbol, operands: [right2] }); } return; } const right = output.pop(); const left = output.pop(); if (!left || !right) { throw new FormulaParseError(7, 0, 0, [def.symbol]); } output.push({ type: "operation", operation: def.symbol, operands: [left, right] }); return; } throw new FormulaParseError(8, 0, 0); }; let i = 0; while (i < tokens.length) { const token = tokens[i]; if (isFormulaIdentStart(token[0]) && tokens[i + 1] === "(") { const name = token; ops.push({ kind: "function", name, args: [] }); ops.push({ kind: "parenthesis", outLen: output.length }); i += 2; continue; } if (token === "(") { ops.push({ kind: "parenthesis", outLen: output.length }); i++; continue; } if (token === ",") { while (true) { const top = ops[ops.length - 1]; if (!top || top.kind === "parenthesis") { break; } if (top.kind === "op") { applyTop(); } else { throw new FormulaParseError(9, i, i + 1); } } const paren = ops[ops.length - 1]; if (!paren || paren.kind !== "parenthesis") { throw new FormulaParseError(10, i, i + 1); } const maybeFunction = ops[ops.length - 2]; if (!maybeFunction || maybeFunction.kind !== "function") { throw new FormulaParseError(11, i, i + 1); } if (output.length > paren.outLen) { maybeFunction.args.push(output.pop()); } i++; continue; } if (token === ")") { while (true) { const top = ops[ops.length - 1]; if (!top || top.kind === "parenthesis") { break; } if (top.kind === "op") { applyTop(); } else { throw new FormulaParseError(12, i, i + 1); } } const paren = ops[ops.length - 1]; if (!paren || paren.kind !== "parenthesis") { throw new FormulaParseError(13, i, i + 1); } const parenOutLen = paren.outLen; ops.pop(); if (ops[ops.length - 1]?.kind === "function") { const fn = ops.pop(); if (output.length > parenOutLen) { fn.args.push(output.pop()); } output.push({ type: "operation", operation: fn.name, operands: fn.args }); } i++; continue; } const incoming = OP_BY_SYMBOL.has(token) ? pickOpDefForContext(token, tokens[i - 1]) : null; if (incoming) { while (true) { const top = ops[ops.length - 1]; if (!top || top.kind !== "op") { break; } if (shouldReduce(top.def, incoming)) { applyTop(); } else { break; } } ops.push({ kind: "op", def: incoming }); i++; continue; } const parsed = parseOperand(beans, token, unsafe); if (parsed == null) { throw new FormulaParseError(14, 0, token.length, [token]); } output.push({ type: "operand", value: parsed }); i++; } while (ops.length) { const top = ops[ops.length - 1]; if (top.kind === "op") { applyTop(); } else { throw new FormulaParseError(15, 0, 0); } } if (output.length !== 1) { throw new FormulaParseError(16, 0, 0); } return output[0]; } var parseFormula = (beans, formula, unsafe = false) => { if (!_isExpressionString(formula)) { throw new FormulaParseError(17, 0, 1); } const body = formula.slice(1).trim(); return normalizeRefCells(parseExpression(beans, body, unsafe)); }; function isOperation(node, name) { return node.type === "operation" && node.operation.toUpperCase() === name.toUpperCase(); } function asBool(node, def = false) { if (!node) { return def; } if (node.type !== "operand") { return def; } return !!node.value; } function asStringish(node) { if (!node || node.type !== "operand") { return null; } const v = node.value; if (typeof v === "string") { return v; } if (typeof v === "number" || typeof v === "boolean") { return String(v); } return null; } function extractColumnRef(node) { if (!isOperation(node, "COLUMN")) { return null; } const id = asStringish(node.operands[0]); if (id == null) { return null; } const absolute = asBool(node.operands[1], false); return { id, absolute }; } function extractRowRef(node) { if (!isOperation(node, "ROW")) { return null; } const id = asStringish(node.operands[0]); if (id == null) { return null; } const absolute = asBool(node.operands[1], false); return { id, absolute }; } function tryFoldRefToCell(node) { if (!isOperation(node, "REF")) { return null; } const ops = node.operands; if (ops.length !== 2 && ops.length !== 4) { return null; } const col1 = extractColumnRef(ops[0]); const row1 = extractRowRef(ops[1]); if (!col1 || !row1) { return null; } const cell = { column: col1, row: row1 }; if (ops.length === 4) { const col2 = extractColumnRef(ops[2]); const row2 = extractRowRef(ops[3]); if (!col2 || !row2) { return null; } cell.endColumn = col2; cell.endRow = row2; } return { type: "operand", value: cell }; } function normalizeRefCells(node) { if (node.type === "operation") { const normalizedOperands = node.operands.map(normalizeRefCells); const rebuilt = { type: "operation", operation: node.operation, operands: normalizedOperands }; const folded = tryFoldRefToCell(rebuilt); return folded ?? rebuilt; } return node; } // packages/ag-grid-enterprise/src/formula/ast/serializer.ts var isOperationNode = (n) => n.type === "operation"; function colLabelFromId(beans, colId) { const col = beans.colModel.getColById(colId); if (col) { return beans.formula?.getColRef(col) ?? null; } return null; } function colIdFromLabel(beans, label) { return beans.formula?.getColByRef?.(label)?.colId ?? null; } function colIndexFromId(colModel, cols, colId) { const col = colModel.getColById(colId); if (!col) { return null; } const i = cols.indexOf(col); return i >= 0 ? i : null; } function colIdFromIndex(cols, idx) { const col = cols[idx]; return col ? col.getId() ?? null : null; } function rowIndexFromId(beans, rowId) { const row = beans.rowModel?.getRowNode?.(rowId); if (row?.formulaRowIndex != null) { return row.formulaRowIndex + 1; } return null; } function rowIdFromIndex(beans, idx) { return _getClientSideRowModel(beans)?.getFormulaRow?.(idx - 1)?.id ?? null; } function quoteString(s2) { if (s2.includes('"')) { throw new FormulaError(18); } return `"${s2}"`; } function columnValueForREF(beans, ref) { const looksLetters = /^[A-Za-z]+$/.test(ref.id); if (ref.absolute) { if (looksLetters) { return ref.id.toUpperCase(); } const label = colLabelFromId(beans, ref.id); if (label) { return label.toUpperCase(); } throw new FormulaError(19, [ref.id]); } else { if (looksLetters) { const id = colIdFromLabel(beans, ref.id); if (id) { return id; } } return ref.id; } } function rowValueForREF(beans, ref) { const { id, absolute } = ref; if (absolute) { const rowId = rowIdFromIndex(beans, Number(id)); if (rowId == null) { throw new FormulaError(20, [id]); } } else { const idx = rowIndexFromId(beans, id); if (idx == null) { throw new FormulaError(21, [id]); } } return id; } function columnLabelForA1(beans, ref) { if (ref.absolute) { return ref.id; } const label = colLabelFromId(beans, ref.id); if (label) { return label.toUpperCase(); } throw new FormulaError(22, [ref.id]); } function rowIndexForA1(beans, ref) { if (ref.absolute) { const idx2 = Number(ref.id); if (Number.isFinite(idx2) && idx2 >= 1) { return idx2; } throw new FormulaError(23, [ref.id]); } const idx = rowIndexFromId(beans, ref.id); if (idx != null) { return idx; } throw new FormulaError(24, [ref.id]); } function serializeCellA1(beans, cell, unsafe) { const a = (abs, x) => (abs ? "$" : "") + String(x); const col1 = unsafe ? cell.column.id : columnLabelForA1(beans, cell.column); const row1 = unsafe ? cell.row.id : rowIndexForA1(beans, cell.row); const startRef = a(cell.column.absolute, col1) + a(cell.row.absolute, row1); if (cell.endColumn && cell.endRow) { const col2 = unsafe ? cell.endColumn.id : columnLabelForA1(beans, cell.endColumn); const row2 = unsafe ? cell.endRow.id : rowIndexForA1(beans, cell.endRow); return `${startRef}:${a(cell.endColumn.absolute, col2)}${a(cell.endRow.absolute, row2)}`; } return startRef; } function serializeCellREF(beans, cell) { const colPart = (r) => `COLUMN(${quoteString(columnValueForREF(beans, r))}${r.absolute ? ",true" : ""})`; const rowPart = (r) => `ROW(${quoteString(rowValueForREF(beans, r))}${r.absolute ? ",true" : ""})`; const start = `REF(${colPart(cell.column)},${rowPart(cell.row)}`; if (cell.endColumn && cell.endRow) { return `${start},${colPart(cell.endColumn)},${rowPart(cell.endRow)})`; } return `${start})`; } function isUnaryMinusNode(node) { if (!isOperationNode(node) || node.operation !== "-" || node.operands.length !== 2) { return null; } const [left, right] = node.operands; if (left.type === "operand" && left.value === 0) { return right; } return null; } function isInfixOpNode(node) { if (!isOperationNode(node)) { return false; } return !!getDefBySymbol(node.operation, "infix"); } function needsParensInBinary(parentDef, child, side) { if (!isOperationNode(child)) { return false; } if (isUnaryMinusNode(child)) { return false; } const childDef = getDefBySymbol(child.operation, "infix"); if (!childDef || childDef.fixity !== "infix") { return false; } const pParent = parentDef.precedence; const pChild = childDef.precedence; if (pChild < pParent) { return true; } if (pChild > pParent) { return false; } if (parentDef.associativity === "right") { const sameOp = childDef.symbol === parentDef.symbol; return side === "left" && sameOp; } const parentAssociative = parentDef.isAssociative === true; if (!parentAssociative) { return side === "right"; } return false; } function needsParensForUnaryMinus(rhs) { if (!isOperationNode(rhs)) { return false; } const innerInfix = getDefBySymbol(rhs.operation, "infix"); if (!innerInfix) { return false; } const isPow = innerInfix.symbol === "^"; return !isPow; } function serializeFormula(beans, root, useRefFormat, unsafe) { const emitCell = (cell) => useRefFormat ? serializeCellREF(beans, cell) : serializeCellA1(beans, cell, unsafe); function emit(node) { if (node.type === "operand") { const v = node.value; if (typeof v === "string") { return quoteString(v); } if (typeof v === "number") { return String(v); } if (typeof v === "boolean") { return v ? "TRUE" : "FALSE"; } return emitCell(v); } const unaryMinusInner = isUnaryMinusNode(node); if (unaryMinusInner) { const s2 = emit(unaryMinusInner); return needsParensForUnaryMinus(unaryMinusInner) ? `-(${s2})` : `-${s2}`; } const op = node.operation.toUpperCase(); if (node.operands.length === 1) { const rhs = node.operands[0]; const post = getDefBySymbol(op, "postfix"); if (post) { return `${emit(rhs)}${post.symbol}`; } const pre = getDefBySymbol(op, "prefix"); if (pre) { const inner = emit(rhs); const need = isInfixOpNode(rhs); return need ? `${pre.symbol}(${inner})` : `${pre.symbol}${inner}`; } return `${op}(${emit(rhs)})`; } if (node.operands.length === 2) { const def = getDefBySymbol(op, "infix"); if (def) { const [l, r] = node.operands; const Ls = needsParensInBinary(def, l, "left") ? `(${emit(l)})` : emit(l); const Rs = needsParensInBinary(def, r, "right") ? `(${emit(r)})` : emit(r); return `${Ls}${def.symbol}${Rs}`; } } return `${op}(${node.operands.map(emit).join(",")})`; } return "=" + emit(root); } // packages/ag-grid-enterprise/src/formula/functions/resolver.ts function isRangeCell(cell) { return !!(cell.endColumn && cell.endRow); } function resolveRefToAddress(beans, cell) { const { row, column } = cell; const rowNode = row.absolute ? _getClientSideRowModel(beans)?.getFormulaRow(Number(row.id) - 1) : beans.rowModel.getRowNode(row.id); const agCol = column.absolute ? beans.formula.getColByRef(column.id) : beans.colModel.getColById(column.id); if (!rowNode || !agCol) { return null; } return { row: rowNode, column: agCol }; } function evalAst(beans, node, getCellValue2, caller) { if (node.type === "operand") { const v = node.value; if (typeof v !== "object") { return v; } if (isRangeCell(v)) { throw new FormulaError(25); } const addr = resolveRefToAddress(beans, v); if (!addr) { throw new FormulaError(26); } return getCellValue2(addr); } const fn = beans.formula?.getFunction(node.operation); if (!fn) { throw new FormulaError(27, [node.operation]); } const { args, values } = makeArgIterables(beans, node.operands, getCellValue2, caller); return fn({ row: caller.row, column: caller.column, args, values }); } function operandToArg(beans, node, getCellValue2, caller) { if (node.type === "operand") { const v = node.value; if (typeof v !== "object") { return { kind: "value", value: v }; } if (isRangeCell(v)) { return buildRangeArgLazy(beans, v, getCellValue2); } const addr = resolveRefToAddress(beans, v); if (!addr) { throw new FormulaError(26); } return { kind: "value", value: getCellValue2(addr) }; } const val = evalAst(beans, node, getCellValue2, caller); return { kind: "value", value: val }; } var ParamsIterator = class { constructor(beans, operandNodes, getCellValue2, caller) { this.beans = beans; this.operandNodes = operandNodes; this.getCellValue = getCellValue2; this.caller = caller; this.i = 0; this.res = { done: false, value: void 0 }; } next() { if (this.i >= this.operandNodes.length) { this.res.done = true; this.res.value = void 0; return this.res; } this.res.done = false; this.res.value = operandToArg(this.beans, this.operandNodes[this.i++], this.getCellValue, this.caller); return this.res; } [Symbol.iterator]() { return this; } }; var ValuesIterator = class { constructor(beans, operandNodes, getCellValue2, caller) { this.beans = beans; this.operandNodes = operandNodes; this.getCellValue = getCellValue2; this.caller = caller; this.i = 0; this.inner = null; this.res = { done: false, value: void 0 }; } next() { while (true) { if (this.inner) { const step = this.inner.next(); if (!step.done) { this.res.done = false; this.res.value = step.value; return this.res; } this.inner = null; continue; } if (this.i >= this.operandNodes.length) { this.res.done = true; this.res.value = void 0; return this.res; } const arg = operandToArg(this.beans, this.operandNodes[this.i++], this.getCellValue, this.caller); if (arg.kind === "value") { this.res.done = false; this.res.value = arg.value; return this.res; } this.inner = arg[Symbol.iterator](); } } [Symbol.iterator]() { return this; } }; function makeArgIterables(beans, operandNodes, getCellValue2, caller) { const args = { [Symbol.iterator]() { return new ParamsIterator(beans, operandNodes, getCellValue2, caller); } }; const values = { [Symbol.iterator]() { return new ValuesIterator(beans, operandNodes, getCellValue2, caller); } }; return { args, values }; } function resolveRowIndex(beans, ref) { if (ref.absolute) { const n = Number(ref.id) - 1; if (!Number.isFinite(n) || n < 0) { throw new FormulaError(28); } return n; } const node = beans.rowModel?.getRowNode?.(ref.id); if (node?.formulaRowIndex == null) { throw new FormulaError(29); } return node.formulaRowIndex; } function resolveCol(beans, ref) { if (ref.absolute) { const col2 = beans.formula?.getColByRef(ref.id); if (!col2) { throw new FormulaError(30); } return col2; } const col = beans.colModel.getColById(ref.id); if (!col) { throw new FormulaError(31); } return col; } var RangeValuesIterator = class { constructor(beans, rowStartIndex, rowEndIndex, colStart, colEnd, getCellValue2) { this.beans = beans; this.rowStartIndex = rowStartIndex; this.rowEndIndex = rowEndIndex; this.colStart = colStart; this.colEnd = colEnd; this.getCellValue = getCellValue2; this.cols = null; this.currentRowIndex = this.rowStartIndex; this.currentColIdx = -1; this.colStartIdx = -1; this.colEndIdx = -1; this.res = { done: false, value: void 0 }; } initColsOnce() { if (this.cols) { return; } this.cols = this.beans.colModel.getCols() ?? []; const range = getColRangeIndices(this.beans, this.colStart, this.colEnd); if (!range) { this.colStartIdx = -1; this.colEndIdx = -1; return; } [this.colStartIdx, this.colEndIdx] = range; this.currentColIdx = this.colStartIdx; } next() { if (!this.cols) { this.initColsOnce(); if (this.colStartIdx < 0) { this.res.done = true; return this.res; } } if (this.currentRowIndex <= this.rowEndIndex) { const row = _getClientSideRowModel(this.beans)?.getFormulaRow(this.currentRowIndex); if (!row) { throw new FormulaError(32); } const col = this.cols[this.currentColIdx]; if (this.currentColIdx < this.colEndIdx) { this.currentColIdx++; } else { this.currentColIdx = this.colStartIdx; this.currentRowIndex++; } this.res.value = this.getCellValue({ row, column: col }); return this.res; } this.res.done = true; this.res.value = void 0; return this.res; } }; function buildRangeArgLazy(beans, cell, getCellValue2) { const r1 = resolveRowIndex(beans, cell.row); const r2 = cell.endRow ? resolveRowIndex(beans, cell.endRow) : r1; const rowStart = Math.min(r1, r2); const rowEnd = Math.max(r1, r2); const c1 = resolveCol(beans, cell.column); const c2 = cell.endColumn ? resolveCol(beans, cell.endColumn) : c1; return { kind: "range", rowStart, rowEnd, colStart: c1, colEnd: c2, [Symbol.iterator]() { return new RangeValuesIterator(beans, rowStart, rowEnd, c1, c2, getCellValue2); } }; } function getColRangeIndices(beans, c1, c2) { const allColumns = beans.colModel.getCols() ?? []; let startColIndex = null; let endColIndex = null; for (let i = 0; i < allColumns.length && (startColIndex === null || endColIndex === null); i++) { const column = allColumns[i]; if (column === c2) { endColIndex = i; } if (column === c1) { startColIndex = i; } if (endColIndex !== null && startColIndex !== null) { break; } } if (startColIndex === null || endColIndex === null) { return null; } const colIndexMin = Math.min(startColIndex, endColIndex); const colIndexMax = Math.max(startColIndex, endColIndex); return [colIndexMin, colIndexMax]; } function* rangeAddrs(beans, rowStartIndex, rowEndIndex, startColumn, endColumn) { const allColumns = beans.colModel.getCols() ?? []; const colRange = getColRangeIndices(beans, startColumn, endColumn); if (colRange == null) { return; } const [colIndexMin, colIndexMax] = colRange; for (let rowIndex = rowStartIndex; rowIndex <= rowEndIndex; rowIndex++) { const rowNode = _getClientSideRowModel(beans)?.getFormulaRow(rowIndex); if (!rowNode) { continue; } for (let colIndex = colIndexMin; colIndex <= colIndexMax; colIndex++) { yield { row: rowNode, column: allColumns[colIndex] }; } } } function* unresolvedDeps(beans, root, ensureFormulaCache) { const astStack = [root]; while (astStack.length) { const currentNode = astStack.pop(); if (currentNode.type === "operand") { const operandValue = currentNode.value; if (typeof operandValue !== "object" || operandValue == null) { continue; } if (!operandValue.endColumn && !operandValue.endRow) { const cellAddress = resolveRefToAddress(beans, operandValue); if (!cellAddress) { throw new FormulaError(33); } const cachedCellFormula = ensureFormulaCache(cellAddress.row, cellAddress.column); if (!cachedCellFormula || cachedCellFormula.isValueReady()) { continue; } yield cellAddress; continue; } if (!operandValue.endColumn || !operandValue.endRow) { throw new FormulaError(34); } const firstRowIndex = resolveRowIndex(beans, operandValue.row); const secondRowIndex = resolveRowIndex(beans, operandValue.endRow); const rowStartIndex = Math.min(firstRowIndex, secondRowIndex); const rowEndIndex = Math.max(firstRowIndex, secondRowIndex); const startCol = resolveCol(beans, operandValue.column); const endCol = resolveCol(beans, operandValue.endColumn); for (const cellAddress of rangeAddrs(beans, rowStartIndex, rowEndIndex, startCol, endCol)) { const cachedCellFormula = ensureFormulaCache(cellAddress.row, cellAddress.column); if (!cachedCellFormula || cachedCellFormula.isValueReady()) { continue; } yield cellAddress; } continue; } for (let i = 0; i < currentNode.operands.length; i++) { astStack.push(currentNode.operands[i]); } } } // packages/ag-grid-enterprise/src/formula/functions/utils.ts function take(values, name, n) { const it = values[Symbol.iterator](); const out = new Array(n); for (let i = 0; i < n; i++) { const step = it.next(); if (step.done) { throw new FormulaError(35, [name, n]); } out[i] = step.value; } if (!it.next().done) { throw new FormulaError(35, [name, n]); } return out; } function iterableWithoutBlanks(values) { return { *[Symbol.iterator]() { for (const v of values) { if (v != null && v !== "") { yield v; } } } }; } function takeBetween(values, name, min, max) { const out = []; for (const v of values) { out.push(v); if (out.length > max) { throw new FormulaError(36, [name, max]); } } if (out.length < min) { throw new FormulaError(37, [name, min]); } return out; } var isRangeParam = (p) => { return p.kind === "range"; }; var isValueParam = (p) => { return p.kind === "value"; }; var OPERATOR_TOKENS = ["<=", ">=", "<>", "<", ">", "="]; function findOperatorSymbol(s2) { for (const tok of OPERATOR_TOKENS) { if (s2.startsWith(tok)) { return tok; } } return null; } function toNumberLike(x) { if (typeof x === "number" && Number.isFinite(x)) { return x; } if (x instanceof Date) { return +x; } if (typeof x === "string") { const num = Number(x); if (!Number.isNaN(num)) { return num; } } return null; } function toText(x) { if (x == null) { return ""; } switch (typeof x) { case "string": return x; case "number": return String(x); case "boolean": return x ? "TRUE" : "FALSE"; } if (x instanceof Date) { return String(+x); } return String(x); } function wildcardToRegExp(pattern) { let out = "^"; for (let i = 0; i < pattern.length; i++) { const ch = pattern[i]; if (ch === "~" && i + 1 < pattern.length && (pattern[i + 1] === "*" || pattern[i + 1] === "?")) { out += "\\" + pattern[++i]; continue; } if (ch === "*") { out += ".*"; continue; } if (ch === "?") { out += "."; continue; } if (/[-/\\^$*+?.()|[\]{}]/.test(ch)) { out += "\\" + ch; } else { out += ch; } } out += "$"; return new RegExp(out, "i"); } var COMPARE_VALUES = (op, query, cell) => { let queryVal = toNumberLike(query); let cellVal = toNumberLike(cell); if (queryVal == null || cellVal == null) { queryVal = query; cellVal = toText(cell).toUpperCase(); } switch (op) { case "<": return cellVal < queryVal; case ">": return cellVal > queryVal; case "<=": return cellVal <= queryVal; case ">=": return cellVal >= queryVal; case "=": return cellVal === queryVal; case "<>": return cellVal !== queryVal; } return false; }; var REGEX_COMPARE_VALUES = (op, rx, cell) => { const text = toText(cell); const match = rx.test(text); return op === "=" ? match : !match; }; var EMPTY_PREDICATE = (cell) => cell == null || cell === ""; function criteriaToPredicate(criteria) { if (typeof criteria === "number") { return (cell) => toNumberLike(cell) === criteria; } if (typeof criteria !== "string") { return (cell) => criteria === cell; } const trimmed = criteria.trim(); if (trimmed === "") { return EMPTY_PREDICATE; } const symbol = findOperatorSymbol(trimmed); const query = symbol ? trimmed.substring(symbol.length) : trimmed; const wildcard = /[*?]/.test(query); if (!wildcard) { return COMPARE_VALUES.bind(null, symbol ?? "=", query.toUpperCase()); } if (symbol && symbol !== "=" && symbol !== "<>") { throw new FormulaError(38); } const regexp = wildcardToRegExp(query); return REGEX_COMPARE_VALUES.bind(null, symbol ?? "=", regexp); } var shiftColRef = (beans, delta, ref) => { if (!ref || delta === 0 || ref.absolute) { return; } const { visibleCols, colModel } = beans; const cols = visibleCols.allCols; const i0 = colIndexFromId(colModel, cols, ref.id); if (i0 == null) { return; } const j0 = i0 + delta; if (j0 < 0) { return; } const nextId = colIdFromIndex(cols, j0); if (nextId) { ref.id = nextId; } }; var shiftRowRef = (beans, rowDelta, ref, unsafe) => { if (!ref || rowDelta === 0 || ref.absolute) { return; } if (unsafe) { const numericId = Number(ref.id); if (!Number.isFinite(numericId)) { return; } ref.id = String(numericId + rowDelta); return; } const idx1 = rowIndexFromId(beans, ref.id); if (idx1 == null) { return; } const next1 = idx1 + rowDelta; if (next1 < 1) { return; } const nextId = rowIdFromIndex(beans, next1); if (nextId) { ref.id = nextId; } }; var isCellOperand = (value) => { return !!value && typeof value === "object" && value !== null && "row" in value && "column" in value; }; var shiftNode = (beans, node, rowDelta, columnDelta, unsafe) => { if (node.type === "operand") { const { value } = node; if (!isCellOperand(value)) { return; } const { row, column, endRow, endColumn } = value; shiftRowRef(beans, rowDelta, row, unsafe); shiftColRef(beans, columnDelta, column); shiftRowRef(beans, rowDelta, endRow, unsafe); shiftColRef(beans, columnDelta, endColumn); return; } if (node.type === "operation") { for (const child of node.operands) { shiftNode(beans, child, rowDelta, columnDelta, unsafe); } } }; // packages/ag-grid-enterprise/src/formula/functions/counting/functions.ts var COUNT = ({ values }) => { let count = 0; for (const v of values) { if (v != null && v !== "" && !isNaN(v)) { count++; } } return count; }; var COUNTA = ({ values }) => { let count = 0; for (const v of values) { if (v != null && v !== "") { count++; } } return count; }; var COUNTBLANK = ({ values }) => { let count = 0; for (const v of values) { if (v == null || v === "") { count++; } } return count; }; var COUNTIF = ({ args }) => { const [range, criteria] = take(args, "COUNTIF", 2); if (!isRangeParam(range)) { throw new FormulaError(65); } if (!isValueParam(criteria)) { throw new FormulaError(66); } const pred = criteriaToPredicate(criteria.value); let count = 0; for (const v of range) { if (pred(v)) { count++; } } return count; }; // packages/ag-grid-enterprise/src/formula/functions/dates/functions.ts var NOW = () => /* @__PURE__ */ new Date(); var TODAY = () => { const now = /* @__PURE__ */ new Date(); return new Date(now.getFullYear(), now.getMonth(), now.getDate()); }; // packages/ag-grid-enterprise/src/formula/functions/logic/functions.ts var EQUALS = ({ values }) => { const [a, b] = take(values, "EQUALS", 2); return a === b; }; var NOT_EQUALS = ({ values }) => { const [a, b] = take(values, "NOT_EQUALS", 2); return a !== b; }; var GT = ({ values }) => { const [a, b] = take(values, "GT", 2); return a > b; }; var GTE = ({ values }) => { const [a, b] = take(values, "GTE", 2); return a >= b; }; var LT = ({ values }) => { const [a, b] = take(values, "LT", 2); return a < b; }; var LTE = ({ values }) => { const [a, b] = take(values, "LTE", 2); return a <= b; }; var IF = ({ values }) => { const [cond, valTrue, valFalse] = take(values, "IF", 3); return cond ? valTrue : valFalse; }; var MIN = ({ values }) => { let best = null; for (const v of values) { if (v == null) { continue; } if (best === null || v < best) { best = v; } } if (best === null) { throw new FormulaError(68); } return best; }; var MAX = ({ values }) => { let best = null; for (const v of values) { if (v == null) { continue; } if (best === null || v > best) { best = v; } } if (best === null) { throw new FormulaError(69); } return best; }; // packages/ag-grid-enterprise/src/formula/functions/numbers/utils.ts var isFiniteNumber = (v) => typeof v === "number" && Number.isFinite(v); var MS_PER_DAY = 24 * 60 * 60 * 1e3; function daysFromDate(d) { return d.getTime() / MS_PER_DAY; } function dateFromDays(n) { return new Date(n * MS_PER_DAY); } function isDateValue(v) { return v instanceof Date; } function coerceFiniteNumber(fname, v) { if (typeof v === "bigint") { const asNumber = Number(v); if (Number.isFinite(asNumber)) { return asNumber; } throw new FormulaError(48, [fname]); } if (isFiniteNumber(v)) { return v; } if (isDateValue(v)) { return daysFromDate(v); } if (typeof v === "boolean") { return v ? 1 : 0; } if (typeof v === "string") { const n = Number(v.trim()); if (Number.isFinite(n)) { return n; } } throw new FormulaError(48, [fname]); } function coerceFiniteNumberOrBigInt(fname, v) { if (typeof v === "bigint") { return v; } return coerceFiniteNumber(fname, v); } function coerceBigInt(fname, v) { if (typeof v === "bigint") { return v; } if (!Number.isFinite(v) || !Number.isInteger(v)) { throw new FormulaError(49, [fname]); } return BigInt(v); } // packages/ag-grid-enterprise/src/formula/functions/numbers/functions.ts var PRODUCT = ({ values }) => { let acc = 1; let accBigInt = null; for (const v of iterableWithoutBlanks(values)) { const n = coerceFiniteNumberOrBigInt("PRODUCT", v); if (typeof n === "bigint") { accBigInt ?? (accBigInt = coerceBigInt("PRODUCT", acc)); if (n === 0n) { return 0n; } accBigInt *= n; continue; } if (accBigInt != null) { accBigInt *= coerceBigInt("PRODUCT", n); continue; } if (n === 0) { return 0; } acc *= n; } return accBigInt ?? acc; }; var DIVIDE = ({ values }) => { const [a, b] = take(iterableWithoutBlanks(values), "DIVIDE", 2); const na = coerceFiniteNumber("DIV", a); const nb = coerceFiniteNumber("DIV", b); if (na == null || nb == null) { throw new FormulaError(54); } if (nb === 0) { throw new FormulaError(55); } return na / nb; }; var SUM = ({ values }) => { let hasDates = false; let acc = 0; let accBigInt = null; let hasValue = false; for (const v of iterableWithoutBlanks(values)) { hasDates || (hasDates = isDateValue(v)); const n = coerceFiniteNumberOrBigInt("SUM", v); if (typeof n === "bigint") { if (hasDates) { throw new FormulaError(56); } accBigInt ?? (accBigInt = coerceBigInt("SUM", acc)); accBigInt += n; hasValue = true; continue; } if (typeof accBigInt === "bigint") { if (hasDates) { throw new FormulaError(56); } accBigInt += coerceBigInt("SUM", n); hasValue = true; continue; } acc += n; hasValue = true; } if (!hasValue) { throw new FormulaError(57); } if (typeof accBigInt === "bigint") { return accBigInt; } return hasDates ? dateFromDays(acc) : acc; }; var MINUS = ({ values }) => { const [a, b] = take(iterableWithoutBlanks(values), "MINUS", 2); const aDate = isDateValue(a); const bDate = isDateValue(b); if (aDate || bDate) { const na2 = coerceFiniteNumber("MINUS", a); const nb2 = coerceFiniteNumber("MINUS", b); if (aDate && !bDate) { return dateFromDays(na2 - nb2); } if (aDate && bDate) { return na2 - nb2; } return na2 - nb2; } const na = coerceFiniteNumberOrBigInt("MINUS", a); const nb = coerceFiniteNumberOrBigInt("MINUS", b); if (typeof na === "bigint" || typeof nb === "bigint") { return coerceBigInt("MINUS", na) - coerceBigInt("MINUS", nb); } return na - nb; }; var PERCENT = ({ values }) => { const [a] = take(values, "PERCENT", 1); const n = coerceFiniteNumber("PERCENT", a); if (n == null) { throw new FormulaError(70); } return n / 100; }; var POWER = ({ values }) => { const [a, b] = take(values, "POWER", 2); const na = coerceFiniteNumber("POWER", a); const nb = coerceFiniteNumber("POWER", b); if (na == null || nb == null) { throw new FormulaError(71); } return Math.pow(na, nb); }; var AVERAGE = ({ values }) => { let sum = 0; let count = 0; let allDate = true; for (const v of iterableWithoutBlanks(values)) { const n = coerceFiniteNumber("AVG", v); if (n == null) { continue; } sum += n; count++; allDate && (allDate = isDateValue(v)); } if (count === 0) { throw new FormulaError(58); } const avg = sum / count; return allDate ? dateFromDays(avg) : avg; }; var MEDIAN = ({ values }) => { let allDates = true; const arr = []; for (const v of iterableWithoutBlanks(values)) { const n = coerceFiniteNumber("MEDIAN", v); if (n == null) { throw new FormulaError(59); } arr.push(n); allDates && (allDates = isDateValue(v)); } if (arr.length === 0) { throw new FormulaError(60); } arr.sort((a, b) => a - b); const mid = Math.floor(arr.length / 2); const med = arr.length % 2 === 1 ? arr[mid] : (arr[mid - 1] + arr[mid]) / 2; return allDates ? dateFromDays(med) : med; }; var RAND = () => Math.random(); var SUMIF = ({ args }) => { const [critRange, criteria, sumRange] = takeBetween(args, "SUMIF", 2, 3); if (!isRangeParam(critRange)) { throw new FormulaError(61); } if (!isValueParam(criteria)) { throw new FormulaError(62); } if (sumRange && !isRangeParam(sumRange)) { throw new FormulaError(63); } const pred = criteriaToPredicate(criteria.value); if (!sumRange) { let acc = 0; let accBigInt = null; for (const v of critRange) { if (pred(v)) { const n = coerceFiniteNumberOrBigInt("SUMIF", v); if (typeof n === "bigint") { accBigInt ?? (accBigInt = coerceBigInt("SUMIF", acc)); accBigInt += n; } else if (accBigInt != null) { accBigInt += coerceBigInt("SUMIF", n); } else { acc += n; } } } return accBigInt ?? acc; } const critRangeHeight = critRange.rowEnd - critRange.rowStart; const sumRangeHeight = sumRange.rowEnd - sumRange.rowStart; if (critRangeHeight !== sumRangeHeight) { throw new FormulaError(64); } const critRangeIterator = critRange[Symbol.iterator](); const sumRangeIterator = sumRange[Symbol.iterator](); let total = 0; let totalBigInt = null; while (true) { const a = critRangeIterator.next(); const b = sumRangeIterator.next(); if (a.done || b.done) { if (a.done !== b.done) { throw new FormulaError(64); } break; } if (pred(a.value)) { const n = coerceFiniteNumberOrBigInt("SUMIF", b.value); if (typeof n === "bigint") { totalBigInt ?? (totalBigInt = coerceBigInt("SUMIF", total)); totalBigInt += n; } else if (totalBigInt != null) { totalBigInt += coerceBigInt("SUMIF", n); } else { total += n; } } } return totalBigInt ?? total; }; // packages/ag-grid-enterprise/src/formula/functions/strings/functions.ts var CONCAT = ({ values }) => { let out = ""; for (const v of values) { if (v == null) { continue; } switch (typeof v) { case "string": { out += v; break; } case "number": { out += String(v); break; } case "boolean": { out += v ? "TRUE" : "FALSE"; break; } case "object": { out += v.toString(); break; } default: { throw new FormulaError(67); } } } return out; }; // packages/ag-grid-enterprise/src/formula/functions/supportedFuncs.ts var supportedFuncs_default = { // logic/date IF, NOW, TODAY, // arithmetic PRODUCT, // DIVIDE, // DIV: DIVIDE, SUM, ADD: SUM, SUMIF, // MINUS, // PERCENT, POWER, MIN, MAX, AVERAGE, MEDIAN, // counting COUNT, COUNTA, COUNTBLANK, COUNTIF, // random RAND, // text CONCAT, CONCATENATE: CONCAT, // comparisons // EQ: EQUALS, // NE: NOT_EQUALS, // GT, // GTE, // LT, // LTE, // operator aliases "+": SUM, "-": MINUS, "*": PRODUCT, "/": DIVIDE, "^": POWER, "%": PERCENT, "=": EQUALS, "&": CONCAT, "<>": NOT_EQUALS, ">": GT, ">=": GTE, "<": LT, "<=": LTE }; // packages/ag-grid-enterprise/src/formula/formulaService.ts var CellFormula = class { constructor(rowNode, column, formulaString, beans) { this.rowNode = rowNode; this.column = column; this.formulaString = formulaString; this.beans = beans; this.error = null; this.ast = null; this.astStale = true; this._value = void 0; this._valueStale = true; } setFormulaString(next) { if (this.formulaString === next) { return; } this.formulaString = next; this.astStale = true; this._valueStale = true; } /** Cache write: store a fresh computed value (and clear previous error). */ setComputedValue(v) { this._value = v; this._valueStale = false; this.error = null; } /** Cache write: store an error (value considered stale). */ setError(e) { this.error = e; this._valueStale = false; } isValueReady() { return !this._valueStale; } /** * Return the error type or the value */ getValue() { return this.error?.type ?? this._value; } getError() { return this.error; } /** Returns the AST for the formula and recomputes if stale */ getAst() { if (!this.astStale) { return this.ast; } const ast = parseFormula(this.beans, this.formulaString); this.ast = ast ?? null; this.astStale = false; return this.ast; } }; var FormulaService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "formula"; /** Cache: row -> (column -> CellFormula) */ this.cachedResult = /* @__PURE__ */ new WeakMap(); /** Map "A", "B", ..., "AA" -> actual AgColumn */ this.colRefMap = /* @__PURE__ */ new Map(); this.functionNames = null; this.active = false; } setFormulasActive(cols) { const formulaColumnsPresent = cols.list.some((col) => col.isAllowFormula()); const active = formulaColumnsPresent && this.checkForIncompatibleServices(cols); if (active !== this.active) { this.active = active; this.refreshFormulas(true); } } checkForIncompatibleServices(cols) { if (this.gos.get("masterDetail")) { _warn(295, { blockedService: "Master Detail" }); return false; } if (this.gos.get("treeData")) { _warn(295, { blockedService: "Tree Data" }); return false; } if (this.gos.get("enableCellExpressions")) { _warn(295, { blockedService: "Cell Expressions" }); return false; } return cols.list.every((col) => { if (col.isAllowPivot() || col.isPivotActive()) { _warn(295, { blockedService: "Column Pivoting" }); return false; } if (col.isAllowRowGroup() || col.isRowGroupActive()) { _warn(295, { blockedService: "Row Groups" }); return false; } if (col.isAllowValue() || col.isValueActive() || col.getAggFunc()) { _warn(295, { blockedService: "Value Aggregation" }); return false; } return true; }); } postConstruct() { this.setupFunctions(); const refreshFormulas = () => { if (this.active) { this.refreshFormulas(true); } }; const resetColMap = () => { if (this.active) { this.setupColRefMap(); } }; this.addManagedPropertyListeners(["masterDetail", "enableCellExpressions"], (e) => { const { colModel } = this.beans; const formulaColumnsPresent = colModel.cols?.list.some((col) => col.isAllowFormula()); if (formulaColumnsPresent) { colModel.refreshAll(_convertColumnEventSourceType(e.source)); } }); this.addManagedListeners(this.beans.eventSvc, { modelUpdated: refreshFormulas, cellValueChanged: refreshFormulas, rowDataUpdated: refreshFormulas, newColumnsLoaded: resetColMap, columnMoved: resetColMap }); } updateFormulaByOffset(params) { const { value, rowDelta = 0, columnDelta = 0, useRefFormat = true } = params; const { beans } = this; try { const unsafe = !useRefFormat; const ast = parseFormula(beans, value, unsafe); shiftNode(beans, ast, rowDelta, columnDelta, unsafe); return serializeFormula( beans, ast, /*useRefFormat*/ useRefFormat, unsafe ); } catch { return value; } } setupFunctions() { this.supportedOperations = /* @__PURE__ */ new Map(); Object.keys(supportedFuncs_default).forEach((name) => { this.supportedOperations.set(name, supportedFuncs_default[name]); }); this.functionNames = null; const customFuncs = this.gos.get("formulaFuncs"); if (customFuncs) { Object.keys(customFuncs).forEach((name) => { this.supportedOperations.set(name.toUpperCase(), customFuncs[name].func); }); } } getFunctionNames() { if (this.functionNames) { return this.functionNames; } const names = []; for (const name of this.supportedOperations.keys()) { if (!isFormulaIdentStart(name[0])) { continue; } if (![...name].every((char) => isFormulaIdentChar(char))) { continue; } names.push(name); } names.sort((a, b) => a.localeCompare(b)); this.functionNames = names; return names; } setupColRefMap() { if (!this.active) { this.colRefMap = /* @__PURE__ */ new Map(); return; } const alphabet = "abcdefghijklmnopqrstuvwxyz"; const base = alphabet.length; const list = this.beans.colModel.getCols(); const map = /* @__PURE__ */ new Map(); let idx = 0; list?.forEach((col) => { if (!col.isPrimary()) { return; } let label = ""; let n = idx++; while (true) { label = alphabet[n % base] + label; if (n < base) { break; } n = Math.floor(n / base) - 1; } if (col.formulaRef !== label.toUpperCase()) { col.formulaRef = label.toUpperCase(); col.dispatchColEvent("formulaRefChanged", "api"); } map.set(label.toUpperCase(), col); }); this.colRefMap = map; this.refreshFormulas(true); } /** Lookup a column by A1-style reference label, e.g. "A", "AB". */ getColByRef(ref) { return this.colRefMap.get(ref.toUpperCase()) ?? null; } /** Find the A1-style label for a given column (reverse lookup). */ getColRef(col) { for (const [label, value] of this.colRefMap.entries()) { if (value === col) { return label; } } return null; } /** Clear all cached results and re-render cells. */ refreshFormulas(refreshCells2) { this.cachedResult = /* @__PURE__ */ new WeakMap(); if (refreshCells2) { this.beans.rowRenderer.refreshCells({ suppressFlash: true, force: true }); } } /** * Is a value a formula string (starts with '=') **/ isFormula(value) { return this.active && _isExpressionString(value); } /** * Normalise a formula by parsing and serializing it (REF(COLUMN(), ROW()) format). * @returns null if the formula is invalid. */ normaliseFormula(value, shorthand = false) { const { beans } = this; try { const parsedAST = parseFormula(beans, value); const serialized = serializeFormula(beans, parsedAST, !shorthand, false); return serialized; } catch { return null; } } /** If the cell has been evaluated and errored, return its last error (else null). */ getFormulaError(column, node) { const rowMap = this.cachedResult.get(node); const cell = rowMap?.get(column); return cell?.error ?? null; } /** Get a registered function by name (used by the evaluator). */ getFunction(name) { return this.supportedOperations.get(name.toUpperCase()); } /** Ensure a CellFormula exists for (row,col) if it's a formula cell; returns null for non-formula. */ ensureCellFormula(row, col) { let rowMap = this.cachedResult.get(row); let cf = rowMap?.get(col); if (cf) { return cf; } const str = this.getFormulaFromDataSource(row, col) ?? this.fetchRawValue(col, row); if (typeof str !== "string" || str[0] !== "=") { return null; } cf = new CellFormula(row, col, str, this.beans); if (!rowMap) { rowMap = /* @__PURE__ */ new Map(); this.cachedResult.set(row, rowMap); } rowMap.set(col, cf); return cf; } getFormulaFromDataSource(row, col) { const dataSource = this.beans.formulaDataSvc; if (!dataSource?.hasDataSource()) { return void 0; } return dataSource.getFormula({ column: col, rowNode: row }); } coerceFormulaValue(column, value) { const baseDataType = this.beans.dataTypeSvc?.getBaseDataType(column); if (baseDataType === "bigint") { const bigintValue = this.toBigIntValue(value); return bigintValue ?? value; } if (baseDataType === "number" && typeof value === "bigint") { const asNumber = Number(value); return Number.isFinite(asNumber) ? asNumber : value; } return value; } toBigIntValue(value) { if (typeof value === "bigint") { return value; } if (typeof value === "number") { if (!Number.isFinite(value) || !Number.isInteger(value)) { return null; } return BigInt(value); } return null; } /** Fetch a non-formula value from the grid without triggering nested formula calc. */ fetchRawValue(col, row) { return this.beans.valueSvc.getValue(col, row, "data"); } getVisitorContext() { if (this.activeCtx) { return this.activeCtx; } const stateByCell = /* @__PURE__ */ new Map(); const setVisiting = (r, c) => { let colSet = stateByCell.get(r); const isVisiting = colSet?.has(c); if (isVisiting) { throw new FormulaError(51); } if (!colSet) { colSet = /* @__PURE__ */ new Set(); stateByCell.set(r, colSet); } colSet.add(c); }; const setVisited = (r, c) => { const colSet = stateByCell.get(r); if (colSet) { colSet.delete(c); if (colSet.size === 0) { stateByCell.delete(r); } } }; const errorAllVisitors = (error) => { for (const [row, cells] of stateByCell) { for (const col of cells) { const cache = this.ensureCellFormula(row, col); cache?.setError(error); } } }; return this.activeCtx = { setVisited, setVisiting, errorAllVisitors }; } makeFormulaFrame(address) { const cachedItem = this.ensureCellFormula(address.row, address.column); const ast = cachedItem.getAst(); if (!ast) { throw new FormulaError(52); } const unresolvedDepIterator = unresolvedDeps(this.beans, ast, this.ensureCellFormula.bind(this)); return { address, ast, unresolvedDepIterator }; } /** * Evaluate a single cell's formula **iteratively** (no recursion to avoid large stack traces), * caching dependency results into their own CellFormula entries. * * Returns the computed value, or a '#...' string on error. */ resolveValue(column, node) { const rootCachedCellFormula = this.ensureCellFormula(node, column); if (!rootCachedCellFormula) { return this.fetchRawValue(column, node); } if (rootCachedCellFormula.isValueReady()) { return rootCachedCellFormula.getValue(); } const hadCtx = !!this.activeCtx; const { setVisited, setVisiting, errorAllVisitors } = this.getVisitorContext(); const evalStack = []; try { setVisiting(node, column); evalStack.push(this.makeFormulaFrame({ row: node, column })); while (evalStack.length) { const { address, ast, unresolvedDepIterator } = evalStack[evalStack.length - 1]; const { row, column: col } = address; const cachedCellFormula = this.ensureCellFormula(row, col); if (cachedCellFormula.isValueReady()) { evalStack.pop(); setVisited(row, col); if (cachedCellFormula.error) { throw cachedCellFormula.error; } continue; } const depStep = unresolvedDepIterator.next(); if (!depStep.done) { const depAddr = depStep.value; const depCachedCellFormula = this.ensureCellFormula(depAddr.row, depAddr.column); if (!depCachedCellFormula || depCachedCellFormula.isValueReady()) { continue; } setVisiting(depAddr.row, depAddr.column); evalStack.push(this.makeFormulaFrame(depAddr)); continue; } const computed = evalAst( this.beans, ast, (addr) => { const cachedRefFormula = this.ensureCellFormula(addr.row, addr.column); if (cachedRefFormula) { if (!cachedRefFormula.isValueReady()) { throw new FormulaError(53); } const error = cachedRefFormula.getError(); if (error) { throw error; } return cachedRefFormula.getValue(); } return this.fetchRawValue(addr.column, addr.row); }, { row, column: col } ); const coerced = this.coerceFormulaValue(col, computed); const existing = cachedCellFormula.getError(); if (existing) { setVisited(row, col); throw existing; } cachedCellFormula.setComputedValue(coerced); setVisited(row, col); evalStack.pop(); } if (!rootCachedCellFormula.isValueReady()) { throw new FormulaError(53); } return rootCachedCellFormula.getValue(); } catch (e) { const normalized = e instanceof FormulaError ? e : new FormulaError(String(e?.message ?? e)); errorAllVisitors(normalized); return normalized.type; } finally { if (!hadCtx) { this.activeCtx = null; } } } }; // packages/ag-grid-enterprise/src/formula/formulaModule.ts var FormulaModule = { moduleName: "Formula", version: VERSION2, userComponents: { agFormulaCellEditor: FormulaCellEditor }, beans: [FormulaService, FormulaDataService, FormulaInputManagerService], dependsOn: [RowNumbersModule], css: [formula_default] }; // packages/ag-grid-enterprise/src/sparkline/sparkline.css var sparkline_default = ".ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}"; // packages/ag-grid-enterprise/src/sparkline/sparklinesUtils.ts var WrappedFunctionMarker = Symbol("WrappedFunctionMarker"); var wrapFn = (fn, wrapperFn) => { if (fn[WrappedFunctionMarker]) { return fn; } const wrapped = (...args) => wrapperFn(fn, ...args); wrapped[WrappedFunctionMarker] = WrappedFunctionMarker; return wrapped; }; var defaultSparklineAriaDescription = "Sparkline - ${chartType} displaying ${count} values between ${min} and ${max}. Starts at ${start} and ends at ${end}."; var defaultSingleValueSparklineAriaDescription = "Sparkline - ${chartType} displaying 1 value, ${value}."; var defaultEmptySparklineAriaDescription = "Sparkline - ${chartType} displaying no values."; var getChartTypeLabel = (translate, sparklineOptions) => { const type = sparklineOptions?.type ?? "line"; switch (type) { case "line": return translate("lineChart", "Line"); case "area": return translate("areaChart", "Area"); case "bar": return translate("barChart", "Bar"); default: return type; } }; var getSparklineSummary = (data, yKey) => { let count = 0; let min = Number.POSITIVE_INFINITY; let max = Number.NEGATIVE_INFINITY; let start; let end; for (const datum of data) { const yValue = getYValue(datum, yKey); if (yValue == null) { continue; } if (start == null) { start = yValue; } end = yValue; count++; min = Math.min(min, yValue); max = Math.max(max, yValue); } return count === 0 ? { count } : { count, min, max, start, end }; }; function getSparklineAriaTemplate(params) { const { translate, chartType, summary, formatNumber } = params; let key; let defaultTemplate; let variableValues; let values; if (!hasCompleteSparklineSummary(summary)) { key = "ariaSparklineChartDescriptionEmpty"; defaultTemplate = defaultEmptySparklineAriaDescription; variableValues = [chartType]; values = { chartType }; } else if (summary.count === 1) { const value = formatNumber(summary.start); key = "ariaSparklineChartDescriptionSingleValue"; defaultTemplate = defaultSingleValueSparklineAriaDescription; variableValues = [chartType, value]; values = { chartType, value }; } else { const [count, min, max, start, end] = [summary.count, summary.min, summary.max, summary.start, summary.end].map( formatNumber ); key = "ariaSparklineChartDescription"; defaultTemplate = defaultSparklineAriaDescription; variableValues = [chartType, count, min, max, start, end]; values = { chartType, count, min, max, start, end }; } return { template: translate(key, defaultTemplate, variableValues), values }; } var hasCompleteSparklineSummary = (summary) => summary.count > 0 && summary.min != null && summary.max != null && summary.start != null && summary.end != null; var interpolateTemplate = (template, values) => template.replace(/\$\{([^}]+)\}/g, (match, token) => values[token] ?? match); var getYValue = (datum, yKey) => { if (typeof datum === "number") { return Number.isFinite(datum) ? datum : null; } if (datum && typeof datum === "object") { const yValue = Array.isArray(datum) ? datum[1] : datum[yKey]; return typeof yValue === "number" && Number.isFinite(yValue) ? yValue : null; } return null; }; // packages/ag-grid-enterprise/src/sparkline/sparklineCellRenderer.ts function tooltipRendererWithXValue(params) { return { content: `${params.xValue} ${params.yValue}` }; } function tooltipRenderer(params) { return { content: `${params.yValue}` }; } var COMPONENT_PREFIX = "ag-sparkline"; var SparklineCellRenderer = class extends Component { constructor() { super({ tag: "div", cls: `${COMPONENT_PREFIX}-wrapper`, children: [{ tag: "span", ref: "eSparkline" }] }); this.eSparkline = RefPlaceholder; this.cachedWidth = 0; this.cachedHeight = 0; this.dataRef = []; this.processedData = []; } postConstruct() { this.env = this.beans.environment; this.addManagedPropertyListeners( ["chartThemeOverrides", "chartThemes", "styleNonce"], () => this.refresh(this.params) ); } createListener(batch = true) { return () => this.updateSize(this.params?.column?.getActualWidth() ?? 0, (this.params?.node.rowHeight ?? 0) - 2, batch); } initGridObserver() { const batchListener = this.createListener(); const listener = this.createListener(false); const column = this.params?.column; const rowNode = this.params?.node; column.__addEventListener("columnStateUpdated", batchListener); rowNode.__addEventListener("heightChanged", batchListener); this.addDestroyFunc(() => { column.__removeEventListener("columnStateUpdated", batchListener); rowNode.__removeEventListener("heightChanged", batchListener); }); listener(); } updateSize(newWidth, newHeight, batch = true) { newWidth -= this.env.getCellPadding(); if (newWidth !== this.cachedWidth || newHeight !== this.cachedHeight) { this.cachedWidth = newWidth; this.cachedHeight = newHeight; const refresh = this.refresh.bind(this); if (batch) { _batchCall(() => this.isAlive() && refresh()); } else { refresh(); } } } init(params) { this.params = params; const { eParentOfValue } = params; const id = `${COMPONENT_PREFIX}-cell-renderer-${this.getCompId()}`; this.getGui().setAttribute("id", id); _setAriaLabelledBy(eParentOfValue, id); this.addDestroyFunc(() => _setAriaLabelledBy(eParentOfValue)); this.initGridObserver(); } refresh(params = this.params) { var _a; this.params = params; const data = this.processData(params?.value); this.refreshAriaLabel(data); const width = this.cachedWidth; const height = this.cachedHeight; const styleNonce = this.gos.get("styleNonce"); if (!this.sparklineInstance && params && width > 0 && height > 0) { this.sparklineOptions = { container: this.eSparkline, width, height, ...params.sparklineOptions, ...styleNonce ? { styleNonce } : {}, data }; (_a = this.sparklineOptions).type ?? (_a.type = "line"); if (this.sparklineOptions.tooltip?.renderer) { this.wrapTooltipRenderer(); } else { const renderer = this.getDefaultTooltipRenderer(); this.sparklineOptions.tooltip = { ...this.sparklineOptions.tooltip, renderer }; } const theme = this.sparklineOptions?.theme; if (this.sparklineOptions.type === "bar" && this.sparklineOptions.itemStyler) { this.wrapItemStyler(this.sparklineOptions); } else if (theme?.overrides?.bar?.series?.itemStyler) { this.wrapItemStyler(theme.overrides.bar.series); } this.sparklineInstance = params.createSparkline(this.sparklineOptions); return true; } else if (this.sparklineInstance) { this.sparklineInstance.update({ ...this.sparklineOptions, data, width, height, ...styleNonce ? { styleNonce } : {} }); return true; } return false; } refreshAriaLabel(data) { const translate = this.getLocaleTextFunc(); const getLocaleText = this.getLocaleTextFunc.bind(this); const yKey = this.params?.sparklineOptions?.yKey ?? this.sparklineOptions?.yKey ?? "y"; const summary = getSparklineSummary(data, yKey); const sparklineOptions = this.params?.sparklineOptions ?? this.sparklineOptions; const { template, values } = getSparklineAriaTemplate({ translate, chartType: getChartTypeLabel(translate, sparklineOptions), summary, formatNumber: (value) => _formatNumberCommas(value, getLocaleText) }); _setAriaLabel(this.getGui(), interpolateTemplate(template, values)); } processData(data) { if (!data?.length) { return data ?? []; } if (this.dataRef !== data) { this.dataRef = data; this.processedData = Array.isArray(data[0]) ? data.filter((item) => item != null) : data; } return this.processedData; } createContext() { return { data: this.params?.data, cellData: this.params?.value }; } getDefaultTooltipRenderer(userRendererResult) { const userTitle = userRendererResult?.title; const xKeyProvided = this.sparklineOptions.xKey; const tupleData = Array.isArray(this.sparklineOptions.data?.[0]); const showXValue = !userTitle && (xKeyProvided || tupleData); return showXValue ? tooltipRendererWithXValue : tooltipRenderer; } wrapItemStyler(container) { container.itemStyler = wrapFn(container.itemStyler, (fn, stylerParams) => { return fn({ ...stylerParams, context: this.createContext() }); }); } wrapTooltipRenderer() { this.sparklineOptions.tooltip = { ...this.sparklineOptions.tooltip, renderer: wrapFn(this.sparklineOptions.tooltip.renderer, (fn, tooltipParams) => { const userRendererResult = fn({ ...tooltipParams, context: this.createContext() }); if (typeof userRendererResult === "string") { return userRendererResult; } return { ...this.getDefaultTooltipRenderer(userRendererResult)(tooltipParams), ...userRendererResult }; }) }; } destroy() { super.destroy(); this.sparklineInstance?.destroy(); } }; // packages/ag-grid-enterprise/src/sparkline/sparklinesModule.ts var moduleName = "Sparklines"; var SparklinesModule = { moduleName, version: VERSION2, dependsOn: [EnterpriseCoreModule], validate: () => { return { isValid: false, message: _preInitErrMsg(258) }; }, with: (params) => { params.setup(); return { moduleName, version: VERSION2, dependsOn: [EnterpriseCoreModule], css: [sparkline_default], userComponents: { agSparklineCellRenderer: { classImp: SparklineCellRenderer, /** Default params for provided components */ params: { createSparkline: params.createSparkline } } }, validate: () => { return { isValid: true }; } }; } }; // packages/ag-grid-enterprise/src/find/find.css var find_default = ".ag-find-cell{display:block;overflow:hidden;text-overflow:ellipsis}.ag-find-match{background-color:var(--ag-find-match-background-color);color:var(--ag-find-match-color)}.ag-find-active-match{background-color:var(--ag-find-active-match-background-color);color:var(--ag-find-active-match-color)}"; // packages/ag-grid-enterprise/src/find/findApi.ts function findNext(beans) { beans.findSvc?.next(); } function findPrevious(beans) { beans.findSvc?.previous(); } function findGetTotalMatches(beans) { return beans.findSvc?.totalMatches ?? 0; } function findGoTo(beans, match, force) { beans.findSvc?.goTo(match, force); } function findClearActive(beans) { beans.findSvc?.clearActive(); } function findGetActiveMatch(beans) { return beans.findSvc?.activeMatch; } function findGetNumMatches(beans, params) { const { node, column } = params; return beans.findSvc?.getNumMatches(node, column) ?? 0; } function findGetParts(beans, params) { return beans.findSvc?.getParts(params) ?? []; } function findRefresh(beans) { return beans.findSvc?.refresh(true); } // packages/ag-grid-enterprise/src/find/findCellRenderer.ts var FindCellRendererElement = { tag: "span", cls: "ag-find-cell" }; var FindCellRenderer = class extends Component { constructor() { super(FindCellRendererElement); } init(params) { this.refresh(params); } refresh(params) { const { node, column } = params; const { findSvc, valueSvc } = this.beans; const { value, valueFormatted } = valueSvc.getValueForDisplay({ column, node, includeValueFormatted: true, from: "edit" }); const displayValue = valueFormatted ?? value ?? ""; const eGui = this.getGui(); _clearElement(eGui); const parts = findSvc?.getParts({ value: displayValue, node, column: column ?? null }); if (!parts) { eGui.textContent = _toString(displayValue) ?? ""; eGui.classList.remove("ag-find-cell-active-match"); } else { let hasActiveMatch = false; for (const { value: value2, match, activeMatch } of parts) { const content = _toString(value2) ?? ""; if (match) { const element = _createElement({ tag: "mark", cls: "ag-find-match" }); element.textContent = content; if (activeMatch) { element.classList.add("ag-find-active-match"); hasActiveMatch = true; } eGui.appendChild(element); } else { eGui.appendChild(document.createTextNode(content)); } } eGui.classList.toggle("ag-find-cell-active-match", hasActiveMatch); } return true; } }; // packages/ag-grid-enterprise/src/find/findService.ts function defaultCaseFormat(value) { return value?.toLocaleLowerCase(); } function getMatchesForValue(findSearchValue, caseFormat, valueToFind) { const finalValue = caseFormat(_toString(valueToFind)); let numMatches = 0; if (finalValue?.length) { let index = -1; while (true) { index = finalValue.indexOf(findSearchValue, index + 1); if (index != -1) { numMatches++; } else { break; } } } return numMatches; } var FindService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "findSvc"; /** * Is find currently active (e.g. non-empty search value). * Used for performance when checking matches (part of cell rendering) */ this.active = false; /** pinned top matches */ this.topMatches = /* @__PURE__ */ new Map(); /** same nodes as keys in `topMatches`, but kept separate for performance when moving backwards and forwards through the matches */ this.topNodes = []; /** total number of matches in pinned top */ this.topNumMatches = 0; this.centerMatches = /* @__PURE__ */ new Map(); this.centerNodes = []; this.centerNumMatches = 0; this.bottomMatches = /* @__PURE__ */ new Map(); this.bottomNodes = []; /** switches based on grid options */ this.caseFormat = defaultCaseFormat; /** whether to scroll to active match after a refresh */ this.scrollOnRefresh = false; this.totalMatches = 0; } postConstruct() { if (!_isClientSideRowModel(this.gos)) { return; } const refreshAndWipeActive = this.refresh.bind(this, false); const refreshAndKeepActive = this.refresh.bind(this, true); const refreshAndKeepActiveDebounced = _debounce( this, () => { if (this.isAlive()) { refreshAndKeepActive(); } }, 0 ); this.refreshDebounced = refreshAndKeepActiveDebounced; this.addManagedPropertyListener("findSearchValue", refreshAndWipeActive); this.addManagedPropertyListener("findOptions", ({ currentValue, previousValue }) => { if (!_jsonEquals(currentValue, previousValue)) { refreshAndWipeActive(); } }); this.addManagedPropertyListeners(["groupSuppressBlankHeader", "showOpenedGroup"], refreshAndKeepActive); this.addManagedEventListeners({ modelUpdated: refreshAndKeepActive, displayedColumnsChanged: refreshAndKeepActive, pinnedRowDataChanged: refreshAndKeepActive, cellValueChanged: refreshAndKeepActiveDebounced, rowNodeDataChanged: refreshAndKeepActiveDebounced, cellEditingStopped: refreshAndKeepActiveDebounced, cellEditValuesChanged: refreshAndKeepActiveDebounced, batchEditingStopped: refreshAndKeepActiveDebounced }); const rowSpanSvc = this.beans.rowSpanSvc; if (rowSpanSvc) { this.addManagedListeners(rowSpanSvc, { spannedCellsUpdated: refreshAndKeepActiveDebounced }); } refreshAndWipeActive(); } next() { this.findAcrossContainers(false, ["top", null, "bottom"], 1, 1); } previous() { this.findAcrossContainers(true, ["bottom", null, "top"], this.totalMatches, -1); } goTo(match, force) { if (!force && match === this.activeMatch?.numOverall) { return; } const { topMatches, topNumMatches, centerMatches, centerNumMatches, bottomMatches } = this; if (match <= topNumMatches) { this.goToInContainer(topMatches, match, 0); return; } if (match <= centerNumMatches) { this.goToInContainer(centerMatches, match, topNumMatches); return; } this.goToInContainer(bottomMatches, match, topNumMatches + centerNumMatches); } clearActive() { if (this.activeMatch) { this.setActive(void 0); } } // called by cell ctrl, so needs to be performant isMatch(node, column) { return this.active && !!this.getMatches(node.rowPinned).get(node)?.some(([colToCheck]) => colToCheck === column); } getNumMatches(node, column) { return this.getMatches(node.rowPinned).get(node)?.find(([colToCheck]) => colToCheck === column)?.[1] ?? 0; } /** * Get detail for cell renderer. Splits up the cell value into strings depending on * whether they don't match, match, or are the active match */ getParts(params) { const { value, node, column, precedingNumMatches } = params; const findSearchValue = this.findSearchValue; const stringValue = _toString(value) ?? ""; if (_missing(findSearchValue)) { return [{ value: stringValue }]; } const valueToFind = this.caseFormat(stringValue) ?? ""; const activeMatchNum = this.getActiveMatchNum(node, column) - (precedingNumMatches ?? 0); let lastIndex = 0; let currentMatchNum = 0; const findTextLength = findSearchValue.length; const parts = []; while (true) { const index = valueToFind.indexOf(findSearchValue, lastIndex); if (index != -1) { currentMatchNum++; if (index > lastIndex) { parts.push({ value: stringValue.slice(lastIndex, index) }); } const endIndex = index + findTextLength; parts.push({ value: stringValue.slice(index, endIndex), match: true, activeMatch: currentMatchNum === activeMatchNum }); lastIndex = endIndex; } else { if (lastIndex < stringValue.length) { parts.push({ value: stringValue.slice(lastIndex) }); } return parts; } } } // when a detail grid is created, we need to sync the matches registerDetailGrid(node, api) { const gos = this.gos; if (!_isClientSideRowModel(gos)) { return; } const isSearchDetail = () => gos.get("findOptions")?.searchDetail; const compareMatchesAndRefresh = (newNumMatches) => { const nodeMatch = this.centerMatches.get(node)?.[0]; const oldNumMatches = nodeMatch?.[1] ?? 0; if (newNumMatches !== oldNumMatches) { this.refreshDebounced(); } }; api.addEventListener("findChanged", (event) => { if (api.isDestroyed() || !this.isAlive() || !this.active || !isSearchDetail()) { return; } compareMatchesAndRefresh(event.totalMatches); }); api.addEventListener("gridPreDestroyed", () => { if (!this.isAlive() || !this.active || !isSearchDetail()) { return; } const masterNode = node.parent; const findSearchValue = this.findSearchValue; if (!masterNode || !findSearchValue) { return; } const numMatches = gos.get("detailCellRendererParams")?.getFindMatches?.({ node: masterNode, data: masterNode.data, findSearchValue: gos.get("findSearchValue"), updateMatches: this.refreshDebounced, getMatchesForValue: (value) => getMatchesForValue(findSearchValue, this.caseFormat, value) }) ?? 0; compareMatchesAndRefresh(numMatches); }); if (isSearchDetail()) { api.setGridOption("findSearchValue", gos.get("findSearchValue")); } } // updates all the matches refresh(maintainActive) { const rowNodesToRefresh = /* @__PURE__ */ new Set([...this.topNodes, ...this.centerNodes, ...this.bottomNodes]); this.topNodes = []; this.centerNodes = []; this.bottomNodes = []; const { topNodes, topMatches, centerMatches, centerNodes, bottomNodes, bottomMatches, beans: { gos, visibleCols, rowModel, valueSvc, pinnedRowModel, pagination, rowSpanSvc, masterDetailSvc, colModel }, findSearchValue: oldFindSearchValue } = this; const findOptions = gos.get("findOptions"); const caseFormat = findOptions?.caseSensitive ? (value) => value ?? void 0 : defaultCaseFormat; this.caseFormat = caseFormat; const providedFindSearchValue = gos.get("findSearchValue"); const findSearchValue = caseFormat(providedFindSearchValue?.trim()); this.findSearchValue = findSearchValue; topMatches.clear(); centerMatches.clear(); bottomMatches.clear(); const oldActiveMatch = maintainActive ? this.activeMatch : void 0; this.activeMatch = void 0; const checkMasterDetail = gos.get("masterDetail") && findOptions?.searchDetail && masterDetailSvc; if (_missing(findSearchValue)) { this.active = false; this.topNumMatches = 0; this.centerNumMatches = 0; this.totalMatches = 0; this.refreshRows(rowNodesToRefresh); if (checkMasterDetail) { const store = masterDetailSvc.store; for (const detailId of Object.keys(store)) { store[detailId]?.api?.findClearActive(); } } if (!_missing(oldFindSearchValue)) { this.dispatchFindChanged(); } return; } const allCols = visibleCols.allCols; const isFullWidthCellFunc = gos.getCallback("isFullWidthRow"); const detailCellRendererParams = gos.get("detailCellRendererParams"); const fullWidthCellRendererParams = gos.get("fullWidthCellRendererParams"); const groupRowRendererParams = gos.get("groupRowRendererParams"); const flattenDetails = _getFlattenDetails(gos); const pivotMode = colModel.isPivotMode(); let containerNumMatches = 0; let matches; let rowNodes; let checkCurrentPage = false; const addMatches = (node, column, numMatches, skipRefresh) => { if (!numMatches) { return; } let rowMatches = matches.get(node); if (!rowMatches) { rowMatches = []; matches.set(node, rowMatches); rowNodes.push(node); if (!skipRefresh) { rowNodesToRefresh.add(node); } } rowMatches.push([column, numMatches]); containerNumMatches += numMatches; }; const findMatchesForRow = (node) => { if (checkCurrentPage) { let rowIndex = node.rowIndex; let nodeToCheck = node.parent; while (rowIndex == null && nodeToCheck) { rowIndex = nodeToCheck.rowIndex; nodeToCheck = nodeToCheck.parent; } if (rowIndex == null || !pagination.isRowInPage(rowIndex)) { return; } } const isParent = node.hasChildren(); if (!_shouldRowBeRendered( flattenDetails, node, isParent, pivotMode, _isRemovedSingleChildrenGroup(flattenDetails, node, isParent), _isRemovedLowestSingleChildrenGroup(flattenDetails, node, isParent) )) { return; } const data = node.data; if (isFullWidthCellFunc?.({ rowNode: node })) { if (fullWidthCellRendererParams) { const numMatches = fullWidthCellRendererParams.getFindMatches?.({ node, data, findSearchValue: providedFindSearchValue, updateMatches: this.refreshDebounced, getMatchesForValue: (value) => getMatchesForValue(findSearchValue, caseFormat, value) }) ?? 0; addMatches(node, null, numMatches); } return; } if (_isFullWidthGroupRow(gos, node, pivotMode)) { let valueToFind; const getFindText = groupRowRendererParams?.getFindText; if (getFindText) { const value = valueSvc.getValueForDisplay({ node, from: "batch" }).value; valueToFind = getFindText( _addGridCommonParams(gos, { value, node, data, column: null, colDef: null, getValueFormatted: () => { const { valueFormatted } = valueSvc.getValueForDisplay({ node, includeValueFormatted: true, from: "batch" }); return valueFormatted; } }) ); } else { const { value, valueFormatted } = valueSvc.getValueForDisplay({ node, includeValueFormatted: true, from: "batch" }); valueToFind = valueFormatted ?? value; } const numMatches = getMatchesForValue(findSearchValue, caseFormat, valueToFind); addMatches(node, null, numMatches); return; } const nodeWillBeHiddenByOpenParent = node.level > 0 && gos.get("groupHideOpenParents") && node.parent?.getFirstChild() === node && !node.parent?.expanded; for (const column of allCols) { if (isSpecialCol(column)) { continue; } const cellSpan = rowSpanSvc?.getCellSpan(column, node); if (cellSpan && cellSpan.firstNode !== node) { continue; } if (column.colDef.showRowGroup && nodeWillBeHiddenByOpenParent) { continue; } let valueToFind; const colDef = column.colDef; const getFindText = colDef.getFindText; if (getFindText) { const value = valueSvc.getValueForDisplay({ column, node, from: "batch" }).value; valueToFind = getFindText( _addGridCommonParams(gos, { value, node, data, column, colDef, getValueFormatted: () => { const { valueFormatted } = valueSvc.getValueForDisplay({ column, node, includeValueFormatted: true, from: "batch" }); return valueFormatted; } }) ); } else { const { value, valueFormatted } = valueSvc.getValueForDisplay({ column, node, includeValueFormatted: true, from: "batch" }); valueToFind = valueFormatted ?? value; } const numMatches = getMatchesForValue(findSearchValue, caseFormat, valueToFind); addMatches(node, column, numMatches); } if (node.master && checkMasterDetail) { const detailNode = node.detailNode; if (detailNode) { const detailApi = detailNode.detailGridInfo?.api; if (detailApi) { detailApi.setGridOption("findSearchValue", providedFindSearchValue); const numMatches = detailApi.findGetTotalMatches(); addMatches(detailNode, null, numMatches); return; } } if (detailCellRendererParams) { const numMatches = detailCellRendererParams.getFindMatches?.({ node, data, findSearchValue: providedFindSearchValue, updateMatches: this.refreshDebounced, getMatchesForValue: (value) => getMatchesForValue(findSearchValue, caseFormat, value) }) ?? 0; addMatches( detailNode ?? { parent: node, dummy: true }, null, numMatches, !detailNode // if dummy detail node, don't refresh ); } } }; matches = topMatches; rowNodes = topNodes; pinnedRowModel?.forEachPinnedRow("top", findMatchesForRow); this.topNumMatches = containerNumMatches; let totalMatches = containerNumMatches; matches = centerMatches; rowNodes = centerNodes; containerNumMatches = 0; checkCurrentPage = !!pagination && !!findOptions?.currentPageOnly; rowModel.forEachNodeAfterFilterAndSort(findMatchesForRow, true); this.centerNumMatches = containerNumMatches; totalMatches += containerNumMatches; matches = bottomMatches; rowNodes = bottomNodes; containerNumMatches = 0; checkCurrentPage = false; pinnedRowModel?.forEachPinnedRow("bottom", findMatchesForRow); totalMatches += containerNumMatches; this.totalMatches = totalMatches; this.active = true; this.refreshRows(rowNodesToRefresh); if (oldActiveMatch) { this.resetActiveMatch(oldActiveMatch); } this.dispatchFindChanged(); } // update the active match back to what it was previously if possible. e.g. row index might have changed resetActiveMatch(oldActiveMatch) { const { column, numInMatch } = oldActiveMatch; let node = oldActiveMatch.node; if (node.dummy) { const detailNode = node.parent?.detailNode; if (!detailNode) { return; } node = detailNode; } const rowPinned = node.rowPinned ?? null; const stillValid = this.getMatches(rowPinned)?.get(node)?.some(([columnToCheck, numMatches]) => columnToCheck === column && numMatches >= numInMatch); if (!stillValid) { return; } let numOverall = 0; if (rowPinned == null) { numOverall = this.topNumMatches; } else if (rowPinned === "bottom") { numOverall = this.topNumMatches + this.centerNumMatches; } const updateNumInMatches = () => { const matches = this.getMatches(rowPinned); for (const nodeToCheck of matches.keys()) { const matchingNode = nodeToCheck === node; const cols = matches.get(nodeToCheck); for (const [columnToCheck, numMatches] of cols) { if (matchingNode && columnToCheck === column) { numOverall += numInMatch; return; } numOverall += numMatches; } } }; updateNumInMatches(); const activeMatch = { ...oldActiveMatch, node, numOverall }; this.activeMatch = activeMatch; this.refreshRows(/* @__PURE__ */ new Set([node]), column == null ? void 0 : /* @__PURE__ */ new Set([column])); if (this.scrollOnRefresh) { this.scrollOnRefresh = false; this.scrollToActive(activeMatch); } this.setDetailActive(activeMatch); } refreshRows(rowNodes, columns) { if (!rowNodes.size) { return; } this.beans.rowRenderer.refreshCells({ rowNodes: [...rowNodes], columns: columns ? [...columns] : void 0, force: true, suppressFlash: true }); } // go to the next/previous match across all containers findAcrossContainers(backwards, containers, startNum, increment) { if (!this.totalMatches) { this.setActive(); return; } const activeMatch = this.activeMatch; let containersToFind = containers; if (activeMatch) { const { column, node, numInMatch, numOverall } = activeMatch; const rowPinned = node.rowPinned ?? null; const nextOverallNum = numOverall + increment; const matchInContainer = this.findInContainer( rowPinned, backwards, nextOverallNum, node, column, numInMatch ); if (matchInContainer) { return; } const activeContainerIndex = containers.indexOf(rowPinned); const containerLength = containers.length; const containersAfter = containers.slice(activeContainerIndex + 1, containerLength); if (containersAfter.some( (containerRowPinned) => this.findInContainer(containerRowPinned, backwards, nextOverallNum) )) { return; } containersToFind = containers.slice(0, activeContainerIndex + 1); } containersToFind.some((containerRowPinned) => this.findInContainer(containerRowPinned, backwards, startNum)); } // go to the next/previous match within a container findInContainer(rowPinned, backwards, nextOverallNum, currentNode, currentColumn, currentNumInMatch) { const matches = this.getMatches(rowPinned); const rowNodes = this.getRowNodes(rowPinned); const direction = backwards ? -1 : 1; if (currentNode != null) { const currentIndexRowMatches = matches.get(currentNode); const colArrayIndex = currentIndexRowMatches?.findIndex(([column]) => column === currentColumn); if (colArrayIndex != null && colArrayIndex != -1) { const [column, numMatches] = currentIndexRowMatches[colArrayIndex]; if (backwards ? currentNumInMatch > 1 : currentNumInMatch < numMatches) { this.setActive({ column, node: currentNode, numInMatch: currentNumInMatch + direction, numOverall: nextOverallNum }); return true; } } const nextMatch2 = colArrayIndex != null && colArrayIndex != -1 ? currentIndexRowMatches?.[colArrayIndex + direction] : void 0; if (nextMatch2) { const [column, numMatches] = nextMatch2; this.setActive({ column, node: currentNode, numInMatch: backwards ? numMatches : 1, numOverall: nextOverallNum }); return true; } } let nextNode; if (currentNode == null) { nextNode = rowNodes[backwards ? rowNodes.length - 1 : 0]; } else { const rowArrayIndex = rowNodes.findIndex((node) => node === currentNode); nextNode = rowNodes[rowArrayIndex + direction]; } if (nextNode == null) { return false; } const nextIndexRowMatches = matches.get(nextNode); const nextMatch = nextIndexRowMatches?.[backwards ? nextIndexRowMatches.length - 1 : 0]; if (nextMatch) { const [column, numMatches] = nextMatch; this.setActive({ column, node: nextNode, numInMatch: backwards ? numMatches : 1, numOverall: nextOverallNum }); return true; } return false; } dispatchFindChanged() { const { eventSvc, activeMatch, totalMatches, findSearchValue } = this; eventSvc.dispatchEvent({ type: "findChanged", activeMatch, totalMatches, findSearchValue }); } setActive(activeMatch) { if (activeMatch && activeMatch.node.rowIndex == null) { const node = activeMatch.node; let parent = node.footer ? node.sibling : node.parent; while (parent && parent.level !== -1) { parent.expanded = true; parent = parent.parent; } this.activeMatch = activeMatch; this.scrollOnRefresh = true; this.beans.expansionSvc?.onGroupExpandedOrCollapsed(); return; } const oldActiveMatch = this.activeMatch; this.activeMatch = activeMatch; this.refreshAndScrollToActive(activeMatch, oldActiveMatch); if (activeMatch) { this.setDetailActive(activeMatch); } this.dispatchFindChanged(); } setDetailActive({ node, numInMatch }) { if (node.detail) { node.detailGridInfo?.api?.findGoTo(numInMatch); } } refreshAndScrollToActive(activeMatch, oldActiveMatch) { if (activeMatch || oldActiveMatch) { const nodes = /* @__PURE__ */ new Set(); const columns = /* @__PURE__ */ new Set(); let skipColumns = false; const addMatch = (match) => { if (!match) { return; } const { node, column } = match; nodes.add(node); if (column == null) { skipColumns = true; } else { columns.add(column); } }; addMatch(activeMatch); addMatch(oldActiveMatch); this.refreshRows(nodes, skipColumns ? void 0 : columns); } if (activeMatch) { this.scrollToActive(activeMatch); } } scrollToActive({ node: { rowPinned, rowIndex }, column }) { const { ctrlsSvc, pagination, gos } = this.beans; const scrollFeature = ctrlsSvc.getScrollFeature(); if (rowPinned == null && rowIndex != null) { if (pagination && !gos.get("findOptions")?.currentPageOnly && !pagination.isRowInPage(rowIndex)) { pagination.goToPageWithIndex(rowIndex); } scrollFeature.ensureIndexVisible(rowIndex); } scrollFeature.ensureColumnVisible(column); } // search for the specified overall `match` number with the provided container, and set it to be active goToInContainer(matches, match, startNum) { let currentMatch = startNum; for (const node of matches.keys()) { const cols = matches.get(node); for (const [column, numMatches] of cols) { if (match <= currentMatch + numMatches) { this.setActive({ column, node, numInMatch: match - currentMatch, numOverall: match }); return; } currentMatch += numMatches; } } } getMatches(rowPinned) { if (rowPinned === "top") { return this.topMatches; } else if (rowPinned === "bottom") { return this.bottomMatches; } else { return this.centerMatches; } } getRowNodes(rowPinned) { if (rowPinned === "top") { return this.topNodes; } else if (rowPinned === "bottom") { return this.bottomNodes; } else { return this.centerNodes; } } getActiveMatchNum(node, column) { const activeMatch = this.activeMatch; return activeMatch != null && activeMatch.node === node && activeMatch.column === column ? activeMatch.numInMatch : 0; } destroy() { this.topMatches.clear(); this.topNodes.length = 0; this.centerMatches.clear(); this.centerNodes.length = 0; this.bottomMatches.clear(); this.bottomNodes.length = 0; this.activeMatch = void 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/find/findModule.ts var FindCoreModule = { moduleName: "FindCore", version: VERSION2, rowModels: ["clientSide"], beans: [FindService], userComponents: { agFindCellRenderer: FindCellRenderer }, css: [find_default] }; var FindModule = { moduleName: "Find", version: VERSION2, apiFunctions: { findGetTotalMatches, findGoTo, findNext, findPrevious, findGetActiveMatch, findGetNumMatches, findGetParts, findClearActive, findRefresh }, dependsOn: [EnterpriseCoreModule, FindCoreModule] }; // packages/ag-grid-enterprise/src/batch-edit/batchEditApi.ts function startBatchEdit({ editSvc, gos, rowModel }) { if (!_isClientSideRowModel(gos, rowModel)) { _warn(289, { rowModelType: gos.get("rowModelType") }); return; } editSvc?.startBatchEditing(); } function cancelBatchEdit({ editSvc }) { editSvc?.stopBatchEditing({ cancel: true, source: "api", forceCancel: true }); } function commitBatchEdit({ editSvc }) { editSvc?.stopBatchEditing({ source: "api", forceStop: true, commit: true }); } function isBatchEditing(beans) { return beans.editSvc?.isBatchEditing() ?? false; } // packages/ag-grid-enterprise/src/batch-edit/batchEditModule.ts var BatchEditModule = { moduleName: "BatchEdit", version: VERSION2, beans: [], apiFunctions: { isBatchEditing, startBatchEdit, cancelBatchEdit, commitBatchEdit }, dependsOn: [EditCoreModule, EnterpriseCoreModule], css: [] }; // packages/ag-grid-enterprise/src/rowGrouping/distributeGroupValue/valueConversion.ts var resolveStrategy = (aggFunc, distribution) => { if (distribution === false || distribution === null) { return false; } if (isNonDistributable(aggFunc)) { return distribution === "overwrite" ? "overwrite" : false; } if (typeof distribution === "string") { return distribution; } if (aggFunc === "sum") { return "uniform"; } if (aggFunc === "avg" || aggFunc == null) { return "overwrite"; } return distribution === true ? "overwrite" : false; }; var isNonDistributable = (aggFunc) => aggFunc === "count" || aggFunc === "min" || aggFunc === "max" || aggFunc === "first" || aggFunc === "last"; var isDistributableBuiltin = (aggFunc) => aggFunc === "sum" || aggFunc === "avg"; var toNumber = (raw) => { if (typeof raw === "number") { return raw; } if (typeof raw === "bigint" || typeof raw === "string") { const r = Number(raw); return Number.isFinite(r) ? r : 0; } if (typeof raw === "boolean") { return raw ? 1 : 0; } if (raw != null && typeof raw === "object") { if (typeof raw.toNumber === "function") { return toNumber(raw.toNumber()); } if ("value" in raw) { return toNumber(raw.value); } } return 0; }; var numberToBigInt = (value) => Number.isFinite(value) ? BigInt(Math.round(value)) : 0n; var toBigInt = (raw) => { if (typeof raw === "bigint") { return raw; } if (typeof raw === "number") { return numberToBigInt(raw); } if (typeof raw === "boolean") { return raw ? 1n : 0n; } if (typeof raw === "string") { try { return BigInt(raw); } catch { return numberToBigInt(Number(raw)); } } if (raw != null && typeof raw === "object") { if (typeof raw.toNumber === "function") { return toBigInt(raw.toNumber()); } if ("value" in raw) { return toBigInt(raw.value); } } return 0n; }; var isNumericLike = (value) => { const t = typeof value; if (t === "number" || t === "bigint" || t === "boolean") { return true; } if (t === "string") { return Number.isFinite(Number(value)); } if (value != null && t === "object") { if (typeof value.toNumber === "function") { return true; } if ("value" in value) { return isNumericLike(value.value); } } return false; }; var detectPrecision = (colDef) => { if (colDef.cellDataType === "bigint") { return 0; } const ep = colDef.cellEditorParams; if (ep == null || typeof ep !== "object") { return void 0; } const precision = ep.precision; if (typeof precision === "number" && Number.isInteger(precision) && precision >= 0) { return precision; } const step = ep.step; if (typeof step === "number" && Number.isInteger(step)) { return 0; } return void 0; }; // packages/ag-grid-enterprise/src/rowGrouping/distributeGroupValue/distributorBigInt.ts var DistributorBigInt = class { constructor(params, opts, aggFunc) { this.params = params; const { aggregatedChildren: children, column, newValue } = params; const newBigInt = toBigInt(newValue); const oldBigInt = toBigInt(params.oldValue); const count = children.length; const bigCount = BigInt(count); this.children = children; this.column = column; this.count = count; this.bigCount = bigCount; this.newValue = newValue; this.strategy = resolveStrategy(aggFunc, opts?.distribution); if (aggFunc === "avg") { this.target = newBigInt * bigCount; this.oldTarget = oldBigInt * bigCount; } else { this.target = newBigInt; this.oldTarget = oldBigInt; } this.getVal = opts?.getValue; this.setVal = opts?.setValue; } run() { const { strategy, newValue } = this; if (strategy === false) { return false; } if (strategy === "overwrite") { return this.writeAll(newValue); } const { target, oldTarget } = this; if (target === 0n && !isNumericLike(newValue)) { return this.writeAll(newValue); } if (strategy === "increment" && target === oldTarget) { return false; } if (strategy === "uniform") { return this.writeUniformDirect(target); } if (strategy === "increment") { return this.writeIncrementDirect(target - oldTarget); } return this.writePercentage(); } /** Reads a child's current value as a bigint. */ readOne(index) { const { children, column, getVal } = this; const node = children[index]; if (getVal) { const { colDef, api, context } = this.params; return toBigInt(getVal({ node, data: node.data, column, colDef, api, context, groupParams: this.params })); } return toBigInt(node.getDataValue(column, "value")); } /** Writes a value to a single child. */ writeOne(index, value) { const { children, column, setVal } = this; const node = children[index]; if (setVal) { const { colDef, api, context } = this.params; return setVal({ node, data: node.data, column, colDef, api, context, groupParams: this.params, value }); } return node.setDataValue(column, value, "data"); } /** Writes the same value to every child. */ writeAll(value) { const { count } = this; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(i, value)) { changed = true; } } return changed; } /** Writes uniform values directly without array allocation. */ writeUniformDirect(total) { const { count, bigCount } = this; const base = total / bigCount; const rem = total - base * bigCount; const absRem = Number(rem < 0n ? -rem : rem); const step = rem >= 0n ? 1n : -1n; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(i, i < absRem ? base + step : base)) { changed = true; } } return changed; } /** Writes increment values directly without array allocation. */ writeIncrementDirect(totalDelta) { const { count, bigCount } = this; const base = totalDelta / bigCount; const rem = totalDelta - base * bigCount; const absRem = Number(rem < 0n ? -rem : rem); const step = rem >= 0n ? 1n : -1n; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(i, this.readOne(i) + base + (i < absRem ? step : 0n))) { changed = true; } } return changed; } /** Computes percentage distribution and writes values. */ writePercentage() { const { count, target } = this; let total = 0n; const values = new Array(count); for (let i = 0; i < count; ++i) { const v = this.readOne(i); values[i] = v; total += v; } if (total === 0n) { return this.writeUniformDirect(target); } let scaledSum = 0n; for (let i = 0; i < count; ++i) { const v = values[i] * target / total; values[i] = v; scaledSum += v; } let diff = target - scaledSum; for (let i = 0; diff > 0n && i < count; ++i, --diff) { ++values[i]; } for (let i = 0; diff < 0n && i < count; ++i, ++diff) { --values[i]; } let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(i, values[i])) { changed = true; } } return changed; } }; // packages/ag-grid-enterprise/src/rowGrouping/distributeGroupValue/distributorNumber.ts var DistributorNumber = class { constructor(params, opts, aggFunc) { this.params = params; const { aggregatedChildren: children, column, colDef, newValue } = params; const newNumber = toNumber(newValue); const count = children.length; const isAvg = aggFunc === "avg"; this.children = children; this.column = column; this.count = count; this.newValue = newValue; this.strategy = resolveStrategy(aggFunc, opts?.distribution); this.isAvg = isAvg; if (isAvg) { this.target = newNumber * count; this.oldTarget = toNumber(params.oldValue) * count; } else { this.target = newNumber; this.oldTarget = toNumber(params.oldValue); } const explicitPrecision = opts?.precision; if (explicitPrecision === false) { this.precision = void 0; } else if (typeof explicitPrecision === "number") { this.precision = Number.isInteger(explicitPrecision) && explicitPrecision >= 0 ? explicitPrecision : void 0; } else { this.precision = detectPrecision(colDef); } this.getVal = opts?.getValue; this.setVal = opts?.setValue; } run() { const { strategy, newValue } = this; if (strategy === false) { return false; } if (strategy === "overwrite") { return this.writeAll(newValue); } if (this.target === 0 && !isNumericLike(newValue)) { return this.writeAll(newValue); } if (strategy === "increment" && this.target === this.oldTarget) { return false; } switch (strategy) { case "uniform": return this.distributeUniform(); case "increment": return this.distributeIncrement(); default: return this.isAvg ? this.distributePercentageAvg() : this.distributePercentage(); } } readOne(node) { const { column, getVal } = this; if (getVal) { const { colDef, api, context } = this.params; return toNumber(getVal({ node, data: node.data, column, colDef, api, context, groupParams: this.params })); } return toNumber(node.getDataValue(column, "value")); } /** * Reads a child's value and leaf count in a single call. * For group children, reads the raw avg agg object { value, count } if available, * falling back to allLeafChildren.length. For leaf children, count is always 1. */ readValueAndCount(node) { const { column, getVal } = this; let raw; if (getVal) { const { colDef, api, context } = this.params; raw = getVal({ node, data: node.data, column, colDef, api, context, groupParams: this.params }); } else { raw = node.getDataValue(column); } if (node.group) { if (raw != null && typeof raw === "object") { const { value, count } = raw; if (value != null && typeof count === "number" && count > 0) { return typeof value === "number" ? raw : { value: toNumber(value), count }; } } return { value: toNumber(raw), count: node.allLeafChildren?.length || 1 }; } return { value: toNumber(raw), count: 1 }; } writeOne(node, value) { const { column, setVal } = this; if (setVal) { const { colDef, api, context } = this.params; return setVal({ node, data: node.data, column, colDef, api, context, groupParams: this.params, value }); } return node.setDataValue(column, value, "data"); } writeAll(value) { const { children, count } = this; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], value)) { changed = true; } } return changed; } distributeUniform() { const { children, count, target, precision } = this; if (precision === void 0) { return this.writeAll(target / count); } const scale = 10 ** precision; const intTarget = Math.round(target * scale); const base = Math.trunc(intTarget / count); const rem = intTarget - base * count; const absRem = Math.abs(rem); const step = rem >= 0 ? 1 : -1; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], (i < absRem ? base + step : base) / scale)) { changed = true; } } return changed; } distributeIncrement() { const { children, count, target, oldTarget, precision } = this; if (precision === void 0) { const add = (target - oldTarget) / count; let changed2 = false; for (let i = 0; i < count; ++i) { const child = children[i]; if (this.writeOne(child, this.readOne(child) + add)) { changed2 = true; } } return changed2; } const scale = 10 ** precision; const intDelta = Math.round(target * scale) - Math.round(oldTarget * scale); const base = Math.trunc(intDelta / count); const rem = intDelta - base * count; const absRem = Math.abs(rem); const step = rem >= 0 ? 1 : -1; let changed = false; for (let i = 0; i < count; ++i) { const child = children[i]; const cur = Math.round(this.readOne(child) * scale); if (this.writeOne(child, (cur + base + (i < absRem ? step : 0)) / scale)) { changed = true; } } return changed; } /** * Scales each child's value proportionally so they sum to the target. * Each child keeps its relative share: newValue[i] = oldValue[i] × (target / oldTotal). * With precision rounding, uses scaled integers and spreads the remainder across the first N children. */ distributePercentage() { const { children, count, target, precision } = this; const values = new Array(count); let total = 0; for (let i = 0; i < count; ++i) { const v = this.readOne(children[i]); values[i] = v; total += v; } if (total === 0) { return this.distributeUniform(); } if (precision === void 0) { const ratio = target / total; let changed2 = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], values[i] * ratio)) { changed2 = true; } } return changed2; } const scale = 10 ** precision; const intTarget = Math.round(target * scale); let roundedSum = 0; for (let i = 0; i < count; ++i) { const r = Math.round(values[i] / total * intTarget); values[i] = r; roundedSum += r; } const rem = intTarget - roundedSum; const absRem = Math.abs(rem); const step = rem >= 0 ? 1 : -1; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], (values[i] + (i < absRem ? step : 0)) / scale)) { changed = true; } } return changed; } /** * Percentage distribution for avg aggregation. * * Avg group children may themselves be groups with different leaf counts, * so we can't scale avg values directly — a group averaging 2 leaves contributes * twice as much to the parent avg as a group averaging 1 leaf. * * Instead, we convert each child's avg to its sum contribution (avg × leafCount), * scale those sums proportionally, then convert back to avg for writing. * * The target is also converted: constructor stores target = newAvg × childGroupCount, * but we need effectiveTarget = newAvg × totalLeafCount for sum-space scaling. */ distributePercentageAvg() { const { children, count, target, precision } = this; const values = new Array(count); const leafCounts = new Array(count); let total = 0; let totalLeafCount = 0; for (let i = 0; i < count; ++i) { const vc = this.readValueAndCount(children[i]); const lc = vc.count; leafCounts[i] = lc; totalLeafCount += lc; const v = vc.value * lc; values[i] = v; total += v; } if (total === 0) { return this.distributeUniform(); } const effectiveTarget = target / count * totalLeafCount; if (precision === void 0) { const ratio = effectiveTarget / total; let changed2 = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], values[i] * ratio / leafCounts[i])) { changed2 = true; } } return changed2; } const scale = 10 ** precision; const intTarget = Math.round(effectiveTarget * scale); let roundedSum = 0; for (let i = 0; i < count; ++i) { const r = Math.round(values[i] / total * intTarget); values[i] = r; roundedSum += r; } const rem = intTarget - roundedSum; const absRem = Math.abs(rem); const step = rem >= 0 ? 1 : -1; let changed = false; for (let i = 0; i < count; ++i) { if (this.writeOne(children[i], (values[i] + (i < absRem ? step : 0)) / (scale * leafCounts[i]))) { changed = true; } } return changed; } }; // packages/ag-grid-enterprise/src/rowGrouping/distributeGroupValue/distributeGroupValue.ts var distributeGroupValue = (params, options) => { const { aggregatedChildren: children, colDef } = params; if (children.length === 0) { return false; } const aggFunc = colDef.aggFunc ?? null; const entry = resolveDistributionEntry(options, aggFunc); if (entry === false) { return false; } if (typeof entry === "function") { return entry(params) ?? true; } if (colDef.cellDataType === "bigint") { return new DistributorBigInt(params, entry, aggFunc).run(); } return new DistributorNumber(params, entry, aggFunc).run(); }; function resolveDistributionEntry(options, aggFunc) { if (!options) { return void 0; } const dist = options.distribution; if (dist === false || dist === null) { return false; } const nonDist = isNonDistributable(aggFunc); const defaultHandler = options.default; if (typeof dist === "object") { const aggEntry = typeof aggFunc === "string" ? dist[aggFunc] : void 0; if (aggEntry !== void 0) { return resolveEntry(aggEntry, nonDist, options); } if (nonDist) { return false; } return resolveEntry(defaultHandler, false, options) ?? inheritOptions(options); } if (nonDist) { return dist === "overwrite" ? inheritOptions(options, "overwrite") : false; } if (dist === void 0 && !isDistributableBuiltin(aggFunc)) { const resolved = resolveEntry(defaultHandler, false, options); if (resolved !== void 0) { return resolved; } } return options; } function resolveEntry(entry, nonDist, parent) { if (entry === false || entry === null) { return false; } if (entry === void 0) { return void 0; } if (typeof entry === "function") { return entry; } if (typeof entry === "object") { const dist = entry.distribution; if (nonDist && dist !== "overwrite" && dist !== true) { return false; } const { precision: pp, getValue: pgv, setValue: psv } = parent; return { distribution: nonDist ? "overwrite" : dist, precision: entry.precision ?? pp, getValue: entry.getValue ?? pgv, setValue: entry.setValue ?? psv }; } if (nonDist && entry !== "overwrite" && entry !== true) { return false; } return inheritOptions(parent, nonDist ? "overwrite" : entry); } function inheritOptions(parent, distribution) { return { distribution, precision: parent.precision, getValue: parent.getValue, setValue: parent.setValue }; } // packages/ag-grid-enterprise/src/rowGrouping/rowGroupingEditValueSvc.ts var RowGroupingEditValueSvc = class extends BeanStub { constructor() { super(...arguments); this.beanName = "rowGroupingEditValueSvc"; } isGroupCellEditable(rowNode, column) { const colDef = column.getColDef(); if (!column.isColumnFunc(rowNode, colDef.groupRowEditable)) { return false; } const setter = colDef.groupRowValueSetter; if (typeof setter === "function") { return true; } const aggFunc = colDef.aggFunc ?? null; if (typeof setter === "object") { const entry = resolveDistributionEntry(setter, aggFunc); return typeof entry === "function" || entry !== false && resolveStrategy(aggFunc, entry?.distribution) !== false; } return resolveStrategy(aggFunc, setter ?? void 0) !== false; } setGroupDataValue(rowNode, column, newValue, oldValue, eventSource, valueChanged) { const colDef = column.getColDef(); let setter = colDef.groupRowValueSetter; if (setter == null) { const gre = colDef.groupRowEditable; setter = gre && column.isColumnFunc(rowNode, gre) ? true : void 0; } if (!setter) { return void 0; } const params = this.gos.addCommon({ node: rowNode, data: rowNode.data, oldValue, newValue, colDef, column, eventSource, valueChanged, aggregatedChildren: this.beans.aggChildrenSvc?.getAggregatedChildren(rowNode, column) ?? [] }); const result = typeof setter === "function" ? setter(params) : ( // true or options object — delegate to the built-in distributor. distributeGroupValue(params, setter === true ? void 0 : setter) ); return result ?? true; } }; // packages/ag-grid-enterprise/src/rowGrouping/rowGroupingEditModule.ts var RowGroupingEditModule = { moduleName: "RowGroupingEdit", version: VERSION2, beans: [RowGroupingEditValueSvc], dependsOn: [EnterpriseCoreModule, SharedRowGroupingModule] }; // packages/ag-grid-enterprise/src/charts/agChartsExports.ts var AgChartsExports = class extends BeanStub { constructor(params) { super(); this.beanName = "agChartsExports"; this.isEnterprise = false; this.create = params.create; this._Theme = params._Theme; this._Scene = params._Scene; this.isEnterprise = params.isEnterprise; this._Util = params._Util; } }; // packages/ag-grid-enterprise/src/charts/chartComp/utils/integration.ts function deproxy(chartOrProxy) { if (chartOrProxy.chart != null) { return chartOrProxy.chart; } return chartOrProxy; } // packages/ag-grid-enterprise/src/charts/chartComp/utils/object.ts var SKIP_JS_BUILTINS2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); function get(source, expression, defaultValue) { if (source == null) { return defaultValue; } const keys = expression.split("."); let objectToRead = source; while (keys.length > 1) { objectToRead = objectToRead[keys.shift()]; if (objectToRead == null) { return defaultValue; } } const value = objectToRead[keys[0]]; return value != null ? value : defaultValue; } function set(target, expression, value) { if (target == null) { return; } const keys = expression.split("."); let objectToUpdate = target; keys.filter((key) => !SKIP_JS_BUILTINS2.has(key)).forEach((key, i) => { if (!objectToUpdate[key]) { objectToUpdate[key] = {}; } if (i < keys.length - 1) { objectToUpdate = objectToUpdate[key]; } }); objectToUpdate[keys[keys.length - 1]] = value; } // packages/ag-grid-enterprise/src/charts/chartComp/utils/seriesTypeMapper.ts var CHART_TYPE_TO_SERIES_TYPE = { column: "bar", groupedColumn: "bar", stackedColumn: "bar", normalizedColumn: "bar", bar: "bar", groupedBar: "bar", stackedBar: "bar", normalizedBar: "bar", line: "line", stackedLine: "line", normalizedLine: "line", scatter: "scatter", bubble: "bubble", pie: "pie", donut: "donut", doughnut: "donut", area: "area", stackedArea: "area", normalizedArea: "area", histogram: "histogram", radarLine: "radar-line", radarArea: "radar-area", nightingale: "nightingale", radialColumn: "radial-column", radialBar: "radial-bar", sunburst: "sunburst", rangeBar: "range-bar", rangeArea: "range-area", boxPlot: "box-plot", treemap: "treemap", heatmap: "heatmap", waterfall: "waterfall", funnel: "funnel", coneFunnel: "cone-funnel", pyramid: "pyramid" }; var COMBO_CHART_TYPES = /* @__PURE__ */ new Set(["columnLineCombo", "areaColumnCombo", "customCombo"]); var SERIES_GROUP_TYPES = ["grouped", "stacked", "normalized"]; var SERIES_TYPES = { area: { isCartesian: true, canInvert: true }, bar: { isCartesian: true, canInvert: true }, histogram: { isCartesian: true }, line: { isCartesian: true, canInvert: true }, pie: { isPie: true }, donut: { isPie: true, canInvert: true }, scatter: { isCartesian: true }, bubble: { isCartesian: true }, "radial-column": { isPolar: true, isEnterprise: true, isRadial: true, canInvert: true }, "radial-bar": { isPolar: true, isEnterprise: true, isRadial: true, canInvert: true }, "radar-line": { isPolar: true, isEnterprise: true, canInvert: true }, "radar-area": { isPolar: true, isEnterprise: true, canInvert: true }, nightingale: { isPolar: true, isEnterprise: true, canInvert: true }, "range-bar": { isCartesian: true, isStatistical: true, isEnterprise: true, canSwitchDirection: true }, "range-area": { isCartesian: true, isStatistical: true, isEnterprise: true }, "box-plot": { isCartesian: true, isStatistical: true, isEnterprise: true, canSwitchDirection: true }, treemap: { isEnterprise: true, isHierarchical: true }, sunburst: { isEnterprise: true, isHierarchical: true }, heatmap: { isCartesian: true, isEnterprise: true }, waterfall: { isCartesian: true, isEnterprise: true, canSwitchDirection: true }, funnel: { isCartesian: true, isEnterprise: true, canSwitchDirection: true }, "cone-funnel": { isCartesian: true, isEnterprise: true, canSwitchDirection: true }, pyramid: { isCartesian: true, isEnterprise: true, canSwitchDirection: true } }; function isSeriesType(seriesType) { return !!SERIES_TYPES[seriesType]; } function isComboChart(chartType) { return COMBO_CHART_TYPES.has(chartType); } function doesSeriesHaveProperty(seriesType, prop) { return !!SERIES_TYPES[seriesType]?.[prop]; } function isEnterpriseChartType(chartType) { return doesSeriesHaveProperty(getSeriesType(chartType), "isEnterprise"); } var stackedChartTypes = /* @__PURE__ */ new Set(["stackedColumn", "normalizedColumn", "stackedBar", "normalizedBar"]); function isStacked(chartType) { return stackedChartTypes.has(chartType); } function isCartesian(seriesType) { return doesSeriesHaveProperty(seriesType, "isCartesian"); } function isFunnel(seriesType) { return seriesType === "funnel" || seriesType === "cone-funnel" || seriesType === "pyramid"; } function isPolar(seriesType) { return doesSeriesHaveProperty(seriesType, "isPolar"); } function isRadial(seriesType) { return doesSeriesHaveProperty(seriesType, "isRadial"); } function isHierarchical(seriesType) { return doesSeriesHaveProperty(seriesType, "isHierarchical"); } function isStatistical(seriesType) { return doesSeriesHaveProperty(seriesType, "isStatistical"); } function getCanonicalChartType(chartType) { return chartType === "doughnut" ? "donut" : chartType; } function getSeriesTypeIfExists(chartType) { return CHART_TYPE_TO_SERIES_TYPE[chartType]; } function getSeriesType(chartType) { return getSeriesTypeIfExists(chartType) ?? "line"; } function isPieChartSeries(seriesType) { return doesSeriesHaveProperty(seriesType, "isPie"); } function canOnlyHaveSingleSeries(chartType) { return chartType === "pie" || chartType === "waterfall" || chartType === "histogram" || chartType === "funnel" || chartType === "coneFunnel" || chartType === "pyramid"; } function getMaxNumCategories(chartType) { return isHierarchical(getSeriesType(chartType)) ? void 0 : 1; } function getMaxNumSeries(chartType) { if (isHierarchical(getSeriesType(chartType))) { return 2; } else if (canOnlyHaveSingleSeries(chartType)) { return 1; } else { return void 0; } } function supportsInvertedCategorySeries(chartType) { return !isComboChart(chartType) && doesSeriesHaveProperty(getSeriesType(chartType), "canInvert"); } function canSwitchDirection(chartType) { return doesSeriesHaveProperty(getSeriesType(chartType), "canSwitchDirection"); } function getFullChartNameTranslationKey(chartType) { switch (chartType) { case "groupedColumn": case "stackedColumn": case "normalizedColumn": case "groupedBar": case "stackedBar": case "normalizedBar": case "stackedLine": case "normalizedLine": case "stackedArea": case "normalizedArea": return `${chartType}Full`; case "doughnut": return "donut"; case "areaColumnCombo": return "AreaColumnCombo"; default: return chartType; } } // packages/ag-grid-enterprise/src/charts/chartComp/utils/axisTypeMapper.ts var ALL_AXIS_TYPES = ["number", "category", "grouped-category", "log", "time"]; function getLegacyAxisType(chartType) { switch (chartType) { case "bar": case "stackedBar": case "normalizedBar": return ["number", "category"]; case "groupedBar": return ["number", "grouped-category"]; case "column": case "stackedColumn": case "normalizedColumn": case "line": case "stackedLine": case "normalizedLine": case "area": case "stackedArea": case "normalizedArea": case "histogram": return ["category", "number"]; case "groupedColumn": return ["grouped-category", "number"]; case "scatter": case "bubble": return ["number", "number"]; default: return void 0; } } // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/chartTheme.ts function createAgChartTheme(chartProxyParams, proxy, isEnterprise, chartThemeDefaults, updatedOverrides) { const { chartOptionsToRestore, chartPaletteToRestore, chartThemeToRestore, agChartsExports } = chartProxyParams; const themeName = getSelectedTheme(chartProxyParams); const stockTheme = isStockTheme(themeName, agChartsExports._Theme); const rootTheme = stockTheme ? { baseTheme: themeName } : lookupCustomChartTheme(chartProxyParams, themeName) ?? {}; const gridOptionsThemeOverrides = chartProxyParams.getGridOptionsChartThemeOverrides(); const apiThemeOverrides = chartProxyParams.apiChartThemeOverrides; const standaloneChartType = getSeriesType(chartProxyParams.chartType); const crossFilteringOverrides = chartProxyParams.crossFiltering ? createCrossFilterThemeOverrides(proxy, chartProxyParams, standaloneChartType) : void 0; const isTitleEnabled = () => { const isTitleEnabled2 = (obj) => { if (!obj) { return false; } return Object.keys(obj).some((key) => get(obj[key], "title.enabled", false)); }; return isTitleEnabled2(gridOptionsThemeOverrides) || isTitleEnabled2(apiThemeOverrides); }; const overrides = [ stockTheme ? inbuiltStockThemeOverrides(chartProxyParams, isEnterprise, isTitleEnabled()) : void 0, pieAndDonutOverrides(), chartThemeDefaults, crossFilteringOverrides, gridOptionsThemeOverrides, apiThemeOverrides, { ...chartOptionsToRestore ?? {} }, updatedOverrides ]; const theme = overrides.filter((v) => !!v).reduce( (r, n) => ({ baseTheme: r, overrides: n }), rootTheme ); if (chartPaletteToRestore && themeName === chartThemeToRestore) { const rootThemePalette = chartProxyParams.agChartsExports._Theme.getChartTheme(rootTheme).palette; if (!isIdenticalPalette(chartPaletteToRestore, rootThemePalette)) { theme.palette = chartPaletteToRestore; } } return theme; } function isIdenticalPalette(paletteA, paletteB) { const arrayCompare = (arrA, arrB) => { if (arrA === arrB) { return true; } if (arrA?.length !== arrB?.length) { return false; } return arrA?.every((v, i) => v === arrB?.[i]) ?? false; }; return arrayCompare(paletteA.fills, paletteB.fills) && arrayCompare(paletteA.strokes, paletteB.strokes); } function isStockTheme(themeName, theme) { return Object.keys(theme.themes).includes(themeName); } function createCrossFilterThemeOverrides(proxy, chartProxyParams, seriesType) { const legend = { listeners: { legendItemClick: (e) => { const chart = proxy.getChart(); const eligibleSeriesIds = [e.seriesId, `${e.seriesId}-filtered-out`]; for (const s2 of chart.series.filter((s3) => eligibleSeriesIds.includes(s3.id))) { s2.toggleSeriesItem(void 0, "category", e.itemId, void 0); } } } }; const common = { tooltip: { delay: 500 }, legend, listeners: { click: (e) => chartProxyParams.crossFilterCallback(e, true) } }; if (seriesType === "pie" || seriesType === "donut") { return { [seriesType]: { series: { fills: { $applyCycle: [ { $cacheMax: { $size: { $path: ["./data", { $path: "/data" }] } } }, { $palette: "fills" }, { $if: [ { $eq: [{ $value: "$parentIndex" }, 0] }, { $mix: [{ $value: "$1" }, { $ref: "backgroundColor" }, 0.7] }, { $value: "$1" } ] } ] }, strokes: { $applyCycle: [ { $cacheMax: { $size: { $path: ["./data", { $path: "/data" }] } } }, { $palette: "strokes" }, { $if: [ { $eq: [{ $value: "$parentIndex" }, 0] }, { $mix: [{ $value: "$1" }, { $ref: "backgroundColor" }, 0.7] }, { $value: "$1" } ] } ] } }, ...common } }; } const fill = {}; if (seriesType !== "line") { fill.fill = { $if: [ { $isEven: [{ $value: "$index" }] }, { $palette: "fill" }, { $mix: [ { $path: ["../$prevIndex/fill", { $palette: "fill" }] }, { $ref: "backgroundColor" }, 0.7 ] } ] }; } return { [seriesType]: { series: { stroke: { $if: [ { $isEven: [{ $value: "$index" }] }, { $palette: "stroke" }, { $mix: [ { $path: ["../$prevIndex/fill", { $palette: "stroke" }] }, { $ref: "backgroundColor" }, 0.7 ] } ] }, ...fill }, ...common } }; } var STATIC_INBUILT_STOCK_THEME_AXES_OVERRIDES = ALL_AXIS_TYPES.reduce( (r, n) => ({ ...r, [n]: { title: { _enabledFromTheme: true } } }), {} ); function inbuiltStockThemeOverrides(params, isEnterprise, titleEnabled) { const extraPadding = params.getExtraPaddingDirections(); return { common: { ...isEnterprise ? { animation: { duration: 500 } } : void 0, axes: STATIC_INBUILT_STOCK_THEME_AXES_OVERRIDES, padding: { // don't add extra padding when a title is present! top: !titleEnabled && extraPadding.includes("top") ? 40 : 20, right: extraPadding.includes("right") ? 30 : 20, bottom: extraPadding.includes("bottom") ? 40 : 20, left: extraPadding.includes("left") ? 30 : 20 } } }; } function pieAndDonutOverrides() { return { pie: { series: { title: { _enabledFromTheme: true }, calloutLabel: { _enabledFromTheme: true }, sectorLabel: { enabled: false, _enabledFromTheme: true } } }, donut: { series: { title: { _enabledFromTheme: true }, calloutLabel: { _enabledFromTheme: true }, sectorLabel: { enabled: false, _enabledFromTheme: true } } } }; } function getSelectedTheme(chartProxyParams) { let chartThemeName = chartProxyParams.getChartThemeName(); const availableThemes = chartProxyParams.getChartThemes(); if (!availableThemes.includes(chartThemeName)) { chartThemeName = availableThemes[0]; } return chartThemeName; } function lookupCustomChartTheme(chartProxyParams, name) { const { customChartThemes } = chartProxyParams; const customChartTheme = customChartThemes?.[name]; if (!customChartTheme) { _warn(140, { name }); } return customChartTheme; } function getSeriesHighlight(crossFiltering, isSingleSeries) { const highlight = { highlightedItem: { strokeWidth: 2 } }; if (!isSingleSeries) { highlight.unhighlightedSeries = { opacity: 1 }; } if (!crossFiltering) { highlight.unhighlightedItem = { opacity: 1 }; } return highlight; } // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/chartProxy.ts var ChartProxy = class { constructor(chartProxyParams) { this.chartProxyParams = chartProxyParams; this.clearThemeOverrides = false; this.agChartsExports = chartProxyParams.agChartsExports; this.chart = chartProxyParams.chartInstance; this.chartType = chartProxyParams.chartType; this.crossFiltering = chartProxyParams.crossFiltering; this.crossFilterCallback = chartProxyParams.crossFilterCallback; this.standaloneChartType = getSeriesType(this.chartType); if (this.chart == null) { this.chart = chartProxyParams.agChartsExports.create(this.getCommonChartOptions()); } else { this.clearThemeOverrides = true; } } crossFilteringReset() { } update(params) { this.getChartRef().update(this.getUpdateOptions(params, this.getCommonChartOptions(params.updatedOverrides))); } updateThemeOverrides(themeOverrides) { this.getChartRef().updateDelta({ theme: { overrides: themeOverrides } }); } getChart() { return deproxy(this.chart); } getChartRef() { return this.chart; } downloadChart(dimensions, fileName, fileFormat) { const { chart } = this; const rawChart = deproxy(chart); const imageFileName = fileName || rawChart.title.node.getPlainText(); const { width, height } = dimensions || {}; chart.download({ width, height, fileName: imageFileName, fileFormat }); } getChartImageDataURL(type) { return this.getChart().getCanvasDataURL(type); } getChartOptions() { return this.chart.getOptions(); } getChartThemeOverrides() { const chartOptionsTheme = this.getChartOptions().theme; return chartOptionsTheme.overrides ?? {}; } getChartPalette() { return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette; } setPaired(paired) { const seriesType = getSeriesType(this.chartProxyParams.chartType); this.chart.updateDelta({ theme: { overrides: { [seriesType]: { paired } } } }); } isPaired() { const seriesType = getSeriesType(this.chartProxyParams.chartType); return get(this.getChartThemeOverrides(), `${seriesType}.paired`, true); } lookupCustomChartTheme(themeName) { return lookupCustomChartTheme(this.chartProxyParams, themeName); } getSeriesGroupType() { return void 0; } transformCategoryData(data, categoryKey) { return data.map((d, index) => { const value = d[categoryKey]; const valueString = value?.toString ? value.toString() : ""; const datum = { ...d }; datum[categoryKey] = { id: index, value, toString: () => valueString }; return datum; }); } getCommonChartOptions(updatedOverrides) { const existingOptions = this.clearThemeOverrides ? {} : this.chart?.getOptions() ?? {}; const formattingPanelOverrides = this.chart != null ? this.getActiveFormattingPanelOverrides() : void 0; this.clearThemeOverrides = false; const styleNonce = this.chartProxyParams.styleNonce; const theme = createAgChartTheme( this.chartProxyParams, this, this.agChartsExports.isEnterprise, this.getChartThemeDefaults(), updatedOverrides ?? formattingPanelOverrides ); const newOptions = { ...existingOptions, mode: "integrated", ...styleNonce ? { styleNonce } : {}, suppressFieldDotNotation: true, theme, container: this.chartProxyParams.parentElement }; return newOptions; } getChartThemeDefaults() { const crosshair = { enabled: true, snap: true, label: { enabled: false } }; const common = this.agChartsExports.isEnterprise ? { zoom: { enabled: true }, animation: { enabled: true, duration: 500 }, axes: { number: { crosshair }, category: { crosshair }, log: { crosshair }, time: { crosshair } } } : {}; common.minHeight = 0; common.minWidth = 0; common.navigator = { enabled: false, height: 18 }; common.context = this.chartProxyParams.context; const overrides = { common }; this.setSeriesChartThemeDefaults(overrides); return overrides; } setSeriesChartThemeDefaults(overrides) { const seriesOverrides = this.getSeriesChartThemeDefaults(); if (!seriesOverrides) { return; } overrides[this.standaloneChartType] = seriesOverrides; } getSeriesChartThemeDefaults() { return void 0; } getActiveFormattingPanelOverrides() { if (this.clearThemeOverrides) { return {}; } const inUseTheme = this.chart?.getOptions().theme; return inUseTheme?.overrides ?? {}; } destroy({ keepChartInstance = false } = {}) { if (keepChartInstance) { this.chart.resetAnimations(); return this.chart; } this.destroyChart(); } destroyChart() { if (this.chart) { this.chart.destroy(); this.chart = void 0; } } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/cartesianChartProxy.ts var CartesianChartProxy = class extends ChartProxy { constructor() { super(...arguments); this.crossFilteringAllPoints = /* @__PURE__ */ new Set(); this.crossFilteringSelectedPoints = []; this.isSingleSeries = false; } getUpdateOptions(params, commonChartOptions) { const axes = this.getAxes(params, commonChartOptions); return { ...commonChartOptions, data: this.getData(params, axes), axes, series: this.getSeries(params) }; } getData(params, axes) { const supportsCrossFiltering = ["area", "line"].includes(this.standaloneChartType); return this.crossFiltering && supportsCrossFiltering ? this.getCrossFilterData(params) : this.getDataTransformedData(params, axes); } getDataTransformedData(params, axes) { const xAxisType = axes.x.type; const { categories, data } = params; const [category] = categories; switch (xAxisType) { case "category": return this.transformCategoryData(data, category.id); case "time": return this.transformTimeData(data, category.id, category.convertTime); default: return data; } } getXAxisType(params) { if (params.grouping) { return "grouped-category"; } else if (this.isXAxisOfType(params, "time", (value) => value instanceof Date)) { return "time"; } else if (this.isXAxisOfType(params, "number")) { return "number"; } return "category"; } isXAxisOfType(params, type, isInstance) { const [category] = params.categories; if (category?.chartDataType) { return category.chartDataType === type; } if (!isInstance) { return false; } const testDatum = params.data[0]; if (!testDatum) { return false; } return isInstance(testDatum[category.id]); } transformTimeData(data, categoryKey, convertTime2) { const firstValue = data[0]?.[categoryKey]; if (firstValue instanceof Date) { return data; } return data.map((datum) => { const value = datum[categoryKey]; return typeof value === "string" ? { ...datum, [categoryKey]: convertTime2 ? convertTime2(value) : _parseDateTimeFromString(value) } : datum; }); } crossFilteringReset() { this.crossFilteringSelectedPoints = []; this.crossFilteringAllPoints.clear(); } crossFilteringPointSelected(point) { return this.crossFilteringSelectedPoints.length == 0 || this.crossFilteringSelectedPoints.includes(point); } crossFilteringDeselectedPoints() { return this.crossFilteringSelectedPoints.length > 0 && this.crossFilteringAllPoints.size !== this.crossFilteringSelectedPoints.length; } extractLineAreaCrossFilterSeries(series, params) { const [category] = params.categories; const getYKey = (yKey) => { if (this.standaloneChartType === "area") { const lastSelectedChartId = params.getCrossFilteringContext().lastSelectedChartId; return lastSelectedChartId === params.chartId ? yKey + "-total" : yKey; } return yKey + "-total"; }; return series.map((s2) => { s2.yKey = getYKey(s2.yKey); s2.listeners = { seriesNodeClick: (e) => { const value = e.datum[s2.xKey]; const multiSelection = e.event.metaKey || e.event.ctrlKey; this.crossFilteringAddSelectedPoint(multiSelection, value); this.crossFilterCallback(e); } }; s2.marker = { itemStyler: (p) => { const value = p.datum[category.id]; const highlighted = p.highlightState === "highlighted-item"; return { fill: highlighted ? "yellow" : p.fill, size: highlighted ? 14 : this.crossFilteringPointSelected(value) ? 8 : 0 }; } }; if (this.standaloneChartType === "area") { s2.fillOpacity = this.crossFilteringDeselectedPoints() ? 0.3 : 1; } if (this.standaloneChartType === "line") { s2.strokeOpacity = this.crossFilteringDeselectedPoints() ? 0.3 : 1; } return s2; }); } getCrossFilterData(params) { this.crossFilteringAllPoints.clear(); const [category] = params.categories; const colId = params.fields[0].colId; const filteredOutColId = `${colId}-filtered-out`; const lastSelectedChartId = params.getCrossFilteringContext().lastSelectedChartId; return params.data.map((d) => { const value = d[category.id]; this.crossFilteringAllPoints.add(value); const pointSelected = this.crossFilteringPointSelected(value); if (this.standaloneChartType === "area" && lastSelectedChartId === params.chartId) { d[`${colId}-total`] = pointSelected ? d[colId] : d[colId] + d[filteredOutColId]; } if (this.standaloneChartType === "line") { d[`${colId}-total`] = pointSelected ? d[colId] : d[colId] + d[filteredOutColId]; } return d; }); } crossFilteringAddSelectedPoint(multiSelection, value) { if (multiSelection) { this.crossFilteringSelectedPoints.push(value); } else { this.crossFilteringSelectedPoints = [value]; } } isHorizontal(commonChartOptions) { const seriesType = this.standaloneChartType; if (seriesType !== "waterfall" && seriesType !== "box-plot" && seriesType !== "range-bar") { return false; } const theme = commonChartOptions.theme; const isHorizontal = (theme2) => { const direction = theme2?.overrides?.[seriesType]?.series?.direction; if (direction != null) { return direction === "horizontal"; } if (typeof theme2?.baseTheme === "object") { return isHorizontal(theme2.baseTheme); } return false; }; return isHorizontal(theme); } getSeriesChartThemeDefaults() { return { series: { highlight: getSeriesHighlight(this.crossFiltering, this.isSingleSeries) } }; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/histogramChartProxy.ts var HistogramChartProxy = class extends CartesianChartProxy { getSeries(params) { const firstField = params.fields[0]; return [ { type: this.standaloneChartType, xKey: firstField.colId, xName: firstField.displayName, yName: this.chartProxyParams.translate("histogramFrequency"), areaPlot: false // only constant width is supported via integrated charts } ]; } getAxes(_params) { return { x: { type: "number", position: "bottom" }, y: { type: "number", position: "left" } }; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/waterfallChartProxy.ts var WaterfallChartProxy = class extends CartesianChartProxy { constructor() { super(...arguments); this.isSingleSeries = true; } getAxes(params, commonChartOptions) { const isHorizontal = this.isHorizontal(commonChartOptions); const crossAxis = isHorizontal ? "y" : "x"; const valueAxis = isHorizontal ? "x" : "y"; return { [crossAxis]: { type: this.getXAxisType(params), position: isHorizontal ? "left" : "bottom" }, [valueAxis]: { type: "number", position: isHorizontal ? "bottom" : "left" } }; } getSeries(params) { const [category] = params.categories; const [firstField] = params.fields; const firstSeries = { type: this.standaloneChartType, xKey: category.id, xName: category.name, yKey: firstField.colId, yName: firstField.displayName ?? void 0 }; return [firstSeries]; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/funnel/funnelChartProxy.ts var FunnelChartProxy = class extends ChartProxy { getUpdateOptions(params, commonChartOptions) { return { ...commonChartOptions, data: this.transformFunnelCategories(params), series: this.getSeries(params) }; } transformFunnelCategories(params) { const { data } = params; const [{ id }] = params.categories; return data.map((d, index) => ({ ...d, [id]: { name: d[id], id: index, toString: () => String(d[id]) } })); } getSeriesChartThemeDefaults() { const config = { crosshair: { enabled: false } }; return { zoom: { enabled: false }, ...this.chartType !== "pyramid" && { axes: { category: config, number: config } } }; } getSeries(params) { const [{ id }] = params.categories; const [{ colId }] = params.fields; const series = { type: this.standaloneChartType, stageKey: id, valueKey: colId }; return [series]; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/hierarchical/hierarchicalChartUtils.ts var CATEGORY_LABEL_KEY = "AG-GRID-DEFAULT-LABEL-KEY"; function createCategoryHierarchy(data, categoryKeys) { const hierarchy = buildNestedHierarchy(data, getItemDepth, getItemCategoryLabel); return formatCategoryHierarchy(hierarchy); function getItemDepth(_item) { return categoryKeys.length; } function getItemCategoryLabel(item, categoryIndex) { const categoryKey = categoryKeys[categoryIndex]; const categoryValue = item[categoryKey]; return getCategoryLabel(categoryValue); } function getCategoryLabel(value) { if (value == null) { return null; } return String(value); } } function createAutoGroupHierarchy(data, getItemLabels) { const hierarchy = buildNestedHierarchy(data, getItemDepth, getItemGroupLabel); return formatCategoryHierarchy(hierarchy); function getItemDepth(item) { return getItemLabels(item)?.length ?? 0; } function getItemGroupLabel(item, groupIndex) { const labels2 = getItemLabels(item); return labels2 ? labels2[groupIndex] : labels2; } } function formatCategoryHierarchy(hierarchy, key = null, isChild) { const { depth, rootValues, value, children: inputChildren } = hierarchy; if (rootValues) { return rootValues.map((item) => ({ [CATEGORY_LABEL_KEY]: key, ...item })); } else if (depth === 0) { return [{ [CATEGORY_LABEL_KEY]: key, ...value }]; } const children = []; for (const [childKey, childHierarchy] of inputChildren.entries()) { children.push(...formatCategoryHierarchy(childHierarchy, childKey, true)); } return isChild ? [ { [CATEGORY_LABEL_KEY]: key, children, ...value ?? {} } ] : children; } function buildNestedHierarchy(data, getItemDepth, getItemGroupKey) { const hierarchy = { depth: 0, children: /* @__PURE__ */ new Map() }; for (const item of data) { const itemDepth = getItemDepth(item); createNestedItemHierarchy(item, itemDepth, getItemGroupKey, 0, hierarchy); } return hierarchy; function createNestedItemHierarchy(item, itemDepth, getItemGroupKey2, currentDepth, hierarchy2) { if (currentDepth === itemDepth) { if (currentDepth === 0) { if (!hierarchy2.rootValues) { hierarchy2.rootValues = []; } hierarchy2.rootValues.push(item); } else { hierarchy2.value = item; } return hierarchy2; } else { const key = getItemGroupKey2(item, currentDepth); const existingChildHierarchy = hierarchy2.children.get(key); const childHierarchy = createNestedItemHierarchy( item, itemDepth, getItemGroupKey2, currentDepth + 1, existingChildHierarchy || { depth: 0, children: /* @__PURE__ */ new Map() } ); hierarchy2.children.set(key, childHierarchy); hierarchy2.depth = Math.max(1 + childHierarchy.depth, hierarchy2.depth); return hierarchy2; } } } // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/hierarchical/hierarchicalChartProxy.ts var HierarchicalChartProxy = class extends ChartProxy { getUpdateOptions(params, commonChartOptions) { const { fields } = params; const [sizeField, colorField] = fields; return { ...commonChartOptions, series: this.getSeries(sizeField, colorField), data: this.getData(params, sizeField, colorField) }; } getSeriesChartThemeDefaults() { return { gradientLegend: { gradient: { preferredLength: 200 }, position: "right" } }; } getSeries(sizeField, colorField) { return [ { type: this.standaloneChartType, labelKey: CATEGORY_LABEL_KEY, // Size and color fields are inferred from the range data sizeKey: sizeField?.colId, sizeName: sizeField?.displayName ?? void 0, colorKey: colorField?.colId, colorName: colorField?.displayName ?? void 0 } ]; } getData(params, sizeField, colorField) { const { categories, data, groupData, grouping: isGrouped } = params; if (isGrouped) { const processedData = colorField ? data.concat( groupData?.map((groupDatum) => { const newDatum = { ...groupDatum }; delete newDatum[sizeField.colId]; return newDatum; }) ?? [] ) : data; return createAutoGroupHierarchy( processedData, (item) => item[GROUP_AUTO_COLUMN_ID]?.value ?? null ); } else { const categoryKeys = categories.map(({ id }) => id); return createCategoryHierarchy(data, categoryKeys); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/polar/polarChartProxy.ts var PolarChartProxy = class extends ChartProxy { getAxes(_) { const radialBar = this.standaloneChartType === "radial-bar"; return { angle: { type: radialBar ? "angle-number" : "angle-category" }, radius: { type: radialBar ? "radius-category" : "radius-number" } }; } getSeries(params) { const { fields, categories, seriesGroupType } = params; const [category] = categories; const radialBar = this.standaloneChartType === "radial-bar"; const seriesGroupTypeOptions = this.getSeriesGroupTypeOptions(seriesGroupType); return fields.map((f) => { return { type: this.standaloneChartType, angleKey: radialBar ? f.colId : category.id, angleName: radialBar ? f.displayName ?? void 0 : category.name, radiusKey: radialBar ? category.id : f.colId, radiusName: radialBar ? category.name : f.displayName ?? void 0, ...seriesGroupTypeOptions }; }); } getSeriesGroupType() { const standaloneChartType = this.standaloneChartType; if (!["nightingale", "radial-bar", "radial-column"].includes(standaloneChartType)) { return void 0; } const firstSeriesProperties = this.getChart().series?.[0]?.properties.toJson(); const getStackedValue = () => firstSeriesProperties.normalizedTo ? "normalized" : "stacked"; if (standaloneChartType === "nightingale") { return firstSeriesProperties.grouped ? "grouped" : getStackedValue(); } else { return firstSeriesProperties.stacked ? getStackedValue() : "grouped"; } } getUpdateOptions(params, commonChartOptions) { const axes = this.getAxes(params); return { ...commonChartOptions, data: this.getData(params, axes), axes, series: this.getSeries(params) }; } getData(params, axes) { const isCategoryAxis = axes.angle.type === "angle-category" || axes.radius.type === "radius-category"; if (isCategoryAxis) { const [category] = params.categories; return this.transformCategoryData(params.data, category.id); } else { return params.data; } } getSeriesGroupTypeOptions(seriesGroupType) { if (!seriesGroupType) { return {}; } return { grouped: seriesGroupType === "grouped" || void 0, stacked: seriesGroupType !== "grouped" || void 0, normalizedTo: seriesGroupType === "normalized" ? 100 : void 0 }; } getSeriesChartThemeDefaults() { return { series: { highlight: getSeriesHighlight(this.crossFiltering) } }; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/specialized/heatmapChartProxy.ts var HEATMAP_CATEGORY_KEY = "AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY"; var HEATMAP_SERIES_KEY = "AG-GRID-DEFAULT-HEATMAP-SERIES-KEY"; var HEATMAP_VALUE_KEY = "AG-GRID-DEFAULT-HEATMAP-VALUE-KEY"; function flatMap(items, iteratee) { return items.reduce((acc, item, index, array) => acc.concat(iteratee(item, index, array)), new Array()); } var HeatmapChartProxy = class extends ChartProxy { getUpdateOptions(params, commonChartOptions) { const xSeriesKey = HEATMAP_SERIES_KEY; const xValueKey = HEATMAP_VALUE_KEY; const yKey = HEATMAP_CATEGORY_KEY; return { ...commonChartOptions, series: this.getSeries(params, xSeriesKey, xValueKey, yKey), data: this.getData(params, xSeriesKey, xValueKey, yKey) }; } getSeries(params, xSeriesKey, xValueKey, yKey) { const [category] = params.categories; return [ { type: this.standaloneChartType, // The axis keys reference synthetic fields based on the category values and series column names yKey, xKey: xSeriesKey, // The color key references a synthetic field based on the series column value for a specific cell colorKey: xValueKey, yName: category.name, // We don't know how to label the 'x' series, as it is a synthetic series created from the set of all input columns // In future releases we may want to consider inferring the series label from column groupings etc xName: void 0, colorName: void 0 } ]; } getData(params, xSeriesKey, xValueKey, yKey) { const [category] = params.categories; return flatMap(params.data, (datum, index) => { const value = datum[category.id]; const valueString = value == null ? "" : String(value); const yValue = { id: index, value, toString: () => valueString }; return params.fields.map(({ colId, displayName }) => ({ ...datum, [xSeriesKey]: displayName, [xValueKey]: datum[colId], [yKey]: yValue })); }); } getSeriesChartThemeDefaults() { return { gradientLegend: { gradient: { preferredLength: 200 }, position: "right" }, series: { tooltip: { renderer: renderHeatmapTooltip } } }; } }; function renderHeatmapTooltip(params) { const { xKey, yKey, colorKey, yName, datum } = params; const table = [ { label: yName, value: datum[yKey] }, { label: datum[xKey], value: colorKey && datum[colorKey] } ]; return { title: "", data: table.map(({ label, value }) => ({ label: String(label), value: String(value) })) }; } // packages/ag-grid-enterprise/src/charts/chartComp/datasource/chartDatasource.ts var ChartDatasource = class extends BeanStub { wireBeans(beans) { this.sortSvc = beans.sortSvc; this.gridRowModel = beans.rowModel; this.colModel = beans.colModel; this.valueSvc = beans.valueSvc; this.pivotResultCols = beans.pivotResultCols; this.rowNodeSorter = beans.rowNodeSorter; } getData(params) { if (params.crossFiltering) { if (params.grouping) { _warn(141); return { chartData: [], colNames: {} }; } if (!_isClientSideRowModel(this.gos)) { _warn(142); return { chartData: [], colNames: {} }; } } const isServerSide = _isServerSideRowModel(this.gos); if (isServerSide && params.pivoting) { this.updatePivotKeysForSSRM(); } const result = this.extractRowsFromGridRowModel(params); result.chartData = this.aggregateRowsByDimension(params, result.chartData); return result; } extractRowsFromGridRowModel(params) { const { crossFiltering, startRow, endRow, valueCols, dimensionCols, grouping, crossFilteringSort, combineGroupValues } = params; let extractedRowData = []; const colNames = {}; const groupNodeIndexes = {}; const groupsToRemove = {}; let filteredNodes = {}; let allRowNodes = []; let numRows; if (crossFiltering) { filteredNodes = this.getFilteredRowNodes(); allRowNodes = this.getAllRowNodes(crossFilteringSort); numRows = allRowNodes.length; } else { const modelLastRow = this.gridRowModel.getRowCount() - 1; const hasNoRange = startRow === endRow && startRow === 0 && dimensionCols.length === 0 && valueCols.length === 0; if (hasNoRange) { numRows = 0; } else { const rangeLastRow = endRow >= 0 ? Math.min(endRow, modelLastRow) : modelLastRow; numRows = rangeLastRow - startRow + 1; } } if (numRows > 0) { for (const col of valueCols) { let colNamesArr = []; const pivotKeys = col.getColDef().pivotKeys; if (pivotKeys) { colNamesArr = pivotKeys.slice(); } const headerName = col.getColDef().headerName; if (headerName) { colNamesArr.push(headerName); } if (colNamesArr.length > 0) { colNames[col.getId()] = colNamesArr; } } } let numRemovedNodes = 0; let id = 0; const groupingCache = {}; for (let i = 0; i < numRows; i++) { const rowNode = crossFiltering ? allRowNodes[i] : this.gridRowModel.getRow(i + startRow); if (rowNode.footer || rowNode.detail) { numRemovedNodes++; continue; } const data = { node: rowNode }; for (const col of dimensionCols) { const colId = col.colId; const column = this.colModel.getCol(colId); if (column) { const valueObject = this.valueSvc.getValue(column, rowNode, "data"); if (grouping) { const valueString = valueObject?.toString ? String(valueObject.toString()) : " "; const labels2 = this.getGroupLabels(rowNode, valueString); const value = labels2.slice().reverse(); let groupingValue = { value, // this is needed so that standalone can handle animations properly when data updates id: id++, toString: () => value.filter(Boolean).join(" - ") }; if (combineGroupValues) { const groupingKey = groupingValue.toString(); const cachedGroupingValue = groupingCache[groupingKey]; if (cachedGroupingValue) { groupingValue = cachedGroupingValue; } else { groupingCache[groupingKey] = groupingValue; } } data[colId] = groupingValue; if (rowNode.group) { groupNodeIndexes[labels2.toString()] = i - numRemovedNodes; } const groupKey = labels2.slice(1, labels2.length).toString(); if (groupKey) { groupsToRemove[groupKey] = groupNodeIndexes[groupKey]; } } else { data[colId] = valueObject; } } else { data[DEFAULT_CHART_CATEGORY] = i + 1; } } for (const col of valueCols) { const colId = col.getColId(); if (crossFiltering) { const filteredOutColId = colId + "-filtered-out"; const value = this.valueSvc.getValue(col, rowNode, "data"); let actualValue = value; if (value != null) { if (typeof value.toNumber === "function") { actualValue = value.toNumber(); } else if (typeof value.value === "number") { actualValue = value.value; } } if (filteredNodes[rowNode.id]) { data[colId] = actualValue; data[filteredOutColId] = params.aggFunc || params.isScatter ? void 0 : 0; } else { data[colId] = params.aggFunc || params.isScatter ? void 0 : 0; data[filteredOutColId] = actualValue; } } else { let value = this.valueSvc.getValue(col, rowNode, "data"); if (value && typeof value.value === "number") { value = value.value; } if (value && Object.prototype.hasOwnProperty.call(value, "toString")) { value = parseFloat(value.toString()); } data[colId] = value != null && typeof value.toNumber === "function" ? value.toNumber() : value; } } extractedRowData.push(data); } let groupChartData; if (grouping) { const groupIndexesToRemove = Object.values(groupsToRemove); const allData = extractedRowData; extractedRowData = []; groupChartData = []; for (let i = 0; i < allData.length; i++) { (groupIndexesToRemove.includes(i) ? groupChartData : extractedRowData).push(allData[i]); } } return { chartData: extractedRowData, colNames, groupChartData }; } aggregateRowsByDimension(params, dataFromGrid) { const dimensionCols = params.dimensionCols; if (!params.aggFunc || dimensionCols.length === 0) { return dataFromGrid; } const lastCol = _last(dimensionCols); const lastColId = lastCol?.colId; const map = {}; const dataAggregated = []; for (const data of dataFromGrid) { let currentMap = map; for (const col of dimensionCols) { const colId = col.colId; const key = data[colId]; if (colId === lastColId) { let groupItem = currentMap[key]; if (!groupItem) { groupItem = { __children: [] }; for (const dimCol of dimensionCols) { const dimColId = dimCol.colId; groupItem[dimColId] = data[dimColId]; } currentMap[key] = groupItem; dataAggregated.push(groupItem); } groupItem.__children.push(data); } else { if (!currentMap[key]) { currentMap[key] = {}; } currentMap = currentMap[key]; } } } if (this.gos.assertModuleRegistered("SharedAggregation", 1)) { const aggFuncOrString = params.aggFunc; const aggFunc = typeof aggFuncOrString === "function" ? aggFuncOrString : typeof aggFuncOrString === "string" ? this.beans.aggFuncSvc.getAggFunc(aggFuncOrString) : null; if (typeof aggFunc !== "function") { _warn(109, { inputValue: String(aggFuncOrString), allSuggestions: [] }); return dataAggregated; } const api = this.beans.gridApi; const context = this.gos.get("context"); for (const groupItem of dataAggregated) { for (const col of params.valueCols) { const colId = col.getColId(); if (params.crossFiltering) { const dataToAgg = groupItem.__children.filter((child) => typeof child[colId] !== "undefined").map((child) => child[colId]); const aggResult = aggFunc({ values: dataToAgg, column: col, colDef: col.colDef, pivotResultColumn: void 0, rowNode: void 0, data: void 0, aggregatedChildren: [], api, context }); groupItem[colId] = aggResult && typeof aggResult.value !== "undefined" ? aggResult.value : aggResult; const filteredOutColId = `${colId}-filtered-out`; const dataToAggFiltered = groupItem.__children.filter((child) => typeof child[filteredOutColId] !== "undefined").map((child) => child[filteredOutColId]); const aggResultFiltered = aggFunc({ values: dataToAggFiltered, column: col, colDef: col.colDef, pivotResultColumn: void 0, rowNode: void 0, data: void 0, aggregatedChildren: [], api, context }); groupItem[filteredOutColId] = aggResultFiltered && typeof aggResultFiltered.value !== "undefined" ? aggResultFiltered.value : aggResultFiltered; } else { const dataToAgg = groupItem.__children.map((child) => child[colId]); const aggResult = aggFunc({ values: dataToAgg, column: col, colDef: col.colDef, pivotResultColumn: void 0, rowNode: void 0, data: void 0, aggregatedChildren: [], api, context }); groupItem[colId] = aggResult && typeof aggResult.value !== "undefined" ? aggResult.value : aggResult; } } } } return dataAggregated; } updatePivotKeysForSSRM() { const secondaryColumns = this.pivotResultCols?.getPivotResultCols()?.list; if (!secondaryColumns) { return; } const pivotKeySeparator = this.extractPivotKeySeparator(secondaryColumns); for (const col of secondaryColumns) { if (pivotKeySeparator === "") { col.getColDef().pivotKeys = []; } else { const keys = col.getColId().split(pivotKeySeparator); col.getColDef().pivotKeys = keys.slice(0, keys.length - 1); } } } extractPivotKeySeparator(secondaryColumns) { if (secondaryColumns.length === 0) { return ""; } const extractSeparator = (columnGroup, childId) => { const groupId = columnGroup.getGroupId(); if (!columnGroup.getParent()) { return childId.split(groupId)[1][0]; } return extractSeparator(columnGroup.getParent(), groupId); }; const firstSecondaryCol = secondaryColumns[0]; if (firstSecondaryCol.getParent() == null) { return ""; } return extractSeparator(firstSecondaryCol.getParent(), firstSecondaryCol.getColId()); } getGroupLabels(rowNode, initialLabel) { const labels2 = [initialLabel]; while (rowNode && rowNode.level !== 0) { rowNode = rowNode.parent; if (rowNode) { if (rowNode.group) { const groupColumn = this.colModel.getCol(GROUP_AUTO_COLUMN_ID); if (groupColumn) { const valueObject = this.valueSvc.getValue(groupColumn, rowNode, "data"); const valueString = valueObject?.toString ? String(valueObject.toString()) : " "; labels2.push(valueString); } } else { labels2.push(rowNode.key); } } } return labels2; } /** cross filtering only */ getFilteredRowNodes() { const filteredNodes = {}; this.gridRowModel.forEachNodeAfterFilterAndSort((rowNode) => { filteredNodes[rowNode.id] = rowNode; }); return filteredNodes; } /** cross filtering only */ getAllRowNodes(sortModel) { const allRowNodes = []; this.gridRowModel.forEachNode((rowNode) => { allRowNodes.push(rowNode); }); const rowNodeSorter = this.rowNodeSorter; if (!rowNodeSorter) { return allRowNodes; } const sortOptions = sortModel === true ? this.sortSvc?.getSortOptions() : sortModel; if (!sortOptions || sortOptions.length == 0) { return allRowNodes; } return rowNodeSorter.doFullSortInPlace(allRowNodes, sortOptions); } }; // packages/ag-grid-enterprise/src/charts/chartComp/services/chartColumnService.ts var ChartColumnService = class extends BeanStub { constructor() { super(...arguments); this.valueColsWithoutSeriesType = /* @__PURE__ */ new Set(); } wireBeans(beans) { this.colModel = beans.colModel; this.colNames = beans.colNames; this.valueSvc = beans.valueSvc; } postConstruct() { const clearValueCols = () => this.valueColsWithoutSeriesType.clear(); this.addManagedEventListeners({ newColumnsLoaded: clearValueCols, rowDataUpdated: clearValueCols }); } getColumn(colId) { return this.colModel.getColDefCol(colId); } getAllDisplayedColumns() { return this.beans.visibleCols.allCols; } getColDisplayName(col) { return this.colNames.getDisplayNameForColumn(col, "chart"); } getColGroupDisplayName(colGroup) { return this.colNames.getDisplayNameForColumnGroup(colGroup, "chart"); } getRowGroupColumns() { return this.beans.rowGroupColsSvc?.columns ?? []; } getGroupDisplayColumns() { return this.beans.showRowGroupCols?.columns ?? []; } isPivotMode() { return this.colModel.isPivotMode(); } isPivotActive() { return this.colModel.isPivotActive(); } getChartColumns() { const gridCols = this.colModel.getCols(); const dimensionCols = /* @__PURE__ */ new Set(); const valueCols = /* @__PURE__ */ new Set(); for (const col of gridCols) { const colDef = col.getColDef(); const chartDataType = colDef.chartDataType; if (chartDataType) { switch (chartDataType) { case "category": case "time": dimensionCols.add(col); continue; case "series": valueCols.add(col); continue; case "excluded": continue; default: _warn(153, { chartDataType }); break; } } if (colDef.colId === "ag-Grid-AutoColumn") { dimensionCols.add(col); continue; } if (!col.isPrimary()) { valueCols.add(col); continue; } (this.isInferredValueCol(col) ? valueCols : dimensionCols).add(col); } return { dimensionCols, valueCols }; } isInferredValueCol(col) { const colId = col.getColId(); if (colId === "ag-Grid-AutoColumn") { return false; } const row = _getRowNode(this.beans, { rowIndex: 0, rowPinned: null }); if (!row) { return this.valueColsWithoutSeriesType.has(colId); } let cellValue = this.valueSvc.getValue(col, row, "data"); if (cellValue == null) { cellValue = this.extractLeafData(row, col); } if (cellValue != null) { if (typeof cellValue.toNumber === "function") { cellValue = cellValue.toNumber(); } else if (typeof cellValue.value === "number") { cellValue = cellValue.value; } } const isNumber = typeof cellValue === "number" || col.colDef.cellDataType === "number" || ["series", "time"].includes(col.colDef.chartDataType); if (isNumber) { this.valueColsWithoutSeriesType.add(colId); } else if (cellValue == null && col.colDef.cellDataType !== "number") { _warn(265, { colId }); } return isNumber; } extractLeafData(row, col) { const value = row.data && this.valueSvc.getValue(col, row, "data"); if (value != null) { return value; } const childrenAfterGroup = row.childrenAfterGroup; if (childrenAfterGroup) { for (let i = 0, len = childrenAfterGroup.length; i < len; ++i) { const child = childrenAfterGroup[i]; const result = this.extractLeafData(child, col); if (result != null) { return result; } } } return null; } destroy() { this.valueColsWithoutSeriesType.clear(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/model/comboChartModel.ts var SUPPORTED_COMBO_CHART_TYPES = /* @__PURE__ */ new Set(["line", "groupedColumn", "stackedColumn", "area", "stackedArea"]); var ComboChartModel = class extends BeanStub { constructor(chartDataModel) { super(); // this control flag is used to only log warning for the initial user config this.suppressComboChartWarnings = false; this.chartDataModel = chartDataModel; this.seriesChartTypes = chartDataModel.params.seriesChartTypes ?? []; } postConstruct() { this.initComboCharts(); } update(seriesChartTypes) { this.seriesChartTypes = seriesChartTypes ?? this.seriesChartTypes; this.initComboCharts(); this.updateSeriesChartTypes(); } initComboCharts() { const seriesChartTypesExist = this.seriesChartTypes && this.seriesChartTypes.length > 0; const customCombo = this.chartDataModel.chartType === "customCombo" || seriesChartTypesExist; if (customCombo) { this.chartDataModel.chartType = "customCombo"; this.savedCustomSeriesChartTypes = this.seriesChartTypes || []; } } updateSeriesChartTypes() { if (!this.chartDataModel.isComboChart()) { return; } this.seriesChartTypes = this.seriesChartTypes.map((seriesChartType) => { const primaryOnly = ["groupedColumn", "stackedColumn", "stackedArea"].includes(seriesChartType.chartType); seriesChartType.secondaryAxis = primaryOnly ? false : seriesChartType.secondaryAxis; return seriesChartType; }); if (this.chartDataModel.chartType === "customCombo") { this.updateSeriesChartTypesForCustomCombo(); return; } this.updateChartSeriesTypesForBuiltInCombos(); } updateSeriesChartTypesForCustomCombo() { const seriesChartTypesSupplied = this.seriesChartTypes && this.seriesChartTypes.length > 0; if (!seriesChartTypesSupplied && !this.suppressComboChartWarnings) { _warn(150); } this.seriesChartTypes = this.seriesChartTypes.map((s2) => { if (!SUPPORTED_COMBO_CHART_TYPES.has(s2.chartType)) { _warn(151, { chartType: s2.chartType }); s2.chartType = "line"; } return s2; }); const getSeriesChartType = (valueCol) => { if (!this.savedCustomSeriesChartTypes || this.savedCustomSeriesChartTypes.length === 0) { this.savedCustomSeriesChartTypes = this.seriesChartTypes; } const providedSeriesChartType = this.savedCustomSeriesChartTypes.find((s2) => s2.colId === valueCol.colId); if (!providedSeriesChartType) { if (valueCol.selected && !this.suppressComboChartWarnings) { _warn(152, { colId: valueCol.colId }); } return { colId: valueCol.colId, chartType: "line", secondaryAxis: false }; } return providedSeriesChartType; }; const updatedSeriesChartTypes = this.chartDataModel.valueColState.map(getSeriesChartType); this.seriesChartTypes = updatedSeriesChartTypes; this.savedCustomSeriesChartTypes = updatedSeriesChartTypes; this.suppressComboChartWarnings = true; } updateChartSeriesTypesForBuiltInCombos() { const { chartType, valueColState } = this.chartDataModel; const primaryChartType = chartType === "columnLineCombo" ? "groupedColumn" : "stackedArea"; const secondaryChartType = chartType === "columnLineCombo" ? "line" : "groupedColumn"; const selectedCols = valueColState.filter((cs) => cs.selected); const lineIndex = Math.ceil(selectedCols.length / 2); this.seriesChartTypes = selectedCols.map((valueCol, i) => { const seriesType = i >= lineIndex ? secondaryChartType : primaryChartType; return { colId: valueCol.colId, chartType: seriesType, secondaryAxis: false }; }); } }; // packages/ag-grid-enterprise/src/charts/chartComp/model/chartDataModel.ts var DEFAULT_CHART_CATEGORY = "AG-GRID-DEFAULT-CATEGORY"; var ChartDataModel = class extends BeanStub { constructor(params) { super(); this.unlinked = false; this.chartData = []; this.valueColState = []; this.dimensionColState = []; this.colNames = {}; this.crossFiltering = false; this.crossFilteringSort = true; this.grouping = false; this.useGroupColumnAsCategory = false; this.params = params; this.chartId = params.chartId; this.setParams(params); } wireBeans(beans) { this.rangeSvc = beans.rangeSvc; this.chartTranslation = beans.chartTranslation; } setParams(params) { const { chartType, pivotChart, chartThemeName, switchCategorySeries, aggFunc, cellRange, suppressChartRanges, unlinkChart, crossFiltering, crossFilteringSort, seriesGroupType, useGroupColumnAsCategory } = params; this.chartType = chartType; this.pivotChart = pivotChart ?? false; this.chartThemeName = chartThemeName; this.switchCategorySeries = !!switchCategorySeries; this.aggFunc = aggFunc; this.referenceCellRange = cellRange; this.suppliedCellRange = cellRange; this.suppressChartRanges = suppressChartRanges ?? false; this.unlinked = !!unlinkChart; this.crossFiltering = !!crossFiltering; this.crossFilteringSort = crossFilteringSort ?? true; this.seriesGroupType = seriesGroupType; this.useGroupColumnAsCategory = !!useGroupColumnAsCategory; } postConstruct() { this.datasource = this.createManagedBean(new ChartDatasource()); this.chartColSvc = this.createManagedBean(new ChartColumnService()); this.comboChartModel = this.createManagedBean(new ComboChartModel(this)); this.updateCellRanges({ setColsFromRange: true }); this.updateData(); } updateModel(params) { const { cellRange, seriesChartTypes } = params; if (cellRange !== this.suppliedCellRange) { this.dimensionCellRange = void 0; this.valueCellRange = void 0; } this.setParams(params); this.updateSelectedDimensions(cellRange?.columns); this.updateCellRanges({ setColsFromRange: true }); const shouldUpdateComboModel = this.isComboChart() || seriesChartTypes; if (shouldUpdateComboModel) { this.comboChartModel.update(seriesChartTypes); } if (!this.unlinked) { this.updateData(); } } updateCellRanges(params) { const { updatedColState, resetOrder, maintainColState, setColsFromRange } = params ?? {}; if (this.valueCellRange) { this.referenceCellRange = this.valueCellRange; } const { dimensionCols, valueCols } = this.chartColSvc.getChartColumns(); const allColsFromRanges = this.getAllColumnsFromRanges(); if (updatedColState) { this.updateColumnState(updatedColState, resetOrder); } this.setDimensionCellRange(dimensionCols, allColsFromRanges, updatedColState); this.setValueCellRange(valueCols, allColsFromRanges, setColsFromRange); if (!updatedColState && !maintainColState) { this.resetColumnState(); this.syncDimensionCellRange(); } this.comboChartModel.updateSeriesChartTypes(); } updateData() { const { startRow, endRow } = this.getRowIndexes(); if (this.pivotChart) { this.resetColumnState(); } this.grouping = this.isGrouping(); const params = { aggFunc: this.aggFunc, dimensionCols: this.getSelectedDimensions(), grouping: this.grouping, pivoting: this.isPivotActive(), crossFiltering: this.crossFiltering, crossFilteringSort: this.getCrossFilteringSort(), valueCols: this.getSelectedValueCols(), startRow, endRow, isScatter: ["scatter", "bubble"].includes(this.chartType), combineGroupValues: isStatistical(getSeriesType(this.chartType)) }; const { chartData, colNames, groupChartData } = this.datasource.getData(params); this.chartData = chartData; this.groupChartData = groupChartData; this.colNames = colNames; this.categoryAxisType = void 0; } isGrouping() { const usingTreeData = this.gos.get("treeData"); const groupedCols = usingTreeData ? null : this.chartColSvc.getRowGroupColumns(); const isGroupActive = usingTreeData || groupedCols && groupedCols.length > 0; const colIds = this.getSelectedDimensions().map(({ colId }) => colId); const displayedGroupCols = this.chartColSvc.getGroupDisplayColumns(); const groupDimensionSelected = displayedGroupCols.map((col) => col.getColId()).some((id) => colIds.includes(id)); return !!isGroupActive && groupDimensionSelected; } getSelectedValueCols() { return this.valueColState.filter((cs) => cs.selected).map((cs) => cs.column); } getSelectedDimensions() { return this.dimensionColState.filter((cs) => cs.selected); } getValueColState() { return this.valueColState.map(this.displayNameMapper.bind(this)); } displayNameMapper(col) { const { column } = col; if (column) { const columnDisplayName = this.getColDisplayName(column); col.displayName = this.isPivotMode() ? this.getPivotDisplayName(column, columnDisplayName) : columnDisplayName; } else { const colNames = this.colNames[col.colId]; col.displayName = colNames ? colNames.join(" - ") : this.getColDisplayName(column); } return col; } getPivotDisplayName(column, columnDisplayName) { let attemptFallbackToColNames = false; let displayNames = [columnDisplayName]; const getDisplayName2 = (colGroup) => { if (!colGroup) { return; } const colGroupName = this.chartColSvc.getColGroupDisplayName(colGroup); if (colGroupName?.length) { displayNames.unshift(colGroupName); getDisplayName2(colGroup.getParent()); } else { attemptFallbackToColNames = true; } }; getDisplayName2(column.getParent()); if (attemptFallbackToColNames) { const colNames = this.colNames[column.getColId()]; if (colNames) { displayNames = colNames; } } return displayNames.join(" - "); } getColDisplayName(col) { return this.chartColSvc.getColDisplayName(col); } isPivotMode() { return this.chartColSvc.isPivotMode(); } getChartDataType(colId) { const column = this.chartColSvc.getColumn(colId); return column ? column.getColDef().chartDataType : void 0; } getConvertTime(colId) { const column = this.chartColSvc.getColumn(colId); if (column?.colDef.cellDataType === "dateString") { return this.beans.dataTypeSvc?.getDateParserFunction(column); } return void 0; } isPivotActive() { return this.chartColSvc.isPivotActive(); } createCellRange(type, ...columns) { return { id: this.chartId, // set range ID to match chart ID so we can identify changes to the ranges for this chart startRow: this.referenceCellRange.startRow, endRow: this.referenceCellRange.endRow, columns, startColumn: type === CellRangeType.DIMENSION || this.referenceCellRange.startColumn == null ? columns[0] : this.referenceCellRange.startColumn, type }; } getAllColumnsFromRanges() { if (this.pivotChart) { return new Set(this.chartColSvc.getAllDisplayedColumns()); } const columns = this.dimensionCellRange || this.valueCellRange ? [] : this.referenceCellRange.columns; if (this.dimensionCellRange) { columns.push(...this.dimensionCellRange.columns); } if (this.valueCellRange) { columns.push(...this.valueCellRange.columns); } return new Set(columns); } getRowIndexes() { let startRow = 0, endRow = 0; const { rangeSvc, valueCellRange, dimensionCellRange } = this; const cellRange = valueCellRange || dimensionCellRange; if (rangeSvc && cellRange) { startRow = rangeSvc.getRangeStartRow(cellRange).rowIndex; const endRowPosition = rangeSvc.getRangeEndRow(cellRange); endRow = endRowPosition.rowPinned === "bottom" ? -1 : endRowPosition.rowIndex; } return { startRow, endRow }; } resetColumnState() { const { dimensionCols, valueCols } = this.chartColSvc.getChartColumns(); const allCols = this.getAllColumnsFromRanges(); const isInitialising = this.valueColState.length < 1; this.dimensionColState = []; this.valueColState = []; const supportsMultipleDimensions = isHierarchical(getSeriesType(this.chartType)); let hasSelectedDimension = false; let order = 1; const aggFuncDimension = this.suppliedCellRange.columns[0]; const usingTreeData = this.gos.get("treeData"); const rowGroupCols = usingTreeData ? null : this.chartColSvc.getRowGroupColumns(); const groupingActive = usingTreeData || rowGroupCols && rowGroupCols.length > 0; dimensionCols.forEach((column) => { const autoGroup = isColumnGroupAutoCol(column); const selected = this.crossFiltering && this.aggFunc ? aggFuncDimension.getColId() === column.getColId() : this.useGroupColumnAsCategory && groupingActive && autoGroup || (!hasSelectedDimension || supportsMultipleDimensions) && allCols.has(column); this.dimensionColState.push({ column, colId: column.getColId(), displayName: this.getColDisplayName(column), selected, order: order++ }); if (selected) { hasSelectedDimension = true; } }); const defaultCategory = { colId: DEFAULT_CHART_CATEGORY, displayName: this.chartTranslation.translate("defaultCategory"), selected: !hasSelectedDimension, // if no dimensions in range select the default order: 0 }; this.dimensionColState.unshift(defaultCategory); const valueColumnsFromReferenceRange = this.referenceCellRange.columns.filter( (c) => valueCols.has(c) ); valueCols.forEach((column) => { if (isInitialising && this.referenceCellRange.columns.includes(column)) { column = valueColumnsFromReferenceRange.shift(); } this.valueColState.push({ column, colId: column.getColId(), displayName: this.getColDisplayName(column), selected: allCols.has(column), order: order++ }); }); } updateColumnState(updatedCol, resetOrder) { const idsMatch = (cs) => cs.colId === updatedCol.colId; const { dimensionColState, valueColState } = this; const matchedDimensionColState = dimensionColState.find(idsMatch); const matchedValueColState = valueColState.find(idsMatch); if (matchedDimensionColState) { const supportsMultipleDimensions = isHierarchical(getSeriesType(this.chartType)); if (!supportsMultipleDimensions) { const selectedColumnState = updatedCol.selected ? matchedDimensionColState : dimensionColState.filter((cs) => cs !== matchedDimensionColState).find(({ selected }) => selected); dimensionColState.forEach((cs) => cs.selected = cs === selectedColumnState); } else { matchedDimensionColState.selected = updatedCol.selected; } } else if (matchedValueColState) { matchedValueColState.selected = updatedCol.selected; } const allColumns = [...dimensionColState, ...valueColState]; const orderedColIds = []; if (!resetOrder) { allColumns.forEach((col, i) => { if (i === updatedCol.order) { orderedColIds.push(updatedCol.colId); } if (col.colId !== updatedCol.colId) { orderedColIds.push(col.colId); } }); allColumns.forEach((col) => { const order = orderedColIds.indexOf(col.colId); col.order = order >= 0 ? orderedColIds.indexOf(col.colId) : allColumns.length - 1; }); } this.reorderColState(); } reorderColState() { const ascColStateOrder = (a, b) => a.order - b.order; this.dimensionColState.sort(ascColStateOrder); this.valueColState.sort(ascColStateOrder); } setDimensionCellRange(dimensionCols, colsInRange, updatedColState) { this.dimensionCellRange = void 0; const supportsMultipleDimensions = isHierarchical(getSeriesType(this.chartType)); if (!updatedColState && !this.dimensionColState.length) { const selectedCols = new Array(); dimensionCols.forEach((col) => { if (selectedCols.length > 0 && !supportsMultipleDimensions || !colsInRange.has(col)) { return; } selectedCols.push(col); }); if (selectedCols.length > 0) { this.dimensionCellRange = this.createCellRange(CellRangeType.DIMENSION, ...selectedCols); } return; } let selectedDimensionColStates = updatedColState ? [updatedColState] : []; if (this.crossFiltering && this.aggFunc) { const aggFuncDimension = this.suppliedCellRange.columns[0]; selectedDimensionColStates = this.dimensionColState.filter( (cs) => cs.colId === aggFuncDimension.getColId() ); } else if (supportsMultipleDimensions || selectedDimensionColStates.length === 0 || selectedDimensionColStates.some(({ column }) => !column || !dimensionCols.has(column))) { selectedDimensionColStates = this.dimensionColState.filter((cs) => cs.selected); } const isDefaultCategory = selectedDimensionColStates.length === 1 ? selectedDimensionColStates[0].colId === DEFAULT_CHART_CATEGORY : false; const selectedColumns = selectedDimensionColStates.map(({ column }) => column).filter((value) => value != null); if (selectedColumns.length > 0 && !isDefaultCategory) { this.dimensionCellRange = this.createCellRange(CellRangeType.DIMENSION, ...selectedColumns); } } setValueCellRange(valueCols, colsInRange, setColsFromRange) { this.valueCellRange = void 0; const selectedValueCols = []; const maxSelection = getMaxNumSeries(this.chartType); let numSelected = 0; valueCols.forEach((col) => { if (setColsFromRange) { if ((maxSelection == null || numSelected < maxSelection) && colsInRange.has(col)) { selectedValueCols.push(col); numSelected++; } } else if (this.valueColState.some((colState) => colState.selected && colState.colId === col.getColId())) { selectedValueCols.push(col); } }); if (selectedValueCols.length > 0) { let orderedColIds = []; if (this.valueColState.length > 0) { orderedColIds = this.valueColState.map((c) => c.colId); } else { colsInRange.forEach((c) => orderedColIds.push(c.getColId())); } selectedValueCols.sort((a, b) => orderedColIds.indexOf(a.getColId()) - orderedColIds.indexOf(b.getColId())); this.valueCellRange = this.createCellRange(CellRangeType.VALUE, ...selectedValueCols); } } resetCellRanges(dimension, value) { if (!dimension && !value) { return; } const { dimensionCols, valueCols } = this.chartColSvc.getChartColumns(); const allColsFromRanges = this.getAllColumnsFromRanges(); if (dimension) { this.setDimensionCellRange(dimensionCols, allColsFromRanges); } if (value) { this.setValueCellRange(valueCols, allColsFromRanges); } } updateSelectedDimensions(columns) { const colIdSet = new Set(columns.map((column) => column.getColId())); const supportsMultipleDimensions = isHierarchical(getSeriesType(this.chartType)); if (!supportsMultipleDimensions) { const foundColState = this.dimensionColState.find((colState) => colIdSet.has(colState.colId)) || this.dimensionColState[0]; const selectedColumnId = foundColState.colId; this.dimensionColState = this.dimensionColState.map((colState) => ({ ...colState, selected: colState.colId === selectedColumnId })); } else { const foundColStates = this.dimensionColState.filter((colState) => colIdSet.has(colState.colId)); const selectedColumnIds = new Set(foundColStates.map((colState) => colState.colId)); this.dimensionColState = this.dimensionColState.map((colState) => ({ ...colState, selected: selectedColumnIds.has(colState.colId) })); } } syncDimensionCellRange() { const selectedDimensions = this.getSelectedDimensions(); if (selectedDimensions.length === 0) { return; } const selectedCols = selectedDimensions.map(({ column }) => column).filter((value) => value != null); if (selectedCols.length > 0) { this.dimensionCellRange = this.createCellRange(CellRangeType.DIMENSION, ...selectedCols); } } isComboChart(chartType) { return isComboChart(chartType ?? this.chartType); } getCrossFilteringSort() { const sort = this.crossFilteringSort; if (typeof sort === "boolean") { return sort; } const sortOptions = []; sort.forEach(({ sort: sort2, colId }) => { const column = this.chartColSvc.getColumn(colId); if (column) { sortOptions.push({ sort: sort2, column, type: _normalizeSortType(column.getSortDef()?.type) }); } }); return sortOptions; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/statistical/statisticalChartProxy.ts var StatisticalChartProxy = class extends CartesianChartProxy { getAxes(params, commonChartOptions) { return { x: { type: this.getXAxisType(params), position: this.isHorizontal(commonChartOptions) ? "left" : "bottom" }, y: { type: "number", position: this.isHorizontal(commonChartOptions) ? "bottom" : "left" } }; } computeSeriesStatistics(params, computeStatsFn) { const { data, fields } = params; const [category] = params.categories; const categoryKey = category.id || DEFAULT_CHART_CATEGORY; const groupedData = this.groupDataByCategory(categoryKey, data); return Array.from(groupedData).map(([categoryValue, categoryData]) => { const categoryResult = { [category.id]: categoryValue }; fields.forEach((field, seriesIndex) => { const seriesValues = categoryData.map((datum) => datum[field.colId]).filter((value) => typeof value === "number" && !isNaN(value)); const computed = computeStatsFn(seriesValues); for (const statKey of Object.keys(computed)) { const propertyKey = `${statKey}:${seriesIndex}`; categoryResult[propertyKey] = seriesValues.length > 0 ? computed[statKey] : null; } }); return categoryResult; }); } groupDataByCategory(categoryKey, data) { const getCategory = (datum) => { if (categoryKey === DEFAULT_CHART_CATEGORY) { return 1; } const categoryValue = datum[categoryKey]; if (categoryValue === null || categoryValue === void 0) { return ""; } return categoryValue instanceof Date ? categoryValue.getTime() : categoryValue; }; return data.reduce((acc, datum) => { const category = getCategory(datum); const existingCategoryData = acc.get(category); if (existingCategoryData) { existingCategoryData.push(datum); } else { acc.set(category, [datum]); } return acc; }, /* @__PURE__ */ new Map()); } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/statistical/boxPlotChartProxy.ts var BoxPlotChartProxy = class extends StatisticalChartProxy { getSeries(params) { const [category] = params.categories; return params.fields.map((field, seriesIndex) => ({ type: this.standaloneChartType, // xKey/xName refer to category buckets xKey: category.id, xName: category.name, // yName is used to label the series yName: field.displayName ?? void 0, // custom field labels shown in the tooltip minName: "Min", q1Name: "Q1", medianName: "Median", q3Name: "Q3", maxName: "Max", // generated 'synthetic fields' from getData() minKey: `min:${seriesIndex}`, q1Key: `q1:${seriesIndex}`, medianKey: `median:${seriesIndex}`, q3Key: `q3:${seriesIndex}`, maxKey: `max:${seriesIndex}` })); } getData(params) { return this.computeSeriesStatistics(params, (seriesValues) => { const sortedValues = seriesValues.sort((a, b) => a - b); return { min: sortedValues[0], q1: this.quantile(sortedValues, 0.25), median: this.quantile(sortedValues, 0.5), q3: this.quantile(sortedValues, 0.75), max: sortedValues[sortedValues.length - 1] }; }); } quantile(sortedValues, q) { const position = (sortedValues.length - 1) * q; const indexBelow = Math.floor(position); const aboveValue = position - indexBelow; if (sortedValues[indexBelow + 1] !== void 0) { return sortedValues[indexBelow] + aboveValue * (sortedValues[indexBelow + 1] - sortedValues[indexBelow]); } return sortedValues[indexBelow]; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/statistical/rangeChartProxy.ts var RangeChartProxy = class extends StatisticalChartProxy { getSeries(params) { const [category] = params.categories; return params.fields.map((field, seriesIndex) => ({ type: this.standaloneChartType, // xKey/xName refer to category buckets xKey: category.id, xName: category.name, // yName is used to label the series yName: field.displayName ?? void 0, // custom field labels shown in the tooltip yLowName: "Min", yHighName: "Max", // generated 'synthetic fields' from getData() yLowKey: `min:${seriesIndex}`, yHighKey: `max:${seriesIndex}` })); } getData(params) { return this.computeSeriesStatistics(params, (seriesValues) => { return { min: Math.min(...seriesValues), max: Math.max(...seriesValues) }; }); } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/enterpriseChartProxyFactory.ts var EnterpriseChartProxyFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "enterpriseChartProxyFactory"; } createChartProxy(chartProxyParams) { switch (chartProxyParams.chartType) { case "histogram": return new HistogramChartProxy(chartProxyParams); case "radarLine": case "radarArea": case "nightingale": case "radialColumn": case "radialBar": return new PolarChartProxy(chartProxyParams); case "rangeBar": case "rangeArea": return new RangeChartProxy(chartProxyParams); case "boxPlot": return new BoxPlotChartProxy(chartProxyParams); case "treemap": case "sunburst": return new HierarchicalChartProxy(chartProxyParams); case "heatmap": return new HeatmapChartProxy(chartProxyParams); case "waterfall": return new WaterfallChartProxy(chartProxyParams); case "funnel": case "coneFunnel": case "pyramid": return new FunnelChartProxy(chartProxyParams); } return void 0; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/chartPanelFeature.ts var ChartPanelFeature = class extends BeanStub { constructor(chartController, eGui, cssClass, createPanels) { super(); this.chartController = chartController; this.eGui = eGui; this.cssClass = cssClass; this.createPanels = createPanels; this.panels = []; } postConstruct() { this.addManagedListeners(this.chartController, { chartUpdated: () => this.refreshPanels(true), chartApiUpdate: () => this.refreshPanels(false) }); } addComponent(component) { this.createBean(component); this.panels.push(component); component.addCss(this.cssClass); this.eGui.appendChild(component.getGui()); } refreshPanels(reuse) { const chartType = this.chartController.getChartType(); const isGrouping = this.chartController.isGrouping(); const seriesType = getSeriesType(chartType); if (reuse && chartType === this.chartType && isGrouping === this.isGrouping) { return; } this.destroyPanels(); this.createPanels(chartType, seriesType); this.chartType = chartType; this.isGrouping = isGrouping; } destroyPanels() { for (const panel of this.panels) { _removeFromParent(panel.getGui()); this.destroyBean(panel); } this.panels = []; } destroy() { this.destroyPanels(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/interactivity/animationPanel.ts var AnimationPanel = class extends Component { constructor(chartMenuParamsFactory) { super(); this.chartMenuParamsFactory = chartMenuParamsFactory; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const animationGroupParams = this.chartMenuParamsFactory.addEnableParams( "animation.enabled", { cssIdentifier: "charts-advanced-settings-top-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("animation"), suppressEnabledCheckbox: true, useToggle: true } ); const animationHeightInputParams = this.chartMenuParamsFactory.getDefaultNumberInputParams( "animation.duration", "durationMillis", { min: 0 } ); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgInputNumberFieldSelector], { animationGroup: animationGroupParams, animationHeightInput: animationHeightInputParams } ); } }; // packages/ag-grid-enterprise/src/charts/widgets/colorPicker.ts var ColorPicker = class extends AgColorPicker { constructor(config) { super({ ...config, dialogCallbacks: DIALOG_CALLBACKS }); } }; var ColorPickerSelector = { selector: "AG-COLOR-PICKER", component: ColorPicker }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/interactivity/crosshairPanel.ts var CrosshairPanel = class extends Component { constructor(chartMenuParamsFactory) { super(); this.chartMenuParamsFactory = chartMenuParamsFactory; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const crosshairGroupParams = this.chartMenuParamsFactory.addEnableParams( "crosshair.enabled", { cssIdentifier: "charts-advanced-settings-top-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("crosshair"), suppressEnabledCheckbox: true, useToggle: true } ); const crosshairLabelCheckboxParams = this.chartMenuParamsFactory.getDefaultCheckboxParams( "crosshair.label.enabled", "crosshairLabel" ); const crosshairSnapCheckboxParams = this.chartMenuParamsFactory.getDefaultCheckboxParams( "crosshair.snap", "crosshairSnap" ); const crosshairStrokeColorPickerParams = this.chartMenuParamsFactory.getDefaultColorPickerParams( "crosshair.stroke", "color" ); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgCheckboxSelector, ColorPickerSelector], { crosshairGroup: crosshairGroupParams, crosshairLabelCheckbox: crosshairLabelCheckboxParams, crosshairSnapCheckbox: crosshairSnapCheckboxParams, crosshairStrokeColorPicker: crosshairStrokeColorPickerParams } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/interactivity/navigatorPanel.ts var NavigatorPanel = class extends Component { constructor(chartMenuParamsFactory) { super(); this.chartMenuParamsFactory = chartMenuParamsFactory; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const navigatorGroupParams = this.chartMenuParamsFactory.addEnableParams( "navigator.enabled", { cssIdentifier: "charts-advanced-settings-top-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("navigator"), suppressEnabledCheckbox: true, useToggle: true } ); const navigatorHeightSliderParams = this.chartMenuParamsFactory.getDefaultSliderParams( "navigator.height", "height", 60 ); navigatorHeightSliderParams.minValue = 10; const navigatorMiniChartCheckboxParams = this.chartMenuParamsFactory.getDefaultCheckboxParams( "navigator.miniChart.enabled", "miniChart" ); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSliderSelector, AgCheckboxSelector], { navigatorGroup: navigatorGroupParams, navigatorHeightSlider: navigatorHeightSliderParams, navigatorMiniChartCheckbox: navigatorMiniChartCheckboxParams } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/interactivity/zoomPanel.ts var ZoomPanel = class extends Component { constructor(chartMenuParamsFactory) { super(); this.chartMenuParamsFactory = chartMenuParamsFactory; this.zoomScrollingStepInput = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const zoomGroupParams = this.chartMenuParamsFactory.addEnableParams("zoom.enabled", { cssIdentifier: "charts-advanced-settings-top-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("zoom"), suppressEnabledCheckbox: true, useToggle: true }); const zoomScrollingCheckboxParams = this.chartMenuParamsFactory.getDefaultCheckboxParams( "zoom.enableScrolling", "scrollingZoom" ); const zoomScrollingStepSliderParams = this.chartMenuParamsFactory.getDefaultSliderParams( "zoom.scrollingStep", "scrollingStep", 1 ); zoomScrollingStepSliderParams.step = 0.01; zoomScrollingStepSliderParams.minValue = zoomScrollingStepSliderParams.step; const zoomSelectingCheckboxParams = this.chartMenuParamsFactory.getDefaultCheckboxParams( "zoom.enableSelecting", "selectingZoom" ); zoomScrollingCheckboxParams.onValueChange = /* @__PURE__ */ ((onValueChange) => (value) => { if (!onValueChange) { return; } onValueChange(value); this.zoomScrollingStepInput.setDisabled(!value); })(zoomScrollingCheckboxParams.onValueChange); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgCheckboxSelector, AgSliderSelector], { zoomGroup: zoomGroupParams, zoomScrollingCheckbox: zoomScrollingCheckboxParams, zoomScrollingStepInput: zoomScrollingStepSliderParams, zoomSelectingCheckbox: zoomSelectingCheckboxParams } ); this.zoomScrollingStepInput.setDisabled(!zoomScrollingCheckboxParams.value); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/advancedSettingsPanel.ts var INTERACTIVITY_GROUPS = ["navigator", "zoom", "animation", "crosshair"]; var AdvancedSettingsPanel = class extends Component { constructor(chartMenuContext) { super( /* html */ `
` ); this.chartMenuContext = chartMenuContext; } postConstruct() { this.chartPanelFeature = this.createManagedBean( new ChartPanelFeature( this.chartMenuContext.chartController, this.getGui(), "ag-chart-advanced-settings-section", (chartType, seriesType) => this.createPanels(chartType, seriesType) ) ); this.chartPanelFeature.refreshPanels(); } createPanels(chartType, seriesType) { for (const group of INTERACTIVITY_GROUPS) { if (!this.isGroupPanelShownForSeries(group, seriesType)) { continue; } const comp = this.createPanel(group); this.chartPanelFeature.addComponent(comp); } } isGroupPanelShownForSeries(group, seriesType) { return group === "animation" || isCartesian(seriesType) && !isFunnel(seriesType); } createPanel(group) { const { chartMenuParamsFactory, chartAxisMenuParamsFactory } = this.chartMenuContext; switch (group) { case "navigator": return new NavigatorPanel(chartMenuParamsFactory); case "zoom": return new ZoomPanel(chartMenuParamsFactory); case "animation": return new AnimationPanel(chartMenuParamsFactory); case "crosshair": return new CrosshairPanel(chartAxisMenuParamsFactory); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/advancedSettings/advancedSettingsMenuFactory.ts var AdvancedSettingsMenuFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "advSettingsMenuFactory"; } showMenu(chartMenuContext, eventSource) { this.hideMenu(); const menu = this.createBean(new AdvancedSettingsMenu(chartMenuContext)); this.activeDialog = this.createBean( new Dialog({ title: this.beans.chartTranslation.translate("advancedSettings"), component: menu, width: 300, height: 400, resizable: true, movable: true, centered: true, closable: true, afterGuiAttached: () => { _findFocusableElements(menu.getGui())[0]?.focus(); }, closedCallback: () => { this.activeMenu = this.destroyBean(this.activeMenu); this.activeDialog = void 0; eventSource?.focus({ preventScroll: true }); } }) ); this.activeMenu = menu; } hideMenu() { if (this.activeDialog) { this.destroyBean(this.activeDialog); } } destroy() { this.activeMenu = this.destroyBean(this.activeMenu); this.activeDialog = this.destroyBean(this.activeDialog); super.destroy(); } }; var AdvancedSettingsMenu = class extends TabGuardComp { constructor(chartMenuContext) { super( /* html */ `
` ); this.chartMenuContext = chartMenuContext; } postConstruct() { this.advancedSettingsPanel = this.createManagedBean(new AdvancedSettingsPanel(this.chartMenuContext)); this.getGui().appendChild(this.advancedSettingsPanel.getGui()); this.initialiseTabGuard({ onTabKeyDown: this.onTabKeyDown.bind(this), focusTrapActive: true }); } onTabKeyDown(e) { if (e.defaultPrevented) { return; } e.preventDefault(); const backwards = e.shiftKey; const panelGui = this.advancedSettingsPanel.getGui(); const nextEl = _findNextFocusableElement(this.beans, panelGui, false, backwards); if (nextEl) { nextEl.focus(); } else { const focusableElements = _findFocusableElements(panelGui); if (focusableElements.length) { focusableElements[backwards ? focusableElements.length - 1 : 0].focus(); } } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/chartMenuList.ts var ChartMenuListFactory = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartMenuListFactory"; } wireBeans(beans) { this.popupSvc = beans.popupSvc; this.chartMenuSvc = beans.chartMenuSvc; this.chartTranslation = beans.chartTranslation; } showMenuList(params) { const { eventSource, showMenu, chartMenuContext, closeOnElementClick } = params; const areChartToolPanelsEnabled = this.chartMenuSvc.doChartToolPanelsExist(chartMenuContext.chartController); const menuItems = this.mapWithStockItems( this.getMenuItems(chartMenuContext.chartController, areChartToolPanelsEnabled), chartMenuContext, showMenu, eventSource, areChartToolPanelsEnabled ); if (!menuItems.length) { return; } const chartMenuList = this.createBean(new ChartMenuList(menuItems)); this.activeChartMenuList = chartMenuList; let multiplier = -1; let alignSide = "left"; if (this.gos.get("enableRtl")) { multiplier = 1; alignSide = "right"; } const eGui = chartMenuList.getGui(); this.popupSvc.addPopup({ modal: true, eChild: eGui, closeOnEsc: true, alwaysOnTop: true, closedCallback: () => { this.destroyBean(chartMenuList); this.activeChartMenuList = void 0; if (_isNothingFocused(this.beans)) { eventSource.focus({ preventScroll: true }); } }, afterGuiAttached: (params2) => { chartMenuList.afterGuiAttached(params2, closeOnElementClick); }, positionCallback: () => { { this.popupSvc.positionPopupByComponent({ type: "chartMenu", eventSource, ePopup: eGui, alignSide, nudgeX: 4 * multiplier, nudgeY: 4, position: "under", keepWithinBounds: true }); } }, ariaLabel: "Chart Menu" }); } getMenuItems(chartController, areChartToolPanelsEnabled) { const defaultItems = [ ...areChartToolPanelsEnabled ? ["chartEdit"] : [], ...chartController.isEnterprise() ? ["chartAdvancedSettings"] : [], chartController.isChartLinked() ? "chartUnlink" : "chartLink", "chartDownload" ]; const chartMenuItems = this.gos.get("chartMenuItems"); if (!chartMenuItems) { return defaultItems; } else if (Array.isArray(chartMenuItems)) { return chartMenuItems; } else { return chartMenuItems( _addGridCommonParams(this.gos, { defaultItems, chartId: chartController.getChartId() }) ); } } mapWithStockItems(originalList, chartMenuContext, showMenu, eventSource, areChartToolPanelsEnabled) { if (!originalList) { return []; } const resultList = []; for (const menuItemOrString of originalList) { let result; if (typeof menuItemOrString === "string") { result = this.getStockMenuItem( menuItemOrString, chartMenuContext, showMenu, eventSource, areChartToolPanelsEnabled ); } else { result = { ...menuItemOrString }; } if (!result) { continue; } const { subMenu } = result; if (Array.isArray(subMenu)) { result.subMenu = this.mapWithStockItems( subMenu, chartMenuContext, showMenu, eventSource, areChartToolPanelsEnabled ); } resultList.push(result); } return resultList; } getStockMenuItem(key, chartMenuContext, showMenu, eventSource, areChartToolPanelsEnabled) { switch (key) { case "chartEdit": return areChartToolPanelsEnabled ? this.createMenuItem(this.chartTranslation.translate("chartEdit"), "chartsMenuEdit", showMenu) : null; case "chartAdvancedSettings": return this.createMenuItem( this.chartTranslation.translate("chartAdvancedSettings"), "chartsMenuAdvancedSettings", () => this.chartMenuSvc.openAdvancedSettings(chartMenuContext, eventSource) ); case "chartUnlink": return chartMenuContext.chartController.isChartLinked() ? this.createMenuItem( this.chartTranslation.translate("chartUnlink"), "unlinked", () => this.chartMenuSvc.toggleLinked(chartMenuContext) ) : null; case "chartLink": return !chartMenuContext.chartController.isChartLinked() ? this.createMenuItem( this.chartTranslation.translate("chartLink"), "linked", () => this.chartMenuSvc.toggleLinked(chartMenuContext) ) : null; case "chartDownload": return this.createMenuItem( this.chartTranslation.translate("chartDownload"), "chartsDownload", () => this.chartMenuSvc.downloadChart(chartMenuContext) ); } return null; } createMenuItem(name, iconName, action) { return { name, icon: _createIconNoSpan(iconName, this.beans, null), action }; } destroy() { this.destroyBean(this.activeChartMenuList); super.destroy(); } }; var ChartMenuList = class extends Component { constructor(menuItems) { super( /* html */ ` ` ); this.menuItems = menuItems; this.eChartsMenu = RefPlaceholder; } postConstruct() { this.mainMenuList = this.createManagedBean(new MenuList(0)); this.mainMenuList.addMenuItems(this.menuItems); this.mainMenuList.addEventListener("closeMenu", this.onHidePopup.bind(this)); this.eChartsMenu.appendChild(this.mainMenuList.getGui()); } onHidePopup() { this.hidePopupFunc?.(); } afterGuiAttached({ hidePopup }, closeOnElementClick) { const time = Date.now(); if (hidePopup) { this.hidePopupFunc = hidePopup; this.addDestroyFunc(hidePopup); if (closeOnElementClick) { const clickListener = () => { if (Date.now() - time < 500) { return; } this.hidePopupFunc(); }; closeOnElementClick.addEventListener("click", clickListener); this.addDestroyFunc(() => { closeOnElementClick?.removeEventListener("click", clickListener); }); } } _focusInto(this.mainMenuList.getGui()); } }; // packages/ag-grid-enterprise/src/charts/chartComp/services/chartCrossFilterService.ts var ChartCrossFilterService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartCrossFilterSvc"; } filter(event, reset = false) { const filterManager = this.beans.filterManager; const filterModel = filterManager?.getFilterModel() ?? {}; if (reset) { if (Object.keys(filterModel).length > 0) { filterManager?.setFilterModel(null); } return; } let colId = extractFilterColId(event); if (colId.indexOf("-filtered-out")) { colId = colId.replace("-filtered-out", ""); } this.updateFilters(filterModel, event, colId); } updateFilters(filterModel, event, colId) { const dataKey = extractFilterColId(event); const rawValue = this.convertRawValue(colId, event.datum[dataKey]); if (rawValue === void 0) { return; } const filterManager = this.beans.filterManager; filterManager?.getColumnFilterInstance(colId).then((filter) => { const filterType = filter?.filterType; let setFilter; let processModel = (model) => model; if (filterType === "multi") { const result = extractFromMultiFilter(filter); setFilter = result.setFilter; processModel = result.processModel ?? processModel; } else if (filterType === "set") { setFilter = filter; } if (!setFilter) { _warn(154, { colId }); return; } const update = event.event.metaKey || event.event.ctrlKey; const setFilterModel2 = setFilter.getFilterHandler().getCrossFilterModel( (createKey, availableKeys, existingValues) => getSetFilterModel(update, createKey(rawValue), availableKeys, existingValues) ); const colFilterModel = processModel(setFilterModel2); const newFilterModel = update ? { ...filterModel } : {}; newFilterModel[colId] = colFilterModel; filterManager?.setFilterModel(newFilterModel); }); } convertRawValue(colId, rawValue) { const { colModel, dataTypeSvc } = this.beans; const column = colModel.getColById(colId); const colDef = column?.colDef; if (colDef && dataTypeSvc && colDef.chartDataType === "time" && colDef.cellDataType === "dateString") { return dataTypeSvc.getDateFormatterFunction(column)(rawValue); } return rawValue; } }; function processMultiFilterModel(setFilterModel2, index, numFilters) { const filterModels = new Array(numFilters); for (let i = 0; i < numFilters; i++) { filterModels[i] = i === index ? setFilterModel2 : null; } return { filterType: "multi", filterModels }; } function extractFromMultiFilter(multiFilter) { const numFilters = multiFilter.getNumChildFilters(); for (let i = 0; i < numFilters; i++) { const childFilter = multiFilter.getChildFilterInstance(i); if (childFilter?.filterType === "set") { return { setFilter: childFilter, processModel: (model) => processMultiFilterModel(model, i, numFilters) }; } } return {}; } function extractFilterColId(event) { return event.xKey || event.calloutLabelKey; } function getSetFilterModel(update, key, availableKeySet, existingValues) { let values; if (update) { if (availableKeySet.has(key) && (existingValues == null || existingValues.includes(key))) { values = []; if (existingValues == null) { for (const availableKey of availableKeySet) { if (availableKey !== key) { values.push(availableKey); } } } else { for (const existingValue of existingValues) { if (existingValue !== key && availableKeySet.has(existingValue)) { values.push(existingValue); } } } } else { if (existingValues == null) { values = Array.from(availableKeySet); } else { values = []; for (const existingValue of existingValues) { if (availableKeySet.has(existingValue)) { values.push(existingValue); } } } values.push(key); } } else { values = [key]; } return { filterType: "set", values }; } // packages/ag-grid-enterprise/src/charts/chartComp/services/chartMenuService.ts var CHART_TOOLBAR_ALLOW_LIST = [ "chartUnlink", "chartLink", "chartDownload", "chartMenu" ]; var CHART_TOOL_PANEL_MENU_OPTIONS = { settings: "chartSettings", data: "chartData", format: "chartFormat" }; var ChartMenuService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartMenuSvc"; } wireBeans(beans) { this.advSettingsMenuFactory = beans.advSettingsMenuFactory; } downloadChart(chartMenuContext, dimensions, fileName, fileFormat) { chartMenuContext.chartController.getChartProxy().downloadChart(dimensions, fileName, fileFormat); } toggleLinked(chartMenuContext) { chartMenuContext.chartController.detachChartRange(); } openAdvancedSettings(chartMenuContext, eventSource) { this.advSettingsMenuFactory?.showMenu(chartMenuContext, eventSource); } hideAdvancedSettings() { this.advSettingsMenuFactory?.hideMenu(); } getChartToolbarOptions() { const defaultChartToolbarOptions = ["chartMenu"]; const toolbarItemsFunc = this.gos.getCallback("getChartToolbarItems"); const params = { defaultItems: defaultChartToolbarOptions }; return toolbarItemsFunc ? toolbarItemsFunc(params).filter((option) => { if (!CHART_TOOLBAR_ALLOW_LIST.includes(option)) { _warn(155, { option }); return false; } return true; }) : defaultChartToolbarOptions; } getChartToolPanels(chartController) { const chartToolPanelsDef = this.gos.get("chartToolPanelsDef"); const panelsOverride = chartToolPanelsDef?.panels?.map((panel) => { const menuOption = CHART_TOOL_PANEL_MENU_OPTIONS[panel]; if (!menuOption) { _warn(156, { panel }); } return menuOption; }).filter((panel) => Boolean(panel)); let panels = panelsOverride ?? Object.values(CHART_TOOL_PANEL_MENU_OPTIONS); if (chartController.isPivotChart()) { panels = panels.filter((panel) => panel !== "chartData"); } const defaultToolPanel = chartToolPanelsDef?.defaultToolPanel; const defaultPanel = defaultToolPanel && CHART_TOOL_PANEL_MENU_OPTIONS[defaultToolPanel] || panels[0]; return { panels, defaultPanel }; } doesChartToolbarExist() { const chartToolbarOptions = this.getChartToolbarOptions(); return chartToolbarOptions.length > 0; } doChartToolPanelsExist(chartController) { const { panels } = this.getChartToolPanels(chartController); return panels.length > 0; } }; // packages/ag-grid-enterprise/src/charts/chartComp/services/chartTranslationService.ts var DEFAULT_CHART_TRANSLATIONS = { pivotChartTitle: "Pivot Chart", rangeChartTitle: "Range Chart", settings: "Chart", data: "Set Up", format: "Customize", categories: "Categories", defaultCategory: "(None)", series: "Series", switchCategorySeries: "Switch Category / Series", categoryValues: "Category Values", seriesLabels: "Series Labels", aggregate: "Aggregate", xyValues: "X Y Values", paired: "Paired Mode", axis: "Axis", xAxis: "Horizontal Axis", yAxis: "Vertical Axis", polarAxis: "Polar Axis", radiusAxis: "Radius Axis", navigator: "Navigator", zoom: "Zoom", animation: "Animation", crosshair: "Crosshair", color: "Color", thickness: "Thickness", preferredLength: "Preferred Length", xType: "X Type", axisType: "Axis Type", automatic: "Automatic", category: "Category", number: "Number", time: "Time", timeFormat: "Time Format", autoRotate: "Auto Rotate", labelRotation: "Rotation", circle: "Circle", polygon: "Polygon", square: "Square", cross: "Cross", diamond: "Diamond", plus: "Plus", triangle: "Triangle", heart: "Heart", orientation: "Orientation", fixed: "Fixed", parallel: "Parallel", perpendicular: "Perpendicular", radiusAxisPosition: "Position", ticks: "Ticks", gridLines: "Grid Lines", width: "Width", height: "Height", length: "Length", padding: "Padding", spacing: "Spacing", chartStyle: "Chart Style", title: "Title", chartTitles: "Titles", chartTitle: "Chart Title", chartSubtitle: "Subtitle", horizontalAxisTitle: "Horizontal Axis Title", verticalAxisTitle: "Vertical Axis Title", polarAxisTitle: "Polar Axis Title", titlePlaceholder: "Chart Title", background: "Background", font: "Font", weight: "Weight", top: "Top", right: "Right", bottom: "Bottom", left: "Left", labels: "Labels", calloutLabels: "Callout Labels", sectorLabels: "Sector Labels", positionRatio: "Position Ratio", size: "Size", shape: "Shape", minSize: "Minimum Size", maxSize: "Maximum Size", legend: "Legend", position: "Position", markerSize: "Marker Size", markerStroke: "Marker Stroke", markerPadding: "Marker Padding", itemSpacing: "Item Spacing", itemPaddingX: "Item Padding X", itemPaddingY: "Item Padding Y", layoutHorizontalSpacing: "Horizontal Spacing", layoutVerticalSpacing: "Vertical Spacing", strokeWidth: "Stroke Width", offset: "Offset", offsets: "Offsets", tooltips: "Tooltips", callout: "Callout", markers: "Markers", shadow: "Shadow", blur: "Blur", xOffset: "X Offset", yOffset: "Y Offset", lineWidth: "Line Width", lineDash: "Line Dash", lineDashOffset: "Dash Offset", scrollingZoom: "Scrolling", scrollingStep: "Scrolling Step", selectingZoom: "Selecting", durationMillis: "Duration (ms)", crosshairLabel: "Label", crosshairSnap: "Snap to Node", normal: "Normal", bold: "Bold", italic: "Italic", boldItalic: "Bold Italic", predefined: "Predefined", fillOpacity: "Fill Opacity", strokeColor: "Line Color", strokeOpacity: "Line Opacity", miniChart: "Mini-Chart", histogramBinCount: "Bin count", connectorLine: "Connector Line", seriesItems: "Series Items", seriesItemType: "Item Type", seriesItemPositive: "Positive", seriesItemNegative: "Negative", seriesItemLabels: "Item Labels", columnGroup: "Column", barGroup: "Bar", pieGroup: "Pie", lineGroup: "Line", scatterGroup: "X Y (Scatter)", areaGroup: "Area", polarGroup: "Polar", statisticalGroup: "Statistical", hierarchicalGroup: "Hierarchical", specializedGroup: "Specialized", combinationGroup: "Combination", groupedColumnTooltip: "Grouped", stackedColumnTooltip: "Stacked", normalizedColumnTooltip: "100% Stacked", groupedBarTooltip: "Grouped", stackedBarTooltip: "Stacked", normalizedBarTooltip: "100% Stacked", pieTooltip: "Pie", donutTooltip: "Donut", lineTooltip: "Line", stackedLineTooltip: "Stacked", normalizedLineTooltip: "100% Stacked", groupedAreaTooltip: "Area", stackedAreaTooltip: "Stacked", normalizedAreaTooltip: "100% Stacked", scatterTooltip: "Scatter", bubbleTooltip: "Bubble", histogramTooltip: "Histogram", radialColumnTooltip: "Radial Column", radialBarTooltip: "Radial Bar", radarLineTooltip: "Radar Line", radarAreaTooltip: "Radar Area", nightingaleTooltip: "Nightingale", rangeBarTooltip: "Range Bar", rangeAreaTooltip: "Range Area", boxPlotTooltip: "Box Plot", treemapTooltip: "Treemap", sunburstTooltip: "Sunburst", waterfallTooltip: "Waterfall", heatmapTooltip: "Heatmap", columnLineComboTooltip: "Column & Line", areaColumnComboTooltip: "Area & Column", customComboTooltip: "Custom Combination", innerRadius: "Inner Radius", startAngle: "Start Angle", endAngle: "End Angle", reverseDirection: "Reverse Direction", groupPadding: "Group Padding", seriesPadding: "Series Padding", tile: "Tile", whisker: "Whisker", cap: "Cap", capLengthRatio: "Length Ratio", labelPlacement: "Placement", inside: "Inside", outside: "Outside", noDataToChart: "No data available to be charted.", pivotChartRequiresPivotMode: "Pivot Chart requires Pivot Mode enabled.", chartSettingsToolbarTooltip: "Menu", chartLinkToolbarTooltip: "Linked to Grid", chartUnlinkToolbarTooltip: "Unlinked from Grid", chartDownloadToolbarTooltip: "Download Chart", chartMenuToolbarTooltip: "Menu", chartEdit: "Edit Chart", chartAdvancedSettings: "Advanced Settings", chartLink: "Link to Grid", chartUnlink: "Unlink from Grid", chartDownload: "Download Chart", histogramFrequency: "Frequency", seriesChartType: "Series Chart Type", seriesType: "Series Type", secondaryAxis: "Secondary Axis", seriesAdd: "Add a series", categoryAdd: "Add a category", bar: "Bar", column: "Column", histogram: "Histogram", advancedSettings: "Advanced Settings", direction: "Direction", horizontal: "Horizontal", vertical: "Vertical", seriesGroupType: "Group Type", groupedSeriesGroupType: "Grouped", stackedSeriesGroupType: "Stacked", normalizedSeriesGroupType: "100% Stacked", legendEnabled: "Enabled", groupedColumnFull: "Grouped Column", stackedColumnFull: "Stacked Column", normalizedColumnFull: "100% Stacked Column", groupedBarFull: "Grouped Bar", stackedBarFull: "Stacked Bar", normalizedBarFull: "100% Stacked Bar", stackedAreaFull: "Stacked Area", normalizedAreaFull: "100% Stacked Area", stackedLineFull: "Stacked Line", normalizedLineFull: "100% Stacked Line", customCombo: "Custom Combination", funnel: "Funnel", coneFunnel: "Cone Funnel", pyramid: "Pyramid", funnelGroup: "Funnel", funnelTooltip: "Funnel", coneFunnelTooltip: "Cone Funnel", pyramidTooltip: "Pyramid", dropOff: "Drop-Off", stageLabels: "Stage Labels", reverse: "Reverse", tooltipMode: "Tooltip Mode", tooltipModeSingle: "Single", tooltipModeShared: "Multiple", tooltipModeCompact: "Compact", // menu items groupedColumn: "Grouped", stackedColumn: "Stacked", pie: "Pie", donut: "Donut", line: "Line", scatter: "Scatter", bubble: "Bubble", area: "Area", stackedArea: "Stacked", radarLine: "Radar Line", radarArea: "Radar Area", nightingale: "Nightingale", radialColumn: "Radial Column", radialBar: "Radial Bar", boxPlot: "Box Plot", rangeBar: "Range Bar", rangeArea: "Range Area", treemap: "Treemap", sunburst: "Sunburst", waterfall: "Waterfall", heatmap: "Heatmap", columnLineCombo: "Column & Line", AreaColumnCombo: "Area & Column", // aria ariaChartMenuClose: "Close Chart Edit Menu", ariaChartSelected: "Selected", // group group: "Group", // time formats timeFormatSlashesDDMMYYYY: "DD/MM/YYYY", timeFormatSlashesMMDDYYYY: "MM/DD/YYYY", timeFormatSlashesDDMMYY: "DD/MM/YY", timeFormatSlashesMMDDYY: "MM/DD/YY", timeFormatDotsDDMYY: "DD.M.YY", timeFormatDotsMDDYY: "M.DD.YY", timeFormatDashesYYYYMMDD: "YYYY-MM-DD", timeFormatSpacesDDMMMMYYYY: "DD MMMM YYYY", timeFormatHHMMSS: "HH:MM:SS", timeFormatHHMMSSAmPm: "HH:MM:SS AM/PM", // agg funcs sum: "Sum", first: "First", last: "Last", min: "Min", max: "Max", count: "Count", avg: "Average" }; var ChartTranslationService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartTranslation"; } translate(toTranslate) { const translate = this.getLocaleTextFunc(); const defaultTranslation = DEFAULT_CHART_TRANSLATIONS[toTranslate]; return translate(toTranslate, defaultTranslation); } }; // packages/ag-grid-enterprise/src/charts/chartComp/utils/chartParamsValidator.ts var validateIfDefined = (validationFn) => { return (value) => { if (value == void 0) { return true; } return validationFn(value); }; }; var isString = (value) => typeof value === "string"; var isBoolean = (value) => typeof value === "boolean"; var isValidSeriesChartType = (value) => typeof value === "object"; var createWarnMessage = (property, expectedType) => (value) => `AG Grid - unable to update chart as invalid params supplied: \`${property}: ${value}\`, expected ${expectedType}.`; var createEnterpriseMessage = (feature) => { const url = "https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"; return `${feature} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See ${url} for more details.`; }; var legacyChartTypes = ["doughnut"]; var baseUpdateChartParams = [ "type", "chartId", "chartType", "chartThemeName", "chartThemeOverrides", "unlinkChart" ]; function isValidChartType(value) { return !!getSeriesTypeIfExists(value) || isComboChart(value); } function isLegacyChartType(value) { return legacyChartTypes.includes(value); } var validateChartType = validateIfDefined( (chartType) => { if (isValidChartType(chartType)) { return true; } if (isLegacyChartType(chartType)) { const renamedChartType = getCanonicalChartType(chartType); _warnOnce(`The chart type '${chartType}' has been deprecated. Please use '${renamedChartType}' instead.`); return renamedChartType; } return false; } ); var validateAgChartThemeOverrides = validateIfDefined((themeOverrides) => { return typeof themeOverrides === "object"; }); var validateChartParamsCellRange = validateIfDefined((cellRange) => { return typeof cellRange === "object"; }); var validateAggFunc = validateIfDefined((aggFunc) => { return typeof aggFunc === "string" || typeof aggFunc === "function"; }); var enterpriseChartTypeValidation = (isEnterprise) => ({ property: "chartType", validationFn: validateIfDefined( (chartType) => isEnterprise || !chartType || !isEnterpriseChartType(chartType) ), warnMessage: (chartType) => createEnterpriseMessage(`The '${chartType}' chart type`) }); var switchCategorySeriesValidation = (isEnterprise) => ({ property: "switchCategorySeries", validationFn: validateIfDefined((switchCategorySeries) => { if (!switchCategorySeries || isEnterprise) { return true; } return void 0; }), warnMessage: () => createEnterpriseMessage(`'switchCategorySeries' has been ignored as it`), warnIfFixed: true }); var commonUpdateValidations = () => [ { property: "chartId", validationFn: isString, warnMessage: createWarnMessage("chartId", "string") }, { property: "chartType", validationFn: validateChartType, warnMessage: createWarnMessage("chartType", "ChartType") }, { property: "chartThemeName", validationFn: isString, warnMessage: createWarnMessage("chartThemeName", "string") }, { property: "chartThemeOverrides", validationFn: validateAgChartThemeOverrides, warnMessage: createWarnMessage("chartThemeOverrides", "AgChartThemeOverrides") }, { property: "unlinkChart", validationFn: isBoolean, warnMessage: createWarnMessage("unlinkChart", "boolean") } ]; var cellRangeValidations = (isEnterprise) => [ { property: "cellRange", validationFn: validateChartParamsCellRange, warnMessage: createWarnMessage("cellRange", "ChartParamsCellRange") }, { property: "suppressChartRanges", validationFn: isBoolean, warnMessage: createWarnMessage("suppressChartRanges", "boolean") }, { property: "aggFunc", validationFn: validateAggFunc, warnMessage: createWarnMessage("aggFunc", "string or IAggFunc") }, switchCategorySeriesValidation(isEnterprise) ]; function validateUpdateParams(params, isEnterprise) { const paramsToValidate = params; switch (paramsToValidate.type) { case "rangeChartUpdate": return validateUpdateRangeChartParams(params, isEnterprise); case "pivotChartUpdate": return validateUpdatePivotChartParams(params); case "crossFilterChartUpdate": return validateUpdateCrossFilterChartParams(params, isEnterprise); default: _warnOnce( `Invalid value supplied for 'type': ${params.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.` ); return false; } } function validateCreateParams(params, isEnterprise) { return validateProperties(params, [ enterpriseChartTypeValidation(isEnterprise), switchCategorySeriesValidation(isEnterprise) ]); } function validateUpdateRangeChartParams(params, isEnterprise) { const validations = [ ...commonUpdateValidations(), enterpriseChartTypeValidation(isEnterprise), ...cellRangeValidations(isEnterprise), { property: "seriesChartTypes", validationFn: (value) => value === void 0 || Array.isArray(value) && value.every(isValidSeriesChartType), warnMessage: createWarnMessage("seriesChartTypes", "Array of SeriesChartType") }, { property: "useGroupColumnAsCategory", validationFn: isBoolean, warnMessage: createWarnMessage("useGroupColumnAsCategory", "boolean") } ]; return validateProperties( params, validations, [ ...baseUpdateChartParams, "cellRange", "suppressChartRanges", "switchCategorySeries", "aggFunc", "seriesChartTypes", "seriesGroupType", "useGroupColumnAsCategory" ], "UpdateRangeChartParams" ); } function validateUpdatePivotChartParams(params) { const validations = [...commonUpdateValidations()]; return validateProperties(params, validations, [...baseUpdateChartParams], "UpdatePivotChartParams"); } function validateUpdateCrossFilterChartParams(params, isEnterprise) { const validations = [ ...commonUpdateValidations(), ...cellRangeValidations(isEnterprise) ]; return validateProperties( params, validations, [...baseUpdateChartParams, "cellRange", "suppressChartRanges", "aggFunc"], "UpdateCrossFilterChartParams" ); } function validateProperties(params, validations, validPropertyNames, paramsType) { let validatedProperties = void 0; for (const validation of validations) { const { property, validationFn, warnMessage, warnIfFixed } = validation; if (property in params) { const value = params[property]; const validationResult = validationFn(value); if (validationResult === true) { continue; } if (validationResult === false) { _warnOnce(warnMessage(value)); return false; } validatedProperties = validatedProperties || { ...params }; validatedProperties[property] = validationResult; if (warnIfFixed) { _warnOnce(warnMessage(value)); } } } if (validPropertyNames) { for (const property of Object.keys(params)) { if (!validPropertyNames.includes(property)) { _warnOnce(`Unexpected property supplied. ${paramsType} does not contain: \`${property}\`.`); return false; } } } if (validatedProperties) { return validatedProperties; } return true; } // packages/ag-grid-enterprise/src/charts/chartComp/chartController.ts var DEFAULT_THEMES = ["ag-default", "ag-material", "ag-sheets", "ag-polychroma", "ag-vivid"]; var ChartController = class extends BeanStub { constructor(model) { super(); this.model = model; this.isEnterprise = () => this.agChartsExports.isEnterprise; } wireBeans(beans) { this.rangeSvc = beans.rangeSvc; this.agChartsExports = beans.agChartsExports; } postConstruct() { this.setChartRange(); if (this.model.unlinked) { if (this.rangeSvc) { this.rangeSvc.setCellRanges([]); } } const listener = this.updateForGridChange.bind(this, {}); this.addManagedEventListeners({ cellSelectionChanged: (event) => { if (event.id && event.id === this.model.chartId) { this.updateForRangeChange(); } }, columnMoved: listener, columnPinned: listener, columnVisible: listener, columnRowGroupChanged: listener, modelUpdated: listener, cellValueChanged: this.updateForDataChange.bind(this), cellEditValuesChanged: this.updateForDataChange.bind(this) }); } update(params) { if (!this.validUpdateType(params)) { return false; } const validationResult = validateUpdateParams(params, this.agChartsExports.isEnterprise); if (!validationResult) { return false; } const validParams = validationResult === true ? params : validationResult; this.applyValidatedChartParams(validParams); return true; } applyValidatedChartParams(params) { const { chartId, chartType, chartThemeName, unlinkChart } = params; const common = { chartId, pivotChart: this.model.pivotChart, chartType: chartType ?? this.model.chartType, chartThemeName: chartThemeName ?? this.model.chartThemeName, unlinkChart: unlinkChart ?? this.model.unlinked, cellRange: this.model.suppliedCellRange, switchCategorySeries: this.model.switchCategorySeries, aggFunc: this.model.aggFunc, seriesChartTypes: void 0, suppressChartRanges: false, crossFiltering: false }; const chartModelParams = { ...common }; switch (params.type) { case "rangeChartUpdate": chartModelParams.cellRange = this.createCellRange(params) ?? this.model.suppliedCellRange; chartModelParams.switchCategorySeries = params.switchCategorySeries ?? this.model.switchCategorySeries; chartModelParams.aggFunc = params.aggFunc ?? this.model.aggFunc; chartModelParams.seriesChartTypes = params.seriesChartTypes; chartModelParams.suppressChartRanges = params.suppressChartRanges ?? this.model.suppressChartRanges; chartModelParams.seriesGroupType = params.seriesGroupType ?? this.model.seriesGroupType; chartModelParams.useGroupColumnAsCategory = params.useGroupColumnAsCategory ?? this.model.useGroupColumnAsCategory; break; case "crossFilterChartUpdate": chartModelParams.cellRange = this.createCellRange(params) ?? this.model.suppliedCellRange; chartModelParams.switchCategorySeries = false; chartModelParams.aggFunc = params.aggFunc ?? this.model.aggFunc; chartModelParams.crossFiltering = true; chartModelParams.crossFilteringSort = this.model.crossFilteringSort; chartModelParams.suppressChartRanges = params.suppressChartRanges ?? this.model.suppressChartRanges; break; case "pivotChartUpdate": chartModelParams.switchCategorySeries = false; break; } this.model.updateModel(chartModelParams); const removeChartCellRanges = chartModelParams.unlinkChart || chartModelParams.suppressChartRanges; if (removeChartCellRanges) { this.rangeSvc?.setCellRanges([]); } else { this.setChartRange(); } } updateForGridChange(params) { if (this.model.unlinked) { return; } const { maintainColState, setColsFromRange } = params ?? {}; this.model.updateCellRanges({ maintainColState, setColsFromRange }); this.model.updateData(); this.setChartRange(); } updateForDataChange() { if (this.model.unlinked) { return; } this.model.updateData(); this.raiseChartModelUpdateEvent(); } updateForRangeChange() { this.updateForGridChange({ setColsFromRange: true }); this.raiseChartRangeSelectionChangedEvent(); } updateForPanelChange(params) { this.model.updateCellRanges(params); this.model.updateData(); if (params.skipAnimation) { this.getChartProxy().getChartRef().skipAnimations(); } this.setChartRange(); this.raiseChartRangeSelectionChangedEvent(); } updateThemeOverrides(updatedOverrides) { this.chartProxy.updateThemeOverrides(updatedOverrides); } getChartUpdateParams(updatedOverrides) { const selectedCols = this.getSelectedValueColState(); const fields = selectedCols.map((c) => ({ colId: c.colId, displayName: c.displayName })); const data = this.getChartData(); const selectedDimensions = this.getSelectedDimensions(); const model = this.model; const params = { data, groupData: model.groupChartData, grouping: this.isGrouping(), categories: selectedDimensions.map(({ colId, displayName }) => { const chartDataType = model.categoryAxisType ?? model.getChartDataType(colId); return { id: colId, name: displayName, chartDataType, convertTime: chartDataType === "time" ? model.getConvertTime(colId) : void 0 }; }), fields, chartId: this.getChartId(), getCrossFilteringContext: () => ({ lastSelectedChartId: "xxx" }), //this.params.crossFilteringContext, //TODO seriesChartTypes: this.getSeriesChartTypes(), updatedOverrides, seriesGroupType: model.seriesGroupType }; return this.isCategorySeriesSwitched() ? this.invertCategorySeriesParams(params) : params; } invertCategorySeriesParams(params) { const [category] = params.categories; const categories = [{ id: DEFAULT_CHART_CATEGORY, name: "" }]; const fields = params.data.map((value, index) => { const categoryKey = `${category.id}:${index}`; const categoryValue = value[category.id]; const seriesLabel = categoryValue == null ? "" : String(categoryValue); return { colId: categoryKey, displayName: seriesLabel }; }); const data = params.fields.map((field) => { const row = { [DEFAULT_CHART_CATEGORY]: field.displayName }; for (const [index, value] of params.data.entries()) { const categoryKey = `${category.id}:${index}`; const seriesLabelValue = value[field.colId]; row[categoryKey] = seriesLabelValue; } return row; }); return { ...params, categories, fields, data }; } getChartModel() { const modelType = this.model.pivotChart ? "pivot" : "range"; const seriesChartTypes = this.isComboChart() ? this.model.comboChartModel.seriesChartTypes : void 0; return { modelType, chartId: this.model.chartId, chartType: this.model.chartType, chartThemeName: this.getChartThemeName(), chartOptions: this.chartProxy?.getChartThemeOverrides(), chartPalette: this.chartProxy?.getChartPalette(), cellRange: this.getCellRangeParams(), switchCategorySeries: this.model.switchCategorySeries, suppressChartRanges: this.model.suppressChartRanges, aggFunc: this.model.aggFunc, unlinkChart: this.model.unlinked, seriesChartTypes, seriesGroupType: this.model.seriesGroupType, useGroupColumnAsCategory: this.model.useGroupColumnAsCategory }; } getChartId() { return this.model.chartId; } getChartData() { return this.model.chartData; } getChartType() { return this.model.chartType; } setChartType(chartType) { this.updateMultiSeriesAndCategory(this.model.chartType, chartType); this.model.chartType = chartType; this.model.comboChartModel.updateSeriesChartTypes(); this.model.switchCategorySeries = false; this.model.categoryAxisType = void 0; this.model.seriesGroupType = void 0; this.raiseChartModelUpdateEvent(); } isCategorySeriesSwitched() { return this.model.switchCategorySeries && !this.model.isGrouping(); } switchCategorySeries(inverted) { if (!supportsInvertedCategorySeries(this.getChartType())) { return; } this.model.switchCategorySeries = inverted; this.raiseChartModelUpdateEvent(); } getAggFunc() { return this.model.aggFunc; } setAggFunc(value, silent) { if (this.model.aggFunc === value) { return; } this.model.aggFunc = value; if (silent) { return; } this.model.updateData(); this.raiseChartModelUpdateEvent(); } updateMultiSeriesAndCategory(previousChartType, chartType) { const updateForMax = (columns, maxNum) => { let numSelected = 0; for (const colState of columns) { if (!colState.selected) { continue; } if (numSelected >= maxNum) { colState.selected = false; } else { numSelected++; } } if (numSelected === 0) { columns[0].selected = true; } }; const maxNumDimensions = getMaxNumCategories(chartType); const maxNumSeries = getMaxNumSeries(chartType); const updateDimensionColState = maxNumDimensions != null && (getMaxNumCategories(previousChartType) ?? 100) > (maxNumDimensions ?? 100); const updateValueColState = maxNumSeries != null && (getMaxNumSeries(previousChartType) ?? 100) > (maxNumSeries ?? 100); if (updateDimensionColState) { updateForMax(this.model.dimensionColState, maxNumDimensions); } if (updateValueColState) { updateForMax(this.model.valueColState, maxNumSeries); } if (updateDimensionColState || updateValueColState) { this.model.resetCellRanges(updateDimensionColState, updateValueColState); this.setChartRange(true); } } setChartThemeName(chartThemeName, silent) { this.model.chartThemeName = chartThemeName; if (!silent) { this.raiseChartModelUpdateEvent(); } } getChartThemeName() { return this.model.chartThemeName; } isPivotChart() { return this.model.pivotChart; } isPivotMode() { return this.model.isPivotMode(); } isGrouping() { return this.model.isGrouping(); } isCrossFilterChart() { return this.model.crossFiltering; } getThemeNames() { return this.gos.get("chartThemes") || DEFAULT_THEMES; } getThemes() { const themeNames = this.getThemeNames(); return themeNames.map((themeName) => { const stockTheme = isStockTheme(themeName, this.agChartsExports._Theme); const theme = stockTheme ? themeName : this.chartProxy.lookupCustomChartTheme(themeName); return this.agChartsExports._Theme.getChartTheme(theme); }); } getPalettes() { const themes = this.getThemes(); return themes.map((theme) => { return theme.palette; }); } getSelectedValueColState() { return this.model.getValueColState().filter((cs) => cs.selected); } getSelectedDimensions() { return this.model.getSelectedDimensions(); } getColStateForMenu() { return { dimensionCols: this.model.dimensionColState, valueCols: this.model.getValueColState() }; } setChartRange(silent = false) { if (this.rangeSvc && !this.model.suppressChartRanges && !this.model.unlinked) { this.rangeSvc.setCellRanges(this.getCellRanges()); } if (!silent) { this.raiseChartModelUpdateEvent(); } } detachChartRange() { this.model.unlinked = !this.model.unlinked; if (this.model.unlinked) { if (this.rangeSvc) { this.rangeSvc.setCellRanges([]); } } else { this.updateForGridChange(); } this.dispatchLocalEvent({ type: "chartLinkedChanged" }); } setChartProxy(chartProxy) { this.chartProxy = chartProxy; } getChartProxy() { return this.chartProxy; } isActiveXYChart() { return ["scatter", "bubble"].includes(this.getChartType()); } isChartLinked() { return !this.model.unlinked; } customComboExists() { const savedCustomSeriesChartTypes = this.model.comboChartModel.savedCustomSeriesChartTypes; return savedCustomSeriesChartTypes && savedCustomSeriesChartTypes.length > 0; } getSeriesChartTypes() { return this.model.comboChartModel.seriesChartTypes; } isComboChart(chartType) { return this.model.isComboChart(chartType); } updateSeriesChartType(colId, chartType, secondaryAxis) { const seriesChartType = this.model.comboChartModel.seriesChartTypes.find((s2) => s2.colId === colId); if (seriesChartType) { const updateChartType = this.model.chartType !== "customCombo"; if (updateChartType) { this.model.chartType = "customCombo"; } const prevSeriesChartType = seriesChartType.chartType; if (chartType != null) { seriesChartType.chartType = chartType; } if (secondaryAxis != null) { seriesChartType.secondaryAxis = secondaryAxis; } this.model.comboChartModel.savedCustomSeriesChartTypes = this.model.comboChartModel.seriesChartTypes; this.model.comboChartModel.updateSeriesChartTypes(); this.updateForDataChange(); if (updateChartType) { this.dispatchLocalEvent({ type: "chartTypeChanged" }); } if (prevSeriesChartType !== chartType) { this.dispatchLocalEvent({ type: "chartSeriesChartTypeChanged" }); } this.raiseChartOptionsChangedEvent(); } } getActiveSeriesChartTypes() { const selectedColIds = this.getSelectedValueColState().map((c) => c.colId); return this.getSeriesChartTypes().filter((s2) => selectedColIds.includes(s2.colId)); } getChartSeriesTypes(chartType) { const targetChartType = chartType ?? this.getChartType(); return this.isComboChart(targetChartType) ? ["line", "bar", "area"] : [getSeriesType(targetChartType)]; } getChartSeriesType() { const seriesChartTypes = this.getSeriesChartTypes(); if (seriesChartTypes.length === 0) { return "bar"; } const ct = seriesChartTypes[0].chartType; if (ct === "columnLineCombo") { return "bar"; } if (ct === "areaColumnCombo") { return "area"; } return getSeriesType(ct); } getCellRanges() { return [this.model.dimensionCellRange, this.model.valueCellRange].filter((r) => r); } createCellRange(params) { return params.cellRange && this.rangeSvc?.createPartialCellRangeFromRangeParams(params.cellRange, true); } validUpdateType(params) { if (!params.type) { _warn(136); return false; } const chartTypeMap = { "Range Chart": () => !this.isPivotChart() && !this.isCrossFilterChart(), "Pivot Chart": () => this.isPivotChart(), "Cross Filter Chart": () => this.isCrossFilterChart() }; const currentChartType = Object.keys(chartTypeMap).find((type) => chartTypeMap[type]()) ?? "Range Chart"; const valid = params.type === `${currentChartType[0].toLowerCase()}${currentChartType.slice(1).replace(/ /g, "")}Update`; if (!valid) { _warn(137, { currentChartType, type: params.type }); } return valid; } getCellRangeParams() { const cellRanges = this.getCellRanges(); const firstCellRange = cellRanges[0]; const startRow = firstCellRange?.startRow || null; const endRow = firstCellRange?.endRow || null; return { rowStartIndex: startRow?.rowIndex ?? null, rowStartPinned: startRow?.rowPinned, rowEndIndex: endRow?.rowIndex ?? null, rowEndPinned: endRow?.rowPinned, columns: cellRanges.reduce( (columns, value) => columns.concat(value.columns.map((c) => c.getId())), [] ) }; } setCategoryAxisType(categoryAxisType) { this.model.categoryAxisType = categoryAxisType; this.raiseChartModelUpdateEvent(); } getSeriesGroupType() { return this.model.seriesGroupType ?? this.chartProxy.getSeriesGroupType(); } setSeriesGroupType(seriesGroupType) { this.model.seriesGroupType = seriesGroupType; this.raiseChartModelUpdateEvent(); } raiseChartModelUpdateEvent() { this.dispatchLocalEvent({ type: "chartModelUpdate" }); this.raiseChartOptionsChangedEvent(); } raiseChartUpdatedEvent() { this.dispatchLocalEvent({ type: "chartUpdated" }); } raiseChartApiUpdateEvent() { this.dispatchLocalEvent({ type: "chartApiUpdate" }); } raiseChartOptionsChangedEvent() { const { chartId, chartType } = this.getChartModel(); this.eventSvc.dispatchEvent({ type: "chartOptionsChanged", chartId, chartType, chartThemeName: this.getChartThemeName(), chartOptions: this.chartProxy?.getChartThemeOverrides() }); } raiseChartRangeSelectionChangedEvent() { this.eventSvc.dispatchEvent({ type: "chartRangeSelectionChanged", id: this.model.chartId, chartId: this.model.chartId, cellRange: this.getCellRangeParams() }); } destroy() { super.destroy(); if (this.rangeSvc) { this.rangeSvc.setCellRanges([]); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/areaChartProxy.ts var AreaChartProxy = class extends CartesianChartProxy { getAxes(params) { const axes = { x: { type: this.getXAxisType(params), position: "bottom" }, y: { type: "number", position: "left" } }; if (this.isNormalised()) { axes.y.label = { ...axes.y.label, formatter: (params2) => Math.round(params2.value) + "%" }; } return axes; } getSeries(params) { const [category] = params.categories; const series = params.fields.map( (f) => ({ type: this.standaloneChartType, xKey: category.id, xName: category.name, yKey: f.colId, yName: f.displayName, normalizedTo: this.chartType === "normalizedArea" ? 100 : void 0, stacked: ["normalizedArea", "stackedArea"].includes(this.chartType) }) ); return this.crossFiltering ? this.extractLineAreaCrossFilterSeries(series, params) : series; } isNormalised() { return !this.crossFiltering && this.chartType === "normalizedArea"; } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/barChartProxy.ts var HORIZONTAL_CHART_TYPES = /* @__PURE__ */ new Set(["bar", "groupedBar", "stackedBar", "normalizedBar"]); var BarChartProxy = class extends CartesianChartProxy { getAxes(params) { const axes = { x: { type: this.getXAxisType(params), position: this.isHorizontal() ? "left" : "bottom" }, y: { type: "number", position: this.isHorizontal() ? "bottom" : "left" } }; if (this.isNormalised()) { axes.y.label = { ...axes.y.label, formatter: (params2) => Math.round(params2.value) + "%" }; } return axes; } getSeries(params) { const [category] = params.categories; const series = params.fields.map( (f) => ({ type: this.standaloneChartType, direction: this.isHorizontal() ? "horizontal" : "vertical", stacked: this.crossFiltering || isStacked(this.chartType), normalizedTo: this.isNormalised() ? 100 : void 0, xKey: category.id, xName: category.name, yKey: f.colId, yName: f.displayName }) ); return this.crossFiltering ? this.extractCrossFilterSeries(series) : series; } extractCrossFilterSeries(series) { const allSeries = []; for (let i = 0; i < series.length; i++) { const commonSeries = series[i]; const primarySeries = { ...commonSeries, listeners: { seriesNodeClick: this.crossFilterCallback } }; const filteredOutSeries = { ...primarySeries, yKey: `${primarySeries.yKey}-filtered-out`, showInLegend: false }; allSeries.push(primarySeries); allSeries.push(filteredOutSeries); } return allSeries; } isNormalised() { const normalisedCharts = ["normalizedColumn", "normalizedBar"]; return !this.crossFiltering && normalisedCharts.includes(this.chartType); } isHorizontal() { return HORIZONTAL_CHART_TYPES.has(this.chartType); } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/lineChartProxy.ts var LineChartProxy = class extends CartesianChartProxy { getAxes(params) { const axes = { x: { type: this.getXAxisType(params), position: "bottom" }, y: { type: "number", position: "left" } }; if (this.isNormalised()) { axes.y.label = { ...axes.y.label, formatter: (params2) => Math.round(params2.value) + "%" }; } return axes; } getSeries(params) { const [category] = params.categories; const stacked = ["normalizedLine", "stackedLine"].includes(this.chartType); const series = params.fields.map( (f) => ({ type: this.standaloneChartType, xKey: category.id, xName: category.name, yKey: f.colId, yName: f.displayName, normalizedTo: stacked && this.isNormalised() ? 100 : void 0, stacked }) ); return this.crossFiltering ? this.extractLineAreaCrossFilterSeries(series, params) : series; } isNormalised() { const normalisedCharts = ["normalizedLine"]; return !this.crossFiltering && normalisedCharts.includes(this.chartType); } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/cartesian/scatterChartProxy.ts var ScatterChartProxy = class extends CartesianChartProxy { getAxes(_params) { return { x: { type: "number", position: "bottom" }, y: { type: "number", position: "left" } }; } getSeries(params) { const [category] = params.categories; const paired = this.isPaired(); const seriesDefinitions = this.getSeriesDefinitions(params.fields, paired); const labelFieldDefinition = category.id === DEFAULT_CHART_CATEGORY ? void 0 : category; const series = seriesDefinitions.map((seriesDefinition) => { if (seriesDefinition?.sizeField) { const opts2 = { type: "bubble", xKey: seriesDefinition.xField.colId, xName: seriesDefinition.xField.displayName ?? void 0, yKey: seriesDefinition.yField.colId, yName: seriesDefinition.yField.displayName ?? void 0, title: `${seriesDefinition.yField.displayName} vs ${seriesDefinition.xField.displayName}`, sizeKey: seriesDefinition.sizeField.colId, sizeName: seriesDefinition.sizeField.displayName ?? "", labelKey: labelFieldDefinition ? labelFieldDefinition.id : seriesDefinition.yField.colId, labelName: labelFieldDefinition ? labelFieldDefinition.name : void 0 }; return opts2; } const opts = { type: "scatter", xKey: seriesDefinition.xField.colId, xName: seriesDefinition.xField.displayName ?? void 0, yKey: seriesDefinition.yField.colId, yName: seriesDefinition.yField.displayName ?? void 0, title: `${seriesDefinition.yField.displayName} vs ${seriesDefinition.xField.displayName}`, labelKey: labelFieldDefinition ? labelFieldDefinition.id : seriesDefinition.yField.colId, labelName: labelFieldDefinition ? labelFieldDefinition.name : void 0 }; return opts; }); return this.crossFiltering ? this.extractCrossFilterSeries(series, params) : series; } extractCrossFilterSeries(series, params) { const { data } = params; const filteredOutKey = (key) => `${key}-filtered-out`; const calcMarkerDomain = (data2, sizeKey) => { const markerDomain = [Infinity, -Infinity]; if (sizeKey != null) { for (const datum of data2) { const value = datum[sizeKey] ?? datum[filteredOutKey(sizeKey)]; if (value < markerDomain[0]) { markerDomain[0] = value; } if (value > markerDomain[1]) { markerDomain[1] = value; } } } if (markerDomain[0] <= markerDomain[1]) { return markerDomain; } return void 0; }; const updatePrimarySeries = (series2) => { let markerDomain = void 0; if (series2.type === "bubble") { const { sizeKey } = series2; markerDomain = calcMarkerDomain(data, sizeKey); } return { ...series2, domain: markerDomain, highlight: { highlightedItem: { fill: "yellow" } }, listeners: { ...series2.listeners, seriesNodeClick: this.crossFilterCallback } }; }; const updateFilteredOutSeries = (series2) => { const { yKey, xKey } = series2; let alteredSizeKey = {}; if (series2.type === "bubble") { alteredSizeKey = { sizeKey: filteredOutKey(series2.sizeKey) }; } return { ...series2, ...alteredSizeKey, yKey: filteredOutKey(yKey), xKey: filteredOutKey(xKey), showInLegend: false, listeners: { ...series2.listeners, seriesNodeClick: (e) => { const value = e.datum[filteredOutKey(xKey)]; const filterableEvent = { ...e, xKey, datum: { ...e.datum, [xKey]: value } }; this.crossFilterCallback(filterableEvent); } } }; }; const updatedSeries = series.map(updatePrimarySeries); return [...updatedSeries, ...updatedSeries.map(updateFilteredOutSeries)]; } getSeriesDefinitions(fields, paired) { if (fields.length < 2) { return []; } const isBubbleChart = this.chartType === "bubble"; if (paired) { if (isBubbleChart) { return fields.map( (currentXField, i) => i % 3 === 0 ? { xField: currentXField, yField: fields[i + 1], sizeField: fields[i + 2] } : null ).filter((x) => x?.yField && x.sizeField); } return fields.map( (currentXField, i) => i % 2 === 0 ? { xField: currentXField, yField: fields[i + 1] } : null ).filter((x) => x?.yField); } const xField = fields[0]; if (isBubbleChart) { return fields.map( (yField, i) => i % 2 === 1 ? { xField, yField, sizeField: fields[i + 1] } : null ).filter((x) => x?.sizeField); } return fields.filter((value, i) => i > 0).map((yField) => ({ xField, yField })); } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/combo/comboChartProxy.ts var ComboChartProxy = class extends CartesianChartProxy { getAxes(params) { const fields = params ? params.fields : []; const fieldsMap = new Map(fields.map((f) => [f.colId, f])); const { primaryYKeys, secondaryYKeys } = this.getYKeys(fields, params.seriesChartTypes); const axes = { x: { type: this.getXAxisType(params), position: "bottom" } }; if (primaryYKeys.length > 0) { axes.y = { type: "number", position: "left" }; } if (secondaryYKeys.length > 0) { secondaryYKeys.forEach((secondaryYKey) => { const field = fieldsMap.get(secondaryYKey); const secondaryAxisIsVisible = field && field.colId === secondaryYKey; if (!secondaryAxisIsVisible) { return; } const secondaryAxisOptions = { type: "number", position: "right" }; axes[`y_${secondaryYKey}`] = secondaryAxisOptions; }); } return axes; } getSeries(params) { const { fields, seriesChartTypes } = params; const [category] = params.categories; return fields.map((field) => { const seriesChartType = seriesChartTypes.find((s2) => s2.colId === field.colId); if (seriesChartType) { const chartType = seriesChartType.chartType; const grouped = ["groupedColumn", "groupedBar"].includes(chartType); const groupedOpts = grouped ? { grouped: true } : {}; const yKeyAxis = seriesChartType.secondaryAxis ? `y_${field.colId}` : "y"; return { type: getSeriesType(chartType), xKey: category.id, yKey: field.colId, yName: field.displayName, yKeyAxis, stacked: ["stackedArea", "stackedColumn"].includes(chartType), ...groupedOpts }; } }); } getYKeys(fields, seriesChartTypes) { const primaryYKeys = []; const secondaryYKeys = []; for (const field of fields) { const colId = field.colId; const seriesChartType = seriesChartTypes.find((s2) => s2.colId === colId); if (seriesChartType) { if (seriesChartType.secondaryAxis) { secondaryYKeys.push(colId); } else { primaryYKeys.push(colId); } } } return { primaryYKeys, secondaryYKeys }; } setSeriesChartThemeDefaults(overrides) { const seriesOverrides = this.getSeriesChartThemeDefaults(); if (!seriesOverrides) { return; } const chartTypes = /* @__PURE__ */ new Set(); for (const seriesChartType of this.chartProxyParams.seriesChartTypes) { chartTypes.add(seriesChartType.chartType); } for (const chartType of chartTypes) { overrides[getSeriesType(chartType)] = seriesOverrides; } } }; // packages/ag-grid-enterprise/src/charts/chartComp/chartProxies/pie/pieChartProxy.ts function calculateOffsets(offset) { const outerRadiusOffset = offset.currentOffset; offset.currentOffset -= offset.offsetAmount; const innerRadiusOffset = offset.currentOffset; offset.currentOffset -= offset.offsetAmount; return { outerRadiusOffset, innerRadiusOffset }; } var PieChartProxy = class extends ChartProxy { getUpdateOptions(params, commonChartOptions) { return { ...commonChartOptions, data: this.crossFiltering ? this.getCrossFilterData(params) : params.data, series: this.getSeries(params) }; } getSeries(params) { const [category] = params.categories; const numFields = params.fields.length; const offset = { currentOffset: 0, offsetAmount: numFields > 1 ? 20 : 40 }; const series = this.getFields(params).map( (f) => { const options = { type: this.standaloneChartType, angleKey: f.colId, angleName: f.displayName, sectorLabelKey: f.colId, calloutLabelName: category.name, calloutLabelKey: category.id }; if (this.chartType === "donut" || this.chartType === "doughnut") { const { outerRadiusOffset, innerRadiusOffset } = calculateOffsets(offset); const title = f.displayName ? { title: { text: f.displayName, showInLegend: numFields > 1 } } : void 0; return { ...options, type: "donut", outerRadiusOffset, innerRadiusOffset, ...title }; } return options; } ); return this.crossFiltering ? this.extractCrossFilterSeries(series) : series; } getCrossFilterData(params) { const colId = params.fields[0].colId; const filteredOutColId = `${colId}-filtered-out`; return params.data.map((d) => { const total = d[colId] + d[filteredOutColId]; d[`${colId}-total`] = total; d[filteredOutColId] = 1; d[colId] = d[colId] / total; return d; }); } extractCrossFilterSeries(series) { const primarySeries = series[0]; const angleKey = primarySeries.angleKey; const commonOptions = { ...primarySeries, radiusMin: 0, radiusMax: 1, listeners: { seriesNodeClick: this.crossFilterCallback }, legendItemKey: primarySeries.calloutLabelKey, angleKey: `${angleKey}-total` }; const primaryOptions = { ...commonOptions, radiusKey: angleKey, sectorLabelKey: `${angleKey}-total` }; const filteredOutOptions = { ...commonOptions, radiusKey: `${angleKey}-filtered-out`, showInLegend: false }; return [filteredOutOptions, primaryOptions]; } getFields(params) { return this.chartType === "pie" ? params.fields.slice(0, 1) : params.fields; } getSeriesChartThemeDefaults() { return { series: { highlight: getSeriesHighlight(this.crossFiltering) } }; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/chartToolbar.ts var ChartToolbar = class extends Component { constructor() { super( /* html */ `
` ); this.eMenu = RefPlaceholder; this.buttonListenersDestroyFuncs = []; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } updateParams(params) { const { buttons } = params; this.createButtons(buttons); } createButtons(buttons) { for (const func of this.buttonListenersDestroyFuncs) { func?.(); } this.buttonListenersDestroyFuncs = []; const menuEl = this.eMenu; _clearElement(menuEl); for (const buttonConfig of buttons) { const { buttonName, iconName, callback } = buttonConfig; const buttonEl = this.createButton(iconName); const tooltipTitle = this.chartTranslation.translate( buttonName + "ToolbarTooltip" ); if (tooltipTitle && buttonEl instanceof HTMLElement) { buttonEl.title = tooltipTitle; } this.buttonListenersDestroyFuncs.push( ...this.addManagedElementListeners(buttonEl, { click: (event) => callback(event.currentTarget) }) ); menuEl.appendChild(buttonEl); } } createButton(iconName) { const buttonEl = _createIconNoSpan(iconName, this.beans); buttonEl.classList.add("ag-chart-menu-icon"); const wrapperEl = _createElement({ tag: "button", attrs: { type: "button" }, cls: "ag-chart-menu-toolbar-button" }); wrapperEl.appendChild(buttonEl); return wrapperEl; } destroy() { this.buttonListenersDestroyFuncs = []; super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/widgets/agPillSelect.css var agPillSelect_default = ".ag-pill-select{display:flex;flex-direction:column}.ag-pill-select .ag-column-drop-list{padding:0}:where(.ag-pill-select){.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}"; // packages/ag-grid-enterprise/src/charts/widgets/agPillSelect.ts var AgPillSelect = class extends Component { constructor(config) { super( /* html */ `` ); this.config = config ?? {}; const { selectedValueList, valueFormatter, valueList } = this.config; this.selectedValues = selectedValueList ?? []; this.valueList = valueList ?? []; this.valueFormatter = valueFormatter ?? ((value) => _escapeString(value)); this.registerCSS(agPillSelect_default); } postConstruct() { const { ariaLabel, onValuesChange, dragSourceId } = this.config; this.dropZonePanel = this.createManagedBean( new PillSelectDropZonePanel( { getValues: () => this.selectedValues, setValues: (values) => this.updateValues(values), isDraggable: () => this.selectedValues.length > 1 }, (value) => this.valueFormatter(value), ariaLabel, dragSourceId ) ); const eGui = this.getGui(); eGui.appendChild(this.dropZonePanel.getGui()); this.initSelect(); if (onValuesChange != null) { this.onValuesChange = onValuesChange; } } setValues(valueList, selectedValues) { const { added, removed, updated } = this.getChanges(this.valueList, valueList); let refreshSelect = false; if (added.length || removed.length || updated.length) { refreshSelect = true; } this.valueList = valueList; this.updateValues(selectedValues, refreshSelect, true); return this; } setValueFormatter(valueFormatter) { this.valueFormatter = valueFormatter; return this; } initSelect() { const options = this.createSelectOptions(); if (!options.length) { return false; } const { selectPlaceholder: placeholder } = this.config; this.eSelect = this.createBean( new AgSelect({ options, placeholder, onValueChange: (value) => this.addValue(value), pickerIcon: "chartsMenuAdd" }) ); this.getGui().appendChild(this.eSelect.getGui()); return true; } createSelectOptions() { const options = []; const { maxSelection } = this.config; if (maxSelection && this.selectedValues.length >= maxSelection) { return options; } for (const value of this.valueList) { if (!this.selectedValues.includes(value)) { options.push({ value, text: this.valueFormatter(value) }); } } return options; } addValue(value) { this.dropZonePanel.addItem(value); } updateValues(values, forceRefreshSelect, silent) { const previousSelectedValues = this.selectedValues; this.selectedValues = values; const changes = this.getChanges(previousSelectedValues, values); const refreshSelect = forceRefreshSelect || changes.added.length || changes.removed.length; const activeElement = _getActiveDomElement(this.beans); const selectHasFocus = this.eSelect?.getGui().contains(activeElement); const dropZoneHasFocus = this.dropZonePanel?.getGui().contains(activeElement); if (!silent) { this.onValuesChange?.(changes); } const emptyRefreshedSelect = refreshSelect ? !this.refreshSelect() : false; this.dropZonePanel.refreshGui(); if (refreshSelect && selectHasFocus) { if (emptyRefreshedSelect) { this.dropZonePanel.focusList(true); } else { this.eSelect?.getFocusableElement().focus(); } } if (dropZoneHasFocus && !values.length) { this.eSelect?.getFocusableElement().focus(); } } getChanges(previousSelectedValues, newSelectedValues) { const added = newSelectedValues.filter((value) => !previousSelectedValues.includes(value)); const removed = previousSelectedValues.filter((value) => !newSelectedValues.includes(value)); const updated = newSelectedValues.filter((value, index) => previousSelectedValues[index] !== value); return { added, removed, updated, selected: newSelectedValues }; } refreshSelect() { if (!this.eSelect) { return this.initSelect(); } const options = this.createSelectOptions(); if (!options.length) { _removeFromParent(this.eSelect.getGui()); this.eSelect = this.destroyBean(this.eSelect); return false; } this.eSelect.clearOptions().addOptions(options).setValue(void 0, true); return true; } destroy() { this.destroyBean(this.eSelect); super.destroy(); } }; var PillSelectDragComp = class extends PillDragComp { constructor(value, dragSourceDropTarget, ghost, valueFormatter, draggable, sourceId) { super(dragSourceDropTarget, ghost, false); this.value = value; this.valueFormatter = valueFormatter; this.draggable = draggable; this.sourceId = sourceId; } getItem() { return this.value; } getDisplayName() { return this.valueFormatter(this.value); } getAriaDisplayName() { return this.getDisplayName(); } getTooltip() { return void 0; } createGetDragItem() { return () => ({ value: this.value }); } getDragSourceType() { return DragSourceType.ChartPanel; } getDragSourceId() { return this.sourceId; } isMovable() { return this.isDraggable(); } isDraggable() { return this.draggable; } }; var PillSelectDropZonePanel = class extends PillDropZonePanel { constructor(model, valueFormatter, ariaLabel, sourceId) { super(false); this.model = model; this.valueFormatter = valueFormatter; this.ariaLabel = ariaLabel; this.sourceId = sourceId; } postConstruct() { super.init(); } isItemDroppable(item, draggingEvent) { return this.isSourceEventFromTarget(draggingEvent) || this.sourceId != null && this.sourceId === draggingEvent.dragSource.sourceId; } updateItems(items) { this.model.setValues(items); } getExistingItems() { return this.model.getValues(); } getIconName() { return this.isPotentialDndItems() ? "move" : "notAllowed"; } getAriaLabel() { return this.ariaLabel; } createPillComponent(item, dropTarget, ghost) { return new PillSelectDragComp( item, dropTarget, ghost, this.valueFormatter, this.model.isDraggable(), this.sourceId ); } getItems(dragItem) { return [dragItem.value]; } isInterestedIn(type) { return type === DragSourceType.ChartPanel; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/dragDataPanel.ts var DragDataPanel = class extends Component { constructor(chartController, allowMultipleSelection, maxSelection, template) { super(template); this.chartController = chartController; this.allowMultipleSelection = allowMultipleSelection; this.maxSelection = maxSelection; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } addItem(eItem) { this.groupComp.addItem(eItem); } createGroup(columns, valueFormatter, selectLabelKey, dragSourceId, skipAnimation) { if (this.allowMultipleSelection) { const selectedValueList = columns.filter((col) => col.selected); this.valuePillSelect = this.groupComp.createManagedBean( new AgPillSelect({ valueList: columns, selectedValueList, valueFormatter, selectPlaceholder: this.chartTranslation.translate(selectLabelKey), dragSourceId, onValuesChange: (params) => this.onValueChange(params), maxSelection: this.maxSelection }) ); this.groupComp.addItem(this.valuePillSelect); } else { const params = this.createValueSelectParams(columns); params.onValueChange = (updatedColState) => { for (const col of columns) { col.selected = false; } updatedColState.selected = true; if (updatedColState.colId === DEFAULT_CHART_CATEGORY) { this.chartController.setAggFunc(void 0, true); } this.chartController.updateForPanelChange({ updatedColState, skipAnimation: skipAnimation?.() }); }; this.valueSelect = this.groupComp.createManagedBean(new AgSelect(params)); this.groupComp.addItem(this.valueSelect); } } refreshValueSelect(columns) { if (!this.valueSelect) { return; } const { options, value } = this.createValueSelectParams(columns); this.valueSelect.clearOptions().addOptions(options).setValue(value, true); } createValueSelectParams(columns) { let selectedValue; const options = columns.map((value) => { const text = value.displayName ?? ""; if (value.selected) { selectedValue = value; } return { value, text }; }); return { options, value: selectedValue }; } onValueChange({ added, updated, removed, selected }) { let updatedColState; let resetOrder; const updateOrder = () => { selected.forEach((col, index) => { col.order = index; }); resetOrder = true; }; if (added.length) { updatedColState = added[0]; updatedColState.selected = true; updateOrder(); } else if (removed.length) { updatedColState = removed[0]; updatedColState.selected = false; } else if (updated.length) { updateOrder(); updatedColState = updated[0]; } if (updatedColState) { this.chartController.updateForPanelChange({ updatedColState, resetOrder }); } } destroy() { this.valuePillSelect = void 0; this.valueSelect = void 0; super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/categoriesDataPanel.ts var DEFAULT_AGG_FUNC = "sum"; var CategoriesDataPanel = class extends DragDataPanel { constructor(chartController, title, allowMultipleSelection, dimensionCols, isOpen) { const maxSelection = void 0; super( chartController, allowMultipleSelection, maxSelection, /* html */ `
` ); this.title = title; this.dimensionCols = dimensionCols; this.isOpen = isOpen; } postConstruct() { this.groupComp = this.createBean( new AgGroupComponent({ title: this.title, enabled: true, suppressEnabledCheckbox: true, suppressOpenCloseIcons: false, cssIdentifier: "charts-data", expanded: this.isOpen }) ); this.createGroup( this.dimensionCols, (col) => col.displayName ?? "", "categoryAdd", "categorySelect", () => !this.chartController.getAggFunc() ); this.createAggFuncControls(this.dimensionCols); this.getGui().appendChild(this.groupComp.getGui()); } refresh(dimensionCols) { this.valuePillSelect?.setValues( dimensionCols, dimensionCols.filter((col) => col.selected) ); this.refreshValueSelect(dimensionCols); this.refreshAggFuncControls(dimensionCols, this.chartController.getAggFunc()); } createAggFuncControls(dimensionCols) { const aggFunc = this.chartController.getAggFunc(); this.groupComp.addItem( this.aggFuncToggle = this.createBean( new AgToggleButton({ label: this.chartTranslation.translate("aggregate"), labelAlignment: "left", labelWidth: "flex", inputWidth: "flex", value: aggFunc != void 0, onValueChange: (value) => { const aggFunc2 = value ? DEFAULT_AGG_FUNC : void 0; this.chartController.setAggFunc(aggFunc2); this.aggFuncSelect?.setValue(aggFunc2, true); this.aggFuncSelect?.setDisplayed(aggFunc2 != void 0); } }) ) ); this.groupComp.addItem( this.aggFuncSelect = this.createBean( new AgSelect({ options: [ { value: "sum", text: this.chartTranslation.translate("sum") }, { value: "first", text: this.chartTranslation.translate("first") }, { value: "last", text: this.chartTranslation.translate("last") }, { value: "min", text: this.chartTranslation.translate("min") }, { value: "max", text: this.chartTranslation.translate("max") }, { value: "count", text: this.chartTranslation.translate("count") }, { value: "avg", text: this.chartTranslation.translate("avg") } ], value: typeof aggFunc === "string" ? aggFunc : void 0, onValueChange: (value) => { this.chartController.setAggFunc(value); } }) ) ); this.refreshAggFuncControls(dimensionCols, aggFunc); } refreshAggFuncControls(dimensionCols, aggFunc) { const selectedDimensions = dimensionCols.filter((col) => col.selected); const supportsAggregation = selectedDimensions.some((col) => col.colId !== DEFAULT_CHART_CATEGORY); this.aggFuncToggle?.setValue(aggFunc != void 0); this.aggFuncSelect?.setValue(typeof aggFunc === "string" ? aggFunc : void 0, true); this.aggFuncToggle?.setDisplayed(supportsAggregation); this.aggFuncSelect?.setDisplayed(supportsAggregation && aggFunc != void 0); } clearAggFuncControls() { this.aggFuncToggle = this.destroyBean(this.aggFuncToggle); this.aggFuncSelect = this.destroyBean(this.aggFuncSelect); } destroy() { this.clearAggFuncControls(); this.groupComp = this.destroyBean(this.groupComp); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/chartMenuParamsFactory.ts var ChartMenuParamsFactory = class extends BeanStub { constructor(chartOptionsProxy) { super(); this.chartOptionsProxy = chartOptionsProxy; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } getDefaultColorPickerParams(expression, labelKey, options) { return this.addValueParams( expression, { label: this.chartTranslation.translate(labelKey ?? "color"), labelWidth: "flex", inputWidth: "flex", labelAlignment: "top", pickerGap: 6 }, options ); } getDefaultNumberInputParams(expression, labelKey, options) { return this.addValueParams( expression, { label: this.chartTranslation.translate(labelKey), labelAlignment: "top", labelWidth: "flex", inputWidth: "flex", precision: options?.precision, step: options?.step, min: options?.min, max: options?.max }, { parseInputValue: (value) => { const numberValue = Number(value); return isNaN(numberValue) ? void 0 : numberValue; }, formatInputValue: (value) => { return value == null ? "" : `${value}`; } } ); } getDefaultSliderParams(expression, labelKey, defaultMaxValue, isArray) { let value = this.chartOptionsProxy.getValue(expression) ?? 0; if (isArray && Array.isArray(value)) { value = value[0]; } const params = this.getDefaultSliderParamsWithoutValueParams(value, labelKey, defaultMaxValue); params.onValueChange = (value2) => this.chartOptionsProxy.setValue(expression, isArray ? [value2] : value2); return params; } getDefaultSliderParamsWithoutValueParams(value, labelKey, defaultMaxValue) { return { label: this.chartTranslation.translate(labelKey), minValue: 0, maxValue: Math.max(value, defaultMaxValue), textFieldWidth: 45, value: `${value}` }; } getDefaultCheckboxParams(expression, labelKey, options) { const value = this.chartOptionsProxy.getValue(expression); const params = { label: this.chartTranslation.translate(labelKey), value, readOnly: options?.readOnly, passive: options?.passive }; params.onValueChange = (value2) => { this.chartOptionsProxy.setValue(expression, typeof value2 === "boolean" ? value2 : void 0); }; return params; } getDefaultToggleParams(expression, labelKey, options) { const value = this.chartOptionsProxy.getValue(expression); const params = { label: this.chartTranslation.translate(labelKey), labelAlignment: "left", labelWidth: "flex", inputWidth: "flex", value, readOnly: options?.readOnly, passive: options?.passive }; params.onValueChange = (value2) => { this.chartOptionsProxy.setValue(expression, typeof value2 === "boolean" ? value2 : void 0); }; return params; } getDefaultSelectParams(expression, labelKey, dropdownOptions) { return this.getDefaultSelectParamsWithoutValueParams( labelKey, dropdownOptions, this.chartOptionsProxy.getValue(expression), (value) => { this.chartOptionsProxy.setValue(expression, value); } ); } getDefaultSelectParamsWithoutValueParams(labelKey, options, value, onValueChange) { return { label: this.chartTranslation.translate(labelKey), labelAlignment: "top", options, pickerGap: 6, value, onValueChange }; } getDefaultFontPanelParams(expression, labelKey) { const keyMapper = (key) => `${expression}.${key}`; return this.addEnableParams(keyMapper("enabled"), { name: this.chartTranslation.translate(labelKey), suppressEnabledCheckbox: false, chartMenuParamsFactory: this, keyMapper }); } addValueParams(expression, params, options) { const optionsValue = this.chartOptionsProxy.getValue(expression); params.value = options?.formatInputValue ? options.formatInputValue(optionsValue) : optionsValue; params.onValueChange = (value) => { const optionsValue2 = options?.parseInputValue ? options.parseInputValue(value) : value; this.chartOptionsProxy.setValue(expression, optionsValue2); }; return params; } addEnableParams(expression, params) { params.enabled = this.chartOptionsProxy.getValue(expression) ?? false; params.onEnableChange = (value) => this.chartOptionsProxy.setValue(expression, value); return params; } getChartOptions() { return this.chartOptionsProxy; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/chartSpecificDataPanel.ts var ChartSpecificDataPanel = class extends Component { constructor(chartMenuContext, isOpen) { super(); this.chartMenuContext = chartMenuContext; this.isOpen = isOpen; this.chartSpecificGroup = RefPlaceholder; this.hasContent = false; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; this.chartSvc = beans.chartSvc; } postConstruct() { const title = this.getTitle(); const chartSpecificGroupParams = { title, enabled: true, suppressEnabledCheckbox: true, suppressOpenCloseIcons: false, cssIdentifier: "charts-data", expanded: this.isOpen, items: [...this.createDirectionSelect(), this.createReverseSelect(), this.createGroupTypeSelect()] }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { chartSpecificGroup: chartSpecificGroupParams } ); this.setDisplayed(this.hasContent); } refresh() { this.hasContent = false; this.chartSpecificGroup.setTitle(this.getTitle()); this.updateDirectionSelect(); this.updateReverseSelect(); this.updateGroupTypeSelect(); this.setDisplayed(this.hasContent); } getTitle() { const chartType = this.chartMenuContext.chartController.getChartType(); return this.chartTranslation.translate(getFullChartNameTranslationKey(chartType)); } createDirectionSelect() { if (!this.chartSvc.isEnterprise()) { return []; } const { chartOptionsService, chartController } = this.chartMenuContext; const chartOptionsSeriesProxy = chartOptionsService.getSeriesOptionsProxy( () => getSeriesType(chartController.getChartType()) ); const chartSeriesMenuParamsFactory = this.createManagedBean( new ChartMenuParamsFactory(chartOptionsSeriesProxy) ); const options = ["horizontal", "vertical"].map((value) => ({ value, text: this.chartTranslation.translate(value) })); const params = chartSeriesMenuParamsFactory.getDefaultSelectParams("direction", "direction", options); const onValueChange = params.onValueChange; params.onValueChange = (value) => { onValueChange(value); chartController.raiseChartModelUpdateEvent(); }; this.directionSelect = this.createManagedBean(new AgSelect(params)); this.updateDirectionSelect(); return [this.directionSelect]; } createReverseSelect() { const { chartMenuParamsFactory } = this.chartMenuContext; const params = chartMenuParamsFactory.getDefaultToggleParams("series.reverse", "reverse"); this.reverseToggle = this.createManagedBean(new AgToggleButton(params)); this.updateReverseSelect(); return this.reverseToggle; } updateReverseSelect() { const isDisplayed = this.chartMenuContext.chartController.getChartType() === "pyramid"; this.updateDisplayed(this.reverseToggle, isDisplayed); } updateDirectionSelect() { const isDisplayed = canSwitchDirection(this.chartMenuContext.chartController.getChartType()); this.updateDisplayed(this.directionSelect, isDisplayed); } createGroupTypeSelect() { const { chartController, chartMenuParamsFactory } = this.chartMenuContext; this.groupTypeSelect = this.createManagedBean( new AgSelect( chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams( "seriesGroupType", SERIES_GROUP_TYPES.map((value) => ({ value, text: this.chartTranslation.translate(`${value}SeriesGroupType`) })), chartController.getSeriesGroupType(), (value) => chartController.setSeriesGroupType(value) ) ) ); this.updateGroupTypeSelect(); return this.groupTypeSelect; } updateGroupTypeSelect() { const isDisplayed = ["radialColumn", "radialBar", "nightingale"].includes( this.chartMenuContext.chartController.getChartType() ); this.updateDisplayed(this.groupTypeSelect, isDisplayed); } updateDisplayed(select, isDisplayed) { select?.setDisplayed(isDisplayed); if (select) { this.hasContent = this.hasContent || isDisplayed; } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/seriesChartTypePanel.ts var SeriesChartTypePanel = class extends Component { constructor(chartController, columns, isOpen) { super( /* html */ `
` ); this.chartController = chartController; this.columns = columns; this.isOpen = isOpen; this.selectedColIds = []; this.chartTypeComps = /* @__PURE__ */ new Map(); this.secondaryAxisComps = /* @__PURE__ */ new Map(); } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { this.createSeriesChartTypeGroup(this.columns); } refresh(columns) { if (!_areEqual(this.getValidColIds(columns), this.selectedColIds)) { this.recreate(columns); } else { this.refreshComps(); } } recreate(columns) { this.isOpen = this.seriesChartTypeGroupComp.isExpanded(); _clearElement(this.getGui()); this.destroyBean(this.seriesChartTypeGroupComp); this.columns = columns; this.selectedColIds = []; this.clearComps(); this.postConstruct(); } getValidColIds(columns) { const seriesChartTypes = this.chartController.getSeriesChartTypes(); return columns.filter((col) => col.selected && !!seriesChartTypes.filter((s2) => s2.colId === col.colId)[0]).map(({ colId }) => colId); } createSeriesChartTypeGroup(columns) { this.seriesChartTypeGroupComp = this.createBean( new AgGroupComponent({ title: this.chartTranslation.translate("seriesChartType"), enabled: true, suppressEnabledCheckbox: true, suppressOpenCloseIcons: false, cssIdentifier: "charts-data", expanded: this.isOpen }) ); const seriesChartTypes = this.chartController.getSeriesChartTypes(); for (const col of columns) { if (!col.selected) { continue; } const seriesChartType = seriesChartTypes.filter((s2) => s2.colId === col.colId)[0]; if (!seriesChartType) { continue; } this.selectedColIds.push(col.colId); const seriesItemGroup = this.seriesChartTypeGroupComp.createManagedBean( new AgGroupComponent({ title: col.displayName, enabled: true, suppressEnabledCheckbox: true, suppressOpenCloseIcons: true, cssIdentifier: "charts-format-sub-level" }) ); const isSecondaryAxisDisabled = (chartType) => ["groupedColumn", "stackedColumn", "stackedArea"].includes(chartType); const secondaryAxisComp = this.seriesChartTypeGroupComp.createManagedBean( new AgCheckbox({ label: this.chartTranslation.translate("secondaryAxis"), labelWidth: "flex", disabled: isSecondaryAxisDisabled(seriesChartType.chartType), value: !!seriesChartType.secondaryAxis, onValueChange: (enabled) => this.chartController.updateSeriesChartType(col.colId, void 0, enabled) }) ); seriesItemGroup.addItem(secondaryAxisComp); const options = ["line", "area", "stackedArea", "groupedColumn", "stackedColumn"].map( (value) => ({ value, text: this.chartTranslation.translate(getFullChartNameTranslationKey(value)) }) ); const chartTypeComp = seriesItemGroup.createManagedBean( new AgSelect({ options, value: seriesChartType.chartType, onValueChange: (chartType) => this.chartController.updateSeriesChartType(col.colId, chartType) }) ); seriesItemGroup.addItem(chartTypeComp); this.seriesChartTypeGroupComp.addItem(seriesItemGroup); this.chartTypeComps.set(col.colId, chartTypeComp); this.secondaryAxisComps.set(col.colId, secondaryAxisComp); } this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui()); } refreshComps() { const seriesChartTypes = this.chartController.getSeriesChartTypes(); for (const colId of this.selectedColIds) { const seriesChartType = seriesChartTypes.find((chartType) => chartType.colId === colId); if (!seriesChartType) { continue; } const chartTypeComp = this.chartTypeComps.get(colId); const secondaryAxisComp = this.secondaryAxisComps.get(colId); chartTypeComp?.setValue(seriesChartType.chartType); secondaryAxisComp?.setValue(!!seriesChartType.secondaryAxis); secondaryAxisComp?.setDisabled(this.isSecondaryAxisDisabled(seriesChartType.chartType)); } } clearComps() { this.chartTypeComps.clear(); this.secondaryAxisComps.clear(); } isSecondaryAxisDisabled(chartType) { return ["groupedColumn", "stackedColumn", "stackedArea"].includes(chartType); } destroy() { this.clearComps(); this.seriesChartTypeGroupComp = this.destroyBean(this.seriesChartTypeGroupComp); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/seriesDataPanel.ts var SeriesDataPanel = class extends DragDataPanel { constructor(chartController, chartOptionsService, title, allowMultipleSelect, maxSelection, valueCols, isOpen) { super( chartController, allowMultipleSelect, maxSelection, /* html */ `
` ); this.chartOptionsService = chartOptionsService; this.title = title; this.valueCols = valueCols; this.isOpen = isOpen; } postConstruct() { this.groupComp = this.createBean( new AgGroupComponent({ title: this.title, enabled: true, suppressEnabledCheckbox: true, suppressOpenCloseIcons: false, cssIdentifier: "charts-data", expanded: this.isOpen }) ); if (this.chartController.isActiveXYChart()) { const pairedModeToggle = this.groupComp.createManagedBean( new AgToggleButton({ label: this.chartTranslation.translate("paired"), labelAlignment: "left", labelWidth: "flex", inputWidth: "flex", value: this.chartOptionsService.getPairedMode(), onValueChange: (newValue) => { this.chartOptionsService.setPairedMode(!!newValue); this.chartController.updateForGridChange({ maintainColState: true }); } }) ); this.groupComp.addItem(pairedModeToggle); } this.createGroup(this.valueCols, this.generateGetSeriesLabel(this.valueCols), "seriesAdd", "seriesSelect"); this.getGui().appendChild(this.groupComp.getGui()); } refresh(valueCols) { this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(valueCols)); this.valuePillSelect?.setValues( valueCols, valueCols.filter((col) => col.selected) ); this.refreshValueSelect(valueCols); } generateGetSeriesLabel(valueCols) { if (!this.chartController.isActiveXYChart()) { return (col) => col.displayName ?? ""; } const selectedCols = valueCols.filter((col) => col.selected); const isBubble = this.chartController.getChartType() === "bubble"; const isInPairedMode = this.chartOptionsService.getPairedMode(); const indexToAxisLabel = /* @__PURE__ */ new Map(); indexToAxisLabel.set(0, "X"); indexToAxisLabel.set(1, "Y"); indexToAxisLabel.set(2, "size"); return (col) => { const escapedLabel = col.displayName ?? ""; if (!col.selected) { return escapedLabel; } const index = selectedCols.indexOf(col); if (index === -1) { return escapedLabel; } let axisLabel; if (isInPairedMode) { axisLabel = indexToAxisLabel.get(index % (isBubble ? 3 : 2)); } else if (index === 0) { axisLabel = "X"; } else { axisLabel = isBubble && index % 2 === 0 ? "size" : "Y"; } return `${escapedLabel} (${axisLabel})`; }; } destroy() { this.groupComp = this.destroyBean(this.groupComp); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/data/chartDataPanel.ts var DefaultDataPanelDef = { groups: [ { type: "categories", isOpen: true }, { type: "series", isOpen: true }, { type: "seriesChartType", isOpen: true }, { type: "chartSpecific", isOpen: true } ] }; var ChartDataPanel = class extends Component { constructor(chartMenuContext) { super( /* html */ `
` ); this.chartMenuContext = chartMenuContext; this.isSwitchCategorySeriesToggled = false; this.restoreSwitchCategorySeriesToggleFocus = false; this.panels = []; this.chartController = chartMenuContext.chartController; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; this.chartSvc = beans.chartSvc; } postConstruct() { this.createSwitchCategorySeriesToggle(); this.isSwitchCategorySeriesToggled = this.chartController.isCategorySeriesSwitched(); this.updatePanels(); const listener = this.updatePanels.bind(this); this.addManagedListeners(this.chartController, { chartModelUpdate: listener, chartApiUpdate: listener }); } destroy() { this.clearPanelComponents(); super.destroy(); } updatePanels() { const currentChartType = this.chartType; const isSwitchCategorySeriesToggledCurrent = this.isSwitchCategorySeriesToggled; const { dimensionCols, valueCols } = this.chartController.getColStateForMenu(); this.chartType = this.chartController.getChartType(); this.isSwitchCategorySeriesToggled = this.chartController.isCategorySeriesSwitched(); const hasChangedSwitchCategorySeries = this.isSwitchCategorySeriesToggled !== isSwitchCategorySeriesToggledCurrent; if (this.canRefresh(currentChartType, this.chartType) && !hasChangedSwitchCategorySeries) { this.categoriesDataPanel?.refresh(dimensionCols); this.seriesDataPanel?.refresh(valueCols); this.seriesChartTypePanel?.refresh(valueCols); this.chartSpecificPanel?.refresh(); } else { this.recreatePanels(dimensionCols, valueCols); } const isSwitchCategorySeriesDisplayed = supportsInvertedCategorySeries(this.chartType) && this.chartSvc.isEnterprise() && !this.chartController.isGrouping(); _setDisplayed(this.switchCategorySeriesToggle.getGui(), isSwitchCategorySeriesDisplayed); if (hasChangedSwitchCategorySeries) { this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched()); } if (this.restoreSwitchCategorySeriesToggleFocus) { this.restoreSwitchCategorySeriesToggleFocus = false; if (isSwitchCategorySeriesDisplayed) { this.switchCategorySeriesToggle.getFocusableElement().focus(); } } } canRefresh(oldChartType, newChartType) { if (oldChartType === void 0) { return false; } if (oldChartType === newChartType) { return true; } const isCombo = (chartType) => ["columnLineCombo", "areaColumnCombo", "customCombo"].includes(chartType); if (isCombo(oldChartType) && isCombo(newChartType)) { return true; } return false; } recreatePanels(dimensionCols, valueCols) { this.clearPanelComponents(); const { chartType } = this; if (!chartType) { return; } const isCategorySeriesSwitched = this.chartController.isCategorySeriesSwitched(); this.getDataPanelDef().groups?.forEach(({ type, isOpen }) => { if (type === (isCategorySeriesSwitched ? "series" : "categories")) { this.categoriesDataPanel = this.createBean( new CategoriesDataPanel( this.chartController, this.getCategoryGroupTitle(isCategorySeriesSwitched), this.getCategoryGroupMultipleSelect(chartType, isCategorySeriesSwitched), dimensionCols, isOpen ) ); this.panels.push(this.categoriesDataPanel); } else if (type === (isCategorySeriesSwitched ? "categories" : "series")) { this.seriesDataPanel = this.createBean( new SeriesDataPanel( this.chartController, this.chartMenuContext.chartOptionsService, this.getSeriesGroupTitle(isCategorySeriesSwitched), this.getSeriesGroupMultipleSelect(chartType, isCategorySeriesSwitched), this.getSeriesGroupMaxSelection(chartType, isCategorySeriesSwitched), valueCols, isOpen ) ); this.panels.push(this.seriesDataPanel); } else if (type === "seriesChartType") { if (this.chartController.isComboChart()) { this.seriesChartTypePanel = this.createBean( new SeriesChartTypePanel(this.chartController, valueCols, isOpen) ); this.panels.push(this.seriesChartTypePanel); } } else if (type === "chartSpecific") { this.chartSpecificPanel = this.createBean(new ChartSpecificDataPanel(this.chartMenuContext, isOpen)); this.panels.push(this.chartSpecificPanel); } else { _warn(144, { type }); } }); (isCategorySeriesSwitched ? this.categoriesDataPanel : this.seriesDataPanel)?.addItem( this.switchCategorySeriesToggle.getGui() ); this.addPanelComponents(); } addPanelComponents() { if (!this.panels.length) { return; } const eDocument = _getDocument(this.beans); const fragment = eDocument.createDocumentFragment(); for (const panel of this.panels) { panel.addCss("ag-chart-data-section"); fragment.appendChild(panel.getGui()); } this.getGui().appendChild(fragment); } clearPanelComponents() { for (const panel of this.panels) { panel.getGui().remove(); this.destroyBean(panel); } this.panels = []; } getDataPanelDef() { return this.gos.get("chartToolPanelsDef")?.dataPanel ?? DefaultDataPanelDef; } getCategoryGroupTitle(isCategorySeriesSwitched) { if (isCategorySeriesSwitched) { return this.chartTranslation.translate("seriesLabels"); } return this.chartTranslation.translate(this.chartController.isActiveXYChart() ? "labels" : "categories"); } getCategoryGroupMultipleSelect(chartType, isCategorySeriesSwitched) { if (isCategorySeriesSwitched) { return false; } return getMaxNumCategories(chartType) !== 1; } getSeriesGroupTitle(isCategorySeriesSwitched) { if (isCategorySeriesSwitched) { return this.chartTranslation.translate("categoryValues"); } return this.chartTranslation.translate(this.chartController.isActiveXYChart() ? "xyValues" : "series"); } getSeriesGroupMultipleSelect(chartType, isCategorySeriesSwitched) { return this.getSeriesGroupMaxSelection(chartType, isCategorySeriesSwitched) !== 1; } getSeriesGroupMaxSelection(chartType, isCategorySeriesSwitched) { if (isCategorySeriesSwitched) { return void 0; } return getMaxNumSeries(chartType); } createSwitchCategorySeriesToggle() { this.switchCategorySeriesToggle = this.createManagedBean( new AgToggleButton({ label: this.chartTranslation.translate("switchCategorySeries"), labelAlignment: "left", labelWidth: "flex", inputWidth: "flex", value: this.chartController.isCategorySeriesSwitched(), onValueChange: (value) => { this.restoreSwitchCategorySeriesToggleFocus = true; this.chartController.switchCategorySeries(value); } }) ); } }; // packages/ag-grid-enterprise/src/charts/widgets/agAngleSelect.ts var AgAngleSelect = class extends AgAbstractLabel { constructor(config) { super( config, /* html */ `
`, [AgInputNumberFieldSelector] ); this.eLabel = RefPlaceholder; this.eParentCircle = RefPlaceholder; this.eChildCircle = RefPlaceholder; this.eAngleValue = RefPlaceholder; this.radius = 0; this.offsetX = 0; this.offsetY = 0; } wireBeans(beans) { this.dragSvc = beans.dragSvc; } postConstruct() { super.postConstruct(); const { value, onValueChange } = this.config; if (value != null) { this.setValue(value, void 0, true); } if (onValueChange != null) { this.onValueChange(onValueChange); } this.dragListener = { eElement: this.eParentCircle, dragStartPixels: 0, onDragStart: () => { this.parentCircleRect = this.eParentCircle.getBoundingClientRect(); }, onDragging: (e) => this.calculateAngleDrag(e), onDragStop: () => { } }; this.dragSvc?.addDragSource(this.dragListener); this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange((value2) => { if (value2 == null || value2 === "") { value2 = "0"; } value2 = this.eAngleValue.normalizeValue(value2); let floatValue = parseFloat(value2); if (floatValue > 180) { floatValue = floatValue - 360; } this.setValue(floatValue); }); this.updateNumberInput(); if (_exists(this.getValue())) { this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()); } this.addManagedListeners(this, { fieldValueChanged: () => { if (this.eAngleValue.getInputElement().contains(_getActiveDomElement(this.beans))) { return; } this.updateNumberInput(); } }); } updateNumberInput() { const normalizedValue = this.normalizeNegativeValue(this.getValue()); this.eAngleValue.setValue(normalizedValue.toString()); } positionChildCircle(radians) { const rect = this.parentCircleRect || { width: 24, height: 24 }; const eChildCircle = this.eChildCircle; const centerX = rect.width / 2; const centerY = rect.height / 2; eChildCircle.style.left = `${centerX + Math.cos(radians) * 8}px`; eChildCircle.style.top = `${centerY + Math.sin(radians) * 8}px`; } calculatePolar() { const x = this.offsetX; const y = this.offsetY; const radians = Math.atan2(y, x); this.degrees = this.toDegrees(radians); this.radius = Math.sqrt(x * x + y * y); this.positionChildCircle(radians); } calculateCartesian() { const radians = this.toRadians(this.getValue()); const radius = this.getRadius(); this.setOffsetX(Math.cos(radians) * radius).setOffsetY(Math.sin(radians) * radius); } setOffsetX(offset) { if (this.offsetX !== offset) { this.offsetX = offset; this.calculatePolar(); } return this; } setOffsetY(offset) { if (this.offsetY !== offset) { this.offsetY = offset; this.calculatePolar(); } return this; } calculateAngleDrag(e) { const rect = this.parentCircleRect; const centerX = rect.width / 2; const centerY = rect.height / 2; const x = e.clientX - rect.left; const y = e.clientY - rect.top; const dx = x - centerX; const dy = y - centerY; const radians = Math.atan2(dy, dx); this.setValue(radians, true); } toDegrees(radians) { return radians / Math.PI * 180; } toRadians(degrees) { return degrees / 180 * Math.PI; } normalizeNegativeValue(degrees) { return degrees < 0 ? 360 + degrees : degrees; } normalizeAngle180(radians) { radians %= Math.PI * 2; if (radians < -Math.PI) { radians += Math.PI * 2; } else if (radians >= Math.PI) { radians -= Math.PI * 2; } return radians; } getRadius() { return this.radius; } setRadius(r) { if (this.radius === r) { return this; } this.radius = r; this.calculateCartesian(); return this; } onValueChange(callbackFn) { this.addManagedListeners(this, { fieldValueChanged: () => { callbackFn(this.degrees); } }); return this; } getValue(radians) { return radians ? this.toRadians(this.degrees) : this.degrees; } setValue(degrees, radians, silent) { let radiansValue; if (!radians) { radiansValue = this.normalizeAngle180(this.toRadians(degrees)); } else { radiansValue = degrees; } degrees = this.toDegrees(radiansValue); if (this.degrees !== degrees) { this.degrees = Math.floor(degrees); this.calculateCartesian(); this.positionChildCircle(radiansValue); if (!silent) { this.dispatchLocalEvent({ type: "fieldValueChanged" }); } } return this; } setWidth(width) { _setFixedWidth(this.getGui(), width); return this; } setDisabled(disabled) { super.setDisabled(disabled); this.eAngleValue.setDisabled(disabled); return this; } destroy() { this.dragSvc?.removeDragSource(this.dragListener); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/fontPanel.ts function _capitalise(str) { return str[0].toUpperCase() + str.substring(1).toLowerCase(); } var FontPanel = class extends Component { constructor(params) { super(); this.params = params; this.fontGroup = RefPlaceholder; this.activeComps = []; this.chartOptions = params.chartMenuParamsFactory.getChartOptions(); } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { cssIdentifier = "charts-format-sub-level", name: title, enabled, onEnableChange, suppressEnabledCheckbox, chartMenuParamsFactory, keyMapper } = this.params; const fontGroupParams = { cssIdentifier, direction: "vertical", suppressOpenCloseIcons: true, title, enabled, suppressEnabledCheckbox: true, onEnableChange: (enabled2) => { if (onEnableChange) { onEnableChange(enabled2); } }, useToggle: !suppressEnabledCheckbox }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSelectSelector, ColorPickerSelector], { fontGroup: fontGroupParams, familySelect: this.getFamilySelectParams(), weightStyleSelect: this.getWeightStyleSelectParams(), sizeSelect: this.getSizeSelectParams(), colorPicker: chartMenuParamsFactory.getDefaultColorPickerParams(keyMapper("color")) } ); this.toggleCss("ag-font-panel-no-header", !title); } addItem(comp, prepend) { if (prepend) { this.fontGroup.prependItem(comp); } else { this.fontGroup.addItem(comp); } this.activeComps.push(comp); } setEnabled(enabled) { this.fontGroup.setEnabled(enabled); } getFamilySelectParams() { const families = [ "Arial, sans-serif", "Aria Black, sans-serif", "Book Antiqua, serif", "Charcoal, sans-serif", "Comic Sans MS, cursive", "Courier, monospace", "Courier New, monospace", "Gadget, sans-serif", "Geneva, sans-serif", "Helvetica, sans-serif", "Impact, sans-serif", "Lucida Console, monospace", "Lucida Grande, sans-serif", "Lucida Sans Unicode, sans-serif", "Monaco, monospace", "Palatino Linotype, serif", "Palatino, serif", "Times New Roman, serif", "Times, serif", "Verdana, sans-serif" ]; const family = this.getInitialFontValue("fontFamily"); let initialValue = families[0]; if (family) { const lowerCaseValues = families.map((f) => f.toLowerCase()); const valueIndex = lowerCaseValues.indexOf(family.toLowerCase()); if (valueIndex >= 0) { initialValue = families[valueIndex]; } else { const capitalisedFontValue = _capitalise(family); families.push(capitalisedFontValue); initialValue = capitalisedFontValue; } } const options = families.sort().map((value) => ({ value, text: value })); return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams( "font", options, `${initialValue}`, (newValue) => this.setFont({ fontFamily: newValue }) ); } getSizeSelectParams() { const sizes = [8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36]; const size = this.getInitialFontValue("fontSize"); if (!sizes.includes(size)) { sizes.push(size); } const options = sizes.sort((a, b) => a - b).map((value) => ({ value: `${value}`, text: `${value}` })); return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams( "size", options, `${size}`, (newValue) => this.setFont({ fontSize: parseInt(newValue, 10) }) ); } getWeightStyleSelectParams() { const weight = this.getInitialFontValue("fontWeight") ?? "normal"; const style = this.getInitialFontValue("fontStyle") ?? "normal"; const weightStyles = [ { name: "normal", weight: "normal", style: "normal" }, { name: "bold", weight: "bold", style: "normal" }, { name: "italic", weight: "normal", style: "italic" }, { name: "boldItalic", weight: "bold", style: "italic" } ]; let selectedOption = weightStyles.find((x) => x.weight === weight && x.style === style); if (!selectedOption) { selectedOption = { name: "predefined", weight, style }; weightStyles.unshift(selectedOption); } const options = weightStyles.map((ws) => ({ value: ws.name, text: this.chartTranslation.translate(ws.name) })); return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams( "weight", options, selectedOption.name, (newValue) => { const selectedWeightStyle = weightStyles.find((x) => x.name === newValue); this.setFont({ fontWeight: selectedWeightStyle.weight, fontStyle: selectedWeightStyle.style }); } ); } destroyActiveComps() { for (const comp of this.activeComps) { _removeFromParent(comp.getGui()); this.destroyBean(comp); } } destroy() { this.destroyActiveComps(); super.destroy(); } setFont(font) { const { keyMapper } = this.params; for (const fontKey of Object.keys(font)) { const value = font[fontKey]; if (value) { this.chartOptions.setValue(keyMapper(fontKey), value); } } } getInitialFontValue(fontKey) { const { keyMapper } = this.params; return this.chartOptions.getValue(keyMapper(fontKey)); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/axis/axisTicksPanel.ts var AxisTicksPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; this.axisTicksSizeSlider = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { chartMenuUtils } = this; const axisTicksGroupParams = chartMenuUtils.addEnableParams("tick.enabled", { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("ticks"), suppressEnabledCheckbox: true, useToggle: true }); const axisTicksColorPickerParams = chartMenuUtils.getDefaultColorPickerParams("tick.stroke"); const axisTicksWidthSliderParams = chartMenuUtils.getDefaultSliderParams("tick.width", "width", 10); const axisTicksSizeSliderParams = chartMenuUtils.getDefaultSliderParams("tick.size", "length", 30); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { axisTicksGroup: axisTicksGroupParams, axisTicksColorPicker: axisTicksColorPickerParams, axisTicksWidthSlider: axisTicksWidthSliderParams, axisTicksSizeSlider: axisTicksSizeSliderParams } ); } setTickSizeSliderDisplayed(displayed) { this.axisTicksSizeSlider.setDisplayed(displayed); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/axis/gridLinePanel.ts var GridLinePanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; this.chartOptions = chartMenuUtils.getChartOptions(); } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const gridLineGroupParams = this.chartMenuUtils.addEnableParams("gridLine.enabled", { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("gridLines"), suppressEnabledCheckbox: true, useToggle: true }); const gridLineColorPickerParams = this.getGridLineColorPickerParams("color"); const gridLineWidthSliderParams = this.getGridLineWidthSliderParams("thickness"); const gridLineLineDashSliderParams = this.getGridLineDashSliderParams("lineDash"); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { gridLineGroup: gridLineGroupParams, gridLineColorPicker: gridLineColorPickerParams, gridLineWidthSlider: gridLineWidthSliderParams, gridLineLineDashSlider: gridLineLineDashSliderParams } ); } getGridLineColorPickerParams(labelKey) { return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style", labelKey, { formatInputValue: (value) => { return value?.[0]?.stroke; }, parseInputValue: (value) => { const styles = this.chartOptions.getValue("gridLine.style") ?? []; if (styles.length === 0) { return [{ stroke: value, lineDash: [] }]; } return [{ ...styles[0], stroke: value }]; } }); } getGridLineWidthSliderParams(labelKey) { return this.chartMenuUtils.getDefaultSliderParams("gridLine.width", labelKey, 10); } getGridLineDashSliderParams(labelKey) { const initialStyles = this.chartOptions.getValue("gridLine.style"); const initialValue = initialStyles?.[0]?.lineDash?.[0]; const params = this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(initialValue ?? 0, labelKey, 30); params.onValueChange = (value) => { const stroke = this.chartOptions.getValue("gridLine.style.0.stroke"); this.chartOptions.setValue("gridLine.style", [ { lineDash: [value], stroke } ]); }; return params; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/axis/cartesianAxisPanel.ts var DEFAULT_TIME_AXIS_FORMAT = "%d %B %Y"; var CartesianAxisPanel = class extends Component { constructor(axisType, options) { super(); this.axisType = axisType; this.options = options; this.axisGroup = RefPlaceholder; this.axisTypeSelect = RefPlaceholder; this.axisPositionSelect = RefPlaceholder; this.axisTimeFormatSelect = RefPlaceholder; this.activePanels = []; this.updateFuncs = []; const { chartOptionsService, seriesType, chartController } = options; this.chartOptionsService = chartOptionsService; this.chartController = chartController; this.chartOptionsSeriesProxy = chartOptionsService.getSeriesOptionsProxy(() => seriesType); } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { isExpandedOnInit: expanded, chartOptionsService, registerGroupComponent } = this.options; const labelKey = this.axisType; const axisGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.translate(labelKey), expanded, suppressEnabledCheckbox: true }; const chartAxisOptionsProxy = chartOptionsService.getCartesianAxisOptionsProxy(this.axisType); const chartAxisOptions = this.createManagedBean(new ChartMenuParamsFactory(chartAxisOptionsProxy)); const chartAxisThemeOverrides = this.createManagedBean( new ChartMenuParamsFactory(chartOptionsService.getCartesianAxisThemeOverridesProxy(this.axisType)) ); const axisTypeSelectParams = this.getAxisTypeSelectParams( chartAxisOptions, chartOptionsService.getCartesianAxisAppliedThemeOverridesProxy(this.axisType) ); const axisPositionSelectParams = this.getAxisPositionSelectParams(chartAxisOptions); const axisTimeFormatSelectParams = this.getAxisTimeFormatSelectParams(chartAxisOptions); const axisColorInputParams = this.getAxisColorInputParams(chartAxisThemeOverrides); const axisLineWidthSliderParams = this.getAxisLineWidthSliderParams(chartAxisThemeOverrides); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSelectSelector, ColorPickerSelector, AgSliderSelector], { axisGroup: axisGroupParams, axisTypeSelect: axisTypeSelectParams ?? void 0, axisPositionSelect: axisPositionSelectParams ?? void 0, axisTimeFormatSelect: axisTimeFormatSelectParams ?? void 0, axisColorInput: axisColorInputParams, axisLineWidthSlider: axisLineWidthSliderParams } ); registerGroupComponent(this.axisGroup); this.axisTypeSelect.setDisplayed(!!axisTypeSelectParams.options?.length); if (!axisPositionSelectParams) { this.removeTemplateComponent(this.axisPositionSelect); } const updateTimeFormatVisibility = () => { const isTimeAxis = chartAxisOptionsProxy.getValue("type") === "time"; _setDisplayed(this.axisTimeFormatSelect.getGui(), isTimeAxis); }; if (!axisTimeFormatSelectParams) { this.removeTemplateComponent(this.axisTimeFormatSelect); } else { updateTimeFormatVisibility(); this.addManagedEventListeners({ chartOptionsChanged: () => { updateTimeFormatVisibility(); } }); } this.initGridLines(chartAxisThemeOverrides); this.initAxisTicks(chartAxisThemeOverrides); this.initAxisLabels(chartAxisThemeOverrides); const updateFns = () => { for (const func of this.updateFuncs) { func(); } }; this.addManagedListeners(this.chartController, { chartUpdated: updateFns, chartModelUpdate: () => setTimeout(() => { if (!this.isAlive()) { return; } this.refreshAxisTypeSelect(chartAxisOptions); updateTimeFormatVisibility(); }) }); } getAxisTypeSelectParams(chartAxisOptions, chartAxisAppliedThemeOverrides) { const chartOptions = chartAxisOptions.getChartOptions(); const axisTypeSelectOptions = this.getAxisTypeSelectOptions(); const params = chartAxisOptions.getDefaultSelectParams("type", "axisType", axisTypeSelectOptions); params.onValueChange = (value) => { const previousAxisType = chartOptions.getValue("type"); if (value === previousAxisType) { return; } const previousAxisThemeOverrides = chartAxisAppliedThemeOverrides.getValue("*"); const previousAxisIsTimeAxis = previousAxisType === "time"; const updatedAxisIsTimeAxis = value === "time"; const updatedLabelFormat = previousAxisIsTimeAxis !== updatedAxisIsTimeAxis ? updatedAxisIsTimeAxis ? DEFAULT_TIME_AXIS_FORMAT : void 0 : null; if (updatedLabelFormat === void 0) { chartOptions.clearValue?.("label", "format"); } this.chartOptionsService.setCartesianCategoryAxisType(this.axisType, value); if (updatedLabelFormat != null) { chartOptions.setValue("label.format", updatedLabelFormat); } chartAxisAppliedThemeOverrides.setValue("*", previousAxisThemeOverrides); }; return params; } refreshAxisTypeSelect(chartAxisOptions) { const options = this.getAxisTypeSelectOptions(); const hasOptions = !!options.length; this.axisTypeSelect.setDisplayed(hasOptions); if (!hasOptions) { return; } this.axisTypeSelect.clearOptions().addOptions(options).setValue(chartAxisOptions.getChartOptions().getValue("type")); } getAxisTypeSelectOptions() { const controller = this.chartController; const chartType = controller.getChartType(); const supportsNumericalAxis = () => { const testDatum = controller.getChartData()[0]; if (!testDatum) { return false; } return controller.getSelectedDimensions().every((col) => !isNaN(parseFloat(testDatum[col.colId]))); }; if (["heatmap", "histogram", "boxPlot", "rangeBar", "scatter", "bubble"].includes(chartType) || controller.isGrouping() || !this.isCategoryAxis() || controller.isCategorySeriesSwitched() || !supportsNumericalAxis()) { return []; } return ["category", "number", "time"].map((value) => ({ value, text: this.translate(value) })); } isCategoryAxis() { const isHorizontal = this.chartOptionsSeriesProxy.getValue("direction") === "horizontal"; return isHorizontal && this.axisType === "yAxis" || !isHorizontal && this.axisType === "xAxis"; } getAxisPositionSelectParams(chartAxisOptions) { const axisPositionSelectOptions = ((chartType, axisType) => { if (chartType === "heatmap") { return null; } if (axisType === "xAxis") { return [ { value: "top", text: this.translate("top") }, { value: "bottom", text: this.translate("bottom") } ]; } if (axisType === "yAxis") { return [ { value: "left", text: this.translate("left") }, { value: "right", text: this.translate("right") } ]; } })(this.chartController.getChartType(), this.axisType); if (!axisPositionSelectOptions) { return null; } return chartAxisOptions.getDefaultSelectParams("position", "position", axisPositionSelectOptions); } getAxisTimeFormatSelectParams(chartAxisOptions) { if (!this.isCategoryAxis()) { return null; } const axisTimeFormatSelectOptions = [ { value: "%d/%m/%Y", text: this.translate("timeFormatSlashesDDMMYYYY") }, { value: "%m/%d/%Y", text: this.translate("timeFormatSlashesMMDDYYYY") }, { value: "%d/%m/%y", text: this.translate("timeFormatSlashesDDMMYY") }, { value: "%m/%d/%y", text: this.translate("timeFormatSlashesMMDDYY") }, { value: "%d.%e.%y", text: this.translate("timeFormatDotsDDMYY") }, { value: "%e.%d.%y", text: this.translate("timeFormatDotsMDDYY") }, { value: "%Y-%m-%d", text: this.translate("timeFormatDashesYYYYMMDD") }, { value: "%d %B %Y", text: this.translate("timeFormatSpacesDDMMMMYYYY") }, { value: "%H:%M:%S", text: this.translate("timeFormatHHMMSS") }, { value: "%I:%M:%S %p", text: this.translate("timeFormatHHMMSSAmPm") } ]; return chartAxisOptions.getDefaultSelectParams("label.format", "timeFormat", axisTimeFormatSelectOptions); } getAxisColorInputParams(chartAxisThemeOverrides) { return chartAxisThemeOverrides.getDefaultColorPickerParams("line.stroke"); } getAxisLineWidthSliderParams(chartAxisThemeOverrides) { const chartOptions = chartAxisThemeOverrides.getChartOptions(); const getAxisLineWidth = () => { const isAxisLineEnabled = chartOptions.getValue("line.enabled"); if (!isAxisLineEnabled) { return null; } return chartOptions.getValue("line.width"); }; const setAxisLineWidth = (value) => { chartOptions.setValues([ { expression: "line.enabled", value: value != null }, { expression: "line.width", value: value ?? 0 } ]); }; const axisLineWidthSliderParams = chartAxisThemeOverrides.getDefaultSliderParamsWithoutValueParams( getAxisLineWidth() ?? 0, "thickness", 10 ); axisLineWidthSliderParams.onValueChange = (newValue) => { setAxisLineWidth(newValue === 0 ? null : newValue); }; return axisLineWidthSliderParams; } initGridLines(chartAxisThemeOverrides) { const chartType = this.chartController.getChartType(); if (chartType === "heatmap") { return; } const gridLineComp = this.createBean(new GridLinePanel(chartAxisThemeOverrides)); this.axisGroup.addItem(gridLineComp); this.activePanels.push(gridLineComp); } initAxisTicks(chartAxisThemeOverrides) { if (!this.hasConfigurableAxisTicks()) { return; } const axisTicksComp = this.createBean(new AxisTicksPanel(chartAxisThemeOverrides)); this.axisGroup.addItem(axisTicksComp); this.activePanels.push(axisTicksComp); const updateTickFn = () => axisTicksComp.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis()); this.updateFuncs.push(updateTickFn); updateTickFn(); } hasConfigurableAxisTicks() { const chartType = this.chartController.getChartType(); switch (chartType) { case "radarLine": case "radarArea": case "rangeBar": case "boxPlot": case "waterfall": return false; default: return true; } } initAxisLabels(chartAxisThemeOverrides) { const params = { name: this.translate("labels"), enabled: true, suppressEnabledCheckbox: true, chartMenuParamsFactory: chartAxisThemeOverrides, keyMapper: (key) => `label.${key}` }; const labelPanelComp = this.createBean(new FontPanel(params)); this.axisGroup.addItem(labelPanelComp); this.activePanels.push(labelPanelComp); this.addAdditionalLabelComps(labelPanelComp, chartAxisThemeOverrides); } addAdditionalLabelComps(labelPanelComp, chartAxisThemeOverrides) { this.addLabelPadding(labelPanelComp, chartAxisThemeOverrides); const rotationComp = this.createRotationWidget("labelRotation", chartAxisThemeOverrides); const autoRotateCb = this.initLabelRotation(rotationComp, chartAxisThemeOverrides); labelPanelComp.addItem(autoRotateCb); labelPanelComp.addItem(rotationComp); } initLabelRotation(rotationComp, chartAxisThemeOverrides) { const chartOptions = chartAxisThemeOverrides.getChartOptions(); const getLabelRotationValue = () => { return chartOptions.getValue("label.rotation"); }; const getLabelAutoRotateValue = () => { return chartOptions.getValue("label.autoRotate"); }; const updateAutoRotate = (autoRotate2) => { if (autoRotate2) { this.prevRotation = getLabelRotationValue(); } chartOptions.setValues([ { expression: "label.autoRotate", value: autoRotate2 }, // Clear the rotation option when activating auto-rotate, reinstate the previous value when deactivating { expression: "label.rotation", value: autoRotate2 ? void 0 : this.prevRotation } ]); rotationComp.setDisplayed(!autoRotate2); }; const rotation = getLabelRotationValue(); const autoRotate = typeof rotation === "number" ? false : getLabelAutoRotateValue(); const autoRotateCheckbox = this.createBean( new AgCheckbox({ label: this.translate("autoRotate"), value: autoRotate, onValueChange: updateAutoRotate }) ); rotationComp.setDisplayed(!autoRotate); const autoRotateUpdateFn = () => autoRotateCheckbox.setDisplayed(this.isGroupedCategoryAxis()); this.updateFuncs.push(autoRotateUpdateFn); autoRotateUpdateFn(); return autoRotateCheckbox; } createRotationWidget(labelKey, chartAxisThemeOverrides) { const chartOptions = chartAxisThemeOverrides.getChartOptions(); const getLabelRotationValue = () => { return chartOptions.getValue("label.rotation"); }; const setLabelRotationValue = (value) => { return chartOptions.setValue("label.rotation", value); }; const degreesSymbol = String.fromCharCode(176); const label = `${this.chartTranslation.translate(labelKey)} ${degreesSymbol}`; const angleSelect = new AgAngleSelect({ label, labelWidth: "flex", value: getLabelRotationValue() ?? 0, onValueChange: setLabelRotationValue }); this.updateFuncs.push(() => { angleSelect.setValue(getLabelRotationValue() ?? 0); }); return this.createBean(angleSelect); } isGroupedCategoryAxis() { const axisOptionsType = this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue("type"); if (axisOptionsType === "grouped-category") { return !this.isCategoryAxis(); } return true; } addLabelPadding(labelPanelComp, chartAxisThemeOverrides) { const labelPaddingSlider = this.createBean( new AgSlider(chartAxisThemeOverrides.getDefaultSliderParams("label.spacing", "padding", 30)) ); labelPanelComp.addItem(labelPaddingSlider); } translate(key) { return this.chartTranslation.translate(key); } removeTemplateComponent(component) { _removeFromParent(component.getGui()); this.destroyBean(component); } destroyActivePanels() { for (const panel of this.activePanels) { _removeFromParent(panel.getGui()); this.destroyBean(panel); } } destroy() { this.destroyActivePanels(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/axis/polarAxisPanel.ts var PolarAxisPanel = class extends Component { constructor(options) { super(); this.options = options; this.axisGroup = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { isExpandedOnInit: expanded, chartAxisMenuParamsFactory, registerGroupComponent } = this.options; const axisGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.translate("polarAxis"), expanded, suppressEnabledCheckbox: true }; const axisColorInputParams = chartAxisMenuParamsFactory.getDefaultColorPickerParams("line.stroke"); const axisLineWidthSliderParams = chartAxisMenuParamsFactory.getDefaultSliderParams( "line.width", "thickness", 10 ); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { axisGroup: axisGroupParams, axisColorInput: axisColorInputParams, axisLineWidthSlider: axisLineWidthSliderParams } ); registerGroupComponent(this.axisGroup); this.initAxis(); this.initAxisLabels(); this.initRadiusAxis(); } initAxis() { const chartType = this.options.chartController.getChartType(); const hasConfigurableAxisShape = ["radarLine", "radarArea"].includes(chartType); if (hasConfigurableAxisShape) { const options = [ { value: "circle", text: this.translate("circle") }, { value: "polygon", text: this.translate("polygon") } ]; this.axisGroup.addItem( this.createSelect({ labelKey: "shape", options, property: "shape" }) ); } if (chartType !== "pie") { this.axisGroup.addItem( this.createSlider({ labelKey: "innerRadius", defaultMaxValue: 1, property: "innerRadiusRatio" }) ); } } initAxisLabels() { const params = { name: this.translate("labels"), enabled: true, suppressEnabledCheckbox: true, chartMenuParamsFactory: this.options.chartAxisMenuParamsFactory, keyMapper: (key) => `label.${key}` }; const labelPanelComp = this.createManagedBean(new FontPanel(params)); const labelOrientationComp = this.createOrientationWidget(); labelPanelComp.addItem(labelOrientationComp); this.axisGroup.addItem(labelPanelComp); } createOrientationWidget() { const options = [ { value: "fixed", text: this.translate("fixed") }, { value: "parallel", text: this.translate("parallel") }, { value: "perpendicular", text: this.translate("perpendicular") } ]; return this.createSelect({ labelKey: "orientation", options, property: "label.orientation" }); } initRadiusAxis() { const chartSeriesType = getSeriesType(this.options.chartController.getChartType()); if (!isRadial(chartSeriesType)) { return; } const items = [ this.createSlider({ labelKey: "groupPadding", defaultMaxValue: 1, property: "paddingInner" }), this.createSlider({ labelKey: "seriesPadding", defaultMaxValue: 1, property: "groupPaddingInner" }) ]; const paddingPanelComp = this.createManagedBean( new AgGroupComponent({ cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, enabled: true, suppressEnabledCheckbox: true, title: this.translate("padding"), items }) ).hideEnabledCheckbox(true).hideOpenCloseIcons(true); this.axisGroup.addItem(paddingPanelComp); } createSlider(config) { const { labelKey, defaultMaxValue, step = 0.05, property } = config; const params = this.options.chartAxisMenuParamsFactory.getDefaultSliderParams( property, labelKey, defaultMaxValue ); params.step = step; return this.createManagedBean(new AgSlider(params)); } createSelect(config) { const { labelKey, options, property } = config; return this.createManagedBean( new AgSelect(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(property, labelKey, options)) ); } translate(key) { return this.chartTranslation.translate(key); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/chart/backgroundPanel.ts var BackgroundPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const chartBackgroundGroupParams = this.chartMenuUtils.addEnableParams( "background.visible", { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("background"), suppressEnabledCheckbox: true, useToggle: true } ); const colorPickerParams = this.chartMenuUtils.getDefaultColorPickerParams("background.fill"); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector], { chartBackgroundGroup: chartBackgroundGroupParams, colorPicker: colorPickerParams } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/chart/paddingPanel.ts var PaddingPanel = class extends Component { constructor(chartMenuUtils, chartController) { super(); this.chartMenuUtils = chartMenuUtils; this.chartController = chartController; this.paddingTopSlider = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const chartPaddingGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("padding"), suppressEnabledCheckbox: true }; const getSliderParams = (property) => this.chartMenuUtils.getDefaultSliderParams("padding." + property, property, 200); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSliderSelector], { chartPaddingGroup: chartPaddingGroupParams, paddingTopSlider: getSliderParams("top"), paddingRightSlider: getSliderParams("right"), paddingBottomSlider: getSliderParams("bottom"), paddingLeftSlider: getSliderParams("left") } ); this.addManagedEventListeners({ chartOptionsChanged: (e) => { this.updateTopPadding(e.chartOptions); } }); } updateTopPadding(chartOptions) { const topPadding = [...this.chartController.getChartSeriesTypes(), "common"].map((seriesType) => chartOptions?.[seriesType]?.padding?.top).find((value) => value != null); if (topPadding != null) { this.paddingTopSlider.setValue(`${topPadding}`); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/chart/chartPanel.ts var ChartPanel = class extends Component { constructor(options) { super(); this.options = options; this.chartGroup = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { chartController, chartMenuParamsFactory, isExpandedOnInit: expanded, registerGroupComponent } = this.options; const chartGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.chartTranslation.translate("chartStyle"), expanded, suppressEnabledCheckbox: true, items: [ this.createManagedBean(new PaddingPanel(chartMenuParamsFactory, chartController)), this.createManagedBean(new BackgroundPanel(chartMenuParamsFactory)) ] }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { chartGroup: chartGroupParams } ); registerGroupComponent(this.chartGroup); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/groupExpansionFeature.ts var GroupExpansionFeature = class extends BeanStub { constructor(groupContainer) { super(); this.groupContainer = groupContainer; this.id = 0; this.groupComponents = /* @__PURE__ */ new Map(); } addGroupComponent(groupComponent) { const id = this.id++; this.groupComponents.set(id, groupComponent); if (groupComponent.isExpanded()) { this.expandedGroupComponent = id; } groupComponent.onExpandedChange((expanded) => { if (expanded) { const previouslyExpandedGroupComponent = this.expandedGroupComponent; this.expandedGroupComponent = id; if (previouslyExpandedGroupComponent != null) { const groupComponentGui = groupComponent.getGui(); const groupPositionInViewport = groupComponentGui.offsetTop - this.groupContainer.parentElement.scrollTop; this.groupComponents.get(previouslyExpandedGroupComponent)?.toggleGroupExpand(false, true); let newScrollTop = groupComponentGui.offsetTop - groupPositionInViewport; if (newScrollTop < 0) { newScrollTop = 0; } if (newScrollTop !== this.groupContainer.parentElement.scrollTop) { this.groupContainer.parentElement.scrollTop = newScrollTop; } } } else { this.expandedGroupComponent = void 0; } }); } destroy() { this.groupComponents.clear(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/legend/legendPanel.ts var LegendPanel = class extends Component { constructor(options, chartMenuContext) { super(); this.options = options; this.legendGroup = RefPlaceholder; this.enabledGroup = RefPlaceholder; this.isGradient = ["treemap", "sunburst", "heatmap"].includes(options.seriesType); this.key = this.isGradient ? "gradientLegend" : "legend"; this.chartController = chartMenuContext.chartController; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { chartMenuParamsFactory, isExpandedOnInit: expanded, registerGroupComponent } = this.options; const positionSelect = this.createManagedBean( new AgSelect( chartMenuParamsFactory.getDefaultSelectParams( `${this.key}.position`, "position", ["top", "right", "bottom", "left"].map((position) => ({ value: position, text: this.chartTranslation.translate(position) })) ) ) ); this.enabledGroup = this.createManagedBean( new AgGroupComponent( chartMenuParamsFactory.addEnableParams(`${this.key}.enabled`, { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("legendEnabled"), suppressEnabledCheckbox: true, useToggle: true, items: [ this.createLabelPanel(chartMenuParamsFactory), positionSelect, ...this.getItems(chartMenuParamsFactory) ] }) ) ); const legendGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.chartTranslation.translate("legend"), suppressEnabledCheckbox: true, expanded, items: [this.enabledGroup] }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { legendGroup: legendGroupParams } ); registerGroupComponent(this.legendGroup); const listener = this.updateLegendEnabledState.bind(this); this.addManagedListeners(this.chartController, { chartModelUpdate: listener, chartApiUpdate: listener }); } updateLegendEnabledState() { const { valueCols } = this.chartController.getColStateForMenu(); this.enabledGroup.setEnabled(valueCols.filter((vc) => vc.selected).length > 1); } getItems(chartMenuParamsFactory) { const createSlider = (expression, labelKey, defaultMaxValue) => this.createManagedBean( new AgSlider( chartMenuParamsFactory.getDefaultSliderParams( `${this.key}.${expression}`, labelKey, defaultMaxValue ) ) ); if (this.isGradient) { return [ this.createManagedBean( new AgCheckbox( chartMenuParamsFactory.addValueParams("gradientLegend.reverseOrder", { label: this.chartTranslation.translate("reverseDirection"), labelWidth: "flex" }) ) ), createSlider("gradient.thickness", "thickness", 40), createSlider("gradient.preferredLength", "preferredLength", 300), createSlider("spacing", "spacing", 200) ]; } return [ createSlider("spacing", "spacing", 200), createSlider("item.marker.size", "markerSize", 40), createSlider("item.marker.strokeWidth", "markerStroke", 10), createSlider("item.marker.padding", "itemSpacing", 20), createSlider("item.paddingX", "layoutHorizontalSpacing", 50), createSlider("item.paddingY", "layoutVerticalSpacing", 50) ]; } createLabelPanel(chartMenuParamsFactory) { const rootKey = this.isGradient ? "gradientLegend.scale.label" : "legend.item.label"; const params = { enabled: true, suppressEnabledCheckbox: true, chartMenuParamsFactory, keyMapper: (key) => `${rootKey}.${key}`, cssIdentifier: "charts-format-sub-level-no-header" }; return this.createManagedBean(new FontPanel(params)); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/toggleablePanel.ts var ToggleablePanel = class extends Component { constructor(params) { super(); this.params = params; this.toggleableGroup = RefPlaceholder; this.activeComps = []; this.chartOptions = params.chartMenuParamsFactory.getChartOptions(); } postConstruct() { const { tag, cssIdentifier = "charts-format-sub-level", title, suppressEnabledCheckbox } = this.params; const groupParams = this.params.chartMenuParamsFactory.addEnableParams(`${tag}.enabled`, { cssIdentifier, direction: "vertical", suppressOpenCloseIcons: true, title, suppressEnabledCheckbox: true, useToggle: !suppressEnabledCheckbox }); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { toggleableGroup: groupParams } ); this.toggleCss(`ag-toggleable-group-panel-no-header`, !title); } addItem(comp, prepend) { if (prepend) { this.toggleableGroup.prependItem(comp); } else { this.toggleableGroup.addItem(comp); } this.activeComps.push(comp); } setEnabled(enabled) { this.toggleableGroup.setEnabled(enabled); } destroyActiveComps() { for (const comp of this.activeComps) { _removeFromParent(comp.getGui()); this.destroyBean(comp); } } destroy() { this.destroyActiveComps(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/calloutPanel.ts var CalloutPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const calloutGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("callout"), enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSliderSelector], { calloutGroup: calloutGroupParams, calloutLengthSlider: this.chartMenuUtils.getDefaultSliderParams("calloutLine.length", "length", 40), calloutStrokeWidthSlider: this.chartMenuUtils.getDefaultSliderParams( "calloutLine.strokeWidth", "strokeWidth", 10 ), labelOffsetSlider: this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset", "offset", 30) } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/capsPanel.ts var CapsPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const capsGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("cap"), enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; const capLengthRatioSliderParams = this.chartMenuUtils.getDefaultSliderParams( "cap.lengthRatio", "capLengthRatio", 1 ); capLengthRatioSliderParams.step = 0.05; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSliderSelector], { capsGroup: capsGroupParams, capLengthRatioSlider: capLengthRatioSliderParams } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/connectorLinePanel.ts var ConnectorLinePanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const lineGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("connectorLine"), enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { lineGroup: lineGroupParams, lineColorPicker: this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"), lineStrokeWidthSlider: this.getSliderParams("strokeWidth", 10, "line.strokeWidth"), lineDashSlider: this.getSliderParams("lineDash", 30, "line.lineDash", 1, true), lineOpacitySlider: this.getSliderParams("strokeOpacity", 1, "line.strokeOpacity", 0.05) } ); } getSliderParams(labelKey, maxValue, seriesOptionKey, step = 1, isArray = false) { const params = this.chartMenuUtils.getDefaultSliderParams(seriesOptionKey, labelKey, maxValue, isArray); params.step = step; return params; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/seriesUtils.ts function getShapeSelectOptions(chartTranslation) { return ["square", "circle", "cross", "diamond", "plus", "triangle", "heart"].map((value) => ({ value, text: chartTranslation.translate(value) })); } // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/markersPanel.ts var MarkersPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const seriesMarkersGroupParams = this.chartMenuUtils.addEnableParams("marker.enabled", { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("markers"), suppressEnabledCheckbox: true, useToggle: true, suppressOpenCloseIcons: true }); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSelectSelector, AgSliderSelector], { seriesMarkersGroup: seriesMarkersGroupParams, seriesMarkerShapeSelect: this.chartMenuUtils.getDefaultSelectParams( "marker.shape", "shape", getShapeSelectOptions(this.chartTranslation) ), seriesMarkerSizeSlider: this.chartMenuUtils.getDefaultSliderParams("marker.size", "size", 60), seriesMarkerStrokeWidthSlider: this.chartMenuUtils.getDefaultSliderParams( "marker.strokeWidth", "strokeWidth", 10 ) } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/seriesItemsPanel.ts var SeriesItemsPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; this.seriesItemsGroup = RefPlaceholder; this.activePanels = []; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const seriesItemsGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("seriesItems"), enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSelectSelector], { seriesItemsGroup: seriesItemsGroupParams, seriesItemSelect: this.getSeriesItemsParams() } ); this.initSeriesControls(); } getSeriesItemsParams() { const options = [ { value: "positive", text: this.chartTranslation.translate("seriesItemPositive") }, { value: "negative", text: this.chartTranslation.translate("seriesItemNegative") } ]; const seriesItemChangedCallback = (newValue) => { this.destroyActivePanels(); this.initSeriesControls(newValue); }; return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams( "seriesItemType", options, "positive", seriesItemChangedCallback ); } initSeriesControls(itemType = "positive") { this.initSlider("strokeWidth", 10, `item.${itemType}.strokeWidth`); this.initSlider("lineDash", 30, `item.${itemType}.lineDash`, 1, true); this.initSlider("strokeOpacity", 1, `item.${itemType}.strokeOpacity`, 0.05, false); this.initSlider("fillOpacity", 1, `item.${itemType}.fillOpacity`, 0.05, false); this.initItemLabels(itemType); } initSlider(labelKey, maxValue, seriesOptionKey, step = 1, isArray = false) { const params = this.chartMenuUtils.getDefaultSliderParams(seriesOptionKey, labelKey, maxValue, isArray); params.step = step; const itemSlider = this.seriesItemsGroup.createManagedBean(new AgSlider(params)); this.seriesItemsGroup.addItem(itemSlider); this.activePanels.push(itemSlider); } initItemLabels(itemType) { const sectorParams = this.chartMenuUtils.getDefaultFontPanelParams( `item.${itemType}.label`, "seriesItemLabels" ); const labelPanelComp = this.createBean(new FontPanel(sectorParams)); this.seriesItemsGroup.addItem(labelPanelComp); this.activePanels.push(labelPanelComp); } destroyActivePanels() { for (const panel of this.activePanels) { _removeFromParent(panel.getGui()); this.destroyBean(panel); } } destroy() { this.destroyActivePanels(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/shadowPanel.ts var ShadowPanel = class extends Component { constructor(chartMenuUtils, propertyKey = "shadow") { super(); this.chartMenuUtils = chartMenuUtils; this.propertyKey = propertyKey; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const propertyNamespace = this.propertyKey; const shadowGroupParams = this.chartMenuUtils.addEnableParams( `${propertyNamespace}.enabled`, { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: this.chartTranslation.translate("shadow"), suppressEnabledCheckbox: true, useToggle: true } ); const shadowColorPickerParams = this.chartMenuUtils.getDefaultColorPickerParams(`${propertyNamespace}.color`); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { shadowGroup: shadowGroupParams, shadowColorPicker: shadowColorPickerParams, shadowBlurSlider: this.getSliderParams("blur", 0, 20), shadowXOffsetSlider: this.getSliderParams("xOffset", -10, 10), shadowYOffsetSlider: this.getSliderParams("yOffset", -10, 10) } ); } getSliderParams(property, minValue, defaultMaxValue) { const expression = `${this.propertyKey}.${property}`; const params = this.chartMenuUtils.getDefaultSliderParams(expression, property, defaultMaxValue); params.minValue = minValue; return params; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/tileSpacingPanel.ts var TileSpacingPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const groupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSliderSelector], { groupSpacing: { ...groupParams, title: this.chartTranslation.translate("group") }, tileSpacing: { ...groupParams, title: this.chartTranslation.translate("tile") }, groupPaddingSlider: this.getSliderParams("padding", "group.padding"), groupSpacingSlider: this.getSliderParams("spacing", "group.gap"), tilePaddingSlider: this.getSliderParams("padding", "tile.padding"), tileSpacingSlider: this.getSliderParams("spacing", "tile.gap") } ); } getSliderParams(labelKey, key) { return this.chartMenuUtils.getDefaultSliderParams(key, labelKey, 10); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/tooltipPanel.ts function _capitalise2(str) { return str[0].toUpperCase() + str.substring(1); } var TooltipPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; this.tooltipMode = RefPlaceholder; } postConstruct() { const { chartMenuUtils, beans } = this; const propertyKey = "tooltip"; const chartTranslation = beans.chartTranslation; const tooltipGroupParams = chartMenuUtils.addEnableParams(`${propertyKey}.enabled`, { cssIdentifier: "charts-format-sub-level", direction: "vertical", suppressOpenCloseIcons: true, title: chartTranslation.translate("tooltips"), suppressEnabledCheckbox: true, useToggle: true }); const tooltipModeLocaleKey = "tooltipMode"; const tooltipModeSelectionOptions = ["single", "shared", "compact"].map((value) => ({ value, text: chartTranslation.translate(`${tooltipModeLocaleKey}${_capitalise2(value)}`) })); const tooltipModeExpression = `${propertyKey}.mode`; const tooltipModeSelectParams = chartMenuUtils.getDefaultSelectParams( tooltipModeExpression, tooltipModeLocaleKey, tooltipModeSelectionOptions ); this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, AgSelectSelector], { tooltipGroup: tooltipGroupParams, tooltipMode: tooltipModeSelectParams } ); this.addManagedEventListeners({ chartOptionsChanged: () => { const tooltipModeValue = chartMenuUtils.getChartOptions().getValue(tooltipModeExpression); this.tooltipMode.setValue(tooltipModeValue, true); } }); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/whiskersPanel.ts var WhiskersPanel = class extends Component { constructor(chartMenuUtils) { super(); this.chartMenuUtils = chartMenuUtils; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const whiskersGroupParams = { cssIdentifier: "charts-format-sub-level", direction: "vertical", title: this.chartTranslation.translate("whisker"), enabled: true, suppressOpenCloseIcons: true, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector, ColorPickerSelector, AgSliderSelector], { whiskersGroup: whiskersGroupParams, whiskerColorPicker: this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"), whiskerThicknessSlider: this.chartMenuUtils.getDefaultSliderParams( "whisker.strokeWidth", "strokeWidth", 10 ), whiskerOpacitySlider: this.chartMenuUtils.getDefaultSliderParams( "whisker.strokeOpacity", "strokeOpacity", 1 ), whiskerLineDashSlider: this.chartMenuUtils.getDefaultSliderParams( "whisker.lineDash", "lineDash", 30, true ), whiskerLineDashOffsetSlider: this.chartMenuUtils.getDefaultSliderParams( "whisker.lineDashOffset", "lineDashOffset", 30 ) } ); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/series/seriesPanel.ts var tooltips = "tooltips"; var strokeWidth = "strokeWidth"; var lineWidth = "lineWidth"; var lineDash = "lineDash"; var lineOpacity = "lineOpacity"; var fillOpacity = "fillOpacity"; var labels = "labels"; var shadow = "shadow"; var stageLabels = "stageLabels"; var markers = "markers"; var SeriesPanel = class extends Component { constructor(options) { super(); this.options = options; this.seriesGroup = RefPlaceholder; this.activePanels = []; this.widgetFuncs = { lineWidth: () => this.initStrokeWidth(lineWidth), [strokeWidth]: () => this.initStrokeWidth("strokeWidth"), lineColor: () => this.initLineColor(), [lineDash]: () => this.initLineDash(), [lineOpacity]: () => this.initOpacity("strokeOpacity"), [fillOpacity]: () => this.initOpacity("fillOpacity"), markers: () => new MarkersPanel(this.chartMenuUtils), [labels]: () => this.initLabels(), sectorLabels: () => this.initSectorLabels(), [shadow]: () => new ShadowPanel(this.chartMenuUtils), [tooltips]: () => new TooltipPanel(this.options.chartMenuParamsFactory), bins: () => this.initBins(), whiskers: () => new WhiskersPanel(this.chartMenuUtils), caps: () => new CapsPanel(this.chartMenuUtils), connectorLine: () => new ConnectorLinePanel(this.chartMenuUtils), seriesItems: () => new SeriesItemsPanel(this.chartMenuUtils), tileSpacing: () => new TileSpacingPanel(this.chartMenuUtils), shape: () => this.initShape(), size: () => this.initSize("size", "size"), minSize: () => this.initSize("size", "minSize"), maxSize: () => this.initSize("maxSize", "maxSize"), dropoff: () => this.initDropOff(), stageLabels: () => this.initStageLabels() }; this.seriesWidgetMappings = { bar: [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels, shadow], pie: [tooltips, strokeWidth, lineOpacity, fillOpacity, labels, "sectorLabels", shadow], donut: [tooltips, strokeWidth, lineOpacity, fillOpacity, labels, "sectorLabels", shadow], line: [tooltips, lineWidth, lineDash, lineOpacity, markers, labels], scatter: [tooltips, "shape", "size", strokeWidth, labels], bubble: [tooltips, "shape", "minSize", "maxSize", strokeWidth, labels], area: [tooltips, lineWidth, lineDash, lineOpacity, fillOpacity, markers, labels, shadow], histogram: [tooltips, "bins", strokeWidth, lineDash, lineOpacity, fillOpacity, labels, shadow], "radial-column": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels], "radial-bar": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels], "radar-line": [tooltips, strokeWidth, lineDash, lineOpacity, markers, labels], "radar-area": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, markers, labels], nightingale: [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels], "box-plot": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, "whiskers", "caps"], "range-bar": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels], "range-area": [tooltips, lineWidth, lineDash, lineOpacity, fillOpacity, markers, labels, shadow], treemap: [tooltips, "tileSpacing"], sunburst: [tooltips], heatmap: [tooltips, labels, "lineColor", lineWidth, lineOpacity], waterfall: [tooltips, "connectorLine", "seriesItems"], funnel: [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels, "dropoff", stageLabels, shadow], "cone-funnel": [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels, stageLabels], pyramid: [tooltips, strokeWidth, lineDash, lineOpacity, fillOpacity, labels, stageLabels, shadow] }; this.seriesType = options.seriesType; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { isExpandedOnInit: expanded, chartOptionsService, chartController, registerGroupComponent } = this.options; const seriesGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.translate("series"), expanded, suppressEnabledCheckbox: true }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { seriesGroup: seriesGroupParams } ); registerGroupComponent(this.seriesGroup); this.chartMenuUtils = this.createManagedBean( new ChartMenuParamsFactory(chartOptionsService.getSeriesOptionsProxy(() => this.seriesType)) ); this.addManagedListeners(chartController, { chartSeriesChartTypeChanged: this.refreshWidgets.bind(this) }); this.refreshWidgets(); } refreshWidgets() { const { chartController } = this.options; this.destroyActivePanels(); const chart = chartController.getChartProxy().getChart(); chart.waitForUpdate().then(() => { const componentWasRemoved = !this.isAlive(); if (componentWasRemoved) { return; } if (chartController.isComboChart()) { this.updateSeriesType(); this.initSeriesSelect(); } for (const w of this.seriesWidgetMappings[this.seriesType] ?? []) { const widgetFuncResult = this.widgetFuncs[w](); let widget; if (Array.isArray(widgetFuncResult)) { const comp = this.createBean(widgetFuncResult[0]); widget = comp; widgetFuncResult[1](comp); } else { widget = this.createBean(widgetFuncResult); } this.seriesGroup.addItem(widget); this.activePanels.push(widget); } }).catch((e) => _error(105, { e })); } initSeriesSelect() { const seriesSelect = this.createBean( new AgSelect( this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams( "seriesType", this.getSeriesSelectOptions(), `${this.seriesType}`, (newValue) => { this.seriesType = newValue; this.refreshWidgets(); } ) ) ); this.seriesGroup.addItem(seriesSelect); this.activePanels.push(seriesSelect); } initLineColor() { return new ColorPicker(this.chartMenuUtils.getDefaultColorPickerParams("stroke", "strokeColor")); } initStrokeWidth(labelKey, expression) { return new AgSlider( this.chartMenuUtils.getDefaultSliderParams( expression ? `${expression}.${labelKey}` : "strokeWidth", labelKey, 10 ) ); } initLineDash(expression) { return new AgSlider( this.chartMenuUtils.getDefaultSliderParams( expression ? `${expression}.lineDash` : "lineDash", "lineDash", 30, true ) ); } initOpacity(type, expression) { const params = this.chartMenuUtils.getDefaultSliderParams(expression ? `${expression}.${type}` : type, type, 1); params.step = 0.05; return new AgSlider(params); } initDropOff() { const dropOffGroup = new ToggleablePanel({ tag: "dropOff", cssIdentifier: "charts-format-sub-level", title: this.translate("dropOff"), suppressEnabledCheckbox: false, chartMenuParamsFactory: this.chartMenuUtils }); const addItems = (groupComponent) => { for (const comp of [ this.initStrokeWidth("strokeWidth", "dropOff"), this.initLineDash("dropOff"), this.initOpacity("strokeOpacity", "dropOff"), this.initOpacity("fillOpacity", "dropOff") ]) { const managed = groupComponent.createManagedBean(comp); groupComponent.addItem(managed); this.activePanels.push(managed); } }; return [dropOffGroup, addItems]; } initLabels() { const isPieChart = isPieChartSeries(this.seriesType); const seriesOptionLabelProperty = isPieChart ? "calloutLabel" : "label"; const labelKey = isPieChart ? "calloutLabels" : "labels"; const labelParams = this.chartMenuUtils.getDefaultFontPanelParams(seriesOptionLabelProperty, labelKey); const fontPanel = new FontPanel(labelParams); const addItems = (labelPanelComp) => { if (isPieChart) { const calloutPanelComp = labelPanelComp.createManagedBean(new CalloutPanel(this.chartMenuUtils)); labelPanelComp.addItem(calloutPanelComp); this.activePanels.push(calloutPanelComp); } if (this.seriesType === "range-bar") { const options = [ { value: "inside", text: this.translate("inside") }, { value: "outside", text: this.translate("outside") } ]; const placementSelect = labelPanelComp.createManagedBean( new AgSelect( this.chartMenuUtils.getDefaultSelectParams("label.placement", "labelPlacement", options) ) ); labelPanelComp.addItem(placementSelect); this.activePanels.push(placementSelect); const paddingSlider = labelPanelComp.createManagedBean( new AgSlider(this.chartMenuUtils.getDefaultSliderParams("label.padding", "padding", 200)) ); labelPanelComp.addItem(paddingSlider); this.activePanels.push(paddingSlider); } }; return [fontPanel, addItems]; } initSectorLabels() { const sectorParams = this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel", "sectorLabels"); const fontPanel = new FontPanel(sectorParams); const addItems = (sectorPanelComp) => { const positionRatioParams = this.chartMenuUtils.getDefaultSliderParams( "sectorLabel.positionRatio", "positionRatio", 1 ); positionRatioParams.step = 0.05; const positionRatioComp = sectorPanelComp.createManagedBean(new AgSlider(positionRatioParams)); sectorPanelComp.addItem(positionRatioComp); }; return [fontPanel, addItems]; } initStageLabels() { return new FontPanel(this.chartMenuUtils.getDefaultFontPanelParams("stageLabel", stageLabels)); } initBins() { const params = this.chartMenuUtils.getDefaultSliderParams("binCount", "histogramBinCount", 20); const chartOptions = this.chartMenuUtils.getChartOptions(); const value = (chartOptions.getValue("bins") ?? chartOptions.getValue("calculatedBins", true)).length; params.value = `${value}`; params.maxValue = Math.max(value, 20); return new AgSlider(params); } initShape() { return new AgSelect( this.chartMenuUtils.getDefaultSelectParams("shape", "shape", getShapeSelectOptions(this.chartTranslation)) ); } initSize(expression, labelKey) { return new AgSlider(this.chartMenuUtils.getDefaultSliderParams(expression, labelKey, 60)); } getSeriesSelectOptions() { const activeSeriesTypes = this.getActiveSeriesTypes(); return ["area", "bar", "line"].filter((seriesType) => activeSeriesTypes.includes(seriesType)).map((value) => ({ value, text: this.translate(value) })); } updateSeriesType() { const activeSeriesTypes = this.getActiveSeriesTypes(); const invalidSeriesType = !activeSeriesTypes.includes(this.seriesType); if (invalidSeriesType && activeSeriesTypes.length > 0) { this.seriesType = activeSeriesTypes[0]; } } getActiveSeriesTypes() { return this.options.chartController.getActiveSeriesChartTypes().map((s2) => getSeriesType(s2.chartType)); } translate(key) { return this.chartTranslation.translate(key); } destroyActivePanels() { for (const panel of this.activePanels) { _removeFromParent(panel.getGui()); this.destroyBean(panel); } } destroy() { this.destroyActivePanels(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/titles/titlePanel.ts var TitlePanel = class extends Component { constructor(chartMenuUtils, name, key) { super( /* html */ `
` ); this.chartMenuUtils = chartMenuUtils; this.name = name; this.key = key; this.chartOptions = chartMenuUtils.getChartOptions(); } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { this.initFontPanel(); } hasTitle() { const title = this.chartOptions.getValue(this.key); return title?.enabled && title.text && title.text.length > 0; } initFontPanel() { const hasTitle = this.hasTitle(); const fontPanelParams = { name: this.chartTranslation.translate(this.name), enabled: hasTitle, suppressEnabledCheckbox: false, chartMenuParamsFactory: this.chartMenuUtils, keyMapper: (key) => `${this.key}.${key}`, onEnableChange: (enabled) => this.onEnableChange(enabled) }; this.fontPanel = this.createManagedBean(new FontPanel(fontPanelParams)); this.fontPanel.addItem(this.createBean(new AgInputTextField(this.getTextInputParams())), true); this.fontPanel.addItem(this.createBean(new AgSlider(this.getSpacingSliderParams()))); this.getGui().appendChild(this.fontPanel.getGui()); } getTextInputParams() { return this.chartMenuUtils.addValueParams(`${this.key}.text`, { label: this.chartTranslation.translate("title"), labelAlignment: "top" }); } getSpacingSliderParams() { return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`, "spacing", 100); } onEnableChange(enabled) { this.chartOptions.setValue(`${this.key}.enabled`, enabled); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/titles/chartTitlePanel.ts var ChartTitlePanel = class extends TitlePanel { wireBeans(beans) { super.wireBeans(beans); this.chartMenuSvc = beans.chartMenuSvc; } postConstruct() { this.titlePlaceholder = this.chartTranslation.translate("titlePlaceholder"); super.postConstruct(); this.addManagedEventListeners({ chartTitleEdit: () => { this.fontPanel.setEnabled(this.hasTitle()); } }); } getTextInputParams() { const params = super.getTextInputParams(); if (this.shouldOverrideTextWithPlaceholder(params.value)) { params.value = this.titlePlaceholder; } return params; } getSpacingSliderParams() { const params = super.getSpacingSliderParams(); params.value = "10"; return params; } onEnableChange(enabled) { if (this.chartMenuSvc.doesChartToolbarExist()) { const topPadding = this.chartOptions.getValue("padding.top"); this.chartOptions.setValue("padding.top", enabled ? topPadding - 20 : topPadding + 20); } this.chartOptions.setValue(`${this.key}.enabled`, enabled); const currentTitleText = this.chartOptions.getValue(`${this.key}.text`); if (enabled && this.shouldOverrideTextWithPlaceholder(currentTitleText)) { this.chartOptions.setValue(`${this.key}.text`, this.titlePlaceholder); } } shouldOverrideTextWithPlaceholder(currentTitleText) { return currentTitleText === "Title" || currentTitleText?.trim().length === 0; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/titles/titlesPanel.ts var TitlesPanel = class extends Component { constructor(options) { super(); this.options = options; this.titleGroup = RefPlaceholder; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { const { chartMenuParamsFactory, chartAxisMenuParamsFactory, chartOptionsService, seriesType, isExpandedOnInit: expanded = false, registerGroupComponent } = this.options; const axisTitlePanels = []; if (isCartesian(seriesType) && seriesType !== "pyramid") { const createAxisParamsFactory = (axisType) => this.createManagedBean( new ChartMenuParamsFactory(chartOptionsService.getCartesianAxisThemeOverridesProxy(axisType)) ); axisTitlePanels.push( this.createManagedBean(new TitlePanel(createAxisParamsFactory("xAxis"), "horizontalAxisTitle", "title")) ); axisTitlePanels.push( this.createManagedBean(new TitlePanel(createAxisParamsFactory("yAxis"), "verticalAxisTitle", "title")) ); } else if (isPolar(seriesType)) { axisTitlePanels.push( this.createManagedBean(new TitlePanel(chartAxisMenuParamsFactory, "polarAxisTitle", "title")) ); } const titleGroupParams = { cssIdentifier: "charts-format-top-level", direction: "vertical", title: this.chartTranslation.translate("chartTitles"), expanded, suppressEnabledCheckbox: true, items: [ this.createManagedBean(new ChartTitlePanel(chartMenuParamsFactory, "chartTitle", "title")), this.createManagedBean(new TitlePanel(chartMenuParamsFactory, "chartSubtitle", "subtitle")), ...axisTitlePanels ] }; this.setTemplate( /* html */ `
`, [AgGroupComponentSelector], { titleGroup: titleGroupParams } ); registerGroupComponent(this.titleGroup); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/format/formatPanel.ts var DefaultFormatPanelDef = { groups: [{ type: "chart" }, { type: "titles" }, { type: "legend" }, { type: "series" }, { type: "axis" }] }; var AXIS_KEYS = ["axis", "horizontalAxis", "verticalAxis"]; var FormatPanel = class extends Component { constructor(chartMenuContext) { super( /* html */ `
` ); this.chartMenuContext = chartMenuContext; } postConstruct() { this.groupExpansionFeature = this.createManagedBean(new GroupExpansionFeature(this.getGui())); this.chartPanelFeature = this.createManagedBean( new ChartPanelFeature( this.chartMenuContext.chartController, this.getGui(), "ag-chart-format-section", (_chartType, seriesType) => this.createPanels(seriesType) ) ); this.chartPanelFeature.refreshPanels(); } createPanels(seriesType) { let panelExpandedOnInit = false; this.getFormatPanelDef().groups?.forEach(({ type: group, isOpen: isExpandedOnInit = false }) => { if (!this.isGroupPanelShownInSeries(group, seriesType)) { return; } if (isExpandedOnInit) { if (panelExpandedOnInit) { _warn(145, { group }); } panelExpandedOnInit = true; } const registerGroupComponent = (groupComponent) => this.groupExpansionFeature.addGroupComponent(groupComponent); const opts = { ...this.chartMenuContext, isExpandedOnInit, seriesType, registerGroupComponent }; switch (group) { case "chart": this.chartPanelFeature.addComponent(new ChartPanel(opts)); break; case "titles": this.chartPanelFeature.addComponent(new TitlesPanel(opts)); break; case "legend": this.chartPanelFeature.addComponent(new LegendPanel(opts, this.chartMenuContext)); break; case "axis": if (isPolar(seriesType)) { this.chartPanelFeature.addComponent(new PolarAxisPanel(opts)); } else if (isCartesian(seriesType)) { this.chartPanelFeature.addComponent(new CartesianAxisPanel("xAxis", opts)); this.chartPanelFeature.addComponent(new CartesianAxisPanel("yAxis", opts)); } break; case "horizontalAxis": this.chartPanelFeature.addComponent(new CartesianAxisPanel("xAxis", opts)); break; case "verticalAxis": this.chartPanelFeature.addComponent(new CartesianAxisPanel("yAxis", opts)); break; case "series": this.chartPanelFeature.addComponent(new SeriesPanel(opts)); break; default: _warn(147, { group }); } }); } getFormatPanelDef() { const userProvidedFormatPanelDef = this.gos.get("chartToolPanelsDef")?.formatPanel; return userProvidedFormatPanelDef ? userProvidedFormatPanelDef : DefaultFormatPanelDef; } isGroupPanelShownInSeries(group, seriesType) { const enable = ["chart", "titles", "legend", "series"].includes(group) || isCartesian(seriesType) && AXIS_KEYS.includes(group) || isPolar(seriesType) && group === "axis"; const disable = isFunnel(seriesType) && group === "legend" || isFunnel(seriesType) && AXIS_KEYS.includes(group); return enable && !disable; } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/miniChart.ts var CANVAS_CLASS = "ag-chart-mini-thumbnail-canvas"; var MiniChart = class extends Component { constructor(container, agChartsExports, tooltipName) { super(); this.agChartsExports = agChartsExports; this.tooltipName = tooltipName; this.size = 58; this.padding = 5; const { _Scene } = agChartsExports; this.root = new _Scene.Group(); const canvasElement = container.ownerDocument.createElement("canvas"); const scene = new _Scene.Scene({ canvasElement, pixelRatio: container.ownerDocument.defaultView?.devicePixelRatio ?? 1, width: this.size, height: this.size, willReadFrequently: false }); scene.canvas.element.classList.add(CANVAS_CLASS); scene.setRoot(this.root); scene.setContainer(container); this.scene = scene; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { this.scene.canvas.element.title = this.chartTranslation.translate(this.tooltipName); try { this.scene.render(); } catch (e) { _error(108, { e }); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/miniChartHelpers.ts function createColumnRects(params) { const { stacked, size, padding, xScalePadding, xScaleDomain, yScaleDomain, agChartsExports: { _Scene } } = params; const xScale = new _Scene.CategoryScale(); xScale.domain = xScaleDomain; xScale.range = [padding, size - padding]; xScale.paddingInner = xScalePadding; xScale.paddingOuter = xScalePadding; const yScale = new _Scene.LinearScale(); yScale.domain = yScaleDomain; yScale.range = [size - padding, padding]; const createBars = (series, xScale2, yScale2) => { return series.map((datum, i) => { const top = yScale2.convert(datum); const rect = new _Scene.Rect(); rect.x = xScale2.convert(i); rect.y = top; rect.width = xScale2.bandwidth; rect.height = yScale2.convert(0) - top; rect.strokeWidth = 0; rect.crisp = true; return rect; }); }; if (stacked) { return params.data.map((d) => createBars(d, xScale, yScale)); } return createBars(params.data, xScale, yScale); } function prepareXYScales(_Scene, data, size, padding) { const xDomain = []; const yDomain = []; for (const item of data) { for (const [x, y] of item) { xDomain.push(x); yDomain.push(y); } } const xScale = new _Scene.LinearScale(); xScale.domain = [Math.min(...xDomain), Math.max(...xDomain)]; xScale.range = [padding, size - padding]; const yScale = new _Scene.LinearScale(); yScale.domain = [Math.min(...yDomain), Math.max(...yDomain)]; yScale.range = [size - padding, padding]; return { xScale, yScale }; } function prepareLinearScene(_Scene, data, size, padding) { const xDomain = [0, data[0].length - 1]; const yDomain = data.reduce( (acc, curr) => { for (const datum of curr) { if (datum < acc[0]) { acc[0] = datum; } if (datum > acc[1]) { acc[1] = datum; } } return acc; }, [Infinity, -Infinity] ); yDomain[0]--; yDomain[yDomain.length - 1]++; const xScale = new _Scene.LinearScale(); xScale.domain = xDomain; xScale.range = [padding, size - padding]; const yScale = new _Scene.LinearScale(); yScale.domain = yDomain; yScale.range = [size - padding, padding]; return { xScale, yScale }; } function createXPathCommands(data, xScale, yScale) { return data.map( (series) => series.map((datum, i) => [ i > 0 ? "lineTo" : "moveTo", xScale.convert(i), yScale.convert(datum) ]) ); } function createXYPathCommands(shape, xScale, yScale) { return shape.map(([x, y], i) => [i > 0 ? "lineTo" : "moveTo", xScale.convert(x), yScale.convert(y)]); } function closePath(commandSegments) { const closingCommand = commandSegments[0]; const first = commandSegments[1]; const last = _last(commandSegments); if (first[1] !== last[1] || first[2] !== last[2]) { commandSegments.push([closingCommand[0], first[1], first[2]]); } return commandSegments; } function createPath(_Scene, commands) { const path = new _Scene.Path(); commands.forEach(([command, x, y]) => path.path[command](x, y)); return path; } function createAreaPathCommands(commands, yScale, stacked) { return commands.map((pathCommands, index, all) => { const closingPath = stacked ? closePathViaPreviousSeries(all, index, yScale) : closePathViaOrigin(pathCommands, yScale); const closingPathCommands = [...closingPath].reverse().map(([_, x, y]) => ["lineTo", x, y]); const first = pathCommands[0]; const last = _last(closingPathCommands); if (first[1] !== last[1] || first[2] !== last[2]) { closingPathCommands.push(["lineTo", first[1], first[2]]); } return [...pathCommands, ...closingPathCommands]; }); } function closePathViaPreviousSeries(all, index, yScale) { if (index === 0) { return closePathViaOrigin(all[index], yScale); } return [...all[index - 1]]; } function closePathViaOrigin(pathCommands, yScale) { return pathCommands.map(([c, x]) => [c, x, yScale.convert(0)]); } function commandsToPath(_Scene, commands) { const path = createPath(_Scene, commands); path.fill = void 0; path.lineCap = "round"; path.strokeWidth = 3; return path; } function createShapePaths({ _Scene }, root, shapes, size, padding) { const { xScale, yScale } = prepareXYScales(_Scene, shapes, size, padding); const openPathsCommands = shapes.map((shape) => createXYPathCommands(shape, xScale, yScale)); const shapesCommands = openPathsCommands.map((path) => closePath(path)); const shapePaths = shapesCommands.map((shapeCommands) => commandsToPath(_Scene, shapeCommands)); const paths = shapePaths.reduce((acc, curr) => acc.concat(curr), []); const pathsGroup = new _Scene.Group(); pathsGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); pathsGroup.append(paths); root.append(pathsGroup); return paths; } function createLinePaths({ _Scene }, root, data, size, padding) { const { xScale, yScale } = prepareLinearScene(_Scene, data, size, padding); const pathCommands = createXPathCommands(data, xScale, yScale); const paths = pathCommands.map((commands) => commandsToPath(_Scene, commands)); const pathsGroup = new _Scene.Group(); pathsGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); pathsGroup.append(paths); root.append(pathsGroup); return paths; } function createAreaPaths(_Scene, root, data, size, padding, stacked = false) { const { xScale, yScale } = prepareLinearScene(_Scene, data, size, padding); const pathCommands = createAreaPathCommands(createXPathCommands(data, xScale, yScale), yScale, stacked); const areasGroup = new _Scene.Group(); areasGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); const paths = pathCommands.map((commands) => createPath(_Scene, commands)); areasGroup.append(paths); root.append(areasGroup); return paths; } function stackData(data) { return data.map( (stack, sindex, array) => stack.map((_y, i) => array.slice(0, sindex + 1).reduce((p, c) => p + c[i], 0)) ); } function normalizeStackData(data) { const colSum = data.map((_, index) => data.reduce((acc, cur) => Math.max(acc, cur[index]), 0)); return data.map((stack) => stack.map((y, index) => y / colSum[index] * 19)); } function createPolarPaths(agChartsExports, root, data, size, radius, innerRadius, markerSize = 0) { const { _Scene } = agChartsExports; const angleScale = new _Scene.LinearScale(); angleScale.domain = [0, 7]; angleScale.range = [-Math.PI, Math.PI].map((angle) => angle + Math.PI / 2); const radiusScale = new _Scene.LinearScale(); radiusScale.domain = [0, 10]; radiusScale.range = [radius, innerRadius]; const markers2 = []; const center = size / 2; const paths = data.map((series) => { const path = new _Scene.Path(); path.strokeWidth = 1; path.strokeOpacity = 0.5; path.lineCap = "round"; path.fill = void 0; path.fillOpacity = 0.8; series.forEach((datum, i) => { const angle = angleScale.convert(i); const r = radius + innerRadius - radiusScale.convert(datum); const x = r * Math.cos(angle) + center; const y = r * Math.sin(angle) + center; path.path[i > 0 ? "lineTo" : "moveTo"](x, y); if (markerSize > 0) { const marker = new _Scene.Marker({ shape: "circle" }); marker.x = x; marker.y = y; marker.size = markerSize; markers2.push(marker); } }); path.path.closePath(); return path; }); const group = new _Scene.Group(); group.append([...paths, ...markers2]); root.append(group); return { paths, markers: markers2 }; } function accumulateData(data) { let [min, max] = [Infinity, -Infinity]; const processedData = data.reduce((acc, curr, currIndex) => { const previous = currIndex > 0 ? acc[currIndex - 1] : void 0; acc[currIndex] ?? (acc[currIndex] = []); const current = acc[currIndex]; curr.forEach((datum, datumIndex) => { if (previous) { datum += previous[datumIndex]; } current[datumIndex] = datum; if (current[datumIndex] < min) { min = current[datumIndex]; } if (current[datumIndex] > max) { max = current[datumIndex]; } }); return acc; }, []); return { processedData, min, max }; } // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/funnel/miniFunnel.ts var FUNNEL_SHAPES = [ [ [13, 16], [13, 12], [3, 12], [3, 16] ], [ [12, 11], [12, 7], [4, 7], [4, 11] ], [ [10.125, 6], [10.125, 1.5], [5.875, 1.5], [5.875, 6] ] ]; var MiniFunnelClass = class extends MiniChart { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, tooltipName = "funnelTooltip", data = FUNNEL_SHAPES) { super(container, agChartsExports, tooltipName); this.shapes = createShapePaths(agChartsExports, this.root, data, this.size, this.padding); this.updateColors(fills, strokes); } updateColors(fills, strokes) { for (const bar of this.shapes) { bar.fill = fills[0]; bar.stroke = strokes[0]; bar.strokeWidth = 0; } } }; var MiniFunnel = { chartType: "funnel", miniChart: MiniFunnelClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/funnel/miniConeFunnel.ts var CONE_FUNNEL_SHAPES = [ [ [13, 16], [10.75, 11.5], [5.25, 11.5], [3, 16] ], [ [10.75, 11.5], [8.875, 6], [7.125, 6], [5.25, 11.5] ], [ [8.875, 6], [8.875, 1.5], [7.125, 1.5], [7.125, 6] ] ]; var MiniConeFunnelClass = class extends MiniFunnelClass { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, tooltipName = "coneFunnelTooltip") { super(container, agChartsExports, fills, strokes, _isCustomTheme, tooltipName, CONE_FUNNEL_SHAPES); } updateColors(fills, strokes) { this.shapes.forEach((bar, i) => { bar.fill = fills[0]; bar.fillOpacity = 1 - i * 0.2; bar.stroke = strokes[0]; bar.strokeWidth = 0; }); } }; var MiniConeFunnel = { chartType: "coneFunnel", miniChart: MiniConeFunnelClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/funnel/miniPyramid.ts var PYRAMID_SHAPES = [ [ [8, 16], [10, 12], [6, 12] ], [ [10.5, 11], [12.5, 7], [3.5, 7], [5.5, 11] ], [ [13, 6], [15.5, 1.5], [0.5, 1.5], [3, 6] ] ]; var MiniPyramidClass = class extends MiniFunnelClass { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, tooltipName = "pyramidTooltip") { super(container, agChartsExports, fills, strokes, _isCustomTheme, tooltipName, PYRAMID_SHAPES); } updateColors(fills, strokes) { this.shapes.forEach((bar, i) => { bar.fill = fills[i]; bar.stroke = strokes[i]; bar.strokeWidth = 0; }); } }; var MiniPyramid = { chartType: "pyramid", miniChart: MiniPyramidClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/miniChartWithAxes.ts var MiniChartWithAxes = class extends MiniChart { constructor(container, agChartsExports, tooltipName) { super(container, agChartsExports, tooltipName); this.stroke = "gray"; this.axisOvershoot = 3; } postConstruct() { const { _Scene } = this.agChartsExports; const size = this.size; const padding = this.padding; const leftAxis = new _Scene.Line(); leftAxis.x1 = padding; leftAxis.y1 = padding; leftAxis.x2 = padding; leftAxis.y2 = size - padding + this.axisOvershoot; leftAxis.stroke = this.stroke; const bottomAxis = new _Scene.Line(); bottomAxis.x1 = padding - this.axisOvershoot + 1; bottomAxis.y1 = size - padding; bottomAxis.x2 = size - padding + 1; bottomAxis.y2 = size - padding; bottomAxis.stroke = this.stroke; const root = this.root; root.append(leftAxis); root.append(bottomAxis); super.postConstruct(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/column/miniColumn.ts var MiniColumnClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "groupedColumnTooltip"); this.columnData = [2, 3, 4]; const { root, columnData, size, padding } = this; this.columns = createColumnRects({ stacked: false, root, data: columnData, size, padding, xScaleDomain: [0, 1, 2], yScaleDomain: [0, 4], xScalePadding: 0.3, agChartsExports }); root.append(this.columns); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.columns.forEach((column, i) => { column.fill = fills[i]; column.stroke = strokes[i]; }); } }; var MiniColumn = { chartType: "groupedColumn", miniChart: MiniColumnClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/column/miniStackedColumn.ts var miniStackedColumnData = [ [8, 12, 16], [6, 9, 12], [2, 3, 4] ]; var MiniStackedColumnClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniStackedColumnData, yScaleDomain = [0, 16], tooltipName = "stackedColumnTooltip") { super(container, agChartsExports, tooltipName); const { root, size, padding } = this; this.stackedColumns = createColumnRects({ stacked: true, root, data, size, padding, xScaleDomain: [0, 1, 2], yScaleDomain, xScalePadding: 0.3, agChartsExports }); root.append(_flatten(this.stackedColumns)); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.stackedColumns.forEach((series, i) => { for (const column of series) { column.fill = fills[i]; column.stroke = strokes[i]; } }); } }; var MiniStackedColumn = { chartType: "stackedColumn", miniChart: MiniStackedColumnClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/column/miniNormalizedColumn.ts var miniNormalizedColumnData = [ [10, 10, 10], [6, 7, 8], [2, 4, 6] ]; var MiniNormalizedColumnClass = class extends MiniStackedColumnClass { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super( container, agChartsExports, fills, strokes, isCustomTheme, miniNormalizedColumnData, [0, 10], "normalizedColumnTooltip" ); } }; var MiniNormalizedColumn = { chartType: "normalizedColumn", miniChart: MiniNormalizedColumnClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/bar/miniBar.ts var MiniBarClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "groupedBarTooltip"); const { _Scene } = agChartsExports; const padding = this.padding; const size = this.size; const data = [2, 3, 4]; const yScale = new _Scene.CategoryScale(); yScale.domain = [0, 1, 2]; yScale.range = [padding, size - padding]; yScale.paddingInner = 0.3; yScale.paddingOuter = 0.3; const xScale = new _Scene.LinearScale(); xScale.domain = [0, 4]; xScale.range = [size - padding, padding]; const bottom = xScale.convert(0); const height = yScale.bandwidth; this.bars = data.map((datum, i) => { const rect = new _Scene.Rect(); rect.x = padding; rect.y = yScale.convert(i); rect.width = bottom - xScale.convert(datum); rect.height = height; rect.strokeWidth = 0; rect.crisp = true; return rect; }); this.updateColors(fills, strokes); this.root.append(this.bars); } updateColors(fills, strokes) { this.bars.forEach((bar, i) => { bar.fill = fills[i]; bar.stroke = strokes[i]; }); } }; var MiniBar = { chartType: "groupedBar", miniChart: MiniBarClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/bar/miniStackedBar.ts var miniStackedBarData = [ [8, 12, 16], [6, 9, 12], [2, 3, 4] ]; var MiniStackedBarClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniStackedBarData, xScaleDomain = [0, 16], tooltipName = "stackedBarTooltip") { super(container, agChartsExports, tooltipName); const { _Scene } = agChartsExports; const size = this.size; const padding = this.padding; const yScale = new _Scene.CategoryScale(); yScale.domain = [0, 1, 2]; yScale.range = [padding, size - padding]; yScale.paddingInner = 0.3; yScale.paddingOuter = 0.3; const xScale = new _Scene.LinearScale(); xScale.domain = xScaleDomain; xScale.range = [size - padding, padding]; const bottom = xScale.convert(0); const height = yScale.bandwidth; this.bars = data.map( (series) => series.map((datum, i) => { const rect = new _Scene.Rect(); rect.x = padding; rect.y = yScale.convert(i); rect.width = bottom - xScale.convert(datum); rect.height = height; rect.strokeWidth = 0; rect.crisp = true; return rect; }) ); this.updateColors(fills, strokes); this.root.append(_flatten(this.bars)); } updateColors(fills, strokes) { this.bars.forEach( (series, i) => series.forEach((bar) => { bar.fill = fills[i]; bar.stroke = strokes[i]; }) ); } }; var MiniStackedBar = { chartType: "stackedBar", miniChart: MiniStackedBarClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/bar/miniNormalizedBar.ts var miniNormalizedBarData = [ [10, 10, 10], [6, 7, 8], [2, 4, 6] ]; var MiniNormalizedBarClass = class extends MiniStackedBarClass { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super( container, agChartsExports, fills, strokes, isCustomTheme, miniNormalizedBarData, [0, 10], "normalizedBarTooltip" ); } }; var MiniNormalizedBar = { chartType: "normalizedBar", miniChart: MiniNormalizedBarClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/pie/miniDonut.ts var MiniDonutClass = class extends MiniChart { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, centerRadiusScaler = 0.6, tooltipName = "donutTooltip") { super(container, agChartsExports, tooltipName); const { size, padding, agChartsExports: { _Scene } } = this; const radius = (size - padding * 2) / 2; const center = radius + padding; const toRadians = _Scene.toRadians; const angles = [ [toRadians(-90), toRadians(30)], [toRadians(30), toRadians(120)], [toRadians(120), toRadians(180)], [toRadians(180), toRadians(210)], [toRadians(210), toRadians(240)], [toRadians(240), toRadians(270)] ]; this.sectors = angles.map(([startAngle, endAngle]) => { const sector = new _Scene.Sector(); sector.centerX = center; sector.centerY = center; sector.innerRadius = radius * centerRadiusScaler; sector.outerRadius = radius; sector.startAngle = startAngle; sector.endAngle = endAngle; sector.stroke = void 0; sector.strokeWidth = 0; sector.inset = 0.75; return sector; }); this.updateColors(fills, strokes); this.root.append(this.sectors); } updateColors(fills, strokes) { this.sectors.forEach((sector, i) => { sector.fill = fills[i % fills.length]; sector.stroke = strokes[i % strokes.length]; }); } }; var MiniDonut = { chartType: "donut", miniChart: MiniDonutClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/pie/miniPie.ts var MiniPieClass = class extends MiniDonutClass { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super(container, agChartsExports, fills, strokes, isCustomTheme, 0, "pieTooltip"); } }; var MiniPie = { chartType: "pie", miniChart: MiniPieClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/line/miniLine.ts var miniLineData = [ [1, 3, 5], [2, 6, 4], [5, 3, 1] ]; var MiniLineClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniLineData, tooltipName = "lineTooltip") { super(container, agChartsExports, tooltipName); const { size, padding, root } = this; this.lines = createLinePaths(agChartsExports, root, data, size, padding); this.updateColors(fills, strokes); } updateColors(fills, _strokes) { this.lines.forEach((line, i) => { line.stroke = fills[i]; }); } }; var MiniLine = { chartType: "line", miniChart: MiniLineClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/line/miniStackedLine.ts var miniStackedLineData = stackData(miniLineData); var MiniStackedLineClass = class extends MiniLineClass { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniStackedLineData, tooltipName = "stackedLineTooltip") { super(container, agChartsExports, fills, strokes, _isCustomTheme, data, tooltipName); } }; var MiniStackedLine = { chartType: "stackedLine", miniChart: MiniStackedLineClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/line/miniNormalizedLine.ts var miniNormalizedLineData = normalizeStackData(miniStackedLineData); var MiniNormalizedLineClass = class extends MiniLineClass { constructor(container, agChartsExports, fills, strokes, isCustomTheme, data = miniNormalizedLineData, tooltipName = "normalizedLineTooltip") { super(container, agChartsExports, fills, strokes, isCustomTheme, data, tooltipName); } }; var MiniNormalizedLine = { chartType: "normalizedLine", miniChart: MiniNormalizedLineClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/scatter/miniScatter.ts var MiniScatterClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "scatterTooltip"); const { size, padding, agChartsExports: { _Scene } } = this; const data = [ [ [0.3, 3], [1.1, 0.9], [2, 0.4], [3.4, 2.4] ], [ [0, 0.3], [1, 2], [2.4, 1.4], [3, 0] ] ]; const xScale = new _Scene.LinearScale(); xScale.domain = [-0.5, 4]; xScale.range = [padding * 2, size - padding]; const yScale = new _Scene.LinearScale(); yScale.domain = [-0.5, 3.5]; yScale.range = [size - padding, padding]; const points = []; data.forEach((series) => { series.forEach(([x, y]) => { const arc = new _Scene.Arc(); arc.strokeWidth = 0; arc.centerX = xScale.convert(x); arc.centerY = yScale.convert(y); arc.radius = 2.5; points.push(arc); }); }); this.points = points; this.updateColors(fills, strokes); const pointsGroup = new _Scene.Group(); pointsGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); pointsGroup.append(this.points); this.root.append(pointsGroup); } updateColors(fills, strokes) { this.points.forEach((line, i) => { line.stroke = strokes[i % strokes.length]; line.fill = fills[i % fills.length]; }); } }; var MiniScatter = { chartType: "scatter", miniChart: MiniScatterClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/scatter/miniBubble.ts var MiniBubbleClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "bubbleTooltip"); const { size, padding, agChartsExports: { _Scene } } = this; const data = [ [ [0.1, 0.3, 5], [0.5, 0.4, 7], [0.2, 0.8, 7] ], [ [0.8, 0.7, 5], [0.7, 0.3, 9] ] ]; const xScale = new _Scene.LinearScale(); xScale.domain = [0, 1]; xScale.range = [padding * 2, size - padding]; const yScale = new _Scene.LinearScale(); yScale.domain = [0, 1]; yScale.range = [size - padding, padding]; const points = []; data.forEach((series) => { series.forEach(([x, y, radius]) => { const arc = new _Scene.Arc(); arc.strokeWidth = 0; arc.centerX = xScale.convert(x); arc.centerY = yScale.convert(y); arc.radius = radius; arc.fillOpacity = 0.7; points.push(arc); }); }); this.points = points; this.updateColors(fills, strokes); const pointsGroup = new _Scene.Group(); pointsGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); pointsGroup.append(this.points); this.root.append(pointsGroup); } updateColors(fills, strokes) { this.points.forEach((line, i) => { line.stroke = strokes[i % strokes.length]; line.fill = fills[i % fills.length]; }); } }; var MiniBubble = { chartType: "bubble", miniChart: MiniBubbleClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/area/miniArea.ts var miniAreaData = miniLineData; var MiniAreaClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniAreaData, tooltipName = "groupedAreaTooltip", stacked = false) { super(container, agChartsExports, tooltipName); this.areas = createAreaPaths(agChartsExports._Scene, this.root, data, this.size, this.padding, stacked); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.areas.forEach((area, i) => { area.fill = fills[i]; area.stroke = strokes[i]; area.strokeWidth = 1; area.strokeOpacity = 0.75; area.fillOpacity = 0.7; }); } }; var MiniArea = { chartType: "area", miniChart: MiniAreaClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/area/miniStackedArea.ts var miniStackedAreaData = stackData(miniAreaData); var MiniStackedAreaClass = class extends MiniAreaClass { constructor(container, agChartsExports, fills, strokes, _isCustomTheme, data = miniStackedAreaData, tooltipName = "stackedAreaTooltip") { super(container, agChartsExports, fills, strokes, _isCustomTheme, data, tooltipName, true); } updateColors(fills, strokes) { this.areas.forEach((area, i) => { area.fill = fills[i]; area.stroke = strokes[i]; }); } }; var MiniStackedArea = { chartType: "stackedArea", miniChart: MiniStackedAreaClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/area/miniNormalizedArea.ts var miniNormalizedAreaData = normalizeStackData(miniStackedAreaData); var MiniNormalizedAreaClass = class extends MiniStackedAreaClass { constructor(container, agChartsExports, fills, strokes, isCustomTheme, data = miniNormalizedAreaData, tooltipName = "normalizedAreaTooltip") { super(container, agChartsExports, fills, strokes, isCustomTheme, data, tooltipName); } }; var MiniNormalizedArea = { chartType: "normalizedArea", miniChart: MiniNormalizedAreaClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/histogram/miniHistogram.ts var MiniHistogramClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "histogramTooltip"); const { padding, size, agChartsExports: { _Scene } } = this; const data = [2, 5, 11, 13, 10, 6, 1]; const xScale = new _Scene.LinearScale(); xScale.domain = [0, data.length]; xScale.range = [padding, size - padding]; const yScale = new _Scene.LinearScale(); yScale.domain = [0, data.reduce((a, b) => Math.max(a, b), 0)]; yScale.range = [size - padding, padding]; const bottom = yScale.convert(0); this.bars = data.map((datum, i) => { const top = yScale.convert(datum); const left = xScale.convert(i); const right = xScale.convert(i + 1); const rect = new _Scene.Rect(); rect.x = left; rect.y = top; rect.width = right - left; rect.height = bottom - top; rect.strokeWidth = 1; rect.strokeOpacity = 0.75; rect.crisp = true; return rect; }); this.updateColors(fills, strokes); this.root.append(this.bars); } updateColors([fill], [stroke]) { for (const bar of this.bars) { bar.fill = fill; bar.stroke = stroke; } } }; var MiniHistogram = { chartType: "histogram", miniChart: MiniHistogramClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/miniChartWithPolarAxes.ts var MiniChartWithPolarAxes = class extends MiniChart { constructor(container, agChartsExports, tooltipName) { super(container, agChartsExports, tooltipName); this.stroke = "gray"; this.showRadiusAxisLine = true; this.showAngleAxisLines = true; } postConstruct() { const { _Scene } = this.agChartsExports; const size = this.size; const padding = this.padding; const combinedPadding = padding * 2; const axisLineRadius = (size - combinedPadding) / 2; const gridRadii = this.showAngleAxisLines ? [axisLineRadius, axisLineRadius * 0.8, axisLineRadius * 0.6, axisLineRadius * 0.4] : []; const radiusAxisLine = new _Scene.Line(); radiusAxisLine.x1 = size / 2; radiusAxisLine.y1 = padding; radiusAxisLine.x2 = size / 2; radiusAxisLine.y2 = size - padding - axisLineRadius - gridRadii[gridRadii.length - 1]; radiusAxisLine.stroke = this.stroke; radiusAxisLine.strokeOpacity = 0.5; radiusAxisLine.fill = void 0; radiusAxisLine.visible = this.showRadiusAxisLine; const x = padding + axisLineRadius; this.gridLines = gridRadii.map((radius, index) => { const gridLine = new _Scene.Path(); gridLine.path.arc(x, x, radius, 0, 2 * Math.PI); gridLine.strokeWidth = 1; gridLine.stroke = this.stroke; gridLine.strokeOpacity = index === 0 ? 0.5 : 0.2; gridLine.fill = void 0; return gridLine; }); const root = this.root; root.append(radiusAxisLine); if (this.gridLines.length > 0) { root.append(this.gridLines); } super.postConstruct(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/polar/miniRadialColumn.ts var MiniRadialColumnClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "radialColumnTooltip"); this.data = [ [6, 8, 10, 2, 6, 5], [4, 4, 3, 6, 4, 4], [5, 4, 2, 9, 8, 9] ]; this.showRadiusAxisLine = false; const { padding, size, data, agChartsExports: { _Scene } } = this; const radius = (size - padding * 2) / 2; const innerRadiusRatio = 0.4; const axisInnerRadius = radius * innerRadiusRatio; const angleScale = new _Scene.CategoryScale(); angleScale.domain = data[0].map((_, index) => index); angleScale.range = [0, 2 * Math.PI]; angleScale.paddingInner = 0; angleScale.paddingOuter = 0; const bandwidth = angleScale.bandwidth * 0.7; const { processedData, max } = accumulateData(data); const radiusScale = new _Scene.LinearScale(); radiusScale.domain = [0, max]; radiusScale.range = [axisInnerRadius, radius]; const center = this.size / 2; this.series = processedData.map((series, seriesIndex) => { const firstSeries = seriesIndex === 0; const previousSeries = firstSeries ? void 0 : processedData[seriesIndex - 1]; const seriesGroup = new _Scene.TranslatableGroup({ zIndex: 1e6 }); const seriesColumns = series.map((datum, i) => { const previousDatum = previousSeries?.[i]; const outerRadius = radiusScale.convert(datum); const innerRadius = radiusScale.convert(previousDatum ?? 0); const startAngle = angleScale.convert(i); const endAngle = startAngle + bandwidth; const columnWidth = _Scene.getRadialColumnWidth(startAngle, endAngle, radius, 0.5, 0.5); const column = new _Scene.RadialColumnShape(); column.columnWidth = columnWidth; column.innerRadius = innerRadius; column.outerRadius = outerRadius; column.startAngle = startAngle; column.endAngle = endAngle; column.isBeveled = true; column.axisInnerRadius = axisInnerRadius; column.axisOuterRadius = radius; column.stroke = void 0; column.strokeWidth = 0; return column; }); seriesGroup.append(seriesColumns); seriesGroup.translationX = center; seriesGroup.translationY = center; return seriesGroup; }); this.root.append(this.series); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.series.forEach((group, i) => { for (const sector of group.children()) { sector.fill = fills[i % fills.length]; sector.stroke = strokes[i % strokes.length]; } }); } }; var MiniRadialColumn = { chartType: "radialColumn", miniChart: MiniRadialColumnClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/polar/miniRadialBar.ts var MiniRadialBarClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "radialBarTooltip"); this.data = [ [6, 8, 10], [4, 4, 3], [5, 4, 2] ]; this.showRadiusAxisLine = false; const { size, padding, data, agChartsExports: { _Scene } } = this; const radius = (size - padding) / 2; const innerRadiusRatio = 0.4; const innerRadius = radius * innerRadiusRatio; const radiusScale = new _Scene.CategoryScale(); radiusScale.domain = data[0].map((_, index) => index); radiusScale.range = [innerRadius, radius]; radiusScale.paddingInner = 0.5; radiusScale.paddingOuter = 0; const bandwidth = radiusScale.bandwidth; const { processedData, max } = accumulateData(data); const angleScale = new _Scene.LinearScale(); angleScale.domain = [0, Math.ceil(max * 1.5)]; const start = 3 / 2 * Math.PI; const end = start + 2 * Math.PI; angleScale.range = [start, end]; const center = size / 2; this.series = processedData.map((series, index) => { const previousSeries = index < 0 ? void 0 : processedData[index - 1]; const seriesGroup = new _Scene.Group({ zIndex: 1e6 }); const seriesSectors = series.map((datum, i) => { const previousDatum = previousSeries?.[i] ?? 0; const outerRadius = radiusScale.convert(i); const innerRadius2 = outerRadius - bandwidth; const startAngle = angleScale.convert(previousDatum); const endAngle = angleScale.convert(datum); const sector = new _Scene.Sector(); sector.centerX = center; sector.centerY = center; sector.innerRadius = innerRadius2; sector.outerRadius = outerRadius; sector.startAngle = startAngle; sector.endAngle = endAngle; sector.stroke = void 0; sector.strokeWidth = 0; return sector; }); seriesGroup.append(seriesSectors); return seriesGroup; }); this.root.append(this.series); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.series.forEach((group, i) => { for (const sector of group.children()) { sector.fill = fills[i % fills.length]; sector.stroke = strokes[i % strokes.length]; } }); } }; var MiniRadialBar = { chartType: "radialBar", miniChart: MiniRadialBarClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/polar/miniRadarLine.ts var MiniRadarLineClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "radarLineTooltip"); this.markerSize = 4; this.data = [ [8, 7, 8, 7, 8, 8, 7, 8], [6, 8, 5, 10, 6, 7, 4, 6], [0, 3, 3, 5, 4, 4, 2, 0] ]; this.showRadiusAxisLine = false; const { size, padding, root, data } = this; const radius = (size - padding * 2) / 2; const innerRadius = 0; const { paths, markers: markers2 } = createPolarPaths( agChartsExports, root, data, size, radius, innerRadius, this.markerSize ); this.lines = paths; this.markers = markers2; this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.lines.forEach((line, i) => { const n = this.data[i].length; line.stroke = fills[i]; const startIdx = i * n; const endIdx = startIdx + n; const markers2 = this.markers.slice(startIdx, endIdx); for (const marker of markers2) { marker.stroke = strokes[i]; marker.fill = fills[i]; } }); } }; var MiniRadarLine = { chartType: "radarLine", miniChart: MiniRadarLineClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/polar/miniRadarArea.ts var MiniRadarAreaClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "radarAreaTooltip"); this.data = [ [8, 10, 5, 7, 4, 1, 5, 8], [1, 1, 2, 7, 7, 8, 10, 1], [4, 5, 9, 9, 4, 2, 3, 4] ]; const { size, padding, root, data } = this; this.showRadiusAxisLine = false; const radius = (size - padding * 2) / 2; const innerRadius = radius - size * 0.3; this.areas = createPolarPaths(agChartsExports, root, data, size, radius, innerRadius).paths; this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.areas.forEach((area, i) => { area.fill = fills[i]; area.stroke = strokes[i]; }); } }; var MiniRadarArea = { chartType: "radarArea", miniChart: MiniRadarAreaClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/polar/miniNightingale.ts var MiniNightingaleClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "nightingaleTooltip"); this.data = [ [6, 10, 9, 8, 7, 8], [4, 6, 5, 4, 5, 5], [3, 5, 4, 3, 4, 7] ]; this.showRadiusAxisLine = false; const { size, padding, data, agChartsExports: { _Scene } } = this; const radius = (size - padding * 2) / 2; const angleScale = new _Scene.CategoryScale(); angleScale.domain = data[0].map((_, index) => index); angleScale.range = [-Math.PI, Math.PI]; angleScale.paddingInner = 0; angleScale.paddingOuter = 0; const bandwidth = angleScale.bandwidth * 0.7; const { processedData, max } = accumulateData(data); const radiusScale = new _Scene.LinearScale(); radiusScale.domain = [0, max]; radiusScale.range = [0, radius]; const center = size / 2; this.series = processedData.map((series, index) => { const previousSeries = index < 0 ? void 0 : processedData[index - 1]; const seriesGroup = new _Scene.Group({ zIndex: 1e6 }); const seriesSectors = series.map((datum, i) => { const previousDatum = previousSeries?.[i]; const outerRadius = radiusScale.convert(datum); const innerRadius = radiusScale.convert(previousDatum ?? 0); const startAngle = angleScale.convert(i); const endAngle = startAngle + bandwidth; const sector = new _Scene.Sector(); sector.centerX = center; sector.centerY = center; sector.innerRadius = innerRadius; sector.outerRadius = outerRadius; sector.startAngle = startAngle; sector.endAngle = endAngle; sector.stroke = void 0; sector.strokeWidth = 0; return sector; }); seriesGroup.append(seriesSectors); return seriesGroup; }); this.root.append(this.series); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.series.forEach((group, i) => { for (const sector of group.children()) { sector.fill = fills[i % fills.length]; sector.stroke = strokes[i % strokes.length]; } }); } }; var MiniNightingale = { chartType: "nightingale", miniChart: MiniNightingaleClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/statistical/miniRangeBar.ts var MiniRangeBarClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "rangeBarTooltip"); const data = [3, 3.5, 3]; this.bars = this.createRangeBar(this.root, data, this.size, this.padding, "vertical"); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.bars.forEach((bar, i) => { bar.fill = fills[i]; bar.stroke = strokes[i]; }); } createRangeBar(root, data, size, padding, direction) { const barAlongX = direction === "horizontal"; const scalePadding = 2 * padding; const { _Scene } = this.agChartsExports; const xScale = new _Scene.CategoryScale(); xScale.domain = data.map((_, index) => index); xScale.range = [padding, size - padding]; xScale.paddingInner = 0.3; xScale.paddingOuter = 0.3; const lowRatio = 0.7; const highRatio = 1.3; const yScale = new _Scene.LinearScale(); yScale.domain = [ data.reduce((a, b) => Math.min(a, b), Infinity) * lowRatio, data.reduce((a, b) => Math.max(a, b), 0) * highRatio ]; yScale.range = [scalePadding, size - scalePadding]; const width = xScale.bandwidth; const bars = data.map((datum, i) => { const [low, high] = [datum * lowRatio, datum * highRatio]; const x = xScale.convert(i); const y = yScale.convert(low); const height = yScale.convert(high) - y; const rect = new _Scene.Rect(); rect.x = barAlongX ? y : x; rect.y = barAlongX ? x : y; rect.width = barAlongX ? height : width; rect.height = barAlongX ? width : height; rect.strokeWidth = 0; rect.crisp = true; return rect; }); root.append(bars); return bars; } }; var MiniRangeBar = { chartType: "rangeBar", miniChart: MiniRangeBarClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/statistical/miniRangeArea.ts var MiniRangeAreaClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "rangeAreaTooltip"); const period = 4; const dataSeriesMidpoints = [ zigzag({ offset: 0.375 * period, length: period, pattern: { low: 3, high: 5, period } }), zigzag({ offset: 0.375 * period, length: period, pattern: { low: 2.25, high: 4.25, period } }), zigzag({ offset: 0.75 * period, length: period, pattern: { low: 2.5, high: 4.5, period } }) ]; const dataSeriesWidth = 1.75; const data = dataSeriesMidpoints.map( (series) => series.map(([x, y]) => ({ x, low: y - 0.5 * dataSeriesWidth, high: y + 0.5 * dataSeriesWidth })) ); const { lines, areas } = this.createRangeArea(this.root, data, this.size, this.padding); this.lines = lines; this.areas = areas; this.updateColors(fills, strokes); } updateColors(fills, strokes) { fills = swapArrayItems(fills, 1, 2); strokes = swapArrayItems(strokes, 1, 2); this.lines.forEach(([highLine, lowLine], i) => { highLine.fill = void 0; highLine.stroke = strokes[i]; lowLine.fill = void 0; lowLine.stroke = strokes[i]; }); this.areas.forEach((area, i) => { area.fill = fills[i]; }); } createRangeArea(root, data, size, padding) { const xMin = data.reduce((acc, series) => series.reduce((acc2, { x }) => Math.min(acc2, x), acc), Infinity); const xMax = data.reduce((acc, series) => series.reduce((acc2, { x }) => Math.max(acc2, x), acc), -Infinity); const yMin = data.reduce((acc, series) => series.reduce((acc2, { low }) => Math.min(acc2, low), acc), Infinity); const yMax = data.reduce( (acc, series) => series.reduce((acc2, { high }) => Math.max(acc2, high), acc), -Infinity ); const { _Scene } = this.agChartsExports; const xScale = new _Scene.LinearScale(); xScale.domain = [xMin, xMax]; xScale.range = [padding, size - padding]; const scalePadding = 2 * padding; const yScale = new _Scene.LinearScale(); yScale.domain = [yMin, yMax]; yScale.range = [size - scalePadding, scalePadding]; const lines = []; const areas = []; const lowPoints = data.map((series) => { const highLine = new _Scene.Path(); const lowLine = new _Scene.Path(); const area = new _Scene.Path(); lines.push([highLine, lowLine]); areas.push(area); highLine.strokeWidth = 0; lowLine.strokeWidth = 0; area.strokeWidth = 0; area.fillOpacity = 0.8; highLine.path.clear(); lowLine.path.clear(); area.path.clear(); return series.map((datum, datumIndex) => { const { x, low, high } = datum; const scaledX = xScale.convert(x); const yLow = yScale.convert(low); const yHigh = yScale.convert(high); const command = datumIndex > 0 ? "lineTo" : "moveTo"; highLine.path[command](scaledX, yHigh); lowLine.path[command](scaledX, yLow); area.path[command](scaledX, yHigh); return [scaledX, yLow]; }); }); lowPoints.forEach((seriesLowPoints, seriesIndex) => { const n = seriesLowPoints.length - 1; const area = areas[seriesIndex]; for (let datumIndex = n; datumIndex >= 0; datumIndex--) { const [x, y] = seriesLowPoints[datumIndex]; area.path["lineTo"](x, y); } }); root.append(areas.concat(...lines)); return { lines, areas }; } }; function zigzag(options) { const { offset, length, pattern } = options; const points = getZigzagInflectionPoints(offset, length, pattern); const xMin = 0; const xMax = length; if (points.length === 0 || points[0][0] !== xMin) { points.unshift(getZigzagPoint(xMin, offset, pattern)); } if (points[points.length - 1][0] !== xMax) { points.push(getZigzagPoint(xMax, offset, pattern)); } return points; function getZigzagInflectionPoints(offset2, length2, pattern2) { const { period } = pattern2; const scaledOffset = offset2 / period; const patternInflectionPoints = [0, 0.5]; const inflectionPoints = patternInflectionPoints.map((x) => x - scaledOffset).map(getRemainderAbs).sort((a, b) => a - b); const repeatedPoints = Array.from( { length: Math.floor(inflectionPoints.length * (period / length2)) }, (_, i) => inflectionPoints[i % inflectionPoints.length] + Math.floor(i / inflectionPoints.length) ); return repeatedPoints.map((x) => x * period).map((x) => getZigzagPoint(x, offset2, pattern2)); } function getZigzagPoint(x, offset2, pattern2) { return [x, getZigzagValue(offset2 + x, pattern2)]; } function getZigzagValue(x, pattern2) { const { low, high, period } = pattern2; const scaledX = getRemainderAbs(x / period); const y = scaledX > 0.5 ? 1 - 2 * (scaledX - 0.5) : 2 * scaledX; return low + (high - low) * y; } } function getRemainderAbs(value) { const remainder = value % 1; return remainder < 0 ? remainder + 1 : remainder; } function swapArrayItems(items, leftIndex, rightIndex) { const results = [...items]; const temp = results[leftIndex]; results[leftIndex] = results[rightIndex]; results[rightIndex] = temp; return results; } var MiniRangeArea = { chartType: "rangeArea", miniChart: MiniRangeAreaClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/statistical/miniBoxPlot.ts var MiniBoxPlotClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super(container, agChartsExports, "boxPlotTooltip"); const { size, padding, agChartsExports: { _Scene } } = this; const data = [11, 11.5, 10.5]; const maxRatio = 1.2; const q3Ratio = 1.1; const q1Ratio = 0.9; const minRatio = 0.8; const yScale = new _Scene.LinearScale(); yScale.domain = [ data.reduce((a, b) => Math.min(a, b), Infinity) * minRatio, data.reduce((a, b) => Math.max(a, b), 0) * maxRatio ]; yScale.range = [size - 1.5 * padding, padding]; const xScale = new _Scene.CategoryScale(); xScale.domain = data.map((_, index) => index); xScale.range = [padding, size - padding]; xScale.paddingInner = 0.4; xScale.paddingOuter = 0.2; const bandwidth = Math.round(xScale.bandwidth); const halfBandWidth = Math.round(xScale.bandwidth / 2); this.boxPlotGroups = data.map((datum, i) => { const [minValue, q1Value, q3Value, maxValue] = [ datum * minRatio, datum * q1Ratio, datum * q3Ratio, datum * maxRatio ]; const top = Math.round(yScale.convert(q3Value)); const left = Math.round(xScale.convert(i)); const right = Math.round(left + bandwidth); const bottom = Math.round(yScale.convert(q1Value)); const min = Math.round(yScale.convert(minValue)); const mid = Math.round(yScale.convert(datum)); const max = Math.round(yScale.convert(maxValue)); const whiskerX = left + halfBandWidth; const boxPlotGroup = new _Scene.Group(); const box = new _Scene.Rect(); const median = new _Scene.Line(); const topWhisker = new _Scene.Line(); const bottomWhisker = new _Scene.Line(); const topCap = new _Scene.Line(); const bottomCap = new _Scene.Line(); box.x = left; box.y = top; box.width = bandwidth; box.height = bottom - top; box.strokeWidth = 1; box.strokeOpacity = 0.75; box.crisp = true; this.setLineProperties(median, left, right, mid, mid); this.setLineProperties(topWhisker, whiskerX, whiskerX, max, top); this.setLineProperties(bottomWhisker, whiskerX, whiskerX, min, bottom); this.setLineProperties(topCap, left, right, max, max); this.setLineProperties(bottomCap, left, right, min, min); boxPlotGroup.append([box, median, topWhisker, bottomWhisker, topCap, bottomCap]); return boxPlotGroup; }); this.updateColors(fills, strokes, isCustomTheme); this.root.append(this.boxPlotGroups); } updateColors(fills, strokes, isCustomTheme) { const { _Theme } = this.agChartsExports; this.boxPlotGroups.forEach((group, i) => { for (const node of group.children()) { const fill = fills[i % fills.length]; node.fill = isCustomTheme ? fill : _Theme.resolveOperation({ $mix: [fill, { $ref: "backgroundColor" }, 0.7] }); node.stroke = strokes[i % strokes.length]; } }); } setLineProperties(line, x1, x2, y1, y2) { line.x1 = x1; line.x2 = x2; line.y1 = y1; line.y2 = y2; line.strokeOpacity = 0.75; } }; var MiniBoxPlot = { chartType: "boxPlot", miniChart: MiniBoxPlotClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/hierarchical/miniTreemap.ts var MiniTreemapClass = class extends MiniChart { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super(container, agChartsExports, "treemapTooltip"); const { size, padding, agChartsExports: { _Scene } } = this; const data = [ [1, 1], [3, 2, 1] ]; const treeSize = data.length; const treePadding = treeSize % 2 === 0 ? 0.3 : 0.2; const range = [padding, size - padding]; const columns = data.length; const columnParts = columns * (columns + 1) / 2; const columnPadding = treePadding / (columns - 1); const availableRange = range[1] - range[0]; const availableWidth = availableRange - treePadding; let previousX = range[0]; this.rects = data.reduce((rects, d, columnIndex) => { rects ?? (rects = []); const widthRatio = (columns - columnIndex) / columnParts; const width = availableWidth * widthRatio; const rows = d.length; const rowParts = d.reduce((parts, ratio) => parts + ratio, 0); const rowPadding = treePadding / (rows - 1 || 1); const availableHeight = rows > 1 ? availableRange - treePadding : availableRange; let previousY = range[0]; const xRects = d.map((ratio) => { const rect = new _Scene.Rect(); const height = availableHeight * ratio / rowParts; rect.x = previousX; rect.y = previousY; rect.width = width; rect.height = height; rect.strokeWidth = 0.75; rect.crisp = true; previousY += height + rowPadding; return rect; }); previousX += width + columnPadding; rects.push(...xRects); return rects; }, []); this.updateColors(fills, strokes, isCustomTheme); const rectGroup = new _Scene.Group(); rectGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding, size - padding)); rectGroup.append(this.rects); this.root.append(rectGroup); } updateColors(fills, strokes, isCustomTheme) { const { _Theme } = this.agChartsExports; this.rects.forEach((rect, i) => { rect.fill = fills[i % strokes.length]; rect.stroke = isCustomTheme ? strokes[i % strokes.length] : _Theme.resolveOperation({ $ref: "backgroundColor" }); }); } }; var MiniTreemap = { chartType: "treemap", miniChart: MiniTreemapClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/hierarchical/miniSunburst.ts var MiniSunburstClass = class extends MiniChartWithPolarAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "sunburstTooltip"); // Hierarchical data using multidimensional array this.data = [ [[], []], [[], []], [[], []] ]; // Rotate the chart by the given angle (-90 degrees) this.angleOffset = -Math.PI / 2; this.innerRadiusRatio = 0; this.showRadiusAxisLine = false; this.showAngleAxisLines = false; const { data, size, padding, angleOffset, innerRadiusRatio, agChartsExports: { _Scene } } = this; const radius = (size - padding * 2) / 2; const angleRange = [angleOffset + 0, angleOffset + 2 * Math.PI]; const angleExtent = Math.abs(angleRange[1] - angleRange[0]); const radiusRange = [radius * innerRadiusRatio, radius]; const radiusExtent = Math.abs(radiusRange[1] - radiusRange[0]); let maxDepth = 0; const findMaxDepth = (data2, parentDepth) => { for (const child of data2) { const depth = parentDepth + 1; maxDepth = Math.max(maxDepth, depth); findMaxDepth(child, depth); } }; findMaxDepth(data, 0); const radiusRatio = radiusExtent / maxDepth; const center = this.size / 2; const startAngle = angleRange[0]; this.series = []; const createSectors = (data2, depth, startAngle2, availableAngle, group) => { const isArray = Array.isArray(data2); if (!isArray) { return; } const childDepth = depth + 1; let previousAngle = startAngle2; data2.forEach((child, childIndex, children) => { let childGroup = group; if (!childGroup) { childGroup = new _Scene.Group(); this.series.push(childGroup); } const innerRadius = radiusRange[0] + depth * radiusRatio; const outerRadius = radiusRange[0] + childDepth * radiusRatio; const angleRatio = 1 / children.length; const start = previousAngle; const end = start + availableAngle * angleRatio; const sector = new _Scene.Sector(); sector.centerX = center; sector.centerY = center; sector.innerRadius = innerRadius; sector.outerRadius = outerRadius; sector.startAngle = start; sector.endAngle = end; sector.stroke = void 0; sector.strokeWidth = 0; sector.inset = 0.75; previousAngle = end; childGroup.append(sector); createSectors(child, childDepth, start, Math.abs(end - start), childGroup); }); }; createSectors(data, 0, startAngle, angleExtent); this.root.append(this.series); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.series.forEach((group, i) => { for (const sector of group.children()) { sector.fill = fills[i % fills.length]; sector.stroke = strokes[i % strokes.length]; } }); } }; var MiniSunburst = { chartType: "sunburst", miniChart: MiniSunburstClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/specialized/miniHeatmap.ts var MiniHeatmapClass = class extends MiniChart { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super(container, agChartsExports, "heatmapTooltip"); const { size, padding, agChartsExports: { _Scene } } = this; const heatmapSize = 3; const data = Array.from( { length: heatmapSize }, (_, __) => Array.from({ length: heatmapSize }, (_2, yIndex) => yIndex) ); const domain = data.map((_, index) => index); const xScale = new _Scene.CategoryScale(); xScale.domain = domain; xScale.range = [padding, size - padding]; xScale.paddingInner = 0.01; xScale.paddingOuter = 0.1; const yScale = new _Scene.CategoryScale(); yScale.domain = domain; yScale.range = [padding, size - padding]; yScale.paddingInner = 0.01; yScale.paddingOuter = 0.1; const width = xScale.bandwidth ?? 0; const height = yScale.bandwidth ?? 0; this.rects = data.reduce((rects, d, index) => { rects ?? (rects = []); const xRects = d.map((_, yIndex) => { const rect = new _Scene.Rect(); rect.x = xScale.convert(index); rect.y = yScale.convert(yIndex); rect.width = width; rect.height = height; rect.strokeWidth = 0; rect.crisp = true; return rect; }); rects.push(...xRects); return rects; }, []); this.updateColors(fills, strokes, isCustomTheme); const rectGroup = new _Scene.Group(); rectGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding, size - padding)); rectGroup.append(this.rects); this.root.append(rectGroup); } updateColors(fills, strokes, isCustomTheme) { const { _Theme, _Util } = this.agChartsExports; const colorRange = isCustomTheme ? [fills[0], fills[1]] : _Theme.resolveOperation({ $palette: "divergingColors" }); const stroke = isCustomTheme ? strokes[0] : _Theme.resolveOperation({ $ref: "backgroundColor" }); const fillFn = _Util.interpolateColor(colorRange[0], colorRange[1]); this.rects.forEach((rect, i) => { rect.fill = fillFn(i * 0.2); rect.stroke = stroke; }); } }; var MiniHeatmap = { chartType: "heatmap", miniChart: MiniHeatmapClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/specialized/miniWaterfall.ts var MiniWaterfallClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes, isCustomTheme) { super(container, agChartsExports, "waterfallTooltip"); this.data = [4, 3, -3, 6, -3]; this.bars = this.createWaterfall(this.root, this.data, this.size, this.padding, "vertical").bars; this.updateColors(fills, strokes, isCustomTheme); } updateColors(fills, strokes, isCustomTheme) { const { data, agChartsExports: { _Theme } } = this; const positive = { fill: isCustomTheme ? fills[0] : _Theme.resolveOperation({ $palette: "altUp.fill" }), stroke: isCustomTheme ? strokes[0] : _Theme.resolveOperation({ $palette: "altUp.stroke" }) }; const negative = { fill: isCustomTheme ? fills[1] : _Theme.resolveOperation({ $palette: "altDown.fill" }), stroke: isCustomTheme ? strokes[1] : _Theme.resolveOperation({ $palette: "altDown.stroke" }) }; this.bars.forEach((bar, i) => { const isPositive = data[i] >= 0; bar.fill = isPositive ? positive.fill : negative.fill; bar.stroke = isPositive ? positive.stroke : negative.stroke; }); } createWaterfall(root, data, size, padding, direction) { const scalePadding = 2 * padding; const { processedData, min, max } = accumulateData(data.map((d) => [d])); const flatData = processedData.reduce((flat, d) => flat.concat(d), []); const { _Scene } = this.agChartsExports; const yScale = new _Scene.LinearScale(); yScale.domain = [Math.min(min, 0), max]; yScale.range = [size - scalePadding, scalePadding]; const xScale = new _Scene.CategoryScale(); xScale.domain = data.map((_, index) => index); xScale.range = [padding, size - padding]; xScale.paddingInner = 0.2; xScale.paddingOuter = 0.3; const width = xScale.bandwidth; const connectorLine = new _Scene.Path(); connectorLine.stroke = "#575757"; connectorLine.strokeWidth = 0; const pixelAlignmentOffset = Math.floor(connectorLine.strokeWidth) % 2 / 2; const connectorPath = connectorLine.path; connectorPath.clear(); const barAlongX = direction === "horizontal"; const bars = flatData.map((datum, i) => { const previousDatum = i > 0 ? flatData[i - 1] : 0; const rawValue = data[i]; const isPositive = rawValue > 0; const currY = Math.round(yScale.convert(datum)); const trailY = Math.round(yScale.convert(previousDatum)); const y = (isPositive ? currY : trailY) - pixelAlignmentOffset; const bottomY = (isPositive ? trailY : currY) + pixelAlignmentOffset; const height = Math.abs(bottomY - y); const x = xScale.convert(i); const rect = new _Scene.Rect(); rect.x = barAlongX ? y : x; rect.y = barAlongX ? x : y; rect.width = barAlongX ? height : width; rect.height = barAlongX ? width : height; rect.strokeWidth = 0; rect.crisp = true; const moveTo = currY + pixelAlignmentOffset; const lineTo = trailY + pixelAlignmentOffset; if (i > 0) { const lineToX = barAlongX ? lineTo : rect.x; const lineToY = barAlongX ? rect.y : lineTo; connectorPath.lineTo(lineToX, lineToY); } const moveToX = barAlongX ? moveTo : rect.x; const moveToY = barAlongX ? rect.y : moveTo; connectorPath.moveTo(moveToX, moveToY); return rect; }); root.append([connectorLine, ...bars]); return { bars }; } }; var MiniWaterfall = { chartType: "waterfall", miniChart: MiniWaterfallClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/combo/miniColumnLineCombo.ts var MiniColumnLineComboClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "columnLineComboTooltip"); this.columnData = [3, 4]; this.lineData = [[5, 4, 6, 5, 4]]; const { root, columnData, lineData, size, padding } = this; this.columns = createColumnRects({ stacked: false, root, data: columnData, size, padding, xScaleDomain: [0, 1], yScaleDomain: [0, 4], xScalePadding: 0.5, agChartsExports }); root.append(this.columns); this.lines = createLinePaths(agChartsExports, root, lineData, size, padding); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.columns.forEach((bar, i) => { bar.fill = fills[i]; bar.stroke = strokes[i]; }); this.lines.forEach((line, i) => { line.stroke = fills[i + 2]; }); } }; var MiniColumnLineCombo = { chartType: "columnLineCombo", miniChart: MiniColumnLineComboClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/combo/miniAreaColumnCombo.ts var MiniAreaColumnComboClass = class extends MiniChartWithAxes { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "areaColumnComboTooltip"); this.columnData = [3, 4.5]; this.areaData = [[5, 4, 6, 5, 4]]; const { root, columnData, areaData, size, padding, agChartsExports: { _Scene } } = this; this.columns = createColumnRects({ stacked: false, root, data: columnData, size, padding, xScaleDomain: [0, 1], yScaleDomain: [0, 6], xScalePadding: 0.5, agChartsExports }); const xScale = new _Scene.CategoryScale(); xScale.range = [padding, size - padding]; xScale.domain = [0, 1, 2, 3, 4]; xScale.paddingInner = 1; xScale.paddingOuter = 0; const yScale = new _Scene.LinearScale(); yScale.range = [size - padding, padding]; yScale.domain = [0, 6]; const pathData = []; const yZero = yScale.convert(0); const firstX = xScale.convert(0); areaData.forEach((series, i) => { const points = pathData[i] || (pathData[i] = []); series.forEach((data, j) => { const yDatum = data; const xDatum = j; const x = xScale.convert(xDatum); const y = yScale.convert(yDatum); points[j] = { x, y }; }); const lastX = xScale.convert(series.length - 1); pathData[i].push( { x: lastX, y: yZero }, { x: firstX, y: yZero } ); }); this.areas = pathData.map((points) => { const area = new _Scene.Path(); area.strokeWidth = 0; area.fillOpacity = 0.8; const path = area.path; points.forEach((point, i) => path[i > 0 ? "lineTo" : "moveTo"](point.x, point.y)); return area; }); const areaGroup = new _Scene.Group(); areaGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); const columnGroup = new _Scene.Group(); columnGroup.setClipRect(new _Scene.BBox(padding, padding, size - padding * 2, size - padding * 2)); areaGroup.append(this.areas); columnGroup.append(this.columns); root.append(areaGroup); root.append(columnGroup); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.areas.forEach((area, i) => { area.fill = fills[i]; area.stroke = strokes[i]; }); this.columns.forEach((bar, i) => { bar.fill = fills[i + 1]; bar.stroke = strokes[i + 1]; }); } }; var MiniAreaColumnCombo = { chartType: "areaColumnCombo", miniChart: MiniAreaColumnComboClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniCharts/combo/miniCustomCombo.ts var MiniCustomComboClass = class extends MiniChart { constructor(container, agChartsExports, fills, strokes) { super(container, agChartsExports, "customComboTooltip"); this.columnData = [3, 4]; this.lineData = [[5, 4, 6, 5, 4]]; const { root, columnData, lineData, size, padding, agChartsExports: { _Scene } } = this; this.columns = createColumnRects({ stacked: false, root, data: columnData, size, padding, xScaleDomain: [0, 1], yScaleDomain: [0, 4], xScalePadding: 0.5, agChartsExports }); root.append(this.columns); this.lines = createLinePaths(this.agChartsExports, root, lineData, size, padding); const axisStroke = "grey"; const axisOvershoot = 3; const leftAxis = new _Scene.Line(); leftAxis.x1 = padding; leftAxis.y1 = padding; leftAxis.x2 = padding; leftAxis.y2 = size - padding + axisOvershoot; leftAxis.stroke = axisStroke; const bottomAxis = new _Scene.Line(); bottomAxis.x1 = padding - axisOvershoot + 1; bottomAxis.y1 = size - padding; bottomAxis.x2 = size - padding + 1; bottomAxis.y2 = size - padding; bottomAxis.stroke = axisStroke; const penIcon = new _Scene.Path(); this.buildPenIconPath(penIcon); penIcon.fill = "whitesmoke"; penIcon.stroke = "darkslategrey"; penIcon.strokeWidth = 1; root.append([bottomAxis, leftAxis, penIcon]); this.updateColors(fills, strokes); } updateColors(fills, strokes) { this.columns.forEach((bar, i) => { bar.fill = fills[i]; bar.stroke = strokes[i]; }); this.lines.forEach((line, i) => { line.stroke = fills[i + 2]; }); } buildPenIconPath(penIcon) { const { path } = penIcon; path.moveTo(25.76, 43.46); path.lineTo(31.27, 48.53); path.moveTo(49.86, 22); path.lineTo(49.86, 22); path.cubicCurveTo(49.01994659053345, 21.317514933510974, 47.89593834348529, 21.09645997825817, 46.86, 21.41); path.lineTo(46.86, 21.41); path.cubicCurveTo(45.55460035985361, 21.77260167850787, 44.38777081121966, 22.517979360321792, 43.51, 23.55); path.lineTo(25.51, 43.8); path.lineTo(25.43, 43.89); path.lineTo(23.01, 51.89); path.lineTo(22.83, 52.46); path.lineTo(31.02, 48.86); path.lineTo(49.02, 28.52); path.lineTo(49.02, 28.52); path.cubicCurveTo(49.940716461596224, 27.521914221246085, 50.54302631059587, 26.2720342455763, 50.75, 24.93); path.lineTo(50.75, 24.93); path.cubicCurveTo(50.95363374988308, 23.866379846512814, 50.62080640232334, 22.77066734274871, 49.86, 22); path.closePath(); path.moveTo(41.76, 25.5); path.lineTo(47.34, 30.5); path.moveTo(40.74, 26.65); path.lineTo(46.25, 31.71); } }; var MiniCustomCombo = { chartType: "customCombo", miniChart: MiniCustomComboClass }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/miniChartsContainer.ts var miniChartMapping = { columnGroup: { column: { range: true, pivot: true, enterprise: false, icon: MiniColumn }, stackedColumn: { range: true, pivot: true, enterprise: false, icon: MiniStackedColumn }, normalizedColumn: { range: true, pivot: true, enterprise: false, icon: MiniNormalizedColumn } }, barGroup: { bar: { range: true, pivot: true, enterprise: false, icon: MiniBar }, stackedBar: { range: true, pivot: true, enterprise: false, icon: MiniStackedBar }, normalizedBar: { range: true, pivot: true, enterprise: false, icon: MiniNormalizedBar } }, pieGroup: { pie: { range: true, pivot: true, enterprise: false, icon: MiniPie }, donut: { range: true, pivot: true, enterprise: false, icon: MiniDonut }, doughnut: { range: true, pivot: true, enterprise: false, icon: MiniDonut } }, lineGroup: { line: { range: true, pivot: true, enterprise: false, icon: MiniLine }, stackedLine: { range: true, pivot: true, enterprise: false, icon: MiniStackedLine }, normalizedLine: { range: true, pivot: true, enterprise: false, icon: MiniNormalizedLine } }, scatterGroup: { scatter: { range: true, pivot: true, enterprise: false, icon: MiniScatter }, bubble: { range: true, pivot: true, enterprise: false, icon: MiniBubble } }, areaGroup: { area: { range: true, pivot: true, enterprise: false, icon: MiniArea }, stackedArea: { range: true, pivot: true, enterprise: false, icon: MiniStackedArea }, normalizedArea: { range: true, pivot: true, enterprise: false, icon: MiniNormalizedArea } }, polarGroup: { radarLine: { range: true, pivot: false, enterprise: true, icon: MiniRadarLine }, radarArea: { range: true, pivot: false, enterprise: true, icon: MiniRadarArea }, nightingale: { range: true, pivot: false, enterprise: true, icon: MiniNightingale }, radialColumn: { range: true, pivot: false, enterprise: true, icon: MiniRadialColumn }, radialBar: { range: true, pivot: false, enterprise: true, icon: MiniRadialBar } }, statisticalGroup: { boxPlot: { range: true, pivot: false, enterprise: true, icon: MiniBoxPlot }, histogram: { range: true, pivot: false, enterprise: false, icon: MiniHistogram }, rangeBar: { range: true, pivot: false, enterprise: true, icon: MiniRangeBar }, rangeArea: { range: true, pivot: false, enterprise: true, icon: MiniRangeArea } }, hierarchicalGroup: { treemap: { range: true, pivot: true, enterprise: true, icon: MiniTreemap }, sunburst: { range: true, pivot: true, enterprise: true, icon: MiniSunburst } }, specializedGroup: { heatmap: { range: true, pivot: false, enterprise: true, icon: MiniHeatmap }, waterfall: { range: true, pivot: false, enterprise: true, icon: MiniWaterfall } }, combinationGroup: { columnLineCombo: { range: true, pivot: true, enterprise: false, icon: MiniColumnLineCombo }, areaColumnCombo: { range: true, pivot: true, enterprise: false, icon: MiniAreaColumnCombo }, customCombo: { range: true, pivot: true, enterprise: false, icon: MiniCustomCombo } }, funnelGroup: { funnel: { range: true, pivot: false, enterprise: true, icon: MiniFunnel }, coneFunnel: { range: true, pivot: false, enterprise: true, icon: MiniConeFunnel }, pyramid: { range: true, pivot: false, enterprise: true, icon: MiniPyramid } } }; var DEFAULT_CHART_GROUPS = { columnGroup: ["column", "stackedColumn", "normalizedColumn"], barGroup: ["bar", "stackedBar", "normalizedBar"], pieGroup: ["pie", "donut"], lineGroup: ["line", "stackedLine", "normalizedLine"], areaGroup: ["area", "stackedArea", "normalizedArea"], scatterGroup: ["scatter", "bubble"], polarGroup: ["radarLine", "radarArea", "nightingale", "radialColumn", "radialBar"], statisticalGroup: ["boxPlot", "histogram", "rangeBar", "rangeArea"], hierarchicalGroup: ["treemap", "sunburst"], specializedGroup: ["heatmap", "waterfall"], funnelGroup: ["funnel", "coneFunnel", "pyramid"], combinationGroup: ["columnLineCombo", "areaColumnCombo", "customCombo"] }; var MiniChartsContainer = class extends Component { constructor(chartController, fills, strokes, isCustomTheme, chartGroups = DEFAULT_CHART_GROUPS) { super( /* html */ `
` ); this.wrappers = /* @__PURE__ */ new Map(); this.chartController = chartController; this.fills = fills; this.strokes = strokes; this.isCustomTheme = isCustomTheme; this.chartGroups = { ...chartGroups }; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { if (!this.chartController.customComboExists() && this.chartGroups.combinationGroup) { this.chartGroups.combinationGroup = this.chartGroups.combinationGroup.filter( (chartType) => chartType !== "customCombo" ); } const eGui = this.getGui(); const isEnterprise = this.chartController.isEnterprise(); const isPivotChart = this.chartController.isPivotChart(); const isRangeChart = !isPivotChart; const displayedMenuGroups = Object.keys(this.chartGroups).map((group) => { const menuGroup = group in miniChartMapping ? miniChartMapping[group] : void 0; if (!menuGroup) { _warn(148, { group }); return null; } const chartGroupValues = this.chartGroups[group] ?? []; const menuItems = chartGroupValues.map((chartType) => { const menuItem = chartType in menuGroup ? menuGroup[chartType] : void 0; if (!menuItem) { _warn(149, { group, chartType }); return null; } if (!isEnterprise && menuItem.enterprise) { return null; } if (isRangeChart && menuItem.range) { return menuItem; } if (isPivotChart && menuItem.pivot) { return menuItem; } return null; }).filter((menuItem) => menuItem != null); if (menuItems.length === 0) { return null; } return { label: this.chartTranslation.translate(group), items: menuItems }; }).filter((menuGroup) => menuGroup != null); for (const { label, items } of displayedMenuGroups) { const groupComponent = this.createBean( new AgGroupComponent({ title: label, suppressEnabledCheckbox: true, enabled: true, suppressOpenCloseIcons: true, cssIdentifier: "charts-settings", direction: "horizontal", suppressKeyboardNavigation: true }) ); for (const menuItem of items) { const { miniChart: MiniClass, chartType } = menuItem.icon; const miniWrapper = document.createElement("div"); miniWrapper.classList.add("ag-chart-mini-thumbnail"); miniWrapper.setAttribute("tabindex", "0"); miniWrapper.setAttribute("role", "button"); const miniClassChartType = chartType; const listener = () => { this.chartController.setChartType(miniClassChartType); this.updateSelectedMiniChart(); }; this.addManagedListeners(miniWrapper, { click: listener, keydown: (event) => { if (event.key == KeyCode.ENTER || event.key === KeyCode.SPACE) { event.preventDefault(); listener(); } } }); this.wrappers.set(miniClassChartType, miniWrapper); this.createBean( new MiniClass(miniWrapper, this.beans.agChartsExports, this.fills, this.strokes, this.isCustomTheme) ); groupComponent.addItem(miniWrapper); } eGui.appendChild(groupComponent.getGui()); } this.updateSelectedMiniChart(); } updateSelectedMiniChart() { const selectedChartType = this.chartController.getChartType(); this.wrappers.forEach((miniChart, miniChartType) => { const selected = miniChartType === selectedChartType; miniChart.classList.toggle("ag-selected", selected); const chartName = this.chartTranslation.translate(getFullChartNameTranslationKey(miniChartType)); const ariaLabel = selected ? `${chartName}. ${this.chartTranslation.translate("ariaChartSelected")}` : chartName; _setAriaLabel(miniChart, ariaLabel); }); } destroy() { this.wrappers.clear(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/settings/chartSettingsPanel.ts var ChartSettingsPanel = class extends Component { constructor(chartController) { super( /* html */ `
` ); this.chartController = chartController; this.eMiniChartsContainer = RefPlaceholder; this.eNavBar = RefPlaceholder; this.eCardSelector = RefPlaceholder; this.ePrevBtn = RefPlaceholder; this.eNextBtn = RefPlaceholder; this.miniChartsContainers = []; this.cardItems = []; this.activePaletteIndex = 0; this.palettes = []; this.themes = []; } postConstruct() { this.resetPalettes(); const isRtl = this.gos.get("enableRtl"); this.ePrevBtn.insertAdjacentElement( "afterbegin", _createIconNoSpan(isRtl ? "chartsThemeNext" : "chartsThemePrevious", this.beans) ); this.eNextBtn.insertAdjacentElement( "afterbegin", _createIconNoSpan(isRtl ? "chartsThemePrevious" : "chartsThemeNext", this.beans) ); this.addManagedElementListeners(this.ePrevBtn, { click: () => this.setActivePalette(this.getPrev(), "left") }); this.addManagedElementListeners(this.eNextBtn, { click: () => this.setActivePalette(this.getNext(), "right") }); const reset = () => this.resetPalettes(true); this.addManagedListeners(this.chartController, { chartTypeChanged: reset, chartApiUpdate: reset }); this.scrollSelectedIntoView(); } scrollSelectedIntoView() { setTimeout(() => { const isMiniChartsContainerVisible = (miniChartsContainers) => { return !miniChartsContainers.getGui().classList.contains("ag-hidden"); }; const currentMiniChartContainer = this.miniChartsContainers.find(isMiniChartsContainerVisible); const currentChart = currentMiniChartContainer.getGui().querySelector(".ag-selected"); if (currentChart) { const parent = currentChart.offsetParent; if (parent) { this.eMiniChartsContainer.scrollTo(0, parent.offsetTop); } } }, 250); } resetPalettes(forceReset) { const palettes = this.chartController.getPalettes(); const chartGroups = this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef; if (_areEqual(palettes, this.palettes) && !forceReset || this.isAnimating) { return; } this.palettes = palettes; this.themes = this.chartController.getThemeNames(); this.activePaletteIndex = this.themes.findIndex((name) => name === this.chartController.getChartThemeName()); this.cardItems = []; _clearElement(this.eCardSelector); this.destroyMiniCharts(); const { themes } = this; this.palettes.forEach((palette, index) => { const isActivePalette = this.activePaletteIndex === index; const { fills = [], strokes = [] } = palette; const themeName = themes[index]; const isCustomTheme = !isStockTheme(themeName, this.beans.agChartsExports._Theme); const miniChartsContainer = this.createBean( new MiniChartsContainer(this.chartController, fills, strokes, isCustomTheme, chartGroups) ); this.miniChartsContainers.push(miniChartsContainer); this.eMiniChartsContainer.appendChild(miniChartsContainer.getGui()); this.addCardLink(index); if (isActivePalette) { miniChartsContainer.updateSelectedMiniChart(); } else { miniChartsContainer.setDisplayed(false); } }); _setDisplayed(this.eNavBar, this.palettes.length > 1); _radioCssClass(this.cardItems[this.activePaletteIndex], "ag-selected", "ag-not-selected"); } addCardLink(index) { const link = document.createElement("div"); link.classList.add("ag-chart-settings-card-item"); this.addManagedElementListeners(link, { click: () => { this.setActivePalette(index, index < this.activePaletteIndex ? "left" : "right"); } }); this.eCardSelector.appendChild(link); this.cardItems.push(link); } getPrev() { let prev = this.activePaletteIndex - 1; if (prev < 0) { prev = this.palettes.length - 1; } return prev; } getNext() { let next = this.activePaletteIndex + 1; if (next >= this.palettes.length) { next = 0; } return next; } setActivePalette(index, animationDirection) { if (this.isAnimating || this.activePaletteIndex === index) { return; } _radioCssClass(this.cardItems[index], "ag-selected", "ag-not-selected"); const currentPalette = this.miniChartsContainers[this.activePaletteIndex]; const currentGui = currentPalette.getGui(); const futurePalette = this.miniChartsContainers[index]; const nextGui = futurePalette.getGui(); currentPalette.updateSelectedMiniChart(); futurePalette.updateSelectedMiniChart(); const multiplier = animationDirection === "left" ? -1 : 1; const final = nextGui.style.left = `${_getAbsoluteWidth(this.getGui()) * multiplier}px`; this.activePaletteIndex = index; this.isAnimating = true; const animatingClass = "ag-animating"; futurePalette.setDisplayed(true); currentPalette.addCss(animatingClass); futurePalette.addCss(animatingClass); this.chartController.setChartThemeName(this.themes[index]); window.setTimeout(() => { currentGui.style.left = `${-parseFloat(final)}px`; nextGui.style.left = "0px"; }, 0); window.setTimeout(() => { this.isAnimating = false; currentPalette.removeCss(animatingClass); futurePalette.removeCss(animatingClass); currentPalette.setDisplayed(false); }, 300); } destroyMiniCharts() { _clearElement(this.eMiniChartsContainer); this.miniChartsContainers = this.destroyBeans(this.miniChartsContainers); } destroy() { this.destroyMiniCharts(); super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/tabbedChartMenu.ts var TAB_DATA = "data"; var TAB_FORMAT = "format"; var TabbedChartMenu = class extends Component { constructor(panels, chartMenuContext) { super(); this.panels = panels; this.chartMenuContext = chartMenuContext; this.tabs = []; } wireBeans(beans) { this.chartTranslation = beans.chartTranslation; } postConstruct() { for (const panel of this.panels) { const panelType = panel.replace("chart", "").toLowerCase(); const panelComp = this.createPanel(panelType); const tabItem = this.createTab(panel, panelType, panelComp); this.tabs.push(tabItem); this.addDestroyFunc(() => this.destroyBean(panelComp)); } this.tabbedLayout = new AgTabbedLayout({ items: this.tabs, cssClass: "ag-chart-tabbed-menu", keepScrollPosition: true, suppressFocusBodyOnOpen: true, suppressTrapFocus: true, enableCloseButton: true, closeButtonAriaLabel: this.chartTranslation.translate("ariaChartMenuClose"), onCloseClicked: () => { this.eventSource?.focus({ preventScroll: true }); this.dispatchLocalEvent({ type: "closed" }); } }); this.createBean(this.tabbedLayout); } createTab(name, title, panelComp) { const eWrapperDiv = _createElement({ tag: "div", cls: `ag-chart-tab ag-chart-${title}` }); this.createBean(panelComp); eWrapperDiv.appendChild(panelComp.getGui()); const translatedTitle = this.chartTranslation.translate(title); const titleEl = _createElement({ tag: "div", children: translatedTitle }); return { title: titleEl, titleLabel: translatedTitle, bodyPromise: AgPromise.resolve(eWrapperDiv), getScrollableContainer: () => { const scrollableContainer = eWrapperDiv.querySelector(".ag-scrollable-container"); return scrollableContainer || eWrapperDiv; }, name }; } showTab(tab) { const tabItem = this.tabs[tab]; this.tabbedLayout.showItem(tabItem); } getGui() { return this.tabbedLayout?.getGui(); } showMenu(eventSource, suppressFocus) { this.eventSource = eventSource; if (!suppressFocus) { this.tabbedLayout?.focusHeader(true); } } destroy() { if (this.parentComponent?.isAlive()) { this.destroyBean(this.parentComponent); } super.destroy(); } createPanel(panelType) { switch (panelType) { case TAB_DATA: return new ChartDataPanel(this.chartMenuContext); case TAB_FORMAT: return new FormatPanel(this.chartMenuContext); default: return new ChartSettingsPanel(this.chartMenuContext.chartController); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/menu/chartMenu.ts var ChartMenu = class extends Component { constructor(eChartContainer, eMenuPanelContainer, chartMenuContext) { super( /* html */ `
` ); this.eChartContainer = eChartContainer; this.eMenuPanelContainer = eMenuPanelContainer; this.chartMenuContext = chartMenuContext; this.buttons = { chartLink: { iconName: "linked", callback: () => this.chartMenuSvc.toggleLinked(this.chartMenuContext) }, chartUnlink: { iconName: "unlinked", callback: () => this.chartMenuSvc.toggleLinked(this.chartMenuContext) }, chartDownload: { iconName: "chartsDownload", callback: () => this.chartMenuSvc.downloadChart(this.chartMenuContext) }, chartMenu: { iconName: "chartsMenu", callback: (eventSource) => this.showMenuList(eventSource) } }; this.panels = []; this.menuVisible = false; this.chartController = chartMenuContext.chartController; } wireBeans(beans) { this.chartMenuSvc = beans.chartMenuSvc; this.chartMenuListFactory = beans.chartMenuListFactory; } postConstruct() { this.chartToolbar = this.createManagedBean(new ChartToolbar()); this.getGui().appendChild(this.chartToolbar.getGui()); this.refreshToolbarAndPanels(); this.addManagedEventListeners({ chartCreated: (e) => { if (e.chartId === this.chartController.getChartId()) { const showDefaultToolPanel = Boolean(this.gos.get("chartToolPanelsDef")?.defaultToolPanel); if (showDefaultToolPanel) { this.showMenu({ panel: this.defaultPanel, suppressFocus: true }); } } } }); this.addManagedListeners(this.chartController, { chartLinkedChanged: this.refreshToolbarAndPanels.bind(this) }); this.refreshMenuClasses(); this.addManagedListeners(this.chartController, { chartApiUpdate: this.refreshToolbarAndPanels.bind(this) }); } isVisible() { return this.menuVisible; } getExtraPaddingDirections() { return ["chartMenu", "chartLink", "chartUnlink", "chartDownload"].some( (v) => this.chartToolbarOptions.includes(v) ) ? ["top"] : []; } refreshToolbarAndPanels() { this.initToolbarOptionsAndPanels(); this.updateToolbar(); } initToolbarOptionsAndPanels() { const { panels, defaultPanel } = this.chartMenuSvc.getChartToolPanels(this.chartController); this.panels = panels; this.defaultPanel = defaultPanel; this.chartToolbarOptions = this.chartMenuSvc.getChartToolbarOptions(); } updateToolbar() { const buttons = this.chartToolbarOptions.map((buttonName) => { const { iconName, callback } = this.buttons[buttonName]; return { buttonName, iconName, callback }; }); this.chartToolbar.updateParams({ buttons }); } createMenuPanel(defaultTab) { const menuPanel = this.menuPanel = this.createBean( new AgPanel({ height: "100%", closable: true, hideTitleBar: true, cssIdentifier: "chart-menu" }) ); menuPanel.setParentComponent(this); this.eMenuPanelContainer.appendChild(menuPanel.getGui()); this.tabbedMenu = this.createBean(new TabbedChartMenu(this.panels, this.chartMenuContext)); this.addManagedListeners(this.tabbedMenu, { closed: () => { this.hideMenu(); } }); this.addManagedListeners(menuPanel, { destroyed: () => this.destroyBean(this.tabbedMenu) }); return new AgPromise((res) => { window.setTimeout(() => { menuPanel.setBodyComponent(this.tabbedMenu); this.tabbedMenu.showTab(defaultTab); res(menuPanel); }, 100); }); } showContainer(eventSource, suppressFocus) { if (!this.menuPanel) { return; } this.menuVisible = true; this.refreshMenuClasses(); this.tabbedMenu.showMenu(eventSource, suppressFocus); } showMenu(params) { const { panel, eventSource, suppressFocus } = params ?? {}; if (this.menuPanel && !panel) { this.showContainer(eventSource, suppressFocus); } else { const menuPanel = panel || this.defaultPanel; let tab = this.panels.indexOf(menuPanel); if (tab < 0) { _warn(143, { panel }); tab = this.panels.indexOf(this.defaultPanel); } if (this.menuPanel) { this.tabbedMenu.showTab(tab); this.showContainer(eventSource, suppressFocus); } else { this.createMenuPanel(tab).then(() => this.showContainer(eventSource, suppressFocus)); } } } hideMenu() { this.menuVisible = false; this.refreshMenuClasses(); } refreshMenuClasses() { this.eChartContainer.classList.toggle("ag-chart-menu-visible", this.menuVisible); this.eChartContainer.classList.toggle("ag-chart-menu-hidden", !this.menuVisible); } showMenuList(eventSource) { this.chartMenuListFactory.showMenuList({ eventSource, showMenu: () => this.showMenu({ eventSource }), chartMenuContext: this.chartMenuContext, closeOnElementClick: this.eChartContainer }); } destroy() { super.destroy(); if (this.menuPanel?.isAlive()) { this.destroyBean(this.menuPanel); } if (this.tabbedMenu?.isAlive()) { this.destroyBean(this.tabbedMenu); } } }; // packages/ag-grid-enterprise/src/charts/chartComp/services/chartOptionsService.ts var CARTESIAN_AXIS_TYPES = ["number", "category", "time", "grouped-category"]; var POLAR_AXIS_TYPES = ["angle-category", "angle-number", "radius-category", "radius-number"]; var VALID_AXIS_TYPES = [...CARTESIAN_AXIS_TYPES, ...POLAR_AXIS_TYPES]; var ChartOptionsService = class extends BeanStub { constructor(chartController) { super(); this.chartController = chartController; } getChartThemeOverridesProxy() { return { getValue: (expression) => this.getChartOption(expression), setValue: (expression, value) => this.setChartThemeOverrides([{ expression, value }]), setValues: (properties) => this.setChartThemeOverrides(properties) }; } getAxisThemeOverridesProxy() { return { getValue: (expression) => this.getAxisProperty(expression), setValue: (expression, value) => this.setAxisThemeOverrides([{ expression, value }]), setValues: (properties) => this.setAxisThemeOverrides(properties) }; } getCartesianAxisOptionsProxy(axisType) { return { getValue: (expression) => this.getCartesianAxisProperty(axisType, expression), setValue: (expression, value) => this.setCartesianAxisOptions(axisType, [{ expression, value }]), setValues: (properties) => this.setCartesianAxisOptions(axisType, properties), clearValue: (parentExpression, key) => this.clearCartesianAxisOptions(axisType, parentExpression, key) }; } getCartesianAxisThemeOverridesProxy(axisType) { return { getValue: (expression) => this.getCartesianAxisProperty(axisType, expression), setValue: (expression, value) => this.setCartesianAxisThemeOverrides(axisType, [{ expression, value }]), setValues: (properties) => this.setCartesianAxisThemeOverrides(axisType, properties) }; } getCartesianAxisAppliedThemeOverridesProxy(axisType) { return { getValue: (expression) => this.getCartesianAxisThemeOverride( axisType, // Allow the caller to specify a wildcard expression to retrieve the whole set of overrides expression === "*" ? null : expression ), setValue: (expression, value) => this.setCartesianAxisThemeOverrides( axisType, // Allow the caller to specify a wildcard expression to set the whole set of overrides [{ expression: expression === "*" ? null : expression, value }] ), setValues: (properties) => this.setCartesianAxisThemeOverrides(axisType, properties) }; } getSeriesOptionsProxy(getSelectedSeries) { return { getValue: (expression, calculated) => this.getSeriesOption(getSelectedSeries(), expression, calculated), setValue: (expression, value) => this.setSeriesOptions(getSelectedSeries(), [{ expression, value }]), setValues: (properties) => this.setSeriesOptions(getSelectedSeries(), properties) }; } /** * Determine the set of theme overrides that should be retained when transitioning from one chart type to another. */ getPersistedChartThemeOverrides(existingChartOptions, existingAxes, existingChartType, targetChartType) { const retainedThemeOverrideKeys = this.getRetainedChartThemeOverrideKeys(existingChartType, targetChartType); const retainedChartAxisThemeOverrideKeys = this.getRetainedChartAxisThemeOverrideKeys( null, existingChartType, targetChartType ); const targetChartOptions = this.createChartOptions(); for (const expression of retainedThemeOverrideKeys) { const value = this.retrieveChartOptionsThemeOverride(existingChartOptions, existingChartType, expression); if (value !== void 0) { this.assignChartOptionsThemeOverride(targetChartOptions, targetChartType, expression, value); } } if (existingAxes) { this.assignPersistedAxisOverrides({ existingAxes, retainedChartAxisThemeOverrideKeys, existingChartOptions, targetChartOptions, existingChartType, targetChartType }); } return targetChartOptions.theme.overrides; } assignPersistedAxisOverrides(params) { const { existingAxes, retainedChartAxisThemeOverrideKeys, existingChartOptions, targetChartOptions, existingChartType, targetChartType } = params; for (const { expression, targetAxisTypes } of retainedChartAxisThemeOverrideKeys) { for (const existingAxisType of existingAxes.map((axis) => axis.type)) { const value = this.retrieveChartOptionsThemeOverride( existingChartOptions, existingChartType, ["axes", existingAxisType, expression].join(".") ); if (value !== void 0) { for (const targetAxisType of targetAxisTypes) { this.assignChartOptionsThemeOverride( targetChartOptions, targetChartType, ["axes", targetAxisType, expression].join("."), value ); } } } } } getRetainedChartThemeOverrideKeys(existingChartType, targetChartType) { const UNIVERSAL_PERSISTED_THEME_OVERRIDES = ["animation"]; const PERSISTED_CARTESIAN_CHART_THEME_OVERRIDES = ["zoom", "navigator"]; const chartSpecificThemeOverrideKeys = ((previousChartType, updatedChartType) => { const expressions = new Array(); if (isCartesian(getSeriesType(previousChartType)) && isCartesian(getSeriesType(updatedChartType))) { expressions.push(...PERSISTED_CARTESIAN_CHART_THEME_OVERRIDES); } return expressions; })(existingChartType, targetChartType); return [...UNIVERSAL_PERSISTED_THEME_OVERRIDES, ...chartSpecificThemeOverrideKeys]; } getRetainedChartAxisThemeOverrideKeys(axisType, existingChartType, targetChartType) { if (isCartesian(getSeriesType(existingChartType)) && isCartesian(getSeriesType(targetChartType))) { const retainedKeys = this.getRetainedCartesianAxisThemeOverrideKeys(axisType); return retainedKeys.map((expression) => ({ expression, targetAxisTypes: CARTESIAN_AXIS_TYPES })); } return []; } getRetainedCartesianAxisThemeOverrideKeys(axisType) { const axisPositionSuffixes = axisType === "xAxis" ? ["", ".top", ".bottom"] : axisType === "yAxis" ? ["", ".left", ".right"] : ["", ".left", ".right", ".top", ".bottom"]; const PERSISTED_CARTESIAN_AXIS_THEME_OVERRIDES = ["crosshair"]; const expressions = new Array(); for (const expression of PERSISTED_CARTESIAN_AXIS_THEME_OVERRIDES) { for (const axisPositionSuffix of axisPositionSuffixes) { expressions.push(`${expression}${axisPositionSuffix}`); } } return expressions; } getChartOption(expression) { return get(this.getChart(), expression, void 0); } setChartThemeOverrides(properties) { const chartType = this.getChartType(); const chartOptions = this.createChartOptions(); for (const { expression, value } of properties) { this.assignChartOptionsThemeOverride(chartOptions, chartType, expression, value); } this.applyChartOptions(chartOptions); } applyChartOptions(chartOptions, options) { if (Object.keys(chartOptions).length === 0) { return; } this.updateChart(chartOptions); const shouldRaiseEvent = !options?.silent; if (shouldRaiseEvent) { this.raiseChartOptionsChangedEvent(); } } awaitChartOptionUpdate(func) { const chart = this.chartController.getChartProxy().getChart(); chart.waitForUpdate().then(() => func()).catch((e) => _error(108, { e })); } getAxisProperty(expression) { return get(this.getChart().axes?.x, expression, void 0); } setAxisThemeOverrides(properties) { const chart = this.getChart(); const chartType = this.getChartType(); const chartOptions = this.createChartOptions(); for (const { expression, value } of properties) { const relevantAxes = Object.values(chart.axes ?? {}).filter((axis) => { const parts = expression.split("."); let current = axis; for (const part of parts) { if (!(part in current)) { return false; } current = current[part]; } return true; }); if (!relevantAxes) { continue; } for (const axis of relevantAxes) { if (!this.isValidAxisType(axis)) { continue; } this.assignChartAxisThemeOverride(chartOptions, chartType, axis.type, null, expression, value); } } this.applyChartOptions(chartOptions); } getCartesianAxisProperty(axisType, expression) { const axes = this.getChartAxes(); const axis = this.getCartesianAxis(axes, axisType); return get(axis, expression, void 0); } getCartesianAxisThemeOverride(axisType, expression) { const axes = this.getChartAxes(); const chartAxis = this.getCartesianAxis(axes, axisType); if (!chartAxis || !this.isValidAxisType(chartAxis)) { return void 0; } const chartType = this.getChartType(); const chartOptions = this.getChart().getOptions(); return this.retrieveChartAxisThemeOverride( chartOptions, chartType, chartAxis.type, axisType === "yAxis" ? ["left", "right"] : ["bottom", "top"], expression ); } setCartesianAxisThemeOverrides(axisType, properties) { const axes = this.getChartAxes(); const chartAxis = this.getCartesianAxis(axes, axisType); if (!chartAxis || !this.isValidAxisType(chartAxis)) { return; } const chartType = this.getChartType(); const chartOptions = this.createChartOptions(); for (const { expression, value } of properties) { this.assignChartAxisThemeOverride( chartOptions, chartType, chartAxis.type, axisType === "yAxis" ? ["left", "right"] : ["bottom", "top"], expression, value ); } this.applyChartOptions(chartOptions); } setCartesianAxisOptions(axisType, properties) { this.updateCartesianAxisOptions(axisType, (chartOptions) => { const axisId = axisType === "yAxis" ? "y" : "x"; for (const { expression, value } of properties) { this.assignChartOption(chartOptions, `axes.${axisId}.${expression}`, value); } }); } clearCartesianAxisOptions(axisType, parentExpression, key) { this.updateCartesianAxisOptions(axisType, (chartOptions) => { const axisId = axisType === "yAxis" ? "y" : "x"; this.clearChartOption(chartOptions, `axes.${axisId}.${parentExpression}`, key); }); } updateCartesianAxisOptions(axisType, updateFunc) { const existingChartOptions = this.getChart().getOptions(); const axisOptions = "axes" in existingChartOptions ? existingChartOptions.axes : void 0; if (!existingChartOptions || !axisOptions) { return; } const axes = this.getChartAxes(); const chartAxis = this.getCartesianAxis(axes, axisType); if (!chartAxis) { return; } const chartOptions = this.createChartOptions(); chartOptions.axes = axisOptions; updateFunc(chartOptions, chartAxis, existingChartOptions); this.applyChartOptions(chartOptions); } setCartesianCategoryAxisType(axisType, value) { this.updateCartesianAxisOptions(axisType, (chartOptions, chartAxis, existingChartOptions) => { const chartType = this.getChartType(); this.assignPersistedAxisOverrides({ existingAxes: [chartAxis], retainedChartAxisThemeOverrideKeys: this.getRetainedChartAxisThemeOverrideKeys( axisType, chartType, chartType ), existingChartOptions, targetChartOptions: chartOptions, existingChartType: chartType, targetChartType: chartType }); this.assignChartOption(chartOptions, `axes.x.type`, value); this.chartController.setCategoryAxisType(value); }); } getCartesianAxis(axes, axisType) { if (axes.length < 2) { return void 0; } switch (axisType) { case "xAxis": return axes[0].direction === "x" ? axes[0] : axes[1]; case "yAxis": return axes[1].direction === "y" ? axes[1] : axes[0]; } } getSeriesOption(seriesType, expression, calculated) { const series = this.getChart().series.find((s2) => isMatchingSeries(seriesType, s2)); return get(calculated ? series : series?.properties.toJson(), expression, void 0); } setSeriesOptions(seriesType, properties) { const chartOptions = this.createChartOptions(); for (const { expression, value } of properties) { this.assignChartOptionsSeriesThemeOverride(chartOptions, seriesType, `series.${expression}`, value); } this.applyChartOptions(chartOptions); } getPairedMode() { return this.chartController.getChartProxy().isPaired(); } setPairedMode(paired) { this.chartController.getChartProxy().setPaired(paired); } getChartAxes() { const chart = this.getChart(); return Object.values(chart.axes ?? {}); } retrieveChartAxisThemeOverride(chartOptions, chartType, axisType, axisPositions, expression) { if (axisPositions) { for (const axisPosition of axisPositions) { const value = this.retrieveChartOptionsThemeOverride( chartOptions, chartType, ["axes", axisType, axisPosition, ...expression ? [expression] : []].join(".") ); if (value === void 0) { continue; } return value; } } else { return this.retrieveChartOptionsThemeOverride( chartOptions, chartType, ["axes", axisType, ...expression ? [expression] : []].join(".") ); } } assignChartAxisThemeOverride(chartOptions, chartType, axisType, axisPositions, expression, value) { if (axisPositions) { for (const axisPosition of axisPositions) { this.assignChartOptionsThemeOverride( chartOptions, chartType, ["axes", axisType, axisPosition, ...expression ? [expression] : []].join("."), value ); } } else { this.assignChartOptionsThemeOverride( chartOptions, chartType, ["axes", axisType, ...expression ? [expression] : []].join("."), value ); } } isValidAxisType(chartAxis) { return VALID_AXIS_TYPES.includes(chartAxis.type); } getChartType() { return this.chartController.getChartType(); } getChart() { return this.chartController.getChartProxy().getChart(); } updateChart(chartOptions) { const chartRef = this.chartController.getChartProxy().getChartRef(); chartRef.skipAnimations(); chartRef.updateDelta(chartOptions); } createChartOptions() { const chartOptions = { theme: { overrides: {} } }; return chartOptions; } retrieveChartOptionsThemeOverride(chartOptions, chartType, expression) { const chartSeriesTypes = this.getChartThemeOverridesSeriesTypeKeys(chartType); for (const seriesType of chartSeriesTypes) { const value = this.retrieveChartOptionsSeriesThemeOverride(chartOptions, seriesType, expression); if (value === void 0) { continue; } return value; } return void 0; } assignChartOptionsThemeOverride(chartOptions, chartType, expression, value) { const chartSeriesTypes = this.getChartThemeOverridesSeriesTypeKeys(chartType); for (const seriesType of chartSeriesTypes) { this.assignChartOptionsSeriesThemeOverride(chartOptions, seriesType, expression, value); } } retrieveChartOptionsSeriesThemeOverride(chartOptions, seriesType, expression) { return this.retrieveChartOption( chartOptions, ["theme", "overrides", seriesType, ...expression ? [expression] : []].join(".") ); } assignChartOptionsSeriesThemeOverride(chartOptions, seriesType, expression, value) { this.assignChartOption( chartOptions, ["theme", "overrides", seriesType, ...expression ? [expression] : []].join("."), value ); } getChartThemeOverridesSeriesTypeKeys(chartType) { const chartSeriesTypes = this.chartController.getChartSeriesTypes(chartType); if (this.chartController.isComboChart()) { chartSeriesTypes.push("common"); } return chartSeriesTypes; } retrieveChartOption(chartOptions, expression) { return get(chartOptions, expression, void 0); } assignChartOption(chartOptions, expression, value) { set(chartOptions, expression, value); } clearChartOption(chartOptions, parentExpression, key) { const parentObject = get(chartOptions, parentExpression, void 0); if (parentObject) { delete parentObject[key]; } } raiseChartOptionsChangedEvent() { const chartModel = this.chartController.getChartModel(); this.eventSvc.dispatchEvent({ type: "chartOptionsChanged", chartId: chartModel.chartId, chartType: chartModel.chartType, chartThemeName: this.chartController.getChartThemeName(), chartOptions: chartModel.chartOptions }); } }; function isMatchingSeries(seriesType, series) { return isSeriesType(seriesType) && series.type === seriesType; } // packages/ag-grid-enterprise/src/charts/chartComp/gridChartComp.ts var GridChartComp = class extends Component { constructor(params) { super( /* html */ `
` ); this.eChart = RefPlaceholder; this.eWrapper = RefPlaceholder; this.eChartContainer = RefPlaceholder; this.eMenuContainer = RefPlaceholder; this.eEmpty = RefPlaceholder; this.params = params; } wireBeans(beans) { this.crossFilterService = beans.chartCrossFilterSvc; this.chartTranslation = beans.chartTranslation; this.chartMenuSvc = beans.chartMenuSvc; this.focusSvc = beans.focusSvc; this.popupSvc = beans.popupSvc; this.enterpriseChartProxyFactory = beans.enterpriseChartProxyFactory; this.environment = beans.environment; } postConstruct() { const modelParams = { ...this.params, chartType: getCanonicalChartType(this.params.chartType), chartThemeName: this.getThemeName() }; const isRtl = this.gos.get("enableRtl"); this.eWrapper.classList.add(isRtl ? "ag-rtl" : "ag-ltr"); const model = this.createBean(new ChartDataModel(modelParams)); this.chartController = this.createManagedBean(new ChartController(model)); this.chartOptionsService = this.createManagedBean(new ChartOptionsService(this.chartController)); this.validateCustomThemes(); this.createChart(); if (this.params.insideDialog) { this.addDialog(); } else { this.addManagedEventListeners({ stylesChanged: this.updateTheme.bind(this) }); this.updateTheme(); } this.addMenu(); this.addManagedElementListeners(this.getGui(), { focusin: this.setActiveChartCellRange.bind(this) }); this.addManagedListeners(this.chartController, { chartModelUpdate: this.update.bind(this) }); this.addManagedPropertyListeners( ["chartThemeOverrides", "chartThemes"], this.reactivePropertyUpdate.bind(this) ); this.update(); this.raiseChartCreatedEvent(); } updateTheme() { this.environment.applyThemeClasses(this.getGui()); } createChart() { let chartInstance = void 0; if (this.chartProxy) { chartInstance = this.chartProxy.destroy({ keepChartInstance: true }); } const crossFilterCallback = (event, reset) => { const ctx = this.params.crossFilteringContext; ctx.lastSelectedChartId = reset ? "" : this.chartController.getChartId(); if (reset) { this.params.crossFilteringResetCallback(); } this.crossFilterService.filter(event, reset); }; const chartType = this.chartController.getChartType(); const chartProxyParams = { agChartsExports: this.beans.agChartsExports, chartType, chartInstance, getChartThemeName: this.getChartThemeName.bind(this), getChartThemes: this.getChartThemes.bind(this), customChartThemes: this.gos.get("customChartThemes"), styleNonce: this.gos.get("styleNonce"), getGridOptionsChartThemeOverrides: () => this.getGridOptionsChartThemeOverrides(), getExtraPaddingDirections: () => this.chartMenu?.getExtraPaddingDirections() ?? [], apiChartThemeOverrides: this.params.chartThemeOverrides, crossFiltering: this.params.crossFiltering ?? false, crossFilterCallback, parentElement: this.eChart, grouping: this.chartController.isGrouping(), chartThemeToRestore: this.params.chartThemeName, chartOptionsToRestore: this.params.chartOptionsToRestore, chartPaletteToRestore: this.params.chartPaletteToRestore, seriesChartTypes: this.chartController.getSeriesChartTypes(), translate: (toTranslate) => this.chartTranslation.translate(toTranslate), context: _addGridCommonParams(this.gos, {}) }; this.params.chartOptionsToRestore = void 0; this.chartType = chartType; this.chartProxy = this.createChartProxy(chartProxyParams); if (!this.chartProxy) { _warn(138, { chartType: chartProxyParams.chartType }); return; } this.chartController.setChartProxy(this.chartProxy); this.createMenuContext(); } createMenuContext() { if (this.chartMenuContext) { return; } const chartMenuParamsFactory = this.createManagedBean( new ChartMenuParamsFactory(this.chartOptionsService.getChartThemeOverridesProxy()) ); const chartAxisMenuParamsFactory = this.createManagedBean( new ChartMenuParamsFactory(this.chartOptionsService.getAxisThemeOverridesProxy()) ); this.chartMenuContext = { chartController: this.chartController, chartOptionsService: this.chartOptionsService, chartMenuParamsFactory, chartAxisMenuParamsFactory }; } getChartThemeName() { return this.chartController.getChartThemeName(); } getChartThemes() { return this.chartController.getThemeNames(); } getGridOptionsChartThemeOverrides() { return this.gos.get("chartThemeOverrides"); } createChartProxy(chartProxyParams) { const { chartType } = chartProxyParams; switch (chartType) { case "column": case "bar": case "groupedColumn": case "stackedColumn": case "normalizedColumn": case "groupedBar": case "stackedBar": case "normalizedBar": return new BarChartProxy(chartProxyParams); case "pie": case "donut": case "doughnut": return new PieChartProxy(chartProxyParams); case "area": case "stackedArea": case "normalizedArea": return new AreaChartProxy(chartProxyParams); case "line": case "stackedLine": case "normalizedLine": return new LineChartProxy(chartProxyParams); case "scatter": case "bubble": return new ScatterChartProxy(chartProxyParams); case "columnLineCombo": case "areaColumnCombo": case "customCombo": return new ComboChartProxy(chartProxyParams); } const enterpriseChartProxy = this.enterpriseChartProxyFactory?.createChartProxy(chartProxyParams); if (!enterpriseChartProxy) { throw _errMsg(251, { chartType }); } return enterpriseChartProxy; } addDialog() { const title = this.chartTranslation.translate(this.params.pivotChart ? "pivotChartTitle" : "rangeChartTitle"); const { width, height } = this.getBestDialogSize(); const afterGuiAttached = this.params.focusDialogOnOpen ? () => setTimeout(() => _focusInto(this.getGui())) : void 0; this.chartDialog = new Dialog({ resizable: true, movable: true, maximizable: true, title, width, height, component: this, centered: true, closable: true, afterGuiAttached, postProcessPopupParams: { type: "chart" } }); this.createBean(this.chartDialog); this.chartDialog.addEventListener("destroyed", () => { this.destroy(); this.chartMenuSvc.hideAdvancedSettings(); const lastFocusedCell = this.focusSvc.getFocusedCell(); setTimeout(() => { if (this.focusSvc.isAlive()) { if (lastFocusedCell) { this.focusSvc.setFocusedCell({ ...lastFocusedCell, forceBrowserFocus: true }); } else { _focusGridInnerElement(this.beans); } } }); }); } getBestDialogSize() { const popupParent = this.popupSvc.getPopupParent(); const maxWidth = _getAbsoluteWidth(popupParent) * 0.75; const maxHeight = _getAbsoluteHeight(popupParent) * 0.75; const ratio = 0.553; const chart = this.chartProxy.getChart(); let width = this.params.insideDialog ? 850 : chart.width; let height = this.params.insideDialog ? 470 : chart.height; if (width > maxWidth || height > maxHeight) { width = Math.min(width, maxWidth); height = Math.round(width * ratio); if (height > maxHeight) { height = maxHeight; width = Math.min(width, Math.round(height / ratio)); } } return { width, height }; } addMenu() { if (!this.params.crossFiltering) { this.chartMenu = this.createBean( new ChartMenu(this.eChartContainer, this.eMenuContainer, this.chartMenuContext) ); this.eChartContainer.appendChild(this.chartMenu.getGui()); } } update(params) { if (params?.chartId) { const validUpdate = this.chartController.update(params); if (!validUpdate) { return; } } const updatedChartType = this.chartTypeChanged(params); const persistedThemeOverrides = updatedChartType || this.chartEmpty ? ((updatedChartType2) => { const currentChartType = this.chartType; const targetChartType = updatedChartType2; const existingChartInstance = this.chartProxy.getChart(); const existingChartOptions = existingChartInstance?.getOptions(); const existingAxes = Object.values(existingChartInstance?.axes ?? {}); return this.chartOptionsService.getPersistedChartThemeOverrides( existingChartOptions, existingAxes, currentChartType, targetChartType ?? currentChartType ); })(updatedChartType) : void 0; if (updatedChartType) { this.createChart(); } if (persistedThemeOverrides && params?.chartThemeOverrides) { _mergeDeep(persistedThemeOverrides, params.chartThemeOverrides); } const updatedThemeOverrides = persistedThemeOverrides ?? params?.chartThemeOverrides; this.updateChart(updatedThemeOverrides); if (params?.chartId) { this.chartProxy.getChart().waitForUpdate().then(() => { this.chartController.raiseChartApiUpdateEvent(); }); } } updateChart(updatedOverrides) { const { chartProxy } = this; const selectedCols = this.chartController.getSelectedValueColState(); const data = this.chartController.getChartData(); const chartEmpty = this.handleEmptyChart(data, selectedCols.length); this.chartEmpty = chartEmpty; if (chartEmpty) { if (updatedOverrides) { this.chartController.updateThemeOverrides(updatedOverrides); } return; } const chartUpdateParams = this.chartController.getChartUpdateParams(updatedOverrides); chartProxy.update(chartUpdateParams); this.chartProxy.getChart().waitForUpdate().then(() => { this.chartController.raiseChartUpdatedEvent(); }); } chartTypeChanged(updateParams) { const [currentType, updatedChartType] = [this.chartController.getChartType(), updateParams?.chartType]; const targetChartType = updatedChartType ? getCanonicalChartType(updatedChartType) : void 0; if (this.chartType !== currentType) { return targetChartType ?? currentType; } if (targetChartType && currentType !== targetChartType) { return targetChartType; } return null; } getChartModel() { return this.chartController.getChartModel(); } getChartImageDataURL(fileFormat) { return this.chartProxy.getChartImageDataURL(fileFormat); } handleEmptyChart(data, numFields) { const pivotModeDisabled = this.chartController.isPivotChart() && !this.chartController.isPivotMode(); const chartType = this.chartController.getChartType(); let minFieldsRequired = 1; if (this.chartController.isActiveXYChart()) { minFieldsRequired = chartType === "bubble" ? 3 : 2; } else if (isHierarchical(getSeriesType(chartType))) { minFieldsRequired = 0; } const isEmptyChart = numFields < minFieldsRequired || data.length === 0; if (this.eChart) { const isEmpty = pivotModeDisabled || isEmptyChart; _setDisplayed(this.eChart, !isEmpty); _setDisplayed(this.eEmpty, isEmpty); } if (pivotModeDisabled) { this.eEmpty.textContent = this.chartTranslation.translate("pivotChartRequiresPivotMode"); return true; } if (isEmptyChart) { this.eEmpty.textContent = this.chartTranslation.translate("noDataToChart"); return true; } return false; } downloadChart(dimensions, fileName, fileFormat) { this.chartProxy.downloadChart(dimensions, fileName, fileFormat); } openChartToolPanel(panel) { const menuPanel = panel ? CHART_TOOL_PANEL_MENU_OPTIONS[panel] : panel; this.chartMenu.showMenu({ panel: menuPanel }); } closeChartToolPanel() { this.chartMenu.hideMenu(); } getChartId() { return this.chartController.getChartId(); } getUnderlyingChart() { return this.chartProxy.getChartRef(); } crossFilteringReset() { this.chartProxy.crossFilteringReset(); } setMaximized(maximized) { this.chartDialog?.setMaximized(maximized); } setActiveChartCellRange(focusEvent) { if (this.getGui().contains(focusEvent.relatedTarget)) { return; } this.chartController.setChartRange(true); } getThemeName() { const availableChartThemes = this.gos.get("chartThemes") || DEFAULT_THEMES; if (availableChartThemes.length === 0) { throw new Error(_errMsg(254)); } const { chartThemeName } = this.params; return availableChartThemes.includes(chartThemeName) ? chartThemeName : availableChartThemes[0]; } getAllKeysInObjects(objects) { const allValues = {}; for (const obj of objects.filter((obj2) => obj2 != null)) { for (const key of Object.keys(obj)) { allValues[key] = null; } } return Object.keys(allValues); } validateCustomThemes() { const suppliedThemes = this.getChartThemes(); const customChartThemes = this.gos.get("customChartThemes"); if (customChartThemes) { for (const customThemeName of this.getAllKeysInObjects([customChartThemes])) { if (!suppliedThemes.includes(customThemeName)) { _warn(139, { customThemeName }); } } } } reactivePropertyUpdate() { this.chartController.setChartThemeName(this.getThemeName(), true); const chartId = this.getChartId(); const modelType = this.chartController.isCrossFilterChart() ? "crossFilter" : this.getChartModel().modelType; const chartThemeOverrides = this.gos.get("chartThemeOverrides") || {}; this.update({ type: `${modelType}ChartUpdate`, chartId, chartThemeOverrides }); } raiseChartCreatedEvent() { this.chartProxy.getChart().waitForUpdate().then(() => { this.eventSvc.dispatchEvent({ type: "chartCreated", chartId: this.chartController.getChartId() }); }); } raiseChartDestroyedEvent() { this.eventSvc.dispatchEvent({ type: "chartDestroyed", chartId: this.chartController.getChartId() }); } destroy() { super.destroy(); if (this.chartProxy) { this.chartProxy.destroy(); } this.destroyBean(this.chartMenu); if (this.chartDialog?.isAlive()) { this.destroyBean(this.chartDialog); } this.onDestroyColorSchemeChangeListener?.(); const eGui = this.getGui(); _clearElement(eGui); _removeFromParent(eGui); this.raiseChartDestroyedEvent(); } }; // packages/ag-grid-enterprise/src/charts/chartModelMigration.ts var DEBUG = false; function upgradeChartModel(model) { const originalVersion = model.version; if (model.version == null) { model.version = heuristicVersionDetection(model); } model = migrateIfBefore("23.0.0", model, migrateV23); model = migrateIfBefore("24.0.0", model, migrateV24); model = migrateIfBefore("25.1.0", model, migrateV25_1); model = migrateIfBefore("26.0.0", model, migrateV26); model = migrateIfBefore("26.1.0", model, migrateV26_1); model = migrateIfBefore("26.2.0", model, migrateV26_2); model = migrateIfBefore("28.0.0", model, migrateV28); model = migrateIfBefore("28.2.0", model, migrateV28_2); model = migrateIfBefore("29.0.0", model, migrateV29); model = migrateIfBefore("29.1.0", model, migrateV29_1); model = migrateIfBefore("29.2.0", model, migrateV29_2); model = migrateIfBefore("30.0.0", model, migrateV30); model = migrateIfBefore("31.0.0", model, migrateV31); model = migrateIfBefore("32.0.0", model, migrateV32); model = migrateIfBefore("33.0.0", model, migrateV33); model = migrateIfBefore("34.0.0", model, migrateV34); model = cleanup(model); model = migrateIfBefore(VERSION2, model, (m) => m); if (DEBUG && originalVersion !== model.version) { console.log("AG Grid: ChartModel migration complete", { model }); } return model; } function migrateV23(model) { model = jsonRename("chartOptions.legend.item.marker.type", "shape", model); model = jsonRename("chartOptions.seriesDefaults.marker.type", "shape", model); model = jsonRename("chartOptions.legend.padding", "spacing", model); return model; } function migrateV24(model) { model = jsonDelete("chartOptions.seriesDefaults.marker.minSize", model); const { chartType, chartPalette, // Migrate. chartOptions: { xAxis, yAxis, ...chartOptions }, ...chartModel } = model; const axesTypes = getLegacyAxisType(chartType); const axes = axesTypes?.map((type, i) => ({ type, ...i === 0 ? xAxis : yAxis })); const LEGACY_PALETTES = { borneo: "ag-default", material: "ag-material", bright: "ag-vivid" }; return { chartType, chartThemeName: LEGACY_PALETTES[chartPalette] ?? "ag-default", chartOptions: { ...chartOptions, axes, xAxis, yAxis }, ...chartModel }; } function migrateV25_1(model) { model = jsonRename("chartOptions.seriesDefaults.label.minRequiredAngle", "minAngle", model); return model; } function migrateV26(model) { const highlightOptUpdate = ({ dimOpacity, ...opts }) => ({ ...opts, ...dimOpacity != null ? { series: { dimOpacity } } : {} }); model = jsonMutate("chartOptions.seriesDefaults.highlightStyle", model, highlightOptUpdate); model = jsonDelete("chart", model); model = jsonDelete("chartOptions.seriesDefaults.tooltipClass", model); model = jsonDelete("chartOptions.seriesDefaults.tooltipTracking", model); model = jsonDeleteDefault("chartOptions.axes[].label.rotation", 0, model); model = jsonDeleteDefault("chartOptions.axes[].label.rotation", 335, model); return model; } function migrateV26_1(model) { const highlightOptUpdate = ({ item, series, ...opts }) => ({ item: { ...opts, ...item }, ...series ? { series } : {} }); model = jsonMutate("chartOptions.seriesDefaults.highlightStyle", model, highlightOptUpdate); model = jsonMutate("chartOptions.series[].highlightStyle", model, highlightOptUpdate); return model; } function migrateV26_2(model) { model = jsonMove("chartOptions.seriesDefaults.fill.opacity", "chartOptions.seriesDefaults.fillOpacity", model); model = jsonMove("chartOptions.seriesDefaults.stroke.opacity", "chartOptions.seriesDefaults.strokeOpacity", model); model = jsonMove("chartOptions.seriesDefaults.stroke.width", "chartOptions.seriesDefaults.strokeWidth", model); model = jsonDelete("chartOptions.seriesDefaults.fill", model); model = jsonDelete("chartOptions.seriesDefaults.stroke", model); model = jsonDelete("chartOptions.seriesDefaults.callout.colors", model); model = jsonDelete("chartOptions.xAxis", model); model = jsonDelete("chartOptions.yAxis", model); const { chartType: providedChartType, // disable no-unused-vars because `series` is required here, even though // unused, because it serves to take the `series` key out of otherChartOptions // eslint-disable-next-line @typescript-eslint/no-unused-vars chartOptions: { axes, series, seriesDefaults, ...otherChartOptions }, ...otherModelProps } = model; const chartType = getCanonicalChartType(providedChartType); const seriesType = getSeriesType(chartType); const seriesTypes = [seriesType]; const chartTypeMixin = {}; if (!isPieChartSeries(seriesType)) { const minimalAxis = { top: {}, bottom: {}, left: {}, right: {} }; const updatedAxes = axes.map(({ type, ...axisProps }) => ({ [type]: { ...minimalAxis, ...axisProps } })).reduce(merge, {}); for (const v of ALL_AXIS_TYPES.filter((v2) => updatedAxes[v2] == null)) { updatedAxes[v] = { ...minimalAxis }; } chartTypeMixin.axes = updatedAxes; } const updatedChartOptions = seriesTypes.map((t) => ({ [t]: { ...chartTypeMixin, series: seriesDefaults, ...otherChartOptions } })).reduce(merge, {}); model = { ...otherModelProps, chartType, chartOptions: updatedChartOptions }; return model; } function migrateV28(model) { model = jsonDelete("chartOptions.*.title.padding", model); model = jsonDelete("chartOptions.*.subtitle.padding", model); model = jsonDelete("chartOptions.*.axes.*.title.padding", model); model = jsonBackfill("chartOptions.*.axes.*.title.enabled", false, model); return model; } function migrateV28_2(model) { model = jsonRename("chartOptions.pie.series.callout", "calloutLine", model); model = jsonRename("chartOptions.pie.series.label", "calloutLabel", model); model = jsonRename("chartOptions.pie.series.labelKey", "sectorLabelKey", model); model = jsonRename("chartOptions.pie.series.labelName", "sectorLabelName", model); model = jsonRename("chartOptions.donut.series.callout", "calloutLine", model); model = jsonRename("chartOptions.donut.series.label", "calloutLabel", model); model = jsonRename("chartOptions.donut.series.labelKey", "sectorLabelKey", model); model = jsonRename("chartOptions.donut.series.labelName", "sectorLabelName", model); return model; } function migrateV29(model) { model = jsonMoveIfMissing("chartOptions.scatter.series.fill", "chartOptions.scatter.series.marker.fill", model); model = jsonMoveIfMissing( "chartOptions.scatter.series.fillOpacity", "chartOptions.scatter.series.marker.fillOpacity", model ); model = jsonMoveIfMissing("chartOptions.scatter.series.stroke", "chartOptions.scatter.series.marker.stroke", model); model = jsonMoveIfMissing( "chartOptions.scatter.series.strokeOpacity", "chartOptions.scatter.series.marker.strokeOpacity", model ); model = jsonMoveIfMissing( "chartOptions.scatter.series.strokeWidth", "chartOptions.scatter.series.marker.strokeWidth", model ); model = jsonMove("chartOptions.scatter.series.paired", "chartOptions.scatter.paired", model); return model; } function migrateV29_1(model) { model = jsonDelete("chartOptions.axes[].tick.count", model); return model; } function migrateV29_2(model) { const tooltipOptUpdate = ({ tracking, ...opts }) => { const output = { ...opts }; if (tracking === false) { output.position ?? (output.position = { type: "pointer" }); output.range ?? (output.range = "nearest"); } else if (tracking === true) { output.position ?? (output.position = { type: "node" }); output.range ?? (output.range = "nearest"); } return output; }; model = jsonMutate("chartOptions.*.tooltip", model, tooltipOptUpdate); return model; } function migrateV30(model) { model = jsonRename("chartOptions.pie.series.labelKey", "sectorLabelKey", model); model = jsonRename("chartOptions.pie.series.labelName", "sectorLabelName", model); model = migrateV29_1(model); model = migrateV29_2(model); model = jsonDelete("chartOptions.*.series.flipXY", model); model = jsonAdd("chartOptions.common.legend.enabled", true, model); model = jsonBackfill("chartOptions.common.legend.position", "right", model); return model; } function migrateV31(model) { const V30_LEGACY_PALETTES = { "ag-pastel": "ag-sheets", "ag-solar": "ag-polychroma" }; const updatedModel = jsonRename("chartOptions.column", "bar", model); const chartThemeName = V30_LEGACY_PALETTES[updatedModel.chartThemeName] || updatedModel.chartThemeName; return { ...updatedModel, chartThemeName }; } function migrateV32(model) { model = jsonMutateProperty("chartOptions.*.autoSize", true, model, (parent, targetProp) => { if (parent[targetProp] === true) { } else if (parent[targetProp] === false) { parent["minHeight"] = 600; parent["minWidth"] = 300; } delete parent[targetProp]; }); return model; } function migrateV33(model) { model = jsonDelete("chartOptions.*.axes.category.label.format", model); model = jsonDelete("chartOptions.*.axes.category.crosshair.label.format", model); model = jsonDelete("chartOptions.*.axes.angle-category.label.format", model); model = jsonDelete("chartOptions.*.axes.radius-category.label.format", model); model = jsonRename("chartOptions.*.axes.*.label.padding", "spacing", model); model = jsonRename("chartOptions.*.navigator.miniChart.label.padding", "spacing", model); model = jsonDelete("chartOptions.*.axes.*.crossLines.label.className", model); model = jsonMutateProperty("chartOptions.*.axes.*.crossLines.label.position", true, model, (parent, targetProp) => { if (typeof parent[targetProp] === "string") { parent[targetProp] = parent[targetProp].replace(/([A-Z])/, "-$1").toLowerCase(); } }); model = jsonDelete("chartOptions.bullet", model); model = jsonRenameEnumValues("chartOptions.bar.series.label.placement", model, { inside: "inside-center", outside: "inside-end" }); model = jsonRenameEnumValues("chartOptions.waterfall.series.item.*.label.placement", model, { inside: "inside-center", start: "outside-start", end: "outside-end" }); model = jsonDelete("chartOptions.*.navigator.min", model); model = jsonDelete("chartOptions.*.navigator.max", model); model = jsonDelete("chartOptions.*.zoom.ratioX", model); model = jsonDelete("chartOptions.*.zoom.ratioY", model); model = jsonDelete("chartOptions.*.zoom.rangeX", model); model = jsonDelete("chartOptions.*.zoom.rangeY", model); return model; } function migrateV34(model) { const highlightUpdate = (parent, targetProp) => { const highlightStyle = parent[targetProp]; if (highlightStyle == null) { return; } const highlight = {}; if (highlightStyle.item) { highlight.highlightedItem = highlightStyle.item; } if (highlightStyle.series) { const { dimOpacity, ...seriesOpts } = highlightStyle.series; if (dimOpacity != null) { highlight.unhighlightedSeries = { opacity: dimOpacity }; } if (Object.keys(seriesOpts).length > 0) { highlight.highlightedSeries = seriesOpts; } } delete parent[targetProp]; parent.highlight = highlight; }; jsonMutateProperty("chartOptions.series[].highlightStyle", true, model, highlightUpdate); return model; } function cleanup(model) { model = jsonDelete("chartOptions.*.width", model); model = jsonDelete("chartOptions.*.height", model); model = jsonBackfill("chartOptions.*.axes.category.label.autoRotate", true, model); return model; } function heuristicVersionDetection(model) { const modelAny = model; if (model.version != null) { return model.version; } const hasKey = (obj, ...keys) => { return Object.keys(obj || {}).some((k) => keys.includes(k)); }; const chartOptions = modelAny.chartOptions; const seriesOptions = hasKey(chartOptions, "seriesDefaults") ? chartOptions?.seriesDefaults : chartOptions?.[Object.keys(chartOptions)[0]]; const hints = { "27.0.0": hasKey(modelAny, "seriesChartTypes"), "26.2.0": !hasKey(chartOptions, "seriesDefaults"), "26.1.0": hasKey(seriesOptions?.highlightStyle, "item"), "26.0.0": hasKey(seriesOptions?.highlightStyle, "series"), // '26.0.0': modelAny.chart === undefined, "25.1.0": hasKey(seriesOptions?.label, "minAngle"), "25.0.0": hasKey(modelAny, "modelType", "aggFunc", "unlinkChart", "suppressChartRanges") || hasKey(seriesOptions, "lineDash", "lineDashOffset"), "24.0.0": hasKey(modelAny, "chartThemeName", "chart") || hasKey(chartOptions, "series"), "23.2.0": hasKey(chartOptions, "navigator"), "23.0.0": hasKey(chartOptions?.legend?.item?.marker, "shape"), "22.1.0": hasKey(modelAny, "chartPalette", "chartType") }; const defaultVersion = "27.1.0"; const matchingHints = Object.entries(hints).filter(([_, match]) => match); if (DEBUG) { console.log("AG Grid: ChartModel migration", { heuristicVersionCandidates: matchingHints }); } const [heuristicVersion = defaultVersion] = matchingHints[0]; if (DEBUG) { console.log("AG Grid: ChartModel migration", { heuristicVersion }); } return heuristicVersion; } function migrateIfBefore(maxVersion, model, migration) { if (versionNumber(maxVersion) > versionNumber(model.version)) { if (DEBUG) { console.log("AG Grid: ChartModel migration", { migratingTo: maxVersion }); } const result = migration(model); result.version = maxVersion; if (DEBUG) { console.log("AG Grid: ChartModel migration", { migratedTo: maxVersion, result }); } return result; } return model; } function versionParts(versionRaw) { const version = versionRaw.includes("-beta") ? versionRaw.replace(/-beta.*/, "") : versionRaw; const split = typeof version === "string" ? version.split(".").map((v) => Number(v)) : []; if (split.length !== 3 || split.some((v) => isNaN(v))) { throw new Error(_errMsg(253, { version })); } return { major: split[0], minor: split[1], patch: split[2] }; } function versionNumber(version) { const { major, minor, patch } = versionParts(version); return major * 1e4 + minor * 100 + patch; } function jsonDeleteDefault(path, defaultValue, json) { return jsonMutateProperty(path, true, json, (parent, prop) => { if (parent[prop] === defaultValue) { delete parent[prop]; } }); } function jsonBackfill(path, defaultValue, json) { return jsonMutateProperty(path, false, json, (parent, prop) => { if (parent[prop] == null) { parent[prop] = defaultValue; } }); } function jsonAdd(path, value, json) { if (typeof path === "string") { path = path.split("."); } const nextPath = path[0]; if (path.length > 1) { json[nextPath] = jsonAdd(path.slice(1), value, json[nextPath] ?? {}); } const hasProperty = Object.keys(json).includes(nextPath); if (!hasProperty) { json[nextPath] = value; } return json; } function jsonMove(from, to, json) { let valueToMove = void 0; let valueFound = false; json = jsonMutateProperty(from, true, json, (parent, prop) => { valueFound = true; valueToMove = parent[prop]; delete parent[prop]; }); if (!valueFound) { return json; } return jsonMutateProperty(to, false, json, (parent, prop) => { parent[prop] = valueToMove; }); } function jsonMoveIfMissing(from, to, json) { let valueToMove = void 0; let valueFound = false; json = jsonMutateProperty(from, true, json, (parent, prop) => { valueFound = true; valueToMove = parent[prop]; delete parent[prop]; }); if (!valueFound) { return json; } return jsonMutateProperty(to, false, json, (parent, prop) => { if (parent[prop] === void 0) { parent[prop] = valueToMove; } }); } function jsonRename(path, renameTo, json) { return jsonMutateProperty(path, true, json, (parent, prop) => { parent[renameTo] = parent[prop]; delete parent[prop]; }); } function jsonDelete(path, json) { return jsonMutateProperty(path, true, json, (parent, prop) => delete parent[prop]); } function jsonMutateProperty(path, skipMissing, json, mutator) { const pathElements = path instanceof Array ? path : path.split("."); const parentPathElements = pathElements.slice(0, pathElements.length - 1); const targetName = pathElements[pathElements.length - 1]; return jsonMutate(parentPathElements, json, (parent) => { const hasProperty = Object.keys(parent).includes(targetName); if (skipMissing && !hasProperty) { return parent; } const result = { ...parent }; mutator(result, targetName); return result; }); } function jsonMutate(path, json, mutator) { const pathElements = path instanceof Array ? path : path.split("."); json = { ...json }; if (pathElements.length === 0) { return mutator(json); } else if (pathElements[0].startsWith("{")) { const pathOptions = pathElements[0].substring(1, pathElements[0].lastIndexOf("}")).split(","); for (const pathOption of pathOptions) { if (json[pathOption] != null) { json[pathOption] = jsonMutate(pathElements.slice(1), json[pathOption], mutator); } } } else if (pathElements[0].endsWith("[]")) { const arrayName = pathElements[0].substring(0, path[0].indexOf("[")); if (json[arrayName] instanceof Array) { json[arrayName] = json[arrayName].map((v) => jsonMutate(pathElements.slice(1), v, mutator)); } } else if (pathElements[0] === "*") { for (const jsonProp of Object.keys(json)) { json[jsonProp] = jsonMutate(pathElements.slice(1), json[jsonProp], mutator); } } else if (json[pathElements[0]] != null) { json[pathElements[0]] = jsonMutate(pathElements.slice(1), json[pathElements[0]], mutator); } return json; } function jsonRenameEnumValues(path, json, values) { return jsonMutateProperty(path, true, json, (parent, targetProp) => { if (typeof parent[targetProp] === "string") { parent[targetProp] = values[targetProp] ?? targetProp; } }); } var merge = (r, n) => ({ ...r, ...n }); // packages/ag-grid-enterprise/src/charts/chartService.ts var ChartService = class extends BeanStub { constructor() { super(...arguments); this.beanName = "chartSvc"; // we destroy all charts bound to this grid when grid is destroyed. activeCharts contains all charts, including // those in developer provided containers. this.activeCharts = /* @__PURE__ */ new Set(); this.activeChartComps = /* @__PURE__ */ new Set(); // this shared (singleton) context is used by cross filtering in line and area charts this.crossFilteringContext = { lastSelectedChartId: "" }; this.isEnterprise = () => this.agChartsExports.isEnterprise; } wireBeans(beans) { this.visibleCols = beans.visibleCols; this.rangeSvc = beans.rangeSvc; this.agChartsExports = beans.agChartsExports; } updateChart(params) { if (this.activeChartComps.size === 0) { _warn(124); return; } const chartComp = [...this.activeChartComps].find((chartComp2) => chartComp2.getChartId() === params.chartId); if (!chartComp) { _warn(125, { chartId: params.chartId }); return; } chartComp.update(params); } getChartModels() { const models = []; const versionedModel = (c) => { return { ...c, version: VERSION2 }; }; for (const c of this.activeChartComps) { models.push(versionedModel(c.getChartModel())); } return models; } getChartRef(chartId) { let chartRef; for (const cr of this.activeCharts) { if (cr.chartId === chartId) { chartRef = cr; } } return chartRef; } getChartComp(chartId) { let chartComp; for (const comp of this.activeChartComps) { if (comp.getChartId() === chartId) { chartComp = comp; } } return chartComp; } getChartImageDataURL(params) { let url; for (const c of this.activeChartComps) { if (c.getChartId() === params.chartId) { url = c.getChartImageDataURL(params.fileFormat); } } return url; } downloadChart(params) { const chartComp = Array.from(this.activeChartComps).find((c) => c.getChartId() === params.chartId); chartComp?.downloadChart(params.dimensions, params.fileName, params.fileFormat); } openChartToolPanel(params) { const chartComp = Array.from(this.activeChartComps).find((c) => c.getChartId() === params.chartId); chartComp?.openChartToolPanel(params.panel); } closeChartToolPanel(chartId) { const chartComp = Array.from(this.activeChartComps).find((c) => c.getChartId() === chartId); chartComp?.closeChartToolPanel(); } createChartFromCurrentRange(chartType = "groupedColumn", fromApi) { const cellRange = this.getSelectedRange(); return this.createChart({ cellRange, chartType, focusDialogOnOpen: !fromApi }); } restoreChart(model, chartContainer) { if (!model) { _warn(126); return; } if (model.version !== VERSION2) { model = upgradeChartModel(model); } let cellRange; let pivotChart; let suppressChartRanges; let chartPaletteToRestore; if (model.modelType === "pivot") { this.gos.updateGridOptions({ options: { pivotMode: true }, source: "pivotChart" }); cellRange = this.createCellRange(void 0, true); pivotChart = true; suppressChartRanges = true; } else { cellRange = this.createCellRange(model.cellRange); chartPaletteToRestore = model.chartPalette; suppressChartRanges = model.suppressChartRanges; } if (!cellRange) { return; } return this.createChart({ ...model, cellRange, pivotChart, suppressChartRanges, chartContainer, chartOptionsToRestore: model.chartOptions, chartPaletteToRestore }); } createRangeChart(params, fromApi) { const cellRange = this.createCellRange(params.cellRange); if (!cellRange) { return; } return this.createChart({ ...params, cellRange, focusDialogOnOpen: !fromApi }); } createPivotChart(params, fromApi) { this.gos.updateGridOptions({ options: { pivotMode: true }, source: "pivotChart" }); const cellRange = this.createCellRange(void 0, true); if (!cellRange) { return; } return this.createChart({ ...params, cellRange, pivotChart: true, suppressChartRanges: true, focusDialogOnOpen: !fromApi }); } createCrossFilterChart(params, fromApi) { const cellRange = this.createCellRange(params.cellRange); if (!cellRange) { return; } const suppressChartRangesSupplied = typeof params.suppressChartRanges !== "undefined" && params.suppressChartRanges !== null; const suppressChartRanges = suppressChartRangesSupplied ? params.suppressChartRanges : true; return this.createChart({ ...params, cellRange, suppressChartRanges, crossFiltering: true, crossFilteringSort: params.sort, focusDialogOnOpen: !fromApi }); } createChart(params) { const validationResult = validateCreateParams(params, this.agChartsExports.isEnterprise); if (!validationResult) { return void 0; } params = validationResult === true ? params : validationResult; const { chartType, chartContainer } = params; const createChartContainerFunc = this.gos.getCallback("createChartContainer"); const gridChartParams = { ...params, chartId: this.generateId(), chartType: getCanonicalChartType(chartType), insideDialog: !(chartContainer || createChartContainerFunc), crossFilteringContext: this.crossFilteringContext, crossFilteringResetCallback: () => { for (const c of this.activeChartComps) { c.crossFilteringReset(); } } }; const chartComp = new GridChartComp(gridChartParams); this.createBean(chartComp); const chartRef = this.createChartRef(chartComp); if (chartContainer) { chartContainer.appendChild(chartRef.chartElement); } else if (createChartContainerFunc) { createChartContainerFunc(chartRef); } else { chartComp.addEventListener("destroyed", () => { this.activeChartComps.delete(chartComp); this.activeCharts.delete(chartRef); }); } return chartRef; } createChartRef(chartComp) { const chartRef = { destroyChart: () => { if (this.activeCharts.has(chartRef)) { this.destroyBean(chartComp); this.activeChartComps.delete(chartComp); this.activeCharts.delete(chartRef); } }, focusChart: () => { _focusInto(chartComp.getGui()); }, chartElement: chartComp.getGui(), chart: chartComp.getUnderlyingChart(), chartId: chartComp.getChartModel().chartId, setMaximized: chartComp.setMaximized.bind(chartComp) }; this.activeCharts.add(chartRef); this.activeChartComps.add(chartComp); return chartRef; } getSelectedRange() { const ranges = this.rangeSvc?.getCellRanges(); if (!ranges || ranges.length === 0) { return { columns: [] }; } const uCols = /* @__PURE__ */ new Set(); let startRowIndex = Number.MAX_VALUE; let endRowIndex = -Number.MAX_VALUE; for (const { startRow: sr, endRow: er, columns: cols } of ranges) { if (!(sr && er)) { continue; } for (const col of cols) { uCols.add(col); } let { rowIndex: sRowIndex, rowPinned: startRowPinned } = sr; let { rowIndex: eRowIndex, rowPinned: endRowPinned } = er; if (startRowPinned === "top") { if (endRowPinned === "top") { continue; } sRowIndex = 0; } if (endRowPinned === "bottom") { if (startRowPinned === "bottom") { continue; } eRowIndex = this.beans.pageBounds.getLastRow(); } if (sRowIndex !== void 0) { startRowIndex = Math.min(startRowIndex, sRowIndex); } if (eRowIndex !== void 0) { endRowIndex = Math.max(endRowIndex, eRowIndex); } } if (startRowIndex === Number.MAX_VALUE || endRowIndex === -Number.MAX_VALUE) { return { columns: [] }; } const columns = Array.from(uCols); return { // Don't specify id here, as it should be chart-specific // but we don't have that context yet columns, startColumn: columns[0], startRow: { rowIndex: startRowIndex, rowPinned: void 0 }, endRow: { rowIndex: endRowIndex, rowPinned: void 0 } }; } generateId() { return `id-${Math.random().toString(36).substring(2, 18)}`; } createCellRange(cellRangeParams, allRange) { const rangeParams = allRange ? { rowStartIndex: null, rowStartPinned: void 0, rowEndIndex: null, rowEndPinned: void 0, columns: this.visibleCols.allCols.map((col) => col.getColId()) } : cellRangeParams; const cellRange = rangeParams && this.rangeSvc?.createPartialCellRangeFromRangeParams(rangeParams, true); if (!cellRange) { _warn(127, { allRange }); } return cellRange; } destroy() { for (const chart of this.activeCharts) { chart.destroyChart(); } super.destroy(); } }; // packages/ag-grid-enterprise/src/charts/chartsApi.ts function getChartModels(beans) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.getChartModels()); } function getChartRef(beans, chartId) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.getChartRef(chartId)); } function getChartImageDataURL(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.getChartImageDataURL(params)); } function downloadChart(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.downloadChart(params)); } function openChartToolPanel(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.openChartToolPanel(params)); } function closeChartToolPanel(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.closeChartToolPanel(params.chartId)); } function createRangeChart(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.createRangeChart(params, true)); } function createPivotChart(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.createPivotChart(params, true)); } function createCrossFilterChart(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.createCrossFilterChart(params, true)); } function updateChart(beans, params) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.updateChart(params)); } function restoreChart(beans, chartModel, chartContainer) { return beans.frameworkOverrides.wrapIncoming(() => beans.chartSvc?.restoreChart(chartModel, chartContainer)); } // packages/ag-grid-enterprise/src/charts/integratedChartsModule.css var integratedChartsModule_default = `.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative}.ag-chart-tabbed-menu-body:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:solid var(--ag-border-width) var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-card-item:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative}.ag-chart-settings-next:focus-within,.ag-chart-settings-prev:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:solid var(--ag-border-width) var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:calc(var(--ag-border-width) + 1px);padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:solid var(--ag-border-width) var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8}.ag-chart-menu-icon:hover{opacity:1}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}.ag-label{display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:solid var(--ag-border-width) var(--ag-border-color)}.ag-chart-data-wrapper,.ag-chart-format-wrapper{margin:0;padding:0}.ag-group{.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{border-top:none;display:grid;font-weight:500;grid-template-columns:60px 1fr 60px 1fr 60px;row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;margin:0;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}&.ag-charts-data-group,&.ag-charts-format-top-level-group{border-top:solid var(--ag-border-width) var(--ag-border-color)}.ag-charts-data-group-container,.ag-charts-format-top-level-group-container,.ag-charts-settings-group-container{margin:0;padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-item,.ag-charts-format-sub-level-no-header-group-item,.ag-charts-format-top-level-group-item{margin-bottom:var(--ag-widget-vertical-spacing)}&.ag-charts-format-sub-level-group,&.ag-charts-format-top-level-group,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group-item{margin:0;padding:0}.ag-charts-advanced-settings-top-level-group-container{margin:0}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-color,.ag-spectrum-fill{border-radius:var(--ag-border-radius)}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:var(--ag-color-picker-thumb-border-width) solid #fff;border-radius:var(--ag-color-picker-thumb-size);box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:var(--ag-color-picker-thumb-size);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{cursor:pointer;height:var(--ag-color-picker-track-size);margin-bottom:10px;position:relative}.ag-spectrum-slider,.ag-spectrum-tool{border-radius:var(--ag-color-picker-thumb-size)}.ag-spectrum-slider{border:var(--ag-color-picker-thumb-border-width) solid #fff;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:var(--ag-color-picker-thumb-size);margin-top:calc(var(--ag-color-picker-track-size)/2*-1 + var(--ag-color-picker-thumb-size)/2*-1);pointer-events:none;position:absolute;width:var(--ag-color-picker-thumb-size)}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin:10px var(--ag-spacing) 2px}.ag-recent-color{border:solid var(--ag-border-width) var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding:10px 0 0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:var(--ag-color-picker-track-border-radius)}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:var(--ag-color-picker-color-border-radius)}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:solid var(--ag-border-width) var(--ag-border-color);height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-ltr) .ag-color-input .ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-rtl) .ag-color-input .ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}:where(.ag-color-input) .ag-color-input-color{position:absolute}:where(.ag-ltr) :where(.ag-color-input) .ag-color-input-color{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-color-input) .ag-color-input-color{margin-right:var(--ag-spacing)}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`; // packages/ag-grid-enterprise/src/charts/utils/validGridChartsVersion.ts var VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION = 28; var VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION = 6; function isValidVersion(version) { return version?.match(/\d+\.\d+\.\d+/); } function isValidMajorVersion({ gridMajorVersion, chartsMajorVersion }) { const gridMajor = parseInt(gridMajorVersion, 10); const chartsMajor = parseInt(chartsMajorVersion, 10); const gridMajorDifference = gridMajor - VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION; const chartsMajorDifference = chartsMajor - VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION; const isFirstOrAfterVersion = gridMajorDifference >= 0; return gridMajorDifference === chartsMajorDifference && isFirstOrAfterVersion; } function gridChartVersion(gridVersion) { if (!gridVersion || !isValidVersion(gridVersion)) { return void 0; } const [gridMajor, gridMinor] = gridVersion.split(".") || []; const gridMajorMinor = `${gridMajor}.${gridMinor}.x`; const gridMajorNumber = parseInt(gridMajor, 10); const chartsMajor = gridMajorNumber - VERSION_CHECKING_FIRST_GRID_MAJOR_VERSION + VERSION_CHECKING_FIRST_CHARTS_MAJOR_VERSION; if (chartsMajor < 0) { return void 0; } const chartsMinor = gridMinor; const chartsMajorMinor = `${chartsMajor}.${chartsMinor}.x`; return { gridMajorMinor, chartsMajorMinor }; } function validGridChartsVersionErrorMessage({ type, gridVersion, chartsVersion }) { const invalidMessage = "AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information."; if (!gridVersion) { return invalidMessage; } const version = gridChartVersion(gridVersion); if (!version) { return invalidMessage; } const { gridMajorMinor, chartsMajorMinor } = version; if (type === "incompatible") { return `AG Grid version ${gridVersion} and AG Charts version ${chartsVersion} is not supported. AG Grid version ${gridMajorMinor} should be used with AG Chart ${chartsMajorMinor}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`; } else if (type === "invalidCharts") { return `AG Grid version ${gridMajorMinor} should be used with AG Chart ${chartsMajorMinor} not ${chartsVersion}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`; } return invalidMessage; } function validGridChartsVersion({ gridVersion, chartsVersion }) { if (!isValidVersion(chartsVersion)) { return { isValid: false, message: validGridChartsVersionErrorMessage({ type: "invalidCharts", gridVersion, chartsVersion }) }; } if (!isValidVersion(gridVersion)) { return { isValid: false, message: validGridChartsVersionErrorMessage({ type: "invalidGrid", gridVersion, chartsVersion }) }; } const [gridMajor, gridMinor] = gridVersion.split(".") || []; const [chartsMajor, chartsMinor, chartsPatch] = chartsVersion.split(".") || []; const isValidMajor = isValidMajorVersion({ gridMajorVersion: gridMajor, chartsMajorVersion: chartsMajor }); if (isValidMajor && gridMinor === chartsMinor || chartsPatch.includes("beta")) { return { isValid: true }; } else if (!isValidMajor || gridMinor !== chartsMinor) { return { isValid: false, message: validGridChartsVersionErrorMessage({ type: "incompatible", gridVersion, chartsVersion }) }; } return { isValid: false, message: validGridChartsVersionErrorMessage({ type: "invalid", gridVersion, chartsVersion }) }; } // packages/ag-grid-enterprise/src/charts/integratedChartsModule.ts var icons = { // shown on top right of chart when chart is linked to range data (click to unlink) linked: "linked", // shown on top right of chart when chart is not linked to range data (click to link) unlinked: "unlinked", // icon to open charts menu chartsMenu: "menu-alt", // download chart chartsDownload: "save", // Edit Chart menu item shown in Integrated Charts menu chartsMenuEdit: "chart", // Advanced Settings menu item shown in Integrated Charts menu chartsMenuAdvancedSettings: "settings", // shown in Integrated Charts menu add fields chartsMenuAdd: "plus", // shown in Integrated Charts tool panel color picker chartsColorPicker: "small-down", // previous in Integrated Charts settings tool panel theme switcher chartsThemePrevious: "previous", // next in Integrated Charts settings tool panel theme switcher chartsThemeNext: "next" }; var apiFunctions = { getChartModels, getChartRef, getChartImageDataURL, downloadChart, openChartToolPanel, closeChartToolPanel, createRangeChart, createPivotChart, createCrossFilterChart, updateChart, restoreChart }; var dependsOn = [ CellSelectionModule, EnterpriseCoreModule, SharedDragAndDropModule, PopupModule, MenuItemModule ]; var moduleName2 = "IntegratedCharts"; var GridChartsModule = { moduleName: "GridCharts", version: VERSION2, dependsOn, // included to avoid other false positive warnings about missing modules validate: () => { return { isValid: false, message: `AG Grid: As of v33, the "GridChartsModule" has been deprecated. Please use "IntegratedChartsModule.with(...)" instead. ${_preInitErrMsg(257)}` }; } }; var IntegratedChartsModule = { moduleName: moduleName2, version: VERSION2, dependsOn, // included to avoid other false positive warnings about missing modules validate: () => { return { isValid: false, message: _preInitErrMsg(257) }; }, with: (params) => { params.setup(); params.setGridContext?.(true); if (params.isEnterprise && params.setLicenseKey) { const chartsManager = { setLicenseKey: params.setLicenseKey }; LicenseManager.setChartsLicenseManager(chartsManager); } return { moduleName: moduleName2, version: VERSION2, icons, apiFunctions, dependsOn, css: [integratedChartsModule_default], validate: () => { return validGridChartsVersion({ gridVersion: VERSION2, chartsVersion: params.VERSION }); }, beans: [ // bind the params to the constructor to avoid the need for static properties AgChartsExports.bind(null, params), ChartService, ChartTranslationService, ChartCrossFilterService, ChartMenuListFactory, ChartMenuService, // Include enterprise beans for now for all users as tiny compared to charts bundle size EnterpriseChartProxyFactory, AdvancedSettingsMenuFactory ] }; } }; // packages/ag-grid-enterprise/src/allEnterpriseModule.ts var dependsOn2 = [ AllCommunityModule, ClipboardModule, ColumnsToolPanelModule, ExcelExportModule, FiltersToolPanelModule, NewFiltersToolPanelModule, MasterDetailModule, ColumnMenuModule, ContextMenuModule, CellSelectionModule, RichSelectModule, RowNumbersModule, RowGroupingModule, RowGroupingPanelModule, GroupFilterModule, ServerSideRowModelModule, ServerSideRowModelApiModule, FormulaModule, SetFilterModule, MultiFilterModule, AdvancedFilterModule, SideBarModule, StatusBarModule, ViewportRowModelModule, PivotModule, TreeDataModule, FindModule, BatchEditModule, RowGroupingEditModule, AiToolkitModule ]; var moduleName3 = "AllEnterprise"; var AllEnterpriseModule = { with: (params) => ({ moduleName: moduleName3, version: VERSION2, dependsOn: [...dependsOn2, IntegratedChartsModule.with(params), SparklinesModule.with(params)] }), moduleName: moduleName3, version: VERSION2, dependsOn: dependsOn2 }; // packages/ag-grid-enterprise/src/main-umd-shared.ts function autoRegisterAgCharts() { const agChartsDynamic = globalThis?.agCharts; const agChartsModule = agChartsDynamic?.AgChartsEnterpriseModule ?? agChartsDynamic?.AgChartsCommunityModule; if (agChartsModule) { ModuleRegistry.registerModules([ IntegratedChartsModule.with(agChartsModule), SparklinesModule.with(agChartsModule) ]); } } function createGrid2(eGridDiv, gridOptions, params) { autoRegisterAgCharts(); return createGrid(eGridDiv, gridOptions, params); } // packages/ag-grid-enterprise/src/main-umd-styles.ts _setUmd(); ModuleRegistry.registerModules([AllEnterpriseModule]); ;if (typeof module.exports == "object" && typeof exports == "object") { var __cp = (to, from, except, desc) => { if ((from && typeof from === "object") || typeof from === "function") { for (let key of Object.getOwnPropertyNames(from)) { if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except) Object.defineProperty(to, key, { get: () => from[key], enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable, }); } } return to; }; module.exports = __cp(module.exports, exports); } return module.exports; }))