ngwr 16.1.0 → 16.2.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 (123) hide show
  1. package/date-picker/styles/_index.scss +89 -1
  2. package/dropdown/styles/_index.scss +37 -1
  3. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  4. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  5. package/fesm2022/ngwr-date-picker.mjs +152 -8
  6. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  7. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
  8. package/fesm2022/ngwr-date-stamp.mjs +73 -9
  9. package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
  10. package/fesm2022/ngwr-date.mjs +86 -5
  11. package/fesm2022/ngwr-date.mjs.map +1 -1
  12. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  13. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  14. package/fesm2022/ngwr-dropdown.mjs +358 -24
  15. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  16. package/fesm2022/ngwr-i18n-ar.mjs +7 -2
  17. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  18. package/fesm2022/ngwr-i18n-cs.mjs +7 -2
  19. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  20. package/fesm2022/ngwr-i18n-de.mjs +7 -2
  21. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  22. package/fesm2022/ngwr-i18n-en.mjs +7 -2
  23. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  24. package/fesm2022/ngwr-i18n-es.mjs +7 -2
  25. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  26. package/fesm2022/ngwr-i18n-fr.mjs +7 -2
  27. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-he.mjs +7 -2
  29. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-hi.mjs +7 -2
  31. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-id.mjs +7 -2
  33. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-it.mjs +7 -2
  35. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-ja.mjs +7 -2
  37. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-ko.mjs +7 -2
  39. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-nl.mjs +7 -2
  41. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-pl.mjs +7 -2
  43. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-pt.mjs +7 -2
  45. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-ru.mjs +7 -2
  47. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-sv.mjs +7 -2
  49. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-tr.mjs +7 -2
  51. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-uk.mjs +7 -2
  53. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-vi.mjs +7 -2
  55. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-zh-tw.mjs +7 -2
  57. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-zh.mjs +7 -2
  59. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  60. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  61. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  62. package/fesm2022/ngwr-lightbox.mjs +246 -10
  63. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  64. package/fesm2022/ngwr-pipes.mjs +28 -6
  65. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  66. package/fesm2022/ngwr-schema-form.mjs +3 -0
  67. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  68. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  69. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  70. package/fesm2022/ngwr-slider.mjs +87 -11
  71. package/fesm2022/ngwr-slider.mjs.map +1 -1
  72. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  73. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  74. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  75. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  76. package/fesm2022/ngwr-version.mjs +1 -1
  77. package/fesm2022/ngwr-version.mjs.map +1 -1
  78. package/i18n/ar.json +7 -2
  79. package/i18n/cs.json +7 -2
  80. package/i18n/de.json +7 -2
  81. package/i18n/en.json +7 -2
  82. package/i18n/es.json +7 -2
  83. package/i18n/fr.json +7 -2
  84. package/i18n/he.json +7 -2
  85. package/i18n/hi.json +7 -2
  86. package/i18n/id.json +7 -2
  87. package/i18n/it.json +7 -2
  88. package/i18n/ja.json +7 -2
  89. package/i18n/ko.json +7 -2
  90. package/i18n/nl.json +7 -2
  91. package/i18n/pl.json +7 -2
  92. package/i18n/pt.json +7 -2
  93. package/i18n/ru.json +7 -2
  94. package/i18n/sv.json +7 -2
  95. package/i18n/tr.json +7 -2
  96. package/i18n/uk.json +7 -2
  97. package/i18n/vi.json +7 -2
  98. package/i18n/zh-TW.json +7 -2
  99. package/i18n/zh.json +7 -2
  100. package/lightbox/styles/_rules.scss +96 -0
  101. package/llms-full.txt +12 -8
  102. package/llms.txt +12 -0
  103. package/package.json +5 -1
  104. package/schematics/use/symbol-map.json +1 -0
  105. package/skills/ngwr/SKILL.md +1 -1
  106. package/skills/ngwr/references/catalog.md +2 -1
  107. package/slider/styles/_index.scss +106 -0
  108. package/sortable-list/styles/_rules.scss +23 -1
  109. package/types/ngwr-date-picker-testing.d.ts +17 -0
  110. package/types/ngwr-date-picker.d.ts +79 -2
  111. package/types/ngwr-date-stamp-testing.d.ts +1 -1
  112. package/types/ngwr-date-stamp.d.ts +53 -7
  113. package/types/ngwr-date.d.ts +118 -15
  114. package/types/ngwr-dropdown-testing.d.ts +53 -5
  115. package/types/ngwr-dropdown.d.ts +100 -0
  116. package/types/ngwr-lightbox-testing.d.ts +27 -0
  117. package/types/ngwr-lightbox.d.ts +71 -6
  118. package/types/ngwr-pipes.d.ts +33 -13
  119. package/types/ngwr-slider-testing.d.ts +8 -1
  120. package/types/ngwr-slider.d.ts +89 -3
  121. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  122. package/types/ngwr-sortable-list.d.ts +113 -10
  123. package/types/ngwr-version.d.ts +1 -1
@@ -1,7 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ElementRef, Signal } from "@angular/core";
2
+ import { ElementRef, Signal, WritableSignal } from "@angular/core";
3
3
  import * as i1 from "@angular/cdk/drag-drop";
4
- import { CdkDragDrop } from "@angular/cdk/drag-drop";
5
4
  /**
6
5
  * Contract a `<wr-sortable-item>` uses to talk to its parent list.
7
6
  *
@@ -59,6 +58,27 @@ interface WrSortableReorderEvent<T> {
59
58
  /** Convenience handle for the dropped item. */
60
59
  readonly item: T;
61
60
  }
61
+ /** One end of a move between connected lists: the list and the index in it. */
62
+ interface WrSortableMoveEnd<T> {
63
+ /** The list. Tell it apart by its `id` input, or by comparing the instance. */
64
+ readonly list: WrSortableList<T>;
65
+ /** Index in that list's `items`. */
66
+ readonly index: number;
67
+ }
68
+ /** Payload emitted by the TARGET list when an item arrives from another list of its group. */
69
+ interface WrSortableMoveEvent<T> {
70
+ /** The item that moved. */
71
+ readonly item: T;
72
+ /** Where it left. */
73
+ readonly from: WrSortableMoveEnd<T>;
74
+ /** Where it landed. */
75
+ readonly to: WrSortableMoveEnd<T>;
76
+ }
77
+ /**
78
+ * Decides whether a list takes an item from another list of its group.
79
+ * `from` is the list the gesture started in.
80
+ */
81
+ type WrSortableCanEnter<T> = (item: T, from: WrSortableList<T>) => boolean;
62
82
  /**
63
83
  * Drag-to-reorder list. Wraps CDK's `cdkDropList` + `cdkDrag` with a
64
84
  * signal-based items binding — the source array is updated in place and
@@ -87,6 +107,13 @@ interface WrSortableReorderEvent<T> {
87
107
  * click would be picking itself straight back up. A visible move-up /
88
108
  * move-down affordance is the remaining answer, and that is a design change.
89
109
  *
110
+ * Lists that share a `group` exchange items, by drag and by keyboard. The
111
+ * target list emits `move` once, and both lists write `[(items)]`; `reorder`
112
+ * stays for a move inside one list. Lists find each other through a root
113
+ * registry and are handed to `cdkDropListConnectedTo`, not through
114
+ * `cdkDropListGroup`, which needs a common ancestor directive and so cannot
115
+ * join lists that live in separate components.
116
+ *
90
117
  * @example
91
118
  * ```html
92
119
  * <wr-sortable-list [(items)]="rows" (reorder)="onReorder($event)">
@@ -122,11 +149,42 @@ export declare class WrSortableList<T = unknown> implements WrSortableListContex
122
149
  touch: number;
123
150
  mouse: number;
124
151
  }>;
125
- /** Fired after a successful reorder with the new array + indices. */
152
+ /**
153
+ * Name of the group this list belongs to. Lists with the same group exchange
154
+ * items, wherever they sit in the page. @default null
155
+ */
156
+ readonly group: import("@angular/core").InputSignal<string | null>;
157
+ /**
158
+ * Refuses an item coming from another list of the group, by drag and by
159
+ * keyboard alike. An item can always return to the list it left.
160
+ * @default null
161
+ */
162
+ readonly canEnter: import("@angular/core").InputSignal<WrSortableCanEnter<T> | null>;
163
+ /**
164
+ * Accessible name of the list. A keyboard move into this list announces it;
165
+ * without one the announcement falls back to the list's position in the group.
166
+ * @default null
167
+ */
168
+ readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
169
+ /** The host's `id`, and what tells the lists of a `move` apart. Generated when omitted. */
170
+ readonly id: import("@angular/core").InputSignal<string | undefined>;
171
+ /** Fired after a successful reorder with the new array + indices. Not fired for a move between lists. */
126
172
  readonly reorder: import("@angular/core").OutputEmitterRef<WrSortableReorderEvent<T>>;
173
+ /**
174
+ * Fired once on the list an item ARRIVED in from another list of the group,
175
+ * after both lists have written `items`. The list it left emits nothing but
176
+ * `itemsChange`.
177
+ */
178
+ readonly move: import("@angular/core").OutputEmitterRef<WrSortableMoveEvent<T>>;
127
179
  private readonly injector;
180
+ private readonly host;
181
+ private readonly dropList;
182
+ private readonly lists;
183
+ private readonly listEl;
184
+ /** The other lists of this list's group. */
185
+ private readonly peers;
128
186
  /**
129
- * Ambient reading direction, for the horizontal keyboard path only.
187
+ * Ambient reading direction, for the keyboard path.
130
188
  *
131
189
  * Optional so a bare `TestBed` — or any consumer that never set a direction —
132
190
  * needs no provider; `Directionality` is root-provided, so `null` only ever
@@ -152,21 +210,28 @@ export declare class WrSortableList<T = unknown> implements WrSortableListContex
152
210
  */
153
211
  private readonly rows;
154
212
  /** Index of the row the keyboard is holding, or `null` when nothing is held. */
155
- readonly grabbedIndex: import("@angular/core").WritableSignal<number | null>;
213
+ readonly grabbedIndex: WritableSignal<number | null>;
156
214
  /** Live-region text. Written by the keyboard path only. */
157
- protected readonly announcement: import("@angular/core").WritableSignal<string>;
215
+ protected readonly announcement: WritableSignal<string>;
216
+ private readonly uid;
158
217
  /** Links every row to the key model via `aria-describedby`. */
159
218
  readonly keyHelpId: string;
219
+ protected readonly fallbackId: string;
220
+ private readonly keyHelp;
221
+ private readonly groupKeyHelp;
160
222
  protected readonly resolvedKeyHelp: import("@angular/core").Signal<string>;
161
223
  private readonly grabbedText;
162
224
  private readonly movedText;
163
225
  private readonly droppedText;
164
226
  private readonly cancelledText;
165
- /** Where the held row started. Escape puts it back there. */
227
+ private readonly movedToText;
228
+ private readonly listPositionText;
229
+ /** Where the held row started, which can be another list. Escape puts it back there. */
166
230
  private grabOrigin;
167
231
  /** True while a keyboard move is handing focus back — see `onRowFocusout`. */
168
232
  private restoringFocus;
169
- protected onDrop(event: CdkDragDrop<T[]>): void;
233
+ constructor();
234
+ private onDrop;
170
235
  /**
171
236
  * The keyboard reorder path: pick up, move, drop — deliberately a two-step
172
237
  * grab rather than "an arrow moves the focused row", so that arrowing through
@@ -213,9 +278,22 @@ export declare class WrSortableList<T = unknown> implements WrSortableListContex
213
278
  onRowFocusout(): void;
214
279
  private grab;
215
280
  private moveGrabbed;
281
+ /**
282
+ * Hands the held row to the nearest list of the group, in document order,
283
+ * that takes it. A list that refuses is stepped over, since a drag can reach
284
+ * any list of the group and the keyboard must not reach fewer.
285
+ */
286
+ private moveToList;
216
287
  private drop;
217
288
  private cancelGrab;
289
+ /** Whether this list takes `item` from another list of the group. */
290
+ private accepts;
291
+ /** This list and its peers, in document order. */
292
+ private groupLists;
293
+ private removeAt;
294
+ private insertAt;
218
295
  private relocate;
296
+ private focusRow;
219
297
  private position;
220
298
  static ɵfac: i0.ɵɵFactoryDeclaration<WrSortableList<any>, never>;
221
299
  static ɵcmp: i0.ɵɵComponentDeclaration<WrSortableList<any>, "wr-sortable-list", never, {
@@ -244,10 +322,35 @@ export declare class WrSortableList<T = unknown> implements WrSortableListContex
244
322
  "required": false;
245
323
  "isSignal": true;
246
324
  };
325
+ "group": {
326
+ "alias": "group";
327
+ "required": false;
328
+ "isSignal": true;
329
+ };
330
+ "canEnter": {
331
+ "alias": "canEnter";
332
+ "required": false;
333
+ "isSignal": true;
334
+ };
335
+ "ariaLabel": {
336
+ "alias": "ariaLabel";
337
+ "required": false;
338
+ "isSignal": true;
339
+ };
340
+ "id": {
341
+ "alias": "id";
342
+ "required": false;
343
+ "isSignal": true;
344
+ };
247
345
  }, {
248
346
  "items": "itemsChange";
249
347
  "reorder": "reorder";
250
- }, never, ["*"], true, never>;
348
+ "move": "move";
349
+ }, never, ["*", "[wrSortableListEmpty]"], true, [{
350
+ directive: typeof i1.CdkDropList;
351
+ inputs: {};
352
+ outputs: {};
353
+ }]>;
251
354
  }
252
355
  /**
253
356
  * One row of a {@link WrSortableList}. Write the loop yourself and put whatever
@@ -340,4 +443,4 @@ export declare class WrDragHandle {
340
443
  outputs: {};
341
444
  }]>;
342
445
  }
343
- export type { WrSortableReorderEvent };
446
+ export type { WrSortableCanEnter, WrSortableMoveEnd, WrSortableMoveEvent, WrSortableReorderEvent };
@@ -15,7 +15,7 @@ import { InjectionToken } from "@angular/core";
15
15
  * Distinct from `Version` exported by `@angular/core`, which reports the
16
16
  * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.
17
17
  */
18
- export declare const NGWR_VERSION = "16.1.0";
18
+ export declare const NGWR_VERSION = "16.2.0";
19
19
  /**
20
20
  * Injection token holding the ngwr library version string.
21
21
  *