@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
32 lines • 1.32 kB
JavaScript
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import MultiSelectDropdown from './fps-Dropdown'; // Adjust import path
/**
*
* @param props
* @returns
*/
export function PropertyPaneMultiSelectDropdown(props) {
return {
type: 1,
targetProperty: props.key,
properties: {
key: props.key,
onRender: (elem) => {
if (!elem) {
console.error('Error: Element for rendering is null or undefined');
return;
}
// Render the React component inside the DOM element
ReactDOM.render(React.createElement(MultiSelectDropdown, { key: props.key, label: props.label, description: props.description, maxVsibleRows: props.maxVsibleRows, options: props.options, multiple: props.multiple, selectedKeys: props.selectedKeys, onChange: (selectedKeys) => {
props.onChange(selectedKeys);
}, styles: { maxWidth: '250px' } }), elem);
},
onDispose: (elem) => {
// Unmount the React component on dispose
ReactDOM.unmountComponentAtNode(elem);
},
},
};
}
//# sourceMappingURL=fps-PropPaneMultiSelectDropdown.js.map