@openeuropa/bcl-theme-joinup 1.10.1 → 1.10.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.
@@ -196,7 +196,7 @@ const noop = () => {};
196
196
  * @param {HTMLElement} element
197
197
  * @return void
198
198
  *
199
- * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
199
+ * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
200
200
  */
201
201
  const reflow = element => {
202
202
  element.offsetHeight; // eslint-disable-line no-unused-expressions
@@ -241,7 +241,7 @@ const defineJQueryPlugin$1 = plugin => {
241
241
  });
242
242
  };
243
243
  const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
244
- return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;
244
+ return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue;
245
245
  };
246
246
  const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
247
247
  if (!waitForTransition) {
@@ -563,7 +563,7 @@ const Manipulator$1 = {
563
563
  const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
564
564
  for (const key of bsKeys) {
565
565
  let pureKey = key.replace(/^bs/, '');
566
- pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
566
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1);
567
567
  attributes[pureKey] = normalizeData$1(element.dataset[key]);
568
568
  }
569
569
  return attributes;
@@ -638,7 +638,7 @@ class Config {
638
638
  * Constants
639
639
  */
640
640
 
641
- const VERSION = '5.3.3';
641
+ const VERSION = '5.3.6';
642
642
 
643
643
  /**
644
644
  * Class definition
@@ -664,6 +664,8 @@ class BaseComponent extends Config {
664
664
  this[propertyName] = null;
665
665
  }
666
666
  }
667
+
668
+ // Private
667
669
  _queueCallback(callback, element, isAnimated = true) {
668
670
  executeAfterTransition(callback, element, isAnimated);
669
671
  }
@@ -1595,11 +1597,11 @@ class Collapse extends BaseComponent {
1595
1597
  this._element.style[dimension] = '';
1596
1598
  this._queueCallback(complete, this._element, true);
1597
1599
  }
1600
+
1601
+ // Private
1598
1602
  _isShown(element = this._element) {
1599
1603
  return element.classList.contains(CLASS_NAME_SHOW$7);
1600
1604
  }
1601
-
1602
- // Private
1603
1605
  _configAfterMerge(config) {
1604
1606
  config.toggle = Boolean(config.toggle); // Coerce string values
1605
1607
  config.parent = getElement$1(config.parent);
@@ -1842,6 +1844,9 @@ class Dropdown extends BaseComponent {
1842
1844
  this._element.setAttribute('aria-expanded', 'false');
1843
1845
  Manipulator$1.removeDataAttribute(this._menu, 'popper');
1844
1846
  EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);
1847
+
1848
+ // Explicitly return focus to the trigger element
1849
+ this._element.focus();
1845
1850
  }
1846
1851
  _getConfig(config) {
1847
1852
  config = super._getConfig(config);
@@ -1853,7 +1858,7 @@ class Dropdown extends BaseComponent {
1853
1858
  }
1854
1859
  _createPopper() {
1855
1860
  if (typeof Popper === 'undefined') {
1856
- throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
1861
+ throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org/docs/v2/)');
1857
1862
  }
1858
1863
  let referenceElement = this._element;
1859
1864
  if (this._config.reference === 'parent') {
@@ -1932,7 +1937,7 @@ class Dropdown extends BaseComponent {
1932
1937
  }
1933
1938
  return {
1934
1939
  ...defaultBsPopperConfig,
1935
- ...execute(this._config.popperConfig, [defaultBsPopperConfig])
1940
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
1936
1941
  };
1937
1942
  }
1938
1943
  _selectMenuItem({
@@ -3382,7 +3387,7 @@ class TemplateFactory extends Config {
3382
3387
  return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
3383
3388
  }
3384
3389
  _resolvePossibleFunction(arg) {
3385
- return execute(arg, [this]);
3390
+ return execute(arg, [undefined, this]);
3386
3391
  }
3387
3392
  _putElementInTemplate(element, templateElement) {
3388
3393
  if (this._config.html) {
@@ -3481,7 +3486,7 @@ const DefaultType$3 = {
3481
3486
  class Tooltip extends BaseComponent {
3482
3487
  constructor(element, config) {
3483
3488
  if (typeof Popper === 'undefined') {
3484
- throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
3489
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org/docs/v2/)');
3485
3490
  }
3486
3491
  super(element, config);
3487
3492
 
@@ -3527,7 +3532,6 @@ class Tooltip extends BaseComponent {
3527
3532
  if (!this._isEnabled) {
3528
3533
  return;
3529
3534
  }
3530
- this._activeTrigger.click = !this._activeTrigger.click;
3531
3535
  if (this._isShown()) {
3532
3536
  this._leave();
3533
3537
  return;
@@ -3715,7 +3719,7 @@ class Tooltip extends BaseComponent {
3715
3719
  return offset;
3716
3720
  }
3717
3721
  _resolvePossibleFunction(arg) {
3718
- return execute(arg, [this._element]);
3722
+ return execute(arg, [this._element, this._element]);
3719
3723
  }
3720
3724
  _getPopperConfig(attachment) {
3721
3725
  const defaultBsPopperConfig = {
@@ -3753,7 +3757,7 @@ class Tooltip extends BaseComponent {
3753
3757
  };
3754
3758
  return {
3755
3759
  ...defaultBsPopperConfig,
3756
- ...execute(this._config.popperConfig, [defaultBsPopperConfig])
3760
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
3757
3761
  };
3758
3762
  }
3759
3763
  _setListeners() {
@@ -4989,7 +4993,6 @@ class Toast extends BaseComponent {
4989
4993
  }
4990
4994
 
4991
4995
  // Private
4992
-
4993
4996
  _maybeScheduleHide() {
4994
4997
  if (!this._config.autohide) {
4995
4998
  return;