UNPKG

@adaptabletools/adaptable-cjs

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

49 lines (48 loc) 1.95 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DashboardInternalApi = void 0; const Types_1 = require("../../AdaptableState/Common/Types"); const ApiBase_1 = require("../Implementation/ApiBase"); class DashboardInternalApi extends ApiBase_1.ApiBase { isToolbarInActiveTab(toolbarName, dashboardState) { if (!dashboardState) { return false; } const tabIndex = dashboardState.ActiveTabIndex; if (tabIndex != undefined) { if (dashboardState?.Tabs && dashboardState?.Tabs?.length > 0) { const newTab = dashboardState?.Tabs[tabIndex]; if (newTab && newTab.Toolbars) { return newTab.Toolbars.find((c) => c == toolbarName) != undefined; } } } return false; } isToolbarCustom(toolbarName) { return this.getAdaptableApi() .dashboardApi.getCustomToolbars() .some((tb) => tb.name === toolbarName); } getCustomToolbarRenderContainerId(customToolbarName) { return `ab-CustomToolbar__${customToolbarName}__renderContent`; } getCustomToolbarButtonsContainerId(customToolbarName) { return `ab-CustomToolbar__${customToolbarName}__buttons`; } getCustomToolbarComponentContainerId(customToolbarName) { return `ab-CustomToolbar__${customToolbarName}__component`; } getModuleToolbars() { const moduleService = this.getAdaptableInternalApi().getModuleService(); return Types_1.ALL_TOOLBARS.filter((moduleName) => { return moduleService.isModuleAvailable(moduleName); }).map((moduleName) => { return { id: moduleName, friendlyName: moduleService.getModuleInfoByModule(moduleName)?.FriendlyName ?? moduleName, }; }); } } exports.DashboardInternalApi = DashboardInternalApi;