@threadlabs/looma 0.10.3 → 0.10.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.
@@ -59,9 +59,17 @@ export default function controller(host) {
59
59
  };
60
60
  const onDisclosureClick = (event) => { event.stopPropagation(); setExpanded(!Boolean(host.state.internalExpanded), triggerFor(event)); };
61
61
  const onRowClick = (event) => {
62
- if (!isContainer() || host.state.disabled) return;
62
+ if (host.state.disabled) return;
63
63
  const interactive = event.composedPath().some((node) => node instanceof HTMLElement && node.matches?.('a, button, input, select, textarea, [role="button"], [role="link"]'));
64
- if (!interactive) setExpanded(!Boolean(host.state.internalExpanded), triggerFor(event));
64
+ if (interactive) return;
65
+ if (isContainer()) {
66
+ setExpanded(!Boolean(host.state.internalExpanded), triggerFor(event));
67
+ return;
68
+ }
69
+ // A leaf row whose label is a link is that link everywhere a control is not: its icon and padding
70
+ // follow it too. The click is replayed with its modifiers, so a modified click still opens a tab.
71
+ const link = labelText?.querySelector("a[href]");
72
+ if (link) link.dispatchEvent(new MouseEvent("click", event));
65
73
  };
66
74
  const onRoving = (event) => { host.state.tabStop = Boolean(event.detail?.active) && !host.state.disabled; apply(); };
67
75
  const onExpansionRequest = (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",