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

@ag-grid-enterprise/side-bar

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/side-bar - npm Package Compare versions

Comparing version 31.1.0 to 31.1.1

2

dist/cjs/es5/version.d.ts

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

export declare const VERSION = "31.1.0";
export declare const VERSION = "31.1.1";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.1.0';
exports.VERSION = '31.1.1';

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

export declare const VERSION = "31.1.0";
export declare const VERSION = "31.1.1";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.1.0';
exports.VERSION = '31.1.1';

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

export declare const VERSION = "31.1.0";
export declare const VERSION = "31.1.1";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '31.1.0';
export var VERSION = '31.1.1';

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

export declare const VERSION = "31.1.0";
export declare const VERSION = "31.1.1";
/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.1
* @link https://www.ag-grid.com/

@@ -1048,3 +1048,3 @@ * @license Commercial

// DO NOT UPDATE MANUALLY: Generated from script during build time
var VERSION = '31.1.0';
var VERSION = '31.1.1';

@@ -1051,0 +1051,0 @@ var __extends = (undefined && undefined.__extends) || (function () {

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.1
* @link https://www.ag-grid.com/

@@ -7,6 +7,6 @@ * @license Commercial

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.1
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},i=function(e){function o(){var t=e.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return t.minWidth=100,t.maxWidth=null,t}return n(o,e),o.prototype.setElementToResize=function(e){this.elementToResize=e},o.prototype.postConstruct=function(){var e=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.setInverted(this.gridOptionsService.get("enableRtl"))},o.prototype.dispatchResizeEvent=function(e,o,n){var r={type:t.Events.EVENT_TOOL_PANEL_SIZE_CHANGED,width:n,started:e,ended:o};this.eventService.dispatchEvent(r)},o.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)},o.prototype.onResizeEnd=function(e){return this.onResizing(e,!0)},o.prototype.onResizing=function(e,t){void 0===t&&(t=!1);var o=this.inverted?-1:1,n=Math.max(this.minWidth,Math.floor(this.startingWidth-e*o));null!=this.maxWidth&&(n=Math.min(this.maxWidth,n)),this.elementToResize.style.width="".concat(n,"px"),this.dispatchResizeEvent(!1,t,n)},o.prototype.setInverted=function(e){this.inverted=e},o.prototype.setMaxWidth=function(e){this.maxWidth=e},o.prototype.setMinWidth=function(e){this.minWidth=null!=e?e:100},r([t.Autowired("horizontalResizeService")],o.prototype,"horizontalResizeService",void 0),r([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.Component),s=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),a=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},l=function(e){function o(t){var o=e.call(this)||this;return o.toolPanelDef=t,o}return s(o,e),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var e=this.createTemplate();this.setTemplate(e),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this)),this.eToggleButton.setAttribute("id","ag-".concat(this.getCompId(),"-button"))},o.prototype.createTemplate=function(){return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span ref ="eLabel" class="ag-side-button-label"></span>\n </button>\n </div>'},o.prototype.setLabel=function(){var e=this.localeService.getLocaleTextFunc(),t=this.toolPanelDef,o=e(t.labelKey,t.labelDefault);this.eLabel.innerText=o},o.prototype.setIcon=function(){this.eIconWrapper.insertAdjacentElement("afterbegin",t._.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsService))},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(e){this.addOrRemoveCssClass("ag-selected",e),t._.setAriaExpanded(this.eToggleButton,e)},o.prototype.getButtonElement=function(){return this.eToggleButton},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",a([t.RefSelector("eToggleButton")],o.prototype,"eToggleButton",void 0),a([t.RefSelector("eIconWrapper")],o.prototype,"eIconWrapper",void 0),a([t.RefSelector("eLabel")],o.prototype,"eLabel",void 0),a([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.Component),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),u=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},p=function(e){function o(){var t=e.call(this,o.TEMPLATE)||this;return t.buttonComps=[],t}return c(o,e),o.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},o.prototype.handleKeyDown=function(e){if(e.key===t.KeyCode.TAB&&e.shiftKey){var o=t._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(o,!0)&&e.preventDefault()}},o.prototype.setActiveButton=function(e){this.buttonComps.forEach((function(t){t.setSelected(e===t.getToolPanelId())}))},o.prototype.addButtonComp=function(e){var t=this,n=this.createBean(new l(e));return this.buttonComps.push(n),this.appendChild(n),n.addEventListener(l.EVENT_TOGGLE_BUTTON_CLICKED,(function(){t.dispatchEvent({type:o.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:e.id})})),n},o.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),t._.clearElement(this.getGui())},o.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",o.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',u([t.Autowired("focusService")],o.prototype,"focusService",void 0),u([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),u([t.PostConstruct],o.prototype,"postConstruct",null),u([t.PreDestroy],o.prototype,"clearButtons",null),o}(t.Component),d=function(){function e(){}return e.parse=function(t){if(t){if(!0===t)return{toolPanels:[e.DEFAULT_COLUMN_COMP,e.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof t)return e.parse([t]);if(Array.isArray(t)){var o=[];if(t.forEach((function(t){var n=e.DEFAULT_BY_KEY[t];n?o.push(n):console.warn("AG Grid: the key ".concat(t," is not a valid key for specifying a tool panel, valid keys are: ").concat(Object.keys(e.DEFAULT_BY_KEY).join(",")))})),0===o.length)return;return{toolPanels:o,defaultToolPanel:o[0].id}}return{toolPanels:e.parseComponents(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}},e.parseComponents=function(t){var o=[];return t?(t.forEach((function(t){var n=null;if("string"==typeof t){var r=e.DEFAULT_BY_KEY[t];if(!r)return void console.warn("AG Grid: the key ".concat(t," is not a valid key for specifying a tool panel, valid keys are: ").concat(Object.keys(e.DEFAULT_BY_KEY).join(",")));n=r}else n=t;o.push(n)})),o):o},e.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},e.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},e.DEFAULT_BY_KEY={columns:e.DEFAULT_COLUMN_COMP,filters:e.DEFAULT_FILTER_COMP},e}(),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),h=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},y=function(e){function o(){return e.call(this,o.TEMPLATE)||this}return f(o,e),o.prototype.setupResize=function(){var e=this.getGui(),t=this.resizeBar=this.createManagedBean(new i);e.setAttribute("id","ag-".concat(this.getCompId())),t.setElementToResize(e),this.appendChild(t)},o.prototype.getToolPanelId=function(){return this.toolPanelId},o.prototype.setToolPanelDef=function(e,t){var o=e.id,n=e.minWidth,r=e.maxWidth,i=e.width;this.toolPanelId=o,this.width=i;var s=this.userComponentFactory.getToolPanelCompDetails(e,t),a=s.newAgStackInstance();this.params=s.params,null!=a?(a.then(this.setToolPanelComponent.bind(this)),null!=n&&this.resizeBar.setMinWidth(n),null!=r&&this.resizeBar.setMaxWidth(r)):console.warn("AG Grid: error processing tool panel component ".concat(o,". You need to specify 'toolPanel'"))},o.prototype.setToolPanelComponent=function(e){var t=this;this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc((function(){t.destroyBean(e)})),this.width&&(this.getGui().style.width="".concat(this.width,"px"))},o.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},o.prototype.setResizerSizerSide=function(e){var t="left"===e,o=this.gridOptionsService.get("enableRtl")?t:!t;this.resizeBar.setInverted(o)},o.prototype.refresh=function(){this.toolPanelCompInstance.refresh(this.params)},o.TEMPLATE='<div class="ag-tool-panel-wrapper" role="tabpanel"/>',h([t.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),h([t.PostConstruct],o.prototype,"setupResize",null),o}(t.Component),v=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),g=function(){return(g=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},P=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},T=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],n=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(e){function o(){var t=e.call(this,o.TEMPLATE)||this;return t.toolPanelWrappers=[],t}return v(o,e),o.prototype.postConstruct=function(){var e;this.sideBarButtonsComp.addEventListener(p.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this));var o=(null!==(e=this.gridOptionsService.get("initialState"))&&void 0!==e?e:{}).sideBar;this.setSideBarDef({sideBarDef:d.parse(this.gridOptionsService.get("sideBar")),sideBarState:o}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this),this.createManagedBean(new t.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},o.prototype.onTabKeyDown=function(e){if(!e.defaultPrevented){var t=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsService.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target;if(s)if(r.contains(i))t.focusInto(s,e.shiftKey)&&e.preventDefault();else if(e.shiftKey){var l=null;s.contains(i)?l=this.focusService.findNextFocusableElement(s,void 0,!0):t.isTargetUnderManagedComponent(s,a)&&e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(s,a)),l||(l=r.querySelector(".ag-selected button")),l&&l!==e.target&&(e.preventDefault(),l.focus())}}},o.prototype.handleKeyDown=function(e){var o=this.gridOptionsService.getDocument();if(this.sideBarButtonsComp.getGui().contains(o.activeElement)){var n=this.sideBarButtonsComp.getGui(),r=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),i=o.activeElement,s=r.findIndex((function(e){return e.contains(i)})),a=null;switch(e.key){case t.KeyCode.LEFT:case t.KeyCode.UP:a=Math.max(0,s-1);break;case t.KeyCode.RIGHT:case t.KeyCode.DOWN:a=Math.min(s+1,r.length-1)}if(null!==a){var l=r[a].querySelector("button");l&&(l.focus(),e.preventDefault())}}},o.prototype.onToolPanelButtonClicked=function(e){var t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")},o.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},o.prototype.setSideBarDef=function(e){var t=e.sideBarDef,o=e.sideBarState,n=e.existingToolPanelWrappers;if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){var r=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(r,o,n),!this.toolPanelWrappers.length)return;var i=o?o.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(o?o.position:this.sideBar.position),i)if(o){var s=o.openToolPanel;s&&this.openToolPanel(s,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}},o.prototype.getDef=function(){return this.sideBar},o.prototype.setSideBarPosition=function(e){e||(e="right"),this.position=e;var o="left"===e,n=o?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",o),this.addOrRemoveCssClass("ag-side-bar-right",!o),this.toolPanelWrappers.forEach((function(e){e.setResizerSizerSide(n)})),this.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED}),this},o.prototype.setDisplayed=function(o,n){e.prototype.setDisplayed.call(this,o,n),this.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})},o.prototype.getState=function(){var e={};return this.toolPanelWrappers.forEach((function(t){var o,n;e[t.getToolPanelId()]=null===(n=null===(o=t.getToolPanelInstance())||void 0===o?void 0:o.getState)||void 0===n?void 0:n.call(o)})),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}},o.prototype.createToolPanelsAndSideButtons=function(e,t,o){var n,r,i;try{for(var s=T(e),a=s.next();!a.done;a=s.next()){var l=a.value;this.createToolPanelAndSideButton(l,null===(i=null==t?void 0:t.toolPanels)||void 0===i?void 0:i[l.id],null==o?void 0:o[l.id])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},o.prototype.validateDef=function(e){if(null==e.id)return console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if("agColumnsToolPanel"===e.toolPanel&&!t.ModuleRegistry.__assertRegistered(t.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel",this.context.getGridId()))return!1;if("agFiltersToolPanel"===e.toolPanel){if(!t.ModuleRegistry.__assertRegistered(t.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel",this.context.getGridId()))return!1;if(this.filterManager.isAdvancedFilterEnabled())return t._.warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0},o.prototype.createToolPanelAndSideButton=function(e,o,n){var r=this;if(this.validateDef(e)){var i,s=this.sideBarButtonsComp.addButtonComp(e);n?i=n:(i=this.getContext().createBean(new y)).setToolPanelDef(e,{initialState:o,onStateUpdated:function(){return r.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})}}),i.setDisplayed(!1);var a=i.getGui();this.appendChild(a),this.toolPanelWrappers.push(i),t._.setAriaControls(s.getButtonElement(),a)}},o.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(e){return e.refresh()}))},o.prototype.openToolPanel=function(e,t){void 0===t&&(t="api");var o=this.openedItem();o!==e&&(this.toolPanelWrappers.forEach((function(t){var o=e===t.getToolPanelId();t.setDisplayed(o)})),o!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,null!=o?o:void 0,t)))},o.prototype.getToolPanelInstance=function(e){var t=this.toolPanelWrappers.filter((function(t){return t.getToolPanelId()===e}))[0];if(t)return t.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: ".concat(e))},o.prototype.raiseToolPanelVisibleEvent=function(e,o,n){var r=!!e&&!!o;if(o){var i={type:t.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:n,key:o,visible:!1,switchingToolPanel:r};this.eventService.dispatchEvent(i)}if(e){var s={type:t.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:n,key:e,visible:!0,switchingToolPanel:r};this.eventService.dispatchEvent(s)}},o.prototype.close=function(e){void 0===e&&(e="api"),this.openToolPanel(void 0,e)},o.prototype.isToolPanelShowing=function(){return!!this.openedItem()},o.prototype.openedItem=function(){var e=null;return this.toolPanelWrappers.forEach((function(t){t.isDisplayed()&&(e=t.getToolPanelId())})),e},o.prototype.onSideBarUpdated=function(){var e,o=this,n=d.parse(this.gridOptionsService.get("sideBar")),r={};n&&this.sideBar&&(null===(e=n.toolPanels)||void 0===e||e.forEach((function(e){var n,i,s=e.id;if(s){var a=null===(n=o.sideBar.toolPanels)||void 0===n?void 0:n.find((function(e){return e.id===s}));if(a&&e.toolPanel===a.toolPanel){var l=o.toolPanelWrappers.find((function(e){return e.getToolPanelId()===s}));if(l){var c=o.gridOptionsService.addGridCommonParams(g(g({},null!==(i=e.toolPanelParams)&&void 0!==i?i:{}),{onStateUpdated:function(){return o.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})}}));!0===l.getToolPanelInstance().refresh(c)&&(o.toolPanelWrappers=o.toolPanelWrappers.filter((function(e){return e!==l})),t._.removeFromParent(l.getGui()),r[s]=l)}}}}))),this.clearDownUi(),this.setSideBarDef({sideBarDef:n,existingToolPanelWrappers:r})},o.prototype.destroyToolPanelWrappers=function(){var e=this;this.toolPanelWrappers.forEach((function(o){t._.removeFromParent(o.getGui()),e.destroyBean(o)})),this.toolPanelWrappers.length=0},o.prototype.destroy=function(){this.destroyToolPanelWrappers(),e.prototype.destroy.call(this)},o.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',P([t.Autowired("focusService")],o.prototype,"focusService",void 0),P([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),P([t.Autowired("sideBarService")],o.prototype,"sideBarService",void 0),P([t.RefSelector("sideBarButtons")],o.prototype,"sideBarButtonsComp",void 0),P([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},_=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.isColGroupDef=function(e){return e&&void 0!==e.children},t.getId=function(e){return t.isColGroupDef(e)?e.groupId:e.colId},t}return m(o,e),o.prototype.createColumnTree=function(e){var o=this,n=[],r=function(e,i){if(o.isColGroupDef(e)){var s=e,a=void 0!==s.groupId?s.groupId:s.headerName,l=new t.ProvidedColumnGroup(s,a,!1,i),c=[];return s.children.forEach((function(e){var t=r(e,i+1);t&&c.push(t)})),l.setChildren(c),l}var u=e,p=u.colId?u.colId:u.field,d=o.columnModel.getPrimaryColumn(p);return d||n.push(u),d},i=[];return e.forEach((function(e){var t=r(e,0);t&&i.push(t)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),i},o.prototype.syncLayoutWithGrid=function(e){var t=this.getLeafPathTrees();e(this.mergeLeafPathTrees(t))},o.prototype.getLeafPathTrees=function(){var e=function(o,n){var r;if(o instanceof t.ProvidedColumnGroup)if(o.isPadding())r=n;else{var i=Object.assign({},o.getColGroupDef());i.groupId=o.getGroupId(),i.children=[n],r=i}else{var s=Object.assign({},o.getColDef());s.colId=o.getColId(),r=s}var a=o.getOriginalParent();return a?e(a,r):r};return this.columnModel.getAllGridColumns().filter((function(e){var t=e.getColDef();return e.isPrimary()&&!t.showRowGroup})).map((function(t){return e(t,t.getColDef())}))},o.prototype.mergeLeafPathTrees=function(e){for(var t,o,n=this,r=function(e,t){if(!n.isColGroupDef(t))return e;var o=e,i=t;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(e){return r(o,e)})),o},i=[],s=1;s<=e.length;s++){var a=e[s-1],l=e[s];t=a,o=l,n.isColGroupDef(t)&&n.isColGroupDef(o)&&n.getId(t)===n.getId(o)?e[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(e,o,n){var r=this;if(!this.isColGroupDef(e))return!0;var i=e,s=n;if(function(e,o){var n=e.children.map(r.getId),i=t._.includes(n,r.getId(o)),s=t._.last(e.children),a=s&&r.getId(s)!==r.getId(o);return i&&a}(i,s))return i.children.push(s),!0;if(i.groupId===o){var a=i.children.map(this.getId);if(!t._.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(e){return r.addChildrenToGroup(e,o,n)})),!1},C([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=C([t.Bean("toolPanelColDefService")],o)}(t.BeanStub),b=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),B=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},D=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return b(o,e),o.prototype.registerSideBarComp=function(e){this.sideBarComp=e},o.prototype.getSideBarComp=function(){return this.sideBarComp},o=B([t.Bean("sideBarService")],o)}(t.BeanStub),O={version:"31.1.0",moduleName:t.ModuleNames.SideBarModule,beans:[_,D],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:i},{componentName:"AgSideBar",componentClass:E},{componentName:"AgSideBarButtons",componentClass:p}],dependantModules:[o.EnterpriseCoreModule]};exports.SideBarModule=O,exports.ToolPanelColDefService=_;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},i=function(e){function o(){var t=e.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return t.minWidth=100,t.maxWidth=null,t}return n(o,e),o.prototype.setElementToResize=function(e){this.elementToResize=e},o.prototype.postConstruct=function(){var e=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.setInverted(this.gridOptionsService.get("enableRtl"))},o.prototype.dispatchResizeEvent=function(e,o,n){var r={type:t.Events.EVENT_TOOL_PANEL_SIZE_CHANGED,width:n,started:e,ended:o};this.eventService.dispatchEvent(r)},o.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)},o.prototype.onResizeEnd=function(e){return this.onResizing(e,!0)},o.prototype.onResizing=function(e,t){void 0===t&&(t=!1);var o=this.inverted?-1:1,n=Math.max(this.minWidth,Math.floor(this.startingWidth-e*o));null!=this.maxWidth&&(n=Math.min(this.maxWidth,n)),this.elementToResize.style.width="".concat(n,"px"),this.dispatchResizeEvent(!1,t,n)},o.prototype.setInverted=function(e){this.inverted=e},o.prototype.setMaxWidth=function(e){this.maxWidth=e},o.prototype.setMinWidth=function(e){this.minWidth=null!=e?e:100},r([t.Autowired("horizontalResizeService")],o.prototype,"horizontalResizeService",void 0),r([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.Component),s=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),a=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},l=function(e){function o(t){var o=e.call(this)||this;return o.toolPanelDef=t,o}return s(o,e),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var e=this.createTemplate();this.setTemplate(e),this.setLabel(),this.setIcon(),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this)),this.eToggleButton.setAttribute("id","ag-".concat(this.getCompId(),"-button"))},o.prototype.createTemplate=function(){return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span ref ="eLabel" class="ag-side-button-label"></span>\n </button>\n </div>'},o.prototype.setLabel=function(){var e=this.localeService.getLocaleTextFunc(),t=this.toolPanelDef,o=e(t.labelKey,t.labelDefault);this.eLabel.innerText=o},o.prototype.setIcon=function(){this.eIconWrapper.insertAdjacentElement("afterbegin",t._.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsService))},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(e){this.addOrRemoveCssClass("ag-selected",e),t._.setAriaExpanded(this.eToggleButton,e)},o.prototype.getButtonElement=function(){return this.eToggleButton},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",a([t.RefSelector("eToggleButton")],o.prototype,"eToggleButton",void 0),a([t.RefSelector("eIconWrapper")],o.prototype,"eIconWrapper",void 0),a([t.RefSelector("eLabel")],o.prototype,"eLabel",void 0),a([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.Component),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),u=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},p=function(e){function o(){var t=e.call(this,o.TEMPLATE)||this;return t.buttonComps=[],t}return c(o,e),o.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},o.prototype.handleKeyDown=function(e){if(e.key===t.KeyCode.TAB&&e.shiftKey){var o=t._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(o,!0)&&e.preventDefault()}},o.prototype.setActiveButton=function(e){this.buttonComps.forEach((function(t){t.setSelected(e===t.getToolPanelId())}))},o.prototype.addButtonComp=function(e){var t=this,n=this.createBean(new l(e));return this.buttonComps.push(n),this.appendChild(n),n.addEventListener(l.EVENT_TOGGLE_BUTTON_CLICKED,(function(){t.dispatchEvent({type:o.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:e.id})})),n},o.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),t._.clearElement(this.getGui())},o.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",o.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',u([t.Autowired("focusService")],o.prototype,"focusService",void 0),u([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),u([t.PostConstruct],o.prototype,"postConstruct",null),u([t.PreDestroy],o.prototype,"clearButtons",null),o}(t.Component),d=function(){function e(){}return e.parse=function(t){if(t){if(!0===t)return{toolPanels:[e.DEFAULT_COLUMN_COMP,e.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if("string"==typeof t)return e.parse([t]);if(Array.isArray(t)){var o=[];if(t.forEach((function(t){var n=e.DEFAULT_BY_KEY[t];n?o.push(n):console.warn("AG Grid: the key ".concat(t," is not a valid key for specifying a tool panel, valid keys are: ").concat(Object.keys(e.DEFAULT_BY_KEY).join(",")))})),0===o.length)return;return{toolPanels:o,defaultToolPanel:o[0].id}}return{toolPanels:e.parseComponents(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}},e.parseComponents=function(t){var o=[];return t?(t.forEach((function(t){var n=null;if("string"==typeof t){var r=e.DEFAULT_BY_KEY[t];if(!r)return void console.warn("AG Grid: the key ".concat(t," is not a valid key for specifying a tool panel, valid keys are: ").concat(Object.keys(e.DEFAULT_BY_KEY).join(",")));n=r}else n=t;o.push(n)})),o):o},e.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},e.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},e.DEFAULT_BY_KEY={columns:e.DEFAULT_COLUMN_COMP,filters:e.DEFAULT_FILTER_COMP},e}(),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),h=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},y=function(e){function o(){return e.call(this,o.TEMPLATE)||this}return f(o,e),o.prototype.setupResize=function(){var e=this.getGui(),t=this.resizeBar=this.createManagedBean(new i);e.setAttribute("id","ag-".concat(this.getCompId())),t.setElementToResize(e),this.appendChild(t)},o.prototype.getToolPanelId=function(){return this.toolPanelId},o.prototype.setToolPanelDef=function(e,t){var o=e.id,n=e.minWidth,r=e.maxWidth,i=e.width;this.toolPanelId=o,this.width=i;var s=this.userComponentFactory.getToolPanelCompDetails(e,t),a=s.newAgStackInstance();this.params=s.params,null!=a?(a.then(this.setToolPanelComponent.bind(this)),null!=n&&this.resizeBar.setMinWidth(n),null!=r&&this.resizeBar.setMaxWidth(r)):console.warn("AG Grid: error processing tool panel component ".concat(o,". You need to specify 'toolPanel'"))},o.prototype.setToolPanelComponent=function(e){var t=this;this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc((function(){t.destroyBean(e)})),this.width&&(this.getGui().style.width="".concat(this.width,"px"))},o.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},o.prototype.setResizerSizerSide=function(e){var t="left"===e,o=this.gridOptionsService.get("enableRtl")?t:!t;this.resizeBar.setInverted(o)},o.prototype.refresh=function(){this.toolPanelCompInstance.refresh(this.params)},o.TEMPLATE='<div class="ag-tool-panel-wrapper" role="tabpanel"/>',h([t.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),h([t.PostConstruct],o.prototype,"setupResize",null),o}(t.Component),v=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),g=function(){return(g=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},P=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},T=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],n=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(e){function o(){var t=e.call(this,o.TEMPLATE)||this;return t.toolPanelWrappers=[],t}return v(o,e),o.prototype.postConstruct=function(){var e;this.sideBarButtonsComp.addEventListener(p.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this));var o=(null!==(e=this.gridOptionsService.get("initialState"))&&void 0!==e?e:{}).sideBar;this.setSideBarDef({sideBarDef:d.parse(this.gridOptionsService.get("sideBar")),sideBarState:o}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this),this.createManagedBean(new t.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},o.prototype.onTabKeyDown=function(e){if(!e.defaultPrevented){var t=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsService.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target;if(s)if(r.contains(i))t.focusInto(s,e.shiftKey)&&e.preventDefault();else if(e.shiftKey){var l=null;s.contains(i)?l=this.focusService.findNextFocusableElement(s,void 0,!0):t.isTargetUnderManagedComponent(s,a)&&e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(s,a)),l||(l=r.querySelector(".ag-selected button")),l&&l!==e.target&&(e.preventDefault(),l.focus())}}},o.prototype.handleKeyDown=function(e){var o=this.gridOptionsService.getDocument();if(this.sideBarButtonsComp.getGui().contains(o.activeElement)){var n=this.sideBarButtonsComp.getGui(),r=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),i=o.activeElement,s=r.findIndex((function(e){return e.contains(i)})),a=null;switch(e.key){case t.KeyCode.LEFT:case t.KeyCode.UP:a=Math.max(0,s-1);break;case t.KeyCode.RIGHT:case t.KeyCode.DOWN:a=Math.min(s+1,r.length-1)}if(null!==a){var l=r[a].querySelector("button");l&&(l.focus(),e.preventDefault())}}},o.prototype.onToolPanelButtonClicked=function(e){var t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")},o.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},o.prototype.setSideBarDef=function(e){var t=e.sideBarDef,o=e.sideBarState,n=e.existingToolPanelWrappers;if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){var r=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(r,o,n),!this.toolPanelWrappers.length)return;var i=o?o.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(o?o.position:this.sideBar.position),i)if(o){var s=o.openToolPanel;s&&this.openToolPanel(s,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}},o.prototype.getDef=function(){return this.sideBar},o.prototype.setSideBarPosition=function(e){e||(e="right"),this.position=e;var o="left"===e,n=o?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",o),this.addOrRemoveCssClass("ag-side-bar-right",!o),this.toolPanelWrappers.forEach((function(e){e.setResizerSizerSide(n)})),this.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED}),this},o.prototype.setDisplayed=function(o,n){e.prototype.setDisplayed.call(this,o,n),this.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})},o.prototype.getState=function(){var e={};return this.toolPanelWrappers.forEach((function(t){var o,n;e[t.getToolPanelId()]=null===(n=null===(o=t.getToolPanelInstance())||void 0===o?void 0:o.getState)||void 0===n?void 0:n.call(o)})),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}},o.prototype.createToolPanelsAndSideButtons=function(e,t,o){var n,r,i;try{for(var s=T(e),a=s.next();!a.done;a=s.next()){var l=a.value;this.createToolPanelAndSideButton(l,null===(i=null==t?void 0:t.toolPanels)||void 0===i?void 0:i[l.id],null==o?void 0:o[l.id])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},o.prototype.validateDef=function(e){if(null==e.id)return console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if("agColumnsToolPanel"===e.toolPanel&&!t.ModuleRegistry.__assertRegistered(t.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel",this.context.getGridId()))return!1;if("agFiltersToolPanel"===e.toolPanel){if(!t.ModuleRegistry.__assertRegistered(t.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel",this.context.getGridId()))return!1;if(this.filterManager.isAdvancedFilterEnabled())return t._.warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0},o.prototype.createToolPanelAndSideButton=function(e,o,n){var r=this;if(this.validateDef(e)){var i,s=this.sideBarButtonsComp.addButtonComp(e);n?i=n:(i=this.getContext().createBean(new y)).setToolPanelDef(e,{initialState:o,onStateUpdated:function(){return r.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})}}),i.setDisplayed(!1);var a=i.getGui();this.appendChild(a),this.toolPanelWrappers.push(i),t._.setAriaControls(s.getButtonElement(),a)}},o.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(e){return e.refresh()}))},o.prototype.openToolPanel=function(e,t){void 0===t&&(t="api");var o=this.openedItem();o!==e&&(this.toolPanelWrappers.forEach((function(t){var o=e===t.getToolPanelId();t.setDisplayed(o)})),o!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,null!=o?o:void 0,t)))},o.prototype.getToolPanelInstance=function(e){var t=this.toolPanelWrappers.filter((function(t){return t.getToolPanelId()===e}))[0];if(t)return t.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: ".concat(e))},o.prototype.raiseToolPanelVisibleEvent=function(e,o,n){var r=!!e&&!!o;if(o){var i={type:t.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:n,key:o,visible:!1,switchingToolPanel:r};this.eventService.dispatchEvent(i)}if(e){var s={type:t.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:n,key:e,visible:!0,switchingToolPanel:r};this.eventService.dispatchEvent(s)}},o.prototype.close=function(e){void 0===e&&(e="api"),this.openToolPanel(void 0,e)},o.prototype.isToolPanelShowing=function(){return!!this.openedItem()},o.prototype.openedItem=function(){var e=null;return this.toolPanelWrappers.forEach((function(t){t.isDisplayed()&&(e=t.getToolPanelId())})),e},o.prototype.onSideBarUpdated=function(){var e,o=this,n=d.parse(this.gridOptionsService.get("sideBar")),r={};n&&this.sideBar&&(null===(e=n.toolPanels)||void 0===e||e.forEach((function(e){var n,i,s=e.id;if(s){var a=null===(n=o.sideBar.toolPanels)||void 0===n?void 0:n.find((function(e){return e.id===s}));if(a&&e.toolPanel===a.toolPanel){var l=o.toolPanelWrappers.find((function(e){return e.getToolPanelId()===s}));if(l){var c=o.gridOptionsService.addGridCommonParams(g(g({},null!==(i=e.toolPanelParams)&&void 0!==i?i:{}),{onStateUpdated:function(){return o.eventService.dispatchEvent({type:t.Events.EVENT_SIDE_BAR_UPDATED})}}));!0===l.getToolPanelInstance().refresh(c)&&(o.toolPanelWrappers=o.toolPanelWrappers.filter((function(e){return e!==l})),t._.removeFromParent(l.getGui()),r[s]=l)}}}}))),this.clearDownUi(),this.setSideBarDef({sideBarDef:n,existingToolPanelWrappers:r})},o.prototype.destroyToolPanelWrappers=function(){var e=this;this.toolPanelWrappers.forEach((function(o){t._.removeFromParent(o.getGui()),e.destroyBean(o)})),this.toolPanelWrappers.length=0},o.prototype.destroy=function(){this.destroyToolPanelWrappers(),e.prototype.destroy.call(this)},o.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',P([t.Autowired("focusService")],o.prototype,"focusService",void 0),P([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),P([t.Autowired("sideBarService")],o.prototype,"sideBarService",void 0),P([t.RefSelector("sideBarButtons")],o.prototype,"sideBarButtonsComp",void 0),P([t.PostConstruct],o.prototype,"postConstruct",null),o}(t.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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},_=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.isColGroupDef=function(e){return e&&void 0!==e.children},t.getId=function(e){return t.isColGroupDef(e)?e.groupId:e.colId},t}return m(o,e),o.prototype.createColumnTree=function(e){var o=this,n=[],r=function(e,i){if(o.isColGroupDef(e)){var s=e,a=void 0!==s.groupId?s.groupId:s.headerName,l=new t.ProvidedColumnGroup(s,a,!1,i),c=[];return s.children.forEach((function(e){var t=r(e,i+1);t&&c.push(t)})),l.setChildren(c),l}var u=e,p=u.colId?u.colId:u.field,d=o.columnModel.getPrimaryColumn(p);return d||n.push(u),d},i=[];return e.forEach((function(e){var t=r(e,0);t&&i.push(t)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),i},o.prototype.syncLayoutWithGrid=function(e){var t=this.getLeafPathTrees();e(this.mergeLeafPathTrees(t))},o.prototype.getLeafPathTrees=function(){var e=function(o,n){var r;if(o instanceof t.ProvidedColumnGroup)if(o.isPadding())r=n;else{var i=Object.assign({},o.getColGroupDef());i.groupId=o.getGroupId(),i.children=[n],r=i}else{var s=Object.assign({},o.getColDef());s.colId=o.getColId(),r=s}var a=o.getOriginalParent();return a?e(a,r):r};return this.columnModel.getAllGridColumns().filter((function(e){var t=e.getColDef();return e.isPrimary()&&!t.showRowGroup})).map((function(t){return e(t,t.getColDef())}))},o.prototype.mergeLeafPathTrees=function(e){for(var t,o,n=this,r=function(e,t){if(!n.isColGroupDef(t))return e;var o=e,i=t;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(e){return r(o,e)})),o},i=[],s=1;s<=e.length;s++){var a=e[s-1],l=e[s];t=a,o=l,n.isColGroupDef(t)&&n.isColGroupDef(o)&&n.getId(t)===n.getId(o)?e[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(e,o,n){var r=this;if(!this.isColGroupDef(e))return!0;var i=e,s=n;if(function(e,o){var n=e.children.map(r.getId),i=t._.includes(n,r.getId(o)),s=t._.last(e.children),a=s&&r.getId(s)!==r.getId(o);return i&&a}(i,s))return i.children.push(s),!0;if(i.groupId===o){var a=i.children.map(this.getId);if(!t._.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(e){return r.addChildrenToGroup(e,o,n)})),!1},C([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=C([t.Bean("toolPanelColDefService")],o)}(t.BeanStub),b=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),B=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},D=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return b(o,e),o.prototype.registerSideBarComp=function(e){this.sideBarComp=e},o.prototype.getSideBarComp=function(){return this.sideBarComp},o=B([t.Bean("sideBarService")],o)}(t.BeanStub),O={version:"31.1.1",moduleName:t.ModuleNames.SideBarModule,beans:[_,D],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:i},{componentName:"AgSideBar",componentClass:E},{componentName:"AgSideBarButtons",componentClass:p}],dependantModules:[o.EnterpriseCoreModule]};exports.SideBarModule=O,exports.ToolPanelColDefService=_;
{
"name": "@ag-grid-enterprise/side-bar",
"version": "31.1.0",
"version": "31.1.1",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -49,4 +49,4 @@ "main": "./dist/esm/es6/main.mjs",

"dependencies": {
"@ag-grid-community/core": "~31.1.0",
"@ag-grid-enterprise/core": "~31.1.0"
"@ag-grid-community/core": "31.1.1",
"@ag-grid-enterprise/core": "31.1.1"
},

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

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

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