UNPKG

mui-spfx-controls

Version:
176 lines 9.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = tslib_1.__importStar(require("react")); var ReactDom = tslib_1.__importStar(require("react-dom")); 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 strings = tslib_1.__importStar(require("ListItemPickerWebPartStrings")); var ListItemPickerDisplay_1 = tslib_1.__importDefault(require("./ListItemPickerDisplay")); var ListItemPickerWebPart = /** @class */ (function (_super) { tslib_1.__extends(ListItemPickerWebPart, _super); function ListItemPickerWebPart() { return _super !== null && _super.apply(this, arguments) || this; } ListItemPickerWebPart.prototype.render = function () { var element = React.createElement(ListItemPickerDisplay_1.default, { context: this.context, list: this.properties.list, fields: this.properties.fields, displayField: this.properties.displayField, searchSuggestionLimit: this.properties.searchSuggestionLimit, label: this.properties.label, disabled: this.properties.disabled, size: this.properties.size, color: this.properties.color, variant: this.properties.variant, }); ReactDom.render(element, this.domElement); }; ListItemPickerWebPart.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*/]; } }); }); }; ListItemPickerWebPart.prototype.onDispose = function () { ReactDom.unmountComponentAtNode(this.domElement); }; Object.defineProperty(ListItemPickerWebPart.prototype, "dataVersion", { get: function () { return sp_core_library_1.Version.parse('1.0'); }, enumerable: false, configurable: true }); ListItemPickerWebPart.prototype.getPropertyPaneConfiguration = function () { return { pages: [ { header: { description: strings.PropertyPaneDescription, }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ (0, spfx_property_controls_1.PropertyFieldListPicker)('list', { label: strings.ListFieldLabel, selectedList: this.properties.list, includeHidden: false, orderBy: spfx_property_controls_1.PropertyFieldListPickerOrderBy.Title, disabled: false, onPropertyChange: this.onPropertyPaneFieldChanged.bind(this), properties: this.properties, context: this.context, key: 'listPickerFieldId', }), (0, spfx_property_controls_1.PropertyFieldColumnPicker)('fields', { label: strings.ColumnsFieldLabel, context: this.context, selectedColumn: this.properties.fields, listId: this.properties.list, disabled: false, orderBy: spfx_property_controls_1.PropertyFieldColumnPickerOrderBy.Title, onPropertyChange: this.onPropertyPaneFieldChanged.bind(this), properties: this.properties, deferredValidationTime: 0, key: 'columnPickerFieldId', displayHiddenColumns: false, columnReturnProperty: spfx_property_controls_1.IColumnReturnProperty['Internal Name'], multiSelect: true, }), (0, sp_property_pane_1.PropertyPaneTextField)('displayField', { label: strings.OptionDisplayFieldLabel, }), (0, spfx_property_controls_1.PropertyFieldNumber)('searchSuggestionLimit', { key: 'numberPickerFieldId', label: strings.SearchSuggestionLimitFieldLabel, value: this.properties.searchSuggestionLimit, }), (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)('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', }, ], }), ], }, ], }, ], }; }; return ListItemPickerWebPart; }(sp_webpart_base_1.BaseClientSideWebPart)); exports.default = ListItemPickerWebPart; //# sourceMappingURL=ListItemPickerWebPart.js.map