External module "core/CvMenuItem"
Variables
CvMenuItem
Cv
MenuItem: ClassicComponentClass < CvMenuItemProps > = React.createClass<CvMenuItemProps, CvMenuItemState>({mixins: [CvBaseMixin, CvActionBase, CvMenuItemBase],componentDidMount: function() {this._componentDidMount();},componentWillReceiveProps: function(nextProps) {this._componentWillReceiveProps(nextProps);},getDefaultProps: function () {return {actionId: null,fireOnLoad:null,paneContext: null,navTarget: null,menuDef: null,actionListeners: [],navigationListeners: [],stateChangeListeners:[],parentMenuItem: null,subMenuItemRenderer: null,selectionProvider: null,renderer:null,wrapperElemName:'span',wrapperElemProps:{},wrapperEventHandlerName:'onClick',actionHandler:null}},getInitialState: function() {return this._getInitialState();},parentMenuDef: function() {return this.props.parentMenuItem || this.firstInScope(MenuDef);},render: function() {const menuDef = this.menuDef();if(menuDef) {/* render me (this.menuDef) *//* showOnMenu and displayMode values apply here */if(this.props.renderer) {return this._shouldRender(menuDef) ?this.props.renderer(this.getChildContext().cvContext, this._getCallbackObj()) : null;/* render me - the markup with a 'click' wrapper *//* showOnMenu and displayMode values apply here */} else if(React.Children.count(this.props.children) > 0) {if(this._shouldRender(menuDef)) {const props = ObjUtil.addAllProps(this.props.wrapperElemProps, {});props[this.props.wrapperEventHandlerName] = this.performAction;return React.createElement(this.props.wrapperElemName, props, this.props.children);} else {return null;}/* render child menuDefs (this.menuDef.menuDefs) */} else if (this.props.subMenuItemRenderer) {let newChildren = [];menuDef.menuDefs.forEach((md:MenuDef, i:number)=> {newChildren.push(React.cloneElement(this.props.subMenuItemRenderer(this.getChildContext().cvContext, md), {key:md.name + i}));});return React.createElement(this.props.wrapperElemName, this.props.wrapperElemProps, newChildren);} else {return null;}//render all menuDefs of my parent (i.e. wildcard)}else if(!this.props.actionId && this.props.renderer) {const parentMenuDef:MenuDef = this.parentMenuDef();if(parentMenuDef && parentMenuDef.menuDefs && parentMenuDef.menuDefs.length > 0) {let newChildren = [];parentMenuDef.menuDefs.forEach((md:MenuDef, i:number)=> {newChildren.push(<CvMenuItem {...this.props} menuDef={md} key={md.actionId + i}/>);});return React.createElement(this.props.wrapperElemName, this.props.wrapperElemProps, newChildren);} else {return null;}} else {return null;}},_shouldRender: function(menuDef:MenuDef):boolean {if(!menuDef.showOnMenu) {return false;}const paneContext = this.paneContext();if(paneContext && paneContext instanceof EditorContext) {if(menuDef.isRead && menuDef.isWrite) {return true;} else if(menuDef.isRead) {return (paneContext as EditorContext).isReadMode;} else if(menuDef.isWrite){return (paneContext as EditorContext).isWriteMode;} else {return false;}} else {return true;}}})
Defined in core/CvMenuItem.tsx:60
Object literals
CvMenuItemBase
CvMenuItemBase: object
Defined in core/CvMenuItem.tsx:11
getChildContext
Defined in core/CvMenuItem.tsx:13
Returns any
Legend
Module
Object literal
Variable
Function
Function with type parameter
Index signature
Type alias
Enumeration
Enumeration member
Property
Method
Interface
Interface with type parameter
Constructor
Property
Method
Index signature
Class
Class with type parameter
Constructor
Property
Method
Accessor
Index signature
Inherited constructor
Inherited property
Inherited method
Inherited accessor
Protected property
Protected method
Protected accessor
Private property
Private method
Private accessor
Static property
Static method
There are several ways to use CvMenuItem