UNPKG

mui-spfx-controls

Version:
67 lines 2.62 kB
import { __awaiter, __extends, __generator } from "tslib"; import { Version } from '@microsoft/sp-core-library'; import { PropertyPaneToggle, } from '@microsoft/sp-property-pane'; import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base'; import * as React from 'react'; import * as ReactDom from 'react-dom'; import * as strings from 'CodeEditorWebPartStrings'; import CodeEditorDisplay from './CodeEditorDisplay'; var CodeEditorWebPart = /** @class */ (function (_super) { __extends(CodeEditorWebPart, _super); function CodeEditorWebPart() { return _super !== null && _super.apply(this, arguments) || this; } CodeEditorWebPart.prototype.render = function () { var element = React.createElement(CodeEditorDisplay, { renderControls: this.properties.renderControls, }); ReactDom.render(element, this.domElement); }; CodeEditorWebPart.prototype.onInit = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, _super.prototype.onInit.call(this)]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; CodeEditorWebPart.prototype.onDispose = function () { ReactDom.unmountComponentAtNode(this.domElement); }; Object.defineProperty(CodeEditorWebPart.prototype, "dataVersion", { get: function () { return Version.parse('1.0'); }, enumerable: false, configurable: true }); CodeEditorWebPart.prototype.getPropertyPaneConfiguration = function () { return { pages: [ { header: { description: strings.PropertyPaneDescription, }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ PropertyPaneToggle('renderControls', { checked: this.properties.renderControls, label: strings.RenderInputFieldLabel, }), ], }, ], }, ], }; }; return CodeEditorWebPart; }(BaseClientSideWebPart)); export default CodeEditorWebPart; //# sourceMappingURL=CodeEditorWebPart.js.map