@getflip/swirl-components 0.118.2 → 0.118.4

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/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-12-12T14:00:24",
2
+ "timestamp": "2023-12-13T08:48:01",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -270,13 +270,12 @@ const swirlPopoverTriggerCss = ".sc-swirl-popover-trigger-h{display:contents}";
270
270
  const SwirlPopoverTrigger = class {
271
271
  constructor(hostRef) {
272
272
  index.registerInstance(this, hostRef);
273
- this.popoverOpen = false;
274
273
  this.onClick = () => {
275
274
  const popoverEl = this.getPopoverEl();
276
275
  if (!Boolean(popoverEl)) {
277
276
  return;
278
277
  }
279
- if (this.popoverOpen) {
278
+ if (this.isPopoverOpen()) {
280
279
  popoverEl.close();
281
280
  return;
282
281
  }
@@ -286,11 +285,9 @@ const SwirlPopoverTrigger = class {
286
285
  }
287
286
  popoverEl.open(triggerEl);
288
287
  popoverEl.addEventListener("popoverOpen", () => {
289
- this.popoverOpen = true;
290
288
  this.updateTriggerElAriaAttributes(true);
291
289
  }, { once: true });
292
290
  popoverEl.addEventListener("popoverClose", () => {
293
- this.popoverOpen = false;
294
291
  this.updateTriggerElAriaAttributes(false);
295
292
  }, { once: true });
296
293
  };
@@ -331,6 +328,11 @@ const SwirlPopoverTrigger = class {
331
328
  }
332
329
  return this.el.children[0];
333
330
  }
331
+ isPopoverOpen() {
332
+ const popover = this.getPopoverEl();
333
+ const isActive = popover.shadowRoot.firstChild?.classList.contains("popover--active");
334
+ return isActive;
335
+ }
334
336
  render() {
335
337
  return (index.h(index.Host, { onClick: this.onClick }, index.h("slot", null)));
336
338
  }