mui-spfx-controls
Version:
SPFx component library built with MUI
187 lines • 9.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var sp_core_library_1 = require("@microsoft/sp-core-library");
var sp_property_pane_1 = require("@microsoft/sp-property-pane");
var sp_webpart_base_1 = require("@microsoft/sp-webpart-base");
var strings = tslib_1.__importStar(require("PeoplePickerWebPartStrings"));
var React = tslib_1.__importStar(require("react"));
var ReactDom = tslib_1.__importStar(require("react-dom"));
var PeoplePickerDisplay_1 = tslib_1.__importDefault(require("./PeoplePickerDisplay"));
var PeoplePickerWebPart = /** @class */ (function (_super) {
tslib_1.__extends(PeoplePickerWebPart, _super);
function PeoplePickerWebPart() {
return _super !== null && _super.apply(this, arguments) || this;
}
PeoplePickerWebPart.prototype.render = function () {
var element = React.createElement(PeoplePickerDisplay_1.default, {
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 tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__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 sp_core_library_1.Version.parse('1.0');
},
enumerable: false,
configurable: true
});
PeoplePickerWebPart.prototype.getPropertyPaneConfiguration = function () {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription,
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
(0, sp_property_pane_1.PropertyPaneTextField)('label', {
label: strings.LabelFieldLabel,
}),
(0, sp_property_pane_1.PropertyPaneChoiceGroup)('size', {
label: strings.SizeFieldLabel,
options: [
{
key: 'small',
text: 'small',
},
{
key: 'medium',
text: 'medium',
},
],
}),
(0, sp_property_pane_1.PropertyPaneToggle)('disabled', {
label: strings.DisabledFieldLabel,
}),
(0, sp_property_pane_1.PropertyPaneDropdown)('variant', {
label: strings.VariantFieldLabel,
selectedKey: 'outlined',
options: [
{
key: 'outlined',
text: 'outlined',
},
{
key: 'standard',
text: 'standard',
},
{
key: 'filled',
text: 'filled',
},
],
}),
(0, sp_property_pane_1.PropertyPaneDropdown)('tagVariant', {
label: strings.TagVariantFieldLabel,
selectedKey: 'filled',
options: [
{
key: 'outlined',
text: 'outlined',
},
{
key: 'filled',
text: 'filled',
},
],
}),
(0, sp_property_pane_1.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',
},
],
}),
(0, sp_property_pane_1.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;
}(sp_webpart_base_1.BaseClientSideWebPart));
exports.default = PeoplePickerWebPart;
//# sourceMappingURL=PeoplePickerWebPart.js.map