@cngx/ui 0.1.0-rc.1 → 0.1.0-rc.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/fesm2022/cngx-ui-mat-tabs.mjs +20 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +98 -11
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +110 -12
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +1 -1
- package/package.json +1 -1
- package/stepper/README.md +24 -0
- package/types/cngx-ui-mat-tabs.d.ts +5 -0
- package/types/cngx-ui-stepper.d.ts +66 -6
- package/types/cngx-ui-tabs.d.ts +83 -9
package/types/cngx-ui-tabs.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import * as i2 from '@cngx/common/a11y';
|
|
|
6
6
|
import { CngxPopover } from '@cngx/common/popover';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* CNGX tab-group organism.
|
|
10
|
-
*
|
|
9
|
+
* CNGX tab-group organism. \
|
|
10
|
+
* Thin shell over {@link CngxTabGroupPresenter}
|
|
11
|
+
* and `CngxFocusRestore` via `hostDirectives`. The APG tablist keyboard
|
|
11
12
|
* model (automatic activation: arrow keys move focus AND select; Home/End
|
|
12
13
|
* jump to first/last; the active tab is the lone tab stop) lives in
|
|
13
14
|
* {@link createTabKeyboardNav}, deriving the roving stop from the
|
|
@@ -19,7 +20,12 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
19
20
|
* host directive: its `role="status"` would clobber the wrapper's
|
|
20
21
|
* `role="group"` landmark.
|
|
21
22
|
*
|
|
23
|
+
* @playground Material theme coverage across all skins ./examples/material-theme-coverage/skins-coverage.component.ts
|
|
24
|
+
* @playground Overflow "More" menu under resize ./examples/overflow-resize/overflow-resize.component.ts
|
|
25
|
+
* @playground Async commit-action (optimistic / pessimistic) ./examples/async-commit/async-commit.component.ts
|
|
26
|
+
* @playground Dismissable + addable tabs ./examples/dynamic-tabs/dynamic-tabs.component.ts
|
|
22
27
|
* @playground Form error aggregation ./examples/form-errors/form-errors.component.ts
|
|
28
|
+
* @playground Routed tabs with a CanDeactivate guard ./examples/routed-outlet/routed-outlet.component.ts
|
|
23
29
|
* @see {@link CngxMatTabs} for the Material `<mat-tab-group>` variant with `[cngxMatTabError]`.
|
|
24
30
|
*
|
|
25
31
|
* @category ui/tabs
|
|
@@ -30,12 +36,12 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
30
36
|
* @relatedTo CngxTabOverflow, CngxTabGroupPresenter, CngxTab, CngxFocusRestore
|
|
31
37
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
32
38
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
33
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
34
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
35
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
36
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
37
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
38
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
39
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/all-skins-side-by-side</example-url>
|
|
40
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/contained</example-url>
|
|
41
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/line</example-url>
|
|
42
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/pill</example-url>
|
|
43
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/pill-vs-toggle-group</example-url>
|
|
44
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/vertical-skins</example-url>
|
|
39
45
|
*/
|
|
40
46
|
declare class CngxTabGroup implements CngxTabPanelHost {
|
|
41
47
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
@@ -256,6 +262,72 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
256
262
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabGroup, "cngx-tab-group", ["cngxTabGroup"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "iconLayout": { "alias": "iconLayout"; "required": false; "isSignal": true; }; "panelMode": { "alias": "panelMode"; "required": false; "isSignal": true; }; "fitted": { "alias": "fitted"; "required": false; "isSignal": true; }; "tabAlign": { "alias": "tabAlign"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; }, {}, ["tabDirectives", "errorBadgeSlot", "rejectionIconSlot", "busySpinnerSlot", "iconSlot", "closeIconSlot", "addIconSlot"], ["cngx-tab-overflow", "*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; "loop": "loop"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeIndexChange": "activeIndexChange"; "tabClose": "tabClose"; "tabAdd": "tabAdd"; }; }, { directive: typeof i2.CngxFocusRestore; inputs: {}; outputs: {}; }]>;
|
|
257
263
|
}
|
|
258
264
|
|
|
265
|
+
/**
|
|
266
|
+
* CNGX tab-nav organism. \
|
|
267
|
+
* A `role="navigation"` landmark that wraps consumer-authored
|
|
268
|
+
* `<a cngxTabLink routerLink>` anchors into a tab bar. Native parallel of
|
|
269
|
+
* `[cngxMatTabNav]` in `@cngx/ui/mat-tabs`, and the link-driven sibling of
|
|
270
|
+
* the programmatic `<cngx-tab-group>` tablist: a navigation of natively
|
|
271
|
+
* focusable links is a different WAI-ARIA pattern than an automatic-
|
|
272
|
+
* activation tablist, so it is a separate organism, not a skin flag.
|
|
273
|
+
*
|
|
274
|
+
* Thin shell over {@link CngxTabGroupPresenter} via `hostDirectives` - the
|
|
275
|
+
* registry, `activeIndex`, and `activeId` come from the same brain the
|
|
276
|
+
* tablist organism and the Material bridge compose. There is no keyboard
|
|
277
|
+
* model and no commit gating: links are natural `Tab` stops, `Enter`
|
|
278
|
+
* activates the `routerLink`, and the router runs `CanDeactivate` natively.
|
|
279
|
+
* Add `[cngxTabsRouteSync]` to drive the active link from the route - it
|
|
280
|
+
* reflects `NavigationEnd` onto `activeIndex`; its commit-action stays
|
|
281
|
+
* dormant because nothing here calls `presenter.select()`.
|
|
282
|
+
*
|
|
283
|
+
* `CngxLiveRegion` is mounted as a child `<span>` rather than a host
|
|
284
|
+
* directive: its `role="status"` would clobber the host's `role="navigation"`
|
|
285
|
+
* landmark. Its content is the active link's label (Pillar 2 - the active
|
|
286
|
+
* change is announced).
|
|
287
|
+
*
|
|
288
|
+
* ```html
|
|
289
|
+
* <cngx-tab-nav cngxTabsRouteSync aria-label="Sections">
|
|
290
|
+
* <a cngxTabLink id="overview" routerLink="overview">Overview</a>
|
|
291
|
+
* <a cngxTabLink id="profile" routerLink="profile">Profile</a>
|
|
292
|
+
* </cngx-tab-nav>
|
|
293
|
+
* <router-outlet></router-outlet>
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* @playground Native router tabs with a CanDeactivate guard ./examples/routed-nav/routed-nav.component.ts
|
|
297
|
+
* @see {@link CngxTabGroup} for the programmatic tablist organism.
|
|
298
|
+
*
|
|
299
|
+
* @category ui/tabs
|
|
300
|
+
* @docsKind primary
|
|
301
|
+
* @wcag AA
|
|
302
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-nav.component.ts
|
|
303
|
+
* @since 0.1.0
|
|
304
|
+
* @relatedTo CngxTabLink, CngxTabsRouteSync, CngxTabGroup, CngxMatTabNav
|
|
305
|
+
*/
|
|
306
|
+
declare class CngxTabNav {
|
|
307
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
308
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
309
|
+
/**
|
|
310
|
+
* Visual skin. Cascade `input ?? config ?? 'line'`, reflected onto
|
|
311
|
+
* `[data-skin]`. Resolved inline (single axis) rather than via
|
|
312
|
+
* `createTabsHostAttrs`: that helper resolves five tablist axes the nav
|
|
313
|
+
* does not use, so pulling it here would fabricate dead inputs - inline
|
|
314
|
+
* resolution is Komposition statt Konfiguration (Pillar 3).
|
|
315
|
+
*/
|
|
316
|
+
readonly skin: _angular_core.InputSignal<CngxTabsSkin | undefined>;
|
|
317
|
+
protected readonly presenter: _cngx_common_tabs.CngxTabGroupHost;
|
|
318
|
+
private readonly config;
|
|
319
|
+
protected readonly resolvedSkin: Signal<CngxTabsSkin>;
|
|
320
|
+
/**
|
|
321
|
+
* Active link's accessible label, fed to the polite live region. Derived
|
|
322
|
+
* from `activeId` through the registered handle (Pillar 1 - single
|
|
323
|
+
* source, the route-fed active index). Empty string before any link is
|
|
324
|
+
* active so the region stays silent.
|
|
325
|
+
*/
|
|
326
|
+
protected readonly liveAnnouncement: Signal<string>;
|
|
327
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabNav, never>;
|
|
328
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabNav, "cngx-tab-nav", ["cngxTabNav"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }]>;
|
|
329
|
+
}
|
|
330
|
+
|
|
259
331
|
/**
|
|
260
332
|
* Opt-in overflow indicator for `<cngx-tab-group>`. Surfaces clipped
|
|
261
333
|
* tab buttons through a "More" `CngxPopover` dropdown. Talks to the
|
|
@@ -278,6 +350,8 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
278
350
|
* @since 0.1.0
|
|
279
351
|
* @relatedTo CngxTabGroup, CngxPopover, CngxActiveDescendant
|
|
280
352
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>
|
|
353
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-horizontal</example-url>
|
|
354
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-vertical</example-url>
|
|
281
355
|
*/
|
|
282
356
|
declare class CngxTabOverflow {
|
|
283
357
|
protected readonly panelHost: CngxTabPanelHost;
|
|
@@ -326,4 +400,4 @@ declare class CngxTabOverflow {
|
|
|
326
400
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabOverflow, "cngx-tab-overflow", ["cngxTabOverflow"], {}, {}, ["triggerSlot", "itemSlot"], never, true, never>;
|
|
327
401
|
}
|
|
328
402
|
|
|
329
|
-
export { CngxTabGroup, CngxTabOverflow };
|
|
403
|
+
export { CngxTabGroup, CngxTabNav, CngxTabOverflow };
|