@moda/om 19.4.3 → 19.6.0

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.esm.js CHANGED
@@ -1015,7 +1015,7 @@ function _arrayWithoutHoles(r) {
1015
1015
  function _createForOfIteratorHelper(r, e) {
1016
1016
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1017
1017
  if (!t) {
1018
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
1018
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
1019
1019
  t && (r = t);
1020
1020
  var n = 0,
1021
1021
  F = function () {};
@@ -1143,8 +1143,8 @@ function _objectWithoutProperties(e, t) {
1143
1143
  r,
1144
1144
  i = _objectWithoutPropertiesLoose(e, t);
1145
1145
  if (Object.getOwnPropertySymbols) {
1146
- var n = Object.getOwnPropertySymbols(e);
1147
- for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1146
+ var s = Object.getOwnPropertySymbols(e);
1147
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1148
1148
  }
1149
1149
  return i;
1150
1150
  }
@@ -1152,7 +1152,7 @@ function _objectWithoutPropertiesLoose(r, e) {
1152
1152
  if (null == r) return {};
1153
1153
  var t = {};
1154
1154
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1155
- if (e.indexOf(n) >= 0) continue;
1155
+ if (e.includes(n)) continue;
1156
1156
  t[n] = r[n];
1157
1157
  }
1158
1158
  return t;
@@ -3324,24 +3324,24 @@ var isInert = function isInert(node) {
3324
3324
  var isVisibleUncached = function isVisibleUncached(node, checkParent) {
3325
3325
  return !node || isTopNode(node) || !isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node));
3326
3326
  };
3327
- var isVisibleCached = function isVisibleCached(visibilityCache, node) {
3327
+ var _isVisibleCached = function isVisibleCached(visibilityCache, node) {
3328
3328
  var cached = visibilityCache.get(node);
3329
3329
  if (cached !== undefined) {
3330
3330
  return cached;
3331
3331
  }
3332
- var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));
3332
+ var result = isVisibleUncached(node, _isVisibleCached.bind(undefined, visibilityCache));
3333
3333
  visibilityCache.set(node, result);
3334
3334
  return result;
3335
3335
  };
3336
3336
  var isAutoFocusAllowedUncached = function isAutoFocusAllowedUncached(node, checkParent) {
3337
3337
  return node && !isTopNode(node) ? isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false : true;
3338
3338
  };
3339
- var isAutoFocusAllowedCached = function isAutoFocusAllowedCached(cache, node) {
3339
+ var _isAutoFocusAllowedCached = function isAutoFocusAllowedCached(cache, node) {
3340
3340
  var cached = cache.get(node);
3341
3341
  if (cached !== undefined) {
3342
3342
  return cached;
3343
3343
  }
3344
- var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));
3344
+ var result = isAutoFocusAllowedUncached(node, _isAutoFocusAllowedCached.bind(undefined, cache));
3345
3345
  cache.set(node, result);
3346
3346
  return result;
3347
3347
  };
@@ -3425,9 +3425,9 @@ var tabbables = ['button:enabled', 'select:enabled', 'textarea:enabled', 'input:
3425
3425
 
3426
3426
  var queryTabbables = tabbables.join(',');
3427
3427
  var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]");
3428
- var getFocusablesWithShadowDom = function getFocusablesWithShadowDom(parent, withGuards) {
3428
+ var _getFocusablesWithShadowDom = function getFocusablesWithShadowDom(parent, withGuards) {
3429
3429
  return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {
3430
- return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));
3430
+ return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], _getFocusablesWithShadowDom(child));
3431
3431
  }, []);
3432
3432
  };
3433
3433
  var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuards) {
@@ -3441,7 +3441,7 @@ var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuard
3441
3441
  var getFocusables = function getFocusables(parents, withGuards) {
3442
3442
  return parents.reduce(function (acc, parent) {
3443
3443
  var _a;
3444
- var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);
3444
+ var focusableWithShadowDom = _getFocusablesWithShadowDom(parent, withGuards);
3445
3445
  var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) {
3446
3446
  return getFocusablesWithIFrame(node, withGuards);
3447
3447
  }));
@@ -3474,7 +3474,7 @@ var getParentAutofocusables = function getParentAutofocusables(parent) {
3474
3474
  */
3475
3475
  var filterFocusable = function filterFocusable(nodes, visibilityCache) {
3476
3476
  return toArray(nodes).filter(function (node) {
3477
- return isVisibleCached(visibilityCache, node);
3477
+ return _isVisibleCached(visibilityCache, node);
3478
3478
  }).filter(function (node) {
3479
3479
  return notHiddenInput(node);
3480
3480
  });
@@ -3484,7 +3484,7 @@ var filterAutoFocusable = function filterAutoFocusable(nodes, cache) {
3484
3484
  cache = new Map();
3485
3485
  }
3486
3486
  return toArray(nodes).filter(function (node) {
3487
- return isAutoFocusAllowedCached(cache, node);
3487
+ return _isAutoFocusAllowedCached(cache, node);
3488
3488
  });
3489
3489
  };
3490
3490
  /**
@@ -3524,9 +3524,9 @@ var parentAutofocusables = function parentAutofocusables(topNode, visibilityCach
3524
3524
  /*
3525
3525
  * Determines if element is contained in scope, including nested shadow DOMs
3526
3526
  */
3527
- var contains$1 = function contains(scope, element) {
3527
+ var _contains = function contains(scope, element) {
3528
3528
  if (scope.shadowRoot) {
3529
- return contains(scope.shadowRoot, element);
3529
+ return _contains(scope.shadowRoot, element);
3530
3530
  } else {
3531
3531
  if (Object.getPrototypeOf(scope).contains !== undefined && Object.getPrototypeOf(scope).contains.call(scope, element)) {
3532
3532
  return true;
@@ -3536,11 +3536,11 @@ var contains$1 = function contains(scope, element) {
3536
3536
  if (child instanceof HTMLIFrameElement) {
3537
3537
  var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;
3538
3538
  if (iframeBody) {
3539
- return contains(iframeBody, element);
3539
+ return _contains(iframeBody, element);
3540
3540
  }
3541
3541
  return false;
3542
3542
  }
3543
- return contains(child, element);
3543
+ return _contains(child, element);
3544
3544
  });
3545
3545
  }
3546
3546
  };
@@ -3577,8 +3577,8 @@ var filterNested = function filterNested(nodes) {
3577
3577
  * @param node
3578
3578
  * @returns {*}
3579
3579
  */
3580
- var getTopParent = function getTopParent(node) {
3581
- return node.parentNode ? getTopParent(node.parentNode) : node;
3580
+ var _getTopParent = function getTopParent(node) {
3581
+ return node.parentNode ? _getTopParent(node.parentNode) : node;
3582
3582
  };
3583
3583
  /**
3584
3584
  * returns all "focus containers" inside a given node
@@ -3589,7 +3589,7 @@ var getAllAffectedNodes = function getAllAffectedNodes(node) {
3589
3589
  var nodes = asArray(node);
3590
3590
  return nodes.filter(Boolean).reduce(function (acc, currentNode) {
3591
3591
  var group = currentNode.getAttribute(FOCUS_GROUP);
3592
- acc.push.apply(acc, group ? filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [currentNode]);
3592
+ acc.push.apply(acc, group ? filterNested(toArray(_getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [currentNode]);
3593
3593
  return acc;
3594
3594
  }, []);
3595
3595
  };
@@ -3609,7 +3609,7 @@ var safeProbe = function safeProbe(cb) {
3609
3609
  * returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it
3610
3610
  * @param [inDocument]
3611
3611
  */
3612
- var getActiveElement = function getActiveElement(inDocument) {
3612
+ var _getActiveElement = function getActiveElement(inDocument) {
3613
3613
  if (inDocument === void 0) {
3614
3614
  inDocument = document;
3615
3615
  }
@@ -3617,9 +3617,9 @@ var getActiveElement = function getActiveElement(inDocument) {
3617
3617
  return undefined;
3618
3618
  }
3619
3619
  var activeElement = inDocument.activeElement;
3620
- return activeElement.shadowRoot ? getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () {
3620
+ return activeElement.shadowRoot ? _getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () {
3621
3621
  return activeElement.contentWindow.document;
3622
- }) ? getActiveElement(activeElement.contentWindow.document) : activeElement;
3622
+ }) ? _getActiveElement(activeElement.contentWindow.document) : activeElement;
3623
3623
  };
3624
3624
 
3625
3625
  var focusInFrame = function focusInFrame(frame, activeElement) {
@@ -3637,13 +3637,13 @@ var focusInsideIframe = function focusInsideIframe(topNode, activeElement) {
3637
3637
  var focusInside = function focusInside(topNode, activeElement) {
3638
3638
  // const activeElement = document && getActiveElement();
3639
3639
  if (activeElement === void 0) {
3640
- activeElement = getActiveElement(getFirst(topNode).ownerDocument);
3640
+ activeElement = _getActiveElement(getFirst(topNode).ownerDocument);
3641
3641
  }
3642
3642
  if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) {
3643
3643
  return false;
3644
3644
  }
3645
3645
  return getAllAffectedNodes(topNode).some(function (node) {
3646
- return contains$1(node, activeElement) || focusInsideIframe(node, activeElement);
3646
+ return _contains(node, activeElement) || focusInsideIframe(node, activeElement);
3647
3647
  });
3648
3648
  };
3649
3649
 
@@ -3659,13 +3659,13 @@ var focusIsHidden = function focusIsHidden(inDocument) {
3659
3659
  if (inDocument === void 0) {
3660
3660
  inDocument = document;
3661
3661
  }
3662
- var activeElement = getActiveElement(inDocument);
3662
+ var activeElement = _getActiveElement(inDocument);
3663
3663
  if (!activeElement) {
3664
3664
  return false;
3665
3665
  }
3666
3666
  // this does not support setting FOCUS_ALLOW within shadow dom
3667
3667
  return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) {
3668
- return contains$1(node, activeElement);
3668
+ return _contains(node, activeElement);
3669
3669
  });
3670
3670
  };
3671
3671
 
@@ -3818,13 +3818,13 @@ var pickAutofocus = function pickAutofocus(nodesIndexes, orderedNodes, groups) {
3818
3818
  return pickFirstFocus(filterAutoFocusable(orderedNodes));
3819
3819
  };
3820
3820
 
3821
- var getParents = function getParents(node, parents) {
3821
+ var _getParents = function getParents(node, parents) {
3822
3822
  if (parents === void 0) {
3823
3823
  parents = [];
3824
3824
  }
3825
3825
  parents.push(node);
3826
3826
  if (node.parentNode) {
3827
- getParents(node.parentNode.host || node.parentNode, parents);
3827
+ _getParents(node.parentNode.host || node.parentNode, parents);
3828
3828
  }
3829
3829
  return parents;
3830
3830
  };
@@ -3835,8 +3835,8 @@ var getParents = function getParents(node, parents) {
3835
3835
  * @returns {boolean|*}
3836
3836
  */
3837
3837
  var getCommonParent = function getCommonParent(nodeA, nodeB) {
3838
- var parentsA = getParents(nodeA);
3839
- var parentsB = getParents(nodeB);
3838
+ var parentsA = _getParents(nodeA);
3839
+ var parentsB = _getParents(nodeB);
3840
3840
  // tslint:disable-next-line:prefer-for-of
3841
3841
  for (var i = 0; i < parentsA.length; i += 1) {
3842
3842
  var currentParent = parentsA[i];
@@ -3856,7 +3856,7 @@ var getTopCommonParent = function getTopCommonParent(baseActiveElement, leftEntr
3856
3856
  rightEntries.filter(Boolean).forEach(function (subEntry) {
3857
3857
  var common = getCommonParent(activeElement, subEntry);
3858
3858
  if (common) {
3859
- if (!topCommon || contains$1(common, topCommon)) {
3859
+ if (!topCommon || _contains(common, topCommon)) {
3860
3860
  topCommon = common;
3861
3861
  } else {
3862
3862
  topCommon = getCommonParent(common, topCommon);
@@ -3900,7 +3900,7 @@ var reorderNodes = function reorderNodes(srcNodes, dstNodes) {
3900
3900
  * @param lastNode
3901
3901
  */
3902
3902
  var focusSolver = function focusSolver(topNode, lastNode) {
3903
- var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
3903
+ var activeElement = _getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
3904
3904
  var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
3905
3905
  var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
3906
3906
  var visibilityCache = new Map();
@@ -4133,7 +4133,7 @@ var getRelativeFocusable = function getRelativeFocusable(element, scope, useTabb
4133
4133
  }
4134
4134
  var shards = asArray(scope);
4135
4135
  if (shards.every(function (shard) {
4136
- return !contains$1(shard, element);
4136
+ return !_contains(shard, element);
4137
4137
  })) {
4138
4138
  console.error('Active element is not contained in the scope');
4139
4139
  return {};
@@ -4749,9 +4749,9 @@ var handleScroll = function handleScroll(axis, endTarget, event, sourceDelta, no
4749
4749
  // self content
4750
4750
  targetInLock && (endTarget.contains(target) || endTarget === target));
4751
4751
  // handle epsilon around 0 (non standard zoom levels)
4752
- if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll )) {
4752
+ if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll)) {
4753
4753
  shouldCancelScroll = true;
4754
- } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll )) {
4754
+ } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll)) {
4755
4755
  shouldCancelScroll = true;
4756
4756
  }
4757
4757
  return shouldCancelScroll;
@@ -4945,15 +4945,15 @@ var counterMap = new WeakMap();
4945
4945
  var uncontrolledNodes = new WeakMap();
4946
4946
  var markerMap = {};
4947
4947
  var lockCount = 0;
4948
- var unwrapHost = function unwrapHost(node) {
4949
- return node && (node.host || unwrapHost(node.parentNode));
4948
+ var _unwrapHost = function unwrapHost(node) {
4949
+ return node && (node.host || _unwrapHost(node.parentNode));
4950
4950
  };
4951
4951
  var correctTargets = function correctTargets(parent, targets) {
4952
4952
  return targets.map(function (target) {
4953
4953
  if (parent.contains(target)) {
4954
4954
  return target;
4955
4955
  }
4956
- var correctedTarget = unwrapHost(target);
4956
+ var correctedTarget = _unwrapHost(target);
4957
4957
  if (correctedTarget && parent.contains(correctedTarget)) {
4958
4958
  return correctedTarget;
4959
4959
  }
@@ -4980,21 +4980,21 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
4980
4980
  var hiddenNodes = [];
4981
4981
  var elementsToKeep = new Set();
4982
4982
  var elementsToStop = new Set(targets);
4983
- var keep = function keep(el) {
4983
+ var _keep = function keep(el) {
4984
4984
  if (!el || elementsToKeep.has(el)) {
4985
4985
  return;
4986
4986
  }
4987
4987
  elementsToKeep.add(el);
4988
- keep(el.parentNode);
4988
+ _keep(el.parentNode);
4989
4989
  };
4990
- targets.forEach(keep);
4991
- var deep = function deep(parent) {
4990
+ targets.forEach(_keep);
4991
+ var _deep = function deep(parent) {
4992
4992
  if (!parent || elementsToStop.has(parent)) {
4993
4993
  return;
4994
4994
  }
4995
4995
  Array.prototype.forEach.call(parent.children, function (node) {
4996
4996
  if (elementsToKeep.has(node)) {
4997
- deep(node);
4997
+ _deep(node);
4998
4998
  } else {
4999
4999
  var attr = node.getAttribute(controlAttribute);
5000
5000
  var alreadyHidden = attr !== null && attr !== 'false';
@@ -5015,7 +5015,7 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
5015
5015
  }
5016
5016
  });
5017
5017
  };
5018
- deep(parentNode);
5018
+ _deep(parentNode);
5019
5019
  elementsToKeep.clear();
5020
5020
  lockCount++;
5021
5021
  return function () {
@@ -5479,12 +5479,8 @@ var T = function T() {
5479
5479
  return true;
5480
5480
  };
5481
5481
 
5482
- var _placeholder = {
5483
- '@@functional/placeholder': true
5484
- };
5485
-
5486
5482
  function _isPlaceholder(a) {
5487
- return a === _placeholder;
5483
+ return a != null && _typeof$1(a) === 'object' && a['@@functional/placeholder'] === true;
5488
5484
  }
5489
5485
 
5490
5486
  /**
@@ -10146,7 +10142,7 @@ var Search20 = function Search20(_a) {
10146
10142
  };
10147
10143
  Search20.displayName = 'Search20';
10148
10144
 
10149
- var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "value"];
10145
+ var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value"];
10150
10146
  var DEFAULT_INPUT_VALUE = '';
10151
10147
  var SearchInput = function SearchInput(_ref) {
10152
10148
  var className = _ref.className,
@@ -10154,6 +10150,8 @@ var SearchInput = function SearchInput(_ref) {
10154
10150
  onClear = _ref.onClear,
10155
10151
  _ref$roundBorders = _ref.roundBorders,
10156
10152
  roundBorders = _ref$roundBorders === void 0 ? false : _ref$roundBorders,
10153
+ _ref$noBorders = _ref.noBorders,
10154
+ noBorders = _ref$noBorders === void 0 ? false : _ref$noBorders,
10157
10155
  _ref$value = _ref.value,
10158
10156
  value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
10159
10157
  rest = _objectWithoutProperties(_ref, _excluded$l);
@@ -10182,7 +10180,8 @@ var SearchInput = function SearchInput(_ref) {
10182
10180
  className: "SearchInput__icon"
10183
10181
  }, /*#__PURE__*/React__default.createElement(Search20, null)), /*#__PURE__*/React__default.createElement(TextInput, _extends$1({
10184
10182
  className: classNames('SearchInput__input', {
10185
- 'SearchInput__input--round-borders': roundBorders
10183
+ 'SearchInput__input--round-borders': roundBorders,
10184
+ 'SearchInput__input--no-borders': noBorders
10186
10185
  }),
10187
10186
  onChange: handleChange,
10188
10187
  value: controlledValue,