@ag-grid-enterprise/side-bar
Advanced tools
Comparing version 23.1.1 to 23.2.0
@@ -1,3 +0,3 @@ | ||
import { AbstractColDef, OriginalColumnGroupChild } from "@ag-grid-community/core"; | ||
export declare class ToolPanelColDefService { | ||
import { AbstractColDef, BeanStub, OriginalColumnGroupChild } from "@ag-grid-community/core"; | ||
export declare class ToolPanelColDefService extends BeanStub { | ||
private columnController; | ||
@@ -4,0 +4,0 @@ createColumnTree(colDefs: AbstractColDef[]): OriginalColumnGroupChild[]; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,9 +23,11 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var ToolPanelColDefService = /** @class */ (function () { | ||
var ToolPanelColDefService = /** @class */ (function (_super) { | ||
__extends(ToolPanelColDefService, _super); | ||
function ToolPanelColDefService() { | ||
var _this = this; | ||
this.isColGroupDef = function (colDef) { return colDef && typeof colDef.children !== 'undefined'; }; | ||
this.getId = function (colDef) { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.isColGroupDef = function (colDef) { return colDef && typeof colDef.children !== 'undefined'; }; | ||
_this.getId = function (colDef) { | ||
return _this.isColGroupDef(colDef) ? colDef.groupId : colDef.colId; | ||
}; | ||
return _this; | ||
} | ||
@@ -190,4 +205,4 @@ ToolPanelColDefService.prototype.createColumnTree = function (colDefs) { | ||
return ToolPanelColDefService; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.ToolPanelColDefService = ToolPanelColDefService; | ||
//# sourceMappingURL=toolPanelColDefService.js.map |
@@ -5,3 +5,2 @@ import { Component } from "@ag-grid-community/core"; | ||
private gridOptionsWrapper; | ||
private eventService; | ||
private startingWidth; | ||
@@ -8,0 +7,0 @@ private elementToResize; |
@@ -26,3 +26,3 @@ "use strict"; | ||
function HorizontalResizeComp() { | ||
return _super.call(this, "<div class=\"ag-tool-panel-horizontal-resize\"></div>") || this; | ||
return _super.call(this, /* html */ "<div class=\"ag-tool-panel-horizontal-resize\"></div>") || this; | ||
} | ||
@@ -61,5 +61,2 @@ HorizontalResizeComp.prototype.setElementToResize = function (elementToResize) { | ||
__decorate([ | ||
core_1.Autowired('eventService') | ||
], HorizontalResizeComp.prototype, "eventService", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
@@ -66,0 +63,0 @@ ], HorizontalResizeComp.prototype, "postConstruct", null); |
@@ -7,6 +7,9 @@ import { AgEvent, Component, ToolPanelDef } from "@ag-grid-community/core"; | ||
static EVENT_SIDE_BAR_BUTTON_CLICKED: string; | ||
private gridOptionsWrapper; | ||
private static readonly TEMPLATE; | ||
private buttonComps; | ||
private focusController; | ||
private headerPositionUtils; | ||
constructor(); | ||
private postConstruct; | ||
private handleKeyDown; | ||
setToolPanelDefs(toolPanelDefs: ToolPanelDef[]): void; | ||
@@ -16,3 +19,2 @@ setActiveButton(id: string | undefined): void; | ||
clearButtons(): void; | ||
destroy(): void; | ||
} |
@@ -30,2 +30,19 @@ "use strict"; | ||
} | ||
SideBarButtonsComp.prototype.postConstruct = function () { | ||
this.addManagedListener(this.getFocusableElement(), 'keydown', this.handleKeyDown.bind(this)); | ||
}; | ||
SideBarButtonsComp.prototype.handleKeyDown = function (e) { | ||
if (e.keyCode !== core_1.Constants.KEY_TAB || !e.shiftKey) { | ||
return; | ||
} | ||
var prevEl = this.focusController.findNextFocusableElement(this.getFocusableElement(), null, true); | ||
if (!prevEl) { | ||
var headerPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(0, 'start'); | ||
if (!headerPosition) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
this.focusController.focusHeaderPosition(headerPosition); | ||
} | ||
}; | ||
SideBarButtonsComp.prototype.setToolPanelDefs = function (toolPanelDefs) { | ||
@@ -41,6 +58,5 @@ toolPanelDefs.forEach(this.addButtonComp.bind(this)); | ||
var _this = this; | ||
var buttonComp = new SideBarButtonComp(def); | ||
this.getContext().wireBean(buttonComp); | ||
var buttonComp = this.createBean(new SideBarButtonComp(def)); | ||
this.buttonComps.push(buttonComp); | ||
this.getGui().appendChild(buttonComp.getGui()); | ||
this.appendChild(buttonComp); | ||
buttonComp.addEventListener(SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED, function () { | ||
@@ -54,17 +70,19 @@ _this.dispatchEvent({ | ||
SideBarButtonsComp.prototype.clearButtons = function () { | ||
if (this.buttonComps) { | ||
this.buttonComps.forEach(function (comp) { return comp.destroy(); }); | ||
} | ||
this.buttonComps = this.destroyBeans(this.buttonComps); | ||
core_1._.clearElement(this.getGui()); | ||
this.buttonComps.length = 0; | ||
}; | ||
SideBarButtonsComp.prototype.destroy = function () { | ||
this.clearButtons(); | ||
_super.prototype.destroy.call(this); | ||
}; | ||
SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED = 'sideBarButtonClicked'; | ||
SideBarButtonsComp.TEMPLATE = "<div class=\"ag-side-buttons\"></div>"; | ||
__decorate([ | ||
core_1.Autowired("gridOptionsWrapper") | ||
], SideBarButtonsComp.prototype, "gridOptionsWrapper", void 0); | ||
core_1.Autowired('focusController') | ||
], SideBarButtonsComp.prototype, "focusController", void 0); | ||
__decorate([ | ||
core_1.Autowired('headerPositionUtils') | ||
], SideBarButtonsComp.prototype, "headerPositionUtils", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], SideBarButtonsComp.prototype, "postConstruct", null); | ||
__decorate([ | ||
core_1.PreDestroy | ||
], SideBarButtonsComp.prototype, "clearButtons", null); | ||
return SideBarButtonsComp; | ||
@@ -87,3 +105,3 @@ }(core_1.Component)); | ||
this.eIconWrapper.insertAdjacentElement('afterbegin', core_1._.createIconNoSpan(this.toolPanelDef.iconKey, this.gridOptionsWrapper)); | ||
this.addDestroyableEventListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this)); | ||
this.addManagedListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this)); | ||
}; | ||
@@ -90,0 +108,0 @@ SideBarButtonComp.prototype.createTemplate = function () { |
@@ -6,3 +6,2 @@ import { Component, IComponent, ISideBar, IToolPanel } from "@ag-grid-community/core"; | ||
export declare class SideBarComp extends Component implements ISideBar { | ||
private eventService; | ||
private gridOptionsWrapper; | ||
@@ -28,3 +27,3 @@ private sideBarButtonsComp; | ||
private destroyToolPanelWrappers; | ||
destroy(): void; | ||
protected destroy(): void; | ||
} |
@@ -103,3 +103,3 @@ "use strict"; | ||
var wrapper = new toolPanelWrapper_1.ToolPanelWrapper(); | ||
_this.getContext().wireBean(wrapper); | ||
_this.getContext().createBean(wrapper); | ||
wrapper.setToolPanelDef(def); | ||
@@ -168,5 +168,6 @@ wrapper.setDisplayed(false); | ||
SideBarComp.prototype.destroyToolPanelWrappers = function () { | ||
var _this = this; | ||
this.toolPanelWrappers.forEach(function (wrapper) { | ||
core_1._.removeFromParent(wrapper.getGui()); | ||
wrapper.destroy(); | ||
_this.destroyBean(wrapper); | ||
}); | ||
@@ -179,7 +180,4 @@ this.toolPanelWrappers.length = 0; | ||
}; | ||
SideBarComp.TEMPLATE = "<div class=\"ag-side-bar ag-unselectable\">\n <ag-side-bar-buttons ref=\"sideBarButtons\">\n </div>"; | ||
SideBarComp.TEMPLATE = "<div class=\"ag-side-bar ag-unselectable\">\n <ag-side-bar-buttons ref=\"sideBarButtons\"></ag-side-bar-buttons>\n </div>"; | ||
__decorate([ | ||
core_1.Autowired("eventService") | ||
], SideBarComp.prototype, "eventService", void 0); | ||
__decorate([ | ||
core_1.Autowired("gridOptionsWrapper") | ||
@@ -186,0 +184,0 @@ ], SideBarComp.prototype, "gridOptionsWrapper", void 0); |
@@ -47,3 +47,3 @@ "use strict"; | ||
var resizeBar = this.resizeBar = new horizontalResizeComp_1.HorizontalResizeComp(); | ||
this.getContext().wireBean(resizeBar); | ||
this.getContext().createBean(resizeBar); | ||
resizeBar.setElementToResize(this.getGui()); | ||
@@ -53,4 +53,8 @@ this.appendChild(resizeBar); | ||
ToolPanelWrapper.prototype.setToolPanelComponent = function (compInstance) { | ||
var _this = this; | ||
this.toolPanelCompInstance = compInstance; | ||
this.appendChild(compInstance); | ||
this.appendChild(compInstance.getGui()); | ||
this.addDestroyFunc(function () { | ||
_this.destroyBean(compInstance); | ||
}); | ||
}; | ||
@@ -57,0 +61,0 @@ ToolPanelWrapper.prototype.getToolPanelInstance = function () { |
@@ -1,3 +0,3 @@ | ||
import { AbstractColDef, OriginalColumnGroupChild } from "@ag-grid-community/core"; | ||
export declare class ToolPanelColDefService { | ||
import { AbstractColDef, BeanStub, OriginalColumnGroupChild } from "@ag-grid-community/core"; | ||
export declare class ToolPanelColDefService extends BeanStub { | ||
private columnController; | ||
@@ -4,0 +4,0 @@ createColumnTree(colDefs: AbstractColDef[]): OriginalColumnGroupChild[]; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,10 +20,12 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean, OriginalColumnGroup } from "@ag-grid-community/core"; | ||
var ToolPanelColDefService = /** @class */ (function () { | ||
import { _, Autowired, Bean, BeanStub, OriginalColumnGroup } from "@ag-grid-community/core"; | ||
var ToolPanelColDefService = /** @class */ (function (_super) { | ||
__extends(ToolPanelColDefService, _super); | ||
function ToolPanelColDefService() { | ||
var _this = this; | ||
this.isColGroupDef = function (colDef) { return colDef && typeof colDef.children !== 'undefined'; }; | ||
this.getId = function (colDef) { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.isColGroupDef = function (colDef) { return colDef && typeof colDef.children !== 'undefined'; }; | ||
_this.getId = function (colDef) { | ||
return _this.isColGroupDef(colDef) ? colDef.groupId : colDef.colId; | ||
}; | ||
return _this; | ||
} | ||
@@ -188,3 +203,3 @@ ToolPanelColDefService.prototype.createColumnTree = function (colDefs) { | ||
return ToolPanelColDefService; | ||
}()); | ||
}(BeanStub)); | ||
export { ToolPanelColDefService }; |
@@ -5,3 +5,2 @@ import { Component } from "@ag-grid-community/core"; | ||
private gridOptionsWrapper; | ||
private eventService; | ||
private startingWidth; | ||
@@ -8,0 +7,0 @@ private elementToResize; |
@@ -24,3 +24,3 @@ var __extends = (this && this.__extends) || (function () { | ||
function HorizontalResizeComp() { | ||
return _super.call(this, "<div class=\"ag-tool-panel-horizontal-resize\"></div>") || this; | ||
return _super.call(this, /* html */ "<div class=\"ag-tool-panel-horizontal-resize\"></div>") || this; | ||
} | ||
@@ -59,5 +59,2 @@ HorizontalResizeComp.prototype.setElementToResize = function (elementToResize) { | ||
__decorate([ | ||
Autowired('eventService') | ||
], HorizontalResizeComp.prototype, "eventService", void 0); | ||
__decorate([ | ||
PostConstruct | ||
@@ -64,0 +61,0 @@ ], HorizontalResizeComp.prototype, "postConstruct", null); |
@@ -7,6 +7,9 @@ import { AgEvent, Component, ToolPanelDef } from "@ag-grid-community/core"; | ||
static EVENT_SIDE_BAR_BUTTON_CLICKED: string; | ||
private gridOptionsWrapper; | ||
private static readonly TEMPLATE; | ||
private buttonComps; | ||
private focusController; | ||
private headerPositionUtils; | ||
constructor(); | ||
private postConstruct; | ||
private handleKeyDown; | ||
setToolPanelDefs(toolPanelDefs: ToolPanelDef[]): void; | ||
@@ -16,3 +19,2 @@ setActiveButton(id: string | undefined): void; | ||
clearButtons(): void; | ||
destroy(): void; | ||
} |
@@ -20,3 +20,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { Autowired, Component, PostConstruct, RefSelector, _ } from "@ag-grid-community/core"; | ||
import { Autowired, Component, PostConstruct, RefSelector, PreDestroy, Constants, _ } from "@ag-grid-community/core"; | ||
var SideBarButtonsComp = /** @class */ (function (_super) { | ||
@@ -29,2 +29,19 @@ __extends(SideBarButtonsComp, _super); | ||
} | ||
SideBarButtonsComp.prototype.postConstruct = function () { | ||
this.addManagedListener(this.getFocusableElement(), 'keydown', this.handleKeyDown.bind(this)); | ||
}; | ||
SideBarButtonsComp.prototype.handleKeyDown = function (e) { | ||
if (e.keyCode !== Constants.KEY_TAB || !e.shiftKey) { | ||
return; | ||
} | ||
var prevEl = this.focusController.findNextFocusableElement(this.getFocusableElement(), null, true); | ||
if (!prevEl) { | ||
var headerPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(0, 'start'); | ||
if (!headerPosition) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
this.focusController.focusHeaderPosition(headerPosition); | ||
} | ||
}; | ||
SideBarButtonsComp.prototype.setToolPanelDefs = function (toolPanelDefs) { | ||
@@ -40,6 +57,5 @@ toolPanelDefs.forEach(this.addButtonComp.bind(this)); | ||
var _this = this; | ||
var buttonComp = new SideBarButtonComp(def); | ||
this.getContext().wireBean(buttonComp); | ||
var buttonComp = this.createBean(new SideBarButtonComp(def)); | ||
this.buttonComps.push(buttonComp); | ||
this.getGui().appendChild(buttonComp.getGui()); | ||
this.appendChild(buttonComp); | ||
buttonComp.addEventListener(SideBarButtonComp.EVENT_TOGGLE_BUTTON_CLICKED, function () { | ||
@@ -53,17 +69,19 @@ _this.dispatchEvent({ | ||
SideBarButtonsComp.prototype.clearButtons = function () { | ||
if (this.buttonComps) { | ||
this.buttonComps.forEach(function (comp) { return comp.destroy(); }); | ||
} | ||
this.buttonComps = this.destroyBeans(this.buttonComps); | ||
_.clearElement(this.getGui()); | ||
this.buttonComps.length = 0; | ||
}; | ||
SideBarButtonsComp.prototype.destroy = function () { | ||
this.clearButtons(); | ||
_super.prototype.destroy.call(this); | ||
}; | ||
SideBarButtonsComp.EVENT_SIDE_BAR_BUTTON_CLICKED = 'sideBarButtonClicked'; | ||
SideBarButtonsComp.TEMPLATE = "<div class=\"ag-side-buttons\"></div>"; | ||
__decorate([ | ||
Autowired("gridOptionsWrapper") | ||
], SideBarButtonsComp.prototype, "gridOptionsWrapper", void 0); | ||
Autowired('focusController') | ||
], SideBarButtonsComp.prototype, "focusController", void 0); | ||
__decorate([ | ||
Autowired('headerPositionUtils') | ||
], SideBarButtonsComp.prototype, "headerPositionUtils", void 0); | ||
__decorate([ | ||
PostConstruct | ||
], SideBarButtonsComp.prototype, "postConstruct", null); | ||
__decorate([ | ||
PreDestroy | ||
], SideBarButtonsComp.prototype, "clearButtons", null); | ||
return SideBarButtonsComp; | ||
@@ -86,3 +104,3 @@ }(Component)); | ||
this.eIconWrapper.insertAdjacentElement('afterbegin', _.createIconNoSpan(this.toolPanelDef.iconKey, this.gridOptionsWrapper)); | ||
this.addDestroyableEventListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this)); | ||
this.addManagedListener(this.eToggleButton, 'click', this.onButtonPressed.bind(this)); | ||
}; | ||
@@ -89,0 +107,0 @@ SideBarButtonComp.prototype.createTemplate = function () { |
@@ -6,3 +6,2 @@ import { Component, IComponent, ISideBar, IToolPanel } from "@ag-grid-community/core"; | ||
export declare class SideBarComp extends Component implements ISideBar { | ||
private eventService; | ||
private gridOptionsWrapper; | ||
@@ -28,3 +27,3 @@ private sideBarButtonsComp; | ||
private destroyToolPanelWrappers; | ||
destroy(): void; | ||
protected destroy(): void; | ||
} |
@@ -101,3 +101,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var wrapper = new ToolPanelWrapper(); | ||
_this.getContext().wireBean(wrapper); | ||
_this.getContext().createBean(wrapper); | ||
wrapper.setToolPanelDef(def); | ||
@@ -166,5 +166,6 @@ wrapper.setDisplayed(false); | ||
SideBarComp.prototype.destroyToolPanelWrappers = function () { | ||
var _this = this; | ||
this.toolPanelWrappers.forEach(function (wrapper) { | ||
_.removeFromParent(wrapper.getGui()); | ||
wrapper.destroy(); | ||
_this.destroyBean(wrapper); | ||
}); | ||
@@ -177,7 +178,4 @@ this.toolPanelWrappers.length = 0; | ||
}; | ||
SideBarComp.TEMPLATE = "<div class=\"ag-side-bar ag-unselectable\">\n <ag-side-bar-buttons ref=\"sideBarButtons\">\n </div>"; | ||
SideBarComp.TEMPLATE = "<div class=\"ag-side-bar ag-unselectable\">\n <ag-side-bar-buttons ref=\"sideBarButtons\"></ag-side-bar-buttons>\n </div>"; | ||
__decorate([ | ||
Autowired("eventService") | ||
], SideBarComp.prototype, "eventService", void 0); | ||
__decorate([ | ||
Autowired("gridOptionsWrapper") | ||
@@ -184,0 +182,0 @@ ], SideBarComp.prototype, "gridOptionsWrapper", void 0); |
@@ -45,3 +45,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var resizeBar = this.resizeBar = new HorizontalResizeComp(); | ||
this.getContext().wireBean(resizeBar); | ||
this.getContext().createBean(resizeBar); | ||
resizeBar.setElementToResize(this.getGui()); | ||
@@ -51,4 +51,8 @@ this.appendChild(resizeBar); | ||
ToolPanelWrapper.prototype.setToolPanelComponent = function (compInstance) { | ||
var _this = this; | ||
this.toolPanelCompInstance = compInstance; | ||
this.appendChild(compInstance); | ||
this.appendChild(compInstance.getGui()); | ||
this.addDestroyFunc(function () { | ||
_this.destroyBean(compInstance); | ||
}); | ||
}; | ||
@@ -55,0 +59,0 @@ ToolPanelWrapper.prototype.getToolPanelInstance = function () { |
{ | ||
"name": "@ag-grid-enterprise/side-bar", | ||
"version": "23.1.1", | ||
"version": "23.2.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -12,3 +12,4 @@ "main": "./dist/cjs/main.js", | ||
"package": "node ../../module-build/rollup/build.js", | ||
"build": "npm run build-cjs && npm run build-es6" | ||
"build": "npm run build-cjs && npm run build-es6 && npm run hash", | ||
"hash": "sh ../../scripts/hashDirectory.sh > .hash" | ||
}, | ||
@@ -45,4 +46,4 @@ "repository": { | ||
"dependencies": { | ||
"@ag-grid-community/core": "~23.1.0", | ||
"@ag-grid-enterprise/core": "~23.1.0" | ||
"@ag-grid-community/core": "~23.2.0", | ||
"@ag-grid-enterprise/core": "~23.2.0" | ||
}, | ||
@@ -49,0 +50,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 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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
5596479
45
88824
+ Added@ag-grid-community/core@23.2.1(transitive)
+ Added@ag-grid-enterprise/core@23.2.1(transitive)
- Removed@ag-grid-community/core@23.1.1(transitive)
- Removed@ag-grid-enterprise/core@23.1.1(transitive)