import * as React from 'react' ; import * as ReactDOM from 'react-dom' ; import { IPropertyPaneField , PropertyPaneFieldType } from '@microsoft/sp-webpart-base' ; import PropertyFieldLabelHost from './PropertyFieldLabelWithCalloutHost' ; import { IPropertyFieldLabelWithCalloutPropsInternal , IPropertyFieldLabelWithCalloutProps } from './IPropertyFieldLabelWithCallout' ; /**
 * Represents a PropertyFieldLabelWithCallout object
 */ class PropertyFieldLabelWithCalloutBuilder implements IPropertyPaneField < IPropertyFieldLabelWithCalloutPropsInternal > { public targetProperty : string ; public type : PropertyPaneFieldType = PropertyPaneFieldType . Custom ; public properties : IPropertyFieldLabelWithCalloutPropsInternal ; public constructor ( _targetProperty , _properties ) { this . targetProperty = _targetProperty ; this . properties = _properties ; this . properties . onRender = this . _render . bind ( this ) ; this . properties . onDispose = this . _dispose . bind ( this ) ; } private _render ( elem , context ? , changeCallback ? ) { const props = < IPropertyFieldLabelWithCalloutProps > this . properties ; const element = React . createElement ( PropertyFieldLabelHost , { ... props } ) ; ReactDOM . render ( element , elem ) ; } private _dispose ( elem ) { ReactDOM . unmountComponentAtNode ( elem ) ; } } param targetProperty param properties export function PropertyFieldLabelWithCallout ( targetProperty , properties ) { return new PropertyFieldLabelWithCalloutBuilder ( targetProperty , { ... properties , onRender : null , onDispose : null } ) ; }