@salesforce/design-system-react 0.10.39 → 0.10.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,16 +58,16 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
58
58
  * _Tested with Mocha testing._
59
59
  */
60
60
  events?: Partial<{
61
- onBlur?: (v: any) => any;
62
- onChange?: (v: any) => any;
63
- onClose?: (v: any) => any;
64
- onFocus?: (v: any) => any;
65
- onOpen?: (v: any) => any;
66
- onRequestClose?: (v: any) => any;
67
- onRequestOpen?: (v: any) => any;
68
- onRequestRemoveSelectedOption?: (v: any) => any;
69
- onSelect?: (v: any) => any;
70
- onSubmit?: (v: any) => any;
61
+ onBlur?: (event: React.SyntheticEvent) => any;
62
+ onChange?: (event: React.SyntheticEvent, v: any) => any;
63
+ onClose?: (event: React.SyntheticEvent, v: any) => any;
64
+ onFocus?: (event: React.SyntheticEvent, v: any) => any;
65
+ onOpen?: (event: React.SyntheticEvent, v: any) => any;
66
+ onRequestClose?: (event: React.SyntheticEvent, v: any) => any;
67
+ onRequestOpen?: (event: React.SyntheticEvent, v: any) => any;
68
+ onRequestRemoveSelectedOption?: (event: React.SyntheticEvent, v: any) => any;
69
+ onSelect?: (event: React.SyntheticEvent, v: any) => any;
70
+ onSubmit?: (event: React.SyntheticEvent, v: any) => any;
71
71
  }>;
72
72
  /**
73
73
  * Message to display when the input is in an error state. When this is present, also visually highlights the component as in error. _Tested with snapshot testing._
@@ -183,7 +183,7 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
183
183
  label?: string;
184
184
  subTitle?: string;
185
185
  type?: string;
186
- disabled?: booleanean;
186
+ disabled?: boolean;
187
187
  tooltipContent?: React.ReactNode;
188
188
  }>[];
189
189
  /**
@@ -743,18 +743,17 @@ class MenuDropdown extends React.Component {
743
743
 
744
744
  handleKeyDown = (event) => {
745
745
  if (event.keyCode) {
746
- if (
746
+ if (event.keyCode === KEYS.TAB) {
747
+ this.handleCancel();
748
+ } else if (
747
749
  event.keyCode === KEYS.ENTER ||
748
750
  event.keyCode === KEYS.SPACE ||
749
751
  event.keyCode === KEYS.DOWN ||
750
- event.keyCode === KEYS.UP
752
+ event.keyCode === KEYS.UP ||
753
+ event.keyCode === KEYS.ESCAPE
751
754
  ) {
752
755
  EventUtil.trap(event);
753
- }
754
-
755
- if (event.keyCode !== KEYS.TAB) {
756
756
  const isOpen = this.getIsOpen();
757
-
758
757
  this.handleKeyboardNavigate({
759
758
  event,
760
759
  isOpen,
@@ -764,8 +763,6 @@ class MenuDropdown extends React.Component {
764
763
  target: event.target,
765
764
  toggleOpen: this.toggleOpen,
766
765
  });
767
- } else {
768
- this.handleCancel();
769
766
  }
770
767
 
771
768
  if (this.props.onKeyDown) {
@@ -20,7 +20,7 @@ declare module '@salesforce/design-system-react/components/setup-assistant' {
20
20
  /**
21
21
  * Function to handle opening / closing of steps when the step is expandable. Passes event object and step `index`, `isOpen`, and `step` props as data.
22
22
  */
23
- onStepToggleIsOpen?: (v: any) => any;
23
+ onStepToggleIsOpen?: (event: React.SyntheticEvent, v: any) => any;
24
24
  /**
25
25
  * Accepts a progress bar component, which will only be visible if `isCard` is enabled
26
26
  */
@@ -58,16 +58,16 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
58
58
  * _Tested with Mocha testing._
59
59
  */
60
60
  events?: Partial<{
61
- onBlur?: (v: any) => any;
62
- onChange?: (v: any) => any;
63
- onClose?: (v: any) => any;
64
- onFocus?: (v: any) => any;
65
- onOpen?: (v: any) => any;
66
- onRequestClose?: (v: any) => any;
67
- onRequestOpen?: (v: any) => any;
68
- onRequestRemoveSelectedOption?: (v: any) => any;
69
- onSelect?: (v: any) => any;
70
- onSubmit?: (v: any) => any;
61
+ onBlur?: (event: React.SyntheticEvent) => any;
62
+ onChange?: (event: React.SyntheticEvent, v: any) => any;
63
+ onClose?: (event: React.SyntheticEvent, v: any) => any;
64
+ onFocus?: (event: React.SyntheticEvent, v: any) => any;
65
+ onOpen?: (event: React.SyntheticEvent, v: any) => any;
66
+ onRequestClose?: (event: React.SyntheticEvent, v: any) => any;
67
+ onRequestOpen?: (event: React.SyntheticEvent, v: any) => any;
68
+ onRequestRemoveSelectedOption?: (event: React.SyntheticEvent, v: any) => any;
69
+ onSelect?: (event: React.SyntheticEvent, v: any) => any;
70
+ onSubmit?: (event: React.SyntheticEvent, v: any) => any;
71
71
  }>;
72
72
  /**
73
73
  * Message to display when the input is in an error state. When this is present, also visually highlights the component as in error. _Tested with snapshot testing._
@@ -183,7 +183,7 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
183
183
  label?: string;
184
184
  subTitle?: string;
185
185
  type?: string;
186
- disabled?: booleanean;
186
+ disabled?: boolean;
187
187
  tooltipContent?: React.ReactNode;
188
188
  }>[];
189
189
  /**
@@ -759,11 +759,11 @@ var MenuDropdown = /*#__PURE__*/function (_React$Component) {
759
759
 
760
760
  _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
761
761
  if (event.keyCode) {
762
- if (event.keyCode === _keyCode.default.ENTER || event.keyCode === _keyCode.default.SPACE || event.keyCode === _keyCode.default.DOWN || event.keyCode === _keyCode.default.UP) {
762
+ if (event.keyCode === _keyCode.default.TAB) {
763
+ _this.handleCancel();
764
+ } else if (event.keyCode === _keyCode.default.ENTER || event.keyCode === _keyCode.default.SPACE || event.keyCode === _keyCode.default.DOWN || event.keyCode === _keyCode.default.UP || event.keyCode === _keyCode.default.ESCAPE) {
763
765
  _event.default.trap(event);
764
- }
765
766
 
766
- if (event.keyCode !== _keyCode.default.TAB) {
767
767
  var isOpen = _this.getIsOpen();
768
768
 
769
769
  _this.handleKeyboardNavigate({
@@ -775,8 +775,6 @@ var MenuDropdown = /*#__PURE__*/function (_React$Component) {
775
775
  target: event.target,
776
776
  toggleOpen: _this.toggleOpen
777
777
  });
778
- } else {
779
- _this.handleCancel();
780
778
  }
781
779
 
782
780
  if (_this.props.onKeyDown) {
@@ -20,7 +20,7 @@ declare module '@salesforce/design-system-react/components/setup-assistant' {
20
20
  /**
21
21
  * Function to handle opening / closing of steps when the step is expandable. Passes event object and step `index`, `isOpen`, and `step` props as data.
22
22
  */
23
- onStepToggleIsOpen?: (v: any) => any;
23
+ onStepToggleIsOpen?: (event: React.SyntheticEvent, v: any) => any;
24
24
  /**
25
25
  * Accepts a progress bar component, which will only be visible if `isCard` is enabled
26
26
  */
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-system-react",
3
- "version": "0.10.39",
3
+ "version": "0.10.40",
4
4
  "description": "Salesforce Lightning Design System for React",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "engines": {},
@@ -58,16 +58,16 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
58
58
  * _Tested with Mocha testing._
59
59
  */
60
60
  events?: Partial<{
61
- onBlur?: (v: any) => any;
62
- onChange?: (v: any) => any;
63
- onClose?: (v: any) => any;
64
- onFocus?: (v: any) => any;
65
- onOpen?: (v: any) => any;
66
- onRequestClose?: (v: any) => any;
67
- onRequestOpen?: (v: any) => any;
68
- onRequestRemoveSelectedOption?: (v: any) => any;
69
- onSelect?: (v: any) => any;
70
- onSubmit?: (v: any) => any;
61
+ onBlur?: (event: React.SyntheticEvent) => any;
62
+ onChange?: (event: React.SyntheticEvent, v: any) => any;
63
+ onClose?: (event: React.SyntheticEvent, v: any) => any;
64
+ onFocus?: (event: React.SyntheticEvent, v: any) => any;
65
+ onOpen?: (event: React.SyntheticEvent, v: any) => any;
66
+ onRequestClose?: (event: React.SyntheticEvent, v: any) => any;
67
+ onRequestOpen?: (event: React.SyntheticEvent, v: any) => any;
68
+ onRequestRemoveSelectedOption?: (event: React.SyntheticEvent, v: any) => any;
69
+ onSelect?: (event: React.SyntheticEvent, v: any) => any;
70
+ onSubmit?: (event: React.SyntheticEvent, v: any) => any;
71
71
  }>;
72
72
  /**
73
73
  * Message to display when the input is in an error state. When this is present, also visually highlights the component as in error. _Tested with snapshot testing._
@@ -183,7 +183,7 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
183
183
  label?: string;
184
184
  subTitle?: string;
185
185
  type?: string;
186
- disabled?: booleanean;
186
+ disabled?: boolean;
187
187
  tooltipContent?: React.ReactNode;
188
188
  }>[];
189
189
  /**
@@ -725,11 +725,11 @@ var MenuDropdown = /*#__PURE__*/function (_React$Component) {
725
725
 
726
726
  _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
727
727
  if (event.keyCode) {
728
- if (event.keyCode === KEYS.ENTER || event.keyCode === KEYS.SPACE || event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP) {
728
+ if (event.keyCode === KEYS.TAB) {
729
+ _this.handleCancel();
730
+ } else if (event.keyCode === KEYS.ENTER || event.keyCode === KEYS.SPACE || event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP || event.keyCode === KEYS.ESCAPE) {
729
731
  EventUtil.trap(event);
730
- }
731
732
 
732
- if (event.keyCode !== KEYS.TAB) {
733
733
  var isOpen = _this.getIsOpen();
734
734
 
735
735
  _this.handleKeyboardNavigate({
@@ -741,8 +741,6 @@ var MenuDropdown = /*#__PURE__*/function (_React$Component) {
741
741
  target: event.target,
742
742
  toggleOpen: _this.toggleOpen
743
743
  });
744
- } else {
745
- _this.handleCancel();
746
744
  }
747
745
 
748
746
  if (_this.props.onKeyDown) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../.tmp-es/components/menu-dropdown/menu-dropdown.jsx"],"names":["React","PropTypes","ReactDOM","requiredIf","classNames","isFunction","isEqual","shortid","Dialog","List","ListItem","ListItemLabel","DefaultTrigger","checkProps","componentDoc","EventUtil","KeyBuffer","keyboardNavigate","KEYS","MENU_DROPDOWN","MENU_DROPDOWN_TRIGGER","LIST","IconSettingsContext","documentDefined","document","overlay","createElement","style","top","left","width","height","position","currentOpenDropdown","DropdownNubbinPositions","noop","itemIsSelectable","item","type","disabled","getNavigableItems","items","navigableItems","indexes","keyBuffer","Array","isArray","forEach","index","push","text","label","toLowerCase","getMenu","componentRef","findDOMNode","querySelector","getMenuItem","menuItemId","context","menuItem","getElementById","DropdownToDialogNubbinMapping","bottom","propTypes","align","oneOf","assistiveText","object","buttonClassName","oneOfType","array","string","buttonInverse","bool","buttonVariant","checkmark","children","node","className","containerClassName","hasStaticAlignment","hint","hoverCloseDelay","number","iconCategory","props","iconName","iconPosition","iconVariant","iconSize","id","inverse","isOpen","listItemRenderer","func","length","menuPosition","menuStyle","nubbinPosition","onBlur","onClick","onFocus","openOn","onKeyDown","onMouseDown","onMouseEnter","onMouseLeave","onSelect","onOpen","onClose","options","tabIndex","value","tooltip","tooltipMenuItem","triggerClassName","multiple","defaultProps","MenuDropdown","generatedId","state","foundIndex","some","element","undefined","menuId","getId","isHover","isUnmounting","trigger","focus","list","listItems","nextProps","values","currentIndices","filter","getIndexByValue","map","selectedIndices","selectedIndex","triggerRendered","setState","requestFocus","onRequestFocus","triggerContainer","listItem","focusedIndex","handleKeyboardFocus","getIsOpen","handleClose","event","handleOpenForHover","clearTimeout","isClosing","setTimeout","handleCloseForHover","handleOpen","setFocus","indexOf","concat","deselectIndex","currentSelected","splice","option","getValueByIndex","optionIndex","keyCode","ENTER","SPACE","DOWN","UP","trap","TAB","handleKeyboardNavigate","key","handleSelect","target","toggleOpen","handleCancel","componentContext","currentFocusedIndex","menu","getListItemId","focusMenuItem","scrollToMenuItem","getElementsByTagName","menuHeight","offsetHeight","menuTop","scrollTop","menuItemTop","offsetTop","menuBottom","menuItemBottom","customListProps","saveRefToListItem","getListItemRenderer","saveRefToList","customContent","customContentWithListPropInjection","Children","child","displayName","renderDefaultMenuContent","clonedCustomContent","cloneElement","handleClickCustomContent","generate","outsideClickIgnoreClass","hasNubbin","positionClassName","positions","split","isInline","menuStylesBase","transform","inheritTargetWidth","offset","handleKeyDown","renderMenuContent","appendChild","parentNode","removeChild","currentSelectedIndices","getCurrentSelectedIndices","prevProps","nextState","renderOverlay","CurrentTrigger","CustomTriggerChildProps","renderDialog","handleClick","handleFocus","handleMouseEnter","handleMouseLeave","saveRefToTriggerContainer","saveRefToTrigger","Component","contextType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;AAEA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,WAArB;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AAEA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AAEA,OAAOC,OAAP,MAAoB,SAApB,C,CAEA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,OAAOC,IAAP,MAAiB,wBAAjB;AACA,OAAOC,QAAP,MAAqB,6BAArB;AACA,OAAOC,aAAP,MAA0B,mCAA1B,C,CAEA;;AACA,OAAOC,cAAP,MAA2B,kBAA3B,C,CAEA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,SAAP,MAAsB,4BAAtB;AACA,OAAOC,gBAAP,MAA6B,mCAA7B;AACA,OAAOC,IAAP,MAAiB,0BAAjB;AACA,SACCC,aADD,EAECC,qBAFD,EAGCC,IAHD,QAIO,2BAJP;AAKA,SAASC,mBAAT,QAAoC,kBAApC;AAEA,IAAMC,eAAe,GAAG,OAAOC,QAAP,KAAoB,WAA5C,C,CAEA;AACA;AACA;AACA;;AACA,IAAMC,OAAO,GAAGF,eAAe,GAC5BC,QAAQ,CAACE,aAAT,CAAuB,MAAvB,CAD4B,GAE5B;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAFH;AAGAF,OAAO,CAACE,KAAR,CAAcC,GAAd,GAAoB,CAApB;AACAH,OAAO,CAACE,KAAR,CAAcE,IAAd,GAAqB,CAArB;AACAJ,OAAO,CA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AAA,YAAY,EACX,KAAKnB,KAAL,CAAWiB,MAAX,KAAsB,OAAtB,IAAiC,KAAKjB,KAAL,CAAWiB,MAAX,KAAsB,QAAvD,GACG,KAAKoI,gBADR,GAEG,IA/BL;AAiCC,QAAA,YAAY,EACX,KAAKrJ,KAAL,CAAWiB,MAAX,KAAsB,OAAtB,IAAiC,KAAKjB,KAAL,CAAWiB,MAAX,KAAsB,QAAvD,GACG,KAAKqI,gBADR,GAEG,IApCL;AAsCC,QAAA,MAAM,EAAE,KAAKtJ,KAAL,CAAWiB,MAtCpB;AAuCC,QAAA,GAAG,EAAE,KAAKsI,yBAvCX;AAwCC,QAAA,KAAK,EAAE,KAAKvJ,KAAL,CAAW3D,KAxCnB;AAyCC,QAAA,QAAQ,EAAE,KAAK2D,KAAL,CAAW0B,QAAX,KAAwBnB,MAAM,GAAG,IAAH,GAAU,GAAxC,CAzCX;AA0CC,QAAA,OAAO,EAAE,KAAKP,KAAL,CAAW4B,OA1CrB;AA2CC,QAAA,gBAAgB,EAAE,KAAK5B,KAAL,CAAW8B,gBA3C9B;AA4CC,QAAA,UAAU,EAAE,KAAK0H,gBA5ClB;AA6CC,QAAA,OAAO,EAAE,KAAKxJ,KAAL,CAAWX;AA7CrB,SA8CK4J,uBA9CL,EADD;AAkDA;;;;EA9pByBvO,KAAK,CAAC+O,S;;gBAA3BxH,Y,iBACgBpG,a;;AAgqBtBoG,YAAY,CAACyH,WAAb,GAA2B1N,mBAA3B;AACAiG,YAAY,CAACvD,SAAb,GAAyBA,SAAzB;AACAuD,YAAY,CAACD,YAAb,GAA4BA,YAA5B;AAEA,eAAeC,YAAf;AACA,SAAS7G,QAAT,EAAmBC,aAAnB,EAAkCuB,uBAAlC","sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Dropdown design pattern](https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown) in React. Child elements that do not have the display name of the value of `MENU_DROPDOWN_TRIGGER` in `components/constants.js` will be considered custom content and rendered in the popover.\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport requiredIf from 'react-required-if';\n\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\nimport isEqual from 'lodash.isequal';\n\nimport shortid from 'shortid';\n\n// ### Children\nimport Dialog from '../utilities/dialog';\nimport List from '../utilities/menu-list';\nimport ListItem from '../utilities/menu-list/item';\nimport ListItemLabel from '../utilities/menu-list/item-label';\n\n// This is the the default Dropdown Trigger, which expects one button as a child.\nimport DefaultTrigger from './button-trigger';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyboardNavigate from '../../utilities/keyboard-navigate';\nimport KEYS from '../../utilities/key-code';\nimport {\n\tMENU_DROPDOWN,\n\tMENU_DROPDOWN_TRIGGER,\n\tLIST,\n} from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// The overlay is an optional way to allow the dropdown to close on outside\n// clicks even when those clicks are over areas that wouldn't normally fire\n// click or touch events (for example, iframes). A single overlay is shared\n// between all dropdowns in the app.\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: { style: {} };\noverlay.style.top = 0;\noverlay.style.left = 0;\noverlay.style.width = '100%';\noverlay.style.height = '100%';\noverlay.style.position = 'absolute';\n\nlet currentOpenDropdown;\n\nconst DropdownNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\n// # Keyboard Navigable mixin\n\nconst noop = () => {};\n\nconst itemIsSelectable = (item) =>\n\titem.type !== 'header' && item.type !== 'divider' && !item.disabled;\n\nconst getNavigableItems = (items) => {\n\tconst navigableItems = [];\n\tnavigableItems.indexes = [];\n\tnavigableItems.keyBuffer = new KeyBuffer();\n\n\tif (Array.isArray(items)) {\n\t\titems.forEach((item, index) => {\n\t\t\tif (itemIsSelectable(item)) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tnavigableItems.push({\n\t\t\t\t\tindex,\n\t\t\t\t\ttext: `${item.label}`.toLowerCase(),\n\t\t\t\t});\n\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tnavigableItems.indexes.push(index);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn navigableItems;\n};\n\nfunction getMenu(componentRef) {\n\treturn ReactDOM.findDOMNode(componentRef).querySelector('ul.dropdown__list'); // eslint-disable-line react/no-find-dom-node\n}\n\nfunction getMenuItem(menuItemId, context = document) {\n\tlet menuItem;\n\n\tif (menuItemId) {\n\t\tmenuItem = context.getElementById(menuItemId);\n\t}\n\n\treturn menuItem;\n}\n\n/*\n * Dropdowns with nubbins have a different API from other Dialogs\n *\n * Dialog receives an alignment position and whether it has a nubbin. The nubbin position is inferred from the align.\n * Dropdowns have a nubbinPosition which dictates the align, but in an inverse fashion which then gets inversed back by the Dialog.\n *\n * Since Dialog is the future API and we don't want to break backwards compatability, we currently map to the Dialog api here. Even if Dialog will map it again.\n * TODO - deprecate nubbinPosition in favor for additional `align` values and a flag to show a nubbin.\n */\nconst DropdownToDialogNubbinMapping = {\n\ttop: 'bottom',\n\t'top left': 'bottom left',\n\t'top right': 'bottom right',\n\n\tbottom: 'top',\n\t'bottom left': 'top left',\n\t'bottom right': 'top right',\n};\n\nconst propTypes = {\n\t/**\n\t * Aligns the menu center, right, or left respective to the trigger. This is not intended for use with `nubbinPosition`.\n\t */\n\talign: PropTypes.oneOf(['center', 'left', 'right']),\n\t/**\n\t * This prop is passed onto the triggering `Button`. Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means. You can omit this prop if you are using the `label` prop.\n\t */\n\tassistiveText: PropTypes.object,\n\t/**\n\t * CSS classes to be added to triggering button.\n\t */\n\tbuttonClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * If true, button/icon is white. Meant for buttons or utility icons on dark backgrounds.\n\t */\n\tbuttonInverse: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Determines variant of the Button component that triggers dropdown.\n\t */\n\tbuttonVariant: PropTypes.oneOf([\n\t\t'base',\n\t\t'neutral',\n\t\t'brand',\n\t\t'destructive',\n\t\t'icon',\n\t]),\n\t/**\n\t * If true, renders checkmark icon on the selected Menu Item.\n\t */\n\tcheckmark: PropTypes.bool,\n\t/**\n\t * If you need custom content _and_ a list, use a `<Popover>` instead.\n\t */\n\tchildren: PropTypes.node,\n\t/**\n\t * CSS classes to be added to dropdown menu.\n\t */\n\tclassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * By default, these class names will be added to the absolutely-positioned `Dialog` component.\n\t */\n\tcontainerClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * This prop is passed onto the triggering `Button`. Prevent dropdown menu from opening. Also applies disabled styling to trigger button.\n\t */\n\tdisabled: PropTypes.bool,\n\t/**\n\t * Prevents the dropdown from changing position based on the viewport/window. If set to true your dropdowns can extend outside the viewport _and_ overflow outside of a scrolling parent. If this happens, you might want to consider making the dropdowns contents scrollable to fit the menu on the screen. `hasStaticAlignment` disables this behavior and allows this component to extend beyond boundary elements. _Not tested._\n\t */\n\thasStaticAlignment: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Associates an icon button with another element on the page by changes the color of the SVG. Please reference <a href=\"http://www.lightningdesignsystem.com/components/buttons/#hint\">Lightning Design System Buttons > Hint</a>.\n\t */\n\thint: PropTypes.bool,\n\t/**\n\t * Delay on menu closing in milliseconds.\n\t */\n\thoverCloseDelay: PropTypes.number,\n\t/**\n\t * Name of the icon category. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon categories.\n\t */\n\ticonCategory: requiredIf(\n\t\tPropTypes.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']),\n\t\t(props) => !!props.iconName\n\t),\n\t/**\n\t * Name of the icon. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon names.\n\t */\n\ticonName: PropTypes.string,\n\t/**\n\t * If omitted, icon position is centered.\n\t */\n\ticonPosition: PropTypes.oneOf(['left', 'right']),\n\t/**\n\t * For icon variants, please reference <a href=\"http://www.lightningdesignsystem.com/components/buttons/#icon\">Lightning Design System Icons</a>.\n\t */\n\ticonVariant: PropTypes.oneOf([\n\t\t'bare',\n\t\t'container',\n\t\t'border',\n\t\t'border-filled',\n\t\t'small',\n\t\t'more',\n\t]),\n\t/**\n\t * Determines the size of the icon.\n\t */\n\ticonSize: PropTypes.oneOf(['x-small', 'small', 'medium', 'large']),\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.\n\t */\n\tid: PropTypes.string,\n\t/**\n\t * Adds inverse class to the dropdown\n\t */\n\tinverse: PropTypes.bool,\n\t/**\n\t * Forces the dropdown to be open or closed. See controlled/uncontrolled callback/prop pattern for more on suggested use view [Concepts and Best Practices](https://github.com/salesforce-ux/design-system-react/blob/master/CONTRIBUTING.md#concepts-and-best-practices)\n\t */\n\tisOpen: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Text within the trigger button.\n\t */\n\tlabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n\t/**\n\t * Custom element that overrides the default Menu Item component.\n\t */\n\tlistItemRenderer: PropTypes.func,\n\t/**\n\t * This prop is passed into the List for the menu. Pass null to make it the size of the content, or a string with an integer from here: https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown-height\n\t */\n\tlength: PropTypes.oneOf([null, '5', '7', '10', 5, 7, 10]),\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself. This allows inverted placement or flipping of the dialog.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents. Use on elements that are aligned to the left or right of their target and don't care about the target being within a scrolling parent. Typically this is a popover or tooltip. Dropdown menus can usually open up and down if no room exists. In order to achieve this a portal element will be created and attached to `body`. This element will render into that detached render tree.\n\t * * `relative` - No styling or portals will be used. Menus will be positioned relative to their triggers. This is a great choice for HTML snapshot testing.\n\t */\n\tmenuPosition: PropTypes.oneOf([\n\t\t'absolute',\n\t\t'overflowBoundaryElement',\n\t\t'relative',\n\t]),\n\t/**\n\t * Style applied to menu element (that is the `.slds-dropdown` element)\n\t */\n\tmenuStyle: PropTypes.object,\n\t/**\n\t * Positions dropdown menu with a nubbin--that is the arrow notch. The placement options correspond to the placement of the nubbin. This is implemeted with CSS classes and is best used with a `Button` with \"icon container\" styling (`iconVariant=\"container\"`). Use with `isInline` prop, since positioning is determined by CSS via absolute-relative positioning, and using an absolutely positioned menu will not position the menu correctly without manual offsets.\n\t */\n\tnubbinPosition: PropTypes.oneOf([\n\t\t'top left',\n\t\t'top',\n\t\t'top right',\n\t\t'bottom left',\n\t\t'bottom',\n\t\t'bottom right',\n\t]),\n\t/**\n\t * Called when the triggering button loses focus.\n\t */\n\tonBlur: PropTypes.func,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonClick: PropTypes.func,\n\t/**\n\t * Called when the triggering button gains focus.\n\t */\n\tonFocus: PropTypes.func,\n\t/**\n\t * Determines if mouse hover or click opens or closes the dropdown menu. The default of `click` opens the menu on click, touch, or keyboard navigation and is highly recommended to comply with accessibility standards. The other options are `hover` which opens when the mouse enters the focusable area, and `hybrid` which causes the menu to open on clicking of the trigger, but closes the menu when the mouse leaves the menu and trigger area. If you are planning on using `hover` or `hybrid`, please pause a moment and reconsider.\n\t */\n\topenOn: PropTypes.oneOf(['hover', 'click', 'hybrid']),\n\t/**\n\t * Called when a key pressed.\n\t */\n\tonKeyDown: PropTypes.func,\n\t/**\n\t * Called when mouse clicks down on the trigger button.\n\t */\n\tonMouseDown: PropTypes.func,\n\t/**\n\t * Called when mouse hovers over the trigger button. This is only called if `this.props.openOn` is set to `hover`.\n\t */\n\tonMouseEnter: PropTypes.func,\n\t/**\n\t * Called when mouse hover leaves the trigger button. This is only called if `this.props.openOn` is set to `hover`.\n\t */\n\tonMouseLeave: PropTypes.func,\n\t/**\n\t * Triggered when an item in the menu is clicked.\n\t */\n\tonSelect: PropTypes.func,\n\t/**\n\t * Triggered when the dropdown is opened.\n\t */\n\tonOpen: PropTypes.func,\n\t/**\n\t * Triggered when the dropdown is closed.\n\t */\n\tonClose: PropTypes.func,\n\t/**\n\t * An array of menu item objects. `className` and `id` object keys are applied to the `li` DOM node. `divider` key can have a value of `top` or `bottom`. `rightIcon` and `leftIcon` are not actually `Icon` components, but prop objects that get passed to an `Icon` component. The `href` key will be added to the `a` and its default click event will be prevented. Here is a sample:\n\t * ```\n\t * [{\n\t * className: 'custom-li-class',\n\t * divider: 'bottom',\n\t * label: 'A Header',\n\t * type: 'header'\n\t * }, {\n\t * href: 'http://sfdc.co/',\n\t * id: 'custom-li-id',\n\t * label: 'Has a value',\n\t * leftIcon: {\n\t * name: 'settings',\n\t * category: 'utility'\n\t * },\n\t * rightIcon: {\n\t * name: 'settings',\n\t * category: 'utility'\n\t * },\n\t * type: 'item',\n\t * value: 'B0'\n\t * }, {\n\t * tooltipContent: 'Displays a tooltip when hovered over with this content. The `tooltipMenuItem` prop must be set for this to work.',\n\t * type: 'divider'\n\t * }]\n\t * ```\n\t */\n\toptions: PropTypes.array,\n\t/**\n\t * An object of CSS styles that are applied to the triggering button.\n\t */\n\tstyle: PropTypes.object,\n\t/**\n\t * Write <code>\"-1\"</code> if you don't want the user to tab to the button.\n\t */\n\ttabIndex: PropTypes.string,\n\t/**\n\t * If `true`, adds a transparent overlay when the menu is open to handle outside clicks. Allows clicks on iframes to be captured, but also forces a double-click to interact with other elements. If a function is passed, custom overlay logic may be defined by the app.\n\t */\n\toverlay: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n\t/**\n\t * Current selected menu item.\n\t */\n\tvalue: PropTypes.oneOfType([\n\t\tPropTypes.number,\n\t\tPropTypes.string,\n\t\tPropTypes.array,\n\t]),\n\t/**\n\t * This prop is passed onto the triggering `Button`. It creates a tooltip with the content of the `node` provided.\n\t */\n\ttooltip: PropTypes.node,\n\t/**\n\t * Accepts a `Tooltip` component to be used as the template for menu item tooltips that appear via the `tooltipContent` options object attribute. Must be present for `tooltipContent` to work\n\t */\n\ttooltipMenuItem: PropTypes.node,\n\t/**\n\t * CSS classes to be added to wrapping trigger `div` around the button.\n\t */\n\ttriggerClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * Whether this dropdown supports multi select.\n\t */\n\tmultiple: PropTypes.bool,\n\t/**\n\t * To adjust the width of the menu dropdown\n\t */\n\twidth: PropTypes.oneOf([\n\t\t'xx-small',\n\t\t'x-small',\n\t\t'small',\n\t\t'medium',\n\t\t'bottom',\n\t\t'large',\n\t]),\n};\n\nconst defaultProps = {\n\talign: 'left',\n\thoverCloseDelay: 300,\n\tlength: '5',\n\tmenuPosition: 'absolute',\n\topenOn: 'click',\n\twidth: 'medium',\n\tinverse: false,\n};\n\n/**\n * The MenuDropdown component is a variant of the Lightning Design System Menu component. This component\n * may require a polyfill such as [classList](https://github.com/yola/classlist-polyfill) due to\n * [react-onclickoutside](https://github.com/Pomax/react-onclickoutside) if Internet Explorer 11\n * support is needed.\n *\n * This component is wrapped in a [higher order component to listen for clicks outside itself](https://github.com/kentor/react-click-outside) and thus requires use of `ReactDOM`.\n */\nclass MenuDropdown extends React.Component {\n\tstatic displayName = MENU_DROPDOWN;\n\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\t// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)\n\t\tcheckProps(MENU_DROPDOWN, props, componentDoc);\n\n\t\tthis.generatedId = shortid.generate();\n\n\t\tconst currentSelectedIndices = this.getCurrentSelectedIndices(props);\n\n\t\tthis.state = {\n\t\t\tfocusedIndex: -1,\n\t\t\tselectedIndex: -1,\n\t\t\tselectedIndices: [],\n\t\t\t...currentSelectedIndices,\n\t\t};\n\n\t\tthis.navigableItems = getNavigableItems(props.options);\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (prevProps.value !== this.props.value) {\n\t\t\tconst nextState = this.getCurrentSelectedIndices(this.props);\n\t\t\t// eslint-disable-next-line react/no-did-update-set-state\n\t\t\tthis.setState(nextState);\n\t\t}\n\n\t\tif (prevProps.isOpen !== this.props.isOpen) {\n\t\t\tthis.setFocus();\n\t\t}\n\n\t\tif (!isEqual(prevProps.options, this.props.options)) {\n\t\t\tthis.navigableItems = getNavigableItems(this.props.options);\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (currentOpenDropdown === this) {\n\t\t\tcurrentOpenDropdown = undefined;\n\t\t}\n\t\tthis.isUnmounting = true;\n\t\tthis.renderOverlay(false);\n\t}\n\n\tgetId = () => this.props.id || this.generatedId;\n\n\tgetIsOpen = () =>\n\t\t!!(typeof this.props.isOpen === 'boolean'\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen);\n\n\tgetIndexByValue = (value, options) => {\n\t\tlet foundIndex = -1;\n\n\t\tif (options && options.length) {\n\t\t\toptions.some((element, index) => {\n\t\t\t\tif (element && element.value === value) {\n\t\t\t\t\tfoundIndex = index;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\n\t\treturn foundIndex;\n\t};\n\n\tgetValueByIndex = (index) => this.props.options[index];\n\n\tgetListItemRenderer = () =>\n\t\tthis.props.listItemRenderer ? this.props.listItemRenderer : ListItemLabel;\n\n\tgetListItemId = (index) => {\n\t\tlet menuItemId;\n\n\t\tif (index !== undefined) {\n\t\t\tconst menuId = isFunction(this.getId) ? this.getId() : this.props.id;\n\t\t\tmenuItemId = `${menuId}-item-${index}`;\n\t\t}\n\n\t\treturn menuItemId;\n\t};\n\n\tsetFocus = () => {\n\t\tif (!this.isHover && !this.isUnmounting && this.trigger) {\n\t\t\tReactDOM.findDOMNode(this.trigger).focus(); // eslint-disable-line react/no-find-dom-node\n\t\t}\n\t};\n\n\tgetMenu = () => ReactDOM.findDOMNode(this.list); // eslint-disable-line react/no-find-dom-node\n\n\tgetMenuItem = (index) => {\n\t\tif (index !== undefined && this.listItems) {\n\t\t\treturn ReactDOM.findDOMNode(this.listItems[index]); // eslint-disable-line react/no-find-dom-node\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\tgetCurrentSelectedIndices = (nextProps) => {\n\t\tif (this.props.multiple === true) {\n\t\t\tlet values = [];\n\t\t\tlet currentIndices = [];\n\t\t\tif (!Array.isArray(nextProps.value)) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tvalues.push(nextProps.value);\n\t\t\t} else {\n\t\t\t\tvalues = nextProps.value;\n\t\t\t}\n\t\t\tvalues = values.filter(\n\t\t\t\t(value) => this.getIndexByValue(value, nextProps.options) !== -1\n\t\t\t);\n\t\t\tcurrentIndices = values.map((value) =>\n\t\t\t\tthis.getIndexByValue(value, nextProps.options)\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tselectedIndices: currentIndices,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectedIndex: this.getIndexByValue(nextProps.value, nextProps.options),\n\t\t};\n\t};\n\n\t// Trigger opens, closes, and recieves focus on close\n\tsaveRefToTrigger = (trigger) => {\n\t\tthis.trigger = trigger;\n\n\t\tif (!this.state.triggerRendered) {\n\t\t\tthis.setState({ triggerRendered: true });\n\t\t}\n\n\t\tif (trigger && this.props.requestFocus && this.props.onRequestFocus) {\n\t\t\tthis.props.onRequestFocus(trigger);\n\t\t}\n\t};\n\n\t// TriggerContainer is the wrapping outer DOM element which may differ from the actual trigger which is most likely a `button`.\n\tsaveRefToTriggerContainer = (triggerContainer) => {\n\t\tthis.triggerContainer = triggerContainer;\n\t\tif (!this.trigger) this.trigger = triggerContainer;\n\t};\n\n\tsaveRefToList = (list) => {\n\t\tthis.list = list;\n\t};\n\n\tsaveRefToListItem = (listItem, index) => {\n\t\tif (!this.listItems) {\n\t\t\tthis.listItems = {};\n\t\t}\n\n\t\tthis.listItems[index] = listItem;\n\n\t\tif (index === this.state.focusedIndex) {\n\t\t\tthis.handleKeyboardFocus(this.state.focusedIndex);\n\t\t}\n\t};\n\n\thandleClose = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tif (currentOpenDropdown === this) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tisOpen: false,\n\t\t\t});\n\n\t\t\tthis.isHover = false;\n\n\t\t\tif (this.props.onClose) {\n\t\t\t\tthis.props.onClose();\n\t\t\t}\n\t\t}\n\t};\n\n\thandleOpen = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\n\t\t\tcurrentOpenDropdown = this;\n\n\t\t\tthis.setState({\n\t\t\t\tisOpen: true,\n\t\t\t});\n\n\t\t\tif (this.props.onOpen) {\n\t\t\t\tthis.props.onOpen();\n\t\t\t}\n\t\t}\n\t};\n\n\thandleMouseEnter = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tthis.isHover = true;\n\n\t\tif (!isOpen && this.props.openOn === 'hover') {\n\t\t\tthis.handleOpenForHover();\n\t\t} else {\n\t\t\t// we want this clear when openOn is hover or hybrid\n\t\t\tclearTimeout(this.isClosing);\n\t\t}\n\n\t\tif (this.props.onMouseEnter) {\n\t\t\tthis.props.onMouseEnter(event);\n\t\t}\n\t};\n\n\thandleMouseLeave = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tthis.isClosing = setTimeout(() => {\n\t\t\t\tthis.handleCloseForHover();\n\t\t\t}, this.props.hoverCloseDelay);\n\t\t}\n\n\t\tif (this.props.onMouseLeave) {\n\t\t\tthis.props.onMouseLeave(event);\n\t\t}\n\t};\n\n\t// Special handlers for openOn === hover\n\t// calling onClick inside onMouseEnter/Leave used to cause double clicking the trigger on hover which caused closing and reopening of the dropdown\n\thandleCloseForHover = () => {\n\t\tconst isOpen = this.getIsOpen();\n\t\tif (isOpen) {\n\t\t\tthis.handleClose();\n\t\t}\n\t};\n\n\thandleOpenForHover = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tthis.handleOpen();\n\t\t\tthis.setFocus();\n\t\t}\n\t};\n\n\thandleClick = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tthis.handleOpen();\n\t\t\tthis.setFocus();\n\t\t} else {\n\t\t\tthis.handleClose();\n\t\t}\n\n\t\tif (this.props.onClick) {\n\t\t\tthis.props.onClick(event);\n\t\t}\n\t};\n\n\thandleFocus = (event) => {\n\t\tif (this.props.onFocus) {\n\t\t\tthis.props.onFocus(event);\n\t\t}\n\t};\n\n\thandleClickCustomContent = () => {\n\t\tthis.setFocus();\n\t\tthis.handleClose();\n\n\t\tif (this.props.onSelect) {\n\t\t\tthis.props.onSelect();\n\t\t}\n\t};\n\n\thandleSelect = (index) => {\n\t\tif (!this.props.multiple) {\n\t\t\tthis.setState({ selectedIndex: index });\n\t\t\tthis.handleClose();\n\t\t\tthis.setFocus();\n\t\t} else if (\n\t\t\tthis.props.multiple &&\n\t\t\tthis.state.selectedIndices.indexOf(index) === -1\n\t\t) {\n\t\t\t// eslint-disable-next-line react/no-access-state-in-setstate\n\t\t\tconst currentIndices = this.state.selectedIndices.concat(index);\n\t\t\tthis.setState({\n\t\t\t\tselectedIndices: currentIndices,\n\t\t\t});\n\t\t} else if (this.props.multiple) {\n\t\t\tconst deselectIndex = this.state.selectedIndices.indexOf(index);\n\t\t\t// eslint-disable-next-line react/no-access-state-in-setstate\n\t\t\tconst currentSelected = this.state.selectedIndices;\n\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\tcurrentSelected.splice(deselectIndex, 1);\n\t\t\tthis.setState({\n\t\t\t\tselectedIndices: currentSelected,\n\t\t\t});\n\t\t}\n\n\t\tif (this.props.onSelect) {\n\t\t\tconst option = this.getValueByIndex(index);\n\t\t\tthis.props.onSelect(option, { option, optionIndex: index });\n\t\t}\n\t};\n\n\thandleKeyDown = (event) => {\n\t\tif (event.keyCode) {\n\t\t\tif (\n\t\t\t\tevent.keyCode === KEYS.ENTER ||\n\t\t\t\tevent.keyCode === KEYS.SPACE ||\n\t\t\t\tevent.keyCode === KEYS.DOWN ||\n\t\t\t\tevent.keyCode === KEYS.UP\n\t\t\t) {\n\t\t\t\tEventUtil.trap(event);\n\t\t\t}\n\n\t\t\tif (event.keyCode !== KEYS.TAB) {\n\t\t\t\tconst isOpen = this.getIsOpen();\n\n\t\t\t\tthis.handleKeyboardNavigate({\n\t\t\t\t\tevent,\n\t\t\t\t\tisOpen,\n\t\t\t\t\tkey: event.key,\n\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\tonSelect: this.handleSelect,\n\t\t\t\t\ttarget: event.target,\n\t\t\t\t\ttoggleOpen: this.toggleOpen,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.handleCancel();\n\t\t\t}\n\n\t\t\tif (this.props.onKeyDown) {\n\t\t\t\tthis.props.onKeyDown(event);\n\t\t\t}\n\t\t}\n\t};\n\n\thandleCancel = () => {\n\t\tthis.setFocus();\n\t\tthis.handleClose();\n\t};\n\n\thandleClickOutside = () => {\n\t\tthis.handleClose();\n\t};\n\n\t// Handling open / close toggling is optional, and a default implementation is provided for handling focus, but selection _must_ be handled\n\thandleKeyboardNavigate = ({\n\t\tevent,\n\t\tisOpen = true,\n\t\tkeyCode,\n\t\tonFocus = this.handleKeyboardFocus,\n\t\tonSelect,\n\t\ttarget,\n\t\ttoggleOpen = noop,\n\t}) => {\n\t\tkeyboardNavigate({\n\t\t\tcomponentContext: this,\n\t\t\tcurrentFocusedIndex: this.state.focusedIndex,\n\t\t\tevent,\n\t\t\tisOpen,\n\t\t\tkeyCode,\n\t\t\tnavigableItems: this.navigableItems,\n\t\t\tonFocus,\n\t\t\tonSelect,\n\t\t\ttarget,\n\t\t\ttoggleOpen,\n\t\t});\n\t};\n\n\t// This is a bit of an anti-pattern, but it has the upside of being a nice default. Component authors can always override to only set state and do their own focusing in their subcomponents.\n\thandleKeyboardFocus = (focusedIndex) => {\n\t\tif (this.state.focusedIndex !== focusedIndex) {\n\t\t\tthis.setState({ focusedIndex });\n\t\t}\n\n\t\tconst menu = isFunction(this.getMenu) ? this.getMenu() : getMenu(this);\n\n\t\tconst menuItem = isFunction(this.getMenuItem)\n\t\t\t? this.getMenuItem(focusedIndex, menu)\n\t\t\t: getMenuItem(this.getListItemId(focusedIndex));\n\n\t\tif (menuItem) {\n\t\t\tthis.focusMenuItem(menuItem);\n\t\t\tthis.scrollToMenuItem(menu, menuItem);\n\t\t}\n\t};\n\n\tfocusMenuItem = (menuItem) => {\n\t\tmenuItem.getElementsByTagName('a')[0].focus();\n\t};\n\n\tscrollToMenuItem = (menu, menuItem) => {\n\t\tif (menu && menuItem) {\n\t\t\tconst menuHeight = menu.offsetHeight;\n\n\t\t\tconst menuTop = menu.scrollTop;\n\t\t\tconst menuItemTop = menuItem.offsetTop - menu.offsetTop;\n\n\t\t\tif (menuItemTop < menuTop) {\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\tmenu.scrollTop = menuItemTop;\n\t\t\t} else {\n\t\t\t\tconst menuBottom = menuTop + menuHeight + menu.offsetTop;\n\t\t\t\tconst menuItemBottom =\n\t\t\t\t\tmenuItemTop + menuItem.offsetHeight + menu.offsetTop;\n\n\t\t\t\tif (menuItemBottom > menuBottom) {\n\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\tmenu.scrollTop = menuItemBottom - menuHeight - menu.offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\ttoggleOpen = () => {\n\t\tconst isOpen = this.getIsOpen();\n\t\tthis.setFocus();\n\n\t\tif (isOpen) {\n\t\t\tthis.handleClose();\n\t\t} else {\n\t\t\tthis.handleOpen();\n\t\t}\n\t};\n\n\trenderDefaultMenuContent = (customListProps) => (\n\t\t<List\n\t\t\tkey={`${this.getId()}-dropdown-list`}\n\t\t\tcheckmark={this.props.checkmark}\n\t\t\tgetListItemId={this.getListItemId}\n\t\t\titemRefs={this.saveRefToListItem}\n\t\t\titemRenderer={this.getListItemRenderer()}\n\t\t\tonCancel={this.handleCancel}\n\t\t\tonSelect={this.handleSelect}\n\t\t\toptions={this.props.options}\n\t\t\tref={this.saveRefToList}\n\t\t\tselectedIndex={\n\t\t\t\t!this.props.multiple ? this.state.selectedIndex : undefined\n\t\t\t}\n\t\t\tselectedIndices={\n\t\t\t\tthis.props.multiple ? this.state.selectedIndices : undefined\n\t\t\t}\n\t\t\ttooltipMenuItem={this.props.tooltipMenuItem}\n\t\t\ttriggerId={this.getId()}\n\t\t\tlength={this.props.length}\n\t\t\t{...customListProps}\n\t\t/>\n\t);\n\n\trenderMenuContent = (customContent) => {\n\t\t/**\n\t\t * Custom content for dropdown was a hack done in the past. If there's more than a listbox within a dropdown, then it should be a popover as explained for the `children` prop.\n\t\t *\n\t\t * This code block shows how things are done in the past:\n\t\t * ```\n\t\t * <Dropdown>\n\t\t * <Trigger>\n\t\t * <Button iconCategory=\"utility\" iconName=\"settings\" />\n\t\t * </Trigger>\n\t\t * <div>Look ma! This is Custom Content.</div>\n\t\t * <List options={[myArray]}/>\n\t\t * </Dropdown>\n\t\t * ```\n\t\t */\n\t\tlet customContentWithListPropInjection = [];\n\t\t// Dropdown can take a Trigger component as a child and then return it as the parent DOM element.\n\t\tReact.Children.forEach(customContent, (child) => {\n\t\t\tif (child && child.type.displayName === LIST) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContentWithListPropInjection.push(\n\t\t\t\t\tthis.renderDefaultMenuContent(child.props)\n\t\t\t\t);\n\t\t\t} else if (child) {\n\t\t\t\tconst clonedCustomContent = React.cloneElement(child, {\n\t\t\t\t\tonClick: this.handleClickCustomContent,\n\t\t\t\t\tkey: shortid.generate(),\n\t\t\t\t});\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContentWithListPropInjection.push(clonedCustomContent);\n\t\t\t}\n\t\t});\n\n\t\tif (customContentWithListPropInjection.length === 0) {\n\t\t\tcustomContentWithListPropInjection = null;\n\t\t}\n\n\t\treturn (\n\t\t\tcustomContentWithListPropInjection || this.renderDefaultMenuContent()\n\t\t);\n\t};\n\n\trenderDialog = (customContent, isOpen, outsideClickIgnoreClass) => {\n\t\tlet align = 'bottom';\n\t\tlet hasNubbin = false;\n\t\tlet positionClassName = '';\n\n\t\tif (this.props.nubbinPosition) {\n\t\t\thasNubbin = true;\n\t\t\talign = DropdownToDialogNubbinMapping[this.props.nubbinPosition];\n\t\t} else if (this.props.align) {\n\t\t\talign =\n\t\t\t\tthis.props.align === 'center' ? 'bottom' : `bottom ${this.props.align}`;\n\t\t}\n\n\t\tconst positions = DropdownToDialogNubbinMapping[align].split(' ');\n\t\tpositionClassName = classNames(\n\t\t\tpositions.map((position) => `slds-dropdown_${position}`)\n\t\t);\n\n\t\t// FOR BACKWARDS COMPATIBILITY\n\t\tconst menuPosition = this.props.isInline\n\t\t\t? 'relative'\n\t\t\t: this.props.menuPosition; // eslint-disable-line react/prop-types\n\n\t\tconst menuStylesBase = {};\n\t\tif (this.props.align === 'center' && !hasNubbin) {\n\t\t\tmenuStylesBase.transform = 'none';\n\t\t}\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\talign={align}\n\t\t\t\tclassName={classNames(this.props.containerClassName)}\n\t\t\t\tcloseOnTabKey\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-dropdown',\n\t\t\t\t\t`slds-dropdown_${this.props.width}`,\n\t\t\t\t\t'slds-text-align_left',\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\tthis.props.className,\n\t\t\t\t\tpositionClassName,\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-dropdown_inverse': this.props.inverse,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tcontext={this.context}\n\t\t\t\thasNubbin={hasNubbin}\n\t\t\t\thasStaticAlignment={this.props.hasStaticAlignment}\n\t\t\t\tinheritWidthOf={this.props.inheritTargetWidth ? 'target' : 'none'}\n\t\t\t\toffset={this.props.offset}\n\t\t\t\tonClose={this.handleClose}\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tposition={menuPosition}\n\t\t\t\tstyle={{\n\t\t\t\t\t...menuStylesBase,\n\t\t\t\t\t...this.props.menuStyle,\n\t\t\t\t}}\n\t\t\t\tonRequestTargetElement={() => this.trigger}\n\t\t\t>\n\t\t\t\t{this.renderMenuContent(customContent)}\n\t\t\t</Dialog>\n\t\t) : null;\n\t};\n\n\trenderOverlay = (isOpen) => {\n\t\tif (isFunction(overlay) && documentDefined) {\n\t\t\toverlay(isOpen, overlay);\n\t\t} else if (\n\t\t\tthis.props.overlay &&\n\t\t\tisOpen &&\n\t\t\t!this.overlay &&\n\t\t\tdocumentDefined\n\t\t) {\n\t\t\tthis.overlay = overlay;\n\t\t\tdocument.querySelector('body').appendChild(this.overlay);\n\t\t} else if (!isOpen && this.overlay && this.overlay.parentNode) {\n\t\t\tthis.overlay.parentNode.removeChild(this.overlay);\n\t\t\tthis.overlay = undefined;\n\t\t}\n\t};\n\n\trender() {\n\t\t// Dropdowns are used by other components. The default trigger is a button, but some other components use `li` elements. The following allows `MenuDropdown` to be extended by providing a child component with the displayName of `DropdownTrigger`.\n\t\tlet CurrentTrigger = DefaultTrigger;\n\n\t\tlet CustomTriggerChildProps = {};\n\n\t\t// Child elements that do not have the display name of the value of `MENU_DROPDOWN_TRIGGER` in `components/constants.js` will be considered custom content and rendered in the popover.\n\t\tlet customContent = [];\n\n\t\t// Dropdown can take a Trigger component as a child and then return it as the parent DOM element.\n\t\tReact.Children.forEach(this.props.children, (child) => {\n\t\t\tif (child && child.type.displayName === MENU_DROPDOWN_TRIGGER) {\n\t\t\t\t// `CustomTriggerChildProps` is not used by the default button Trigger, but by other triggers\n\t\t\t\tCustomTriggerChildProps = child.props;\n\t\t\t\tCurrentTrigger = child.type;\n\t\t\t} else if (child) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContent.push(child);\n\t\t\t}\n\t\t});\n\n\t\tif (customContent.length === 0) {\n\t\t\tcustomContent = null;\n\t\t}\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${this.getId()}`;\n\t\tconst isOpen = !this.props.disabled && this.getIsOpen() && !!this.trigger;\n\n\t\tthis.renderOverlay(isOpen);\n\n\t\t/* Below are three sections of props:\n\t\t - The first are the props that may be given by the dropdown component. These may get deprecated in the future.\n\t\t - The next set of props (`CustomTriggerChildProps`) are props that can be overwritten by the end developer.\n\t\t - The final set are props that should not be overwritten, since they are ones that tie the trigger to the dropdown menu.\n\t\t*/\n\n\t\treturn (\n\t\t\t<CurrentTrigger\n\t\t\t\taria-haspopup\n\t\t\t\tassistiveText={this.props.assistiveText}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\toutsideClickIgnoreClass,\n\t\t\t\t\tthis.props.buttonClassName\n\t\t\t\t)}\n\t\t\t\tdisabled={this.props.disabled}\n\t\t\t\thint={this.props.hint}\n\t\t\t\ticonCategory={this.props.iconCategory}\n\t\t\t\ticonName={this.props.iconName}\n\t\t\t\ticonPosition={this.props.iconPosition}\n\t\t\t\ticonSize={this.props.iconSize}\n\t\t\t\ticonVariant={this.props.iconVariant}\n\t\t\t\tid={this.getId()}\n\t\t\t\tinverse={this.props.buttonInverse}\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tlabel={this.props.label}\n\t\t\t\tmenu={this.renderDialog(customContent, isOpen, outsideClickIgnoreClass)}\n\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\tonClick={\n\t\t\t\t\tthis.props.openOn === 'click' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleClick\n\t\t\t\t\t\t: this.props.onClick\n\t\t\t\t}\n\t\t\t\tonFocus={this.handleFocus}\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t\tonMouseDown={this.props.onMouseDown}\n\t\t\t\tonMouseEnter={\n\t\t\t\t\tthis.props.openOn === 'hover' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleMouseEnter\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\tonMouseLeave={\n\t\t\t\t\tthis.props.openOn === 'hover' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleMouseLeave\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\topenOn={this.props.openOn}\n\t\t\t\tref={this.saveRefToTriggerContainer}\n\t\t\t\tstyle={this.props.style}\n\t\t\t\ttabIndex={this.props.tabIndex || (isOpen ? '-1' : '0')}\n\t\t\t\ttooltip={this.props.tooltip}\n\t\t\t\ttriggerClassName={this.props.triggerClassName}\n\t\t\t\ttriggerRef={this.saveRefToTrigger}\n\t\t\t\tvariant={this.props.buttonVariant}\n\t\t\t\t{...CustomTriggerChildProps}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nMenuDropdown.contextType = IconSettingsContext;\nMenuDropdown.propTypes = propTypes;\nMenuDropdown.defaultProps = defaultProps;\n\nexport default MenuDropdown;\nexport { ListItem, ListItemLabel, DropdownNubbinPositions };\n"],"file":"menu-dropdown.js"}
1
+ {"version":3,"sources":["../../../.tmp-es/components/menu-dropdown/menu-dropdown.jsx"],"names":["React","PropTypes","ReactDOM","requiredIf","classNames","isFunction","isEqual","shortid","Dialog","List","ListItem","ListItemLabel","DefaultTrigger","checkProps","componentDoc","EventUtil","KeyBuffer","keyboardNavigate","KEYS","MENU_DROPDOWN","MENU_DROPDOWN_TRIGGER","LIST","IconSettingsContext","documentDefined","document","overlay","createElement","style","top","left","width","height","position","currentOpenDropdown","DropdownNubbinPositions","noop","itemIsSelectable","item","type","disabled","getNavigableItems","items","navigableItems","indexes","keyBuffer","Array","isArray","forEach","index","push","text","label","toLowerCase","getMenu","componentRef","findDOMNode","querySelector","getMenuItem","menuItemId","context","menuItem","getElementById","DropdownToDialogNubbinMapping","bottom","propTypes","align","oneOf","assistiveText","object","buttonClassName","oneOfType","array","string","buttonInverse","bool","buttonVariant","checkmark","children","node","className","containerClassName","hasStaticAlignment","hint","hoverCloseDelay","number","iconCategory","props","iconName","iconPosition","iconVariant","iconSize","id","inverse","isOpen","listItemRenderer","func","length","menuPosition","menuStyle","nubbinPosition","onBlur","onClick","onFocus","openOn","onKeyDown","onMouseDown","onMouseEnter","onMouseLeave","onSelect","onOpen","onClose","options","tabIndex","value","tooltip","tooltipMenuItem","triggerClassName","multiple","defaultProps","MenuDropdown","generatedId","state","foundIndex","some","element","undefined","menuId","getId","isHover","isUnmounting","trigger","focus","list","listItems","nextProps","values","currentIndices","filter","getIndexByValue","map","selectedIndices","selectedIndex","triggerRendered","setState","requestFocus","onRequestFocus","triggerContainer","listItem","focusedIndex","handleKeyboardFocus","getIsOpen","handleClose","event","handleOpenForHover","clearTimeout","isClosing","setTimeout","handleCloseForHover","handleOpen","setFocus","indexOf","concat","deselectIndex","currentSelected","splice","option","getValueByIndex","optionIndex","keyCode","TAB","handleCancel","ENTER","SPACE","DOWN","UP","ESCAPE","trap","handleKeyboardNavigate","key","handleSelect","target","toggleOpen","componentContext","currentFocusedIndex","menu","getListItemId","focusMenuItem","scrollToMenuItem","getElementsByTagName","menuHeight","offsetHeight","menuTop","scrollTop","menuItemTop","offsetTop","menuBottom","menuItemBottom","customListProps","saveRefToListItem","getListItemRenderer","saveRefToList","customContent","customContentWithListPropInjection","Children","child","displayName","renderDefaultMenuContent","clonedCustomContent","cloneElement","handleClickCustomContent","generate","outsideClickIgnoreClass","hasNubbin","positionClassName","positions","split","isInline","menuStylesBase","transform","inheritTargetWidth","offset","handleKeyDown","renderMenuContent","appendChild","parentNode","removeChild","currentSelectedIndices","getCurrentSelectedIndices","prevProps","nextState","renderOverlay","CurrentTrigger","CustomTriggerChildProps","renderDialog","handleClick","handleFocus","handleMouseEnter","handleMouseLeave","saveRefToTriggerContainer","saveRefToTrigger","Component","contextType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;AAEA;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,WAArB;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AAEA,OAAOC,UAAP,MAAuB,YAAvB,C,CAEA;;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AAEA,OAAOC,OAAP,MAAoB,SAApB,C,CAEA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,OAAOC,IAAP,MAAiB,wBAAjB;AACA,OAAOC,QAAP,MAAqB,6BAArB;AACA,OAAOC,aAAP,MAA0B,mCAA1B,C,CAEA;;AACA,OAAOC,cAAP,MAA2B,kBAA3B,C,CAEA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,SAAP,MAAsB,4BAAtB;AACA,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C,QAAA,OAAO,EAAE,KAAKzJ,KAAL,CAAWX;AA7CrB,SA8CK6J,uBA9CL,EADD;AAkDA;;;;EA3pByBxO,KAAK,CAACgP,S;;gBAA3BzH,Y,iBACgBpG,a;;AA6pBtBoG,YAAY,CAAC0H,WAAb,GAA2B3N,mBAA3B;AACAiG,YAAY,CAACvD,SAAb,GAAyBA,SAAzB;AACAuD,YAAY,CAACD,YAAb,GAA4BA,YAA5B;AAEA,eAAeC,YAAf;AACA,SAAS7G,QAAT,EAAmBC,aAAnB,EAAkCuB,uBAAlC","sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Dropdown design pattern](https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown) in React. Child elements that do not have the display name of the value of `MENU_DROPDOWN_TRIGGER` in `components/constants.js` will be considered custom content and rendered in the popover.\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport requiredIf from 'react-required-if';\n\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\nimport isEqual from 'lodash.isequal';\n\nimport shortid from 'shortid';\n\n// ### Children\nimport Dialog from '../utilities/dialog';\nimport List from '../utilities/menu-list';\nimport ListItem from '../utilities/menu-list/item';\nimport ListItemLabel from '../utilities/menu-list/item-label';\n\n// This is the the default Dropdown Trigger, which expects one button as a child.\nimport DefaultTrigger from './button-trigger';\n\n// This component's `checkProps` which issues warnings to developers about properties\n// when in development mode (similar to React's built in development tools)\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyboardNavigate from '../../utilities/keyboard-navigate';\nimport KEYS from '../../utilities/key-code';\nimport {\n\tMENU_DROPDOWN,\n\tMENU_DROPDOWN_TRIGGER,\n\tLIST,\n} from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// The overlay is an optional way to allow the dropdown to close on outside\n// clicks even when those clicks are over areas that wouldn't normally fire\n// click or touch events (for example, iframes). A single overlay is shared\n// between all dropdowns in the app.\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: { style: {} };\noverlay.style.top = 0;\noverlay.style.left = 0;\noverlay.style.width = '100%';\noverlay.style.height = '100%';\noverlay.style.position = 'absolute';\n\nlet currentOpenDropdown;\n\nconst DropdownNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\n// # Keyboard Navigable mixin\n\nconst noop = () => {};\n\nconst itemIsSelectable = (item) =>\n\titem.type !== 'header' && item.type !== 'divider' && !item.disabled;\n\nconst getNavigableItems = (items) => {\n\tconst navigableItems = [];\n\tnavigableItems.indexes = [];\n\tnavigableItems.keyBuffer = new KeyBuffer();\n\n\tif (Array.isArray(items)) {\n\t\titems.forEach((item, index) => {\n\t\t\tif (itemIsSelectable(item)) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tnavigableItems.push({\n\t\t\t\t\tindex,\n\t\t\t\t\ttext: `${item.label}`.toLowerCase(),\n\t\t\t\t});\n\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tnavigableItems.indexes.push(index);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn navigableItems;\n};\n\nfunction getMenu(componentRef) {\n\treturn ReactDOM.findDOMNode(componentRef).querySelector('ul.dropdown__list'); // eslint-disable-line react/no-find-dom-node\n}\n\nfunction getMenuItem(menuItemId, context = document) {\n\tlet menuItem;\n\n\tif (menuItemId) {\n\t\tmenuItem = context.getElementById(menuItemId);\n\t}\n\n\treturn menuItem;\n}\n\n/*\n * Dropdowns with nubbins have a different API from other Dialogs\n *\n * Dialog receives an alignment position and whether it has a nubbin. The nubbin position is inferred from the align.\n * Dropdowns have a nubbinPosition which dictates the align, but in an inverse fashion which then gets inversed back by the Dialog.\n *\n * Since Dialog is the future API and we don't want to break backwards compatability, we currently map to the Dialog api here. Even if Dialog will map it again.\n * TODO - deprecate nubbinPosition in favor for additional `align` values and a flag to show a nubbin.\n */\nconst DropdownToDialogNubbinMapping = {\n\ttop: 'bottom',\n\t'top left': 'bottom left',\n\t'top right': 'bottom right',\n\n\tbottom: 'top',\n\t'bottom left': 'top left',\n\t'bottom right': 'top right',\n};\n\nconst propTypes = {\n\t/**\n\t * Aligns the menu center, right, or left respective to the trigger. This is not intended for use with `nubbinPosition`.\n\t */\n\talign: PropTypes.oneOf(['center', 'left', 'right']),\n\t/**\n\t * This prop is passed onto the triggering `Button`. Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means. You can omit this prop if you are using the `label` prop.\n\t */\n\tassistiveText: PropTypes.object,\n\t/**\n\t * CSS classes to be added to triggering button.\n\t */\n\tbuttonClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * If true, button/icon is white. Meant for buttons or utility icons on dark backgrounds.\n\t */\n\tbuttonInverse: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Determines variant of the Button component that triggers dropdown.\n\t */\n\tbuttonVariant: PropTypes.oneOf([\n\t\t'base',\n\t\t'neutral',\n\t\t'brand',\n\t\t'destructive',\n\t\t'icon',\n\t]),\n\t/**\n\t * If true, renders checkmark icon on the selected Menu Item.\n\t */\n\tcheckmark: PropTypes.bool,\n\t/**\n\t * If you need custom content _and_ a list, use a `<Popover>` instead.\n\t */\n\tchildren: PropTypes.node,\n\t/**\n\t * CSS classes to be added to dropdown menu.\n\t */\n\tclassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * By default, these class names will be added to the absolutely-positioned `Dialog` component.\n\t */\n\tcontainerClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * This prop is passed onto the triggering `Button`. Prevent dropdown menu from opening. Also applies disabled styling to trigger button.\n\t */\n\tdisabled: PropTypes.bool,\n\t/**\n\t * Prevents the dropdown from changing position based on the viewport/window. If set to true your dropdowns can extend outside the viewport _and_ overflow outside of a scrolling parent. If this happens, you might want to consider making the dropdowns contents scrollable to fit the menu on the screen. `hasStaticAlignment` disables this behavior and allows this component to extend beyond boundary elements. _Not tested._\n\t */\n\thasStaticAlignment: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Associates an icon button with another element on the page by changes the color of the SVG. Please reference <a href=\"http://www.lightningdesignsystem.com/components/buttons/#hint\">Lightning Design System Buttons > Hint</a>.\n\t */\n\thint: PropTypes.bool,\n\t/**\n\t * Delay on menu closing in milliseconds.\n\t */\n\thoverCloseDelay: PropTypes.number,\n\t/**\n\t * Name of the icon category. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon categories.\n\t */\n\ticonCategory: requiredIf(\n\t\tPropTypes.oneOf(['action', 'custom', 'doctype', 'standard', 'utility']),\n\t\t(props) => !!props.iconName\n\t),\n\t/**\n\t * Name of the icon. Visit <a href=\"http://www.lightningdesignsystem.com/resources/icons\">Lightning Design System Icons</a> to reference icon names.\n\t */\n\ticonName: PropTypes.string,\n\t/**\n\t * If omitted, icon position is centered.\n\t */\n\ticonPosition: PropTypes.oneOf(['left', 'right']),\n\t/**\n\t * For icon variants, please reference <a href=\"http://www.lightningdesignsystem.com/components/buttons/#icon\">Lightning Design System Icons</a>.\n\t */\n\ticonVariant: PropTypes.oneOf([\n\t\t'bare',\n\t\t'container',\n\t\t'border',\n\t\t'border-filled',\n\t\t'small',\n\t\t'more',\n\t]),\n\t/**\n\t * Determines the size of the icon.\n\t */\n\ticonSize: PropTypes.oneOf(['x-small', 'small', 'medium', 'large']),\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.\n\t */\n\tid: PropTypes.string,\n\t/**\n\t * Adds inverse class to the dropdown\n\t */\n\tinverse: PropTypes.bool,\n\t/**\n\t * Forces the dropdown to be open or closed. See controlled/uncontrolled callback/prop pattern for more on suggested use view [Concepts and Best Practices](https://github.com/salesforce-ux/design-system-react/blob/master/CONTRIBUTING.md#concepts-and-best-practices)\n\t */\n\tisOpen: PropTypes.bool,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Text within the trigger button.\n\t */\n\tlabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n\t/**\n\t * Custom element that overrides the default Menu Item component.\n\t */\n\tlistItemRenderer: PropTypes.func,\n\t/**\n\t * This prop is passed into the List for the menu. Pass null to make it the size of the content, or a string with an integer from here: https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown-height\n\t */\n\tlength: PropTypes.oneOf([null, '5', '7', '10', 5, 7, 10]),\n\t/**\n\t * Please select one of the following:\n\t * * `absolute` - (default) The dialog will use `position: absolute` and style attributes to position itself. This allows inverted placement or flipping of the dialog.\n\t * * `overflowBoundaryElement` - The dialog will overflow scrolling parents. Use on elements that are aligned to the left or right of their target and don't care about the target being within a scrolling parent. Typically this is a popover or tooltip. Dropdown menus can usually open up and down if no room exists. In order to achieve this a portal element will be created and attached to `body`. This element will render into that detached render tree.\n\t * * `relative` - No styling or portals will be used. Menus will be positioned relative to their triggers. This is a great choice for HTML snapshot testing.\n\t */\n\tmenuPosition: PropTypes.oneOf([\n\t\t'absolute',\n\t\t'overflowBoundaryElement',\n\t\t'relative',\n\t]),\n\t/**\n\t * Style applied to menu element (that is the `.slds-dropdown` element)\n\t */\n\tmenuStyle: PropTypes.object,\n\t/**\n\t * Positions dropdown menu with a nubbin--that is the arrow notch. The placement options correspond to the placement of the nubbin. This is implemeted with CSS classes and is best used with a `Button` with \"icon container\" styling (`iconVariant=\"container\"`). Use with `isInline` prop, since positioning is determined by CSS via absolute-relative positioning, and using an absolutely positioned menu will not position the menu correctly without manual offsets.\n\t */\n\tnubbinPosition: PropTypes.oneOf([\n\t\t'top left',\n\t\t'top',\n\t\t'top right',\n\t\t'bottom left',\n\t\t'bottom',\n\t\t'bottom right',\n\t]),\n\t/**\n\t * Called when the triggering button loses focus.\n\t */\n\tonBlur: PropTypes.func,\n\t/**\n\t * This prop is passed onto the triggering `Button`. Triggered when the trigger button is clicked.\n\t */\n\tonClick: PropTypes.func,\n\t/**\n\t * Called when the triggering button gains focus.\n\t */\n\tonFocus: PropTypes.func,\n\t/**\n\t * Determines if mouse hover or click opens or closes the dropdown menu. The default of `click` opens the menu on click, touch, or keyboard navigation and is highly recommended to comply with accessibility standards. The other options are `hover` which opens when the mouse enters the focusable area, and `hybrid` which causes the menu to open on clicking of the trigger, but closes the menu when the mouse leaves the menu and trigger area. If you are planning on using `hover` or `hybrid`, please pause a moment and reconsider.\n\t */\n\topenOn: PropTypes.oneOf(['hover', 'click', 'hybrid']),\n\t/**\n\t * Called when a key pressed.\n\t */\n\tonKeyDown: PropTypes.func,\n\t/**\n\t * Called when mouse clicks down on the trigger button.\n\t */\n\tonMouseDown: PropTypes.func,\n\t/**\n\t * Called when mouse hovers over the trigger button. This is only called if `this.props.openOn` is set to `hover`.\n\t */\n\tonMouseEnter: PropTypes.func,\n\t/**\n\t * Called when mouse hover leaves the trigger button. This is only called if `this.props.openOn` is set to `hover`.\n\t */\n\tonMouseLeave: PropTypes.func,\n\t/**\n\t * Triggered when an item in the menu is clicked.\n\t */\n\tonSelect: PropTypes.func,\n\t/**\n\t * Triggered when the dropdown is opened.\n\t */\n\tonOpen: PropTypes.func,\n\t/**\n\t * Triggered when the dropdown is closed.\n\t */\n\tonClose: PropTypes.func,\n\t/**\n\t * An array of menu item objects. `className` and `id` object keys are applied to the `li` DOM node. `divider` key can have a value of `top` or `bottom`. `rightIcon` and `leftIcon` are not actually `Icon` components, but prop objects that get passed to an `Icon` component. The `href` key will be added to the `a` and its default click event will be prevented. Here is a sample:\n\t * ```\n\t * [{\n\t * className: 'custom-li-class',\n\t * divider: 'bottom',\n\t * label: 'A Header',\n\t * type: 'header'\n\t * }, {\n\t * href: 'http://sfdc.co/',\n\t * id: 'custom-li-id',\n\t * label: 'Has a value',\n\t * leftIcon: {\n\t * name: 'settings',\n\t * category: 'utility'\n\t * },\n\t * rightIcon: {\n\t * name: 'settings',\n\t * category: 'utility'\n\t * },\n\t * type: 'item',\n\t * value: 'B0'\n\t * }, {\n\t * tooltipContent: 'Displays a tooltip when hovered over with this content. The `tooltipMenuItem` prop must be set for this to work.',\n\t * type: 'divider'\n\t * }]\n\t * ```\n\t */\n\toptions: PropTypes.array,\n\t/**\n\t * An object of CSS styles that are applied to the triggering button.\n\t */\n\tstyle: PropTypes.object,\n\t/**\n\t * Write <code>\"-1\"</code> if you don't want the user to tab to the button.\n\t */\n\ttabIndex: PropTypes.string,\n\t/**\n\t * If `true`, adds a transparent overlay when the menu is open to handle outside clicks. Allows clicks on iframes to be captured, but also forces a double-click to interact with other elements. If a function is passed, custom overlay logic may be defined by the app.\n\t */\n\toverlay: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n\t/**\n\t * Current selected menu item.\n\t */\n\tvalue: PropTypes.oneOfType([\n\t\tPropTypes.number,\n\t\tPropTypes.string,\n\t\tPropTypes.array,\n\t]),\n\t/**\n\t * This prop is passed onto the triggering `Button`. It creates a tooltip with the content of the `node` provided.\n\t */\n\ttooltip: PropTypes.node,\n\t/**\n\t * Accepts a `Tooltip` component to be used as the template for menu item tooltips that appear via the `tooltipContent` options object attribute. Must be present for `tooltipContent` to work\n\t */\n\ttooltipMenuItem: PropTypes.node,\n\t/**\n\t * CSS classes to be added to wrapping trigger `div` around the button.\n\t */\n\ttriggerClassName: PropTypes.oneOfType([\n\t\tPropTypes.array,\n\t\tPropTypes.object,\n\t\tPropTypes.string,\n\t]),\n\t/**\n\t * Whether this dropdown supports multi select.\n\t */\n\tmultiple: PropTypes.bool,\n\t/**\n\t * To adjust the width of the menu dropdown\n\t */\n\twidth: PropTypes.oneOf([\n\t\t'xx-small',\n\t\t'x-small',\n\t\t'small',\n\t\t'medium',\n\t\t'bottom',\n\t\t'large',\n\t]),\n};\n\nconst defaultProps = {\n\talign: 'left',\n\thoverCloseDelay: 300,\n\tlength: '5',\n\tmenuPosition: 'absolute',\n\topenOn: 'click',\n\twidth: 'medium',\n\tinverse: false,\n};\n\n/**\n * The MenuDropdown component is a variant of the Lightning Design System Menu component. This component\n * may require a polyfill such as [classList](https://github.com/yola/classlist-polyfill) due to\n * [react-onclickoutside](https://github.com/Pomax/react-onclickoutside) if Internet Explorer 11\n * support is needed.\n *\n * This component is wrapped in a [higher order component to listen for clicks outside itself](https://github.com/kentor/react-click-outside) and thus requires use of `ReactDOM`.\n */\nclass MenuDropdown extends React.Component {\n\tstatic displayName = MENU_DROPDOWN;\n\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\t// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)\n\t\tcheckProps(MENU_DROPDOWN, props, componentDoc);\n\n\t\tthis.generatedId = shortid.generate();\n\n\t\tconst currentSelectedIndices = this.getCurrentSelectedIndices(props);\n\n\t\tthis.state = {\n\t\t\tfocusedIndex: -1,\n\t\t\tselectedIndex: -1,\n\t\t\tselectedIndices: [],\n\t\t\t...currentSelectedIndices,\n\t\t};\n\n\t\tthis.navigableItems = getNavigableItems(props.options);\n\t}\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (prevProps.value !== this.props.value) {\n\t\t\tconst nextState = this.getCurrentSelectedIndices(this.props);\n\t\t\t// eslint-disable-next-line react/no-did-update-set-state\n\t\t\tthis.setState(nextState);\n\t\t}\n\n\t\tif (prevProps.isOpen !== this.props.isOpen) {\n\t\t\tthis.setFocus();\n\t\t}\n\n\t\tif (!isEqual(prevProps.options, this.props.options)) {\n\t\t\tthis.navigableItems = getNavigableItems(this.props.options);\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (currentOpenDropdown === this) {\n\t\t\tcurrentOpenDropdown = undefined;\n\t\t}\n\t\tthis.isUnmounting = true;\n\t\tthis.renderOverlay(false);\n\t}\n\n\tgetId = () => this.props.id || this.generatedId;\n\n\tgetIsOpen = () =>\n\t\t!!(typeof this.props.isOpen === 'boolean'\n\t\t\t? this.props.isOpen\n\t\t\t: this.state.isOpen);\n\n\tgetIndexByValue = (value, options) => {\n\t\tlet foundIndex = -1;\n\n\t\tif (options && options.length) {\n\t\t\toptions.some((element, index) => {\n\t\t\t\tif (element && element.value === value) {\n\t\t\t\t\tfoundIndex = index;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\n\t\treturn foundIndex;\n\t};\n\n\tgetValueByIndex = (index) => this.props.options[index];\n\n\tgetListItemRenderer = () =>\n\t\tthis.props.listItemRenderer ? this.props.listItemRenderer : ListItemLabel;\n\n\tgetListItemId = (index) => {\n\t\tlet menuItemId;\n\n\t\tif (index !== undefined) {\n\t\t\tconst menuId = isFunction(this.getId) ? this.getId() : this.props.id;\n\t\t\tmenuItemId = `${menuId}-item-${index}`;\n\t\t}\n\n\t\treturn menuItemId;\n\t};\n\n\tsetFocus = () => {\n\t\tif (!this.isHover && !this.isUnmounting && this.trigger) {\n\t\t\tReactDOM.findDOMNode(this.trigger).focus(); // eslint-disable-line react/no-find-dom-node\n\t\t}\n\t};\n\n\tgetMenu = () => ReactDOM.findDOMNode(this.list); // eslint-disable-line react/no-find-dom-node\n\n\tgetMenuItem = (index) => {\n\t\tif (index !== undefined && this.listItems) {\n\t\t\treturn ReactDOM.findDOMNode(this.listItems[index]); // eslint-disable-line react/no-find-dom-node\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\tgetCurrentSelectedIndices = (nextProps) => {\n\t\tif (this.props.multiple === true) {\n\t\t\tlet values = [];\n\t\t\tlet currentIndices = [];\n\t\t\tif (!Array.isArray(nextProps.value)) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tvalues.push(nextProps.value);\n\t\t\t} else {\n\t\t\t\tvalues = nextProps.value;\n\t\t\t}\n\t\t\tvalues = values.filter(\n\t\t\t\t(value) => this.getIndexByValue(value, nextProps.options) !== -1\n\t\t\t);\n\t\t\tcurrentIndices = values.map((value) =>\n\t\t\t\tthis.getIndexByValue(value, nextProps.options)\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tselectedIndices: currentIndices,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectedIndex: this.getIndexByValue(nextProps.value, nextProps.options),\n\t\t};\n\t};\n\n\t// Trigger opens, closes, and recieves focus on close\n\tsaveRefToTrigger = (trigger) => {\n\t\tthis.trigger = trigger;\n\n\t\tif (!this.state.triggerRendered) {\n\t\t\tthis.setState({ triggerRendered: true });\n\t\t}\n\n\t\tif (trigger && this.props.requestFocus && this.props.onRequestFocus) {\n\t\t\tthis.props.onRequestFocus(trigger);\n\t\t}\n\t};\n\n\t// TriggerContainer is the wrapping outer DOM element which may differ from the actual trigger which is most likely a `button`.\n\tsaveRefToTriggerContainer = (triggerContainer) => {\n\t\tthis.triggerContainer = triggerContainer;\n\t\tif (!this.trigger) this.trigger = triggerContainer;\n\t};\n\n\tsaveRefToList = (list) => {\n\t\tthis.list = list;\n\t};\n\n\tsaveRefToListItem = (listItem, index) => {\n\t\tif (!this.listItems) {\n\t\t\tthis.listItems = {};\n\t\t}\n\n\t\tthis.listItems[index] = listItem;\n\n\t\tif (index === this.state.focusedIndex) {\n\t\t\tthis.handleKeyboardFocus(this.state.focusedIndex);\n\t\t}\n\t};\n\n\thandleClose = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tif (currentOpenDropdown === this) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\n\t\t\tthis.setState({\n\t\t\t\tisOpen: false,\n\t\t\t});\n\n\t\t\tthis.isHover = false;\n\n\t\t\tif (this.props.onClose) {\n\t\t\t\tthis.props.onClose();\n\t\t\t}\n\t\t}\n\t};\n\n\thandleOpen = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\n\t\t\tcurrentOpenDropdown = this;\n\n\t\t\tthis.setState({\n\t\t\t\tisOpen: true,\n\t\t\t});\n\n\t\t\tif (this.props.onOpen) {\n\t\t\t\tthis.props.onOpen();\n\t\t\t}\n\t\t}\n\t};\n\n\thandleMouseEnter = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tthis.isHover = true;\n\n\t\tif (!isOpen && this.props.openOn === 'hover') {\n\t\t\tthis.handleOpenForHover();\n\t\t} else {\n\t\t\t// we want this clear when openOn is hover or hybrid\n\t\t\tclearTimeout(this.isClosing);\n\t\t}\n\n\t\tif (this.props.onMouseEnter) {\n\t\t\tthis.props.onMouseEnter(event);\n\t\t}\n\t};\n\n\thandleMouseLeave = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (isOpen) {\n\t\t\tthis.isClosing = setTimeout(() => {\n\t\t\t\tthis.handleCloseForHover();\n\t\t\t}, this.props.hoverCloseDelay);\n\t\t}\n\n\t\tif (this.props.onMouseLeave) {\n\t\t\tthis.props.onMouseLeave(event);\n\t\t}\n\t};\n\n\t// Special handlers for openOn === hover\n\t// calling onClick inside onMouseEnter/Leave used to cause double clicking the trigger on hover which caused closing and reopening of the dropdown\n\thandleCloseForHover = () => {\n\t\tconst isOpen = this.getIsOpen();\n\t\tif (isOpen) {\n\t\t\tthis.handleClose();\n\t\t}\n\t};\n\n\thandleOpenForHover = () => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tthis.handleOpen();\n\t\t\tthis.setFocus();\n\t\t}\n\t};\n\n\thandleClick = (event) => {\n\t\tconst isOpen = this.getIsOpen();\n\n\t\tif (!isOpen) {\n\t\t\tthis.handleOpen();\n\t\t\tthis.setFocus();\n\t\t} else {\n\t\t\tthis.handleClose();\n\t\t}\n\n\t\tif (this.props.onClick) {\n\t\t\tthis.props.onClick(event);\n\t\t}\n\t};\n\n\thandleFocus = (event) => {\n\t\tif (this.props.onFocus) {\n\t\t\tthis.props.onFocus(event);\n\t\t}\n\t};\n\n\thandleClickCustomContent = () => {\n\t\tthis.setFocus();\n\t\tthis.handleClose();\n\n\t\tif (this.props.onSelect) {\n\t\t\tthis.props.onSelect();\n\t\t}\n\t};\n\n\thandleSelect = (index) => {\n\t\tif (!this.props.multiple) {\n\t\t\tthis.setState({ selectedIndex: index });\n\t\t\tthis.handleClose();\n\t\t\tthis.setFocus();\n\t\t} else if (\n\t\t\tthis.props.multiple &&\n\t\t\tthis.state.selectedIndices.indexOf(index) === -1\n\t\t) {\n\t\t\t// eslint-disable-next-line react/no-access-state-in-setstate\n\t\t\tconst currentIndices = this.state.selectedIndices.concat(index);\n\t\t\tthis.setState({\n\t\t\t\tselectedIndices: currentIndices,\n\t\t\t});\n\t\t} else if (this.props.multiple) {\n\t\t\tconst deselectIndex = this.state.selectedIndices.indexOf(index);\n\t\t\t// eslint-disable-next-line react/no-access-state-in-setstate\n\t\t\tconst currentSelected = this.state.selectedIndices;\n\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\tcurrentSelected.splice(deselectIndex, 1);\n\t\t\tthis.setState({\n\t\t\t\tselectedIndices: currentSelected,\n\t\t\t});\n\t\t}\n\n\t\tif (this.props.onSelect) {\n\t\t\tconst option = this.getValueByIndex(index);\n\t\t\tthis.props.onSelect(option, { option, optionIndex: index });\n\t\t}\n\t};\n\n\thandleKeyDown = (event) => {\n\t\tif (event.keyCode) {\n\t\t\tif (event.keyCode === KEYS.TAB) {\n\t\t\t\tthis.handleCancel();\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === KEYS.ENTER ||\n\t\t\t\tevent.keyCode === KEYS.SPACE ||\n\t\t\t\tevent.keyCode === KEYS.DOWN ||\n\t\t\t\tevent.keyCode === KEYS.UP ||\n\t\t\t\tevent.keyCode === KEYS.ESCAPE\n\t\t\t) {\n\t\t\t\tEventUtil.trap(event);\n\t\t\t\tconst isOpen = this.getIsOpen();\n\t\t\t\tthis.handleKeyboardNavigate({\n\t\t\t\t\tevent,\n\t\t\t\t\tisOpen,\n\t\t\t\t\tkey: event.key,\n\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\tonSelect: this.handleSelect,\n\t\t\t\t\ttarget: event.target,\n\t\t\t\t\ttoggleOpen: this.toggleOpen,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.props.onKeyDown) {\n\t\t\t\tthis.props.onKeyDown(event);\n\t\t\t}\n\t\t}\n\t};\n\n\thandleCancel = () => {\n\t\tthis.setFocus();\n\t\tthis.handleClose();\n\t};\n\n\thandleClickOutside = () => {\n\t\tthis.handleClose();\n\t};\n\n\t// Handling open / close toggling is optional, and a default implementation is provided for handling focus, but selection _must_ be handled\n\thandleKeyboardNavigate = ({\n\t\tevent,\n\t\tisOpen = true,\n\t\tkeyCode,\n\t\tonFocus = this.handleKeyboardFocus,\n\t\tonSelect,\n\t\ttarget,\n\t\ttoggleOpen = noop,\n\t}) => {\n\t\tkeyboardNavigate({\n\t\t\tcomponentContext: this,\n\t\t\tcurrentFocusedIndex: this.state.focusedIndex,\n\t\t\tevent,\n\t\t\tisOpen,\n\t\t\tkeyCode,\n\t\t\tnavigableItems: this.navigableItems,\n\t\t\tonFocus,\n\t\t\tonSelect,\n\t\t\ttarget,\n\t\t\ttoggleOpen,\n\t\t});\n\t};\n\n\t// This is a bit of an anti-pattern, but it has the upside of being a nice default. Component authors can always override to only set state and do their own focusing in their subcomponents.\n\thandleKeyboardFocus = (focusedIndex) => {\n\t\tif (this.state.focusedIndex !== focusedIndex) {\n\t\t\tthis.setState({ focusedIndex });\n\t\t}\n\n\t\tconst menu = isFunction(this.getMenu) ? this.getMenu() : getMenu(this);\n\n\t\tconst menuItem = isFunction(this.getMenuItem)\n\t\t\t? this.getMenuItem(focusedIndex, menu)\n\t\t\t: getMenuItem(this.getListItemId(focusedIndex));\n\n\t\tif (menuItem) {\n\t\t\tthis.focusMenuItem(menuItem);\n\t\t\tthis.scrollToMenuItem(menu, menuItem);\n\t\t}\n\t};\n\n\tfocusMenuItem = (menuItem) => {\n\t\tmenuItem.getElementsByTagName('a')[0].focus();\n\t};\n\n\tscrollToMenuItem = (menu, menuItem) => {\n\t\tif (menu && menuItem) {\n\t\t\tconst menuHeight = menu.offsetHeight;\n\n\t\t\tconst menuTop = menu.scrollTop;\n\t\t\tconst menuItemTop = menuItem.offsetTop - menu.offsetTop;\n\n\t\t\tif (menuItemTop < menuTop) {\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\tmenu.scrollTop = menuItemTop;\n\t\t\t} else {\n\t\t\t\tconst menuBottom = menuTop + menuHeight + menu.offsetTop;\n\t\t\t\tconst menuItemBottom =\n\t\t\t\t\tmenuItemTop + menuItem.offsetHeight + menu.offsetTop;\n\n\t\t\t\tif (menuItemBottom > menuBottom) {\n\t\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\t\tmenu.scrollTop = menuItemBottom - menuHeight - menu.offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\ttoggleOpen = () => {\n\t\tconst isOpen = this.getIsOpen();\n\t\tthis.setFocus();\n\n\t\tif (isOpen) {\n\t\t\tthis.handleClose();\n\t\t} else {\n\t\t\tthis.handleOpen();\n\t\t}\n\t};\n\n\trenderDefaultMenuContent = (customListProps) => (\n\t\t<List\n\t\t\tkey={`${this.getId()}-dropdown-list`}\n\t\t\tcheckmark={this.props.checkmark}\n\t\t\tgetListItemId={this.getListItemId}\n\t\t\titemRefs={this.saveRefToListItem}\n\t\t\titemRenderer={this.getListItemRenderer()}\n\t\t\tonCancel={this.handleCancel}\n\t\t\tonSelect={this.handleSelect}\n\t\t\toptions={this.props.options}\n\t\t\tref={this.saveRefToList}\n\t\t\tselectedIndex={\n\t\t\t\t!this.props.multiple ? this.state.selectedIndex : undefined\n\t\t\t}\n\t\t\tselectedIndices={\n\t\t\t\tthis.props.multiple ? this.state.selectedIndices : undefined\n\t\t\t}\n\t\t\ttooltipMenuItem={this.props.tooltipMenuItem}\n\t\t\ttriggerId={this.getId()}\n\t\t\tlength={this.props.length}\n\t\t\t{...customListProps}\n\t\t/>\n\t);\n\n\trenderMenuContent = (customContent) => {\n\t\t/**\n\t\t * Custom content for dropdown was a hack done in the past. If there's more than a listbox within a dropdown, then it should be a popover as explained for the `children` prop.\n\t\t *\n\t\t * This code block shows how things are done in the past:\n\t\t * ```\n\t\t * <Dropdown>\n\t\t * <Trigger>\n\t\t * <Button iconCategory=\"utility\" iconName=\"settings\" />\n\t\t * </Trigger>\n\t\t * <div>Look ma! This is Custom Content.</div>\n\t\t * <List options={[myArray]}/>\n\t\t * </Dropdown>\n\t\t * ```\n\t\t */\n\t\tlet customContentWithListPropInjection = [];\n\t\t// Dropdown can take a Trigger component as a child and then return it as the parent DOM element.\n\t\tReact.Children.forEach(customContent, (child) => {\n\t\t\tif (child && child.type.displayName === LIST) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContentWithListPropInjection.push(\n\t\t\t\t\tthis.renderDefaultMenuContent(child.props)\n\t\t\t\t);\n\t\t\t} else if (child) {\n\t\t\t\tconst clonedCustomContent = React.cloneElement(child, {\n\t\t\t\t\tonClick: this.handleClickCustomContent,\n\t\t\t\t\tkey: shortid.generate(),\n\t\t\t\t});\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContentWithListPropInjection.push(clonedCustomContent);\n\t\t\t}\n\t\t});\n\n\t\tif (customContentWithListPropInjection.length === 0) {\n\t\t\tcustomContentWithListPropInjection = null;\n\t\t}\n\n\t\treturn (\n\t\t\tcustomContentWithListPropInjection || this.renderDefaultMenuContent()\n\t\t);\n\t};\n\n\trenderDialog = (customContent, isOpen, outsideClickIgnoreClass) => {\n\t\tlet align = 'bottom';\n\t\tlet hasNubbin = false;\n\t\tlet positionClassName = '';\n\n\t\tif (this.props.nubbinPosition) {\n\t\t\thasNubbin = true;\n\t\t\talign = DropdownToDialogNubbinMapping[this.props.nubbinPosition];\n\t\t} else if (this.props.align) {\n\t\t\talign =\n\t\t\t\tthis.props.align === 'center' ? 'bottom' : `bottom ${this.props.align}`;\n\t\t}\n\n\t\tconst positions = DropdownToDialogNubbinMapping[align].split(' ');\n\t\tpositionClassName = classNames(\n\t\t\tpositions.map((position) => `slds-dropdown_${position}`)\n\t\t);\n\n\t\t// FOR BACKWARDS COMPATIBILITY\n\t\tconst menuPosition = this.props.isInline\n\t\t\t? 'relative'\n\t\t\t: this.props.menuPosition; // eslint-disable-line react/prop-types\n\n\t\tconst menuStylesBase = {};\n\t\tif (this.props.align === 'center' && !hasNubbin) {\n\t\t\tmenuStylesBase.transform = 'none';\n\t\t}\n\n\t\treturn isOpen ? (\n\t\t\t<Dialog\n\t\t\t\talign={align}\n\t\t\t\tclassName={classNames(this.props.containerClassName)}\n\t\t\t\tcloseOnTabKey\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t'slds-dropdown',\n\t\t\t\t\t`slds-dropdown_${this.props.width}`,\n\t\t\t\t\t'slds-text-align_left',\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\tthis.props.className,\n\t\t\t\t\tpositionClassName,\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-dropdown_inverse': this.props.inverse,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tcontext={this.context}\n\t\t\t\thasNubbin={hasNubbin}\n\t\t\t\thasStaticAlignment={this.props.hasStaticAlignment}\n\t\t\t\tinheritWidthOf={this.props.inheritTargetWidth ? 'target' : 'none'}\n\t\t\t\toffset={this.props.offset}\n\t\t\t\tonClose={this.handleClose}\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tposition={menuPosition}\n\t\t\t\tstyle={{\n\t\t\t\t\t...menuStylesBase,\n\t\t\t\t\t...this.props.menuStyle,\n\t\t\t\t}}\n\t\t\t\tonRequestTargetElement={() => this.trigger}\n\t\t\t>\n\t\t\t\t{this.renderMenuContent(customContent)}\n\t\t\t</Dialog>\n\t\t) : null;\n\t};\n\n\trenderOverlay = (isOpen) => {\n\t\tif (isFunction(overlay) && documentDefined) {\n\t\t\toverlay(isOpen, overlay);\n\t\t} else if (\n\t\t\tthis.props.overlay &&\n\t\t\tisOpen &&\n\t\t\t!this.overlay &&\n\t\t\tdocumentDefined\n\t\t) {\n\t\t\tthis.overlay = overlay;\n\t\t\tdocument.querySelector('body').appendChild(this.overlay);\n\t\t} else if (!isOpen && this.overlay && this.overlay.parentNode) {\n\t\t\tthis.overlay.parentNode.removeChild(this.overlay);\n\t\t\tthis.overlay = undefined;\n\t\t}\n\t};\n\n\trender() {\n\t\t// Dropdowns are used by other components. The default trigger is a button, but some other components use `li` elements. The following allows `MenuDropdown` to be extended by providing a child component with the displayName of `DropdownTrigger`.\n\t\tlet CurrentTrigger = DefaultTrigger;\n\n\t\tlet CustomTriggerChildProps = {};\n\n\t\t// Child elements that do not have the display name of the value of `MENU_DROPDOWN_TRIGGER` in `components/constants.js` will be considered custom content and rendered in the popover.\n\t\tlet customContent = [];\n\n\t\t// Dropdown can take a Trigger component as a child and then return it as the parent DOM element.\n\t\tReact.Children.forEach(this.props.children, (child) => {\n\t\t\tif (child && child.type.displayName === MENU_DROPDOWN_TRIGGER) {\n\t\t\t\t// `CustomTriggerChildProps` is not used by the default button Trigger, but by other triggers\n\t\t\t\tCustomTriggerChildProps = child.props;\n\t\t\t\tCurrentTrigger = child.type;\n\t\t\t} else if (child) {\n\t\t\t\t// eslint-disable-next-line fp/no-mutating-methods\n\t\t\t\tcustomContent.push(child);\n\t\t\t}\n\t\t});\n\n\t\tif (customContent.length === 0) {\n\t\t\tcustomContent = null;\n\t\t}\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${this.getId()}`;\n\t\tconst isOpen = !this.props.disabled && this.getIsOpen() && !!this.trigger;\n\n\t\tthis.renderOverlay(isOpen);\n\n\t\t/* Below are three sections of props:\n\t\t - The first are the props that may be given by the dropdown component. These may get deprecated in the future.\n\t\t - The next set of props (`CustomTriggerChildProps`) are props that can be overwritten by the end developer.\n\t\t - The final set are props that should not be overwritten, since they are ones that tie the trigger to the dropdown menu.\n\t\t*/\n\n\t\treturn (\n\t\t\t<CurrentTrigger\n\t\t\t\taria-haspopup\n\t\t\t\tassistiveText={this.props.assistiveText}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\toutsideClickIgnoreClass,\n\t\t\t\t\tthis.props.buttonClassName\n\t\t\t\t)}\n\t\t\t\tdisabled={this.props.disabled}\n\t\t\t\thint={this.props.hint}\n\t\t\t\ticonCategory={this.props.iconCategory}\n\t\t\t\ticonName={this.props.iconName}\n\t\t\t\ticonPosition={this.props.iconPosition}\n\t\t\t\ticonSize={this.props.iconSize}\n\t\t\t\ticonVariant={this.props.iconVariant}\n\t\t\t\tid={this.getId()}\n\t\t\t\tinverse={this.props.buttonInverse}\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tlabel={this.props.label}\n\t\t\t\tmenu={this.renderDialog(customContent, isOpen, outsideClickIgnoreClass)}\n\t\t\t\tonBlur={this.props.onBlur}\n\t\t\t\tonClick={\n\t\t\t\t\tthis.props.openOn === 'click' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleClick\n\t\t\t\t\t\t: this.props.onClick\n\t\t\t\t}\n\t\t\t\tonFocus={this.handleFocus}\n\t\t\t\tonKeyDown={this.handleKeyDown}\n\t\t\t\tonMouseDown={this.props.onMouseDown}\n\t\t\t\tonMouseEnter={\n\t\t\t\t\tthis.props.openOn === 'hover' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleMouseEnter\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\tonMouseLeave={\n\t\t\t\t\tthis.props.openOn === 'hover' || this.props.openOn === 'hybrid'\n\t\t\t\t\t\t? this.handleMouseLeave\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\topenOn={this.props.openOn}\n\t\t\t\tref={this.saveRefToTriggerContainer}\n\t\t\t\tstyle={this.props.style}\n\t\t\t\ttabIndex={this.props.tabIndex || (isOpen ? '-1' : '0')}\n\t\t\t\ttooltip={this.props.tooltip}\n\t\t\t\ttriggerClassName={this.props.triggerClassName}\n\t\t\t\ttriggerRef={this.saveRefToTrigger}\n\t\t\t\tvariant={this.props.buttonVariant}\n\t\t\t\t{...CustomTriggerChildProps}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nMenuDropdown.contextType = IconSettingsContext;\nMenuDropdown.propTypes = propTypes;\nMenuDropdown.defaultProps = defaultProps;\n\nexport default MenuDropdown;\nexport { ListItem, ListItemLabel, DropdownNubbinPositions };\n"],"file":"menu-dropdown.js"}
@@ -20,7 +20,7 @@ declare module '@salesforce/design-system-react/components/setup-assistant' {
20
20
  /**
21
21
  * Function to handle opening / closing of steps when the step is expandable. Passes event object and step `index`, `isOpen`, and `step` props as data.
22
22
  */
23
- onStepToggleIsOpen?: (v: any) => any;
23
+ onStepToggleIsOpen?: (event: React.SyntheticEvent, v: any) => any;
24
24
  /**
25
25
  * Accepts a progress bar component, which will only be visible if `isCard` is enabled
26
26
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/design-system-react",
3
- "version": "0.10.39",
3
+ "version": "0.10.40",
4
4
  "description": "Salesforce Lightning Design System for React",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "engines": {},