import * as tslib_1 from "tslib";
import * as React from 'react';
import { DropdownMenuItemType } from './Dropdown.types';
import { Checkbox } from '../../Checkbox';
import { Callout } from '../../Callout';
import { Label } from '../../Label';
import { CommandButton } from '../../Button';
import { Panel } from '../../Panel';
import { Icon } from '../../Icon';
import { FocusZone, FocusZoneDirection } from '../../FocusZone';
import { withResponsiveMode, ResponsiveMode } from '../../utilities/decorators/withResponsiveMode';
import { BaseComponent, autobind, css, findIndex, getId, getNativeProps, divProperties, getFirstFocusable, getLastFocusable } from '../../Utilities';
import { SelectableOptionMenuItemType } from '../../utilities/selectableOption/SelectableOption.types';
import * as stylesImport from './Dropdown.scss';
var styles = stylesImport;
import { getStyles as getCheckboxStyles } from '../Checkbox/Checkbox.styles';
import { getTheme } from '../../Styling';
var Dropdown = /** @class */ (function (_super) {
    tslib_1.__extends(Dropdown, _super);
    function Dropdown(props) {
        var _this = _super.call(this, props) || this;
        _this._scrollIdleDelay = 250 /* ms */;
        props.options.forEach(function (option) {
            if (!option.itemType) {
                option.itemType = DropdownMenuItemType.Normal;
            }
        });
        _this = _super.call(this, props) || this;
        _this._warnDeprecations({
            'isDisabled': 'disabled'
        });
        _this._warnMutuallyExclusive({
            'defaultSelectedKey': 'selectedKey',
            'defaultSelectedKeys': 'selectedKeys',
            'selectedKeys': 'selectedKey',
            'multiSelect': 'defaultSelectedKey',
            'selectedKey': 'multiSelect'
        });
        _this._id = props.id || getId('Dropdown');
        _this._isScrollIdle = true;
        _this.state = {
            isOpen: false
        };
        if (_this.props.multiSelect) {
            var selectedKeys = props.defaultSelectedKeys !== undefined ? props.defaultSelectedKeys : props.selectedKeys;
            _this.state = {
                selectedIndices: _this._getSelectedIndexes(props.options, selectedKeys)
            };
        }
        else {
            var selectedKey = props.defaultSelectedKey !== undefined ? props.defaultSelectedKey : props.selectedKey;
            _this.state = {
                selectedIndices: _this._getSelectedIndexes(props.options, selectedKey)
            };
        }
        return _this;
    }
    Dropdown_1 = Dropdown;
    Dropdown.prototype.componentWillReceiveProps = function (newProps) {
        // In controlled component usage where selectedKey is provided, update the selectedIndex
        // state if the key or options change.
        var selectedKeyProp = this.props.multiSelect ? 'selectedKeys' : 'selectedKey';
        if (newProps[selectedKeyProp] !== undefined &&
            (newProps[selectedKeyProp] !== this.props[selectedKeyProp] || newProps.options !== this.props.options)) {
            this.setState({
                selectedIndices: this._getSelectedIndexes(newProps.options, newProps[selectedKeyProp])
            });
        }
    };
    Dropdown.prototype.componentDidUpdate = function (prevProps, prevState) {
        if (prevState.isOpen === true && this.state.isOpen === false) {
            this._dropDown.focus();
            if (this.props.onDismiss) {
                this.props.onDismiss();
            }
        }
    };
    // Primary Render
    Dropdown.prototype.render = function () {
        var id = this._id;
        var _a = this.props, className = _a.className, label = _a.label, options = _a.options, disabled = _a.disabled, isDisabled = _a.isDisabled, ariaLabel = _a.ariaLabel, required = _a.required, errorMessage = _a.errorMessage, _b = _a.onRenderTitle, onRenderTitle = _b === void 0 ? this._onRenderTitle : _b, _c = _a.onRenderContainer, onRenderContainer = _c === void 0 ? this._onRenderContainer : _c, _d = _a.onRenderPlaceHolder, onRenderPlaceHolder = _d === void 0 ? this._onRenderPlaceHolder : _d, _e = _a.onRenderCaretDown, onRenderCaretDown = _e === void 0 ? this._onRenderCaretDown : _e;
        var _f = this.state, isOpen = _f.isOpen, _g = _f.selectedIndices, selectedIndices = _g === void 0 ? [] : _g;
        var selectedOptions = this._getAllSelectedOptions(options, selectedIndices);
        var divProps = getNativeProps(this.props, divProperties);
        // Remove this deprecation workaround at 1.0.0
        if (isDisabled !== undefined) {
            disabled = isDisabled;
        }
        return (React.createElement("div", { ref: this._resolveRef('_root'), className: css('ms-Dropdown-container') },
            label && (React.createElement(Label, { className: css('ms-Dropdown-label'), id: id + '-label', htmlFor: id, ref: this._resolveRef('_dropdownLabel'), required: required }, label)),
            React.createElement("div", tslib_1.__assign({ "data-is-focusable": !disabled, ref: this._resolveRef('_dropDown'), id: id, tabIndex: disabled ? -1 : 0, "aria-expanded": isOpen ? 'true' : 'false', role: 'combobox', "aria-autocomplete": 'none', "aria-live": disabled || isOpen ? 'off' : 'assertive', "aria-label": ariaLabel, "aria-describedby": id + '-option', "aria-activedescendant": isOpen && selectedIndices.length === 1 && selectedIndices[0] >= 0 ? (this._id + '-list' + selectedIndices[0]) : null, "aria-disabled": disabled, "aria-owns": isOpen ? id + '-list' : null }, divProps, { className: css('ms-Dropdown', styles.root, className, isOpen && 'is-open', disabled && ('is-disabled ' + styles.rootIsDisabled), required && 'is-required'), onBlur: this._onDropdownBlur, onKeyDown: this._onDropdownKeyDown, onKeyUp: this._onDropdownKeyUp, onClick: this._onDropdownClick }),
                React.createElement("span", { id: id + '-option', className: css('ms-Dropdown-title', styles.title, !selectedOptions.length && 'ms-Dropdown-titleIsPlaceHolder', !selectedOptions.length && styles.titleIsPlaceHolder, (errorMessage && errorMessage.length > 0 ? styles.titleIsError : null)), "aria-atomic": true, role: 'textbox', "aria-readonly": 'true' }, // If option is selected render title, otherwise render the placeholder text
                selectedOptions.length ? (onRenderTitle(selectedOptions, this._onRenderTitle)) :
                    onRenderPlaceHolder(this.props, this._onRenderPlaceHolder)),
                React.createElement("span", { className: css('ms-Dropdown-caretDownWrapper', styles.caretDownWrapper) }, onRenderCaretDown(this.props, this._onRenderCaretDown))),
            isOpen && (onRenderContainer(this.props, this._onRenderContainer)),
            errorMessage &&
                React.createElement("div", { className: css(styles.errorMessage) }, errorMessage)));
    };
    Dropdown.prototype.focus = function (shouldOpenOnFocus) {
        if (this._dropDown && this._dropDown.tabIndex !== -1) {
            this._dropDown.focus();
            if (shouldOpenOnFocus) {
                this.setState({
                    isOpen: true
                });
            }
        }
    };
    Dropdown.prototype.setSelectedIndex = function (index) {
        var _a = this.props, onChanged = _a.onChanged, options = _a.options, selectedKey = _a.selectedKey, selectedKeys = _a.selectedKeys, multiSelect = _a.multiSelect;
        var _b = this.state.selectedIndices, selectedIndices = _b === void 0 ? [] : _b;
        var checked = selectedIndices ? selectedIndices.indexOf(index) > -1 : false;
        index = Math.max(0, Math.min(options.length - 1, index));
        if (!multiSelect && index === selectedIndices[0]) {
            return;
        }
        else if (!multiSelect && selectedKey === undefined) {
            // Set the selected option if this is an uncontrolled component
            this.setState({
                selectedIndices: [index]
            });
        }
        else if (multiSelect && selectedKeys === undefined) {
            var newIndexes = selectedIndices ? this._copyArray(selectedIndices) : [];
            if (checked) {
                var position = newIndexes.indexOf(index);
                if (position > -1) {
                    // unchecked the current one
                    newIndexes.splice(position, 1);
                }
            }
            else {
                // add the new selected index into the existing one
                newIndexes.push(index);
            }
            this.setState({
                selectedIndices: newIndexes
            });
        }
        if (onChanged) {
            // for single-select, option passed in will always be selected.
            // for multi-select, flip the checked value
            var changedOpt = multiSelect ? tslib_1.__assign({}, options[index], { selected: !checked }) : options[index];
            onChanged(changedOpt, index);
        }
    };
    Dropdown.prototype._copyArray = function (array) {
        var newArray = [];
        for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
            var element = array_1[_i];
            newArray.push(element);
        }
        return newArray;
    };
    /**
     * Finds the next valid Dropdown option and sets the selected index to it.
     * @param stepValue Value of how many items the function should traverse.  Should be -1 or 1.
     * @param index Index of where the search should start
     * @param selectedIndex The selectedIndex Dropdown's state
     * @returns The next valid dropdown option's index
     */
    Dropdown.prototype._moveIndex = function (stepValue, index, selectedIndex) {
        var options = this.props.options;
        // Return selectedIndex if nothing has changed or options is empty
        if (selectedIndex === index || options.length === 0) {
            return selectedIndex;
        }
        // Set starting index to 0 if index is < 0
        if (index < 0) {
            index = 0;
        }
        // Set starting index to last option index if greater than options.length
        if (index >= options.length) {
            index = options.length - 1;
        }
        var stepCounter = 0;
        // If current index is a header or divider, increment by step
        while (options[index].itemType === DropdownMenuItemType.Header || options[index].itemType === DropdownMenuItemType.Divider) {
            // If stepCounter exceeds length of options, then return selectedIndex (-1)
            if (stepCounter >= options.length) {
                return selectedIndex;
            }
            // If index + stepValue is out of bounds, wrap around
            if (index + stepValue < 0) {
                index = options.length;
            }
            else if (index + stepValue >= options.length) {
                index = -1;
            }
            index = index + stepValue;
            stepCounter++;
        }
        this.setSelectedIndex(index);
        return index;
    };
    // Render text in dropdown input
    Dropdown.prototype._onRenderTitle = function (item) {
        var _a = this.props.multiSelectDelimiter, multiSelectDelimiter = _a === void 0 ? ', ' : _a;
        var displayTxt = item.map(function (i) { return i.text; }).join(multiSelectDelimiter);
        return React.createElement("span", null, displayTxt);
    };
    // Render placeHolder text in dropdown input
    Dropdown.prototype._onRenderPlaceHolder = function (props) {
        if (!props.placeHolder) {
            return null;
        }
        return React.createElement("span", null, props.placeHolder);
    };
    // Render Callout or Panel container and pass in list
    Dropdown.prototype._onRenderContainer = function (props) {
        var _a = this.props, _b = _a.onRenderList, onRenderList = _b === void 0 ? this._onRenderList : _b, responsiveMode = _a.responsiveMode, calloutProps = _a.calloutProps, dropdownWidth = _a.dropdownWidth;
        var isSmall = responsiveMode <= ResponsiveMode.medium;
        return (isSmall ?
            (React.createElement(Panel, { className: css('ms-Dropdown-panel', styles.panel), isOpen: true, isLightDismiss: true, onDismissed: this._onDismiss, hasCloseButton: false }, onRenderList(props, this._onRenderList)))
            :
                (React.createElement(Callout, tslib_1.__assign({ isBeakVisible: false, gapSpace: 0, doNotLayer: false, directionalHintFixed: true, directionalHint: 4 /* bottomLeftEdge */ }, calloutProps, { className: css('ms-Dropdown-callout', styles.callout, calloutProps ? calloutProps.className : undefined), target: this._dropDown, onDismiss: this._onDismiss, onScroll: this._onScroll, onPositioned: this._onPositioned, calloutWidth: dropdownWidth || this._dropDown.clientWidth }), onRenderList(props, this._onRenderList))));
    };
    // Render Caret Down Icon
    Dropdown.prototype._onRenderCaretDown = function (props) {
        return (React.createElement(Icon, { className: css('ms-Dropdown-caretDown', styles.caretDown), iconName: 'ChevronDown' }));
    };
    // Render List of items
    Dropdown.prototype._onRenderList = function (props) {
        var _this = this;
        var _a = this.props.onRenderItem, onRenderItem = _a === void 0 ? this._onRenderItem : _a;
        var id = this._id;
        var _b = this.state.selectedIndices, selectedIndices = _b === void 0 ? [] : _b;
        return (React.createElement("div", { className: styles.listWrapper, onKeyDown: this._onZoneKeyDown, ref: this._resolveRef('_host'), tabIndex: 0 },
            React.createElement(FocusZone, { ref: this._resolveRef('_focusZone'), direction: FocusZoneDirection.vertical, defaultActiveElement: selectedIndices[0] !== undefined ? "#" + id + "-list" + selectedIndices[0] : undefined, id: id + '-list', className: css('ms-Dropdown-items', styles.items), "aria-labelledby": id + '-label', role: 'listbox' }, this.props.options.map(function (item, index) { return onRenderItem(tslib_1.__assign({}, item, { index: index }), _this._onRenderItem); }))));
    };
    // Render items
    Dropdown.prototype._onRenderItem = function (item) {
        switch (item.itemType) {
            case SelectableOptionMenuItemType.Divider:
                return this._renderSeparator(item);
            case SelectableOptionMenuItemType.Header:
                return this._renderHeader(item);
            default:
                return this._renderOption(item);
        }
    };
    // Render separator
    Dropdown.prototype._renderSeparator = function (item) {
        var index = item.index, key = item.key;
        if (index > 0) {
            return (React.createElement("div", { role: 'separator', key: key, className: css('ms-Dropdown-divider', styles.divider) }));
        }
        return null;
    };
    Dropdown.prototype._renderHeader = function (item) {
        var _a = this.props.onRenderOption, onRenderOption = _a === void 0 ? this._onRenderOption : _a;
        var key = item.key;
        return (React.createElement("div", { key: key, className: css('ms-Dropdown-header', styles.header) }, onRenderOption(item, this._onRenderOption)));
    };
    // Render menu item
    Dropdown.prototype._renderOption = function (item) {
        var _a = this.props.onRenderOption, onRenderOption = _a === void 0 ? this._onRenderOption : _a;
        var _b = this.state.selectedIndices, selectedIndices = _b === void 0 ? [] : _b;
        var id = this._id;
        var isItemSelected = item.index !== undefined && selectedIndices ? selectedIndices.indexOf(item.index) > -1 : false;
        var checkboxStyles = getCheckboxStyles(getTheme());
        return (!this.props.multiSelect ?
            (React.createElement(CommandButton, { id: id + '-list' + item.index, ref: Dropdown_1.Option + item.index, key: item.key, "data-index": item.index, "data-is-focusable": !item.disabled, disabled: item.disabled, className: css('ms-Dropdown-item', styles.item, (_c = {},
                    _c['is-selected ' + styles.itemIsSelected] = isItemSelected,
                    _c['is-disabled ' + styles.itemIsDisabled] = item.disabled === true,
                    _c)), onClick: this._onItemClick(item), onMouseEnter: this._onItemMouseEnter.bind(this, item), onMouseLeave: this._onMouseItemLeave.bind(this, item), onMouseMove: this._onItemMouseMove.bind(this, item), role: 'option', "aria-selected": isItemSelected ? 'true' : 'false', ariaLabel: item.ariaLabel || item.text, title: item.text }, onRenderOption(item, this._onRenderOption))) : (React.createElement(Checkbox, { id: id + '-list' + item.index, ref: Dropdown_1.Option + item.index, key: item.key, "data-index": item.index, "data-is-focusable": !item.disabled, disabled: item.disabled, onChange: this._onItemClick(item), inputProps: {
                onMouseEnter: this._onItemMouseEnter.bind(this, item),
                onMouseLeave: this._onMouseItemLeave.bind(this, item),
                onMouseMove: this._onItemMouseMove.bind(this, item)
            }, label: item.text, className: css('ms-ColumnManagementPanel-checkbox', styles.dropdownCheckbox, 'ms-Dropdown-item', styles.item, (_d = {},
                _d['is-selected ' + styles.itemIsSelected] = isItemSelected,
                _d['is-disabled ' + styles.itemIsDisabled] = item.disabled,
                _d)), role: 'option', "aria-selected": isItemSelected ? 'true' : 'false', checked: isItemSelected, 
            // Hover is being handled by focus styles
            // so clear out the explicit hover styles
            styles: {
                checkboxHovered: checkboxStyles.checkbox,
                checkboxCheckedHovered: checkboxStyles.checkboxChecked,
                textHovered: checkboxStyles.text
            } }, onRenderOption(item, this._onRenderOption))));
        var _c, _d;
    };
    // Render content of item (i.e. text/icon inside of button)
    Dropdown.prototype._onRenderOption = function (item) {
        return React.createElement("span", { className: css('ms-Dropdown-optionText', styles.optionText) }, item.text);
    };
    Dropdown.prototype._onPositioned = function () {
        this._focusZone.focus();
    };
    Dropdown.prototype._onItemClick = function (item) {
        var _this = this;
        return function () {
            if (!item.disabled) {
                _this.setSelectedIndex(item.index);
                if (!_this.props.multiSelect) {
                    // only close the callout when it's in single-select mode
                    _this.setState({
                        isOpen: false
                    });
                }
            }
        };
    };
    /**
     * Scroll handler for the callout to make sure the mouse events
     * for updating focus are not interacting during scroll
     */
    Dropdown.prototype._onScroll = function () {
        var _this = this;
        if (!this._isScrollIdle && this._scrollIdleTimeoutId !== undefined) {
            this._async.clearTimeout(this._scrollIdleTimeoutId);
            this._scrollIdleTimeoutId = undefined;
        }
        else {
            this._isScrollIdle = false;
        }
        this._scrollIdleTimeoutId = this._async.setTimeout(function () { _this._isScrollIdle = true; }, this._scrollIdleDelay);
    };
    Dropdown.prototype._onItemMouseEnter = function (item, ev) {
        if (!this._isScrollIdle) {
            return;
        }
        var targetElement = ev.currentTarget;
        targetElement.focus();
    };
    Dropdown.prototype._onItemMouseMove = function (item, ev) {
        var targetElement = ev.currentTarget;
        if (!this._isScrollIdle || document.activeElement === targetElement) {
            return;
        }
        targetElement.focus();
    };
    Dropdown.prototype._onMouseItemLeave = function (item, ev) {
        if (!this._isScrollIdle) {
            return;
        }
        /**
         * IE11 focus() method forces parents to scroll to top of element.
         * Edge and IE expose a setActive() function for focusable divs that
         * sets the page focus but does not scroll the parent element.
         */
        if (this._host.setActive) {
            this._host.setActive();
        }
        else {
            this._host.focus();
        }
    };
    Dropdown.prototype._onDismiss = function () {
        this.setState({ isOpen: false });
        this._dropDown.focus();
    };
    // Get all selected indexes for multi-select mode
    Dropdown.prototype._getSelectedIndexes = function (options, selectedKey) {
        if (selectedKey === undefined) {
            if (this.props.multiSelect) {
                return this._getAllSelectedIndices(options);
            }
            var selectedIndex = this._getSelectedIndex(options, null);
            return selectedIndex !== -1 ? [selectedIndex] : [];
        }
        else if (!Array.isArray(selectedKey)) {
            return [this._getSelectedIndex(options, selectedKey)];
        }
        var selectedIndices = [];
        for (var _i = 0, selectedKey_1 = selectedKey; _i < selectedKey_1.length; _i++) {
            var key = selectedKey_1[_i];
            selectedIndices.push(this._getSelectedIndex(options, key));
        }
        return selectedIndices;
    };
    // Get all selected options for multi-select mode
    Dropdown.prototype._getAllSelectedOptions = function (options, selectedIndices) {
        var selectedOptions = [];
        for (var _i = 0, selectedIndices_1 = selectedIndices; _i < selectedIndices_1.length; _i++) {
            var index = selectedIndices_1[_i];
            var option = options[index];
            if (option) {
                selectedOptions.push(option);
            }
        }
        return selectedOptions;
    };
    Dropdown.prototype._getAllSelectedIndices = function (options) {
        return options
            .map(function (option, index) { return option.selected ? index : -1; })
            .filter(function (index) { return index !== -1; });
    };
    Dropdown.prototype._getSelectedIndex = function (options, selectedKey) {
        return findIndex(options, (function (option) {
            // tslint:disable-next-line:triple-equals
            if (selectedKey != null) {
                return option.key === selectedKey;
            }
            else {
                return !!option.isSelected || !!option.selected;
            }
        }));
    };
    Dropdown.prototype._onDropdownBlur = function (ev) {
        if (this.state.isOpen) {
            // Do not onBlur when the callout is opened
            return;
        }
        if (this.props.onBlur) {
            this.props.onBlur(ev);
        }
    };
    Dropdown.prototype._onDropdownKeyDown = function (ev) {
        if (this.props.onKeyDown) {
            this.props.onKeyDown(ev);
            if (ev.preventDefault) {
                return;
            }
        }
        var newIndex;
        var selectedIndex = this.state.selectedIndices.length ? this.state.selectedIndices[0] : -1;
        switch (ev.which) {
            case 13 /* enter */:
                this.setState({
                    isOpen: !this.state.isOpen
                });
                break;
            case 27 /* escape */:
                if (!this.state.isOpen) {
                    return;
                }
                this.setState({
                    isOpen: false
                });
                break;
            case 38 /* up */:
                if (this.props.multiSelect) {
                    this.setState({ isOpen: true });
                }
                else {
                    newIndex = this._moveIndex(-1, selectedIndex - 1, selectedIndex);
                }
                break;
            case 40 /* down */:
                if (ev.altKey || ev.metaKey || this.props.multiSelect) {
                    this.setState({ isOpen: true });
                }
                else {
                    newIndex = this._moveIndex(1, selectedIndex + 1, selectedIndex);
                }
                break;
            case 36 /* home */:
                if (!this.props.multiSelect) {
                    newIndex = this._moveIndex(1, 0, selectedIndex);
                }
                break;
            case 35 /* end */:
                if (!this.props.multiSelect) {
                    newIndex = this._moveIndex(-1, this.props.options.length - 1, selectedIndex);
                }
                break;
            case 32 /* space */:
                // event handled in _onDropdownKeyUp
                break;
            default:
                return;
        }
        if (newIndex !== selectedIndex) {
            ev.stopPropagation();
            ev.preventDefault();
        }
    };
    Dropdown.prototype._onDropdownKeyUp = function (ev) {
        if (this.props.onKeyUp) {
            this.props.onKeyUp(ev);
            if (ev.preventDefault) {
                return;
            }
        }
        switch (ev.which) {
            case 32 /* space */:
                this.setState({
                    isOpen: !this.state.isOpen
                });
                break;
            default:
                return;
        }
        ev.stopPropagation();
        ev.preventDefault();
    };
    Dropdown.prototype._onZoneKeyDown = function (ev) {
        var elementToFocus;
        switch (ev.which) {
            case 38 /* up */:
                if (ev.altKey || ev.metaKey) {
                    this.setState({ isOpen: false });
                }
                else {
                    elementToFocus = getLastFocusable(this._host, this._host.lastChild, true);
                }
                break;
            // All directional keystrokes should be canceled when the zone is rendered.
            // This avoids the body scroll from reacting and thus dismissing the dropdown.
            case 36 /* home */:
            case 35 /* end */:
            case 33 /* pageUp */:
            case 34 /* pageDown */:
                break;
            case 40 /* down */:
                elementToFocus = getFirstFocusable(this._host, this._host.firstChild, true);
                break;
            case 27 /* escape */:
                this.setState({ isOpen: false });
                break;
            case 9 /* tab */:
                this.setState({ isOpen: false });
                return;
            default:
                return;
        }
        if (elementToFocus) {
            elementToFocus.focus();
        }
        ev.stopPropagation();
        ev.preventDefault();
    };
    Dropdown.prototype._onDropdownClick = function (ev) {
        if (this.props.onClick) {
            this.props.onClick(ev);
            if (ev.preventDefault) {
                return;
            }
        }
        var _a = this.props, disabled = _a.disabled, isDisabled = _a.isDisabled;
        var isOpen = this.state.isOpen;
        // Remove this deprecation workaround at 1.0.0
        if (isDisabled !== undefined) {
            disabled = isDisabled;
        }
        if (!disabled) {
            this.setState({
                isOpen: !isOpen
            });
        }
    };
    Dropdown.defaultProps = {
        options: []
    };
    Dropdown.Option = 'option';
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderTitle", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderPlaceHolder", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderContainer", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderCaretDown", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderList", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderItem", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_renderOption", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onRenderOption", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onPositioned", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onItemClick", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onScroll", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onMouseItemLeave", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onDismiss", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onDropdownBlur", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onDropdownKeyDown", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onDropdownKeyUp", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onZoneKeyDown", null);
    tslib_1.__decorate([
        autobind
    ], Dropdown.prototype, "_onDropdownClick", null);
    Dropdown = Dropdown_1 = tslib_1.__decorate([
        withResponsiveMode
    ], Dropdown);
    return Dropdown;
    var Dropdown_1;
}(BaseComponent));
export { Dropdown };
//# sourceMappingURL=Dropdown.js.map