ngwr 16.3.0 → 16.4.0

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 (142) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  3. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  4. package/fesm2022/ngwr-carousel-testing.mjs +24 -1
  5. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  6. package/fesm2022/ngwr-carousel.mjs +67 -4
  7. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  8. package/fesm2022/ngwr-cascader.mjs +10 -23
  9. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  10. package/fesm2022/ngwr-context-menu.mjs +16 -1
  11. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  12. package/fesm2022/ngwr-dropdown.mjs +18 -4
  13. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  14. package/fesm2022/ngwr-file-upload.mjs +7 -3
  15. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  16. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  17. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  18. package/fesm2022/ngwr-graph.mjs +568 -7
  19. package/fesm2022/ngwr-graph.mjs.map +1 -1
  20. package/fesm2022/ngwr-i18n-ar.mjs +8 -4
  21. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  22. package/fesm2022/ngwr-i18n-cs.mjs +8 -4
  23. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  24. package/fesm2022/ngwr-i18n-de.mjs +8 -4
  25. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  26. package/fesm2022/ngwr-i18n-en.mjs +8 -4
  27. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-es.mjs +8 -4
  29. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-fr.mjs +8 -4
  31. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-he.mjs +8 -4
  33. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-hi.mjs +8 -4
  35. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-id.mjs +8 -4
  37. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-it.mjs +8 -4
  39. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-ja.mjs +8 -4
  41. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-ko.mjs +8 -4
  43. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-nl.mjs +8 -4
  45. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-pl.mjs +8 -4
  47. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-pt.mjs +8 -4
  49. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-ru.mjs +8 -4
  51. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-sv.mjs +8 -4
  53. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-tr.mjs +8 -4
  55. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-uk.mjs +8 -4
  57. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-vi.mjs +8 -4
  59. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  60. package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
  61. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  62. package/fesm2022/ngwr-i18n-zh.mjs +8 -4
  63. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  64. package/fesm2022/ngwr-lightbox.mjs +2 -2
  65. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  66. package/fesm2022/ngwr-list.mjs +2 -2
  67. package/fesm2022/ngwr-list.mjs.map +1 -1
  68. package/fesm2022/ngwr-pagination.mjs +1 -0
  69. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  70. package/fesm2022/ngwr-schema-form.mjs +1 -0
  71. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  72. package/fesm2022/ngwr-select.mjs +100 -3
  73. package/fesm2022/ngwr-select.mjs.map +1 -1
  74. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  75. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  76. package/fesm2022/ngwr-table-testing.mjs +71 -3
  77. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  78. package/fesm2022/ngwr-table.mjs +171 -11
  79. package/fesm2022/ngwr-table.mjs.map +1 -1
  80. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  81. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  82. package/fesm2022/ngwr-tour.mjs +13 -9
  83. package/fesm2022/ngwr-tour.mjs.map +1 -1
  84. package/fesm2022/ngwr-tree.mjs +12 -1
  85. package/fesm2022/ngwr-tree.mjs.map +1 -1
  86. package/fesm2022/ngwr-utils.mjs +64 -1
  87. package/fesm2022/ngwr-utils.mjs.map +1 -1
  88. package/fesm2022/ngwr-version.mjs +1 -1
  89. package/fesm2022/ngwr-version.mjs.map +1 -1
  90. package/graph/styles/_index.scss +87 -0
  91. package/i18n/ar.json +8 -4
  92. package/i18n/cs.json +8 -4
  93. package/i18n/de.json +8 -4
  94. package/i18n/en.json +8 -4
  95. package/i18n/es.json +8 -4
  96. package/i18n/fr.json +8 -4
  97. package/i18n/he.json +8 -4
  98. package/i18n/hi.json +8 -4
  99. package/i18n/id.json +8 -4
  100. package/i18n/it.json +8 -4
  101. package/i18n/ja.json +8 -4
  102. package/i18n/ko.json +8 -4
  103. package/i18n/nl.json +8 -4
  104. package/i18n/pl.json +8 -4
  105. package/i18n/pt.json +8 -4
  106. package/i18n/ru.json +8 -4
  107. package/i18n/sv.json +8 -4
  108. package/i18n/tr.json +8 -4
  109. package/i18n/uk.json +8 -4
  110. package/i18n/vi.json +8 -4
  111. package/i18n/zh-TW.json +8 -4
  112. package/i18n/zh.json +8 -4
  113. package/llms-full.txt +4 -4
  114. package/llms.txt +57 -24
  115. package/package.json +1 -1
  116. package/schematics/collection.json +5 -0
  117. package/schematics/eject/index.js +158 -0
  118. package/schematics/eject/schema.js +8 -0
  119. package/schematics/eject/schema.json +24 -0
  120. package/schematics/eject/source.js +295 -0
  121. package/schematics/use/symbol-map.json +1 -0
  122. package/select/styles/_index.scss +13 -0
  123. package/skills/ngwr/SKILL.md +30 -3
  124. package/skills/ngwr/references/catalog.md +1 -1
  125. package/table/styles/_index.scss +24 -0
  126. package/theme/styles/_focus.scss +11 -1
  127. package/types/ngwr-carousel-testing.d.ts +27 -6
  128. package/types/ngwr-carousel.d.ts +42 -6
  129. package/types/ngwr-cascader.d.ts +3 -5
  130. package/types/ngwr-context-menu.d.ts +2 -0
  131. package/types/ngwr-dropdown.d.ts +2 -0
  132. package/types/ngwr-file-upload.d.ts +8 -2
  133. package/types/ngwr-graph-testing.d.ts +28 -0
  134. package/types/ngwr-graph.d.ts +247 -91
  135. package/types/ngwr-select.d.ts +37 -0
  136. package/types/ngwr-table-testing.d.ts +52 -1
  137. package/types/ngwr-table.d.ts +101 -9
  138. package/types/ngwr-tour-testing.d.ts +10 -0
  139. package/types/ngwr-tour.d.ts +11 -2
  140. package/types/ngwr-tree.d.ts +2 -0
  141. package/types/ngwr-utils.d.ts +79 -1
  142. package/types/ngwr-version.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { TemplateRef } from "@angular/core";
2
+ import { Signal, TemplateRef } from "@angular/core";
3
3
  /**
4
4
  * @license
5
5
  *
@@ -74,6 +74,90 @@ export declare class WrGraphNodeTemplate {
74
74
  static ɵfac: i0.ɵɵFactoryDeclaration<WrGraphNodeTemplate, never>;
75
75
  static ɵdir: i0.ɵɵDirectiveDeclaration<WrGraphNodeTemplate, "ng-template[wrGraphNode]", never, {}, {}, never, never, true, never>;
76
76
  }
77
+ /**
78
+ * @license
79
+ *
80
+ * Use of this source code is governed by an MIT-style license that can be
81
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
82
+ */
83
+ /** A point in graph space: origin top-left, y grows downward. */
84
+ interface WrGraphPoint {
85
+ readonly x: number;
86
+ readonly y: number;
87
+ }
88
+ /**
89
+ * What a layout reads about a node: resolved, plain and serialisable. The
90
+ * consumer's `data` never reaches a layout, and neither does the DOM — sizes
91
+ * arrive as finite numbers the component already resolved.
92
+ */
93
+ interface WrGraphLayoutNode {
94
+ readonly id: string;
95
+ readonly width: number;
96
+ readonly height: number;
97
+ }
98
+ /** A layout edge. `from` is the parent, `to` the child; `id` is unique per edge. */
99
+ interface WrGraphLayoutEdge {
100
+ readonly id: string;
101
+ readonly from: string;
102
+ readonly to: string;
103
+ }
104
+ /**
105
+ * The whole graph a layout works on. Input order IS the tie-break order, so the
106
+ * same arrays always produce the same picture. Parallel edges and self-loops
107
+ * are legal here; an edge naming a missing node is dropped silently, because
108
+ * the component has already warned about it.
109
+ */
110
+ interface WrGraphLayoutInput {
111
+ readonly nodes: readonly WrGraphLayoutNode[];
112
+ readonly edges: readonly WrGraphLayoutEdge[];
113
+ }
114
+ /**
115
+ * Per-call context. An object from day one so later fields are additive. The
116
+ * signal aborts when the input changes, or the graph is destroyed, before an
117
+ * asynchronous layout settles. An engine that cannot stop its work can leave it
118
+ * running: the graph drops the late result.
119
+ */
120
+ interface WrGraphLayoutContext {
121
+ readonly signal: AbortSignal;
122
+ }
123
+ /** Where a node goes: its TOP-LEFT corner in graph space, which maps straight onto a CSS translate. */
124
+ interface WrGraphNodePlacement {
125
+ readonly id: string;
126
+ readonly x: number;
127
+ readonly y: number;
128
+ }
129
+ /** The polyline of one edge, from the `from` end to the `to` end — at least two points. */
130
+ interface WrGraphEdgeRoute {
131
+ readonly id: string;
132
+ readonly points: readonly WrGraphPoint[];
133
+ }
134
+ /**
135
+ * A finished layout. The bounding box starts at (0, 0) and measures
136
+ * `width` × `height`. Direction-free: RTL is applied after the layout, so these
137
+ * numbers never depend on `dir`.
138
+ */
139
+ interface WrGraphLayoutResult {
140
+ readonly nodes: readonly WrGraphNodePlacement[];
141
+ readonly edges: readonly WrGraphEdgeRoute[];
142
+ readonly width: number;
143
+ readonly height: number;
144
+ }
145
+ /**
146
+ * The seam a layout engine plugs into. Used as both the type and the DI token,
147
+ * the way `WrDateAdapter` is.
148
+ *
149
+ * A synchronous result is drawn in the same pass. A Promise is for an engine
150
+ * that works in a worker or on a server: the graph keeps its last picture until
151
+ * the Promise resolves, and reports a rejection through `layoutError`.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * providers: [{ provide: WrGraphLayout, useClass: WorkerLayout }]
156
+ * ```
157
+ */
158
+ export declare abstract class WrGraphLayout {
159
+ abstract layout(input: WrGraphLayoutInput, context: WrGraphLayoutContext): WrGraphLayoutResult | Promise<WrGraphLayoutResult>;
160
+ }
77
161
  interface DrawnNode<TData> {
78
162
  readonly node: WrGraphNode<TData>;
79
163
  readonly width: number;
@@ -96,7 +180,8 @@ interface GraphView<TData> {
96
180
  /**
97
181
  * A graph of blocks joined by parent-child links, laid out in layers from top to
98
182
  * bottom. Display only: nothing is selectable, and the graph scrolls inside its
99
- * own viewport rather than the page.
183
+ * own viewport rather than the page. With `zoomable` the viewport zooms and pans
184
+ * instead of scrolling.
100
185
  *
101
186
  * The layout runs in a `computed` with no DOM and no measuring, so the sizes are
102
187
  * the consumer's: `nodeWidth` / `nodeHeight` for every node, or `width` /
@@ -147,15 +232,63 @@ export declare class WrGraph<TData = unknown> {
147
232
  readonly nodeHeight: import("@angular/core").InputSignalWithTransform<number, unknown>;
148
233
  /** Accessible name of the scrolling viewport. Falls back to `graph.label`, then `'Graph'`. */
149
234
  readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
235
+ /**
236
+ * Lets the viewport zoom and pan instead of scrolling: `Ctrl` or `⌘` with the
237
+ * wheel, a pinch, a drag on the field, the keyboard and three buttons. The
238
+ * drawing is fitted on first draw and whenever the layout changes its size,
239
+ * until the view is moved by hand. A touch drag on the graph then pans it
240
+ * rather than scrolling the page.
241
+ *
242
+ * @default false
243
+ */
244
+ readonly zoomable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
245
+ /**
246
+ * Lets a plain wheel zoom, with no modifier key. The page then no longer
247
+ * scrolls while the pointer is over the graph.
248
+ *
249
+ * @default false
250
+ */
251
+ readonly wheelZoom: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
252
+ /**
253
+ * The zoom, where `1` is 100%. Two-way: it follows every gesture, and a value
254
+ * written to it zooms around the middle of the viewport, kept inside
255
+ * `minZoom` and `maxZoom`. Ignored unless `zoomable`.
256
+ *
257
+ * @default 1
258
+ */
259
+ readonly zoom: import("@angular/core").ModelSignal<number>;
260
+ /**
261
+ * The smallest zoom.
262
+ *
263
+ * @default 0.25
264
+ */
265
+ readonly minZoom: import("@angular/core").InputSignalWithTransform<number, unknown>;
266
+ /**
267
+ * The largest zoom. Never below `minZoom`.
268
+ *
269
+ * @default 4
270
+ */
271
+ readonly maxZoom: import("@angular/core").InputSignalWithTransform<number, unknown>;
272
+ /** Accessible name of the zoom-in button. Falls back to `graph.zoomIn`, then `'Zoom in'`. */
273
+ readonly zoomInLabel: import("@angular/core").InputSignal<string | null>;
274
+ /** Accessible name of the zoom-out button. Falls back to `graph.zoomOut`, then `'Zoom out'`. */
275
+ readonly zoomOutLabel: import("@angular/core").InputSignal<string | null>;
276
+ /** Accessible name of the fit button. Falls back to `graph.fit`, then `'Fit to view'`. */
277
+ readonly fitLabel: import("@angular/core").InputSignal<string | null>;
150
278
  /**
151
279
  * An asynchronous layout rejected. Carries the rejection as thrown. The last
152
280
  * picture stays on screen, and a run that was aborted never reports here.
153
281
  */
154
282
  readonly layoutError: import("@angular/core").OutputEmitterRef<unknown>;
155
- protected readonly label: import("@angular/core").Signal<string>;
283
+ protected readonly label: Signal<string>;
156
284
  private readonly parentsText;
157
285
  private readonly childrenText;
158
- protected readonly nodeTemplate: import("@angular/core").Signal<WrGraphNodeTemplate | undefined>;
286
+ protected readonly zoomInText: Signal<string>;
287
+ protected readonly zoomOutText: Signal<string>;
288
+ protected readonly fitText: Signal<string>;
289
+ protected readonly nodeTemplate: Signal<WrGraphNodeTemplate | undefined>;
290
+ private readonly viewportRef;
291
+ private readonly stageRef;
159
292
  /** `url(#…)` for every edge's `marker-end`. */
160
293
  protected readonly markerId: string;
161
294
  protected readonly markerUrl: string;
@@ -164,6 +297,8 @@ export declare class WrGraph<TData = unknown> {
164
297
  private readonly dir;
165
298
  private readonly i18n;
166
299
  private readonly localeId;
300
+ private readonly isBrowser;
301
+ private readonly reducedMotion;
167
302
  private readonly isRtl;
168
303
  private readonly locale;
169
304
  /**
@@ -188,7 +323,7 @@ export declare class WrGraph<TData = unknown> {
188
323
  * carries `wr-graph--pending` and the viewport `aria-busy` while it is. Always
189
324
  * `false` with a synchronous layout.
190
325
  */
191
- readonly layoutPending: import("@angular/core").Signal<boolean>;
326
+ readonly layoutPending: Signal<boolean>;
192
327
  /** Layout joined to the nodes and edges, direction-free, nodes in reading order. */
193
328
  private readonly placed;
194
329
  /**
@@ -196,14 +331,78 @@ export declare class WrGraph<TData = unknown> {
196
331
  * same numbers and cannot drift apart — and kept apart from the layout so a
197
332
  * direction change does not lay the graph out again.
198
333
  */
199
- protected readonly view: import("@angular/core").Signal<GraphView<TData>>;
334
+ protected readonly view: Signal<GraphView<TData>>;
335
+ /** The zoom bounds, cleaned: a positive minimum, and a maximum never under it. */
336
+ private readonly bounds;
337
+ /** Where the drawing is. The one write per frame that moves it. */
338
+ private readonly at;
339
+ /**
340
+ * How far the drawing sits from its natural place, in pixels. Moves with every
341
+ * pan and with a zoom around a point. `{ x: 0, y: 0 }` until the view is fitted
342
+ * or moved.
343
+ */
344
+ readonly pan: Signal<WrGraphPoint>;
345
+ /** The size of the drawing, which a fit answers to. Equal sizes are one value. */
346
+ private readonly size;
347
+ /** One `transform` on the stage. Absent at 100% in its natural place, which is also what a prerender ships. */
348
+ protected readonly stageTransform: Signal<string | null>;
349
+ protected readonly atMinZoom: Signal<boolean>;
350
+ protected readonly atMaxZoom: Signal<boolean>;
351
+ /** A drag or a pinch is under way: the host carries `wr-graph--panning`. */
352
+ protected readonly panning: import("@angular/core").WritableSignal<boolean>;
353
+ /** The move in flight came from a button or a key, so the stage eases to it. */
354
+ protected readonly animated: import("@angular/core").WritableSignal<boolean>;
355
+ /** The view was moved by hand, so a new layout no longer fits it. */
356
+ private moved;
357
+ /** Pointer and wheel moves wait here for the next frame. */
358
+ private queued;
359
+ private frameId;
360
+ private readonly pointers;
361
+ private dragging;
200
362
  /**
201
363
  * The visually hidden sentence per node id: its parents, then its children, as
202
364
  * name lists. Never a count — the catalogs have no plural forms. A neighbour
203
365
  * linked by several edges is named once, and names follow reading order.
204
366
  */
205
- protected readonly relations: import("@angular/core").Signal<Map<string, string>>;
367
+ protected readonly relations: Signal<Map<string, string>>;
206
368
  constructor();
369
+ /**
370
+ * Shows the whole drawing, centred, at the largest zoom that fits and never
371
+ * above 100%. The view follows the layout again afterwards: a result of
372
+ * another size is fitted too. Does nothing unless `zoomable`.
373
+ */
374
+ fit(): void;
375
+ /**
376
+ * Puts the drawing back in its natural place at 100%. Counts as moving the
377
+ * view, so a later layout does not fit it. Does nothing unless `zoomable`.
378
+ */
379
+ resetView(): void;
380
+ protected zoomIn(): void;
381
+ protected zoomOut(): void;
382
+ protected fitView(animate: boolean): void;
383
+ /** The viewport's box and where the stage starts in it. All zeros before the first render and on the server. */
384
+ private frame;
385
+ /** The fitted transform, or `null` while there is nothing to fit or no box to fit it in. */
386
+ private fitted;
387
+ /** After a new drawing or a new box: fit it, or keep a view moved by hand within reach. */
388
+ private settle;
389
+ /** The transform the next frame will show. */
390
+ private current;
391
+ private bounded;
392
+ private commit;
393
+ /** A move from a pointer or the wheel: many may arrive in one frame, and one is drawn. */
394
+ private schedule;
395
+ private cancelFrame;
396
+ /** A step from a button or a key, around the middle of the viewport. */
397
+ private zoomBy;
398
+ private panBy;
399
+ private onWheel;
400
+ private onKeydown;
401
+ private onPointerDown;
402
+ private onPointerMove;
403
+ private onPointerEnd;
404
+ /** Capture goes to the viewport only now, so a press that never moved still clicks what it pressed. */
405
+ private startDrag;
207
406
  static ɵfac: i0.ɵɵFactoryDeclaration<WrGraph<any>, never>;
208
407
  static ɵcmp: i0.ɵɵComponentDeclaration<WrGraph<any>, "wr-graph", never, {
209
408
  "nodes": {
@@ -231,94 +430,51 @@ export declare class WrGraph<TData = unknown> {
231
430
  "required": false;
232
431
  "isSignal": true;
233
432
  };
433
+ "zoomable": {
434
+ "alias": "zoomable";
435
+ "required": false;
436
+ "isSignal": true;
437
+ };
438
+ "wheelZoom": {
439
+ "alias": "wheelZoom";
440
+ "required": false;
441
+ "isSignal": true;
442
+ };
443
+ "zoom": {
444
+ "alias": "zoom";
445
+ "required": false;
446
+ "isSignal": true;
447
+ };
448
+ "minZoom": {
449
+ "alias": "minZoom";
450
+ "required": false;
451
+ "isSignal": true;
452
+ };
453
+ "maxZoom": {
454
+ "alias": "maxZoom";
455
+ "required": false;
456
+ "isSignal": true;
457
+ };
458
+ "zoomInLabel": {
459
+ "alias": "zoomInLabel";
460
+ "required": false;
461
+ "isSignal": true;
462
+ };
463
+ "zoomOutLabel": {
464
+ "alias": "zoomOutLabel";
465
+ "required": false;
466
+ "isSignal": true;
467
+ };
468
+ "fitLabel": {
469
+ "alias": "fitLabel";
470
+ "required": false;
471
+ "isSignal": true;
472
+ };
234
473
  }, {
474
+ "zoom": "zoomChange";
235
475
  "layoutError": "layoutError";
236
476
  }, ["nodeTemplate"], never, true, never>;
237
477
  }
238
- /**
239
- * @license
240
- *
241
- * Use of this source code is governed by an MIT-style license that can be
242
- * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
243
- */
244
- /** A point in graph space: origin top-left, y grows downward. */
245
- interface WrGraphPoint {
246
- readonly x: number;
247
- readonly y: number;
248
- }
249
- /**
250
- * What a layout reads about a node: resolved, plain and serialisable. The
251
- * consumer's `data` never reaches a layout, and neither does the DOM — sizes
252
- * arrive as finite numbers the component already resolved.
253
- */
254
- interface WrGraphLayoutNode {
255
- readonly id: string;
256
- readonly width: number;
257
- readonly height: number;
258
- }
259
- /** A layout edge. `from` is the parent, `to` the child; `id` is unique per edge. */
260
- interface WrGraphLayoutEdge {
261
- readonly id: string;
262
- readonly from: string;
263
- readonly to: string;
264
- }
265
- /**
266
- * The whole graph a layout works on. Input order IS the tie-break order, so the
267
- * same arrays always produce the same picture. Parallel edges and self-loops
268
- * are legal here; an edge naming a missing node is dropped silently, because
269
- * the component has already warned about it.
270
- */
271
- interface WrGraphLayoutInput {
272
- readonly nodes: readonly WrGraphLayoutNode[];
273
- readonly edges: readonly WrGraphLayoutEdge[];
274
- }
275
- /**
276
- * Per-call context. An object from day one so later fields are additive. The
277
- * signal aborts when the input changes, or the graph is destroyed, before an
278
- * asynchronous layout settles. An engine that cannot stop its work can leave it
279
- * running: the graph drops the late result.
280
- */
281
- interface WrGraphLayoutContext {
282
- readonly signal: AbortSignal;
283
- }
284
- /** Where a node goes: its TOP-LEFT corner in graph space, which maps straight onto a CSS translate. */
285
- interface WrGraphNodePlacement {
286
- readonly id: string;
287
- readonly x: number;
288
- readonly y: number;
289
- }
290
- /** The polyline of one edge, from the `from` end to the `to` end — at least two points. */
291
- interface WrGraphEdgeRoute {
292
- readonly id: string;
293
- readonly points: readonly WrGraphPoint[];
294
- }
295
- /**
296
- * A finished layout. The bounding box starts at (0, 0) and measures
297
- * `width` × `height`. Direction-free: RTL is applied after the layout, so these
298
- * numbers never depend on `dir`.
299
- */
300
- interface WrGraphLayoutResult {
301
- readonly nodes: readonly WrGraphNodePlacement[];
302
- readonly edges: readonly WrGraphEdgeRoute[];
303
- readonly width: number;
304
- readonly height: number;
305
- }
306
- /**
307
- * The seam a layout engine plugs into. Used as both the type and the DI token,
308
- * the way `WrDateAdapter` is.
309
- *
310
- * A synchronous result is drawn in the same pass. A Promise is for an engine
311
- * that works in a worker or on a server: the graph keeps its last picture until
312
- * the Promise resolves, and reports a rejection through `layoutError`.
313
- *
314
- * @example
315
- * ```ts
316
- * providers: [{ provide: WrGraphLayout, useClass: WorkerLayout }]
317
- * ```
318
- */
319
- export declare abstract class WrGraphLayout {
320
- abstract layout(input: WrGraphLayoutInput, context: WrGraphLayoutContext): WrGraphLayoutResult | Promise<WrGraphLayoutResult>;
321
- }
322
478
  /** Options for {@link WrLayeredGraphLayout}. Spacing lives here, not on the component: the names are engine-specific. */
323
479
  interface WrLayeredGraphLayoutOptions {
324
480
  /** Horizontal gap between two nodes in one layer. Default `24`. */
@@ -532,10 +532,16 @@ export declare class WrSelect<T = unknown> implements FormValueControl<T | reado
532
532
  readonly retryable: import("@angular/core").InputSignalWithTransform<boolean, any>;
533
533
  /** Search mode: label of the retry action on the error row. Falls back to `select.retry`. */
534
534
  readonly retryText: import("@angular/core").InputSignal<string | null>;
535
+ /**
536
+ * Search mode: what a screen reader hears once a search has settled on some
537
+ * options. `{{count}}` is their number. Falls back to `select.results`.
538
+ */
539
+ readonly resultsText: import("@angular/core").InputSignal<string | null>;
535
540
  protected readonly resolvedNoResults: import("@angular/core").Signal<string>;
536
541
  protected readonly resolvedLoading: import("@angular/core").Signal<string>;
537
542
  protected readonly resolvedLoadError: import("@angular/core").Signal<string>;
538
543
  protected readonly resolvedRetry: import("@angular/core").Signal<string>;
544
+ private readonly resultsFormat;
539
545
  /**
540
546
  * Debounced search query, gated to searchable selects. Emits on every settled
541
547
  * change — including the empty string when the field is cleared — so a
@@ -924,6 +930,26 @@ export declare class WrSelect<T = unknown> implements FormValueControl<T | reado
924
930
  protected readonly meetsMinChars: import("@angular/core").Signal<boolean>;
925
931
  /** Search mode: show "no results" when the panel has nothing to offer. */
926
932
  protected readonly hasNoResults: import("@angular/core").Signal<boolean>;
933
+ /**
934
+ * Search mode: what the open panel has to say to someone who cannot see it.
935
+ * The loading, error and "no results" rows are text in a listbox, which a
936
+ * screen reader does not read unless the user walks there, and a count is
937
+ * nowhere on screen at all.
938
+ */
939
+ private readonly searchStatus;
940
+ /** Text of the one live region. Written {@link ANNOUNCE_DELAY} ms after the status last changed. */
941
+ protected readonly announcement: import("@angular/core").WritableSignal<string>;
942
+ /** The status last said, or taken as said when the panel opened: the same one is not said twice. */
943
+ private announced;
944
+ private announceTimer;
945
+ /**
946
+ * Says the search status once it has stood still. Every keystroke of a client
947
+ * filter moves the count and every debounced load passes through "Loading", so
948
+ * each change restarts the wait and only what the typing settles on is read. A
949
+ * panel that opens on its full list says nothing: the count is news once a
950
+ * query has changed it.
951
+ */
952
+ private announceStatus;
927
953
  /** Search mode: the error row, in place of "no results", after a failed load and through its retry. */
928
954
  protected readonly showLoadError: import("@angular/core").Signal<boolean>;
929
955
  /** A `<ng-template wrSelectLoadError>` declared as a direct child, or `undefined`. */
@@ -1142,6 +1168,12 @@ export declare class WrSelect<T = unknown> implements FormValueControl<T | reado
1142
1168
  */
1143
1169
  private reseedOnAttach;
1144
1170
  private seedActiveIndex;
1171
+ private readonly liveLocale;
1172
+ private readonly typeahead;
1173
+ /** A letter opened the panel: the match is found once its rows are there. */
1174
+ private typeaheadPending;
1175
+ /** Move the cursor to the option the typed letters point at. */
1176
+ private applyTypeahead;
1145
1177
  private moveActive;
1146
1178
  /**
1147
1179
  * Both scan `orderedRegistry`, and that is not interchangeable with
@@ -1297,6 +1329,11 @@ export declare class WrSelect<T = unknown> implements FormValueControl<T | reado
1297
1329
  "required": false;
1298
1330
  "isSignal": true;
1299
1331
  };
1332
+ "resultsText": {
1333
+ "alias": "resultsText";
1334
+ "required": false;
1335
+ "isSignal": true;
1336
+ };
1300
1337
  "loading": {
1301
1338
  "alias": "loading";
1302
1339
  "required": false;
@@ -10,6 +10,8 @@ interface WrTableHarnessFilters extends BaseHarnessFilters {
10
10
  /** Match only hierarchies (`true` — a `treegrid`) or only flat tables (`false`). */
11
11
  readonly tree?: boolean;
12
12
  }
13
+ /** Narrows which `<wr-table-column-chooser>` a harness query matches. */
14
+ type WrTableColumnChooserHarnessFilters = BaseHarnessFilters;
13
15
  /** Narrows which body row a harness query matches. */
14
16
  interface WrTableRowHarnessFilters extends BaseHarnessFilters {
15
17
  /** Match a row where ANY data cell's text matches. A string is exact, a RegExp is tested. */
@@ -86,6 +88,48 @@ export declare class WrTableCellHarness extends ContentContainerComponentHarness
86
88
  /** Which edge the cell's column is frozen against, or `null` when it scrolls. */
87
89
  getPin(): Promise<'left' | 'right' | null>;
88
90
  }
91
+ /**
92
+ * Test harness for `<wr-table-column-chooser>`, the column list of a table.
93
+ *
94
+ * Columns are addressed by their TITLE, as everywhere in this harness family.
95
+ * A chooser inside a popover or a dropdown lives in the overlay container:
96
+ * open the menu, then query it from `TestbedHarnessEnvironment.documentRootLoader`.
97
+ * The one in the table's own `columnChooser` panel comes from
98
+ * `WrTableHarness.getColumnChooser()`.
99
+ *
100
+ * @see https://ngwr.dev/guides/testing
101
+ */
102
+ export declare class WrTableColumnChooserHarness extends ComponentHarness {
103
+ static hostSelector: string;
104
+ /** Build a predicate that narrows the query. */
105
+ static with(options?: WrTableColumnChooserHarnessFilters): HarnessPredicate<WrTableColumnChooserHarness>;
106
+ private readonly items;
107
+ private readonly boxes;
108
+ private readonly allBox;
109
+ /** The title of every column listed, in column order, hidden ones included. */
110
+ getColumns(): Promise<string[]>;
111
+ /** Whether the column is shown: its checkbox is checked. */
112
+ isChecked(title: string): Promise<boolean>;
113
+ /** Whether the list refuses to hide the column: `hideable: false`, or the last one shown. */
114
+ isLocked(title: string): Promise<boolean>;
115
+ /** Hide a shown column or show a hidden one. Throws on a locked column. */
116
+ toggle(title: string): Promise<void>;
117
+ /**
118
+ * Press the "Show all" row: it shows every column while one is hidden, and
119
+ * hides every column that can be hidden once all are shown.
120
+ */
121
+ showAll(): Promise<void>;
122
+ /**
123
+ * What the "Show all" row reports: `'all'` (checked) when no hideable column
124
+ * is hidden, `'none'` (unchecked) when every one is, `'some'` (mixed) between.
125
+ */
126
+ getShowAllState(): Promise<'all' | 'some' | 'none'>;
127
+ /** The text of the "Show all" row. */
128
+ getShowAllText(): Promise<string>;
129
+ private showAllBox;
130
+ private entries;
131
+ private entryFor;
132
+ }
89
133
  /**
90
134
  * Test harness for one column header of a `<wr-table>`.
91
135
  *
@@ -462,6 +506,13 @@ export declare class WrTableHarness extends ComponentHarness {
462
506
  isColumnLocked(columnTitle: string): Promise<boolean>;
463
507
  /** Hide a shown column or show a hidden one through the column chooser, which stays open. */
464
508
  toggleColumn(columnTitle: string): Promise<void>;
509
+ /**
510
+ * The list inside the column chooser's panel, with its "Show all" row. Opens
511
+ * the chooser and leaves it open.
512
+ */
513
+ getColumnChooser(): Promise<WrTableColumnChooserHarness>;
514
+ /** Opens the chooser's panel and answers its id, which the trigger publishes while open. */
515
+ private openChooser;
465
516
  /**
466
517
  * The chooser's rows, opening it first. The panel is a popover in the overlay
467
518
  * container, found through the id its trigger publishes while open.
@@ -481,4 +532,4 @@ export declare class WrTableHarness extends ComponentHarness {
481
532
  /** The select-all input, or a failure naming both reasons it is missing. */
482
533
  private selectAllHost;
483
534
  }
484
- export type { WrTableCellHarnessFilters, WrTableHarnessFilters, WrTableHeaderCellHarnessFilters, WrTableRowHarnessFilters };
535
+ export type { WrTableCellHarnessFilters, WrTableColumnChooserHarnessFilters, WrTableHarnessFilters, WrTableHeaderCellHarnessFilters, WrTableRowHarnessFilters };