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
|
@@ -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
|
/**
|
|
@@ -139,7 +129,7 @@ function generateId() {
|
|
|
139
129
|
*/
|
|
140
130
|
function resetIdCounter() {
|
|
141
131
|
// istanbul ignore next
|
|
142
|
-
if ('useId' in
|
|
132
|
+
if ('useId' in React) {
|
|
143
133
|
console.warn("It is not necessary to call resetIdCounter when using React 18+");
|
|
144
134
|
return;
|
|
145
135
|
}
|
|
@@ -454,23 +444,23 @@ var touchEnd = process.env.NODE_ENV !== "production" ? '__autocomplete_touchend_
|
|
|
454
444
|
|
|
455
445
|
var stateChangeTypes$3 = /*#__PURE__*/Object.freeze({
|
|
456
446
|
__proto__: null,
|
|
457
|
-
|
|
458
|
-
|
|
447
|
+
blurButton: blurButton,
|
|
448
|
+
blurInput: blurInput,
|
|
449
|
+
changeInput: changeInput,
|
|
450
|
+
clickButton: clickButton,
|
|
451
|
+
clickItem: clickItem,
|
|
452
|
+
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
459
453
|
itemMouseEnter: itemMouseEnter,
|
|
460
|
-
keyDownArrowUp: keyDownArrowUp,
|
|
461
454
|
keyDownArrowDown: keyDownArrowDown,
|
|
462
|
-
|
|
455
|
+
keyDownArrowUp: keyDownArrowUp,
|
|
456
|
+
keyDownEnd: keyDownEnd,
|
|
463
457
|
keyDownEnter: keyDownEnter,
|
|
458
|
+
keyDownEscape: keyDownEscape,
|
|
464
459
|
keyDownHome: keyDownHome,
|
|
465
|
-
keyDownEnd: keyDownEnd,
|
|
466
|
-
clickItem: clickItem,
|
|
467
|
-
blurInput: blurInput,
|
|
468
|
-
changeInput: changeInput,
|
|
469
460
|
keyDownSpaceButton: keyDownSpaceButton,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
touchEnd: touchEnd
|
|
461
|
+
mouseUp: mouseUp,
|
|
462
|
+
touchEnd: touchEnd,
|
|
463
|
+
unknown: unknown
|
|
474
464
|
});
|
|
475
465
|
|
|
476
466
|
var _excluded$3 = ["refKey", "ref"],
|
|
@@ -480,7 +470,6 @@ var _excluded$3 = ["refKey", "ref"],
|
|
|
480
470
|
_excluded5 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"];
|
|
481
471
|
var Downshift = /*#__PURE__*/function () {
|
|
482
472
|
var Downshift = /*#__PURE__*/function (_Component) {
|
|
483
|
-
_inheritsLoose__default["default"](Downshift, _Component);
|
|
484
473
|
function Downshift(_props) {
|
|
485
474
|
var _this;
|
|
486
475
|
_this = _Component.call(this, _props) || this;
|
|
@@ -534,7 +523,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
534
523
|
otherStateToSet = {};
|
|
535
524
|
}
|
|
536
525
|
otherStateToSet = pickState(otherStateToSet);
|
|
537
|
-
_this.internalSetState(
|
|
526
|
+
_this.internalSetState(_extends({
|
|
538
527
|
highlightedIndex: highlightedIndex
|
|
539
528
|
}, otherStateToSet));
|
|
540
529
|
};
|
|
@@ -548,7 +537,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
548
537
|
};
|
|
549
538
|
_this.selectItem = function (item, otherStateToSet, cb) {
|
|
550
539
|
otherStateToSet = pickState(otherStateToSet);
|
|
551
|
-
_this.internalSetState(
|
|
540
|
+
_this.internalSetState(_extends({
|
|
552
541
|
isOpen: _this.props.defaultIsOpen,
|
|
553
542
|
highlightedIndex: _this.props.defaultHighlightedIndex,
|
|
554
543
|
selectedItem: item,
|
|
@@ -584,7 +573,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
584
573
|
// preserving the cursor position.
|
|
585
574
|
// See https://github.com/downshift-js/downshift/issues/217 for more info.
|
|
586
575
|
if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {
|
|
587
|
-
_this.props.onInputValueChange(stateToSet.inputValue,
|
|
576
|
+
_this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet));
|
|
588
577
|
}
|
|
589
578
|
return _this.setState(function (state) {
|
|
590
579
|
var _newStateToSet;
|
|
@@ -632,7 +621,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
632
621
|
// if stateToSet is a function, then we weren't able to call onInputValueChange
|
|
633
622
|
// earlier, so we'll call it now that we know what the inputValue state will be.
|
|
634
623
|
if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {
|
|
635
|
-
_this.props.onInputValueChange(newStateToSet.inputValue,
|
|
624
|
+
_this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet));
|
|
636
625
|
}
|
|
637
626
|
return nextState;
|
|
638
627
|
}, function () {
|
|
@@ -666,7 +655,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
666
655
|
_ref$refKey = _ref.refKey,
|
|
667
656
|
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
|
|
668
657
|
ref = _ref.ref,
|
|
669
|
-
rest =
|
|
658
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
670
659
|
var _ref2 = _temp2 === void 0 ? {} : _temp2,
|
|
671
660
|
_ref2$suppressRefErro = _ref2.suppressRefError,
|
|
672
661
|
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
|
|
@@ -677,7 +666,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
677
666
|
_this.getRootProps.suppressRefError = suppressRefError;
|
|
678
667
|
var _this$getState = _this.getState(),
|
|
679
668
|
isOpen = _this$getState.isOpen;
|
|
680
|
-
return
|
|
669
|
+
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);
|
|
681
670
|
};
|
|
682
671
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\ ROOT
|
|
683
672
|
_this.keyDownHandlers = {
|
|
@@ -756,7 +745,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
756
745
|
},
|
|
757
746
|
Escape: function Escape(event) {
|
|
758
747
|
event.preventDefault();
|
|
759
|
-
this.reset(
|
|
748
|
+
this.reset(_extends({
|
|
760
749
|
type: keyDownEscape
|
|
761
750
|
}, !this.state.isOpen && {
|
|
762
751
|
selectedItem: null,
|
|
@@ -765,7 +754,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
765
754
|
}
|
|
766
755
|
};
|
|
767
756
|
//////////////////////////// BUTTON
|
|
768
|
-
_this.buttonKeyDownHandlers =
|
|
757
|
+
_this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
|
|
769
758
|
' ': function _(event) {
|
|
770
759
|
event.preventDefault();
|
|
771
760
|
this.toggleMenu({
|
|
@@ -773,7 +762,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
773
762
|
});
|
|
774
763
|
}
|
|
775
764
|
});
|
|
776
|
-
_this.inputKeyDownHandlers =
|
|
765
|
+
_this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
|
|
777
766
|
Home: function Home(event) {
|
|
778
767
|
var _this$getState3 = this.getState(),
|
|
779
768
|
isOpen = _this$getState3.isOpen;
|
|
@@ -822,7 +811,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
822
811
|
_ref3.onKeyDown;
|
|
823
812
|
_ref3.onKeyUp;
|
|
824
813
|
_ref3.onBlur;
|
|
825
|
-
var rest =
|
|
814
|
+
var rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
826
815
|
var _this$getState5 = _this.getState(),
|
|
827
816
|
isOpen = _this$getState5.isOpen;
|
|
828
817
|
var enabledEventHandlers = /* istanbul ignore next (react-native) */
|
|
@@ -830,7 +819,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
830
819
|
onPress: callAllEventHandlers(onPress, _this.buttonHandleClick)
|
|
831
820
|
} ;
|
|
832
821
|
var eventHandlers = rest.disabled ? {} : enabledEventHandlers;
|
|
833
|
-
return
|
|
822
|
+
return _extends({
|
|
834
823
|
type: 'button',
|
|
835
824
|
role: 'button',
|
|
836
825
|
'aria-label': isOpen ? 'close menu' : 'open menu',
|
|
@@ -845,7 +834,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
845
834
|
_this.buttonHandleKeyDown = function (event) {
|
|
846
835
|
var key = normalizeArrowKey(event);
|
|
847
836
|
if (_this.buttonKeyDownHandlers[key]) {
|
|
848
|
-
_this.buttonKeyDownHandlers[key].call(
|
|
837
|
+
_this.buttonKeyDownHandlers[key].call(_this, event);
|
|
849
838
|
}
|
|
850
839
|
};
|
|
851
840
|
_this.buttonHandleClick = function (event) {
|
|
@@ -885,7 +874,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
885
874
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BUTTON
|
|
886
875
|
/////////////////////////////// LABEL
|
|
887
876
|
_this.getLabelProps = function (props) {
|
|
888
|
-
return
|
|
877
|
+
return _extends({
|
|
889
878
|
htmlFor: _this.inputId,
|
|
890
879
|
id: _this.labelId
|
|
891
880
|
}, props);
|
|
@@ -899,7 +888,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
899
888
|
onChange = _ref4.onChange,
|
|
900
889
|
onInput = _ref4.onInput,
|
|
901
890
|
onChangeText = _ref4.onChangeText,
|
|
902
|
-
rest =
|
|
891
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$2);
|
|
903
892
|
var onChangeKey;
|
|
904
893
|
var eventHandlers = {};
|
|
905
894
|
|
|
@@ -930,7 +919,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
930
919
|
onBlur: callAllEventHandlers(onBlur, _this.inputHandleBlur)
|
|
931
920
|
};
|
|
932
921
|
}
|
|
933
|
-
return
|
|
922
|
+
return _extends({
|
|
934
923
|
'aria-autocomplete': 'list',
|
|
935
924
|
'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : undefined,
|
|
936
925
|
'aria-controls': isOpen ? _this.menuId : undefined,
|
|
@@ -945,7 +934,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
945
934
|
_this.inputHandleKeyDown = function (event) {
|
|
946
935
|
var key = normalizeArrowKey(event);
|
|
947
936
|
if (key && _this.inputKeyDownHandlers[key]) {
|
|
948
|
-
_this.inputKeyDownHandlers[key].call(
|
|
937
|
+
_this.inputKeyDownHandlers[key].call(_this, event);
|
|
949
938
|
}
|
|
950
939
|
};
|
|
951
940
|
_this.inputHandleChange = function (event) {
|
|
@@ -983,14 +972,14 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
983
972
|
_ref5$refKey = _ref5.refKey,
|
|
984
973
|
refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
|
|
985
974
|
ref = _ref5.ref,
|
|
986
|
-
props =
|
|
975
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);
|
|
987
976
|
var _ref6 = _temp6 === void 0 ? {} : _temp6,
|
|
988
977
|
_ref6$suppressRefErro = _ref6.suppressRefError,
|
|
989
978
|
suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;
|
|
990
979
|
_this.getMenuProps.called = true;
|
|
991
980
|
_this.getMenuProps.refKey = refKey;
|
|
992
981
|
_this.getMenuProps.suppressRefError = suppressRefError;
|
|
993
|
-
return
|
|
982
|
+
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);
|
|
994
983
|
};
|
|
995
984
|
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ MENU
|
|
996
985
|
/////////////////////////////// ITEM
|
|
@@ -1004,7 +993,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1004
993
|
index = _ref7.index,
|
|
1005
994
|
_ref7$item = _ref7.item,
|
|
1006
995
|
item = _ref7$item === void 0 ? process.env.NODE_ENV === 'production' ? /* istanbul ignore next */undefined : requiredProp('getItemProps', 'item') : _ref7$item,
|
|
1007
|
-
rest =
|
|
996
|
+
rest = _objectWithoutPropertiesLoose(_ref7, _excluded5);
|
|
1008
997
|
if (index === undefined) {
|
|
1009
998
|
_this.items.push(item);
|
|
1010
999
|
index = _this.items.indexOf(item);
|
|
@@ -1051,7 +1040,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1051
1040
|
var eventHandlers = rest.disabled ? {
|
|
1052
1041
|
onMouseDown: enabledEventHandlers.onMouseDown
|
|
1053
1042
|
} : enabledEventHandlers;
|
|
1054
|
-
return
|
|
1043
|
+
return _extends({
|
|
1055
1044
|
id: _this.getItemId(index),
|
|
1056
1045
|
role: 'option',
|
|
1057
1046
|
'aria-selected': _this.getState().highlightedIndex === index
|
|
@@ -1068,7 +1057,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1068
1057
|
otherStateToSet = pickState(otherStateToSet);
|
|
1069
1058
|
_this.internalSetState(function (_ref8) {
|
|
1070
1059
|
var selectedItem = _ref8.selectedItem;
|
|
1071
|
-
return
|
|
1060
|
+
return _extends({
|
|
1072
1061
|
isOpen: _this.props.defaultIsOpen,
|
|
1073
1062
|
highlightedIndex: _this.props.defaultHighlightedIndex,
|
|
1074
1063
|
inputValue: _this.props.itemToString(selectedItem)
|
|
@@ -1082,7 +1071,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1082
1071
|
otherStateToSet = pickState(otherStateToSet);
|
|
1083
1072
|
_this.internalSetState(function (_ref9) {
|
|
1084
1073
|
var isOpen = _ref9.isOpen;
|
|
1085
|
-
return
|
|
1074
|
+
return _extends({
|
|
1086
1075
|
isOpen: !isOpen
|
|
1087
1076
|
}, isOpen && {
|
|
1088
1077
|
highlightedIndex: _this.props.defaultHighlightedIndex
|
|
@@ -1117,7 +1106,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1117
1106
|
var state = _this.getState();
|
|
1118
1107
|
var item = _this.items[state.highlightedIndex];
|
|
1119
1108
|
var resultCount = _this.getItemCount();
|
|
1120
|
-
var status = _this.props.getA11yStatusMessage(
|
|
1109
|
+
var status = _this.props.getA11yStatusMessage(_extends({
|
|
1121
1110
|
itemToString: _this.props.itemToString,
|
|
1122
1111
|
previousResultCount: _this.previousResultCount,
|
|
1123
1112
|
resultCount: resultCount,
|
|
@@ -1149,6 +1138,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1149
1138
|
_this.state = _state;
|
|
1150
1139
|
return _this;
|
|
1151
1140
|
}
|
|
1141
|
+
_inheritsLoose(Downshift, _Component);
|
|
1152
1142
|
var _proto = Downshift.prototype;
|
|
1153
1143
|
/**
|
|
1154
1144
|
* Clear all running timeouts
|
|
@@ -1388,49 +1378,49 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1388
1378
|
return Downshift;
|
|
1389
1379
|
}();
|
|
1390
1380
|
process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
1391
|
-
children:
|
|
1392
|
-
defaultHighlightedIndex:
|
|
1393
|
-
defaultIsOpen:
|
|
1394
|
-
initialHighlightedIndex:
|
|
1395
|
-
initialSelectedItem:
|
|
1396
|
-
initialInputValue:
|
|
1397
|
-
initialIsOpen:
|
|
1398
|
-
getA11yStatusMessage:
|
|
1399
|
-
itemToString:
|
|
1400
|
-
onChange:
|
|
1401
|
-
onSelect:
|
|
1402
|
-
onStateChange:
|
|
1403
|
-
onInputValueChange:
|
|
1404
|
-
onUserAction:
|
|
1405
|
-
onOuterClick:
|
|
1406
|
-
selectedItemChanged:
|
|
1407
|
-
stateReducer:
|
|
1408
|
-
itemCount:
|
|
1409
|
-
id:
|
|
1410
|
-
environment:
|
|
1411
|
-
addEventListener:
|
|
1412
|
-
removeEventListener:
|
|
1413
|
-
document:
|
|
1414
|
-
createElement:
|
|
1415
|
-
getElementById:
|
|
1416
|
-
activeElement:
|
|
1417
|
-
body:
|
|
1381
|
+
children: PropTypes.func,
|
|
1382
|
+
defaultHighlightedIndex: PropTypes.number,
|
|
1383
|
+
defaultIsOpen: PropTypes.bool,
|
|
1384
|
+
initialHighlightedIndex: PropTypes.number,
|
|
1385
|
+
initialSelectedItem: PropTypes.any,
|
|
1386
|
+
initialInputValue: PropTypes.string,
|
|
1387
|
+
initialIsOpen: PropTypes.bool,
|
|
1388
|
+
getA11yStatusMessage: PropTypes.func,
|
|
1389
|
+
itemToString: PropTypes.func,
|
|
1390
|
+
onChange: PropTypes.func,
|
|
1391
|
+
onSelect: PropTypes.func,
|
|
1392
|
+
onStateChange: PropTypes.func,
|
|
1393
|
+
onInputValueChange: PropTypes.func,
|
|
1394
|
+
onUserAction: PropTypes.func,
|
|
1395
|
+
onOuterClick: PropTypes.func,
|
|
1396
|
+
selectedItemChanged: PropTypes.func,
|
|
1397
|
+
stateReducer: PropTypes.func,
|
|
1398
|
+
itemCount: PropTypes.number,
|
|
1399
|
+
id: PropTypes.string,
|
|
1400
|
+
environment: PropTypes.shape({
|
|
1401
|
+
addEventListener: PropTypes.func.isRequired,
|
|
1402
|
+
removeEventListener: PropTypes.func.isRequired,
|
|
1403
|
+
document: PropTypes.shape({
|
|
1404
|
+
createElement: PropTypes.func.isRequired,
|
|
1405
|
+
getElementById: PropTypes.func.isRequired,
|
|
1406
|
+
activeElement: PropTypes.any.isRequired,
|
|
1407
|
+
body: PropTypes.any.isRequired
|
|
1418
1408
|
}).isRequired,
|
|
1419
|
-
Node:
|
|
1409
|
+
Node: PropTypes.func.isRequired
|
|
1420
1410
|
}),
|
|
1421
|
-
suppressRefError:
|
|
1422
|
-
scrollIntoView:
|
|
1411
|
+
suppressRefError: PropTypes.bool,
|
|
1412
|
+
scrollIntoView: PropTypes.func,
|
|
1423
1413
|
// things we keep in state for uncontrolled components
|
|
1424
1414
|
// but can accept as props for controlled components
|
|
1425
1415
|
/* eslint-disable react/no-unused-prop-types */
|
|
1426
|
-
selectedItem:
|
|
1427
|
-
isOpen:
|
|
1428
|
-
inputValue:
|
|
1429
|
-
highlightedIndex:
|
|
1430
|
-
labelId:
|
|
1431
|
-
inputId:
|
|
1432
|
-
menuId:
|
|
1433
|
-
getItemId:
|
|
1416
|
+
selectedItem: PropTypes.any,
|
|
1417
|
+
isOpen: PropTypes.bool,
|
|
1418
|
+
inputValue: PropTypes.string,
|
|
1419
|
+
highlightedIndex: PropTypes.number,
|
|
1420
|
+
labelId: PropTypes.string,
|
|
1421
|
+
inputId: PropTypes.string,
|
|
1422
|
+
menuId: PropTypes.string,
|
|
1423
|
+
getItemId: PropTypes.func
|
|
1434
1424
|
/* eslint-enable react/no-unused-prop-types */
|
|
1435
1425
|
} : void 0;
|
|
1436
1426
|
var Downshift$1 = Downshift;
|
|
@@ -1475,7 +1465,7 @@ function callOnChangeProps(action, state, newState) {
|
|
|
1475
1465
|
}
|
|
1476
1466
|
});
|
|
1477
1467
|
if (props.onStateChange && Object.keys(changes).length) {
|
|
1478
|
-
props.onStateChange(
|
|
1468
|
+
props.onStateChange(_extends({
|
|
1479
1469
|
type: type
|
|
1480
1470
|
}, changes));
|
|
1481
1471
|
}
|
|
@@ -1485,7 +1475,7 @@ function invokeOnChangeHandler(key, action, state, newState) {
|
|
|
1485
1475
|
type = action.type;
|
|
1486
1476
|
var handler = "on" + capitalizeString(key) + "Change";
|
|
1487
1477
|
if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {
|
|
1488
|
-
props[handler](
|
|
1478
|
+
props[handler](_extends({
|
|
1489
1479
|
type: type
|
|
1490
1480
|
}, newState));
|
|
1491
1481
|
}
|
|
@@ -1513,7 +1503,7 @@ var updateA11yStatus = debounce(function (status, document) {
|
|
|
1513
1503
|
var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
1514
1504
|
|
|
1515
1505
|
// istanbul ignore next
|
|
1516
|
-
var useElementIds = 'useId' in
|
|
1506
|
+
var useElementIds = 'useId' in React // Avoid conditional useId call
|
|
1517
1507
|
? function useElementIds(_ref) {
|
|
1518
1508
|
var id = _ref.id,
|
|
1519
1509
|
labelId = _ref.labelId,
|
|
@@ -1522,7 +1512,7 @@ var useElementIds = 'useId' in React__default["default"] // Avoid conditional us
|
|
|
1522
1512
|
toggleButtonId = _ref.toggleButtonId,
|
|
1523
1513
|
inputId = _ref.inputId;
|
|
1524
1514
|
// Avoid conditional useId call
|
|
1525
|
-
var reactId = "downshift-" +
|
|
1515
|
+
var reactId = "downshift-" + React.useId();
|
|
1526
1516
|
if (!id) {
|
|
1527
1517
|
id = reactId;
|
|
1528
1518
|
}
|
|
@@ -1601,7 +1591,7 @@ function useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {
|
|
|
1601
1591
|
actionRef.current = action;
|
|
1602
1592
|
state = getState(state, action.props);
|
|
1603
1593
|
var changes = reducer(state, action);
|
|
1604
|
-
var newState = action.props.stateReducer(state,
|
|
1594
|
+
var newState = action.props.stateReducer(state, _extends({}, action, {
|
|
1605
1595
|
changes: changes
|
|
1606
1596
|
}));
|
|
1607
1597
|
return newState;
|
|
@@ -1611,7 +1601,7 @@ function useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {
|
|
|
1611
1601
|
dispatch = _useReducer[1];
|
|
1612
1602
|
var propsRef = useLatestRef(props);
|
|
1613
1603
|
var dispatchWithProps = React.useCallback(function (action) {
|
|
1614
|
-
return dispatch(
|
|
1604
|
+
return dispatch(_extends({
|
|
1615
1605
|
props: propsRef.current
|
|
1616
1606
|
}, action));
|
|
1617
1607
|
}, [propsRef]);
|
|
@@ -1891,10 +1881,10 @@ function getChangesOnSelection(props, highlightedIndex, inputValue) {
|
|
|
1891
1881
|
inputValue = true;
|
|
1892
1882
|
}
|
|
1893
1883
|
var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0;
|
|
1894
|
-
return
|
|
1884
|
+
return _extends({
|
|
1895
1885
|
isOpen: false,
|
|
1896
1886
|
highlightedIndex: -1
|
|
1897
|
-
}, shouldSelect &&
|
|
1887
|
+
}, shouldSelect && _extends({
|
|
1898
1888
|
selectedItem: props.items[highlightedIndex],
|
|
1899
1889
|
isOpen: getDefaultValue$1(props, 'isOpen'),
|
|
1900
1890
|
highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')
|
|
@@ -1919,8 +1909,8 @@ function isDropdownsStateEqual(prevState, newState) {
|
|
|
1919
1909
|
* Tracks if it's the first render.
|
|
1920
1910
|
*/
|
|
1921
1911
|
function useIsInitialMount() {
|
|
1922
|
-
var isInitialMountRef =
|
|
1923
|
-
|
|
1912
|
+
var isInitialMountRef = React.useRef(true);
|
|
1913
|
+
React.useEffect(function () {
|
|
1924
1914
|
isInitialMountRef.current = false;
|
|
1925
1915
|
return function () {
|
|
1926
1916
|
isInitialMountRef.current = true;
|
|
@@ -1959,44 +1949,44 @@ function getInitialHighlightedIndex(props) {
|
|
|
1959
1949
|
|
|
1960
1950
|
// Shared between all exports.
|
|
1961
1951
|
var commonPropTypes = {
|
|
1962
|
-
environment:
|
|
1963
|
-
addEventListener:
|
|
1964
|
-
removeEventListener:
|
|
1965
|
-
document:
|
|
1966
|
-
createElement:
|
|
1967
|
-
getElementById:
|
|
1968
|
-
activeElement:
|
|
1969
|
-
body:
|
|
1952
|
+
environment: PropTypes.shape({
|
|
1953
|
+
addEventListener: PropTypes.func.isRequired,
|
|
1954
|
+
removeEventListener: PropTypes.func.isRequired,
|
|
1955
|
+
document: PropTypes.shape({
|
|
1956
|
+
createElement: PropTypes.func.isRequired,
|
|
1957
|
+
getElementById: PropTypes.func.isRequired,
|
|
1958
|
+
activeElement: PropTypes.any.isRequired,
|
|
1959
|
+
body: PropTypes.any.isRequired
|
|
1970
1960
|
}).isRequired,
|
|
1971
|
-
Node:
|
|
1961
|
+
Node: PropTypes.func.isRequired
|
|
1972
1962
|
}),
|
|
1973
|
-
itemToString:
|
|
1974
|
-
itemToKey:
|
|
1975
|
-
stateReducer:
|
|
1963
|
+
itemToString: PropTypes.func,
|
|
1964
|
+
itemToKey: PropTypes.func,
|
|
1965
|
+
stateReducer: PropTypes.func
|
|
1976
1966
|
};
|
|
1977
1967
|
|
|
1978
1968
|
// Shared between useSelect, useCombobox, Downshift.
|
|
1979
|
-
var commonDropdownPropTypes =
|
|
1980
|
-
getA11yStatusMessage:
|
|
1981
|
-
highlightedIndex:
|
|
1982
|
-
defaultHighlightedIndex:
|
|
1983
|
-
initialHighlightedIndex:
|
|
1984
|
-
isOpen:
|
|
1985
|
-
defaultIsOpen:
|
|
1986
|
-
initialIsOpen:
|
|
1987
|
-
selectedItem:
|
|
1988
|
-
initialSelectedItem:
|
|
1989
|
-
defaultSelectedItem:
|
|
1990
|
-
id:
|
|
1991
|
-
labelId:
|
|
1992
|
-
menuId:
|
|
1993
|
-
getItemId:
|
|
1994
|
-
toggleButtonId:
|
|
1995
|
-
onSelectedItemChange:
|
|
1996
|
-
onHighlightedIndexChange:
|
|
1997
|
-
onStateChange:
|
|
1998
|
-
onIsOpenChange:
|
|
1999
|
-
scrollIntoView:
|
|
1969
|
+
var commonDropdownPropTypes = _extends({}, commonPropTypes, {
|
|
1970
|
+
getA11yStatusMessage: PropTypes.func,
|
|
1971
|
+
highlightedIndex: PropTypes.number,
|
|
1972
|
+
defaultHighlightedIndex: PropTypes.number,
|
|
1973
|
+
initialHighlightedIndex: PropTypes.number,
|
|
1974
|
+
isOpen: PropTypes.bool,
|
|
1975
|
+
defaultIsOpen: PropTypes.bool,
|
|
1976
|
+
initialIsOpen: PropTypes.bool,
|
|
1977
|
+
selectedItem: PropTypes.any,
|
|
1978
|
+
initialSelectedItem: PropTypes.any,
|
|
1979
|
+
defaultSelectedItem: PropTypes.any,
|
|
1980
|
+
id: PropTypes.string,
|
|
1981
|
+
labelId: PropTypes.string,
|
|
1982
|
+
menuId: PropTypes.string,
|
|
1983
|
+
getItemId: PropTypes.func,
|
|
1984
|
+
toggleButtonId: PropTypes.string,
|
|
1985
|
+
onSelectedItemChange: PropTypes.func,
|
|
1986
|
+
onHighlightedIndexChange: PropTypes.func,
|
|
1987
|
+
onStateChange: PropTypes.func,
|
|
1988
|
+
onIsOpenChange: PropTypes.func,
|
|
1989
|
+
scrollIntoView: PropTypes.func
|
|
2000
1990
|
});
|
|
2001
1991
|
|
|
2002
1992
|
function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
@@ -2053,7 +2043,7 @@ function downshiftCommonReducer(state, action, stateChangeTypes) {
|
|
|
2053
2043
|
default:
|
|
2054
2044
|
throw new Error('Reducer called without proper action type.');
|
|
2055
2045
|
}
|
|
2056
|
-
return
|
|
2046
|
+
return _extends({}, state, changes);
|
|
2057
2047
|
}
|
|
2058
2048
|
/* eslint-enable complexity */
|
|
2059
2049
|
|
|
@@ -2072,7 +2062,7 @@ function getItemIndexByCharacterKey(_a) {
|
|
|
2072
2062
|
}
|
|
2073
2063
|
return highlightedIndex;
|
|
2074
2064
|
}
|
|
2075
|
-
var propTypes$2 = tslib.__assign(tslib.__assign({}, commonDropdownPropTypes), { items:
|
|
2065
|
+
var propTypes$2 = tslib.__assign(tslib.__assign({}, commonDropdownPropTypes), { items: PropTypes.array.isRequired, isItemDisabled: PropTypes.func });
|
|
2076
2066
|
var defaultProps$2 = tslib.__assign(tslib.__assign({}, defaultProps$3), { isItemDisabled: function () {
|
|
2077
2067
|
return false;
|
|
2078
2068
|
} });
|
|
@@ -2081,7 +2071,7 @@ var validatePropTypes$2 = noop;
|
|
|
2081
2071
|
/* istanbul ignore next */
|
|
2082
2072
|
if (process.env.NODE_ENV !== 'production') {
|
|
2083
2073
|
validatePropTypes$2 = function (options, caller) {
|
|
2084
|
-
|
|
2074
|
+
PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);
|
|
2085
2075
|
};
|
|
2086
2076
|
}
|
|
2087
2077
|
|
|
@@ -2110,28 +2100,28 @@ var FunctionReset$2 = process.env.NODE_ENV !== "production" ? '__function_reset_
|
|
|
2110
2100
|
|
|
2111
2101
|
var stateChangeTypes$2 = /*#__PURE__*/Object.freeze({
|
|
2112
2102
|
__proto__: null,
|
|
2103
|
+
FunctionCloseMenu: FunctionCloseMenu$1,
|
|
2104
|
+
FunctionOpenMenu: FunctionOpenMenu$1,
|
|
2105
|
+
FunctionReset: FunctionReset$2,
|
|
2106
|
+
FunctionSelectItem: FunctionSelectItem$1,
|
|
2107
|
+
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
|
|
2108
|
+
FunctionSetInputValue: FunctionSetInputValue$1,
|
|
2109
|
+
FunctionToggleMenu: FunctionToggleMenu$1,
|
|
2110
|
+
ItemClick: ItemClick$1,
|
|
2111
|
+
ItemMouseMove: ItemMouseMove$1,
|
|
2112
|
+
MenuMouseLeave: MenuMouseLeave$1,
|
|
2113
|
+
ToggleButtonBlur: ToggleButtonBlur,
|
|
2113
2114
|
ToggleButtonClick: ToggleButtonClick$1,
|
|
2114
2115
|
ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,
|
|
2115
2116
|
ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,
|
|
2116
2117
|
ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,
|
|
2117
|
-
ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,
|
|
2118
|
-
ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,
|
|
2119
2118
|
ToggleButtonKeyDownEnd: ToggleButtonKeyDownEnd,
|
|
2120
2119
|
ToggleButtonKeyDownEnter: ToggleButtonKeyDownEnter,
|
|
2121
|
-
|
|
2122
|
-
|
|
2120
|
+
ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,
|
|
2121
|
+
ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,
|
|
2123
2122
|
ToggleButtonKeyDownPageDown: ToggleButtonKeyDownPageDown,
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
ItemMouseMove: ItemMouseMove$1,
|
|
2127
|
-
ItemClick: ItemClick$1,
|
|
2128
|
-
FunctionToggleMenu: FunctionToggleMenu$1,
|
|
2129
|
-
FunctionOpenMenu: FunctionOpenMenu$1,
|
|
2130
|
-
FunctionCloseMenu: FunctionCloseMenu$1,
|
|
2131
|
-
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
|
|
2132
|
-
FunctionSelectItem: FunctionSelectItem$1,
|
|
2133
|
-
FunctionSetInputValue: FunctionSetInputValue$1,
|
|
2134
|
-
FunctionReset: FunctionReset$2
|
|
2123
|
+
ToggleButtonKeyDownPageUp: ToggleButtonKeyDownPageUp,
|
|
2124
|
+
ToggleButtonKeyDownSpaceButton: ToggleButtonKeyDownSpaceButton
|
|
2135
2125
|
});
|
|
2136
2126
|
|
|
2137
2127
|
/* eslint-disable complexity */
|
|
@@ -2224,7 +2214,7 @@ function downshiftSelectReducer(state, action) {
|
|
|
2224
2214
|
};
|
|
2225
2215
|
break;
|
|
2226
2216
|
case ToggleButtonBlur:
|
|
2227
|
-
changes =
|
|
2217
|
+
changes = _extends({
|
|
2228
2218
|
isOpen: false,
|
|
2229
2219
|
highlightedIndex: -1
|
|
2230
2220
|
}, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && {
|
|
@@ -2239,7 +2229,7 @@ function downshiftSelectReducer(state, action) {
|
|
|
2239
2229
|
default:
|
|
2240
2230
|
return downshiftCommonReducer(state, action, stateChangeTypes$2);
|
|
2241
2231
|
}
|
|
2242
|
-
return
|
|
2232
|
+
return _extends({}, state, changes);
|
|
2243
2233
|
}
|
|
2244
2234
|
/* eslint-enable complexity */
|
|
2245
2235
|
|
|
@@ -2254,7 +2244,7 @@ function useSelect(userProps) {
|
|
|
2254
2244
|
}
|
|
2255
2245
|
validatePropTypes$2(userProps, useSelect);
|
|
2256
2246
|
// Props defaults and destructuring.
|
|
2257
|
-
var props =
|
|
2247
|
+
var props = _extends({}, defaultProps$2, userProps);
|
|
2258
2248
|
var scrollIntoView = props.scrollIntoView,
|
|
2259
2249
|
environment = props.environment,
|
|
2260
2250
|
getA11yStatusMessage = props.getA11yStatusMessage;
|
|
@@ -2340,7 +2330,7 @@ function useSelect(userProps) {
|
|
|
2340
2330
|
}
|
|
2341
2331
|
}, [dispatch, latest]), React.useMemo(function () {
|
|
2342
2332
|
return [menuRef, toggleButtonRef];
|
|
2343
|
-
}, []));
|
|
2333
|
+
}, [menuRef.current, toggleButtonRef.current]));
|
|
2344
2334
|
var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps');
|
|
2345
2335
|
// Reset itemRefs on close.
|
|
2346
2336
|
React.useEffect(function () {
|
|
@@ -2473,12 +2463,12 @@ function useSelect(userProps) {
|
|
|
2473
2463
|
var getLabelProps = React.useCallback(function (_temp) {
|
|
2474
2464
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
2475
2465
|
onClick = _ref.onClick,
|
|
2476
|
-
labelProps =
|
|
2466
|
+
labelProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2477
2467
|
var labelHandleClick = function labelHandleClick() {
|
|
2478
2468
|
var _toggleButtonRef$curr;
|
|
2479
2469
|
(_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus();
|
|
2480
2470
|
};
|
|
2481
|
-
return
|
|
2471
|
+
return _extends({
|
|
2482
2472
|
id: elementIds.labelId,
|
|
2483
2473
|
htmlFor: elementIds.toggleButtonId,
|
|
2484
2474
|
onClick: callAllEventHandlers(onClick, labelHandleClick)
|
|
@@ -2491,7 +2481,7 @@ function useSelect(userProps) {
|
|
|
2491
2481
|
_ref2$refKey = _ref2.refKey,
|
|
2492
2482
|
refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,
|
|
2493
2483
|
ref = _ref2.ref,
|
|
2494
|
-
rest =
|
|
2484
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
2495
2485
|
var _ref3 = _temp3 === void 0 ? {} : _temp3,
|
|
2496
2486
|
_ref3$suppressRefErro = _ref3.suppressRefError,
|
|
2497
2487
|
suppressRefError = _ref3$suppressRefErro === void 0 ? false : _ref3$suppressRefErro;
|
|
@@ -2501,7 +2491,7 @@ function useSelect(userProps) {
|
|
|
2501
2491
|
});
|
|
2502
2492
|
};
|
|
2503
2493
|
setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
|
|
2504
|
-
return
|
|
2494
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
|
|
2505
2495
|
menuRef.current = menuNode;
|
|
2506
2496
|
}), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : "" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends2), rest);
|
|
2507
2497
|
}, [dispatch, setGetterPropCallInfo, elementIds]);
|
|
@@ -2515,7 +2505,7 @@ function useSelect(userProps) {
|
|
|
2515
2505
|
var _ref4$refKey = _ref4.refKey,
|
|
2516
2506
|
refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,
|
|
2517
2507
|
ref = _ref4.ref,
|
|
2518
|
-
rest =
|
|
2508
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$1);
|
|
2519
2509
|
var _ref5 = _temp5 === void 0 ? {} : _temp5,
|
|
2520
2510
|
_ref5$suppressRefErro = _ref5.suppressRefError,
|
|
2521
2511
|
suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;
|
|
@@ -2532,7 +2522,7 @@ function useSelect(userProps) {
|
|
|
2532
2522
|
});
|
|
2533
2523
|
}
|
|
2534
2524
|
};
|
|
2535
|
-
var toggleProps =
|
|
2525
|
+
var toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {
|
|
2536
2526
|
toggleButtonRef.current = toggleButtonNode;
|
|
2537
2527
|
}), _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);
|
|
2538
2528
|
if (!rest.disabled) {
|
|
@@ -2557,7 +2547,7 @@ function useSelect(userProps) {
|
|
|
2557
2547
|
refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,
|
|
2558
2548
|
disabledProp = _ref6.disabled,
|
|
2559
2549
|
ref = _ref6.ref,
|
|
2560
|
-
rest =
|
|
2550
|
+
rest = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
|
|
2561
2551
|
if (disabledProp !== undefined) {
|
|
2562
2552
|
console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');
|
|
2563
2553
|
}
|
|
@@ -2589,7 +2579,7 @@ function useSelect(userProps) {
|
|
|
2589
2579
|
return e.preventDefault();
|
|
2590
2580
|
}; // keep focus on the toggle after item click select.
|
|
2591
2581
|
|
|
2592
|
-
var itemProps =
|
|
2582
|
+
var itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (itemNode) {
|
|
2593
2583
|
if (itemNode) {
|
|
2594
2584
|
itemRefs.current[elementIds.getItemId(index)] = itemNode;
|
|
2595
2585
|
}
|
|
@@ -2652,29 +2642,29 @@ var ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== "production" ?
|
|
|
2652
2642
|
|
|
2653
2643
|
var stateChangeTypes$1 = /*#__PURE__*/Object.freeze({
|
|
2654
2644
|
__proto__: null,
|
|
2645
|
+
ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem,
|
|
2646
|
+
FunctionCloseMenu: FunctionCloseMenu,
|
|
2647
|
+
FunctionOpenMenu: FunctionOpenMenu,
|
|
2648
|
+
FunctionReset: FunctionReset$1,
|
|
2649
|
+
FunctionSelectItem: FunctionSelectItem,
|
|
2650
|
+
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,
|
|
2651
|
+
FunctionSetInputValue: FunctionSetInputValue,
|
|
2652
|
+
FunctionToggleMenu: FunctionToggleMenu,
|
|
2653
|
+
InputBlur: InputBlur,
|
|
2654
|
+
InputChange: InputChange,
|
|
2655
|
+
InputClick: InputClick,
|
|
2655
2656
|
InputKeyDownArrowDown: InputKeyDownArrowDown,
|
|
2656
2657
|
InputKeyDownArrowUp: InputKeyDownArrowUp,
|
|
2658
|
+
InputKeyDownEnd: InputKeyDownEnd,
|
|
2659
|
+
InputKeyDownEnter: InputKeyDownEnter,
|
|
2657
2660
|
InputKeyDownEscape: InputKeyDownEscape,
|
|
2658
2661
|
InputKeyDownHome: InputKeyDownHome,
|
|
2659
|
-
InputKeyDownEnd: InputKeyDownEnd,
|
|
2660
|
-
InputKeyDownPageUp: InputKeyDownPageUp,
|
|
2661
2662
|
InputKeyDownPageDown: InputKeyDownPageDown,
|
|
2662
|
-
|
|
2663
|
-
InputChange: InputChange,
|
|
2664
|
-
InputBlur: InputBlur,
|
|
2665
|
-
InputClick: InputClick,
|
|
2666
|
-
MenuMouseLeave: MenuMouseLeave,
|
|
2667
|
-
ItemMouseMove: ItemMouseMove,
|
|
2663
|
+
InputKeyDownPageUp: InputKeyDownPageUp,
|
|
2668
2664
|
ItemClick: ItemClick,
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
FunctionCloseMenu: FunctionCloseMenu,
|
|
2673
|
-
FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,
|
|
2674
|
-
FunctionSelectItem: FunctionSelectItem,
|
|
2675
|
-
FunctionSetInputValue: FunctionSetInputValue,
|
|
2676
|
-
FunctionReset: FunctionReset$1,
|
|
2677
|
-
ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem
|
|
2665
|
+
ItemMouseMove: ItemMouseMove,
|
|
2666
|
+
MenuMouseLeave: MenuMouseLeave,
|
|
2667
|
+
ToggleButtonClick: ToggleButtonClick
|
|
2678
2668
|
});
|
|
2679
2669
|
|
|
2680
2670
|
function getInitialState$1(props) {
|
|
@@ -2684,18 +2674,18 @@ function getInitialState$1(props) {
|
|
|
2684
2674
|
if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {
|
|
2685
2675
|
inputValue = props.itemToString(selectedItem);
|
|
2686
2676
|
}
|
|
2687
|
-
return
|
|
2677
|
+
return _extends({}, initialState, {
|
|
2688
2678
|
inputValue: inputValue
|
|
2689
2679
|
});
|
|
2690
2680
|
}
|
|
2691
|
-
var propTypes$1 =
|
|
2692
|
-
items:
|
|
2693
|
-
isItemDisabled:
|
|
2694
|
-
inputValue:
|
|
2695
|
-
defaultInputValue:
|
|
2696
|
-
initialInputValue:
|
|
2697
|
-
inputId:
|
|
2698
|
-
onInputValueChange:
|
|
2681
|
+
var propTypes$1 = _extends({}, commonDropdownPropTypes, {
|
|
2682
|
+
items: PropTypes.array.isRequired,
|
|
2683
|
+
isItemDisabled: PropTypes.func,
|
|
2684
|
+
inputValue: PropTypes.string,
|
|
2685
|
+
defaultInputValue: PropTypes.string,
|
|
2686
|
+
initialInputValue: PropTypes.string,
|
|
2687
|
+
inputId: PropTypes.string,
|
|
2688
|
+
onInputValueChange: PropTypes.func
|
|
2699
2689
|
});
|
|
2700
2690
|
|
|
2701
2691
|
/**
|
|
@@ -2742,10 +2732,10 @@ var validatePropTypes$1 = noop;
|
|
|
2742
2732
|
/* istanbul ignore next */
|
|
2743
2733
|
if (process.env.NODE_ENV !== 'production') {
|
|
2744
2734
|
validatePropTypes$1 = function validatePropTypes(options, caller) {
|
|
2745
|
-
|
|
2735
|
+
PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);
|
|
2746
2736
|
};
|
|
2747
2737
|
}
|
|
2748
|
-
var defaultProps$1 =
|
|
2738
|
+
var defaultProps$1 = _extends({}, defaultProps$3, {
|
|
2749
2739
|
isItemDisabled: function isItemDisabled() {
|
|
2750
2740
|
return false;
|
|
2751
2741
|
}
|
|
@@ -2799,7 +2789,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
2799
2789
|
changes = getChangesOnSelection(props, state.highlightedIndex);
|
|
2800
2790
|
break;
|
|
2801
2791
|
case InputKeyDownEscape:
|
|
2802
|
-
changes =
|
|
2792
|
+
changes = _extends({
|
|
2803
2793
|
isOpen: false,
|
|
2804
2794
|
highlightedIndex: -1
|
|
2805
2795
|
}, !state.isOpen && {
|
|
@@ -2828,7 +2818,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
2828
2818
|
};
|
|
2829
2819
|
break;
|
|
2830
2820
|
case InputBlur:
|
|
2831
|
-
changes =
|
|
2821
|
+
changes = _extends({
|
|
2832
2822
|
isOpen: false,
|
|
2833
2823
|
highlightedIndex: -1
|
|
2834
2824
|
}, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && {
|
|
@@ -2863,7 +2853,7 @@ function downshiftUseComboboxReducer(state, action) {
|
|
|
2863
2853
|
default:
|
|
2864
2854
|
return downshiftCommonReducer(state, action, stateChangeTypes$1);
|
|
2865
2855
|
}
|
|
2866
|
-
return
|
|
2856
|
+
return _extends({}, state, changes);
|
|
2867
2857
|
}
|
|
2868
2858
|
/* eslint-enable complexity */
|
|
2869
2859
|
|
|
@@ -2878,7 +2868,7 @@ function useCombobox(userProps) {
|
|
|
2878
2868
|
}
|
|
2879
2869
|
validatePropTypes$1(userProps, useCombobox);
|
|
2880
2870
|
// Props defaults and destructuring.
|
|
2881
|
-
var props =
|
|
2871
|
+
var props = _extends({}, defaultProps$1, userProps);
|
|
2882
2872
|
var items = props.items,
|
|
2883
2873
|
scrollIntoView = props.scrollIntoView,
|
|
2884
2874
|
environment = props.environment,
|
|
@@ -2950,7 +2940,7 @@ function useCombobox(userProps) {
|
|
|
2950
2940
|
}
|
|
2951
2941
|
}, [dispatch, latest]), React.useMemo(function () {
|
|
2952
2942
|
return [menuRef, toggleButtonRef, inputRef];
|
|
2953
|
-
}, []));
|
|
2943
|
+
}, [menuRef.current, toggleButtonRef.current, inputRef.current]));
|
|
2954
2944
|
var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getMenuProps');
|
|
2955
2945
|
// Reset itemRefs on close.
|
|
2956
2946
|
React.useEffect(function () {
|
|
@@ -3046,7 +3036,7 @@ function useCombobox(userProps) {
|
|
|
3046
3036
|
|
|
3047
3037
|
// Getter props.
|
|
3048
3038
|
var getLabelProps = React.useCallback(function (labelProps) {
|
|
3049
|
-
return
|
|
3039
|
+
return _extends({
|
|
3050
3040
|
id: elementIds.labelId,
|
|
3051
3041
|
htmlFor: elementIds.inputId
|
|
3052
3042
|
}, labelProps);
|
|
@@ -3058,12 +3048,12 @@ function useCombobox(userProps) {
|
|
|
3058
3048
|
_ref$refKey = _ref.refKey,
|
|
3059
3049
|
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
|
|
3060
3050
|
ref = _ref.ref,
|
|
3061
|
-
rest =
|
|
3051
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
3062
3052
|
var _ref2 = _temp2 === void 0 ? {} : _temp2,
|
|
3063
3053
|
_ref2$suppressRefErro = _ref2.suppressRefError,
|
|
3064
3054
|
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
|
|
3065
3055
|
setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
|
|
3066
|
-
return
|
|
3056
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
|
|
3067
3057
|
menuRef.current = menuNode;
|
|
3068
3058
|
}), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : "" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {
|
|
3069
3059
|
dispatch({
|
|
@@ -3084,7 +3074,7 @@ function useCombobox(userProps) {
|
|
|
3084
3074
|
_ref3.onClick;
|
|
3085
3075
|
var onPress = _ref3.onPress,
|
|
3086
3076
|
disabledProp = _ref3.disabled,
|
|
3087
|
-
rest =
|
|
3077
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);
|
|
3088
3078
|
if (disabledProp !== undefined) {
|
|
3089
3079
|
console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
|
|
3090
3080
|
}
|
|
@@ -3118,7 +3108,7 @@ function useCombobox(userProps) {
|
|
|
3118
3108
|
return e.preventDefault();
|
|
3119
3109
|
}; // keep focus on the input after item click select.
|
|
3120
3110
|
|
|
3121
|
-
return
|
|
3111
|
+
return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {
|
|
3122
3112
|
if (itemNode) {
|
|
3123
3113
|
itemRefs.current[elementIds.getItemId(index)] = itemNode;
|
|
3124
3114
|
}
|
|
@@ -3135,16 +3125,16 @@ function useCombobox(userProps) {
|
|
|
3135
3125
|
_ref5$refKey = _ref5.refKey,
|
|
3136
3126
|
refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
|
|
3137
3127
|
ref = _ref5.ref,
|
|
3138
|
-
rest =
|
|
3128
|
+
rest = _objectWithoutPropertiesLoose(_ref5, _excluded3);
|
|
3139
3129
|
var latestState = latest.current.state;
|
|
3140
3130
|
var toggleButtonHandleClick = function toggleButtonHandleClick() {
|
|
3141
3131
|
dispatch({
|
|
3142
3132
|
type: ToggleButtonClick
|
|
3143
3133
|
});
|
|
3144
3134
|
};
|
|
3145
|
-
return
|
|
3135
|
+
return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {
|
|
3146
3136
|
toggleButtonRef.current = toggleButtonNode;
|
|
3147
|
-
}), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled &&
|
|
3137
|
+
}), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && _extends({}, /* istanbul ignore next (react-native) */{
|
|
3148
3138
|
onPress: callAllEventHandlers(onPress, toggleButtonHandleClick)
|
|
3149
3139
|
} ), rest);
|
|
3150
3140
|
}, [dispatch, latest, elementIds]);
|
|
@@ -3160,7 +3150,7 @@ function useCombobox(userProps) {
|
|
|
3160
3150
|
_ref6$refKey = _ref6.refKey,
|
|
3161
3151
|
refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,
|
|
3162
3152
|
ref = _ref6.ref,
|
|
3163
|
-
rest =
|
|
3153
|
+
rest = _objectWithoutPropertiesLoose(_ref6, _excluded4);
|
|
3164
3154
|
var _ref7 = _temp6 === void 0 ? {} : _temp6,
|
|
3165
3155
|
_ref7$suppressRefErro = _ref7.suppressRefError,
|
|
3166
3156
|
suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;
|
|
@@ -3213,7 +3203,7 @@ function useCombobox(userProps) {
|
|
|
3213
3203
|
});
|
|
3214
3204
|
});
|
|
3215
3205
|
}
|
|
3216
|
-
return
|
|
3206
|
+
return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {
|
|
3217
3207
|
inputRef.current = inputNode;
|
|
3218
3208
|
}), _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);
|
|
3219
3209
|
}, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]);
|
|
@@ -3366,17 +3356,17 @@ var propTypes = {
|
|
|
3366
3356
|
stateReducer: commonPropTypes.stateReducer,
|
|
3367
3357
|
itemToKey: commonPropTypes.itemToKey,
|
|
3368
3358
|
environment: commonPropTypes.environment,
|
|
3369
|
-
selectedItems:
|
|
3370
|
-
initialSelectedItems:
|
|
3371
|
-
defaultSelectedItems:
|
|
3372
|
-
getA11yStatusMessage:
|
|
3373
|
-
activeIndex:
|
|
3374
|
-
initialActiveIndex:
|
|
3375
|
-
defaultActiveIndex:
|
|
3376
|
-
onActiveIndexChange:
|
|
3377
|
-
onSelectedItemsChange:
|
|
3378
|
-
keyNavigationNext:
|
|
3379
|
-
keyNavigationPrevious:
|
|
3359
|
+
selectedItems: PropTypes.array,
|
|
3360
|
+
initialSelectedItems: PropTypes.array,
|
|
3361
|
+
defaultSelectedItems: PropTypes.array,
|
|
3362
|
+
getA11yStatusMessage: PropTypes.func,
|
|
3363
|
+
activeIndex: PropTypes.number,
|
|
3364
|
+
initialActiveIndex: PropTypes.number,
|
|
3365
|
+
defaultActiveIndex: PropTypes.number,
|
|
3366
|
+
onActiveIndexChange: PropTypes.func,
|
|
3367
|
+
onSelectedItemsChange: PropTypes.func,
|
|
3368
|
+
keyNavigationNext: PropTypes.string,
|
|
3369
|
+
keyNavigationPrevious: PropTypes.string
|
|
3380
3370
|
};
|
|
3381
3371
|
var defaultProps = {
|
|
3382
3372
|
itemToKey: defaultProps$3.itemToKey,
|
|
@@ -3391,7 +3381,7 @@ var validatePropTypes = noop;
|
|
|
3391
3381
|
/* istanbul ignore next */
|
|
3392
3382
|
if (process.env.NODE_ENV !== 'production') {
|
|
3393
3383
|
validatePropTypes = function validatePropTypes(options, caller) {
|
|
3394
|
-
|
|
3384
|
+
PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);
|
|
3395
3385
|
};
|
|
3396
3386
|
}
|
|
3397
3387
|
|
|
@@ -3411,19 +3401,19 @@ var FunctionReset = process.env.NODE_ENV !== "production" ? '__function_reset__'
|
|
|
3411
3401
|
|
|
3412
3402
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
3413
3403
|
__proto__: null,
|
|
3414
|
-
SelectedItemClick: SelectedItemClick,
|
|
3415
|
-
SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,
|
|
3416
|
-
SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,
|
|
3417
|
-
SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,
|
|
3418
|
-
SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious,
|
|
3419
|
-
DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,
|
|
3420
|
-
DropdownKeyDownBackspace: DropdownKeyDownBackspace,
|
|
3421
3404
|
DropdownClick: DropdownClick,
|
|
3405
|
+
DropdownKeyDownBackspace: DropdownKeyDownBackspace,
|
|
3406
|
+
DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,
|
|
3422
3407
|
FunctionAddSelectedItem: FunctionAddSelectedItem,
|
|
3423
3408
|
FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,
|
|
3424
|
-
|
|
3409
|
+
FunctionReset: FunctionReset,
|
|
3425
3410
|
FunctionSetActiveIndex: FunctionSetActiveIndex,
|
|
3426
|
-
|
|
3411
|
+
FunctionSetSelectedItems: FunctionSetSelectedItems,
|
|
3412
|
+
SelectedItemClick: SelectedItemClick,
|
|
3413
|
+
SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,
|
|
3414
|
+
SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,
|
|
3415
|
+
SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,
|
|
3416
|
+
SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious
|
|
3427
3417
|
});
|
|
3428
3418
|
|
|
3429
3419
|
/* eslint-disable complexity */
|
|
@@ -3463,7 +3453,7 @@ function downshiftMultipleSelectionReducer(state, action) {
|
|
|
3463
3453
|
} else if (activeIndex === selectedItems.length - 1) {
|
|
3464
3454
|
newActiveIndex = selectedItems.length - 2;
|
|
3465
3455
|
}
|
|
3466
|
-
changes =
|
|
3456
|
+
changes = _extends({
|
|
3467
3457
|
selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))
|
|
3468
3458
|
}, {
|
|
3469
3459
|
activeIndex: newActiveIndex
|
|
@@ -3535,7 +3525,7 @@ function downshiftMultipleSelectionReducer(state, action) {
|
|
|
3535
3525
|
default:
|
|
3536
3526
|
throw new Error('Reducer called without proper action type.');
|
|
3537
3527
|
}
|
|
3538
|
-
return
|
|
3528
|
+
return _extends({}, state, changes);
|
|
3539
3529
|
}
|
|
3540
3530
|
|
|
3541
3531
|
var _excluded = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"],
|
|
@@ -3547,7 +3537,7 @@ function useMultipleSelection(userProps) {
|
|
|
3547
3537
|
}
|
|
3548
3538
|
validatePropTypes(userProps, useMultipleSelection);
|
|
3549
3539
|
// Props defaults and destructuring.
|
|
3550
|
-
var props =
|
|
3540
|
+
var props = _extends({}, defaultProps, userProps);
|
|
3551
3541
|
var getA11yStatusMessage = props.getA11yStatusMessage,
|
|
3552
3542
|
environment = props.environment,
|
|
3553
3543
|
keyNavigationNext = props.keyNavigationNext,
|
|
@@ -3640,7 +3630,7 @@ function useMultipleSelection(userProps) {
|
|
|
3640
3630
|
onKeyDown = _ref3.onKeyDown,
|
|
3641
3631
|
selectedItemProp = _ref3.selectedItem,
|
|
3642
3632
|
indexProp = _ref3.index,
|
|
3643
|
-
rest =
|
|
3633
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
3644
3634
|
var latestState = latest.current.state;
|
|
3645
3635
|
var _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, 'Pass either item or index to getSelectedItemProps!'),
|
|
3646
3636
|
index = _getItemAndIndex[1];
|
|
@@ -3657,7 +3647,7 @@ function useMultipleSelection(userProps) {
|
|
|
3657
3647
|
selectedItemKeyDownHandlers[key](event);
|
|
3658
3648
|
}
|
|
3659
3649
|
};
|
|
3660
|
-
return
|
|
3650
|
+
return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {
|
|
3661
3651
|
if (selectedItemNode) {
|
|
3662
3652
|
selectedItemRefs.current.push(selectedItemNode);
|
|
3663
3653
|
}
|
|
@@ -3673,7 +3663,7 @@ function useMultipleSelection(userProps) {
|
|
|
3673
3663
|
onClick = _ref4.onClick,
|
|
3674
3664
|
_ref4$preventKeyActio = _ref4.preventKeyAction,
|
|
3675
3665
|
preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,
|
|
3676
|
-
rest =
|
|
3666
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);
|
|
3677
3667
|
var _ref5 = _temp3 === void 0 ? {} : _temp3,
|
|
3678
3668
|
_ref5$suppressRefErro = _ref5.suppressRefError,
|
|
3679
3669
|
suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;
|
|
@@ -3689,7 +3679,7 @@ function useMultipleSelection(userProps) {
|
|
|
3689
3679
|
type: DropdownClick
|
|
3690
3680
|
});
|
|
3691
3681
|
};
|
|
3692
|
-
return
|
|
3682
|
+
return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {
|
|
3693
3683
|
if (dropdownNode) {
|
|
3694
3684
|
dropdownRef.current = dropdownNode;
|
|
3695
3685
|
}
|
|
@@ -3742,7 +3732,7 @@ function useMultipleSelection(userProps) {
|
|
|
3742
3732
|
};
|
|
3743
3733
|
}
|
|
3744
3734
|
|
|
3745
|
-
exports
|
|
3735
|
+
exports.default = Downshift$1;
|
|
3746
3736
|
exports.resetIdCounter = resetIdCounter;
|
|
3747
3737
|
exports.useCombobox = useCombobox;
|
|
3748
3738
|
exports.useMultipleSelection = useMultipleSelection;
|