UNPKG

@pnp/spfx-property-controls

Version:

Reusable property pane controls for SharePoint Framework solutions

44 lines 1.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PropertyPaneWebPartInformation = PropertyPaneWebPartInformation; const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const ReactDom = tslib_1.__importStar(require("react-dom")); const sp_property_pane_1 = require("@microsoft/sp-property-pane"); const PropertyPaneWebPartInformationHost_1 = tslib_1.__importDefault(require("./PropertyPaneWebPartInformationHost")); class PropertyPaneWebPartInformationBuilder { constructor(_properties) { this.type = sp_property_pane_1.PropertyPaneFieldType.Custom; this.properties = { key: _properties.key, moreInfoLink: _properties.moreInfoLink, moreInfoLinkTarget: _properties.moreInfoLinkTarget !== undefined ? _properties.moreInfoLinkTarget : "_blank", videoProperties: _properties.videoProperties, description: _properties.description, onRender: this.onRender.bind(this) }; } render() { if (!this.elem) { return; } this.onRender(this.elem); } // eslint-disable-next-line @typescript-eslint/no-explicit-any onRender(elem, ctx, changeCallback) { if (!this.elem) { this.elem = elem; } const element = React.createElement(PropertyPaneWebPartInformationHost_1.default, { moreInfoLink: this.properties.moreInfoLink, moreInfoLinkTarget: this.properties.moreInfoLinkTarget, description: this.properties.description, videoProperties: this.properties.videoProperties }); ReactDom.render(element, elem); } } function PropertyPaneWebPartInformation(properties) { return new PropertyPaneWebPartInformationBuilder(properties); } //# sourceMappingURL=PropertyPaneWebPartInformation.js.map