Skip to main content
cngx-src documentation

CngxHierarchicalNavStrategy

Interface

projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts

Import#

import { CngxHierarchicalNavStrategy } from '@cngx/common/interactive'

Description#

Pluggable keyboard policy for CngxHierarchicalNav. The default implementation (createW3CTreeStrategy) matches the W3C APG treeview pattern; consumers who need different semantics (e.g. "ArrowRight always expands but never moves to first child", "ArrowLeft collapses but never jumps to parent") can register their own strategy via CNGX_HIERARCHICAL_NAV_STRATEGY.

Strategy steps are synchronous, side-effect-allowed functions - they may call ctrl.expand() / ctrl.collapse() / ad.highlightByValue() before returning the corresponding action. The directive then emits the informational output + prevents default key handling.