@openeuropa/bcl-theme-default 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.
@@ -200,7 +200,7 @@
200
200
  * @param {HTMLElement} element
201
201
  * @return void
202
202
  *
203
- * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
203
+ * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
204
204
  */
205
205
  const reflow = element => {
206
206
  element.offsetHeight; // eslint-disable-line no-unused-expressions
@@ -245,7 +245,7 @@
245
245
  });
246
246
  };
247
247
  const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
248
- return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;
248
+ return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue;
249
249
  };
250
250
  const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
251
251
  if (!waitForTransition) {
@@ -567,7 +567,7 @@
567
567
  const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
568
568
  for (const key of bsKeys) {
569
569
  let pureKey = key.replace(/^bs/, '');
570
- pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
570
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1);
571
571
  attributes[pureKey] = normalizeData$1(element.dataset[key]);
572
572
  }
573
573
  return attributes;
@@ -642,7 +642,7 @@
642
642
  * Constants
643
643
  */
644
644
 
645
- const VERSION = '5.3.3';
645
+ const VERSION = '5.3.6';
646
646
 
647
647
  /**
648
648
  * Class definition
@@ -668,6 +668,8 @@
668
668
  this[propertyName] = null;
669
669
  }
670
670
  }
671
+
672
+ // Private
671
673
  _queueCallback(callback, element, isAnimated = true) {
672
674
  executeAfterTransition(callback, element, isAnimated);
673
675
  }
@@ -1599,11 +1601,11 @@
1599
1601
  this._element.style[dimension] = '';
1600
1602
  this._queueCallback(complete, this._element, true);
1601
1603
  }
1604
+
1605
+ // Private
1602
1606
  _isShown(element = this._element) {
1603
1607
  return element.classList.contains(CLASS_NAME_SHOW$7);
1604
1608
  }
1605
-
1606
- // Private
1607
1609
  _configAfterMerge(config) {
1608
1610
  config.toggle = Boolean(config.toggle); // Coerce string values
1609
1611
  config.parent = getElement$1(config.parent);
@@ -3509,6 +3511,9 @@
3509
3511
  this._element.setAttribute('aria-expanded', 'false');
3510
3512
  Manipulator$1.removeDataAttribute(this._menu, 'popper');
3511
3513
  EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);
3514
+
3515
+ // Explicitly return focus to the trigger element
3516
+ this._element.focus();
3512
3517
  }
3513
3518
  _getConfig(config) {
3514
3519
  config = super._getConfig(config);
@@ -3520,7 +3525,7 @@
3520
3525
  }
3521
3526
  _createPopper() {
3522
3527
  if (typeof Popper === 'undefined') {
3523
- throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
3528
+ throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org/docs/v2/)');
3524
3529
  }
3525
3530
  let referenceElement = this._element;
3526
3531
  if (this._config.reference === 'parent') {
@@ -3599,7 +3604,7 @@
3599
3604
  }
3600
3605
  return {
3601
3606
  ...defaultBsPopperConfig,
3602
- ...execute(this._config.popperConfig, [defaultBsPopperConfig])
3607
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
3603
3608
  };
3604
3609
  }
3605
3610
  _selectMenuItem({
@@ -4786,7 +4791,7 @@
4786
4791
  return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
4787
4792
  }
4788
4793
  _resolvePossibleFunction(arg) {
4789
- return execute(arg, [this]);
4794
+ return execute(arg, [undefined, this]);
4790
4795
  }
4791
4796
  _putElementInTemplate(element, templateElement) {
4792
4797
  if (this._config.html) {
@@ -4885,7 +4890,7 @@
4885
4890
  class Tooltip extends BaseComponent {
4886
4891
  constructor(element, config) {
4887
4892
  if (typeof Popper === 'undefined') {
4888
- throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
4893
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org/docs/v2/)');
4889
4894
  }
4890
4895
  super(element, config);
4891
4896
 
@@ -4931,7 +4936,6 @@
4931
4936
  if (!this._isEnabled) {
4932
4937
  return;
4933
4938
  }
4934
- this._activeTrigger.click = !this._activeTrigger.click;
4935
4939
  if (this._isShown()) {
4936
4940
  this._leave();
4937
4941
  return;
@@ -5119,7 +5123,7 @@
5119
5123
  return offset;
5120
5124
  }
5121
5125
  _resolvePossibleFunction(arg) {
5122
- return execute(arg, [this._element]);
5126
+ return execute(arg, [this._element, this._element]);
5123
5127
  }
5124
5128
  _getPopperConfig(attachment) {
5125
5129
  const defaultBsPopperConfig = {
@@ -5157,7 +5161,7 @@
5157
5161
  };
5158
5162
  return {
5159
5163
  ...defaultBsPopperConfig,
5160
- ...execute(this._config.popperConfig, [defaultBsPopperConfig])
5164
+ ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])
5161
5165
  };
5162
5166
  }
5163
5167
  _setListeners() {
@@ -6393,7 +6397,6 @@
6393
6397
  }
6394
6398
 
6395
6399
  // Private
6396
-
6397
6400
  _maybeScheduleHide() {
6398
6401
  if (!this._config.autohide) {
6399
6402
  return;