@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9
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 +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +227 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +120 -36
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +121 -56
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +204 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +209 -40
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
- 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 +1074 -460
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
- 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 +555 -204
- 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 +553 -198
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +344 -109
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- 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 +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +234 -99
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +88 -25
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +98 -23
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +101 -33
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/README.md +30 -6
- package/mat-tabs/styles/mat-tabs.css +188 -42
- package/overlay/README.md +9 -4
- package/package.json +31 -7
- package/paginator/README.md +8 -4
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +14 -2
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +100 -28
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +167 -60
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +157 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +140 -10
- package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +605 -59
- package/types/cngx-ui-mat-accordion.d.ts +30 -1
- 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 +250 -34
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +425 -136
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +88 -49
- package/types/cngx-ui-tabs.d.ts +6 -4
- package/types/cngx-ui-timeline.d.ts +35 -11
- package/types/cngx-ui-toc.d.ts +93 -16
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as i1 from '@cngx/common/tabs';
|
|
2
|
-
import { CngxTabHandle, CngxTabOverflowDomAdapter } from '@cngx/common/tabs';
|
|
3
1
|
import * as i0 from '@angular/core';
|
|
4
2
|
import { Signal, WritableSignal, InjectionToken, Injector, OnInit, TemplateRef, EnvironmentProviders, Provider } from '@angular/core';
|
|
3
|
+
import * as i1 from '@cngx/common/tabs';
|
|
4
|
+
import { CngxTabHandle, CngxTabOverflowDomAdapter } from '@cngx/common/tabs';
|
|
5
5
|
import { MatTab } from '@angular/material/tabs';
|
|
6
6
|
import { CngxErrorAggregatorContract } from '@cngx/common/interactive';
|
|
7
7
|
import { MatStepperIconContext } from '@angular/material/stepper';
|
|
@@ -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
|
|
@@ -201,11 +222,10 @@ declare class CngxMatTabs {
|
|
|
201
222
|
private readonly viewContainerRef;
|
|
202
223
|
private readonly overflowRef;
|
|
203
224
|
private readonly aggregatorContentSlot;
|
|
204
|
-
private readonly
|
|
225
|
+
private readonly matTabsConfig;
|
|
205
226
|
private readonly rejectionContentSlot;
|
|
206
|
-
private readonly
|
|
227
|
+
private readonly decorationTemplates;
|
|
207
228
|
private readonly i18n;
|
|
208
|
-
private readonly failedHandleId;
|
|
209
229
|
private readonly rejectionState;
|
|
210
230
|
private readonly aggregatedErrorTabs;
|
|
211
231
|
constructor();
|
|
@@ -237,17 +257,27 @@ declare class CngxMatTabs {
|
|
|
237
257
|
* reflects `NavigationEnd` onto `activeIndex` (its commit-action stays
|
|
238
258
|
* dormant because link clicks navigate natively, never through
|
|
239
259
|
* `presenter.select`). Ableitung statt Verwaltung - the route-active
|
|
240
|
-
* link is the single source of the active index.
|
|
260
|
+
* link is the single source of the active index. `activeIndex` /
|
|
261
|
+
* `activeIndexChange` are forwarded from the presenter hostDirective,
|
|
262
|
+
* so a consumer without route-sync can two-way bind the active link
|
|
263
|
+
* the same way `[cngxMatTabs]` consumers do.
|
|
264
|
+
*
|
|
265
|
+
* Active-link changes speak: the shared nav announcement bundle
|
|
266
|
+
* ({@link createTabNavAnnouncement}) feeds the landing link's label to
|
|
267
|
+
* the shared live announcer - silent through the mount window, so a
|
|
268
|
+
* deep link's initial active state is not announced as a change.
|
|
241
269
|
*
|
|
242
270
|
* Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the
|
|
243
271
|
* `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and
|
|
244
272
|
* the live-region announcer come for free, identical to the cngx
|
|
245
273
|
* organism (Pillar 2 - same communication across skins).
|
|
246
274
|
*
|
|
247
|
-
* Decoration content-template slots
|
|
248
|
-
* `*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
275
|
+
* Decoration content-template slots resolve as on `[cngxMatTabs]`:
|
|
276
|
+
* a projected `*cngxMatTabRejectionContent` wins over
|
|
277
|
+
* `provideMatTabsConfig(withMatTabRejectionTemplate(...))`, and a
|
|
278
|
+
* projected `*cngxMatTabAggregatorContent` replaces the aggregated error
|
|
279
|
+
* summary; without either, the projectors render their built-in
|
|
280
|
+
* `cngx-sr-only` text.
|
|
251
281
|
*
|
|
252
282
|
* @playground Native router tabs with a CanDeactivate guard ./examples/router-nav/router-nav.component.ts
|
|
253
283
|
*
|
|
@@ -257,6 +287,8 @@ declare class CngxMatTabs {
|
|
|
257
287
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-nav.directive.ts
|
|
258
288
|
* @since 0.1.0
|
|
259
289
|
* @relatedTo CngxMatTabLink, CngxMatTabs, CngxTabsRouteSync
|
|
290
|
+
* @slot cngxMatTabAggregatorContent Replaces the aggregated error summary projected into a Material tab.
|
|
291
|
+
* @slot cngxMatTabRejectionContent Replaces the rejection notice on a rolled-back Material tab.
|
|
260
292
|
*/
|
|
261
293
|
declare class CngxMatTabNav {
|
|
262
294
|
private readonly presenter;
|
|
@@ -264,8 +296,12 @@ declare class CngxMatTabNav {
|
|
|
264
296
|
private readonly injector;
|
|
265
297
|
private readonly renderer;
|
|
266
298
|
private readonly hostEl;
|
|
299
|
+
private readonly viewContainerRef;
|
|
300
|
+
private readonly matTabsConfig;
|
|
267
301
|
private readonly i18n;
|
|
268
|
-
private readonly
|
|
302
|
+
private readonly aggregatorContentSlot;
|
|
303
|
+
private readonly rejectionContentSlot;
|
|
304
|
+
private readonly decorationTemplates;
|
|
269
305
|
private readonly rejectionState;
|
|
270
306
|
private readonly aggregatedErrorTabs;
|
|
271
307
|
constructor();
|
|
@@ -276,7 +312,7 @@ declare class CngxMatTabNav {
|
|
|
276
312
|
*/
|
|
277
313
|
clearLastFailed(): void;
|
|
278
314
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabNav, never>;
|
|
279
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabNav, "[cngxMatTabNav]", ["cngxMatTabNav"], {}, {},
|
|
315
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabNav, "[cngxMatTabNav]", ["cngxMatTabNav"], {}, {}, ["aggregatorContentSlot", "rejectionContentSlot"], never, true, [{ directive: typeof i1.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }]>;
|
|
280
316
|
}
|
|
281
317
|
|
|
282
318
|
/**
|
|
@@ -306,7 +342,6 @@ declare class CngxMatTabNav {
|
|
|
306
342
|
* @relatedTo CngxMatTabNav, CngxMatTabs, CngxTab
|
|
307
343
|
*/
|
|
308
344
|
declare class CngxMatTabLink implements OnInit {
|
|
309
|
-
private readonly matLink;
|
|
310
345
|
private readonly host;
|
|
311
346
|
private readonly destroyRef;
|
|
312
347
|
/**
|
|
@@ -326,12 +361,19 @@ declare class CngxMatTabLink implements OnInit {
|
|
|
326
361
|
readonly error: i0.InputSignal<string | boolean>;
|
|
327
362
|
/** Optional rich error aggregator for the link. */
|
|
328
363
|
readonly errorAggregator: i0.InputSignal<CngxErrorAggregatorContract | undefined>;
|
|
364
|
+
/**
|
|
365
|
+
* Disabled state of the link. Angular binds `[disabled]` to every
|
|
366
|
+
* directive on the element that declares the input, so `MatTabLink`
|
|
367
|
+
* and this directive read one template binding and the handle tracks
|
|
368
|
+
* it live. An imperative write to the `MatTabLink` instance is not
|
|
369
|
+
* seen; the template binding is the contract.
|
|
370
|
+
*/
|
|
371
|
+
readonly disabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
329
372
|
private readonly errorMessage;
|
|
330
373
|
private readonly hasError;
|
|
331
|
-
private readonly disabledState;
|
|
332
374
|
ngOnInit(): void;
|
|
333
375
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatTabLink, never>;
|
|
334
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabLink, "[cngxMatTabLink]", ["cngxMatTabLink"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorAggregator": { "alias": "errorAggregator"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
376
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatTabLink, "[cngxMatTabLink]", ["cngxMatTabLink"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorAggregator": { "alias": "errorAggregator"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
335
377
|
}
|
|
336
378
|
|
|
337
379
|
/**
|
|
@@ -363,9 +405,7 @@ declare class CngxMatTabLink implements OnInit {
|
|
|
363
405
|
* @relatedTo CngxMatTabs, CngxMatTabsRegistry, CngxMatTabRejectionContent
|
|
364
406
|
*/
|
|
365
407
|
declare class CngxMatTabError {
|
|
366
|
-
private readonly
|
|
367
|
-
private readonly registry;
|
|
368
|
-
private readonly presenter;
|
|
408
|
+
private readonly target;
|
|
369
409
|
private readonly destroyRef;
|
|
370
410
|
readonly aggregator: i0.InputSignalWithTransform<CngxErrorAggregatorContract | undefined, "" | CngxErrorAggregatorContract | undefined>;
|
|
371
411
|
constructor();
|
|
@@ -379,7 +419,11 @@ declare class CngxMatTabError {
|
|
|
379
419
|
* `string | boolean` writes the per-handle `directError` slot, which
|
|
380
420
|
* folds into the handle's `hasError` / `errorMessage`. A non-empty
|
|
381
421
|
* string doubles as the SR descriptor message; `true` marks the tab
|
|
382
|
-
* invalid with no message; `false` / `''` clear it.
|
|
422
|
+
* invalid with no message; `false` / `''` clear it. The folded state
|
|
423
|
+
* drives the same header decoration as the aggregator: the
|
|
424
|
+
* `cngx-mat-tab--has-errors` badge plus an SR-only descriptor span
|
|
425
|
+
* referenced through `aria-describedby` (message, else the
|
|
426
|
+
* `tabHasErrors` i18n phrase), removed again when the flag clears.
|
|
383
427
|
*
|
|
384
428
|
* Symmetric with `[cngxMatTabError]` (one directive, one
|
|
385
429
|
* responsibility - Pillar 3): the aggregator stays the rich
|
|
@@ -399,9 +443,7 @@ declare class CngxMatTabError {
|
|
|
399
443
|
* @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabsRegistry
|
|
400
444
|
*/
|
|
401
445
|
declare class CngxMatTabErrorFlag {
|
|
402
|
-
private readonly
|
|
403
|
-
private readonly registry;
|
|
404
|
-
private readonly presenter;
|
|
446
|
+
private readonly target;
|
|
405
447
|
private readonly destroyRef;
|
|
406
448
|
readonly error: i0.InputSignalWithTransform<string | boolean, string | boolean>;
|
|
407
449
|
constructor();
|
|
@@ -507,8 +549,11 @@ declare class CngxMatTabAggregatorContent {
|
|
|
507
549
|
* resolves to a handle with a non-empty label) - `undefined` when
|
|
508
550
|
* no labelled rollback origin is resolvable; `fallbackText` is the
|
|
509
551
|
* built-in i18n phrase the imperative fallback path would write
|
|
510
|
-
* verbatim (typically `commitRolledBackTo(
|
|
511
|
-
* origin is resolvable, `commitFailedRetry` otherwise
|
|
552
|
+
* verbatim (for a failure typically `commitRolledBackTo(origin)`
|
|
553
|
+
* when the origin is resolvable, `commitFailedRetry` otherwise; for a
|
|
554
|
+
* refusal `commitRefused(origin)` or `commitRefusedGeneric`; a
|
|
555
|
+
* label-less origin is named `unlabeledTab(position)`);
|
|
556
|
+
* `reason` is the kind of the outcome.
|
|
512
557
|
*
|
|
513
558
|
* **Re-instantiation warning.** The decoration projector destroys
|
|
514
559
|
* the embedded view and creates a fresh one on every `descriptorText`
|
|
@@ -540,6 +585,12 @@ interface CngxMatTabRejectionContentContext {
|
|
|
540
585
|
* decoration (icon, branded prefix, retry CTA).
|
|
541
586
|
*/
|
|
542
587
|
readonly fallbackText: string;
|
|
588
|
+
/**
|
|
589
|
+
* Why the commit did not land: `'refused'` when the commit action
|
|
590
|
+
* answered `false`, `'failed'` when it threw, rejected or errored.
|
|
591
|
+
* Pick copy or an icon per reason; `fallbackText` already follows it.
|
|
592
|
+
*/
|
|
593
|
+
readonly reason: 'refused' | 'failed';
|
|
543
594
|
}
|
|
544
595
|
/**
|
|
545
596
|
* Structural slot directive marking the rejection-descriptor
|
|
@@ -556,7 +607,9 @@ interface CngxMatTabRejectionContentContext {
|
|
|
556
607
|
* Cascade resolution:
|
|
557
608
|
* 1. Per-instance `*cngxMatTabRejectionContent` template wins
|
|
558
609
|
* via `contentChild(CngxMatTabRejectionContent)`.
|
|
559
|
-
* 2.
|
|
610
|
+
* 2. `CNGX_MAT_TABS_CONFIG.templates.rejection` (app-wide middle
|
|
611
|
+
* tier, set via `withMatTabRejectionTemplate`).
|
|
612
|
+
* 3. Library default - imperative `Renderer2.createElement('span')`
|
|
560
613
|
* with `textContent = fallbackText` (the resolved
|
|
561
614
|
* `commitRolledBackTo(originLabel)` / `commitFailedRetry`
|
|
562
615
|
* phrase from `injectTabsI18n()`).
|
|
@@ -611,6 +664,23 @@ declare class CngxMatTabRejectionContent {
|
|
|
611
664
|
*/
|
|
612
665
|
type CngxMatTabHalfWiredSlotSink = (missing: 'contentTemplate' | 'viewContainerRef') => void;
|
|
613
666
|
|
|
667
|
+
/**
|
|
668
|
+
* App-wide template defaults for the `[cngxMatTabs]` decorations -
|
|
669
|
+
* the middle cascade tier between a per-instance structural slot and
|
|
670
|
+
* the built-in fallback. Sibling of `CngxTabsTemplates` /
|
|
671
|
+
* `CngxStepperTemplates` so consumer templates port across families.
|
|
672
|
+
*
|
|
673
|
+
* @category ui/mat-tabs
|
|
674
|
+
*/
|
|
675
|
+
interface CngxMatTabsTemplates {
|
|
676
|
+
/**
|
|
677
|
+
* Default for the rejection SR-descriptor content
|
|
678
|
+
* (`*cngxMatTabRejectionContent`). Per-instance slot still wins;
|
|
679
|
+
* without either tier the imperative fallback writes the resolved
|
|
680
|
+
* i18n phrase verbatim.
|
|
681
|
+
*/
|
|
682
|
+
readonly rejection?: TemplateRef<CngxMatTabRejectionContentContext>;
|
|
683
|
+
}
|
|
614
684
|
/**
|
|
615
685
|
* Behaviour knobs for `[cngxMatTabs]`. Single canonical surface
|
|
616
686
|
* symmetric to `provideSelectConfig` in the select family - every
|
|
@@ -655,7 +725,25 @@ interface CngxMatTabsConfig {
|
|
|
655
725
|
* (Sentry breadcrumbs, custom logger, CI fail-fast).
|
|
656
726
|
*/
|
|
657
727
|
readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;
|
|
728
|
+
/**
|
|
729
|
+
* App-wide decoration template defaults - the middle cascade tier.
|
|
730
|
+
* Per-instance structural slots still win; see
|
|
731
|
+
* {@link CngxMatTabsTemplates}.
|
|
732
|
+
*/
|
|
733
|
+
readonly templates?: CngxMatTabsTemplates;
|
|
658
734
|
}
|
|
735
|
+
/**
|
|
736
|
+
* Library defaults for `[cngxMatTabs]`. Source of truth for every
|
|
737
|
+
* key on {@link CngxMatTabsConfig}. Consumed by
|
|
738
|
+
* {@link injectMatTabsConfig} as the final fallback.
|
|
739
|
+
*
|
|
740
|
+
* @internal
|
|
741
|
+
*/
|
|
742
|
+
declare const CNGX_MAT_TABS_CONFIG_DEFAULTS: {
|
|
743
|
+
readonly anchorMaxAttempts: 5;
|
|
744
|
+
readonly halfWiredSlotSink: CngxMatTabHalfWiredSlotSink;
|
|
745
|
+
readonly templates: {};
|
|
746
|
+
};
|
|
659
747
|
/**
|
|
660
748
|
* DI token holding a partial {@link CngxMatTabsConfig}. Set via
|
|
661
749
|
* {@link provideMatTabsConfig} (app-wide) or
|
|
@@ -697,6 +785,15 @@ declare function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature;
|
|
|
697
785
|
* @category ui/mat-tabs
|
|
698
786
|
*/
|
|
699
787
|
declare function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature;
|
|
788
|
+
/**
|
|
789
|
+
* App-wide override for the rejection SR-descriptor content. Middle
|
|
790
|
+
* tier; per-instance `*cngxMatTabRejectionContent` still wins.
|
|
791
|
+
* Sibling of {@link withTabRejectionIconTemplate} in the cngx-native
|
|
792
|
+
* family.
|
|
793
|
+
*
|
|
794
|
+
* @category ui/mat-tabs
|
|
795
|
+
*/
|
|
796
|
+
declare function withMatTabRejectionTemplate(template: TemplateRef<CngxMatTabRejectionContentContext>): CngxMatTabsConfigFeature;
|
|
700
797
|
/**
|
|
701
798
|
* App-wide `[cngxMatTabs]` configuration. Returns
|
|
702
799
|
* `EnvironmentProviders` for use inside `bootstrapApplication`'s
|
|
@@ -722,6 +819,11 @@ declare function provideMatTabsConfig(...features: CngxMatTabsConfigFeature[]):
|
|
|
722
819
|
* `providers` or `viewProviders` (which cannot accept opaque
|
|
723
820
|
* environment providers).
|
|
724
821
|
*
|
|
822
|
+
* Merges over the outer config (via `skipSelf`), so a component-scope
|
|
823
|
+
* call refines the root {@link provideMatTabsConfig} instead of
|
|
824
|
+
* reverting its untouched keys to library defaults - only the keys
|
|
825
|
+
* the local features set are overridden for the subtree.
|
|
826
|
+
*
|
|
725
827
|
* ```ts
|
|
726
828
|
* @Component({
|
|
727
829
|
* selector: 'app-tabs-page',
|
|
@@ -789,6 +891,18 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
789
891
|
interface StateChangeSource {
|
|
790
892
|
readonly _stateChanges: Subject<void>;
|
|
791
893
|
}
|
|
894
|
+
/**
|
|
895
|
+
* Subset of Material's `MatTab` carrying the `_closestTabGroup`
|
|
896
|
+
* back-reference (the owning `MatTabGroup`, resolved via DI at
|
|
897
|
+
* construction). Material's own `_allTabs` filter compares against
|
|
898
|
+
* it for exactly the reason cngx does: a `descendants: true` query
|
|
899
|
+
* also surfaces tabs of a nested `<mat-tab-group>`, and only the
|
|
900
|
+
* ownership comparison separates them. Typed `unknown` because the
|
|
901
|
+
* upstream declaration is `any` - cngx only ever identity-compares.
|
|
902
|
+
*/
|
|
903
|
+
interface ClosestTabGroupSource {
|
|
904
|
+
readonly _closestTabGroup: unknown;
|
|
905
|
+
}
|
|
792
906
|
/**
|
|
793
907
|
* Subset of Material's `MatStepper` carrying the `_iconOverrides`
|
|
794
908
|
* map. `<cngx-mat-stepper>` patches this map inside
|
|
@@ -845,6 +959,108 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
845
959
|
const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR = ".mat-mdc-tab-label-container";
|
|
846
960
|
}
|
|
847
961
|
|
|
962
|
+
/**
|
|
963
|
+
* Shared order-aware registration seam for the Material
|
|
964
|
+
* instrumentation directives (`[cngxMatTabs]`, `[cngxMatStepper]`).
|
|
965
|
+
*
|
|
966
|
+
* Both bridges diff a `contentChildren(Mat*)` query into a presenter
|
|
967
|
+
* registry via `register`/`unregister`. The presenters keep pure
|
|
968
|
+
* insertion order and append every new registration at the end, so a
|
|
969
|
+
* mid-list `<mat-tab>` / `<mat-step>` insert would register at the
|
|
970
|
+
* tail while Material renders it at its DOM position - index-based
|
|
971
|
+
* selection, announcements and decorations would then target the
|
|
972
|
+
* wrong item. This seam mirrors the query order into the presenter on
|
|
973
|
+
* every emission: surviving prefix entries stay untouched, the
|
|
974
|
+
* diverging suffix is unregistered and re-registered in query order
|
|
975
|
+
* with the SAME handle instances (per-entry resources such as child
|
|
976
|
+
* injectors are never re-created for surviving items).
|
|
977
|
+
*
|
|
978
|
+
* Pure TypeScript, no Angular imports. Lives in the mat-tabs entry
|
|
979
|
+
* and is exported `@internal` from its barrel for cross-entry
|
|
980
|
+
* consumption by `@cngx/ui/mat-stepper` - ng-packagr rejects source
|
|
981
|
+
* files shared between entry points by relative import, so the
|
|
982
|
+
* export-plus-internal-tag route (the `MaterialPrivateSurfaces`
|
|
983
|
+
* pattern) is the supported sharing path.
|
|
984
|
+
*
|
|
985
|
+
* @internal
|
|
986
|
+
*/
|
|
987
|
+
interface CngxOrderedRegistrationSeamOptions<TItem, TEntry> {
|
|
988
|
+
/** Build the per-item entry (handle setup + resources). Called once per item lifetime. */
|
|
989
|
+
create(item: TItem): TEntry;
|
|
990
|
+
/** Register the entry's handle with the presenter. */
|
|
991
|
+
register(entry: TEntry): void;
|
|
992
|
+
/** Remove the entry's handle from the presenter (resources stay alive). */
|
|
993
|
+
unregister(entry: TEntry): void;
|
|
994
|
+
/** Release per-entry resources (child injector etc.). Called once, after the final unregister. */
|
|
995
|
+
dispose(entry: TEntry): void;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Stateful diff surface returned by {@link createOrderedRegistrationSeam}.
|
|
999
|
+
*
|
|
1000
|
+
* @internal
|
|
1001
|
+
*/
|
|
1002
|
+
interface CngxOrderedRegistrationSeam<TItem, TEntry> {
|
|
1003
|
+
/**
|
|
1004
|
+
* Mirror `items` (the current `contentChildren` emission, in query
|
|
1005
|
+
* order) into the presenter registry. Removed items are
|
|
1006
|
+
* unregistered and disposed; new items are created and registered;
|
|
1007
|
+
* surviving items keep their entry, and any item whose position
|
|
1008
|
+
* diverged from the registered order is re-registered so the
|
|
1009
|
+
* presenter's order matches `items` exactly.
|
|
1010
|
+
*/
|
|
1011
|
+
sync(items: readonly TItem[]): void;
|
|
1012
|
+
/** Entry lookup for per-item decoration hooks. */
|
|
1013
|
+
get(item: TItem): TEntry | undefined;
|
|
1014
|
+
/** Unregister and dispose every entry (directive destroy). */
|
|
1015
|
+
clear(): void;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Create the order-aware registration seam. See the module JSDoc for
|
|
1019
|
+
* the contract.
|
|
1020
|
+
*
|
|
1021
|
+
* @internal
|
|
1022
|
+
*/
|
|
1023
|
+
declare function createOrderedRegistrationSeam<TItem, TEntry>(options: CngxOrderedRegistrationSeamOptions<TItem, TEntry>): CngxOrderedRegistrationSeam<TItem, TEntry>;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Options for {@link mountLiveRegionAnnouncer}.
|
|
1027
|
+
*
|
|
1028
|
+
* @internal
|
|
1029
|
+
*/
|
|
1030
|
+
interface CngxMatBridgeLiveRegionOptions {
|
|
1031
|
+
/** Reactive announcement text. Empty string keeps the region quiet. */
|
|
1032
|
+
readonly announcement: Signal<string>;
|
|
1033
|
+
readonly injector: Injector;
|
|
1034
|
+
/** Default: `'polite'`. */
|
|
1035
|
+
readonly politeness?: 'polite' | 'assertive';
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Keep the shared {@link CngxLiveAnnouncer} in sync with the supplied
|
|
1039
|
+
* `announcement` signal: an `effect` reads the reactive text and
|
|
1040
|
+
* forwards every non-empty value to the root announcer at the
|
|
1041
|
+
* configured politeness (default `'polite'`). An empty string between
|
|
1042
|
+
* transitions keeps the region quiet on no-op CD ticks.
|
|
1043
|
+
*
|
|
1044
|
+
* Delegates to {@link CngxLiveAnnouncer} instead of mounting its own
|
|
1045
|
+
* body span, so the announcer owns the persistent polite/assertive
|
|
1046
|
+
* region pair, the clear-then-set re-announce, and teardown. The
|
|
1047
|
+
* delegated region carries `aria-live` + `aria-atomic="true"` and no
|
|
1048
|
+
* explicit `role`; `aria-atomic` re-reads full content and `aria-live`
|
|
1049
|
+
* carries the politeness, so a tab-change status utterance still reads.
|
|
1050
|
+
*
|
|
1051
|
+
* The `effect` is created in `opts.injector`'s context, so it is torn
|
|
1052
|
+
* down with the host directive; the service call is wrapped in
|
|
1053
|
+
* `untracked` - the announcer owns its own clear-then-set timer, so it
|
|
1054
|
+
* stays out of the effect's dependency graph.
|
|
1055
|
+
*
|
|
1056
|
+
* @internal - helper shared by the Material bridge directives
|
|
1057
|
+
* (`[cngxMatTabs]`, `[cngxMatTabNav]`, `[cngxMatStepper]`). Exported
|
|
1058
|
+
* `@internal` from the mat-tabs barrel for cross-entry consumption
|
|
1059
|
+
* (the `MaterialPrivateSurfaces` pattern) - ng-packagr rejects
|
|
1060
|
+
* relative-import file sharing between entry points.
|
|
1061
|
+
*/
|
|
1062
|
+
declare function mountLiveRegionAnnouncer(opts: CngxMatBridgeLiveRegionOptions): void;
|
|
1063
|
+
|
|
848
1064
|
/**
|
|
849
1065
|
* Material variant of {@link CngxTabOverflowDomAdapter}.
|
|
850
1066
|
*
|
|
@@ -874,5 +1090,5 @@ declare namespace MaterialPrivateSurfaces {
|
|
|
874
1090
|
*/
|
|
875
1091
|
declare function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter;
|
|
876
1092
|
|
|
877
|
-
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 };
|
|
878
|
-
export type { CngxMatTabAggregatorContentContext, CngxMatTabHalfWiredSlotSink, CngxMatTabHandleFactory, CngxMatTabRejectionContentContext, CngxMatTabsConfig, CngxMatTabsConfigFeature, CngxMatTabsRegistryHost };
|
|
1093
|
+
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 };
|
|
1094
|
+
export type { CngxMatBridgeLiveRegionOptions, CngxMatTabAggregatorContentContext, CngxMatTabHalfWiredSlotSink, CngxMatTabHandleFactory, CngxMatTabHandleSetup, CngxMatTabRejectionContentContext, CngxMatTabsConfig, CngxMatTabsConfigFeature, CngxMatTabsRegistryHost, CngxMatTabsTemplates, CngxOrderedRegistrationSeam, CngxOrderedRegistrationSeamOptions };
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { Signal, Type, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { OverlayRef, OverlayConfig } from '@angular/cdk/overlay';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Construction-time options for a {@link CngxOverlayRef}. Set by
|
|
8
|
+
* {@link CngxOverlay.open}, not by consumers.
|
|
9
|
+
*
|
|
10
|
+
* @category ui/overlay
|
|
11
|
+
*/
|
|
12
|
+
interface CngxOverlayRefConfig {
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, neither Escape nor a backdrop click closes the overlay - the
|
|
15
|
+
* only way out is a programmatic `close()`. Default `false`.
|
|
16
|
+
*/
|
|
17
|
+
readonly disableClose?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Element focus returns to when the overlay closes - captured at open time,
|
|
20
|
+
* before the overlay steals focus. `null` skips restoration.
|
|
21
|
+
*/
|
|
22
|
+
readonly restoreFocusTo?: HTMLElement | null;
|
|
23
|
+
}
|
|
6
24
|
/**
|
|
7
25
|
* Typed wrapper around a CDK OverlayRef that exposes a close result stream.
|
|
8
26
|
*
|
|
27
|
+
* Closes on Escape and on a backdrop click (unless `disableClose`), restores
|
|
28
|
+
* focus to the element that opened it, and surfaces its open state as a signal
|
|
29
|
+
* beside the RxJS `afterClosed$`.
|
|
30
|
+
*
|
|
9
31
|
* @category ui/overlay
|
|
10
32
|
* @docsKind primary
|
|
11
33
|
* @wcag AA
|
|
@@ -18,19 +40,38 @@ declare class CngxOverlayRef<R = unknown> {
|
|
|
18
40
|
private readonly _afterClosed;
|
|
19
41
|
/** Emits once with the close result when the overlay is dismissed, then completes. */
|
|
20
42
|
readonly afterClosed$: rxjs.Observable<R | undefined>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
43
|
+
private readonly openState;
|
|
44
|
+
/**
|
|
45
|
+
* `true` while the overlay is open, `false` once closed. The signal view of
|
|
46
|
+
* the lifecycle beside {@link afterClosed$} - bind it in a template without
|
|
47
|
+
* an `async` pipe.
|
|
48
|
+
*/
|
|
49
|
+
readonly isOpen: Signal<boolean>;
|
|
50
|
+
private readonly restoreFocusTo;
|
|
51
|
+
constructor(cdkRef: OverlayRef, config?: CngxOverlayRefConfig);
|
|
52
|
+
/**
|
|
53
|
+
* Closes the overlay, emitting `result` on `afterClosed$`, disposing the CDK
|
|
54
|
+
* ref, and restoring focus. Idempotent - a second call (e.g. Escape after a
|
|
55
|
+
* scope teardown already closed it) is a no-op.
|
|
56
|
+
*/
|
|
23
57
|
close(result?: R): void;
|
|
24
58
|
}
|
|
25
59
|
|
|
26
60
|
/**
|
|
27
|
-
* Config accepted by {@link CngxOverlay.open}.
|
|
28
|
-
* {@link OverlayConfig} - every field is optional and falls back to
|
|
29
|
-
*
|
|
61
|
+
* Config accepted by {@link CngxOverlay.open}. A partial of CDK's
|
|
62
|
+
* {@link OverlayConfig} - every field is optional and falls back to the CDK
|
|
63
|
+
* overlay default - plus `disableClose`, a cngx addition that turns off the
|
|
64
|
+
* Escape / backdrop dismiss affordances.
|
|
30
65
|
*
|
|
31
66
|
* @category ui/overlay
|
|
32
67
|
*/
|
|
33
|
-
type CngxOverlayConfig = Partial<OverlayConfig
|
|
68
|
+
type CngxOverlayConfig = Partial<OverlayConfig> & {
|
|
69
|
+
/**
|
|
70
|
+
* When `true`, Escape and backdrop clicks do not close the overlay; only a
|
|
71
|
+
* programmatic `close()` does. Default `false`.
|
|
72
|
+
*/
|
|
73
|
+
readonly disableClose?: boolean;
|
|
74
|
+
};
|
|
34
75
|
/**
|
|
35
76
|
* Thin service over CDK Overlay that returns a typed CngxOverlayRef.
|
|
36
77
|
*
|
|
@@ -54,14 +95,19 @@ type CngxOverlayConfig = Partial<OverlayConfig>;
|
|
|
54
95
|
declare class CngxOverlay {
|
|
55
96
|
private readonly overlay;
|
|
56
97
|
private readonly injector;
|
|
98
|
+
private readonly document;
|
|
99
|
+
private readonly openRefs;
|
|
100
|
+
constructor();
|
|
57
101
|
/**
|
|
58
102
|
* Opens `component` in a CDK overlay panel and returns a typed ref.
|
|
59
103
|
*
|
|
60
|
-
* Defaults to a centered, backdropped panel
|
|
61
|
-
*
|
|
104
|
+
* Defaults to a centered, backdropped panel that closes on Escape or a
|
|
105
|
+
* backdrop click; pass `disableClose` to opt out. Focus returns to the
|
|
106
|
+
* element that was focused at open time. Merge `config` to override position
|
|
107
|
+
* strategy, scroll strategy, or any other CDK `OverlayConfig` option.
|
|
62
108
|
*
|
|
63
109
|
* @param component Component class to attach as a portal.
|
|
64
|
-
* @param config CDK
|
|
110
|
+
* @param config Overlay configuration overrides (CDK options + `disableClose`).
|
|
65
111
|
*/
|
|
66
112
|
open<C, R = unknown>(component: Type<C>, config?: CngxOverlayConfig): CngxOverlayRef<R>;
|
|
67
113
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxOverlay, never>;
|