@difizen/mana-core
Version:
32 lines (31 loc) • 940 B
JavaScript
/**
* Instance of toolbar
* Use this token to get the toolbar instance when customizing elements on the toolbar.
*/
export var ToolbarInstance = Symbol('ToolbarInstance');
/**
* Factory for instantiating toolbars.
*/
export var ToolbarItemFactory = Symbol('ToolbarItemFactory');
export var ToolbarNode = Symbol('ToolbarItemDefinition');
export var ToolbarItem;
(function (_ToolbarItem) {
function isDefinition(arg) {
return !!arg && 'id' in arg && 'command' in arg && typeof arg.command === 'string';
}
_ToolbarItem.isDefinition = isDefinition;
function is(arg) {
return isDefinition(arg) && 'onDisposed' in arg;
}
_ToolbarItem.is = is;
function getGroupKey(record) {
if (!record.group) {
return '';
}
if (typeof record.group === 'string') {
return record.group;
}
return record.group.join('.');
}
_ToolbarItem.getGroupKey = getGroupKey;
})(ToolbarItem || (ToolbarItem = {}));