{"version":3,"sources":["../../src/useControllableValue.ts","../../src/components/Checkbox/Checkbox.base.tsx","../../src/components/Checkbox/Checkbox.styles.ts","../../src/components/Checkbox/Checkbox.tsx","../../src/components/Autofill/Autofill.tsx","../../src/utilities/selectableOption/SelectableOption.types.ts","../../src/components/ComboBox/ComboBox.styles.ts","../../src/components/ComboBox/ComboBox.classNames.ts","../../src/components/ComboBox/ComboBox.tsx","../../src/components/Button/ActionButton/ActionButton.styles.ts","../../src/components/Button/CommandButton/CommandButton.tsx","../../src/components/Button/ActionButton/ActionButton.tsx","../../src/utilities/selectableOption/SelectableOption.ts"],"names":["useControllableValue","controlledValue","defaultUncontrolledValue","onChange","_a","React","value","setValue","isControlled","useConst","undefined","currentValue","valueRef","onChangeRef","current","setValueOrCallOnChange","update","ev","newValue","getClassNames","classNamesFunction","CheckboxBase","props","forwardedRef","disabled","required","inputProps","name","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaPositionInSet","ariaSetSize","title","label","checkmarkIconProps","styles","theme","className","boxSide","id","useId","rootRef","mergedRootRefs","useMergedRefs","inputRef","_b","checked","defaultChecked","isChecked","setIsChecked","_c","indeterminate","defaultIndeterminate","isIndeterminate","setIsIndeterminate","useFocusRects","checkBoxRef","componentRef","focus","useComponentRef","classNames","reversed","isUsingCustomLabelRender","onRenderLabel","defaultLabelRenderer","checkboxProps","text","ariaChecked","mergedInputProps","__assign","input","type","root","ref","htmlFor","checkbox","Icon","iconName","checkmark","displayName","GlobalClassNames","Checkbox","styled","semanticColors","effects","palette","fonts","getGlobalClassNames","checkmarkFontColor","inputForegroundChecked","checkmarkFontColorHovered","neutralSecondary","checkboxBorderColor","neutralPrimary","checkboxBorderIndeterminateColor","inputBackgroundChecked","checkboxBorderColorChecked","checkboxBorderColorDisabled","disabledBodySubtext","checkboxBorderHoveredColor","inputBorderHovered","checkboxBorderIndeterminateHoveredColor","inputBackgroundCheckedHovered","checkboxBackgroundChecked","checkboxBackgroundCheckedHovered","checkboxBorderColorCheckedHovered","checkboxHoveredTextColor","inputTextHovered","checkboxBackgroundDisabledChecked","checkboxTextColor","bodyText","checkboxTextColorDisabled","disabledText","indeterminateDotStyles","content","borderRadius","roundedCorner2","position","width","height","top","left","boxSizing","borderWidth","borderStyle","borderColor","transitionProperty","transitionDuration","transitionTimingFunction","HighContrastSelector","display","_d","color","opacity","_e","background","_f","_g","_h","_j","_k","_l","IsFocusVisibleClassName","_m","outline","outlineOffset","medium","alignItems","cursor","userSelect","flexDirection","justifyContent","right","bottom","pointerEvents","flexShrink","border","overflow","_o","getHighContrastNoAdjustStyle","marginLeft","marginRight","_p","_q","_r","_s","fontSize","lineHeight","_t","scope","Autofill","_super","_this","call","_inputElement","_autoFillEnabled","_isComposing","_onCompositionStart","_onCompositionUpdate","isIE11","_updateValue","_getCurrentInputValue","_onCompositionEnd","inputValue","_tryEnableAutofill","_async","setTimeout","_onClick","_onKeyDown","onKeyDown","nativeEvent","isComposing","which","KeyCodes","backspace","setState","suggestedDisplayValue","enableAutofillOnKeyPress","indexOf","_onInputChanged","nativeEventComposing","_onChanged","composing","onInputChange","onInputValueChange","initializeComponentRef","Async","state","defaultVisibleValue","__extends","getDerivedStateFromProps","updateValueInWillReceiveProps","updatedInputValue","Object","defineProperty","prototype","this","inputElement","selectionDirection","selectionEnd","selectionStart","Boolean","_getControlledValue","componentDidUpdate","shouldSelectFullInputValueInComponentDidUpdate","differenceIndex","preventValueSelection","_doesTextStartWith","shouldSelectFullRange","setSelectionRange","length","toLocaleLowerCase","componentWillUnmount","dispose","render","nativeProps","getNativeProps","inputProperties","autoCapitalize","autoComplete","_getDisplayValue","onCompositionStart","onCompositionUpdate","onCompositionEnd","onInput","onClick","clear","target","oldValue","isComposed","displayValue","console","warn","toString","defaultProps","down","up","startWith","SelectableOptionMenuItemType","getDisabledStyles","memoizeFunction","backgroundColor","disabledBackground","selectors","listOptionHighContrastStyles","inputHighContrastStyles","getOptionStyles","customStylesForAllOptions","customOptionStylesForCurrentOption","isPending","isHidden","option","textHoveredColor","menuItemTextHovered","textSelectedColor","neutralDark","textDisabledColor","backgroundHoveredColor","menuItemBackgroundHovered","backgroundPressedColor","menuItemBackgroundPressed","optionStyles","minHeight","padding","wordWrap","overflowWrap","textAlign","rootHovered","rootFocused","rootChecked","getFocusStyle","inset","isFocusedOnly","rootDisabled","optionText","whiteSpace","textOverflow","minWidth","maxWidth","optionTextWrapper","concatStyleSets","getCaretDownButtonStyles","customStyles","caret","buttonTextColor","bodySubtext","buttonTextHoveredCheckedColor","buttonTextChecked","buttonBackgroundHoveredColor","listItemBackgroundHovered","buttonBackgroundCheckedColor","listItemBackgroundChecked","buttonBackgroundCheckedHoveredColor","listItemBackgroundCheckedHovered","buttonHighContrastStyles","small","icon","rootPressed","rootCheckedHovered","getStyles","comboBoxOptionWidth","textColor","inputText","inputBorder","borderHoveredColor","borderPressedColor","inputFocusBorderAlt","borderFocusedColor","inputBackground","erroredColor","errorText","headerTextColor","menuHeader","dividerBorderColor","bodyDivider","placeholderHighContrastStyles","placeholderStyles","inputPlaceholderText","placeholderStylesHovered","disabledPlaceholderStyles","ComboBoxRootHighContrastFocused","focusBorderStyles","getInputFocusStyle","container","labelDisabled","boxShadow","paddingRight","paddingLeft","marginBottom","getPlaceholderStyles","rootError","rootDisallowFreeForm","font","inputDisabled","errorMessage","marginTop","callout","elevation8","optionsContainerWrapper","optionsContainer","screenReaderText","hiddenContentStyle","header","fontWeight","FontWeights","semibold","divider","isOpen","focused","allowFreeForm","hasErrorMessage","mergeStyles","getComboBoxOptionClassNames","SearchDirection","HoverStatus","baseButtonStyles","getBaseButtonStyles","actionButtonStyles","themePrimary","iconHovered","black","rootExpanded","iconPressed","themeDarker","neutralTertiary","iconChecked","flexContainer","themeDarkAlt","iconDisabled","menuIcon","textContainer","flexGrow","CommandButton","ActionButton","BaseButton","variantClassName","onRenderDescription","nullRender","__decorate","customizable","ComboBoxOptionWrapper","oldProps","__rest","newProps","shallowCompare","DEFAULT_PROPS","options","allowFreeform","buttonIconProps","useOptionsState","defaultSelectedKey","selectedKey","selectedKeys","buildSelectedKeys","selectedIndices","setSelectedIndices","currentOptions","setCurrentOptions","setSuggestedDisplayValue","indices","getSelectedIndices","ComboBox","propsWithoutDefaults","getPropsWithDefaults","mergedRootRef","ComboBoxInternal","hoisted","_autofill","_comboBoxWrapper","_comboBoxMenu","_selectedElement","shouldOpenOnFocus","useFocusAsync","focusAsync","_hasFocus","focusState","dismissMenu","_onUpdateValueInAutofillWillReceiveProps","comboBox","visibleValue","normalizeToString","_currentVisibleValue","_renderComboBoxWrapper","multiselectAccessibleText","errorMessageId","isButtonAriaHidden","placeholderProp","placeholder","tabIndex","autofill","iconButtonProps","multiSelect","_id","_classNames","onFocus","_onFocus","onBlur","_onBlur","_onInputKeyDown","onKeyUp","_onInputKeyUp","_onAutofillClick","onTouchStart","_onTouchStart","_onInputChange","_getAriaAutoCompleteValue","role","readOnly","mergeAriaAttributeValues","_getAriaActiveDescendantValue","spellCheck","_onShouldSelectFullInputValueInAutofillComponentDidUpdate","IconButton","_getCaretButtonStyles","_onComboBoxClick","iconProps","_getVisibleValue","currentPendingValueValidIndex","currentPendingValue","currentPendingIndexValid","indexWithinBounds","index","_getPendingString","_getMultiselectDisplayString","_getFirstSelectedIndex","updatedValue","_handleInputWhenDisabled","_processInputChangeWithFreeform","_processInputChangeWithoutFreeform","select","_onResolveOptions","onResolveOptions","newOptions","__spreadArrays","Array","isArray","then","promise_1","_currentPromise","newOptionsFromPromise","event","relatedTarget","document","activeElement","isBlurFromComboBoxTitle","contains","isBlurFromComboBoxMenu","isBlurFromComboBoxMenuAncestor","findElementRecursive","element","_submitPendingValue","preventDefault","stopPropagation","_onRenderContainer","onRenderList","calloutProps","dropdownWidth","dropdownMaxWidth","onRenderUpperContent","_onRenderUpperContent","onRenderLowerContent","_onRenderLowerContent","useComboBoxAsMenuWidth","persistMenu","shouldRestoreFocus","comboBoxMenuWidth","clientWidth","Callout","isBeakVisible","gapSpace","doNotLayer","directionalHint","DirectionalHint","bottomLeftEdge","directionalHintFixed","onLayerMounted","_onLayerMounted","css","onDismiss","_onDismiss","onMouseDown","_onCalloutMouseDown","onScroll","_onScroll","setInitialFocus","calloutWidth","calloutMaxWidth","hidden","_onRenderList","_onCalloutLayerMounted","_onRenderLabel","onRenderLabelProps","Label","onRenderItem","map","item","_onRenderItem","itemType","Divider","_renderSeparator","Header","_renderHeader","_renderOption","onRenderOption","_onRenderOptionContent","isSelected","_isOptionSelected","_isOptionChecked","_getCurrentOptionStyles","optionClassNames","getPreviewText","onRenderCheckboxLabel","key","_onItemClick","onMouseEnter","_onOptionMouseEnter","bind","onMouseMove","_onOptionMouseMove","onMouseLeave","_onOptionMouseLeave","data","_isScrollIdle","_scrollIdleTimeoutId","clearTimeout","onMenuDismiss","_setOpenStateAndFocusOnClose","_resetSelectedIndex","_onAfterClearPendingInfo","_processingClearPendingInfo","currentPendingValueValidIndexOnHover","_lastKeyDownWasAltOrMeta","isAltOrMeta","_getPendingSelectedIndex","enter","tab","escape","clearAll","altKey","metaKey","_setPendingInfoFromIndexAndDirection","backward","forward","home","end","directionToSearch","space","keyCode","alt","keyPressIsAltOrMetaAlone","shouldHandleKey","isMac","isIOS","openOnKeyboardFocus","_shouldIgnoreMouseEvent","_processingTouch","_handleTouchAndPointerEvent","_onPointerDown","pointerType","stopImmediatePropagation","_events","EventGroup","warnMutuallyExclusive","getId","_gotMouseMove","default","selectedOptions","_i","selectedIndices_1","push","getAllSelectedOptions","componentDidMount","on","prevProps","prevState","onMenuOpen","onMenuDismissed","_scrollIntoView","_focusInputAfterClose","_notifyPendingValueChanged","onRenderContainer","divProps","divProperties","comboBoxWrapper","displayValues","idx","multiSelectDelimiter","join","newCurrentPendingValueValidIndex","items","filter","isNormalOption","_setPendingInfo","originalUpdatedValue","newSuggestedDisplayValue","_autoCompleteTimeout","i","_setPendingInfoFromIndex","_getNextSelectableIndex","searchDirection","newIndex","Math","max","min","none","_setSelectedIndex","submitPendingValueEvent","onPendingValueChanged","initialIndices","slice","selected","persist","_hasPendingValue","changedOptions","_clearPendingInfo","pendingOptionText","isValueSelected","newOption","concat","includeCurrentPendingValue","onScrollToItem","scrollSelectedToTop","offsetParent","scrollIntoView","alignToTop","scrollableParentRect","getBoundingClientRect","selectedElementRect","onItemClick","selectedIndex","indexUpdate","newPendingIndex","newPendingValue","focusInputAfterClose","_lastTouchTimeoutId","customCaretDownButtonStyles","caretDownButtonStyles","comboBoxOptionStyles","customStylesForCurrentOption","_isPendingOption","descendantText","forEach","findIndex","selectedKeys_1","keys","Number","sort","useAriaLabelAsText"],"mappings":"6FAAA,sDAmCM,SAAUA,EAKdC,EACAC,EACAC,GAEM,IAAAC,EAAAC,WAAAH,GAACI,EAAAF,EAAA,GAAOG,EAAAH,EAAA,GACRI,EAAeC,iBAAsCC,IAApBT,GACjCU,EAAeH,EAAeP,EAAkBK,EAIhDM,EAAWP,SAAaM,GACxBE,EAAcR,SAAaF,GACjCE,aAAgB,WACdO,EAASE,QAAUH,EACnBE,EAAYC,QAAUX,KAKxB,IAAMY,EAAyBN,aAAS,WAAM,gBAACO,EAAkDC,GAG/F,IAAMC,EAA6B,oBAAXF,EAAyBA,EAAoBJ,EAASE,SAAWE,EAErFH,EAAYC,SACdD,EAAYC,QAAQG,EAAKC,GAGtBV,GACHD,EAASW,OAIb,MAAO,CAACP,EAAcI,K,sJCnElBI,EAAgBC,cAETC,EAAwDhB,cACnE,SAACiB,EAAOC,GAEJ,IAAAC,EAAAF,EAAAE,SACAC,EAAAH,EAAAG,SACAC,EAAAJ,EAAAI,WACAC,EAAAL,EAAAK,KACAC,EAAAN,EAAAM,UACAC,EAAAP,EAAAO,eACAC,EAAAR,EAAAQ,gBACAC,EAAAT,EAAAS,kBACAC,EAAAV,EAAAU,YACAC,EAAAX,EAAAW,MACAC,EAAAZ,EAAAY,MACAC,EAAAb,EAAAa,mBACAC,EAAAd,EAAAc,OACAC,EAAAf,EAAAe,MACAC,EAAAhB,EAAAgB,UACAlC,EAAAkB,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hB,UAAYghB,EAAKhhB,UAAYghB,EAAKze,KAM3E,SAAS8gB,GAAYhkB,GAEnB,OAAOA,EAAGgL,QAAUC,IAAS+Z,KAAkB,SAAXhlB,EAAG4iB","file":"static/js/2.0c896934.chunk.js","sourcesContent":["import * as React from 'react';\nimport { useConst } from './useConst';\n\nexport type ChangeCallback<\n TElement extends HTMLElement,\n TValue,\n TEvent extends React.SyntheticEvent<TElement> | undefined\n> = (ev: TEvent, newValue: TValue | undefined) => void;\n\n/**\n * Hook to manage a value that could be either controlled or uncontrolled, such as a checked state or\n * text box string.\n * @param controlledValue - The controlled value passed in the props. This value will always be used if provided,\n * and the internal state will be updated to reflect it.\n * @param defaultUncontrolledValue - Initial value for the internal state in the uncontrolled case.\n * @returns An array of the current value and an updater callback. Like `React.useState`, the updater\n * callback always has the same identity, and it can take either a new value, or a function which\n * is passed the previous value and returns the new value.\n * @see https://reactjs.org/docs/uncontrolled-components.html\n */\nexport function useControllableValue<TValue, TElement extends HTMLElement>(\n controlledValue: TValue | undefined,\n defaultUncontrolledValue: TValue | undefined,\n): Readonly<[TValue | undefined, (update: React.SetStateAction<TValue | undefined>) => void]>;\nexport function useControllableValue<\n TValue,\n TElement extends HTMLElement,\n TEvent extends React.SyntheticEvent<TElement> | undefined\n>(\n controlledValue: TValue | undefined,\n defaultUncontrolledValue: TValue | undefined,\n onChange: ChangeCallback<TElement, TValue, TEvent> | undefined,\n): Readonly<\n [TValue | undefined, (update: React.SetStateAction<TValue | undefined>, ev?: React.FormEvent<TElement>) => void]\n>;\nexport function useControllableValue<\n TValue,\n TElement extends HTMLElement,\n TEvent extends React.SyntheticEvent<TElement> | undefined\n>(\n controlledValue: TValue | undefined,\n defaultUncontrolledValue: TValue | undefined,\n onChange?: ChangeCallback<TElement, TValue, TEvent>,\n) {\n const [value, setValue] = React.useState<TValue | undefined>(defaultUncontrolledValue);\n const isControlled = useConst<boolean>(controlledValue !== undefined);\n const currentValue = isControlled ? controlledValue : value;\n\n // Duplicate the current value and onChange in refs so they're accessible from\n // setValueOrCallOnChange without creating a new callback every time\n const valueRef = React.useRef(currentValue);\n const onChangeRef = React.useRef(onChange);\n React.useEffect(() => {\n valueRef.current = currentValue;\n onChangeRef.current = onChange;\n });\n\n // To match the behavior of the setter returned by React.useState, this callback's identity\n // should never change. This means it MUST NOT directly reference variables that can change.\n const setValueOrCallOnChange = useConst(() => (update: React.SetStateAction<TValue | undefined>, ev?: TEvent) => {\n // Assuming here that TValue is not a function, because a controllable value will typically\n // be something a user can enter as input\n const newValue = typeof update === 'function' ? (update as Function)(valueRef.current) : update;\n\n if (onChangeRef.current) {\n onChangeRef.current(ev!, newValue);\n }\n\n if (!isControlled) {\n setValue(newValue);\n }\n });\n\n return [currentValue, setValueOrCallOnChange] as const;\n}\n","import * as React from 'react';\nimport { useControllableValue, useId, useMergedRefs, useWarnings } from '@fluentui/react-hooks';\nimport { useFocusRects, classNamesFunction } from '@fluentui/utilities';\nimport { Icon } from '../Icon/Icon';\nimport { ICheckboxProps, ICheckboxStyleProps, ICheckboxStyles } from './Checkbox.types';\n\nconst getClassNames = classNamesFunction<ICheckboxStyleProps, ICheckboxStyles>();\n\nexport const CheckboxBase: React.FunctionComponent<ICheckboxProps> = React.forwardRef<HTMLDivElement, ICheckboxProps>(\n (props, forwardedRef) => {\n const {\n disabled,\n required,\n inputProps,\n name,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaPositionInSet,\n ariaSetSize,\n title,\n label,\n checkmarkIconProps,\n styles,\n theme,\n className,\n boxSide = 'start',\n } = props;\n\n const id = useId('checkbox-', props.id);\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const mergedRootRefs: React.Ref<HTMLDivElement> = useMergedRefs(rootRef, forwardedRef);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const [isChecked, setIsChecked] = useControllableValue(props.checked, props.defaultChecked, props.onChange);\n const [isIndeterminate, setIsIndeterminate] = useControllableValue(props.indeterminate, props.defaultIndeterminate);\n\n useFocusRects(rootRef);\n useDebugWarning(props);\n useComponentRef(props, isChecked, isIndeterminate, inputRef);\n\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n disabled,\n indeterminate: isIndeterminate,\n checked: isChecked,\n reversed: boxSide !== 'start',\n isUsingCustomLabelRender: !!props.onRenderLabel,\n });\n\n const onChange = (ev: React.ChangeEvent<HTMLElement>): void => {\n if (isIndeterminate) {\n // If indeterminate, clicking the checkbox *only* removes the indeterminate state (or if\n // controlled, lets the consumer know to change it by calling onChange). It doesn't\n // change the checked state.\n setIsChecked(!!isChecked, ev);\n setIsIndeterminate(false);\n } else {\n setIsChecked(!isChecked, ev);\n }\n };\n\n const defaultLabelRenderer = React.useCallback(\n (checkboxProps?: ICheckboxProps): JSX.Element | null => {\n if (!checkboxProps) {\n return null;\n }\n return checkboxProps.label ? (\n <span aria-hidden=\"true\" className={classNames.text} title={checkboxProps.title}>\n {checkboxProps.label}\n </span>\n ) : null;\n },\n [classNames.text],\n );\n\n const onRenderLabel = props.onRenderLabel || defaultLabelRenderer;\n\n const ariaChecked: React.InputHTMLAttributes<HTMLInputElement>['aria-checked'] = isIndeterminate\n ? 'mixed'\n : isChecked\n ? 'true'\n : 'false';\n\n const mergedInputProps: React.InputHTMLAttributes<HTMLInputElement> = {\n className: classNames.input,\n type: 'checkbox' as React.InputHTMLAttributes<HTMLInputElement>['type'],\n ...inputProps,\n checked: !!isChecked,\n disabled,\n required,\n name,\n id,\n title,\n onChange,\n 'aria-disabled': disabled,\n 'aria-label': ariaLabel || label,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-posinset': ariaPositionInSet,\n 'aria-setsize': ariaSetSize,\n 'aria-checked': ariaChecked,\n };\n\n return (\n <div className={classNames.root} title={title} ref={mergedRootRefs}>\n <input {...mergedInputProps} ref={inputRef} data-ktp-execute-target={true} />\n <label className={classNames.label} htmlFor={id}>\n <div className={classNames.checkbox} data-ktp-target={true}>\n <Icon iconName=\"CheckMark\" {...checkmarkIconProps} className={classNames.checkmark} />\n </div>\n {onRenderLabel(props, defaultLabelRenderer)}\n </label>\n </div>\n );\n },\n);\n\nCheckboxBase.displayName = 'CheckboxBase';\n\nfunction useDebugWarning(props: ICheckboxProps) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks -- build-time conditional\n useWarnings({\n name: 'Checkbox',\n props,\n mutuallyExclusive: {\n checked: 'defaultChecked',\n indeterminate: 'defaultIndeterminate',\n },\n });\n }\n}\n\nfunction useComponentRef(\n props: ICheckboxProps,\n isChecked: boolean | undefined,\n isIndeterminate: boolean | undefined,\n checkBoxRef: React.RefObject<HTMLInputElement>,\n) {\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n get checked() {\n return !!isChecked;\n },\n get indeterminate() {\n return !!isIndeterminate;\n },\n focus() {\n if (checkBoxRef.current) {\n checkBoxRef.current.focus();\n }\n },\n }),\n [checkBoxRef, isChecked, isIndeterminate],\n );\n}\n","import { ICheckboxStyleProps, ICheckboxStyles } from './Checkbox.types';\nimport {\n HighContrastSelector,\n getGlobalClassNames,\n IStyle,\n getHighContrastNoAdjustStyle,\n} from '@fluentui/style-utilities';\nimport { IsFocusVisibleClassName } from '@fluentui/utilities';\n\nconst GlobalClassNames = {\n root: 'ms-Checkbox',\n label: 'ms-Checkbox-label',\n checkbox: 'ms-Checkbox-checkbox',\n checkmark: 'ms-Checkbox-checkmark',\n text: 'ms-Checkbox-text',\n};\n\nconst MS_CHECKBOX_LABEL_SIZE = '20px';\nconst MS_CHECKBOX_TRANSITION_DURATION = '200ms';\nconst MS_CHECKBOX_TRANSITION_TIMING = 'cubic-bezier(.4, 0, .23, 1)';\n\nexport const getStyles = (props: ICheckboxStyleProps): ICheckboxStyles => {\n const { className, theme, reversed, checked, disabled, isUsingCustomLabelRender, indeterminate } = props;\n const { semanticColors, effects, palette, fonts } = theme;\n\n const classNames = getGlobalClassNames(GlobalClassNames, theme);\n\n const checkmarkFontColor = semanticColors.inputForegroundChecked;\n // TODO: after updating the semanticColors slots mapping this needs to be semanticColors.inputBorder\n const checkmarkFontColorHovered = palette.neutralSecondary;\n // TODO: after updating the semanticColors slots mapping this needs to be semanticColors.smallInputBorder\n const checkboxBorderColor = palette.neutralPrimary;\n const checkboxBorderIndeterminateColor = semanticColors.inputBackgroundChecked;\n const checkboxBorderColorChecked = semanticColors.inputBackgroundChecked;\n const checkboxBorderColorDisabled = semanticColors.disabledBodySubtext;\n const checkboxBorderHoveredColor = semanticColors.inputBorderHovered;\n const checkboxBorderIndeterminateHoveredColor = semanticColors.inputBackgroundCheckedHovered;\n const checkboxBackgroundChecked = semanticColors.inputBackgroundChecked;\n // TODO: after updating the semanticColors slots mapping the following 2 tokens need to be\n // semanticColors.inputBackgroundCheckedHovered\n const checkboxBackgroundCheckedHovered = semanticColors.inputBackgroundCheckedHovered;\n const checkboxBorderColorCheckedHovered = semanticColors.inputBackgroundCheckedHovered;\n const checkboxHoveredTextColor = semanticColors.inputTextHovered;\n const checkboxBackgroundDisabledChecked = semanticColors.disabledBodySubtext;\n const checkboxTextColor = semanticColors.bodyText;\n const checkboxTextColorDisabled = semanticColors.disabledText;\n\n const indeterminateDotStyles: IStyle = [\n {\n content: '\"\"',\n borderRadius: effects.roundedCorner2,\n position: 'absolute',\n width: 10,\n height: 10,\n top: 4,\n left: 4,\n boxSizing: 'border-box',\n borderWidth: 5,\n borderStyle: 'solid',\n borderColor: disabled ? checkboxBorderColorDisabled : checkboxBorderIndeterminateColor,\n transitionProperty: 'border-width, border, border-color',\n transitionDuration: MS_CHECKBOX_TRANSITION_DURATION,\n transitionTimingFunction: MS_CHECKBOX_TRANSITION_TIMING,\n [HighContrastSelector]: {\n borderColor: 'WindowText',\n },\n },\n ];\n\n return {\n root: [\n classNames.root,\n {\n position: 'relative',\n display: 'flex',\n },\n reversed && 'reversed',\n checked && 'is-checked',\n !disabled && 'is-enabled',\n disabled && 'is-disabled',\n !disabled && [\n !checked && {\n [`:hover .${classNames.checkbox}`]: {\n borderColor: checkboxBorderHoveredColor,\n [HighContrastSelector]: {\n borderColor: 'Highlight',\n },\n },\n [`:focus .${classNames.checkbox}`]: { borderColor: checkboxBorderHoveredColor },\n [`:hover .${classNames.checkmark}`]: {\n color: checkmarkFontColorHovered,\n opacity: '1',\n [HighContrastSelector]: {\n color: 'Highlight',\n },\n },\n },\n checked &&\n !indeterminate && {\n [`:hover .${classNames.checkbox}`]: {\n background: checkboxBackgroundCheckedHovered,\n borderColor: checkboxBorderColorCheckedHovered,\n },\n [`:focus .${classNames.checkbox}`]: {\n background: checkboxBackgroundCheckedHovered,\n borderColor: checkboxBorderColorCheckedHovered,\n },\n [HighContrastSelector]: {\n [`:hover .${classNames.checkbox}`]: {\n background: 'Highlight',\n borderColor: 'Highlight',\n },\n [`:focus .${classNames.checkbox}`]: {\n background: 'Highlight',\n },\n [`:focus:hover .${classNames.checkbox}`]: {\n background: 'Highlight',\n },\n [`:focus:hover .${classNames.checkmark}`]: {\n color: 'Window',\n },\n [`:hover .${classNames.checkmark}`]: {\n color: 'Window',\n },\n },\n },\n indeterminate && {\n [`:hover .${classNames.checkbox}, :hover .${classNames.checkbox}:after`]: {\n borderColor: checkboxBorderIndeterminateHoveredColor,\n [HighContrastSelector]: {\n borderColor: 'WindowText',\n },\n },\n [`:focus .${classNames.checkbox}`]: {\n borderColor: checkboxBorderIndeterminateHoveredColor,\n },\n [`:hover .${classNames.checkmark}`]: {\n opacity: '0',\n },\n },\n {\n [`:hover .${classNames.text}, :focus .${classNames.text}`]: {\n color: checkboxHoveredTextColor,\n [HighContrastSelector]: {\n color: disabled ? 'GrayText' : 'WindowText',\n },\n },\n },\n ],\n className,\n ],\n input: {\n position: 'absolute',\n background: 'none',\n\n opacity: 0,\n [`.${IsFocusVisibleClassName} &:focus + label::before`]: {\n outline: '1px solid ' + theme.palette.neutralSecondary,\n outlineOffset: '2px',\n [HighContrastSelector]: {\n outline: '1px solid WindowText',\n },\n },\n },\n label: [\n classNames.label,\n theme.fonts.medium,\n {\n display: 'flex',\n alignItems: isUsingCustomLabelRender ? 'center' : 'flex-start',\n cursor: disabled ? 'default' : 'pointer',\n position: 'relative',\n userSelect: 'none',\n },\n reversed && {\n flexDirection: 'row-reverse',\n justifyContent: 'flex-end',\n },\n {\n '&::before': {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n content: '\"\"',\n pointerEvents: 'none',\n },\n },\n ],\n checkbox: [\n classNames.checkbox,\n {\n position: 'relative',\n display: 'flex',\n flexShrink: 0,\n alignItems: 'center',\n justifyContent: 'center',\n height: MS_CHECKBOX_LABEL_SIZE,\n width: MS_CHECKBOX_LABEL_SIZE,\n border: `1px solid ${checkboxBorderColor}`,\n borderRadius: effects.roundedCorner2,\n boxSizing: 'border-box',\n transitionProperty: 'background, border, border-color',\n transitionDuration: MS_CHECKBOX_TRANSITION_DURATION,\n transitionTimingFunction: MS_CHECKBOX_TRANSITION_TIMING,\n\n /* in case the icon is bigger than the box */\n overflow: 'hidden',\n ':after': indeterminate ? indeterminateDotStyles : null,\n [HighContrastSelector]: {\n borderColor: 'WindowText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n indeterminate && {\n borderColor: checkboxBorderIndeterminateColor,\n },\n !reversed\n ? // This margin on the checkbox is for backwards compat. Notably it has the effect where a customRender\n // is used, there will be only a 4px margin from checkbox to label. The label by default would have\n // another 4px margin for a total of 8px margin between checkbox and label. We don't combine the two\n // (and move it into the text) to not incur a breaking change for everyone using custom render atm.\n {\n marginRight: 4,\n }\n : {\n marginLeft: 4,\n },\n !disabled &&\n !indeterminate &&\n checked && {\n background: checkboxBackgroundChecked,\n borderColor: checkboxBorderColorChecked,\n [HighContrastSelector]: {\n background: 'Highlight',\n borderColor: 'Highlight',\n },\n },\n disabled && {\n borderColor: checkboxBorderColorDisabled,\n [HighContrastSelector]: {\n borderColor: 'GrayText',\n },\n },\n checked &&\n disabled && {\n background: checkboxBackgroundDisabledChecked,\n borderColor: checkboxBorderColorDisabled,\n [HighContrastSelector]: {\n background: 'Window',\n },\n },\n ],\n checkmark: [\n classNames.checkmark,\n {\n opacity: checked ? '1' : '0',\n color: checkmarkFontColor,\n [HighContrastSelector]: {\n color: disabled ? 'GrayText' : 'Window',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n ],\n text: [\n classNames.text,\n {\n color: disabled ? checkboxTextColorDisabled : checkboxTextColor,\n fontSize: fonts.medium.fontSize,\n lineHeight: '20px',\n [HighContrastSelector]: {\n color: disabled ? 'GrayText' : 'WindowText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n !reversed\n ? {\n marginLeft: 4,\n }\n : {\n marginRight: 4,\n },\n ],\n };\n};\n","import * as React from 'react';\nimport { styled } from '@fluentui/utilities';\nimport { CheckboxBase } from './Checkbox.base';\nimport { getStyles } from './Checkbox.styles';\nimport { ICheckboxProps, ICheckboxStyleProps, ICheckboxStyles } from './Checkbox.types';\n\nexport const Checkbox: React.FunctionComponent<ICheckboxProps> = styled<\n ICheckboxProps,\n ICheckboxStyleProps,\n ICheckboxStyles\n>(CheckboxBase, getStyles, undefined, { scope: 'Checkbox' });\n","import * as React from 'react';\nimport { Async, getNativeProps, initializeComponentRef, inputProperties, isIE11, KeyCodes } from '../../Utilities';\nimport { IAutofill, IAutofillProps } from './Autofill.types';\n\nexport interface IAutofillState {\n inputValue: string;\n}\n\nconst SELECTION_FORWARD = 'forward';\nconst SELECTION_BACKWARD = 'backward';\n\n/**\n * {@docCategory Autofill}\n */\nexport class Autofill extends React.Component<IAutofillProps, IAutofillState> implements IAutofill {\n public static defaultProps = {\n enableAutofillOnKeyPress: [KeyCodes.down, KeyCodes.up] as KeyCodes[],\n };\n\n private _inputElement = React.createRef<HTMLInputElement>();\n private _autoFillEnabled = true;\n private _isComposing: boolean = false;\n private _async: Async;\n\n public static getDerivedStateFromProps(props: IAutofillProps, state: IAutofillState): IAutofillState | null {\n // eslint-disable-next-line deprecation/deprecation\n if (props.updateValueInWillReceiveProps) {\n // eslint-disable-next-line deprecation/deprecation\n const updatedInputValue = props.updateValueInWillReceiveProps();\n // Don't update if we have a null value or the value isn't changing\n // the value should still update if an empty string is passed in\n if (updatedInputValue !== null && updatedInputValue !== state.inputValue) {\n return { inputValue: updatedInputValue };\n }\n }\n return null;\n }\n\n constructor(props: IAutofillProps) {\n super(props);\n\n initializeComponentRef(this);\n this._async = new Async(this);\n\n this.state = {\n inputValue: props.defaultVisibleValue || '',\n };\n }\n\n public get cursorLocation(): number | null {\n if (this._inputElement.current) {\n const inputElement = this._inputElement.current;\n if (inputElement.selectionDirection !== SELECTION_FORWARD) {\n return inputElement.selectionEnd;\n } else {\n return inputElement.selectionStart;\n }\n } else {\n return -1;\n }\n }\n\n public get isValueSelected(): boolean {\n return Boolean(this.inputElement && this.inputElement.selectionStart !== this.inputElement.selectionEnd);\n }\n\n public get value(): string {\n return this._getControlledValue() || this.state.inputValue || '';\n }\n\n public get selectionStart(): number | null {\n return this._inputElement.current ? this._inputElement.current.selectionStart : -1;\n }\n\n public get selectionEnd(): number | null {\n return this._inputElement.current ? this._inputElement.current.selectionEnd : -1;\n }\n\n public get inputElement(): HTMLInputElement | null {\n return this._inputElement.current;\n }\n\n public componentDidUpdate() {\n const { suggestedDisplayValue, shouldSelectFullInputValueInComponentDidUpdate, preventValueSelection } = this.props;\n let differenceIndex = 0;\n\n if (preventValueSelection) {\n return;\n }\n\n if (\n this._autoFillEnabled &&\n this.value &&\n suggestedDisplayValue &&\n _doesTextStartWith(suggestedDisplayValue, this.value)\n ) {\n let shouldSelectFullRange = false;\n\n if (shouldSelectFullInputValueInComponentDidUpdate) {\n shouldSelectFullRange = shouldSelectFullInputValueInComponentDidUpdate();\n }\n\n if (shouldSelectFullRange && this._inputElement.current) {\n this._inputElement.current.setSelectionRange(0, suggestedDisplayValue.length, SELECTION_BACKWARD);\n } else {\n while (\n differenceIndex < this.value.length &&\n this.value[differenceIndex].toLocaleLowerCase() === suggestedDisplayValue[differenceIndex].toLocaleLowerCase()\n ) {\n differenceIndex++;\n }\n if (differenceIndex > 0 && this._inputElement.current) {\n this._inputElement.current.setSelectionRange(\n differenceIndex,\n suggestedDisplayValue.length,\n SELECTION_BACKWARD,\n );\n }\n }\n }\n }\n\n public componentWillUnmount(): void {\n this._async.dispose();\n }\n\n public render(): JSX.Element {\n const nativeProps = getNativeProps<React.InputHTMLAttributes<HTMLInputElement>>(this.props, inputProperties);\n return (\n <input\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n aria-autocomplete={'both'}\n {...nativeProps}\n ref={this._inputElement}\n value={this._getDisplayValue()}\n onCompositionStart={this._onCompositionStart}\n onCompositionUpdate={this._onCompositionUpdate}\n onCompositionEnd={this._onCompositionEnd}\n // TODO (Fabric 8?) - switch to calling only onChange. See notes in TextField._onInputChange.\n onChange={this._onChanged}\n onInput={this._onInputChanged}\n onKeyDown={this._onKeyDown}\n onClick={this.props.onClick ? this.props.onClick : this._onClick}\n data-lpignore={true}\n />\n );\n }\n\n public focus() {\n this._inputElement.current && this._inputElement.current.focus();\n }\n\n public clear() {\n this._autoFillEnabled = true;\n this._updateValue('', false);\n this._inputElement.current && this._inputElement.current.setSelectionRange(0, 0);\n }\n\n // Composition events are used when the character/text requires several keystrokes to be completed.\n // Some examples of this are mobile text input and languages like Japanese or Arabic.\n // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n private _onCompositionStart = (ev: React.CompositionEvent<HTMLInputElement>) => {\n this._isComposing = true;\n this._autoFillEnabled = false;\n };\n\n // Composition events are used when the character/text requires several keystrokes to be completed.\n // Some examples of this are mobile text input and languages like Japanese or Arabic.\n // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n private _onCompositionUpdate = () => {\n if (isIE11()) {\n this._updateValue(this._getCurrentInputValue(), true);\n }\n };\n\n // Composition events are used when the character/text requires several keystrokes to be completed.\n // Some examples of this are mobile text input and languages like Japanese or Arabic.\n // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n private _onCompositionEnd = (ev: React.CompositionEvent<HTMLInputElement>) => {\n const inputValue = this._getCurrentInputValue();\n this._tryEnableAutofill(inputValue, this.value, false, true);\n this._isComposing = false;\n // Due to timing, this needs to be async, otherwise no text will be selected.\n this._async.setTimeout(() => {\n // it's technically possible that the value of _isComposing is reset during this timeout,\n // so explicitly trigger this with composing=true here, since it is supposed to be the\n // update for composition end\n this._updateValue(this._getCurrentInputValue(), false);\n }, 0);\n };\n\n private _onClick = () => {\n if (this.value && this.value !== '' && this._autoFillEnabled) {\n this._autoFillEnabled = false;\n }\n };\n\n private _onKeyDown = (ev: React.KeyboardEvent<HTMLInputElement>) => {\n if (this.props.onKeyDown) {\n this.props.onKeyDown(ev);\n }\n\n // If the event is actively being composed, then don't alert autofill.\n // Right now typing does not have isComposing, once that has been fixed any should be removed.\n\n if (!(ev.nativeEvent as any).isComposing) {\n // eslint-disable-next-line deprecation/deprecation\n switch (ev.which) {\n case KeyCodes.backspace:\n this._autoFillEnabled = false;\n break;\n case KeyCodes.left:\n case KeyCodes.right:\n if (this._autoFillEnabled) {\n this.setState({ inputValue: this.props.suggestedDisplayValue || '' });\n this._autoFillEnabled = false;\n }\n break;\n default:\n if (!this._autoFillEnabled) {\n // eslint-disable-next-line deprecation/deprecation\n if (this.props.enableAutofillOnKeyPress!.indexOf(ev.which) !== -1) {\n this._autoFillEnabled = true;\n }\n }\n break;\n }\n }\n };\n\n private _onInputChanged = (ev: React.FormEvent<HTMLElement>) => {\n const value: string = this._getCurrentInputValue(ev);\n\n if (!this._isComposing) {\n this._tryEnableAutofill(value, this.value, (ev.nativeEvent as any).isComposing);\n }\n\n // If it is not IE11 and currently composing, update the value\n if (!(isIE11() && this._isComposing)) {\n const nativeEventComposing = (ev.nativeEvent as any).isComposing;\n const isComposing = nativeEventComposing === undefined ? this._isComposing : nativeEventComposing;\n this._updateValue(value, isComposing);\n }\n };\n\n private _onChanged = (): void => {\n // Swallow this event, we don't care about it\n // We must provide it because React PropTypes marks it as required, but onInput serves the correct purpose\n return;\n };\n\n private _getCurrentInputValue(ev?: React.FormEvent<HTMLElement>): string {\n if (ev && ev.target && (ev.target as HTMLInputElement).value) {\n return (ev.target as HTMLInputElement).value;\n } else if (this.inputElement && this.inputElement.value) {\n return this.inputElement.value;\n } else {\n return '';\n }\n }\n\n /**\n * Attempts to enable autofill. Whether or not autofill is enabled depends on the input value,\n * whether or not any text is selected, and only if the new input value is longer than the old input value.\n * Autofill should never be set to true if the value is composing. Once compositionEnd is called, then\n * it should be completed.\n * See https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent for more information on composition.\n * @param newValue - new input value\n * @param oldValue - old input value\n * @param isComposing - if true then the text is actively being composed and it has not completed.\n * @param isComposed - if the text is a composed text value.\n */\n private _tryEnableAutofill(newValue: string, oldValue: string, isComposing?: boolean, isComposed?: boolean): void {\n if (\n !isComposing &&\n newValue &&\n this._inputElement.current &&\n this._inputElement.current.selectionStart === newValue.length &&\n !this._autoFillEnabled &&\n (newValue.length > oldValue.length || isComposed)\n ) {\n this._autoFillEnabled = true;\n }\n }\n\n /**\n * Updates the current input value as well as getting a new display value.\n * @param newValue - The new value from the input\n */\n private _updateValue = (newValue: string, composing: boolean) => {\n // Only proceed if the value is nonempty and is different from the old value\n // This is to work around the fact that, in IE 11, inputs with a placeholder fire an onInput event on focus\n if (!newValue && newValue === this.value) {\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { onInputChange, onInputValueChange } = this.props;\n if (onInputChange) {\n newValue = onInputChange?.(newValue, composing) || '';\n }\n\n this.setState({ inputValue: newValue }, () => onInputValueChange?.(newValue, composing));\n };\n\n private _getDisplayValue(): string {\n if (this._autoFillEnabled) {\n return _getDisplayValue(this.value, this.props.suggestedDisplayValue);\n }\n\n return this.value;\n }\n\n private _getControlledValue(): string | undefined {\n const { value } = this.props;\n if (value === undefined || typeof value === 'string') {\n return value;\n }\n\n // eslint-disable-next-line no-console\n console.warn(`props.value of Autofill should be a string, but it is ${value} with type of ${typeof value}`);\n\n return value.toString();\n }\n}\n/**\n * Returns a string that should be used as the display value.\n * It evaluates this based on whether or not the suggested value starts with the input value\n * and whether or not autofill is enabled.\n * @param inputValue - the value that the input currently has.\n * @param suggestedDisplayValue - the possible full value\n */\nfunction _getDisplayValue(inputValue: string, suggestedDisplayValue?: string): string {\n let displayValue = inputValue;\n if (suggestedDisplayValue && inputValue && _doesTextStartWith(suggestedDisplayValue, displayValue)) {\n displayValue = suggestedDisplayValue;\n }\n return displayValue;\n}\n\nfunction _doesTextStartWith(text: string, startWith: string): boolean {\n if (!text || !startWith) {\n return false;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n for (const val of [text, startWith]) {\n if (typeof val !== 'string') {\n throw new Error(\n `${\n Autofill.name\n // eslint-disable-next-line @fluentui/max-len\n } received non-string value \"${val}\" of type ${typeof val} from either input's value or suggestedDisplayValue`,\n );\n }\n }\n }\n\n return text.toLocaleLowerCase().indexOf(startWith.toLocaleLowerCase()) === 0;\n}\n","export interface ISelectableOption<T = any> {\n /**\n * Arbitrary string associated with this option.\n */\n key: string | number;\n\n /**\n * ID attribute associated with this option\n */\n id?: string;\n\n /**\n * Text to render for this option\n */\n text: string;\n\n /**\n * Title attribute (built in tooltip) for a given option.\n */\n title?: string;\n\n /**\n * Text to render for this option\n */\n itemType?: SelectableOptionMenuItemType;\n\n /**\n * Index for this option\n */\n index?: number;\n\n /**\n * The aria label for the dropdown option. If not present, the `text` will be used.\n */\n ariaLabel?: string;\n\n /** If option is selected. */\n selected?: boolean;\n\n /**\n * Whether the option is disabled\n * @defaultvalue false\n */\n disabled?: boolean;\n\n /**\n * Defines whether the option is hidden or not.\n * @defaultvalue false\n */\n hidden?: boolean;\n\n /**\n * Data available to custom onRender functions.\n */\n data?: T;\n}\n\nexport enum SelectableOptionMenuItemType {\n Normal = 0,\n Divider = 1,\n Header = 2,\n}\n","import {\n FontWeights,\n IRawStyle,\n ITheme,\n concatStyleSets,\n getFocusStyle,\n HighContrastSelector,\n IStyle,\n getPlaceholderStyles,\n hiddenContentStyle,\n getInputFocusStyle,\n getHighContrastNoAdjustStyle,\n} from '../../Styling';\nimport { IComboBoxOptionStyles, IComboBoxStyles } from './ComboBox.types';\n\nimport { IButtonStyles } from '../../Button';\nimport { memoizeFunction } from '../../Utilities';\n\nconst ComboBoxHeight = 32;\nconst ComboBoxLineHeight = 30;\nconst ComboBoxCaretDownWidth = 32;\nconst ComboBoxOptionHeight = 36;\n\nconst getDisabledStyles = memoizeFunction(\n (theme: ITheme): IRawStyle => {\n const { semanticColors } = theme;\n\n return {\n backgroundColor: semanticColors.disabledBackground,\n color: semanticColors.disabledText,\n cursor: 'default',\n selectors: {\n ':after': {\n borderColor: semanticColors.disabledBackground,\n },\n [HighContrastSelector]: {\n color: 'GrayText',\n selectors: {\n ':after': {\n borderColor: 'GrayText',\n },\n },\n },\n },\n };\n },\n);\n\nconst listOptionHighContrastStyles: IRawStyle = {\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'Highlight',\n borderColor: 'Highlight',\n color: 'HighlightText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n};\n\nconst inputHighContrastStyles: IRawStyle = {\n selectors: {\n [HighContrastSelector]: {\n color: 'WindowText',\n backgroundColor: 'Window',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n};\n\nexport const getOptionStyles = memoizeFunction(\n (\n theme: ITheme,\n customStylesForAllOptions?: Partial<IComboBoxOptionStyles>,\n customOptionStylesForCurrentOption?: Partial<IComboBoxOptionStyles>,\n isPending?: boolean,\n isHidden?: boolean,\n ): Partial<IComboBoxOptionStyles> => {\n const { palette, semanticColors } = theme;\n\n const option = {\n textHoveredColor: semanticColors.menuItemTextHovered,\n textSelectedColor: palette.neutralDark,\n textDisabledColor: semanticColors.disabledText,\n backgroundHoveredColor: semanticColors.menuItemBackgroundHovered,\n backgroundPressedColor: semanticColors.menuItemBackgroundPressed,\n };\n\n const optionStyles: IComboBoxOptionStyles = {\n root: [\n theme.fonts.medium,\n {\n backgroundColor: isPending ? option.backgroundHoveredColor : 'transparent',\n boxSizing: 'border-box',\n cursor: 'pointer',\n display: isHidden ? 'none' : 'block',\n width: '100%',\n height: 'auto',\n minHeight: ComboBoxOptionHeight,\n lineHeight: '20px',\n padding: '0 8px',\n position: 'relative',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'transparent',\n borderRadius: 0,\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n textAlign: 'left',\n selectors: {\n [HighContrastSelector]: {\n border: 'none',\n borderColor: 'Background',\n },\n '&.ms-Checkbox': {\n display: 'flex',\n alignItems: 'center',\n },\n '&.ms-Button--command:hover:active': {\n backgroundColor: option.backgroundPressedColor,\n },\n '.ms-Checkbox-label': {\n width: '100%',\n },\n },\n },\n ],\n rootHovered: {\n backgroundColor: option.backgroundHoveredColor,\n color: option.textHoveredColor,\n },\n rootFocused: {\n backgroundColor: option.backgroundHoveredColor,\n },\n rootChecked: [\n {\n backgroundColor: 'transparent',\n color: option.textSelectedColor,\n selectors: {\n ':hover': [\n {\n backgroundColor: option.backgroundHoveredColor,\n },\n listOptionHighContrastStyles,\n ],\n },\n },\n getFocusStyle(theme, { inset: -1, isFocusedOnly: false }),\n listOptionHighContrastStyles,\n ],\n rootDisabled: {\n color: option.textDisabledColor,\n cursor: 'default',\n },\n optionText: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n minWidth: '0px',\n maxWidth: '100%',\n wordWrap: 'break-word',\n overflowWrap: 'break-word',\n display: 'inline-block',\n },\n optionTextWrapper: {\n maxWidth: '100%',\n display: 'flex',\n alignItems: 'center',\n },\n };\n\n return concatStyleSets(optionStyles, customStylesForAllOptions, customOptionStylesForCurrentOption);\n },\n);\n\nexport const getCaretDownButtonStyles = memoizeFunction(\n (theme: ITheme, customStyles?: Partial<IButtonStyles>): IButtonStyles => {\n const { semanticColors, fonts } = theme;\n\n const caret = {\n buttonTextColor: semanticColors.bodySubtext,\n buttonTextHoveredCheckedColor: semanticColors.buttonTextChecked,\n buttonBackgroundHoveredColor: semanticColors.listItemBackgroundHovered,\n buttonBackgroundCheckedColor: semanticColors.listItemBackgroundChecked,\n buttonBackgroundCheckedHoveredColor: semanticColors.listItemBackgroundCheckedHovered,\n };\n\n const buttonHighContrastStyles: IStyle = {\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'Highlight',\n borderColor: 'Highlight',\n color: 'HighlightText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n };\n\n const styles: IButtonStyles = {\n root: {\n color: caret.buttonTextColor,\n fontSize: fonts.small.fontSize,\n position: 'absolute',\n top: 0,\n height: '100%',\n lineHeight: ComboBoxLineHeight,\n width: ComboBoxCaretDownWidth,\n textAlign: 'center',\n cursor: 'default',\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'ButtonFace',\n borderColor: 'ButtonText',\n color: 'ButtonText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n icon: {\n fontSize: fonts.small.fontSize,\n },\n rootHovered: [\n {\n backgroundColor: caret.buttonBackgroundHoveredColor,\n color: caret.buttonTextHoveredCheckedColor,\n cursor: 'pointer',\n },\n buttonHighContrastStyles,\n ],\n rootPressed: [\n {\n backgroundColor: caret.buttonBackgroundCheckedColor,\n color: caret.buttonTextHoveredCheckedColor,\n },\n buttonHighContrastStyles,\n ],\n rootChecked: [\n {\n backgroundColor: caret.buttonBackgroundCheckedColor,\n color: caret.buttonTextHoveredCheckedColor,\n },\n buttonHighContrastStyles,\n ],\n rootCheckedHovered: [\n {\n backgroundColor: caret.buttonBackgroundCheckedHoveredColor,\n color: caret.buttonTextHoveredCheckedColor,\n },\n buttonHighContrastStyles,\n ],\n rootDisabled: [\n getDisabledStyles(theme),\n {\n position: 'absolute',\n },\n ],\n };\n return concatStyleSets(styles, customStyles);\n },\n);\n\nexport const getStyles = memoizeFunction(\n (theme: ITheme, customStyles?: Partial<IComboBoxStyles>, comboBoxOptionWidth?: string): Partial<IComboBoxStyles> => {\n const { semanticColors, fonts, effects } = theme;\n\n const root = {\n textColor: semanticColors.inputText,\n borderColor: semanticColors.inputBorder,\n borderHoveredColor: semanticColors.inputBorderHovered,\n borderPressedColor: semanticColors.inputFocusBorderAlt,\n borderFocusedColor: semanticColors.inputFocusBorderAlt,\n backgroundColor: semanticColors.inputBackground,\n erroredColor: semanticColors.errorText,\n };\n\n const option = {\n headerTextColor: semanticColors.menuHeader,\n dividerBorderColor: semanticColors.bodyDivider,\n };\n\n // placeholder style variables\n const placeholderHighContrastStyles: IRawStyle = {\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n },\n },\n };\n const placeholderStyles: IStyle = [\n {\n color: semanticColors.inputPlaceholderText,\n },\n placeholderHighContrastStyles,\n ];\n const placeholderStylesHovered: IStyle = [\n {\n color: semanticColors.inputTextHovered,\n },\n placeholderHighContrastStyles,\n ];\n const disabledPlaceholderStyles: IStyle = [\n {\n color: semanticColors.disabledText,\n },\n placeholderHighContrastStyles,\n ];\n\n const ComboBoxRootHighContrastFocused = {\n color: 'HighlightText',\n backgroundColor: 'Window',\n ...getHighContrastNoAdjustStyle(),\n selectors: {\n ':after': {\n borderColor: 'Highlight',\n },\n },\n };\n\n const focusBorderStyles: IStyle = getInputFocusStyle(root.borderPressedColor, effects.roundedCorner2, 'border', 0);\n\n const styles: IComboBoxStyles = {\n container: {},\n label: {},\n labelDisabled: {},\n root: [\n theme.fonts.medium,\n {\n boxShadow: 'none',\n marginLeft: '0',\n paddingRight: ComboBoxCaretDownWidth,\n paddingLeft: 9,\n color: root.textColor,\n position: 'relative',\n outline: '0',\n userSelect: 'none',\n backgroundColor: root.backgroundColor,\n cursor: 'text',\n display: 'block',\n height: ComboBoxHeight,\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n boxSizing: 'border-box', // Border-box matches Dropdown and TextField\n selectors: {\n '.ms-Label': {\n display: 'inline-block',\n marginBottom: '8px',\n },\n '&.is-open': {\n selectors: {\n [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n },\n },\n // setting border using pseudo-element here in order to\n // prevent chevron button to overlap ComboBox border under certain resolutions\n ':after': {\n pointerEvents: 'none',\n content: \"''\",\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n right: 0,\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: root.borderColor,\n borderRadius: effects.roundedCorner2,\n },\n },\n },\n ],\n\n rootHovered: {\n selectors: {\n ':after': {\n borderColor: root.borderHoveredColor,\n },\n '.ms-ComboBox-Input': [\n {\n color: semanticColors.inputTextHovered,\n },\n getPlaceholderStyles(placeholderStylesHovered),\n inputHighContrastStyles,\n ],\n [HighContrastSelector]: {\n color: 'HighlightText',\n backgroundColor: 'Window',\n ...getHighContrastNoAdjustStyle(),\n selectors: {\n ':after': {\n borderColor: 'Highlight',\n },\n },\n },\n },\n },\n\n rootPressed: [\n {\n position: 'relative',\n selectors: {\n [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n },\n },\n ],\n\n rootFocused: [\n {\n selectors: {\n '.ms-ComboBox-Input': [\n {\n color: semanticColors.inputTextHovered,\n },\n inputHighContrastStyles,\n ],\n [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n },\n },\n focusBorderStyles,\n ],\n\n rootDisabled: getDisabledStyles(theme),\n\n rootError: {\n selectors: {\n ':after': {\n borderColor: root.erroredColor,\n },\n ':hover:after': {\n borderColor: semanticColors.inputBorderHovered,\n },\n },\n },\n\n rootDisallowFreeForm: {},\n\n input: [\n getPlaceholderStyles(placeholderStyles),\n {\n backgroundColor: root.backgroundColor,\n color: root.textColor,\n boxSizing: 'border-box',\n width: '100%',\n height: '100%',\n borderStyle: 'none',\n outline: 'none',\n font: 'inherit',\n textOverflow: 'ellipsis',\n padding: '0',\n selectors: {\n '::-ms-clear': {\n display: 'none',\n },\n },\n },\n inputHighContrastStyles,\n ],\n\n inputDisabled: [getDisabledStyles(theme), getPlaceholderStyles(disabledPlaceholderStyles)],\n errorMessage: [\n theme.fonts.small,\n {\n color: root.erroredColor,\n marginTop: '5px',\n },\n ],\n\n callout: {\n boxShadow: effects.elevation8,\n },\n\n optionsContainerWrapper: {\n width: comboBoxOptionWidth,\n },\n\n optionsContainer: {\n display: 'block',\n },\n screenReaderText: hiddenContentStyle,\n\n header: [\n fonts.medium,\n {\n fontWeight: FontWeights.semibold,\n color: option.headerTextColor,\n backgroundColor: 'none',\n borderStyle: 'none',\n height: ComboBoxOptionHeight,\n lineHeight: ComboBoxOptionHeight,\n cursor: 'default',\n padding: '0 8px',\n userSelect: 'none',\n textAlign: 'left',\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n ],\n\n divider: {\n height: 1,\n backgroundColor: option.dividerBorderColor,\n },\n };\n\n return concatStyleSets(styles, customStyles);\n },\n);\n","import { IComboBoxStyles, IComboBoxOptionStyles } from './ComboBox.types';\nimport { memoizeFunction } from '../../Utilities';\nimport { mergeStyles } from '../../Styling';\n\nexport interface IComboBoxClassNames {\n container: string;\n label: string;\n root: string;\n input: string;\n errorMessage: string;\n callout: string;\n optionsContainer: string;\n header: string;\n divider: string;\n optionsContainerWrapper: string;\n screenReaderText: string;\n}\n\nexport interface IComboBoxOptionClassNames {\n optionText: string;\n root: string;\n optionTextWrapper: string;\n}\n\nexport const getClassNames = memoizeFunction(\n (\n styles: Partial<IComboBoxStyles>,\n className: string,\n isOpen: boolean,\n disabled: boolean,\n required: boolean,\n focused: boolean,\n allowFreeForm: boolean,\n hasErrorMessage: boolean,\n ): IComboBoxClassNames => {\n return {\n container: mergeStyles('ms-ComboBox-container', className, styles.container),\n label: mergeStyles(styles.label, disabled && styles.labelDisabled),\n root: mergeStyles(\n 'ms-ComboBox',\n hasErrorMessage ? styles.rootError : isOpen && 'is-open',\n required && 'is-required',\n styles.root,\n !allowFreeForm && styles.rootDisallowFreeForm,\n hasErrorMessage && !focused ? styles.rootError : !disabled && focused && styles.rootFocused,\n !disabled && {\n selectors: {\n ':hover': hasErrorMessage ? styles.rootError : !isOpen && !focused && styles.rootHovered,\n ':active': hasErrorMessage ? styles.rootError : styles.rootPressed,\n ':focus': hasErrorMessage ? styles.rootError : styles.rootFocused,\n },\n },\n disabled && ['is-disabled', styles.rootDisabled],\n ),\n input: mergeStyles('ms-ComboBox-Input', styles.input, disabled && styles.inputDisabled),\n errorMessage: mergeStyles(styles.errorMessage),\n callout: mergeStyles('ms-ComboBox-callout', styles.callout),\n optionsContainerWrapper: mergeStyles('ms-ComboBox-optionsContainerWrapper', styles.optionsContainerWrapper),\n optionsContainer: mergeStyles('ms-ComboBox-optionsContainer', styles.optionsContainer),\n header: mergeStyles('ms-ComboBox-header', styles.header),\n divider: mergeStyles('ms-ComboBox-divider', styles.divider),\n screenReaderText: mergeStyles(styles.screenReaderText),\n };\n },\n);\n\nexport const getComboBoxOptionClassNames = memoizeFunction(\n (styles: Partial<IComboBoxOptionStyles>): IComboBoxOptionClassNames => {\n return {\n optionText: mergeStyles('ms-ComboBox-optionText', styles.optionText),\n root: mergeStyles('ms-ComboBox-option', styles.root, {\n selectors: {\n ':hover': styles.rootHovered,\n ':focus': styles.rootFocused,\n ':active': styles.rootPressed,\n },\n }),\n optionTextWrapper: mergeStyles(styles.optionTextWrapper),\n };\n },\n);\n","import * as React from 'react';\nimport { Autofill, IAutofill } from '../../Autofill';\nimport {\n initializeComponentRef,\n css,\n customizable,\n divProperties,\n findElementRecursive,\n findIndex,\n focusAsync,\n getId,\n getNativeProps,\n isIOS,\n isMac,\n KeyCodes,\n shallowCompare,\n mergeAriaAttributeValues,\n warnMutuallyExclusive,\n Async,\n EventGroup,\n getPropsWithDefaults,\n} from '../../Utilities';\nimport { Callout, DirectionalHint } from '../../Callout';\nimport { Checkbox } from '../../Checkbox';\nimport { getCaretDownButtonStyles, getOptionStyles, getStyles } from './ComboBox.styles';\nimport { getClassNames, getComboBoxOptionClassNames, IComboBoxClassNames } from './ComboBox.classNames';\nimport {\n IComboBoxOption,\n IComboBoxOptionStyles,\n IComboBoxProps,\n IOnRenderComboBoxLabelProps,\n IComboBox,\n} from './ComboBox.types';\nimport { Label } from '../../Label';\nimport { SelectableOptionMenuItemType, getAllSelectedOptions } from '../../SelectableOption';\nimport { BaseButton, Button, CommandButton, IButtonStyles, IconButton } from '../../Button';\nimport { ICalloutProps } from '../../Callout';\nimport { useMergedRefs } from '@fluentui/react-hooks';\n\nexport interface IComboBoxState {\n /** The open state */\n isOpen?: boolean;\n\n /** The focused state of the combo box */\n focusState?: 'none' | 'focused' | 'focusing';\n\n /**\n * When taking input, this will store the index that the options input matches\n * (-1 if no input or match)\n */\n currentPendingValueValidIndex: number;\n\n /**\n * Stores the hovered over value in the dropdown\n * (used for styling the options without updating the input)\n */\n currentPendingValueValidIndexOnHover: number;\n\n /** When taking input, this will store the actual text that is being entered */\n currentPendingValue?: string;\n}\n\nenum SearchDirection {\n backward = -1,\n none = 0,\n forward = 1,\n}\n\nenum HoverStatus {\n /** Used when the user was hovering and has since moused out of the menu items */\n clearAll = -2,\n /** Default \"normal\" state, when no hover has happened or a hover is in progress */\n default = -1,\n}\n\nconst ScrollIdleDelay = 250; /* ms */\nconst TouchIdleDelay = 500; /* ms */\n\n/**\n * This is used to clear any pending autocomplete text (used when autocomplete is true and\n * allowFreeform is false)\n */\nconst ReadOnlyPendingAutoCompleteTimeout = 1000; /* ms */\n\ninterface IComboBoxOptionWrapperProps extends IComboBoxOption {\n /** True if the option is currently selected */\n isSelected: boolean;\n\n /** True if the option is currently checked (multi-select) */\n isChecked: boolean;\n\n /**\n * A function that returns the children of the OptionWrapper. We pass this in as a function to ensure that\n * children methods don't get called unnecessarily if the component doesn't need to be updated. This leads\n * to a significant performance increase in ComboBoxes with many options and/or complex onRenderOption functions\n */\n render: () => JSX.Element;\n}\n\n/**\n * Internal component that is used to wrap all ComboBox options.\n * This is used to customize when we want to re-render components,\n * so we don't re-render every option every time render is executed.\n */\nconst ComboBoxOptionWrapper = React.memo(\n ({ render }: IComboBoxOptionWrapperProps) => render(),\n (\n { render: oldRender, ...oldProps }: IComboBoxOptionWrapperProps,\n { render: newRender, ...newProps }: IComboBoxOptionWrapperProps,\n ) =>\n // The render function will always be different, so we ignore that prop\n shallowCompare(oldProps, newProps),\n);\n\nconst COMPONENT_NAME = 'ComboBox';\nconst DEFAULT_PROPS: Partial<IComboBoxProps> = {\n options: [],\n allowFreeform: false,\n autoComplete: 'on',\n buttonIconProps: { iconName: 'ChevronDown' },\n};\n\nfunction useOptionsState({ options, defaultSelectedKey, selectedKey }: IComboBoxProps) {\n /** The currently selected indices */\n const [selectedIndices, setSelectedIndices] = React.useState<number[]>(() =>\n getSelectedIndices(options, buildDefaultSelectedKeys(defaultSelectedKey, selectedKey)),\n );\n /** The options currently available for the callout */\n const [currentOptions, setCurrentOptions] = React.useState<IComboBoxOption[]>(options);\n /** This value is used for the autocomplete hint value */\n const [suggestedDisplayValue, setSuggestedDisplayValue] = React.useState<string>();\n\n React.useEffect(() => {\n if (selectedKey !== undefined) {\n const selectedKeys: string[] | number[] = buildSelectedKeys(selectedKey);\n const indices: number[] = getSelectedIndices(options, selectedKeys);\n\n setSelectedIndices(indices);\n }\n setCurrentOptions(options);\n }, [options, selectedKey]);\n\n React.useEffect(() => {\n if (selectedKey === null) {\n setSuggestedDisplayValue(undefined);\n }\n }, [selectedKey]);\n\n return [\n selectedIndices,\n setSelectedIndices,\n currentOptions,\n setCurrentOptions,\n suggestedDisplayValue,\n setSuggestedDisplayValue,\n ] as const;\n}\n\nexport const ComboBox: React.FunctionComponent<IComboBoxProps> = React.forwardRef<HTMLDivElement, IComboBoxProps>(\n (propsWithoutDefaults: IComboBoxProps, forwardedRef: React.Ref<HTMLDivElement>) => {\n const { ref, ...props } = getPropsWithDefaults(DEFAULT_PROPS, propsWithoutDefaults);\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const mergedRootRef = useMergedRefs(rootRef, forwardedRef);\n\n const [\n selectedIndices,\n setSelectedIndices,\n currentOptions,\n setCurrentOptions,\n suggestedDisplayValue,\n setSuggestedDisplayValue,\n ] = useOptionsState(props);\n\n return (\n <ComboBoxInternal\n {...props}\n hoisted={{\n mergedRootRef,\n rootRef,\n selectedIndices,\n setSelectedIndices,\n currentOptions,\n setCurrentOptions,\n suggestedDisplayValue,\n setSuggestedDisplayValue,\n }}\n />\n );\n },\n);\nComboBox.displayName = COMPONENT_NAME;\n\ninterface IComboBoxInternalProps extends Omit<IComboBoxProps, 'ref'> {\n hoisted: {\n mergedRootRef: React.Ref<HTMLDivElement>;\n rootRef: React.RefObject<HTMLDivElement>;\n selectedIndices: number[];\n currentOptions: IComboBoxOption[];\n suggestedDisplayValue?: string;\n setSelectedIndices: React.Dispatch<React.SetStateAction<number[]>>;\n setCurrentOptions: React.Dispatch<React.SetStateAction<IComboBoxOption[]>>;\n setSuggestedDisplayValue: React.Dispatch<React.SetStateAction<string | undefined>>;\n };\n}\n\n@customizable('ComboBox', ['theme', 'styles'], true)\nclass ComboBoxInternal extends React.Component<IComboBoxInternalProps, IComboBoxState> implements IComboBox {\n /** The input aspect of the combo box */\n private _autofill = React.createRef<IAutofill>();\n\n /** The wrapping div of the input and button */\n private _comboBoxWrapper = React.createRef<HTMLDivElement>();\n\n /** The callout element */\n private _comboBoxMenu = React.createRef<HTMLDivElement>();\n\n /** The menu item element that is currently selected */\n private _selectedElement = React.createRef<HTMLSpanElement>();\n\n /** The base id for the ComboBox */\n private _id: string;\n\n /**\n * After a character is inserted when autocomplete is true and allowFreeform is false,\n * remember the task that will clear the pending string of characters.\n */\n private _autoCompleteTimeout: number | undefined;\n\n /** Promise used when resolving the comboBox options */\n private _currentPromise: PromiseLike<IComboBoxOption[]>;\n\n /** The current visible value sent to the auto fill on render */\n private _currentVisibleValue: string | undefined;\n private _classNames: IComboBoxClassNames;\n private _isScrollIdle: boolean;\n private _hasPendingValue: boolean;\n private _scrollIdleTimeoutId: number | undefined;\n private _processingTouch: boolean;\n private _lastTouchTimeoutId: number | undefined;\n /** True if the most recent keydown event was for alt (option) or meta (command). */\n private _lastKeyDownWasAltOrMeta: boolean | undefined;\n\n /**\n * Determines if we should be setting focus back to the input when the menu closes.\n * The general rule of thumb is if the menu was launched via the keyboard focus should go back\n * to the input, if it was dropped via the mouse focus should not be forced back to the input.\n */\n private _focusInputAfterClose: boolean;\n\n /** Flag for when we get the first mouseMove */\n private _gotMouseMove: boolean;\n\n private _processingClearPendingInfo: boolean;\n\n private _async: Async;\n private _events: EventGroup;\n\n constructor(props: IComboBoxInternalProps) {\n super(props);\n\n initializeComponentRef(this);\n this._async = new Async(this);\n this._events = new EventGroup(this);\n\n warnMutuallyExclusive(COMPONENT_NAME, props, {\n defaultSelectedKey: 'selectedKey',\n text: 'defaultSelectedKey',\n selectedKey: 'value',\n dropdownWidth: 'useComboBoxAsMenuWidth',\n });\n\n this._id = props.id || getId('ComboBox');\n\n this._isScrollIdle = true;\n this._processingTouch = false;\n this._gotMouseMove = false;\n this._processingClearPendingInfo = false;\n\n this.state = {\n isOpen: false,\n focusState: 'none',\n currentPendingValueValidIndex: -1,\n currentPendingValue: undefined,\n currentPendingValueValidIndexOnHover: HoverStatus.default,\n };\n }\n\n /**\n * All selected options\n */\n public get selectedOptions(): IComboBoxOption[] {\n const { currentOptions, selectedIndices } = this.props.hoisted;\n\n return getAllSelectedOptions(currentOptions, selectedIndices!);\n }\n\n public componentDidMount(): void {\n if (this._comboBoxWrapper.current && !this.props.disabled) {\n // hook up resolving the options if needed on focus\n this._events.on(this._comboBoxWrapper.current, 'focus', this._onResolveOptions, true);\n if ('onpointerdown' in this._comboBoxWrapper.current) {\n // For ComboBoxes, touching anywhere in the combo box should drop the dropdown, including the input element.\n // This gives more hit target space for touch environments. We're setting the onpointerdown here, because React\n // does not support Pointer events yet.\n this._events.on(this._comboBoxWrapper.current, 'pointerdown', this._onPointerDown, true);\n }\n }\n }\n\n public componentDidUpdate(prevProps: IComboBoxInternalProps, prevState: IComboBoxState) {\n const {\n allowFreeform,\n text,\n onMenuOpen,\n onMenuDismissed,\n hoisted: { selectedIndices },\n } = this.props;\n const { isOpen, currentPendingValueValidIndex } = this.state;\n\n // If we are newly open or are open and the pending valid index changed,\n // make sure the currently selected/pending option is scrolled into view\n if (isOpen && (!prevState.isOpen || prevState.currentPendingValueValidIndex !== currentPendingValueValidIndex)) {\n // Need this timeout so that the selectedElement ref is correctly updated\n this._async.setTimeout(() => this._scrollIntoView(), 0);\n }\n\n // if an action is taken that put focus in the ComboBox\n // and If we are open or we are just closed, shouldFocusAfterClose is set,\n // but we are not the activeElement set focus on the input\n if (\n this._hasFocus() &&\n (isOpen ||\n (prevState.isOpen &&\n !isOpen &&\n this._focusInputAfterClose &&\n this._autofill.current &&\n document.activeElement !== this._autofill.current.inputElement))\n ) {\n this.focus(undefined /*shouldOpenOnFocus*/, true /*useFocusAsync*/);\n }\n\n // If we should focusAfterClose AND\n // just opened/closed the menu OR\n // are focused AND\n // updated the selectedIndex with the menu closed OR\n // are not allowing freeform OR\n // the value changed\n // we need to set selection\n if (\n this._focusInputAfterClose &&\n ((prevState.isOpen && !isOpen) ||\n (this._hasFocus() &&\n ((!isOpen &&\n !this.props.multiSelect &&\n prevProps.hoisted.selectedIndices &&\n selectedIndices &&\n prevProps.hoisted.selectedIndices[0] !== selectedIndices[0]) ||\n !allowFreeform ||\n text !== prevProps.text)))\n ) {\n this._onFocus();\n }\n\n this._notifyPendingValueChanged(prevState);\n\n if (isOpen && !prevState.isOpen && onMenuOpen) {\n onMenuOpen();\n }\n\n if (!isOpen && prevState.isOpen && onMenuDismissed) {\n onMenuDismissed();\n }\n }\n\n public componentWillUnmount(): void {\n this._async.dispose();\n this._events.dispose();\n }\n\n // Primary Render\n public render(): JSX.Element {\n const id = this._id;\n const errorMessageId = id + '-error';\n const {\n className,\n disabled,\n required,\n errorMessage,\n onRenderContainer = this._onRenderContainer,\n onRenderLabel = this._onRenderLabel,\n onRenderList = this._onRenderList,\n onRenderItem = this._onRenderItem,\n onRenderOption = this._onRenderOptionContent,\n allowFreeform,\n styles: customStyles,\n theme,\n persistMenu,\n multiSelect,\n hoisted: { suggestedDisplayValue, selectedIndices, currentOptions },\n } = this.props;\n const { isOpen } = this.state;\n this._currentVisibleValue = this._getVisibleValue();\n\n // Single select is already accessible since the whole text is selected\n // when focus enters the input. Since multiselect appears to clear the input\n // it needs special accessible text\n const multiselectAccessibleText = multiSelect\n ? this._getMultiselectDisplayString(selectedIndices, currentOptions, suggestedDisplayValue)\n : undefined;\n\n const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(this.props, divProperties, [\n 'onChange',\n 'value',\n ]);\n\n const hasErrorMessage = errorMessage && errorMessage.length > 0 ? true : false;\n\n this._classNames = this.props.getClassNames\n ? this.props.getClassNames(\n theme!,\n !!isOpen,\n !!disabled,\n !!required,\n !!this._hasFocus(),\n !!allowFreeform,\n !!hasErrorMessage,\n className,\n )\n : getClassNames(\n getStyles(theme!, customStyles),\n className!,\n !!isOpen,\n !!disabled,\n !!required,\n !!this._hasFocus(),\n !!allowFreeform,\n !!hasErrorMessage,\n );\n\n const comboBoxWrapper = this._renderComboBoxWrapper(multiselectAccessibleText, errorMessageId);\n\n return (\n <div {...divProps} ref={this.props.hoisted.mergedRootRef} className={this._classNames.container}>\n {onRenderLabel({ props: this.props, multiselectAccessibleText }, this._onRenderLabel)}\n {comboBoxWrapper}\n {(persistMenu || isOpen) &&\n onRenderContainer(\n {\n ...this.props,\n onRenderList,\n onRenderItem,\n onRenderOption,\n options: currentOptions.map((item, index) => ({ ...item, index: index })),\n onDismiss: this._onDismiss,\n },\n this._onRenderContainer,\n )}\n <div\n role=\"region\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n id={errorMessageId}\n {...(hasErrorMessage ? { className: this._classNames.errorMessage } : { 'aria-hidden': true })}\n >\n {errorMessage !== undefined ? errorMessage : ''}\n </div>\n </div>\n );\n }\n\n /**\n * {@inheritdoc}\n */\n public focus = (shouldOpenOnFocus?: boolean, useFocusAsync?: boolean): void => {\n if (this._autofill.current) {\n if (useFocusAsync) {\n focusAsync(this._autofill.current);\n } else {\n this._autofill.current.focus();\n }\n\n if (shouldOpenOnFocus) {\n this.setState({\n isOpen: true,\n });\n }\n }\n\n // Programmatically setting focus means that there is nothing else that needs to be done\n // Focus is now contained\n if (!this._hasFocus()) {\n this.setState({ focusState: 'focused' });\n }\n };\n\n /**\n * Close menu callout if it is open\n */\n public dismissMenu = (): void => {\n const { isOpen } = this.state;\n isOpen && this.setState({ isOpen: false });\n };\n\n /**\n * componentWillReceiveProps handler for the auto fill component\n * Checks/updates the input value to set, if needed\n * @param defaultVisibleValue - the defaultVisibleValue that got passed\n * in to the auto fill's componentWillReceiveProps\n * @returns - the updated value to set, if needed\n */\n private _onUpdateValueInAutofillWillReceiveProps = (): string | null => {\n const comboBox = this._autofill.current;\n\n if (!comboBox) {\n return null;\n }\n\n if (comboBox.value === null || comboBox.value === undefined) {\n return null;\n }\n\n const visibleValue = normalizeToString(this._currentVisibleValue);\n if (comboBox.value !== visibleValue) {\n return visibleValue;\n }\n\n return comboBox.value;\n };\n\n private _renderComboBoxWrapper = (\n multiselectAccessibleText: string | undefined,\n errorMessageId: string,\n ): JSX.Element => {\n const {\n label,\n disabled,\n ariaLabel,\n ariaDescribedBy,\n required,\n errorMessage,\n buttonIconProps,\n isButtonAriaHidden = true,\n title,\n placeholder: placeholderProp,\n tabIndex,\n autofill,\n iconButtonProps,\n hoisted: { suggestedDisplayValue },\n } = this.props;\n\n const { isOpen } = this.state;\n\n // If the combo box has focus, is multiselect, and has a display string, then use that placeholder\n // so that the selected items don't appear to vanish. This is not ideal but it's the only reasonable way\n // to correct the behavior where the input is cleared so the user can type. If a full refactor is done, then this\n // should be removed and the multiselect combo box should behave like a picker.\n const placeholder =\n this._hasFocus() && this.props.multiSelect && multiselectAccessibleText\n ? multiselectAccessibleText\n : placeholderProp;\n\n return (\n <div\n data-ktp-target={true}\n ref={this._comboBoxWrapper}\n id={this._id + 'wrapper'}\n className={this._classNames.root}\n >\n <Autofill\n data-ktp-execute-target={true}\n data-is-interactable={!disabled}\n componentRef={this._autofill}\n id={this._id + '-input'}\n className={this._classNames.input}\n type=\"text\"\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n onKeyDown={this._onInputKeyDown}\n onKeyUp={this._onInputKeyUp}\n onClick={this._onAutofillClick}\n onTouchStart={this._onTouchStart}\n onInputValueChange={this._onInputChange}\n aria-expanded={isOpen}\n aria-autocomplete={this._getAriaAutoCompleteValue()}\n role=\"combobox\"\n readOnly={disabled}\n aria-labelledby={label && this._id + '-label'}\n aria-label={ariaLabel && !label ? ariaLabel : undefined}\n aria-describedby={\n errorMessage !== undefined ? mergeAriaAttributeValues(ariaDescribedBy, errorMessageId) : ariaDescribedBy\n }\n aria-activedescendant={this._getAriaActiveDescendantValue()}\n aria-required={required}\n aria-disabled={disabled}\n aria-owns={isOpen ? this._id + '-list' : undefined}\n spellCheck={false}\n defaultVisibleValue={this._currentVisibleValue}\n suggestedDisplayValue={suggestedDisplayValue}\n updateValueInWillReceiveProps={this._onUpdateValueInAutofillWillReceiveProps}\n shouldSelectFullInputValueInComponentDidUpdate={\n this._onShouldSelectFullInputValueInAutofillComponentDidUpdate\n }\n title={title}\n preventValueSelection={!this._hasFocus()}\n placeholder={placeholder}\n tabIndex={tabIndex}\n {...autofill}\n />\n <IconButton\n className={'ms-ComboBox-CaretDown-button'}\n styles={this._getCaretButtonStyles()}\n role=\"presentation\"\n aria-hidden={isButtonAriaHidden}\n data-is-focusable={false}\n tabIndex={-1}\n onClick={this._onComboBoxClick}\n onBlur={this._onBlur}\n iconProps={buttonIconProps}\n disabled={disabled}\n checked={isOpen}\n {...iconButtonProps}\n />\n </div>\n );\n };\n\n /**\n * componentDidUpdate handler for the auto fill component\n *\n * @param defaultVisibleValue - the current defaultVisibleValue in the auto fill's componentDidUpdate\n * @param suggestedDisplayValue - the current suggestedDisplayValue in the auto fill's componentDidUpdate\n * @returns - should the full value of the input be selected?\n * True if the defaultVisibleValue equals the suggestedDisplayValue, false otherwise\n */\n private _onShouldSelectFullInputValueInAutofillComponentDidUpdate = (): boolean => {\n return this._currentVisibleValue === this.props.hoisted.suggestedDisplayValue;\n };\n\n /**\n * Get the correct value to pass to the input\n * to show to the user based off of the current props and state\n * @returns the value to pass to the input\n */\n private _getVisibleValue = (): string | undefined => {\n const {\n text,\n allowFreeform,\n autoComplete,\n hoisted: { suggestedDisplayValue, selectedIndices, currentOptions },\n } = this.props;\n const { currentPendingValueValidIndex, currentPendingValue, isOpen } = this.state;\n\n const currentPendingIndexValid = indexWithinBounds(currentOptions, currentPendingValueValidIndex);\n\n // If the user passed is a value prop, use that\n // unless we are open and have a valid current pending index\n if (\n !(isOpen && currentPendingIndexValid) &&\n text &&\n (currentPendingValue === null || currentPendingValue === undefined)\n ) {\n return text;\n }\n\n if (this.props.multiSelect) {\n // Multi-select\n if (this._hasFocus()) {\n let index = -1;\n if (autoComplete === 'on' && currentPendingIndexValid) {\n index = currentPendingValueValidIndex;\n }\n return this._getPendingString(currentPendingValue, currentOptions, index);\n } else {\n return this._getMultiselectDisplayString(selectedIndices, currentOptions, suggestedDisplayValue);\n }\n } else {\n // Single-select\n let index: number = this._getFirstSelectedIndex();\n if (allowFreeform) {\n // If we are allowing freeform and autocomplete is also true\n // and we've got a pending value that matches an option, remember\n // the matched option's index\n if (autoComplete === 'on' && currentPendingIndexValid) {\n index = currentPendingValueValidIndex;\n }\n\n // Since we are allowing freeform, if there is currently a pending value, use that\n // otherwise use the index determined above (falling back to '' if we did not get a valid index)\n return this._getPendingString(currentPendingValue, currentOptions, index);\n } else {\n // If we are not allowing freeform and have a valid index that matches the pending value,\n // we know we will need some version of the pending value\n if (currentPendingIndexValid && autoComplete === 'on') {\n // If autoComplete is on, return the raw pending value, otherwise remember\n // the matched option's index\n index = currentPendingValueValidIndex;\n return normalizeToString(currentPendingValue);\n } else if (!this.state.isOpen && currentPendingValue) {\n return indexWithinBounds(currentOptions, index)\n ? currentPendingValue\n : normalizeToString(suggestedDisplayValue);\n } else {\n return indexWithinBounds(currentOptions, index)\n ? currentOptions[index].text\n : normalizeToString(suggestedDisplayValue);\n }\n }\n }\n };\n\n private _getPendingString(\n currentPendingValue: string | null | undefined,\n currentOptions: IComboBoxOption[],\n index: number,\n ) {\n return currentPendingValue !== null && currentPendingValue !== undefined\n ? currentPendingValue\n : indexWithinBounds(currentOptions, index)\n ? currentOptions[index].text\n : '';\n }\n\n /**\n * Returns a string that concatenates all of the selected values\n * for multiselect combo box.\n */\n private _getMultiselectDisplayString(\n selectedIndices: number[] | undefined,\n currentOptions: IComboBoxOption[],\n suggestedDisplayValue: string | undefined,\n ) {\n const displayValues = [];\n for (let idx = 0; selectedIndices && idx < selectedIndices.length; idx++) {\n const index: number = selectedIndices[idx];\n displayValues.push(\n indexWithinBounds(currentOptions, index)\n ? currentOptions[index].text\n : normalizeToString(suggestedDisplayValue),\n );\n }\n const { multiSelectDelimiter = ', ' } = this.props;\n return displayValues.join(multiSelectDelimiter);\n }\n\n /**\n * Handler for typing changes on the input\n * @param updatedValue - the newly changed value\n */\n private _onInputChange = (updatedValue: string): void => {\n if (this.props.disabled) {\n this._handleInputWhenDisabled(null /* event */);\n return;\n }\n\n this.props.allowFreeform\n ? this._processInputChangeWithFreeform(updatedValue)\n : this._processInputChangeWithoutFreeform(updatedValue);\n };\n\n /**\n * Process the new input's new value when the combo box allows freeform entry\n * @param updatedValue - the input's newly changed value\n */\n private _processInputChangeWithFreeform(updatedValue: string): void {\n const { currentOptions } = this.props.hoisted;\n let newCurrentPendingValueValidIndex = -1;\n\n // if the new value is empty, see if we have an exact match and then set the pending info\n if (updatedValue === '') {\n const items = currentOptions\n .map((item, index) => ({ ...item, index }))\n .filter(option => isNormalOption(option) && getPreviewText(option) === updatedValue);\n\n // if we found a match remember the index\n if (items.length === 1) {\n newCurrentPendingValueValidIndex = items[0].index;\n }\n\n this._setPendingInfo(updatedValue, newCurrentPendingValueValidIndex, updatedValue);\n return;\n }\n\n // Remember the original value and then make the value lowercase for comparison\n const originalUpdatedValue: string = updatedValue;\n updatedValue = updatedValue.toLocaleLowerCase();\n\n let newSuggestedDisplayValue = '';\n\n // If autoComplete is on, attempt to find a match from the available options\n if (this.props.autoComplete === 'on') {\n // If autoComplete is on, attempt to find a match where the text of an option starts with the updated value\n const items = currentOptions\n .map((item, index) => ({ ...item, index }))\n .filter(\n option =>\n isNormalOption(option) &&\n getPreviewText(option)\n .toLocaleLowerCase()\n .indexOf(updatedValue) === 0,\n );\n if (items.length > 0) {\n // use ariaLabel as the value when the option is set\n const text: string = getPreviewText(items[0]);\n\n // If the user typed out the complete option text, we don't need any suggested display text anymore\n newSuggestedDisplayValue = text.toLocaleLowerCase() !== updatedValue ? text : '';\n\n // remember the index of the match we found\n newCurrentPendingValueValidIndex = items[0].index;\n }\n } else {\n // If autoComplete is off, attempt to find a match only when the value is exactly equal to the text of an option\n const items = currentOptions\n .map((item, index) => ({ ...item, index }))\n .filter(option => isNormalOption(option) && getPreviewText(option).toLocaleLowerCase() === updatedValue);\n\n // if we found a match remember the index\n if (items.length === 1) {\n newCurrentPendingValueValidIndex = items[0].index;\n }\n }\n\n // Set the updated state\n this._setPendingInfo(originalUpdatedValue, newCurrentPendingValueValidIndex, newSuggestedDisplayValue);\n }\n\n /**\n * Process the new input's new value when the combo box does not allow freeform entry\n * @param updatedValue - the input's newly changed value\n */\n private _processInputChangeWithoutFreeform(updatedValue: string): void {\n const { currentOptions } = this.props.hoisted;\n const { currentPendingValue, currentPendingValueValidIndex } = this.state;\n\n if (this.props.autoComplete === 'on') {\n // If autoComplete is on while allow freeform is off,\n // we will remember the key press and build up a string to attempt to match\n // as long as characters are typed within a the timeout span of each other,\n // otherwise we will clear the string and start building a new one on the next keypress.\n // Also, only do this processing if we have a non-empty value\n if (updatedValue !== '') {\n // If we have a pending autocomplete clearing task,\n // we know that the user is typing with key press happening\n // within the timeout of each other so remove the clearing task\n // and continue building the pending value with the updated value\n if (this._autoCompleteTimeout) {\n this._async.clearTimeout(this._autoCompleteTimeout);\n this._autoCompleteTimeout = undefined;\n updatedValue = normalizeToString(currentPendingValue) + updatedValue;\n }\n\n const originalUpdatedValue: string = updatedValue;\n updatedValue = updatedValue.toLocaleLowerCase();\n\n // If autoComplete is on, attempt to find a match where the text of an option starts with the updated value\n const items = currentOptions\n .map((item, i) => ({ ...item, index: i }))\n\n .filter(option => isNormalOption(option) && option.text.toLocaleLowerCase().indexOf(updatedValue) === 0);\n\n // If we found a match, update the state\n if (items.length > 0) {\n this._setPendingInfo(originalUpdatedValue, items[0].index, getPreviewText(items[0]));\n }\n\n // Schedule a timeout to clear the pending value after the timeout span\n this._autoCompleteTimeout = this._async.setTimeout(() => {\n this._autoCompleteTimeout = undefined;\n }, ReadOnlyPendingAutoCompleteTimeout);\n return;\n }\n }\n\n // If we get here, either autoComplete is on or we did not find a match with autoComplete on.\n // Remember we are not allowing freeform, so at this point, if we have a pending valid value index\n // use that; otherwise use the selectedIndex\n const index = currentPendingValueValidIndex >= 0 ? currentPendingValueValidIndex : this._getFirstSelectedIndex();\n\n // Since we are not allowing freeform, we need to\n // set both the pending and suggested values/index\n // to allow us to select all content in the input to\n // give the illusion that we are readonly (e.g. freeform off)\n this._setPendingInfoFromIndex(index);\n }\n\n private _getFirstSelectedIndex(): number {\n const { selectedIndices } = this.props.hoisted;\n return selectedIndices?.length ? selectedIndices[0] : -1;\n }\n\n /**\n * Walk along the options starting at the index, stepping by the delta (positive or negative)\n * looking for the next valid selectable index (e.g. skipping headings and dividers)\n * @param index - the index to get the next selectable index from\n * @param delta - optional delta to step by when finding the next index, defaults to 0\n * @returns - the next valid selectable index. If the new index is outside of the bounds,\n * it will snap to the edge of the options array. If delta == 0 and the given index is not selectable\n */\n private _getNextSelectableIndex(index: number, searchDirection: SearchDirection): number {\n const { currentOptions } = this.props.hoisted;\n\n let newIndex = index + searchDirection;\n\n newIndex = Math.max(0, Math.min(currentOptions.length - 1, newIndex));\n\n if (!indexWithinBounds(currentOptions, newIndex)) {\n return -1;\n }\n\n const option: IComboBoxOption = currentOptions[newIndex];\n\n if (!isNormalOption(option) || option.hidden === true) {\n // Should we continue looking for an index to select?\n if (\n searchDirection !== SearchDirection.none &&\n ((newIndex > 0 && searchDirection < SearchDirection.none) ||\n (newIndex >= 0 && newIndex < currentOptions.length && searchDirection > SearchDirection.none))\n ) {\n newIndex = this._getNextSelectableIndex(newIndex, searchDirection);\n } else {\n // If we cannot perform a useful search just return the index we were given\n return index;\n }\n }\n\n // We have the next valid selectable index, return it\n return newIndex;\n }\n\n /**\n * Set the selected index. Note, this is\n * the \"real\" selected index, not the pending selected index\n * @param index - the index to set (or the index to set from if a search direction is provided)\n * @param searchDirection - the direction to search along the options from the given index\n */\n private _setSelectedIndex(\n index: number,\n submitPendingValueEvent: React.SyntheticEvent<any>,\n searchDirection: SearchDirection = SearchDirection.none,\n ): void {\n const {\n onChange,\n onPendingValueChanged,\n hoisted: { selectedIndices: initialIndices, currentOptions },\n } = this.props;\n\n // Clone selectedIndices so we don't mutate state\n let selectedIndices = initialIndices ? initialIndices.slice() : [];\n\n // Find the next selectable index, if searchDirection is none\n // we will get our starting index back\n index = this._getNextSelectableIndex(index, searchDirection);\n\n if (!indexWithinBounds(currentOptions, index)) {\n return;\n }\n\n // Are we at a new index? If so, update the state, otherwise\n // there is nothing to do\n if (\n this.props.multiSelect ||\n selectedIndices.length < 1 ||\n (selectedIndices.length === 1 && selectedIndices[0] !== index)\n ) {\n const option: IComboBoxOption = { ...currentOptions[index] };\n // if option doesn't existing, or option is disabled, we noop\n if (!option || option.disabled) {\n return;\n }\n if (this.props.multiSelect) {\n // Setting the initial state of option.selected in Multi-select combo box by checking the\n // selectedIndices array and overriding the undefined issue\n option.selected = option.selected !== undefined ? !option.selected : selectedIndices.indexOf(index) < 0;\n if (option.selected && selectedIndices.indexOf(index) < 0) {\n selectedIndices.push(index);\n } else if (!option.selected && selectedIndices.indexOf(index) >= 0) {\n selectedIndices = selectedIndices.filter((value: number) => value !== index);\n }\n } else {\n selectedIndices[0] = index;\n }\n\n submitPendingValueEvent.persist();\n\n // Only setState if combo box is uncontrolled.\n if (this.props.selectedKey || this.props.selectedKey === null) {\n // If combo box value is changed, revert preview first\n if (this._hasPendingValue && onPendingValueChanged) {\n onPendingValueChanged();\n this._hasPendingValue = false;\n }\n if (onChange) {\n onChange(submitPendingValueEvent, option, index, undefined);\n }\n } else {\n // Update current options\n const changedOptions = currentOptions.slice();\n changedOptions[index] = option;\n\n // Call onChange after state is updated\n this.props.hoisted.setSelectedIndices(selectedIndices);\n this.props.hoisted.setCurrentOptions(changedOptions);\n\n // If ComboBox value is changed, revert preview first\n if (this._hasPendingValue && onPendingValueChanged) {\n onPendingValueChanged();\n this._hasPendingValue = false;\n }\n\n if (onChange) {\n onChange(submitPendingValueEvent, option, index, undefined);\n }\n }\n }\n if (this.props.multiSelect && this.state.isOpen) {\n return;\n }\n // clear all of the pending info\n this._clearPendingInfo();\n }\n\n /**\n * Focus (and select) the content of the input\n * and set the focused state\n */\n private _onFocus = (): void => {\n this._autofill.current?.inputElement?.select();\n\n if (!this._hasFocus()) {\n this.setState({ focusState: 'focusing' });\n }\n };\n\n /**\n * Callback issued when the options should be resolved, if they have been updated or\n * if they need to be passed in the first time. This only does work if an onResolveOptions\n * callback was passed in\n */\n private _onResolveOptions = (): void => {\n if (this.props.onResolveOptions) {\n // get the options\n const newOptions = this.props.onResolveOptions([...this.props.hoisted.currentOptions]);\n\n // Check to see if the returned value is an array, if it is update the state\n // If the returned value is not an array then check to see if it's a promise or PromiseLike.\n // If it is then resolve it asynchronously.\n if (Array.isArray(newOptions)) {\n this.props.hoisted.setCurrentOptions(newOptions);\n } else if (newOptions && newOptions.then) {\n // Ensure that the promise will only use the callback if it was the most recent one\n // and update the state when the promise returns\n const promise: PromiseLike<IComboBoxOption[]> = (this._currentPromise = newOptions);\n promise.then((newOptionsFromPromise: IComboBoxOption[]) => {\n if (promise === this._currentPromise) {\n this.props.hoisted.setCurrentOptions(newOptionsFromPromise);\n }\n });\n }\n }\n };\n\n /**\n * OnBlur handler. Set the focused state to false\n * and submit any pending value\n */\n // eslint-disable-next-line deprecation/deprecation\n private _onBlur = (event: React.FocusEvent<HTMLElement | Autofill | BaseButton | Button>): void => {\n // Do nothing if the blur is coming from something\n // inside the comboBox root or the comboBox menu since\n // it we are not really blurring from the whole comboBox\n let relatedTarget = event.relatedTarget;\n if (event.relatedTarget === null) {\n // In IE11, due to lack of support, event.relatedTarget is always\n // null making every onBlur call to be \"outside\" of the ComboBox\n // even when it's not. Using document.activeElement is another way\n // for us to be able to get what the relatedTarget without relying\n // on the event\n relatedTarget = document.activeElement as Element;\n }\n\n if (relatedTarget) {\n const isBlurFromComboBoxTitle = this.props.hoisted.rootRef.current?.contains(relatedTarget as HTMLElement);\n const isBlurFromComboBoxMenu = this._comboBoxMenu.current?.contains(relatedTarget as HTMLElement);\n const isBlurFromComboBoxMenuAncestor =\n this._comboBoxMenu.current &&\n findElementRecursive(this._comboBoxMenu.current, (element: HTMLElement) => element === relatedTarget);\n\n if (isBlurFromComboBoxTitle || isBlurFromComboBoxMenu || isBlurFromComboBoxMenuAncestor) {\n if (\n isBlurFromComboBoxMenuAncestor &&\n this._hasFocus() &&\n (!this.props.multiSelect || this.props.allowFreeform)\n ) {\n this._submitPendingValue(event);\n }\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n }\n\n if (this._hasFocus()) {\n this.setState({ focusState: 'none' });\n if (!this.props.multiSelect || this.props.allowFreeform) {\n this._submitPendingValue(event);\n }\n }\n };\n\n /**\n * Submit a pending value if there is one\n */\n private _submitPendingValue(submitPendingValueEvent: React.SyntheticEvent<any>): void {\n const { onChange, allowFreeform, autoComplete, multiSelect, hoisted } = this.props;\n const { currentOptions } = hoisted;\n const { currentPendingValue, currentPendingValueValidIndex, currentPendingValueValidIndexOnHover } = this.state;\n let { selectedIndices } = this.props.hoisted;\n\n // Do not submit any pending value if we\n // have already initiated clearing the pending info\n if (this._processingClearPendingInfo) {\n return;\n }\n\n // If we allow freeform we need to handle that\n if (allowFreeform) {\n // if currentPendingValue is null or undefined the user did not submit anything\n // (not even empty because we would have stored that as the pending value)\n if (currentPendingValue === null || currentPendingValue === undefined) {\n // if a user did not type anything they may just hovered over an item\n if (currentPendingValueValidIndexOnHover >= 0) {\n this._setSelectedIndex(currentPendingValueValidIndexOnHover, submitPendingValueEvent);\n this._clearPendingInfo();\n }\n\n return;\n }\n\n // Check to see if the user typed an exact match\n if (indexWithinBounds(currentOptions, currentPendingValueValidIndex)) {\n const pendingOptionText = getPreviewText(currentOptions[currentPendingValueValidIndex]).toLocaleLowerCase();\n const autofill = this._autofill.current;\n\n // By exact match, that means: our pending value is the same as the pending option text OR\n // the pending option starts with the pending value and we have an \"autoComplete\" selection\n // where the total length is equal to pending option length OR\n // the live value in the underlying input matches the pending option; update the state\n if (\n currentPendingValue.toLocaleLowerCase() === pendingOptionText ||\n (autoComplete &&\n pendingOptionText.indexOf(currentPendingValue.toLocaleLowerCase()) === 0 &&\n autofill?.isValueSelected &&\n currentPendingValue.length + (autofill.selectionEnd! - autofill.selectionStart!) ===\n pendingOptionText.length) ||\n autofill?.inputElement?.value.toLocaleLowerCase() === pendingOptionText\n ) {\n this._setSelectedIndex(currentPendingValueValidIndex, submitPendingValueEvent);\n if (multiSelect && this.state.isOpen) {\n return;\n }\n this._clearPendingInfo();\n return;\n }\n }\n\n if (onChange) {\n if (onChange) {\n // trigger onChange to clear value\n onChange(submitPendingValueEvent, undefined, undefined, currentPendingValue);\n }\n } else {\n // If we are not controlled, create a new selected option\n const newOption: IComboBoxOption = {\n key: currentPendingValue || getId(),\n text: normalizeToString(currentPendingValue),\n };\n // If it's multiselect, set selected state to true\n if (multiSelect) {\n newOption.selected = true;\n }\n const newOptions: IComboBoxOption[] = currentOptions.concat([newOption]);\n if (selectedIndices) {\n if (!multiSelect) {\n selectedIndices = [];\n }\n selectedIndices.push(newOptions.length - 1);\n }\n hoisted.setCurrentOptions(newOptions);\n hoisted.setSelectedIndices(selectedIndices);\n }\n } else if (currentPendingValueValidIndex >= 0) {\n // Since we are not allowing freeform, we must have a matching\n // to be able to update state\n this._setSelectedIndex(currentPendingValueValidIndex, submitPendingValueEvent);\n } else if (currentPendingValueValidIndexOnHover >= 0) {\n // If all else failed and we were hovering over an item, select it\n this._setSelectedIndex(currentPendingValueValidIndexOnHover, submitPendingValueEvent);\n }\n\n // Finally, clear the pending info\n this._clearPendingInfo();\n }\n\n // Render Callout container and pass in list\n private _onRenderContainer = (props: IComboBoxProps): JSX.Element => {\n const {\n onRenderList,\n calloutProps,\n dropdownWidth,\n dropdownMaxWidth,\n onRenderUpperContent = this._onRenderUpperContent,\n onRenderLowerContent = this._onRenderLowerContent,\n useComboBoxAsMenuWidth,\n persistMenu,\n shouldRestoreFocus = true,\n } = props;\n\n const { isOpen } = this.state;\n\n const comboBoxMenuWidth =\n useComboBoxAsMenuWidth && this._comboBoxWrapper.current\n ? this._comboBoxWrapper.current.clientWidth + 2\n : undefined;\n\n return (\n <Callout\n isBeakVisible={false}\n gapSpace={0}\n doNotLayer={false}\n directionalHint={DirectionalHint.bottomLeftEdge}\n directionalHintFixed={false}\n {...calloutProps}\n onLayerMounted={this._onLayerMounted}\n className={css(this._classNames.callout, calloutProps?.className)}\n target={this._comboBoxWrapper.current}\n onDismiss={this._onDismiss}\n onMouseDown={this._onCalloutMouseDown}\n onScroll={this._onScroll}\n setInitialFocus={false}\n calloutWidth={\n useComboBoxAsMenuWidth && this._comboBoxWrapper.current\n ? comboBoxMenuWidth && comboBoxMenuWidth\n : dropdownWidth\n }\n calloutMaxWidth={dropdownMaxWidth ? dropdownMaxWidth : comboBoxMenuWidth}\n hidden={persistMenu ? !isOpen : undefined}\n shouldRestoreFocus={shouldRestoreFocus}\n >\n {onRenderUpperContent(this.props, this._onRenderUpperContent)}\n <div className={this._classNames.optionsContainerWrapper} ref={this._comboBoxMenu}>\n {onRenderList?.({ ...props }, this._onRenderList)}\n </div>\n {onRenderLowerContent(this.props, this._onRenderLowerContent)}\n </Callout>\n );\n };\n\n private _onCalloutLayerMounted() {\n // In persistMenu mode _onLayerMounted is only called once for the lifetime\n // of the component. Any functionality required for callout \"on mount\" can\n // go here so that we can also call it again during callout dismissal to reset\n // object state.\n this._gotMouseMove = false;\n }\n\n private _onLayerMounted = () => {\n this._onCalloutLayerMounted();\n\n if (this.props.calloutProps && this.props.calloutProps.onLayerMounted) {\n this.props.calloutProps.onLayerMounted();\n }\n };\n\n private _onRenderLabel = (onRenderLabelProps: IOnRenderComboBoxLabelProps): JSX.Element | null => {\n const { label, disabled, required } = onRenderLabelProps.props;\n\n if (label) {\n return (\n <Label id={this._id + '-label'} disabled={disabled} required={required} className={this._classNames.label}>\n {label}\n {onRenderLabelProps.multiselectAccessibleText && (\n <span className={this._classNames.screenReaderText}>{onRenderLabelProps.multiselectAccessibleText}</span>\n )}\n </Label>\n );\n }\n\n return null;\n };\n\n // Render List of items\n private _onRenderList = (props: IComboBoxProps): JSX.Element => {\n const { onRenderItem, options } = props;\n\n const id = this._id;\n return (\n <div\n id={id + '-list'}\n className={this._classNames.optionsContainer}\n aria-labelledby={id + '-label'}\n role=\"listbox\"\n >\n {options.map(item => onRenderItem?.(item, this._onRenderItem))}\n </div>\n );\n };\n\n // Render items\n private _onRenderItem = (item: IComboBoxOption): JSX.Element | null => {\n switch (item.itemType) {\n case SelectableOptionMenuItemType.Divider:\n return this._renderSeparator(item);\n case SelectableOptionMenuItemType.Header:\n return this._renderHeader(item);\n default:\n return this._renderOption(item);\n }\n };\n\n // Default _onRenderLowerContent function returns nothing\n private _onRenderLowerContent = (): null => {\n return null;\n };\n\n // Default _onRenderUpperContent function returns nothing\n private _onRenderUpperContent = (): null => {\n return null;\n };\n\n // Render separator\n private _renderSeparator(item: IComboBoxOption): JSX.Element | null {\n const { index, key } = item;\n\n if (index && index > 0) {\n return <div role=\"separator\" key={key} className={this._classNames.divider} />;\n }\n return null;\n }\n\n private _renderHeader(item: IComboBoxOption): JSX.Element {\n const { onRenderOption = this._onRenderOptionContent } = this.props;\n\n return (\n <div key={item.key} className={this._classNames.header}>\n {onRenderOption(item, this._onRenderOptionContent)}\n </div>\n );\n }\n\n private _renderOption = (item: IComboBoxOption): JSX.Element => {\n const { onRenderOption = this._onRenderOptionContent } = this.props;\n const id = this._id;\n const isSelected: boolean = this._isOptionSelected(item.index);\n const isChecked: boolean = this._isOptionChecked(item.index);\n const optionStyles = this._getCurrentOptionStyles(item);\n const optionClassNames = getComboBoxOptionClassNames(this._getCurrentOptionStyles(item));\n const title = getPreviewText(item);\n\n const onRenderCheckboxLabel = () => onRenderOption(item, this._onRenderOptionContent);\n\n const getOptionComponent = () => {\n return !this.props.multiSelect ? (\n <CommandButton\n id={id + '-list' + item.index}\n key={item.key}\n data-index={item.index}\n styles={optionStyles}\n checked={isSelected}\n className={'ms-ComboBox-option'}\n onClick={this._onItemClick(item)}\n // eslint-disable-next-line react/jsx-no-bind\n onMouseEnter={this._onOptionMouseEnter.bind(this, item.index)}\n // eslint-disable-next-line react/jsx-no-bind\n onMouseMove={this._onOptionMouseMove.bind(this, item.index)}\n onMouseLeave={this._onOptionMouseLeave}\n role=\"option\"\n // aria-selected should only be applied to checked items, not hovered items\n aria-selected={isChecked ? 'true' : 'false'}\n ariaLabel={getPreviewText(item)}\n disabled={item.disabled}\n title={title}\n >\n {\n <span className={optionClassNames.optionTextWrapper} ref={isSelected ? this._selectedElement : undefined}>\n {onRenderOption(item, this._onRenderOptionContent)}\n </span>\n }\n </CommandButton>\n ) : (\n <Checkbox\n id={id + '-list' + item.index}\n ariaLabel={getPreviewText(item)}\n key={item.key}\n styles={optionStyles}\n className={'ms-ComboBox-option'}\n onChange={this._onItemClick(item)}\n label={item.text}\n checked={isChecked}\n title={title}\n disabled={item.disabled}\n // eslint-disable-next-line react/jsx-no-bind\n onRenderLabel={onRenderCheckboxLabel}\n inputProps={{\n // aria-selected should only be applied to checked items, not hovered items\n 'aria-selected': isChecked ? 'true' : 'false',\n role: 'option',\n ...({\n 'data-index': item.index,\n 'data-is-focusable': true,\n } as any),\n }}\n />\n );\n };\n\n return (\n <ComboBoxOptionWrapper\n key={item.key}\n index={item.index}\n disabled={item.disabled}\n isSelected={isSelected}\n isChecked={isChecked}\n text={item.text}\n // eslint-disable-next-line react/jsx-no-bind\n render={getOptionComponent}\n data={item.data}\n />\n );\n };\n\n /**\n * If we are coming from a mouseOut:\n * there is no visible selected option.\n *\n * Else if We are hovering over an item:\n * that gets the selected look.\n *\n * Else:\n * Use the current valid pending index if it exists OR\n * we do not have a valid index and we currently have a pending input value,\n * otherwise use the selected index\n * */\n private _isOptionSelected(index: number | undefined): boolean {\n const { currentPendingValueValidIndexOnHover } = this.state;\n\n // If the hover state is set to clearAll, don't show a selected index.\n // Note, this happens when the user moused out of the menu items\n if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n return false;\n }\n\n return this._getPendingSelectedIndex(true /* includePendingValue */) === index ? true : false;\n }\n\n private _isOptionChecked(index: number | undefined): boolean {\n if (this.props.multiSelect && index !== undefined && this.props.hoisted.selectedIndices) {\n let idxOfSelectedIndex = -1;\n\n idxOfSelectedIndex = this.props.hoisted.selectedIndices.indexOf(index);\n return idxOfSelectedIndex >= 0;\n }\n return false;\n }\n\n /**\n * Gets the pending selected index taking into account hover, valueValidIndex, and selectedIndex\n * @param includeCurrentPendingValue - Should we include the currentPendingValue when\n * finding the index\n */\n private _getPendingSelectedIndex(includeCurrentPendingValue: boolean): number {\n const { currentPendingValueValidIndexOnHover, currentPendingValueValidIndex, currentPendingValue } = this.state;\n\n return currentPendingValueValidIndexOnHover >= 0\n ? currentPendingValueValidIndexOnHover\n : currentPendingValueValidIndex >= 0 ||\n (includeCurrentPendingValue && currentPendingValue !== null && currentPendingValue !== undefined)\n ? currentPendingValueValidIndex\n : this.props.multiSelect\n ? 0\n : this._getFirstSelectedIndex();\n }\n\n /**\n * Mouse clicks to headers, dividers and scrollbar should not make input lose focus\n */\n private _onCalloutMouseDown: ICalloutProps['onMouseDown'] = ev => {\n ev.preventDefault();\n };\n\n /**\n * Scroll handler for the callout to make sure the mouse events\n * for updating focus are not interacting during scroll\n */\n private _onScroll = () => {\n if (!this._isScrollIdle && this._scrollIdleTimeoutId !== undefined) {\n this._async.clearTimeout(this._scrollIdleTimeoutId);\n this._scrollIdleTimeoutId = undefined;\n } else {\n this._isScrollIdle = false;\n }\n\n this._scrollIdleTimeoutId = this._async.setTimeout(() => {\n this._isScrollIdle = true;\n }, ScrollIdleDelay);\n };\n\n /**\n * Scroll the selected element into view\n */\n private _scrollIntoView(): void {\n const { onScrollToItem, scrollSelectedToTop } = this.props;\n\n const { currentPendingValueValidIndex, currentPendingValue } = this.state;\n\n if (onScrollToItem) {\n // Use the custom scroll handler\n onScrollToItem(\n currentPendingValueValidIndex >= 0 || currentPendingValue !== ''\n ? currentPendingValueValidIndex\n : this._getFirstSelectedIndex(),\n );\n } else if (this._selectedElement.current && this._selectedElement.current.offsetParent) {\n // We are using refs, scroll the ref into view\n if (scrollSelectedToTop) {\n this._selectedElement.current.offsetParent.scrollIntoView(true);\n } else {\n let alignToTop = true;\n\n if (this._comboBoxMenu.current && this._comboBoxMenu.current.offsetParent) {\n const scrollableParentRect = this._comboBoxMenu.current.offsetParent.getBoundingClientRect();\n const selectedElementRect = this._selectedElement.current.offsetParent.getBoundingClientRect();\n\n // If we are completely in view then we do not need to scroll\n if (\n scrollableParentRect.top <= selectedElementRect.top &&\n scrollableParentRect.top + scrollableParentRect.height >=\n selectedElementRect.top + selectedElementRect.height\n ) {\n return;\n }\n\n // If we are lower than the scrollable parent viewport then we should align to the bottom\n if (\n scrollableParentRect.top + scrollableParentRect.height <=\n selectedElementRect.top + selectedElementRect.height\n ) {\n alignToTop = false;\n }\n }\n\n this._selectedElement.current.offsetParent.scrollIntoView(alignToTop);\n }\n }\n }\n\n private _onRenderOptionContent = (item: IComboBoxOption): JSX.Element => {\n const optionClassNames = getComboBoxOptionClassNames(this._getCurrentOptionStyles(item));\n return <span className={optionClassNames.optionText}>{item.text}</span>;\n };\n\n /**\n * Click handler for the menu items\n * to select the item and also close the menu\n * @param index - the index of the item that was clicked\n */\n private _onItemClick(item: IComboBoxOption): (ev: React.MouseEvent<any>) => void {\n const { onItemClick } = this.props;\n const { index } = item;\n return (ev: React.MouseEvent<any>): void => {\n // only close the callout when it's in single-select mode\n if (!this.props.multiSelect) {\n // ensure that focus returns to the input, not the button\n this._autofill.current && this._autofill.current.focus();\n this.setState({\n isOpen: false,\n });\n }\n\n // Continue processing the click only after\n // performing menu close / control focus(inner working)\n onItemClick && onItemClick(ev, item, index);\n this._setSelectedIndex(index as number, ev);\n };\n }\n\n /**\n * Handles dismissing (cancelling) the menu\n */\n private _onDismiss = (): void => {\n const { onMenuDismiss } = this.props;\n if (onMenuDismiss) {\n onMenuDismiss();\n }\n\n // In persistMode we need to simulate callout layer mount\n // since that only happens once. We do it on dismiss since\n // it works either way.\n if (this.props.persistMenu) {\n this._onCalloutLayerMounted();\n }\n\n // close the menu\n this._setOpenStateAndFocusOnClose(false /* isOpen */, false /* focusInputAfterClose */);\n\n // reset the selected index\n // to the last value state\n this._resetSelectedIndex();\n };\n\n /**\n * Reset the selected index by clearing the\n * input (of any pending text), clearing the pending state,\n * and setting the suggested display value to the last\n * selected state text\n */\n private _resetSelectedIndex(): void {\n const { currentOptions } = this.props.hoisted;\n this._clearPendingInfo();\n\n const selectedIndex: number = this._getFirstSelectedIndex();\n if (selectedIndex > 0 && selectedIndex < currentOptions.length) {\n this.props.hoisted.setSuggestedDisplayValue(currentOptions[selectedIndex].text);\n } else if (this.props.text) {\n // If we had a value initially, restore it\n this.props.hoisted.setSuggestedDisplayValue(this.props.text);\n }\n }\n\n /**\n * Clears the pending info state\n */\n private _clearPendingInfo(): void {\n this._processingClearPendingInfo = true;\n\n this.props.hoisted.setSuggestedDisplayValue(undefined);\n this.setState(\n {\n currentPendingValue: undefined,\n currentPendingValueValidIndex: -1,\n currentPendingValueValidIndexOnHover: HoverStatus.default,\n },\n this._onAfterClearPendingInfo,\n );\n }\n\n private _onAfterClearPendingInfo = () => {\n this._processingClearPendingInfo = false;\n };\n\n /**\n * Set the pending info\n * @param currentPendingValue - new pending value to set\n * @param currentPendingValueValidIndex - new pending value index to set\n * @param suggestedDisplayValue - new suggest display value to set\n */\n private _setPendingInfo(\n currentPendingValue?: string,\n currentPendingValueValidIndex: number = -1,\n suggestedDisplayValue?: string,\n ): void {\n if (this._processingClearPendingInfo) {\n return;\n }\n\n this.props.hoisted.setSuggestedDisplayValue(suggestedDisplayValue);\n this.setState({\n currentPendingValue: normalizeToString(currentPendingValue),\n currentPendingValueValidIndex: currentPendingValueValidIndex,\n currentPendingValueValidIndexOnHover: HoverStatus.default,\n });\n }\n\n /**\n * Set the pending info from the given index\n * @param index - the index to set the pending info from\n */\n private _setPendingInfoFromIndex(index: number): void {\n const { currentOptions } = this.props.hoisted;\n\n if (index >= 0 && index < currentOptions.length) {\n const option = currentOptions[index];\n this._setPendingInfo(getPreviewText(option), index, getPreviewText(option));\n } else {\n this._clearPendingInfo();\n }\n }\n\n /**\n * Sets the pending info for the combo box\n * @param index - the index to search from\n * @param searchDirection - the direction to search\n */\n private _setPendingInfoFromIndexAndDirection(index: number, searchDirection: SearchDirection): void {\n const { currentOptions } = this.props.hoisted;\n\n // update index to allow content to wrap\n if (searchDirection === SearchDirection.forward && index >= currentOptions.length - 1) {\n index = -1;\n } else if (searchDirection === SearchDirection.backward && index <= 0) {\n index = currentOptions.length;\n }\n\n // get the next \"valid\" index\n const indexUpdate = this._getNextSelectableIndex(index, searchDirection);\n\n // if the two indices are equal we didn't move and\n // we should attempt to get get the first/last \"valid\" index to use\n // (Note, this takes care of the potential cases where the first/last\n // item is not focusable), otherwise use the updated index\n if (index === indexUpdate) {\n if (searchDirection === SearchDirection.forward) {\n index = this._getNextSelectableIndex(-1, searchDirection);\n } else if (searchDirection === SearchDirection.backward) {\n index = this._getNextSelectableIndex(currentOptions.length, searchDirection);\n }\n } else {\n index = indexUpdate;\n }\n\n if (indexWithinBounds(currentOptions, index)) {\n this._setPendingInfoFromIndex(index);\n }\n }\n\n private _notifyPendingValueChanged(prevState: IComboBoxState): void {\n const { onPendingValueChanged } = this.props;\n\n if (!onPendingValueChanged) {\n return;\n }\n\n const { currentOptions } = this.props.hoisted;\n const { currentPendingValue, currentPendingValueValidIndex, currentPendingValueValidIndexOnHover } = this.state;\n\n let newPendingIndex: number | undefined = undefined;\n let newPendingValue: string | undefined = undefined;\n\n if (\n currentPendingValueValidIndexOnHover !== prevState.currentPendingValueValidIndexOnHover &&\n indexWithinBounds(currentOptions, currentPendingValueValidIndexOnHover)\n ) {\n // Set new pending index if hover index was changed\n newPendingIndex = currentPendingValueValidIndexOnHover;\n } else if (\n currentPendingValueValidIndex !== prevState.currentPendingValueValidIndex &&\n indexWithinBounds(currentOptions, currentPendingValueValidIndex)\n ) {\n // Set new pending index if currentPendingValueValidIndex was changed\n newPendingIndex = currentPendingValueValidIndex;\n } else if (currentPendingValue !== prevState.currentPendingValue) {\n // Set pendingValue in the case it was changed and no index was changed\n newPendingValue = currentPendingValue;\n }\n\n // Notify when there is a new pending index/value. Also, if there is a pending value, it needs to send undefined.\n if (newPendingIndex !== undefined || newPendingValue !== undefined || this._hasPendingValue) {\n onPendingValueChanged(\n newPendingIndex !== undefined ? currentOptions[newPendingIndex] : undefined,\n newPendingIndex,\n newPendingValue,\n );\n this._hasPendingValue = newPendingIndex !== undefined || newPendingValue !== undefined;\n }\n }\n\n /**\n * Sets the isOpen state and updates focusInputAfterClose\n */\n private _setOpenStateAndFocusOnClose(isOpen: boolean, focusInputAfterClose: boolean): void {\n this._focusInputAfterClose = focusInputAfterClose;\n this.setState({\n isOpen: isOpen,\n });\n }\n\n /**\n * Handle keydown on the input\n * @param ev - The keyboard event that was fired\n */\n private _onInputKeyDown = (ev: React.KeyboardEvent<HTMLElement | Autofill>): void => {\n const {\n disabled,\n allowFreeform,\n autoComplete,\n hoisted: { currentOptions },\n } = this.props;\n const { isOpen, currentPendingValueValidIndexOnHover } = this.state;\n\n // Take note if we are processing an alt (option) or meta (command) keydown.\n // See comment in _onInputKeyUp for reasoning.\n this._lastKeyDownWasAltOrMeta = isAltOrMeta(ev);\n\n if (disabled) {\n this._handleInputWhenDisabled(ev);\n return;\n }\n\n let index = this._getPendingSelectedIndex(false /* includeCurrentPendingValue */);\n\n // eslint-disable-next-line deprecation/deprecation\n switch (ev.which) {\n case KeyCodes.enter:\n if (this._autofill.current && this._autofill.current.inputElement) {\n this._autofill.current.inputElement.select();\n }\n\n this._submitPendingValue(ev);\n if (this.props.multiSelect && isOpen) {\n this.setState({\n currentPendingValueValidIndex: index,\n });\n } else {\n // On enter submit the pending value\n if (\n isOpen ||\n ((!allowFreeform ||\n this.state.currentPendingValue === undefined ||\n this.state.currentPendingValue === null ||\n this.state.currentPendingValue.length <= 0) &&\n this.state.currentPendingValueValidIndex < 0)\n ) {\n // if we are open or\n // if we are not allowing freeform or\n // our we have no pending value\n // and no valid pending index\n // flip the open state\n this.setState({\n isOpen: !isOpen,\n });\n }\n }\n break;\n\n case KeyCodes.tab:\n // On enter submit the pending value\n if (!this.props.multiSelect) {\n this._submitPendingValue(ev);\n }\n\n // If we are not allowing freeform\n // or the combo box is open, flip the open state\n if (isOpen) {\n this._setOpenStateAndFocusOnClose(!isOpen, false /* focusInputAfterClose */);\n }\n\n // Allow TAB to propagate\n return;\n\n case KeyCodes.escape:\n // reset the selected index\n this._resetSelectedIndex();\n\n // Close the menu if opened\n if (isOpen) {\n this.setState({\n isOpen: false,\n });\n } else {\n return;\n }\n break;\n\n case KeyCodes.up:\n // if we are in clearAll state (e.g. the user as hovering\n // and has since mousedOut of the menu items),\n // go to the last index\n if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n index = this.props.hoisted.currentOptions.length;\n }\n\n if (ev.altKey || ev.metaKey) {\n // Close the menu if it is open and break so\n // that the event get stopPropagation and prevent default.\n // Otherwise, we need to let the event continue to propagate\n if (isOpen) {\n this._setOpenStateAndFocusOnClose(!isOpen, true /* focusInputAfterClose */);\n break;\n }\n\n return;\n }\n\n // Go to the previous option\n this._setPendingInfoFromIndexAndDirection(index, SearchDirection.backward);\n break;\n\n case KeyCodes.down:\n // Expand the combo box on ALT + DownArrow\n if (ev.altKey || ev.metaKey) {\n this._setOpenStateAndFocusOnClose(true /* isOpen */, true /* focusInputAfterClose */);\n } else {\n // if we are in clearAll state (e.g. the user as hovering\n // and has since mousedOut of the menu items),\n // go to the first index\n if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n index = -1;\n }\n\n // Got to the next option\n this._setPendingInfoFromIndexAndDirection(index, SearchDirection.forward);\n }\n break;\n\n case KeyCodes.home:\n case KeyCodes.end:\n if (allowFreeform) {\n return;\n }\n\n // Set the initial values to respond to HOME\n // which goes to the first selectable option\n index = -1;\n let directionToSearch = SearchDirection.forward;\n\n // If end, update the values to respond to END\n // which goes to the last selectable option\n // eslint-disable-next-line deprecation/deprecation\n if (ev.which === KeyCodes.end) {\n index = currentOptions.length;\n directionToSearch = SearchDirection.backward;\n }\n\n this._setPendingInfoFromIndexAndDirection(index, directionToSearch);\n break;\n\n /* eslint-disable no-fallthrough */\n case KeyCodes.space:\n // event handled in _onComboBoxKeyUp\n if (!allowFreeform && autoComplete === 'off') {\n break;\n }\n\n default:\n /* eslint-enable no-fallthrough */\n // are we processing a function key? if so bail out\n // eslint-disable-next-line deprecation/deprecation\n if (ev.which >= 112 /* F1 */ && ev.which <= 123 /* F12 */) {\n return;\n }\n\n // If we get here and we got either and ALT key\n // or meta key, let the event propagate\n if (ev.keyCode === KeyCodes.alt || ev.key === 'Meta' /* && isOpen */) {\n return;\n }\n\n // If we are not allowing freeform and\n // allowing autoComplete, handle the input here\n // since we have marked the input as readonly\n if (!allowFreeform && autoComplete === 'on') {\n this._onInputChange(ev.key);\n break;\n }\n\n // allow the key to propagate by default\n return;\n }\n\n ev.stopPropagation();\n ev.preventDefault();\n };\n\n /**\n * Handle keyup on the input\n * @param ev - the keyboard event that was fired\n */\n private _onInputKeyUp = (ev: React.KeyboardEvent<HTMLElement | Autofill>): void => {\n const { disabled, allowFreeform, autoComplete } = this.props;\n const isOpen = this.state.isOpen;\n\n // We close the menu on key up only if ALL of the following are true:\n // - Most recent key down was alt or meta (command)\n // - The alt/meta key down was NOT followed by some other key (such as down/up arrow to\n // expand/collapse the menu)\n // - We're not on a Mac (or iOS)\n // This is because on Windows, pressing alt moves focus to the application menu bar or similar,\n // closing any open context menus. There is not a similar behavior on Macs.\n const keyPressIsAltOrMetaAlone = this._lastKeyDownWasAltOrMeta && isAltOrMeta(ev);\n this._lastKeyDownWasAltOrMeta = false;\n const shouldHandleKey = keyPressIsAltOrMetaAlone && !(isMac() || isIOS());\n\n if (disabled) {\n this._handleInputWhenDisabled(ev);\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n switch (ev.which) {\n case KeyCodes.space:\n // If we are not allowing freeform and are not autoComplete\n // make space expand/collapse the combo box\n // and allow the event to propagate\n if (!allowFreeform && autoComplete === 'off') {\n this._setOpenStateAndFocusOnClose(!isOpen, !!isOpen);\n }\n return;\n default:\n if (shouldHandleKey && isOpen) {\n this._setOpenStateAndFocusOnClose(!isOpen, true /* focusInputAfterClose */);\n } else {\n if (this.state.focusState === 'focusing' && this.props.openOnKeyboardFocus) {\n this.setState({ isOpen: true });\n }\n if (this.state.focusState !== 'focused') {\n this.setState({ focusState: 'focused' });\n }\n }\n return;\n }\n };\n\n private _onOptionMouseEnter(index: number): void {\n if (this._shouldIgnoreMouseEvent()) {\n return;\n }\n\n this.setState({\n currentPendingValueValidIndexOnHover: index,\n });\n }\n\n private _onOptionMouseMove(index: number): void {\n this._gotMouseMove = true;\n\n if (!this._isScrollIdle || this.state.currentPendingValueValidIndexOnHover === index) {\n return;\n }\n\n this.setState({\n currentPendingValueValidIndexOnHover: index,\n });\n }\n\n private _onOptionMouseLeave = () => {\n if (this._shouldIgnoreMouseEvent()) {\n return;\n }\n\n // Ignore the event in persistMenu mode if the callout has\n // closed. This is to avoid clearing the visuals on item click.\n if (this.props.persistMenu && !this.state.isOpen) {\n return;\n }\n\n this.setState({\n currentPendingValueValidIndexOnHover: HoverStatus.clearAll,\n });\n };\n\n private _shouldIgnoreMouseEvent(): boolean {\n return !this._isScrollIdle || !this._gotMouseMove;\n }\n\n /**\n * Handle dismissing the menu and eating the required key event when disabled\n * @param ev - the keyboard event that was fired\n */\n private _handleInputWhenDisabled(ev: React.KeyboardEvent<HTMLElement | Autofill> | null): void {\n // If we are disabled, close the menu (if needed)\n // and eat all keystrokes other than TAB or ESC\n if (this.props.disabled) {\n if (this.state.isOpen) {\n this.setState({ isOpen: false });\n }\n\n // When disabled stop propagation and prevent default\n // of the event unless we have a tab, escape, or function key\n if (\n ev !== null &&\n // eslint-disable-next-line deprecation/deprecation\n ev.which !== KeyCodes.tab &&\n // eslint-disable-next-line deprecation/deprecation\n ev.which !== KeyCodes.escape &&\n // eslint-disable-next-line deprecation/deprecation\n (ev.which < 112 /* F1 */ || ev.which > 123) /* F12 */\n ) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n }\n\n /**\n * Click handler for the button of the combo box and the input when not allowing freeform.\n * This toggles the expand/collapse state of the combo box (if enabled).\n */\n private _onComboBoxClick = (): void => {\n const { disabled } = this.props;\n const { isOpen } = this.state;\n\n if (!disabled) {\n this._setOpenStateAndFocusOnClose(!isOpen, false /* focusInputAfterClose */);\n this.setState({ focusState: 'focused' });\n }\n };\n\n /**\n * Click handler for the autofill.\n */\n private _onAutofillClick = (): void => {\n const { disabled, allowFreeform } = this.props;\n if (allowFreeform && !disabled) {\n this.focus(this.state.isOpen || this._processingTouch);\n } else {\n this._onComboBoxClick();\n }\n };\n\n private _onTouchStart: () => void = () => {\n if (this._comboBoxWrapper.current && !('onpointerdown' in this._comboBoxWrapper)) {\n this._handleTouchAndPointerEvent();\n }\n };\n\n private _onPointerDown = (ev: PointerEvent): void => {\n if (ev.pointerType === 'touch') {\n this._handleTouchAndPointerEvent();\n\n ev.preventDefault();\n ev.stopImmediatePropagation();\n }\n };\n\n private _handleTouchAndPointerEvent() {\n // If we already have an existing timeout from a previous touch and pointer event\n // cancel that timeout so we can set a nwe one.\n if (this._lastTouchTimeoutId !== undefined) {\n this._async.clearTimeout(this._lastTouchTimeoutId);\n this._lastTouchTimeoutId = undefined;\n }\n this._processingTouch = true;\n\n this._lastTouchTimeoutId = this._async.setTimeout(() => {\n this._processingTouch = false;\n this._lastTouchTimeoutId = undefined;\n }, TouchIdleDelay);\n }\n\n /**\n * Get the styles for the current option.\n * @param item - Item props for the current option\n */\n private _getCaretButtonStyles(): IButtonStyles {\n const { caretDownButtonStyles: customCaretDownButtonStyles } = this.props;\n return getCaretDownButtonStyles(this.props.theme!, customCaretDownButtonStyles);\n }\n\n /**\n * Get the styles for the current option.\n * @param item - Item props for the current option\n */\n private _getCurrentOptionStyles(item: IComboBoxOption): Partial<IComboBoxOptionStyles> {\n const { comboBoxOptionStyles: customStylesForAllOptions } = this.props;\n const { styles: customStylesForCurrentOption } = item;\n\n return getOptionStyles(\n this.props.theme!,\n customStylesForAllOptions,\n customStylesForCurrentOption,\n this._isPendingOption(item),\n item.hidden,\n );\n }\n\n /**\n * Get the aria-activedescendant value for the combo box.\n * @returns the id of the current focused combo item, otherwise the id of the currently selected element,\n * null otherwise\n */\n private _getAriaActiveDescendantValue(): string | undefined {\n const { selectedIndices } = this.props.hoisted;\n const { isOpen, currentPendingValueValidIndex } = this.state;\n let descendantText = isOpen && selectedIndices?.length ? this._id + '-list' + selectedIndices[0] : undefined;\n if (isOpen && this._hasFocus() && currentPendingValueValidIndex !== -1) {\n descendantText = this._id + '-list' + currentPendingValueValidIndex;\n }\n return descendantText;\n }\n\n /**\n * Get the aria autocomplete value for the combo box\n * @returns 'inline' if auto-complete automatically dynamic, 'both' if we have a list of possible values to pick from\n * and can dynamically populate input, and 'none' if auto-complete is not enabled as we can't give user inputs.\n */\n private _getAriaAutoCompleteValue(): 'none' | 'inline' | 'list' | 'both' | undefined {\n const autoComplete = !this.props.disabled && this.props.autoComplete === 'on';\n return autoComplete ? (this.props.allowFreeform ? 'inline' : 'both') : 'none';\n }\n\n private _isPendingOption(item: IComboBoxOption): boolean {\n return item && item.index === this.state.currentPendingValueValidIndex;\n }\n\n /**\n * Returns true if the component has some kind of focus. If it's either focusing or if it's focused\n */\n private _hasFocus() {\n return this.state.focusState !== 'none';\n }\n}\n\n/**\n * Get the indices of the options that are marked as selected\n * @param options - the combo box options\n * @param selectedKeys - the known selected keys to find\n * @returns - an array of the indices of the selected options, empty array if nothing is selected\n */\nfunction getSelectedIndices(\n options: IComboBoxOption[] | undefined,\n selectedKeys: (string | number | undefined)[],\n): number[] {\n if (!options || !selectedKeys) {\n return [];\n }\n\n const selectedIndices: { [key: number]: boolean } = {};\n options.forEach((option: IComboBoxOption, index: number) => {\n if (option.selected) {\n selectedIndices[index] = true;\n }\n });\n\n for (const selectedKey of selectedKeys) {\n const index = findIndex(options, option => option.key === selectedKey);\n if (index > -1) {\n selectedIndices[index] = true;\n }\n }\n\n return Object.keys(selectedIndices)\n .map(Number)\n .sort();\n}\n\n/**\n * Given default selected key(s) and selected key(s), return the selected keys(s).\n * When default selected key(s) are available, they take precedence and return them instead of selected key(s).\n *\n * @returns No matter what specific types the input parameters are, always return an array of\n * either strings or numbers instead of primitive type. This normalization makes caller's logic easier.\n */\nfunction buildDefaultSelectedKeys(\n defaultSelectedKey: string | number | string[] | number[] | null | undefined,\n selectedKey: string | number | string[] | number[] | null | undefined,\n): string[] | number[] {\n const selectedKeys: string[] | number[] = buildSelectedKeys(defaultSelectedKey);\n if (selectedKeys.length) {\n return selectedKeys;\n }\n return buildSelectedKeys(selectedKey);\n}\n\nfunction buildSelectedKeys(selectedKey: string | number | string[] | number[] | null | undefined): string[] | number[] {\n if (selectedKey === undefined) {\n return [];\n }\n\n // need to cast here so typescript does not complain\n return (selectedKey instanceof Array ? selectedKey : [selectedKey]) as string[] | number[];\n}\n\nfunction normalizeToString(value: string | undefined) {\n return value || '';\n}\n\n/**\n * Is the index within the bounds of the array?\n * @param options - options to check if the index is valid for\n * @param index - the index to check\n * @returns - true if the index is valid for the given options, false otherwise\n */\nfunction indexWithinBounds(options: IComboBoxOption[] | undefined, index: number): boolean {\n return !!options && index >= 0 && index < options.length;\n}\n\n/** Whether this is a normal option, not a header or divider. */\nfunction isNormalOption(option: IComboBoxOption) {\n return (\n option.itemType !== SelectableOptionMenuItemType.Header && option.itemType !== SelectableOptionMenuItemType.Divider\n );\n}\n\n/**\n * For scenarios where the option's `text` prop contains embedded styles, we use the option's\n * `ariaLabel` value as the text in the input and for autocomplete matching. We know to use this\n * when the `useAriaLabelAsText` prop is set to true.\n */\nfunction getPreviewText(item: IComboBoxOption): string {\n return item.useAriaLabelAsText && item.ariaLabel ? item.ariaLabel : item.text;\n}\n\n/**\n * Returns true if the key for the event is alt (Mac option) or meta (Mac command).\n */\nfunction isAltOrMeta(ev: React.KeyboardEvent<HTMLElement | Autofill>): boolean {\n // eslint-disable-next-line deprecation/deprecation\n return ev.which === KeyCodes.alt || ev.key === 'Meta';\n}\n","import { IButtonStyles } from '../Button.types';\nimport { ITheme, concatStyleSets, HighContrastSelector } from '../../../Styling';\nimport { memoizeFunction } from '../../../Utilities';\nimport { getStyles as getBaseButtonStyles } from '../BaseButton.styles';\n\nconst DEFAULT_BUTTON_HEIGHT = '40px';\nconst DEFAULT_PADDING = '0 4px';\n\nexport const getStyles = memoizeFunction(\n (theme: ITheme, customStyles?: IButtonStyles): IButtonStyles => {\n const baseButtonStyles: IButtonStyles = getBaseButtonStyles(theme);\n const actionButtonStyles: IButtonStyles = {\n root: {\n padding: DEFAULT_PADDING,\n height: DEFAULT_BUTTON_HEIGHT,\n color: theme.palette.neutralPrimary,\n backgroundColor: 'transparent',\n border: '1px solid transparent',\n selectors: {\n [HighContrastSelector]: {\n borderColor: 'Window',\n },\n },\n },\n\n rootHovered: {\n color: theme.palette.themePrimary,\n selectors: {\n [HighContrastSelector]: {\n color: 'Highlight',\n },\n },\n },\n\n iconHovered: {\n color: theme.palette.themePrimary,\n },\n\n rootPressed: {\n color: theme.palette.black,\n },\n\n rootExpanded: {\n color: theme.palette.themePrimary,\n },\n\n iconPressed: {\n color: theme.palette.themeDarker,\n },\n\n rootDisabled: {\n color: theme.palette.neutralTertiary,\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n },\n },\n },\n\n rootChecked: {\n color: theme.palette.black,\n },\n\n iconChecked: {\n color: theme.palette.themeDarker,\n },\n\n flexContainer: {\n justifyContent: 'flex-start',\n },\n\n icon: {\n color: theme.palette.themeDarkAlt,\n },\n\n iconDisabled: {\n color: 'inherit',\n },\n\n menuIcon: {\n color: theme.palette.neutralSecondary,\n },\n\n textContainer: {\n flexGrow: 0,\n },\n };\n\n return concatStyleSets(baseButtonStyles, actionButtonStyles, customStyles)!;\n },\n);\n","import { ActionButton } from '../ActionButton/ActionButton';\n\n/**\n * {@docCategory Button}\n */\nexport const CommandButton = ActionButton;\n","import * as React from 'react';\nimport { BaseButton } from '../BaseButton';\nimport { customizable, nullRender } from '../../../Utilities';\nimport { IButtonProps } from '../Button.types';\nimport { getStyles } from './ActionButton.styles';\n\n/**\n * {@docCategory Button}\n */\n@customizable('ActionButton', ['theme', 'styles'], true)\nexport class ActionButton extends React.Component<IButtonProps, {}> {\n public render(): JSX.Element {\n const { styles, theme } = this.props;\n\n return (\n <BaseButton\n {...this.props}\n variantClassName=\"ms-Button--action ms-Button--command\"\n styles={getStyles(theme!, styles)}\n onRenderDescription={nullRender}\n />\n );\n }\n}\n","import { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.types';\n\nexport function getAllSelectedOptions(options: ISelectableOption[], selectedIndices: number[]): ISelectableOption[] {\n const selectedOptions: ISelectableOption[] = [];\n for (const index of selectedIndices) {\n const option = options[index];\n\n if (option) {\n selectedOptions.push(option);\n }\n }\n\n return selectedOptions;\n}\n"],"sourceRoot":""}