Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/CvViewDesc"

Index

Variables

CvViewDesc

CvViewDesc: ClassicComponentClass<CvViewDescProps> = React.createClass<CvViewDescProps, CvViewDescState>({mixins: [CvBaseMixin],componentDidMount: function() {},getChildContext: function () {const ctx = this.getDefaultChildContext();ctx.cvContext.scopeCtx.scopeObj = this.viewDesc();return ctx;},getDefaultProps: function () {return {paneContext: null,actionListeners: [],stateChangeListeners: [],navigationListeners: [],navTarget: null,viewDesc: null,renderer: null,wrapperElemName: 'span',wrapperElemProps: {},wrapperEventHandlerName: 'onClick',}},openView: function(resultCallback?:CvResultCallback<Either<PaneContext, NavRequest>>) {(CvViewDesc as any).openView(this.viewDesc(),this.paneContext(),this.eventRegistry(),this.catavolt(),this.props.actionListeners,this.props.stateChangeListeners,this.props.navigationListeners,this.props.navTarget,resultCallback);},paneContext: function ():PaneContext {var paneContext:PaneContext = null;if (this.props.paneContext) {paneContext = this.props.paneContext;} else {paneContext = this.findPaneContext();}return paneContext;},render: function () {if(this.viewDesc()) {if (this.props.renderer) {return this.props.renderer(this.getChildContext().cvContext, this._getCallbackObj())} else if (this.props.children) {const props = ObjUtil.addAllProps(this.props.wrapperElemProps, {});props[this.props.wrapperEventHandlerName] = ()=>{this.openView()};return React.createElement(this.props.wrapperElemName, props, this.props.children);} else {return null;}} else {return null;}},viewDesc: function():ViewDesc {return this.props.viewDesc;},_getCallbackObj: function ():CvViewDescCallback {return {openView: (resultCallback?:CvResultCallback<Either<PaneContext, NavRequest>>):void => {this.openView(resultCallback);}}},statics : {publishStateChange: function (paneContext:PaneContext, eventRegistry:CvEventRegistry,stateChangeListeners?:Array<(event:CvEvent<CvStateChangeResult>)=>void>) {if (paneContext) {const event:CvEvent<CvStateChangeResult> ={type: CvEventType.STATE_CHANGE,resourceId: null,eventObj: {source: paneContext, type: CvStateChangeType.PANE_DEF_CHANGE}};eventRegistry.publish(event, false)stateChangeListeners.forEach(listener=> {listener(event)});}},publishNavigation: function(navRequest:NavRequest, actionId:string,paneContext:PaneContext, catavolt:AppContext, eventRegistry:CvEventRegistry,navigationListeners:Array<(event:CvEvent<CvNavigationResult>)=>void>, navTarget:string) {const e:CvEvent<CvNavigationResult> =CvNavigationResultUtil.publishNavigation(catavolt, eventRegistry, navRequest,actionId, null, navTarget, navigationListeners,paneContext.isDestroyed, false);},publishError: function(failure:any, eventRegistry:CvEventRegistry) {const event:CvEvent<CvMessage> = {type:CvEventType.MESSAGE, eventObj:{message:'Change View Failed',messageObj:failure, type: CvMessageType.ERROR}}eventRegistry.publish(event, false);},openView: function(viewDesc:ViewDesc, paneContext:PaneContext,eventRegistry:CvEventRegistry,catavolt:AppContext,actionListeners:Array<(event:CvEvent<CvActionFiredResult>)=>void>,stateChangeListeners:Array<(event:CvEvent<CvStateChangeResult>)=>void>,navigationListeners:Array<(event:CvEvent<CvNavigationResult>)=>void>,navTarget:string,resultCallback?:CvResultCallback<Either<PaneContext, NavRequest>>) {const actionId = '#viewChange';CvActionBase._publishActionStarted(actionId, paneContext, false, actionListeners, eventRegistry);paneContext.openView(viewDesc).onComplete((openViewTry:Try<Either<PaneContext, NavRequest>>)=> {CvActionBase._publishActionFinished(actionId, paneContext, actionListeners, eventRegistry);if (openViewTry.isFailure) {if (resultCallback) resultCallback(null, openViewTry.failure);(CvViewDesc as any).publishError(openViewTry.failure, eventRegistry);} else {if (resultCallback) resultCallback(openViewTry.success);if(openViewTry.success.isLeft) {(CvViewDesc as any).publishStateChange(openViewTry.success.left, eventRegistry, stateChangeListeners);} else {(CvViewDesc as any).publishNavigation(openViewTry.success.right, actionId, paneContext, catavolt,eventRegistry, navigationListeners, navTarget);}}});},}})

Generated using TypeDoc