downshift 9.0.7-alpha.2 → 9.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/downshift.cjs.js +220 -230
- package/dist/downshift.esm.js +59 -60
- package/dist/downshift.native.cjs.js +220 -230
- package/dist/downshift.nativeweb.cjs.js +220 -230
- package/dist/downshift.umd.js +116 -137
- package/dist/downshift.umd.js.map +1 -1
- package/dist/downshift.umd.min.js +1 -1
- package/dist/downshift.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/preact/dist/downshift.cjs.js +182 -192
- package/preact/dist/downshift.esm.js +59 -60
- package/preact/dist/downshift.umd.js +170 -192
- package/preact/dist/downshift.umd.js.map +1 -1
- package/preact/dist/downshift.umd.min.js +2 -2
- package/preact/dist/downshift.umd.min.js.map +1 -1
package/dist/downshift.cjs.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
|
-
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
|
|
8
7
|
var _inheritsLoose = require('@babel/runtime/helpers/inheritsLoose');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var React = require('react');
|
|
@@ -12,15 +11,6 @@ var reactIs = require('react-is');
|
|
|
12
11
|
var computeScrollIntoView = require('compute-scroll-into-view');
|
|
13
12
|
var tslib = require('tslib');
|
|
14
13
|
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
|
|
18
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
19
|
-
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
20
|
-
var _inheritsLoose__default = /*#__PURE__*/_interopDefaultLegacy(_inheritsLoose);
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
|
|
24
14
|
var idCounter = 0;
|
|
25
15
|
|
|
26
16
|
/**
|
|
@@ -150,7 +140,7 @@ function generateId() {
|
|
|
150
140
|
*/
|
|
151
141
|
function resetIdCounter() {
|
|
152
142
|
// istanbul ignore next
|
|
153
|
-
if ('useId' in
|
|
143
|
+
if ('useId' in React) {
|
|
154
144
|
console.warn("It is not necessary to call resetIdCounter when using React 18+");
|
|
155
145
|
return;
|
|
156
146
|
}
|
|
@@ -484,23 +474,23 @@ var touchEnd = process.env.NODE_ENV !== "production" ? '__autocomplete_touchend_
|
|
|
484
474
|
|
|
485
475
|
var stateChangeTypes$3 = /*#__PURE__*/Object.freeze({
|
|
486
476
|
__proto__: null,
|
|
487
|
-
|
|
488
|
-
|
|
477
|
+
blurButton: blurButton,
|
|
478
|
+
blurInput: blurInput,
|
|
479
|
+
changeInput: changeInput,
|
|
480
|
+
clickButton: clickButton,
|
|
481
|
+
clickItem: clickItem,
|
|
482
|
+
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
489
483
|
itemMouseEnter: itemMouseEnter,
|
|
490
|
-
keyDownArrowUp: keyDownArrowUp,
|
|
491
484
|
keyDownArrowDown: keyDownArrowDown,
|
|
492
|
-
|
|
485
|
+
keyDownArrowUp: keyDownArrowUp,
|
|
486
|
+
keyDownEnd: keyDownEnd,
|
|
493
487
|
keyDownEnter: keyDownEnter,
|
|
488
|
+
keyDownEscape: keyDownEscape,
|
|
494
489
|
keyDownHome: keyDownHome,
|
|
495
|
-
keyDownEnd: keyDownEnd,
|
|
496
|
-
clickItem: clickItem,
|
|
497
|
-
blurInput: blurInput,
|
|
498
|
-
changeInput: changeInput,
|
|
499
490
|
keyDownSpaceButton: keyDownSpaceButton,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
touchEnd: touchEnd
|
|
491
|
+
mouseUp: mouseUp,
|
|
492
|
+
touchEnd: touchEnd,
|
|
493
|
+
unknown: unknown
|
|
504
494
|
});
|
|
505
495
|
|
|
506
496
|
var _excluded$3 = ["refKey", "ref"],
|
|
@@ -510,7 +500,6 @@ var _excluded$3 = ["refKey", "ref"],
|
|
|
510
500
|
_excluded5 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"];
|
|
511
501
|
var Downshift = /*#__PURE__*/function () {
|
|
512
502
|
var Downshift = /*#__PURE__*/function (_Component) {
|
|
513
|
-
_inheritsLoose__default["default"](Downshift, _Component);
|
|
514
503
|
function Downshift(_props) {
|
|
515
504
|
var _this;
|
|
516
505
|
_this = _Component.call(this, _props) || this;
|
|
@@ -564,7 +553,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
564
553
|
otherStateToSet = {};
|
|
565
554
|
}
|
|
566
555
|
otherStateToSet = pickState(otherStateToSet);
|
|
567
|
-
_this.internalSetState(
|
|
556
|
+
_this.internalSetState(_extends({
|
|
568
557
|
highlightedIndex: highlightedIndex
|
|
569
558
|
}, otherStateToSet));
|
|
570
559
|
};
|
|
@@ -578,7 +567,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
578
567
|
};
|
|
579
568
|
_this.selectItem = function (item, otherStateToSet, cb) {
|
|
580
569
|
otherStateToSet = pickState(otherStateToSet);
|
|
581
|
-
_this.internalSetState(
|
|
570
|
+
_this.internalSetState(_extends({
|
|
582
571
|
isOpen: _this.props.defaultIsOpen,
|
|
583
572
|
highlightedIndex: _this.props.defaultHighlightedIndex,
|
|
584
573
|
selectedItem: item,
|
|
@@ -614,7 +603,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
614
603
|
// preserving the cursor position.
|
|
615
604
|
// See https://github.com/downshift-js/downshift/issues/217 for more info.
|
|
616
605
|
if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {
|
|
617
|
-
_this.props.onInputValueChange(stateToSet.inputValue,
|
|
606
|
+
_this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet));
|
|
618
607
|
}
|
|
619
608
|
return _this.setState(function (state) {
|
|
620
609
|
var _newStateToSet;
|
|
@@ -662,7 +651,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
662
651
|
// if stateToSet is a function, then we weren't able to call onInputValueChange
|
|
663
652
|
// earlier, so we'll call it now that we know what the inputValue state will be.
|
|
664
653
|
if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {
|
|
665
|
-
_this.props.onInputValueChange(newStateToSet.inputValue,
|
|
654
|
+
_this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet));
|
|
666
655
|
}
|
|
667
656
|
return nextState;
|
|
668
657
|
}, function () {
|
|
@@ -696,7 +685,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
696
685
|
_ref$refKey = _ref.refKey,
|
|
697
686
|
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
|
|
698
687
|
ref = _ref.ref,
|
|
699
|
-
rest =
|
|
688
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
700
689
|
var _ref2 = _temp2 === void 0 ? {} : _temp2,
|
|
701
690
|
_ref2$suppressRefErro = _ref2.suppressRefError,
|
|
702
691
|
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
|
|
@@ -707,7 +696,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
707
696
|
_this.getRootProps.suppressRefError = suppressRefError;
|
|
708
697
|
var _this$getState = _this.getState(),
|
|
709
698
|
isOpen = _this$getState.isOpen;
|
|
710
|
-
return
|
|
699
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : undefined, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);
|
|
711
700
|
};
|
|
712
701
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\ ROOT
|
|
713
702
|
_this.keyDownHandlers = {
|
|
@@ -786,7 +775,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
786
775
|
},
|
|
787
776
|
Escape: function Escape(event) {
|
|
788
777
|
event.preventDefault();
|
|
789
|
-
this.reset(
|
|
778
|
+
this.reset(_extends({
|
|
790
779
|
type: keyDownEscape
|
|
791
780
|
}, !this.state.isOpen && {
|
|
792
781
|
selectedItem: null,
|
|
@@ -795,7 +784,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
795
784
|
}
|
|
796
785
|
};
|
|
797
786
|
//////////////////////////// BUTTON
|
|
798
|
-
_this.buttonKeyDownHandlers =
|
|
787
|
+
_this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
|
|
799
788
|
' ': function _(event) {
|
|
800
789
|
event.preventDefault();
|
|
801
790
|
this.toggleMenu({
|
|
@@ -803,7 +792,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
803
792
|
});
|
|
804
793
|
}
|
|
805
794
|
});
|
|
806
|
-
_this.inputKeyDownHandlers =
|
|
795
|
+
_this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
|
|
807
796
|
Home: function Home(event) {
|
|
808
797
|
var _this$getState3 = this.getState(),
|
|
809
798
|
isOpen = _this$getState3.isOpen;
|
|
@@ -852,7 +841,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
852
841
|
var onKeyDown = _ref3.onKeyDown,
|
|
853
842
|
onKeyUp = _ref3.onKeyUp,
|
|
854
843
|
onBlur = _ref3.onBlur,
|
|
855
|
-
rest =
|
|
844
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
856
845
|
var _this$getState5 = _this.getState(),
|
|
857
846
|
isOpen = _this$getState5.isOpen;
|
|
858
847
|
var enabledEventHandlers = {
|
|
@@ -862,7 +851,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
862
851
|
onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)
|
|
863
852
|
};
|
|
864
853
|
var eventHandlers = rest.disabled ? {} : enabledEventHandlers;
|
|
865
|
-
return
|
|
854
|
+
return _extends({
|
|
866
855
|
type: 'button',
|
|
867
856
|
role: 'button',
|
|
868
857
|
'aria-label': isOpen ? 'close menu' : 'open menu',
|
|
@@ -877,7 +866,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
877
866
|
_this.buttonHandleKeyDown = function (event) {
|
|
878
867
|
var key = normalizeArrowKey(event);
|
|
879
868
|
if (_this.buttonKeyDownHandlers[key]) {
|
|
880
|
-
_this.buttonKeyDownHandlers[key].call(
|
|
869
|
+
_this.buttonKeyDownHandlers[key].call(_this, event);
|
|
881
870
|
}
|
|
882
871
|
};
|
|
883
872
|
_this.buttonHandleClick = function (event) {
|
|
@@ -928,7 +917,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
928
917
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BUTTON
|
|
929
918
|
/////////////////////////////// LABEL
|
|
930
919
|
_this.getLabelProps = function (props) {
|
|
931
|
-
return
|
|
920
|
+
return _extends({
|
|
932
921
|
htmlFor: _this.inputId,
|
|
933
922
|
id: _this.labelId
|
|
934
923
|
}, props);
|
|
@@ -942,7 +931,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
942
931
|
onChange = _ref4.onChange,
|
|
943
932
|
onInput = _ref4.onInput;
|
|
944
933
|
_ref4.onChangeText;
|
|
945
|
-
var rest =
|
|
934
|
+
var rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$2);
|
|
946
935
|
var onChangeKey;
|
|
947
936
|
var eventHandlers = {};
|
|
948
937
|
|
|
@@ -958,7 +947,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
958
947
|
var _eventHandlers;
|
|
959
948
|
eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);
|
|
960
949
|
}
|
|
961
|
-
return
|
|
950
|
+
return _extends({
|
|
962
951
|
'aria-autocomplete': 'list',
|
|
963
952
|
'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : undefined,
|
|
964
953
|
'aria-controls': isOpen ? _this.menuId : undefined,
|
|
@@ -973,7 +962,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
973
962
|
_this.inputHandleKeyDown = function (event) {
|
|
974
963
|
var key = normalizeArrowKey(event);
|
|
975
964
|
if (key && _this.inputKeyDownHandlers[key]) {
|
|
976
|
-
_this.inputKeyDownHandlers[key].call(
|
|
965
|
+
_this.inputKeyDownHandlers[key].call(_this, event);
|
|
977
966
|
}
|
|
978
967
|
};
|
|
979
968
|
_this.inputHandleChange = function (event) {
|
|
@@ -1011,14 +1000,14 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1011
1000
|
_ref5$refKey = _ref5.refKey,
|
|
1012
1001
|
refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
|
|
1013
1002
|
ref = _ref5.ref,
|
|
1014
|
-
props =
|
|
1003
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);
|
|
1015
1004
|
var _ref6 = _temp6 === void 0 ? {} : _temp6,
|
|
1016
1005
|
_ref6$suppressRefErro = _ref6.suppressRefError,
|
|
1017
1006
|
suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;
|
|
1018
1007
|
_this.getMenuProps.called = true;
|
|
1019
1008
|
_this.getMenuProps.refKey = refKey;
|
|
1020
1009
|
_this.getMenuProps.suppressRefError = suppressRefError;
|
|
1021
|
-
return
|
|
1010
|
+
return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? undefined : _this.labelId, _extends3.id = _this.menuId, _extends3), props);
|
|
1022
1011
|
};
|
|
1023
1012
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ MENU
|
|
1024
1013
|
/////////////////////////////// ITEM
|
|
@@ -1032,7 +1021,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1032
1021
|
var index = _ref7.index,
|
|
1033
1022
|
_ref7$item = _ref7.item,
|
|
1034
1023
|
item = _ref7$item === void 0 ? process.env.NODE_ENV === 'production' ? /* istanbul ignore next */undefined : requiredProp('getItemProps', 'item') : _ref7$item,
|
|
1035
|
-
rest =
|
|
1024
|
+
rest = _objectWithoutPropertiesLoose(_ref7, _excluded5);
|
|
1036
1025
|
if (index === undefined) {
|
|
1037
1026
|
_this.items.push(item);
|
|
1038
1027
|
index = _this.items.indexOf(item);
|
|
@@ -1079,7 +1068,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1079
1068
|
var eventHandlers = rest.disabled ? {
|
|
1080
1069
|
onMouseDown: enabledEventHandlers.onMouseDown
|
|
1081
1070
|
} : enabledEventHandlers;
|
|
1082
|
-
return
|
|
1071
|
+
return _extends({
|
|
1083
1072
|
id: _this.getItemId(index),
|
|
1084
1073
|
role: 'option',
|
|
1085
1074
|
'aria-selected': _this.getState().highlightedIndex === index
|
|
@@ -1096,7 +1085,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1096
1085
|
otherStateToSet = pickState(otherStateToSet);
|
|
1097
1086
|
_this.internalSetState(function (_ref8) {
|
|
1098
1087
|
var selectedItem = _ref8.selectedItem;
|
|
1099
|
-
return
|
|
1088
|
+
return _extends({
|
|
1100
1089
|
isOpen: _this.props.defaultIsOpen,
|
|
1101
1090
|
highlightedIndex: _this.props.defaultHighlightedIndex,
|
|
1102
1091
|
inputValue: _this.props.itemToString(selectedItem)
|
|
@@ -1110,7 +1099,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1110
1099
|
otherStateToSet = pickState(otherStateToSet);
|
|
1111
1100
|
_this.internalSetState(function (_ref9) {
|
|
1112
1101
|
var isOpen = _ref9.isOpen;
|
|
1113
|
-
return
|
|
1102
|
+
return _extends({
|
|
1114
1103
|
isOpen: !isOpen
|
|
1115
1104
|
}, isOpen && {
|
|
1116
1105
|
highlightedIndex: _this.props.defaultHighlightedIndex
|
|
@@ -1145,7 +1134,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1145
1134
|
var state = _this.getState();
|
|
1146
1135
|
var item = _this.items[state.highlightedIndex];
|
|
1147
1136
|
var resultCount = _this.getItemCount();
|
|
1148
|
-
var status = _this.props.getA11yStatusMessage(
|
|
1137
|
+
var status = _this.props.getA11yStatusMessage(_extends({
|
|
1149
1138
|
itemToString: _this.props.itemToString,
|
|
1150
1139
|
previousResultCount: _this.previousResultCount,
|
|
1151
1140
|
resultCount: resultCount,
|
|
@@ -1177,6 +1166,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1177
1166
|
_this.state = _state;
|
|
1178
1167
|
return _this;
|
|
1179
1168
|
}
|
|
1169
|
+
_inheritsLoose(Downshift, _Component);
|
|
1180
1170
|
var _proto = Downshift.prototype;
|
|
1181
1171
|
/**
|
|
1182
1172
|
* Clear all running timeouts
|
|
@@ -1489,49 +1479,49 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1489
1479
|
return Downshift;
|
|
1490
1480
|
}();
|
|
1491
1481
|
process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
1492
|
-
children:
|
|
1493
|
-
defaultHighlightedIndex:
|
|
1494
|
-
defaultIsOpen:
|
|
1495
|
-
initialHighlightedIndex:
|
|
1496
|
-
initialSelectedItem:
|
|
1497
|
-
initialInputValue:
|
|
1498
|
-
initialIsOpen:
|
|
1499
|
-
getA11yStatusMessage:
|
|
1500
|
-
itemToString:
|
|
1501
|
-
onChange:
|
|
1502
|
-
onSelect:
|
|
1503
|
-
onStateChange:
|
|
1504
|
-
onInputValueChange:
|
|
1505
|
-
onUserAction:
|
|
1506
|
-
onOuterClick:
|
|
1507
|
-
selectedItemChanged:
|
|
1508
|
-
stateReducer:
|
|
1509
|
-
itemCount:
|
|
1510
|
-
id:
|
|
1511
|
-
environment:
|
|
1512
|
-
addEventListener:
|
|
1513
|
-
removeEventListener:
|
|
1514
|
-
document:
|
|
1515
|
-
createElement:
|
|
1516
|
-
getElementById:
|
|
1517
|
-
activeElement:
|
|
1518
|
-
body:
|
|
1482
|
+
children: PropTypes.func,
|
|
1483
|
+
defaultHighlightedIndex: PropTypes.number,
|
|
1484
|
+
defaultIsOpen: PropTypes.bool,
|
|
1485
|
+
initialHighlightedIndex: PropTypes.number,
|
|
1486
|
+
initialSelectedItem: PropTypes.any,
|
|
1487
|
+
initialInputValue: PropTypes.string,
|
|
1488
|
+
initialIsOpen: PropTypes.bool,
|
|
1489
|
+
getA11yStatusMessage: PropTypes.func,
|
|
1490
|
+
itemToString: PropTypes.func,
|
|
1491
|
+
onChange: PropTypes.func,
|
|
1492
|
+
onSelect: PropTypes.func,
|
|
1493
|
+
onStateChange: PropTypes.func,
|
|
1494
|
+
onInputValueChange: PropTypes.func,
|
|
1495
|
+
onUserAction: PropTypes.func,
|
|
1496
|
+
onOuterClick: PropTypes.func,
|
|
1497
|
+
selectedItemChanged: PropTypes.func,
|
|
1498
|
+
stateReducer: PropTypes.func,
|
|
1499
|
+
itemCount: PropTypes.number,
|
|
1500
|
+
id: PropTypes.string,
|
|
1501
|
+
environment: PropTypes.shape({
|
|
1502
|
+
addEventListener: PropTypes.func.isRequired,
|
|
1503
|
+
removeEventListener: PropTypes.func.isRequired,
|
|
1504
|
+
document: PropTypes.shape({
|
|
1505
|
+
createElement: PropTypes.func.isRequired,
|
|
1506
|
+
getElementById: PropTypes.func.isRequired,
|
|
1507
|
+
activeElement: PropTypes.any.isRequired,
|
|
1508
|
+
body: PropTypes.any.isRequired
|
|
1519
1509
|
}).isRequired,
|
|
1520
|
-
Node:
|
|
1510
|
+
Node: PropTypes.func.isRequired
|
|
1521
1511
|
}),
|
|
1522
|
-
suppressRefError:
|
|
1523
|
-
scrollIntoView:
|
|
1512
|
+
suppressRefError: PropTypes.bool,
|
|
1513
|
+
scrollIntoView: PropTypes.func,
|
|
1524
1514
|
// things we keep in state for uncontrolled components
|
|
1525
1515
|
// but can accept as props for controlled components
|
|
1526
1516
|
/* eslint-disable react/no-unused-prop-types */
|
|
1527
|
-
selectedItem:
|
|
1528
|
-
isOpen:
|
|
1529
|
-
inputValue:
|
|
1530
|
-
highlightedIndex:
|
|
1531
|
-
labelId:
|
|
1532
|
-
inputId:
|
|
1533
|
-
menuId:
|
|
1534
|
-
getItemId:
|
|
1517
|
+
selectedItem: PropTypes.any,
|
|
1518
|
+
isOpen: PropTypes.bool,
|
|
1519
|
+
inputValue: PropTypes.string,
|
|
1520
|
+
highlightedIndex: PropTypes.number,
|
|
1521
|
+
labelId: PropTypes.string,
|
|
1522
|
+
inputId: PropTypes.string,
|
|
1523
|
+
menuId: PropTypes.string,
|
|
1524
|
+
getItemId: PropTypes.func
|
|
1535
1525
|
/* eslint-enable react/no-unused-prop-types */
|
|
1536
1526
|
} : void 0;
|
|
1537
1527
|
var Downshift$1 = Downshift;
|
|
@@ -1576,7 +1566,7 @@ function callOnChangeProps(action, state, newState) {
|
|
|
1576
1566
|
}
|
|
1577
1567
|
});
|
|
1578
1568
|
if (props.onStateChange && Object.keys(changes).length) {
|
|
1579
|
-
props.onStateChange(
|
|
1569
|
+
props.onStateChange(_extends({
|
|
1580
1570
|
type: type
|
|
1581
1571
|
}, changes));
|
|
1582
1572
|
}
|
|
@@ -1586,7 +1576,7 @@ function invokeOnChangeHandler(key, action, state, newState) {
|
|
|
1586
1576
|
type = action.type;
|
|
1587
1577
|
var handler = "on" + capitalizeString(key) + "Change";
|
|
1588
1578
|
if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {
|
|
1589
|
-
props[handler](
|
|
1579
|
+
props[handler](_extends({
|
|
1590
1580
|
type: type
|
|
1591
1581
|
}, newState));
|
|
1592
1582
|
}
|
|
@@ -1614,7 +1604,7 @@ var updateA11yStatus = debounce(function (status, document) {
|
|
|
1614
1604
|
var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
1615
1605
|
|
|
1616
1606
|
// istanbul ignore next
|
|
1617
|
-
var useElementIds = 'useId' in
|
|
1607
|
+
var useElementIds = 'useId' in React // Avoid conditional useId call
|
|
1618
1608
|
? function useElementIds(_ref) {
|
|
1619
1609
|
var id = _ref.id,
|
|
1620
1610
|
labelId = _ref.labelId,
|
|
@@ -1623,7 +1613,7 @@ var useElementIds = 'useId' in React__default["default"] // Avoid conditional us
|
|
|
1623
1613
|
toggleButtonId = _ref.toggleButtonId,
|
|
1624
1614
|
inputId = _ref.inputId;
|
|
1625
1615
|
// Avoid conditional useId call
|
|
1626
|
-
var reactId = "downshift-" +
|
|
1616
|
+
var reactId = "downshift-" + React.useId();
|
|
1627
1617
|
if (!id) {
|
|
1628
1618
|
id = reactId;
|
|
1629
1619
|
}
|
|
@@ -1705,7 +1695,7 @@ function useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {
|
|
|
1705
1695
|
actionRef.current = action;
|
|
1706
1696
|
state = getState(state, action.props);
|
|
1707
1697
|
var changes = reducer(state, action);
|
|
1708
|
-
var newState = action.props.stateReducer(state,
|
|
1698
|
+
var newState = action.props.stateReducer(state, _extends({}, action, {
|
|
1709
1699
|
changes: changes
|
|
1710
1700
|
}));
|
|
1711
1701
|
return newState;
|
|
@@ -1715,7 +1705,7 @@ function useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {
|
|
|
1715
1705
|
dispatch = _useReducer[1];
|
|
1716
1706
|
var propsRef = useLatestRef(props);
|
|
1717
1707
|
var dispatchWithProps = React.useCallback(function (action) {
|
|
1718
|
-
return dispatch(
|
|
1708
|
+
return dispatch(_extends({
|
|
1719
1709
|
props: propsRef.current
|
|
1720
1710
|
}, action));
|
|
1721
1711
|
}, [propsRef]);
|
|
@@ -2033,10 +2023,10 @@ function getChangesOnSelection(props, highlightedIndex, inputValue) {
|
|
|
2033
2023
|
inputValue = true;
|
|
2034
2024
|
}
|
|
2035
2025
|
var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0;
|
|
2036
|
-
return
|
|
2026
|
+
return _extends({
|
|
2037
2027
|
isOpen: false,
|
|
2038
2028
|
highlightedIndex: -1
|
|
2039
|
-
}, shouldSelect &&
|
|
2029
|
+
}, shouldSelect && _extends({
|
|
2040
2030
|
selectedItem: props.items[highlightedIndex],
|
|
2041
2031
|
isOpen: getDefaultValue$1(props, 'isOpen'),
|
|
2042
2032
|
highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')
|
|
@@ -2061,8 +2051,8 @@ function isDropdownsStateEqual(prevState, newState) {
|
|
|
2061
2051
|
* Tracks if it's the first render.
|
|
2062
2052
|
*/
|
|
2063
2053
|
function useIsInitialMount() {
|
|
2064
|
-
var isInitialMountRef =
|
|
2065
|
-
|
|
2054
|
+
var isInitialMountRef = React.useRef(true);
|
|
2055
|
+
React.useEffect(function () {
|
|
2066
2056
|
isInitialMountRef.current = false;
|
|
2067
2057
|
return function () {
|
|
2068
2058
|
isInitialMountRef.current = true;
|
|
@@ -2101,44 +2091,44 @@ function getInitialHighlightedIndex(props) {
|
|
|
2101
2091
|
|
|
2102
2092
|
// Shared between all exports.
|
|
2103
2093
|
var commonPropTypes = {
|
|
2104
|
-
environment:
|
|
2105
|
-
addEventListener:
|
|
2106
|
-
removeEventListener:
|
|
2107
|
-
document:
|
|
2108
|
-
createElement:
|
|
2109
|
-
getElementById:
|
|
2110
|
-
activeElement:
|
|
2111
|
-
body:
|
|
2094
|
+
environment: PropTypes.shape({
|
|
2095
|
+
addEventListener: PropTypes.func.isRequired,
|
|
2096
|
+
removeEventListener: PropTypes.func.isRequired,
|
|
2097
|
+
document: PropTypes.shape({
|
|
2098
|
+
createElement: PropTypes.func.isRequired,
|
|
2099
|
+
getElementById: PropTypes.func.isRequired,
|
|
2100
|
+
activeElement: PropTypes.any.isRequired,
|
|
2101
|
+
body: PropTypes.any.isRequired
|
|
2112
2102
|
}).isRequired,
|
|
2113
|
-
Node:
|
|
2103
|
+
Node: PropTypes.func.isRequired
|
|
2114
2104
|
}),
|
|
2115
|
-
itemToString:
|
|
2116
|
-
itemToKey:
|
|
2117
|
-
stateReducer:
|
|
2105
|
+
itemToString: PropTypes.func,
|
|
2106
|
+
itemToKey: PropTypes.func,
|
|
2107
|
+
stateReducer: PropTypes.func
|
|
2118
2108
|
};
|
|
2119
2109
|
|
|
2120
2110
|
// Shared between useSelect, useCombobox, Downshift.
|
|
2121
|
-
var commonDropdownPropTypes =
|
|
2122
|
-
getA11yStatusMessage:
|
|
2123
|
-
highlightedIndex:
|
|
2124
|
-
defaultHighlightedIndex:
|
|
2125
|
-
initialHighlightedIndex:
|
|
2126
|
-
isOpen:
|
|
2127
|
-
defaultIsOpen:
|
|
2128
|
-
initialIsOpen:
|
|
2129
|
-
selectedItem:
|
|
2130
|
-
initialSelectedItem:
|
|
2131
|
-
defaultSelectedItem:
|
|
2132
|
-
id:
|
|
2133
|
-
labelId:
|
|
2134
|
-
menuId:
|
|
2135
|
-
getItemId:
|
|
2136
|
-
toggleButtonId:
|
|
2137
|
-
onSelectedItemChange:
|
|
2138
|
-
onHighlightedIndexChange:
|
|
2139
|
-
onStateChange:
|
|
2140
|
-
onIsOpenChange:
|
|
2141
|
-
scrollIntoView:
|
|
2111
|
+
var commonDropdownPropTypes = _extends({}, commonPropTypes, {
|
|
2112
|
+
getA11yStatusMessage: PropTypes.func,
|
|
2113
|
+
highlightedIndex: PropTypes.number,
|
|
2114
|
+
defaultHighlightedIndex: PropTypes.number,
|
|
2115
|
+
initialHighlightedIndex: PropTypes.number,
|
|
2116
|
+
isOpen: PropTypes.bool,
|
|
2117
|
+
defaultIsOpen: PropTypes.bool,
|
|
2118
|
+
initialIsOpen: PropTypes.bool,
|
|
2119
|
+
selectedItem: PropTypes.any,
|
|
2120
|
+
initialSelectedItem: PropTypes.any,
|
|
2121
|
+
defaultSelectedItem: PropTypes.any,
|
|
2122
|
+
id: PropTypes.string,
|
|
2123
|
+
labelId: PropTypes.string,
|
|
2124
|
+
menuId: PropTypes.string,
|
|
2125
|
+
getItemId: PropTypes.func,
|
|
2126
|
+
toggleButtonId: PropTypes.string,
|
|
2127
|
+
onSelectedItemChange: PropTypes.func,
|
|
2128
|
+
onHighlightedIndexChange: PropTypes.func,
|
|
2129
|
+
onStateChange: PropTypes.func,
|
|
2130
|
+
onIsOpenChange: PropTypes.func,
|
|
2131
|
+
scrollIntoView: PropTypes.func
|
|
2142
2132
|
});
|
|
2143
2133
|
|
|
2144
2134
|
function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
@@ -2195,7 +2185,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
|
2195
2185
|
default:
|
|
2196
2186
|
throw new Error('Reducer called without proper action type.');
|
|
2197
2187
|
}
|
|
2198
|
-
return
|
|
2188
|
+
return _extends({}, state, changes);
|
|
2199
2189
|
}
|
|
2200
2190
|
/* eslint-enable complexity */
|
|
2201
2191
|
|
|
@@ -2214,7 +2204,7 @@ function getItemIndexByCharacterKey(_a) {
|
|
|
2214
2204
|
}
|
|
2215
2205
|
return highlightedIndex;
|
|
2216
2206
|
}
|
|
2217
|
-
var propTypes$2 = tslib.__assign(tslib.__assign({}, commonDropdownPropTypes), { items:
|
|
2207
|
+
var propTypes$2 = tslib.__assign(tslib.__assign({}, commonDropdownPropTypes), { items: PropTypes.array.isRequired, isItemDisabled: PropTypes.func });
|
|
2218
2208
|
var defaultProps$2 = tslib.__assign(tslib.__assign({}, defaultProps$3), { isItemDisabled: function () {
|
|
2219
2209
|
return false;
|
|
2220
2210
|
} });
|
|
@@ -2223,7 +2213,7 @@ var validatePropTypes$2 = noop;
|
|
|
2223
2213
|
/* istanbul ignore next */
|
|
2224
2214
|
if (process.env.NODE_ENV !== 'production') {
|
|
2225
2215
|
validatePropTypes$2 = function (options, caller) {
|
|
2226
|
-
|
|
2216
|
+
PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);
|
|
2227
2217
|
};
|
|
2228
2218
|
}
|
|
2229
2219
|
|
|
@@ -2252,28 +2242,28 @@ var FunctionReset$2 = process.env.NODE_ENV !== "production" ? '__function_reset_
|
|
|
2252
2242
|
|
|
2253
2243
|
var stateChangeTypes$2 = /*#__PURE__*/Object.freeze({
|
|
2254
2244
|
__proto__: null,
|
|
2245
|
+
FunctionCloseMenu: FunctionCloseMenu$1,
|
|
2246
|
+
FunctionOpenMenu: FunctionOpenMenu$1,
|
|
2247
|
+
FunctionReset: FunctionReset$2,
|
|
2248
|
+
FunctionSelectItem: FunctionSelectItem$1,
|
|
2249
|
+
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
|
|
2250
|
+
FunctionSetInputValue: FunctionSetInputValue$1,
|
|
2251
|
+
FunctionToggleMenu: FunctionToggleMenu$1,
|
|
2252
|
+
ItemClick: ItemClick$1,
|
|
2253
|
+
ItemMouseMove: ItemMouseMove$1,
|
|
2254
|
+
MenuMouseLeave: MenuMouseLeave$1,
|
|
2255
|
+
ToggleButtonBlur: ToggleButtonBlur,
|
|
2255
2256
|
ToggleButtonClick: ToggleButtonClick$1,
|
|
2256
2257
|
ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,
|
|
2257
2258
|
ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,
|
|
2258
2259
|
ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,
|
|
2259
|
-
ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,
|
|
2260
|
-
ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,
|
|
2261
2260
|
ToggleButtonKeyDownEnd: ToggleButtonKeyDownEnd,
|
|
2262
2261
|
ToggleButtonKeyDownEnter: ToggleButtonKeyDownEnter,
|
|
2263
|
-
|
|
2264
|
-
|
|
2262
|
+
ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,
|
|
2263
|
+
ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,
|
|
2265
2264
|
ToggleButtonKeyDownPageDown: ToggleButtonKeyDownPageDown,
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
ItemMouseMove: ItemMouseMove$1,
|
|
2269
|
-
ItemClick: ItemClick$1,
|
|
2270
|
-
FunctionToggleMenu: FunctionToggleMenu$1,
|
|
2271
|
-
FunctionOpenMenu: FunctionOpenMenu$1,
|
|
2272
|
-
FunctionCloseMenu: FunctionCloseMenu$1,
|
|
2273
|
-
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
|
|
2274
|
-
FunctionSelectItem: FunctionSelectItem$1,
|
|
2275
|
-
FunctionSetInputValue: FunctionSetInputValue$1,
|
|
2276
|
-
FunctionReset: FunctionReset$2
|
|
2265
|
+
ToggleButtonKeyDownPageUp: ToggleButtonKeyDownPageUp,
|
|
2266
|
+
ToggleButtonKeyDownSpaceButton: ToggleButtonKeyDownSpaceButton
|
|
2277
2267
|
});
|
|
2278
2268
|
|
|
2279
2269
|
/* eslint-disable complexity */
|
|
@@ -2366,7 +2356,7 @@ function downshiftSelectReducer(state, action) {
|
|
|
2366
2356
|
};
|
|
2367
2357
|
break;
|
|
2368
2358
|
case ToggleButtonBlur:
|
|
2369
|
-
changes =
|
|
2359
|
+
changes = _extends({
|
|
2370
2360
|
isOpen: false,
|
|
2371
2361
|
highlightedIndex: -1
|
|
2372
2362
|
}, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && {
|
|
@@ -2381,7 +2371,7 @@ function downshiftSelectReducer(state, action) {
|
|
|
2381
2371
|
default:
|
|
2382
2372
|
return downshiftCommonReducer(state, action, stateChangeTypes$2);
|
|
2383
2373
|
}
|
|
2384
|
-
return
|
|
2374
|
+
return _extends({}, state, changes);
|
|
2385
2375
|
}
|
|
2386
2376
|
/* eslint-enable complexity */
|
|
2387
2377
|
|
|
@@ -2396,7 +2386,7 @@ function useSelect(userProps) {
|
|
|
2396
2386
|
}
|
|
2397
2387
|
validatePropTypes$2(userProps, useSelect);
|
|
2398
2388
|
// Props defaults and destructuring.
|
|
2399
|
-
var props =
|
|
2389
|
+
var props = _extends({}, defaultProps$2, userProps);
|
|
2400
2390
|
var scrollIntoView = props.scrollIntoView,
|
|
2401
2391
|
environment = props.environment,
|
|
2402
2392
|
getA11yStatusMessage = props.getA11yStatusMessage;
|
|
@@ -2482,7 +2472,7 @@ function useSelect(userProps) {
|
|
|
2482
2472
|
}
|
|
2483
2473
|
}, [dispatch, latest]), React.useMemo(function () {
|
|
2484
2474
|
return [menuRef, toggleButtonRef];
|
|
2485
|
-
}, []));
|
|
2475
|
+
}, [menuRef.current, toggleButtonRef.current]));
|
|
2486
2476
|
var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps');
|
|
2487
2477
|
// Reset itemRefs on close.
|
|
2488
2478
|
React.useEffect(function () {
|
|
@@ -2615,12 +2605,12 @@ function useSelect(userProps) {
|
|
|
2615
2605
|
var getLabelProps = React.useCallback(function (_temp) {
|
|
2616
2606
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
2617
2607
|
onClick = _ref.onClick,
|
|
2618
|
-
labelProps =
|
|
2608
|
+
labelProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2619
2609
|
var labelHandleClick = function labelHandleClick() {
|
|
2620
2610
|
var _toggleButtonRef$curr;
|
|
2621
2611
|
(_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus();
|
|
2622
2612
|
};
|
|
2623
|
-
return
|
|
2613
|
+
return _extends({
|
|
2624
2614
|
id: elementIds.labelId,
|
|
2625
2615
|
htmlFor: elementIds.toggleButtonId,
|
|
2626
2616
|
onClick: callAllEventHandlers(onClick, labelHandleClick)
|
|
@@ -2633,7 +2623,7 @@ function useSelect(userProps) {
|
|
|
2633
2623
|
_ref2$refKey = _ref2.refKey,
|
|
2634
2624
|
refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,
|
|
2635
2625
|
ref = _ref2.ref,
|
|
2636
|
-
rest =
|
|
2626
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
2637
2627
|
var _ref3 = _temp3 === void 0 ? {} : _temp3,
|
|
2638
2628
|
_ref3$suppressRefErro = _ref3.suppressRefError,
|
|
2639
2629
|
suppressRefError = _ref3$suppressRefErro === void 0 ? false : _ref3$suppressRefErro;
|
|
@@ -2643,7 +2633,7 @@ function useSelect(userProps) {
|
|
|
2643
2633
|
});
|
|
2644
2634
|
};
|
|
2645
2635
|
setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
|
|
2646
|
-
return
|
|
2636
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
|
|
2647
2637
|
menuRef.current = menuNode;
|
|
2648
2638
|
}), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : "" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends2), rest);
|
|
2649
2639
|
}, [dispatch, setGetterPropCallInfo, elementIds]);
|
|
@@ -2657,7 +2647,7 @@ function useSelect(userProps) {
|
|
|
2657
2647
|
_ref4$refKey = _ref4.refKey,
|
|
2658
2648
|
refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,
|
|
2659
2649
|
ref = _ref4.ref,
|
|
2660
|
-
rest =
|
|
2650
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$1);
|
|
2661
2651
|
var _ref5 = _temp5 === void 0 ? {} : _temp5,
|
|
2662
2652
|
_ref5$suppressRefErro = _ref5.suppressRefError,
|
|
2663
2653
|
suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;
|
|
@@ -2685,7 +2675,7 @@ function useSelect(userProps) {
|
|
|
2685
2675
|
});
|
|
2686
2676
|
}
|
|
2687
2677
|
};
|
|
2688
|
-
var toggleProps =
|
|
2678
|
+
var toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {
|
|
2689
2679
|
toggleButtonRef.current = toggleButtonNode;
|
|
2690
2680
|
}), _extends3['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends3['aria-controls'] = elementIds.menuId, _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-labelledby'] = rest && rest['aria-label'] ? undefined : "" + elementIds.labelId, _extends3.id = elementIds.toggleButtonId, _extends3.role = 'combobox', _extends3.tabIndex = 0, _extends3.onBlur = callAllEventHandlers(onBlur, toggleButtonHandleBlur), _extends3), rest);
|
|
2691
2681
|
if (!rest.disabled) {
|
|
@@ -2711,7 +2701,7 @@ function useSelect(userProps) {
|
|
|
2711
2701
|
refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,
|
|
2712
2702
|
disabledProp = _ref6.disabled,
|
|
2713
2703
|
ref = _ref6.ref,
|
|
2714
|
-
rest =
|
|
2704
|
+
rest = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
|
|
2715
2705
|
if (disabledProp !== undefined) {
|
|
2716
2706
|
console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');
|
|
2717
2707
|
}
|
|
@@ -2743,7 +2733,7 @@ function useSelect(userProps) {
|
|
|
2743
2733
|
return e.preventDefault();
|
|
2744
2734
|
}; // keep focus on the toggle after item click select.
|
|
2745
2735
|
|
|
2746
|
-
var itemProps =
|
|
2736
|
+
var itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (itemNode) {
|
|
2747
2737
|
if (itemNode) {
|
|
2748
2738
|
itemRefs.current[elementIds.getItemId(index)] = itemNode;
|
|
2749
2739
|
}
|
|
@@ -2806,29 +2796,29 @@ var ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== "production" ?
|
|
|
2806
2796
|
|
|
2807
2797
|
var stateChangeTypes$1 = /*#__PURE__*/Object.freeze({
|
|
2808
2798
|
__proto__: null,
|
|
2799
|
+
ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem,
|
|
2800
|
+
FunctionCloseMenu: FunctionCloseMenu,
|
|
2801
|
+
FunctionOpenMenu: FunctionOpenMenu,
|
|
2802
|
+
FunctionReset: FunctionReset$1,
|
|
2803
|
+
FunctionSelectItem: FunctionSelectItem,
|
|
2804
|
+
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,
|
|
2805
|
+
FunctionSetInputValue: FunctionSetInputValue,
|
|
2806
|
+
FunctionToggleMenu: FunctionToggleMenu,
|
|
2807
|
+
InputBlur: InputBlur,
|
|
2808
|
+
InputChange: InputChange,
|
|
2809
|
+
InputClick: InputClick,
|
|
2809
2810
|
InputKeyDownArrowDown: InputKeyDownArrowDown,
|
|
2810
2811
|
InputKeyDownArrowUp: InputKeyDownArrowUp,
|
|
2812
|
+
InputKeyDownEnd: InputKeyDownEnd,
|
|
2813
|
+
InputKeyDownEnter: InputKeyDownEnter,
|
|
2811
2814
|
InputKeyDownEscape: InputKeyDownEscape,
|
|
2812
2815
|
InputKeyDownHome: InputKeyDownHome,
|
|
2813
|
-
InputKeyDownEnd: InputKeyDownEnd,
|
|
2814
|
-
InputKeyDownPageUp: InputKeyDownPageUp,
|
|
2815
2816
|
InputKeyDownPageDown: InputKeyDownPageDown,
|
|
2816
|
-
|
|
2817
|
-
InputChange: InputChange,
|
|
2818
|
-
InputBlur: InputBlur,
|
|
2819
|
-
InputClick: InputClick,
|
|
2820
|
-
MenuMouseLeave: MenuMouseLeave,
|
|
2821
|
-
ItemMouseMove: ItemMouseMove,
|
|
2817
|
+
InputKeyDownPageUp: InputKeyDownPageUp,
|
|
2822
2818
|
ItemClick: ItemClick,
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
FunctionCloseMenu: FunctionCloseMenu,
|
|
2827
|
-
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,
|
|
2828
|
-
FunctionSelectItem: FunctionSelectItem,
|
|
2829
|
-
FunctionSetInputValue: FunctionSetInputValue,
|
|
2830
|
-
FunctionReset: FunctionReset$1,
|
|
2831
|
-
ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem
|
|
2819
|
+
ItemMouseMove: ItemMouseMove,
|
|
2820
|
+
MenuMouseLeave: MenuMouseLeave,
|
|
2821
|
+
ToggleButtonClick: ToggleButtonClick
|
|
2832
2822
|
});
|
|
2833
2823
|
|
|
2834
2824
|
function getInitialState$1(props) {
|
|
@@ -2838,18 +2828,18 @@ function getInitialState$1(props) {
|
|
|
2838
2828
|
if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {
|
|
2839
2829
|
inputValue = props.itemToString(selectedItem);
|
|
2840
2830
|
}
|
|
2841
|
-
return
|
|
2831
|
+
return _extends({}, initialState, {
|
|
2842
2832
|
inputValue: inputValue
|
|
2843
2833
|
});
|
|
2844
2834
|
}
|
|
2845
|
-
var propTypes$1 =
|
|
2846
|
-
items:
|
|
2847
|
-
isItemDisabled:
|
|
2848
|
-
inputValue:
|
|
2849
|
-
defaultInputValue:
|
|
2850
|
-
initialInputValue:
|
|
2851
|
-
inputId:
|
|
2852
|
-
onInputValueChange:
|
|
2835
|
+
var propTypes$1 = _extends({}, commonDropdownPropTypes, {
|
|
2836
|
+
items: PropTypes.array.isRequired,
|
|
2837
|
+
isItemDisabled: PropTypes.func,
|
|
2838
|
+
inputValue: PropTypes.string,
|
|
2839
|
+
defaultInputValue: PropTypes.string,
|
|
2840
|
+
initialInputValue: PropTypes.string,
|
|
2841
|
+
inputId: PropTypes.string,
|
|
2842
|
+
onInputValueChange: PropTypes.func
|
|
2853
2843
|
});
|
|
2854
2844
|
|
|
2855
2845
|
/**
|
|
@@ -2896,10 +2886,10 @@ var validatePropTypes$1 = noop;
|
|
|
2896
2886
|
/* istanbul ignore next */
|
|
2897
2887
|
if (process.env.NODE_ENV !== 'production') {
|
|
2898
2888
|
validatePropTypes$1 = function validatePropTypes(options, caller) {
|
|
2899
|
-
|
|
2889
|
+
PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);
|
|
2900
2890
|
};
|
|
2901
2891
|
}
|
|
2902
|
-
var defaultProps$1 =
|
|
2892
|
+
var defaultProps$1 = _extends({}, defaultProps$3, {
|
|
2903
2893
|
isItemDisabled: function isItemDisabled() {
|
|
2904
2894
|
return false;
|
|
2905
2895
|
}
|
|
@@ -2953,7 +2943,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
2953
2943
|
changes = getChangesOnSelection(props, state.highlightedIndex);
|
|
2954
2944
|
break;
|
|
2955
2945
|
case InputKeyDownEscape:
|
|
2956
|
-
changes =
|
|
2946
|
+
changes = _extends({
|
|
2957
2947
|
isOpen: false,
|
|
2958
2948
|
highlightedIndex: -1
|
|
2959
2949
|
}, !state.isOpen && {
|
|
@@ -2982,7 +2972,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
2982
2972
|
};
|
|
2983
2973
|
break;
|
|
2984
2974
|
case InputBlur:
|
|
2985
|
-
changes =
|
|
2975
|
+
changes = _extends({
|
|
2986
2976
|
isOpen: false,
|
|
2987
2977
|
highlightedIndex: -1
|
|
2988
2978
|
}, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && {
|
|
@@ -3017,7 +3007,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
3017
3007
|
default:
|
|
3018
3008
|
return downshiftCommonReducer(state, action, stateChangeTypes$1);
|
|
3019
3009
|
}
|
|
3020
|
-
return
|
|
3010
|
+
return _extends({}, state, changes);
|
|
3021
3011
|
}
|
|
3022
3012
|
/* eslint-enable complexity */
|
|
3023
3013
|
|
|
@@ -3032,7 +3022,7 @@ function useCombobox(userProps) {
|
|
|
3032
3022
|
}
|
|
3033
3023
|
validatePropTypes$1(userProps, useCombobox);
|
|
3034
3024
|
// Props defaults and destructuring.
|
|
3035
|
-
var props =
|
|
3025
|
+
var props = _extends({}, defaultProps$1, userProps);
|
|
3036
3026
|
var items = props.items,
|
|
3037
3027
|
scrollIntoView = props.scrollIntoView,
|
|
3038
3028
|
environment = props.environment,
|
|
@@ -3104,7 +3094,7 @@ function useCombobox(userProps) {
|
|
|
3104
3094
|
}
|
|
3105
3095
|
}, [dispatch, latest]), React.useMemo(function () {
|
|
3106
3096
|
return [menuRef, toggleButtonRef, inputRef];
|
|
3107
|
-
}, []));
|
|
3097
|
+
}, [menuRef.current, toggleButtonRef.current, inputRef.current]));
|
|
3108
3098
|
var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getMenuProps');
|
|
3109
3099
|
// Reset itemRefs on close.
|
|
3110
3100
|
React.useEffect(function () {
|
|
@@ -3200,7 +3190,7 @@ function useCombobox(userProps) {
|
|
|
3200
3190
|
|
|
3201
3191
|
// Getter props.
|
|
3202
3192
|
var getLabelProps = React.useCallback(function (labelProps) {
|
|
3203
|
-
return
|
|
3193
|
+
return _extends({
|
|
3204
3194
|
id: elementIds.labelId,
|
|
3205
3195
|
htmlFor: elementIds.inputId
|
|
3206
3196
|
}, labelProps);
|
|
@@ -3212,12 +3202,12 @@ function useCombobox(userProps) {
|
|
|
3212
3202
|
_ref$refKey = _ref.refKey,
|
|
3213
3203
|
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
|
|
3214
3204
|
ref = _ref.ref,
|
|
3215
|
-
rest =
|
|
3205
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
3216
3206
|
var _ref2 = _temp2 === void 0 ? {} : _temp2,
|
|
3217
3207
|
_ref2$suppressRefErro = _ref2.suppressRefError,
|
|
3218
3208
|
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
|
|
3219
3209
|
setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
|
|
3220
|
-
return
|
|
3210
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
|
|
3221
3211
|
menuRef.current = menuNode;
|
|
3222
3212
|
}), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : "" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {
|
|
3223
3213
|
dispatch({
|
|
@@ -3238,7 +3228,7 @@ function useCombobox(userProps) {
|
|
|
3238
3228
|
onClick = _ref3.onClick;
|
|
3239
3229
|
_ref3.onPress;
|
|
3240
3230
|
var disabledProp = _ref3.disabled,
|
|
3241
|
-
rest =
|
|
3231
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);
|
|
3242
3232
|
if (disabledProp !== undefined) {
|
|
3243
3233
|
console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
|
|
3244
3234
|
}
|
|
@@ -3272,7 +3262,7 @@ function useCombobox(userProps) {
|
|
|
3272
3262
|
return e.preventDefault();
|
|
3273
3263
|
}; // keep focus on the input after item click select.
|
|
3274
3264
|
|
|
3275
|
-
return
|
|
3265
|
+
return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {
|
|
3276
3266
|
if (itemNode) {
|
|
3277
3267
|
itemRefs.current[elementIds.getItemId(index)] = itemNode;
|
|
3278
3268
|
}
|
|
@@ -3289,16 +3279,16 @@ function useCombobox(userProps) {
|
|
|
3289
3279
|
var _ref5$refKey = _ref5.refKey,
|
|
3290
3280
|
refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
|
|
3291
3281
|
ref = _ref5.ref,
|
|
3292
|
-
rest =
|
|
3282
|
+
rest = _objectWithoutPropertiesLoose(_ref5, _excluded3);
|
|
3293
3283
|
var latestState = latest.current.state;
|
|
3294
3284
|
var toggleButtonHandleClick = function toggleButtonHandleClick() {
|
|
3295
3285
|
dispatch({
|
|
3296
3286
|
type: ToggleButtonClick
|
|
3297
3287
|
});
|
|
3298
3288
|
};
|
|
3299
|
-
return
|
|
3289
|
+
return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {
|
|
3300
3290
|
toggleButtonRef.current = toggleButtonNode;
|
|
3301
|
-
}), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled &&
|
|
3291
|
+
}), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && _extends({}, {
|
|
3302
3292
|
onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)
|
|
3303
3293
|
}), rest);
|
|
3304
3294
|
}, [dispatch, latest, elementIds]);
|
|
@@ -3314,7 +3304,7 @@ function useCombobox(userProps) {
|
|
|
3314
3304
|
_ref6$refKey = _ref6.refKey,
|
|
3315
3305
|
refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,
|
|
3316
3306
|
ref = _ref6.ref,
|
|
3317
|
-
rest =
|
|
3307
|
+
rest = _objectWithoutPropertiesLoose(_ref6, _excluded4);
|
|
3318
3308
|
var _ref7 = _temp6 === void 0 ? {} : _temp6,
|
|
3319
3309
|
_ref7$suppressRefErro = _ref7.suppressRefError,
|
|
3320
3310
|
suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;
|
|
@@ -3355,7 +3345,7 @@ function useCombobox(userProps) {
|
|
|
3355
3345
|
var _eventHandlers;
|
|
3356
3346
|
eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers.onClick = callAllEventHandlers(onClick, inputHandleClick), _eventHandlers);
|
|
3357
3347
|
}
|
|
3358
|
-
return
|
|
3348
|
+
return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {
|
|
3359
3349
|
inputRef.current = inputNode;
|
|
3360
3350
|
}), _extends5['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5['aria-expanded'] = latestState.isOpen, _extends5['aria-labelledby'] = rest && rest['aria-label'] ? undefined : elementIds.labelId, _extends5.autoComplete = 'off', _extends5.id = elementIds.inputId, _extends5.role = 'combobox', _extends5.value = latestState.inputValue, _extends5), eventHandlers, rest);
|
|
3361
3351
|
}, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]);
|
|
@@ -3508,17 +3498,17 @@ var propTypes = {
|
|
|
3508
3498
|
stateReducer: commonPropTypes.stateReducer,
|
|
3509
3499
|
itemToKey: commonPropTypes.itemToKey,
|
|
3510
3500
|
environment: commonPropTypes.environment,
|
|
3511
|
-
selectedItems:
|
|
3512
|
-
initialSelectedItems:
|
|
3513
|
-
defaultSelectedItems:
|
|
3514
|
-
getA11yStatusMessage:
|
|
3515
|
-
activeIndex:
|
|
3516
|
-
initialActiveIndex:
|
|
3517
|
-
defaultActiveIndex:
|
|
3518
|
-
onActiveIndexChange:
|
|
3519
|
-
onSelectedItemsChange:
|
|
3520
|
-
keyNavigationNext:
|
|
3521
|
-
keyNavigationPrevious:
|
|
3501
|
+
selectedItems: PropTypes.array,
|
|
3502
|
+
initialSelectedItems: PropTypes.array,
|
|
3503
|
+
defaultSelectedItems: PropTypes.array,
|
|
3504
|
+
getA11yStatusMessage: PropTypes.func,
|
|
3505
|
+
activeIndex: PropTypes.number,
|
|
3506
|
+
initialActiveIndex: PropTypes.number,
|
|
3507
|
+
defaultActiveIndex: PropTypes.number,
|
|
3508
|
+
onActiveIndexChange: PropTypes.func,
|
|
3509
|
+
onSelectedItemsChange: PropTypes.func,
|
|
3510
|
+
keyNavigationNext: PropTypes.string,
|
|
3511
|
+
keyNavigationPrevious: PropTypes.string
|
|
3522
3512
|
};
|
|
3523
3513
|
var defaultProps = {
|
|
3524
3514
|
itemToKey: defaultProps$3.itemToKey,
|
|
@@ -3533,7 +3523,7 @@ var validatePropTypes = noop;
|
|
|
3533
3523
|
/* istanbul ignore next */
|
|
3534
3524
|
if (process.env.NODE_ENV !== 'production') {
|
|
3535
3525
|
validatePropTypes = function validatePropTypes(options, caller) {
|
|
3536
|
-
|
|
3526
|
+
PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);
|
|
3537
3527
|
};
|
|
3538
3528
|
}
|
|
3539
3529
|
|
|
@@ -3553,19 +3543,19 @@ var FunctionReset = process.env.NODE_ENV !== "production" ? '__function_reset__'
|
|
|
3553
3543
|
|
|
3554
3544
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
3555
3545
|
__proto__: null,
|
|
3556
|
-
SelectedItemClick: SelectedItemClick,
|
|
3557
|
-
SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,
|
|
3558
|
-
SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,
|
|
3559
|
-
SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,
|
|
3560
|
-
SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious,
|
|
3561
|
-
DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,
|
|
3562
|
-
DropdownKeyDownBackspace: DropdownKeyDownBackspace,
|
|
3563
3546
|
DropdownClick: DropdownClick,
|
|
3547
|
+
DropdownKeyDownBackspace: DropdownKeyDownBackspace,
|
|
3548
|
+
DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,
|
|
3564
3549
|
FunctionAddSelectedItem: FunctionAddSelectedItem,
|
|
3565
3550
|
FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,
|
|
3566
|
-
|
|
3551
|
+
FunctionReset: FunctionReset,
|
|
3567
3552
|
FunctionSetActiveIndex: FunctionSetActiveIndex,
|
|
3568
|
-
|
|
3553
|
+
FunctionSetSelectedItems: FunctionSetSelectedItems,
|
|
3554
|
+
SelectedItemClick: SelectedItemClick,
|
|
3555
|
+
SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,
|
|
3556
|
+
SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,
|
|
3557
|
+
SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,
|
|
3558
|
+
SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious
|
|
3569
3559
|
});
|
|
3570
3560
|
|
|
3571
3561
|
/* eslint-disable complexity */
|
|
@@ -3605,7 +3595,7 @@ function downshiftMultipleSelectionReducer(state, action) {
|
|
|
3605
3595
|
} else if (activeIndex === selectedItems.length - 1) {
|
|
3606
3596
|
newActiveIndex = selectedItems.length - 2;
|
|
3607
3597
|
}
|
|
3608
|
-
changes =
|
|
3598
|
+
changes = _extends({
|
|
3609
3599
|
selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))
|
|
3610
3600
|
}, {
|
|
3611
3601
|
activeIndex: newActiveIndex
|
|
@@ -3677,7 +3667,7 @@ function downshiftMultipleSelectionReducer(state, action) {
|
|
|
3677
3667
|
default:
|
|
3678
3668
|
throw new Error('Reducer called without proper action type.');
|
|
3679
3669
|
}
|
|
3680
|
-
return
|
|
3670
|
+
return _extends({}, state, changes);
|
|
3681
3671
|
}
|
|
3682
3672
|
|
|
3683
3673
|
var _excluded = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"],
|
|
@@ -3689,7 +3679,7 @@ function useMultipleSelection(userProps) {
|
|
|
3689
3679
|
}
|
|
3690
3680
|
validatePropTypes(userProps, useMultipleSelection);
|
|
3691
3681
|
// Props defaults and destructuring.
|
|
3692
|
-
var props =
|
|
3682
|
+
var props = _extends({}, defaultProps, userProps);
|
|
3693
3683
|
var getA11yStatusMessage = props.getA11yStatusMessage,
|
|
3694
3684
|
environment = props.environment,
|
|
3695
3685
|
keyNavigationNext = props.keyNavigationNext,
|
|
@@ -3782,7 +3772,7 @@ function useMultipleSelection(userProps) {
|
|
|
3782
3772
|
onKeyDown = _ref3.onKeyDown,
|
|
3783
3773
|
selectedItemProp = _ref3.selectedItem,
|
|
3784
3774
|
indexProp = _ref3.index,
|
|
3785
|
-
rest =
|
|
3775
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
3786
3776
|
var latestState = latest.current.state;
|
|
3787
3777
|
var _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, 'Pass either item or index to getSelectedItemProps!'),
|
|
3788
3778
|
index = _getItemAndIndex[1];
|
|
@@ -3799,7 +3789,7 @@ function useMultipleSelection(userProps) {
|
|
|
3799
3789
|
selectedItemKeyDownHandlers[key](event);
|
|
3800
3790
|
}
|
|
3801
3791
|
};
|
|
3802
|
-
return
|
|
3792
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {
|
|
3803
3793
|
if (selectedItemNode) {
|
|
3804
3794
|
selectedItemRefs.current.push(selectedItemNode);
|
|
3805
3795
|
}
|
|
@@ -3815,7 +3805,7 @@ function useMultipleSelection(userProps) {
|
|
|
3815
3805
|
onClick = _ref4.onClick,
|
|
3816
3806
|
_ref4$preventKeyActio = _ref4.preventKeyAction,
|
|
3817
3807
|
preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,
|
|
3818
|
-
rest =
|
|
3808
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);
|
|
3819
3809
|
var _ref5 = _temp3 === void 0 ? {} : _temp3,
|
|
3820
3810
|
_ref5$suppressRefErro = _ref5.suppressRefError,
|
|
3821
3811
|
suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;
|
|
@@ -3831,7 +3821,7 @@ function useMultipleSelection(userProps) {
|
|
|
3831
3821
|
type: DropdownClick
|
|
3832
3822
|
});
|
|
3833
3823
|
};
|
|
3834
|
-
return
|
|
3824
|
+
return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {
|
|
3835
3825
|
if (dropdownNode) {
|
|
3836
3826
|
dropdownRef.current = dropdownNode;
|
|
3837
3827
|
}
|
|
@@ -3884,7 +3874,7 @@ function useMultipleSelection(userProps) {
|
|
|
3884
3874
|
};
|
|
3885
3875
|
}
|
|
3886
3876
|
|
|
3887
|
-
exports
|
|
3877
|
+
exports.default = Downshift$1;
|
|
3888
3878
|
exports.resetIdCounter = resetIdCounter;
|
|
3889
3879
|
exports.useCombobox = useCombobox;
|
|
3890
3880
|
exports.useMultipleSelection = useMultipleSelection;
|