devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
56 lines (55 loc) • 2.1 kB
JavaScript
/**
* DevExtreme (esm/__internal/ui/diagram/diagram.toolbox_manager.js)
* Version: 26.1.4
* Build date: Fri Jul 24 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import messageLocalization from "../../../common/core/localization/message";
const DiagramToolboxManager = {
getDefaultGroups() {
if (!this._groups) {
this._groups = {
general: {
category: "general",
title: messageLocalization.format("dxDiagram-categoryGeneral")
},
flowchart: {
category: "flowchart",
title: messageLocalization.format("dxDiagram-categoryFlowchart")
},
orgChart: {
category: "orgChart",
title: messageLocalization.format("dxDiagram-categoryOrgChart")
},
containers: {
category: "containers",
title: messageLocalization.format("dxDiagram-categoryContainers")
},
custom: {
category: "custom",
title: messageLocalization.format("dxDiagram-categoryCustom")
}
}
}
return this._groups
},
getGroups(groups) {
const defaultGroups = this.getDefaultGroups();
if (groups) {
return groups.map(g => {
if ("string" === typeof g) {
var _defaultGroups$g;
return {
category: g,
title: (null === (_defaultGroups$g = defaultGroups[g]) || void 0 === _defaultGroups$g ? void 0 : _defaultGroups$g.title) || g
}
}
return g
}).filter(g => g)
}
return [defaultGroups.general, defaultGroups.flowchart, defaultGroups.orgChart, defaultGroups.containers]
}
};
export default DiagramToolboxManager;