@cngx/ui 0.1.0-rc.6 → 0.1.0-rc.8
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/README.md +112 -1
- package/a11y/README.md +87 -0
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +224 -0
- package/context-menu/README.md +98 -0
- package/data-grid-accordion/README.md +103 -2
- package/feedback/README.md +42 -0
- package/fesm2022/cngx-ui-a11y.mjs +452 -0
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
- package/fesm2022/cngx-ui-accordion.mjs +116 -38
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +115 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
- package/fesm2022/cngx-ui-collection.mjs +207 -66
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
- package/fesm2022/cngx-ui-context-menu.mjs +857 -0
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1095 -521
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +18 -9
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +370 -203
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +501 -182
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +22 -21
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +718 -0
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +217 -76
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +40 -19
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +548 -0
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
- package/fesm2022/cngx-ui-toc.mjs +748 -0
- package/fesm2022/cngx-ui-toc.mjs.map +1 -0
- package/fesm2022/cngx-ui.mjs +16 -21
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-accordion/README.md +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +29 -27
- package/overlay/README.md +9 -4
- package/package.json +32 -1
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/skeleton/README.md +2 -0
- package/speak/README.md +3 -2
- package/stepper/README.md +15 -3
- package/timeline/README.md +350 -0
- package/toc/README.md +186 -0
- package/types/cngx-ui-a11y.d.ts +394 -0
- package/types/cngx-ui-accordion.d.ts +100 -30
- package/types/cngx-ui-action-button.d.ts +47 -3
- package/types/cngx-ui-breadcrumb.d.ts +159 -58
- package/types/cngx-ui-chart-panel.d.ts +382 -0
- package/types/cngx-ui-collection.d.ts +159 -58
- package/types/cngx-ui-command-palette.d.ts +565 -0
- package/types/cngx-ui-context-menu.d.ts +559 -0
- package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +664 -73
- package/types/cngx-ui-layout.d.ts +8 -3
- package/types/cngx-ui-mat-accordion.d.ts +32 -4
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +218 -23
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +416 -132
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +18 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +411 -0
- package/types/cngx-ui-stepper.d.ts +81 -29
- package/types/cngx-ui-tabs.d.ts +22 -6
- package/types/cngx-ui-timeline.d.ts +495 -0
- package/types/cngx-ui-toc.d.ts +581 -0
- package/types/cngx-ui.d.ts +8 -5
|
@@ -22,8 +22,9 @@ type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
22
22
|
* Composable flex-based stack layout component.
|
|
23
23
|
*
|
|
24
24
|
* Gap tokens use CSS custom properties (`--cngx-gap-xs` through `--cngx-gap-xl`)
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* that fall back to the density scale (`--cngx-space-*`), so a root
|
|
26
|
+
* `[data-density]` swap rescales the stack. Override the `--cngx-gap-*`
|
|
27
|
+
* hooks at any scope to detach a stack from the scale.
|
|
27
28
|
*
|
|
28
29
|
* <cngx-stack direction="row" gap="md" align="center">
|
|
29
30
|
* <div>Item 1</div>
|
|
@@ -74,7 +75,11 @@ declare class CngxStack {
|
|
|
74
75
|
declare class CngxGrid {
|
|
75
76
|
/** Number of equal columns, or a custom `grid-template-columns` value. */
|
|
76
77
|
readonly columns: _angular_core.InputSignalWithTransform<string | number, string | number>;
|
|
77
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* CSS gap between cells. The default reads the `--cngx-gap-md` override
|
|
80
|
+
* hook and falls back to the density scale (`--cngx-space-md`), so a root
|
|
81
|
+
* `[data-density]` swap rescales the grid; any CSS gap value is accepted.
|
|
82
|
+
*/
|
|
78
83
|
readonly gap: _angular_core.InputSignal<string>;
|
|
79
84
|
/** @internal */
|
|
80
85
|
protected readonly gridTemplateColumns: _angular_core.Signal<string>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
+
import { MatExpansionPanel } from '@angular/material/expansion';
|
|
2
3
|
import * as i1 from '@cngx/common/interactive';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -6,7 +7,7 @@ import * as i1 from '@cngx/common/interactive';
|
|
|
6
7
|
* a vanilla `<mat-accordion>` and it is driven by the headless
|
|
7
8
|
* {@link CngxAccordion} brain. Consumers gain the controlled
|
|
8
9
|
* `[(openIds)]` group model and single-open arbitration on Material
|
|
9
|
-
* markup
|
|
10
|
+
* markup - neither of which `<mat-accordion>` exposes (Material has only
|
|
10
11
|
* per-panel `[expanded]`). Mirrors `[cngxMatStepper]` / `[cngxMatTabs]`.
|
|
11
12
|
*
|
|
12
13
|
* This is the instrumentation pattern: Material owns rendering and the
|
|
@@ -29,11 +30,25 @@ import * as i1 from '@cngx/common/interactive';
|
|
|
29
30
|
*
|
|
30
31
|
* `multi` is authoritative on the cngx side. `MatAccordion` inherits its
|
|
31
32
|
* own `multi` input from `CdkAccordion`, and both directives sit on the
|
|
32
|
-
* same host element, so a single `[multi]` binding feeds both
|
|
33
|
+
* same host element, so a single `[multi]` binding feeds both - the
|
|
33
34
|
* directive therefore pins `matAccordion.multi = true` (via an `effect`
|
|
34
35
|
* that re-asserts on every `multi` change) so Material never runs its own
|
|
35
36
|
* single-open close while the cngx `effectiveOpenIds` clamp arbitrates.
|
|
36
37
|
*
|
|
38
|
+
* Panels authored `[expanded]="true"` seed the open-set at first
|
|
39
|
+
* registration (Material→brain), so an initially-open Material panel
|
|
40
|
+
* is not closed by the initially-empty membership model. To make a
|
|
41
|
+
* pre-populated `[(openIds)]` addressable, bind `[panelIdFn]` - the
|
|
42
|
+
* hook replaces the generated per-panel ids with consumer-known keys:
|
|
43
|
+
*
|
|
44
|
+
* ```html
|
|
45
|
+
* <mat-accordion
|
|
46
|
+
* cngxMatAccordion
|
|
47
|
+
* [(openIds)]="openIds"
|
|
48
|
+
* [panelIdFn]="idFromPanel"
|
|
49
|
+
* >
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
37
52
|
* @playground Controlled open-set ./examples/bridge/bridge-example.component.ts
|
|
38
53
|
* @category ui/mat-accordion
|
|
39
54
|
* @docsKind primary
|
|
@@ -46,18 +61,31 @@ declare class CngxMatAccordion {
|
|
|
46
61
|
private readonly matAccordion;
|
|
47
62
|
/**
|
|
48
63
|
* The accordion brain on this host element (declared in
|
|
49
|
-
* `hostDirectives`). Same-host ownership
|
|
64
|
+
* `hostDirectives`). Same-host ownership - not a child→parent inject -
|
|
50
65
|
* so it stays decompose-safe.
|
|
51
66
|
*/
|
|
52
67
|
private readonly accordion;
|
|
53
68
|
private readonly injector;
|
|
54
69
|
private readonly destroyRef;
|
|
55
70
|
private readonly panels;
|
|
71
|
+
private readonly ownPanels;
|
|
72
|
+
/**
|
|
73
|
+
* Per-panel id hook. When bound, the returned key is what the
|
|
74
|
+
* open-set stores for that panel - making a pre-populated
|
|
75
|
+
* `[(openIds)]` model addressable (the generated
|
|
76
|
+
* `cngx-mat-panel-N` ids are unknowable to consumers). The
|
|
77
|
+
* function must return a stable, unique id per panel instance;
|
|
78
|
+
* `MatExpansionPanel.id` (consumer-assignable) is a natural key.
|
|
79
|
+
* Unbound, ids fall back to generated `nextUid` values. Swapping
|
|
80
|
+
* the bound function at runtime re-keys future events but does not
|
|
81
|
+
* migrate ids already stored in `openIds` - bind it once.
|
|
82
|
+
*/
|
|
83
|
+
readonly panelIdFn: i0.InputSignal<((panel: MatExpansionPanel) => string) | undefined>;
|
|
56
84
|
private readonly idByPanel;
|
|
57
85
|
constructor();
|
|
58
86
|
private panelId;
|
|
59
87
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatAccordion, never>;
|
|
60
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatAccordion, "[cngxMatAccordion]", ["cngxMatAccordion"], {}, {}, ["panels"], never, true, [{ directive: typeof i1.CngxAccordion; inputs: { "multi": "multi"; "openIds": "openIds"; }; outputs: { "openIdsChange": "openIdsChange"; }; }]>;
|
|
88
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatAccordion, "[cngxMatAccordion]", ["cngxMatAccordion"], { "panelIdFn": { "alias": "panelIdFn"; "required": false; "isSignal": true; }; }, {}, ["panels"], never, true, [{ directive: typeof i1.CngxAccordion; inputs: { "multi": "multi"; "openIds": "openIds"; }; outputs: { "openIdsChange": "openIdsChange"; }; }]>;
|
|
61
89
|
}
|
|
62
90
|
|
|
63
91
|
export { CngxMatAccordion };
|
|
@@ -38,9 +38,12 @@ interface CngxMatPaginatorAnnounceContext {
|
|
|
38
38
|
* search value) changes, so a filtered result set never strands the user on a
|
|
39
39
|
* now-empty page. Pass a primitive (or a `computed` string key); an inline
|
|
40
40
|
* array literal recomputes every change-detection pass and would reset on each.
|
|
41
|
-
* - `[announce]` - mount a visually-hidden `aria-live` region that speaks the
|
|
42
|
-
* page
|
|
43
|
-
*
|
|
41
|
+
* - `[announce]` - mount a visually-hidden `aria-live` region that speaks the
|
|
42
|
+
* page after every change; `<mat-paginator>` only relabels its own range
|
|
43
|
+
* text, which AT does not announce. Phrasing resolves from the shared
|
|
44
|
+
* `CNGX_PAGINATOR_CONFIG` cascade (`announcements.pageChange`), so app-wide
|
|
45
|
+
* localisation covers the bridge and the organism together; bind
|
|
46
|
+
* `[announceLabel]` for a richer per-instance message with the visible range.
|
|
44
47
|
* - `[cngxPaginateRouting]` (generic companion directive from `@cngx/common/data`)
|
|
45
48
|
* - persist the page / size in the URL query string for deep-linkable,
|
|
46
49
|
* back-button-safe pagination.
|
|
@@ -87,10 +90,36 @@ declare class CngxMatPaginator {
|
|
|
87
90
|
* literal recomputes every change-detection pass and would reset every time.
|
|
88
91
|
*/
|
|
89
92
|
readonly resetOn: _angular_core.InputSignal<unknown>;
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Emits the effective page index on every change - navigation or a
|
|
95
|
+
* `total`-shrink clamp - exactly once per change, through the shared
|
|
96
|
+
* `connectPaginateEmit` guard. Clamp emits are held back while the brain is
|
|
97
|
+
* busy or `total` is 0, matching the `CngxPaginator` shell.
|
|
98
|
+
*/
|
|
99
|
+
readonly pageChange: _angular_core.OutputEmitterRef<number>;
|
|
100
|
+
/** Emits the effective page size exactly once per change. */
|
|
101
|
+
readonly pageSizeChange: _angular_core.OutputEmitterRef<number>;
|
|
102
|
+
/**
|
|
103
|
+
* Speak page changes through a visually-hidden `aria-live` region when set.
|
|
104
|
+
* `booleanAttribute` transform, so static `announce` markup enables it.
|
|
105
|
+
*/
|
|
106
|
+
readonly announce: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
107
|
+
/**
|
|
108
|
+
* Builds the announcement string from the page/range context. When unbound,
|
|
109
|
+
* the message resolves from the `CNGX_PAGINATOR_CONFIG` cascade
|
|
110
|
+
* (`announcements.pageChange`, "Page N of M" in the EN defaults), so
|
|
111
|
+
* `withPaginatorAnnouncements(...)` localises the bridge together with the
|
|
112
|
+
* `CngxPaginator` organism. Bind this for a richer per-instance message
|
|
113
|
+
* (the context also carries the visible item range).
|
|
114
|
+
*/
|
|
115
|
+
readonly announceLabel: _angular_core.InputSignal<((context: CngxMatPaginatorAnnounceContext) => string) | undefined>;
|
|
116
|
+
/**
|
|
117
|
+
* Paginator config cascade - shared with the `CngxPaginator` organism, so
|
|
118
|
+
* one `provideCngxPaginatorConfig(...)` localises both surfaces. Busy /
|
|
119
|
+
* settle phrases stay unspoken here: the bridge communicates the updating
|
|
120
|
+
* state via `aria-busy` on the host instead of a spoken transition.
|
|
121
|
+
*/
|
|
122
|
+
private readonly announcements;
|
|
94
123
|
private readonly elementRef;
|
|
95
124
|
private readonly renderer;
|
|
96
125
|
private readonly destroyRef;
|
|
@@ -101,7 +130,7 @@ declare class CngxMatPaginator {
|
|
|
101
130
|
/** A visually-hidden polite live region appended to the host paginator. */
|
|
102
131
|
private createLiveRegion;
|
|
103
132
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMatPaginator, never>;
|
|
104
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMatPaginator, "[cngxMatPaginator]", ["cngxMatPaginator"], { "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "resetOn": { "alias": "resetOn"; "required": false; "isSignal": true; }; "announce": { "alias": "announce"; "required": false; "isSignal": true; }; "announceLabel": { "alias": "announceLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CngxPaginate; inputs: { "cngxPageIndex": "cngxPageIndex"; "cngxPageSize": "cngxPageSize"; "total": "total"; "state": "state"; }; outputs: {
|
|
133
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMatPaginator, "[cngxMatPaginator]", ["cngxMatPaginator"], { "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "resetOn": { "alias": "resetOn"; "required": false; "isSignal": true; }; "announce": { "alias": "announce"; "required": false; "isSignal": true; }; "announceLabel": { "alias": "announceLabel"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; }, never, never, true, [{ directive: typeof i1.CngxPaginate; inputs: { "cngxPageIndex": "cngxPageIndex"; "cngxPageSize": "cngxPageSize"; "total": "total"; "state": "state"; }; outputs: {}; }]>;
|
|
105
134
|
}
|
|
106
135
|
|
|
107
136
|
export { CngxMatPaginator };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _cngx_common_stepper from '@cngx/common/stepper';
|
|
2
|
-
import { CngxStepRegistration } from '@cngx/common/stepper';
|
|
2
|
+
import { CngxStepperI18n, CngxStepRegistration } from '@cngx/common/stepper';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken } from '@angular/core';
|
|
4
|
+
import { InjectionToken, Signal } from '@angular/core';
|
|
5
5
|
import { MatStep } from '@angular/material/stepper';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -20,6 +20,11 @@ import { MatStep } from '@angular/material/stepper';
|
|
|
20
20
|
* the consumer authors native `<mat-step>` markup; CNGX is the
|
|
21
21
|
* behaviour layer. Topology mirrors `[cngxMatTabs]`.
|
|
22
22
|
*
|
|
23
|
+
* Commit-lifecycle transitions speak: the shared announcement builder
|
|
24
|
+
* feeds the root live announcer (pending / landed / rolled-back
|
|
25
|
+
* phrases, identical to `<cngx-stepper>`), and the host carries
|
|
26
|
+
* `aria-busy="true"` while a commit is in flight.
|
|
27
|
+
*
|
|
23
28
|
* Inputs/outputs are forwarded from {@link CngxStepperPresenter}:
|
|
24
29
|
* - `activeStepIndex` (two-way, with `activeStepIndexChange`),
|
|
25
30
|
* - `linear`,
|
|
@@ -76,10 +81,10 @@ declare class CngxMatStepper {
|
|
|
76
81
|
private readonly destroyRef;
|
|
77
82
|
private readonly injector;
|
|
78
83
|
private readonly matSteps;
|
|
79
|
-
private readonly setupsByStep;
|
|
80
84
|
private readonly createHandle;
|
|
85
|
+
private readonly i18n;
|
|
86
|
+
private readonly seam;
|
|
81
87
|
constructor();
|
|
82
|
-
private syncHandles;
|
|
83
88
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatStepper, never>;
|
|
84
89
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatStepper, "[cngxMatStepper]", ["cngxMatStepper"], {}, {}, ["matSteps"], never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
|
|
85
90
|
}
|
|
@@ -117,9 +122,12 @@ interface CngxMatStepHandleSetup {
|
|
|
117
122
|
* throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).
|
|
118
123
|
* Captures literal `matStepLabel` markup; dynamic interpolation
|
|
119
124
|
* bails through to (4).
|
|
120
|
-
* 4. `
|
|
121
|
-
* id
|
|
122
|
-
*
|
|
125
|
+
* 4. `CNGX_STEPPER_I18N.stepFallbackLabel(id)` (English default
|
|
126
|
+
* `Step <id>`) - deterministic, derived from the cngx handle id.
|
|
127
|
+
* Always non-empty. The `[cngxMatStepper]` directive passes its
|
|
128
|
+
* injected bundle Signal as `i18n`. This tier follows a runtime
|
|
129
|
+
* language switch.
|
|
130
|
+
* Documented limitation: runtime changes of tiers 1-3 do not propagate.
|
|
123
131
|
* CDK's `CdkStep` does not expose a `_stateChanges` Subject
|
|
124
132
|
* analogous to `MatTab._stateChanges`, so cngx cannot re-trigger
|
|
125
133
|
* the snapshot when Material flips the input later. Surface the
|
|
@@ -147,12 +155,16 @@ interface CngxMatStepHandleSetup {
|
|
|
147
155
|
*
|
|
148
156
|
* @category ui/mat-stepper
|
|
149
157
|
*/
|
|
150
|
-
declare function createMatStepHandle(matStep: MatStep, idSeed: () => string): CngxMatStepHandleSetup;
|
|
158
|
+
declare function createMatStepHandle(matStep: MatStep, idSeed: () => string, i18n: Signal<CngxStepperI18n>): CngxMatStepHandleSetup;
|
|
151
159
|
/**
|
|
152
160
|
* Factory signature for {@link createMatStepHandle}. The DI token
|
|
153
161
|
* {@link CNGX_MAT_STEP_HANDLE_FACTORY} resolves to a function with
|
|
154
162
|
* this exact shape - overrides match it identically.
|
|
155
163
|
*
|
|
164
|
+
* The third argument is the stepper i18n Signal the directive injected;
|
|
165
|
+
* it carries the last-resort label (`stepFallbackLabel`). Forward it when
|
|
166
|
+
* delegating to {@link createMatStepHandle}.
|
|
167
|
+
*
|
|
156
168
|
* @category ui/mat-stepper
|
|
157
169
|
*/
|
|
158
170
|
type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
@@ -180,8 +192,8 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
|
180
192
|
* providers: [
|
|
181
193
|
* {
|
|
182
194
|
* provide: CNGX_MAT_STEP_HANDLE_FACTORY,
|
|
183
|
-
* useValue: ((step, idSeed) => {
|
|
184
|
-
* const setup = createMatStepHandle(step, idSeed);
|
|
195
|
+
* useValue: ((step, idSeed, i18n) => {
|
|
196
|
+
* const setup = createMatStepHandle(step, idSeed, i18n);
|
|
185
197
|
* reportStepRegistered(setup.handle.id);
|
|
186
198
|
* return setup;
|
|
187
199
|
* }) satisfies CngxMatStepHandleFactory,
|
|
@@ -197,4 +209,4 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
|
197
209
|
declare const CNGX_MAT_STEP_HANDLE_FACTORY: InjectionToken<typeof createMatStepHandle>;
|
|
198
210
|
|
|
199
211
|
export { CNGX_MAT_STEP_HANDLE_FACTORY, CngxMatStepper, createMatStepHandle };
|
|
200
|
-
export type { CngxMatStepHandleFactory };
|
|
212
|
+
export type { CngxMatStepHandleFactory, CngxMatStepHandleSetup };
|
|
@@ -132,11 +132,20 @@ declare const CNGX_MAT_TABS_REGISTRY_HOST: InjectionToken<CngxMatTabsRegistryHos
|
|
|
132
132
|
* LOC guard and lets per-tab decoration directives reach the
|
|
133
133
|
* registry through a typed token.
|
|
134
134
|
*
|
|
135
|
-
* Owns: `contentChildren(MatTab)` query, the
|
|
136
|
-
* (per-tab cngx setup paired with a child
|
|
137
|
-
* scoping the `_stateChanges` bridge), an
|
|
138
|
-
*
|
|
139
|
-
*
|
|
135
|
+
* Owns: `contentChildren(MatTab)` query, the order-aware
|
|
136
|
+
* registration seam (per-tab cngx setup paired with a child
|
|
137
|
+
* `EnvironmentInjector` scoping the `_stateChanges` bridge), an
|
|
138
|
+
* `effect()` that mirrors the MatTab query order into
|
|
139
|
+
* `CNGX_TAB_GROUP_HOST` on every emission, and a `DestroyRef`
|
|
140
|
+
* cleanup that unregisters and destroys every entry.
|
|
141
|
+
*
|
|
142
|
+
* Order matters: the presenter registry appends new registrations,
|
|
143
|
+
* but Material renders tabs at their DOM position - a mid-list
|
|
144
|
+
* `<mat-tab>` insert must land at its query index, not at the tail,
|
|
145
|
+
* or index-based selection, announcements and decorations target the
|
|
146
|
+
* wrong tab. The shared seam re-registers the diverging suffix in
|
|
147
|
+
* query order while keeping surviving handle instances (and their
|
|
148
|
+
* child injectors) alive.
|
|
140
149
|
*
|
|
141
150
|
* Composition: `[cngxMatTabs]` declares this in `hostDirectives`;
|
|
142
151
|
* both share the parent's `CngxTabGroupPresenter` and the same
|
|
@@ -154,11 +163,11 @@ declare class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {
|
|
|
154
163
|
private readonly destroyRef;
|
|
155
164
|
private readonly envInjector;
|
|
156
165
|
private readonly createHandle;
|
|
166
|
+
private readonly matTabGroup;
|
|
157
167
|
private readonly matTabs;
|
|
158
|
-
private readonly
|
|
168
|
+
private readonly seam;
|
|
159
169
|
constructor();
|
|
160
170
|
getHandleSetup(matTab: MatTab): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined;
|
|
161
|
-
private syncHandles;
|
|
162
171
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabsRegistry, never>;
|
|
163
172
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabsRegistry, "[cngxMatTabsRegistry]", ["cngxMatTabsRegistry"], {}, {}, ["matTabs"], never, true, never>;
|
|
164
173
|
}
|
|
@@ -180,6 +189,18 @@ declare class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {
|
|
|
180
189
|
* `./decorations/`; this directive supplies their reactive triggers
|
|
181
190
|
* and the delegators consumer templates call.
|
|
182
191
|
*
|
|
192
|
+
* **Inert on this bridge: `loop` and `orientation`.** Both are
|
|
193
|
+
* forwarded so templates stay portable between `<cngx-tab-group>` and
|
|
194
|
+
* the instrumented `<mat-tab-group>`, but Material owns the keyboard
|
|
195
|
+
* interaction and the strip layout here - `loop` never changes
|
|
196
|
+
* Material's Home/End/arrow behaviour, and `orientation` never
|
|
197
|
+
* rotates the Material strip (use `<mat-tab-group headerPosition>` /
|
|
198
|
+
* Material's own APIs for that). `orientation` still reaches the
|
|
199
|
+
* cngx side through the overflow panel-host adapter; `loop` feeds
|
|
200
|
+
* nothing Material does not already own. Deliberately kept in the
|
|
201
|
+
* forwarded input set for template portability - removing them would
|
|
202
|
+
* break `<cngx-tab-group>`-authored templates on paste.
|
|
203
|
+
*
|
|
183
204
|
* @playground Form error aggregation ./examples/form-errors/form-errors.component.ts
|
|
184
205
|
*
|
|
185
206
|
* @category ui/mat-tabs
|
|
@@ -188,6 +209,8 @@ declare class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {
|
|
|
188
209
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs.directive.ts
|
|
189
210
|
* @since 0.1.0
|
|
190
211
|
* @relatedTo CngxMatTabsRegistry, CngxMatTabError, CngxMatStepper
|
|
212
|
+
* @slot cngxMatTabAggregatorContent Replaces the aggregated error summary projected into a Material tab.
|
|
213
|
+
* @slot cngxMatTabRejectionContent Replaces the rejection notice on a rolled-back Material tab.
|
|
191
214
|
*/
|
|
192
215
|
declare class CngxMatTabs {
|
|
193
216
|
private readonly matTabGroup;
|
|
@@ -200,10 +223,10 @@ declare class CngxMatTabs {
|
|
|
200
223
|
private readonly overflowRef;
|
|
201
224
|
private readonly aggregatorContentSlot;
|
|
202
225
|
private readonly aggregatorContentTemplate;
|
|
226
|
+
private readonly matTabsConfig;
|
|
203
227
|
private readonly rejectionContentSlot;
|
|
204
228
|
private readonly rejectionContentTemplate;
|
|
205
229
|
private readonly i18n;
|
|
206
|
-
private readonly failedHandleId;
|
|
207
230
|
private readonly rejectionState;
|
|
208
231
|
private readonly aggregatedErrorTabs;
|
|
209
232
|
constructor();
|
|
@@ -235,7 +258,15 @@ declare class CngxMatTabs {
|
|
|
235
258
|
* reflects `NavigationEnd` onto `activeIndex` (its commit-action stays
|
|
236
259
|
* dormant because link clicks navigate natively, never through
|
|
237
260
|
* `presenter.select`). Ableitung statt Verwaltung - the route-active
|
|
238
|
-
* link is the single source of the active index.
|
|
261
|
+
* link is the single source of the active index. `activeIndex` /
|
|
262
|
+
* `activeIndexChange` are forwarded from the presenter hostDirective,
|
|
263
|
+
* so a consumer without route-sync can two-way bind the active link
|
|
264
|
+
* the same way `[cngxMatTabs]` consumers do.
|
|
265
|
+
*
|
|
266
|
+
* Active-link changes speak: the shared nav announcement bundle
|
|
267
|
+
* ({@link createTabNavAnnouncement}) feeds the landing link's label to
|
|
268
|
+
* the shared live announcer - silent through the mount window, so a
|
|
269
|
+
* deep link's initial active state is not announced as a change.
|
|
239
270
|
*
|
|
240
271
|
* Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the
|
|
241
272
|
* `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and
|
|
@@ -263,7 +294,6 @@ declare class CngxMatTabNav {
|
|
|
263
294
|
private readonly renderer;
|
|
264
295
|
private readonly hostEl;
|
|
265
296
|
private readonly i18n;
|
|
266
|
-
private readonly failedHandleId;
|
|
267
297
|
private readonly rejectionState;
|
|
268
298
|
private readonly aggregatedErrorTabs;
|
|
269
299
|
constructor();
|
|
@@ -274,7 +304,7 @@ declare class CngxMatTabNav {
|
|
|
274
304
|
*/
|
|
275
305
|
clearLastFailed(): void;
|
|
276
306
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabNav, never>;
|
|
277
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabNav, "[cngxMatTabNav]", ["cngxMatTabNav"], {}, {}, never, never, true, [{ directive: typeof i1.CngxTabGroupPresenter; inputs: {}; outputs: {}; }]>;
|
|
307
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabNav, "[cngxMatTabNav]", ["cngxMatTabNav"], {}, {}, never, never, true, [{ directive: typeof i1.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }]>;
|
|
278
308
|
}
|
|
279
309
|
|
|
280
310
|
/**
|
|
@@ -554,7 +584,9 @@ interface CngxMatTabRejectionContentContext {
|
|
|
554
584
|
* Cascade resolution:
|
|
555
585
|
* 1. Per-instance `*cngxMatTabRejectionContent` template wins
|
|
556
586
|
* via `contentChild(CngxMatTabRejectionContent)`.
|
|
557
|
-
* 2.
|
|
587
|
+
* 2. `CNGX_MAT_TABS_CONFIG.templates.rejection` (app-wide middle
|
|
588
|
+
* tier, set via `withMatTabRejectionTemplate`).
|
|
589
|
+
* 3. Library default - imperative `Renderer2.createElement('span')`
|
|
558
590
|
* with `textContent = fallbackText` (the resolved
|
|
559
591
|
* `commitRolledBackTo(originLabel)` / `commitFailedRetry`
|
|
560
592
|
* phrase from `injectTabsI18n()`).
|
|
@@ -593,7 +625,7 @@ declare class CngxMatTabRejectionContent {
|
|
|
593
625
|
* Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration
|
|
594
626
|
* projector when a consumer wires exactly one of
|
|
595
627
|
* `*cngxMatTabAggregatorContent` (the slot template) or
|
|
596
|
-
* `ViewContainerRef` (the embedded-view host)
|
|
628
|
+
* `ViewContainerRef` (the embedded-view host) - the half-wired-slot
|
|
597
629
|
* misconfiguration. The projector silently falls back to the
|
|
598
630
|
* imperative `textContent` path when this happens; the sink is the
|
|
599
631
|
* only deliberate signal that the consumer's slot template will not
|
|
@@ -609,6 +641,23 @@ declare class CngxMatTabRejectionContent {
|
|
|
609
641
|
*/
|
|
610
642
|
type CngxMatTabHalfWiredSlotSink = (missing: 'contentTemplate' | 'viewContainerRef') => void;
|
|
611
643
|
|
|
644
|
+
/**
|
|
645
|
+
* App-wide template defaults for the `[cngxMatTabs]` decorations -
|
|
646
|
+
* the middle cascade tier between a per-instance structural slot and
|
|
647
|
+
* the built-in fallback. Sibling of `CngxTabsTemplates` /
|
|
648
|
+
* `CngxStepperTemplates` so consumer templates port across families.
|
|
649
|
+
*
|
|
650
|
+
* @category ui/mat-tabs
|
|
651
|
+
*/
|
|
652
|
+
interface CngxMatTabsTemplates {
|
|
653
|
+
/**
|
|
654
|
+
* Default for the rejection SR-descriptor content
|
|
655
|
+
* (`*cngxMatTabRejectionContent`). Per-instance slot still wins;
|
|
656
|
+
* without either tier the imperative fallback writes the resolved
|
|
657
|
+
* i18n phrase verbatim.
|
|
658
|
+
*/
|
|
659
|
+
readonly rejection?: TemplateRef<CngxMatTabRejectionContentContext>;
|
|
660
|
+
}
|
|
612
661
|
/**
|
|
613
662
|
* Behaviour knobs for `[cngxMatTabs]`. Single canonical surface
|
|
614
663
|
* symmetric to `provideSelectConfig` in the select family - every
|
|
@@ -653,7 +702,25 @@ interface CngxMatTabsConfig {
|
|
|
653
702
|
* (Sentry breadcrumbs, custom logger, CI fail-fast).
|
|
654
703
|
*/
|
|
655
704
|
readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;
|
|
705
|
+
/**
|
|
706
|
+
* App-wide decoration template defaults - the middle cascade tier.
|
|
707
|
+
* Per-instance structural slots still win; see
|
|
708
|
+
* {@link CngxMatTabsTemplates}.
|
|
709
|
+
*/
|
|
710
|
+
readonly templates?: CngxMatTabsTemplates;
|
|
656
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Library defaults for `[cngxMatTabs]`. Source of truth for every
|
|
714
|
+
* key on {@link CngxMatTabsConfig}. Consumed by
|
|
715
|
+
* {@link injectMatTabsConfig} as the final fallback.
|
|
716
|
+
*
|
|
717
|
+
* @internal
|
|
718
|
+
*/
|
|
719
|
+
declare const CNGX_MAT_TABS_CONFIG_DEFAULTS: {
|
|
720
|
+
readonly anchorMaxAttempts: 5;
|
|
721
|
+
readonly halfWiredSlotSink: CngxMatTabHalfWiredSlotSink;
|
|
722
|
+
readonly templates: {};
|
|
723
|
+
};
|
|
657
724
|
/**
|
|
658
725
|
* DI token holding a partial {@link CngxMatTabsConfig}. Set via
|
|
659
726
|
* {@link provideMatTabsConfig} (app-wide) or
|
|
@@ -695,6 +762,15 @@ declare function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature;
|
|
|
695
762
|
* @category ui/mat-tabs
|
|
696
763
|
*/
|
|
697
764
|
declare function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature;
|
|
765
|
+
/**
|
|
766
|
+
* App-wide override for the rejection SR-descriptor content. Middle
|
|
767
|
+
* tier; per-instance `*cngxMatTabRejectionContent` still wins.
|
|
768
|
+
* Sibling of {@link withTabRejectionIconTemplate} in the cngx-native
|
|
769
|
+
* family.
|
|
770
|
+
*
|
|
771
|
+
* @category ui/mat-tabs
|
|
772
|
+
*/
|
|
773
|
+
declare function withMatTabRejectionTemplate(template: TemplateRef<CngxMatTabRejectionContentContext>): CngxMatTabsConfigFeature;
|
|
698
774
|
/**
|
|
699
775
|
* App-wide `[cngxMatTabs]` configuration. Returns
|
|
700
776
|
* `EnvironmentProviders` for use inside `bootstrapApplication`'s
|
|
@@ -720,6 +796,11 @@ declare function provideMatTabsConfig(...features: CngxMatTabsConfigFeature[]):
|
|
|
720
796
|
* `providers` or `viewProviders` (which cannot accept opaque
|
|
721
797
|
* environment providers).
|
|
722
798
|
*
|
|
799
|
+
* Merges over the outer config (via `skipSelf`), so a component-scope
|
|
800
|
+
* call refines the root {@link provideMatTabsConfig} instead of
|
|
801
|
+
* reverting its untouched keys to library defaults - only the keys
|
|
802
|
+
* the local features set are overridden for the subtree.
|
|
803
|
+
*
|
|
723
804
|
* ```ts
|
|
724
805
|
* @Component({
|
|
725
806
|
* selector: 'app-tabs-page',
|
|
@@ -767,7 +848,7 @@ declare function injectMatTabsConfig(): Required<CngxMatTabsConfig>;
|
|
|
767
848
|
* type façades and the selector constants. The TS namespace also
|
|
768
849
|
* lets cross-package consumers (`@cngx/ui/mat-stepper`) read the
|
|
769
850
|
* grouped name through ESLint's `@typescript-eslint` type resolver
|
|
770
|
-
*
|
|
851
|
+
* - a flat `export * as` re-export from `public-api.ts` does not
|
|
771
852
|
* resolve nested members through the path-alias.
|
|
772
853
|
*
|
|
773
854
|
* @category ui/mat-tabs
|
|
@@ -787,13 +868,25 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
787
868
|
interface StateChangeSource {
|
|
788
869
|
readonly _stateChanges: Subject<void>;
|
|
789
870
|
}
|
|
871
|
+
/**
|
|
872
|
+
* Subset of Material's `MatTab` carrying the `_closestTabGroup`
|
|
873
|
+
* back-reference (the owning `MatTabGroup`, resolved via DI at
|
|
874
|
+
* construction). Material's own `_allTabs` filter compares against
|
|
875
|
+
* it for exactly the reason cngx does: a `descendants: true` query
|
|
876
|
+
* also surfaces tabs of a nested `<mat-tab-group>`, and only the
|
|
877
|
+
* ownership comparison separates them. Typed `unknown` because the
|
|
878
|
+
* upstream declaration is `any` - cngx only ever identity-compares.
|
|
879
|
+
*/
|
|
880
|
+
interface ClosestTabGroupSource {
|
|
881
|
+
readonly _closestTabGroup: unknown;
|
|
882
|
+
}
|
|
790
883
|
/**
|
|
791
884
|
* Subset of Material's `MatStepper` carrying the `_iconOverrides`
|
|
792
885
|
* map. `<cngx-mat-stepper>` patches this map inside
|
|
793
886
|
* `afterNextRender` to forward consumer-projected
|
|
794
887
|
* `<ng-template matStepperIcon>` declarations through the wrapper
|
|
795
888
|
* into Material's per-header indicator bindings (the only
|
|
796
|
-
* deterministic forwarding path
|
|
889
|
+
* deterministic forwarding path - `<ng-content>` projection
|
|
797
890
|
* inside `<mat-stepper>` does not reach
|
|
798
891
|
* `@ContentChildren(MatStepperIcon)` due to content-init
|
|
799
892
|
* lifecycle ordering).
|
|
@@ -808,23 +901,23 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
808
901
|
* it through the getter and re-fires whenever Material flips
|
|
809
902
|
* completion. Documented limitation: `hasError` writes that are
|
|
810
903
|
* not paired with a `completed` change do not retrigger the
|
|
811
|
-
* computed
|
|
904
|
+
* computed - sharper note lives on `createMatStepHandle`'s JSDoc.
|
|
812
905
|
*/
|
|
813
906
|
interface CompletedOverrideSource {
|
|
814
907
|
readonly _completedOverride: WritableSignal<boolean | null>;
|
|
815
908
|
}
|
|
816
909
|
/**
|
|
817
|
-
* `.mat-mdc-tab`
|
|
910
|
+
* `.mat-mdc-tab` - the class Material applies to the rendered
|
|
818
911
|
* tab `<button>` elements inside `MatTabHeader`. cngx
|
|
819
912
|
* index-correlates `presenter.tabs()` registration order against
|
|
820
913
|
* `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a
|
|
821
|
-
* portal
|
|
914
|
+
* portal - the rendered buttons live inside `MatTabHeader`'s
|
|
822
915
|
* template, not on the `<mat-tab>` declaration site, and Material
|
|
823
916
|
* exposes no public per-tab element accessor.
|
|
824
917
|
*/
|
|
825
918
|
const MAT_MDC_TAB_SELECTOR = ".mat-mdc-tab";
|
|
826
919
|
/**
|
|
827
|
-
* `.mat-mdc-tab-header`
|
|
920
|
+
* `.mat-mdc-tab-header` - the strip element rendered by
|
|
828
921
|
* `MatTabHeader`. `[cngxMatTabs]` walks
|
|
829
922
|
* `host.querySelector('.mat-mdc-tab-header')` to locate the mount
|
|
830
923
|
* anchor for the cngx overflow molecule (so the More button pins
|
|
@@ -833,7 +926,7 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
833
926
|
*/
|
|
834
927
|
const MAT_MDC_TAB_HEADER_SELECTOR = ".mat-mdc-tab-header";
|
|
835
928
|
/**
|
|
836
|
-
* `.mat-mdc-tab-label-container`
|
|
929
|
+
* `.mat-mdc-tab-label-container` - Material's IO-friendly scroll
|
|
837
930
|
* viewport ancestor of the rendered tab buttons. The Material-
|
|
838
931
|
* twin overflow adapter walks `host → header → any tab → closest
|
|
839
932
|
* label-container` to attach the molecule's
|
|
@@ -843,12 +936,114 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
843
936
|
const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR = ".mat-mdc-tab-label-container";
|
|
844
937
|
}
|
|
845
938
|
|
|
939
|
+
/**
|
|
940
|
+
* Shared order-aware registration seam for the Material
|
|
941
|
+
* instrumentation directives (`[cngxMatTabs]`, `[cngxMatStepper]`).
|
|
942
|
+
*
|
|
943
|
+
* Both bridges diff a `contentChildren(Mat*)` query into a presenter
|
|
944
|
+
* registry via `register`/`unregister`. The presenters keep pure
|
|
945
|
+
* insertion order and append every new registration at the end, so a
|
|
946
|
+
* mid-list `<mat-tab>` / `<mat-step>` insert would register at the
|
|
947
|
+
* tail while Material renders it at its DOM position - index-based
|
|
948
|
+
* selection, announcements and decorations would then target the
|
|
949
|
+
* wrong item. This seam mirrors the query order into the presenter on
|
|
950
|
+
* every emission: surviving prefix entries stay untouched, the
|
|
951
|
+
* diverging suffix is unregistered and re-registered in query order
|
|
952
|
+
* with the SAME handle instances (per-entry resources such as child
|
|
953
|
+
* injectors are never re-created for surviving items).
|
|
954
|
+
*
|
|
955
|
+
* Pure TypeScript, no Angular imports. Lives in the mat-tabs entry
|
|
956
|
+
* and is exported `@internal` from its barrel for cross-entry
|
|
957
|
+
* consumption by `@cngx/ui/mat-stepper` - ng-packagr rejects source
|
|
958
|
+
* files shared between entry points by relative import, so the
|
|
959
|
+
* export-plus-internal-tag route (the `MaterialPrivateSurfaces`
|
|
960
|
+
* pattern) is the supported sharing path.
|
|
961
|
+
*
|
|
962
|
+
* @internal
|
|
963
|
+
*/
|
|
964
|
+
interface CngxOrderedRegistrationSeamOptions<TItem, TEntry> {
|
|
965
|
+
/** Build the per-item entry (handle setup + resources). Called once per item lifetime. */
|
|
966
|
+
create(item: TItem): TEntry;
|
|
967
|
+
/** Register the entry's handle with the presenter. */
|
|
968
|
+
register(entry: TEntry): void;
|
|
969
|
+
/** Remove the entry's handle from the presenter (resources stay alive). */
|
|
970
|
+
unregister(entry: TEntry): void;
|
|
971
|
+
/** Release per-entry resources (child injector etc.). Called once, after the final unregister. */
|
|
972
|
+
dispose(entry: TEntry): void;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Stateful diff surface returned by {@link createOrderedRegistrationSeam}.
|
|
976
|
+
*
|
|
977
|
+
* @internal
|
|
978
|
+
*/
|
|
979
|
+
interface CngxOrderedRegistrationSeam<TItem, TEntry> {
|
|
980
|
+
/**
|
|
981
|
+
* Mirror `items` (the current `contentChildren` emission, in query
|
|
982
|
+
* order) into the presenter registry. Removed items are
|
|
983
|
+
* unregistered and disposed; new items are created and registered;
|
|
984
|
+
* surviving items keep their entry, and any item whose position
|
|
985
|
+
* diverged from the registered order is re-registered so the
|
|
986
|
+
* presenter's order matches `items` exactly.
|
|
987
|
+
*/
|
|
988
|
+
sync(items: readonly TItem[]): void;
|
|
989
|
+
/** Entry lookup for per-item decoration hooks. */
|
|
990
|
+
get(item: TItem): TEntry | undefined;
|
|
991
|
+
/** Unregister and dispose every entry (directive destroy). */
|
|
992
|
+
clear(): void;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Create the order-aware registration seam. See the module JSDoc for
|
|
996
|
+
* the contract.
|
|
997
|
+
*
|
|
998
|
+
* @internal
|
|
999
|
+
*/
|
|
1000
|
+
declare function createOrderedRegistrationSeam<TItem, TEntry>(options: CngxOrderedRegistrationSeamOptions<TItem, TEntry>): CngxOrderedRegistrationSeam<TItem, TEntry>;
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Options for {@link mountLiveRegionAnnouncer}.
|
|
1004
|
+
*
|
|
1005
|
+
* @internal
|
|
1006
|
+
*/
|
|
1007
|
+
interface CngxMatBridgeLiveRegionOptions {
|
|
1008
|
+
/** Reactive announcement text. Empty string keeps the region quiet. */
|
|
1009
|
+
readonly announcement: Signal<string>;
|
|
1010
|
+
readonly injector: Injector;
|
|
1011
|
+
/** Default: `'polite'`. */
|
|
1012
|
+
readonly politeness?: 'polite' | 'assertive';
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Keep the shared {@link CngxLiveAnnouncer} in sync with the supplied
|
|
1016
|
+
* `announcement` signal: an `effect` reads the reactive text and
|
|
1017
|
+
* forwards every non-empty value to the root announcer at the
|
|
1018
|
+
* configured politeness (default `'polite'`). An empty string between
|
|
1019
|
+
* transitions keeps the region quiet on no-op CD ticks.
|
|
1020
|
+
*
|
|
1021
|
+
* Delegates to {@link CngxLiveAnnouncer} instead of mounting its own
|
|
1022
|
+
* body span, so the announcer owns the persistent polite/assertive
|
|
1023
|
+
* region pair, the clear-then-set re-announce, and teardown. The
|
|
1024
|
+
* delegated region carries `aria-live` + `aria-atomic="true"` and no
|
|
1025
|
+
* explicit `role`; `aria-atomic` re-reads full content and `aria-live`
|
|
1026
|
+
* carries the politeness, so a tab-change status utterance still reads.
|
|
1027
|
+
*
|
|
1028
|
+
* The `effect` is created in `opts.injector`'s context, so it is torn
|
|
1029
|
+
* down with the host directive; the service call is wrapped in
|
|
1030
|
+
* `untracked` - the announcer owns its own clear-then-set timer, so it
|
|
1031
|
+
* stays out of the effect's dependency graph.
|
|
1032
|
+
*
|
|
1033
|
+
* @internal - helper shared by the Material bridge directives
|
|
1034
|
+
* (`[cngxMatTabs]`, `[cngxMatTabNav]`, `[cngxMatStepper]`). Exported
|
|
1035
|
+
* `@internal` from the mat-tabs barrel for cross-entry consumption
|
|
1036
|
+
* (the `MaterialPrivateSurfaces` pattern) - ng-packagr rejects
|
|
1037
|
+
* relative-import file sharing between entry points.
|
|
1038
|
+
*/
|
|
1039
|
+
declare function mountLiveRegionAnnouncer(opts: CngxMatBridgeLiveRegionOptions): void;
|
|
1040
|
+
|
|
846
1041
|
/**
|
|
847
1042
|
* Material variant of {@link CngxTabOverflowDomAdapter}.
|
|
848
1043
|
*
|
|
849
1044
|
* `resolveStripRoot` walks from host up to `<mat-tab-header>` and
|
|
850
1045
|
* locates `.mat-mdc-tab-label-container` via any rendered
|
|
851
|
-
* `.mat-mdc-tab` descendant
|
|
1046
|
+
* `.mat-mdc-tab` descendant - Material's IO-friendly scroll
|
|
852
1047
|
* container.
|
|
853
1048
|
*
|
|
854
1049
|
* `resolveTabButton` indexes positionally; Material owns the DOM
|
|
@@ -872,5 +1067,5 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
872
1067
|
*/
|
|
873
1068
|
declare function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter;
|
|
874
1069
|
|
|
875
|
-
export { CNGX_MAT_TABS_CONFIG, CNGX_MAT_TABS_REGISTRY_HOST, CNGX_MAT_TAB_HANDLE_FACTORY, CngxMatTabAggregatorContent, CngxMatTabError, CngxMatTabErrorFlag, CngxMatTabLink, CngxMatTabNav, CngxMatTabRejectionContent, CngxMatTabs, CngxMatTabsRegistry, MaterialPrivateSurfaces, createCngxMatTabOverflowDomAdapter, createMatTabHandle, injectMatTabsConfig, provideMatTabsConfig, provideMatTabsConfigAt, withAnchorRetryAttempts, withHalfWiredSlotSink };
|
|
876
|
-
export type { CngxMatTabAggregatorContentContext, CngxMatTabHalfWiredSlotSink, CngxMatTabHandleFactory, CngxMatTabRejectionContentContext, CngxMatTabsConfig, CngxMatTabsConfigFeature, CngxMatTabsRegistryHost };
|
|
1070
|
+
export { CNGX_MAT_TABS_CONFIG, CNGX_MAT_TABS_CONFIG_DEFAULTS, CNGX_MAT_TABS_REGISTRY_HOST, CNGX_MAT_TAB_HANDLE_FACTORY, CngxMatTabAggregatorContent, CngxMatTabError, CngxMatTabErrorFlag, CngxMatTabLink, CngxMatTabNav, CngxMatTabRejectionContent, CngxMatTabs, CngxMatTabsRegistry, MaterialPrivateSurfaces, createCngxMatTabOverflowDomAdapter, createMatTabHandle, createOrderedRegistrationSeam, injectMatTabsConfig, mountLiveRegionAnnouncer, provideMatTabsConfig, provideMatTabsConfigAt, withAnchorRetryAttempts, withHalfWiredSlotSink, withMatTabRejectionTemplate };
|
|
1071
|
+
export type { CngxMatBridgeLiveRegionOptions, CngxMatTabAggregatorContentContext, CngxMatTabHalfWiredSlotSink, CngxMatTabHandleFactory, CngxMatTabHandleSetup, CngxMatTabRejectionContentContext, CngxMatTabsConfig, CngxMatTabsConfigFeature, CngxMatTabsRegistryHost, CngxMatTabsTemplates, CngxOrderedRegistrationSeam, CngxOrderedRegistrationSeamOptions };
|