@ag-grid-enterprise/filter-tool-panel
Advanced tools
Comparing version 26.2.0 to 27.0.0
/** | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -156,3 +156,3 @@ ' * @license Commercial | ||
this.addManagedListener(this.eFilterToolPanelHeader, 'keydown', function (e) { | ||
if (e.keyCode === core.KeyCode.ENTER) { | ||
if (e.key === core.KeyCode.ENTER) { | ||
_this.toggleExpanded(); | ||
@@ -163,6 +163,6 @@ } | ||
this.addInIcon('filter', this.eFilterIcon, this.column); | ||
core._.addOrRemoveCssClass(this.eFilterIcon, 'ag-hidden', !this.isFilterActive()); | ||
core._.addCssClass(this.eExpandChecked, 'ag-hidden'); | ||
this.eFilterIcon.classList.toggle('ag-hidden', !this.isFilterActive()); | ||
this.eExpandChecked.classList.add('ag-hidden'); | ||
if (this.hideHeader) { | ||
core._.addOrRemoveCssClass(this.eFilterToolPanelHeader, 'ag-hidden', true); | ||
this.eFilterToolPanelHeader.classList.toggle('ag-hidden', true); | ||
this.eFilterToolPanelHeader.removeAttribute('tabindex'); | ||
@@ -182,3 +182,3 @@ } | ||
ToolPanelFilterComp.prototype.addCssClassToTitleBar = function (cssClass) { | ||
core._.addCssClass(this.eFilterToolPanelHeader, cssClass); | ||
this.eFilterToolPanelHeader.classList.add(cssClass); | ||
}; | ||
@@ -196,3 +196,3 @@ ToolPanelFilterComp.prototype.addInIcon = function (iconName, eParent, column) { | ||
ToolPanelFilterComp.prototype.onFilterChanged = function () { | ||
core._.addOrRemoveCssClass(this.eFilterIcon, 'ag-hidden', !this.isFilterActive()); | ||
this.eFilterIcon.classList.toggle('ag-hidden', !this.isFilterActive()); | ||
this.dispatchEvent({ type: core.Column.EVENT_FILTER_CHANGED }); | ||
@@ -205,2 +205,3 @@ }; | ||
var _this = this; | ||
var _a; | ||
if (this.expanded) { | ||
@@ -212,3 +213,3 @@ return; | ||
var container = core._.loadTemplate(/* html */ "<div class=\"ag-filter-toolpanel-instance-filter\"></div>"); | ||
var filterPromise = this.filterManager.getOrCreateFilterWrapper(this.column, 'TOOLBAR').filterPromise; | ||
var filterPromise = (_a = this.filterManager.getOrCreateFilterWrapper(this.column, 'TOOLBAR')) === null || _a === void 0 ? void 0 : _a.filterPromise; | ||
if (filterPromise) { | ||
@@ -336,3 +337,3 @@ filterPromise.then(function (filter) { | ||
this.filterGroupComp.setAlignItems('stretch'); | ||
core._.addCssClass(this.filterGroupComp.getGui(), "ag-filter-toolpanel-group-level-" + this.depth); | ||
this.filterGroupComp.addCssClass("ag-filter-toolpanel-group-level-" + this.depth); | ||
this.filterGroupComp.addCssClassToTitleBar("ag-filter-toolpanel-group-level-" + this.depth + "-header"); | ||
@@ -400,6 +401,6 @@ this.childFilterComps.forEach(function (filterComp) { | ||
ToolPanelFilterGroupComp.prototype.hideGroup = function (hide) { | ||
core._.addOrRemoveCssClass(this.getGui(), 'ag-hidden', hide); | ||
this.addOrRemoveCssClass('ag-hidden', hide); | ||
}; | ||
ToolPanelFilterGroupComp.prototype.forEachToolPanelFilterChild = function (action) { | ||
core._.forEach(this.childFilterComps, function (filterComp) { | ||
this.childFilterComps.forEach(function (filterComp) { | ||
if (filterComp instanceof ToolPanelFilterComp) { | ||
@@ -428,3 +429,3 @@ action(filterComp); | ||
_this.addManagedListener(column, core.Column.EVENT_FILTER_CHANGED, function () { | ||
core._.addOrRemoveCssClass(_this.filterGroupComp.getGui(), 'ag-has-filter', anyChildFiltersActive_1()); | ||
_this.filterGroupComp.addOrRemoveCssClass('ag-has-filter', anyChildFiltersActive_1()); | ||
}); | ||
@@ -437,3 +438,3 @@ }); | ||
this.addManagedListener(column_1, core.Column.EVENT_FILTER_CHANGED, function () { | ||
core._.addOrRemoveCssClass(_this.filterGroupComp.getGui(), 'ag-has-filter', column_1.isFilterActive()); | ||
_this.filterGroupComp.addOrRemoveCssClass('ag-has-filter', column_1.isFilterActive()); | ||
}); | ||
@@ -468,3 +469,3 @@ } | ||
ToolPanelFilterGroupComp.prototype.getColumnGroupName = function (columnGroup) { | ||
return this.columnModel.getDisplayNameForOriginalColumnGroup(null, columnGroup, 'filterToolPanel'); | ||
return this.columnModel.getDisplayNameForProvidedColumnGroup(null, columnGroup, 'filterToolPanel'); | ||
}; | ||
@@ -801,3 +802,3 @@ ToolPanelFilterGroupComp.prototype.getColumnName = function (column) { | ||
if (firstVisible === undefined) { | ||
if (!core._.containsClass(filterGroup.getGui(), 'ag-hidden')) { | ||
if (!filterGroup.containsCssClass('ag-hidden')) { | ||
firstVisible = idx; | ||
@@ -807,3 +808,3 @@ lastVisible = idx; | ||
} | ||
else if (!core._.containsClass(filterGroup.getGui(), 'ag-hidden') && lastVisible !== idx) { | ||
else if (!filterGroup.containsCssClass('ag-hidden') && lastVisible !== idx) { | ||
lastVisible = idx; | ||
@@ -816,9 +817,9 @@ } | ||
this.filterGroupComps.forEach(function (filterGroup, idx) { | ||
core._.removeCssClass(filterGroup.getGui(), 'ag-first-group-visible'); | ||
core._.removeCssClass(filterGroup.getGui(), 'ag-last-group-visible'); | ||
filterGroup.removeCssClass('ag-first-group-visible'); | ||
filterGroup.removeCssClass('ag-last-group-visible'); | ||
if (idx === firstIdx) { | ||
core._.addCssClass(filterGroup.getGui(), 'ag-first-group-visible'); | ||
filterGroup.addCssClass('ag-first-group-visible'); | ||
} | ||
if (idx === lastIdx) { | ||
core._.addCssClass(filterGroup.getGui(), 'ag-last-group-visible'); | ||
filterGroup.addCssClass('ag-last-group-visible'); | ||
} | ||
@@ -825,0 +826,0 @@ }); |
/** | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -8,6 +8,6 @@ ' * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @ag-grid-enterprise/filter-tool-panel - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0 | ||
* @link http://www.ag-grid.com/ | ||
' * @license Commercial | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),i=require("@ag-grid-enterprise/core"),r=require("@ag-grid-enterprise/side-bar"),n=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}),s=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.EXPANDED=0]="EXPANDED",e[e.COLLAPSED=1]="COLLAPSED",e[e.INDETERMINATE=2]="INDETERMINATE"}(t||(t={}));var l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.preConstruct=function(){this.setTemplate('<div class="ag-filter-toolpanel-search" role="presentation">\n <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n <ag-input-text-field ref="eFilterTextField" class="ag-filter-toolpanel-search-input"></ag-input-text-field>\n </div>')},i.prototype.postConstruct=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.onValueChange(this.onSearchTextChanged.bind(this)),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.createExpandIcons(),this.setExpandState(t.EXPANDED),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this))},i.prototype.init=function(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()},i.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=o._.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper))},i.prototype.showOrHideOptions=function(){var e=!this.params.suppressFilterSearch,t=!this.params.suppressExpandAll,i=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search..."));var r=this.columnModel.getAllGridColumns().some((function(e){return e.getOriginalParent()&&e.isFilterAllowed()}));o._.setDisplayed(this.eFilterTextField.getGui(),e),o._.setDisplayed(this.eExpand,t&&r)},i.prototype.onSearchTextChanged=function(){var e=this;this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=o._.debounce((function(){e.dispatchEvent({type:"searchChanged",searchText:e.eFilterTextField.getValue()})}),300)),this.onSearchTextChangedDebounced()},i.prototype.onExpandClicked=function(){var e=this.currentExpandState===t.EXPANDED?{type:"collapseAll"}:{type:"expandAll"};this.dispatchEvent(e)},i.prototype.setExpandState=function(e){this.currentExpandState=e,o._.setDisplayed(this.eExpandChecked,this.currentExpandState===t.EXPANDED),o._.setDisplayed(this.eExpandUnchecked,this.currentExpandState===t.COLLAPSED),o._.setDisplayed(this.eExpandIndeterminate,this.currentExpandState===t.INDETERMINATE)},s([o.Autowired("columnModel")],i.prototype,"columnModel",void 0),s([o.RefSelector("eExpand")],i.prototype,"eExpand",void 0),s([o.RefSelector("eFilterTextField")],i.prototype,"eFilterTextField",void 0),s([o.PreConstruct],i.prototype,"preConstruct",null),s([o.PostConstruct],i.prototype,"postConstruct",null),i}(o.Component),a=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),p=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},d=function(e){function t(o){void 0===o&&(o=!1);var i=e.call(this,t.TEMPLATE)||this;return i.expanded=!1,i.hideHeader=o,i}return a(t,e),t.prototype.postConstruct=function(){this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper),this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper),this.eExpand.appendChild(this.eExpandChecked),this.eExpand.appendChild(this.eExpandUnchecked)},t.prototype.setColumn=function(e){var t=this;this.column=e,this.eFilterName.innerText=this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)||"",this.addManagedListener(this.eFilterToolPanelHeader,"click",this.toggleExpanded.bind(this)),this.addManagedListener(this.eFilterToolPanelHeader,"keydown",(function(e){e.keyCode===o.KeyCode.ENTER&&t.toggleExpanded()})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addInIcon("filter",this.eFilterIcon,this.column),o._.addOrRemoveCssClass(this.eFilterIcon,"ag-hidden",!this.isFilterActive()),o._.addCssClass(this.eExpandChecked,"ag-hidden"),this.hideHeader?(o._.addOrRemoveCssClass(this.eFilterToolPanelHeader,"ag-hidden",!0),this.eFilterToolPanelHeader.removeAttribute("tabindex")):this.eFilterToolPanelHeader.setAttribute("tabindex","0"),this.addManagedListener(this.column,o.Column.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},t.prototype.getColumn=function(){return this.column},t.prototype.getColumnFilterName=function(){return this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)},t.prototype.addCssClassToTitleBar=function(e){o._.addCssClass(this.eFilterToolPanelHeader,e)},t.prototype.addInIcon=function(e,t,i){if(null!=t){var r=o._.createIconNoSpan(e,this.gridOptionsWrapper,i);t.appendChild(r)}},t.prototype.isFilterActive=function(){return this.filterManager.isFilterActive(this.column)},t.prototype.onFilterChanged=function(){o._.addOrRemoveCssClass(this.eFilterIcon,"ag-hidden",!this.isFilterActive()),this.dispatchEvent({type:o.Column.EVENT_FILTER_CHANGED})},t.prototype.toggleExpanded=function(){this.expanded?this.collapse():this.expand()},t.prototype.expand=function(){var e=this;if(!this.expanded){this.expanded=!0,o._.setAriaExpanded(this.eFilterToolPanelHeader,!0);var t=o._.loadTemplate('<div class="ag-filter-toolpanel-instance-filter"></div>'),i=this.filterManager.getOrCreateFilterWrapper(this.column,"TOOLBAR").filterPromise;i&&i.then((function(o){e.underlyingFilter=o,o&&(t.appendChild(o.getGui()),e.agFilterToolPanelBody.appendChild(t),o.afterGuiAttached&&o.afterGuiAttached({container:"toolPanel"}))})),o._.setDisplayed(this.eExpandChecked,!0),o._.setDisplayed(this.eExpandUnchecked,!1)}},t.prototype.collapse=function(){this.expanded&&(this.expanded=!1,o._.setAriaExpanded(this.eFilterToolPanelHeader,!1),this.agFilterToolPanelBody.removeChild(this.agFilterToolPanelBody.children[0]),o._.setDisplayed(this.eExpandChecked,!1),o._.setDisplayed(this.eExpandUnchecked,!0))},t.prototype.refreshFilter=function(){if(this.expanded){var e=this.underlyingFilter;e&&"function"==typeof e.refreshVirtualList&&e.refreshVirtualList()}},t.prototype.onFilterOpened=function(e){"COLUMN_MENU"===e.source&&e.column===this.column&&this.expanded&&this.collapse()},t.TEMPLATE='\n <div class="ag-filter-toolpanel-instance">\n <div class="ag-filter-toolpanel-header ag-filter-toolpanel-instance-header" ref="eFilterToolPanelHeader" role="button" aria-expanded="false">\n <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n <span ref="eFilterName" class="ag-header-cell-text"></span>\n <span ref="eFilterIcon" class="ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" aria-hidden="true"></span>\n </div>\n <div class="ag-filter-toolpanel-instance-body ag-filter" ref="agFilterToolPanelBody"></div>\n </div>',p([o.RefSelector("eFilterToolPanelHeader")],t.prototype,"eFilterToolPanelHeader",void 0),p([o.RefSelector("eFilterName")],t.prototype,"eFilterName",void 0),p([o.RefSelector("agFilterToolPanelBody")],t.prototype,"agFilterToolPanelBody",void 0),p([o.RefSelector("eFilterIcon")],t.prototype,"eFilterIcon",void 0),p([o.RefSelector("eExpand")],t.prototype,"eExpand",void 0),p([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),p([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),p([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.Component),u=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),c=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},h=function(e){function t(t,o,i,r,n){var s=e.call(this)||this;return s.columnGroup=t,s.childFilterComps=o,s.depth=r,s.expandedCallback=i,s.showingColumn=n,s}return u(t,e),t.prototype.preConstruct=function(){this.setTemplate(t.TEMPLATE,{filterGroupComp:{cssIdentifier:"filter-toolpanel",direction:"vertical"}})},t.prototype.init=function(){var e=this;this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),o._.addCssClass(this.filterGroupComp.getGui(),"ag-filter-toolpanel-group-level-"+this.depth),this.filterGroupComp.addCssClassToTitleBar("ag-filter-toolpanel-group-level-"+this.depth+"-header"),this.childFilterComps.forEach((function(t){e.filterGroupComp.addItem(t),t.addCssClassToTitleBar("ag-filter-toolpanel-group-level-"+(e.depth+1)+"-header")})),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip()},t.prototype.setupTooltip=function(){var e=this;if(this.showingColumn){var t=function(){var t=e.columnGroup.getColDef().headerTooltip;e.setTooltip(t)};t(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t)}},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="filterToolPanelColumnGroup",t},t.prototype.addCssClassToTitleBar=function(e){this.filterGroupComp.addCssClassToTitleBar(e)},t.prototype.refreshFilters=function(){this.childFilterComps.forEach((function(e){e instanceof t?e.refreshFilters():e.refreshFilter()}))},t.prototype.isColumnGroup=function(){return this.columnGroup instanceof o.ProvidedColumnGroup},t.prototype.isExpanded=function(){return this.filterGroupComp.isExpanded()},t.prototype.getChildren=function(){return this.childFilterComps},t.prototype.getFilterGroupName=function(){return this.filterGroupName?this.filterGroupName:""},t.prototype.getFilterGroupId=function(){return this.columnGroup.getId()},t.prototype.hideGroupItem=function(e,t){this.filterGroupComp.hideItem(e,t)},t.prototype.hideGroup=function(e){o._.addOrRemoveCssClass(this.getGui(),"ag-hidden",e)},t.prototype.forEachToolPanelFilterChild=function(e){o._.forEach(this.childFilterComps,(function(t){t instanceof d&&e(t)}))},t.prototype.addExpandCollapseListeners=function(){var e=this,t=this.isColumnGroup()?function(){return e.expandedCallback()}:function(){return e.forEachToolPanelFilterChild((function(e){return e.expand()}))},i=this.isColumnGroup()?function(){return e.expandedCallback()}:function(){return e.forEachToolPanelFilterChild((function(e){return e.collapse()}))};this.addManagedListener(this.filterGroupComp,o.AgGroupComponent.EVENT_EXPANDED,t),this.addManagedListener(this.filterGroupComp,o.AgGroupComponent.EVENT_COLLAPSED,i)},t.prototype.addFilterChangedListeners=function(){var e=this;if(this.columnGroup instanceof o.ProvidedColumnGroup){var t=this.columnGroup;t.getLeafColumns().forEach((function(i){e.addManagedListener(i,o.Column.EVENT_FILTER_CHANGED,(function(){o._.addOrRemoveCssClass(e.filterGroupComp.getGui(),"ag-has-filter",t.getLeafColumns().some((function(e){return e.isFilterActive()})))}))}))}else{var i=this.columnGroup;this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addManagedListener(i,o.Column.EVENT_FILTER_CHANGED,(function(){o._.addOrRemoveCssClass(e.filterGroupComp.getGui(),"ag-has-filter",i.isFilterActive())}))}},t.prototype.onFilterOpened=function(e){"COLUMN_MENU"===e.source&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()},t.prototype.expand=function(){this.filterGroupComp.toggleGroupExpand(!0)},t.prototype.collapse=function(){this.filterGroupComp.toggleGroupExpand(!1)},t.prototype.setGroupTitle=function(){this.filterGroupName=this.columnGroup instanceof o.ProvidedColumnGroup?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")},t.prototype.getColumnGroupName=function(e){return this.columnModel.getDisplayNameForOriginalColumnGroup(null,e,"filterToolPanel")},t.prototype.getColumnName=function(e){return this.columnModel.getDisplayNameForColumn(e,"filterToolPanel",!1)},t.prototype.destroyFilters=function(){this.childFilterComps=this.destroyBeans(this.childFilterComps),o._.clearElement(this.getGui())},t.prototype.destroy=function(){this.destroyFilters(),e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-filter-toolpanel-group-wrapper">\n <ag-group-component ref="filterGroupComp"></ag-group-component>\n </div>',c([o.RefSelector("filterGroupComp")],t.prototype,"filterGroupComp",void 0),c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),c([o.PreConstruct],t.prototype,"preConstruct",null),c([o.PostConstruct],t.prototype,"init",null),t}(o.Component),f=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),C=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},y=function(e){function i(){var t=e.call(this,i.TEMPLATE)||this;return t.initialised=!1,t.filterGroupComps=[],t}return f(i,e),i.prototype.init=function(e){var t=this;this.initialised=!0;var i={suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};o._.mergeDeep(i,e),this.params=i,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_MOVED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,o.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,(function(e){"filters"===e.source&&t.refreshFilters()})),this.columnModel.isReady()&&this.onColumnsChanged()},i.prototype.onColumnsChanged=function(){var e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs()},i.prototype.syncFilterLayout=function(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this))},i.prototype.buildTreeFromProvidedColumnDefs=function(){var e=this;this.destroyFilters();var t=this.columnModel.getPrimaryColumnTree();this.filterGroupComps=this.recursivelyAddComps(t,0);var i=this.filterGroupComps.length;i&&(this.filterGroupComps.forEach((function(t){return e.appendChild(t)})),this.setFirstAndLastVisible(0,i-1)),o._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent()},i.prototype.setFiltersLayout=function(e){var t=this;this.destroyFilters();var i=this.toolPanelColDefService.createColumnTree(e);this.filterGroupComps=this.recursivelyAddComps(i,0);var r=this.filterGroupComps.length;r&&(this.filterGroupComps.forEach((function(e){return t.appendChild(e)})),this.setFirstAndLastVisible(0,r-1)),o._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent()},i.prototype.recursivelyAddComps=function(e,t){var i=this;return o._.flatten(e.map((function(e){if(e instanceof o.ProvidedColumnGroup)return o._.flatten(i.recursivelyAddFilterGroupComps(e,t));var r=e;if(!i.shouldDisplayFilter(r))return[];var n=new d(0===t);if(i.getContext().createBean(n),n.setColumn(r),t>0)return n;var s=i.createBean(new h(r,[n],i.onGroupExpanded.bind(i),t,!0));return s.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.collapse(),s})))},i.prototype.recursivelyAddFilterGroupComps=function(e,t){if(this.filtersExistInChildren(e.getChildren())){var i=e.getColGroupDef();if(i&&i.suppressFiltersToolPanel)return[];var r=e.isPadding()?t:t+1,n=o._.flatten(this.recursivelyAddComps(e.getChildren(),r));if(e.isPadding())return n;var s=new h(e,n,this.onGroupExpanded.bind(this),t,!1);return this.getContext().createBean(s),s.addCssClassToTitleBar("ag-filter-toolpanel-header"),[s]}},i.prototype.filtersExistInChildren=function(e){var t=this;return e.some((function(e){return e instanceof o.ProvidedColumnGroup?t.filtersExistInChildren(e.getChildren()):t.shouldDisplayFilter(e)}))},i.prototype.shouldDisplayFilter=function(e){var t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t},i.prototype.refresh=function(){},i.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},i.prototype.expandFilterGroups=function(e,t){var i=[],r=function(n){var s=n.getFilterGroupId();(!t||o._.includes(t,s))&&(e&&n.isColumnGroup()?n.expand():n.collapse(),i.push(s)),n.getChildren().forEach((function(e){e instanceof h&&r(e)}))};if(this.filterGroupComps.forEach(r),this.onGroupExpanded(),t){var n=t.filter((function(e){return i.indexOf(e)<0}));n.length>0&&console.warn("AG Grid: unable to find groups for these supplied groupIds:",n)}},i.prototype.expandFilters=function(e,t){var i=[],r=function(n){if(n instanceof h){var s=!1;return n.getChildren().forEach((function(t){r(t)&&(e?(n.expand(),s=!0):n.isColumnGroup()||n.collapse())})),s}var l=n.getColumn().getColId(),a=!t||o._.includes(t,l);return a&&(e?n.expand():n.collapse(),i.push(l)),a};if(this.filterGroupComps.forEach(r),this.onGroupExpanded(),t){var n=t.filter((function(e){return i.indexOf(e)<0}));n.length>0&&console.warn("AG Grid: unable to find columns for these supplied colIds:",n)}},i.prototype.onGroupExpanded=function(){this.fireExpandedEvent()},i.prototype.fireExpandedEvent=function(){var e,o=0,i=0,r=function(e){e.isColumnGroup()&&(e.isExpanded()?o++:i++,e.getChildren().forEach((function(e){e instanceof h&&r(e)})))};this.filterGroupComps.forEach(r),e=o>0&&i>0?t.INDETERMINATE:i>0?t.COLLAPSED:t.EXPANDED,this.dispatchEvent({type:"groupExpanded",state:e})},i.prototype.performFilterSearch=function(e){this.searchFilterText=o._.exists(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)},i.prototype.searchFilters=function(e){var t,i,r=function(t){return!o._.exists(e)||-1!==t.toLowerCase().indexOf(e)},n=function(e,t){if(!(e instanceof h))return r(e.getColumnFilterName()||"");var o=e.getChildren(),i=r(e.getFilterGroupName()),s=t||i;if(s){e.hideGroup(!1);for(var l=0;l<o.length;l++)n(o[l],s),e.hideGroupItem(!1,l);return!0}var a=!1;return o.forEach((function(o,i){var r=n(o,t);e.hideGroupItem(!r,i),r&&(a=!0)})),e.hideGroup(!a),a};this.filterGroupComps.forEach((function(e,r){n(e,!1),void 0===t?o._.containsClass(e.getGui(),"ag-hidden")||(t=r,i=r):o._.containsClass(e.getGui(),"ag-hidden")||i===r||(i=r)})),this.setFirstAndLastVisible(t,i)},i.prototype.setFirstAndLastVisible=function(e,t){this.filterGroupComps.forEach((function(i,r){o._.removeCssClass(i.getGui(),"ag-first-group-visible"),o._.removeCssClass(i.getGui(),"ag-last-group-visible"),r===e&&o._.addCssClass(i.getGui(),"ag-first-group-visible"),r===t&&o._.addCssClass(i.getGui(),"ag-last-group-visible")}))},i.prototype.refreshFilters=function(){this.filterGroupComps.forEach((function(e){return e.refreshFilters()}))},i.prototype.destroyFilters=function(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),o._.clearElement(this.getGui())},i.prototype.destroy=function(){this.destroyFilters(),e.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-filter-list-panel"></div>',C([o.Autowired("gridApi")],i.prototype,"gridApi",void 0),C([o.Autowired("columnApi")],i.prototype,"columnApi",void 0),C([o.Autowired("toolPanelColDefService")],i.prototype,"toolPanelColDefService",void 0),C([o.Autowired("columnModel")],i.prototype,"columnModel",void 0),i}(o.Component),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),g=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},E=function(e){function t(){var o=e.call(this,t.TEMPLATE)||this;return o.initialised=!1,o.listenerDestroyFuncs=[],o}return m(t,e),t.prototype.init=function(e){this.initialised&&(this.listenerDestroyFuncs.forEach((function(e){return e()})),this.listenerDestroyFuncs=[]),this.initialised=!0;var t={suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};o._.mergeDeep(t,e),this.params=t,this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);var i=this.params.suppressExpandAll,r=this.params.suppressFilterSearch;i&&r&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"searchChanged",this.onSearchChanged.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"groupExpanded",this.onGroupExpanded.bind(this)))},t.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},t.prototype.onExpandAll=function(){this.filtersToolPanelListPanel.expandFilterGroups(!0)},t.prototype.onCollapseAll=function(){this.filtersToolPanelListPanel.expandFilterGroups(!1)},t.prototype.onSearchChanged=function(e){this.filtersToolPanelListPanel.performFilterSearch(e.searchText)},t.prototype.setFilterLayout=function(e){this.filtersToolPanelListPanel.setFiltersLayout(e)},t.prototype.onGroupExpanded=function(e){this.filtersToolPanelHeaderPanel.setExpandState(e.state)},t.prototype.expandFilterGroups=function(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)},t.prototype.collapseFilterGroups=function(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)},t.prototype.expandFilters=function(e){this.filtersToolPanelListPanel.expandFilters(!0,e)},t.prototype.collapseFilters=function(e){this.filtersToolPanelListPanel.expandFilters(!1,e)},t.prototype.syncLayoutWithGrid=function(){this.filtersToolPanelListPanel.syncFilterLayout()},t.prototype.refresh=function(){this.init(this.params)},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-filter-toolpanel">\n <ag-filters-tool-panel-header ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>\n <ag-filters-tool-panel-list ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>\n </div>',g([o.RefSelector("filtersToolPanelHeaderPanel")],t.prototype,"filtersToolPanelHeaderPanel",void 0),g([o.RefSelector("filtersToolPanelListPanel")],t.prototype,"filtersToolPanelListPanel",void 0),g([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),g([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),t}(o.Component),v={moduleName:o.ModuleNames.FiltersToolPanelModule,beans:[],agStackComponents:[{componentName:"AgFiltersToolPanelHeader",componentClass:l},{componentName:"AgFiltersToolPanelList",componentClass:y}],userComponents:[{componentName:"agFiltersToolPanel",componentClass:E}],dependantModules:[r.SideBarModule,i.EnterpriseCoreModule]};exports.FiltersToolPanelModule=v; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),i=require("@ag-grid-enterprise/core"),r=require("@ag-grid-enterprise/side-bar"),n=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}),s=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.EXPANDED=0]="EXPANDED",e[e.COLLAPSED=1]="COLLAPSED",e[e.INDETERMINATE=2]="INDETERMINATE"}(t||(t={}));var l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.preConstruct=function(){this.setTemplate('<div class="ag-filter-toolpanel-search" role="presentation">\n <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n <ag-input-text-field ref="eFilterTextField" class="ag-filter-toolpanel-search-input"></ag-input-text-field>\n </div>')},i.prototype.postConstruct=function(){var e=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.onValueChange(this.onSearchTextChanged.bind(this)),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.createExpandIcons(),this.setExpandState(t.EXPANDED),this.addManagedListener(this.eExpand,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.showOrHideOptions.bind(this))},i.prototype.init=function(e){this.params=e,this.columnModel.isReady()&&this.showOrHideOptions()},i.prototype.createExpandIcons=function(){this.eExpand.appendChild(this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper)),this.eExpand.appendChild(this.eExpandIndeterminate=o._.createIconNoSpan("columnSelectIndeterminate",this.gridOptionsWrapper))},i.prototype.showOrHideOptions=function(){var e=!this.params.suppressFilterSearch,t=!this.params.suppressExpandAll,i=this.gridOptionsWrapper.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search..."));var r=this.columnModel.getAllGridColumns().some((function(e){return e.getOriginalParent()&&e.isFilterAllowed()}));o._.setDisplayed(this.eFilterTextField.getGui(),e),o._.setDisplayed(this.eExpand,t&&r)},i.prototype.onSearchTextChanged=function(){var e=this;this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=o._.debounce((function(){e.dispatchEvent({type:"searchChanged",searchText:e.eFilterTextField.getValue()})}),300)),this.onSearchTextChangedDebounced()},i.prototype.onExpandClicked=function(){var e=this.currentExpandState===t.EXPANDED?{type:"collapseAll"}:{type:"expandAll"};this.dispatchEvent(e)},i.prototype.setExpandState=function(e){this.currentExpandState=e,o._.setDisplayed(this.eExpandChecked,this.currentExpandState===t.EXPANDED),o._.setDisplayed(this.eExpandUnchecked,this.currentExpandState===t.COLLAPSED),o._.setDisplayed(this.eExpandIndeterminate,this.currentExpandState===t.INDETERMINATE)},s([o.Autowired("columnModel")],i.prototype,"columnModel",void 0),s([o.RefSelector("eExpand")],i.prototype,"eExpand",void 0),s([o.RefSelector("eFilterTextField")],i.prototype,"eFilterTextField",void 0),s([o.PreConstruct],i.prototype,"preConstruct",null),s([o.PostConstruct],i.prototype,"postConstruct",null),i}(o.Component),a=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),p=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},d=function(e){function t(o){void 0===o&&(o=!1);var i=e.call(this,t.TEMPLATE)||this;return i.expanded=!1,i.hideHeader=o,i}return a(t,e),t.prototype.postConstruct=function(){this.eExpandChecked=o._.createIconNoSpan("columnSelectOpen",this.gridOptionsWrapper),this.eExpandUnchecked=o._.createIconNoSpan("columnSelectClosed",this.gridOptionsWrapper),this.eExpand.appendChild(this.eExpandChecked),this.eExpand.appendChild(this.eExpandUnchecked)},t.prototype.setColumn=function(e){var t=this;this.column=e,this.eFilterName.innerText=this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)||"",this.addManagedListener(this.eFilterToolPanelHeader,"click",this.toggleExpanded.bind(this)),this.addManagedListener(this.eFilterToolPanelHeader,"keydown",(function(e){e.key===o.KeyCode.ENTER&&t.toggleExpanded()})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addInIcon("filter",this.eFilterIcon,this.column),this.eFilterIcon.classList.toggle("ag-hidden",!this.isFilterActive()),this.eExpandChecked.classList.add("ag-hidden"),this.hideHeader?(this.eFilterToolPanelHeader.classList.toggle("ag-hidden",!0),this.eFilterToolPanelHeader.removeAttribute("tabindex")):this.eFilterToolPanelHeader.setAttribute("tabindex","0"),this.addManagedListener(this.column,o.Column.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},t.prototype.getColumn=function(){return this.column},t.prototype.getColumnFilterName=function(){return this.columnModel.getDisplayNameForColumn(this.column,"filterToolPanel",!1)},t.prototype.addCssClassToTitleBar=function(e){this.eFilterToolPanelHeader.classList.add(e)},t.prototype.addInIcon=function(e,t,i){if(null!=t){var r=o._.createIconNoSpan(e,this.gridOptionsWrapper,i);t.appendChild(r)}},t.prototype.isFilterActive=function(){return this.filterManager.isFilterActive(this.column)},t.prototype.onFilterChanged=function(){this.eFilterIcon.classList.toggle("ag-hidden",!this.isFilterActive()),this.dispatchEvent({type:o.Column.EVENT_FILTER_CHANGED})},t.prototype.toggleExpanded=function(){this.expanded?this.collapse():this.expand()},t.prototype.expand=function(){var e,t=this;if(!this.expanded){this.expanded=!0,o._.setAriaExpanded(this.eFilterToolPanelHeader,!0);var i=o._.loadTemplate('<div class="ag-filter-toolpanel-instance-filter"></div>'),r=null===(e=this.filterManager.getOrCreateFilterWrapper(this.column,"TOOLBAR"))||void 0===e?void 0:e.filterPromise;r&&r.then((function(e){t.underlyingFilter=e,e&&(i.appendChild(e.getGui()),t.agFilterToolPanelBody.appendChild(i),e.afterGuiAttached&&e.afterGuiAttached({container:"toolPanel"}))})),o._.setDisplayed(this.eExpandChecked,!0),o._.setDisplayed(this.eExpandUnchecked,!1)}},t.prototype.collapse=function(){this.expanded&&(this.expanded=!1,o._.setAriaExpanded(this.eFilterToolPanelHeader,!1),this.agFilterToolPanelBody.removeChild(this.agFilterToolPanelBody.children[0]),o._.setDisplayed(this.eExpandChecked,!1),o._.setDisplayed(this.eExpandUnchecked,!0))},t.prototype.refreshFilter=function(){if(this.expanded){var e=this.underlyingFilter;e&&"function"==typeof e.refreshVirtualList&&e.refreshVirtualList()}},t.prototype.onFilterOpened=function(e){"COLUMN_MENU"===e.source&&e.column===this.column&&this.expanded&&this.collapse()},t.TEMPLATE='\n <div class="ag-filter-toolpanel-instance">\n <div class="ag-filter-toolpanel-header ag-filter-toolpanel-instance-header" ref="eFilterToolPanelHeader" role="button" aria-expanded="false">\n <div ref="eExpand" class="ag-filter-toolpanel-expand"></div>\n <span ref="eFilterName" class="ag-header-cell-text"></span>\n <span ref="eFilterIcon" class="ag-header-icon ag-filter-icon ag-filter-toolpanel-instance-header-icon" aria-hidden="true"></span>\n </div>\n <div class="ag-filter-toolpanel-instance-body ag-filter" ref="agFilterToolPanelBody"></div>\n </div>',p([o.RefSelector("eFilterToolPanelHeader")],t.prototype,"eFilterToolPanelHeader",void 0),p([o.RefSelector("eFilterName")],t.prototype,"eFilterName",void 0),p([o.RefSelector("agFilterToolPanelBody")],t.prototype,"agFilterToolPanelBody",void 0),p([o.RefSelector("eFilterIcon")],t.prototype,"eFilterIcon",void 0),p([o.RefSelector("eExpand")],t.prototype,"eExpand",void 0),p([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),p([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),p([o.PostConstruct],t.prototype,"postConstruct",null),t}(o.Component),u=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),c=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},h=function(e){function t(t,o,i,r,n){var s=e.call(this)||this;return s.columnGroup=t,s.childFilterComps=o,s.depth=r,s.expandedCallback=i,s.showingColumn=n,s}return u(t,e),t.prototype.preConstruct=function(){this.setTemplate(t.TEMPLATE,{filterGroupComp:{cssIdentifier:"filter-toolpanel",direction:"vertical"}})},t.prototype.init=function(){var e=this;this.setGroupTitle(),this.filterGroupComp.setAlignItems("stretch"),this.filterGroupComp.addCssClass("ag-filter-toolpanel-group-level-"+this.depth),this.filterGroupComp.addCssClassToTitleBar("ag-filter-toolpanel-group-level-"+this.depth+"-header"),this.childFilterComps.forEach((function(t){e.filterGroupComp.addItem(t),t.addCssClassToTitleBar("ag-filter-toolpanel-group-level-"+(e.depth+1)+"-header")})),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip()},t.prototype.setupTooltip=function(){var e=this;if(this.showingColumn){var t=function(){var t=e.columnGroup.getColDef().headerTooltip;e.setTooltip(t)};t(),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t)}},t.prototype.getTooltipParams=function(){var t=e.prototype.getTooltipParams.call(this);return t.location="filterToolPanelColumnGroup",t},t.prototype.addCssClassToTitleBar=function(e){this.filterGroupComp.addCssClassToTitleBar(e)},t.prototype.refreshFilters=function(){this.childFilterComps.forEach((function(e){e instanceof t?e.refreshFilters():e.refreshFilter()}))},t.prototype.isColumnGroup=function(){return this.columnGroup instanceof o.ProvidedColumnGroup},t.prototype.isExpanded=function(){return this.filterGroupComp.isExpanded()},t.prototype.getChildren=function(){return this.childFilterComps},t.prototype.getFilterGroupName=function(){return this.filterGroupName?this.filterGroupName:""},t.prototype.getFilterGroupId=function(){return this.columnGroup.getId()},t.prototype.hideGroupItem=function(e,t){this.filterGroupComp.hideItem(e,t)},t.prototype.hideGroup=function(e){this.addOrRemoveCssClass("ag-hidden",e)},t.prototype.forEachToolPanelFilterChild=function(e){this.childFilterComps.forEach((function(t){t instanceof d&&e(t)}))},t.prototype.addExpandCollapseListeners=function(){var e=this,t=this.isColumnGroup()?function(){return e.expandedCallback()}:function(){return e.forEachToolPanelFilterChild((function(e){return e.expand()}))},i=this.isColumnGroup()?function(){return e.expandedCallback()}:function(){return e.forEachToolPanelFilterChild((function(e){return e.collapse()}))};this.addManagedListener(this.filterGroupComp,o.AgGroupComponent.EVENT_EXPANDED,t),this.addManagedListener(this.filterGroupComp,o.AgGroupComponent.EVENT_COLLAPSED,i)},t.prototype.addFilterChangedListeners=function(){var e=this;if(this.columnGroup instanceof o.ProvidedColumnGroup){var t=this.columnGroup;t.getLeafColumns().forEach((function(i){e.addManagedListener(i,o.Column.EVENT_FILTER_CHANGED,(function(){e.filterGroupComp.addOrRemoveCssClass("ag-has-filter",t.getLeafColumns().some((function(e){return e.isFilterActive()})))}))}))}else{var i=this.columnGroup;this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_OPENED,this.onFilterOpened.bind(this)),this.addManagedListener(i,o.Column.EVENT_FILTER_CHANGED,(function(){e.filterGroupComp.addOrRemoveCssClass("ag-has-filter",i.isFilterActive())}))}},t.prototype.onFilterOpened=function(e){"COLUMN_MENU"===e.source&&e.column===this.columnGroup&&this.isExpanded()&&this.collapse()},t.prototype.expand=function(){this.filterGroupComp.toggleGroupExpand(!0)},t.prototype.collapse=function(){this.filterGroupComp.toggleGroupExpand(!1)},t.prototype.setGroupTitle=function(){this.filterGroupName=this.columnGroup instanceof o.ProvidedColumnGroup?this.getColumnGroupName(this.columnGroup):this.getColumnName(this.columnGroup),this.filterGroupComp.setTitle(this.filterGroupName||"")},t.prototype.getColumnGroupName=function(e){return this.columnModel.getDisplayNameForProvidedColumnGroup(null,e,"filterToolPanel")},t.prototype.getColumnName=function(e){return this.columnModel.getDisplayNameForColumn(e,"filterToolPanel",!1)},t.prototype.destroyFilters=function(){this.childFilterComps=this.destroyBeans(this.childFilterComps),o._.clearElement(this.getGui())},t.prototype.destroy=function(){this.destroyFilters(),e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-filter-toolpanel-group-wrapper">\n <ag-group-component ref="filterGroupComp"></ag-group-component>\n </div>',c([o.RefSelector("filterGroupComp")],t.prototype,"filterGroupComp",void 0),c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),c([o.PreConstruct],t.prototype,"preConstruct",null),c([o.PostConstruct],t.prototype,"init",null),t}(o.Component),f=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),y=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},C=function(e){function i(){var t=e.call(this,i.TEMPLATE)||this;return t.initialised=!1,t.filterGroupComps=[],t}return f(i,e),i.prototype.init=function(e){var t=this;this.initialised=!0;var i={suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};o._.mergeDeep(i,e),this.params=i,this.params.suppressSyncLayoutWithGrid||this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_MOVED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,(function(){return t.onColumnsChanged()})),this.addManagedListener(this.eventService,o.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,(function(e){"filters"===e.source&&t.refreshFilters()})),this.columnModel.isReady()&&this.onColumnsChanged()},i.prototype.onColumnsChanged=function(){var e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs()},i.prototype.syncFilterLayout=function(){this.toolPanelColDefService.syncLayoutWithGrid(this.setFiltersLayout.bind(this))},i.prototype.buildTreeFromProvidedColumnDefs=function(){var e=this;this.destroyFilters();var t=this.columnModel.getPrimaryColumnTree();this.filterGroupComps=this.recursivelyAddComps(t,0);var i=this.filterGroupComps.length;i&&(this.filterGroupComps.forEach((function(t){return e.appendChild(t)})),this.setFirstAndLastVisible(0,i-1)),o._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent()},i.prototype.setFiltersLayout=function(e){var t=this;this.destroyFilters();var i=this.toolPanelColDefService.createColumnTree(e);this.filterGroupComps=this.recursivelyAddComps(i,0);var r=this.filterGroupComps.length;r&&(this.filterGroupComps.forEach((function(e){return t.appendChild(e)})),this.setFirstAndLastVisible(0,r-1)),o._.exists(this.searchFilterText)&&this.searchFilters(this.searchFilterText),this.fireExpandedEvent()},i.prototype.recursivelyAddComps=function(e,t){var i=this;return o._.flatten(e.map((function(e){if(e instanceof o.ProvidedColumnGroup)return o._.flatten(i.recursivelyAddFilterGroupComps(e,t));var r=e;if(!i.shouldDisplayFilter(r))return[];var n=new d(0===t);if(i.getContext().createBean(n),n.setColumn(r),t>0)return n;var s=i.createBean(new h(r,[n],i.onGroupExpanded.bind(i),t,!0));return s.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.collapse(),s})))},i.prototype.recursivelyAddFilterGroupComps=function(e,t){if(this.filtersExistInChildren(e.getChildren())){var i=e.getColGroupDef();if(i&&i.suppressFiltersToolPanel)return[];var r=e.isPadding()?t:t+1,n=o._.flatten(this.recursivelyAddComps(e.getChildren(),r));if(e.isPadding())return n;var s=new h(e,n,this.onGroupExpanded.bind(this),t,!1);return this.getContext().createBean(s),s.addCssClassToTitleBar("ag-filter-toolpanel-header"),[s]}},i.prototype.filtersExistInChildren=function(e){var t=this;return e.some((function(e){return e instanceof o.ProvidedColumnGroup?t.filtersExistInChildren(e.getChildren()):t.shouldDisplayFilter(e)}))},i.prototype.shouldDisplayFilter=function(e){var t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t},i.prototype.refresh=function(){},i.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},i.prototype.expandFilterGroups=function(e,t){var i=[],r=function(n){var s=n.getFilterGroupId();(!t||o._.includes(t,s))&&(e&&n.isColumnGroup()?n.expand():n.collapse(),i.push(s)),n.getChildren().forEach((function(e){e instanceof h&&r(e)}))};if(this.filterGroupComps.forEach(r),this.onGroupExpanded(),t){var n=t.filter((function(e){return i.indexOf(e)<0}));n.length>0&&console.warn("AG Grid: unable to find groups for these supplied groupIds:",n)}},i.prototype.expandFilters=function(e,t){var i=[],r=function(n){if(n instanceof h){var s=!1;return n.getChildren().forEach((function(t){r(t)&&(e?(n.expand(),s=!0):n.isColumnGroup()||n.collapse())})),s}var l=n.getColumn().getColId(),a=!t||o._.includes(t,l);return a&&(e?n.expand():n.collapse(),i.push(l)),a};if(this.filterGroupComps.forEach(r),this.onGroupExpanded(),t){var n=t.filter((function(e){return i.indexOf(e)<0}));n.length>0&&console.warn("AG Grid: unable to find columns for these supplied colIds:",n)}},i.prototype.onGroupExpanded=function(){this.fireExpandedEvent()},i.prototype.fireExpandedEvent=function(){var e,o=0,i=0,r=function(e){e.isColumnGroup()&&(e.isExpanded()?o++:i++,e.getChildren().forEach((function(e){e instanceof h&&r(e)})))};this.filterGroupComps.forEach(r),e=o>0&&i>0?t.INDETERMINATE:i>0?t.COLLAPSED:t.EXPANDED,this.dispatchEvent({type:"groupExpanded",state:e})},i.prototype.performFilterSearch=function(e){this.searchFilterText=o._.exists(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)},i.prototype.searchFilters=function(e){var t,i,r=function(t){return!o._.exists(e)||-1!==t.toLowerCase().indexOf(e)},n=function(e,t){if(!(e instanceof h))return r(e.getColumnFilterName()||"");var o=e.getChildren(),i=r(e.getFilterGroupName()),s=t||i;if(s){e.hideGroup(!1);for(var l=0;l<o.length;l++)n(o[l],s),e.hideGroupItem(!1,l);return!0}var a=!1;return o.forEach((function(o,i){var r=n(o,t);e.hideGroupItem(!r,i),r&&(a=!0)})),e.hideGroup(!a),a};this.filterGroupComps.forEach((function(e,o){n(e,!1),void 0===t?e.containsCssClass("ag-hidden")||(t=o,i=o):e.containsCssClass("ag-hidden")||i===o||(i=o)})),this.setFirstAndLastVisible(t,i)},i.prototype.setFirstAndLastVisible=function(e,t){this.filterGroupComps.forEach((function(o,i){o.removeCssClass("ag-first-group-visible"),o.removeCssClass("ag-last-group-visible"),i===e&&o.addCssClass("ag-first-group-visible"),i===t&&o.addCssClass("ag-last-group-visible")}))},i.prototype.refreshFilters=function(){this.filterGroupComps.forEach((function(e){return e.refreshFilters()}))},i.prototype.destroyFilters=function(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),o._.clearElement(this.getGui())},i.prototype.destroy=function(){this.destroyFilters(),e.prototype.destroy.call(this)},i.TEMPLATE='<div class="ag-filter-list-panel"></div>',y([o.Autowired("gridApi")],i.prototype,"gridApi",void 0),y([o.Autowired("columnApi")],i.prototype,"columnApi",void 0),y([o.Autowired("toolPanelColDefService")],i.prototype,"toolPanelColDefService",void 0),y([o.Autowired("columnModel")],i.prototype,"columnModel",void 0),i}(o.Component),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),g=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},E=function(e){function t(){var o=e.call(this,t.TEMPLATE)||this;return o.initialised=!1,o.listenerDestroyFuncs=[],o}return m(t,e),t.prototype.init=function(e){this.initialised&&(this.listenerDestroyFuncs.forEach((function(e){return e()})),this.listenerDestroyFuncs=[]),this.initialised=!0;var t={suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1,api:this.gridApi,columnApi:this.columnApi};o._.mergeDeep(t,e),this.params=t,this.filtersToolPanelHeaderPanel.init(this.params),this.filtersToolPanelListPanel.init(this.params);var i=this.params.suppressExpandAll,r=this.params.suppressFilterSearch;i&&r&&this.filtersToolPanelHeaderPanel.setDisplayed(!1),this.listenerDestroyFuncs.push(this.addManagedListener(this.filtersToolPanelHeaderPanel,"expandAll",this.onExpandAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"collapseAll",this.onCollapseAll.bind(this)),this.addManagedListener(this.filtersToolPanelHeaderPanel,"searchChanged",this.onSearchChanged.bind(this)),this.addManagedListener(this.filtersToolPanelListPanel,"groupExpanded",this.onGroupExpanded.bind(this)))},t.prototype.setVisible=function(t){e.prototype.setDisplayed.call(this,t),t&&!this.initialised&&this.init(this.params)},t.prototype.onExpandAll=function(){this.filtersToolPanelListPanel.expandFilterGroups(!0)},t.prototype.onCollapseAll=function(){this.filtersToolPanelListPanel.expandFilterGroups(!1)},t.prototype.onSearchChanged=function(e){this.filtersToolPanelListPanel.performFilterSearch(e.searchText)},t.prototype.setFilterLayout=function(e){this.filtersToolPanelListPanel.setFiltersLayout(e)},t.prototype.onGroupExpanded=function(e){this.filtersToolPanelHeaderPanel.setExpandState(e.state)},t.prototype.expandFilterGroups=function(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)},t.prototype.collapseFilterGroups=function(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)},t.prototype.expandFilters=function(e){this.filtersToolPanelListPanel.expandFilters(!0,e)},t.prototype.collapseFilters=function(e){this.filtersToolPanelListPanel.expandFilters(!1,e)},t.prototype.syncLayoutWithGrid=function(){this.filtersToolPanelListPanel.syncFilterLayout()},t.prototype.refresh=function(){this.init(this.params)},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.TEMPLATE='<div class="ag-filter-toolpanel">\n <ag-filters-tool-panel-header ref="filtersToolPanelHeaderPanel"></ag-filters-tool-panel-header>\n <ag-filters-tool-panel-list ref="filtersToolPanelListPanel"></ag-filters-tool-panel-list>\n </div>',g([o.RefSelector("filtersToolPanelHeaderPanel")],t.prototype,"filtersToolPanelHeaderPanel",void 0),g([o.RefSelector("filtersToolPanelListPanel")],t.prototype,"filtersToolPanelListPanel",void 0),g([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),g([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),t}(o.Component),v={moduleName:o.ModuleNames.FiltersToolPanelModule,beans:[],agStackComponents:[{componentName:"AgFiltersToolPanelHeader",componentClass:l},{componentName:"AgFiltersToolPanelList",componentClass:C}],userComponents:[{componentName:"agFiltersToolPanel",componentClass:E}],dependantModules:[r.SideBarModule,i.EnterpriseCoreModule]};exports.FiltersToolPanelModule=v; |
{ | ||
"name": "@ag-grid-enterprise/filter-tool-panel", | ||
"version": "26.2.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
"main": "./dist/cjs/main.js", | ||
"module": "./dist/es6/main.js", | ||
"types": "./dist/cjs/main.d.ts", | ||
"version": "27.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
"main": "./dist/cjs/es5/main.js", | ||
"module": "./dist/esm/es5/main.js", | ||
"types": "./dist/cjs/es5/main.d.ts", | ||
"scripts": { | ||
"build-cjs": "npx tsc -p tsconfig.json", | ||
"build-es6": "npx tsc -p tsconfig.es6.json", | ||
"build-cjs": "npx tsc -p tsconfig.cjs.es5.json && npx tsc -p tsconfig.cjs.es6.json", | ||
"build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json", | ||
"package": "node ../../module-build/rollup/build.js", | ||
"build": "npm run build-cjs && npm run build-es6 && npm run hash", | ||
"build": "npm run build-cjs && npm run build-esm && npm run hash", | ||
"hash": "sh ../../scripts/hashDirectory.sh > .hash" | ||
@@ -28,4 +28,5 @@ }, | ||
"react-component", | ||
"angularjs", | ||
"reactjs" | ||
"reactjs", | ||
"vue", | ||
"vuejs" | ||
], | ||
@@ -40,4 +41,4 @@ "author": "Sean Landsman <sean@thelandsmans.com>", | ||
"last 2 versions", | ||
"not ie <= 10", | ||
"not ie_mob <= 11", | ||
"not ie >= 0", | ||
"not ie_mob >= 0", | ||
"not blackberry > 0" | ||
@@ -47,8 +48,8 @@ ], | ||
"dependencies": { | ||
"@ag-grid-community/core": "~26.2.0", | ||
"@ag-grid-enterprise/core": "~26.2.0", | ||
"@ag-grid-enterprise/side-bar": "~26.2.0" | ||
"@ag-grid-community/core": "~27.0.0", | ||
"@ag-grid-enterprise/core": "~27.0.0", | ||
"@ag-grid-enterprise/side-bar": "~27.0.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "~3.6.5" | ||
"typescript": "~3.7.7" | ||
}, | ||
@@ -55,0 +56,0 @@ "publishConfig": { |
@@ -12,3 +12,3 @@ AG Grid Enterprise | ||
[Angular 1](https://www.ag-grid.com/angular-grid/angularjs/) | [Angular 2](https://www.ag-grid.com/angular-grid/getting-started/) | [Javascript](https://www.ag-grid.com/javascript-grid/getting-started/) | [Polymer](https://www.ag-grid.com/javascript-grid/polymer-getting-started/) | [React](https://www.ag-grid.com/react-grid/getting-started/) | [TypeScript](https://www.ag-grid.com/javascript-grid/building-typescript/) | [VueJS](https://www.ag-grid.com/vue-grid/getting-started/) | ||
[Angular](https://www.ag-grid.com/angular-grid/getting-started/) | [Javascript](https://www.ag-grid.com/javascript-grid/getting-started/) | [React](https://www.ag-grid.com/react-grid/getting-started/) | [TypeScript](https://www.ag-grid.com/javascript-grid/building-typescript/) | [VueJS](https://www.ag-grid.com/vue-grid/getting-started/) | ||
@@ -15,0 +15,0 @@ This is not free software, this software is covered by copyright and to use you need a commercial license. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3790906
98
57975
0
+ Added@ag-grid-community/core@27.0.1(transitive)
+ Added@ag-grid-enterprise/core@27.0.1(transitive)
+ Added@ag-grid-enterprise/side-bar@27.0.0(transitive)
- Removed@ag-grid-community/core@26.2.1(transitive)
- Removed@ag-grid-enterprise/core@26.2.0(transitive)
- Removed@ag-grid-enterprise/side-bar@26.2.0(transitive)