MCPcopy Index your code
hub / github.com/microsoft/SandDance / Dropdown

Function Dropdown

docs/app/js/sanddance-app.js:568–584  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

566var _base = require("../base");
567const dropdownWidth = 200;
568function Dropdown(props) {
569 const newProps = Object.assign({}, props);
570 let selectedKey = null;
571 if (newProps.options && newProps.options.length > 1) {
572 const selectedOptions = newProps.options.filter((option)=>option.selected);
573 if (selectedOptions && selectedOptions.length > 0) selectedKey = selectedOptions[0].key;
574 }
575 if (newProps.collapseLabel) newProps.onRenderTitle = (a, b)=>{
576 return (0, _base.base).react.createElement("span", null, newProps.label, ": ", a[0].text);
577 };
578 return (0, _base.base).react.createElement((0, _base.base).fluentUI.Dropdown, Object.assign({
579 dropdownWidth: dropdownWidth
580 }, newProps, {
581 label: newProps.collapseLabel ? null : newProps.label,
582 selectedKey: selectedKey
583 }));
584}
585
586},{"../base":"b6Cy1","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"jA2du":[function(require,module,exports) {
587exports.interopDefault = function(a) {

Callers

nothing calls this directly

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected