Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/column-tool-panel

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/column-tool-panel - npm Package Compare versions

Comparing version 27.0.0 to 27.1.0

8

dist/cjs/es5/columnToolPanel/toolPanelColumnComp.js

@@ -199,6 +199,10 @@ "use strict";

canBeToggled = !functionsReadOnly && !noFunctionsAllowed;
canBeDragged = canBeToggled;
}
else {
canBeToggled = !this.column.getColDef().lockVisible;
canBeDragged = !this.column.getColDef().lockPosition;
var _a = this.column.getColDef(), enableRowGroup = _a.enableRowGroup, enableValue = _a.enableValue, lockPosition = _a.lockPosition, suppressMovable = _a.suppressMovable, lockVisible = _a.lockVisible;
var forceDraggable = !!enableRowGroup || !!enableValue;
var disableDraggable = !!lockPosition || !!suppressMovable;
canBeToggled = !lockVisible;
canBeDragged = forceDraggable || !disableDraggable;
}

@@ -205,0 +209,0 @@ this.cbSelect.setReadOnly(!canBeToggled);

@@ -180,6 +180,10 @@ "use strict";

canBeToggled = !functionsReadOnly && !noFunctionsAllowed;
canBeDragged = canBeToggled;
}
else {
canBeToggled = !this.column.getColDef().lockVisible;
canBeDragged = !this.column.getColDef().lockPosition;
const { enableRowGroup, enableValue, lockPosition, suppressMovable, lockVisible } = this.column.getColDef();
const forceDraggable = !!enableRowGroup || !!enableValue;
const disableDraggable = !!lockPosition || !!suppressMovable;
canBeToggled = !lockVisible;
canBeDragged = forceDraggable || !disableDraggable;
}

@@ -186,0 +190,0 @@ this.cbSelect.setReadOnly(!canBeToggled);

/**
* @ag-grid-enterprise/column-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
* @ag-grid-enterprise/column-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @link http://www.ag-grid.com/
* @license Commercial
*/
/**
* @ag-grid-enterprise/column-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0
* @link http://www.ag-grid.com/
' * @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),n=require("@ag-grid-enterprise/core"),i=require("@ag-grid-enterprise/row-grouping"),r=require("@ag-grid-enterprise/side-bar"),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),l=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.EXPANDED=0]="EXPANDED",e[e.COLLAPSED=1]="COLLAPSED",e[e.INDETERMINATE=2]="INDETERMINATE"}(t||(t={}));var a=function(e){function n(){return e.call(this,n.TEMPLATE)||this}return s(n,e),n.prototype.postConstruct=function(){var e=this;this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",(function(t){t.key===o.KeyCode.SPACE&&e.onExpandClicked()})),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.eFilterTextField.onValueChange((function(){return e.onFilterTextChanged()})),this.addManagedListener(this.eFilterTextField.getInputElement(),"keypress",this.onMiniFilterKeyPress.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));var t=this.gridOptionsWrapper.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input"))},n.prototype.init=function(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()},n.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=o._.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper)),this.setExpandState(t.EXPANDED)},n.prototype.showOrHideOptions=function(){var e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isPrimaryColumnGroupsPresent(),r=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),o._.setDisplayed(this.eFilterTextField.getGui(),e),o._.setDisplayed(this.eSelect.getGui(),t),o._.setDisplayed(this.eExpand,n&&i)},n.prototype.onFilterTextChanged=function(){var e=this;this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=o._.debounce((function(){var t=e.eFilterTextField.getValue();e.dispatchEvent({type:"filterChanged",filterText:t})}),n.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()},n.prototype.onMiniFilterKeyPress=function(e){var t=this;e.key===o.KeyCode.ENTER&&setTimeout((function(){return t.onSelectClicked()}),n.DEBOUNCE_DELAY)},n.prototype.onSelectClicked=function(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})},n.prototype.onExpandClicked=function(){this.dispatchEvent({type:this.expandState===t.EXPANDED?"collapseAll":"expandAll"})},n.prototype.setExpandState=function(e){this.expandState=e,o._.setDisplayed(this.eExpandChecked,this.expandState===t.EXPANDED),o._.setDisplayed(this.eExpandUnchecked,this.expandState===t.COLLAPSED),o._.setDisplayed(this.eExpandIndeterminate,this.expandState===t.INDETERMINATE)},n.prototype.setSelectionState=function(e){this.selectState=e,this.eSelect.setValue(this.selectState)},n.DEBOUNCE_DELAY=300,n.TEMPLATE='<div class="ag-column-select-header" role="presentation" tabindex="-1">\n <div ref="eExpand" class="ag-column-select-header-icon" tabindex="0"></div>\n <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n </div>',l([o.Autowired("columnModel")],n.prototype,"columnModel",void 0),l([o.RefSelector("eExpand")],n.prototype,"eExpand",void 0),l([o.RefSelector("eSelect")],n.prototype,"eSelect",void 0),l([o.RefSelector("eFilterTextField")],n.prototype,"eFilterTextField",void 0),l([o.PostConstruct],n.prototype,"postConstruct",null),n}(o.Component),u=function(){function e(e,t,n,i,r){void 0===i&&(i=!1),this.eventService=new o.EventService,this.displayName=e,this.dept=n,this.group=i,i?(this.columnGroup=t,this.expanded=r,this.children=[]):this.column=t}return e.prototype.isGroup=function(){return this.group},e.prototype.getDisplayName=function(){return this.displayName},e.prototype.getColumnGroup=function(){return this.columnGroup},e.prototype.getColumn=function(){return this.column},e.prototype.getDept=function(){return this.dept},e.prototype.isExpanded=function(){return!!this.expanded},e.prototype.getChildren=function(){return this.children},e.prototype.isPassesFilter=function(){return this.passesFilter},e.prototype.setExpanded=function(t){t!==this.expanded&&(this.expanded=t,this.eventService.dispatchEvent({type:e.EVENT_EXPANDED_CHANGED}))},e.prototype.setPassesFilter=function(e){this.passesFilter=e},e.prototype.addEventListener=function(e,t){this.eventService.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventService.removeEventListener(e,t)},e.EVENT_EXPANDED_CHANGED="expandedChanged",e}(),p=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),c=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},d=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,i,r=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}return s},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},m=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],n=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(e){function t(t,o,n){var i=e.call(this,'<div class="ag-menu"></div>')||this;return i.column=t,i.mouseEvent=o,i.parentEl=n,i.displayName=null,i}return p(t,e),t.prototype.postConstruct=function(){this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof o.Column?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()&&(this.mouseEvent.preventDefault(),this.displayContextMenu())},t.prototype.initializeProperties=function(e){e instanceof o.ProvidedColumnGroup?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some((function(e){return e.isPrimary()&&e.isAllowRowGroup()})),this.allowValues=this.columns.some((function(e){return e.isPrimary()&&e.isAllowValue()})),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some((function(e){return e.isPrimary()&&e.isAllowPivot()}))},t.prototype.buildMenuItemMap=function(){var e=this,t=this.gridOptionsWrapper.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:function(e){return e.isPrimary()&&e.isAllowRowGroup()},activeFunction:function(e){return e.isRowGroupActive()},activateLabel:function(){return t("groupBy","Group by")+" "+e.displayName},deactivateLabel:function(){return t("ungroupBy","Un-Group by")+" "+e.displayName},activateFunction:function(){var t=e.columnModel.getRowGroupColumns();e.columnModel.setRowGroupColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getRowGroupColumns();e.columnModel.setRowGroupColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:function(e){return e.isPrimary()&&e.isAllowValue()},activeFunction:function(e){return e.isValueActive()},activateLabel:function(){return t("addToValues","Add "+e.displayName+" to values",[e.displayName])},deactivateLabel:function(){return t("removeFromValues","Remove "+e.displayName+" from values",[e.displayName])},activateFunction:function(){var t=e.columnModel.getValueColumns();e.columnModel.setValueColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getValueColumns();e.columnModel.setValueColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:function(t){return e.columnModel.isPivotMode()&&t.isPrimary()&&t.isAllowPivot()},activeFunction:function(e){return e.isPivotActive()},activateLabel:function(){return t("addToLabels","Add "+e.displayName+" to labels",[e.displayName])},deactivateLabel:function(){return t("removeFromLabels","Remove "+e.displayName+" from labels",[e.displayName])},activateFunction:function(){var t=e.columnModel.getPivotColumns();e.columnModel.setPivotColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getPivotColumns();e.columnModel.setPivotColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})},t.prototype.addColumnsToList=function(e){return h(e).concat(this.columns.filter((function(t){return-1===e.indexOf(t)})))},t.prototype.removeColumnsFromList=function(e){var t=this;return e.filter((function(e){return-1===t.columns.indexOf(e)}))},t.prototype.displayContextMenu=function(){var e=this,t=this.getGui(),n=this.createBean(new o.AgMenuList),i=this.getMappedMenuItems(),r=function(){};t.appendChild(n.getGui()),n.addMenuItems(i),n.addManagedListener(n,o.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,(function(){e.parentEl.focus(),r()}));var s=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:function(){return e.focusService.focusInto(n.getGui())},ariaLabel:"Foo",closedCallback:function(t){t instanceof KeyboardEvent&&e.parentEl.focus(),e.destroyBean(n)}});s&&(r=s.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})},t.prototype.isActive=function(){return this.allowGrouping||this.allowValues||this.allowPivoting},t.prototype.getMappedMenuItems=function(){var e,t,n=[],i=function(e){var t=r.columns.some((function(t){return e.allowedFunction(t)&&!e.activeFunction(t)})),i=r.columns.some((function(t){return e.allowedFunction(t)&&e.activeFunction(t)}));t&&n.push({name:e.activateLabel(r.displayName),icon:o._.createIconNoSpan(e.addIcon,r.gridOptionsWrapper,null),action:function(){return e.activateFunction()}}),i&&n.push({name:e.deactivateLabel(r.displayName),icon:o._.createIconNoSpan(e.removeIcon,r.gridOptionsWrapper,null),action:function(){return e.deActivateFunction()}})},r=this;try{for(var s=m(this.menuItemMap.values()),l=s.next();!l.done;l=s.next()){i(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return n},c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),c([o.Autowired("popupService")],t.prototype,"popupService",void 0),c([o.Autowired("focusService")],t.prototype,"focusService",void 0),c([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.Component),g=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),v=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},y=function(e){function t(t,o,n,i){var r=e.call(this)||this;return r.modelItem=t,r.allowDragging=o,r.eventType=n,r.focusWrapper=i,r.processingColumnStateChange=!1,r.modelItem=t,r.columnGroup=t.getColumnGroup(),r.columnDept=t.getDept(),r.allowDragging=o,r}return g(t,e),t.prototype.init=function(){var e=this;this.setTemplate(t.TEMPLATE),this.eDragHandle=o._.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");var n=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.columnGroup,this.eventType),o._.missing(this.displayName)&&(this.displayName=">>"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,o.AgCheckbox.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,u.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),o.CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gridOptionsWrapper,null,this.columnGroup).forEach((function(t){return e.addOrRemoveCssClass(t,!0)}))},t.prototype.getColumns=function(){return this.columnGroup.getLeafColumns()},t.prototype.setupTooltip=function(){var e=this,t=this.columnGroup.getColGroupDef();if(t){var n=function(){var o=t.headerTooltip;e.setTooltip(o)};n(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,n)}},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="columnToolPanelColumnGroup",t},t.prototype.handleKeyDown=function(e){switch(e.key){case o.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case o.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case o.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}},t.prototype.onContextMenu=function(e){var t=this,o=this.columnGroup;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var n=this.createBean(new f(o,e,this.focusWrapper));this.addDestroyFunc((function(){n.isAlive()&&t.destroyBean(n)}))}},t.prototype.addVisibilityListenersToAllChildren=function(){var e=this;this.columnGroup.getLeafColumns().forEach((function(t){e.addManagedListener(t,o.Column.EVENT_VISIBLE_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_VALUE_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_PIVOT_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_ROW_GROUP_CHANGED,e.onColumnStateChanged.bind(e))}))},t.prototype.setupDragging=function(){var e=this;if(this.allowDragging){var t={type:o.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDragItem:function(){return e.createDragItem()},onDragStarted:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:e.columnGroup};e.eventService.dispatchEvent(t)},onDragStopped:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};e.eventService.dispatchEvent(t)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc((function(){return e.dragAndDropService.removeDragSource(t)}))}else o._.setDisplayed(this.eDragHandle,!1)},t.prototype.createDragItem=function(){var e={};return this.columnGroup.getLeafColumns().forEach((function(t){e[t.getId()]=t.isVisible()})),{columns:this.columnGroup.getLeafColumns(),visibleState:e}},t.prototype.setupExpandContract=function(){this.eGroupClosedIcon.appendChild(o._.createIcon("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(o._.createIcon("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));var e=new o.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListener(e,o.TouchListener.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))},t.prototype.onLabelClicked=function(){var e=!this.cbSelect.getValue();this.onChangeCommon(e)},t.prototype.onCheckboxChanged=function(e){this.onChangeCommon(e.selected)},t.prototype.getVisibleLeafColumns=function(){var e=[],t=function(o){o.forEach((function(o){o.isPassesFilter()&&(o.isGroup()?t(o.getChildren()):e.push(o.getColumn()))}))};return t(this.modelItem.getChildren()),e},t.prototype.onChangeCommon=function(e){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)},t.prototype.refreshAriaLabel=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");o._.setAriaLabel(this.focusWrapper,this.displayName+" "+t),this.cbSelect.setInputAriaLabel(i+" ("+n+")"),o._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},t.prototype.onColumnStateChanged=function(){var e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(e),this.cbSelect.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1},t.prototype.workOutSelectedValue=function(){var e=this,t=this.columnModel.isPivotMode(),o=this.getVisibleLeafColumns(),n=0,i=0;if(o.forEach((function(o){!t&&o.getColDef().lockVisible||(e.isColumnChecked(o,t)?n++:i++)})),!(n>0&&i>0))return n>0},t.prototype.workOutReadOnlyValue=function(){var e=this.columnModel.isPivotMode(),t=0;return this.columnGroup.getLeafColumns().forEach((function(o){e?o.isAnyFunctionAllowed()&&t++:o.getColDef().lockVisible||t++})),0===t},t.prototype.isColumnChecked=function(e,t){if(t){var o=e.isPivotActive(),n=e.isRowGroupActive(),i=e.isValueActive();return o||n||i}return e.isVisible()},t.prototype.onExpandOrContractClicked=function(){var e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)},t.prototype.onExpandChanged=function(){this.setOpenClosedIcons(),this.refreshAriaExpanded()},t.prototype.setOpenClosedIcons=function(){var e=this.modelItem.isExpanded();o._.setDisplayed(this.eGroupClosedIcon,!e),o._.setDisplayed(this.eGroupOpenedIcon,e)},t.prototype.refreshAriaExpanded=function(){o._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.onSelectAllChanged=function(e){var t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()},t.prototype.isSelected=function(){return this.cbSelect.getValue()},t.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},t.prototype.setSelected=function(e){this.cbSelect.setValue(e,!0)},t.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n </span>\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',v([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),v([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),v([o.Autowired("modelItemUtils")],t.prototype,"modelItemUtils",void 0),v([o.RefSelector("cbSelect")],t.prototype,"cbSelect",void 0),v([o.RefSelector("eLabel")],t.prototype,"eLabel",void 0),v([o.RefSelector("eGroupOpenedIcon")],t.prototype,"eGroupOpenedIcon",void 0),v([o.RefSelector("eGroupClosedIcon")],t.prototype,"eGroupClosedIcon",void 0),v([o.RefSelector("eColumnGroupIcons")],t.prototype,"eColumnGroupIcons",void 0),v([o.PostConstruct],t.prototype,"init",null),t}(o.Component),C=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),E=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},A="ag-list-item-hovered",P=function(e){function t(t,o){var n=e.call(this)||this;return n.comp=t,n.virtualList=o,n.currentDragColumn=null,n.lastHoveredColumnItem=null,n}return C(t,e),t.prototype.postConstruct=function(){this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,this.columnPanelItemDragStart.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,this.columnPanelItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()},t.prototype.columnPanelItemDragStart=function(e){var t=e.column;this.currentDragColumn=t,this.getCurrentColumns().find((function(e){var t=e.getColDef();return!!t.suppressMovable||!!t.lockPosition}))&&(this.moveBlocked=!0)},t.prototype.columnPanelItemDragEnd=function(){var e=this;window.setTimeout((function(){e.currentDragColumn=null,e.moveBlocked=!1}),10)},t.prototype.createDropTarget=function(){var e=this,t={isInterestedIn:function(e){return e===o.DragSourceType.ToolPanel},getIconName:function(){return o.DragAndDropService[e.moveBlocked?"ICON_NOT_ALLOWED":"ICON_MOVE"]},getContainer:function(){return e.comp.getGui()},onDragging:function(t){return e.onDragging(t)},onDragStop:function(){return e.onDragStop()},onDragLeave:function(){return e.onDragLeave()}};this.dragAndDropService.addDropTarget(t)},t.prototype.createAutoScrollService=function(){var e=this.virtualList.getGui();this.autoScrollService=new o.AutoScrollService({scrollContainer:e,scrollAxis:"y",getVerticalPosition:function(){return e.scrollTop},setVerticalPosition:function(t){return e.scrollTop=t}})},t.prototype.onDragging=function(e){if(this.currentDragColumn&&!this.moveBlocked){var t=this.getDragColumnItem(e),n=this.virtualList.getComponentAt(t.rowIndex);if(n){var i=n.getGui().parentElement;this.lastHoveredColumnItem&&this.lastHoveredColumnItem.rowIndex===t.rowIndex&&this.lastHoveredColumnItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredColumnItem=t,o._.radioCssClass(i,""+A),o._.radioCssClass(i,"ag-item-highlight-"+t.position))}}},t.prototype.getDragColumnItem=function(e){var t=this.virtualList.getGui(),o=parseFloat(window.getComputedStyle(t).paddingTop),n=this.virtualList.getRowHeight(),i=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-o+i)/n),s=this.comp.getDisplayedColsList().length-1,l=0|Math.min(s,r);return{rowIndex:l,position:Math.round(r)>r||r>s?"bottom":"top",component:this.virtualList.getComponentAt(l)}},t.prototype.onDragStop=function(){if(!this.moveBlocked){var e=this.getTargetIndex(),t=this.getCurrentColumns();null!=e&&this.columnModel.moveColumns(t,e),this.clearHoveredItems(),this.autoScrollService.ensureCleared()}},t.prototype.getMoveDiff=function(e){var t=this.columnModel.getAllGridColumns(),o=this.getCurrentColumns(),n=o[0],i=o.length;return t.indexOf(n)<e?i:0},t.prototype.getCurrentColumns=function(){return this.currentDragColumn instanceof o.ProvidedColumnGroup?this.currentDragColumn.getLeafColumns():[this.currentDragColumn]},t.prototype.getTargetIndex=function(){if(!this.lastHoveredColumnItem)return null;var e,t=this.lastHoveredColumnItem.component,o="top"===this.lastHoveredColumnItem.position;t instanceof y?(e=t.getColumns()[0],o=!0):e=t.getColumn();var n=this.columnModel.getAllGridColumns().indexOf(e),i=o?n:n+1;return i-this.getMoveDiff(i)},t.prototype.onDragLeave=function(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()},t.prototype.clearHoveredItems=function(){this.virtualList.getGui().querySelectorAll("."+A).forEach((function(e){[A,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach((function(t){e.classList.remove(t)}))})),this.lastHoveredColumnItem=null},E([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),E([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),E([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.BeanStub),D=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),b=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},S=function(e){function t(t,o,n,i,r){var s=e.call(this)||this;return s.column=t,s.columnDept=o,s.allowDragging=n,s.groupsExist=i,s.focusWrapper=r,s.processingColumnStateChange=!1,s}return D(t,e),t.prototype.init=function(){var e=this;this.setTemplate(t.TEMPLATE),this.eDragHandle=o._.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");var n=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel");var r=o._.escapeString(this.displayName);this.eLabel.innerHTML=r;var s=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass("ag-column-select-indent-"+s),this.setupDragging(),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,o.AgCheckbox.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),o.CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(),this.gridOptionsWrapper,this.column,null).forEach((function(t){return e.addOrRemoveCssClass(t,!0)}))},t.prototype.getColumn=function(){return this.column},t.prototype.setupTooltip=function(){var e=this,t=function(){var t=e.column.getColDef().headerTooltip;e.setTooltip(t)};t(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t)},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t},t.prototype.onContextMenu=function(e){var t=this,o=this.column;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var n=this.createBean(new f(o,e,this.focusWrapper));this.addDestroyFunc((function(){n.isAlive()&&t.destroyBean(n)}))}},t.prototype.handleKeyDown=function(e){e.key===o.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))},t.prototype.onLabelClicked=function(){if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=!this.cbSelect.getValue();this.onChangeCommon(e)}},t.prototype.onCheckboxChanged=function(e){this.onChangeCommon(e.selected)},t.prototype.onChangeCommon=function(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))},t.prototype.refreshAriaLabel=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc(),t=e("ariaColumn","Column"),n=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");o._.setAriaLabel(this.focusWrapper,this.displayName+" "+t),this.cbSelect.setInputAriaLabel(i+" ("+n+")"),o._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},t.prototype.setupDragging=function(){var e=this;if(this.allowDragging){var t={type:o.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDragItem:function(){return e.createDragItem()},onDragStarted:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:e.column};e.eventService.dispatchEvent(t)},onDragStopped:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};e.eventService.dispatchEvent(t)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc((function(){return e.dragAndDropService.removeDragSource(t)}))}else o._.setDisplayed(this.eDragHandle,!1)},t.prototype.createDragItem=function(){var e={};return e[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:e}},t.prototype.onColumnStateChanged=function(){this.processingColumnStateChange=!0;var e=this.columnModel.isPivotMode();if(e){var t=this.column.isAnyFunctionActive();this.cbSelect.setValue(t)}else this.cbSelect.setValue(this.column.isVisible());var o=!0,n=!0;if(e){var i=this.gridOptionsWrapper.isFunctionsReadOnly(),r=!this.column.isAnyFunctionAllowed();o=!i&&!r}else o=!this.column.getColDef().lockVisible,n=!this.column.getColDef().lockPosition;this.cbSelect.setReadOnly(!o),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!o);var s=e&&this.gridOptionsWrapper.isFunctionsPassive();this.cbSelect.setPassive(s),this.processingColumnStateChange=!1},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.onSelectAllChanged=function(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())},t.prototype.isSelected=function(){return this.cbSelect.getValue()},t.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},t.prototype.isExpandable=function(){return!1},t.prototype.setExpanded=function(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")},t.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',b([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),b([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),b([o.Autowired("modelItemUtils")],t.prototype,"modelItemUtils",void 0),b([o.RefSelector("eLabel")],t.prototype,"eLabel",void 0),b([o.RefSelector("cbSelect")],t.prototype,"cbSelect",void 0),b([o.PostConstruct],t.prototype,"init",null),t}(o.Component),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),M=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},_=function(){function e(e){this.items=e}return e.prototype.getRowCount=function(){return this.items.length},e.prototype.getRow=function(e){return this.items[e]},e}(),T=function(e){function n(){var t=e.call(this,n.TEMPLATE)||this;return t.destroyColumnItemFuncs=[],t}return L(n,e),n.prototype.destroyColumnTree=function(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach((function(e){return e()})),this.destroyColumnItemFuncs=[]},n.prototype.init=function(e,t,n){var i=this;this.params=e,this.allowDragging=t,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[o.Events.EVENT_COLUMN_PIVOT_CHANGED,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,o.Events.EVENT_COLUMN_VALUE_CHANGED,o.Events.EVENT_COLUMN_VISIBLE,o.Events.EVENT_NEW_COLUMNS_LOADED].forEach((function(e){i.addManagedListener(i.eventService,e,i.fireSelectionChangedEvent.bind(i))})),this.expandGroupsByDefault=!this.params.contractColumnSelection;var r=this.gridOptionsWrapper.getLocaleTextFunc()("ariaColumnList","Column List");this.virtualList=this.createManagedBean(new o.VirtualList("column-select","tree",r)),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((function(e,t){return o._.setAriaLevel(t,e.getDept()+1),i.createComponentFromItem(e,t)})),this.columnModel.isReady()&&this.onColumnsChanged(),e.suppressColumnMove||this.gridOptionsWrapper.isSuppressMovableColumns()||this.createManagedBean(new P(this,this.virtualList))},n.prototype.createComponentFromItem=function(e,t){if(e.isGroup()){var o=new y(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(o),o}var n=new S(e.getColumn(),e.getDept(),this.allowDragging,this.groupsExist,t);return this.getContext().createBean(n),n},n.prototype.onColumnsChanged=function(){var e=this.getExpandedStates(),t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.getDisplayedColsList=function(){return this.displayedColsList},n.prototype.getExpandedStates=function(){if(!this.allColsTree)return{};var e={};return this.forEachItem((function(t){if(t.isGroup()){var o=t.getColumnGroup();o&&(e[o.getId()]=t.isExpanded())}})),e},n.prototype.setExpandedStates=function(e){this.allColsTree&&this.forEachItem((function(t){if(t.isGroup()){var o=t.getColumnGroup();if(o){var n=e[o.getId()];null!=n&&t.setExpanded(n)}}}))},n.prototype.buildTreeFromWhatGridIsDisplaying=function(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))},n.prototype.setColumnLayout=function(e){var t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some((function(e){return e&&void 0!==e.children})),this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.buildTreeFromProvidedColumnDefs=function(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()},n.prototype.buildListModel=function(e){var t=this,n=this.onColumnExpanded.bind(this),i=function(e,t,n){e.forEach((function(e){e instanceof o.ProvidedColumnGroup?r(e,t,n):s(e,t,n)}))},r=function(e,o,r){var s=e.getColGroupDef();if(!(s&&s.suppressColumnsToolPanel))if(e.isPadding())i(e.getChildren(),o,r);else{var l=t.columnModel.getDisplayNameForProvidedColumnGroup(null,e,t.eventType),a=new u(l,e,o,!0,t.expandGroupsByDefault);r.push(a),function(e){e.addEventListener(u.EVENT_EXPANDED_CHANGED,n);var o=e.removeEventListener.bind(e,u.EVENT_EXPANDED_CHANGED,n);t.destroyColumnItemFuncs.push(o)}(a),i(e.getChildren(),o+1,a.getChildren())}},s=function(e,o,n){if(!(e.getColDef()&&e.getColDef().suppressColumnsToolPanel)){var i=t.columnModel.getDisplayNameForColumn(e,"columnToolPanel");n.push(new u(i,e,o))}};this.destroyColumnTree(),i(e,0,this.allColsTree)},n.prototype.onColumnExpanded=function(){this.flattenAndFilterModel()},n.prototype.flattenAndFilterModel=function(){var e=this;this.displayedColsList=[];var t=function(o){o.isPassesFilter()&&(e.displayedColsList.push(o),o.isGroup()&&o.isExpanded()&&o.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new _(this.displayedColsList));var o=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=o&&this.focusRowIfAlive(o),this.notifyListeners()},n.prototype.focusRowIfAlive=function(e){var t=this;window.setTimeout((function(){t.isAlive()&&t.virtualList.focusRow(e)}),0)},n.prototype.forEachItem=function(e){var t=function(o){o.forEach((function(o){e(o),o.isGroup()&&t(o.getChildren())}))};t(this.allColsTree)},n.prototype.doSetExpandedAll=function(e){this.forEachItem((function(t){t.isGroup()&&t.setExpanded(e)}))},n.prototype.setGroupsExpanded=function(e,t){if(t){var n=[];this.forEachItem((function(o){if(o.isGroup()){var i=o.getColumnGroup().getId();t.indexOf(i)>=0&&(o.setExpanded(e),n.push(i))}}));var i=t.filter((function(e){return!o._.includes(n,e)}));i.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",i)}else this.doSetExpandedAll(e)},n.prototype.getExpandState=function(){var e=0,o=0;return this.forEachItem((function(t){t.isGroup()&&(t.isExpanded()?e++:o++)})),e>0&&o>0?t.INDETERMINATE:o>0?t.COLLAPSED:t.EXPANDED},n.prototype.doSetSelectedAll=function(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)},n.prototype.getSelectionState=function(){var e=0,t=0,o=this.columnModel.isPivotMode();if(this.forEachItem((function(n){if(!n.isGroup()&&n.isPassesFilter()){var i,r=n.getColumn(),s=r.getColDef();if(o){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;i=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(s.lockVisible)return;i=r.isVisible()}i?e++:t++}})),!(e>0&&t>0))return!(0===e||t>0)},n.prototype.setFilterText=function(e){this.filterText=o._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.markFilteredColumns=function(){var e=this,t=function(t){if(!o._.exists(e.filterText))return!0;var n=t.getDisplayName();return null==n||-1!==n.toLowerCase().indexOf(e.filterText)},n=function(e,o){var i=!1;if(e.isGroup()){var r=t(e);e.getChildren().forEach((function(e){var t=n(e,r||o);t&&(i=t)}))}var s=!(!o&&!i)||t(e);return e.setPassesFilter(s),s};this.allColsTree.forEach((function(e){return n(e,!1)}))},n.prototype.notifyListeners=function(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()},n.prototype.fireGroupExpandedEvent=function(){var e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})},n.prototype.fireSelectionChangedEvent=function(){var e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})},n.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',M([o.Autowired("columnModel")],n.prototype,"columnModel",void 0),M([o.Autowired("toolPanelColDefService")],n.prototype,"colDefService",void 0),M([o.Autowired("modelItemUtils")],n.prototype,"modelItemUtils",void 0),M([o.PreDestroy],n.prototype,"destroyColumnTree",null),n}(o.Component),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),G=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.createTemplate=function(){return'<div class="ag-pivot-mode-panel">\n <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n </div>'},t.prototype.init=function(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());var e=this.gridOptionsWrapper.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,o.AgCheckbox.EVENT_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))},t.prototype.onBtPivotMode=function(){var e=!!this.cbPivotMode.getValue();if(e!==this.columnModel.isPivotMode()){this.columnModel.setPivotMode(e,"toolPanelUi");var t=this.gridOptionsWrapper.getApi();t&&t.refreshHeader()}},t.prototype.onPivotModeChanged=function(){var e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)},G([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),G([o.RefSelector("cbPivotMode")],t.prototype,"cbPivotMode",void 0),G([o.PreConstruct],t.prototype,"init",null),t}(o.Component),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),x=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},I=function(e){function t(){return e.call(this,t.TEMPLATE)||this}return N(t,e),t.prototype.postConstruct=function(){this.initialiseTabGuard({})},t.prototype.init=function(e,t,n){this.allowDragging=e,this.params=t,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);var i=this.params.suppressColumnFilter,r=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&r&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new o.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)},t.prototype.toggleResizable=function(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})},t.prototype.onExpandAll=function(){this.primaryColsListPanel.doSetExpandedAll(!0)},t.prototype.onCollapseAll=function(){this.primaryColsListPanel.doSetExpandedAll(!1)},t.prototype.expandGroups=function(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)},t.prototype.collapseGroups=function(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)},t.prototype.setColumnLayout=function(e){this.primaryColsListPanel.setColumnLayout(e)},t.prototype.onFilterChanged=function(e){this.primaryColsListPanel.setFilterText(e.filterText)},t.prototype.syncLayoutWithGrid=function(){this.primaryColsListPanel.onColumnsChanged()},t.prototype.onSelectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!0)},t.prototype.onUnselectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!1)},t.prototype.onGroupExpanded=function(e){this.primaryColsHeaderPanel.setExpandState(e.state)},t.prototype.onSelectionChange=function(e){this.primaryColsHeaderPanel.setSelectionState(e.state)},t.TEMPLATE='<div class="ag-column-select">\n <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n </div>',x([o.RefSelector("primaryColsHeaderPanel")],t.prototype,"primaryColsHeaderPanel",void 0),x([o.RefSelector("primaryColsListPanel")],t.prototype,"primaryColsListPanel",void 0),x([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.TabGuardComp),F=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),V=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},R=function(e){function t(){var o=e.call(this,t.TEMPLATE)||this;return o.initialised=!1,o.childDestroyFuncs=[],o}return F(t,e),t.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},t.prototype.init=function(e){var t=this,n={suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};if(o._.mergeDeep(n,e),this.params=n,this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new w),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotModePanel)})),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new I),this.childDestroyFuncs.push((function(){return t.destroyBean(t.primaryColsPanel)})),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new i.RowGroupDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.rowGroupDropZonePanel)})),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new i.ValuesDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.valuesDropZonePanel)})),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new i.PivotDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotDropZonePanel)})),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();var r=this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){t.resetChildrenHeight(),t.setLastVisible()}));this.childDestroyFuncs.push((function(){return r()}))}this.initialised=!0},t.prototype.setPivotModeSectionVisible=function(e){var t=this;this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new w),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotModePanel)}))),this.setLastVisible())},t.prototype.setRowGroupsSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new i.RowGroupDropZonePanel(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())},t.prototype.setValuesSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new i.ValuesDropZonePanel(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())},t.prototype.setPivotSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new i.PivotDropZonePanel(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())},t.prototype.setResizers=function(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach((function(e){if(e){var t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))}}))},t.prototype.setLastVisible=function(){var e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach((function(e){return e.classList.remove("ag-last-column-drop")}));var t=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),n=o._.last(t);n&&n.classList.add("ag-last-column-drop"),this.setResizers()},t.prototype.resetChildrenHeight=function(){for(var e=this.getGui().children,t=0;t<e.length;t++){var o=e[t];o.style.removeProperty("height"),o.style.removeProperty("flex")}},t.prototype.isRowGroupingModuleLoaded=function(){return o.ModuleRegistry.assertRegistered(o.ModuleNames.RowGroupingModule,"Row Grouping")},t.prototype.expandColumnGroups=function(e){this.primaryColsPanel.expandGroups(e)},t.prototype.collapseColumnGroups=function(e){this.primaryColsPanel.collapseGroups(e)},t.prototype.setColumnLayout=function(e){this.primaryColsPanel.setColumnLayout(e)},t.prototype.syncLayoutWithGrid=function(){this.primaryColsPanel.syncLayoutWithGrid()},t.prototype.destroyChildren=function(){this.childDestroyFuncs.forEach((function(e){return e()})),this.childDestroyFuncs.length=0,o._.clearElement(this.getGui())},t.prototype.refresh=function(){this.destroyChildren(),this.init(this.params)},t.prototype.destroy=function(){this.destroyChildren(),e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-column-panel"></div>',V([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),V([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),t}(o.Component),H=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},k=function(){function e(){}return e.prototype.selectAllChildren=function(e,t,o){var n=this.extractAllLeafColumns(e);this.setAllColumns(n,t,o)},e.prototype.setColumn=function(e,t,o){this.setAllColumns([e],t,o)},e.prototype.setAllColumns=function(e,t,o){this.columnModel.isPivotMode()?this.setAllPivot(e,t,o):this.setAllVisible(e,t,o)},e.prototype.extractAllLeafColumns=function(e){var t=[],o=function(e){e.forEach((function(e){e.isPassesFilter()&&(e.isGroup()?o(e.getChildren()):t.push(e.getColumn()))}))};return o(e),t},e.prototype.setAllVisible=function(e,t,o){var n=[];e.forEach((function(e){e.getColDef().lockVisible||e.isVisible()!=t&&n.push({colId:e.getId(),hide:!t})})),n.length>0&&this.columnModel.applyColumnState({state:n},o)},e.prototype.setAllPivot=function(e,t,o){this.gridOptionsWrapper.isFunctionsPassive()?this.setAllPivotPassive(e,t):this.setAllPivotActive(e,t,o)},e.prototype.setAllPivotPassive=function(e,t){var n=this.columnModel.getPivotColumns().slice(),i=this.columnModel.getValueColumns().slice(),r=this.columnModel.getRowGroupColumns().slice(),s=!1,l=!1,a=!1,u=t?function(e){e.isAnyFunctionActive()||(e.isAllowValue()?(i.push(e),l=!0):e.isAllowRowGroup()?(r.push(e),s=!0):e.isAllowPivot()&&(n.push(e),a=!0))}:function(e){e.isAnyFunctionActive()&&(n.indexOf(e)>=0&&(o._.removeFromArray(n,e),s=!0),i.indexOf(e)>=0&&(o._.removeFromArray(i,e),l=!0),r.indexOf(e)>=0&&(o._.removeFromArray(r,e),a=!0))};if(e.forEach(u),s){var p={type:o.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:n,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(p)}if(a){var c={type:o.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:r,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(c)}if(l){var d={type:o.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:r,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(d)}},e.prototype.setAllPivotActive=function(e,t,o){var n=this,i=[],r=t?function(e){if(!e.isAnyFunctionActive())if(e.isAllowValue()){var t="string"==typeof e.getAggFunc()?e.getAggFunc():n.aggFuncService.getDefaultAggFunc(e);i.push({colId:e.getId(),aggFunc:t})}else e.isAllowRowGroup()?i.push({colId:e.getId(),rowGroup:!0}):e.isAllowPivot()&&i.push({colId:e.getId(),pivot:!0})}:function(e){(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&i.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(r),i.length>0&&this.columnModel.applyColumnState({state:i},o)},H([o.Autowired("aggFuncService")],e.prototype,"aggFuncService",void 0),H([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),H([o.Autowired("gridOptionsWrapper")],e.prototype,"gridOptionsWrapper",void 0),H([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),H([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),H([o.Autowired("eventService")],e.prototype,"eventService",void 0),e=H([o.Bean("modelItemUtils")],e)}(),U={moduleName:o.ModuleNames.ColumnToolPanelModule,beans:[k],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:a},{componentName:"AgPrimaryColsList",componentClass:T},{componentName:"AgPrimaryCols",componentClass:I}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:R}],dependantModules:[n.EnterpriseCoreModule,i.RowGroupingModule,r.SideBarModule]};exports.ColumnsToolPanelModule=U,exports.PrimaryColsPanel=I;
* @ag-grid-enterprise/column-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @link http://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),n=require("@ag-grid-enterprise/core"),i=require("@ag-grid-enterprise/row-grouping"),r=require("@ag-grid-enterprise/side-bar"),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),l=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.EXPANDED=0]="EXPANDED",e[e.COLLAPSED=1]="COLLAPSED",e[e.INDETERMINATE=2]="INDETERMINATE"}(t||(t={}));var a=function(e){function n(){return e.call(this,n.TEMPLATE)||this}return s(n,e),n.prototype.postConstruct=function(){var e=this;this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",(function(t){t.key===o.KeyCode.SPACE&&e.onExpandClicked()})),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.eFilterTextField.onValueChange((function(){return e.onFilterTextChanged()})),this.addManagedListener(this.eFilterTextField.getInputElement(),"keypress",this.onMiniFilterKeyPress.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));var t=this.gridOptionsWrapper.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input"))},n.prototype.init=function(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()},n.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=o._.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper)),this.setExpandState(t.EXPANDED)},n.prototype.showOrHideOptions=function(){var e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isPrimaryColumnGroupsPresent(),r=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),o._.setDisplayed(this.eFilterTextField.getGui(),e),o._.setDisplayed(this.eSelect.getGui(),t),o._.setDisplayed(this.eExpand,n&&i)},n.prototype.onFilterTextChanged=function(){var e=this;this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=o._.debounce((function(){var t=e.eFilterTextField.getValue();e.dispatchEvent({type:"filterChanged",filterText:t})}),n.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()},n.prototype.onMiniFilterKeyPress=function(e){var t=this;e.key===o.KeyCode.ENTER&&setTimeout((function(){return t.onSelectClicked()}),n.DEBOUNCE_DELAY)},n.prototype.onSelectClicked=function(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})},n.prototype.onExpandClicked=function(){this.dispatchEvent({type:this.expandState===t.EXPANDED?"collapseAll":"expandAll"})},n.prototype.setExpandState=function(e){this.expandState=e,o._.setDisplayed(this.eExpandChecked,this.expandState===t.EXPANDED),o._.setDisplayed(this.eExpandUnchecked,this.expandState===t.COLLAPSED),o._.setDisplayed(this.eExpandIndeterminate,this.expandState===t.INDETERMINATE)},n.prototype.setSelectionState=function(e){this.selectState=e,this.eSelect.setValue(this.selectState)},n.DEBOUNCE_DELAY=300,n.TEMPLATE='<div class="ag-column-select-header" role="presentation" tabindex="-1">\n <div ref="eExpand" class="ag-column-select-header-icon" tabindex="0"></div>\n <ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>\n <ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field>\n </div>',l([o.Autowired("columnModel")],n.prototype,"columnModel",void 0),l([o.RefSelector("eExpand")],n.prototype,"eExpand",void 0),l([o.RefSelector("eSelect")],n.prototype,"eSelect",void 0),l([o.RefSelector("eFilterTextField")],n.prototype,"eFilterTextField",void 0),l([o.PostConstruct],n.prototype,"postConstruct",null),n}(o.Component),u=function(){function e(e,t,n,i,r){void 0===i&&(i=!1),this.eventService=new o.EventService,this.displayName=e,this.dept=n,this.group=i,i?(this.columnGroup=t,this.expanded=r,this.children=[]):this.column=t}return e.prototype.isGroup=function(){return this.group},e.prototype.getDisplayName=function(){return this.displayName},e.prototype.getColumnGroup=function(){return this.columnGroup},e.prototype.getColumn=function(){return this.column},e.prototype.getDept=function(){return this.dept},e.prototype.isExpanded=function(){return!!this.expanded},e.prototype.getChildren=function(){return this.children},e.prototype.isPassesFilter=function(){return this.passesFilter},e.prototype.setExpanded=function(t){t!==this.expanded&&(this.expanded=t,this.eventService.dispatchEvent({type:e.EVENT_EXPANDED_CHANGED}))},e.prototype.setPassesFilter=function(e){this.passesFilter=e},e.prototype.addEventListener=function(e,t){this.eventService.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventService.removeEventListener(e,t)},e.EVENT_EXPANDED_CHANGED="expandedChanged",e}(),p=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),c=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},d=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,i,r=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}return s},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},m=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],n=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(e){function t(t,o,n){var i=e.call(this,'<div class="ag-menu"></div>')||this;return i.column=t,i.mouseEvent=o,i.parentEl=n,i.displayName=null,i}return p(t,e),t.prototype.postConstruct=function(){this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof o.Column?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()&&(this.mouseEvent.preventDefault(),this.displayContextMenu())},t.prototype.initializeProperties=function(e){e instanceof o.ProvidedColumnGroup?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some((function(e){return e.isPrimary()&&e.isAllowRowGroup()})),this.allowValues=this.columns.some((function(e){return e.isPrimary()&&e.isAllowValue()})),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some((function(e){return e.isPrimary()&&e.isAllowPivot()}))},t.prototype.buildMenuItemMap=function(){var e=this,t=this.gridOptionsWrapper.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:function(e){return e.isPrimary()&&e.isAllowRowGroup()},activeFunction:function(e){return e.isRowGroupActive()},activateLabel:function(){return t("groupBy","Group by")+" "+e.displayName},deactivateLabel:function(){return t("ungroupBy","Un-Group by")+" "+e.displayName},activateFunction:function(){var t=e.columnModel.getRowGroupColumns();e.columnModel.setRowGroupColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getRowGroupColumns();e.columnModel.setRowGroupColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:function(e){return e.isPrimary()&&e.isAllowValue()},activeFunction:function(e){return e.isValueActive()},activateLabel:function(){return t("addToValues","Add "+e.displayName+" to values",[e.displayName])},deactivateLabel:function(){return t("removeFromValues","Remove "+e.displayName+" from values",[e.displayName])},activateFunction:function(){var t=e.columnModel.getValueColumns();e.columnModel.setValueColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getValueColumns();e.columnModel.setValueColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:function(t){return e.columnModel.isPivotMode()&&t.isPrimary()&&t.isAllowPivot()},activeFunction:function(e){return e.isPivotActive()},activateLabel:function(){return t("addToLabels","Add "+e.displayName+" to labels",[e.displayName])},deactivateLabel:function(){return t("removeFromLabels","Remove "+e.displayName+" from labels",[e.displayName])},activateFunction:function(){var t=e.columnModel.getPivotColumns();e.columnModel.setPivotColumns(e.addColumnsToList(t),"toolPanelUi")},deActivateFunction:function(){var t=e.columnModel.getPivotColumns();e.columnModel.setPivotColumns(e.removeColumnsFromList(t),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})},t.prototype.addColumnsToList=function(e){return h(e).concat(this.columns.filter((function(t){return-1===e.indexOf(t)})))},t.prototype.removeColumnsFromList=function(e){var t=this;return e.filter((function(e){return-1===t.columns.indexOf(e)}))},t.prototype.displayContextMenu=function(){var e=this,t=this.getGui(),n=this.createBean(new o.AgMenuList),i=this.getMappedMenuItems(),r=function(){};t.appendChild(n.getGui()),n.addMenuItems(i),n.addManagedListener(n,o.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,(function(){e.parentEl.focus(),r()}));var s=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:function(){return e.focusService.focusInto(n.getGui())},ariaLabel:"Foo",closedCallback:function(t){t instanceof KeyboardEvent&&e.parentEl.focus(),e.destroyBean(n)}});s&&(r=s.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})},t.prototype.isActive=function(){return this.allowGrouping||this.allowValues||this.allowPivoting},t.prototype.getMappedMenuItems=function(){var e,t,n=[],i=function(e){var t=r.columns.some((function(t){return e.allowedFunction(t)&&!e.activeFunction(t)})),i=r.columns.some((function(t){return e.allowedFunction(t)&&e.activeFunction(t)}));t&&n.push({name:e.activateLabel(r.displayName),icon:o._.createIconNoSpan(e.addIcon,r.gridOptionsWrapper,null),action:function(){return e.activateFunction()}}),i&&n.push({name:e.deactivateLabel(r.displayName),icon:o._.createIconNoSpan(e.removeIcon,r.gridOptionsWrapper,null),action:function(){return e.deActivateFunction()}})},r=this;try{for(var s=m(this.menuItemMap.values()),l=s.next();!l.done;l=s.next()){i(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return n},c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),c([o.Autowired("popupService")],t.prototype,"popupService",void 0),c([o.Autowired("focusService")],t.prototype,"focusService",void 0),c([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.Component),g=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),v=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},y=function(e){function t(t,o,n,i){var r=e.call(this)||this;return r.modelItem=t,r.allowDragging=o,r.eventType=n,r.focusWrapper=i,r.processingColumnStateChange=!1,r.modelItem=t,r.columnGroup=t.getColumnGroup(),r.columnDept=t.getDept(),r.allowDragging=o,r}return g(t,e),t.prototype.init=function(){var e=this;this.setTemplate(t.TEMPLATE),this.eDragHandle=o._.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");var n=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.columnGroup,this.eventType),o._.missing(this.displayName)&&(this.displayName=">>"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,o.AgCheckbox.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,u.EVENT_EXPANDED_CHANGED,this.onExpandChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),o.CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gridOptionsWrapper,null,this.columnGroup).forEach((function(t){return e.addOrRemoveCssClass(t,!0)}))},t.prototype.getColumns=function(){return this.columnGroup.getLeafColumns()},t.prototype.setupTooltip=function(){var e=this,t=this.columnGroup.getColGroupDef();if(t){var n=function(){var o=t.headerTooltip;e.setTooltip(o)};n(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,n)}},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="columnToolPanelColumnGroup",t},t.prototype.handleKeyDown=function(e){switch(e.key){case o.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case o.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case o.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}},t.prototype.onContextMenu=function(e){var t=this,o=this.columnGroup;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var n=this.createBean(new f(o,e,this.focusWrapper));this.addDestroyFunc((function(){n.isAlive()&&t.destroyBean(n)}))}},t.prototype.addVisibilityListenersToAllChildren=function(){var e=this;this.columnGroup.getLeafColumns().forEach((function(t){e.addManagedListener(t,o.Column.EVENT_VISIBLE_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_VALUE_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_PIVOT_CHANGED,e.onColumnStateChanged.bind(e)),e.addManagedListener(t,o.Column.EVENT_ROW_GROUP_CHANGED,e.onColumnStateChanged.bind(e))}))},t.prototype.setupDragging=function(){var e=this;if(this.allowDragging){var t={type:o.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDragItem:function(){return e.createDragItem()},onDragStarted:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:e.columnGroup};e.eventService.dispatchEvent(t)},onDragStopped:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};e.eventService.dispatchEvent(t)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc((function(){return e.dragAndDropService.removeDragSource(t)}))}else o._.setDisplayed(this.eDragHandle,!1)},t.prototype.createDragItem=function(){var e={};return this.columnGroup.getLeafColumns().forEach((function(t){e[t.getId()]=t.isVisible()})),{columns:this.columnGroup.getLeafColumns(),visibleState:e}},t.prototype.setupExpandContract=function(){this.eGroupClosedIcon.appendChild(o._.createIcon("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(o._.createIcon("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));var e=new o.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListener(e,o.TouchListener.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))},t.prototype.onLabelClicked=function(){var e=!this.cbSelect.getValue();this.onChangeCommon(e)},t.prototype.onCheckboxChanged=function(e){this.onChangeCommon(e.selected)},t.prototype.getVisibleLeafColumns=function(){var e=[],t=function(o){o.forEach((function(o){o.isPassesFilter()&&(o.isGroup()?t(o.getChildren()):e.push(o.getColumn()))}))};return t(this.modelItem.getChildren()),e},t.prototype.onChangeCommon=function(e){this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)},t.prototype.refreshAriaLabel=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");o._.setAriaLabel(this.focusWrapper,this.displayName+" "+t),this.cbSelect.setInputAriaLabel(i+" ("+n+")"),o._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},t.prototype.onColumnStateChanged=function(){var e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(e),this.cbSelect.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1},t.prototype.workOutSelectedValue=function(){var e=this,t=this.columnModel.isPivotMode(),o=this.getVisibleLeafColumns(),n=0,i=0;if(o.forEach((function(o){!t&&o.getColDef().lockVisible||(e.isColumnChecked(o,t)?n++:i++)})),!(n>0&&i>0))return n>0},t.prototype.workOutReadOnlyValue=function(){var e=this.columnModel.isPivotMode(),t=0;return this.columnGroup.getLeafColumns().forEach((function(o){e?o.isAnyFunctionAllowed()&&t++:o.getColDef().lockVisible||t++})),0===t},t.prototype.isColumnChecked=function(e,t){if(t){var o=e.isPivotActive(),n=e.isRowGroupActive(),i=e.isValueActive();return o||n||i}return e.isVisible()},t.prototype.onExpandOrContractClicked=function(){var e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)},t.prototype.onExpandChanged=function(){this.setOpenClosedIcons(),this.refreshAriaExpanded()},t.prototype.setOpenClosedIcons=function(){var e=this.modelItem.isExpanded();o._.setDisplayed(this.eGroupClosedIcon,!e),o._.setDisplayed(this.eGroupOpenedIcon,e)},t.prototype.refreshAriaExpanded=function(){o._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.onSelectAllChanged=function(e){var t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()},t.prototype.isSelected=function(){return this.cbSelect.getValue()},t.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},t.prototype.setSelected=function(e){this.cbSelect.setValue(e,!0)},t.TEMPLATE='<div class="ag-column-select-column-group" aria-hidden="true">\n <span class="ag-column-group-icons" ref="eColumnGroupIcons" >\n <span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span>\n <span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span>\n </span>\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',v([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),v([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),v([o.Autowired("modelItemUtils")],t.prototype,"modelItemUtils",void 0),v([o.RefSelector("cbSelect")],t.prototype,"cbSelect",void 0),v([o.RefSelector("eLabel")],t.prototype,"eLabel",void 0),v([o.RefSelector("eGroupOpenedIcon")],t.prototype,"eGroupOpenedIcon",void 0),v([o.RefSelector("eGroupClosedIcon")],t.prototype,"eGroupClosedIcon",void 0),v([o.RefSelector("eColumnGroupIcons")],t.prototype,"eColumnGroupIcons",void 0),v([o.PostConstruct],t.prototype,"init",null),t}(o.Component),C=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),E=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},A="ag-list-item-hovered",P=function(e){function t(t,o){var n=e.call(this)||this;return n.comp=t,n.virtualList=o,n.currentDragColumn=null,n.lastHoveredColumnItem=null,n}return C(t,e),t.prototype.postConstruct=function(){this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,this.columnPanelItemDragStart.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,this.columnPanelItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()},t.prototype.columnPanelItemDragStart=function(e){var t=e.column;this.currentDragColumn=t,this.getCurrentColumns().find((function(e){var t=e.getColDef();return!!t.suppressMovable||!!t.lockPosition}))&&(this.moveBlocked=!0)},t.prototype.columnPanelItemDragEnd=function(){var e=this;window.setTimeout((function(){e.currentDragColumn=null,e.moveBlocked=!1}),10)},t.prototype.createDropTarget=function(){var e=this,t={isInterestedIn:function(e){return e===o.DragSourceType.ToolPanel},getIconName:function(){return o.DragAndDropService[e.moveBlocked?"ICON_NOT_ALLOWED":"ICON_MOVE"]},getContainer:function(){return e.comp.getGui()},onDragging:function(t){return e.onDragging(t)},onDragStop:function(){return e.onDragStop()},onDragLeave:function(){return e.onDragLeave()}};this.dragAndDropService.addDropTarget(t)},t.prototype.createAutoScrollService=function(){var e=this.virtualList.getGui();this.autoScrollService=new o.AutoScrollService({scrollContainer:e,scrollAxis:"y",getVerticalPosition:function(){return e.scrollTop},setVerticalPosition:function(t){return e.scrollTop=t}})},t.prototype.onDragging=function(e){if(this.currentDragColumn&&!this.moveBlocked){var t=this.getDragColumnItem(e),n=this.virtualList.getComponentAt(t.rowIndex);if(n){var i=n.getGui().parentElement;this.lastHoveredColumnItem&&this.lastHoveredColumnItem.rowIndex===t.rowIndex&&this.lastHoveredColumnItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredColumnItem=t,o._.radioCssClass(i,""+A),o._.radioCssClass(i,"ag-item-highlight-"+t.position))}}},t.prototype.getDragColumnItem=function(e){var t=this.virtualList.getGui(),o=parseFloat(window.getComputedStyle(t).paddingTop),n=this.virtualList.getRowHeight(),i=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-o+i)/n),s=this.comp.getDisplayedColsList().length-1,l=0|Math.min(s,r);return{rowIndex:l,position:Math.round(r)>r||r>s?"bottom":"top",component:this.virtualList.getComponentAt(l)}},t.prototype.onDragStop=function(){if(!this.moveBlocked){var e=this.getTargetIndex(),t=this.getCurrentColumns();null!=e&&this.columnModel.moveColumns(t,e),this.clearHoveredItems(),this.autoScrollService.ensureCleared()}},t.prototype.getMoveDiff=function(e){var t=this.columnModel.getAllGridColumns(),o=this.getCurrentColumns(),n=o[0],i=o.length;return t.indexOf(n)<e?i:0},t.prototype.getCurrentColumns=function(){return this.currentDragColumn instanceof o.ProvidedColumnGroup?this.currentDragColumn.getLeafColumns():[this.currentDragColumn]},t.prototype.getTargetIndex=function(){if(!this.lastHoveredColumnItem)return null;var e,t=this.lastHoveredColumnItem.component,o="top"===this.lastHoveredColumnItem.position;t instanceof y?(e=t.getColumns()[0],o=!0):e=t.getColumn();var n=this.columnModel.getAllGridColumns().indexOf(e),i=o?n:n+1;return i-this.getMoveDiff(i)},t.prototype.onDragLeave=function(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()},t.prototype.clearHoveredItems=function(){this.virtualList.getGui().querySelectorAll("."+A).forEach((function(e){[A,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach((function(t){e.classList.remove(t)}))})),this.lastHoveredColumnItem=null},E([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),E([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),E([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.BeanStub),D=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),b=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},S=function(e){function t(t,o,n,i,r){var s=e.call(this)||this;return s.column=t,s.columnDept=o,s.allowDragging=n,s.groupsExist=i,s.focusWrapper=r,s.processingColumnStateChange=!1,s}return D(t,e),t.prototype.init=function(){var e=this;this.setTemplate(t.TEMPLATE),this.eDragHandle=o._.createIconNoSpan("columnDrag",this.gridOptionsWrapper),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");var n=this.cbSelect.getGui(),i=this.cbSelect.getInputElement();n.insertAdjacentElement("afterend",this.eDragHandle),i.setAttribute("tabindex","-1"),this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel");var r=o._.escapeString(this.displayName);this.eLabel.innerHTML=r;var s=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass("ag-column-select-indent-"+s),this.setupDragging(),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,o.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.focusWrapper,"keydown",this.handleKeyDown.bind(this)),this.addManagedListener(this.focusWrapper,"contextmenu",this.onContextMenu.bind(this)),this.addManagedListener(this.gridOptionsWrapper,"functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,o.AgCheckbox.EVENT_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),o.CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(),this.gridOptionsWrapper,this.column,null).forEach((function(t){return e.addOrRemoveCssClass(t,!0)}))},t.prototype.getColumn=function(){return this.column},t.prototype.setupTooltip=function(){var e=this,t=function(){var t=e.column.getColDef().headerTooltip;e.setTooltip(t)};t(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t)},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t},t.prototype.onContextMenu=function(e){var t=this,o=this.column;if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var n=this.createBean(new f(o,e,this.focusWrapper));this.addDestroyFunc((function(){n.isAlive()&&t.destroyBean(n)}))}},t.prototype.handleKeyDown=function(e){e.key===o.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))},t.prototype.onLabelClicked=function(){if(!this.gridOptionsWrapper.isFunctionsReadOnly()){var e=!this.cbSelect.getValue();this.onChangeCommon(e)}},t.prototype.onCheckboxChanged=function(e){this.onChangeCommon(e.selected)},t.prototype.onChangeCommon=function(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))},t.prototype.refreshAriaLabel=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc(),t=e("ariaColumn","Column"),n=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");o._.setAriaLabel(this.focusWrapper,this.displayName+" "+t),this.cbSelect.setInputAriaLabel(i+" ("+n+")"),o._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)},t.prototype.setupDragging=function(){var e=this;if(this.allowDragging){var t={type:o.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDragItem:function(){return e.createDragItem()},onDragStarted:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:e.column};e.eventService.dispatchEvent(t)},onDragStopped:function(){var t={type:o.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};e.eventService.dispatchEvent(t)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc((function(){return e.dragAndDropService.removeDragSource(t)}))}else o._.setDisplayed(this.eDragHandle,!1)},t.prototype.createDragItem=function(){var e={};return e[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:e}},t.prototype.onColumnStateChanged=function(){this.processingColumnStateChange=!0;var e=this.columnModel.isPivotMode();if(e){var t=this.column.isAnyFunctionActive();this.cbSelect.setValue(t)}else this.cbSelect.setValue(this.column.isVisible());var o=!0,n=!0;if(e){var i=this.gridOptionsWrapper.isFunctionsReadOnly(),r=!this.column.isAnyFunctionAllowed();n=o=!i&&!r}else{var s=this.column.getColDef(),l=s.enableRowGroup,a=s.enableValue,u=s.lockPosition,p=s.suppressMovable;o=!s.lockVisible,n=!!l||!!a||!(!!u||!!p)}this.cbSelect.setReadOnly(!o),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!o);var c=e&&this.gridOptionsWrapper.isFunctionsPassive();this.cbSelect.setPassive(c),this.processingColumnStateChange=!1},t.prototype.getDisplayName=function(){return this.displayName},t.prototype.onSelectAllChanged=function(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())},t.prototype.isSelected=function(){return this.cbSelect.getValue()},t.prototype.isSelectable=function(){return!this.cbSelect.isReadOnly()},t.prototype.isExpandable=function(){return!1},t.prototype.setExpanded=function(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")},t.TEMPLATE='<div class="ag-column-select-column" aria-hidden="true">\n <ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>\n <span class="ag-column-select-column-label" ref="eLabel"></span>\n </div>',b([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),b([o.Autowired("dragAndDropService")],t.prototype,"dragAndDropService",void 0),b([o.Autowired("modelItemUtils")],t.prototype,"modelItemUtils",void 0),b([o.RefSelector("eLabel")],t.prototype,"eLabel",void 0),b([o.RefSelector("cbSelect")],t.prototype,"cbSelect",void 0),b([o.PostConstruct],t.prototype,"init",null),t}(o.Component),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),M=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},_=function(){function e(e){this.items=e}return e.prototype.getRowCount=function(){return this.items.length},e.prototype.getRow=function(e){return this.items[e]},e}(),T=function(e){function n(){var t=e.call(this,n.TEMPLATE)||this;return t.destroyColumnItemFuncs=[],t}return L(n,e),n.prototype.destroyColumnTree=function(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach((function(e){return e()})),this.destroyColumnItemFuncs=[]},n.prototype.init=function(e,t,n){var i=this;this.params=e,this.allowDragging=t,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[o.Events.EVENT_COLUMN_PIVOT_CHANGED,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,o.Events.EVENT_COLUMN_VALUE_CHANGED,o.Events.EVENT_COLUMN_VISIBLE,o.Events.EVENT_NEW_COLUMNS_LOADED].forEach((function(e){i.addManagedListener(i.eventService,e,i.fireSelectionChangedEvent.bind(i))})),this.expandGroupsByDefault=!this.params.contractColumnSelection;var r=this.gridOptionsWrapper.getLocaleTextFunc()("ariaColumnList","Column List");this.virtualList=this.createManagedBean(new o.VirtualList("column-select","tree",r)),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((function(e,t){return o._.setAriaLevel(t,e.getDept()+1),i.createComponentFromItem(e,t)})),this.columnModel.isReady()&&this.onColumnsChanged(),e.suppressColumnMove||this.gridOptionsWrapper.isSuppressMovableColumns()||this.createManagedBean(new P(this,this.virtualList))},n.prototype.createComponentFromItem=function(e,t){if(e.isGroup()){var o=new y(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(o),o}var n=new S(e.getColumn(),e.getDept(),this.allowDragging,this.groupsExist,t);return this.getContext().createBean(n),n},n.prototype.onColumnsChanged=function(){var e=this.getExpandedStates(),t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.getDisplayedColsList=function(){return this.displayedColsList},n.prototype.getExpandedStates=function(){if(!this.allColsTree)return{};var e={};return this.forEachItem((function(t){if(t.isGroup()){var o=t.getColumnGroup();o&&(e[o.getId()]=t.isExpanded())}})),e},n.prototype.setExpandedStates=function(e){this.allColsTree&&this.forEachItem((function(t){if(t.isGroup()){var o=t.getColumnGroup();if(o){var n=e[o.getId()];null!=n&&t.setExpanded(n)}}}))},n.prototype.buildTreeFromWhatGridIsDisplaying=function(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))},n.prototype.setColumnLayout=function(e){var t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some((function(e){return e&&void 0!==e.children})),this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.buildTreeFromProvidedColumnDefs=function(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()},n.prototype.buildListModel=function(e){var t=this,n=this.onColumnExpanded.bind(this),i=function(e,t,n){e.forEach((function(e){e instanceof o.ProvidedColumnGroup?r(e,t,n):s(e,t,n)}))},r=function(e,o,r){var s=e.getColGroupDef();if(!(s&&s.suppressColumnsToolPanel))if(e.isPadding())i(e.getChildren(),o,r);else{var l=t.columnModel.getDisplayNameForProvidedColumnGroup(null,e,t.eventType),a=new u(l,e,o,!0,t.expandGroupsByDefault);r.push(a),function(e){e.addEventListener(u.EVENT_EXPANDED_CHANGED,n);var o=e.removeEventListener.bind(e,u.EVENT_EXPANDED_CHANGED,n);t.destroyColumnItemFuncs.push(o)}(a),i(e.getChildren(),o+1,a.getChildren())}},s=function(e,o,n){if(!(e.getColDef()&&e.getColDef().suppressColumnsToolPanel)){var i=t.columnModel.getDisplayNameForColumn(e,"columnToolPanel");n.push(new u(i,e,o))}};this.destroyColumnTree(),i(e,0,this.allColsTree)},n.prototype.onColumnExpanded=function(){this.flattenAndFilterModel()},n.prototype.flattenAndFilterModel=function(){var e=this;this.displayedColsList=[];var t=function(o){o.isPassesFilter()&&(e.displayedColsList.push(o),o.isGroup()&&o.isExpanded()&&o.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new _(this.displayedColsList));var o=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),null!=o&&this.focusRowIfAlive(o),this.notifyListeners()},n.prototype.focusRowIfAlive=function(e){var t=this;window.setTimeout((function(){t.isAlive()&&t.virtualList.focusRow(e)}),0)},n.prototype.forEachItem=function(e){var t=function(o){o.forEach((function(o){e(o),o.isGroup()&&t(o.getChildren())}))};t(this.allColsTree)},n.prototype.doSetExpandedAll=function(e){this.forEachItem((function(t){t.isGroup()&&t.setExpanded(e)}))},n.prototype.setGroupsExpanded=function(e,t){if(t){var n=[];this.forEachItem((function(o){if(o.isGroup()){var i=o.getColumnGroup().getId();t.indexOf(i)>=0&&(o.setExpanded(e),n.push(i))}}));var i=t.filter((function(e){return!o._.includes(n,e)}));i.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",i)}else this.doSetExpandedAll(e)},n.prototype.getExpandState=function(){var e=0,o=0;return this.forEachItem((function(t){t.isGroup()&&(t.isExpanded()?e++:o++)})),e>0&&o>0?t.INDETERMINATE:o>0?t.COLLAPSED:t.EXPANDED},n.prototype.doSetSelectedAll=function(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)},n.prototype.getSelectionState=function(){var e=0,t=0,o=this.columnModel.isPivotMode();if(this.forEachItem((function(n){if(!n.isGroup()&&n.isPassesFilter()){var i,r=n.getColumn(),s=r.getColDef();if(o){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;i=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(s.lockVisible)return;i=r.isVisible()}i?e++:t++}})),!(e>0&&t>0))return!(0===e||t>0)},n.prototype.setFilterText=function(e){this.filterText=o._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()},n.prototype.markFilteredColumns=function(){var e=this,t=function(t){if(!o._.exists(e.filterText))return!0;var n=t.getDisplayName();return null==n||-1!==n.toLowerCase().indexOf(e.filterText)},n=function(e,o){var i=!1;if(e.isGroup()){var r=t(e);e.getChildren().forEach((function(e){var t=n(e,r||o);t&&(i=t)}))}var s=!(!o&&!i)||t(e);return e.setPassesFilter(s),s};this.allColsTree.forEach((function(e){return n(e,!1)}))},n.prototype.notifyListeners=function(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()},n.prototype.fireGroupExpandedEvent=function(){var e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})},n.prototype.fireSelectionChangedEvent=function(){var e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})},n.TEMPLATE='<div class="ag-column-select-list" role="presentation"></div>',M([o.Autowired("columnModel")],n.prototype,"columnModel",void 0),M([o.Autowired("toolPanelColDefService")],n.prototype,"colDefService",void 0),M([o.Autowired("modelItemUtils")],n.prototype,"modelItemUtils",void 0),M([o.PreDestroy],n.prototype,"destroyColumnTree",null),n}(o.Component),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),G=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.createTemplate=function(){return'<div class="ag-pivot-mode-panel">\n <ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>\n </div>'},t.prototype.init=function(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());var e=this.gridOptionsWrapper.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,o.AgCheckbox.EVENT_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))},t.prototype.onBtPivotMode=function(){var e=!!this.cbPivotMode.getValue();if(e!==this.columnModel.isPivotMode()){this.columnModel.setPivotMode(e,"toolPanelUi");var t=this.gridOptionsWrapper.getApi();t&&t.refreshHeader()}},t.prototype.onPivotModeChanged=function(){var e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)},G([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),G([o.RefSelector("cbPivotMode")],t.prototype,"cbPivotMode",void 0),G([o.PreConstruct],t.prototype,"init",null),t}(o.Component),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),x=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},I=function(e){function t(){return e.call(this,t.TEMPLATE)||this}return N(t,e),t.prototype.postConstruct=function(){this.initialiseTabGuard({})},t.prototype.init=function(e,t,n){this.allowDragging=e,this.params=t,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);var i=this.params.suppressColumnFilter,r=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&r&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListener(this.primaryColsListPanel,"groupExpanded",this.onGroupExpanded.bind(this)),this.addManagedListener(this.primaryColsListPanel,"selectionChanged",this.onSelectionChange.bind(this)),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListener(this.primaryColsHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"selectAll",this.onSelectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"unselectAll",this.onUnselectAll.bind(this)),this.addManagedListener(this.primaryColsHeaderPanel,"filterChanged",this.onFilterChanged.bind(this)),this.positionableFeature=new o.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)},t.prototype.toggleResizable=function(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})},t.prototype.onExpandAll=function(){this.primaryColsListPanel.doSetExpandedAll(!0)},t.prototype.onCollapseAll=function(){this.primaryColsListPanel.doSetExpandedAll(!1)},t.prototype.expandGroups=function(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)},t.prototype.collapseGroups=function(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)},t.prototype.setColumnLayout=function(e){this.primaryColsListPanel.setColumnLayout(e)},t.prototype.onFilterChanged=function(e){this.primaryColsListPanel.setFilterText(e.filterText)},t.prototype.syncLayoutWithGrid=function(){this.primaryColsListPanel.onColumnsChanged()},t.prototype.onSelectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!0)},t.prototype.onUnselectAll=function(){this.primaryColsListPanel.doSetSelectedAll(!1)},t.prototype.onGroupExpanded=function(e){this.primaryColsHeaderPanel.setExpandState(e.state)},t.prototype.onSelectionChange=function(e){this.primaryColsHeaderPanel.setSelectionState(e.state)},t.TEMPLATE='<div class="ag-column-select">\n <ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header>\n <ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list>\n </div>',x([o.RefSelector("primaryColsHeaderPanel")],t.prototype,"primaryColsHeaderPanel",void 0),x([o.RefSelector("primaryColsListPanel")],t.prototype,"primaryColsListPanel",void 0),x([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.TabGuardComp),F=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),V=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},R=function(e){function t(){var o=e.call(this,t.TEMPLATE)||this;return o.initialised=!1,o.childDestroyFuncs=[],o}return F(t,e),t.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},t.prototype.init=function(e){var t=this,n={suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};if(o._.mergeDeep(n,e),this.params=n,this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new w),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotModePanel)})),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new I),this.childDestroyFuncs.push((function(){return t.destroyBean(t.primaryColsPanel)})),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new i.RowGroupDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.rowGroupDropZonePanel)})),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new i.ValuesDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.valuesDropZonePanel)})),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new i.PivotDropZonePanel(!1)),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotDropZonePanel)})),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();var r=this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){t.resetChildrenHeight(),t.setLastVisible()}));this.childDestroyFuncs.push((function(){return r()}))}this.initialised=!0},t.prototype.setPivotModeSectionVisible=function(e){var t=this;this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new w),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push((function(){return t.destroyBean(t.pivotModePanel)}))),this.setLastVisible())},t.prototype.setRowGroupsSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new i.RowGroupDropZonePanel(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())},t.prototype.setValuesSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new i.ValuesDropZonePanel(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())},t.prototype.setPivotSectionVisible=function(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new i.PivotDropZonePanel(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())},t.prototype.setResizers=function(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach((function(e){if(e){var t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))}}))},t.prototype.setLastVisible=function(){var e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach((function(e){return e.classList.remove("ag-last-column-drop")}));var t=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),n=o._.last(t);n&&n.classList.add("ag-last-column-drop"),this.setResizers()},t.prototype.resetChildrenHeight=function(){for(var e=this.getGui().children,t=0;t<e.length;t++){var o=e[t];o.style.removeProperty("height"),o.style.removeProperty("flex")}},t.prototype.isRowGroupingModuleLoaded=function(){return o.ModuleRegistry.assertRegistered(o.ModuleNames.RowGroupingModule,"Row Grouping")},t.prototype.expandColumnGroups=function(e){this.primaryColsPanel.expandGroups(e)},t.prototype.collapseColumnGroups=function(e){this.primaryColsPanel.collapseGroups(e)},t.prototype.setColumnLayout=function(e){this.primaryColsPanel.setColumnLayout(e)},t.prototype.syncLayoutWithGrid=function(){this.primaryColsPanel.syncLayoutWithGrid()},t.prototype.destroyChildren=function(){this.childDestroyFuncs.forEach((function(e){return e()})),this.childDestroyFuncs.length=0,o._.clearElement(this.getGui())},t.prototype.refresh=function(){this.destroyChildren(),this.init(this.params)},t.prototype.destroy=function(){this.destroyChildren(),e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-column-panel"></div>',V([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),V([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),t}(o.Component),H=function(e,t,o,n){var i,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},k=function(){function e(){}return e.prototype.selectAllChildren=function(e,t,o){var n=this.extractAllLeafColumns(e);this.setAllColumns(n,t,o)},e.prototype.setColumn=function(e,t,o){this.setAllColumns([e],t,o)},e.prototype.setAllColumns=function(e,t,o){this.columnModel.isPivotMode()?this.setAllPivot(e,t,o):this.setAllVisible(e,t,o)},e.prototype.extractAllLeafColumns=function(e){var t=[],o=function(e){e.forEach((function(e){e.isPassesFilter()&&(e.isGroup()?o(e.getChildren()):t.push(e.getColumn()))}))};return o(e),t},e.prototype.setAllVisible=function(e,t,o){var n=[];e.forEach((function(e){e.getColDef().lockVisible||e.isVisible()!=t&&n.push({colId:e.getId(),hide:!t})})),n.length>0&&this.columnModel.applyColumnState({state:n},o)},e.prototype.setAllPivot=function(e,t,o){this.gridOptionsWrapper.isFunctionsPassive()?this.setAllPivotPassive(e,t):this.setAllPivotActive(e,t,o)},e.prototype.setAllPivotPassive=function(e,t){var n=this.columnModel.getPivotColumns().slice(),i=this.columnModel.getValueColumns().slice(),r=this.columnModel.getRowGroupColumns().slice(),s=!1,l=!1,a=!1,u=t?function(e){e.isAnyFunctionActive()||(e.isAllowValue()?(i.push(e),l=!0):e.isAllowRowGroup()?(r.push(e),s=!0):e.isAllowPivot()&&(n.push(e),a=!0))}:function(e){e.isAnyFunctionActive()&&(n.indexOf(e)>=0&&(o._.removeFromArray(n,e),s=!0),i.indexOf(e)>=0&&(o._.removeFromArray(i,e),l=!0),r.indexOf(e)>=0&&(o._.removeFromArray(r,e),a=!0))};if(e.forEach(u),s){var p={type:o.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:n,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(p)}if(a){var c={type:o.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:r,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(c)}if(l){var d={type:o.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:r,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(d)}},e.prototype.setAllPivotActive=function(e,t,o){var n=this,i=[],r=t?function(e){if(!e.isAnyFunctionActive())if(e.isAllowValue()){var t="string"==typeof e.getAggFunc()?e.getAggFunc():n.aggFuncService.getDefaultAggFunc(e);i.push({colId:e.getId(),aggFunc:t})}else e.isAllowRowGroup()?i.push({colId:e.getId(),rowGroup:!0}):e.isAllowPivot()&&i.push({colId:e.getId(),pivot:!0})}:function(e){(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&i.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(r),i.length>0&&this.columnModel.applyColumnState({state:i},o)},H([o.Autowired("aggFuncService")],e.prototype,"aggFuncService",void 0),H([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),H([o.Autowired("gridOptionsWrapper")],e.prototype,"gridOptionsWrapper",void 0),H([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),H([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),H([o.Autowired("eventService")],e.prototype,"eventService",void 0),e=H([o.Bean("modelItemUtils")],e)}(),U={moduleName:o.ModuleNames.ColumnToolPanelModule,beans:[k],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:a},{componentName:"AgPrimaryColsList",componentClass:T},{componentName:"AgPrimaryCols",componentClass:I}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:R}],dependantModules:[n.EnterpriseCoreModule,i.RowGroupingModule,r.SideBarModule]};exports.ColumnsToolPanelModule=U,exports.PrimaryColsPanel=I;

@@ -197,6 +197,10 @@ var __extends = (this && this.__extends) || (function () {

canBeToggled = !functionsReadOnly && !noFunctionsAllowed;
canBeDragged = canBeToggled;
}
else {
canBeToggled = !this.column.getColDef().lockVisible;
canBeDragged = !this.column.getColDef().lockPosition;
var _a = this.column.getColDef(), enableRowGroup = _a.enableRowGroup, enableValue = _a.enableValue, lockPosition = _a.lockPosition, suppressMovable = _a.suppressMovable, lockVisible = _a.lockVisible;
var forceDraggable = !!enableRowGroup || !!enableValue;
var disableDraggable = !!lockPosition || !!suppressMovable;
canBeToggled = !lockVisible;
canBeDragged = forceDraggable || !disableDraggable;
}

@@ -203,0 +207,0 @@ this.cbSelect.setReadOnly(!canBeToggled);

@@ -178,6 +178,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

canBeToggled = !functionsReadOnly && !noFunctionsAllowed;
canBeDragged = canBeToggled;
}
else {
canBeToggled = !this.column.getColDef().lockVisible;
canBeDragged = !this.column.getColDef().lockPosition;
const { enableRowGroup, enableValue, lockPosition, suppressMovable, lockVisible } = this.column.getColDef();
const forceDraggable = !!enableRowGroup || !!enableValue;
const disableDraggable = !!lockPosition || !!suppressMovable;
canBeToggled = !lockVisible;
canBeDragged = forceDraggable || !disableDraggable;
}

@@ -184,0 +188,0 @@ this.cbSelect.setReadOnly(!canBeToggled);

{
"name": "@ag-grid-enterprise/column-tool-panel",
"version": "27.0.0",
"version": "27.1.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -46,6 +46,6 @@ "main": "./dist/cjs/es5/main.js",

"dependencies": {
"@ag-grid-community/core": "~27.0.0",
"@ag-grid-enterprise/core": "~27.0.0",
"@ag-grid-enterprise/row-grouping": "~27.0.0",
"@ag-grid-enterprise/side-bar": "~27.0.0"
"@ag-grid-community/core": "~27.1.0",
"@ag-grid-enterprise/core": "~27.1.0",
"@ag-grid-enterprise/row-grouping": "~27.1.0",
"@ag-grid-enterprise/side-bar": "~27.1.0"
},

@@ -52,0 +52,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc