mui-spfx-controls
Version:
SPFx component library built with MUI
141 lines • 6.63 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 React = tslib_1.__importStar(require("react"));
var ReactDom = tslib_1.__importStar(require("react-dom"));
var strings = tslib_1.__importStar(require("SearchBarWebPartStrings"));
var SearchbarDisplay_1 = tslib_1.__importDefault(require("./SearchbarDisplay"));
var SearchbarWebPart = /** @class */ (function (_super) {
tslib_1.__extends(SearchbarWebPart, _super);
function SearchbarWebPart() {
return _super !== null && _super.apply(this, arguments) || this;
}
SearchbarWebPart.prototype.render = function () {
var element = React.createElement(SearchbarDisplay_1.default, {
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 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*/];
}
});
});
};
SearchbarWebPart.prototype.onDispose = function () {
ReactDom.unmountComponentAtNode(this.domElement);
};
Object.defineProperty(SearchbarWebPart.prototype, "dataVersion", {
get: function () {
return sp_core_library_1.Version.parse('1.0');
},
enumerable: false,
configurable: true
});
SearchbarWebPart.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.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)('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.PropertyPaneTextField)('scope', {
label: strings.SearchScopeFieldLabel,
}),
(0, sp_property_pane_1.PropertyPaneTextField)('excludedScope', {
label: strings.ExcludedScopeFieldLabel,
}),
],
},
],
},
],
};
};
return SearchbarWebPart;
}(sp_webpart_base_1.BaseClientSideWebPart));
exports.default = SearchbarWebPart;
//# sourceMappingURL=SearchbarWebPart.js.map