@getflip/swirl-components 0.256.1 → 0.256.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.
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-11-18T12:21:40",
2
+ "timestamp": "2024-11-18T13:07:41",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.18.1",
@@ -35,7 +35,7 @@ const SwirlTreeNavigationItem = class {
35
35
  }
36
36
  };
37
37
  this.toggleExpanded = (event) => {
38
- if (!this.href || !this.expandable) {
38
+ if (this.expandable && this.hasChildren && !this.href) {
39
39
  event.preventDefault();
40
40
  event.stopPropagation();
41
41
  if (this.expanded) {
@@ -86,9 +86,9 @@ const SwirlTreeNavigationItem = class {
86
86
  "tree-navigation-item__link--active": this.active,
87
87
  "tree-navigation-item__link--has-icon": Boolean(this.icon),
88
88
  });
89
- return (index.h(index.Host, { key: 'a821377f4a2e8f7913ab6aa65ca7b0126b99fd95', role: "none" }, index.h("li", { key: '712e77af1186a24e1ef884e5972044ee0e8ebf8f', class: "tree-navigation-item", role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, index.h(Tag, { key: 'bb33784af6d87d1fac438398e435d7305aa53616', onClick: this.toggleExpanded, onKeyDown: this.onKeyDown, class: linkClassName, href: this.href, target: this.target, type: isLink ? undefined : "button", id: this.buttonId, "aria-current": this.active ? "page" : undefined, "aria-controls": this.hasChildren ? this.childrenId : undefined, "aria-expanded": this.hasChildren ? this.expanded : undefined }, index.h("span", { key: '23100bf22e467bcd776110bf3b417c14dd712c9d', class: "tree-navigation-item__content" }, this.icon && (index.h("swirl-icon", { key: '2ccfae85ca436819f2d2461c4c7b2f1f0c9d75b6', class: "tree-navigation-item__icon", glyph: this.icon, size: 20, "aria-hidden": "true", role: "img", "aria-label": `${this.label} icon` })), index.h("span", { key: '6a09c3578093f8de3b111132192d6b52ce31425e', class: "tree-navigation-item__label" }, this.label)), this.expandable && this.hasChildren && !this.external && (index.h("span", { key: '952182732993dd3a79692e91a497d488dfc8b335', class: "tree-navigation-item__toggle-icon", "aria-hidden": "true" }, this.expanded ? (index.h("swirl-icon-expand-more", { size: 16, role: "img", "aria-label": "Collapse" })) : (index.h("swirl-icon-chevron-right", { size: 16, role: "img", "aria-label": "Expand" })))), this.external && (index.h("span", { key: '1e1b284f3f61dcf375d3ae2904d4e43af95f94ee', class: "tree-navigation-item__external-icon", "aria-hidden": "true" }, index.h("swirl-icon-open-in-new", { key: '6bc207820463c81edd493ad7a8d86bb69598a91f', size: 16, role: "img", "aria-label": "External link" })))), this.hasChildren && (index.h("ul", { key: '32a8f9120bb8b1b6a381151a4d74b83f701a53fa', class: "tree-navigation-item__children", id: this.childrenId, role: "group", "aria-label": `${this.label} submenu`, style: {
89
+ return (index.h(index.Host, { key: 'a9ff10b73bf2590b5b32c6bdde98452b325dd07f', role: "none" }, index.h("li", { key: 'a36bac6a8f8d6cc08cc12b82751b412cab9770e6', class: "tree-navigation-item", role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, index.h(Tag, { key: 'ea5988791f7a62127a0dc6a1bf06530fe258296a', onClick: this.toggleExpanded, onKeyDown: this.onKeyDown, class: linkClassName, href: this.href, target: this.target, type: isLink ? undefined : "button", id: this.buttonId, "aria-current": this.active ? "page" : undefined, "aria-controls": this.hasChildren ? this.childrenId : undefined, "aria-expanded": this.hasChildren ? this.expanded : undefined }, index.h("span", { key: '5838bc17bf01e8644b583c122b9d0c72b842ccad', class: "tree-navigation-item__content" }, this.icon && (index.h("swirl-icon", { key: '5e9bf82d1ff7aa4a46e077786e0d6dc05d367526', class: "tree-navigation-item__icon", glyph: this.icon, size: 20, "aria-hidden": "true", role: "img", "aria-label": `${this.label} icon` })), index.h("span", { key: '017b1e8ecb93b08f4ad51cc2e0b7d800b4d74bdd', class: "tree-navigation-item__label" }, this.label)), this.expandable && this.hasChildren && !this.external && (index.h("span", { key: 'fed4147568ee64adc006d4d4e87c8a7a8370f079', class: "tree-navigation-item__toggle-icon", "aria-hidden": "true" }, this.expanded ? (index.h("swirl-icon-expand-more", { size: 16, role: "img", "aria-label": "Collapse" })) : (index.h("swirl-icon-chevron-right", { size: 16, role: "img", "aria-label": "Expand" })))), this.external && (index.h("span", { key: 'f219e59cee7707992bb270edf301c67867fccad9', class: "tree-navigation-item__external-icon", "aria-hidden": "true" }, index.h("swirl-icon-open-in-new", { key: '3f71c3097d071e90fa026a86ddcd101677c2c3ce', size: 16, role: "img", "aria-label": "External link" })))), this.hasChildren && (index.h("ul", { key: 'f0acf9327561438ece383a8b2dd047f175e1692d', class: "tree-navigation-item__children", id: this.childrenId, role: "group", "aria-label": `${this.label} submenu`, style: {
90
90
  display: !this.expanded ? "none" : undefined,
91
- } }, index.h("slot", { key: '43389aa1d7626ad3949bd71cd2556872a31d96b5' }))))));
91
+ } }, index.h("slot", { key: '42e95f0cfc4890335acb8c6a972f869f260396f2' }))))));
92
92
  }
93
93
  get el() { return index.getElement(this); }
94
94
  static get watchers() { return {