vrembem 3.0.19 → 3.0.21

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.
@@ -3,78 +3,55 @@
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = global || self, factory(global.vrembem = {}));
5
5
  })(this, (function (exports) {
6
- function _toPrimitive(t, r) {
7
- if ("object" != typeof t || !t) return t;
8
- var e = t[Symbol.toPrimitive];
9
- if (void 0 !== e) {
10
- var i = e.call(t, r || "default");
11
- if ("object" != typeof i) return i;
12
- throw new TypeError("@@toPrimitive must return a primitive value.");
13
- }
14
- return ("string" === r ? String : Number)(t);
6
+ function _classPrivateFieldLooseBase(e, t) {
7
+ if (!{}.hasOwnProperty.call(e, t)) throw new TypeError("attempted to use private field on non-instance");
8
+ return e;
15
9
  }
16
- function _toPropertyKey(t) {
17
- var i = _toPrimitive(t, "string");
18
- return "symbol" == typeof i ? i : String(i);
10
+ var id = 0;
11
+ function _classPrivateFieldLooseKey(e) {
12
+ return "__private_" + id++ + "_" + e;
19
13
  }
20
- function _defineProperties(target, props) {
21
- for (var i = 0; i < props.length; i++) {
22
- var descriptor = props[i];
23
- descriptor.enumerable = descriptor.enumerable || false;
24
- descriptor.configurable = true;
25
- if ("value" in descriptor) descriptor.writable = true;
26
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
14
+ function _defineProperties(e, r) {
15
+ for (var t = 0; t < r.length; t++) {
16
+ var o = r[t];
17
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
27
18
  }
28
19
  }
29
- function _createClass(Constructor, protoProps, staticProps) {
30
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
31
- if (staticProps) _defineProperties(Constructor, staticProps);
32
- Object.defineProperty(Constructor, "prototype", {
33
- writable: false
34
- });
35
- return Constructor;
20
+ function _createClass(e, r, t) {
21
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
22
+ writable: !1
23
+ }), e;
36
24
  }
37
25
  function _extends() {
38
- _extends = Object.assign ? Object.assign.bind() : function (target) {
39
- for (var i = 1; i < arguments.length; i++) {
40
- var source = arguments[i];
41
- for (var key in source) {
42
- if (Object.prototype.hasOwnProperty.call(source, key)) {
43
- target[key] = source[key];
44
- }
45
- }
26
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
27
+ for (var e = 1; e < arguments.length; e++) {
28
+ var t = arguments[e];
29
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
46
30
  }
47
- return target;
48
- };
49
- return _extends.apply(this, arguments);
31
+ return n;
32
+ }, _extends.apply(null, arguments);
50
33
  }
51
- function _inheritsLoose(subClass, superClass) {
52
- subClass.prototype = Object.create(superClass.prototype);
53
- subClass.prototype.constructor = subClass;
54
- _setPrototypeOf(subClass, superClass);
34
+ function _inheritsLoose(t, o) {
35
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
55
36
  }
56
- function _setPrototypeOf(o, p) {
57
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
58
- o.__proto__ = p;
59
- return o;
60
- };
61
- return _setPrototypeOf(o, p);
37
+ function _setPrototypeOf(t, e) {
38
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
39
+ return t.__proto__ = e, t;
40
+ }, _setPrototypeOf(t, e);
62
41
  }
63
- function _assertThisInitialized(self) {
64
- if (self === void 0) {
65
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
42
+ function _toPrimitive(t, r) {
43
+ if ("object" != typeof t || !t) return t;
44
+ var e = t[Symbol.toPrimitive];
45
+ if (void 0 !== e) {
46
+ var i = e.call(t, r || "default");
47
+ if ("object" != typeof i) return i;
48
+ throw new TypeError("@@toPrimitive must return a primitive value.");
66
49
  }
67
- return self;
68
- }
69
- var id = 0;
70
- function _classPrivateFieldLooseKey(name) {
71
- return "__private_" + id++ + "_" + name;
50
+ return ("string" === r ? String : Number)(t);
72
51
  }
73
- function _classPrivateFieldLooseBase(receiver, privateKey) {
74
- if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
75
- throw new TypeError("attempted to use private field on non-instance");
76
- }
77
- return receiver;
52
+ function _toPropertyKey(t) {
53
+ var i = _toPrimitive(t, "string");
54
+ return "symbol" == typeof i ? i : i + "";
78
55
  }
79
56
 
80
57
  var _handler = /*#__PURE__*/_classPrivateFieldLooseKey("handler");
@@ -101,8 +78,8 @@
101
78
  this.mql = window.matchMedia("(min-width: " + this.value + ")");
102
79
 
103
80
  // Conditionally use addListener() for IE11 support.
104
- if (typeof this.mql.addEventListener === 'function') {
105
- this.mql.addEventListener('change', _classPrivateFieldLooseBase(this, _handler)[_handler]);
81
+ if (typeof this.mql.addEventListener === "function") {
82
+ this.mql.addEventListener("change", _classPrivateFieldLooseBase(this, _handler)[_handler]);
106
83
  } else {
107
84
  this.mql.addListener(_classPrivateFieldLooseBase(this, _handler)[_handler]);
108
85
  }
@@ -116,8 +93,8 @@
116
93
  if (!this.mql) return this;
117
94
 
118
95
  // Conditionally use removeListener() for IE11 support.
119
- if (typeof this.mql.removeEventListener === 'function') {
120
- this.mql.removeEventListener('change', _classPrivateFieldLooseBase(this, _handler)[_handler]);
96
+ if (typeof this.mql.removeEventListener === "function") {
97
+ this.mql.removeEventListener("change", _classPrivateFieldLooseBase(this, _handler)[_handler]);
121
98
  } else {
122
99
  this.mql.removeListener(_classPrivateFieldLooseBase(this, _handler)[_handler]);
123
100
  }
@@ -128,7 +105,7 @@
128
105
  this.mql = null;
129
106
  return this;
130
107
  };
131
- _createClass(Breakpoint, [{
108
+ return _createClass(Breakpoint, [{
132
109
  key: "handler",
133
110
  get: function get() {
134
111
  return _classPrivateFieldLooseBase(this, _handler)[_handler];
@@ -139,8 +116,8 @@
139
116
  set: function set(func) {
140
117
  if (this.mql) {
141
118
  // Conditionally use removeListener() for IE11 support.
142
- if (typeof this.mql.removeEventListener === 'function') {
143
- this.mql.removeEventListener('change', _classPrivateFieldLooseBase(this, _handler)[_handler]);
119
+ if (typeof this.mql.removeEventListener === "function") {
120
+ this.mql.removeEventListener("change", _classPrivateFieldLooseBase(this, _handler)[_handler]);
144
121
  } else {
145
122
  this.mql.removeListener(_classPrivateFieldLooseBase(this, _handler)[_handler]);
146
123
  }
@@ -148,7 +125,6 @@
148
125
  _classPrivateFieldLooseBase(this, _handler)[_handler] = func;
149
126
  }
150
127
  }]);
151
- return Breakpoint;
152
128
  }();
153
129
 
154
130
  function _settle(pact, state, value) {
@@ -364,7 +340,7 @@
364
340
  };
365
341
  _proto.get = function get(value, key) {
366
342
  if (key === void 0) {
367
- key = 'id';
343
+ key = "id";
368
344
  }
369
345
  return this.collection.find(function (item) {
370
346
  return item[key] === value;
@@ -373,31 +349,6 @@
373
349
  return Collection;
374
350
  }();
375
351
 
376
- const not = {
377
- inert: ':not([inert]):not([inert] *)',
378
- negTabIndex: ':not([tabindex^="-"])',
379
- disabled: ':not(:disabled)',
380
- };
381
-
382
- var e = [
383
- `a[href]${not.inert}${not.negTabIndex}`,
384
- `area[href]${not.inert}${not.negTabIndex}`,
385
- `input:not([type="hidden"]):not([type="radio"])${not.inert}${not.negTabIndex}${not.disabled}`,
386
- `input[type="radio"]${not.inert}${not.negTabIndex}${not.disabled}`,
387
- `select${not.inert}${not.negTabIndex}${not.disabled}`,
388
- `textarea${not.inert}${not.negTabIndex}${not.disabled}`,
389
- `button${not.inert}${not.negTabIndex}${not.disabled}`,
390
- `details${not.inert} > summary:first-of-type${not.negTabIndex}`,
391
- // Discard until Firefox supports `:has()`
392
- // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
393
- // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
394
- `iframe${not.inert}${not.negTabIndex}`,
395
- `audio[controls]${not.inert}${not.negTabIndex}`,
396
- `video[controls]${not.inert}${not.negTabIndex}`,
397
- `[contenteditable]${not.inert}${not.negTabIndex}`,
398
- `[tabindex]${not.inert}${not.negTabIndex}`,
399
- ];
400
-
401
352
  var _focusable = /*#__PURE__*/_classPrivateFieldLooseKey("focusable");
402
353
  var _handleFocusTrap = /*#__PURE__*/_classPrivateFieldLooseKey("handleFocusTrap");
403
354
  var _handleFocusLock = /*#__PURE__*/_classPrivateFieldLooseKey("handleFocusLock");
@@ -407,7 +358,7 @@
407
358
  el = null;
408
359
  }
409
360
  if (selectorFocus === void 0) {
410
- selectorFocus = '[data-focus]';
361
+ selectorFocus = "[data-focus]";
411
362
  }
412
363
  Object.defineProperty(this, _focusable, {
413
364
  writable: true,
@@ -446,8 +397,8 @@
446
397
  this.focusable = [];
447
398
 
448
399
  // Remove event listeners
449
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
450
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
400
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
401
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
451
402
  };
452
403
  _proto.focus = function focus(el, selectorFocus) {
453
404
  if (el === void 0) {
@@ -473,7 +424,8 @@
473
424
  var initScrollTop = el.scrollTop;
474
425
 
475
426
  // Query for all the focusable elements.
476
- var els = el.querySelectorAll(e.join(','));
427
+ var selector = focusableSelectors.join(",");
428
+ var els = el.querySelectorAll(selector);
477
429
 
478
430
  // Loop through all focusable elements.
479
431
  els.forEach(function (el) {
@@ -493,7 +445,7 @@
493
445
  // Return the focusable array.
494
446
  return focusable;
495
447
  };
496
- _createClass(FocusTrap, [{
448
+ return _createClass(FocusTrap, [{
497
449
  key: "focusable",
498
450
  get: function get() {
499
451
  return _classPrivateFieldLooseBase(this, _focusable)[_focusable];
@@ -504,11 +456,11 @@
504
456
 
505
457
  // Apply event listeners based on new focusable array length.
506
458
  if (_classPrivateFieldLooseBase(this, _focusable)[_focusable].length) {
507
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
508
- document.addEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
459
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
460
+ document.addEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
509
461
  } else {
510
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
511
- document.addEventListener('keydown', _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
462
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusTrap)[_handleFocusTrap]);
463
+ document.addEventListener("keydown", _classPrivateFieldLooseBase(this, _handleFocusLock)[_handleFocusLock]);
512
464
  }
513
465
  }
514
466
  }, {
@@ -522,11 +474,17 @@
522
474
  return this.focusable[this.focusable.length - 1];
523
475
  }
524
476
  }]);
525
- return FocusTrap;
526
477
  }();
478
+
479
+ // This has been copied over from focusable-selectors package and modified.
480
+ // https://github.com/KittyGiraudel/focusable-selectors
481
+ var notInert = ":not([inert])"; // Previously `:not([inert]):not([inert] *)`
482
+ var notNegTabIndex = ":not([tabindex^=\"-\"])";
483
+ var notDisabled = ":not(:disabled)";
484
+ var focusableSelectors = ["a[href]" + notInert + notNegTabIndex, "area[href]" + notInert + notNegTabIndex, "input:not([type=\"hidden\"]):not([type=\"radio\"])" + notInert + notNegTabIndex + notDisabled, "input[type=\"radio\"]" + notInert + notNegTabIndex + notDisabled, "select" + notInert + notNegTabIndex + notDisabled, "textarea" + notInert + notNegTabIndex + notDisabled, "button" + notInert + notNegTabIndex + notDisabled, "details" + notInert + " > summary:first-of-type" + notNegTabIndex, "iframe" + notInert + notNegTabIndex, "audio[controls]" + notInert + notNegTabIndex, "video[controls]" + notInert + notNegTabIndex, "[contenteditable]" + notInert + notNegTabIndex, "[tabindex]" + notInert + notNegTabIndex];
527
485
  function handleFocusTrap(event) {
528
486
  // Check if the click was a tab and return if not.
529
- var isTab = event.key === 'Tab' || event.keyCode === 9;
487
+ var isTab = event.key === "Tab" || event.keyCode === 9;
530
488
  if (!isTab) return;
531
489
 
532
490
  // If the shift key is pressed.
@@ -548,18 +506,18 @@
548
506
  }
549
507
  function handleFocusLock(event) {
550
508
  // Ignore the tab key by preventing default.
551
- var isTab = event.key === 'Tab' || event.keyCode === 9;
509
+ var isTab = event.key === "Tab" || event.keyCode === 9;
552
510
  if (isTab) event.preventDefault();
553
511
  }
554
512
 
555
513
  function getConfig$1(el, dataConfig) {
556
- var string = el.getAttribute("data-" + dataConfig) || '';
557
- var json = string.replace(/'/g, '"');
514
+ var string = el.getAttribute("data-" + dataConfig) || "";
515
+ var json = string.replace(/'/g, "\"");
558
516
  return json ? JSON.parse(json) : {};
559
517
  }
560
518
 
561
519
  function getPrefix() {
562
- return getComputedStyle(document.body).getPropertyValue('--vrembem-variable-prefix').trim();
520
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
563
521
  }
564
522
 
565
523
  function localStore(key, enable) {
@@ -604,18 +562,18 @@
604
562
  where = isComment || isElement ? where : document.querySelector(where);
605
563
 
606
564
  // If ref is a comment, set teleport type to 'after'.
607
- if (isComment) how = 'after';
565
+ if (isComment) how = "after";
608
566
 
609
567
  // Must be a valid reference element and method.
610
568
  if (!where) throw new Error("Not a valid teleport reference: '" + where + "'");
611
- if (typeof where[how] != 'function') throw new Error("Not a valid teleport method: '" + how + "'");
569
+ if (typeof where[how] != "function") throw new Error("Not a valid teleport method: '" + how + "'");
612
570
 
613
571
  // Initial return ref is null.
614
572
  var returnRef = null;
615
573
 
616
574
  // If ref is not a comment, set a return reference comment.
617
575
  if (!isComment) {
618
- returnRef = document.createComment('teleported #' + what.id);
576
+ returnRef = document.createComment("teleported #" + what.id);
619
577
  what.before(returnRef);
620
578
  }
621
579
 
@@ -641,7 +599,7 @@
641
599
  el.classList.add(settings.stateOpening);
642
600
 
643
601
  // Add event listener for when the transition is finished.
644
- el.addEventListener('transitionend', function _f(event) {
602
+ el.addEventListener("transitionend", function _f(event) {
645
603
  // Prevent child transition bubbling from firing this event.
646
604
  if (event.target != el) return;
647
605
 
@@ -651,7 +609,7 @@
651
609
 
652
610
  // Resolve the promise and remove the event listener.
653
611
  resolve(el);
654
- this.removeEventListener('transitionend', _f);
612
+ this.removeEventListener("transitionend", _f);
655
613
  });
656
614
  } else {
657
615
  // Toggle final opened state classes and resolve the promise.
@@ -670,7 +628,7 @@
670
628
  el.classList.remove(settings.stateOpened);
671
629
 
672
630
  // Add event listener for when the transition is finished.
673
- el.addEventListener('transitionend', function _f(event) {
631
+ el.addEventListener("transitionend", function _f(event) {
674
632
  // Prevent child transition bubbling from firing this event.
675
633
  if (event.target != el) return;
676
634
 
@@ -680,7 +638,7 @@
680
638
 
681
639
  // Resolve the promise and remove the event listener.
682
640
  resolve(el);
683
- this.removeEventListener('transitionend', _f);
641
+ this.removeEventListener("transitionend", _f);
684
642
  });
685
643
  } else {
686
644
  // Toggle final closed state classes and resolve the promise.
@@ -696,24 +654,17 @@
696
654
  var els = document.querySelectorAll(selector);
697
655
  els.forEach(function (el) {
698
656
  if (state) {
699
- el.style.overflow = 'hidden';
657
+ el.style.overflow = "hidden";
700
658
  } else {
701
- el.style.removeProperty('overflow');
659
+ el.style.removeProperty("overflow");
702
660
  }
703
661
  });
704
662
  }
705
663
  }
706
664
  function setInert(state, selector) {
707
665
  if (selector) {
708
- var els = document.querySelectorAll(selector);
709
- els.forEach(function (el) {
710
- if (state) {
711
- el.inert = true;
712
- el.setAttribute('aria-hidden', true);
713
- } else {
714
- el.inert = null;
715
- el.removeAttribute('aria-hidden');
716
- }
666
+ document.querySelectorAll(selector).forEach(function (el) {
667
+ el.inert = state;
717
668
  });
718
669
  }
719
670
  }
@@ -741,8 +692,8 @@
741
692
 
742
693
  var defaults$3 = {
743
694
  autoInit: false,
744
- stateAttr: 'aria-checked',
745
- stateValue: 'mixed'
695
+ stateAttr: "aria-checked",
696
+ stateValue: "mixed"
746
697
  };
747
698
 
748
699
  var Checkbox = /*#__PURE__*/function () {
@@ -761,10 +712,10 @@
761
712
  var selector = "[" + this.settings.stateAttr + "=\"" + this.settings.stateValue + "\"]";
762
713
  var mixed = document.querySelectorAll(selector);
763
714
  this.setIndeterminate(mixed);
764
- document.addEventListener('click', this.__handlerClick, false);
715
+ document.addEventListener("click", this.__handlerClick, false);
765
716
  };
766
717
  _proto.destroy = function destroy() {
767
- document.removeEventListener('click', this.__handlerClick, false);
718
+ document.removeEventListener("click", this.__handlerClick, false);
768
719
  };
769
720
  _proto.handlerClick = function handlerClick(event) {
770
721
  var selector = "[" + this.settings.stateAttr + "=\"" + this.settings.stateValue + "\"]";
@@ -807,30 +758,30 @@
807
758
  var defaults$2 = {
808
759
  autoInit: false,
809
760
  // Data attributes
810
- dataOpen: 'drawer-open',
811
- dataClose: 'drawer-close',
812
- dataToggle: 'drawer-toggle',
813
- dataBreakpoint: 'drawer-breakpoint',
814
- dataConfig: 'drawer-config',
761
+ dataOpen: "drawer-open",
762
+ dataClose: "drawer-close",
763
+ dataToggle: "drawer-toggle",
764
+ dataBreakpoint: "drawer-breakpoint",
765
+ dataConfig: "drawer-config",
815
766
  // Selectors
816
- selectorDrawer: '.drawer',
817
- selectorDialog: '.drawer__dialog',
818
- selectorFocus: '[data-focus]',
767
+ selectorDrawer: ".drawer",
768
+ selectorDialog: ".drawer__dialog",
769
+ selectorFocus: "[data-focus]",
819
770
  selectorInert: null,
820
- selectorOverflow: 'body',
771
+ selectorOverflow: "body",
821
772
  // State classes
822
- stateOpened: 'is-opened',
823
- stateOpening: 'is-opening',
824
- stateClosing: 'is-closing',
825
- stateClosed: 'is-closed',
773
+ stateOpened: "is-opened",
774
+ stateOpening: "is-opening",
775
+ stateClosing: "is-closing",
776
+ stateClosed: "is-closed",
826
777
  // Classes
827
- classModal: 'drawer_modal',
778
+ classModal: "drawer_modal",
828
779
  // Feature toggles
829
780
  breakpoints: null,
830
- customEventPrefix: 'drawer:',
781
+ customEventPrefix: "drawer:",
831
782
  eventListeners: true,
832
783
  store: true,
833
- storeKey: 'VB:DrawerState',
784
+ storeKey: "VB:DrawerState",
834
785
  setTabindex: true,
835
786
  transition: true
836
787
  };
@@ -845,7 +796,7 @@
845
796
 
846
797
  // If it's a toggle trigger...
847
798
  if (trigger.matches("[data-" + this.settings.dataToggle + "]")) {
848
- var selectors = trigger.getAttribute("data-" + this.settings.dataToggle).trim().split(' ');
799
+ var selectors = trigger.getAttribute("data-" + this.settings.dataToggle).trim().split(" ");
849
800
  selectors.forEach(function (selector) {
850
801
  // Get the entry from collection using the attribute value.
851
802
  var entry = _this.get(selector);
@@ -858,7 +809,7 @@
858
809
 
859
810
  // If it's a open trigger...
860
811
  if (trigger.matches("[data-" + this.settings.dataOpen + "]")) {
861
- var _selectors = trigger.getAttribute("data-" + this.settings.dataOpen).trim().split(' ');
812
+ var _selectors = trigger.getAttribute("data-" + this.settings.dataOpen).trim().split(" ");
862
813
  _selectors.forEach(function (selector) {
863
814
  // Get the entry from collection using the attribute value.
864
815
  var entry = _this.get(selector);
@@ -871,7 +822,7 @@
871
822
 
872
823
  // If it's a close trigger...
873
824
  if (trigger.matches("[data-" + this.settings.dataClose + "]")) {
874
- var _selectors2 = trigger.getAttribute("data-" + this.settings.dataClose).trim().split(' ');
825
+ var _selectors2 = trigger.getAttribute("data-" + this.settings.dataClose).trim().split(" ");
875
826
  _selectors2.forEach(function (selector) {
876
827
  if (selector) {
877
828
  // Get the entry from collection using the attribute value.
@@ -898,7 +849,7 @@
898
849
  }
899
850
  }
900
851
  function handleKeydown$2(event) {
901
- if (event.key === 'Escape') {
852
+ if (event.key === "Escape") {
902
853
  var modal = this.activeModal;
903
854
  if (modal) this.close(modal);
904
855
  }
@@ -925,27 +876,27 @@
925
876
  if (index >= 0) {
926
877
  var _temp2 = function _temp2() {
927
878
  // Remove entry from local store.
928
- _this.store.set(_entry.id);
879
+ _this.store.set(entry.id);
929
880
 
930
881
  // Unmount the MatchMedia functionality.
931
- _entry.unmountBreakpoint();
882
+ entry.unmountBreakpoint();
932
883
 
933
884
  // Delete properties from collection entry.
934
- Object.getOwnPropertyNames(_entry).forEach(function (prop) {
935
- delete _entry[prop];
885
+ Object.getOwnPropertyNames(entry).forEach(function (prop) {
886
+ delete entry[prop];
936
887
  });
937
888
 
938
889
  // Remove entry from collection.
939
890
  _this.collection.splice(index, 1);
940
891
  };
941
892
  // Get the collection entry.
942
- var _entry = _this.collection[index];
893
+ var entry = _this.collection[index];
943
894
 
944
895
  // If entry is in the opened state.
945
896
  var _temp = function () {
946
- if (close && _entry.state === 'opened') {
897
+ if (close && entry.state === "opened") {
947
898
  // Close the drawer.
948
- return Promise.resolve(_entry.close(false)).then(function () {});
899
+ return Promise.resolve(entry.close(false)).then(function () {});
949
900
  }
950
901
  }();
951
902
  return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
@@ -957,12 +908,12 @@
957
908
  }
958
909
  };
959
910
 
960
- function E() {
911
+ function P() {
961
912
  return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
962
913
  }
963
914
 
964
915
  function getBreakpoint(drawer) {
965
- var prefix = E();
916
+ var prefix = P();
966
917
  var bp = drawer.getAttribute("data-" + this.settings.dataBreakpoint);
967
918
  if (this.settings.breakpoints && this.settings.breakpoints[bp]) {
968
919
  return this.settings.breakpoints[bp];
@@ -975,7 +926,7 @@
975
926
 
976
927
  function getDrawer(query) {
977
928
  // Get the entry from collection.
978
- var entry = typeof query === 'string' ? this.get(query) : this.get(query.id);
929
+ var entry = typeof query === "string" ? this.get(query) : this.get(query.id);
979
930
 
980
931
  // Return entry if it was resolved, otherwise throw error.
981
932
  if (entry) {
@@ -987,12 +938,12 @@
987
938
 
988
939
  function getDrawerID(obj) {
989
940
  // If it's a string, return the string.
990
- if (typeof obj === 'string') {
941
+ if (typeof obj === "string") {
991
942
  return obj;
992
943
  }
993
944
 
994
945
  // If it's an HTML element.
995
- else if (typeof obj.hasAttribute === 'function') {
946
+ else if (typeof obj.hasAttribute === "function") {
996
947
  // If it's a drawer open trigger, return data value.
997
948
  if (obj.hasAttribute("data-" + this.settings.dataOpen)) {
998
949
  return obj.getAttribute("data-" + this.settings.dataOpen);
@@ -1038,7 +989,7 @@
1038
989
  };
1039
990
  } else if (!dialog) {
1040
991
  return {
1041
- error: new Error('Drawer is missing dialog element.')
992
+ error: new Error("Drawer is missing dialog element.")
1042
993
  };
1043
994
  } else {
1044
995
  return {
@@ -1048,7 +999,7 @@
1048
999
  }
1049
1000
  } else {
1050
1001
  return {
1051
- error: new Error('Could not resolve the drawer ID.')
1002
+ error: new Error("Could not resolve the drawer ID.")
1052
1003
  };
1053
1004
  }
1054
1005
  }
@@ -1059,7 +1010,7 @@
1059
1010
  var _temp2 = function () {
1060
1011
  if (_this.store.get(entry.id)) {
1061
1012
  var _temp = function () {
1062
- if (_this.store.get(entry.id) === 'opened') {
1013
+ if (_this.store.get(entry.id) === "opened") {
1063
1014
  return Promise.resolve(entry.open(false, false)).then(function () {});
1064
1015
  } else {
1065
1016
  return Promise.resolve(entry.close(false, false)).then(function () {});
@@ -1068,7 +1019,7 @@
1068
1019
  if (_temp && _temp.then) return _temp.then(function () {});
1069
1020
  } else if (entry.el.classList.contains(_this.settings.stateOpened)) {
1070
1021
  // Update drawer state.
1071
- entry.state = 'opened';
1022
+ entry.state = "opened";
1072
1023
  } else {
1073
1024
  // Remove transition state classes.
1074
1025
  entry.el.classList.remove(_this.settings.stateOpening);
@@ -1089,9 +1040,9 @@
1089
1040
 
1090
1041
  function updateFocusState$1(entry) {
1091
1042
  // Check if there's an active modal
1092
- if (entry.state === 'opened') {
1043
+ if (entry.state === "opened") {
1093
1044
  // Mount the focus trap on the opened drawer.
1094
- if (entry.mode === 'modal') {
1045
+ if (entry.mode === "modal") {
1095
1046
  this.focusTrap.mount(entry.dialog, this.settings.selectorFocus);
1096
1047
  } else {
1097
1048
  this.focusTrap.focus(entry.dialog, this.settings.selectorFocus);
@@ -1118,7 +1069,7 @@
1118
1069
  }
1119
1070
 
1120
1071
  // Dispatch custom opened event.
1121
- drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'opened', {
1072
+ drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + "opened", {
1122
1073
  detail: _this,
1123
1074
  bubbles: true
1124
1075
  }));
@@ -1138,17 +1089,17 @@
1138
1089
 
1139
1090
  // If drawer is closed.
1140
1091
  var _temp = function () {
1141
- if (drawer.state === 'closed') {
1092
+ if (drawer.state === "closed") {
1142
1093
  // Update drawer state.
1143
- drawer.state = 'opening';
1094
+ drawer.state = "opening";
1144
1095
 
1145
1096
  // Run the open transition.
1146
1097
  return Promise.resolve(openTransition(drawer.el, config)).then(function () {
1147
1098
  // Update the global state if mode is modal.
1148
- if (drawer.mode === 'modal') updateGlobalState(true, config);
1099
+ if (drawer.mode === "modal") updateGlobalState(true, config);
1149
1100
 
1150
1101
  // Update drawer state.
1151
- drawer.state = 'opened';
1102
+ drawer.state = "opened";
1152
1103
  });
1153
1104
  }
1154
1105
  }();
@@ -1175,9 +1126,9 @@
1175
1126
 
1176
1127
  // If drawer is opened.
1177
1128
  var _temp = function () {
1178
- if (drawer.state === 'opened') {
1129
+ if (drawer.state === "opened") {
1179
1130
  // Update drawer state.
1180
- drawer.state = 'closing';
1131
+ drawer.state = "closing";
1181
1132
 
1182
1133
  // Remove focus from active element.
1183
1134
  document.activeElement.blur();
@@ -1185,7 +1136,7 @@
1185
1136
  // Run the close transition.
1186
1137
  return Promise.resolve(closeTransition(drawer.el, config)).then(function () {
1187
1138
  // Update the global state if mode is modal.
1188
- if (drawer.mode === 'modal') updateGlobalState(false, config);
1139
+ if (drawer.mode === "modal") updateGlobalState(false, config);
1189
1140
 
1190
1141
  // Set focus to the trigger element if the focus param is true.
1191
1142
  if (focus) {
@@ -1193,10 +1144,10 @@
1193
1144
  }
1194
1145
 
1195
1146
  // Update drawer state.
1196
- drawer.state = 'closed';
1147
+ drawer.state = "closed";
1197
1148
 
1198
1149
  // Dispatch custom closed event.
1199
- drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'closed', {
1150
+ drawer.el.dispatchEvent(new CustomEvent(config.customEventPrefix + "closed", {
1200
1151
  detail: _this,
1201
1152
  bubbles: true
1202
1153
  }));
@@ -1219,7 +1170,7 @@
1219
1170
  var drawer = getDrawer.call(_this, query);
1220
1171
 
1221
1172
  // Open or close the drawer based on its current state.
1222
- if (drawer.state === 'closed') {
1173
+ if (drawer.state === "closed") {
1223
1174
  return Promise.resolve(open$2.call(_this, drawer, transition, focus));
1224
1175
  } else {
1225
1176
  return Promise.resolve(close$2.call(_this, drawer, transition, focus));
@@ -1235,21 +1186,21 @@
1235
1186
  // Get the drawer configuration.
1236
1187
 
1237
1188
  // Add the modal class.
1238
- entry.el.classList.add(entry.getSetting('classModal'));
1189
+ entry.el.classList.add(entry.getSetting("classModal"));
1239
1190
 
1240
1191
  // Set aria-modal attribute to true.
1241
- entry.dialog.setAttribute('aria-modal', 'true');
1192
+ entry.dialog.setAttribute("aria-modal", "true");
1242
1193
 
1243
1194
  // If there isn't a stored state but also has the opened state class...
1244
- if (!_this2.store.get(entry.id) && entry.el.classList.contains(entry.getSetting('stateOpened'))) {
1195
+ if (!_this2.store.get(entry.id) && entry.el.classList.contains(entry.getSetting("stateOpened"))) {
1245
1196
  // Save the opened state in local store.
1246
- _this2.store.set(entry.id, 'opened');
1197
+ _this2.store.set(entry.id, "opened");
1247
1198
  }
1248
1199
 
1249
1200
  // Modal drawer defaults to closed state.
1250
1201
  return Promise.resolve(close$2.call(_this2, entry, false, false)).then(function () {
1251
1202
  // Dispatch custom switch event.
1252
- entry.el.dispatchEvent(new CustomEvent(entry.getSetting('customEventPrefix') + 'switchMode', {
1203
+ entry.el.dispatchEvent(new CustomEvent(entry.getSetting("customEventPrefix") + "switchMode", {
1253
1204
  detail: _this2,
1254
1205
  bubbles: true
1255
1206
  }));
@@ -1265,10 +1216,10 @@
1265
1216
  try {
1266
1217
  var _this = this;
1267
1218
  // Remove the modal class.
1268
- entry.el.classList.remove(entry.getSetting('classModal'));
1219
+ entry.el.classList.remove(entry.getSetting("classModal"));
1269
1220
 
1270
1221
  // Remove the aria-modal attribute.
1271
- entry.dialog.removeAttribute('aria-modal');
1222
+ entry.dialog.removeAttribute("aria-modal");
1272
1223
 
1273
1224
  // Update the global state.
1274
1225
  updateGlobalState(false, _extends({}, _this.settings, entry.settings));
@@ -1279,7 +1230,7 @@
1279
1230
  // Setup initial state.
1280
1231
  return Promise.resolve(initialState.call(_this, entry)).then(function () {
1281
1232
  // Dispatch custom switch event.
1282
- entry.el.dispatchEvent(new CustomEvent(entry.getSetting('customEventPrefix') + 'switchMode', {
1233
+ entry.el.dispatchEvent(new CustomEvent(entry.getSetting("customEventPrefix") + "switchMode", {
1283
1234
  detail: _this,
1284
1235
  bubbles: true
1285
1236
  }));
@@ -1293,9 +1244,9 @@
1293
1244
  };
1294
1245
  function switchMode(entry) {
1295
1246
  switch (entry.mode) {
1296
- case 'inline':
1247
+ case "inline":
1297
1248
  return toInline.call(this, entry);
1298
- case 'modal':
1249
+ case "modal":
1299
1250
  return toModal.call(this, entry);
1300
1251
  default:
1301
1252
  throw new Error("\"" + entry.mode + "\" is not a valid drawer mode.");
@@ -1338,7 +1289,7 @@
1338
1289
  return this;
1339
1290
  },
1340
1291
  handleBreakpoint: function handleBreakpoint(event) {
1341
- this.mode = event.matches ? 'inline' : 'modal';
1292
+ this.mode = event.matches ? "inline" : "modal";
1342
1293
  return this;
1343
1294
  },
1344
1295
  getSetting: function getSetting(key) {
@@ -1362,8 +1313,8 @@
1362
1313
  set state(value) {
1363
1314
  __state = value;
1364
1315
  // Save 'opened' and 'closed' states to store if mode is inline.
1365
- if (value === 'opened' || value === 'closed') {
1366
- if (this.mode === 'inline') root.store.set(this.id, this.state);
1316
+ if (value === "opened" || value === "closed") {
1317
+ if (this.mode === "inline") root.store.set(this.id, this.state);
1367
1318
  }
1368
1319
  },
1369
1320
  get mode() {
@@ -1376,23 +1327,23 @@
1376
1327
  }, methods);
1377
1328
 
1378
1329
  // Create the state var with the initial state.
1379
- var __state = el.classList.contains(entry.getSetting('stateOpened')) ? 'opened' : 'closed';
1330
+ var __state = el.classList.contains(entry.getSetting("stateOpened")) ? "opened" : "closed";
1380
1331
 
1381
1332
  // Create the mode var with the initial mode.
1382
- var __mode = el.classList.contains(entry.getSetting('classModal')) ? 'modal' : 'inline';
1333
+ var __mode = el.classList.contains(entry.getSetting("classModal")) ? "modal" : "inline";
1383
1334
 
1384
1335
  // Setup mode specific attributes.
1385
- if (entry.mode === 'modal') {
1336
+ if (entry.mode === "modal") {
1386
1337
  // Set aria-modal attribute to true.
1387
- entry.dialog.setAttribute('aria-modal', 'true');
1338
+ entry.dialog.setAttribute("aria-modal", "true");
1388
1339
  } else {
1389
1340
  // Remove the aria-modal attribute.
1390
- entry.dialog.removeAttribute('aria-modal');
1341
+ entry.dialog.removeAttribute("aria-modal");
1391
1342
  }
1392
1343
 
1393
1344
  // Set tabindex="-1" so dialog is focusable via JS or click.
1394
- if (entry.getSetting('setTabindex')) {
1395
- entry.dialog.setAttribute('tabindex', '-1');
1345
+ if (entry.getSetting("setTabindex")) {
1346
+ entry.dialog.setAttribute("tabindex", "-1");
1396
1347
  }
1397
1348
 
1398
1349
  // Add entry to collection.
@@ -1421,15 +1372,14 @@
1421
1372
  var _handleClick$1 = /*#__PURE__*/_classPrivateFieldLooseKey("handleClick");
1422
1373
  var _handleKeydown$2 = /*#__PURE__*/_classPrivateFieldLooseKey("handleKeydown");
1423
1374
  var Drawer = /*#__PURE__*/function (_Collection) {
1424
- _inheritsLoose(Drawer, _Collection);
1425
1375
  function Drawer(options) {
1426
1376
  var _this;
1427
1377
  _this = _Collection.call(this) || this;
1428
- Object.defineProperty(_assertThisInitialized(_this), _handleClick$1, {
1378
+ Object.defineProperty(_this, _handleClick$1, {
1429
1379
  writable: true,
1430
1380
  value: void 0
1431
1381
  });
1432
- Object.defineProperty(_assertThisInitialized(_this), _handleKeydown$2, {
1382
+ Object.defineProperty(_this, _handleKeydown$2, {
1433
1383
  writable: true,
1434
1384
  value: void 0
1435
1385
  });
@@ -1439,11 +1389,12 @@
1439
1389
 
1440
1390
  // Setup local store for inline drawer state management.
1441
1391
  _this.store = localStore(_this.settings.storeKey, _this.settings.store);
1442
- _classPrivateFieldLooseBase(_assertThisInitialized(_this), _handleClick$1)[_handleClick$1] = handleClick$2.bind(_assertThisInitialized(_this));
1443
- _classPrivateFieldLooseBase(_assertThisInitialized(_this), _handleKeydown$2)[_handleKeydown$2] = handleKeydown$2.bind(_assertThisInitialized(_this));
1392
+ _classPrivateFieldLooseBase(_this, _handleClick$1)[_handleClick$1] = handleClick$2.bind(_this);
1393
+ _classPrivateFieldLooseBase(_this, _handleKeydown$2)[_handleKeydown$2] = handleKeydown$2.bind(_this);
1444
1394
  if (_this.settings.autoInit) _this.init();
1445
1395
  return _this;
1446
1396
  }
1397
+ _inheritsLoose(Drawer, _Collection);
1447
1398
  var _proto = Drawer.prototype;
1448
1399
  _proto.init = function init(options) {
1449
1400
  if (options === void 0) {
@@ -1485,12 +1436,12 @@
1485
1436
  }
1486
1437
  };
1487
1438
  _proto.initEventListeners = function initEventListeners() {
1488
- document.addEventListener('click', _classPrivateFieldLooseBase(this, _handleClick$1)[_handleClick$1], false);
1489
- document.addEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown$2)[_handleKeydown$2], false);
1439
+ document.addEventListener("click", _classPrivateFieldLooseBase(this, _handleClick$1)[_handleClick$1], false);
1440
+ document.addEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown$2)[_handleKeydown$2], false);
1490
1441
  };
1491
1442
  _proto.destroyEventListeners = function destroyEventListeners() {
1492
- document.removeEventListener('click', _classPrivateFieldLooseBase(this, _handleClick$1)[_handleClick$1], false);
1493
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown$2)[_handleKeydown$2], false);
1443
+ document.removeEventListener("click", _classPrivateFieldLooseBase(this, _handleClick$1)[_handleClick$1], false);
1444
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown$2)[_handleKeydown$2], false);
1494
1445
  };
1495
1446
  _proto.register = function register(query) {
1496
1447
  var els = getDrawerElements.call(this, query);
@@ -1510,48 +1461,47 @@
1510
1461
  _proto.toggle = function toggle$1(id, transition, focus) {
1511
1462
  return toggle.call(this, id, transition, focus);
1512
1463
  };
1513
- _createClass(Drawer, [{
1464
+ return _createClass(Drawer, [{
1514
1465
  key: "activeModal",
1515
1466
  get: function get() {
1516
1467
  return this.collection.find(function (entry) {
1517
- return entry.state === 'opened' && entry.mode === 'modal';
1468
+ return entry.state === "opened" && entry.mode === "modal";
1518
1469
  });
1519
1470
  }
1520
1471
  }]);
1521
- return Drawer;
1522
1472
  }(Collection);
1523
1473
 
1524
1474
  var defaults$1 = {
1525
1475
  autoInit: false,
1526
1476
  // Data attributes
1527
- dataOpen: 'modal-open',
1528
- dataClose: 'modal-close',
1529
- dataReplace: 'modal-replace',
1530
- dataConfig: 'modal-config',
1477
+ dataOpen: "modal-open",
1478
+ dataClose: "modal-close",
1479
+ dataReplace: "modal-replace",
1480
+ dataConfig: "modal-config",
1531
1481
  // Selectors
1532
- selectorModal: '.modal',
1533
- selectorDialog: '.modal__dialog',
1534
- selectorRequired: '[role="alertdialog"]',
1535
- selectorFocus: '[data-focus]',
1482
+ selectorModal: ".modal",
1483
+ selectorDialog: ".modal__dialog",
1484
+ selectorRequired: "[role=\"alertdialog\"]",
1485
+ selectorFocus: "[data-focus]",
1536
1486
  selectorInert: null,
1537
- selectorOverflow: 'body',
1487
+ selectorOverflow: "body",
1538
1488
  // State classes
1539
- stateOpened: 'is-opened',
1540
- stateOpening: 'is-opening',
1541
- stateClosing: 'is-closing',
1542
- stateClosed: 'is-closed',
1489
+ stateOpened: "is-opened",
1490
+ stateOpening: "is-opening",
1491
+ stateClosing: "is-closing",
1492
+ stateClosed: "is-closed",
1543
1493
  // Feature settings
1544
- customEventPrefix: 'modal:',
1494
+ customEventPrefix: "modal:",
1545
1495
  eventListeners: true,
1546
1496
  teleport: null,
1547
- teleportMethod: 'append',
1497
+ teleportMethod: "append",
1548
1498
  setTabindex: true,
1549
1499
  transition: true
1550
1500
  };
1551
1501
 
1552
1502
  function getModal(query) {
1553
1503
  // Get the entry from collection.
1554
- var entry = typeof query === 'string' ? this.get(query) : this.get(query.id);
1504
+ var entry = typeof query === "string" ? this.get(query) : this.get(query.id);
1555
1505
 
1556
1506
  // Return entry if it was resolved, otherwise throw error.
1557
1507
  if (entry) {
@@ -1563,12 +1513,12 @@
1563
1513
 
1564
1514
  function getModalID(obj) {
1565
1515
  // If it's a string, return the string.
1566
- if (typeof obj === 'string') {
1516
+ if (typeof obj === "string") {
1567
1517
  return obj;
1568
1518
  }
1569
1519
 
1570
1520
  // If it's an HTML element.
1571
- else if (typeof obj.hasAttribute === 'function') {
1521
+ else if (typeof obj.hasAttribute === "function") {
1572
1522
  // If it's a modal open trigger, return data value.
1573
1523
  if (obj.hasAttribute("data-" + this.settings.dataOpen)) {
1574
1524
  return obj.getAttribute("data-" + this.settings.dataOpen);
@@ -1614,7 +1564,7 @@
1614
1564
  };
1615
1565
  } else if (!dialog) {
1616
1566
  return {
1617
- error: new Error('Modal is missing dialog element.')
1567
+ error: new Error("Modal is missing dialog element.")
1618
1568
  };
1619
1569
  } else {
1620
1570
  return {
@@ -1624,7 +1574,7 @@
1624
1574
  }
1625
1575
  } else {
1626
1576
  return {
1627
- error: new Error('Could not resolve the modal ID.')
1577
+ error: new Error("Could not resolve the modal ID.")
1628
1578
  };
1629
1579
  }
1630
1580
  }
@@ -1667,7 +1617,7 @@
1667
1617
  // Get the value of the data attribute.
1668
1618
  var value = trigger.getAttribute("data-" + _this.settings.dataClose);
1669
1619
  // Close all if * wildcard is passed, otherwise close a single modal.
1670
- return Promise.resolve(value === '*' ? _this.closeAll() : _this.close(value));
1620
+ return Promise.resolve(value === "*" ? _this.closeAll() : _this.close(value));
1671
1621
  }
1672
1622
 
1673
1623
  // If the modal screen was clicked, close the modal.
@@ -1681,7 +1631,7 @@
1681
1631
  };
1682
1632
  function handleKeydown$1(event) {
1683
1633
  // If escape key was pressed.
1684
- if (event.key === 'Escape') {
1634
+ if (event.key === "Escape") {
1685
1635
  // If a modal is opened and not required, close the modal.
1686
1636
  if (this.active && !this.active.dialog.matches(this.settings.selectorRequired)) {
1687
1637
  return this.close();
@@ -1710,28 +1660,28 @@
1710
1660
  if (index >= 0) {
1711
1661
  var _temp2 = function _temp2() {
1712
1662
  // Return teleported modal if a reference has been set.
1713
- if (_entry.getSetting('teleport')) {
1714
- _entry.teleportReturn();
1663
+ if (entry.getSetting("teleport")) {
1664
+ entry.teleportReturn();
1715
1665
  }
1716
1666
 
1717
1667
  // Delete properties from collection entry.
1718
- Object.getOwnPropertyNames(_entry).forEach(function (prop) {
1719
- delete _entry[prop];
1668
+ Object.getOwnPropertyNames(entry).forEach(function (prop) {
1669
+ delete entry[prop];
1720
1670
  });
1721
1671
 
1722
1672
  // Remove entry from collection.
1723
1673
  _this.collection.splice(index, 1);
1724
1674
  };
1725
1675
  // Get the collection entry.
1726
- var _entry = _this.collection[index];
1676
+ var entry = _this.collection[index];
1727
1677
 
1728
1678
  // If entry is in the opened state, close it.
1729
1679
  var _temp = function () {
1730
- if (close && _entry.state === 'opened') {
1731
- return Promise.resolve(_entry.close(false)).then(function () {});
1680
+ if (close && entry.state === "opened") {
1681
+ return Promise.resolve(entry.close(false)).then(function () {});
1732
1682
  } else {
1733
1683
  // Remove modal from stack.
1734
- _this.stack.remove(_entry);
1684
+ _this.stack.remove(entry);
1735
1685
  }
1736
1686
  }();
1737
1687
  return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
@@ -1755,7 +1705,7 @@
1755
1705
  }
1756
1706
 
1757
1707
  // Dispatch custom opened event.
1758
- modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'opened', {
1708
+ modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + "opened", {
1759
1709
  detail: _this,
1760
1710
  bubbles: true
1761
1711
  }));
@@ -1778,9 +1728,9 @@
1778
1728
 
1779
1729
  // If modal is closed.
1780
1730
  var _temp = function () {
1781
- if (modal.state === 'closed') {
1731
+ if (modal.state === "closed") {
1782
1732
  // Update modal state.
1783
- modal.state = 'opening';
1733
+ modal.state = "opening";
1784
1734
 
1785
1735
  // Add modal to stack.
1786
1736
  _this.stack.add(modal);
@@ -1788,7 +1738,7 @@
1788
1738
  // Run the open transition.
1789
1739
  return Promise.resolve(openTransition(modal.el, config)).then(function () {
1790
1740
  // Update modal state.
1791
- modal.state = 'opened';
1741
+ modal.state = "opened";
1792
1742
  });
1793
1743
  }
1794
1744
  }();
@@ -1809,9 +1759,9 @@
1809
1759
 
1810
1760
  // If a modal exists and its state is opened.
1811
1761
  var _temp = function () {
1812
- if (modal && modal.state === 'opened') {
1762
+ if (modal && modal.state === "opened") {
1813
1763
  // Update modal state.
1814
- modal.state = 'closing';
1764
+ modal.state = "closing";
1815
1765
 
1816
1766
  // Get the modal configuration.
1817
1767
  var config = _extends({}, _this.settings, modal.settings);
@@ -1833,10 +1783,10 @@
1833
1783
  }
1834
1784
 
1835
1785
  // Update modal state.
1836
- modal.state = 'closed';
1786
+ modal.state = "closed";
1837
1787
 
1838
1788
  // Dispatch custom closed event.
1839
- modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + 'closed', {
1789
+ modal.el.dispatchEvent(new CustomEvent(config.customEventPrefix + "closed", {
1840
1790
  detail: _this,
1841
1791
  bubbles: true
1842
1792
  }));
@@ -1907,7 +1857,7 @@
1907
1857
  // Setup results for return.
1908
1858
  var resultOpened, resultClosed;
1909
1859
  var _temp = function () {
1910
- if (modal.state === 'opened') {
1860
+ if (modal.state === "opened") {
1911
1861
  // If modal is open, close all modals except for replacement.
1912
1862
  resultOpened = modal;
1913
1863
  return Promise.resolve(closeAll$1.call(_this, modal.id, transition)).then(function (_closeAll$call) {
@@ -1950,16 +1900,16 @@
1950
1900
  },
1951
1901
  teleport: function teleport$1(ref, method) {
1952
1902
  if (ref === void 0) {
1953
- ref = this.getSetting('teleport');
1903
+ ref = this.getSetting("teleport");
1954
1904
  }
1955
1905
  if (method === void 0) {
1956
- method = this.getSetting('teleportMethod');
1906
+ method = this.getSetting("teleportMethod");
1957
1907
  }
1958
1908
  if (!this.returnRef) {
1959
1909
  this.returnRef = teleport(this.el, ref, method);
1960
1910
  return this.el;
1961
1911
  } else {
1962
- console.error('Element has already been teleported:', this.el);
1912
+ console.error("Element has already been teleported:", this.el);
1963
1913
  return false;
1964
1914
  }
1965
1915
  },
@@ -1968,7 +1918,7 @@
1968
1918
  this.returnRef = teleport(this.el, this.returnRef);
1969
1919
  return this.el;
1970
1920
  } else {
1971
- console.error('No return reference found:', this.el);
1921
+ console.error("No return reference found:", this.el);
1972
1922
  return false;
1973
1923
  }
1974
1924
  },
@@ -1980,7 +1930,7 @@
1980
1930
  // Setup the modal object.
1981
1931
  var entry = _extends({
1982
1932
  id: el.id,
1983
- state: 'closed',
1933
+ state: "closed",
1984
1934
  el: el,
1985
1935
  dialog: dialog,
1986
1936
  returnRef: null,
@@ -1988,20 +1938,20 @@
1988
1938
  }, methods);
1989
1939
 
1990
1940
  // Set aria-modal attribute to true.
1991
- entry.dialog.setAttribute('aria-modal', 'true');
1941
+ entry.dialog.setAttribute("aria-modal", "true");
1992
1942
 
1993
1943
  // If a role attribute is not set, set it to "dialog" as the default.
1994
- if (!entry.dialog.hasAttribute('role')) {
1995
- entry.dialog.setAttribute('role', 'dialog');
1944
+ if (!entry.dialog.hasAttribute("role")) {
1945
+ entry.dialog.setAttribute("role", "dialog");
1996
1946
  }
1997
1947
 
1998
1948
  // Set tabindex="-1" so dialog is focusable via JS or click.
1999
- if (entry.getSetting('setTabindex')) {
2000
- entry.dialog.setAttribute('tabindex', '-1');
1949
+ if (entry.getSetting("setTabindex")) {
1950
+ entry.dialog.setAttribute("tabindex", "-1");
2001
1951
  }
2002
1952
 
2003
1953
  // Teleport modal if a reference has been set.
2004
- if (entry.getSetting('teleport')) {
1954
+ if (entry.getSetting("teleport")) {
2005
1955
  entry.teleport();
2006
1956
  }
2007
1957
 
@@ -2043,7 +1993,7 @@
2043
1993
  updateIndex: function updateIndex() {
2044
1994
  stackArray.forEach(function (entry, index) {
2045
1995
  entry.el.style.zIndex = null;
2046
- var value = getComputedStyle(entry.el)['z-index'];
1996
+ var value = getComputedStyle(entry.el)["z-index"];
2047
1997
  entry.el.style.zIndex = parseInt(value) + index + 1;
2048
1998
  });
2049
1999
  },
@@ -2054,7 +2004,7 @@
2054
2004
  add: function add(entry) {
2055
2005
  // Apply z-index styles based on stack length.
2056
2006
  entry.el.style.zIndex = null;
2057
- var value = getComputedStyle(entry.el)['z-index'];
2007
+ var value = getComputedStyle(entry.el)["z-index"];
2058
2008
  entry.el.style.zIndex = parseInt(value) + stackArray.length + 1;
2059
2009
 
2060
2010
  // Move back to end of stack.
@@ -2102,15 +2052,14 @@
2102
2052
  var _handleClick = /*#__PURE__*/_classPrivateFieldLooseKey("handleClick");
2103
2053
  var _handleKeydown$1 = /*#__PURE__*/_classPrivateFieldLooseKey("handleKeydown");
2104
2054
  var Modal = /*#__PURE__*/function (_Collection) {
2105
- _inheritsLoose(Modal, _Collection);
2106
2055
  function Modal(options) {
2107
2056
  var _this;
2108
2057
  _this = _Collection.call(this) || this;
2109
- Object.defineProperty(_assertThisInitialized(_this), _handleClick, {
2058
+ Object.defineProperty(_this, _handleClick, {
2110
2059
  writable: true,
2111
2060
  value: void 0
2112
2061
  });
2113
- Object.defineProperty(_assertThisInitialized(_this), _handleKeydown$1, {
2062
+ Object.defineProperty(_this, _handleKeydown$1, {
2114
2063
  writable: true,
2115
2064
  value: void 0
2116
2065
  });
@@ -2121,11 +2070,12 @@
2121
2070
 
2122
2071
  // Setup stack module.
2123
2072
  _this.stack = stack(_this.settings);
2124
- _classPrivateFieldLooseBase(_assertThisInitialized(_this), _handleClick)[_handleClick] = handleClick$1.bind(_assertThisInitialized(_this));
2125
- _classPrivateFieldLooseBase(_assertThisInitialized(_this), _handleKeydown$1)[_handleKeydown$1] = handleKeydown$1.bind(_assertThisInitialized(_this));
2073
+ _classPrivateFieldLooseBase(_this, _handleClick)[_handleClick] = handleClick$1.bind(_this);
2074
+ _classPrivateFieldLooseBase(_this, _handleKeydown$1)[_handleKeydown$1] = handleKeydown$1.bind(_this);
2126
2075
  if (_this.settings.autoInit) _this.init();
2127
2076
  return _this;
2128
2077
  }
2078
+ _inheritsLoose(Modal, _Collection);
2129
2079
  var _proto = Modal.prototype;
2130
2080
  _proto.init = function init(options) {
2131
2081
  try {
@@ -2167,12 +2117,12 @@
2167
2117
  }
2168
2118
  };
2169
2119
  _proto.initEventListeners = function initEventListeners() {
2170
- document.addEventListener('click', _classPrivateFieldLooseBase(this, _handleClick)[_handleClick], false);
2171
- document.addEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown$1)[_handleKeydown$1], false);
2120
+ document.addEventListener("click", _classPrivateFieldLooseBase(this, _handleClick)[_handleClick], false);
2121
+ document.addEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown$1)[_handleKeydown$1], false);
2172
2122
  };
2173
2123
  _proto.destroyEventListeners = function destroyEventListeners() {
2174
- document.removeEventListener('click', _classPrivateFieldLooseBase(this, _handleClick)[_handleClick], false);
2175
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown$1)[_handleKeydown$1], false);
2124
+ document.removeEventListener("click", _classPrivateFieldLooseBase(this, _handleClick)[_handleClick], false);
2125
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown$1)[_handleKeydown$1], false);
2176
2126
  };
2177
2127
  _proto.register = function register(query) {
2178
2128
  var els = getModalElements.call(this, query);
@@ -2212,26 +2162,25 @@
2212
2162
  return Promise.reject(e);
2213
2163
  }
2214
2164
  };
2215
- _createClass(Modal, [{
2165
+ return _createClass(Modal, [{
2216
2166
  key: "active",
2217
2167
  get: function get() {
2218
2168
  return this.stack.top;
2219
2169
  }
2220
2170
  }]);
2221
- return Modal;
2222
2171
  }(Collection);
2223
2172
 
2224
2173
  var defaults = {
2225
2174
  autoInit: false,
2226
2175
  // Selectors
2227
- selectorPopover: '.popover',
2228
- selectorArrow: '.popover__arrow',
2176
+ selectorPopover: ".popover",
2177
+ selectorArrow: ".popover__arrow",
2229
2178
  // State classes
2230
- stateActive: 'is-active',
2179
+ stateActive: "is-active",
2231
2180
  // Feature settings
2232
2181
  eventListeners: true,
2233
- eventType: 'click',
2234
- placement: 'bottom'
2182
+ eventType: "click",
2183
+ placement: "bottom"
2235
2184
  };
2236
2185
 
2237
2186
  function getConfig(el, settings) {
@@ -2240,19 +2189,19 @@
2240
2189
 
2241
2190
  // Setup the config obj with default values.
2242
2191
  var config = {
2243
- 'placement': settings.placement,
2244
- 'event': settings.eventType,
2245
- 'offset': 0,
2246
- 'overflow-padding': 0,
2247
- 'flip-padding': 0,
2248
- 'arrow-element': settings.selectorArrow,
2249
- 'arrow-padding': 0
2192
+ "placement": settings.placement,
2193
+ "event": settings.eventType,
2194
+ "offset": 0,
2195
+ "overflow-padding": 0,
2196
+ "flip-padding": 0,
2197
+ "arrow-element": settings.selectorArrow,
2198
+ "arrow-padding": 0
2250
2199
  };
2251
2200
 
2252
2201
  // Loop through config obj.
2253
2202
  for (var prop in config) {
2254
2203
  // Get the CSS variable property values.
2255
- var prefix = E();
2204
+ var prefix = P();
2256
2205
  var value = styles.getPropertyValue("--" + prefix + "popover-" + prop).trim();
2257
2206
 
2258
2207
  // If a value was found, replace the default in config obj.
@@ -2269,7 +2218,7 @@
2269
2218
  var padding;
2270
2219
 
2271
2220
  // Split the value by spaces if it's a string.
2272
- var array = typeof value === 'string' ? value.trim().split(' ') : [value];
2221
+ var array = typeof value === "string" ? value.trim().split(" ") : [value];
2273
2222
 
2274
2223
  // Convert individual values to integers.
2275
2224
  array.forEach(function (item, index) {
@@ -2316,32 +2265,32 @@
2316
2265
 
2317
2266
  function getModifiers(options) {
2318
2267
  return [{
2319
- name: 'offset',
2268
+ name: "offset",
2320
2269
  options: {
2321
- offset: [0, parseInt(options['offset'], 10)]
2270
+ offset: [0, parseInt(options["offset"], 10)]
2322
2271
  }
2323
2272
  }, {
2324
- name: 'preventOverflow',
2273
+ name: "preventOverflow",
2325
2274
  options: {
2326
- padding: getPadding(options['overflow-padding'])
2275
+ padding: getPadding(options["overflow-padding"])
2327
2276
  }
2328
2277
  }, {
2329
- name: 'flip',
2278
+ name: "flip",
2330
2279
  options: {
2331
- padding: getPadding(options['flip-padding'])
2280
+ padding: getPadding(options["flip-padding"])
2332
2281
  }
2333
2282
  }, {
2334
- name: 'arrow',
2283
+ name: "arrow",
2335
2284
  options: {
2336
- element: options['arrow-element'],
2337
- padding: getPadding(options['arrow-padding'])
2285
+ element: options["arrow-element"],
2286
+ padding: getPadding(options["arrow-padding"])
2338
2287
  }
2339
2288
  }];
2340
2289
  }
2341
2290
 
2342
2291
  function getPopover(query) {
2343
2292
  // Get the entry from collection.
2344
- var entry = typeof query === 'string' ? this.get(query) : this.get(query.id);
2293
+ var entry = typeof query === "string" ? this.get(query) : this.get(query.id);
2345
2294
 
2346
2295
  // Return entry if it was resolved, otherwise throw error.
2347
2296
  if (entry) {
@@ -2353,12 +2302,12 @@
2353
2302
 
2354
2303
  function getPopoverID(obj) {
2355
2304
  // If it's a string, return the string.
2356
- if (typeof obj === 'string') {
2305
+ if (typeof obj === "string") {
2357
2306
  return obj;
2358
2307
  }
2359
2308
 
2360
2309
  // If it's an HTML element.
2361
- else if (typeof obj.hasAttribute === 'function') {
2310
+ else if (typeof obj.hasAttribute === "function") {
2362
2311
  // If it's a popover element, return the id.
2363
2312
  if (obj.closest(this.settings.selectorPopover)) {
2364
2313
  obj = obj.closest(this.settings.selectorPopover);
@@ -2366,13 +2315,13 @@
2366
2315
  }
2367
2316
 
2368
2317
  // If it's a popover trigger, return value of aria-controls.
2369
- else if (obj.hasAttribute('aria-controls')) {
2370
- return obj.getAttribute('aria-controls');
2318
+ else if (obj.hasAttribute("aria-controls")) {
2319
+ return obj.getAttribute("aria-controls");
2371
2320
  }
2372
2321
 
2373
2322
  // If it's a popover tooltip trigger, return the value of aria-describedby.
2374
- else if (obj.hasAttribute('aria-describedby')) {
2375
- return obj.getAttribute('aria-describedby');
2323
+ else if (obj.hasAttribute("aria-describedby")) {
2324
+ return obj.getAttribute("aria-describedby");
2376
2325
  }
2377
2326
 
2378
2327
  // Return false if no id was found.
@@ -2399,11 +2348,11 @@
2399
2348
  };
2400
2349
  } else if (!trigger) {
2401
2350
  return {
2402
- error: new Error('No popover trigger associated with the provided popover.')
2351
+ error: new Error("No popover trigger associated with the provided popover.")
2403
2352
  };
2404
2353
  } else if (!popover) {
2405
2354
  return {
2406
- error: new Error('No popover associated with the provided popover trigger.')
2355
+ error: new Error("No popover associated with the provided popover trigger.")
2407
2356
  };
2408
2357
  } else {
2409
2358
  return {
@@ -2413,7 +2362,7 @@
2413
2362
  }
2414
2363
  } else {
2415
2364
  return {
2416
- error: new Error('Could not resolve the popover ID.')
2365
+ error: new Error("Could not resolve the popover ID.")
2417
2366
  };
2418
2367
  }
2419
2368
  }
@@ -2425,7 +2374,7 @@
2425
2374
  return Promise.resolve(Promise.all(_this2.collection.map(function (popover) {
2426
2375
  try {
2427
2376
  var _temp2 = function () {
2428
- if (popover.state === 'opened') {
2377
+ if (popover.state === "opened") {
2429
2378
  var _push = result.push;
2430
2379
  return Promise.resolve(close.call(_this2, popover)).then(function (_close$call) {
2431
2380
  _push.call(result, _close$call);
@@ -2447,25 +2396,25 @@
2447
2396
  try {
2448
2397
  var _temp = function _temp(popover) {
2449
2398
  // If a modal exists and its state is opened.
2450
- if (popover && popover.state === 'opened') {
2399
+ if (popover && popover.state === "opened") {
2451
2400
  // Update state class.
2452
2401
  popover.el.classList.remove(_this.settings.stateActive);
2453
2402
 
2454
2403
  // Update accessibility attribute(s).
2455
- if (popover.trigger.hasAttribute('aria-controls')) {
2456
- popover.trigger.setAttribute('aria-expanded', 'false');
2404
+ if (popover.trigger.hasAttribute("aria-controls")) {
2405
+ popover.trigger.setAttribute("aria-expanded", "false");
2457
2406
  }
2458
2407
 
2459
2408
  // Disable popper event listeners.
2460
2409
  popover.popper.setOptions({
2461
2410
  modifiers: [{
2462
- name: 'eventListeners',
2411
+ name: "eventListeners",
2463
2412
  enabled: false
2464
2413
  }]
2465
2414
  });
2466
2415
 
2467
2416
  // Update popover state.
2468
- popover.state = 'closed';
2417
+ popover.state = "closed";
2469
2418
 
2470
2419
  // Clear root trigger if popover trigger matches.
2471
2420
  if (popover.trigger === _this.trigger) {
@@ -2485,12 +2434,12 @@
2485
2434
  };
2486
2435
  function closeCheck(popover) {
2487
2436
  // Only run closeCheck if provided popover is currently open.
2488
- if (popover.state != 'opened') return;
2437
+ if (popover.state != "opened") return;
2489
2438
 
2490
2439
  // Needed to correctly check which element is currently being focused.
2491
2440
  setTimeout(function () {
2492
2441
  // Check if trigger or element are being hovered.
2493
- var isHovered = popover.el.closest(':hover') === popover.el || popover.trigger.closest(':hover') === popover.trigger;
2442
+ var isHovered = popover.el.closest(":hover") === popover.el || popover.trigger.closest(":hover") === popover.trigger;
2494
2443
 
2495
2444
  // Check if trigger or element are being focused.
2496
2445
  var isFocused = document.activeElement.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"], [aria-describedby=\"" + popover.id + "\"]");
@@ -2506,7 +2455,7 @@
2506
2455
  }
2507
2456
 
2508
2457
  function handleClick(popover) {
2509
- if (popover.state === 'opened') {
2458
+ if (popover.state === "opened") {
2510
2459
  popover.close();
2511
2460
  } else {
2512
2461
  this.trigger = popover.trigger;
@@ -2517,13 +2466,13 @@
2517
2466
  function handleKeydown(event) {
2518
2467
  var _this = this;
2519
2468
  switch (event.key) {
2520
- case 'Escape':
2469
+ case "Escape":
2521
2470
  if (this.trigger) {
2522
2471
  this.trigger.focus();
2523
2472
  }
2524
2473
  closeAll.call(this);
2525
2474
  return;
2526
- case 'Tab':
2475
+ case "Tab":
2527
2476
  this.collection.forEach(function (popover) {
2528
2477
  closeCheck.call(_this, popover);
2529
2478
  });
@@ -2534,7 +2483,7 @@
2534
2483
  }
2535
2484
  function handleDocumentClick(popover) {
2536
2485
  var root = this;
2537
- document.addEventListener('click', function _f(event) {
2486
+ document.addEventListener("click", function _f(event) {
2538
2487
  // Check if a popover or its trigger was clicked.
2539
2488
  var wasClicked = event.target.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"], [aria-describedby=\"" + popover.id + "\"]");
2540
2489
 
@@ -2542,14 +2491,14 @@
2542
2491
  if (wasClicked) {
2543
2492
  // If popover element exists and is not active...
2544
2493
  if (popover.el && !popover.el.classList.contains(root.settings.stateActive)) {
2545
- this.removeEventListener('click', _f);
2494
+ this.removeEventListener("click", _f);
2546
2495
  }
2547
2496
  } else {
2548
2497
  // If popover element exists and is active...
2549
2498
  if (popover.el && popover.el.classList.contains(root.settings.stateActive)) {
2550
2499
  popover.close();
2551
2500
  }
2552
- this.removeEventListener('click', _f);
2501
+ this.removeEventListener("click", _f);
2553
2502
  }
2554
2503
  });
2555
2504
  }
@@ -4360,7 +4309,7 @@
4360
4309
  var entry = _this.collection[index];
4361
4310
 
4362
4311
  // If entry is in the opened state, close it.
4363
- if (entry.state === 'opened') {
4312
+ if (entry.state === "opened") {
4364
4313
  entry.close();
4365
4314
  }
4366
4315
 
@@ -4415,8 +4364,8 @@
4415
4364
  popover.el.classList.add(_this.settings.stateActive);
4416
4365
 
4417
4366
  // Update accessibility attribute(s).
4418
- if (popover.trigger.hasAttribute('aria-controls')) {
4419
- popover.trigger.setAttribute('aria-expanded', 'true');
4367
+ if (popover.trigger.hasAttribute("aria-controls")) {
4368
+ popover.trigger.setAttribute("aria-expanded", "true");
4420
4369
  }
4421
4370
 
4422
4371
  // Update popover config.
@@ -4424,9 +4373,9 @@
4424
4373
 
4425
4374
  // Enable popper event listeners and set placement/modifiers.
4426
4375
  popover.popper.setOptions({
4427
- placement: popover.config['placement'],
4376
+ placement: popover.config["placement"],
4428
4377
  modifiers: [{
4429
- name: 'eventListeners',
4378
+ name: "eventListeners",
4430
4379
  enabled: true
4431
4380
  }].concat(getModifiers(popover.config))
4432
4381
  });
@@ -4435,7 +4384,7 @@
4435
4384
  popover.popper.update();
4436
4385
 
4437
4386
  // Update popover state.
4438
- popover.state = 'opened';
4387
+ popover.state = "opened";
4439
4388
 
4440
4389
  // Return the popover.
4441
4390
  return Promise.resolve(popover);
@@ -4469,7 +4418,7 @@
4469
4418
  // Setup the popover object.
4470
4419
  var entry = _extends({
4471
4420
  id: el.id,
4472
- state: 'closed',
4421
+ state: "closed",
4473
4422
  el: el,
4474
4423
  trigger: trigger,
4475
4424
  popper: createPopper(trigger, el),
@@ -4477,8 +4426,8 @@
4477
4426
  }, methods);
4478
4427
 
4479
4428
  // Set aria-expanded to false if trigger has aria-controls attribute.
4480
- if (entry.trigger.hasAttribute('aria-controls')) {
4481
- entry.trigger.setAttribute('aria-expanded', 'false');
4429
+ if (entry.trigger.hasAttribute("aria-controls")) {
4430
+ entry.trigger.setAttribute("aria-expanded", "false");
4482
4431
  }
4483
4432
 
4484
4433
  // Setup event listeners.
@@ -4507,18 +4456,18 @@
4507
4456
  // If event listeners aren't already setup.
4508
4457
  if (!entry.__eventListeners) {
4509
4458
  // Add event listeners based on event type.
4510
- var eventType = entry.config['event'];
4459
+ var eventType = entry.config["event"];
4511
4460
 
4512
4461
  // If the event type is hover.
4513
- if (eventType === 'hover') {
4462
+ if (eventType === "hover") {
4514
4463
  // Setup event listeners object for hover.
4515
4464
  entry.__eventListeners = [{
4516
- el: ['trigger'],
4517
- type: ['mouseenter', 'focus'],
4465
+ el: ["trigger"],
4466
+ type: ["mouseenter", "focus"],
4518
4467
  listener: open.bind(this, entry)
4519
4468
  }, {
4520
- el: ['el', 'trigger'],
4521
- type: ['mouseleave', 'focusout'],
4469
+ el: ["el", "trigger"],
4470
+ type: ["mouseleave", "focusout"],
4522
4471
  listener: closeCheck.bind(this, entry)
4523
4472
  }];
4524
4473
 
@@ -4536,8 +4485,8 @@
4536
4485
  else {
4537
4486
  // Setup event listeners object for click.
4538
4487
  entry.__eventListeners = [{
4539
- el: ['trigger'],
4540
- type: ['click'],
4488
+ el: ["trigger"],
4489
+ type: ["click"],
4541
4490
  listener: handleClick.bind(this, entry)
4542
4491
  }];
4543
4492
 
@@ -4558,21 +4507,21 @@
4558
4507
 
4559
4508
  var _handleKeydown = /*#__PURE__*/_classPrivateFieldLooseKey("handleKeydown");
4560
4509
  var Popover = /*#__PURE__*/function (_Collection) {
4561
- _inheritsLoose(Popover, _Collection);
4562
4510
  function Popover(options) {
4563
4511
  var _this;
4564
4512
  _this = _Collection.call(this) || this;
4565
- Object.defineProperty(_assertThisInitialized(_this), _handleKeydown, {
4513
+ Object.defineProperty(_this, _handleKeydown, {
4566
4514
  writable: true,
4567
4515
  value: void 0
4568
4516
  });
4569
4517
  _this.defaults = defaults;
4570
4518
  _this.settings = _extends({}, _this.defaults, options);
4571
4519
  _this.trigger = null;
4572
- _classPrivateFieldLooseBase(_assertThisInitialized(_this), _handleKeydown)[_handleKeydown] = handleKeydown.bind(_assertThisInitialized(_this));
4520
+ _classPrivateFieldLooseBase(_this, _handleKeydown)[_handleKeydown] = handleKeydown.bind(_this);
4573
4521
  if (_this.settings.autoInit) _this.init();
4574
4522
  return _this;
4575
4523
  }
4524
+ _inheritsLoose(Popover, _Collection);
4576
4525
  var _proto = Popover.prototype;
4577
4526
  _proto.init = function init(options) {
4578
4527
  try {
@@ -4630,7 +4579,7 @@
4630
4579
  }
4631
4580
 
4632
4581
  // Add keydown global event listener.
4633
- document.addEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown)[_handleKeydown], false);
4582
+ document.addEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown)[_handleKeydown], false);
4634
4583
  };
4635
4584
  _proto.destroyEventListeners = function destroyEventListeners(processCollection) {
4636
4585
  if (processCollection === void 0) {
@@ -4644,7 +4593,7 @@
4644
4593
  }
4645
4594
 
4646
4595
  // Remove keydown global event listener.
4647
- document.removeEventListener('keydown', _classPrivateFieldLooseBase(this, _handleKeydown)[_handleKeydown], false);
4596
+ document.removeEventListener("keydown", _classPrivateFieldLooseBase(this, _handleKeydown)[_handleKeydown], false);
4648
4597
  };
4649
4598
  _proto.register = function register$1(query) {
4650
4599
  var els = getPopoverElements.call(this, query);