From d0caac1058649e2cbd9ec0dbcc696d836233b16f Mon Sep 17 00:00:00 2001 From: masuP9 Date: Thu, 14 May 2026 02:25:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat(treegrid):=20=E3=83=9E=E3=82=A6?= =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B=E3=82=BB=E3=83=AB=E3=83=95=E3=82=A9=E3=83=BC=E3=82=AB?= =?UTF-8?q?=E3=82=B9=E3=81=A8=E5=B1=95=E9=96=8B/=E6=8A=98=E3=82=8A?= =?UTF-8?q?=E3=81=9F=E3=81=9F=E3=81=BF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 任意のセルクリックでそのセルにフォーカスを移動し、rowheader クリックで親行の 展開/折りたたみをトグルする。行選択 (aria-selected) は Space キー専用のまま 維持し、APG の cell-only focus model とキーボードのセマンティクスを保つ。 4 フレームワーク (React / Vue / Svelte / Astro Web Component) と ドキュメント (treegrid.md, accessibility-docs MDX) を更新。 package version は 0.3.8 にバンプ。 Co-Authored-By: Claude Opus 4.7 (1M context) --- package-lock.json | 4 +- package.json | 2 +- .../accessibility-docs/treegrid/en.mdx | 14 ++ .../accessibility-docs/treegrid/ja.mdx | 14 ++ src/patterns/treegrid/TreeGrid.astro | 35 +++++ src/patterns/treegrid/TreeGrid.svelte | 34 +++++ src/patterns/treegrid/TreeGrid.test.tsx | 137 ++++++++++++++++++ src/patterns/treegrid/TreeGrid.tsx | 41 ++++++ src/patterns/treegrid/TreeGrid.vue | 34 +++++ src/patterns/treegrid/treegrid.ja.md | 14 ++ src/patterns/treegrid/treegrid.md | 14 ++ 11 files changed, 340 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5f52250..be0c85a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "apg-patterns-examples", - "version": "0.3.7", + "version": "0.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "apg-patterns-examples", - "version": "0.3.7", + "version": "0.3.8", "license": "MIT", "dependencies": { "@astrojs/compiler-rs": "^0.1.10", diff --git a/package.json b/package.json index af0e0d50..bd14f73e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "apg-patterns-examples", "type": "module", - "version": "0.3.7", + "version": "0.3.8", "private": false, "description": "Accessible UI components following WAI-ARIA APG patterns. Multi-framework implementations in React, Vue, Svelte, and Astro with documentation and tests.", "author": "masuP9", diff --git a/src/content/accessibility-docs/treegrid/en.mdx b/src/content/accessibility-docs/treegrid/en.mdx index 28d928cc..adcbed8d 100644 --- a/src/content/accessibility-docs/treegrid/en.mdx +++ b/src/content/accessibility-docs/treegrid/en.mdx @@ -158,6 +158,20 @@ Total columns (for virtualization) - Tree operations (expand/collapse) only work at the rowheader column - Rows have aria-level to indicate hierarchy depth +### Mouse Support (non-APG extension) + +APG does not specify mouse behavior for the treegrid pattern. This implementation adds a minimal mouse layer that preserves the cell-only focus model and keyboard semantics defined above. + +| Action | Behavior | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| Click any cell | Move focus to the cell (updates roving tabindex). Row selection (`aria-selected`) is unchanged | +| Click a rowheader of an expandable, non-disabled row | Above, plus toggle expand/collapse | +| Click on a row with `aria-disabled="true"` | Focus may move, but expansion is not toggled (matches arrow-key behavior on disabled rows) | +| Click on an interactive descendant (`