downshift 9.0.8 → 9.0.9

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.
@@ -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' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
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
 
@@ -1524,7 +1524,6 @@ 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
- var Downshift$1 = Downshift;
1528
1527
  function validateGetMenuPropsCalledCorrectly(node, _ref12) {
1529
1528
  var refKey = _ref12.refKey;
1530
1529
  if (!node) {
@@ -3873,7 +3872,7 @@ function useMultipleSelection(userProps) {
3873
3872
  };
3874
3873
  }
3875
3874
 
3876
- exports.default = Downshift$1;
3875
+ exports.default = Downshift;
3877
3876
  exports.resetIdCounter = resetIdCounter;
3878
3877
  exports.useCombobox = useCombobox;
3879
3878
  exports.useMultipleSelection = useMultipleSelection;
@@ -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' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
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
 
@@ -1520,7 +1520,6 @@ 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
- var Downshift$1 = Downshift;
1524
1523
  function validateGetMenuPropsCalledCorrectly(node, _ref12) {
1525
1524
  var refKey = _ref12.refKey;
1526
1525
  if (!node) {
@@ -3869,4 +3868,4 @@ function useMultipleSelection(userProps) {
3869
3868
  };
3870
3869
  }
3871
3870
 
3872
- export { Downshift$1 as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };
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' && !true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
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
  {
@@ -1367,7 +1365,7 @@ var Downshift = /*#__PURE__*/function () {
1367
1365
  return prevItem !== item;
1368
1366
  },
1369
1367
  environment: /* istanbul ignore next (ssr) */
1370
- typeof window === 'undefined' || true ? undefined : window,
1368
+ undefined ,
1371
1369
  stateReducer: function stateReducer(state, stateToSet) {
1372
1370
  return stateToSet;
1373
1371
  },
@@ -1423,14 +1421,6 @@ 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
- var Downshift$1 = Downshift;
1427
- function validateGetMenuPropsCalledCorrectly(node, _ref12) {
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
1424
  function validateGetRootPropsCalledCorrectly(element, _ref13) {
1435
1425
  var refKey = _ref13.refKey;
1436
1426
  var refKeySpecified = refKey !== 'ref';
@@ -1643,7 +1633,7 @@ var defaultProps$3 = {
1643
1633
  stateReducer: stateReducer,
1644
1634
  scrollIntoView: scrollIntoView,
1645
1635
  environment: /* istanbul ignore next (ssr) */
1646
- typeof window === 'undefined' || true ? undefined : window
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
- var isInitialMount = useIsInitialMount();
1794
+ useIsInitialMount();
1805
1795
 
1806
1796
  // Adds an a11y aria live status message if getA11yStatusMessage is passed.
1807
1797
  React.useEffect(function () {
1808
- if (!getA11yStatusMessage || isInitialMount || true || !document) {
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$1;
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' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {
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
 
@@ -1522,7 +1522,6 @@ 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
- var Downshift$1 = Downshift;
1526
1525
  function validateGetMenuPropsCalledCorrectly(node, _ref12) {
1527
1526
  var refKey = _ref12.refKey;
1528
1527
  if (!node) {
@@ -3856,7 +3855,7 @@ function useMultipleSelection(userProps) {
3856
3855
  };
3857
3856
  }
3858
3857
 
3859
- exports.default = Downshift$1;
3858
+ exports.default = Downshift;
3860
3859
  exports.resetIdCounter = resetIdCounter;
3861
3860
  exports.useCombobox = useCombobox;
3862
3861
  exports.useMultipleSelection = useMultipleSelection;
@@ -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.includes(n)) continue;
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 !1},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{scrollMode:c,block:f,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,bottom:F,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="start"===f||"nearest"===f?x-T:"end"===f?I+F:x+v/2-T+F,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:n,width:l,top:r,right:i,bottom:s,left:d}=e.getBoundingClientRect();if("if-needed"===c&&x>=0&&R>=0&&I<=H&&C<=b&&x>=r&&I<=s&&R>=d&&C<=i)return L;const h=getComputedStyle(e),a=parseInt(h.borderLeftWidth,10),g=parseInt(h.borderTopWidth,10),p=parseInt(h.borderRightWidth,10),W=parseInt(h.borderBottomWidth,10);let T=0,B=0;const F="offsetWidth"in e?e.offsetWidth-e.clientWidth-a-p:0,V="offsetHeight"in e?e.offsetHeight-e.clientHeight-g-W:0,S="offsetWidth"in e?0===e.offsetWidth?0:l/e.offsetWidth:0,X="offsetHeight"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(m===e)T="start"===f?k:"end"===f?k-H:"nearest"===f?o(M,M+H,H,g,W,M+k,M+k+v,v):k-H/2,B="start"===u?D:"center"===u?D-b/2:"end"===u?D-b:o(y,y+b,b,a,p,y+D,y+D+E,E),T=Math.max(0,T+M),B=Math.max(0,B+y);else {T="start"===f?k-r-g:"end"===f?k-s+W+V:"nearest"===f?o(r,s,n,g,W+V,k,k+v,v):k-(r+n/2)+V/2,B="start"===u?D-d-a:"center"===u?D-(d+l/2)+F/2:"end"===u?D-i+p+F:o(d,i,l,a,p+F,D,D+E,E);const{scrollLeft:t,scrollTop:h}=e;T=0===X?0:Math.max(0,Math.min(h+T/X,e.scrollHeight-n/X+V)),B=0===S?0:Math.max(0,Math.min(t+B/S,e.scrollWidth-l/S+F)),k+=h-T,D+=t-B;}L.push({el:e,top:T,left:B});}return L};
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,
@@ -2864,7 +2861,6 @@
2864
2861
  getItemId: PropTypes.func
2865
2862
  /* eslint-enable react/no-unused-prop-types */
2866
2863
  } ;
2867
- var Downshift$1 = Downshift;
2868
2864
  function validateGetMenuPropsCalledCorrectly(node, _ref12) {
2869
2865
  var refKey = _ref12.refKey;
2870
2866
  if (!node) {
@@ -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$1;
5245
+ exports.default = Downshift;
5250
5246
  exports.resetIdCounter = resetIdCounter;
5251
5247
  exports.useCombobox = useCombobox;
5252
5248
  exports.useMultipleSelection = useMultipleSelection;