forty-cdk 0.41.1 → 0.43.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 (203) hide show
  1. package/button/README.md +5 -5
  2. package/calendar/README.md +33 -29
  3. package/carousel/README.md +9 -7
  4. package/checkbox/README.md +9 -9
  5. package/combobox/README.md +30 -20
  6. package/context-menu/README.md +1 -1
  7. package/date-adapter/README.md +1 -1
  8. package/date-field/README.md +3 -2
  9. package/date-picker/README.md +8 -8
  10. package/dialog/README.md +5 -4
  11. package/drag-drop/README.md +67 -22
  12. package/drawer/README.md +46 -43
  13. package/dropdown-menu/README.md +1 -1
  14. package/fesm2022/forty-cdk-accordion.mjs +16 -15
  15. package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
  16. package/fesm2022/forty-cdk-aspect-ratio.mjs +3 -3
  17. package/fesm2022/forty-cdk-avatar.mjs +9 -9
  18. package/fesm2022/forty-cdk-breadcrumbs.mjs +9 -9
  19. package/fesm2022/forty-cdk-button.mjs +12 -16
  20. package/fesm2022/forty-cdk-button.mjs.map +1 -1
  21. package/fesm2022/forty-cdk-calendar.mjs +118 -72
  22. package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
  23. package/fesm2022/forty-cdk-carousel.mjs +48 -37
  24. package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
  25. package/fesm2022/forty-cdk-checkbox.mjs +9 -7
  26. package/fesm2022/forty-cdk-checkbox.mjs.map +1 -1
  27. package/fesm2022/forty-cdk-combobox.mjs +113 -87
  28. package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
  29. package/fesm2022/forty-cdk-context-menu.mjs +11 -9
  30. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
  31. package/fesm2022/forty-cdk-core-anchored.mjs +275 -145
  32. package/fesm2022/forty-cdk-core-anchored.mjs.map +1 -1
  33. package/fesm2022/forty-cdk-core-overlay.mjs +90 -41
  34. package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
  35. package/fesm2022/forty-cdk-core.mjs +775 -197
  36. package/fesm2022/forty-cdk-core.mjs.map +1 -1
  37. package/fesm2022/forty-cdk-date-adapter.mjs +7 -4
  38. package/fesm2022/forty-cdk-date-adapter.mjs.map +1 -1
  39. package/fesm2022/forty-cdk-date-field.mjs +55 -43
  40. package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
  41. package/fesm2022/forty-cdk-date-picker.mjs +75 -59
  42. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
  43. package/fesm2022/forty-cdk-defaults.mjs +12 -10
  44. package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
  45. package/fesm2022/forty-cdk-dialog.mjs +42 -38
  46. package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
  47. package/fesm2022/forty-cdk-disclosure.mjs +9 -9
  48. package/fesm2022/forty-cdk-drag-drop.mjs +111 -96
  49. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
  50. package/fesm2022/forty-cdk-drawer.mjs +122 -66
  51. package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
  52. package/fesm2022/forty-cdk-dropdown-menu.mjs +11 -9
  53. package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -1
  54. package/fesm2022/forty-cdk-field.mjs +23 -22
  55. package/fesm2022/forty-cdk-field.mjs.map +1 -1
  56. package/fesm2022/forty-cdk-fieldset.mjs +6 -6
  57. package/fesm2022/forty-cdk-file-upload.mjs +9 -9
  58. package/fesm2022/forty-cdk-hover-card.mjs +59 -22
  59. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
  60. package/fesm2022/forty-cdk-input.mjs +6 -10
  61. package/fesm2022/forty-cdk-input.mjs.map +1 -1
  62. package/fesm2022/forty-cdk-internationalized-date.mjs +6 -6
  63. package/fesm2022/forty-cdk-listbox.mjs +162 -81
  64. package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
  65. package/fesm2022/forty-cdk-menu.mjs +142 -79
  66. package/fesm2022/forty-cdk-menu.mjs.map +1 -1
  67. package/fesm2022/forty-cdk-menubar.mjs +51 -36
  68. package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-meter.mjs +15 -12
  70. package/fesm2022/forty-cdk-meter.mjs.map +1 -1
  71. package/fesm2022/forty-cdk-navigation-menu.mjs +29 -28
  72. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
  73. package/fesm2022/forty-cdk-number-input.mjs +14 -15
  74. package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
  75. package/fesm2022/forty-cdk-otp-input.mjs +12 -8
  76. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
  77. package/fesm2022/forty-cdk-pagination.mjs +16 -15
  78. package/fesm2022/forty-cdk-pagination.mjs.map +1 -1
  79. package/fesm2022/forty-cdk-pane-resizer.mjs +8 -7
  80. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -1
  81. package/fesm2022/forty-cdk-popover.mjs +37 -40
  82. package/fesm2022/forty-cdk-popover.mjs.map +1 -1
  83. package/fesm2022/forty-cdk-progress.mjs +7 -7
  84. package/fesm2022/forty-cdk-progress.mjs.map +1 -1
  85. package/fesm2022/forty-cdk-radio-group.mjs +46 -17
  86. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
  87. package/fesm2022/forty-cdk-scroll-area.mjs +70 -46
  88. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
  89. package/fesm2022/forty-cdk-search.mjs +9 -11
  90. package/fesm2022/forty-cdk-search.mjs.map +1 -1
  91. package/fesm2022/forty-cdk-select.mjs +134 -114
  92. package/fesm2022/forty-cdk-select.mjs.map +1 -1
  93. package/fesm2022/forty-cdk-separator.mjs +3 -3
  94. package/fesm2022/forty-cdk-slider.mjs +28 -22
  95. package/fesm2022/forty-cdk-slider.mjs.map +1 -1
  96. package/fesm2022/forty-cdk-stepper.mjs +97 -63
  97. package/fesm2022/forty-cdk-stepper.mjs.map +1 -1
  98. package/fesm2022/forty-cdk-switch.mjs +6 -4
  99. package/fesm2022/forty-cdk-switch.mjs.map +1 -1
  100. package/fesm2022/forty-cdk-table-virtualization.mjs +79 -10
  101. package/fesm2022/forty-cdk-table-virtualization.mjs.map +1 -1
  102. package/fesm2022/forty-cdk-table.mjs +197 -149
  103. package/fesm2022/forty-cdk-table.mjs.map +1 -1
  104. package/fesm2022/forty-cdk-tabs.mjs +21 -16
  105. package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
  106. package/fesm2022/forty-cdk-testing.mjs +1 -0
  107. package/fesm2022/forty-cdk-testing.mjs.map +1 -1
  108. package/fesm2022/forty-cdk-time-field.mjs +55 -43
  109. package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
  110. package/fesm2022/forty-cdk-time-picker.mjs +116 -71
  111. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
  112. package/fesm2022/forty-cdk-toast.mjs +64 -34
  113. package/fesm2022/forty-cdk-toast.mjs.map +1 -1
  114. package/fesm2022/forty-cdk-toggle.mjs +50 -21
  115. package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
  116. package/fesm2022/forty-cdk-toolbar.mjs +46 -51
  117. package/fesm2022/forty-cdk-toolbar.mjs.map +1 -1
  118. package/fesm2022/forty-cdk-tooltip.mjs +70 -30
  119. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
  120. package/fesm2022/forty-cdk-tree.mjs +339 -138
  121. package/fesm2022/forty-cdk-tree.mjs.map +1 -1
  122. package/fesm2022/forty-cdk-virtual-reorder.mjs +78 -64
  123. package/fesm2022/forty-cdk-virtual-reorder.mjs.map +1 -1
  124. package/fesm2022/forty-cdk-virtualization.mjs +55 -14
  125. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  126. package/field/README.md +6 -13
  127. package/hover-card/README.md +2 -0
  128. package/input/README.md +28 -27
  129. package/listbox/README.md +46 -41
  130. package/menu/README.md +24 -22
  131. package/menubar/README.md +19 -19
  132. package/meter/README.md +11 -11
  133. package/number-input/README.md +6 -5
  134. package/otp-input/README.md +8 -7
  135. package/package.json +1 -1
  136. package/pagination/README.md +9 -9
  137. package/progress/README.md +2 -2
  138. package/radio-group/README.md +13 -12
  139. package/scroll-area/README.md +8 -3
  140. package/search/README.md +7 -5
  141. package/select/README.md +11 -11
  142. package/slider/README.md +3 -1
  143. package/stepper/README.md +11 -7
  144. package/switch/README.md +11 -11
  145. package/table/README.md +34 -34
  146. package/tabs/README.md +2 -2
  147. package/time-field/README.md +3 -2
  148. package/time-picker/README.md +49 -46
  149. package/toast/README.md +29 -11
  150. package/toggle/README.md +34 -33
  151. package/toolbar/README.md +5 -5
  152. package/tooltip/README.md +1 -0
  153. package/tree/README.md +59 -40
  154. package/types/forty-cdk-accordion.d.ts +6 -35
  155. package/types/forty-cdk-avatar.d.ts +0 -37
  156. package/types/forty-cdk-button.d.ts +4 -2
  157. package/types/forty-cdk-calendar.d.ts +39 -60
  158. package/types/forty-cdk-carousel.d.ts +11 -82
  159. package/types/forty-cdk-combobox.d.ts +28 -391
  160. package/types/forty-cdk-context-menu.d.ts +12 -40
  161. package/types/forty-cdk-core-anchored.d.ts +233 -247
  162. package/types/forty-cdk-core-overlay.d.ts +40 -40
  163. package/types/forty-cdk-core.d.ts +745 -586
  164. package/types/forty-cdk-date-adapter.d.ts +5 -0
  165. package/types/forty-cdk-date-field.d.ts +16 -41
  166. package/types/forty-cdk-date-picker.d.ts +35 -70
  167. package/types/forty-cdk-defaults.d.ts +41 -296
  168. package/types/forty-cdk-dialog.d.ts +24 -22
  169. package/types/forty-cdk-disclosure.d.ts +0 -5
  170. package/types/forty-cdk-drag-drop.d.ts +20 -24
  171. package/types/forty-cdk-drawer.d.ts +53 -52
  172. package/types/forty-cdk-dropdown-menu.d.ts +14 -10
  173. package/types/forty-cdk-field.d.ts +9 -9
  174. package/types/forty-cdk-file-upload.d.ts +0 -5
  175. package/types/forty-cdk-hover-card.d.ts +14 -50
  176. package/types/forty-cdk-listbox.d.ts +70 -171
  177. package/types/forty-cdk-menu.d.ts +55 -21
  178. package/types/forty-cdk-menubar.d.ts +21 -13
  179. package/types/forty-cdk-meter.d.ts +12 -14
  180. package/types/forty-cdk-navigation-menu.d.ts +10 -104
  181. package/types/forty-cdk-otp-input.d.ts +4 -18
  182. package/types/forty-cdk-pagination.d.ts +6 -24
  183. package/types/forty-cdk-pane-resizer.d.ts +6 -5
  184. package/types/forty-cdk-popover.d.ts +9 -45
  185. package/types/forty-cdk-progress.d.ts +3 -8
  186. package/types/forty-cdk-radio-group.d.ts +24 -36
  187. package/types/forty-cdk-scroll-area.d.ts +21 -44
  188. package/types/forty-cdk-select.d.ts +48 -375
  189. package/types/forty-cdk-slider.d.ts +16 -17
  190. package/types/forty-cdk-stepper.d.ts +29 -50
  191. package/types/forty-cdk-table.d.ts +22 -339
  192. package/types/forty-cdk-tabs.d.ts +6 -42
  193. package/types/forty-cdk-time-field.d.ts +16 -41
  194. package/types/forty-cdk-time-picker.d.ts +21 -113
  195. package/types/forty-cdk-toast.d.ts +10 -127
  196. package/types/forty-cdk-toggle.d.ts +16 -3
  197. package/types/forty-cdk-toolbar.d.ts +10 -11
  198. package/types/forty-cdk-tooltip.d.ts +19 -31
  199. package/types/forty-cdk-tree.d.ts +62 -267
  200. package/types/forty-cdk-virtual-reorder.d.ts +9 -5
  201. package/types/forty-cdk-virtualization.d.ts +11 -33
  202. package/virtual-reorder/README.md +9 -2
  203. package/virtualization/README.md +21 -19
@@ -169,14 +169,26 @@ unchecks the item's own and no cloned media plays or frame reloads.
169
169
  | Idle | Arrow keys | Move roving focus between items |
170
170
  | Idle | Home / End | Jump to first / last item |
171
171
  | Idle | Space/Enter | **Lift** the focused item |
172
- | Lifted | Arrow keys | Step the logical drop position |
172
+ | Lifted | Arrow keys | Step the logical drop position, across connected lists |
173
173
  | Lifted | Home / End | Jump the lifted item to the first / last position |
174
174
  | Lifted | Space/Enter | **Drop** (commits, emits `(dragDrop)`, focus follows the item) |
175
175
  | Lifted | Escape | **Cancel** (no event, focus stays on item) |
176
176
 
177
+ Removing the focused item outside a drop moves focus to the item that takes over the Tab stop, the one
178
+ before it or else the one after, so focus never falls to `<body>`. A drop keeps the rules of
179
+ [Focus after a keyboard drop](#focus-after-a-keyboard-drop).
180
+
177
181
  Arrow direction follows the list's `orientation` and respects RTL via `dir`. In
178
182
  `orientation="mixed"` every arrow key steps the lifted item linearly in DOM order.
179
183
 
184
+ With connected lists (`[forDropListGroup]` or `[connectedTo]`), the lifted item steps through one
185
+ sequence of positions: every position of the list it was lifted from, then every position of each
186
+ connected list, including the append position past its last item. Connected lists come in
187
+ `[connectedTo]` order, then in the order the group's lists registered. Home and End jump to the two
188
+ ends of that sequence, and a step past either end does nothing and announces nothing. The
189
+ announcement names the list a position belongs to whenever it is not the source list, so a
190
+ transfer never sounds like a reorder.
191
+
180
192
  `[dragDisabled]` and a disabled `[forDropList]` stop a lift from starting, nothing else. A
181
193
  `[dragDisabled]` item still takes the idle arrow and Home / End keys (only a disabled list stops
182
194
  those), and an item that was already lifted when it or its list became disabled keeps every lifted
@@ -186,6 +198,24 @@ key, so Escape always ends the gesture.
186
198
 
187
199
  Keyboard lifting, stepping, dropping, and cancellation are announced via ARIA live regions. Override the default messages at any injector scope via `provideForDragDropDefaults` (see [Scoped defaults](#scoped-defaults)). Free-drag is pointer-only. There is no WAI-ARIA pattern for "reposition an element", so `[forFreeDrag]` owns no role or ARIA state; the consumer is responsible for keeping the moved element fully usable at its default position.
188
200
 
201
+ ### Item names
202
+
203
+ Every lift, move, drop and cancel announcement names the item the way a screen reader would: by
204
+ the text its `aria-labelledby` references, else by its `aria-label`, else by its text with any
205
+ `aria-hidden` content (such as a `[forDragHandle]` glyph) left out and a space between adjacent
206
+ elements. Set `[textValue]` on `[forDraggable]` to name an item in announcements by a string of
207
+ your own; an empty or `null` value falls back to the item's own name. The same name is used by
208
+ `[forVirtualReorder]` and `[forTableRowReorder]`.
209
+
210
+ ```html
211
+ <li forDraggable [dragData]="task" [textValue]="task.title">
212
+ <strong>{{ task.title }}</strong><span>{{ task.due }}</span>
213
+ </li>
214
+ ```
215
+
216
+ A list is named in an announcement by its `aria-labelledby` or `aria-label`, never by its items, so
217
+ label each list of a transfer.
218
+
189
219
  ### Role description
190
220
 
191
221
  Each `[forDraggable]` that can be lifted carries `aria-roledescription`, `"sortable"` by default.
@@ -288,13 +318,20 @@ scrolling, and the item around it leaves touch scrolling alone. Both follow the
288
318
  mounted or removed after the first render moves the `touch-action: none` between the handle and
289
319
  the item, and a disabled item or list drops it from both.
290
320
 
321
+ An item with no handle carries `touch-action: none` itself, so it takes every touch move that
322
+ starts on it. A scroller made only of handle-less items, such as a virtualized list or an
323
+ `overflow: auto` kanban column, therefore cannot be scrolled by touch. Give those items a
324
+ `[forDragHandle]`: the rest of each item then pans the scroller, and the handle starts the drag.
325
+
291
326
  ### Native drag
292
327
 
293
328
  Images, links and selected text are draggable by the browser itself, and its own drag starts
294
329
  before a pointer drag arms. A `[forDraggable]` or `[forFreeDrag]` therefore cancels the native
295
330
  `dragstart` of every press it would turn into a pointer drag, so pressing a thumbnail inside an
296
331
  item reorders the item instead of dragging a copy of the image. Content outside the item's
297
- handles, and every press while the item or its list is disabled, keeps its native drag.
332
+ handles, and every press while the item or its list is disabled, keeps its native drag. The
333
+ same holds for every pointer reorder in the library: `[forTreeNodeDrag]`, `[forListboxReorder]`,
334
+ table row reorder and `[forVirtualReorder]`.
298
335
 
299
336
  ### Nested controls
300
337
 
@@ -452,10 +489,12 @@ always provided by the consumer via CSS; the library imposes none.
452
489
  }
453
490
  ```
454
491
 
455
- With no such CSS, `animateReorder` is a graceful no-op: transforms clear instantly and the
456
- preview is destroyed promptly. Otherwise the preview is destroyed when its `transform` transition
457
- ends, and never before that transition's `transition-delay` plus duration have elapsed, wherever
458
- `transform` sits in a multi-property `transition` list.
492
+ With no such CSS, `animateReorder` is a graceful no-op: `data-drag-animating` clears instantly
493
+ and the preview is destroyed promptly. Otherwise a displaced item keeps `data-drag-animating`, and
494
+ the preview stays mounted, until its own `transform` transition ends, and never before that
495
+ transition's `transition-delay` plus duration have elapsed, wherever `transform` sits in a
496
+ multi-property `transition` list. A transition of another property, or one running on a
497
+ descendant, ends neither.
459
498
 
460
499
  ## Orientation
461
500
 
@@ -612,10 +651,13 @@ onReorder({ from, to }: ForVirtualReorderEvent): void {
612
651
  ```
613
652
 
614
653
  A custom integration that cannot use either companion must supply the same three
615
- mechanisms itself: map window-relative to absolute indices with the reusable
616
- `translateWindowReorder` helper (`forty-cdk/core`), keep the lifted row mounted
617
- for the duration of the drag, and step the keyboard target over the true total
618
- count. Miss any one of the three and the failure is silent: an index that
654
+ mechanisms itself: map window-relative to absolute indices, keep the lifted row
655
+ mounted for the duration of the drag, and step the keyboard target over the true
656
+ total count. The mapping reads the absolute index of every rendered row, in DOM
657
+ order. `previousIndex` is the lifted row's position in that list. `currentIndex`
658
+ is a position in the same list with the lifted row taken out: the target is the
659
+ absolute index found there (one past the last entry when the row lands at the
660
+ end), minus one when it is greater than the lifted row's own. Miss any one of the three and the failure is silent: an index that
619
661
  addresses the wrong row, a lifted row recycled mid-drag, or a keyboard move that
620
662
  stops at the window edge.
621
663
 
@@ -692,20 +734,20 @@ onDrop(event: ForDragDropEvent): void {
692
734
 
693
735
  `provideForDragDropDefaults` configures drag-drop defaults for an injector subtree, either at the application root or in any component's `providers` array. They apply to `[forDropList]` and `[forDraggable]`, and to the reorder coordinators `[forListboxReorder]`, `[forTreeNodeDrag]`, `[forTableRowReorder]` and `[forVirtualReorder]`. Partial overrides inherit unspecified keys from the parent scope (or the library fallbacks at the root).
694
736
 
695
- | Key | Library fallback | Meaning |
696
- | --------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
697
- | `itemRoleDescription` | `'sortable'` | `aria-roledescription` of each item that can be lifted. An empty string drops the attribute. See [Role description](#role-description). |
698
- | `announceLift` | `'<label>, lifted. <index> of <total>.'` | Announcement when an item is lifted. `index` / `total` describe the source list. |
699
- | `announceMove` | `'<label>, moved to position <index> of <total>.'` | Announcement when the drop position changes. `index` / `total` describe the list under that position, which may be a connected list. |
700
- | `announceDrop` | `'<label>, dropped at position <index> of <total>.'` | Announcement on a committed drop. `index` / `total` describe the destination list. |
701
- | `announceCancel` | `'<label>, movement cancelled.'` | Announcement when a drag is cancelled. |
702
- | `autoScrollEdgeSize` | `50` | Distance in px from a scroll edge that arms auto-scroll during a pointer drag. See [Auto-scroll](#auto-scroll). |
703
- | `autoScrollMaxSpeed` | `16` | Maximum scroll distance in px per animation frame while auto-scrolling. |
704
- | `liftKey` | `Shift+Enter`, `Ctrl+Space` or `Cmd+Space` | Whether a keydown on a focused item lifts it into a keyboard reorder in `[forListboxReorder]`, `[forTreeNodeDrag]` and `[forTableRowReorder]` (grid mode). |
737
+ | Key | Library fallback | Meaning |
738
+ | --------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
739
+ | `itemRoleDescription` | `'sortable'` | `aria-roledescription` of each item that can be lifted. An empty string drops the attribute. See [Role description](#role-description). |
740
+ | `announceLift` | `'<label>, lifted. <index> of <total>.'` | Announcement when an item is lifted. `index` / `total` describe the source list. |
741
+ | `announceMove` | `'<label>, moved to position <index> of <total>.'` | Announcement when the drop position changes. `index` / `total` describe the list under that position, which may be a connected list: then the fallback is `'<label>, moved to <list>, position <index> of <total>.'`. |
742
+ | `announceDrop` | `'<label>, dropped at position <index> of <total>.'` | Announcement on a committed drop. `index` / `total` describe the destination list. Into a connected list the fallback is `'<label>, dropped in <list>, position <index> of <total>.'`. |
743
+ | `announceCancel` | `'<label>, movement cancelled.'` | Announcement when a drag is cancelled. |
744
+ | `autoScrollEdgeSize` | `50` | Distance in px from a scroll edge that arms auto-scroll during a pointer drag. See [Auto-scroll](#auto-scroll). |
745
+ | `autoScrollMaxSpeed` | `16` | Maximum scroll distance in px per animation frame while auto-scrolling. |
746
+ | `liftKey` | `Shift+Enter`, `Ctrl+Space` or `Cmd+Space` | Whether a keydown on a focused item lifts it into a keyboard reorder in `[forListboxReorder]`, `[forTreeNodeDrag]` and `[forTableRowReorder]` (grid mode). |
705
747
 
706
748
  `itemRoleDescription` is spoken by a screen reader, so translate it here. It accepts a string or a function returning one; a function can read a language signal, so the text follows a language the app sets or switches after bootstrap, as [Localizing default text](../shared/README.md#localizing-default-text) shows.
707
749
 
708
- The four announcers are builder functions whose return value is spoken through an ARIA live region; return the sentence in your language. `announceLift`, `announceMove` and `announceDrop` receive `(label, index, total)`, and `announceCancel` receives `(label)`. `label` is the dragged item's accessible text and `index` is the 1-based position being announced. `total` is the number of valid drop positions in the list the announcement describes, never a bare item count: the item count for a reorder inside one list, and one more than the target's item count for a transfer into a connected list, because the append gap past the last item is also a valid position. `index` therefore never exceeds `total`, and an empty transfer target announces `1 of 1`.
750
+ The four announcers are builder functions whose return value is spoken through an ARIA live region; return the sentence in your language. `announceLift`, `announceMove` and `announceDrop` receive `(label, index, total, context)`, and `announceCancel` receives `(label)`. `label` is the dragged item's name (see [Item names](#item-names)) and `index` is the 1-based position being announced. `total` is the number of valid drop positions in the list the announcement describes, never a bare item count: the item count for a reorder inside one list, and one more than the target's item count for a transfer into a connected list, because the append gap past the last item is also a valid position. `index` therefore never exceeds `total`, and an empty transfer target announces `1 of 1`. `context` is a `ForDragDropAnnouncementContext`: `list` is the accessible name of that list (`''` when it has no `aria-labelledby` or `aria-label`) and `transfer` is `true` when it is not the list the item was lifted from. The fallbacks name the list only on a transfer, and say "another list" when it has no name. A builder that ignores `context` can leave the parameter out.
709
751
 
710
752
  `liftKey` receives the `KeyboardEvent` and returns `true` when that key should lift the item. Shift+Enter is reserved by no operating system, while macOS and most IMEs claim Ctrl+Space / Cmd+Space before the page sees them. A keydown that belongs to an IME composition never lifts, whatever `liftKey` returns.
711
753
 
@@ -718,7 +760,10 @@ export const appConfig: ApplicationConfig = {
718
760
  provideForDragDropDefaults({
719
761
  itemRoleDescription: 'reordenable',
720
762
  announceLift: (label, index, total) => `${label}, levantado. ${index} de ${total}.`,
721
- announceMove: (label, index, total) => `${label}, movido a la posición ${index} de ${total}.`,
763
+ announceMove: (label, index, total, { list, transfer }) =>
764
+ transfer
765
+ ? `${label}, movido a ${list || 'otra lista'}, posición ${index} de ${total}.`
766
+ : `${label}, movido a la posición ${index} de ${total}.`,
722
767
  announceDrop: (label, index, total) =>
723
768
  `${label}, soltado en la posición ${index} de ${total}.`,
724
769
  announceCancel: (label) => `${label}, movimiento cancelado.`,
package/drawer/README.md CHANGED
@@ -98,11 +98,11 @@ import {
98
98
  ForDrawerDescription,
99
99
  ForDrawerHandle,
100
100
  ForDrawerManager,
101
- ForDrawerRef,
102
101
  ForDrawerTitle,
103
102
  FOR_DRAWER_CONTRACT,
104
103
  type ForDrawerContract,
105
104
  injectDrawerData,
105
+ injectDrawerRef,
106
106
  } from 'forty-cdk/drawer';
107
107
 
108
108
  interface ConfirmData {
@@ -129,14 +129,14 @@ type ConfirmResult = 'confirm' | 'cancel';
129
129
  <div forDrawerHandle aria-hidden="true"></div>
130
130
  <h2 forDrawerTitle>Delete account?</h2>
131
131
  <p forDrawerDescription>{{ data?.message }}</p>
132
- <button forDrawerClose [closeWith]="'cancel'">Cancel</button>
133
- <button forDrawerClose [closeWith]="'confirm'">Confirm</button>
132
+ <button forDrawerClose>Cancel</button>
133
+ <button type="button" (click)="ref.close('confirm')">Confirm</button>
134
134
  `,
135
135
  })
136
136
  class ConfirmDrawer {
137
137
  declare readonly [FOR_DRAWER_CONTRACT]: ForDrawerContract<ConfirmData, ConfirmResult>;
138
138
  readonly data = injectDrawerData<ConfirmDrawer>();
139
- readonly ref = inject(ForDrawerRef<ConfirmResult>);
139
+ readonly ref = injectDrawerRef<ConfirmDrawer>();
140
140
  }
141
141
 
142
142
  @Component({
@@ -160,7 +160,7 @@ class DemoHost {
160
160
  }
161
161
  ```
162
162
 
163
- The `[FOR_DRAWER_CONTRACT]` member states, once, the data a drawer component reads and the result it closes with: `open()` infers both from the component, so a `data` of any other shape fails to compile and the ref is a `ForDrawerRef<ConfirmResult>`, and `injectDrawerData<ConfirmDrawer>()` reads the payload at that type. Declare it with `declare`, no initializer, and keep it public. Without the member `data` is unchecked, the result is `unknown`, and `injectDrawerData<T>()` with a plain type still types the payload as `T`; explicit type arguments override the contract. `injectDrawerData()` returns `null` too, because the manager provides `null` when `open()` is called without `data`, so guard (`data?.message`) before dereferencing the payload. `await ref.closed` resolves `{ reason, result }`, whose `reason` (a `ForDrawerCloseReason`) tells apart an imperative `close()` (`'programmatic'`) from Escape / backdrop / outside / swipe / close-button dismissals.
163
+ The `[FOR_DRAWER_CONTRACT]` member states, once, the data a drawer component reads and the result it closes with: `open()` infers both from the component, so a `data` of any other shape fails to compile and the ref is a `ForDrawerRef<ConfirmResult>`, and `injectDrawerData<ConfirmDrawer>()` reads the payload at that type. Declare the member with `declare`, no initializer, and keep it public. `injectDrawerRef<ConfirmDrawer>()` hands the component its own ref typed with the declared result, so `ref.close(42)` fails to compile; a `[forDrawerClose]` button's `[closeWith]` is not checked against the contract, so close through that ref wherever the result type matters. Without the member `data` is unchecked, the result is `unknown`, and `injectDrawerData<T>()` with a plain type still types the payload as `T`; explicit type arguments override the contract. `injectDrawerData()` returns `null` too, because the manager provides `null` when `open()` is called without `data`, so guard (`data?.message`) before dereferencing the payload. `await ref.closed` resolves `{ reason, result }`, whose `reason` (a `ForDrawerCloseReason`) tells apart an imperative `close()` (`'programmatic'`) from Escape / backdrop / outside / swipe / close-button dismissals.
164
164
 
165
165
  Drawers opened by the manager share the LIFO dismissible layer with declarative ones, so Escape closes the topmost drawer first whichever API opened it. Nesting is resolved from where a drawer is declared, not from the order drawers open in: a declarative `[forDrawer]` inside a programmatic drawer's component is its child (`data-depth="1"`, and the programmatic parent reflects `data-state-nested`), but a drawer the manager opens over a declarative one is a root, so it reflects `data-depth="0"` and its declarative neighbour gets no `data-state-nested`.
166
166
 
@@ -180,7 +180,7 @@ this.#drawers.open(ConfirmDrawer, { data, side: 'bottom', class: 'my-drawer' });
180
180
  }
181
181
  ```
182
182
 
183
- **Enter / exit animations.** A programmatic drawer is portaled to `document.body` and torn down imperatively, so the consumer can't attach `animate.leave` to the host the way a declarative `@if` block can. Pass `animateEnter` / `animateLeave` (CSS class names) instead: the manager applies `animateEnter` on mount (via `animate.enter`) and, on `close()`, keeps the host mounted with `animateLeave` until its CSS animations / transitions finish before tearing down. `close()` still resolves its promise and flips `isClosed()` immediately. Only the visual teardown waits. A template `animate.leave` inside the opened component never runs, because Angular does not run leave animations across the outlet the manager mounts it through; a `[forDrawerBackdrop]` takes its exit class from `backdropAnimateLeave`. Set them once with `provideForDrawerDefaults({ animateEnter, animateLeave, backdropAnimateLeave })`; a per-`open()` value wins over the default. `ForDrawerManager` is provided in root and reads the defaults from the root injector, so a `provideForDrawerDefaults` on a lazy route or in a component's `providers` reaches a programmatic drawer only when that scope's injector is passed as `injector` on the `open()` config; every key then applies, the scale and nested tunables included.
183
+ **Enter / exit animations.** A programmatic drawer is portaled to `document.body` and torn down imperatively, so the consumer can't attach `animate.leave` to the host the way a declarative `@if` block can. Pass `animateEnter` / `animateLeave` (CSS class names) instead: the manager applies `animateEnter` on mount (via `animate.enter`) and, on `close()`, keeps the host mounted with `animateLeave` until its CSS animations / transitions finish before tearing down. `close()` still resolves its promise and flips `isClosed()` immediately, and the overlay stops being modal at the same moment: its focus trap, inert siblings, scroll lock and Escape layer are released and focus returns. Only the DOM removal waits. A template `animate.leave` inside the opened component never runs, because Angular does not run leave animations across the outlet the manager mounts it through; a `[forDrawerBackdrop]` takes its exit class from `backdropAnimateLeave`. Set them once with `provideForDrawerDefaults({ animateEnter, animateLeave, backdropAnimateLeave })`; a per-`open()` value wins over the default. `ForDrawerManager` is provided in root and reads the defaults from the root injector, so a `provideForDrawerDefaults` on a lazy route or in a component's `providers` reaches a programmatic drawer only when that scope's injector is passed as `injector` on the `open()` config; every key then applies, the scale and nested tunables included.
184
184
 
185
185
  <!-- snippet: fragment -->
186
186
 
@@ -368,34 +368,34 @@ Press the button: the manager opens the confirmation as a bottom drawer, and the
368
368
 
369
369
  ### `ForDrawer`
370
370
 
371
- | Property | Type | Description |
372
- | --------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
373
- | `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | Anchored edge. Drives swipe direction and `data-side`.<br>**Default:** `'bottom'` |
374
- | `modal` | `boolean` | `aria-modal`, scroll lock, focus trap, inert siblings, return focus on close. Read once at mount: a change while the drawer is open takes effect on the next open.<br>**Default:** `true` |
375
- | `dismissible` | `boolean` | Whether Escape / backdrop / outside / swipe close. When `false`, no swipe dismisses; `snapPoints` still drag between snaps.<br>**Default:** `true` |
376
- | `alert` | `boolean` | `role="alertdialog"`.<br>**Default:** `false` |
377
- | `returnFocus` | `boolean` | Modal mode only: restore focus on close. A non-modal drawer never moves focus on close.<br>**Default:** `true` |
378
- | `initialFocus` | `'first' \| 'container'` | **Default:** `'first'` |
379
- | `ariaLabel` | `string \| null` | Use when no visible title is rendered.<br>**Default:** `null` |
380
- | `autoFocusOnOpen` | `(e: VetoableEvent) => void` \| `undefined` | `event.preventDefault()` skips the imperative focus move.<br>**Default:** — |
381
- | `autoFocusOnClose` | `(e: VetoableEvent) => void` \| `undefined` | Fires on every close path regardless of mode. In non-modal mode the directive doesn't move focus, so the veto is informational; in modal mode `event.preventDefault()` skips return-focus.<br>**Default:** — |
382
- | `swipeToDismiss` | `boolean` | Whether a swipe toward the anchored edge dismisses. When `false`, `snapPoints` still drag between snaps and stop at the lowest one. No drag arms under `prefers-reduced-motion: reduce`.<br>**Default:** `true` |
383
- | `closeThreshold` | `number` | Fraction past which a release dismisses, measured against the full dimension without `snapPoints` and against the lowest snap's extent with them.<br>**Default:** `0.25` |
384
- | `handleOnly` | `boolean` | Swipe arms only on the registered `[forDrawerHandle]`.<br>**Default:** `false` |
385
- | `snapPoints` | `ReadonlyArray<ForDrawerSnapPoint>` | `number ∈ [0,1]` \| `'NN%'` \| `'NNpx'`. Strictly increasing.<br>**Default:** — |
386
- | `activeSnapPoint` | `ModelSignal<ForDrawerSnapPoint \| null>` | Two-way bindable. Initialised to `snapPoints[0]` on mount when null.<br>**Default:** `null` |
387
- | `fadeFromIndex` | `number` | Backdrop reflects `data-fade-from-active` once active >= this index.<br>**Default:** — |
388
- | `scaleBackground` | `boolean` | Asks `[forDrawerWrapper]` to scale + translate behind the drawer.<br>**Default:** `false` |
389
- | `setBackgroundColorOnScale` | `boolean` | Paints `<body>` to mask the gap between scaled wrapper and viewport edge.<br>**Default:** `true` |
390
- | `dismiss` | `OutputEmitterRef<ForDrawerCloseReason>` | Output. Wire to `(dismiss)="open.set(false)"`.<br>**Default:** — |
391
- | `escapeKeyDown` | `OutputEmitterRef<VetoableNativeEvent<KeyboardEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
392
- | `pointerDownOutside` | `OutputEmitterRef<VetoableNativeEvent<PointerEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
393
- | `focusOutside` | `OutputEmitterRef<VetoableNativeEvent<FocusEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
394
- | `interactOutside` | `OutputEmitterRef<VetoableNativeEvent<PointerEvent \| FocusEvent>>` | Output. Composite, vetoed by either specific event.<br>**Default:** — |
395
- | `swipeStart` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. Fires once on the arming pointer move; `progress` is `0`.<br>**Default:** — |
396
- | `swipeMove` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. Streams `progress` ∈ [0,1] and the originating `PointerEvent`.<br>**Default:** — |
397
- | `swipeEnd` | `OutputEmitterRef<ForDrawerSwipeEndEvent>` | Output. `willClose`, `nextSnapPoint`. Fires once `activeSnapPoint` holds `nextSnapPoint`, and before `(dismiss)` on a dismissing release.<br>**Default:** — |
398
- | `swipeCancel` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. `pointercancel` or mid-gesture direction abort; the surface springs back.<br>**Default:** — |
371
+ | Property | Type | Description |
372
+ | --------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
373
+ | `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | Anchored edge. Drives swipe direction and `data-side`.<br>**Default:** `'bottom'` |
374
+ | `modal` | `boolean` | `aria-modal`, scroll lock, focus trap, inert siblings, return focus on close. Read once at mount: a change while the drawer is open takes effect on the next open.<br>**Default:** `true` |
375
+ | `dismissible` | `boolean` | Whether Escape / backdrop / outside / swipe close. When `false`, no swipe dismisses; `snapPoints` still drag between snaps.<br>**Default:** `true` |
376
+ | `alert` | `boolean` | `role="alertdialog"`.<br>**Default:** `false` |
377
+ | `returnFocus` | `boolean` | Modal mode only: restore focus on close. A non-modal drawer never moves focus on close.<br>**Default:** `true` |
378
+ | `initialFocus` | `'first' \| 'container'` | **Default:** `'first'` |
379
+ | `ariaLabel` | `string \| null` | Use when no visible title is rendered.<br>**Default:** `null` |
380
+ | `autoFocusOnOpen` | `(e: VetoableEvent) => void` \| `undefined` | `event.preventDefault()` skips the imperative focus move.<br>**Default:** — |
381
+ | `autoFocusOnClose` | `(e: VetoableEvent) => void` \| `undefined` | Fires on every close path regardless of mode. In non-modal mode the directive doesn't move focus, so the veto is informational; in modal mode `event.preventDefault()` skips return-focus.<br>**Default:** — |
382
+ | `swipeToDismiss` | `boolean` | Whether a swipe toward the anchored edge dismisses. When `false`, `snapPoints` still drag between snaps and stop at the lowest one.<br>**Default:** `true` |
383
+ | `closeThreshold` | `number` | Fraction past which a release dismisses, measured against the full dimension without `snapPoints` and against the lowest snap's extent with them.<br>**Default:** `0.25` |
384
+ | `handleOnly` | `boolean` | Swipe arms only on the registered `[forDrawerHandle]`.<br>**Default:** `false` |
385
+ | `snapPoints` | `ReadonlyArray<ForDrawerSnapPoint>` | `number ∈ [0,1]` \| `'NN%'` \| `'NNpx'`. Strictly increasing.<br>**Default:** — |
386
+ | `activeSnapPoint` | `ModelSignal<ForDrawerSnapPoint \| null>` | Two-way bindable. Initialised to `snapPoints[0]` on mount when null.<br>**Default:** `null` |
387
+ | `fadeFromIndex` | `number` | Backdrop reflects `data-fade-from-active` once active >= this index.<br>**Default:** — |
388
+ | `scaleBackground` | `boolean` | Asks `[forDrawerWrapper]` to scale + translate behind the drawer.<br>**Default:** `false` |
389
+ | `setBackgroundColorOnScale` | `boolean` | Paints `<body>` to mask the gap between scaled wrapper and viewport edge.<br>**Default:** `true` |
390
+ | `dismiss` | `OutputEmitterRef<ForDrawerCloseReason>` | Output. Wire to `(dismiss)="open.set(false)"`.<br>**Default:** — |
391
+ | `escapeKeyDown` | `OutputEmitterRef<VetoableNativeEvent<KeyboardEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
392
+ | `pointerDownOutside` | `OutputEmitterRef<VetoableNativeEvent<PointerEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
393
+ | `focusOutside` | `OutputEmitterRef<VetoableNativeEvent<FocusEvent>>` | Output. `preventDefault()` suppresses auto-close.<br>**Default:** — |
394
+ | `interactOutside` | `OutputEmitterRef<VetoableNativeEvent<PointerEvent \| FocusEvent>>` | Output. Composite, vetoed by either specific event.<br>**Default:** — |
395
+ | `swipeStart` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. Fires once on the arming pointer move; `progress` is `0`.<br>**Default:** — |
396
+ | `swipeMove` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. Streams `progress` ∈ [0,1] and the originating `PointerEvent`.<br>**Default:** — |
397
+ | `swipeEnd` | `OutputEmitterRef<ForDrawerSwipeEndEvent>` | Output. `willClose`, `nextSnapPoint`. Fires once `activeSnapPoint` holds `nextSnapPoint`, and before `(dismiss)` on a dismissing release.<br>**Default:** — |
398
+ | `swipeCancel` | `OutputEmitterRef<ForDrawerSwipeEvent>` | Output. `pointercancel` or mid-gesture direction abort; the surface springs back.<br>**Default:** — |
399
399
 
400
400
  `ForDrawerCloseReason`: `'escape' | 'backdrop' | 'pointerDownOutside' | 'focusOutside' | 'closeButton' | 'swipe' | 'programmatic'`.
401
401
 
@@ -531,9 +531,10 @@ For a seamless release, transition **both** `translate` and your snap-position p
531
531
  - Dismissal and dragging are separate. With `swipeToDismiss` or `dismissible` set to `false`, a drawer with `snapPoints` still drags between them and stops at the lowest snap, and `(swipeEnd)` reports `willClose: false`; a drawer without `snapPoints` arms no drag at all.
532
532
  - `closeThreshold` (default `0.25`) is the fraction past which a release from the lowest snap dismisses. It is measured against that snap's own extent (not the full dimension), so a small "peek" snap stays dismissible without dragging it off-screen.
533
533
  - `handleOnly: true` confines the gesture to a registered `[forDrawerHandle]`, leaving the rest of the surface free for content scroll.
534
- - On touch the browser would otherwise claim the swipe as a scroll. The handle always carries `touch-action: none`, and while the whole surface arms the drag (`handleOnly` off, and a drag the drawer can arm) the surface carries an inline `touch-action` that leaves the browser only the other axis: `pan-x` for a `top` / `bottom` drawer, `pan-y` for `left` / `right`. A scroller inside the surface keeps its own native scrolling, so your CSS needs no `touch-action` rule of its own.
535
- - Gestures whose press lands inside a scrollable element that hasn't reached its edge are NOT treated as swipes (the helper defers to inner scroll). The edge is read in the scroller's own writing direction, with a 1 px tolerance for fractional scroll offsets.
536
- - **`prefers-reduced-motion: reduce`** disables the drag entirely, snap dragging included. Escape, backdrop, outside-pointer, and close button continue to work.
534
+ - On touch the browser would otherwise claim the swipe as a scroll. While the drawer can arm the drag, the handle carries `touch-action: none`, and while the whole surface arms it (`handleOnly` off) the surface carries an inline `touch-action` that leaves the browser only the other axis: `pan-x` for a `top` / `bottom` drawer, `pan-y` for `left` / `right`. A scroller inside the surface keeps its own native scrolling, so your CSS needs no `touch-action` rule of its own.
535
+ - A surface that is itself the scroll container (`[forDrawer] { max-height: 85vh; overflow-y: auto }`) keeps touch scrolling on that axis while its content overflows it: the surface leaves that axis to the browser, so a touch drag on the content scrolls it instead of dragging the drawer. Add a `[forDrawerHandle]` to keep a touch swipe available; a mouse drag still swipes once the content is scrolled to its edge.
536
+ - Gestures whose press lands inside a scrollable element that hasn't reached its edge, the surface itself included, are NOT treated as swipes (the helper defers to the scroll). The edge is read in the scroller's own writing direction, with a 1 px tolerance for fractional scroll offsets.
537
+ - **`prefers-reduced-motion: reduce`** keeps the gesture and drops the motion, as every swipe surface in the library does: the drag still arms, fires `(swipeStart)` / `(swipeMove)` / `(swipeEnd)` / `(swipeCancel)` and resolves to a snap point or a dismiss on release, but `--for-drawer-swipe-movement-x` / `-y` stay at `0px` and the swipe progress (the backdrop's `--for-drawer-swipe-progress` and each event's `progress`) stays at `0`, so the surface does not follow the finger and moves to the committed snap on release.
537
538
 
538
539
  ## Scale background
539
540
 
@@ -566,6 +567,8 @@ Opt in to the "viewport recedes behind the drawer" effect: when the drawer opens
566
567
 
567
568
  While the effect is active the wrapper reflects `data-state="scaled"` (and `"idle"` at rest); the drawer reflects `data-scale-background` so consumers can style the surface differently when scale is in play (e.g. larger corner radii).
568
569
 
570
+ The wrapper scales in and back out over the same 0.5 s transition, which the directive writes inline on it while the effect runs. On close the wrapper animates back to full size while the drawer plays its leave animation, and your own inline `transition`, `transform-origin` and `overflow` on the wrapper, and the body colour, are restored once that transition ends.
571
+
569
572
  `setBackgroundColorOnScale` (default `true`) paints `<body>` with `scaleBackgroundColor` while the effect is active. Disable it (`[setBackgroundColorOnScale]="false"`) when the application shell already covers the viewport edge: a themed `<html>` / `<body>` background, a fixed root layer, or a full-bleed CSS-framework wrapper. In those flows the body-color mutation is redundant and would briefly overwrite a theme-managed value on every open / close; leaving it off keeps the consumer's own paint authoritative, the rounded gap behind the scaled wrapper composes with whatever colour they ship. The flag has no effect under `prefers-reduced-motion: reduce` (the whole effect is suppressed).
570
573
 
571
574
  `prefers-reduced-motion: reduce` suppresses the effect entirely. Wrapper styles, body color, and `data-scale-background` are all bypassed without affecting the rest of the drawer's behaviour.
@@ -777,12 +780,12 @@ forty-cdk ships no styles: put your own class on each piece and key your CSS off
777
780
 
778
781
  ### CSS custom properties
779
782
 
780
- | Property | Meaning |
781
- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
782
- | `--for-drawer-swipe-movement-x` | Written on `[forDrawer]` (the surface). Live swipe displacement in CSS px along the x axis (`0px` at rest; only the dismissal axis is ever non-zero). Compose with `translate: var(--for-drawer-swipe-movement-x, 0px) var(--for-drawer-swipe-movement-y, 0px)`. See [Positioning the snaps](#positioning-the-snaps-css-contract). |
783
- | `--for-drawer-swipe-movement-y` | Written on `[forDrawer]` (the surface). Live swipe displacement in CSS px along the y axis (`0px` at rest; only the dismissal axis is ever non-zero). Compose with `translate: var(--for-drawer-swipe-movement-x, 0px) var(--for-drawer-swipe-movement-y, 0px)`. See [Positioning the snaps](#positioning-the-snaps-css-contract). |
784
- | `--for-drawer-swipe-progress` | Written on `[forDrawerBackdrop]`. Swipe progress toward the anchored edge, a unitless fraction `0` (at rest) → `1` (fully swiped off-screen, from any snap). Fade with `opacity: calc(1 - var(--for-drawer-swipe-progress, 0))`. See [Backdrop swipe-fade](#backdrop-swipe-fade-css-contract). |
785
- | `--for-drawer-depth` | Written on `[forDrawer]` and `[forDrawerBackdrop]`. The drawer's nesting depth as a unitless integer, `0` for a root drawer, mirroring `data-depth`. Stack a nested drawer's backdrop above its parent with `z-index: calc(1009 + var(--for-drawer-depth) * 10)`. |
783
+ | Property | Meaning |
784
+ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
785
+ | `--for-drawer-swipe-movement-x` | Written on `[forDrawer]` (the surface). Live swipe displacement in CSS px along the x axis (`0px` at rest and under `prefers-reduced-motion: reduce`; only the dismissal axis is ever non-zero). Compose with `translate: var(--for-drawer-swipe-movement-x, 0px) var(--for-drawer-swipe-movement-y, 0px)`. See [Positioning the snaps](#positioning-the-snaps-css-contract). |
786
+ | `--for-drawer-swipe-movement-y` | Written on `[forDrawer]` (the surface). Live swipe displacement in CSS px along the y axis (`0px` at rest and under `prefers-reduced-motion: reduce`; only the dismissal axis is ever non-zero). Compose with `translate: var(--for-drawer-swipe-movement-x, 0px) var(--for-drawer-swipe-movement-y, 0px)`. See [Positioning the snaps](#positioning-the-snaps-css-contract). |
787
+ | `--for-drawer-swipe-progress` | Written on `[forDrawerBackdrop]`. Swipe progress toward the anchored edge, a unitless fraction `0` (at rest, and throughout under `prefers-reduced-motion: reduce`) → `1` (fully swiped off-screen, from any snap). Fade with `opacity: calc(1 - var(--for-drawer-swipe-progress, 0))`. See [Backdrop swipe-fade](#backdrop-swipe-fade-css-contract). |
788
+ | `--for-drawer-depth` | Written on `[forDrawer]` and `[forDrawerBackdrop]`. The drawer's nesting depth as a unitless integer, `0` for a root drawer, mirroring `data-depth`. Stack a nested drawer's backdrop above its parent with `z-index: calc(1009 + var(--for-drawer-depth) * 10)`. |
786
789
 
787
790
  ```css
788
791
  .sheet[data-active-snap-point] {
@@ -109,7 +109,7 @@ A settings-style dropdown built from the full menu vocabulary: `forMenuGroup` wi
109
109
  | `dir` | `input<'ltr' \| 'rtl' \| null>` | Writing direction. `null` inherits the nearest `[dir]` / `<html dir>`, else `'ltr'`. In RTL, ArrowLeft opens submenus and ArrowRight closes them. The swap is automatic. Inherited by every nested `[forMenuSub]` underneath unless overridden.<br>**Default:** `null` |
110
110
  | `disabled` | `input<boolean>` | When `true`, trigger interactions are ignored and every item of the menu and its submenus is disabled. An open menu stays open, and keyboard navigation, Tab and Escape keep working.<br>**Default:** `false` |
111
111
  | `dismissible` | `input<boolean>` | When `false`, Escape and outside interactions don't close.<br>**Default:** `true` |
112
- | `returnFocus` | `input<boolean>` | When `true`, focus returns to the trigger on close.<br>**Default:** `true` |
112
+ | `returnFocus` | `input<boolean>` | When `true`, focus returns to the trigger on close, except after an outside or Tab close.<br>**Default:** `true` |
113
113
  | `ariaLabel` | `input<string \| null>` | Manual `aria-label` on `[forMenuContent]` if the trigger isn't a meaningful name.<br>**Default:** `null` |
114
114
  | `escapeKeyDown` | `output<VetoableNativeEvent<KeyboardEvent>>` | Output. Escape pressed while the menu is the topmost dismissible layer.<br>**Default:** — |
115
115
  | `pointerDownOutside` | `output<VetoableNativeEvent<PointerEvent>>` | Output. Pointer-down on a target outside content + trigger.<br>**Default:** — |
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { Directive, ElementRef, InjectionToken, booleanAttribute, computed, inject, input, model, signal } from "@angular/core";
3
- import { Collection, IdGenerator, adoptHostId, assertRootContext, hostButtonType, hostLabelledBy, injectTextDirection, moveIndex, orphanContextError, reflectDisabled, registerHandle, resolveListNavigation } from "forty-cdk/core";
3
+ import { Collection, IdGenerator, adoptHostId, assertRootContext, hostButtonType, hostLabelledBy, injectReflectedDirection, injectTextDirection, moveIndex, orphanContextError, reflectDisabled, registerHandle, resolveListNavigation } from "forty-cdk/core";
4
4
  const FOR_ACCORDION_CONTEXT = new InjectionToken("FOR_ACCORDION_CONTEXT");
5
5
  const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken("FOR_ACCORDION_ITEM_CONTEXT");
6
6
  function injectAccordionContext(piece) {
@@ -50,6 +50,7 @@ var ForAccordion = class ForAccordion {
50
50
  alias: "dir"
51
51
  });
52
52
  dir = injectTextDirection(this._dirInput);
53
+ reflectedDir = injectReflectedDirection(this._dirInput);
53
54
  loop = input(true, {
54
55
  ...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
55
56
  transform: booleanAttribute
@@ -90,7 +91,7 @@ var ForAccordion = class ForAccordion {
90
91
  }
91
92
  static ɵfac = i0.ɵɵngDeclareFactory({
92
93
  minVersion: "12.0.0",
93
- version: "22.2.2",
94
+ version: "22.2.4",
94
95
  ngImport: i0,
95
96
  type: ForAccordion,
96
97
  deps: [],
@@ -98,7 +99,7 @@ var ForAccordion = class ForAccordion {
98
99
  });
99
100
  static ɵdir = i0.ɵɵngDeclareDirective({
100
101
  minVersion: "17.1.0",
101
- version: "22.2.2",
102
+ version: "22.2.4",
102
103
  type: ForAccordion,
103
104
  isStandalone: true,
104
105
  selector: "[forAccordion]",
@@ -157,7 +158,7 @@ var ForAccordion = class ForAccordion {
157
158
  host: { properties: {
158
159
  "attr.data-orientation": "orientation()",
159
160
  "attr.data-disabled": "disabled() ? \"\" : null",
160
- "attr.dir": "dir()"
161
+ "attr.dir": "reflectedDir()"
161
162
  } },
162
163
  providers: [{
163
164
  provide: FOR_ACCORDION_CONTEXT,
@@ -169,7 +170,7 @@ var ForAccordion = class ForAccordion {
169
170
  };
170
171
  i0.ɵɵngDeclareClassMetadata({
171
172
  minVersion: "12.0.0",
172
- version: "22.2.2",
173
+ version: "22.2.4",
173
174
  ngImport: i0,
174
175
  type: ForAccordion,
175
176
  decorators: [{
@@ -180,7 +181,7 @@ i0.ɵɵngDeclareClassMetadata({
180
181
  host: {
181
182
  "[attr.data-orientation]": "orientation()",
182
183
  "[attr.data-disabled]": "disabled() ? \"\" : null",
183
- "[attr.dir]": "dir()"
184
+ "[attr.dir]": "reflectedDir()"
184
185
  },
185
186
  providers: [{
186
187
  provide: FOR_ACCORDION_CONTEXT,
@@ -277,7 +278,7 @@ var ForAccordionItem = class ForAccordionItem {
277
278
  }
278
279
  static ɵfac = i0.ɵɵngDeclareFactory({
279
280
  minVersion: "12.0.0",
280
- version: "22.2.2",
281
+ version: "22.2.4",
281
282
  ngImport: i0,
282
283
  type: ForAccordionItem,
283
284
  deps: [],
@@ -285,7 +286,7 @@ var ForAccordionItem = class ForAccordionItem {
285
286
  });
286
287
  static ɵdir = i0.ɵɵngDeclareDirective({
287
288
  minVersion: "17.1.0",
288
- version: "22.2.2",
289
+ version: "22.2.4",
289
290
  type: ForAccordionItem,
290
291
  isStandalone: true,
291
292
  selector: "[forAccordionItem]",
@@ -320,7 +321,7 @@ var ForAccordionItem = class ForAccordionItem {
320
321
  };
321
322
  i0.ɵɵngDeclareClassMetadata({
322
323
  minVersion: "12.0.0",
323
- version: "22.2.2",
324
+ version: "22.2.4",
324
325
  ngImport: i0,
325
326
  type: ForAccordionItem,
326
327
  decorators: [{
@@ -387,7 +388,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
387
388
  }
388
389
  static ɵfac = i0.ɵɵngDeclareFactory({
389
390
  minVersion: "12.0.0",
390
- version: "22.2.2",
391
+ version: "22.2.4",
391
392
  ngImport: i0,
392
393
  type: ForAccordionTrigger,
393
394
  deps: [],
@@ -395,7 +396,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
395
396
  });
396
397
  static ɵdir = i0.ɵɵngDeclareDirective({
397
398
  minVersion: "14.0.0",
398
- version: "22.2.2",
399
+ version: "22.2.4",
399
400
  type: ForAccordionTrigger,
400
401
  isStandalone: true,
401
402
  selector: "[forAccordionTrigger]",
@@ -421,7 +422,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
421
422
  };
422
423
  i0.ɵɵngDeclareClassMetadata({
423
424
  minVersion: "12.0.0",
424
- version: "22.2.2",
425
+ version: "22.2.4",
425
426
  ngImport: i0,
426
427
  type: ForAccordionTrigger,
427
428
  decorators: [{
@@ -454,7 +455,7 @@ var ForAccordionContent = class ForAccordionContent {
454
455
  }
455
456
  static ɵfac = i0.ɵɵngDeclareFactory({
456
457
  minVersion: "12.0.0",
457
- version: "22.2.2",
458
+ version: "22.2.4",
458
459
  ngImport: i0,
459
460
  type: ForAccordionContent,
460
461
  deps: [],
@@ -462,7 +463,7 @@ var ForAccordionContent = class ForAccordionContent {
462
463
  });
463
464
  static ɵdir = i0.ɵɵngDeclareDirective({
464
465
  minVersion: "14.0.0",
465
- version: "22.2.2",
466
+ version: "22.2.4",
466
467
  type: ForAccordionContent,
467
468
  isStandalone: true,
468
469
  selector: "[forAccordionContent]",
@@ -481,7 +482,7 @@ var ForAccordionContent = class ForAccordionContent {
481
482
  };
482
483
  i0.ɵɵngDeclareClassMetadata({
483
484
  minVersion: "12.0.0",
484
- version: "22.2.2",
485
+ version: "22.2.4",
485
486
  ngImport: i0,
486
487
  type: ForAccordionContent,
487
488
  decorators: [{