UNPKG

mui-spfx-controls

Version:
185 lines 8.73 kB
import { __awaiter, __extends, __generator } from "tslib"; import { Version } from '@microsoft/sp-core-library'; import { PropertyPaneChoiceGroup, PropertyPaneDropdown, PropertyPaneTextField, PropertyPaneToggle, } from '@microsoft/sp-property-pane'; import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base'; import * as strings from 'PeoplePickerWebPartStrings'; import * as React from 'react'; import * as ReactDom from 'react-dom'; import PeoplePickerDisplay from './PeoplePickerDisplay'; var PeoplePickerWebPart = /** @class */ (function (_super) { __extends(PeoplePickerWebPart, _super); function PeoplePickerWebPart() { return _super !== null && _super.apply(this, arguments) || this; } PeoplePickerWebPart.prototype.render = function () { var element = React.createElement(PeoplePickerDisplay, { context: this.context, label: this.properties.label, size: this.properties.size, disabled: this.properties.disabled, variant: this.properties.variant, tagVariant: this.properties.tagVariant, color: this.properties.color, tagColor: this.properties.tagColor, }); ReactDom.render(element, this.domElement); }; PeoplePickerWebPart.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*/]; } }); }); }; PeoplePickerWebPart.prototype.onDispose = function () { ReactDom.unmountComponentAtNode(this.domElement); }; Object.defineProperty(PeoplePickerWebPart.prototype, "dataVersion", { get: function () { return Version.parse('1.0'); }, enumerable: false, configurable: true }); PeoplePickerWebPart.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', }, ], }), PropertyPaneToggle('disabled', { label: strings.DisabledFieldLabel, }), PropertyPaneDropdown('variant', { label: strings.VariantFieldLabel, selectedKey: 'outlined', options: [ { key: 'outlined', text: 'outlined', }, { key: 'standard', text: 'standard', }, { key: 'filled', text: 'filled', }, ], }), PropertyPaneDropdown('tagVariant', { label: strings.TagVariantFieldLabel, selectedKey: 'filled', options: [ { key: 'outlined', text: 'outlined', }, { 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', }, ], }), PropertyPaneDropdown('tagColor', { label: strings.TagColorFieldLabel, selectedKey: 'default', options: [ { key: 'default', text: 'default', }, { key: 'primary', text: 'primary', }, { key: 'secondary', text: 'secondary', }, { key: 'info', text: 'info', }, { key: 'success', text: 'success', }, { key: 'warning', text: 'warning', }, { key: 'error', text: 'error', }, ], }), ], }, ], }, ], }; }; return PeoplePickerWebPart; }(BaseClientSideWebPart)); export default PeoplePickerWebPart; //# sourceMappingURL=PeoplePickerWebPart.js.map