@ag-grid-enterprise/side-bar
Advanced tools
Comparing version 28.0.2 to 28.1.0
@@ -31,4 +31,3 @@ "use strict"; | ||
var eGui = this.getGui(); | ||
var resizeBar = this.resizeBar = new horizontalResizeComp_1.HorizontalResizeComp(); | ||
this.getContext().createBean(resizeBar); | ||
var resizeBar = this.resizeBar = this.createManagedBean(new horizontalResizeComp_1.HorizontalResizeComp()); | ||
resizeBar.setElementToResize(eGui); | ||
@@ -35,0 +34,0 @@ this.appendChild(resizeBar); |
@@ -17,4 +17,3 @@ "use strict"; | ||
const eGui = this.getGui(); | ||
const resizeBar = this.resizeBar = new horizontalResizeComp_1.HorizontalResizeComp(); | ||
this.getContext().createBean(resizeBar); | ||
const resizeBar = this.resizeBar = this.createManagedBean(new horizontalResizeComp_1.HorizontalResizeComp()); | ||
resizeBar.setElementToResize(eGui); | ||
@@ -21,0 +20,0 @@ this.appendChild(resizeBar); |
@@ -29,4 +29,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var eGui = this.getGui(); | ||
var resizeBar = this.resizeBar = new HorizontalResizeComp(); | ||
this.getContext().createBean(resizeBar); | ||
var resizeBar = this.resizeBar = this.createManagedBean(new HorizontalResizeComp()); | ||
resizeBar.setElementToResize(eGui); | ||
@@ -33,0 +32,0 @@ this.appendChild(resizeBar); |
@@ -15,4 +15,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
const eGui = this.getGui(); | ||
const resizeBar = this.resizeBar = new HorizontalResizeComp(); | ||
this.getContext().createBean(resizeBar); | ||
const resizeBar = this.resizeBar = this.createManagedBean(new HorizontalResizeComp()); | ||
resizeBar.setElementToResize(eGui); | ||
@@ -19,0 +18,0 @@ this.appendChild(resizeBar); |
/** | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.0.2 | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.1.0 | ||
* @link https://www.ag-grid.com/ | ||
@@ -254,4 +254,3 @@ * @license Commercial | ||
var eGui = this.getGui(); | ||
var resizeBar = this.resizeBar = new HorizontalResizeComp(); | ||
this.getContext().createBean(resizeBar); | ||
var resizeBar = this.resizeBar = this.createManagedBean(new HorizontalResizeComp()); | ||
resizeBar.setElementToResize(eGui); | ||
@@ -258,0 +257,0 @@ this.appendChild(resizeBar); |
/** | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.0.2 | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.1.0 | ||
* @link https://www.ag-grid.com/ | ||
@@ -7,6 +7,6 @@ * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.0.2 | ||
* @ag-grid-enterprise/side-bar - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.1.0 | ||
* @link https://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=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; | ||
"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=this.createManagedBean(new i);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; |
{ | ||
"name": "@ag-grid-enterprise/side-bar", | ||
"version": "28.0.2", | ||
"version": "28.1.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -50,4 +50,4 @@ "main": "./dist/cjs/es5/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~28.0.0", | ||
"@ag-grid-enterprise/core": "~28.0.0" | ||
"@ag-grid-community/core": "~28.1.0", | ||
"@ag-grid-enterprise/core": "~28.1.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3698188
58577
0
+ Added@ag-grid-community/core@28.1.1(transitive)
+ Added@ag-grid-enterprise/core@28.1.1(transitive)
- Removed@ag-grid-community/core@28.0.2(transitive)
- Removed@ag-grid-enterprise/core@28.0.2(transitive)