opendash
Version:
open.DASH data visualization framework
55 lines • 2.4 kB
JavaScript
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 __());
};
})();
import { BaseService, NavigationAdapterContext, } from "..";
var NavigationService = /** @class */ (function (_super) {
__extends(NavigationService, _super);
function NavigationService(app, adapter) {
var _this = _super.call(this) || this;
_this.dynamicNavigationGroups = new Set();
_this.dynamicNavigationItems = new Set();
_this.app = app;
_this.services = app.services;
_this.adapter = adapter;
_this.context = new NavigationAdapterContext(_this, _this.app);
_this.initAdapter(adapter, _this.context, _this.services);
return _this;
}
NavigationService.prototype.getGroups = function (place) {
return Array.from(this.dynamicNavigationGroups.values());
};
NavigationService.prototype.getItems = function (place) {
return Array.from(this.dynamicNavigationItems.values());
};
NavigationService.prototype.registerDynamicNavigationGroup = function (group) {
var _this = this;
this.dynamicNavigationGroups.add(group);
_super.prototype.notifySubscribers.call(this);
return function () {
_this.dynamicNavigationGroups.delete(group);
_super.prototype.notifySubscribers.call(_this);
};
};
NavigationService.prototype.registerDynamicNavigationItem = function (item) {
var _this = this;
this.dynamicNavigationItems.add(item);
_super.prototype.notifySubscribers.call(this);
return function () {
_this.dynamicNavigationItems.delete(item);
_super.prototype.notifySubscribers.call(_this);
};
};
return NavigationService;
}(BaseService));
export { NavigationService };
//# sourceMappingURL=NavigationService.js.map