import * as React from 'react' ; import * as ReactDom from 'react-dom' ; import { IPropertyPaneMarkdownContentProps , IPropertyPaneMarkdownContentPropsInternal } from "./IPropertyPaneMarkdownContent" ; import { IPropertyPaneMarkdownContentHostProps } from './IPropertyPaneMarkdownContentHost' ; import PropertyPaneMarkdownContentHost from './PropertyPaneMarkdownContentHost' ; import { IPropertyPaneField , PropertyPaneFieldType } from '@microsoft/sp-webpart-base' ; class PropertyPaneMarkdownContentBuilder implements IPropertyPaneField < IPropertyPaneMarkdownContentProps > { public targetProperty : string ; public type : PropertyPaneFieldType = PropertyPaneFieldType . Custom ; public properties : IPropertyPaneMarkdownContentPropsInternal ; private elem : HTMLElement ; public constructor ( _properties ) { this . properties = { key : _properties . key , label : _properties . label , markdown : _properties . markdown , options : _properties . options , onRender : this . onRender . bind ( this ) , } ; } public render ( ) { if ( ! this . elem ) { return ; } this . onRender ( this . elem ) ; } private onRender ( elem , ctx ? , changeCallback ? ) { if ( ! this . elem ) { this . elem = elem ; } const element = React . createElement ( PropertyPaneMarkdownContentHost , { description : this . properties . label , markdown : this . properties . markdown , markdownProps : this . properties . options } ) ; ReactDom . render ( element , elem ) ; } } param properties export function PropertyPaneMarkdownContent ( properties ) { return new PropertyPaneMarkdownContentBuilder ( properties ) ; }