vrembem 3.0.3 → 3.0.6

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.
@@ -622,12 +622,14 @@
622
622
 
623
623
  return new Proxy(getStore(), {
624
624
  set: function set(target, property, value) {
625
- target[property] = value;
626
- if (enable) setStore(target);
627
- return true;
628
- },
629
- deleteProperty: function deleteProperty(target, property) {
630
- delete target[property];
625
+ console.log('localStore() => set');
626
+
627
+ if (value === undefined) {
628
+ delete target[property];
629
+ } else {
630
+ target[property] = value;
631
+ }
632
+
631
633
  if (enable) setStore(target);
632
634
  return true;
633
635
  }
@@ -971,7 +973,7 @@
971
973
  if (index >= 0) {
972
974
  var _temp7 = function _temp7() {
973
975
  // Remove entry from local store.
974
- delete _this2.store[_entry.id]; // Unmount the MatchMedia functionality.
976
+ _this2.store[_entry.id] = undefined; // Unmount the MatchMedia functionality.
975
977
 
976
978
  _entry.unmountBreakpoint(); // Delete properties from collection entry.
977
979
 
@@ -1003,12 +1005,12 @@
1003
1005
  }
1004
1006
  };
1005
1007
 
1006
- function L() {
1008
+ function g() {
1007
1009
  return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
1008
1010
  }
1009
1011
 
1010
1012
  function getBreakpoint(drawer) {
1011
- var prefix = L();
1013
+ var prefix = g();
1012
1014
  var bp = drawer.getAttribute("data-" + this.settings.dataBreakpoint);
1013
1015
 
1014
1016
  if (this.settings.breakpoints && this.settings.breakpoints[bp]) {
@@ -2313,7 +2315,7 @@
2313
2315
 
2314
2316
  for (var prop in config) {
2315
2317
  // Get the CSS variable property values.
2316
- var prefix = L();
2318
+ var prefix = g();
2317
2319
  var value = styles.getPropertyValue("--" + prefix + "popover-" + prop).trim(); // If a value was found, replace the default in config obj.
2318
2320
 
2319
2321
  if (value) {
@@ -2542,7 +2544,7 @@
2542
2544
  // Check if trigger or element are being hovered.
2543
2545
  var isHovered = popover.el.closest(':hover') === popover.el || popover.trigger.closest(':hover') === popover.trigger; // Check if trigger or element are being focused.
2544
2546
 
2545
- var isFocused = document.activeElement.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"]"); // Close if the trigger and element are not currently hovered or focused.
2547
+ var isFocused = document.activeElement.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"], [aria-describedby=\"" + popover.id + "\"]"); // Close if the trigger and element are not currently hovered or focused.
2546
2548
 
2547
2549
  if (!isHovered && !isFocused) {
2548
2550
  popover.close();
@@ -2587,21 +2589,21 @@
2587
2589
  function handleDocumentClick(popover) {
2588
2590
  var root = this;
2589
2591
  document.addEventListener('click', function _f(event) {
2590
- // Check if a popover was clicked.
2591
- var result = event.target.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"]");
2592
+ // Check if a popover or its trigger was clicked.
2593
+ var wasClicked = event.target.closest("#" + popover.id + ", [aria-controls=\"" + popover.id + "\"], [aria-describedby=\"" + popover.id + "\"]"); // If popover or popover trigger was clicked...
2592
2594
 
2593
- if (!result) {
2594
- // If it doesn't match and popover is open, close it and remove event listener.
2595
+ if (wasClicked) {
2596
+ // If popover element exists and is not active...
2597
+ if (popover.el && !popover.el.classList.contains(root.settings.stateActive)) {
2598
+ this.removeEventListener('click', _f);
2599
+ }
2600
+ } else {
2601
+ // If popover element exists and is active...
2595
2602
  if (popover.el && popover.el.classList.contains(root.settings.stateActive)) {
2596
2603
  popover.close();
2597
2604
  }
2598
2605
 
2599
2606
  this.removeEventListener('click', _f);
2600
- } else {
2601
- // If it does match and popover isn't currently active, remove event listener.
2602
- if (popover.el && !popover.el.classList.contains(root.settings.stateActive)) {
2603
- this.removeEventListener('click', _f);
2604
- }
2605
2607
  }
2606
2608
  });
2607
2609
  }