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 27.1.0 to 27.2.0

5

dist/cjs/es5/sideBar/toolPanelWrapper.js

@@ -43,6 +43,3 @@ "use strict";

this.width = width;
var params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
var params = {};
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -49,0 +46,0 @@ var componentPromise = compDetails.newAgStackInstance();

@@ -29,6 +29,3 @@ "use strict";

this.width = width;
const params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
const params = {};
const compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -35,0 +32,0 @@ const componentPromise = compDetails.newAgStackInstance();

@@ -41,6 +41,3 @@ var __extends = (this && this.__extends) || (function () {

this.width = width;
var params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
var params = {};
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -47,0 +44,0 @@ var componentPromise = compDetails.newAgStackInstance();

@@ -27,6 +27,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

this.width = width;
const params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
const params = {};
const compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -33,0 +30,0 @@ const componentPromise = compDetails.newAgStackInstance();

7

dist/side-bar.cjs.js
/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://www.ag-grid.com/

@@ -266,6 +266,3 @@ * @license Commercial

this.width = width;
var params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
var params = {};
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -272,0 +269,0 @@ var componentPromise = compDetails.newAgStackInstance();

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://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 v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},i=function(t){function o(){var e=t.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return e.minWidth=100,e.maxWidth=null,e}return n(o,t),o.prototype.setElementToResize=function(t){this.elementToResize=t},o.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizing.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},o.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth},o.prototype.onResizing=function(t){var e=this.inverted?-1:1,o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*e));null!=this.maxWidth&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=o+"px"},o.prototype.setInverted=function(t){this.inverted=t},o.prototype.setMaxWidth=function(t){this.maxWidth=t},o.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},r([e.Autowired("horizontalResizeService")],o.prototype,"horizontalResizeService",void 0),r([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),a=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},l=function(t){function o(e){var o=t.call(this)||this;return o.toolPanelDef=e,o}return s(o,t),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.eIconWrapper.insertAdjacentElement("afterbegin",e._.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper)),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},o.prototype.createTemplate=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.toolPanelDef;return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span class="ag-side-button-label">'+t(e.labelKey,e.labelDefault)+"</span>\n </button>\n </div>"},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",a([e.RefSelector("eToggleButton")],o.prototype,"eToggleButton",void 0),a([e.RefSelector("eIconWrapper")],o.prototype,"eIconWrapper",void 0),a([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),p=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),u=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},c=function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.buttonComps=[],e}return p(o,t),o.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},o.prototype.handleKeyDown=function(t){if(t.key===e.KeyCode.TAB&&t.shiftKey){var o=e._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(o,!0)&&t.preventDefault()}},o.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},o.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(e){e.setSelected(t===e.getToolPanelId())}))},o.prototype.addButtonComp=function(t){var e=this,n=this.createBean(new l(t));this.buttonComps.push(n),this.appendChild(n),n.addEventListener(l.EVENT_TOGGLE_BUTTON_CLICKED,(function(){e.dispatchEvent({type:o.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},o.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),e._.clearElement(this.getGui())},o.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",o.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',u([e.Autowired("focusService")],o.prototype,"focusService",void 0),u([e.Autowired("columnModel")],o.prototype,"columnModel",void 0),u([e.PostConstruct],o.prototype,"postConstruct",null),u([e.PreDestroy],o.prototype,"clearButtons",null),o}(e.Component),d=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),f=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},h=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return d(o,t),o.prototype.setupResize=function(){var t=this.getGui(),e=this.resizeBar=new i;this.getContext().createBean(e),e.setElementToResize(t),this.appendChild(e)},o.prototype.getToolPanelId=function(){return this.toolPanelId},o.prototype.setToolPanelDef=function(t){var e=t.id,o=t.minWidth,n=t.maxWidth,r=t.width;this.toolPanelId=e,this.width=r;var i={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()},s=this.userComponentFactory.getToolPanelCompDetails(t,i).newAgStackInstance();null!=s?(s.then(this.setToolPanelComponent.bind(this)),null!=o&&this.resizeBar.setMinWidth(o),null!=n&&this.resizeBar.setMaxWidth(n)):console.warn("AG Grid: error processing tool panel component "+e+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},o.prototype.setToolPanelComponent=function(t){var e=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){e.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},o.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},o.prototype.setResizerSizerSide=function(t){var e="left"===t,o=this.gridOptionsWrapper.isEnableRtl()?e:!e;this.resizeBar.setInverted(o)},o.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},o.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',f([e.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),f([e.PostConstruct],o.prototype,"setupResize",null),o}(e.Component),y=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),g=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},v=function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.toolPanelWrappers=[],e}return y(o,t),o.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(c.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new e.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},o.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var e=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(i))e.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!e.isFocusUnderManagedComponent(s)&&t.shiftKey){var a=e.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},o.prototype.handleKeyDown=function(t){var o=this.gridOptionsWrapper.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(t){return t.contains(i)})),a=null;switch(t.key){case e.KeyCode.LEFT:case e.KeyCode.UP:a=Math.max(0,s-1);break;case e.KeyCode.RIGHT:case e.KeyCode.DOWN:a=Math.min(s+1,r.length-1)}if(null!==a){var l=r[a].querySelector("button");l&&(l.focus(),t.preventDefault())}}},o.prototype.onToolPanelButtonClicked=function(t){var e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0):this.openToolPanel(e)},o.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},o.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),e=!!t&&!!t.toolPanels;if(e){var o=e&&!t.hiddenByDefault;this.setDisplayed(o);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},o.prototype.setSideBarPosition=function(t){t||(t="right");var e="left"===t,o=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(o)})),this},o.prototype.setupToolPanels=function(t){var o=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel)if(!e.ModuleRegistry.assertRegistered(e.ModuleNames.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel)if(!e.ModuleRegistry.assertRegistered(e.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return;var n=new h;o.getContext().createBean(n),n.setToolPanelDef(t),n.setDisplayed(!1),o.getGui().appendChild(n.getGui()),o.toolPanelWrappers.push(n)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},o.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},o.prototype.openToolPanel=function(t){var e=this.openedItem();e!==t&&(this.toolPanelWrappers.forEach((function(e){var o=t===e.getToolPanelId();e.setDisplayed(o)})),e!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},o.prototype.getToolPanelInstance=function(t){var e=this.toolPanelWrappers.filter((function(e){return e.getToolPanelId()===t}))[0];if(e)return e.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},o.prototype.raiseToolPanelVisibleEvent=function(t){var o={type:e.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(o)},o.prototype.close=function(){this.openToolPanel(void 0)},o.prototype.isToolPanelShowing=function(){return!!this.openedItem()},o.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(e){e.isDisplayed()&&(t=e.getToolPanelId())})),t},o.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(o){e._.removeFromParent(o.getGui()),t.destroyBean(o)})),this.toolPanelWrappers.length=0},o.prototype.destroy=function(){this.destroyToolPanelWrappers(),t.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>',g([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),g([e.Autowired("focusService")],o.prototype,"focusService",void 0),g([e.RefSelector("sideBarButtons")],o.prototype,"sideBarButtonsComp",void 0),g([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),m=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),P=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},C=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isColGroupDef=function(t){return t&&void 0!==t.children},e.getId=function(t){return e.isColGroupDef(t)?t.groupId:t.colId},e}return m(o,t),o.prototype.createColumnTree=function(t){var o=this,n=[],r=function(t,i){if(o.isColGroupDef(t)){var s=t,a=void 0!==s.groupId?s.groupId:s.headerName,l=new e.ProvidedColumnGroup(s,a,!1,i),p=[];return s.children.forEach((function(t){var e=r(t,i+1);e&&p.push(e)})),l.setChildren(p),l}var u=t,c=u.colId?u.colId:u.field,d=o.columnModel.getPrimaryColumn(c);return d||n.push(u),d},i=[];return t.forEach((function(t){var e=r(t,0);e&&i.push(e)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),i},o.prototype.syncLayoutWithGrid=function(t){var e=this.getLeafPathTrees();t(this.mergeLeafPathTrees(e))},o.prototype.getLeafPathTrees=function(){var t=function(o,n){var r;if(o instanceof e.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?t(a,r):r};return this.columnModel.getAllGridColumns().filter((function(t){var e=t.getColDef();return t.isPrimary()&&!e.showRowGroup})).map((function(e){return t(e,e.getColDef())}))},o.prototype.mergeLeafPathTrees=function(t){for(var e,o,n=this,r=function(t,e){if(!n.isColGroupDef(e))return t;var o=t,i=e;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(t){return r(o,t)})),o},i=[],s=1;s<=t.length;s++){var a=t[s-1],l=t[s];e=a,o=l,n.isColGroupDef(e)&&n.isColGroupDef(o)&&n.getId(e)===n.getId(o)?t[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(t,o,n){var r=this;if(!this.isColGroupDef(t))return!0;var i=t,s=n;if(function(t,o){var n=t.children.map(r.getId),i=e._.includes(n,r.getId(o)),s=e._.last(t.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(!e._.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(t){return r.addChildrenToGroup(t,o,n)})),!1},P([e.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=P([e.Bean("toolPanelColDefService")],o)}(e.BeanStub),T={moduleName:e.ModuleNames.SideBarModule,beans:[C],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:i},{componentName:"AgSideBar",componentClass:v},{componentName:"AgSideBarButtons",componentClass:c}],dependantModules:[o.EnterpriseCoreModule]};exports.SideBarModule=T,exports.ToolPanelColDefService=C;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},i=function(t){function o(){var e=t.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return e.minWidth=100,e.maxWidth=null,e}return n(o,t),o.prototype.setElementToResize=function(t){this.elementToResize=t},o.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizing.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},o.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth},o.prototype.onResizing=function(t){var e=this.inverted?-1:1,o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*e));null!=this.maxWidth&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=o+"px"},o.prototype.setInverted=function(t){this.inverted=t},o.prototype.setMaxWidth=function(t){this.maxWidth=t},o.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},r([e.Autowired("horizontalResizeService")],o.prototype,"horizontalResizeService",void 0),r([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),a=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},l=function(t){function o(e){var o=t.call(this)||this;return o.toolPanelDef=e,o}return s(o,t),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.eIconWrapper.insertAdjacentElement("afterbegin",e._.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper)),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},o.prototype.createTemplate=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.toolPanelDef;return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span class="ag-side-button-label">'+t(e.labelKey,e.labelDefault)+"</span>\n </button>\n </div>"},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",a([e.RefSelector("eToggleButton")],o.prototype,"eToggleButton",void 0),a([e.RefSelector("eIconWrapper")],o.prototype,"eIconWrapper",void 0),a([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),p=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),u=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},c=function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.buttonComps=[],e}return p(o,t),o.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},o.prototype.handleKeyDown=function(t){if(t.key===e.KeyCode.TAB&&t.shiftKey){var o=e._.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(o,!0)&&t.preventDefault()}},o.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},o.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(e){e.setSelected(t===e.getToolPanelId())}))},o.prototype.addButtonComp=function(t){var e=this,n=this.createBean(new l(t));this.buttonComps.push(n),this.appendChild(n),n.addEventListener(l.EVENT_TOGGLE_BUTTON_CLICKED,(function(){e.dispatchEvent({type:o.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},o.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),e._.clearElement(this.getGui())},o.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",o.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',u([e.Autowired("focusService")],o.prototype,"focusService",void 0),u([e.Autowired("columnModel")],o.prototype,"columnModel",void 0),u([e.PostConstruct],o.prototype,"postConstruct",null),u([e.PreDestroy],o.prototype,"clearButtons",null),o}(e.Component),d=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),f=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},h=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return d(o,t),o.prototype.setupResize=function(){var t=this.getGui(),e=this.resizeBar=new i;this.getContext().createBean(e),e.setElementToResize(t),this.appendChild(e)},o.prototype.getToolPanelId=function(){return this.toolPanelId},o.prototype.setToolPanelDef=function(t){var e=t.id,o=t.minWidth,n=t.maxWidth,r=t.width;this.toolPanelId=e,this.width=r;var i=this.userComponentFactory.getToolPanelCompDetails(t,{}).newAgStackInstance();null!=i?(i.then(this.setToolPanelComponent.bind(this)),null!=o&&this.resizeBar.setMinWidth(o),null!=n&&this.resizeBar.setMaxWidth(n)):console.warn("AG Grid: error processing tool panel component "+e+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},o.prototype.setToolPanelComponent=function(t){var e=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){e.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},o.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},o.prototype.setResizerSizerSide=function(t){var e="left"===t,o=this.gridOptionsWrapper.isEnableRtl()?e:!e;this.resizeBar.setInverted(o)},o.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},o.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',f([e.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),f([e.PostConstruct],o.prototype,"setupResize",null),o}(e.Component),y=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),g=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},v=function(t){function o(){var e=t.call(this,o.TEMPLATE)||this;return e.toolPanelWrappers=[],e}return y(o,t),o.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(c.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new e.ManagedFocusFeature(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},o.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var e=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(i))e.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!e.isFocusUnderManagedComponent(s)&&t.shiftKey){var a=e.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},o.prototype.handleKeyDown=function(t){var o=this.gridOptionsWrapper.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(t){return t.contains(i)})),a=null;switch(t.key){case e.KeyCode.LEFT:case e.KeyCode.UP:a=Math.max(0,s-1);break;case e.KeyCode.RIGHT:case e.KeyCode.DOWN:a=Math.min(s+1,r.length-1)}if(null!==a){var l=r[a].querySelector("button");l&&(l.focus(),t.preventDefault())}}},o.prototype.onToolPanelButtonClicked=function(t){var e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0):this.openToolPanel(e)},o.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},o.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),e=!!t&&!!t.toolPanels;if(e){var o=e&&!t.hiddenByDefault;this.setDisplayed(o);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},o.prototype.setSideBarPosition=function(t){t||(t="right");var e="left"===t,o=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(o)})),this},o.prototype.setupToolPanels=function(t){var o=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel)if(!e.ModuleRegistry.assertRegistered(e.ModuleNames.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel)if(!e.ModuleRegistry.assertRegistered(e.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return;var n=new h;o.getContext().createBean(n),n.setToolPanelDef(t),n.setDisplayed(!1),o.getGui().appendChild(n.getGui()),o.toolPanelWrappers.push(n)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},o.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},o.prototype.openToolPanel=function(t){var e=this.openedItem();e!==t&&(this.toolPanelWrappers.forEach((function(e){var o=t===e.getToolPanelId();e.setDisplayed(o)})),e!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},o.prototype.getToolPanelInstance=function(t){var e=this.toolPanelWrappers.filter((function(e){return e.getToolPanelId()===t}))[0];if(e)return e.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},o.prototype.raiseToolPanelVisibleEvent=function(t){var o={type:e.Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(o)},o.prototype.close=function(){this.openToolPanel(void 0)},o.prototype.isToolPanelShowing=function(){return!!this.openedItem()},o.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(e){e.isDisplayed()&&(t=e.getToolPanelId())})),t},o.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(o){e._.removeFromParent(o.getGui()),t.destroyBean(o)})),this.toolPanelWrappers.length=0},o.prototype.destroy=function(){this.destroyToolPanelWrappers(),t.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>',g([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),g([e.Autowired("focusService")],o.prototype,"focusService",void 0),g([e.RefSelector("sideBarButtons")],o.prototype,"sideBarButtonsComp",void 0),g([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),P=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),m=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},C=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isColGroupDef=function(t){return t&&void 0!==t.children},e.getId=function(t){return e.isColGroupDef(t)?t.groupId:t.colId},e}return P(o,t),o.prototype.createColumnTree=function(t){var o=this,n=[],r=function(t,i){if(o.isColGroupDef(t)){var s=t,a=void 0!==s.groupId?s.groupId:s.headerName,l=new e.ProvidedColumnGroup(s,a,!1,i),p=[];return s.children.forEach((function(t){var e=r(t,i+1);e&&p.push(e)})),l.setChildren(p),l}var u=t,c=u.colId?u.colId:u.field,d=o.columnModel.getPrimaryColumn(c);return d||n.push(u),d},i=[];return t.forEach((function(t){var e=r(t,0);e&&i.push(e)})),n.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",n),i},o.prototype.syncLayoutWithGrid=function(t){var e=this.getLeafPathTrees();t(this.mergeLeafPathTrees(e))},o.prototype.getLeafPathTrees=function(){var t=function(o,n){var r;if(o instanceof e.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?t(a,r):r};return this.columnModel.getAllGridColumns().filter((function(t){var e=t.getColDef();return t.isPrimary()&&!e.showRowGroup})).map((function(e){return t(e,e.getColDef())}))},o.prototype.mergeLeafPathTrees=function(t){for(var e,o,n=this,r=function(t,e){if(!n.isColGroupDef(e))return t;var o=t,i=e;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(t){return r(o,t)})),o},i=[],s=1;s<=t.length;s++){var a=t[s-1],l=t[s];e=a,o=l,n.isColGroupDef(e)&&n.isColGroupDef(o)&&n.getId(e)===n.getId(o)?t[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(t,o,n){var r=this;if(!this.isColGroupDef(t))return!0;var i=t,s=n;if(function(t,o){var n=t.children.map(r.getId),i=e._.includes(n,r.getId(o)),s=e._.last(t.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(!e._.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(t){return r.addChildrenToGroup(t,o,n)})),!1},m([e.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=m([e.Bean("toolPanelColDefService")],o)}(e.BeanStub),T={moduleName:e.ModuleNames.SideBarModule,beans:[C],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:i},{componentName:"AgSideBar",componentClass:v},{componentName:"AgSideBarButtons",componentClass:c}],dependantModules:[o.EnterpriseCoreModule]};exports.SideBarModule=T,exports.ToolPanelColDefService=C;
/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://www.ag-grid.com/

@@ -262,6 +262,3 @@ * @license Commercial

this.width = width;
var params = {
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
var params = {};
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);

@@ -268,0 +265,0 @@ var componentPromise = compDetails.newAgStackInstance();

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://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 v27.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.0
* @link http://www.ag-grid.com/
* @license Commercial
*/
import{Autowired as t,PostConstruct as e,Component as o,_ as n,RefSelector as r,KeyCode as i,PreDestroy as s,ManagedFocusFeature as a,ModuleRegistry as l,ModuleNames as p,Events as c,Bean as u,BeanStub as d,ProvidedColumnGroup as f}from"@ag-grid-community/core";import{EnterpriseCoreModule as h}from"@ag-grid-enterprise/core";var y,g=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),v=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},m=function(o){function n(){var t=o.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return t.minWidth=100,t.maxWidth=null,t}return g(n,o),n.prototype.setElementToResize=function(t){this.elementToResize=t},n.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizing.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},n.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth},n.prototype.onResizing=function(t){var e=this.inverted?-1:1,o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*e));null!=this.maxWidth&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=o+"px"},n.prototype.setInverted=function(t){this.inverted=t},n.prototype.setMaxWidth=function(t){this.maxWidth=t},n.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},v([t("horizontalResizeService")],n.prototype,"horizontalResizeService",void 0),v([e],n.prototype,"postConstruct",null),n}(o),P=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),T=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},C=function(t){function o(e){var o=t.call(this)||this;return o.toolPanelDef=e,o}return P(o,t),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.eIconWrapper.insertAdjacentElement("afterbegin",n.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper)),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},o.prototype.createTemplate=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.toolPanelDef;return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span class="ag-side-button-label">'+t(e.labelKey,e.labelDefault)+"</span>\n </button>\n </div>"},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",T([r("eToggleButton")],o.prototype,"eToggleButton",void 0),T([r("eIconWrapper")],o.prototype,"eIconWrapper",void 0),T([e],o.prototype,"postConstruct",null),o}(o),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),B=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},E=function(o){function r(){var t=o.call(this,r.TEMPLATE)||this;return t.buttonComps=[],t}return b(r,o),r.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},r.prototype.handleKeyDown=function(t){if(t.key===i.TAB&&t.shiftKey){var e=n.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(e,!0)&&t.preventDefault()}},r.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},r.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(e){e.setSelected(t===e.getToolPanelId())}))},r.prototype.addButtonComp=function(t){var e=this,o=this.createBean(new C(t));this.buttonComps.push(o),this.appendChild(o),o.addEventListener(C.EVENT_TOGGLE_BUTTON_CLICKED,(function(){e.dispatchEvent({type:r.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},r.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),n.clearElement(this.getGui())},r.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",r.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',B([t("focusService")],r.prototype,"focusService",void 0),B([t("columnModel")],r.prototype,"columnModel",void 0),B([e],r.prototype,"postConstruct",null),B([s],r.prototype,"clearButtons",null),r}(o),O=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),_=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},D=function(o){function n(){return o.call(this,n.TEMPLATE)||this}return O(n,o),n.prototype.setupResize=function(){var t=this.getGui(),e=this.resizeBar=new m;this.getContext().createBean(e),e.setElementToResize(t),this.appendChild(e)},n.prototype.getToolPanelId=function(){return this.toolPanelId},n.prototype.setToolPanelDef=function(t){var e=t.id,o=t.minWidth,n=t.maxWidth,r=t.width;this.toolPanelId=e,this.width=r;var i={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()},s=this.userComponentFactory.getToolPanelCompDetails(t,i).newAgStackInstance();null!=s?(s.then(this.setToolPanelComponent.bind(this)),null!=o&&this.resizeBar.setMinWidth(o),null!=n&&this.resizeBar.setMaxWidth(n)):console.warn("AG Grid: error processing tool panel component "+e+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},n.prototype.setToolPanelComponent=function(t){var e=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){e.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},n.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},n.prototype.setResizerSizerSide=function(t){var e="left"===t,o=this.gridOptionsWrapper.isEnableRtl()?e:!e;this.resizeBar.setInverted(o)},n.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},n.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',_([t("userComponentFactory")],n.prototype,"userComponentFactory",void 0),_([e],n.prototype,"setupResize",null),n}(o),I=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),w=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},R=function(o){function s(){var t=o.call(this,s.TEMPLATE)||this;return t.toolPanelWrappers=[],t}return I(s,o),s.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(E.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new a(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},s.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var e=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(i))e.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!e.isFocusUnderManagedComponent(s)&&t.shiftKey){var a=e.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},s.prototype.handleKeyDown=function(t){var e=this.gridOptionsWrapper.getDocument();if(this.sideBarButtonsComp.getGui().contains(e.activeElement)){var o=this.sideBarButtonsComp.getGui(),n=Array.prototype.slice.call(o.querySelectorAll(".ag-side-button")),r=e.activeElement,s=n.findIndex((function(t){return t.contains(r)})),a=null;switch(t.key){case i.LEFT:case i.UP:a=Math.max(0,s-1);break;case i.RIGHT:case i.DOWN:a=Math.min(s+1,n.length-1)}if(null!==a){var l=n[a].querySelector("button");l&&(l.focus(),t.preventDefault())}}},s.prototype.onToolPanelButtonClicked=function(t){var e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0):this.openToolPanel(e)},s.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},s.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),e=!!t&&!!t.toolPanels;if(e){var o=e&&!t.hiddenByDefault;this.setDisplayed(o);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},s.prototype.setSideBarPosition=function(t){t||(t="right");var e="left"===t,o=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(o)})),this},s.prototype.setupToolPanels=function(t){var e=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel)if(!l.assertRegistered(p.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel)if(!l.assertRegistered(p.FiltersToolPanelModule,"Filters Tool Panel"))return;var o=new D;e.getContext().createBean(o),o.setToolPanelDef(t),o.setDisplayed(!1),e.getGui().appendChild(o.getGui()),e.toolPanelWrappers.push(o)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},s.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},s.prototype.openToolPanel=function(t){var e=this.openedItem();e!==t&&(this.toolPanelWrappers.forEach((function(e){var o=t===e.getToolPanelId();e.setDisplayed(o)})),e!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},s.prototype.getToolPanelInstance=function(t){var e=this.toolPanelWrappers.filter((function(e){return e.getToolPanelId()===t}))[0];if(e)return e.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},s.prototype.raiseToolPanelVisibleEvent=function(t){var e={type:c.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(e)},s.prototype.close=function(){this.openToolPanel(void 0)},s.prototype.isToolPanelShowing=function(){return!!this.openedItem()},s.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(e){e.isDisplayed()&&(t=e.getToolPanelId())})),t},s.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(e){n.removeFromParent(e.getGui()),t.destroyBean(e)})),this.toolPanelWrappers.length=0},s.prototype.destroy=function(){this.destroyToolPanelWrappers(),o.prototype.destroy.call(this)},s.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',w([t("gridApi")],s.prototype,"gridApi",void 0),w([t("focusService")],s.prototype,"focusService",void 0),w([r("sideBarButtons")],s.prototype,"sideBarButtonsComp",void 0),w([e],s.prototype,"postConstruct",null),s}(o),W=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),G=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},S=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.isColGroupDef=function(t){return t&&void 0!==t.children},t.getId=function(e){return t.isColGroupDef(e)?e.groupId:e.colId},t}return W(o,e),o.prototype.createColumnTree=function(t){var e=this,o=[],n=function(t,r){if(e.isColGroupDef(t)){var i=t,s=void 0!==i.groupId?i.groupId:i.headerName,a=new f(i,s,!1,r),l=[];return i.children.forEach((function(t){var e=n(t,r+1);e&&l.push(e)})),a.setChildren(l),a}var p=t,c=p.colId?p.colId:p.field,u=e.columnModel.getPrimaryColumn(c);return u||o.push(p),u},r=[];return t.forEach((function(t){var e=n(t,0);e&&r.push(e)})),o.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",o),r},o.prototype.syncLayoutWithGrid=function(t){var e=this.getLeafPathTrees();t(this.mergeLeafPathTrees(e))},o.prototype.getLeafPathTrees=function(){var t=function(e,o){var n;if(e instanceof f)if(e.isPadding())n=o;else{var r=Object.assign({},e.getColGroupDef());r.groupId=e.getGroupId(),r.children=[o],n=r}else{var i=Object.assign({},e.getColDef());i.colId=e.getColId(),n=i}var s=e.getOriginalParent();return s?t(s,n):n};return this.columnModel.getAllGridColumns().filter((function(t){var e=t.getColDef();return t.isPrimary()&&!e.showRowGroup})).map((function(e){return t(e,e.getColDef())}))},o.prototype.mergeLeafPathTrees=function(t){for(var e,o,n=this,r=function(t,e){if(!n.isColGroupDef(e))return t;var o=t,i=e;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(t){return r(o,t)})),o},i=[],s=1;s<=t.length;s++){var a=t[s-1],l=t[s];e=a,o=l,n.isColGroupDef(e)&&n.isColGroupDef(o)&&n.getId(e)===n.getId(o)?t[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(t,e,o){var r=this;if(!this.isColGroupDef(t))return!0;var i=t,s=o;if(function(t,e){var o=t.children.map(r.getId),i=n.includes(o,r.getId(e)),s=n.last(t.children),a=s&&r.getId(s)!==r.getId(e);return i&&a}(i,s))return i.children.push(s),!0;if(i.groupId===e){var a=i.children.map(this.getId);if(!n.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(t){return r.addChildrenToGroup(t,e,o)})),!1},G([t("columnModel")],o.prototype,"columnModel",void 0),o=G([u("toolPanelColDefService")],o)}(d),A={moduleName:p.SideBarModule,beans:[S],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:m},{componentName:"AgSideBar",componentClass:R},{componentName:"AgSideBarButtons",componentClass:E}],dependantModules:[h]};export{A as SideBarModule,S as ToolPanelColDefService};
import{Autowired as t,PostConstruct as e,Component as o,_ as n,RefSelector as r,KeyCode as i,PreDestroy as s,ManagedFocusFeature as a,ModuleRegistry as l,ModuleNames as p,Events as c,Bean as u,BeanStub as d,ProvidedColumnGroup as f}from"@ag-grid-community/core";import{EnterpriseCoreModule as h}from"@ag-grid-enterprise/core";var y,g=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),v=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},m=function(o){function n(){var t=o.call(this,'<div class="ag-tool-panel-horizontal-resize"></div>')||this;return t.minWidth=100,t.maxWidth=null,t}return g(n,o),n.prototype.setElementToResize=function(t){this.elementToResize=t},n.prototype.postConstruct=function(){var t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizing.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gridOptionsWrapper.isEnableRtl())},n.prototype.onResizeStart=function(){this.startingWidth=this.elementToResize.offsetWidth},n.prototype.onResizing=function(t){var e=this.inverted?-1:1,o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*e));null!=this.maxWidth&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=o+"px"},n.prototype.setInverted=function(t){this.inverted=t},n.prototype.setMaxWidth=function(t){this.maxWidth=t},n.prototype.setMinWidth=function(t){this.minWidth=null!=t?t:100},v([t("horizontalResizeService")],n.prototype,"horizontalResizeService",void 0),v([e],n.prototype,"postConstruct",null),n}(o),P=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),T=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},C=function(t){function o(e){var o=t.call(this)||this;return o.toolPanelDef=e,o}return P(o,t),o.prototype.getToolPanelId=function(){return this.toolPanelDef.id},o.prototype.postConstruct=function(){var t=this.createTemplate();this.setTemplate(t),this.eIconWrapper.insertAdjacentElement("afterbegin",n.createIconNoSpan(this.toolPanelDef.iconKey,this.gridOptionsWrapper)),this.addManagedListener(this.eToggleButton,"click",this.onButtonPressed.bind(this))},o.prototype.createTemplate=function(){var t=this.gridOptionsWrapper.getLocaleTextFunc(),e=this.toolPanelDef;return'<div class="ag-side-button" role="presentation">\n <button type="button" ref="eToggleButton" tabindex="-1" role="tab" class="ag-side-button-button">\n <div ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>\n <span class="ag-side-button-label">'+t(e.labelKey,e.labelDefault)+"</span>\n </button>\n </div>"},o.prototype.onButtonPressed=function(){this.dispatchEvent({type:o.EVENT_TOGGLE_BUTTON_CLICKED})},o.prototype.setSelected=function(t){this.addOrRemoveCssClass("ag-selected",t)},o.EVENT_TOGGLE_BUTTON_CLICKED="toggleButtonClicked",T([r("eToggleButton")],o.prototype,"eToggleButton",void 0),T([r("eIconWrapper")],o.prototype,"eIconWrapper",void 0),T([e],o.prototype,"postConstruct",null),o}(o),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),B=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},E=function(o){function r(){var t=o.call(this,r.TEMPLATE)||this;return t.buttonComps=[],t}return b(r,o),r.prototype.postConstruct=function(){this.addManagedListener(this.getFocusableElement(),"keydown",this.handleKeyDown.bind(this))},r.prototype.handleKeyDown=function(t){if(t.key===i.TAB&&t.shiftKey){var e=n.last(this.columnModel.getAllDisplayedColumns());this.focusService.focusGridView(e,!0)&&t.preventDefault()}},r.prototype.setToolPanelDefs=function(t){t.forEach(this.addButtonComp.bind(this))},r.prototype.setActiveButton=function(t){this.buttonComps.forEach((function(e){e.setSelected(t===e.getToolPanelId())}))},r.prototype.addButtonComp=function(t){var e=this,o=this.createBean(new C(t));this.buttonComps.push(o),this.appendChild(o),o.addEventListener(C.EVENT_TOGGLE_BUTTON_CLICKED,(function(){e.dispatchEvent({type:r.EVENT_SIDE_BAR_BUTTON_CLICKED,toolPanelId:t.id})}))},r.prototype.clearButtons=function(){this.buttonComps=this.destroyBeans(this.buttonComps),n.clearElement(this.getGui())},r.EVENT_SIDE_BAR_BUTTON_CLICKED="sideBarButtonClicked",r.TEMPLATE='<div class="ag-side-buttons" role="tablist"></div>',B([t("focusService")],r.prototype,"focusService",void 0),B([t("columnModel")],r.prototype,"columnModel",void 0),B([e],r.prototype,"postConstruct",null),B([s],r.prototype,"clearButtons",null),r}(o),_=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),O=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},D=function(o){function n(){return o.call(this,n.TEMPLATE)||this}return _(n,o),n.prototype.setupResize=function(){var t=this.getGui(),e=this.resizeBar=new m;this.getContext().createBean(e),e.setElementToResize(t),this.appendChild(e)},n.prototype.getToolPanelId=function(){return this.toolPanelId},n.prototype.setToolPanelDef=function(t){var e=t.id,o=t.minWidth,n=t.maxWidth,r=t.width;this.toolPanelId=e,this.width=r;var i=this.userComponentFactory.getToolPanelCompDetails(t,{}).newAgStackInstance();null!=i?(i.then(this.setToolPanelComponent.bind(this)),null!=o&&this.resizeBar.setMinWidth(o),null!=n&&this.resizeBar.setMaxWidth(n)):console.warn("AG Grid: error processing tool panel component "+e+". You need to specify either 'toolPanel' or 'toolPanelFramework'")},n.prototype.setToolPanelComponent=function(t){var e=this;this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc((function(){e.destroyBean(t)})),this.width&&(this.getGui().style.width=this.width+"px")},n.prototype.getToolPanelInstance=function(){return this.toolPanelCompInstance},n.prototype.setResizerSizerSide=function(t){var e="left"===t,o=this.gridOptionsWrapper.isEnableRtl()?e:!e;this.resizeBar.setInverted(o)},n.prototype.refresh=function(){this.toolPanelCompInstance.refresh()},n.TEMPLATE='<div class="ag-tool-panel-wrapper"/>',O([t("userComponentFactory")],n.prototype,"userComponentFactory",void 0),O([e],n.prototype,"setupResize",null),n}(o),I=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),w=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},R=function(o){function s(){var t=o.call(this,s.TEMPLATE)||this;return t.toolPanelWrappers=[],t}return I(s,o),s.prototype.postConstruct=function(){var t=this;this.sideBarButtonsComp.addEventListener(E.EVENT_SIDE_BAR_BUTTON_CLICKED,this.onToolPanelButtonClicked.bind(this)),this.setSideBarDef(),this.gridOptionsWrapper.addEventListener("sideBar",(function(){t.clearDownUi(),t.setSideBarDef()})),this.gridApi.registerSideBarComp(this),this.createManagedBean(new a(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)}))},s.prototype.onTabKeyDown=function(t){if(!t.defaultPrevented){var e=this.focusService,o=this.sideBarButtonsComp,n=this.getGui(),r=o.getGui(),i=this.gridOptionsWrapper.getDocument().activeElement,s=n.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)");if(s)if(r.contains(i))e.focusInto(s,t.shiftKey)&&t.preventDefault();else if(!e.isFocusUnderManagedComponent(s)&&t.shiftKey){var a=e.findFocusableElements(s)[0];if(this.gridOptionsWrapper.getDocument().activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},s.prototype.handleKeyDown=function(t){var e=this.gridOptionsWrapper.getDocument();if(this.sideBarButtonsComp.getGui().contains(e.activeElement)){var o=this.sideBarButtonsComp.getGui(),n=Array.prototype.slice.call(o.querySelectorAll(".ag-side-button")),r=e.activeElement,s=n.findIndex((function(t){return t.contains(r)})),a=null;switch(t.key){case i.LEFT:case i.UP:a=Math.max(0,s-1);break;case i.RIGHT:case i.DOWN:a=Math.min(s+1,n.length-1)}if(null!==a){var l=n[a].querySelector("button");l&&(l.focus(),t.preventDefault())}}},s.prototype.onToolPanelButtonClicked=function(t){var e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0):this.openToolPanel(e)},s.prototype.clearDownUi=function(){this.sideBarButtonsComp.clearButtons(),this.destroyToolPanelWrappers()},s.prototype.setSideBarDef=function(){this.setDisplayed(!1);var t=this.gridOptionsWrapper.getSideBar(),e=!!t&&!!t.toolPanels;if(e){var o=e&&!t.hiddenByDefault;this.setDisplayed(o);var n=t.toolPanels;this.sideBarButtonsComp.setToolPanelDefs(n),this.setupToolPanels(n),this.setSideBarPosition(t.position),t.hiddenByDefault||this.openToolPanel(t.defaultToolPanel)}},s.prototype.setSideBarPosition=function(t){t||(t="right");var e="left"===t,o=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(o)})),this},s.prototype.setupToolPanels=function(t){var e=this;t.forEach((function(t){if(null!=t.id){if("agColumnsToolPanel"===t.toolPanel)if(!l.assertRegistered(p.ColumnToolPanelModule,"Column Tool Panel"))return;if("agFiltersToolPanel"===t.toolPanel)if(!l.assertRegistered(p.FiltersToolPanelModule,"Filters Tool Panel"))return;var o=new D;e.getContext().createBean(o),o.setToolPanelDef(t),o.setDisplayed(!1),e.getGui().appendChild(o.getGui()),e.toolPanelWrappers.push(o)}else console.warn("AG Grid: please review all your toolPanel components, it seems like at least one of them doesn't have an id")}))},s.prototype.refresh=function(){this.toolPanelWrappers.forEach((function(t){return t.refresh()}))},s.prototype.openToolPanel=function(t){var e=this.openedItem();e!==t&&(this.toolPanelWrappers.forEach((function(e){var o=t===e.getToolPanelId();e.setDisplayed(o)})),e!==this.openedItem()&&(this.sideBarButtonsComp.setActiveButton(t),this.raiseToolPanelVisibleEvent(t)))},s.prototype.getToolPanelInstance=function(t){var e=this.toolPanelWrappers.filter((function(e){return e.getToolPanelId()===t}))[0];if(e)return e.getToolPanelInstance();console.warn("AG Grid: unable to lookup Tool Panel as invalid key supplied: "+t)},s.prototype.raiseToolPanelVisibleEvent=function(t){var e={type:c.EVENT_TOOL_PANEL_VISIBLE_CHANGED,source:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(e)},s.prototype.close=function(){this.openToolPanel(void 0)},s.prototype.isToolPanelShowing=function(){return!!this.openedItem()},s.prototype.openedItem=function(){var t=null;return this.toolPanelWrappers.forEach((function(e){e.isDisplayed()&&(t=e.getToolPanelId())})),t},s.prototype.destroyToolPanelWrappers=function(){var t=this;this.toolPanelWrappers.forEach((function(e){n.removeFromParent(e.getGui()),t.destroyBean(e)})),this.toolPanelWrappers.length=0},s.prototype.destroy=function(){this.destroyToolPanelWrappers(),o.prototype.destroy.call(this)},s.TEMPLATE='<div class="ag-side-bar ag-unselectable">\n <ag-side-bar-buttons ref="sideBarButtons"></ag-side-bar-buttons>\n </div>',w([t("gridApi")],s.prototype,"gridApi",void 0),w([t("focusService")],s.prototype,"focusService",void 0),w([r("sideBarButtons")],s.prototype,"sideBarButtonsComp",void 0),w([e],s.prototype,"postConstruct",null),s}(o),W=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),G=function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},S=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.isColGroupDef=function(t){return t&&void 0!==t.children},t.getId=function(e){return t.isColGroupDef(e)?e.groupId:e.colId},t}return W(o,e),o.prototype.createColumnTree=function(t){var e=this,o=[],n=function(t,r){if(e.isColGroupDef(t)){var i=t,s=void 0!==i.groupId?i.groupId:i.headerName,a=new f(i,s,!1,r),l=[];return i.children.forEach((function(t){var e=n(t,r+1);e&&l.push(e)})),a.setChildren(l),a}var p=t,c=p.colId?p.colId:p.field,u=e.columnModel.getPrimaryColumn(c);return u||o.push(p),u},r=[];return t.forEach((function(t){var e=n(t,0);e&&r.push(e)})),o.length>0&&console.warn("AG Grid: unable to find grid columns for the supplied colDef(s):",o),r},o.prototype.syncLayoutWithGrid=function(t){var e=this.getLeafPathTrees();t(this.mergeLeafPathTrees(e))},o.prototype.getLeafPathTrees=function(){var t=function(e,o){var n;if(e instanceof f)if(e.isPadding())n=o;else{var r=Object.assign({},e.getColGroupDef());r.groupId=e.getGroupId(),r.children=[o],n=r}else{var i=Object.assign({},e.getColDef());i.colId=e.getColId(),n=i}var s=e.getOriginalParent();return s?t(s,n):n};return this.columnModel.getAllGridColumns().filter((function(t){var e=t.getColDef();return t.isPrimary()&&!e.showRowGroup})).map((function(e){return t(e,e.getColDef())}))},o.prototype.mergeLeafPathTrees=function(t){for(var e,o,n=this,r=function(t,e){if(!n.isColGroupDef(e))return t;var o=t,i=e;if(i.children&&i.groupId&&n.addChildrenToGroup(o,i.groupId,i.children[0]))return o;return i.children.forEach((function(t){return r(o,t)})),o},i=[],s=1;s<=t.length;s++){var a=t[s-1],l=t[s];e=a,o=l,n.isColGroupDef(e)&&n.isColGroupDef(o)&&n.getId(e)===n.getId(o)?t[s]=r(a,l):i.push(a)}return i},o.prototype.addChildrenToGroup=function(t,e,o){var r=this;if(!this.isColGroupDef(t))return!0;var i=t,s=o;if(function(t,e){var o=t.children.map(r.getId),i=n.includes(o,r.getId(e)),s=n.last(t.children),a=s&&r.getId(s)!==r.getId(e);return i&&a}(i,s))return i.children.push(s),!0;if(i.groupId===e){var a=i.children.map(this.getId);if(!n.includes(a,this.getId(s)))return i.children.push(s),!0}return i.children.forEach((function(t){return r.addChildrenToGroup(t,e,o)})),!1},G([t("columnModel")],o.prototype,"columnModel",void 0),o=G([u("toolPanelColDefService")],o)}(d),A={moduleName:p.SideBarModule,beans:[S],agStackComponents:[{componentName:"AgHorizontalResize",componentClass:m},{componentName:"AgSideBar",componentClass:R},{componentName:"AgSideBarButtons",componentClass:E}],dependantModules:[h]};export{A as SideBarModule,S as ToolPanelColDefService};
{
"name": "@ag-grid-enterprise/side-bar",
"version": "27.1.0",
"version": "27.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -9,2 +9,3 @@ "main": "./dist/cjs/es5/main.js",

"scripts": {
"clean": "rimraf dist .hash",
"build-cjs": "npx tsc -p tsconfig.cjs.es5.json && npx tsc -p tsconfig.cjs.es6.json",

@@ -47,7 +48,8 @@ "build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json",

"dependencies": {
"@ag-grid-community/core": "~27.1.0",
"@ag-grid-enterprise/core": "~27.1.0"
"@ag-grid-community/core": "~27.2.0",
"@ag-grid-enterprise/core": "~27.2.0"
},
"devDependencies": {
"typescript": "~3.7.7"
"typescript": "~3.7.7",
"rimraf": "3.0.2"
},

@@ -54,0 +56,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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