@nodeject/ui-components
Version:
UI library for non-trivial components
24 lines (23 loc) • 1.24 kB
JavaScript
import * as React from 'react';
import { hasChildren } from '../../Graph';
import styles from './ExpandCollapseButton.module.less';
export var ExpandCollapseButton = function (props) {
return (props.canCollapse &&
hasChildren(props.node) && (React.createElement("div", { className: styles.expandCollapse },
React.createElement("label", { className: styles.faPlus + ' anticon anticon-plus-square-o', style: {
position: 'absolute',
marginLeft: '.7em',
marginTop: '-.1em',
backgroundColor: 'white'
}, htmlFor: hasChildren(props.node) && props.node.data().id, onClick: function (e) {
return props.onCollapseExpandNode(props.node.data.id);
} }),
React.createElement("label", { className: styles.faMinus + ' anticon anticon-minus-square-o', style: {
position: 'absolute',
marginLeft: '.7em',
marginTop: '-.1em',
backgroundColor: 'white'
}, htmlFor: hasChildren(props.node) && props.node.data().id, onClick: function (e) {
return props.onCollapseExpandNode(props.node.data.id);
} }))));
};