Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 32.1.0 to 32.2.0

4

dist/package/main.cjs.js

@@ -548,3 +548,3 @@ var __defProp = Object.defineProperty;

recreateFilters(columnTree) {
const activeElement = this.gos.getActiveDomElement();
const activeElement = (0, import_core5._getActiveDomElement)(this.gos);
if (!this.hasLoadedInitialState) {

@@ -986,3 +986,3 @@ this.hasLoadedInitialState = true;

// enterprise-modules/filter-tool-panel/src/version.ts
var VERSION = "32.1.0";
var VERSION = "32.2.0";

@@ -989,0 +989,0 @@ // enterprise-modules/filter-tool-panel/src/filtersToolPanelModule.ts

@@ -14,5 +14,5 @@ var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var s in e)__defProp(t,s,{get:e[s],enumerable:!0})},__copyProps=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of __getOwnPropNames(e))!__hasOwnProp.call(t,r)&&r!==s&&__defProp(t,r,{get:()=>e[r],enumerable:!(i=__getOwnPropDesc(e,r))||i.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),main_exports={};__export(main_exports,{FiltersToolPanelModule:()=>FiltersToolPanelModule}),module.exports=__toCommonJS(main_exports);var import_core7=require("@ag-grid-community/core"),import_core8=require("@ag-grid-enterprise/core"),import_side_bar=require("@ag-grid-enterprise/side-bar"),import_core6=require("@ag-grid-community/core"),import_core=require("@ag-grid-community/core"),AgFiltersToolPanelHeader=class extends import_core.Component{constructor(){super(...arguments),this.eExpand=import_core.RefPlaceholder,this.eFilterTextField=import_core.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.setTemplate(`<div class="ag-filter-toolpanel-search" role="presentation">

<ag-group-component data-ref="filterGroupComp"></ag-group-component>
</div>`,[import_core4.AgGroupComponentSelector],{filterGroupComp:e}),this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass(`ag-filter-toolpanel-group-level-${this.depth}`),this.filterGroupComp.getGui().style.setProperty("--ag-indentation-level",String(this.depth)),this.filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth}-header`),this.childFilterComps.forEach(s=>{this.filterGroupComp.addItem(s),s.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth+1}-header`),s.getGui().style.setProperty("--ag-indentation-level",String(this.depth+1))}),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filter")}setupTooltip(){if(!this.showingColumn)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let s;e&&(s=()=>{const a=this.filterGroupComp.getGui().querySelector(".ag-group-title");return a?a.scrollWidth>a.clientWidth:!0});const i=()=>{const r=this.columnGroup.getColDef().headerTooltip;this.setTooltip({newTooltipText:r,location:"filterToolPanelColumnGroup",shouldDisplayTooltip:s})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const e=super.getTooltipParams();return e.location="filterToolPanelColumnGroup",e}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}refreshFilters(e){this.childFilterComps.forEach(s=>{s instanceof c?s.refreshFilters(e):s.refreshFilter(e)})}isColumnGroup(){return(0,import_core3.isProvidedColumnGroup)(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName?this.filterGroupName:""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,s){this.filterGroupComp.hideItem(e,s)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const s=(0,import_core3._createIconNoSpan)(e,this.gos);s&&s.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(s)}forEachToolPanelFilterChild(e){this.childFilterComps.forEach(s=>{s instanceof ToolPanelFilterComp&&e(s)})}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.expand()),s=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:e,collapsed:s})}getColumns(){return(0,import_core3.isProvidedColumnGroup)(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(e=>{this.addManagedListeners(e,{filterChanged:()=>this.refreshFilterClass()})}),(0,import_core3.isProvidedColumnGroup)(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){const e=this.getColumns(),s=()=>e.some(i=>i.isFilterActive());this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",s())}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){this.filterGroupName=(0,import_core3.isProvidedColumnGroup)(this.columnGroup)?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")}getColumnGroupName(e){return this.columnNameService.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.columnNameService.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),(0,import_core3._clearElement)(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},AgFiltersToolPanelList=class extends import_core5.Component{constructor(){super('<div class="ag-filter-list-panel"></div>'),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(t){this.toolPanelColDefService=t.toolPanelColDefService,this.columnModel=t.columnModel}init(t){this.initialised=!0;const e=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});(0,import_core5._mergeDeep)(e,t),this.params=e,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:s=>{s.key==="filters"&&this.refreshFilters(s.visible)},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.columnModel.isReady()&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}const t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const t=this.columnModel.getColDefColTree();this.recreateFilters(t)}setFiltersLayout(t){const e=this.toolPanelColDefService.createColumnTree(t);this.recreateFilters(e)}recreateFilters(t){const e=this.gos.getActiveDomElement();this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const s=this.getExpansionState();this.destroyFilters(),this.filterGroupComps=this.recursivelyAddComps(t,0,s);const i=this.filterGroupComps.length;i&&(this.filterGroupComps.forEach(r=>this.appendChild(r)),this.setFirstAndLastVisible(0,i-1)),(0,import_core5._exists)(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent(),this.getGui().contains(e)&&e.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(t,e,s){return(0,import_core5._flatten)(t.map(i=>{if((0,import_core5.isProvidedColumnGroup)(i))return(0,import_core5._flatten)(this.recursivelyAddFilterGroupComps(i,e,s));const r=i;if(!this.shouldDisplayFilter(r))return[];const a=e===0,l=new ToolPanelFilterComp(a,()=>this.onFilterExpanded());if(this.createBean(l),l.setColumn(r),s.get(r.getId())&&l.expand(),e>0)return l;const n=this.createBean(new ToolPanelFilterGroupComp(r,[l],this.onGroupExpanded.bind(this),e,!0));return n.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.get(n.getFilterGroupId())||n.collapse(),n}))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaFilterPanelList","Filter List"),s=t("filters","Filters"),d=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;(0,import_core5._setAriaLabel)(this.getAriaElement(),`${e} ${d} ${s}`)}recursivelyAddFilterGroupComps(t,e,s){if(!this.filtersExistInChildren(t.getChildren()))return;const i=t.getColGroupDef();if(i&&i.suppressFiltersToolPanel)return[];const r=t.isPadding()?e:e+1,a=(0,import_core5._flatten)(this.recursivelyAddComps(t.getChildren(),r,s));if(t.isPadding())return a;const l=new ToolPanelFilterGroupComp(t,a,this.onGroupExpanded.bind(this),e,!1);this.createBean(l),l.addCssClassToTitleBar("ag-filter-toolpanel-header");const n=s.get(l.getFilterGroupId());return(this.isInitialState&&!n||n===!1)&&l.collapse(),[l]}filtersExistInChildren(t){return t.some(e=>(0,import_core5.isProvidedColumnGroup)(e)?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(t){const e=t.getColDef()&&t.getColDef().suppressFiltersToolPanel;return t.isFilterAllowed()&&!e}getExpansionState(){const t=new Map;if(this.isInitialState){const{expandedColIds:s,expandedGroupIds:i}=this.params.initialState;return s.forEach(r=>t.set(r,!0)),i.forEach(r=>t.set(r,!0)),t}const e=s=>{t.set(s.getFilterGroupId(),s.isExpanded()),s.getChildren().forEach(i=>{i instanceof ToolPanelFilterGroupComp?e(i):t.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(e),t}refresh(){}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}expandFilterGroups(t,e){const s=[],i=r=>{const a=r.getFilterGroupId();(!e||(0,import_core5._includes)(e,a))&&(t&&r.isColumnGroup()?r.expand():r.collapse(),s.push(a)),r.getChildren().forEach(n=>{n instanceof ToolPanelFilterGroupComp&&i(n)})};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),e){const r=e.filter(a=>s.indexOf(a)<0);r.length>0&&(0,import_core5._warnOnce)("unable to find groups for these supplied groupIds:",r)}}expandFilters(t,e){const s=[],i=r=>{if(r instanceof ToolPanelFilterGroupComp){let n=!1;return r.getChildren().forEach(d=>{i(d)&&(t?(r.expand(),n=!0):r.isColumnGroup()||r.collapse())}),n}const a=r.getColumn().getColId(),l=!e||(0,import_core5._includes)(e,a);return l&&(t?r.expand():r.collapse(),s.push(a)),l};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),e){const r=e.filter(a=>s.indexOf(a)<0);r.length>0&&(0,import_core5._warnOnce)("unable to find columns for these supplied colIds:"+r)}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let t=0,e=0;const s=r=>{r.isColumnGroup()&&(r.isExpanded()?t++:e++,r.getChildren().forEach(a=>{a instanceof ToolPanelFilterGroupComp&&s(a)}))};this.filterGroupComps.forEach(s);let i;t>0&&e>0?i=2:e>0?i=1:i=0,this.dispatchLocalEvent({type:"groupExpanded",state:i})}performFilterSearch(t){this.searchFilterText=(0,import_core5._exists)(t)?t.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(t){const e=a=>!(0,import_core5._exists)(t)||a.toLowerCase().indexOf(t)!==-1,s=(a,l)=>{if(!(a instanceof ToolPanelFilterGroupComp))return e(a.getColumnFilterName()||"");const n=a.getChildren(),d=e(a.getFilterGroupName()),h=l||d;if(h){a.hideGroup(!1);for(let o=0;o<n.length;o++)s(n[o],h),a.hideGroupItem(!1,o);return!0}let p=!1;return n.forEach((o,f)=>{const u=s(o,l);a.hideGroupItem(!u,f),u&&(p=!0)}),a.hideGroup(!p),p};let i,r;this.filterGroupComps.forEach((a,l)=>{s(a,!1),i===void 0?a.containsCssClass("ag-hidden")||(i=l,r=l):!a.containsCssClass("ag-hidden")&&r!==l&&(r=l)}),this.setFirstAndLastVisible(i,r),this.refreshAriaLabel()}setFirstAndLastVisible(t,e){this.filterGroupComps.forEach((s,i)=>{s.removeCssClass("ag-first-group-visible"),s.removeCssClass("ag-last-group-visible"),i===t&&s.addCssClass("ag-first-group-visible"),i===e&&s.addCssClass("ag-last-group-visible")})}refreshFilters(t){this.filterGroupComps.forEach(e=>e.refreshFilters(t))}getExpandedFiltersAndGroups(){const t=[],e=new Set,s=i=>{if(i instanceof ToolPanelFilterGroupComp){i.getChildren().forEach(a=>s(a));const r=i.getFilterGroupId();i.isExpanded()&&!e.has(r)&&t.push(r)}else i.isExpanded()&&e.add(i.getColumn().getColId())};return this.filterGroupComps.forEach(s),{expandedGroupIds:t,expandedColIds:Array.from(e)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),(0,import_core5._clearElement)(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},AgFiltersToolPanelListSelector={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:AgFiltersToolPanelList},FiltersToolPanel=class extends import_core6.Component{constructor(){super(`<div class="ag-filter-toolpanel">
</div>`,[import_core4.AgGroupComponentSelector],{filterGroupComp:e}),this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass(`ag-filter-toolpanel-group-level-${this.depth}`),this.filterGroupComp.getGui().style.setProperty("--ag-indentation-level",String(this.depth)),this.filterGroupComp.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth}-header`),this.childFilterComps.forEach(s=>{this.filterGroupComp.addItem(s),s.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${this.depth+1}-header`),s.getGui().style.setProperty("--ag-indentation-level",String(this.depth+1))}),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filter")}setupTooltip(){if(!this.showingColumn)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let s;e&&(s=()=>{const a=this.filterGroupComp.getGui().querySelector(".ag-group-title");return a?a.scrollWidth>a.clientWidth:!0});const i=()=>{const r=this.columnGroup.getColDef().headerTooltip;this.setTooltip({newTooltipText:r,location:"filterToolPanelColumnGroup",shouldDisplayTooltip:s})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const e=super.getTooltipParams();return e.location="filterToolPanelColumnGroup",e}addCssClassToTitleBar(e){this.filterGroupComp.addCssClassToTitleBar(e)}refreshFilters(e){this.childFilterComps.forEach(s=>{s instanceof c?s.refreshFilters(e):s.refreshFilter(e)})}isColumnGroup(){return(0,import_core3.isProvidedColumnGroup)(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName?this.filterGroupName:""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(e,s){this.filterGroupComp.hideItem(e,s)}hideGroup(e){this.setDisplayed(!e)}addInIcon(e){const s=(0,import_core3._createIconNoSpan)(e,this.gos);s&&s.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(s)}forEachToolPanelFilterChild(e){this.childFilterComps.forEach(s=>{s instanceof ToolPanelFilterComp&&e(s)})}addExpandCollapseListeners(){const e=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.expand()),s=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:e,collapsed:s})}getColumns(){return(0,import_core3.isProvidedColumnGroup)(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(e=>{this.addManagedListeners(e,{filterChanged:()=>this.refreshFilterClass()})}),(0,import_core3.isProvidedColumnGroup)(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){const e=this.getColumns(),s=()=>e.some(i=>i.isFilterActive());this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",s())}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){this.filterGroupName=(0,import_core3.isProvidedColumnGroup)(this.columnGroup)?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")}getColumnGroupName(e){return this.columnNameService.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")}getColumnName(e){return this.columnNameService.getDisplayNameForColumn(e,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),(0,import_core3._clearElement)(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},AgFiltersToolPanelList=class extends import_core5.Component{constructor(){super('<div class="ag-filter-list-panel"></div>'),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(t){this.toolPanelColDefService=t.toolPanelColDefService,this.columnModel=t.columnModel}init(t){this.initialised=!0;const e=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});(0,import_core5._mergeDeep)(e,t),this.params=e,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:s=>{s.key==="filters"&&this.refreshFilters(s.visible)},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.columnModel.isReady()&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}const t=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!t?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const t=this.columnModel.getColDefColTree();this.recreateFilters(t)}setFiltersLayout(t){const e=this.toolPanelColDefService.createColumnTree(t);this.recreateFilters(e)}recreateFilters(t){const e=(0,import_core5._getActiveDomElement)(this.gos);this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const s=this.getExpansionState();this.destroyFilters(),this.filterGroupComps=this.recursivelyAddComps(t,0,s);const i=this.filterGroupComps.length;i&&(this.filterGroupComps.forEach(r=>this.appendChild(r)),this.setFirstAndLastVisible(0,i-1)),(0,import_core5._exists)(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent(),this.getGui().contains(e)&&e.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(t,e,s){return(0,import_core5._flatten)(t.map(i=>{if((0,import_core5.isProvidedColumnGroup)(i))return(0,import_core5._flatten)(this.recursivelyAddFilterGroupComps(i,e,s));const r=i;if(!this.shouldDisplayFilter(r))return[];const a=e===0,l=new ToolPanelFilterComp(a,()=>this.onFilterExpanded());if(this.createBean(l),l.setColumn(r),s.get(r.getId())&&l.expand(),e>0)return l;const n=this.createBean(new ToolPanelFilterGroupComp(r,[l],this.onGroupExpanded.bind(this),e,!0));return n.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.get(n.getFilterGroupId())||n.collapse(),n}))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaFilterPanelList","Filter List"),s=t("filters","Filters"),d=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;(0,import_core5._setAriaLabel)(this.getAriaElement(),`${e} ${d} ${s}`)}recursivelyAddFilterGroupComps(t,e,s){if(!this.filtersExistInChildren(t.getChildren()))return;const i=t.getColGroupDef();if(i&&i.suppressFiltersToolPanel)return[];const r=t.isPadding()?e:e+1,a=(0,import_core5._flatten)(this.recursivelyAddComps(t.getChildren(),r,s));if(t.isPadding())return a;const l=new ToolPanelFilterGroupComp(t,a,this.onGroupExpanded.bind(this),e,!1);this.createBean(l),l.addCssClassToTitleBar("ag-filter-toolpanel-header");const n=s.get(l.getFilterGroupId());return(this.isInitialState&&!n||n===!1)&&l.collapse(),[l]}filtersExistInChildren(t){return t.some(e=>(0,import_core5.isProvidedColumnGroup)(e)?this.filtersExistInChildren(e.getChildren()):this.shouldDisplayFilter(e))}shouldDisplayFilter(t){const e=t.getColDef()&&t.getColDef().suppressFiltersToolPanel;return t.isFilterAllowed()&&!e}getExpansionState(){const t=new Map;if(this.isInitialState){const{expandedColIds:s,expandedGroupIds:i}=this.params.initialState;return s.forEach(r=>t.set(r,!0)),i.forEach(r=>t.set(r,!0)),t}const e=s=>{t.set(s.getFilterGroupId(),s.isExpanded()),s.getChildren().forEach(i=>{i instanceof ToolPanelFilterGroupComp?e(i):t.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(e),t}refresh(){}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}expandFilterGroups(t,e){const s=[],i=r=>{const a=r.getFilterGroupId();(!e||(0,import_core5._includes)(e,a))&&(t&&r.isColumnGroup()?r.expand():r.collapse(),s.push(a)),r.getChildren().forEach(n=>{n instanceof ToolPanelFilterGroupComp&&i(n)})};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),e){const r=e.filter(a=>s.indexOf(a)<0);r.length>0&&(0,import_core5._warnOnce)("unable to find groups for these supplied groupIds:",r)}}expandFilters(t,e){const s=[],i=r=>{if(r instanceof ToolPanelFilterGroupComp){let n=!1;return r.getChildren().forEach(d=>{i(d)&&(t?(r.expand(),n=!0):r.isColumnGroup()||r.collapse())}),n}const a=r.getColumn().getColId(),l=!e||(0,import_core5._includes)(e,a);return l&&(t?r.expand():r.collapse(),s.push(a)),l};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),e){const r=e.filter(a=>s.indexOf(a)<0);r.length>0&&(0,import_core5._warnOnce)("unable to find columns for these supplied colIds:"+r)}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let t=0,e=0;const s=r=>{r.isColumnGroup()&&(r.isExpanded()?t++:e++,r.getChildren().forEach(a=>{a instanceof ToolPanelFilterGroupComp&&s(a)}))};this.filterGroupComps.forEach(s);let i;t>0&&e>0?i=2:e>0?i=1:i=0,this.dispatchLocalEvent({type:"groupExpanded",state:i})}performFilterSearch(t){this.searchFilterText=(0,import_core5._exists)(t)?t.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(t){const e=a=>!(0,import_core5._exists)(t)||a.toLowerCase().indexOf(t)!==-1,s=(a,l)=>{if(!(a instanceof ToolPanelFilterGroupComp))return e(a.getColumnFilterName()||"");const n=a.getChildren(),d=e(a.getFilterGroupName()),h=l||d;if(h){a.hideGroup(!1);for(let o=0;o<n.length;o++)s(n[o],h),a.hideGroupItem(!1,o);return!0}let p=!1;return n.forEach((o,f)=>{const u=s(o,l);a.hideGroupItem(!u,f),u&&(p=!0)}),a.hideGroup(!p),p};let i,r;this.filterGroupComps.forEach((a,l)=>{s(a,!1),i===void 0?a.containsCssClass("ag-hidden")||(i=l,r=l):!a.containsCssClass("ag-hidden")&&r!==l&&(r=l)}),this.setFirstAndLastVisible(i,r),this.refreshAriaLabel()}setFirstAndLastVisible(t,e){this.filterGroupComps.forEach((s,i)=>{s.removeCssClass("ag-first-group-visible"),s.removeCssClass("ag-last-group-visible"),i===t&&s.addCssClass("ag-first-group-visible"),i===e&&s.addCssClass("ag-last-group-visible")})}refreshFilters(t){this.filterGroupComps.forEach(e=>e.refreshFilters(t))}getExpandedFiltersAndGroups(){const t=[],e=new Set,s=i=>{if(i instanceof ToolPanelFilterGroupComp){i.getChildren().forEach(a=>s(a));const r=i.getFilterGroupId();i.isExpanded()&&!e.has(r)&&t.push(r)}else i.isExpanded()&&e.add(i.getColumn().getColId())};return this.filterGroupComps.forEach(s),{expandedGroupIds:t,expandedColIds:Array.from(e)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),(0,import_core5._clearElement)(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},AgFiltersToolPanelListSelector={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:AgFiltersToolPanelList},FiltersToolPanel=class extends import_core6.Component{constructor(){super(`<div class="ag-filter-toolpanel">
<ag-filters-tool-panel-header data-ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>
<ag-filters-tool-panel-list data-ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>
</div>`,[AgFiltersToolPanelHeaderSelector,AgFiltersToolPanelListSelector]),this.filtersToolPanelHeaderPanel=import_core6.RefPlaceholder,this.filtersToolPanelListPanel=import_core6.RefPlaceholder,this.initialised=!1,this.listenerDestroyFuncs=[]}init(t){this.initialised&&(this.listenerDestroyFuncs.forEach(r=>r()),this.listenerDestroyFuncs=[]),this.initialised=!0;const e=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});this.params={...e,...t},this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);const s=this.params.suppressExpandAll,i=this.params.suppressFilterSearch;s&&i&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(this.filtersToolPanelHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),searchChanged:this.onSearchChanged.bind(this)}),...this.addManagedListeners(this.filtersToolPanelListPanel,{filterExpanded:this.onFilterExpanded.bind(this),groupExpanded:this.onGroupExpanded.bind(this)}))}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}onExpandAll(){this.filtersToolPanelListPanel.expandFilterGroups(!0)}onCollapseAll(){this.filtersToolPanelListPanel.expandFilterGroups(!1)}onSearchChanged(t){this.filtersToolPanelListPanel.performFilterSearch(t.searchText)}setFilterLayout(t){this.filtersToolPanelListPanel.setFiltersLayout(t)}onFilterExpanded(){this.params.onStateUpdated()}onGroupExpanded(t){this.filtersToolPanelHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}expandFilterGroups(t){this.filtersToolPanelListPanel.expandFilterGroups(!0,t)}collapseFilterGroups(t){this.filtersToolPanelListPanel.expandFilterGroups(!1,t)}expandFilters(t){this.filtersToolPanelListPanel.expandFilters(!0,t)}collapseFilters(t){this.filtersToolPanelListPanel.expandFilters(!1,t)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(t){return this.init(t),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}destroy(){super.destroy()}},VERSION="32.1.0",FiltersToolPanelModule=(0,import_core7._defineModule)({version:VERSION,moduleName:import_core7.ModuleNames.FiltersToolPanelModule,beans:[],userComponents:[{name:"agFiltersToolPanel",classImp:FiltersToolPanel}],dependantModules:[import_side_bar.SideBarModule,import_core8.EnterpriseCoreModule,import_core7._ColumnFilterModule]});
</div>`,[AgFiltersToolPanelHeaderSelector,AgFiltersToolPanelListSelector]),this.filtersToolPanelHeaderPanel=import_core6.RefPlaceholder,this.filtersToolPanelListPanel=import_core6.RefPlaceholder,this.initialised=!1,this.listenerDestroyFuncs=[]}init(t){this.initialised&&(this.listenerDestroyFuncs.forEach(r=>r()),this.listenerDestroyFuncs=[]),this.initialised=!0;const e=this.gos.addGridCommonParams({suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});this.params={...e,...t},this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);const s=this.params.suppressExpandAll,i=this.params.suppressFilterSearch;s&&i&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(this.filtersToolPanelHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),searchChanged:this.onSearchChanged.bind(this)}),...this.addManagedListeners(this.filtersToolPanelListPanel,{filterExpanded:this.onFilterExpanded.bind(this),groupExpanded:this.onGroupExpanded.bind(this)}))}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}onExpandAll(){this.filtersToolPanelListPanel.expandFilterGroups(!0)}onCollapseAll(){this.filtersToolPanelListPanel.expandFilterGroups(!1)}onSearchChanged(t){this.filtersToolPanelListPanel.performFilterSearch(t.searchText)}setFilterLayout(t){this.filtersToolPanelListPanel.setFiltersLayout(t)}onFilterExpanded(){this.params.onStateUpdated()}onGroupExpanded(t){this.filtersToolPanelHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}expandFilterGroups(t){this.filtersToolPanelListPanel.expandFilterGroups(!0,t)}collapseFilterGroups(t){this.filtersToolPanelListPanel.expandFilterGroups(!1,t)}expandFilters(t){this.filtersToolPanelListPanel.expandFilters(!0,t)}collapseFilters(t){this.filtersToolPanelListPanel.expandFilters(!1,t)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(t){return this.init(t),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}destroy(){super.destroy()}},VERSION="32.2.0",FiltersToolPanelModule=(0,import_core7._defineModule)({version:VERSION,moduleName:import_core7.ModuleNames.FiltersToolPanelModule,beans:[],userComponents:[{name:"agFiltersToolPanel",classImp:FiltersToolPanel}],dependantModules:[import_side_bar.SideBarModule,import_core8.EnterpriseCoreModule,import_core7._ColumnFilterModule]});
{
"name": "@ag-grid-enterprise/filter-tool-panel",
"version": "32.1.0",
"version": "32.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"@ag-grid-enterprise/side-bar": "32.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"@ag-grid-enterprise/side-bar": "32.2.0"
},

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

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

@@ -16,5 +16,5 @@ "main": "./src/main.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"@ag-grid-enterprise/side-bar": "32.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"@ag-grid-enterprise/side-bar": "32.2.0"
},

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

@@ -1,1 +0,1 @@

export declare const VERSION = "32.1.0";
export declare const VERSION = "32.2.0";
{
"name": "@ag-grid-enterprise/filter-tool-panel",
"version": "32.1.0",
"version": "32.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.1.0",
"@ag-grid-enterprise/core": "32.1.0",
"@ag-grid-enterprise/side-bar": "32.1.0"
"@ag-grid-community/core": "32.2.0",
"@ag-grid-enterprise/core": "32.2.0",
"@ag-grid-enterprise/side-bar": "32.2.0"
},

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc