@sap-ux/ui-components
Version:
SAP UI Components Library
59 lines • 1.83 kB
JavaScript
import React from 'react';
import { Separator } from '@fluentui/react';
/**
* UISeparator component
* based on https://developer.microsoft.com/en-us/fluentui#/controls/web/separator
*
* @exports
* @class UISeparator
* @extends {React.Component<ISeparatorProps, {}>}
*/
export class UISeparator extends React.Component {
/**
* Initializes component properties.
*
* @param {ISeparatorProps} props The props
*/
constructor(props) {
super(props);
}
/**
* Render the component.
*
* @returns {JSX.Element} return a rendered component
*/
render() {
const separatorStyles = (props) => ({
...{
root: [
{
height: '100%',
width: 1,
padding: '0 10px',
selectors: {
':before': {
backgroundColor: 'var(--vscode-editorWidget-border)',
top: 1,
bottom: 1
}
}
},
props.vertical && {
height: '100%',
width: 1,
padding: '0 10px',
selectors: {
':after': {
backgroundColor: 'var(--vscode-editorWidget-border)',
top: 1,
bottom: 1
}
}
}
]
}
});
return React.createElement(Separator, { ...this.props, styles: separatorStyles });
}
}
//# sourceMappingURL=UISeparator.js.map