mui-spfx-controls
Version:
SPFx component library built with MUI
104 lines • 4.84 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 spfx_property_controls_1 = require("@pnp/spfx-property-controls");
var React = tslib_1.__importStar(require("react"));
var ReactDom = tslib_1.__importStar(require("react-dom"));
var strings = tslib_1.__importStar(require("ExplorerWebPartStrings"));
var ExplorerDisplay_1 = tslib_1.__importDefault(require("./ExplorerDisplay"));
var ExplorerWebPart = /** @class */ (function (_super) {
tslib_1.__extends(ExplorerWebPart, _super);
function ExplorerWebPart() {
return _super !== null && _super.apply(this, arguments) || this;
}
ExplorerWebPart.prototype.render = function () {
var element = React.createElement(ExplorerDisplay_1.default, {
context: this.context,
library: this.properties.library,
defaultDisplayType: this.properties.displayType,
});
ReactDom.render(element, this.domElement);
};
ExplorerWebPart.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*/];
}
});
});
};
ExplorerWebPart.prototype.onDispose = function () {
ReactDom.unmountComponentAtNode(this.domElement);
};
Object.defineProperty(ExplorerWebPart.prototype, "dataVersion", {
get: function () {
return sp_core_library_1.Version.parse('1.0');
},
enumerable: false,
configurable: true
});
ExplorerWebPart.prototype.getPropertyPaneConfiguration = function () {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription,
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
(0, spfx_property_controls_1.PropertyFieldListPicker)('library', {
label: 'Select a list',
selectedList: this.properties.library,
orderBy: spfx_property_controls_1.PropertyFieldListPickerOrderBy.Title,
baseTemplate: 101,
onPropertyChange: this.onPropertyPaneFieldChanged.bind(this),
listsToExclude: [
'Form Templates',
'Site Assets',
'Style Library',
'Content and Structure Reports',
'Site Pages',
'Images',
'Pages',
'_catalogs/hubsite',
],
includeListTitleAndUrl: true,
properties: this.properties,
context: this.context,
deferredValidationTime: 0,
key: 'listPickerFieldId',
}),
(0, sp_property_pane_1.PropertyPaneDropdown)('displayType', {
label: 'Select the display type',
selectedKey: 'grid',
options: [
{
key: 'list',
text: 'list',
},
{
key: 'grid',
text: 'grid',
},
],
}),
],
},
],
},
],
};
};
return ExplorerWebPart;
}(sp_webpart_base_1.BaseClientSideWebPart));
exports.default = ExplorerWebPart;
//# sourceMappingURL=ExplorerWebPart.js.map