downshift 3.1.4 β 3.1.5
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/README.md +3 -2
- package/dist/downshift.cjs.js +22 -5
- package/dist/downshift.esm.js +22 -5
- package/dist/downshift.native.cjs.js +17 -2
- package/dist/downshift.umd.js +142 -48
- 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 +22 -5
- package/preact/dist/downshift.esm.js +22 -5
- package/preact/dist/downshift.umd.js +142 -48
- package/preact/dist/downshift.umd.js.map +1 -1
- package/preact/dist/downshift.umd.min.js +1 -1
- package/preact/dist/downshift.umd.min.js.map +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ autocomplete/dropdown/select/combobox components</p>
|
|
|
19
19
|
[![downloads][downloads-badge]][npmcharts] [![version][version-badge]][package]
|
|
20
20
|
[![MIT License][license-badge]][license]
|
|
21
21
|
|
|
22
|
-
[](#contributors)
|
|
23
23
|
[![PRs Welcome][prs-badge]][prs] [![Chat][chat-badge]][chat]
|
|
24
24
|
[![Code of Conduct][coc-badge]][coc]
|
|
25
25
|
[![Join the community on Spectrum][spectrum-badge]][spectrum]
|
|
@@ -1078,7 +1078,8 @@ Thanks goes to these people ([emoji key][emojis]):
|
|
|
1078
1078
|
| [<img src="https://avatars3.githubusercontent.com/u/5456216?v=4" width="100px;"/><br /><sub><b>Cameron Edwards</b></sub>](http://cameronpedwards.com)<br />[π»](https://github.com/paypal/downshift/commits?author=cameronprattedwards "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=cameronprattedwards "Tests") | [<img src="https://avatars2.githubusercontent.com/u/179534?v=4" width="100px;"/><br /><sub><b>stereobooster</b></sub>](https://github.com/stereobooster)<br />[π»](https://github.com/paypal/downshift/commits?author=stereobooster "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=stereobooster "Tests") | [<img src="https://avatars0.githubusercontent.com/u/934879?v=4" width="100px;"/><br /><sub><b>Trevor Pierce</b></sub>](https://github.com/1Copenut)<br />[π](#review-1Copenut "Reviewed Pull Requests") | [<img src="https://avatars1.githubusercontent.com/u/1334982?v=4" width="100px;"/><br /><sub><b>Xuefei Li</b></sub>](http://xuefei-frank.com)<br />[π»](https://github.com/paypal/downshift/commits?author=franklixuefei "Code") | [<img src="https://avatars0.githubusercontent.com/u/7252803?v=4" width="100px;"/><br /><sub><b>Alfred Ringstad</b></sub>](https://hyperlab.se)<br />[π»](https://github.com/paypal/downshift/commits?author=alfredringstad "Code") | [<img src="https://avatars0.githubusercontent.com/u/6895497?v=4" width="100px;"/><br /><sub><b>D[oa]vid Weisz</b></sub>](https://github.com/dovidweisz)<br />[π»](https://github.com/paypal/downshift/commits?author=dovidweisz "Code") | [<img src="https://avatars0.githubusercontent.com/u/19773?v=4" width="100px;"/><br /><sub><b>Royston Shufflebotham</b></sub>](https://github.com/RoystonS)<br />[π](https://github.com/paypal/downshift/issues?q=author%3ARoystonS "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=RoystonS "Code") |
|
|
1079
1079
|
| [<img src="https://avatars3.githubusercontent.com/u/6643991?v=4" width="100px;"/><br /><sub><b>MichaΓ«l De Boey</b></sub>](http://michaeldeboey.be)<br />[π»](https://github.com/paypal/downshift/commits?author=MichaelDeBoey "Code") | [<img src="https://avatars3.githubusercontent.com/u/4412771?v=4" width="100px;"/><br /><sub><b>Henry</b></sub>](https://github.com/EricHenry)<br />[π»](https://github.com/paypal/downshift/commits?author=EricHenry "Code") | [<img src="https://avatars3.githubusercontent.com/u/2180127?v=4" width="100px;"/><br /><sub><b>Andrew Walton</b></sub>](http://www.greenarrow.me)<br />[π](https://github.com/paypal/downshift/issues?q=author%3Agreen-arrow "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=green-arrow "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=green-arrow "Tests") | [<img src="https://avatars0.githubusercontent.com/u/13774309?v=4" width="100px;"/><br /><sub><b>Arthur Denner</b></sub>](https://github.com/arthurdenner)<br />[π»](https://github.com/paypal/downshift/commits?author=arthurdenner "Code") | [<img src="https://avatars2.githubusercontent.com/u/81981?v=4" width="100px;"/><br /><sub><b>Cody Olsen</b></sub>](http://twitter.com/stipsan)<br />[π»](https://github.com/paypal/downshift/commits?author=stipsan "Code") | [<img src="https://avatars0.githubusercontent.com/u/5084492?v=4" width="100px;"/><br /><sub><b>Thomas Ladd</b></sub>](https://github.com/TLadd)<br />[π»](https://github.com/paypal/downshift/commits?author=TLadd "Code") | [<img src="https://avatars3.githubusercontent.com/u/34634369?v=4" width="100px;"/><br /><sub><b>lixualinta</b></sub>](https://github.com/lixualinta)<br />[π»](https://github.com/paypal/downshift/commits?author=lixualinta "Code") |
|
|
1080
1080
|
| [<img src="https://avatars2.githubusercontent.com/u/2118956?v=4" width="100px;"/><br /><sub><b>Jacob Cofman</b></sub>](https://twitter.com/JCofman)<br />[π»](https://github.com/paypal/downshift/commits?author=JCofman "Code") | [<img src="https://avatars3.githubusercontent.com/u/19275184?v=4" width="100px;"/><br /><sub><b>Joshua Freedman</b></sub>](https://github.com/jf248)<br />[π»](https://github.com/paypal/downshift/commits?author=jf248 "Code") | [<img src="https://avatars1.githubusercontent.com/u/24494020?v=4" width="100px;"/><br /><sub><b>Amy</b></sub>](https://github.com/AmyScript)<br />[π‘](#example-AmyScript "Examples") | [<img src="https://avatars1.githubusercontent.com/u/9063669?v=4" width="100px;"/><br /><sub><b>Rogin Farrer</b></sub>](http://twitter.com/roginfarrer)<br />[π»](https://github.com/paypal/downshift/commits?author=roginfarrer "Code") | [<img src="https://avatars3.githubusercontent.com/u/871583" width="100px;"/><br /><sub><b>Dmitrii Kanatnikov</b></sub>](https://github.com/rifler)<br />[π»](https://github.com/paypal/downshift/commits?author=rifler "Code") | [<img src="https://avatars2.githubusercontent.com/u/346300?v=4" width="100px;"/><br /><sub><b>Dallon Feldner</b></sub>](https://github.com/dallonf)<br />[π](https://github.com/paypal/downshift/issues?q=author%3Adallonf "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=dallonf "Code") | [<img src="https://avatars2.githubusercontent.com/u/10165959?v=4" width="100px;"/><br /><sub><b>Samuel Fuller Thomas</b></sub>](https://samuelfullerthomas.com)<br />[π»](https://github.com/paypal/downshift/commits?author=samuelfullerthomas "Code") |
|
|
1081
|
-
| [<img src="https://avatars1.githubusercontent.com/u/2430381?v=4" width="100px;"/><br /><sub><b>Ryan Castner</b></sub>](http://audiolion.github.io)<br />[π»](https://github.com/paypal/downshift/commits?author=audiolion "Code") | [<img src="https://avatars2.githubusercontent.com/u/11275392?v=4" width="100px;"/><br /><sub><b>Silviu Alexandru Avram</b></sub>](https://github.com/silviuavram)<br />[π](https://github.com/paypal/downshift/issues?q=author%3Asilviuavram "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=silviuavram "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=silviuavram "Tests") | [<img src="https://avatars1.githubusercontent.com/u/15676655?v=4" width="100px;"/><br /><sub><b>Anton Volkov</b></sub>](https://github.com/akronb)<br />[π»](https://github.com/paypal/downshift/commits?author=akronb "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=akronb "Tests") |
|
|
1081
|
+
| [<img src="https://avatars1.githubusercontent.com/u/2430381?v=4" width="100px;"/><br /><sub><b>Ryan Castner</b></sub>](http://audiolion.github.io)<br />[π»](https://github.com/paypal/downshift/commits?author=audiolion "Code") | [<img src="https://avatars2.githubusercontent.com/u/11275392?v=4" width="100px;"/><br /><sub><b>Silviu Alexandru Avram</b></sub>](https://github.com/silviuavram)<br />[π](https://github.com/paypal/downshift/issues?q=author%3Asilviuavram "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=silviuavram "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=silviuavram "Tests") | [<img src="https://avatars1.githubusercontent.com/u/15676655?v=4" width="100px;"/><br /><sub><b>Anton Volkov</b></sub>](https://github.com/akronb)<br />[π»](https://github.com/paypal/downshift/commits?author=akronb "Code") [β οΈ](https://github.com/paypal/downshift/commits?author=akronb "Tests") | [<img src="https://avatars3.githubusercontent.com/u/513363?v=4" width="100px;"/><br /><sub><b>Keegan Street</b></sub>](http://keegan.st)<br />[π](https://github.com/paypal/downshift/issues?q=author%3Akeeganstreet "Bug reports") [π»](https://github.com/paypal/downshift/commits?author=keeganstreet "Code") |
|
|
1082
|
+
|
|
1082
1083
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
1083
1084
|
|
|
1084
1085
|
This project follows the [all-contributors][all-contributors] specification.
|
package/dist/downshift.cjs.js
CHANGED
|
@@ -98,7 +98,7 @@ var keyDownSpaceButton = process.env.NODE_ENV !== "production" ? '__autocomplete
|
|
|
98
98
|
var clickButton = process.env.NODE_ENV !== "production" ? '__autocomplete_click_button__' : 11;
|
|
99
99
|
var blurButton = process.env.NODE_ENV !== "production" ? '__autocomplete_blur_button__' : 12;
|
|
100
100
|
var controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== "production" ? '__autocomplete_controlled_prop_updated_selected_item__' : 13;
|
|
101
|
-
var
|
|
101
|
+
var touchEnd = process.env.NODE_ENV !== "production" ? '__autocomplete_touchend__' : 14;
|
|
102
102
|
|
|
103
103
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
104
104
|
unknown: unknown,
|
|
@@ -115,7 +115,7 @@ var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
|
115
115
|
clickButton: clickButton,
|
|
116
116
|
blurButton: blurButton,
|
|
117
117
|
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
118
|
-
|
|
118
|
+
touchEnd: touchEnd
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
var idCounter = 0;
|
|
@@ -1279,14 +1279,25 @@ function (_Component) {
|
|
|
1279
1279
|
}; // Touching an element in iOS gives focus and hover states, but touching out of
|
|
1280
1280
|
// the element will remove hover, and persist the focus state, resulting in the
|
|
1281
1281
|
// blur event not being triggered.
|
|
1282
|
+
// this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
|
|
1283
|
+
// If the user taps outside of Downshift, the component should be reset,
|
|
1284
|
+
// but not if the user is swiping
|
|
1282
1285
|
|
|
1283
1286
|
|
|
1284
|
-
var onTouchStart = function (
|
|
1287
|
+
var onTouchStart = function () {
|
|
1288
|
+
_this4.isTouchMove = false;
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
var onTouchMove = function () {
|
|
1292
|
+
_this4.isTouchMove = true;
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
var onTouchEnd = function (event) {
|
|
1285
1296
|
var contextWithinDownshift = targetWithinDownshift(event.target, false);
|
|
1286
1297
|
|
|
1287
|
-
if (!contextWithinDownshift && _this4.getState().isOpen) {
|
|
1298
|
+
if (!_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen) {
|
|
1288
1299
|
_this4.reset({
|
|
1289
|
-
type:
|
|
1300
|
+
type: touchEnd
|
|
1290
1301
|
}, function () {
|
|
1291
1302
|
return _this4.props.onOuterClick(_this4.getStateAndHelpers());
|
|
1292
1303
|
});
|
|
@@ -1296,6 +1307,8 @@ function (_Component) {
|
|
|
1296
1307
|
this.props.environment.addEventListener('mousedown', onMouseDown);
|
|
1297
1308
|
this.props.environment.addEventListener('mouseup', onMouseUp);
|
|
1298
1309
|
this.props.environment.addEventListener('touchstart', onTouchStart);
|
|
1310
|
+
this.props.environment.addEventListener('touchmove', onTouchMove);
|
|
1311
|
+
this.props.environment.addEventListener('touchend', onTouchEnd);
|
|
1299
1312
|
|
|
1300
1313
|
this.cleanup = function () {
|
|
1301
1314
|
_this4.internalClearTimeouts();
|
|
@@ -1307,6 +1320,10 @@ function (_Component) {
|
|
|
1307
1320
|
_this4.props.environment.removeEventListener('mouseup', onMouseUp);
|
|
1308
1321
|
|
|
1309
1322
|
_this4.props.environment.removeEventListener('touchstart', onTouchStart);
|
|
1323
|
+
|
|
1324
|
+
_this4.props.environment.removeEventListener('touchmove', onTouchMove);
|
|
1325
|
+
|
|
1326
|
+
_this4.props.environment.removeEventListener('touchend', onTouchEnd);
|
|
1310
1327
|
};
|
|
1311
1328
|
}
|
|
1312
1329
|
};
|
package/dist/downshift.esm.js
CHANGED
|
@@ -91,7 +91,7 @@ var keyDownSpaceButton = process.env.NODE_ENV !== "production" ? '__autocomplete
|
|
|
91
91
|
var clickButton = process.env.NODE_ENV !== "production" ? '__autocomplete_click_button__' : 11;
|
|
92
92
|
var blurButton = process.env.NODE_ENV !== "production" ? '__autocomplete_blur_button__' : 12;
|
|
93
93
|
var controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== "production" ? '__autocomplete_controlled_prop_updated_selected_item__' : 13;
|
|
94
|
-
var
|
|
94
|
+
var touchEnd = process.env.NODE_ENV !== "production" ? '__autocomplete_touchend__' : 14;
|
|
95
95
|
|
|
96
96
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
97
97
|
unknown: unknown,
|
|
@@ -108,7 +108,7 @@ var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
|
108
108
|
clickButton: clickButton,
|
|
109
109
|
blurButton: blurButton,
|
|
110
110
|
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
111
|
-
|
|
111
|
+
touchEnd: touchEnd
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
var idCounter = 0;
|
|
@@ -1272,14 +1272,25 @@ function (_Component) {
|
|
|
1272
1272
|
}; // Touching an element in iOS gives focus and hover states, but touching out of
|
|
1273
1273
|
// the element will remove hover, and persist the focus state, resulting in the
|
|
1274
1274
|
// blur event not being triggered.
|
|
1275
|
+
// this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
|
|
1276
|
+
// If the user taps outside of Downshift, the component should be reset,
|
|
1277
|
+
// but not if the user is swiping
|
|
1275
1278
|
|
|
1276
1279
|
|
|
1277
|
-
var onTouchStart = function (
|
|
1280
|
+
var onTouchStart = function () {
|
|
1281
|
+
_this4.isTouchMove = false;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
var onTouchMove = function () {
|
|
1285
|
+
_this4.isTouchMove = true;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
var onTouchEnd = function (event) {
|
|
1278
1289
|
var contextWithinDownshift = targetWithinDownshift(event.target, false);
|
|
1279
1290
|
|
|
1280
|
-
if (!contextWithinDownshift && _this4.getState().isOpen) {
|
|
1291
|
+
if (!_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen) {
|
|
1281
1292
|
_this4.reset({
|
|
1282
|
-
type:
|
|
1293
|
+
type: touchEnd
|
|
1283
1294
|
}, function () {
|
|
1284
1295
|
return _this4.props.onOuterClick(_this4.getStateAndHelpers());
|
|
1285
1296
|
});
|
|
@@ -1289,6 +1300,8 @@ function (_Component) {
|
|
|
1289
1300
|
this.props.environment.addEventListener('mousedown', onMouseDown);
|
|
1290
1301
|
this.props.environment.addEventListener('mouseup', onMouseUp);
|
|
1291
1302
|
this.props.environment.addEventListener('touchstart', onTouchStart);
|
|
1303
|
+
this.props.environment.addEventListener('touchmove', onTouchMove);
|
|
1304
|
+
this.props.environment.addEventListener('touchend', onTouchEnd);
|
|
1292
1305
|
|
|
1293
1306
|
this.cleanup = function () {
|
|
1294
1307
|
_this4.internalClearTimeouts();
|
|
@@ -1300,6 +1313,10 @@ function (_Component) {
|
|
|
1300
1313
|
_this4.props.environment.removeEventListener('mouseup', onMouseUp);
|
|
1301
1314
|
|
|
1302
1315
|
_this4.props.environment.removeEventListener('touchstart', onTouchStart);
|
|
1316
|
+
|
|
1317
|
+
_this4.props.environment.removeEventListener('touchmove', onTouchMove);
|
|
1318
|
+
|
|
1319
|
+
_this4.props.environment.removeEventListener('touchend', onTouchEnd);
|
|
1303
1320
|
};
|
|
1304
1321
|
}
|
|
1305
1322
|
};
|
|
@@ -98,7 +98,7 @@ var keyDownSpaceButton = process.env.NODE_ENV !== "production" ? '__autocomplete
|
|
|
98
98
|
var clickButton = process.env.NODE_ENV !== "production" ? '__autocomplete_click_button__' : 11;
|
|
99
99
|
var blurButton = process.env.NODE_ENV !== "production" ? '__autocomplete_blur_button__' : 12;
|
|
100
100
|
var controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== "production" ? '__autocomplete_controlled_prop_updated_selected_item__' : 13;
|
|
101
|
-
var
|
|
101
|
+
var touchEnd = process.env.NODE_ENV !== "production" ? '__autocomplete_touchend__' : 14;
|
|
102
102
|
|
|
103
103
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
104
104
|
unknown: unknown,
|
|
@@ -115,7 +115,7 @@ var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
|
115
115
|
clickButton: clickButton,
|
|
116
116
|
blurButton: blurButton,
|
|
117
117
|
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
118
|
-
|
|
118
|
+
touchEnd: touchEnd
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
var idCounter = 0;
|
|
@@ -1226,6 +1226,12 @@ function (_Component) {
|
|
|
1226
1226
|
var _this4 = this;
|
|
1227
1227
|
|
|
1228
1228
|
/* istanbul ignore if (react-native) */
|
|
1229
|
+
if (process.env.NODE_ENV !== 'production' && !true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
|
|
1230
|
+
validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);
|
|
1231
|
+
}
|
|
1232
|
+
/* istanbul ignore if (react-native) */
|
|
1233
|
+
|
|
1234
|
+
|
|
1229
1235
|
this.cleanup = function () {
|
|
1230
1236
|
_this4.internalClearTimeouts();
|
|
1231
1237
|
};
|
|
@@ -1395,6 +1401,15 @@ process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
|
1395
1401
|
|
|
1396
1402
|
} : void 0;
|
|
1397
1403
|
|
|
1404
|
+
function validateGetMenuPropsCalledCorrectly(node, _ref10) {
|
|
1405
|
+
var refKey = _ref10.refKey;
|
|
1406
|
+
|
|
1407
|
+
if (!node) {
|
|
1408
|
+
// eslint-disable-next-line no-console
|
|
1409
|
+
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1398
1413
|
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
1399
1414
|
var refKey = _ref11.refKey;
|
|
1400
1415
|
var refKeySpecified = refKey !== 'ref';
|
package/dist/downshift.umd.js
CHANGED
|
@@ -815,33 +815,35 @@
|
|
|
815
815
|
|
|
816
816
|
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
|
817
817
|
Object.defineProperty(exports,"__esModule",{value:!0});
|
|
818
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,
|
|
819
|
-
function
|
|
820
|
-
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===
|
|
821
|
-
exports.isForwardRef=function(a){return
|
|
818
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,r=b?Symbol.for("react.memo"):
|
|
819
|
+
60115,t=b?Symbol.for("react.lazy"):60116;function u(a){if("object"===typeof a&&null!==a){var q=a.$$typeof;switch(q){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return q}}case d:return q}}}function v(a){return u(a)===m}exports.typeOf=u;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;
|
|
820
|
+
exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||u(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return u(a)===k};exports.isContextProvider=function(a){return u(a)===h};
|
|
821
|
+
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return u(a)===n};exports.isFragment=function(a){return u(a)===e};exports.isProfiler=function(a){return u(a)===g};exports.isPortal=function(a){return u(a)===d};exports.isStrictMode=function(a){return u(a)===f};
|
|
822
822
|
});
|
|
823
823
|
|
|
824
824
|
unwrapExports(reactIs_production_min);
|
|
825
825
|
var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
|
826
826
|
var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
|
827
|
-
var reactIs_production_min_3 = reactIs_production_min.
|
|
828
|
-
var reactIs_production_min_4 = reactIs_production_min.
|
|
829
|
-
var reactIs_production_min_5 = reactIs_production_min.
|
|
830
|
-
var reactIs_production_min_6 = reactIs_production_min.
|
|
831
|
-
var reactIs_production_min_7 = reactIs_production_min.
|
|
832
|
-
var reactIs_production_min_8 = reactIs_production_min.
|
|
833
|
-
var reactIs_production_min_9 = reactIs_production_min.
|
|
834
|
-
var reactIs_production_min_10 = reactIs_production_min.
|
|
835
|
-
var reactIs_production_min_11 = reactIs_production_min.
|
|
836
|
-
var reactIs_production_min_12 = reactIs_production_min.
|
|
837
|
-
var reactIs_production_min_13 = reactIs_production_min.
|
|
838
|
-
var reactIs_production_min_14 = reactIs_production_min.
|
|
839
|
-
var reactIs_production_min_15 = reactIs_production_min.
|
|
840
|
-
var reactIs_production_min_16 = reactIs_production_min.
|
|
841
|
-
var reactIs_production_min_17 = reactIs_production_min.
|
|
842
|
-
var reactIs_production_min_18 = reactIs_production_min.
|
|
843
|
-
var reactIs_production_min_19 = reactIs_production_min.
|
|
844
|
-
var reactIs_production_min_20 = reactIs_production_min.
|
|
827
|
+
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
|
828
|
+
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
|
829
|
+
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
|
830
|
+
var reactIs_production_min_6 = reactIs_production_min.Element;
|
|
831
|
+
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
|
832
|
+
var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
|
833
|
+
var reactIs_production_min_9 = reactIs_production_min.Profiler;
|
|
834
|
+
var reactIs_production_min_10 = reactIs_production_min.Portal;
|
|
835
|
+
var reactIs_production_min_11 = reactIs_production_min.StrictMode;
|
|
836
|
+
var reactIs_production_min_12 = reactIs_production_min.isValidElementType;
|
|
837
|
+
var reactIs_production_min_13 = reactIs_production_min.isAsyncMode;
|
|
838
|
+
var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode;
|
|
839
|
+
var reactIs_production_min_15 = reactIs_production_min.isContextConsumer;
|
|
840
|
+
var reactIs_production_min_16 = reactIs_production_min.isContextProvider;
|
|
841
|
+
var reactIs_production_min_17 = reactIs_production_min.isElement;
|
|
842
|
+
var reactIs_production_min_18 = reactIs_production_min.isForwardRef;
|
|
843
|
+
var reactIs_production_min_19 = reactIs_production_min.isFragment;
|
|
844
|
+
var reactIs_production_min_20 = reactIs_production_min.isProfiler;
|
|
845
|
+
var reactIs_production_min_21 = reactIs_production_min.isPortal;
|
|
846
|
+
var reactIs_production_min_22 = reactIs_production_min.isStrictMode;
|
|
845
847
|
|
|
846
848
|
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
847
849
|
|
|
@@ -864,15 +866,71 @@
|
|
|
864
866
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
865
867
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
866
868
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
869
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
867
870
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
868
|
-
var
|
|
871
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
872
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
873
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
869
874
|
|
|
870
875
|
function isValidElementType(type) {
|
|
871
876
|
return typeof type === 'string' || typeof type === 'function' ||
|
|
872
877
|
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
873
|
-
type === REACT_FRAGMENT_TYPE || type ===
|
|
878
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
874
879
|
}
|
|
875
880
|
|
|
881
|
+
/**
|
|
882
|
+
* Forked from fbjs/warning:
|
|
883
|
+
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
884
|
+
*
|
|
885
|
+
* Only change is we use console.warn instead of console.error,
|
|
886
|
+
* and do nothing when 'console' is not supported.
|
|
887
|
+
* This really simplifies the code.
|
|
888
|
+
* ---
|
|
889
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
890
|
+
* This can be used to log issues in development environments in critical
|
|
891
|
+
* paths. Removing the logging code for production environments will keep the
|
|
892
|
+
* same logic and follow the same code paths.
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
var lowPriorityWarning = function () {};
|
|
896
|
+
|
|
897
|
+
{
|
|
898
|
+
var printWarning = function (format) {
|
|
899
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
900
|
+
args[_key - 1] = arguments[_key];
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
var argIndex = 0;
|
|
904
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
905
|
+
return args[argIndex++];
|
|
906
|
+
});
|
|
907
|
+
if (typeof console !== 'undefined') {
|
|
908
|
+
console.warn(message);
|
|
909
|
+
}
|
|
910
|
+
try {
|
|
911
|
+
// --- Welcome to debugging React ---
|
|
912
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
913
|
+
// to find the callsite that caused this warning to fire.
|
|
914
|
+
throw new Error(message);
|
|
915
|
+
} catch (x) {}
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
lowPriorityWarning = function (condition, format) {
|
|
919
|
+
if (format === undefined) {
|
|
920
|
+
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
921
|
+
}
|
|
922
|
+
if (!condition) {
|
|
923
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
924
|
+
args[_key2 - 2] = arguments[_key2];
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
printWarning.apply(undefined, [format].concat(args));
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
var lowPriorityWarning$1 = lowPriorityWarning;
|
|
933
|
+
|
|
876
934
|
function typeOf(object) {
|
|
877
935
|
if (typeof object === 'object' && object !== null) {
|
|
878
936
|
var $$typeof = object.$$typeof;
|
|
@@ -883,6 +941,7 @@
|
|
|
883
941
|
|
|
884
942
|
switch (type) {
|
|
885
943
|
case REACT_ASYNC_MODE_TYPE:
|
|
944
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
886
945
|
case REACT_FRAGMENT_TYPE:
|
|
887
946
|
case REACT_PROFILER_TYPE:
|
|
888
947
|
case REACT_STRICT_MODE_TYPE:
|
|
@@ -907,7 +966,9 @@
|
|
|
907
966
|
return undefined;
|
|
908
967
|
}
|
|
909
968
|
|
|
969
|
+
// AsyncMode is deprecated along with isAsyncMode
|
|
910
970
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
971
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
911
972
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
912
973
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
913
974
|
var Element = REACT_ELEMENT_TYPE;
|
|
@@ -917,8 +978,20 @@
|
|
|
917
978
|
var Portal = REACT_PORTAL_TYPE;
|
|
918
979
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
919
980
|
|
|
981
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
982
|
+
|
|
983
|
+
// AsyncMode should be deprecated
|
|
920
984
|
function isAsyncMode(object) {
|
|
921
|
-
|
|
985
|
+
{
|
|
986
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
987
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
988
|
+
lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
992
|
+
}
|
|
993
|
+
function isConcurrentMode(object) {
|
|
994
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
922
995
|
}
|
|
923
996
|
function isContextConsumer(object) {
|
|
924
997
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
@@ -947,6 +1020,7 @@
|
|
|
947
1020
|
|
|
948
1021
|
exports.typeOf = typeOf;
|
|
949
1022
|
exports.AsyncMode = AsyncMode;
|
|
1023
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
950
1024
|
exports.ContextConsumer = ContextConsumer;
|
|
951
1025
|
exports.ContextProvider = ContextProvider;
|
|
952
1026
|
exports.Element = Element;
|
|
@@ -957,6 +1031,7 @@
|
|
|
957
1031
|
exports.StrictMode = StrictMode;
|
|
958
1032
|
exports.isValidElementType = isValidElementType;
|
|
959
1033
|
exports.isAsyncMode = isAsyncMode;
|
|
1034
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
960
1035
|
exports.isContextConsumer = isContextConsumer;
|
|
961
1036
|
exports.isContextProvider = isContextProvider;
|
|
962
1037
|
exports.isElement = isElement;
|
|
@@ -972,24 +1047,26 @@
|
|
|
972
1047
|
unwrapExports(reactIs_development);
|
|
973
1048
|
var reactIs_development_1 = reactIs_development.typeOf;
|
|
974
1049
|
var reactIs_development_2 = reactIs_development.AsyncMode;
|
|
975
|
-
var reactIs_development_3 = reactIs_development.
|
|
976
|
-
var reactIs_development_4 = reactIs_development.
|
|
977
|
-
var reactIs_development_5 = reactIs_development.
|
|
978
|
-
var reactIs_development_6 = reactIs_development.
|
|
979
|
-
var reactIs_development_7 = reactIs_development.
|
|
980
|
-
var reactIs_development_8 = reactIs_development.
|
|
981
|
-
var reactIs_development_9 = reactIs_development.
|
|
982
|
-
var reactIs_development_10 = reactIs_development.
|
|
983
|
-
var reactIs_development_11 = reactIs_development.
|
|
984
|
-
var reactIs_development_12 = reactIs_development.
|
|
985
|
-
var reactIs_development_13 = reactIs_development.
|
|
986
|
-
var reactIs_development_14 = reactIs_development.
|
|
987
|
-
var reactIs_development_15 = reactIs_development.
|
|
988
|
-
var reactIs_development_16 = reactIs_development.
|
|
989
|
-
var reactIs_development_17 = reactIs_development.
|
|
990
|
-
var reactIs_development_18 = reactIs_development.
|
|
991
|
-
var reactIs_development_19 = reactIs_development.
|
|
992
|
-
var reactIs_development_20 = reactIs_development.
|
|
1050
|
+
var reactIs_development_3 = reactIs_development.ConcurrentMode;
|
|
1051
|
+
var reactIs_development_4 = reactIs_development.ContextConsumer;
|
|
1052
|
+
var reactIs_development_5 = reactIs_development.ContextProvider;
|
|
1053
|
+
var reactIs_development_6 = reactIs_development.Element;
|
|
1054
|
+
var reactIs_development_7 = reactIs_development.ForwardRef;
|
|
1055
|
+
var reactIs_development_8 = reactIs_development.Fragment;
|
|
1056
|
+
var reactIs_development_9 = reactIs_development.Profiler;
|
|
1057
|
+
var reactIs_development_10 = reactIs_development.Portal;
|
|
1058
|
+
var reactIs_development_11 = reactIs_development.StrictMode;
|
|
1059
|
+
var reactIs_development_12 = reactIs_development.isValidElementType;
|
|
1060
|
+
var reactIs_development_13 = reactIs_development.isAsyncMode;
|
|
1061
|
+
var reactIs_development_14 = reactIs_development.isConcurrentMode;
|
|
1062
|
+
var reactIs_development_15 = reactIs_development.isContextConsumer;
|
|
1063
|
+
var reactIs_development_16 = reactIs_development.isContextProvider;
|
|
1064
|
+
var reactIs_development_17 = reactIs_development.isElement;
|
|
1065
|
+
var reactIs_development_18 = reactIs_development.isForwardRef;
|
|
1066
|
+
var reactIs_development_19 = reactIs_development.isFragment;
|
|
1067
|
+
var reactIs_development_20 = reactIs_development.isProfiler;
|
|
1068
|
+
var reactIs_development_21 = reactIs_development.isPortal;
|
|
1069
|
+
var reactIs_development_22 = reactIs_development.isStrictMode;
|
|
993
1070
|
|
|
994
1071
|
var reactIs = createCommonjsModule(function (module) {
|
|
995
1072
|
|
|
@@ -1083,7 +1160,7 @@
|
|
|
1083
1160
|
var clickButton = '__autocomplete_click_button__';
|
|
1084
1161
|
var blurButton = '__autocomplete_blur_button__';
|
|
1085
1162
|
var controlledPropUpdatedSelectedItem = '__autocomplete_controlled_prop_updated_selected_item__';
|
|
1086
|
-
var
|
|
1163
|
+
var touchEnd = '__autocomplete_touchend__';
|
|
1087
1164
|
|
|
1088
1165
|
var stateChangeTypes = /*#__PURE__*/Object.freeze({
|
|
1089
1166
|
unknown: unknown,
|
|
@@ -1100,7 +1177,7 @@
|
|
|
1100
1177
|
clickButton: clickButton,
|
|
1101
1178
|
blurButton: blurButton,
|
|
1102
1179
|
controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,
|
|
1103
|
-
|
|
1180
|
+
touchEnd: touchEnd
|
|
1104
1181
|
});
|
|
1105
1182
|
|
|
1106
1183
|
function isElement(el) {
|
|
@@ -2432,14 +2509,25 @@
|
|
|
2432
2509
|
}; // Touching an element in iOS gives focus and hover states, but touching out of
|
|
2433
2510
|
// the element will remove hover, and persist the focus state, resulting in the
|
|
2434
2511
|
// blur event not being triggered.
|
|
2512
|
+
// this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
|
|
2513
|
+
// If the user taps outside of Downshift, the component should be reset,
|
|
2514
|
+
// but not if the user is swiping
|
|
2435
2515
|
|
|
2436
2516
|
|
|
2437
|
-
var onTouchStart = function (
|
|
2517
|
+
var onTouchStart = function () {
|
|
2518
|
+
_this4.isTouchMove = false;
|
|
2519
|
+
};
|
|
2520
|
+
|
|
2521
|
+
var onTouchMove = function () {
|
|
2522
|
+
_this4.isTouchMove = true;
|
|
2523
|
+
};
|
|
2524
|
+
|
|
2525
|
+
var onTouchEnd = function (event) {
|
|
2438
2526
|
var contextWithinDownshift = targetWithinDownshift(event.target, false);
|
|
2439
2527
|
|
|
2440
|
-
if (!contextWithinDownshift && _this4.getState().isOpen) {
|
|
2528
|
+
if (!_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen) {
|
|
2441
2529
|
_this4.reset({
|
|
2442
|
-
type:
|
|
2530
|
+
type: touchEnd
|
|
2443
2531
|
}, function () {
|
|
2444
2532
|
return _this4.props.onOuterClick(_this4.getStateAndHelpers());
|
|
2445
2533
|
});
|
|
@@ -2449,6 +2537,8 @@
|
|
|
2449
2537
|
this.props.environment.addEventListener('mousedown', onMouseDown);
|
|
2450
2538
|
this.props.environment.addEventListener('mouseup', onMouseUp);
|
|
2451
2539
|
this.props.environment.addEventListener('touchstart', onTouchStart);
|
|
2540
|
+
this.props.environment.addEventListener('touchmove', onTouchMove);
|
|
2541
|
+
this.props.environment.addEventListener('touchend', onTouchEnd);
|
|
2452
2542
|
|
|
2453
2543
|
this.cleanup = function () {
|
|
2454
2544
|
_this4.internalClearTimeouts();
|
|
@@ -2460,6 +2550,10 @@
|
|
|
2460
2550
|
_this4.props.environment.removeEventListener('mouseup', onMouseUp);
|
|
2461
2551
|
|
|
2462
2552
|
_this4.props.environment.removeEventListener('touchstart', onTouchStart);
|
|
2553
|
+
|
|
2554
|
+
_this4.props.environment.removeEventListener('touchmove', onTouchMove);
|
|
2555
|
+
|
|
2556
|
+
_this4.props.environment.removeEventListener('touchend', onTouchEnd);
|
|
2463
2557
|
};
|
|
2464
2558
|
}
|
|
2465
2559
|
};
|