@ag-grid-enterprise/column-tool-panel
Advanced tools
Comparing version 31.3.2 to 32.0.0
@@ -5,6 +5,4 @@ # Contributing to AG Grid Enterprise | ||
Retention of Intellectual Property Rights for AG Grid Enterprise component | ||
============== | ||
# Retention of Intellectual Property Rights for AG Grid Enterprise component | ||
1.DEFINITIONS | ||
@@ -27,9 +25,9 @@ | ||
- [Question or Problem?](#question) | ||
- [Issues and Bugs](#issue) | ||
- [Feature Requests](#feature) | ||
- [Submission Guidelines](#submit) | ||
- [Coding Rules](#rules) | ||
- [Commit Message Guidelines](#commit) | ||
- [Signing the CLA](#cla) | ||
- [Question or Problem?](#question) | ||
- [Issues and Bugs](#issue) | ||
- [Feature Requests](#feature) | ||
- [Submission Guidelines](#submit) | ||
- [Coding Rules](#rules) | ||
- [Commit Message Guidelines](#commit) | ||
- [Signing the CLA](#cla) | ||
@@ -45,2 +43,3 @@ ## <a name="question"></a> Got a Question or Problem? | ||
## <a name="issue"></a> Found a Bug? | ||
If you find a bug in the source code, you can help us by | ||
@@ -50,3 +49,4 @@ [submitting an issue](#submit-issue) to our [GitHub Repository][github]. | ||
## <a name="feature"></a> Missing a Feature? | ||
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub | ||
You can _request_ a new feature by [submitting an issue](#submit-issue) to our GitHub | ||
Repository. | ||
@@ -62,5 +62,5 @@ | ||
- version of AG Grid Enterprise used | ||
- 3rd-party libraries and their versions | ||
- and most importantly - a use-case that fails | ||
- version of AG Grid Enterprise used | ||
- 3rd-party libraries and their versions | ||
- and most importantly - a use-case that fails | ||
@@ -78,3 +78,1 @@ A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem. | ||
[stackoverflow]: http://stackoverflow.com/questions/tagged/ag-grid | ||
@@ -1,20 +0,20 @@ | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,e,t)=>e in o?__defProp(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,__spreadValues=(o,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(o,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(o,t,e[t]);return o},__export=(o,e)=>{for(var t in e)__defProp(o,t,{get:e[t],enumerable:!0})},__copyProps=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of __getOwnPropNames(e))!__hasOwnProp.call(o,i)&&i!==t&&__defProp(o,i,{get:()=>e[i],enumerable:!(s=__getOwnPropDesc(e,i))||s.enumerable});return o},__toCommonJS=o=>__copyProps(__defProp({},"__esModule",{value:!0}),o),__decorateClass=(o,e,t,s)=>{for(var i=s>1?void 0:s?__getOwnPropDesc(e,t):e,n=o.length-1,a;n>=0;n--)(a=o[n])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&__defProp(e,t,i),i},main_exports={};__export(main_exports,{ColumnsToolPanelModule:()=>ColumnsToolPanelModule,PrimaryColsPanel:()=>PrimaryColsPanel}),module.exports=__toCommonJS(main_exports);var import_core12=require("@ag-grid-community/core"),import_core13=require("@ag-grid-enterprise/core"),import_core=require("@ag-grid-community/core"),_PrimaryColsHeaderPanel=class h extends import_core.Component{constructor(){super(h.TEMPLATE)}postConstruct(){this.createExpandIcons(),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eExpand,"keydown",t=>{t.key===import_core.KeyCode.SPACE&&(t.preventDefault(),this.onExpandClicked())}),this.addManagedListener(this.eSelect.getInputElement(),"click",this.onSelectClicked.bind(this)),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedListener(this.eFilterTextField.getInputElement(),"keydown",this.onMiniFilterKeyDown.bind(this)),this.addManagedListener(this.eventService,import_core.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this));const e=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=import_core._.createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=import_core._.createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=import_core._.createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,s=!this.params.suppressColumnExpandAll,i=this.columnModel.isPrimaryColumnGroupsPresent(),n=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(n("searchOoo","Search...")),import_core._.setDisplayed(this.eFilterTextField.getGui(),e),import_core._.setDisplayed(this.eSelect.getGui(),t),import_core._.setDisplayed(this.eExpand,s&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=import_core._.debounce(()=>{const e=this.eFilterTextField.getValue();this.dispatchEvent({type:"filterChanged",filterText:e})},h.DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(e){e.key===import_core.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),h.DEBOUNCE_DELAY)}onSelectClicked(){this.dispatchEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,import_core._.setDisplayed(this.eExpandChecked,this.expandState===0),import_core._.setDisplayed(this.eExpandUnchecked,this.expandState===1),import_core._.setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}};_PrimaryColsHeaderPanel.DEBOUNCE_DELAY=300,_PrimaryColsHeaderPanel.TEMPLATE=`<div class="ag-column-select-header" role="presentation"> | ||
<div ref="eExpand" class="ag-column-select-header-icon"></div> | ||
<ag-checkbox ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox> | ||
<ag-input-text-field class="ag-column-select-header-filter-wrapper" ref="eFilterTextField"></ag-input-text-field> | ||
</div>`,__decorateClass([(0,import_core.Autowired)("columnModel")],_PrimaryColsHeaderPanel.prototype,"columnModel",2),__decorateClass([(0,import_core.RefSelector)("eExpand")],_PrimaryColsHeaderPanel.prototype,"eExpand",2),__decorateClass([(0,import_core.RefSelector)("eSelect")],_PrimaryColsHeaderPanel.prototype,"eSelect",2),__decorateClass([(0,import_core.RefSelector)("eFilterTextField")],_PrimaryColsHeaderPanel.prototype,"eFilterTextField",2),__decorateClass([import_core.PostConstruct],_PrimaryColsHeaderPanel.prototype,"postConstruct",1);var PrimaryColsHeaderPanel=_PrimaryColsHeaderPanel,import_core7=require("@ag-grid-community/core"),import_core5=require("@ag-grid-community/core"),import_core4=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),_ColumnModelItem=class m{constructor(e,t,s,i=!1,n){this.eventService=new import_core2.EventService,this.displayName=e,this.dept=s,this.group=i,i?(this.columnGroup=t,this.expanded=n,this.children=[]):this.column=t}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(e){e!==this.expanded&&(this.expanded=e,this.eventService.dispatchEvent({type:m.EVENT_EXPANDED_CHANGED}))}setPassesFilter(e){this.passesFilter=e}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}};_ColumnModelItem.EVENT_EXPANDED_CHANGED="expandedChanged";var ColumnModelItem=_ColumnModelItem,import_core3=require("@ag-grid-community/core"),ToolPanelContextMenu=class extends import_core3.Component{constructor(o,e,t){super('<div class="ag-menu"></div>'),this.column=o,this.mouseEvent=e,this.parentEl=t,this.displayName=null}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),this.column instanceof import_core3.Column?this.displayName=this.columnModel.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnModel.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const o=this.getMappedMenuItems();if(o.length===0)return;this.displayContextMenu(o)}}initializeProperties(o){o instanceof import_core3.ProvidedColumnGroup?this.columns=o.getLeafColumns():this.columns=[o],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const o=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColumnGroupingLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${o("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${o("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getRowGroupColumns();this.columnModel.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>o("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>o("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getValueColumns();this.columnModel.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>o("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>o("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.columnModel.getPivotColumns();this.columnModel.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(o){return[...o].concat(this.columns.filter(e=>o.indexOf(e)===-1))}removeColumnsFromList(o){return o.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(o){const e=this.getGui(),t=this.createBean(new import_core3.AgMenuList),s=this.localeService.getLocaleTextFunc();let i=()=>{};e.appendChild(t.getGui()),t.addMenuItems(o),t.addManagedListener(t,import_core3.AgMenuItemComponent.EVENT_CLOSE_MENU,()=>{this.parentEl.focus(),i()});const n=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(t.getGui()),ariaLabel:s("ariaLabelContextMenu","Context Menu"),closedCallback:a=>{a instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(t)}});n&&(i=n.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const o=[];for(const e of this.menuItemMap.values()){const t=this.columns.some(i=>e.allowedFunction(i)&&!e.activeFunction(i)),s=this.columns.some(i=>e.allowedFunction(i)&&e.activeFunction(i));t&&o.push({name:e.activateLabel(this.displayName),icon:import_core3._.createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),s&&o.push({name:e.deactivateLabel(this.displayName),icon:import_core3._.createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return o}};__decorateClass([(0,import_core3.Autowired)("columnModel")],ToolPanelContextMenu.prototype,"columnModel",2),__decorateClass([(0,import_core3.Autowired)("popupService")],ToolPanelContextMenu.prototype,"popupService",2),__decorateClass([(0,import_core3.Autowired)("focusService")],ToolPanelContextMenu.prototype,"focusService",2),__decorateClass([import_core3.PostConstruct],ToolPanelContextMenu.prototype,"postConstruct",1);var _ToolPanelColumnGroupComp=class g extends import_core4.Component{constructor(e,t,s,i){super(),this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.processingColumnStateChange=!1,this.modelItem=e,this.columnGroup=e.getColumnGroup(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName(),this.allowDragging=t}init(){this.setTemplate(g.TEMPLATE),this.eDragHandle=import_core4._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const e=this.cbSelect.getGui(),t=this.cbSelect.getInputElement();e.insertAdjacentElement("afterend",this.eDragHandle),t.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.addManagedListener(this.eventService,import_core4.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.addManagedListener(this.cbSelect,import_core4.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.modelItem,ColumnModelItem.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(),import_core4.CssClassApplier.getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=this.gos.get("tooltipShowMode")==="whenTruncated";let s;t&&(s=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const n=e.headerTooltip;this.setTooltip({newTooltipText:n,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:s})};i(),this.addManagedListener(this.eventService,import_core4.Events.EVENT_NEW_COLUMNS_LOADED,i)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumnGroup",e}handleKeyDown(e){switch(e.key){case import_core4.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case import_core4.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case import_core4.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){const{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListener(e,import_core4.Column.EVENT_VISIBLE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,import_core4.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,import_core4.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(e,import_core4.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this))})}setupDragging(){if(!this.allowDragging){import_core4._.setDisplayed(this.eDragHandle,!1);return}let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:import_core4.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?import_core4.DragAndDropService.ICON_HIDE:import_core4.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const s={type:import_core4.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.columnGroup};this.eventService.dispatchEvent(s)},onDragStopped:()=>{const s={type:import_core4.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(s)},onGridEnter:s=>{e&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:s?.visibleState,pivotState:s?.pivotState,eventType:this.eventType})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},s={};return e.forEach(i=>{const n=i.getId();t[n]=i.isVisible(),s[n]=this.modelItemUtils.createPivotState(i)}),{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){this.eGroupClosedIcon.appendChild(import_core4._.createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(import_core4._.createIcon("columnSelectOpen",this.gos,null)),this.addManagedListener(this.eGroupClosedIcon,"click",this.onExpandOrContractClicked.bind(this)),this.addManagedListener(this.eGroupOpenedIcon,"click",this.onExpandOrContractClicked.bind(this));const e=new import_core4.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListener(e,import_core4.TouchListener.EVENT_TAP,this.onExpandOrContractClicked.bind(this)),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=s=>{s.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(this.modelItem.getChildren()),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),s=this.cbSelect.getValue(),i=s===void 0?e("ariaIndeterminate","indeterminate"):s?e("ariaVisible","visible"):e("ariaHidden","hidden"),n=e("ariaToggleVisibility","Press SPACE to toggle visibility");import_core4._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${n} (${i})`),import_core4._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const 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}workOutSelectedValue(){const e=this.columnModel.isPivotMode(),t=this.getVisibleLeafColumns();let s=0,i=0;if(t.forEach(n=>{!e&&n.getColDef().lockVisible||(this.isColumnChecked(n,e)?s++:i++)}),!(s>0&&i>0))return s>0}workOutReadOnlyValue(){const e=this.columnModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(s=>{e?s.isAnyFunctionAllowed()&&t++:s.getColDef().lockVisible||t++}),t===0}isColumnChecked(e,t){if(t){const s=e.isPivotActive(),i=e.isRowGroupActive(),n=e.isValueActive();return s||i||n}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.isExpanded();import_core4._.setDisplayed(this.eGroupClosedIcon,!e),import_core4._.setDisplayed(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){import_core4._.setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}};_ToolPanelColumnGroupComp.TEMPLATE=`<div class="ag-column-select-column-group" aria-hidden="true"> | ||
<span class="ag-column-group-icons" ref="eColumnGroupIcons" > | ||
<span class="ag-column-group-closed-icon" ref="eGroupClosedIcon"></span> | ||
<span class="ag-column-group-opened-icon" ref="eGroupOpenedIcon"></span> | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of __getOwnPropNames(t))!__hasOwnProp.call(e,o)&&o!==s&&__defProp(e,o,{get:()=>t[o],enumerable:!(i=__getOwnPropDesc(t,o))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{AgPrimaryCols:()=>AgPrimaryCols,ColumnsToolPanelModule:()=>ColumnsToolPanelModule}),module.exports=__toCommonJS(main_exports);var import_core15=require("@ag-grid-community/core"),import_core16=require("@ag-grid-enterprise/core"),import_row_grouping2=require("@ag-grid-enterprise/row-grouping"),import_side_bar=require("@ag-grid-enterprise/side-bar"),import_core13=require("@ag-grid-community/core"),import_row_grouping=require("@ag-grid-enterprise/row-grouping"),import_core11=require("@ag-grid-community/core"),import_core=require("@ag-grid-community/core"),DEBOUNCE_DELAY=300,AgPrimaryColsHeader=class extends import_core.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation"> | ||
<div data-ref="eExpand" class="ag-column-select-header-icon"></div> | ||
<ag-checkbox data-ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox> | ||
<ag-input-text-field class="ag-column-select-header-filter-wrapper" data-ref="eFilterTextField"></ag-input-text-field> | ||
</div>`,[import_core.AgCheckboxSelector,import_core.AgInputTextFieldSelector]),this.eExpand=import_core.RefPlaceholder,this.eSelect=import_core.RefPlaceholder,this.eFilterTextField=import_core.RefPlaceholder}wireBeans(e){this.columnModel=e.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:t=>{t.key===import_core.KeyCode.SPACE&&(t.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const e=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle Select All Columns")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=(0,import_core._createIconNoSpan)("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=(0,import_core._createIconNoSpan)("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=(0,import_core._createIconNoSpan)("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const e=!this.params.suppressColumnFilter,t=!this.params.suppressColumnSelectAll,s=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),o=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(o("searchOoo","Search...")),(0,import_core._setDisplayed)(this.eFilterTextField.getGui(),e),(0,import_core._setDisplayed)(this.eSelect.getGui(),t),(0,import_core._setDisplayed)(this.eExpand,s&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=(0,import_core._debounce)(()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},DEBOUNCE_DELAY)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(e){e.key===import_core.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),DEBOUNCE_DELAY)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,(0,import_core._setDisplayed)(this.eExpandChecked,this.expandState===0),(0,import_core._setDisplayed)(this.eExpandUnchecked,this.expandState===1),(0,import_core._setDisplayed)(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},AgPrimaryColsHeaderSelector={selector:"AG-PRIMARY-COLS-HEADER",component:AgPrimaryColsHeader},import_core9=require("@ag-grid-community/core"),import_core10=require("@ag-grid-enterprise/core"),import_core2=require("@ag-grid-community/core"),ColumnModelItem=class{constructor(e,t,s,i=!1,o){this.localEventService=new import_core2.LocalEventService,this.displayName=e,this.dept=s,this.group=i,i?(this.columnGroup=t,this.expanded=o,this.children=[]):this.column=t}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(e){e!==this.expanded&&(this.expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(e){this.passesFilter=e}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}},import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core"),import_core5=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_core4=require("@ag-grid-enterprise/core"),ToolPanelContextMenu=class extends import_core3.Component{constructor(e,t,s){super('<div class="ag-menu"></div>'),this.column=e,this.mouseEvent=t,this.parentEl=s,this.displayName=null}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.popupService=e.popupService,this.focusService=e.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),(0,import_core3.isColumn)(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const e=this.getMappedMenuItems();if(e.length===0)return;this.displayContextMenu(e)}}initializeProperties(e){(0,import_core3.isProvidedColumnGroup)(e)?this.columns=e.getLeafColumns():this.columns=[e],this.allowGrouping=this.columns.some(t=>t.isPrimary()&&t.isAllowRowGroup()),this.allowValues=this.columns.some(t=>t.isPrimary()&&t.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(t=>t.isPrimary()&&t.isAllowPivot())}buildMenuItemMap(){const e=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:t=>t.isPrimary()&&t.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(t),activeFunction:t=>t.isRowGroupActive(),activateLabel:()=>`${e("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${e("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const t=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(t),"toolPanelUi")},deActivateFunction:()=>{const t=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(t),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:t=>t.isPrimary()&&t.isAllowValue(),activeFunction:t=>t.isValueActive(),activateLabel:()=>e("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>e("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const t=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(t),"toolPanelUi")},deActivateFunction:()=>{const t=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(t),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:t=>this.columnModel.isPivotMode()&&t.isPrimary()&&t.isAllowPivot(),activeFunction:t=>t.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>e("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const t=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(t),"toolPanelUi")},deActivateFunction:()=>{const t=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(t),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(e){return[...e].concat(this.columns.filter(t=>e.indexOf(t)===-1))}removeColumnsFromList(e){return e.filter(t=>this.columns.indexOf(t)===-1)}displayContextMenu(e){const t=this.getGui(),s=this.createBean(new import_core4.AgMenuList),i=this.localeService.getLocaleTextFunc();let o=()=>{};t.appendChild(s.getGui()),s.addMenuItems(e),s.addManagedListeners(s,{closeMenu:()=>{this.parentEl.focus(),o()}});const a=this.popupService.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(s.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:l=>{l instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(s)}});a&&(o=a.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[];for(const t of this.menuItemMap.values()){const s=this.columns.some(o=>t.allowedFunction(o)&&!t.activeFunction(o)),i=this.columns.some(o=>t.allowedFunction(o)&&t.activeFunction(o));s&&e.push({name:t.activateLabel(this.displayName),icon:(0,import_core3._createIconNoSpan)(t.addIcon,this.gos,null),action:()=>t.activateFunction()}),i&&e.push({name:t.deactivateLabel(this.displayName),icon:(0,import_core3._createIconNoSpan)(t.removeIcon,this.gos,null),action:()=>t.deActivateFunction()})}return e}},ToolPanelColumnGroupComp=class extends import_core5.Component{constructor(e,t,s,i){super(),this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.cbSelect=import_core5.RefPlaceholder,this.eLabel=import_core5.RefPlaceholder,this.eGroupOpenedIcon=import_core5.RefPlaceholder,this.eGroupClosedIcon=import_core5.RefPlaceholder,this.eColumnGroupIcons=import_core5.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=e,this.columnGroup=e.getColumnGroup(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName(),this.allowDragging=t}wireBeans(e){this.columnModel=e.columnModel,this.dragAndDropService=e.dragAndDropService,this.modelItemUtils=e.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group" aria-hidden="true"> | ||
<span class="ag-column-group-icons" data-ref="eColumnGroupIcons" > | ||
<span class="ag-column-group-closed-icon" data-ref="eGroupClosedIcon"></span> | ||
<span class="ag-column-group-opened-icon" data-ref="eGroupOpenedIcon"></span> | ||
</span> | ||
<ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox> | ||
<span class="ag-column-select-column-label" ref="eLabel"></span> | ||
</div>`,__decorateClass([(0,import_core4.Autowired)("columnModel")],_ToolPanelColumnGroupComp.prototype,"columnModel",2),__decorateClass([(0,import_core4.Autowired)("dragAndDropService")],_ToolPanelColumnGroupComp.prototype,"dragAndDropService",2),__decorateClass([(0,import_core4.Autowired)("modelItemUtils")],_ToolPanelColumnGroupComp.prototype,"modelItemUtils",2),__decorateClass([(0,import_core4.RefSelector)("cbSelect")],_ToolPanelColumnGroupComp.prototype,"cbSelect",2),__decorateClass([(0,import_core4.RefSelector)("eLabel")],_ToolPanelColumnGroupComp.prototype,"eLabel",2),__decorateClass([(0,import_core4.RefSelector)("eGroupOpenedIcon")],_ToolPanelColumnGroupComp.prototype,"eGroupOpenedIcon",2),__decorateClass([(0,import_core4.RefSelector)("eGroupClosedIcon")],_ToolPanelColumnGroupComp.prototype,"eGroupClosedIcon",2),__decorateClass([(0,import_core4.RefSelector)("eColumnGroupIcons")],_ToolPanelColumnGroupComp.prototype,"eColumnGroupIcons",2),__decorateClass([import_core4.PostConstruct],_ToolPanelColumnGroupComp.prototype,"init",1);var ToolPanelColumnGroupComp=_ToolPanelColumnGroupComp,PrimaryColsListPanelItemDragFeature=class extends import_core5.BeanStub{constructor(o,e){super(),this.comp=o,this.virtualList=e}postConstruct(){this.createManagedBean(new import_core5.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:import_core5.DragSourceType.ToolPanel,listItemDragStartEvent:import_core5.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,listItemDragEndEvent:import_core5.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,eventSource:this.eventService,getCurrentDragValue:o=>this.getCurrentDragValue(o),isMoveBlocked:o=>this.isMoveBlocked(o),getNumRows:o=>o.getDisplayedColsList().length,moveItem:(o,e)=>this.moveItem(o,e)}))}getCurrentDragValue(o){return o.column}isMoveBlocked(o){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumns(o).find(i=>{const n=i.getColDef();return!!n.suppressMovable||!!n.lockPosition})}moveItem(o,e){const t=this.getTargetIndex(o,e),s=this.getCurrentColumns(o);t!=null&&this.columnModel.moveColumns(s,t,"toolPanelUi")}getMoveDiff(o,e){const t=this.columnModel.getAllGridColumns(),s=this.getCurrentColumns(o),i=s[0],n=s.length;return t.indexOf(i)<e?n:0}getCurrentColumns(o){return o instanceof import_core5.ProvidedColumnGroup?o.getLeafColumns():[o]}getTargetIndex(o,e){if(!e)return null;const t=e.component;let s=e.position==="top",i;if(t instanceof ToolPanelColumnGroupComp?(i=t.getColumns()[0],s=!0):i=t.getColumn(),this.getCurrentColumns(o).indexOf(i)!==-1)return null;const a=this.columnModel.getAllGridColumns().indexOf(i),l=s?a:a+1,r=this.getMoveDiff(o,l);return l-r}};__decorateClass([(0,import_core5.Autowired)("columnModel")],PrimaryColsListPanelItemDragFeature.prototype,"columnModel",2),__decorateClass([import_core5.PostConstruct],PrimaryColsListPanelItemDragFeature.prototype,"postConstruct",1);var import_core6=require("@ag-grid-community/core"),_ToolPanelColumnComp=class C extends import_core6.Component{constructor(e,t,s,i){super(),this.allowDragging=t,this.groupsExist=s,this.focusWrapper=i,this.processingColumnStateChange=!1,this.column=e.getColumn(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName()}init(){this.setTemplate(C.TEMPLATE),this.eDragHandle=import_core6._.createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const e=this.cbSelect.getGui(),t=this.cbSelect.getInputElement();e.insertAdjacentElement("afterend",this.eDragHandle),t.setAttribute("tabindex","-1");const s=import_core6._.escapeString(this.displayName);this.eLabel.innerHTML=s;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.setupDragging(),this.addManagedListener(this.eventService,import_core6.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,import_core6.Column.EVENT_VALUE_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,import_core6.Column.EVENT_PIVOT_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,import_core6.Column.EVENT_ROW_GROUP_CHANGED,this.onColumnStateChanged.bind(this)),this.addManagedListener(this.column,import_core6.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.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListener(this.cbSelect,import_core6.Events.EVENT_FIELD_VALUE_CHANGED,this.onCheckboxChanged.bind(this)),this.addManagedListener(this.eLabel,"click",this.onLabelClicked.bind(this)),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),import_core6.CssClassApplier.getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(a=>this.addOrRemoveCssClass(a,!0))}getColumn(){return this.column}setupTooltip(){const e=this.gos.get("tooltipShowMode")==="whenTruncated";let t;e&&(t=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const s=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:t})};s(),this.addManagedListener(this.eventService,import_core6.Events.EVENT_NEW_COLUMNS_LOADED,s)}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumn",e.colDef=this.column.getColDef(),e}onContextMenu(e){const{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(e){e.key===import_core6.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumn","Column"),s=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");import_core6._.setAriaLabel(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${i} (${s})`),import_core6._.setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){import_core6._.setDisplayed(this.eDragHandle,!1);return}let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:import_core6.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?import_core6.DragAndDropService.ICON_HIDE:import_core6.DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const s={type:import_core6.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,column:this.column};this.eventService.dispatchEvent(s)},onDragStopped:()=>{const s={type:import_core6.Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END};this.eventService.dispatchEvent(s)},onGridEnter:s=>{e&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:s?.visibleState,pivotState:s?.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},s={[e]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:s}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.columnModel.isPivotMode();if(e){const n=this.column.isAnyFunctionActive();this.cbSelect.setValue(n)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,s=!0;if(e){const n=this.gos.get("functionsReadOnly"),a=!this.column.isAnyFunctionAllowed();t=!n&&!a,s=t}else{const{enableRowGroup:n,enableValue:a,lockPosition:l,suppressMovable:r,lockVisible:u}=this.column.getColDef(),c=!!n||!!a,d=!!l||!!r;t=!u,s=c||!d}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!s),this.addOrRemoveCssClass("ag-column-select-column-readonly",!s&&!t);const i=e&&this.gos.get("functionsPassive");this.cbSelect.setPassive(i),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){console.warn("AG Grid: can not expand a column item that does not represent a column group header")}};_ToolPanelColumnComp.TEMPLATE=`<div class="ag-column-select-column" aria-hidden="true"> | ||
<ag-checkbox ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox> | ||
<span class="ag-column-select-column-label" ref="eLabel"></span> | ||
</div>`,__decorateClass([(0,import_core6.Autowired)("columnModel")],_ToolPanelColumnComp.prototype,"columnModel",2),__decorateClass([(0,import_core6.Autowired)("dragAndDropService")],_ToolPanelColumnComp.prototype,"dragAndDropService",2),__decorateClass([(0,import_core6.Autowired)("modelItemUtils")],_ToolPanelColumnComp.prototype,"modelItemUtils",2),__decorateClass([(0,import_core6.RefSelector)("eLabel")],_ToolPanelColumnComp.prototype,"eLabel",2),__decorateClass([(0,import_core6.RefSelector)("cbSelect")],_ToolPanelColumnComp.prototype,"cbSelect",2),__decorateClass([import_core6.PostConstruct],_ToolPanelColumnComp.prototype,"init",1);var ToolPanelColumnComp=_ToolPanelColumnComp,UIColumnModel=class{constructor(o){this.items=o}getRowCount(){return this.items.length}getRow(o){return this.items[o]}},PRIMARY_COLS_LIST_PANEL_CLASS="ag-column-select-list",_PrimaryColsListPanel=class v extends import_core7.Component{constructor(){super(v.TEMPLATE),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e,this.allowDragging=t,this.eventType=s,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,import_core7.Events.EVENT_COLUMN_MOVED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,import_core7.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnsChanged.bind(this)),[import_core7.Events.EVENT_COLUMN_PIVOT_CHANGED,import_core7.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,import_core7.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,import_core7.Events.EVENT_COLUMN_VALUE_CHANGED,import_core7.Events.EVENT_COLUMN_VISIBLE,import_core7.Events.EVENT_NEW_COLUMNS_LOADED].forEach(n=>{this.addManagedListener(this.eventService,n,this.fireSelectionChangedEvent.bind(this))}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new import_core7.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((n,a)=>(import_core7._.setAriaLevel(a,n.getDept()+1),this.createComponentFromItem(n,a))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new PrimaryColsListPanelItemDragFeature(this,this.virtualList))}createComponentFromItem(e,t){if(e.isGroup()){const i=new ToolPanelColumnGroupComp(e,this.allowDragging,this.eventType,t);return this.getContext().createBean(i),i}const s=new ToolPanelColumnComp(e,this.allowDragging,this.groupsExist,t);return this.getContext().createBean(s),s}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const e=this.getExpandedStates(),t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(s=>{e[s]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.isGroup())return;const s=t.getColumnGroup();s&&(e[s.getId()]=t.isExpanded())}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(s=>{if(!s.isGroup())return;const i=s.getColumnGroup();if(i){const n=e[i.getId()];(n!=null||t)&&s.setExpanded(!!n)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(e){const t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some(s=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getPrimaryColumnTree()),this.groupsExist=this.columnModel.isPrimaryColumnGroupsPresent()}buildListModel(e){const t=this.onColumnExpanded.bind(this),s=l=>{l.addEventListener(ColumnModelItem.EVENT_EXPANDED_CHANGED,t);const r=l.removeEventListener.bind(l,ColumnModelItem.EVENT_EXPANDED_CHANGED,t);this.destroyColumnItemFuncs.push(r)},i=(l,r,u)=>{l.forEach(c=>{c instanceof import_core7.ProvidedColumnGroup?n(c,r,u):a(c,r,u)})},n=(l,r,u)=>{const c=l.getColGroupDef();if(c&&c.suppressColumnsToolPanel)return;if(l.isPadding()){i(l.getChildren(),r,u);return}const y=this.columnModel.getDisplayNameForProvidedColumnGroup(null,l,"columnToolPanel"),p=new ColumnModelItem(y,l,r,!0,this.expandGroupsByDefault);u.push(p),s(p),i(l.getChildren(),r+1,p.getChildren())},a=(l,r,u)=>{if(l.getColDef()&&l.getColDef().suppressColumnsToolPanel)return;const d=this.columnModel.getDisplayNameForColumn(l,"columnToolPanel");u.push(new ColumnModelItem(d,l,r))};this.destroyColumnTree(),i(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=s=>{s.isPassesFilter()&&(this.displayedColsList.push(s),s.isGroup()&&s.isExpanded()&&s.getChildren().forEach(e))};this.allColsTree.forEach(e),this.virtualList.setModel(new UIColumnModel(this.displayedColsList));const t=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),t!=null&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;import_core7._.setAriaLabel(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=s=>{s.forEach(i=>{e(i),i.isGroup()&&t(i.getChildren())})};this.allColsTree&&t(this.allColsTree)}doSetExpandedAll(e){this.forEachItem(t=>{t.isGroup()&&t.setExpanded(e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}const s=[];this.forEachItem(n=>{if(!n.isGroup())return;const a=n.getColumnGroup().getId();t.indexOf(a)>=0&&(n.setExpanded(e),s.push(a))});const i=t.filter(n=>!import_core7._.includes(s,n));i.length>0&&console.warn("AG Grid: unable to find group(s) for supplied groupIds:",i)}getExpandState(){let e=0,t=0;return this.forEachItem(s=>{s.isGroup()&&(s.isExpanded()?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const s=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const n=i.getColumn(),a=n.getColDef();let l;if(s){if(!n.isAllowPivot()&&!n.isAllowRowGroup()&&!n.isAllowValue())return;l=n.isValueActive()||n.isPivotActive()||n.isRowGroupActive()}else{if(a.lockVisible)return;l=n.isVisible()}l?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=import_core7._.exists(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=s=>{if(!import_core7._.exists(this.filterText))return!0;const i=s.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let n=!1;if(s.isGroup()){const l=e(s);s.getChildren().forEach(r=>{const u=t(r,l||i);u&&(n=u)})}const a=i||n?!0:e(s);return s.setPassesFilter(a),a};this.allColsTree.forEach(s=>t(s,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree&&this.forEachItem(t=>{t.isGroup()&&t.isExpanded()&&e.push(t.getColumnGroup().getId())}),e}};_PrimaryColsListPanel.TEMPLATE=`<div class="${PRIMARY_COLS_LIST_PANEL_CLASS}" role="presentation"></div>`,__decorateClass([(0,import_core7.Autowired)("columnModel")],_PrimaryColsListPanel.prototype,"columnModel",2),__decorateClass([(0,import_core7.Autowired)("toolPanelColDefService")],_PrimaryColsListPanel.prototype,"colDefService",2),__decorateClass([(0,import_core7.Autowired)("modelItemUtils")],_PrimaryColsListPanel.prototype,"modelItemUtils",2),__decorateClass([import_core7.PreDestroy],_PrimaryColsListPanel.prototype,"destroyColumnTree",1);var PrimaryColsListPanel=_PrimaryColsListPanel,import_core10=require("@ag-grid-community/core"),import_core8=require("@ag-grid-community/core"),PivotModePanel=class extends import_core8.Component{createTemplate(){return`<div class="ag-pivot-mode-panel"> | ||
<ag-toggle-button ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button> | ||
</div>`}init(){this.setTemplate(this.createTemplate()),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const o=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(o("pivotMode","Pivot Mode")),this.addManagedListener(this.cbPivotMode,import_core8.Events.EVENT_FIELD_VALUE_CHANGED,this.onBtPivotMode.bind(this)),this.addManagedListener(this.eventService,import_core8.Events.EVENT_NEW_COLUMNS_LOADED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,import_core8.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this))}onBtPivotMode(){const o=!!this.cbPivotMode.getValue();if(o!==this.columnModel.isPivotMode()){this.gos.updateGridOptions({options:{pivotMode:o},source:"toolPanelUi"});const{api:e}=this;e&&e.refreshHeader()}}onPivotModeChanged(){const o=this.columnModel.isPivotMode();this.cbPivotMode.setValue(o)}};__decorateClass([(0,import_core8.Autowired)("columnModel")],PivotModePanel.prototype,"columnModel",2),__decorateClass([(0,import_core8.Autowired)("gridApi")],PivotModePanel.prototype,"api",2),__decorateClass([(0,import_core8.RefSelector)("cbPivotMode")],PivotModePanel.prototype,"cbPivotMode",2),__decorateClass([import_core8.PreConstruct],PivotModePanel.prototype,"init",1);var import_row_grouping=require("@ag-grid-enterprise/row-grouping"),import_core9=require("@ag-grid-community/core"),_PrimaryColsPanel=class f extends import_core9.Component{constructor(){super(f.TEMPLATE)}init(e,t,s){this.allowDragging=e,this.params=t,this.eventType=s,this.primaryColsHeaderPanel.init(this.params);const i=this.params.suppressColumnFilter,n=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&n&&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 import_core9.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}onFilterChanged(e){this.primaryColsListPanel.setFilterText(e.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(e){this.primaryColsHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}onSelectionChange(e){this.primaryColsHeaderPanel.setSelectionState(e.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}};_PrimaryColsPanel.TEMPLATE=`<div class="ag-column-select"> | ||
<ag-primary-cols-header ref="primaryColsHeaderPanel"></ag-primary-cols-header> | ||
<ag-primary-cols-list ref="primaryColsListPanel"></ag-primary-cols-list> | ||
</div>`,__decorateClass([(0,import_core9.RefSelector)("primaryColsHeaderPanel")],_PrimaryColsPanel.prototype,"primaryColsHeaderPanel",2),__decorateClass([(0,import_core9.RefSelector)("primaryColsListPanel")],_PrimaryColsPanel.prototype,"primaryColsListPanel",2);var PrimaryColsPanel=_PrimaryColsPanel,_ColumnToolPanel=class E extends import_core10.Component{constructor(){super(E.TEMPLATE),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params=__spreadValues(__spreadValues({},t),e),this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new PivotModePanel),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new PrimaryColsPanel),this.childDestroyFuncs.push(()=>this.destroyBean(this.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 import_row_grouping.RowGroupDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new import_row_grouping.ValuesDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new import_row_grouping.PivotDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const s=this.addManagedListener(this.eventService,import_core10.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>{this.resetChildrenHeight(),this.setLastVisible()});this.childDestroyFuncs.push(()=>s())}this.initialised=!0}setPivotModeSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new PivotModePanel),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new import_row_grouping.RowGroupDropZonePanel(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new import_row_grouping.ValuesDropZonePanel(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new import_row_grouping.PivotDropZonePanel(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(n=>n.classList.remove("ag-last-column-drop"));const s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=import_core10._.last(s);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const t=this.getGui().children;for(let s=0;s<t.length;s++){const i=t[s];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.RowGroupingModule,"Row Grouping",this.context.getGridId())}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(e=>e()),this.childDestroyFuncs.length=0,import_core10._.clearElement(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};_ColumnToolPanel.TEMPLATE='<div class="ag-column-panel"></div>';var ColumnToolPanel=_ColumnToolPanel,import_row_grouping2=require("@ag-grid-enterprise/row-grouping"),import_side_bar=require("@ag-grid-enterprise/side-bar"),import_core11=require("@ag-grid-community/core"),ModelItemUtils=class{selectAllChildren(o,e,t){const s=this.extractAllLeafColumns(o);this.setAllColumns(s,e,t)}setColumn(o,e,t){this.setAllColumns([o],e,t)}setAllColumns(o,e,t){this.columnModel.isPivotMode()?this.setAllPivot(o,e,t):this.setAllVisible(o,e,t)}extractAllLeafColumns(o){const e=[],t=s=>{s.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(o),e}setAllVisible(o,e,t){const s=[];o.forEach(i=>{i.getColDef().lockVisible||i.isVisible()!=e&&s.push({colId:i.getId(),hide:!e})}),s.length>0&&this.columnModel.applyColumnState({state:s},t)}setAllPivot(o,e,t){this.gos.get("functionsPassive")?this.setAllPivotPassive(o,e):this.setAllPivotActive(o,e,t)}setAllPivotPassive(o,e){const t=this.columnModel.getPivotColumns().slice(),s=this.columnModel.getValueColumns().slice(),i=this.columnModel.getRowGroupColumns().slice();let n=!1,a=!1,l=!1;const c=e?d=>{d.isAnyFunctionActive()||(d.isAllowValue()?(s.push(d),a=!0):d.isAllowRowGroup()?(i.push(d),n=!0):d.isAllowPivot()&&(t.push(d),l=!0))}:d=>{d.isAnyFunctionActive()&&(t.indexOf(d)>=0&&(import_core11._.removeFromArray(t,d),n=!0),s.indexOf(d)>=0&&(import_core11._.removeFromArray(s,d),a=!0),i.indexOf(d)>=0&&(import_core11._.removeFromArray(i,d),l=!0))};if(o.forEach(c),n){const d={type:import_core11.Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST,columns:t};this.eventService.dispatchEvent(d)}if(l){const d={type:import_core11.Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST,columns:i};this.eventService.dispatchEvent(d)}if(a){const d={type:import_core11.Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST,columns:i};this.eventService.dispatchEvent(d)}}setAllPivotActive(o,e,t){const s=[],a=e?l=>{if(!l.isAnyFunctionActive())if(l.isAllowValue()){const r=typeof l.getAggFunc()=="string"?l.getAggFunc():this.aggFuncService.getDefaultAggFunc(l);s.push({colId:l.getId(),aggFunc:r})}else l.isAllowRowGroup()?s.push({colId:l.getId(),rowGroup:!0}):l.isAllowPivot()&&s.push({colId:l.getId(),pivot:!0})}:l=>{(l.isPivotActive()||l.isRowGroupActive()||l.isValueActive())&&s.push({colId:l.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};o.forEach(a),s.length>0&&this.columnModel.applyColumnState({state:s},t)}updateColumns(o){const{columns:e,visibleState:t,pivotState:s,eventType:i}=o,n=e.map(a=>{const l=a.getColId();if(this.columnModel.isPivotMode()){const r=s?.[l];return{colId:l,pivot:r?.pivot,rowGroup:r?.rowGroup,aggFunc:r?.aggFunc}}else return{colId:l,hide:!t?.[l]}});this.columnModel.applyColumnState({state:n},i)}createPivotState(o){return{pivot:o.isPivotActive(),rowGroup:o.isRowGroupActive(),aggFunc:o.isValueActive()?o.getAggFunc():void 0}}};__decorateClass([(0,import_core11.Autowired)("aggFuncService")],ModelItemUtils.prototype,"aggFuncService",2),__decorateClass([(0,import_core11.Autowired)("columnModel")],ModelItemUtils.prototype,"columnModel",2),__decorateClass([(0,import_core11.Autowired)("gridOptionsService")],ModelItemUtils.prototype,"gos",2),__decorateClass([(0,import_core11.Autowired)("eventService")],ModelItemUtils.prototype,"eventService",2),ModelItemUtils=__decorateClass([(0,import_core11.Bean)("modelItemUtils")],ModelItemUtils);var VERSION="31.3.2",ColumnsToolPanelModule={version:VERSION,moduleName:import_core12.ModuleNames.ColumnsToolPanelModule,beans:[ModelItemUtils],agStackComponents:[{componentName:"AgPrimaryColsHeader",componentClass:PrimaryColsHeaderPanel},{componentName:"AgPrimaryColsList",componentClass:PrimaryColsListPanel},{componentName:"AgPrimaryCols",componentClass:PrimaryColsPanel}],userComponents:[{componentName:"agColumnsToolPanel",componentClass:ColumnToolPanel}],dependantModules:[import_core13.EnterpriseCoreModule,import_row_grouping2.RowGroupingModule,import_side_bar.SideBarModule]}; | ||
<ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox> | ||
<span class="ag-column-select-column-label" data-ref="eLabel"></span> | ||
</div>`,[import_core5.AgCheckboxSelector]),this.eDragHandle=(0,import_core5._createIconNoSpan)("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const e=this.cbSelect.getGui(),t=this.cbSelect.getInputElement();e.insertAdjacentElement("afterend",this.eDragHandle),t.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),(0,import_core5._getToolPanelClassesFromColDef)(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=this.gos.get("tooltipShowMode")==="whenTruncated";let s;t&&(s=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const o=e.headerTooltip;this.setTooltip({newTooltipText:o,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:s})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumnGroup",e}handleKeyDown(e){switch(e.key){case import_core5.KeyCode.LEFT:e.preventDefault(),this.modelItem.setExpanded(!1);break;case import_core5.KeyCode.RIGHT:e.preventDefault(),this.modelItem.setExpanded(!0);break;case import_core5.KeyCode.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){const{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const e=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})})}setupDragging(){if(!this.allowDragging){(0,import_core5._setDisplayed)(this.eDragHandle,!1);return}let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:import_core5.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const s={type:"columnPanelItemDragStart",column:this.columnGroup};this.eventService.dispatchEvent(s)},onDragStopped:()=>{const s={type:"columnPanelItemDragEnd"};this.eventService.dispatchEvent(s)},onGridEnter:s=>{e&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:s?.visibleState,pivotState:s?.pivotState,eventType:this.eventType})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},s={};return e.forEach(i=>{const o=i.getId();t[o]=i.isVisible(),s[o]=this.modelItemUtils.createPivotState(i)}),{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){this.eGroupClosedIcon.appendChild((0,import_core5._createIcon)("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild((0,import_core5._createIcon)("columnSelectOpen",this.gos,null));const e=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:e}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:e});const t=new import_core5.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(t,{tap:e}),this.addDestroyFunc(t.destroy.bind(t))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=s=>{s.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?t(i.getChildren()):e.push(i.getColumn()))})};return t(this.modelItem.getChildren()),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),e,this.eventType)}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnGroup","Column Group"),s=this.cbSelect.getValue(),i=s===void 0?e("ariaIndeterminate","indeterminate"):s?e("ariaVisible","visible"):e("ariaHidden","hidden"),o=e("ariaToggleVisibility","Press SPACE to toggle visibility");(0,import_core5._setAriaLabel)(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${o} (${i})`),(0,import_core5._setAriaDescribedBy)(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const 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}workOutSelectedValue(){const e=this.columnModel.isPivotMode(),t=this.getVisibleLeafColumns();let s=0,i=0;if(t.forEach(o=>{!e&&o.getColDef().lockVisible||(this.isColumnChecked(o,e)?s++:i++)}),!(s>0&&i>0))return s>0}workOutReadOnlyValue(){const e=this.columnModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(s=>{e?s.isAnyFunctionAllowed()&&t++:s.getColDef().lockVisible||t++}),t===0}isColumnChecked(e,t){if(t){const s=e.isPivotActive(),i=e.isRowGroupActive(),o=e.isValueActive();return s||i||o}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem.isExpanded();this.modelItem.setExpanded(!e)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.isExpanded();(0,import_core5._setDisplayed)(this.eGroupClosedIcon,!e),(0,import_core5._setDisplayed)(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){(0,import_core5._setAriaExpanded)(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(e&&!t||!e&&t)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},PrimaryColsListPanelItemDragFeature=class extends import_core6.BeanStub{constructor(e,t){super(),this.comp=e,this.virtualList=t}wireBeans(e){this.columnModel=e.columnModel,this.columnMoveService=e.columnMoveService}postConstruct(){this.createManagedBean(new import_core7.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:import_core6.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:e=>this.isMoveBlocked(e),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.column}isMoveBlocked(e){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumns(e).find(o=>{const a=o.getColDef();return!!a.suppressMovable||!!a.lockPosition})}moveItem(e,t){const s=this.getTargetIndex(e,t),i=this.getCurrentColumns(e);s!=null&&this.columnMoveService.moveColumns(i,s,"toolPanelUi")}getMoveDiff(e,t){const s=this.columnModel.getCols(),i=this.getCurrentColumns(e),o=i[0],a=i.length;return s.indexOf(o)<t?a:0}getCurrentColumns(e){return(0,import_core6.isProvidedColumnGroup)(e)?e.getLeafColumns():[e]}getTargetIndex(e,t){if(!t)return null;const s=t.component;let i=t.position==="top",o;if(s instanceof ToolPanelColumnGroupComp?(o=s.getColumns()[0],i=!0):o=s.getColumn(),this.getCurrentColumns(e).indexOf(o)!==-1)return null;const l=this.columnModel.getCols().indexOf(o),n=i?l:l+1,r=this.getMoveDiff(e,n);return n-r}},import_core8=require("@ag-grid-community/core"),ToolPanelColumnComp=class extends import_core8.Component{constructor(e,t,s,i){super(),this.allowDragging=t,this.groupsExist=s,this.focusWrapper=i,this.eLabel=import_core8.RefPlaceholder,this.cbSelect=import_core8.RefPlaceholder,this.processingColumnStateChange=!1,this.column=e.getColumn(),this.columnDept=e.getDept(),this.displayName=e.getDisplayName()}wireBeans(e){this.columnModel=e.columnModel,this.dragAndDropService=e.dragAndDropService,this.modelItemUtils=e.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column" aria-hidden="true"> | ||
<ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox> | ||
<span class="ag-column-select-column-label" data-ref="eLabel"></span> | ||
</div>`,[import_core8.AgCheckboxSelector]),this.eDragHandle=(0,import_core8._createIconNoSpan)("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const e=this.cbSelect.getGui(),t=this.cbSelect.getInputElement();e.insertAdjacentElement("afterend",this.eDragHandle),t.setAttribute("tabindex","-1");const s=(0,import_core8._escapeString)(this.displayName);this.eLabel.innerHTML=s;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.setupDragging();const o=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:o}),this.addManagedListeners(this.column,{columnValueChanged:o,columnPivotChanged:o,columnRowGroupChanged:o,visibleChanged:o}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),(0,import_core8._getToolPanelClassesFromColDef)(this.column.getColDef(),this.gos,this.column,null).forEach(l=>this.addOrRemoveCssClass(l,!0))}getColumn(){return this.column}setupTooltip(){const e=this.gos.get("tooltipShowMode")==="whenTruncated";let t;e&&(t=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const s=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:t})};s(),this.addManagedEventListeners({newColumnsLoaded:s})}getTooltipParams(){const e=super.getTooltipParams();return e.location="columnToolPanelColumn",e.colDef=this.column.getColDef(),e}onContextMenu(e){const{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new ToolPanelContextMenu(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(e){e.key===import_core8.KeyCode.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,e,"toolPanelUi"))}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumn","Column"),s=this.cbSelect.getValue()?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");(0,import_core8._setAriaLabel)(this.focusWrapper,`${this.displayName} ${t}`),this.cbSelect.setInputAriaLabel(`${i} (${s})`),(0,import_core8._setAriaDescribedBy)(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){(0,import_core8._setDisplayed)(this.eDragHandle,!1);return}let e=!this.gos.get("suppressDragLeaveHidesColumns");const t={type:import_core8.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>e?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{e=!this.gos.get("suppressDragLeaveHidesColumns");const s={type:"columnPanelItemDragStart",column:this.column};this.eventService.dispatchEvent(s)},onDragStopped:()=>{const s={type:"columnPanelItemDragEnd"};this.eventService.dispatchEvent(s)},onGridEnter:s=>{e&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:s?.visibleState,pivotState:s?.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{e&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(t,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(t))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},s={[e]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:t,pivotState:s}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.columnModel.isPivotMode();if(e){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,s=!0;if(e){const i=this.gos.get("functionsReadOnly"),o=!this.column.isAnyFunctionAllowed();t=!i&&!o,s=t}else{const{enableRowGroup:i,enableValue:o,lockPosition:a,suppressMovable:l,lockVisible:n}=this.column.getColDef(),r=!!i||!!o,c=!!a||!!l;t=!n,s=r||!c}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!s),this.addOrRemoveCssClass("ag-column-select-column-readonly",!s&&!t),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){e!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){(0,import_core8._warnOnce)("can not expand a column item that does not represent a column group header")}},UIColumnModel=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},PRIMARY_COLS_LIST_PANEL_CLASS="ag-column-select-list",AgPrimaryColsList=class extends import_core9.Component{constructor(){super(`<div class="${PRIMARY_COLS_LIST_PANEL_CLASS}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.colDefService=e.toolPanelColDefService,this.modelItemUtils=e.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e,this.allowDragging=t,this.eventType=s,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new import_core10.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((o,a)=>((0,import_core9._setAriaLevel)(a,o.getDept()+1),this.createComponentFromItem(o,a))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new PrimaryColsListPanelItemDragFeature(this,this.virtualList))}createComponentFromItem(e,t){if(e.isGroup()){const i=new ToolPanelColumnGroupComp(e,this.allowDragging,this.eventType,t);return this.createBean(i),i}const s=new ToolPanelColumnComp(e,this.allowDragging,this.groupsExist,t);return this.createBean(s),s}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const e=this.getExpandedStates(),t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(e),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(s=>{e[s]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.isGroup())return;const s=t.getColumnGroup();s&&(e[s.getId()]=t.isExpanded())}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(s=>{if(!s.isGroup())return;const i=s.getColumnGroup();if(i){const o=e[i.getId()];(o!=null||t)&&s.setExpanded(!!o)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(e){const t=this.colDefService.createColumnTree(e);this.buildListModel(t),this.groupsExist=e.some(s=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(e){const t=this.onColumnExpanded.bind(this),s=l=>{l.addEventListener("expandedChanged",t);const n=l.removeEventListener.bind(l,"expandedChanged",t);this.destroyColumnItemFuncs.push(n)},i=(l,n,r)=>{l.forEach(c=>{(0,import_core9.isProvidedColumnGroup)(c)?o(c,n,r):a(c,n,r)})},o=(l,n,r)=>{const c=l.getColGroupDef();if(c&&c.suppressColumnsToolPanel)return;if(l.isPadding()){i(l.getChildren(),n,r);return}const h=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,l,"columnToolPanel"),d=new ColumnModelItem(h,l,n,!0,this.expandGroupsByDefault);r.push(d),s(d),i(l.getChildren(),n+1,d.getChildren())},a=(l,n,r)=>{if(l.getColDef()&&l.getColDef().suppressColumnsToolPanel)return;const u=this.columnNameService.getDisplayNameForColumn(l,"columnToolPanel");r.push(new ColumnModelItem(u,l,n))};this.destroyColumnTree(),i(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=s=>{s.isPassesFilter()&&(this.displayedColsList.push(s),s.isGroup()&&s.isExpanded()&&s.getChildren().forEach(e))};this.allColsTree.forEach(e),this.virtualList.setModel(new UIColumnModel(this.displayedColsList));const t=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),t!=null&&this.focusRowIfAlive(t),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.localeService.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;(0,import_core9._setAriaLabel)(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=s=>{s.forEach(i=>{e(i),i.isGroup()&&t(i.getChildren())})};this.allColsTree&&t(this.allColsTree)}doSetExpandedAll(e){this.forEachItem(t=>{t.isGroup()&&t.setExpanded(e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}const s=[];this.forEachItem(o=>{if(!o.isGroup())return;const a=o.getColumnGroup().getId();t.indexOf(a)>=0&&(o.setExpanded(e),s.push(a))});const i=t.filter(o=>!(0,import_core9._includes)(s,o));i.length>0&&(0,import_core9._warnOnce)("unable to find group(s) for supplied groupIds:",i)}getExpandState(){let e=0,t=0;return this.forEachItem(s=>{s.isGroup()&&(s.isExpanded()?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){this.modelItemUtils.selectAllChildren(this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const s=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const o=i.getColumn(),a=o.getColDef();let l;if(s){if(!o.isAllowPivot()&&!o.isAllowRowGroup()&&!o.isAllowValue())return;l=o.isValueActive()||o.isPivotActive()||o.isRowGroupActive()}else{if(a.lockVisible)return;l=o.isVisible()}l?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=(0,import_core9._exists)(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=s=>{if(!(0,import_core9._exists)(this.filterText))return!0;const i=s.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let o=!1;if(s.isGroup()){const l=e(s);s.getChildren().forEach(n=>{const r=t(n,l||i);r&&(o=r)})}const a=i||o?!0:e(s);return s.setPassesFilter(a),a};this.allColsTree.forEach(s=>t(s,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree&&this.forEachItem(t=>{t.isGroup()&&t.isExpanded()&&e.push(t.getColumnGroup().getId())}),e}},AgPrimaryColsListSelector={selector:"AG-PRIMARY-COLS-LIST",component:AgPrimaryColsList},AgPrimaryCols=class extends import_core11.Component{constructor(){super(`<div class="ag-column-select"> | ||
<ag-primary-cols-header data-ref="primaryColsHeaderPanel"></ag-primary-cols-header> | ||
<ag-primary-cols-list data-ref="primaryColsListPanel"></ag-primary-cols-list> | ||
</div>`,[AgPrimaryColsHeaderSelector,AgPrimaryColsListSelector]),this.primaryColsHeaderPanel=import_core11.RefPlaceholder,this.primaryColsListPanel=import_core11.RefPlaceholder}init(e,t,s){this.allowDragging=e,this.params=t,this.eventType=s,this.primaryColsHeaderPanel.init(this.params);const i=this.params.suppressColumnFilter,o=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&o&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new import_core11.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}onFilterChanged(e){this.primaryColsListPanel.setFilterText(e.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(e){this.primaryColsHeaderPanel.setExpandState(e.state),this.params.onStateUpdated()}onSelectionChange(e){this.primaryColsHeaderPanel.setSelectionState(e.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},import_core12=require("@ag-grid-community/core"),PivotModePanel=class extends import_core12.Component{constructor(){super(...arguments),this.cbPivotMode=import_core12.RefPlaceholder}wireBeans(e){this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel"> | ||
<ag-toggle-button data-ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button> | ||
</div>`}postConstruct(){this.setTemplate(this.createTemplate(),[import_core12.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const e=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(e("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const t=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:t,columnPivotModeChanged:t})}onBtPivotMode(){const e=!!this.cbPivotMode.getValue();e!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:e},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.cbPivotMode.setValue(e)}},ColumnToolPanel=class extends import_core13.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...t,...e},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new PivotModePanel),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new AgPrimaryCols),this.childDestroyFuncs.push(()=>this.destroyBean(this.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 import_row_grouping.RowGroupDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new import_row_grouping.ValuesDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new import_row_grouping.PivotDropZonePanel(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[s]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>s())}this.initialised=!0}setPivotModeSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(e):e&&(this.pivotModePanel=this.createBean(new PivotModePanel),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(e):e&&(this.rowGroupDropZonePanel=this.createManagedBean(new import_row_grouping.RowGroupDropZonePanel(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(e):e&&(this.valuesDropZonePanel=this.createManagedBean(new import_row_grouping.ValuesDropZonePanel(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(e){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(e):e&&(this.pivotDropZonePanel=this.createManagedBean(new import_row_grouping.PivotDropZonePanel(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(e)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(o=>o.classList.remove("ag-last-column-drop"));const s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=(0,import_core13._last)(s);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const t=this.getGui().children;for(let s=0;s<t.length;s++){const i=t[s];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return import_core13.ModuleRegistry.__assertRegistered(import_core13.ModuleNames.RowGroupingModule,"Row Grouping",this.gridId)}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(e=>e()),this.childDestroyFuncs.length=0,(0,import_core13._clearElement)(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},import_core14=require("@ag-grid-community/core"),ModelItemUtils=class extends import_core14.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(e){this.aggFuncService=e.aggFuncService,this.columnModel=e.columnModel,this.columnApplyStateService=e.columnApplyStateService}selectAllChildren(e,t,s){const i=this.extractAllLeafColumns(e);this.setAllColumns(i,t,s)}setColumn(e,t,s){this.setAllColumns([e],t,s)}setAllColumns(e,t,s){this.columnModel.isPivotMode()?this.setAllPivot(e,t,s):this.setAllVisible(e,t,s)}extractAllLeafColumns(e){const t=[],s=i=>{i.forEach(o=>{o.isPassesFilter()&&(o.isGroup()?s(o.getChildren()):t.push(o.getColumn()))})};return s(e),t}setAllVisible(e,t,s){const i=[];e.forEach(o=>{o.getColDef().lockVisible||o.isVisible()!=t&&i.push({colId:o.getId(),hide:!t})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},s)}setAllPivot(e,t,s){this.setAllPivotActive(e,t,s)}setAllPivotActive(e,t,s){const i=[],l=t?n=>{if(!n.isAnyFunctionActive())if(n.isAllowValue()){const r=typeof n.getAggFunc()=="string"?n.getAggFunc():this.aggFuncService?.getDefaultAggFunc(n);i.push({colId:n.getId(),aggFunc:r})}else n.isAllowRowGroup()?i.push({colId:n.getId(),rowGroup:!0}):n.isAllowPivot()&&i.push({colId:n.getId(),pivot:!0})}:n=>{(n.isPivotActive()||n.isRowGroupActive()||n.isValueActive())&&i.push({colId:n.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};e.forEach(l),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},s)}updateColumns(e){const{columns:t,visibleState:s,pivotState:i,eventType:o}=e,a=t.map(l=>{const n=l.getColId();if(this.columnModel.isPivotMode()){const r=i?.[n];return{colId:n,pivot:r?.pivot,rowGroup:r?.rowGroup,aggFunc:r?.aggFunc}}else return{colId:n,hide:!s?.[n]}});this.columnApplyStateService.applyColumnState({state:a},o)}createPivotState(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}},VERSION="32.0.0",ColumnsToolPanelModule={version:VERSION,moduleName:import_core15.ModuleNames.ColumnsToolPanelModule,beans:[ModelItemUtils],userComponents:[{name:"agColumnsToolPanel",classImp:ColumnToolPanel},{name:"agMenuItem",classImp:import_core16.AgMenuItemRenderer}],dependantModules:[import_core16.EnterpriseCoreModule,import_row_grouping2.RowGroupingModule,import_side_bar.SideBarModule]}; |
{ | ||
"name": "@ag-grid-enterprise/column-tool-panel", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,7 +14,8 @@ "main": "./dist/package/main.cjs.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"@ag-grid-enterprise/row-grouping": "31.3.2", | ||
"@ag-grid-enterprise/side-bar": "31.3.2" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"@ag-grid-enterprise/row-grouping": "32.0.0", | ||
"@ag-grid-enterprise/side-bar": "32.0.0" | ||
}, | ||
@@ -21,0 +22,0 @@ "devDependencies": { |
{ | ||
"name": "@ag-grid-enterprise/column-tool-panel", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,7 +14,8 @@ "main": "./src/main.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"@ag-grid-enterprise/row-grouping": "31.3.2", | ||
"@ag-grid-enterprise/side-bar": "31.3.2" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"@ag-grid-enterprise/row-grouping": "32.0.0", | ||
"@ag-grid-enterprise/side-bar": "32.0.0" | ||
}, | ||
@@ -21,0 +22,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
import { Module } from "@ag-grid-community/core"; | ||
import type { Module } from '@ag-grid-community/core'; | ||
export declare const ColumnsToolPanelModule: Module; |
@@ -1,5 +0,5 @@ | ||
import { AgEventListener, Column, IEventEmitter, ProvidedColumnGroup } from "@ag-grid-community/core"; | ||
export declare class ColumnModelItem implements IEventEmitter { | ||
private eventService; | ||
static EVENT_EXPANDED_CHANGED: string; | ||
import type { AgColumn, AgProvidedColumnGroup, IEventEmitter, IEventListener } from '@ag-grid-community/core'; | ||
export type ColumnModelItemEvent = 'expandedChanged'; | ||
export declare class ColumnModelItem implements IEventEmitter<ColumnModelItemEvent> { | ||
private localEventService; | ||
private readonly group; | ||
@@ -13,7 +13,7 @@ private readonly displayName; | ||
private passesFilter; | ||
constructor(displayName: string | null, columnOrGroup: Column | ProvidedColumnGroup, dept: number, group?: boolean, expanded?: boolean); | ||
constructor(displayName: string | null, columnOrGroup: AgColumn | AgProvidedColumnGroup, dept: number, group?: boolean, expanded?: boolean); | ||
isGroup(): boolean; | ||
getDisplayName(): string | null; | ||
getColumnGroup(): ProvidedColumnGroup; | ||
getColumn(): Column; | ||
getColumnGroup(): AgProvidedColumnGroup; | ||
getColumn(): AgColumn; | ||
getDept(): number; | ||
@@ -25,4 +25,4 @@ isExpanded(): boolean; | ||
setPassesFilter(passesFilter: boolean): void; | ||
addEventListener(eventType: string, listener: AgEventListener): void; | ||
removeEventListener(eventType: string, listener: AgEventListener): void; | ||
addEventListener<T extends ColumnModelItemEvent>(eventType: T, listener: IEventListener<ColumnModelItemEvent>): void; | ||
removeEventListener<T extends ColumnModelItemEvent>(eventType: T, listener: IEventListener<ColumnModelItemEvent>): void; | ||
} |
@@ -1,6 +0,6 @@ | ||
import { ColDef, ColGroupDef, Component, IColumnToolPanel, IToolPanelComp, ColumnToolPanelState, IToolPanelParams, IToolPanelColumnCompParams } from "@ag-grid-community/core"; | ||
import type { ColDef, ColGroupDef, ColumnToolPanelState, IColumnToolPanel, IToolPanelColumnCompParams, IToolPanelComp, IToolPanelParams } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
export interface ToolPanelColumnCompParams<TData = any, TContext = any> extends IToolPanelParams<TData, TContext, ColumnToolPanelState>, IToolPanelColumnCompParams { | ||
} | ||
export declare class ColumnToolPanel extends Component implements IColumnToolPanel, IToolPanelComp { | ||
private static TEMPLATE; | ||
private initialised; | ||
@@ -7,0 +7,0 @@ private params; |
@@ -1,18 +0,19 @@ | ||
import { ColumnModelItem } from "./columnModelItem"; | ||
import { ColumnModel, ColumnEventType, IAggFuncService, Column, IAggFunc } from "@ag-grid-community/core"; | ||
export declare class ModelItemUtils { | ||
aggFuncService: IAggFuncService; | ||
columnModel: ColumnModel; | ||
private gos; | ||
private eventService; | ||
import type { AgColumn, BeanCollection, ColumnEventType, IAggFunc, NamedBean } from '@ag-grid-community/core'; | ||
import { BeanStub } from '@ag-grid-community/core'; | ||
import type { ColumnModelItem } from './columnModelItem'; | ||
export declare class ModelItemUtils extends BeanStub implements NamedBean { | ||
beanName: "modelItemUtils"; | ||
private aggFuncService?; | ||
private columnModel; | ||
private columnApplyStateService; | ||
wireBeans(beans: BeanCollection): void; | ||
selectAllChildren(colTree: ColumnModelItem[], selectAllChecked: boolean, eventType: ColumnEventType): void; | ||
setColumn(col: Column, selectAllChecked: boolean, eventType: ColumnEventType): void; | ||
setAllColumns(cols: Column[], selectAllChecked: boolean, eventType: ColumnEventType): void; | ||
setColumn(col: AgColumn, selectAllChecked: boolean, eventType: ColumnEventType): void; | ||
setAllColumns(cols: AgColumn[], selectAllChecked: boolean, eventType: ColumnEventType): void; | ||
private extractAllLeafColumns; | ||
private setAllVisible; | ||
private setAllPivot; | ||
private setAllPivotPassive; | ||
private setAllPivotActive; | ||
updateColumns(params: { | ||
columns: Column[]; | ||
columns: AgColumn[]; | ||
visibleState?: { | ||
@@ -30,3 +31,3 @@ [key: string]: boolean; | ||
}): void; | ||
createPivotState(column: Column): { | ||
createPivotState(column: AgColumn): { | ||
pivot?: boolean; | ||
@@ -33,0 +34,0 @@ rowGroup?: boolean; |
@@ -1,10 +0,12 @@ | ||
import { Component } from "@ag-grid-community/core"; | ||
import type { BeanCollection } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
export declare class PivotModePanel extends Component { | ||
private columnModel; | ||
private api; | ||
private cbPivotMode; | ||
private ctrlsService; | ||
wireBeans(beans: BeanCollection): void; | ||
private readonly cbPivotMode; | ||
private createTemplate; | ||
init(): void; | ||
postConstruct(): void; | ||
private onBtPivotMode; | ||
private onPivotModeChanged; | ||
} |
@@ -1,3 +0,5 @@ | ||
import { BeanStub, VirtualList } from "@ag-grid-community/core"; | ||
import { PrimaryColsListPanel } from "./primaryColsListPanel"; | ||
import type { BeanCollection } from '@ag-grid-community/core'; | ||
import { BeanStub } from '@ag-grid-community/core'; | ||
import type { VirtualList } from '@ag-grid-enterprise/core'; | ||
import type { AgPrimaryColsList } from './agPrimaryColsList'; | ||
export declare class PrimaryColsListPanelItemDragFeature extends BeanStub { | ||
@@ -7,4 +9,6 @@ private readonly comp; | ||
private columnModel; | ||
constructor(comp: PrimaryColsListPanel, virtualList: VirtualList); | ||
private postConstruct; | ||
private columnMoveService; | ||
wireBeans(beans: BeanCollection): void; | ||
constructor(comp: AgPrimaryColsList, virtualList: VirtualList); | ||
postConstruct(): void; | ||
private getCurrentDragValue; | ||
@@ -11,0 +15,0 @@ private isMoveBlocked; |
@@ -1,3 +0,4 @@ | ||
import { Column, Component, ITooltipParams, WithoutGridCommon } from "@ag-grid-community/core"; | ||
import { ColumnModelItem } from "./columnModelItem"; | ||
import type { AgColumn, BeanCollection, ITooltipParams, WithoutGridCommon } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
import type { ColumnModelItem } from './columnModelItem'; | ||
export declare class ToolPanelColumnComp extends Component { | ||
@@ -7,8 +8,8 @@ private readonly allowDragging; | ||
private readonly focusWrapper; | ||
private static TEMPLATE; | ||
private readonly columnModel; | ||
private readonly dragAndDropService; | ||
private readonly modelItemUtils; | ||
private eLabel; | ||
private cbSelect; | ||
private columnModel; | ||
private dragAndDropService; | ||
private modelItemUtils; | ||
wireBeans(beans: BeanCollection): void; | ||
private readonly eLabel; | ||
private readonly cbSelect; | ||
private column; | ||
@@ -20,4 +21,4 @@ private columnDept; | ||
constructor(modelItem: ColumnModelItem, allowDragging: boolean, groupsExist: boolean, focusWrapper: HTMLElement); | ||
init(): void; | ||
getColumn(): Column; | ||
postConstruct(): void; | ||
getColumn(): AgColumn; | ||
private setupTooltip; | ||
@@ -39,3 +40,3 @@ getTooltipParams(): WithoutGridCommon<ITooltipParams>; | ||
isExpandable(): boolean; | ||
setExpanded(value: boolean): void; | ||
setExpanded(_value: boolean): void; | ||
} |
@@ -1,3 +0,4 @@ | ||
import { Column, ColumnEventType, Component, ITooltipParams, WithoutGridCommon } from "@ag-grid-community/core"; | ||
import { ColumnModelItem } from "./columnModelItem"; | ||
import type { AgColumn, BeanCollection, ColumnEventType, ITooltipParams, WithoutGridCommon } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
import type { ColumnModelItem } from './columnModelItem'; | ||
export declare class ToolPanelColumnGroupComp extends Component { | ||
@@ -8,11 +9,11 @@ private readonly modelItem; | ||
private readonly focusWrapper; | ||
private static TEMPLATE; | ||
private columnModel; | ||
private dragAndDropService; | ||
private modelItemUtils; | ||
private cbSelect; | ||
private eLabel; | ||
private eGroupOpenedIcon; | ||
private eGroupClosedIcon; | ||
private eColumnGroupIcons; | ||
wireBeans(beans: BeanCollection): void; | ||
private readonly cbSelect; | ||
private readonly eLabel; | ||
private readonly eGroupOpenedIcon; | ||
private readonly eGroupClosedIcon; | ||
private readonly eColumnGroupIcons; | ||
private eDragHandle; | ||
@@ -24,4 +25,4 @@ private readonly columnGroup; | ||
constructor(modelItem: ColumnModelItem, allowDragging: boolean, eventType: ColumnEventType, focusWrapper: HTMLElement); | ||
init(): void; | ||
getColumns(): Column[]; | ||
postConstruct(): void; | ||
getColumns(): AgColumn[]; | ||
private setupTooltip; | ||
@@ -28,0 +29,0 @@ getTooltipParams(): WithoutGridCommon<ITooltipParams>; |
@@ -1,2 +0,3 @@ | ||
import { Column, Component, ProvidedColumnGroup } from "@ag-grid-community/core"; | ||
import type { AgColumn, AgProvidedColumnGroup, BeanCollection } from '@ag-grid-community/core'; | ||
import { Component } from '@ag-grid-community/core'; | ||
export declare class ToolPanelContextMenu extends Component { | ||
@@ -6,2 +7,8 @@ private readonly column; | ||
private readonly parentEl; | ||
private columnModel; | ||
private columnNameService; | ||
private funcColsService; | ||
private popupService; | ||
private focusService; | ||
wireBeans(beans: BeanCollection): void; | ||
private columns; | ||
@@ -13,7 +20,4 @@ private allowGrouping; | ||
private displayName; | ||
private readonly columnModel; | ||
private readonly popupService; | ||
private readonly focusService; | ||
constructor(column: Column | ProvidedColumnGroup, mouseEvent: MouseEvent, parentEl: HTMLElement); | ||
private postConstruct; | ||
constructor(column: AgColumn | AgProvidedColumnGroup, mouseEvent: MouseEvent, parentEl: HTMLElement); | ||
postConstruct(): void; | ||
private initializeProperties; | ||
@@ -20,0 +24,0 @@ private buildMenuItemMap; |
@@ -1,2 +0,2 @@ | ||
export { ColumnsToolPanelModule } from "./columnsToolPanelModule"; | ||
export { PrimaryColsPanel } from "./columnToolPanel/primaryColsPanel"; | ||
export { ColumnsToolPanelModule } from './columnsToolPanelModule'; | ||
export { AgPrimaryCols } from './columnToolPanel/agPrimaryCols'; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "31.3.2"; | ||
export declare const VERSION = "32.0.0"; |
{ | ||
"name": "@ag-grid-enterprise/column-tool-panel", | ||
"version": "31.3.2", | ||
"version": "32.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -14,7 +14,8 @@ "main": "./dist/package/main.cjs.js", | ||
}, | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@ag-grid-community/core": "31.3.2", | ||
"@ag-grid-enterprise/core": "31.3.2", | ||
"@ag-grid-enterprise/row-grouping": "31.3.2", | ||
"@ag-grid-enterprise/side-bar": "31.3.2" | ||
"@ag-grid-community/core": "32.0.0", | ||
"@ag-grid-enterprise/core": "32.0.0", | ||
"@ag-grid-enterprise/row-grouping": "32.0.0", | ||
"@ag-grid-enterprise/side-bar": "32.0.0" | ||
}, | ||
@@ -21,0 +22,0 @@ "devDependencies": { |
@@ -1,3 +0,2 @@ | ||
AG Grid Enterprise | ||
============== | ||
# AG Grid Enterprise | ||
@@ -8,4 +7,4 @@ This project contains AG Grid Enterprise features. | ||
Frameworks Supported | ||
==================== | ||
# Frameworks Supported | ||
Framework specific Getting Started guides: | ||
@@ -21,4 +20,3 @@ | ||
Issue Reporting | ||
============== | ||
# Issue Reporting | ||
@@ -29,2 +27,1 @@ If you are an Enterprise customer (or are evaluating AG Grid Enterprise) and wish to report a Bug or raise a new Feature Request please do so on our [Support Portal](https://ag-grid.zendesk.com/). | ||
Send an email to accounts@ag-grid.com with your license key | ||
@@ -1,2 +0,1 @@ | ||
Support and Maintenance document is now merged into the licence document. Please see the licence. |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26
381635
4645
25
+ Added@ag-grid-community/core@32.0.0(transitive)
+ Added@ag-grid-enterprise/core@32.0.0(transitive)
+ Added@ag-grid-enterprise/row-grouping@32.0.0(transitive)
+ Added@ag-grid-enterprise/side-bar@32.0.0(transitive)
+ Addedag-charts-types@10.0.0(transitive)
- Removed@ag-grid-community/core@31.3.2(transitive)
- Removed@ag-grid-enterprise/core@31.3.2(transitive)
- Removed@ag-grid-enterprise/row-grouping@31.3.2(transitive)
- Removed@ag-grid-enterprise/side-bar@31.3.2(transitive)