@pnp/spfx-property-controls
Version:
Reusable property pane controls for SharePoint Framework solutions
40 lines • 1.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const strings = tslib_1.__importStar(require("PropertyControlStrings"));
const telemetry = tslib_1.__importStar(require("../../common/telemetry"));
class PropertyPaneWebPartInformationHost extends React.Component {
constructor(props) {
super(props);
telemetry.track('PropertyWebPartInformation', {});
}
render() {
let iframeElm = null;
const { videoProperties } = this.props;
if (videoProperties && videoProperties.embedLink !== "") {
const linkProperties = {};
linkProperties.src = videoProperties.embedLink;
if (videoProperties.height) {
linkProperties.height = videoProperties.height;
}
if (videoProperties.width) {
linkProperties.width = videoProperties.width;
}
for (const prop in videoProperties.properties) {
if (Object.prototype.hasOwnProperty.call(videoProperties.properties, prop)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
linkProperties[prop] = this.props.videoProperties.properties[prop];
}
}
iframeElm = React.createElement("iframe", Object.assign({}, linkProperties));
}
return (React.createElement("div", null,
React.createElement("div", { dangerouslySetInnerHTML: { __html: this.props.description } }),
this.props.moreInfoLink && (React.createElement("div", null,
React.createElement("a", { href: this.props.moreInfoLink, target: this.props.moreInfoLinkTarget }, strings.MoreInfoLabel))),
iframeElm));
}
}
exports.default = PropertyPaneWebPartInformationHost;
//# sourceMappingURL=PropertyPaneWebPartInformationHost.js.map