UNPKG

mui-spfx-controls

Version:
139 lines 6.32 kB
import { __awaiter, __extends, __generator } from "tslib"; import { Version } from '@microsoft/sp-core-library'; import { PropertyPaneChoiceGroup, PropertyPaneDropdown, PropertyPaneTextField, } 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 'SearchBarWebPartStrings'; import SearchbarDisplay from './SearchbarDisplay'; var SearchbarWebPart = /** @class */ (function (_super) { __extends(SearchbarWebPart, _super); function SearchbarWebPart() { return _super !== null && _super.apply(this, arguments) || this; } SearchbarWebPart.prototype.render = function () { var element = React.createElement(SearchbarDisplay, { context: this.context, label: this.properties.label, variant: this.properties.variant, size: this.properties.size, scope: this.properties.scope, color: this.properties.color, excludedScope: this.properties.excludedScope, }); ReactDom.render(element, this.domElement); }; SearchbarWebPart.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*/]; } }); }); }; SearchbarWebPart.prototype.onDispose = function () { ReactDom.unmountComponentAtNode(this.domElement); }; Object.defineProperty(SearchbarWebPart.prototype, "dataVersion", { get: function () { return Version.parse('1.0'); }, enumerable: false, configurable: true }); SearchbarWebPart.prototype.getPropertyPaneConfiguration = function () { return { pages: [ { header: { description: strings.PropertyPaneDescription, }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ PropertyPaneTextField('label', { label: strings.LabelFieldLabel, }), PropertyPaneChoiceGroup('size', { label: strings.SizeFieldLabel, options: [ { key: 'small', text: 'small', }, { key: 'medium', text: 'medium', }, ], }), PropertyPaneDropdown('variant', { label: strings.VariantFieldLabel, selectedKey: 'outlined', options: [ { key: 'outlined', text: 'outlined', }, { key: 'standard', text: 'standard', }, { key: 'filled', text: 'filled', }, ], }), PropertyPaneDropdown('color', { label: strings.ColorFieldLabel, selectedKey: 'primary', options: [ { key: 'primary', text: 'primary', }, { key: 'secondary', text: 'secondary', }, { key: 'info', text: 'info', }, { key: 'success', text: 'success', }, { key: 'warning', text: 'warning', }, { key: 'error', text: 'error', }, ], }), PropertyPaneTextField('scope', { label: strings.SearchScopeFieldLabel, }), PropertyPaneTextField('excludedScope', { label: strings.ExcludedScopeFieldLabel, }), ], }, ], }, ], }; }; return SearchbarWebPart; }(BaseClientSideWebPart)); export default SearchbarWebPart; //# sourceMappingURL=SearchbarWebPart.js.map