@moda/om 19.7.1 → 19.7.2

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/index.cjs.js CHANGED
@@ -1744,18 +1744,13 @@ RemoveScroll.classNames = {
1744
1744
  };
1745
1745
 
1746
1746
  function _extends() {
1747
- _extends = Object.assign ? Object.assign.bind() : function (target) {
1748
- for (var i = 1; i < arguments.length; i++) {
1749
- var source = arguments[i];
1750
- for (var key in source) {
1751
- if (Object.prototype.hasOwnProperty.call(source, key)) {
1752
- target[key] = source[key];
1753
- }
1754
- }
1747
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
1748
+ for (var e = 1; e < arguments.length; e++) {
1749
+ var t = arguments[e];
1750
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
1755
1751
  }
1756
- return target;
1757
- };
1758
- return _extends.apply(this, arguments);
1752
+ return n;
1753
+ }, _extends.apply(null, arguments);
1759
1754
  }
1760
1755
 
1761
1756
  var propTypes = {exports: {}};
@@ -3182,18 +3177,14 @@ var FocusOn$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, parent
3182
3177
  }))));
3183
3178
  });
3184
3179
 
3185
- function _setPrototypeOf(o, p) {
3186
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
3187
- o.__proto__ = p;
3188
- return o;
3189
- };
3190
- return _setPrototypeOf(o, p);
3180
+ function _setPrototypeOf(t, e) {
3181
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
3182
+ return t.__proto__ = e, t;
3183
+ }, _setPrototypeOf(t, e);
3191
3184
  }
3192
3185
 
3193
- function _inheritsLoose(subClass, superClass) {
3194
- subClass.prototype = Object.create(superClass.prototype);
3195
- subClass.prototype.constructor = subClass;
3196
- _setPrototypeOf(subClass, superClass);
3186
+ function _inheritsLoose(t, o) {
3187
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
3197
3188
  }
3198
3189
 
3199
3190
  function _typeof(o) {
@@ -3222,19 +3213,13 @@ function toPropertyKey(t) {
3222
3213
  return "symbol" == _typeof(i) ? i : i + "";
3223
3214
  }
3224
3215
 
3225
- function _defineProperty(obj, key, value) {
3226
- key = toPropertyKey(key);
3227
- if (key in obj) {
3228
- Object.defineProperty(obj, key, {
3229
- value: value,
3230
- enumerable: true,
3231
- configurable: true,
3232
- writable: true
3233
- });
3234
- } else {
3235
- obj[key] = value;
3236
- }
3237
- return obj;
3216
+ function _defineProperty(e, r, t) {
3217
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
3218
+ value: t,
3219
+ enumerable: !0,
3220
+ configurable: !0,
3221
+ writable: !0
3222
+ }) : e[r] = t, e;
3238
3223
  }
3239
3224
 
3240
3225
  function withSideEffect(reducePropsToState, handleStateChangeOnClient) {
@@ -4675,6 +4660,9 @@ var alwaysContainsScroll = function alwaysContainsScroll(node) {
4675
4660
  return node.tagName === 'TEXTAREA';
4676
4661
  };
4677
4662
  var elementCanBeScrolled = function elementCanBeScrolled(node, overflow) {
4663
+ if (!(node instanceof Element)) {
4664
+ return false;
4665
+ }
4678
4666
  var styles = window.getComputedStyle(node);
4679
4667
  return (
4680
4668
  // not-not-scrollable
@@ -4700,9 +4688,9 @@ var locationCouldBeScrolled = function locationCouldBeScrolled(axis, node) {
4700
4688
  var isScrollable = elementCouldBeScrolled(axis, current);
4701
4689
  if (isScrollable) {
4702
4690
  var _a = getScrollVariables(axis, current),
4703
- s = _a[1],
4704
- d = _a[2];
4705
- if (s > d) {
4691
+ scrollHeight = _a[1],
4692
+ clientHeight = _a[2];
4693
+ if (scrollHeight > clientHeight) {
4706
4694
  return true;
4707
4695
  }
4708
4696
  }
@@ -5016,21 +5004,25 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
5016
5004
  if (elementsToKeep.has(node)) {
5017
5005
  _deep(node);
5018
5006
  } else {
5019
- var attr = node.getAttribute(controlAttribute);
5020
- var alreadyHidden = attr !== null && attr !== 'false';
5021
- var counterValue = (counterMap.get(node) || 0) + 1;
5022
- var markerValue = (markerCounter.get(node) || 0) + 1;
5023
- counterMap.set(node, counterValue);
5024
- markerCounter.set(node, markerValue);
5025
- hiddenNodes.push(node);
5026
- if (counterValue === 1 && alreadyHidden) {
5027
- uncontrolledNodes.set(node, true);
5028
- }
5029
- if (markerValue === 1) {
5030
- node.setAttribute(markerName, 'true');
5031
- }
5032
- if (!alreadyHidden) {
5033
- node.setAttribute(controlAttribute, 'true');
5007
+ try {
5008
+ var attr = node.getAttribute(controlAttribute);
5009
+ var alreadyHidden = attr !== null && attr !== 'false';
5010
+ var counterValue = (counterMap.get(node) || 0) + 1;
5011
+ var markerValue = (markerCounter.get(node) || 0) + 1;
5012
+ counterMap.set(node, counterValue);
5013
+ markerCounter.set(node, markerValue);
5014
+ hiddenNodes.push(node);
5015
+ if (counterValue === 1 && alreadyHidden) {
5016
+ uncontrolledNodes.set(node, true);
5017
+ }
5018
+ if (markerValue === 1) {
5019
+ node.setAttribute(markerName, 'true');
5020
+ }
5021
+ if (!alreadyHidden) {
5022
+ node.setAttribute(controlAttribute, 'true');
5023
+ }
5024
+ } catch (e) {
5025
+ console.error('aria-hidden: cannot operate on ', node, e);
5034
5026
  }
5035
5027
  }
5036
5028
  });