@sap-ux/ui-components
Version:
SAP UI Components Library
64 lines • 2.12 kB
JavaScript
import React from 'react';
import { Pivot, PivotItem } from '@fluentui/react';
export { PivotItem as UITabsItem };
export { Pivot as UIPivot };
/**
* UITabs component.
* based on https://developer.microsoft.com/en-us/fluentui#/controls/web/pivot
*
* @exports
* @class UITabs
* @extends {React.Component<IPivotProps, {}>}
*/
export class UITabs extends React.Component {
/**
* Initializes component properties.
*
* @param {UITabsProps} props
*/
constructor(props) {
super(props);
this.setTabsStyle = () => {
return {
root: {
color: 'var(--vscode-tab-activeForeground)',
borderBottom: '1px solid var(--vscode-dropdown-border)'
},
link: {
color: 'var(--vscode-tab-inactiveForeground)',
selectors: {
'&:active, &:hover': {
backgroundColor: 'transparent',
color: 'var(--vscode-tab-activeForeground)'
}
}
},
linkIsSelected: {
color: 'var(--vscode-tab-activeForeground)',
selectors: {
'&:before': {
height: 1,
transition: 'none',
left: 0,
right: 0,
backgroundColor: 'var(--vscode-inputOption-activeForeground)'
}
}
},
linkContent: {},
text: {
fontSize: 13
}
};
};
}
/**
* @returns {JSX.Element}
*/
render() {
return (React.createElement(Pivot, { ...this.props, styles: this.setTabsStyle() }, this.props.items.map((itemValue) => {
return React.createElement(PivotItem, { headerText: itemValue, key: itemValue, itemKey: itemValue });
})));
}
}
//# sourceMappingURL=UITabs.js.map