@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.
Files changed (101) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +227 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +120 -36
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +121 -56
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +204 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +209 -40
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1074 -460
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +553 -198
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +344 -109
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +234 -99
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +88 -25
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +98 -23
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +101 -33
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/README.md +30 -6
  63. package/mat-tabs/styles/mat-tabs.css +188 -42
  64. package/overlay/README.md +9 -4
  65. package/package.json +31 -7
  66. package/paginator/README.md +8 -4
  67. package/schematics/collection.json +9 -0
  68. package/schematics/ng-add/index.js +9 -0
  69. package/schematics/ng-add/schema.json +91 -0
  70. package/schematics/package.json +3 -0
  71. package/sidenav/README.md +33 -11
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +14 -2
  74. package/timeline/README.md +1 -1
  75. package/toc/README.md +4 -1
  76. package/types/cngx-ui-a11y.d.ts +121 -30
  77. package/types/cngx-ui-accordion.d.ts +100 -28
  78. package/types/cngx-ui-action-button.d.ts +44 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +167 -60
  80. package/types/cngx-ui-chart-panel.d.ts +122 -18
  81. package/types/cngx-ui-collection.d.ts +157 -55
  82. package/types/cngx-ui-command-palette.d.ts +297 -183
  83. package/types/cngx-ui-context-menu.d.ts +140 -10
  84. package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +605 -59
  87. package/types/cngx-ui-mat-accordion.d.ts +30 -1
  88. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  89. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  90. package/types/cngx-ui-mat-tabs.d.ts +250 -34
  91. package/types/cngx-ui-overlay.d.ts +56 -10
  92. package/types/cngx-ui-paginator.d.ts +425 -136
  93. package/types/cngx-ui-sidenav.d.ts +248 -74
  94. package/types/cngx-ui-skeleton.d.ts +6 -7
  95. package/types/cngx-ui-speak.d.ts +118 -5
  96. package/types/cngx-ui-stat-card.d.ts +117 -33
  97. package/types/cngx-ui-stepper.d.ts +88 -49
  98. package/types/cngx-ui-tabs.d.ts +6 -4
  99. package/types/cngx-ui-timeline.d.ts +35 -11
  100. package/types/cngx-ui-toc.d.ts +93 -16
  101. package/types/cngx-ui.d.ts +7 -4
@@ -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
  /**
@@ -34,6 +35,20 @@ import * as i1 from '@cngx/common/interactive';
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
@@ -53,11 +68,25 @@ declare class CngxMatAccordion {
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` is a readonly id the CDK generates, so it is
79
+ * not known up front; key panels from your own data instead.
80
+ * Unbound, ids fall back to generated `nextUid` values. Swapping
81
+ * the bound function at runtime re-keys future events but does not
82
+ * migrate ids already stored in `openIds` - bind it once.
83
+ */
84
+ readonly panelIdFn: i0.InputSignal<((panel: MatExpansionPanel) => string) | undefined>;
56
85
  private readonly idByPanel;
57
86
  constructor();
58
87
  private panelId;
59
88
  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"; }; }]>;
89
+ 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
90
  }
62
91
 
63
92
  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 new
42
- * page + visible range after every change; `<mat-paginator>` only relabels its
43
- * own range text, which AT does not announce. Localise via `[announceLabel]`.
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
- /** Speak page changes through a visually-hidden `aria-live` region when `true`. */
91
- readonly announce: _angular_core.InputSignal<boolean>;
92
- /** Builds the announcement string. Defaults to an English template. */
93
- readonly announceLabel: _angular_core.InputSignal<(context: CngxMatPaginatorAnnounceContext) => string>;
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: { "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; }; }]>;
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. `Step <id>` - deterministic, derived from the cngx handle
121
- * id. Always non-empty.
122
- * Documented limitation: runtime label changes do not propagate.
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 };