Skip to main content
cngx-src documentation

CngxStepperSwipeNav

DirectivePrimaryv0.1.0WCAG AA

projects/common/stepper/swipe-nav.directive.ts

Import#

import { CngxStepperSwipeNav } from '@cngx/common/stepper'

Description#

Routes a CngxSwipe gesture into the stepper presenter so the organism's mobile-collapse panels gain swipe-driven navigation without duplicating pointer handling. Applied via hostDirectives on <cngx-stepper>; consumer-facing input [mobileSwipe] is forwarded through the host metadata.

Cascade for swipeEnabled: per-instance [mobileSwipe] -> CNGX_STEPPER_CONFIG.mobileSwipe -> library default true.

Direction routing is asymmetric, matching the presenter's existing navigation surface: the forward swipe (left under ltr, right under rtl) -> selectNext() -> select() (linear gate + commit window apply identically to a click); the back swipe -> selectPrevious(), gated on busy() like the strip back-arrow.

Metadata#

Index#

Derived State

Inputs#

mobileSwipe#boolean | undefined
input()

Per-instance opt-out for the built-in swipe navigation. undefined defers to the config cascade.

Methods#

handleSwipe#void
handleSwipe(direction: SwipeDirection)

Route a swipe direction into the presenter. The inline mapping resolves against the document direction like the keyboard path: under ltr a left swipe advances; under rtl the roles flip. Vertical directions are ignored. The back path waits while a commit is in flight - a stray gesture must not supersede it (the programmatic selectPrevious() cancels deliberately).

@paramdirectionSwipeDirection