first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,43 @@
import * as React from 'react';
import type { ICommandBar, ICommandBarItemProps, ICommandBarProps } from './CommandBar.types';
import type { JSXElement } from '@fluentui/utilities';
export interface ICommandBarData {
/**
* Items being rendered in the primary region
*/
primaryItems: ICommandBarItemProps[];
/**
* Items being rendered in the overflow
*/
overflowItems: ICommandBarItemProps[];
/**
* Items being rendered on the far side
*/
farItems: ICommandBarItemProps[] | undefined;
/**
* Length of original overflowItems to ensure that they are not moved into primary region on resize
*/
minimumOverflowItems: number;
/**
* Unique string used to cache the width of the command bar
*/
cacheKey: string;
}
export declare class CommandBarBase extends React.Component<ICommandBarProps, {}> implements ICommandBar {
static defaultProps: ICommandBarProps;
private _overflowSet;
private _resizeGroup;
private _classNames;
constructor(props: ICommandBarProps);
render(): JSXElement;
focus(): void;
remeasure(): void;
private _onRenderData;
private _onRenderItem;
private _commandButton;
private _onButtonClick;
private _onRenderOverflowButton;
private _computeCacheKey;
private _onReduceData;
private _onGrowData;
}
@@ -0,0 +1,161 @@
define(["require", "exports", "tslib", "react", "../../Utilities", "../../OverflowSet", "../../ResizeGroup", "../../FocusZone", "../../Button", "../../Tooltip", "./CommandBar.styles"], function (require, exports, tslib_1, React, Utilities_1, OverflowSet_1, ResizeGroup_1, FocusZone_1, Button_1, Tooltip_1, CommandBar_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandBarBase = void 0;
var getClassNames = (0, Utilities_1.classNamesFunction)();
var CommandBarBase = /** @class */ (function (_super) {
tslib_1.__extends(CommandBarBase, _super);
function CommandBarBase(props) {
var _this = _super.call(this, props) || this;
_this._overflowSet = React.createRef();
_this._resizeGroup = React.createRef();
_this._onRenderData = function (data) {
var _a = _this.props, ariaLabel = _a.ariaLabel, primaryGroupAriaLabel = _a.primaryGroupAriaLabel, farItemsGroupAriaLabel = _a.farItemsGroupAriaLabel;
var hasSecondSet = data.farItems && data.farItems.length > 0;
return (React.createElement(FocusZone_1.FocusZone, { className: (0, Utilities_1.css)(_this._classNames.root), direction: FocusZone_1.FocusZoneDirection.horizontal, role: 'menubar', "aria-label": ariaLabel },
React.createElement(OverflowSet_1.OverflowSet, { role: hasSecondSet ? 'group' : 'none', "aria-label": hasSecondSet ? primaryGroupAriaLabel : undefined, componentRef: _this._overflowSet, className: (0, Utilities_1.css)(_this._classNames.primarySet), items: data.primaryItems, overflowItems: data.overflowItems.length ? data.overflowItems : undefined, onRenderItem: _this._onRenderItem, onRenderOverflowButton: _this._onRenderOverflowButton }),
hasSecondSet && (React.createElement(OverflowSet_1.OverflowSet, { role: "group", "aria-label": farItemsGroupAriaLabel, className: (0, Utilities_1.css)(_this._classNames.secondarySet), items: data.farItems, onRenderItem: _this._onRenderItem, onRenderOverflowButton: Utilities_1.nullRender }))));
};
_this._onRenderItem = function (item) {
if (item.onRender) {
// These are the top level items, there is no relevant menu dismissing function to
// provide for the IContextualMenuItem onRender function. Pass in a no op function instead.
return item.onRender(item, function () { return undefined; });
}
// eslint-disable-next-line @typescript-eslint/no-deprecated
var itemText = item.text || item.name;
var commandButtonProps = tslib_1.__assign(tslib_1.__assign({ allowDisabledFocus: true, role: 'menuitem' }, item), { styles: (0, CommandBar_styles_1.getCommandButtonStyles)(item.buttonStyles), className: (0, Utilities_1.css)('ms-CommandBarItem-link', item.className), text: !item.iconOnly ? itemText : undefined, menuProps: item.subMenuProps, onClick: _this._onButtonClick(item) });
if (item.iconOnly && (itemText !== undefined || item.tooltipHostProps)) {
return (React.createElement(Tooltip_1.TooltipHost, tslib_1.__assign({ role: "none", content: itemText,
// eslint-disable-next-line @typescript-eslint/no-deprecated
setAriaDescribedBy: false }, item.tooltipHostProps), _this._commandButton(item, commandButtonProps)));
}
return _this._commandButton(item, commandButtonProps);
};
_this._commandButton = function (item, props) {
var ButtonAs = _this.props.buttonAs;
var CommandBarButtonAs = item.commandBarButtonAs;
var DefaultButtonAs = Button_1.CommandBarButton;
// The prop types between these three possible implementations overlap enough that a force-cast is safe.
var Type = DefaultButtonAs;
if (CommandBarButtonAs) {
Type = (0, Utilities_1.composeComponentAs)(CommandBarButtonAs, Type);
}
if (ButtonAs) {
Type = (0, Utilities_1.composeComponentAs)(ButtonAs, Type);
}
// Always pass the default implementation to the override so it may be composed.
return React.createElement(Type, tslib_1.__assign({}, props));
};
_this._onRenderOverflowButton = function (overflowItems) {
var _a = _this.props.overflowButtonProps, overflowButtonProps = _a === void 0 ? {} : _a;
var combinedOverflowItems = tslib_1.__spreadArray(tslib_1.__spreadArray([], (overflowButtonProps.menuProps ? overflowButtonProps.menuProps.items : []), true), overflowItems, true);
var overflowProps = tslib_1.__assign(tslib_1.__assign({ role: 'menuitem' }, overflowButtonProps), { styles: tslib_1.__assign({ menuIcon: { fontSize: '17px' } }, overflowButtonProps.styles), className: (0, Utilities_1.css)('ms-CommandBar-overflowButton', overflowButtonProps.className), menuProps: tslib_1.__assign(tslib_1.__assign({}, overflowButtonProps.menuProps), { items: combinedOverflowItems }), menuIconProps: tslib_1.__assign({ iconName: 'More' }, overflowButtonProps.menuIconProps) });
var OverflowButtonType = _this.props.overflowButtonAs
? (0, Utilities_1.composeComponentAs)(_this.props.overflowButtonAs, Button_1.CommandBarButton)
: Button_1.CommandBarButton;
return React.createElement(OverflowButtonType, tslib_1.__assign({}, overflowProps));
};
_this._onReduceData = function (data) {
var _a = _this.props, shiftOnReduce = _a.shiftOnReduce, onDataReduced = _a.onDataReduced;
var primaryItems = data.primaryItems, overflowItems = data.overflowItems, cacheKey = data.cacheKey;
var farItems = data.farItems;
// Use first item if shiftOnReduce, otherwise use last item
var movedItem = primaryItems[shiftOnReduce ? 0 : primaryItems.length - 1];
if (movedItem !== undefined) {
movedItem.renderedInOverflow = true;
overflowItems = tslib_1.__spreadArray([movedItem], overflowItems, true);
primaryItems = shiftOnReduce ? primaryItems.slice(1) : primaryItems.slice(0, -1);
var newData = tslib_1.__assign(tslib_1.__assign({}, data), { primaryItems: primaryItems, overflowItems: overflowItems });
cacheKey = _this._computeCacheKey({ primaryItems: primaryItems, overflow: overflowItems.length > 0, farItems: farItems });
if (onDataReduced) {
onDataReduced(movedItem);
}
newData.cacheKey = cacheKey;
return newData;
}
return undefined;
};
_this._onGrowData = function (data) {
var _a = _this.props, shiftOnReduce = _a.shiftOnReduce, onDataGrown = _a.onDataGrown;
var minimumOverflowItems = data.minimumOverflowItems;
var primaryItems = data.primaryItems, overflowItems = data.overflowItems, cacheKey = data.cacheKey;
var farItems = data.farItems;
var movedItem = overflowItems[0];
// Make sure that moved item exists and is not one of the original overflow items
if (movedItem !== undefined && overflowItems.length > minimumOverflowItems) {
movedItem.renderedInOverflow = false;
overflowItems = overflowItems.slice(1);
// if shiftOnReduce, movedItem goes first, otherwise, last.
primaryItems = shiftOnReduce ? tslib_1.__spreadArray([movedItem], primaryItems, true) : tslib_1.__spreadArray(tslib_1.__spreadArray([], primaryItems, true), [movedItem], false);
var newData = tslib_1.__assign(tslib_1.__assign({}, data), { primaryItems: primaryItems, overflowItems: overflowItems });
cacheKey = _this._computeCacheKey({ primaryItems: primaryItems, overflow: overflowItems.length > 0, farItems: farItems });
if (onDataGrown) {
onDataGrown(movedItem);
}
newData.cacheKey = cacheKey;
return newData;
}
return undefined;
};
(0, Utilities_1.initializeComponentRef)(_this);
return _this;
}
CommandBarBase.prototype.render = function () {
var _a = this.props, items = _a.items, overflowItems = _a.overflowItems, farItems = _a.farItems, styles = _a.styles, theme = _a.theme, dataDidRender = _a.dataDidRender, _b = _a.onReduceData, onReduceData = _b === void 0 ? this._onReduceData : _b, _c = _a.onGrowData, onGrowData = _c === void 0 ? this._onGrowData : _c, _d = _a.resizeGroupAs, ResizeGroupAs = _d === void 0 ? ResizeGroup_1.ResizeGroup : _d;
var commandBarData = {
primaryItems: tslib_1.__spreadArray([], items, true),
overflowItems: tslib_1.__spreadArray([], overflowItems, true),
minimumOverflowItems: tslib_1.__spreadArray([], overflowItems, true).length, // for tracking
farItems: farItems,
cacheKey: this._computeCacheKey({
primaryItems: tslib_1.__spreadArray([], items, true),
overflow: overflowItems && overflowItems.length > 0,
farItems: farItems,
}),
};
this._classNames = getClassNames(styles, { theme: theme });
// ResizeGroup will render these attributes to the root <div>.
// TODO We may need to elevate classNames from <FocusZone> into <ResizeGroup> ?
var nativeProps = (0, Utilities_1.getNativeProps)(this.props, Utilities_1.divProperties);
return (React.createElement(ResizeGroupAs, tslib_1.__assign({}, nativeProps, { componentRef: this._resizeGroup, data: commandBarData, onReduceData: onReduceData, onGrowData: onGrowData, onRenderData: this._onRenderData, dataDidRender: dataDidRender })));
};
CommandBarBase.prototype.focus = function () {
var overflowSet = this._overflowSet.current;
overflowSet && overflowSet.focus();
};
CommandBarBase.prototype.remeasure = function () {
this._resizeGroup.current && this._resizeGroup.current.remeasure();
};
CommandBarBase.prototype._onButtonClick = function (item) {
return function (ev) {
// inactive is deprecated. remove check in 7.0
// eslint-disable-next-line @typescript-eslint/no-deprecated
if (item.inactive) {
return;
}
if (item.onClick) {
item.onClick(ev, item);
}
};
};
CommandBarBase.prototype._computeCacheKey = function (data) {
var primaryItems = data.primaryItems, overflow = data.overflow, farItems = data.farItems;
var returnKey = function (acc, current) {
var _a = current.cacheKey, cacheKey = _a === void 0 ? current.key : _a;
return acc + cacheKey;
};
var primaryKey = primaryItems && primaryItems.reduce(returnKey, '');
var overflowKey = overflow ? 'overflow' : '';
var farKey = farItems && farItems.reduce(returnKey, '');
return [primaryKey, overflowKey, farKey].join('');
};
CommandBarBase.defaultProps = {
items: [],
overflowItems: [],
};
return CommandBarBase;
}(React.Component));
exports.CommandBarBase = CommandBarBase;
});
//# sourceMappingURL=CommandBar.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { ICommandBarProps } from './CommandBar.types';
export declare const CommandBar: React.FunctionComponent<ICommandBarProps>;
@@ -0,0 +1,10 @@
define(["require", "exports", "../../Utilities", "./CommandBar.base", "./CommandBar.styles"], function (require, exports, Utilities_1, CommandBar_base_1, CommandBar_styles_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandBar = void 0;
// Create a CommandBar variant which uses these default styles and this styled subcomponent.
exports.CommandBar = (0, Utilities_1.styled)(CommandBar_base_1.CommandBarBase, CommandBar_styles_1.getStyles, undefined, {
scope: 'CommandBar',
});
});
//# sourceMappingURL=CommandBar.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandBar.js","sourceRoot":"../src/","sources":["components/CommandBar/CommandBar.tsx"],"names":[],"mappings":";;;;IAMA,4FAA4F;IAC/E,QAAA,UAAU,GAA8C,IAAA,kBAAM,EAIzE,gCAAc,EAAE,6BAAS,EAAE,SAAS,EAAE;QACtC,KAAK,EAAE,YAAY;KACpB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { CommandBarBase } from './CommandBar.base';\nimport { getStyles } from './CommandBar.styles';\nimport type { ICommandBarProps, ICommandBarStyleProps, ICommandBarStyles } from './CommandBar.types';\n\n// Create a CommandBar variant which uses these default styles and this styled subcomponent.\nexport const CommandBar: React.FunctionComponent<ICommandBarProps> = styled<\n ICommandBarProps,\n ICommandBarStyleProps,\n ICommandBarStyles\n>(CommandBarBase, getStyles, undefined, {\n scope: 'CommandBar',\n});\n"]}
@@ -0,0 +1,4 @@
import type { ICommandBarStyleProps, ICommandBarStyles } from './CommandBar.types';
import type { IButtonStyles } from '../../Button';
export declare const getStyles: (props: ICommandBarStyleProps) => ICommandBarStyles;
export declare const getCommandButtonStyles: (customStyles: IButtonStyles | undefined) => IButtonStyles;
@@ -0,0 +1,51 @@
define(["require", "exports", "tslib", "../../Utilities"], function (require, exports, tslib_1, Utilities_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommandButtonStyles = exports.getStyles = void 0;
var COMMAND_BAR_HEIGHT = 44;
var getStyles = function (props) {
var className = props.className, theme = props.theme;
var semanticColors = theme.semanticColors;
return {
root: [
theme.fonts.medium,
'ms-CommandBar',
{
display: 'flex',
backgroundColor: semanticColors.bodyBackground,
padding: '0 14px 0 24px',
height: COMMAND_BAR_HEIGHT,
},
className,
],
primarySet: [
'ms-CommandBar-primaryCommand',
{
flexGrow: '1',
display: 'flex',
alignItems: 'stretch',
},
],
secondarySet: [
'ms-CommandBar-secondaryCommand',
{
flexShrink: '0',
display: 'flex',
alignItems: 'stretch',
},
],
};
};
exports.getStyles = getStyles;
exports.getCommandButtonStyles = (0, Utilities_1.memoizeFunction)(function (customStyles) {
var rootStyles = {
height: '100%',
};
var labelStyles = {
whiteSpace: 'nowrap',
};
var _a = customStyles || {}, root = _a.root, label = _a.label, restCustomStyles = tslib_1.__rest(_a, ["root", "label"]);
return tslib_1.__assign(tslib_1.__assign({}, restCustomStyles), { root: root ? [rootStyles, root] : rootStyles, label: label ? [labelStyles, label] : labelStyles });
});
});
//# sourceMappingURL=CommandBar.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CommandBar.styles.js","sourceRoot":"../src/","sources":["components/CommandBar/CommandBar.styles.ts"],"names":[],"mappings":";;;;IAKA,IAAM,kBAAkB,GAAG,EAAE,CAAC;IAEvB,IAAM,SAAS,GAAG,UAAC,KAA4B;QAC5C,IAAA,SAAS,GAAY,KAAK,UAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;QAC3B,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QAEjC,OAAO;YACL,IAAI,EAAE;gBACJ,KAAK,CAAC,KAAK,CAAC,MAAM;gBAClB,eAAe;gBACf;oBACE,OAAO,EAAE,MAAM;oBACf,eAAe,EAAE,cAAc,CAAC,cAAc;oBAC9C,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,kBAAkB;iBAC3B;gBACD,SAAS;aACV;YACD,UAAU,EAAE;gBACV,8BAA8B;gBAC9B;oBACE,QAAQ,EAAE,GAAG;oBACb,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,SAAS;iBACtB;aACF;YACD,YAAY,EAAE;gBACZ,gCAAgC;gBAChC;oBACE,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,SAAS;iBACtB;aACF;SACF,CAAC;IACJ,CAAC,CAAC;IAjCW,QAAA,SAAS,aAiCpB;IAEW,QAAA,sBAAsB,GAAG,IAAA,2BAAe,EAAC,UAAC,YAAuC;QAC5F,IAAM,UAAU,GAAW;YACzB,MAAM,EAAE,MAAM;SACf,CAAC;QACF,IAAM,WAAW,GAAW;YAC1B,UAAU,EAAE,QAAQ;SACrB,CAAC;QAEF,IAAM,KAAuC,YAAY,IAAI,EAAE,EAAvD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAK,gBAAgB,sBAAlC,iBAAoC,CAAqB,CAAC;QAEhE,6CACK,gBAAgB,KACnB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAC5C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,IACjD;IACJ,CAAC,CAAC,CAAC","sourcesContent":["import { memoizeFunction } from '../../Utilities';\nimport type { ICommandBarStyleProps, ICommandBarStyles } from './CommandBar.types';\nimport type { IButtonStyles } from '../../Button';\nimport type { IStyle } from '../../Styling';\n\nconst COMMAND_BAR_HEIGHT = 44;\n\nexport const getStyles = (props: ICommandBarStyleProps): ICommandBarStyles => {\n const { className, theme } = props;\n const { semanticColors } = theme;\n\n return {\n root: [\n theme.fonts.medium,\n 'ms-CommandBar',\n {\n display: 'flex',\n backgroundColor: semanticColors.bodyBackground,\n padding: '0 14px 0 24px',\n height: COMMAND_BAR_HEIGHT,\n },\n className,\n ],\n primarySet: [\n 'ms-CommandBar-primaryCommand',\n {\n flexGrow: '1',\n display: 'flex',\n alignItems: 'stretch',\n },\n ],\n secondarySet: [\n 'ms-CommandBar-secondaryCommand',\n {\n flexShrink: '0',\n display: 'flex',\n alignItems: 'stretch',\n },\n ],\n };\n};\n\nexport const getCommandButtonStyles = memoizeFunction((customStyles: IButtonStyles | undefined): IButtonStyles => {\n const rootStyles: IStyle = {\n height: '100%',\n };\n const labelStyles: IStyle = {\n whiteSpace: 'nowrap',\n };\n\n const { root, label, ...restCustomStyles } = customStyles || {};\n\n return {\n ...restCustomStyles,\n root: root ? [rootStyles, root] : rootStyles,\n label: label ? [labelStyles, label] : labelStyles,\n };\n});\n"]}
@@ -0,0 +1,171 @@
import * as React from 'react';
import type { IContextualMenuItem } from '../../ContextualMenu';
import type { IButtonStyles, IButtonProps } from '../../Button';
import type { ICommandBarData } from './CommandBar.base';
import type { IStyle, ITheme } from '../../Styling';
import type { IRefObject, IStyleFunctionOrObject, IComponentAs } from '../../Utilities';
import type { ITooltipHostProps } from '../../Tooltip';
import type { IResizeGroupProps } from '../ResizeGroup/ResizeGroup.types';
/**
* {@docCategory CommandBar}
*/
export interface ICommandBar {
/**
* Sets focus to the active command in the list.
*/
focus(): void;
/**
* Remeasures the available space.
*/
remeasure(): void;
}
/**
* {@docCategory CommandBar}
*/
export interface ICommandBarProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Optional callback to access the ICommandBar interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
componentRef?: IRefObject<ICommandBar>;
/**
* Items to render. ICommandBarItemProps extends IContextualMenuItem.
*/
items: ICommandBarItemProps[];
/**
* Items to render on the right side (or left, in RTL). ICommandBarItemProps extends IContextualMenuItem.
*/
farItems?: ICommandBarItemProps[];
/**
* Default items to have in the overflow menu. ICommandBarItemProps extends IContextualMenuItem.
*/
overflowItems?: ICommandBarItemProps[];
/**
* Props to be passed to overflow button.
* If `menuProps` are passed through this prop, any items provided will be prepended to any
* computed overflow items.
*/
overflowButtonProps?: IButtonProps;
/**
* Custom component for the ResizeGroup.
*/
resizeGroupAs?: IComponentAs<IResizeGroupProps>;
/**
* Custom component for the overflow button.
*/
overflowButtonAs?: IComponentAs<IButtonProps>;
/**
* Custom component for the near and far item buttons. Not used for overflow menu items.
*/
buttonAs?: IComponentAs<IButtonProps>;
/**
* When true, items will be 'shifted' off the front of the array when reduced, and unshifted during grow.
*/
shiftOnReduce?: boolean;
/**
* Custom function to reduce data if items do not fit in a given space.
* Return `undefined` if no more steps can be taken to avoid an infinite loop.
*/
onReduceData?: (data: ICommandBarData) => ICommandBarData | undefined;
/**
* Custom function to grow data if items are too small for the given space.
* Return `undefined` if no more steps can be taken to avoid an infinite loop.
*/
onGrowData?: (data: ICommandBarData) => ICommandBarData | undefined;
/**
* Callback invoked when data has been reduced.
*/
onDataReduced?: (movedItem: ICommandBarItemProps) => void;
/**
* Callback invoked when data has been grown.
*/
onDataGrown?: (movedItem: ICommandBarItemProps) => void;
/**
* Function to be called every time data is rendered. It provides the data that was actually rendered.
* A use case would be adding telemetry when a particular control is shown in an overflow or dropped
* as a result of `onReduceData`, or to count the number of renders that an implementation of
* `onReduceData` triggers.
*/
dataDidRender?: (renderedData: any) => void;
/**
* Additional css class to apply to the command bar
*/
className?: string;
/**
* Accessibility text to be read by the screen reader when the user's
* focus enters the command bar. The screen reader will read this text
* after reading information about the first focusable item in the command bar.
*/
ariaLabel?: string;
/**
* When using farItems, primaryGroupAriaLabel and farItemsGroupAriaLabel function as
* labels for each group that are exposed to screen reader users.
* This helps clarify when a screen reader user is entering or leaving each group.
*/
primaryGroupAriaLabel?: string;
/**
* When using farItems, primaryGroupAriaLabel and farItemsGroupAriaLabel function as
* labels for each group that are exposed to screen reader users.
* This helps clarify when a screen reader user is entering or leaving each group.
*/
farItemsGroupAriaLabel?: string;
/**
* Customized styling that will layer on top of the variant rules.
*/
styles?: IStyleFunctionOrObject<ICommandBarStyleProps, ICommandBarStyles>;
/**
* Theme provided by HOC.
*/
theme?: ITheme;
}
/**
* ICommandBarItemProps extends IContextualMenuItem and adds a few CommandBar-specific props.
* {@docCategory CommandBar}
*/
export interface ICommandBarItemProps extends IContextualMenuItem {
/**
* Show only an icon for this item, not text.
* Does not apply if item is in the overflow.
* @defaultvalue false
*/
iconOnly?: boolean;
/**
* Props for the tooltip when in `iconOnly` mode.
*/
tooltipHostProps?: ITooltipHostProps;
/**
* Custom styles for individual button
*/
buttonStyles?: IButtonStyles;
/**
* A custom cache key to be used for this item. If `cacheKey` is changed, the cache will invalidate.
* Defaults to `key` value.
*/
cacheKey?: string;
/**
* Context under which the item is being rendered.
* This value is mutated by the CommandBar and is useful for adjusting the `onRender` function.
*/
renderedInOverflow?: boolean;
/**
* Method to override the render of the individual command bar button.
* Not used when item is rendered in overflow.
* @defaultvalue CommandBarButton
*/
commandBarButtonAs?: IComponentAs<ICommandBarItemProps>;
}
/**
* {@docCategory CommandBar}
*/
export interface ICommandBarStyleProps {
theme: ITheme;
className?: string;
}
/**
* {@docCategory CommandBar}
*/
export interface ICommandBarStyles {
root?: IStyle;
primarySet?: IStyle;
secondarySet?: IStyle;
}
@@ -0,0 +1,5 @@
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=CommandBar.types.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
export { getStyles as getCommandBarStyles, getCommandButtonStyles } from './CommandBar.styles';
export * from './CommandBar';
export * from './CommandBar.base';
export * from './CommandBar.types';
+11
View File
@@ -0,0 +1,11 @@
define(["require", "exports", "tslib", "./CommandBar.styles", "./CommandBar", "./CommandBar.base", "./CommandBar.types"], function (require, exports, tslib_1, CommandBar_styles_1, CommandBar_1, CommandBar_base_1, CommandBar_types_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCommandButtonStyles = exports.getCommandBarStyles = void 0;
Object.defineProperty(exports, "getCommandBarStyles", { enumerable: true, get: function () { return CommandBar_styles_1.getStyles; } });
Object.defineProperty(exports, "getCommandButtonStyles", { enumerable: true, get: function () { return CommandBar_styles_1.getCommandButtonStyles; } });
tslib_1.__exportStar(CommandBar_1, exports);
tslib_1.__exportStar(CommandBar_base_1, exports);
tslib_1.__exportStar(CommandBar_types_1, exports);
});
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CommandBar/index.ts"],"names":[],"mappings":";;;;IAAS,wHAAA,SAAS,OAAuB;IAAE,2HAAA,sBAAsB,OAAA;IAEjE,4CAA6B;IAC7B,iDAAkC;IAClC,kDAAmC","sourcesContent":["export { getStyles as getCommandBarStyles, getCommandButtonStyles } from './CommandBar.styles';\n\nexport * from './CommandBar';\nexport * from './CommandBar.base';\nexport * from './CommandBar.types';\n"]}