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

@ag-grid-enterprise/set-filter

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/set-filter - npm Package Compare versions

Comparing version 32.2.2 to 32.3.0

4

dist/package/main.cjs.min.js

@@ -18,5 +18,5 @@ var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of __getOwnPropNames(t))!__hasOwnProp.call(e,r)&&r!==s&&__defProp(e,r,{get:()=>t[r],enumerable:!(i=__getOwnPropDesc(t,r))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{SetFilter:()=>SetFilter,SetFilterModule:()=>SetFilterModule}),module.exports=__toCommonJS(main_exports);var import_core9=require("@ag-grid-community/core"),import_core10=require("@ag-grid-enterprise/core"),import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core"),SetFilterDisplayValue=class{};SetFilterDisplayValue.SELECT_ALL="__AG_SELECT_ALL__",SetFilterDisplayValue.ADD_SELECTION_TO_FILTER="__AG_ADD_SELECTION_TO_FILTER__";var DEFAULT_LOCALE_TEXT={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches."},import_core=require("@ag-grid-community/core"),SetFilterListItem=class extends import_core.Component{constructor(e){super(e.isGroup?`

<div data-ref="eSetFilterList" class="ag-set-filter-list" role="presentation"></div>
</div>`}getAgComponents(){return[import_core6.AgInputTextFieldSelector]}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case import_core6.KeyCode.SPACE:this.handleKeySpace(e);break;case import_core6.KeyCode.ENTER:this.handleKeyEnter(e);break;case import_core6.KeyCode.LEFT:this.handleKeyLeft(e);break;case import_core6.KeyCode.RIGHT:this.handleKeyRight(e);break}}handleKeySpace(e){this.getComponentForKeyEvent(e)?.toggleSelected()}handleKeyEnter(e){if(!this.setFilterParams)return;const{excelMode:t,readOnly:s}=this.setFilterParams||{};!t||s||(e.preventDefault(),this.onBtApply(!1,!1,e),this.setFilterParams.excelMode==="mac"&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){this.getComponentForKeyEvent(e)?.setExpanded(!1)}handleKeyRight(e){this.getComponentForKeyEvent(e)?.setExpanded(!0)}getComponentForKeyEvent(e){if(!this.eSetFilterList.contains((0,import_core6._getActiveDomElement)(this.gos))||!this.virtualList)return;const t=this.virtualList.getLastFocusedRow();if(t==null)return;const s=this.virtualList.getComponentAt(t);if(s==null)return;e.preventDefault();const{readOnly:i}=this.setFilterParams??{};if(!i)return s}getCssIdentifier(){return"set-filter"}setModel(e){return e==null&&this.valueModel?.getModel()==null?(this.setMiniFilter(null),import_core6.AgPromise.resolve()):super.setModel(e)}refresh(e){if(this.applyExcelModeOptions(e),!super.refresh(e))return!1;const t=this.setFilterParams;return["treeList","treeListPathGetter","caseSensitive","comparator","excelMode"].some(i=>e[i]!==t?.[i])||this.haveColDefParamsChanged(e)?!1:(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.suppressSelectAll!==t?.suppressSelectAll&&this.createVirtualListModel(e),this.valueModel?.updateOnParamsChange(e).then(()=>{this.refreshFilterValues()}),!0)}haveColDefParamsChanged(e){const{colDef:t,keyCreator:s}=e,{colDef:i,keyCreator:r}=this.setFilterParams??{},l=s??t.keyCreator,a=r??i?.keyCreator,o=t.filterValueGetter!==i?.filterValueGetter,n=l!==a,h=!!this.dataTypeService&&!!l&&this.dataTypeService.getFormatValue(t.cellDataType)===l&&t.valueFormatter!==i?.valueFormatter;return o||n||h}setModelAndRefresh(e){return this.valueModel?this.valueModel.setModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()}):import_core6.AgPromise.resolve()}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getModel();return e?{values:e,filterType:this.getFilterType()}:null}getFilterType(){return"set"}getValueModel(){return this.valueModel}areModelsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&(0,import_core6._areEqual)(e.values,t.values)}setParams(e){this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const t=e.keyCreator??e.colDef.keyCreator;this.valueModel=new SetValueModel({filterParams:e,setIsLoading:s=>this.setIsLoading(s),translate:s=>this.translateForSetFilter(s),caseFormat:s=>this.caseFormat(s),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!t,gos:this.gos,funcColsService:this.funcColsService,valueService:this.valueService,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedEventListeners:s=>this.addManagedEventListeners(s)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,s,i){let r=e;if(!r){if(t&&!s)throw new Error("AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator");this.noValueFormatterSupplied=!0,i||(r=l=>(0,import_core6._toStringOrNull)(l.value))}this.valueFormatter=r}generateCreateKey(e,t){if(t&&!e)throw new Error("AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.");return e?(s,i=null)=>{const r=this.getKeyCreatorParams(s,i);return(0,import_core6._makeNull)(e(r))}:s=>(0,import_core6._makeNull)((0,import_core6._toStringOrNull)(s))}getFormattedValue(e){let t=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(t)&&(t=(0,import_core6._last)(t));const s=this.valueService.formatValue(this.setFilterParams.column,null,t,this.valueFormatter,!1);return s??(0,import_core6._toStringOrNull)(t)??this.translateForSetFilter("blanks")}applyExcelModeOptions(e){e.excelMode==="windows"?(e.buttons||(e.buttons=["apply","cancel"]),e.closeOnApply==null&&(e.closeOnApply=!0)):e.excelMode==="mac"&&(e.buttons||(e.buttons=["reset"]),e.applyMiniFilterWhileTyping==null&&(e.applyMiniFilterWhileTyping=!0),e.debounceMs==null&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,(0,import_core6._warnOnce)('The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.'))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedEventListeners({cellValueChanged:e=>{this.setFilterParams&&e.column===this.setFilterParams.column&&this.syncAfterDataChange()}}),this.addManagedPropertyListeners(["treeData","getDataPath","groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}))}syncAfterDataChange(){if(!this.valueModel)throw new Error("Value model has not been created.");return this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),(!this.applyActive||this.areModelsEqual(this.getModel(),this.getModelFromUi()))&&this.onBtApply(!1,!0)})}setIsLoading(e){(0,import_core6._setDisplayed)(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter()}initVirtualList(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const t=this.localeService.getLocaleTextFunc()("ariaFilterList","Filter List"),s=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new import_core7.VirtualList({cssIdentifier:"filter",ariaRole:s?"tree":"listbox",listName:t})),r=this.eSetFilterList;s&&r.classList.add("ag-set-filter-tree-list"),r&&r.appendChild(i.getGui());const{cellHeight:l}=this.setFilterParams;l!=null&&i.setRowHeight(l);const a=(n,h)=>this.createSetListItem(n,s,h);i.setComponentCreator(a);const o=(n,h)=>this.updateSetListItem(n,h);i.setComponentUpdater(o),this.createVirtualListModel(this.setFilterParams)}createVirtualListModel(e){if(!this.valueModel)return;let t;e.suppressSelectAll?t=new ModelWrapper(this.valueModel):t=new ModelWrapperWithSelectAll(this.valueModel,()=>this.isSelectAllSelected()),e.treeList&&(t=new TreeModelWrapper(t)),this.virtualList?.setModel(t)}getSelectAllLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getMiniFilter()==null||!this.setFilterParams.excelMode?"selectAll":"selectAllSearchResults";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,s){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const i=this.valueModel.hasGroups(),{isSelected:r,isExpanded:l}=this.isSelectedExpanded(e),{value:a,depth:o,isGroup:n,hasIndeterminateExpandState:h,selectedListener:d,expandedListener:u}=this.newSetListItemAttributes(e),p={focusWrapper:s,value:a,params:this.setFilterParams,translate:m=>this.translateForSetFilter(m),valueFormatter:this.valueFormatter,item:e,isSelected:r,isTree:t,depth:o,groupsExist:i,isGroup:n,isExpanded:l,hasIndeterminateExpandState:h},c=this.createBean(new SetFilterListItem(p));return c.addEventListener("selectionChanged",d),u&&c.addEventListener("expandedChanged",u),c}newSetTreeItemAttributes(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const t=this.valueModel.hasGroups();return e.key===SetFilterDisplayValue.SELECT_ALL?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:s=>this.onSelectAll(s.isSelected),expandedListener:s=>this.onExpandAll(s.item,s.isExpanded)}:e.key===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:s=>{this.onAddCurrentSelectionToFilterChange(s.isSelected)}}:e.children?{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:s=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:s=>this.onExpandedChanged(s.item,s.isExpanded)}:{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:s=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===SetFilterDisplayValue.SELECT_ALL?{value:()=>this.getSelectAllLabel(),selectedListener:t=>this.onSelectAll(t.isSelected)}:e===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:t=>{this.onAddCurrentSelectionToFilterChange(t.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:t=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){const{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;return this.isSetFilterModelTreeItem(e)?(s=e.expanded,e.key===SetFilterDisplayValue.SELECT_ALL?t=this.isSelectAllSelected():e.key===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?t=this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?t=this.areAllChildrenSelected(e):t=this.valueModel.isKeySelected(e.key)):e===SetFilterDisplayValue.SELECT_ALL?t=this.isSelectAllSelected():e===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?t=this.valueModel.isAddCurrentSelectionToFilterChecked():t=this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e,localeService:t}=this,s=t.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(s("ariaSearchFilterValues","Search filter values")),this.addManagedElementListeners(e.getInputElement(),{keydown:i=>this.onMiniFilterKeyDown(i)})}updateMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),(!e||!e.suppressFocus)&&(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList?.focusRow(0))}afterGuiDetached(){super.afterGuiDetached(),this.setFilterParams?.excelMode&&this.resetMiniFilter();const e=this.getModel();(this.setFilterParams?.excelMode||!this.areModelsEqual(e,this.getModelFromUi()))&&(this.resetUiToActiveModel(e),this.showOrHideResults())}applyModel(e="api"){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");this.setFilterParams.excelMode&&e!=="rowDataUpdated"&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const s=super.applyModel(e),i=this.getModel();return i?(t||this.valueModel.setAppliedModelKeys(new Set),i.values.forEach(r=>{this.valueModel.addToAppliedModelKeys(r)})):t||this.valueModel.setAppliedModelKeys(null),s}isModelValid(e){return this.setFilterParams&&this.setFilterParams.excelMode?e==null||e.values.length>0:!0}doesFilterPass(e){if(!this.setFilterParams||!this.valueModel||!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t,data:s}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t,s);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);const i=this.getValueFromNode(t);return i!=null&&Array.isArray(i)?i.length===0?this.valueModel.hasAppliedModelKey(null):i.some(r=>this.isInAppliedModel(this.createKey(r,t))):this.isInAppliedModel(this.createKey(i,t))}doesFilterPassForTreeData(e,t){return e.childrenAfterGroup?.length?!1:this.isInAppliedModel(this.createKey(processDataPath(this.getDataPath(t),!0,this.gos.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){const t=this.funcColsService.getRowGroupColumns().map(s=>this.valueService.getKeyForNode(s,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(processDataPath(t,!1,this.gos.get("groupAllowUnbalanced"))))}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){return{value:e,colDef:this.setFilterParams.colDef,column:this.setFilterParams.column,node:t,data:t?.data,api:this.setFilterParams.api,context:this.setFilterParams.context}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return this.valueModel?this.valueModel.getValuesType()===2:!1}setFilterValues(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.overrideValues(e).then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}resetFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.hardRefreshVirtualList=!0,this.checkAndRefreshVirtualList(),this.onUiChanged()})}onAnyFilterChanged(){setTimeout(()=>{if(this.isAlive()){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})}},0)}onMiniFilterInput(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams||{};!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{excelMode:e,readOnly:t}=this.setFilterParams||{};e==null||t?this.checkAndRefreshVirtualList():this.valueModel.getMiniFilter()==null?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getMiniFilter()!=null&&this.valueModel.getDisplayedValueCount()<1;(0,import_core6._setDisplayed)(this.eFilterNoMatches,e),(0,import_core6._setDisplayed)(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.valueModel?.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(e==null?null:e.values).then(()=>{this.onUiChanged(!1,"prevent"),t?.()})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:s}=this.setFilterParams||{};e.key===import_core6.KeyCode.ENTER&&!t&&!s&&this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){const{readOnly:t}=this.setFilterParams||{};if(!this.valueModel)throw new Error("Value model has not been created.");if(t)throw new Error("Unable to filter in readOnly mode.");this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){e!=null&&window.setTimeout(()=>{if(!this.virtualList)throw new Error("Virtual list has not been created.");this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const s=i=>{i.children?i.children.forEach(r=>s(r)):this.selectItem(i.key,t)};s(e),this.refreshAfterSelection()}onItemSelected(e,t){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const s=i=>{i.filterPasses&&i.available&&i.children&&(i.children.forEach(r=>s(r)),i.expanded=t)};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel?this.valueModel.getMiniFilter():null}checkAndRefreshVirtualList(){if(!this.virtualList)throw new Error("Virtual list has not been created.");this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel?this.valueModel.getKeys():[]}getFilterValues(){return this.valueModel?this.valueModel.getValues():[]}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams&&this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.localeService.getLocaleTextFunc()(e,DEFAULT_LOCALE_TEXT[e])}isSelectAllSelected(){if(!this.setFilterParams||!this.valueModel)return!1;if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=s=>{if(s.children){let i=!1,r=!1;return s.children.some(a=>{if(!a.filterPasses||!a.available)return!1;const o=t(a);return o===void 0?!0:(o?i=!0:r=!0,i&&r)})?void 0:i}else return this.valueModel.isKeySelected(s.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){this.virtualList!=null&&(this.virtualList.destroy(),this.virtualList=null),super.destroy()}caseFormat(e){return e==null||typeof e!="string"||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){if(!this.setFilterParams?.treeList)return;const e=this.valueModel?.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){const t=s=>{s.children&&(s.children.forEach(i=>t(i)),s.expanded=!1)};t(e),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}},ModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},ModelWrapperWithSelectAll=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const t=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),s=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},TreeModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}},import_core8=require("@ag-grid-community/core"),SetFloatingFilterComp=class extends import_core8.Component{constructor(){super(`
</div>`}getAgComponents(){return[import_core6.AgInputTextFieldSelector]}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case import_core6.KeyCode.SPACE:this.handleKeySpace(e);break;case import_core6.KeyCode.ENTER:this.handleKeyEnter(e);break;case import_core6.KeyCode.LEFT:this.handleKeyLeft(e);break;case import_core6.KeyCode.RIGHT:this.handleKeyRight(e);break}}handleKeySpace(e){this.getComponentForKeyEvent(e)?.toggleSelected()}handleKeyEnter(e){if(!this.setFilterParams)return;const{excelMode:t,readOnly:s}=this.setFilterParams||{};!t||s||(e.preventDefault(),this.onBtApply(!1,!1,e),this.setFilterParams.excelMode==="mac"&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){this.getComponentForKeyEvent(e)?.setExpanded(!1)}handleKeyRight(e){this.getComponentForKeyEvent(e)?.setExpanded(!0)}getComponentForKeyEvent(e){if(!this.eSetFilterList.contains((0,import_core6._getActiveDomElement)(this.gos))||!this.virtualList)return;const t=this.virtualList.getLastFocusedRow();if(t==null)return;const s=this.virtualList.getComponentAt(t);if(s==null)return;e.preventDefault();const{readOnly:i}=this.setFilterParams??{};if(!i)return s}getCssIdentifier(){return"set-filter"}setModel(e){return e==null&&this.valueModel?.getModel()==null?(this.setMiniFilter(null),import_core6.AgPromise.resolve()):super.setModel(e)}refresh(e){if(this.applyExcelModeOptions(e),!super.refresh(e))return!1;const t=this.setFilterParams;return["treeList","treeListPathGetter","caseSensitive","comparator","excelMode"].some(i=>e[i]!==t?.[i])||this.haveColDefParamsChanged(e)?!1:(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.suppressSelectAll!==t?.suppressSelectAll&&this.createVirtualListModel(e),this.valueModel?.updateOnParamsChange(e).then(()=>{this.refreshFilterValues()}),!0)}haveColDefParamsChanged(e){const{colDef:t,keyCreator:s}=e,{colDef:i,keyCreator:r}=this.setFilterParams??{},l=s??t.keyCreator,a=r??i?.keyCreator,o=t.filterValueGetter!==i?.filterValueGetter,n=l!==a,h=!!this.dataTypeService&&!!l&&this.dataTypeService.getFormatValue(t.cellDataType)===l&&t.valueFormatter!==i?.valueFormatter;return o||n||h}setModelAndRefresh(e){return this.valueModel?this.valueModel.setModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()}):import_core6.AgPromise.resolve()}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getModel();return e?{values:e,filterType:this.getFilterType()}:null}getFilterType(){return"set"}getValueModel(){return this.valueModel}areModelsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&(0,import_core6._areEqual)(e.values,t.values)}setParams(e){this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const t=e.keyCreator??e.colDef.keyCreator;this.valueModel=new SetValueModel({filterParams:e,setIsLoading:s=>this.setIsLoading(s),translate:s=>this.translateForSetFilter(s),caseFormat:s=>this.caseFormat(s),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!t,gos:this.gos,funcColsService:this.funcColsService,valueService:this.valueService,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedEventListeners:s=>this.addManagedEventListeners(s)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,s,i){let r=e;if(!r){if(t&&!s)throw new Error("AG Grid: Must supply a Value Formatter in Set Filter params when using a Key Creator");this.noValueFormatterSupplied=!0,i||(r=l=>(0,import_core6._toStringOrNull)(l.value))}this.valueFormatter=r}generateCreateKey(e,t){if(t&&!e)throw new Error("AG Grid: Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.");return e?(s,i=null)=>{const r=this.getKeyCreatorParams(s,i);return(0,import_core6._makeNull)(e(r))}:s=>(0,import_core6._makeNull)((0,import_core6._toStringOrNull)(s))}getFormattedValue(e){let t=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(t)&&(t=(0,import_core6._last)(t));const s=this.valueService.formatValue(this.setFilterParams.column,null,t,this.valueFormatter,!1);return s??(0,import_core6._toStringOrNull)(t)??this.translateForSetFilter("blanks")}applyExcelModeOptions(e){e.excelMode==="windows"?(e.buttons||(e.buttons=["apply","cancel"]),e.closeOnApply==null&&(e.closeOnApply=!0)):e.excelMode==="mac"&&(e.buttons||(e.buttons=["reset"]),e.applyMiniFilterWhileTyping==null&&(e.applyMiniFilterWhileTyping=!0),e.debounceMs==null&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,(0,import_core6._warnOnce)('The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.'))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedEventListeners({cellValueChanged:e=>{this.setFilterParams&&e.column===this.setFilterParams.column&&this.syncAfterDataChange()}}),this.addManagedPropertyListeners(["treeData","getDataPath","groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}))}syncAfterDataChange(){if(!this.valueModel)throw new Error("Value model has not been created.");return this.valueModel.refreshValues().then(()=>{this.checkAndRefreshVirtualList(),(!this.applyActive||this.areModelsEqual(this.getModel(),this.getModelFromUi()))&&this.onBtApply(!1,!0)})}setIsLoading(e){(0,import_core6._setDisplayed)(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter()}initVirtualList(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const t=this.localeService.getLocaleTextFunc()("ariaFilterList","Filter List"),s=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new import_core7.VirtualList({cssIdentifier:"filter",ariaRole:s?"tree":"listbox",listName:t})),r=this.eSetFilterList;s&&r.classList.add("ag-set-filter-tree-list"),r&&r.appendChild(i.getGui());const{cellHeight:l}=this.setFilterParams;l!=null&&i.setRowHeight(l);const a=(n,h)=>this.createSetListItem(n,s,h);i.setComponentCreator(a);const o=(n,h)=>this.updateSetListItem(n,h);i.setComponentUpdater(o),this.createVirtualListModel(this.setFilterParams)}createVirtualListModel(e){if(!this.valueModel)return;let t;e.suppressSelectAll?t=new ModelWrapper(this.valueModel):t=new ModelWrapperWithSelectAll(this.valueModel,()=>this.isSelectAllSelected()),e.treeList&&(t=new TreeModelWrapper(t)),this.virtualList?.setModel(t)}getSelectAllLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getMiniFilter()==null||!this.setFilterParams.excelMode?"selectAll":"selectAllSearchResults";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,s){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const i=this.valueModel.hasGroups(),{isSelected:r,isExpanded:l}=this.isSelectedExpanded(e),{value:a,depth:o,isGroup:n,hasIndeterminateExpandState:h,selectedListener:d,expandedListener:u}=this.newSetListItemAttributes(e),p={focusWrapper:s,value:a,params:this.setFilterParams,translate:m=>this.translateForSetFilter(m),valueFormatter:this.valueFormatter,item:e,isSelected:r,isTree:t,depth:o,groupsExist:i,isGroup:n,isExpanded:l,hasIndeterminateExpandState:h},c=this.createBean(new SetFilterListItem(p));return c.addEventListener("selectionChanged",d),u&&c.addEventListener("expandedChanged",u),c}newSetTreeItemAttributes(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const t=this.valueModel.hasGroups();return e.key===SetFilterDisplayValue.SELECT_ALL?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:s=>this.onSelectAll(s.isSelected),expandedListener:s=>this.onExpandAll(s.item,s.isExpanded)}:e.key===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:s=>{this.onAddCurrentSelectionToFilterChange(s.isSelected)}}:e.children?{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:s=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:s=>this.onExpandedChanged(s.item,s.isExpanded)}:{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:s=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===SetFilterDisplayValue.SELECT_ALL?{value:()=>this.getSelectAllLabel(),selectedListener:t=>this.onSelectAll(t.isSelected)}:e===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:t=>{this.onAddCurrentSelectionToFilterChange(t.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:t=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){const{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;return this.isSetFilterModelTreeItem(e)?(s=e.expanded,e.key===SetFilterDisplayValue.SELECT_ALL?t=this.isSelectAllSelected():e.key===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?t=this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?t=this.areAllChildrenSelected(e):t=this.valueModel.isKeySelected(e.key)):e===SetFilterDisplayValue.SELECT_ALL?t=this.isSelectAllSelected():e===SetFilterDisplayValue.ADD_SELECTION_TO_FILTER?t=this.valueModel.isAddCurrentSelectionToFilterChecked():t=this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e,localeService:t}=this,s=t.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(s("ariaSearchFilterValues","Search filter values")),this.addManagedElementListeners(e.getInputElement(),{keydown:i=>this.onMiniFilterKeyDown(i)})}updateMiniFilter(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),(!e||!e.suppressFocus)&&(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList?.awaitStable(()=>this.virtualList?.focusRow(0)))}afterGuiDetached(){super.afterGuiDetached(),this.setFilterParams?.excelMode&&this.resetMiniFilter();const e=this.getModel();(this.setFilterParams?.excelMode||!this.areModelsEqual(e,this.getModelFromUi()))&&(this.resetUiToActiveModel(e),this.showOrHideResults())}applyModel(e="api"){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");this.setFilterParams.excelMode&&e!=="rowDataUpdated"&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const s=super.applyModel(e),i=this.getModel();return i?(t||this.valueModel.setAppliedModelKeys(new Set),i.values.forEach(r=>{this.valueModel.addToAppliedModelKeys(r)})):t||this.valueModel.setAppliedModelKeys(null),s}isModelValid(e){return this.setFilterParams&&this.setFilterParams.excelMode?e==null||e.values.length>0:!0}doesFilterPass(e){if(!this.setFilterParams||!this.valueModel||!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t,data:s}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t,s);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);const i=this.getValueFromNode(t);return i!=null&&Array.isArray(i)?i.length===0?this.valueModel.hasAppliedModelKey(null):i.some(r=>this.isInAppliedModel(this.createKey(r,t))):this.isInAppliedModel(this.createKey(i,t))}doesFilterPassForTreeData(e,t){return e.childrenAfterGroup?.length?!1:this.isInAppliedModel(this.createKey(processDataPath(this.getDataPath(t),!0,this.gos.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){const t=this.funcColsService.getRowGroupColumns().map(s=>this.valueService.getKeyForNode(s,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(processDataPath(t,!1,this.gos.get("groupAllowUnbalanced"))))}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){return{value:e,colDef:this.setFilterParams.colDef,column:this.setFilterParams.column,node:t,data:t?.data,api:this.setFilterParams.api,context:this.setFilterParams.context}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return this.valueModel?this.valueModel.getValuesType()===2:!1}setFilterValues(e){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.overrideValues(e).then(()=>{this.checkAndRefreshVirtualList(),this.onUiChanged()})}resetFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.hardRefreshVirtualList=!0,this.checkAndRefreshVirtualList(),this.onUiChanged()})}onAnyFilterChanged(){setTimeout(()=>{if(this.isAlive()){if(!this.valueModel)throw new Error("Value model has not been created.");this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})}},0)}onMiniFilterInput(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams||{};!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){if(!this.setFilterParams)throw new Error("Set filter params have not been provided.");if(!this.valueModel)throw new Error("Value model has not been created.");const{excelMode:e,readOnly:t}=this.setFilterParams||{};e==null||t?this.checkAndRefreshVirtualList():this.valueModel.getMiniFilter()==null?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){if(!this.valueModel)throw new Error("Value model has not been created.");const e=this.valueModel.getMiniFilter()!=null&&this.valueModel.getDisplayedValueCount()<1;(0,import_core6._setDisplayed)(this.eFilterNoMatches,e),(0,import_core6._setDisplayed)(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.valueModel?.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(e==null?null:e.values).then(()=>{this.onUiChanged(!1,"prevent"),t?.()})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:s}=this.setFilterParams||{};e.key===import_core6.KeyCode.ENTER&&!t&&!s&&this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){const{readOnly:t}=this.setFilterParams||{};if(!this.valueModel)throw new Error("Value model has not been created.");if(t)throw new Error("Unable to filter in readOnly mode.");this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){e!=null&&window.setTimeout(()=>{if(!this.virtualList)throw new Error("Virtual list has not been created.");this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const s=i=>{i.children?i.children.forEach(r=>s(r)):this.selectItem(i.key,t)};s(e),this.refreshAfterSelection()}onItemSelected(e,t){if(!this.valueModel)throw new Error("Value model has not been created.");if(!this.virtualList)throw new Error("Virtual list has not been created.");this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const s=i=>{i.filterPasses&&i.available&&i.children&&(i.children.forEach(r=>s(r)),i.expanded=t)};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel?this.valueModel.getMiniFilter():null}checkAndRefreshVirtualList(){if(!this.virtualList)throw new Error("Virtual list has not been created.");this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel?this.valueModel.getKeys():[]}getFilterValues(){return this.valueModel?this.valueModel.getValues():[]}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams&&this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.localeService.getLocaleTextFunc()(e,DEFAULT_LOCALE_TEXT[e])}isSelectAllSelected(){if(!this.setFilterParams||!this.valueModel)return!1;if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=s=>{if(s.children){let i=!1,r=!1;return s.children.some(a=>{if(!a.filterPasses||!a.available)return!1;const o=t(a);return o===void 0?!0:(o?i=!0:r=!0,i&&r)})?void 0:i}else return this.valueModel.isKeySelected(s.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){this.virtualList!=null&&(this.virtualList.destroy(),this.virtualList=null),super.destroy()}caseFormat(e){return e==null||typeof e!="string"||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){if(!this.setFilterParams?.treeList)return;const e=this.valueModel?.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){const t=s=>{s.children&&(s.children.forEach(i=>t(i)),s.expanded=!1)};t(e),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}},ModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},ModelWrapperWithSelectAll=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const t=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),s=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},TreeModelWrapper=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}},import_core8=require("@ag-grid-community/core"),SetFloatingFilterComp=class extends import_core8.Component{constructor(){super(`
<div class="ag-floating-filter-input ag-set-floating-filter-input" role="presentation">
<ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>
</div>`,[import_core8.AgInputTextFieldSelector]),this.eFloatingFilterText=import_core8.RefPlaceholder,this.availableValuesListenerAdded=!1,this.filterModelFormatter=new SetFilterModelFormatter}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),s=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof SetFilter))throw new Error("AG Grid - SetFloatingFilter expects SetFilter as its parent");e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListeners(t,{availableValuesChanged:()=>this.updateFloatingFilterText()})}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}},VERSION="32.2.2",SetFilterCoreModule=(0,import_core9._defineModule)({version:VERSION,moduleName:`${import_core9.ModuleNames.SetFilterModule}-core`,userComponents:[{name:"agSetColumnFilter",classImp:SetFilter}],dependantModules:[import_core10.EnterpriseCoreModule,import_core9._ColumnFilterModule]}),SetFloatingFilterModule=(0,import_core9._defineModule)({version:VERSION,moduleName:"@ag-grid-enterprise/set-floating-filter",userComponents:[{name:"agSetColumnFloatingFilter",classImp:SetFloatingFilterComp}],dependantModules:[SetFilterCoreModule,import_core9._FloatingFilterModule]}),SetFilterModule=(0,import_core9._defineModule)({version:VERSION,moduleName:import_core9.ModuleNames.SetFilterModule,dependantModules:[SetFilterCoreModule,SetFloatingFilterModule]});
</div>`,[import_core8.AgInputTextFieldSelector]),this.eFloatingFilterText=import_core8.RefPlaceholder,this.availableValuesListenerAdded=!1,this.filterModelFormatter=new SetFilterModelFormatter}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),s=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof SetFilter))throw new Error("AG Grid - SetFloatingFilter expects SetFilter as its parent");e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListeners(t,{availableValuesChanged:()=>this.updateFloatingFilterText()})}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}},VERSION="32.3.0",SetFilterCoreModule=(0,import_core9._defineModule)({version:VERSION,moduleName:`${import_core9.ModuleNames.SetFilterModule}-core`,userComponents:[{name:"agSetColumnFilter",classImp:SetFilter}],dependantModules:[import_core10.EnterpriseCoreModule,import_core9._ColumnFilterModule]}),SetFloatingFilterModule=(0,import_core9._defineModule)({version:VERSION,moduleName:"@ag-grid-enterprise/set-floating-filter",userComponents:[{name:"agSetColumnFloatingFilter",classImp:SetFloatingFilterComp}],dependantModules:[SetFilterCoreModule,import_core9._FloatingFilterModule]}),SetFilterModule=(0,import_core9._defineModule)({version:VERSION,moduleName:import_core9.ModuleNames.SetFilterModule,dependantModules:[SetFilterCoreModule,SetFloatingFilterModule]});
{
"name": "@ag-grid-enterprise/set-filter",
"version": "32.2.2",
"version": "32.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

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

"dependencies": {
"@ag-grid-community/core": "32.2.2",
"@ag-grid-enterprise/core": "32.2.2"
"@ag-grid-community/core": "32.3.0",
"@ag-grid-enterprise/core": "32.3.0"
},

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

{
"name": "@ag-grid-enterprise/set-filter",
"version": "32.2.2",
"version": "32.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

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

"dependencies": {
"@ag-grid-community/core": "32.2.2",
"@ag-grid-enterprise/core": "32.2.2"
"@ag-grid-community/core": "32.3.0",
"@ag-grid-enterprise/core": "32.3.0"
},

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

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

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

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

"dependencies": {
"@ag-grid-community/core": "32.2.2",
"@ag-grid-enterprise/core": "32.2.2"
"@ag-grid-community/core": "32.3.0",
"@ag-grid-enterprise/core": "32.3.0"
},

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc