downshift 9.0.8 → 9.0.10
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 +10 -11
- package/dist/downshift.esm.js +10 -11
- package/dist/downshift.native.cjs.js +12 -24
- package/dist/downshift.nativeweb.cjs.js +10 -11
- package/dist/downshift.umd.js +13 -17
- 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 +13 -1
- package/preact/dist/downshift.cjs.js +10 -11
- package/preact/dist/downshift.esm.js +10 -11
- package/preact/dist/downshift.umd.js +13 -17
- 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/typings/index.d.ts +2 -2
package/dist/downshift.cjs.js
CHANGED
|
@@ -1290,7 +1290,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1290
1290
|
_proto.componentDidMount = function componentDidMount() {
|
|
1291
1291
|
var _this4 = this;
|
|
1292
1292
|
/* istanbul ignore if (react-native) */
|
|
1293
|
-
if (process.env.NODE_ENV !== 'production' &&
|
|
1293
|
+
if (process.env.NODE_ENV !== 'production' && true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
|
|
1294
1294
|
validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
@@ -1361,10 +1361,10 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
};
|
|
1363
1363
|
_proto.shouldScroll = function shouldScroll(prevState, prevProps) {
|
|
1364
|
-
var
|
|
1365
|
-
currentHighlightedIndex =
|
|
1366
|
-
var
|
|
1367
|
-
prevHighlightedIndex =
|
|
1364
|
+
var _ref0 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
|
|
1365
|
+
currentHighlightedIndex = _ref0.highlightedIndex;
|
|
1366
|
+
var _ref1 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
|
|
1367
|
+
prevHighlightedIndex = _ref1.highlightedIndex;
|
|
1368
1368
|
var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
|
|
1369
1369
|
var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
|
|
1370
1370
|
return scrollWhenOpen || scrollWhenNavigating;
|
|
@@ -1524,16 +1524,15 @@ process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
|
1524
1524
|
getItemId: PropTypes.func
|
|
1525
1525
|
/* eslint-enable react/no-unused-prop-types */
|
|
1526
1526
|
} : void 0;
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
var refKey = _ref12.refKey;
|
|
1527
|
+
function validateGetMenuPropsCalledCorrectly(node, _ref10) {
|
|
1528
|
+
var refKey = _ref10.refKey;
|
|
1530
1529
|
if (!node) {
|
|
1531
1530
|
// eslint-disable-next-line no-console
|
|
1532
1531
|
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
1533
1532
|
}
|
|
1534
1533
|
}
|
|
1535
|
-
function validateGetRootPropsCalledCorrectly(element,
|
|
1536
|
-
var refKey =
|
|
1534
|
+
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
1535
|
+
var refKey = _ref11.refKey;
|
|
1537
1536
|
var refKeySpecified = refKey !== 'ref';
|
|
1538
1537
|
var isComposite = !isDOMElement(element);
|
|
1539
1538
|
if (isComposite && !refKeySpecified && !reactIs.isForwardRef(element)) {
|
|
@@ -3873,7 +3872,7 @@ function useMultipleSelection(userProps) {
|
|
|
3873
3872
|
};
|
|
3874
3873
|
}
|
|
3875
3874
|
|
|
3876
|
-
exports.default = Downshift
|
|
3875
|
+
exports.default = Downshift;
|
|
3877
3876
|
exports.resetIdCounter = resetIdCounter;
|
|
3878
3877
|
exports.useCombobox = useCombobox;
|
|
3879
3878
|
exports.useMultipleSelection = useMultipleSelection;
|
package/dist/downshift.esm.js
CHANGED
|
@@ -1286,7 +1286,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1286
1286
|
_proto.componentDidMount = function componentDidMount() {
|
|
1287
1287
|
var _this4 = this;
|
|
1288
1288
|
/* istanbul ignore if (react-native) */
|
|
1289
|
-
if (process.env.NODE_ENV !== 'production' &&
|
|
1289
|
+
if (process.env.NODE_ENV !== 'production' && true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
|
|
1290
1290
|
validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
@@ -1357,10 +1357,10 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
};
|
|
1359
1359
|
_proto.shouldScroll = function shouldScroll(prevState, prevProps) {
|
|
1360
|
-
var
|
|
1361
|
-
currentHighlightedIndex =
|
|
1362
|
-
var
|
|
1363
|
-
prevHighlightedIndex =
|
|
1360
|
+
var _ref0 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
|
|
1361
|
+
currentHighlightedIndex = _ref0.highlightedIndex;
|
|
1362
|
+
var _ref1 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
|
|
1363
|
+
prevHighlightedIndex = _ref1.highlightedIndex;
|
|
1364
1364
|
var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
|
|
1365
1365
|
var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
|
|
1366
1366
|
return scrollWhenOpen || scrollWhenNavigating;
|
|
@@ -1520,16 +1520,15 @@ process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
|
1520
1520
|
getItemId: PropTypes.func
|
|
1521
1521
|
/* eslint-enable react/no-unused-prop-types */
|
|
1522
1522
|
} : void 0;
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
var refKey = _ref12.refKey;
|
|
1523
|
+
function validateGetMenuPropsCalledCorrectly(node, _ref10) {
|
|
1524
|
+
var refKey = _ref10.refKey;
|
|
1526
1525
|
if (!node) {
|
|
1527
1526
|
// eslint-disable-next-line no-console
|
|
1528
1527
|
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
1529
1528
|
}
|
|
1530
1529
|
}
|
|
1531
|
-
function validateGetRootPropsCalledCorrectly(element,
|
|
1532
|
-
var refKey =
|
|
1530
|
+
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
1531
|
+
var refKey = _ref11.refKey;
|
|
1533
1532
|
var refKeySpecified = refKey !== 'ref';
|
|
1534
1533
|
var isComposite = !isDOMElement(element);
|
|
1535
1534
|
if (isComposite && !refKeySpecified && !isForwardRef(element)) {
|
|
@@ -3869,4 +3868,4 @@ function useMultipleSelection(userProps) {
|
|
|
3869
3868
|
};
|
|
3870
3869
|
}
|
|
3871
3870
|
|
|
3872
|
-
export { Downshift
|
|
3871
|
+
export { Downshift as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };
|
|
@@ -1257,9 +1257,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1257
1257
|
_proto.componentDidMount = function componentDidMount() {
|
|
1258
1258
|
var _this4 = this;
|
|
1259
1259
|
/* istanbul ignore if (react-native) */
|
|
1260
|
-
if (process.env.NODE_ENV !== 'production' &&
|
|
1261
|
-
validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);
|
|
1262
|
-
}
|
|
1260
|
+
if (process.env.NODE_ENV !== 'production' && false) ;
|
|
1263
1261
|
|
|
1264
1262
|
/* istanbul ignore if (react-native or SSR) */
|
|
1265
1263
|
{
|
|
@@ -1269,10 +1267,10 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1269
1267
|
}
|
|
1270
1268
|
};
|
|
1271
1269
|
_proto.shouldScroll = function shouldScroll(prevState, prevProps) {
|
|
1272
|
-
var
|
|
1273
|
-
currentHighlightedIndex =
|
|
1274
|
-
var
|
|
1275
|
-
prevHighlightedIndex =
|
|
1270
|
+
var _ref0 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
|
|
1271
|
+
currentHighlightedIndex = _ref0.highlightedIndex;
|
|
1272
|
+
var _ref1 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
|
|
1273
|
+
prevHighlightedIndex = _ref1.highlightedIndex;
|
|
1276
1274
|
var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
|
|
1277
1275
|
var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
|
|
1278
1276
|
return scrollWhenOpen || scrollWhenNavigating;
|
|
@@ -1367,7 +1365,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1367
1365
|
return prevItem !== item;
|
|
1368
1366
|
},
|
|
1369
1367
|
environment: /* istanbul ignore next (ssr) */
|
|
1370
|
-
|
|
1368
|
+
undefined ,
|
|
1371
1369
|
stateReducer: function stateReducer(state, stateToSet) {
|
|
1372
1370
|
return stateToSet;
|
|
1373
1371
|
},
|
|
@@ -1423,16 +1421,8 @@ process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
|
1423
1421
|
getItemId: PropTypes.func
|
|
1424
1422
|
/* eslint-enable react/no-unused-prop-types */
|
|
1425
1423
|
} : void 0;
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
var refKey = _ref12.refKey;
|
|
1429
|
-
if (!node) {
|
|
1430
|
-
// eslint-disable-next-line no-console
|
|
1431
|
-
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
function validateGetRootPropsCalledCorrectly(element, _ref13) {
|
|
1435
|
-
var refKey = _ref13.refKey;
|
|
1424
|
+
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
1425
|
+
var refKey = _ref11.refKey;
|
|
1436
1426
|
var refKeySpecified = refKey !== 'ref';
|
|
1437
1427
|
var isComposite = !isDOMElement(element);
|
|
1438
1428
|
if (isComposite && !refKeySpecified && !reactIs.isForwardRef(element)) {
|
|
@@ -1643,7 +1633,7 @@ var defaultProps$3 = {
|
|
|
1643
1633
|
stateReducer: stateReducer,
|
|
1644
1634
|
scrollIntoView: scrollIntoView,
|
|
1645
1635
|
environment: /* istanbul ignore next (ssr) */
|
|
1646
|
-
|
|
1636
|
+
undefined
|
|
1647
1637
|
};
|
|
1648
1638
|
function getDefaultValue$1(props, propKey, defaultStateValues) {
|
|
1649
1639
|
if (defaultStateValues === void 0) {
|
|
@@ -1801,15 +1791,13 @@ function useA11yMessageStatus(getA11yStatusMessage, options, dependencyArray, en
|
|
|
1801
1791
|
environment = {};
|
|
1802
1792
|
}
|
|
1803
1793
|
var document = environment.document;
|
|
1804
|
-
|
|
1794
|
+
useIsInitialMount();
|
|
1805
1795
|
|
|
1806
1796
|
// Adds an a11y aria live status message if getA11yStatusMessage is passed.
|
|
1807
1797
|
React.useEffect(function () {
|
|
1808
|
-
|
|
1798
|
+
{
|
|
1809
1799
|
return;
|
|
1810
1800
|
}
|
|
1811
|
-
var status = getA11yStatusMessage(options);
|
|
1812
|
-
updateA11yStatus(status, document);
|
|
1813
1801
|
|
|
1814
1802
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1815
1803
|
}, dependencyArray);
|
|
@@ -3731,7 +3719,7 @@ function useMultipleSelection(userProps) {
|
|
|
3731
3719
|
};
|
|
3732
3720
|
}
|
|
3733
3721
|
|
|
3734
|
-
exports.default = Downshift
|
|
3722
|
+
exports.default = Downshift;
|
|
3735
3723
|
exports.resetIdCounter = resetIdCounter;
|
|
3736
3724
|
exports.useCombobox = useCombobox;
|
|
3737
3725
|
exports.useMultipleSelection = useMultipleSelection;
|
|
@@ -1288,7 +1288,7 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1288
1288
|
_proto.componentDidMount = function componentDidMount() {
|
|
1289
1289
|
var _this4 = this;
|
|
1290
1290
|
/* istanbul ignore if (react-native) */
|
|
1291
|
-
if (process.env.NODE_ENV !== 'production' &&
|
|
1291
|
+
if (process.env.NODE_ENV !== 'production' && true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
|
|
1292
1292
|
validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);
|
|
1293
1293
|
}
|
|
1294
1294
|
|
|
@@ -1359,10 +1359,10 @@ var Downshift = /*#__PURE__*/function () {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
};
|
|
1361
1361
|
_proto.shouldScroll = function shouldScroll(prevState, prevProps) {
|
|
1362
|
-
var
|
|
1363
|
-
currentHighlightedIndex =
|
|
1364
|
-
var
|
|
1365
|
-
prevHighlightedIndex =
|
|
1362
|
+
var _ref0 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
|
|
1363
|
+
currentHighlightedIndex = _ref0.highlightedIndex;
|
|
1364
|
+
var _ref1 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
|
|
1365
|
+
prevHighlightedIndex = _ref1.highlightedIndex;
|
|
1366
1366
|
var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
|
|
1367
1367
|
var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
|
|
1368
1368
|
return scrollWhenOpen || scrollWhenNavigating;
|
|
@@ -1522,16 +1522,15 @@ process.env.NODE_ENV !== "production" ? Downshift.propTypes = {
|
|
|
1522
1522
|
getItemId: PropTypes.func
|
|
1523
1523
|
/* eslint-enable react/no-unused-prop-types */
|
|
1524
1524
|
} : void 0;
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
var refKey = _ref12.refKey;
|
|
1525
|
+
function validateGetMenuPropsCalledCorrectly(node, _ref10) {
|
|
1526
|
+
var refKey = _ref10.refKey;
|
|
1528
1527
|
if (!node) {
|
|
1529
1528
|
// eslint-disable-next-line no-console
|
|
1530
1529
|
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
1531
1530
|
}
|
|
1532
1531
|
}
|
|
1533
|
-
function validateGetRootPropsCalledCorrectly(element,
|
|
1534
|
-
var refKey =
|
|
1532
|
+
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
1533
|
+
var refKey = _ref11.refKey;
|
|
1535
1534
|
var refKeySpecified = refKey !== 'ref';
|
|
1536
1535
|
var isComposite = !isDOMElement(element);
|
|
1537
1536
|
if (isComposite && !refKeySpecified && !reactIs.isForwardRef(element)) {
|
|
@@ -3856,7 +3855,7 @@ function useMultipleSelection(userProps) {
|
|
|
3856
3855
|
};
|
|
3857
3856
|
}
|
|
3858
3857
|
|
|
3859
|
-
exports.default = Downshift
|
|
3858
|
+
exports.default = Downshift;
|
|
3860
3859
|
exports.resetIdCounter = resetIdCounter;
|
|
3861
3860
|
exports.useCombobox = useCombobox;
|
|
3862
3861
|
exports.useMultipleSelection = useMultipleSelection;
|
package/dist/downshift.umd.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
if (null == r) return {};
|
|
9
9
|
var t = {};
|
|
10
10
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
11
|
-
if (e.
|
|
11
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
12
12
|
t[n] = r[n];
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
@@ -1356,7 +1356,7 @@
|
|
|
1356
1356
|
|
|
1357
1357
|
var reactIsExports = reactIs.exports;
|
|
1358
1358
|
|
|
1359
|
-
const t=t=>"object"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||"hidden"!==t)&&("visible"!==t&&"clip"!==t),n=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const o=getComputedStyle(t,null);return e(o.overflowY,n)||e(o.overflowX,n)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return !!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return
|
|
1359
|
+
const t=t=>"object"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||"hidden"!==t)&&("visible"!==t&&"clip"!==t),n=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const o=getComputedStyle(t,null);return e(o.overflowY,n)||e(o.overflowX,n)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return !!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return false},o=(t,e,n,o,l,r,i,s)=>r<t&&i>e||r>t&&i<e?0:r<=t&&s<=n||i>=e&&s>=n?r-t-o:i>e&&s<n||r<t&&s>n?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},r=(e,r)=>{var i,s,d,h;if("undefined"==typeof document)return [];const{inline:u,boundary:a,skipOverflowHiddenElements:g}=r,p="function"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W);}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,left:V}=(t=>{const e=window.getComputedStyle(t);return {top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=x-T,D="center"===u?R+E/2-V+B:"end"===u?C+B:R-V;const L=[];for(let t=0;t<w.length;t++){const e=w[t],{height:l,width:r,top:i,right:s,bottom:d,left:h}=e.getBoundingClientRect();if(x>=0&&R>=0&&I<=H&&C<=b&&(e===m&&!n(e)||x>=i&&I<=d&&R>=h&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V="offsetWidth"in e?e.offsetWidth-e.clientWidth-g-W:0,S="offsetHeight"in e?e.offsetHeight-e.clientHeight-p-T:0,X="offsetWidth"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,Y="offsetHeight"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B=o(M,M+H,H,p,T,M+k,M+k+v,v),F="start"===u?D:"center"===u?D-b/2:"end"===u?D-b:o(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else {B=o(i,d,l,p,T+S,k,k+v,v),F="start"===u?D-h-g:"center"===u?D-(h+r/2)+V/2:"end"===u?D-s+W+V:o(h,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:n}=e;B=0===Y?0:Math.max(0,Math.min(n+B/Y,e.scrollHeight-l/Y+S)),F=0===X?0:Math.max(0,Math.min(t+F/X,e.scrollWidth-r/X+V)),k+=n-B,D+=t-F;}L.push({el:e,top:B,left:F});}return L};
|
|
1360
1360
|
|
|
1361
1361
|
var idCounter = 0;
|
|
1362
1362
|
|
|
@@ -1383,10 +1383,7 @@
|
|
|
1383
1383
|
return;
|
|
1384
1384
|
}
|
|
1385
1385
|
var actions = r(node, {
|
|
1386
|
-
boundary: menuNode
|
|
1387
|
-
block: 'nearest',
|
|
1388
|
-
scrollMode: 'if-needed'
|
|
1389
|
-
});
|
|
1386
|
+
boundary: menuNode});
|
|
1390
1387
|
actions.forEach(function (_ref) {
|
|
1391
1388
|
var el = _ref.el,
|
|
1392
1389
|
top = _ref.top,
|
|
@@ -2704,10 +2701,10 @@
|
|
|
2704
2701
|
}
|
|
2705
2702
|
};
|
|
2706
2703
|
_proto.shouldScroll = function shouldScroll(prevState, prevProps) {
|
|
2707
|
-
var
|
|
2708
|
-
currentHighlightedIndex =
|
|
2709
|
-
var
|
|
2710
|
-
prevHighlightedIndex =
|
|
2704
|
+
var _ref0 = this.props.highlightedIndex === undefined ? this.getState() : this.props,
|
|
2705
|
+
currentHighlightedIndex = _ref0.highlightedIndex;
|
|
2706
|
+
var _ref1 = prevProps.highlightedIndex === undefined ? prevState : prevProps,
|
|
2707
|
+
prevHighlightedIndex = _ref1.highlightedIndex;
|
|
2711
2708
|
var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
|
|
2712
2709
|
var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
|
|
2713
2710
|
return scrollWhenOpen || scrollWhenNavigating;
|
|
@@ -2864,16 +2861,15 @@
|
|
|
2864
2861
|
getItemId: PropTypes.func
|
|
2865
2862
|
/* eslint-enable react/no-unused-prop-types */
|
|
2866
2863
|
} ;
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
var refKey = _ref12.refKey;
|
|
2864
|
+
function validateGetMenuPropsCalledCorrectly(node, _ref10) {
|
|
2865
|
+
var refKey = _ref10.refKey;
|
|
2870
2866
|
if (!node) {
|
|
2871
2867
|
// eslint-disable-next-line no-console
|
|
2872
2868
|
console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
|
|
2873
2869
|
}
|
|
2874
2870
|
}
|
|
2875
|
-
function validateGetRootPropsCalledCorrectly(element,
|
|
2876
|
-
var refKey =
|
|
2871
|
+
function validateGetRootPropsCalledCorrectly(element, _ref11) {
|
|
2872
|
+
var refKey = _ref11.refKey;
|
|
2877
2873
|
var refKeySpecified = refKey !== 'ref';
|
|
2878
2874
|
var isComposite = !isDOMElement(element);
|
|
2879
2875
|
if (isComposite && !refKeySpecified && !reactIsExports.isForwardRef(element)) {
|
|
@@ -3542,7 +3538,7 @@
|
|
|
3542
3538
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3543
3539
|
PERFORMANCE OF THIS SOFTWARE.
|
|
3544
3540
|
***************************************************************************** */
|
|
3545
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
3541
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
3546
3542
|
|
|
3547
3543
|
|
|
3548
3544
|
var __assign = function() {
|
|
@@ -5246,7 +5242,7 @@
|
|
|
5246
5242
|
};
|
|
5247
5243
|
}
|
|
5248
5244
|
|
|
5249
|
-
exports.default = Downshift
|
|
5245
|
+
exports.default = Downshift;
|
|
5250
5246
|
exports.resetIdCounter = resetIdCounter;
|
|
5251
5247
|
exports.useCombobox = useCombobox;
|
|
5252
5248
|
exports.useMultipleSelection = useMultipleSelection;
|