Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contentWidth={contentWidth}
>
{this.wrapChildrenOnClick(children)}
{clonedButton}
);
}
}
CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
widths: Menu.Opts.widths,
};
export default CollapsibleMenu;
const cx = classNames.bind(styles);
const propTypes = {
/**
* List of CollapsibleMenuView.Item(s)/CollapsibleMenuView.ItemGroup(s)/CollapsibleMenuView.Divider(s) to be displayed as content within the Menu.
*/
children: PropTypes.node.isRequired,
/**
* Bounding container for the menu, will use window if no value provided.
*/
boundingRef: PropTypes.func,
/**
* A string representation of the width in px, limited to:
* 160, 240, 320, 640, 960, 1280, 1760, or auto
*/
contentWidth: PropTypes.oneOf(Object.keys(Menu.Opts.widths)),
/**
* Button to display the menu from
*/
button: PropTypes.element.isRequired,
};
const childContextTypes = {
isCollapsibleMenuItem: PropTypes.bool,
};
class CollapsibleMenu extends React.Component {
constructor(props) {
super(props);
this.handleRequestClose = this.handleRequestClose.bind(this);
this.wrappedOnClick = this.wrappedOnClick.bind(this);
<button>
{!!accessory && <div>{accessory}</div>}
{!!title && size !== 'tiny' && <div>{title}</div>}
{}
</button>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;
onClick={this.handleOnClick}
icon={buttonIcon}
variant="utility"
/>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;
>
{menuItems}
<button>
{!!accessory && <div>{accessory}</div>}
{!!title && size !== 'tiny' && <div>{title}</div>}
{}
</button>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;
isArrowDisplayed
isOpen={this.state.isOpen}
targetRef={this.getButtonNode}
contentWidth={contentWidth}
>
{this.wrapChildrenOnClick(children)}
{clonedButton}
);
}
}
CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
widths: Menu.Opts.widths,
};
export default CollapsibleMenu;
<button>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;
</button>
isOpen={this.state.isOpen}
targetRef={this.getButtonNode}
contentWidth={contentWidth}
>
{this.wrapChildrenOnClick(children)}
{clonedButton}
);
}
}
CollapsibleMenu.propTypes = propTypes;
CollapsibleMenu.childContextTypes = childContextTypes;
CollapsibleMenu.Item = Menu.Item;
CollapsibleMenu.ItemGroup = Menu.ItemGroup;
CollapsibleMenu.Opts = {
widths: Menu.Opts.widths,
};
export default CollapsibleMenu;
{menuItems}
<button>
{!!accessory && <div>{accessory}</div>}
{!!title && size !== 'tiny' && <div>{title}</div>}
{}
</button>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;
{...customProps}
text="Utility Menu"
onClick={this.handleOnClick}
icon={buttonIcon}
variant="utility"
/>
);
}
}
Utility.propTypes = propTypes;
Utility.defaultProps = defaultProps;
Utility.Item = Menu.Item;
Utility.ItemGroup = Menu.ItemGroup;
Utility.Divider = Menu.Divider;
Utility.Opts = Menu.Opts;
export default Utility;