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 26.1.0 to 26.2.0

3

dist/cjs/sideBar/toolPanelWrapper.js

@@ -47,3 +47,4 @@ "use strict";

};
var componentPromise = this.userComponentFactory.newToolPanelComponent(toolPanelDef, params);
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);
var componentPromise = compDetails.newAgStackInstance();
if (componentPromise == null) {

@@ -50,0 +51,0 @@ console.warn("ag-grid: error processing tool panel component " + id + ". You need to specify either 'toolPanel' or 'toolPanelFramework'");

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

};
var componentPromise = this.userComponentFactory.newToolPanelComponent(toolPanelDef, params);
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);
var componentPromise = compDetails.newAgStackInstance();
if (componentPromise == null) {

@@ -48,0 +49,0 @@ console.warn("ag-grid: error processing tool panel component " + id + ". You need to specify either 'toolPanel' or 'toolPanelFramework'");

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0
* @link http://www.ag-grid.com/

@@ -271,3 +271,4 @@ ' * @license Commercial

};
var componentPromise = this.userComponentFactory.newToolPanelComponent(toolPanelDef, params);
var compDetails = this.userComponentFactory.getToolPanelCompDetails(toolPanelDef, params);
var componentPromise = compDetails.newAgStackInstance();
if (componentPromise == null) {

@@ -274,0 +275,0 @@ console.warn("ag-grid: error processing tool panel component " + id + ". You need to specify either 'toolPanel' or 'toolPanelFramework'");

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0
* @link http://www.ag-grid.com/

@@ -8,6 +8,6 @@ ' * @license Commercial

/**
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.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.keyCode===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.newToolPanelComponent(t,i);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=document.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(document.activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},o.prototype.handleKeyDown=function(t){if(this.sideBarButtonsComp.getGui().contains(document.activeElement)){var o=this.sideBarButtonsComp.getGui(),n=Array.prototype.slice.call(o.querySelectorAll(".ag-side-button")),r=document.activeElement,i=e._.findIndex(n,(function(t){return t.contains(r)})),s=null;switch(t.keyCode){case e.KeyCode.LEFT:case e.KeyCode.UP:s=Math.max(0,i-1);break;case e.KeyCode.RIGHT:case e.KeyCode.DOWN:s=Math.min(i+1,n.length-1)}if(null!==s){var a=n[s].querySelector("button");a&&(a.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 o="left"===t,n=o?"right":"left",r=this.getGui();return e._.addOrRemoveCssClass(r,"ag-side-bar-left",o),e._.addOrRemoveCssClass(r,"ag-side-bar-right",!o),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(n)})),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=e._.assign({},o.getColGroupDef());i.groupId=o.getGroupId(),i.children=[n],r=i}else{var s=e._.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.keyCode===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=document.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(document.activeElement===a){var l=r.querySelector(".ag-selected button");l&&(t.preventDefault(),l.focus())}}}},o.prototype.handleKeyDown=function(t){if(this.sideBarButtonsComp.getGui().contains(document.activeElement)){var o=this.sideBarButtonsComp.getGui(),n=Array.prototype.slice.call(o.querySelectorAll(".ag-side-button")),r=document.activeElement,i=e._.findIndex(n,(function(t){return t.contains(r)})),s=null;switch(t.keyCode){case e.KeyCode.LEFT:case e.KeyCode.UP:s=Math.max(0,i-1);break;case e.KeyCode.RIGHT:case e.KeyCode.DOWN:s=Math.min(i+1,n.length-1)}if(null!==s){var a=n[s].querySelector("button");a&&(a.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 o="left"===t,n=o?"right":"left",r=this.getGui();return e._.addOrRemoveCssClass(r,"ag-side-bar-left",o),e._.addOrRemoveCssClass(r,"ag-side-bar-right",!o),this.toolPanelWrappers.forEach((function(t){t.setResizerSizerSide(n)})),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=e._.assign({},o.getColGroupDef());i.groupId=o.getGroupId(),i.children=[n],r=i}else{var s=e._.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;
{
"name": "@ag-grid-enterprise/side-bar",
"version": "26.1.0",
"version": "26.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components",

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

"dependencies": {
"@ag-grid-community/core": "~26.1.0",
"@ag-grid-enterprise/core": "~26.1.0"
"@ag-grid-community/core": "~26.2.0",
"@ag-grid-enterprise/core": "~26.2.0"
},

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is 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