forty-cdk 0.2.0 → 0.3.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 (220) hide show
  1. package/accordion/README.md +122 -0
  2. package/aspect-ratio/README.md +76 -0
  3. package/avatar/README.md +100 -0
  4. package/breadcrumbs/README.md +49 -0
  5. package/breakpoints/README.md +81 -0
  6. package/button/README.md +49 -0
  7. package/calendar/README.md +458 -0
  8. package/carousel/README.md +358 -0
  9. package/checkbox/README.md +146 -0
  10. package/combobox/README.md +535 -0
  11. package/context-menu/README.md +139 -0
  12. package/date-field/README.md +184 -0
  13. package/date-picker/README.md +338 -0
  14. package/dialog/README.md +388 -0
  15. package/disclosure/README.md +114 -0
  16. package/drag-drop/README.md +359 -0
  17. package/drawer/README.md +560 -0
  18. package/dropdown-menu/README.md +176 -0
  19. package/fesm2022/forty-cdk-accordion.mjs +348 -0
  20. package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
  21. package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
  22. package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
  23. package/fesm2022/forty-cdk-avatar.mjs +308 -0
  24. package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
  25. package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
  26. package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
  27. package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
  28. package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
  29. package/fesm2022/forty-cdk-button.mjs +134 -0
  30. package/fesm2022/forty-cdk-button.mjs.map +1 -0
  31. package/fesm2022/forty-cdk-calendar.mjs +2034 -0
  32. package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
  33. package/fesm2022/forty-cdk-carousel.mjs +968 -0
  34. package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
  35. package/fesm2022/forty-cdk-checkbox.mjs +226 -0
  36. package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
  37. package/fesm2022/forty-cdk-combobox.mjs +2596 -0
  38. package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
  39. package/fesm2022/forty-cdk-context-menu.mjs +413 -0
  40. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
  41. package/fesm2022/forty-cdk-core.mjs +9022 -0
  42. package/fesm2022/forty-cdk-core.mjs.map +1 -0
  43. package/fesm2022/forty-cdk-date-field.mjs +744 -0
  44. package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
  45. package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
  46. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
  47. package/fesm2022/forty-cdk-dialog.mjs +707 -0
  48. package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
  49. package/fesm2022/forty-cdk-disclosure.mjs +190 -0
  50. package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
  51. package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
  52. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
  53. package/fesm2022/forty-cdk-drawer.mjs +1641 -0
  54. package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
  55. package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
  56. package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
  57. package/fesm2022/forty-cdk-field.mjs +425 -0
  58. package/fesm2022/forty-cdk-field.mjs.map +1 -0
  59. package/fesm2022/forty-cdk-fieldset.mjs +164 -0
  60. package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
  61. package/fesm2022/forty-cdk-file-upload.mjs +221 -0
  62. package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
  63. package/fesm2022/forty-cdk-hover-card.mjs +496 -0
  64. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
  65. package/fesm2022/forty-cdk-input.mjs +274 -0
  66. package/fesm2022/forty-cdk-input.mjs.map +1 -0
  67. package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
  68. package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-listbox.mjs +1279 -0
  70. package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
  71. package/fesm2022/forty-cdk-menu.mjs +1439 -0
  72. package/fesm2022/forty-cdk-menu.mjs.map +1 -0
  73. package/fesm2022/forty-cdk-menubar.mjs +787 -0
  74. package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
  75. package/fesm2022/forty-cdk-meter.mjs +211 -0
  76. package/fesm2022/forty-cdk-meter.mjs.map +1 -0
  77. package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
  78. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
  79. package/fesm2022/forty-cdk-number-input.mjs +559 -0
  80. package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
  81. package/fesm2022/forty-cdk-otp-input.mjs +527 -0
  82. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
  83. package/fesm2022/forty-cdk-pagination.mjs +323 -0
  84. package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
  85. package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
  86. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
  87. package/fesm2022/forty-cdk-popover.mjs +698 -0
  88. package/fesm2022/forty-cdk-popover.mjs.map +1 -0
  89. package/fesm2022/forty-cdk-progress.mjs +226 -0
  90. package/fesm2022/forty-cdk-progress.mjs.map +1 -0
  91. package/fesm2022/forty-cdk-radio-group.mjs +378 -0
  92. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
  93. package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
  94. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
  95. package/fesm2022/forty-cdk-search.mjs +205 -0
  96. package/fesm2022/forty-cdk-search.mjs.map +1 -0
  97. package/fesm2022/forty-cdk-select.mjs +1661 -0
  98. package/fesm2022/forty-cdk-select.mjs.map +1 -0
  99. package/fesm2022/forty-cdk-separator.mjs +82 -0
  100. package/fesm2022/forty-cdk-separator.mjs.map +1 -0
  101. package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
  102. package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
  103. package/fesm2022/forty-cdk-slider.mjs +803 -0
  104. package/fesm2022/forty-cdk-slider.mjs.map +1 -0
  105. package/fesm2022/forty-cdk-stepper.mjs +886 -0
  106. package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
  107. package/fesm2022/forty-cdk-switch.mjs +137 -0
  108. package/fesm2022/forty-cdk-switch.mjs.map +1 -0
  109. package/fesm2022/forty-cdk-table.mjs +1518 -0
  110. package/fesm2022/forty-cdk-table.mjs.map +1 -0
  111. package/fesm2022/forty-cdk-tabs.mjs +400 -0
  112. package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
  113. package/fesm2022/forty-cdk-time-field.mjs +593 -0
  114. package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
  115. package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
  116. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
  117. package/fesm2022/forty-cdk-toast.mjs +1153 -0
  118. package/fesm2022/forty-cdk-toast.mjs.map +1 -0
  119. package/fesm2022/forty-cdk-toggle.mjs +516 -0
  120. package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
  121. package/fesm2022/forty-cdk-toolbar.mjs +374 -0
  122. package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
  123. package/fesm2022/forty-cdk-tooltip.mjs +672 -0
  124. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
  125. package/fesm2022/forty-cdk-tree.mjs +2007 -0
  126. package/fesm2022/forty-cdk-tree.mjs.map +1 -0
  127. package/fesm2022/forty-cdk-virtualization.mjs +1 -1
  128. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  129. package/fesm2022/forty-cdk.mjs +0 -43310
  130. package/fesm2022/forty-cdk.mjs.map +1 -1
  131. package/field/README.md +97 -0
  132. package/fieldset/README.md +86 -0
  133. package/file-upload/README.md +73 -0
  134. package/hover-card/README.md +171 -0
  135. package/input/README.md +156 -0
  136. package/listbox/README.md +424 -0
  137. package/menu/README.md +181 -0
  138. package/menubar/README.md +140 -0
  139. package/meter/README.md +128 -0
  140. package/navigation-menu/README.md +253 -0
  141. package/number-input/README.md +171 -0
  142. package/otp-input/README.md +198 -0
  143. package/package.json +213 -1
  144. package/pagination/README.md +61 -0
  145. package/pane-resizer/README.md +136 -0
  146. package/popover/README.md +262 -0
  147. package/progress/README.md +115 -0
  148. package/radio-group/README.md +129 -0
  149. package/scroll-area/README.md +184 -0
  150. package/search/README.md +42 -0
  151. package/select/README.md +488 -0
  152. package/separator/README.md +84 -0
  153. package/signal-forms/README.md +72 -0
  154. package/slider/README.md +152 -0
  155. package/stepper/README.md +292 -0
  156. package/switch/README.md +116 -0
  157. package/table/README.md +769 -0
  158. package/tabs/README.md +130 -0
  159. package/time-field/README.md +157 -0
  160. package/time-picker/README.md +172 -0
  161. package/toast/README.md +398 -0
  162. package/toggle/README.md +224 -0
  163. package/toolbar/README.md +109 -0
  164. package/tooltip/README.md +274 -0
  165. package/tree/README.md +708 -0
  166. package/types/forty-cdk-accordion.d.ts +242 -0
  167. package/types/forty-cdk-aspect-ratio.d.ts +59 -0
  168. package/types/forty-cdk-avatar.d.ts +133 -0
  169. package/types/forty-cdk-breadcrumbs.d.ts +92 -0
  170. package/types/forty-cdk-breakpoints.d.ts +141 -0
  171. package/types/forty-cdk-button.d.ts +80 -0
  172. package/types/forty-cdk-calendar.d.ts +914 -0
  173. package/types/forty-cdk-carousel.d.ts +530 -0
  174. package/types/forty-cdk-checkbox.d.ts +141 -0
  175. package/types/forty-cdk-combobox.d.ts +1259 -0
  176. package/types/forty-cdk-context-menu.d.ts +313 -0
  177. package/types/forty-cdk-core.d.ts +5774 -0
  178. package/types/forty-cdk-date-field.d.ts +307 -0
  179. package/types/forty-cdk-date-picker.d.ts +622 -0
  180. package/types/forty-cdk-dialog.d.ts +546 -0
  181. package/types/forty-cdk-disclosure.d.ts +127 -0
  182. package/types/forty-cdk-drag-drop.d.ts +456 -0
  183. package/types/forty-cdk-drawer.d.ts +871 -0
  184. package/types/forty-cdk-dropdown-menu.d.ts +242 -0
  185. package/types/forty-cdk-field.d.ts +236 -0
  186. package/types/forty-cdk-fieldset.d.ts +119 -0
  187. package/types/forty-cdk-file-upload.d.ts +124 -0
  188. package/types/forty-cdk-hover-card.d.ts +320 -0
  189. package/types/forty-cdk-input.d.ts +169 -0
  190. package/types/forty-cdk-internationalized-date.d.ts +1 -1
  191. package/types/forty-cdk-listbox.d.ts +513 -0
  192. package/types/forty-cdk-menu.d.ts +629 -0
  193. package/types/forty-cdk-menubar.d.ts +451 -0
  194. package/types/forty-cdk-meter.d.ts +122 -0
  195. package/types/forty-cdk-navigation-menu.d.ts +514 -0
  196. package/types/forty-cdk-number-input.d.ts +319 -0
  197. package/types/forty-cdk-otp-input.d.ts +248 -0
  198. package/types/forty-cdk-pagination.d.ts +214 -0
  199. package/types/forty-cdk-pane-resizer.d.ts +145 -0
  200. package/types/forty-cdk-popover.d.ts +509 -0
  201. package/types/forty-cdk-progress.d.ts +143 -0
  202. package/types/forty-cdk-radio-group.d.ts +222 -0
  203. package/types/forty-cdk-scroll-area.d.ts +258 -0
  204. package/types/forty-cdk-search.d.ts +142 -0
  205. package/types/forty-cdk-select.d.ts +899 -0
  206. package/types/forty-cdk-separator.d.ts +59 -0
  207. package/types/forty-cdk-signal-forms.d.ts +58 -0
  208. package/types/forty-cdk-slider.d.ts +379 -0
  209. package/types/forty-cdk-stepper.d.ts +650 -0
  210. package/types/forty-cdk-switch.d.ts +87 -0
  211. package/types/forty-cdk-table.d.ts +723 -0
  212. package/types/forty-cdk-tabs.d.ts +235 -0
  213. package/types/forty-cdk-time-field.d.ts +307 -0
  214. package/types/forty-cdk-time-picker.d.ts +578 -0
  215. package/types/forty-cdk-toast.d.ts +598 -0
  216. package/types/forty-cdk-toggle.d.ts +310 -0
  217. package/types/forty-cdk-toolbar.d.ts +217 -0
  218. package/types/forty-cdk-tooltip.d.ts +436 -0
  219. package/types/forty-cdk-tree.d.ts +688 -0
  220. package/types/forty-cdk.d.ts +1 -19743
@@ -0,0 +1,313 @@
1
+ import * as forty_cdk_core from 'forty-cdk/core';
2
+ import { MenuActivationModality, MenuOverlayHost, ForMenuContext, FloatingSide, FloatingAlign, WritingDirection, VetoableNativeEvent, VetoableEvent } from 'forty-cdk/core';
3
+ import * as _angular_core from '@angular/core';
4
+ import { InjectionToken, Signal, Provider } from '@angular/core';
5
+ import { ReferenceElement } from '@floating-ui/dom';
6
+
7
+ /**
8
+ * Coordination contract `[forContextMenuTrigger]` resolves from its enclosing
9
+ * `[forContextMenu]` root. It exposes exactly the slice of the root the
10
+ * trigger consumes: open / disabled state, trigger registration (for
11
+ * return-focus on close), the pointer / keyboard virtual-anchor setters, and
12
+ * the open entry point.
13
+ *
14
+ * `ForContextMenu` provides it via `useExisting`, so a subclassed root (the
15
+ * standard design-system wrapping pattern) only has to re-provide tokens —
16
+ * `FOR_MENU_CONTEXT` for items / content and `FOR_CONTEXT_MENU_CONTEXT` for
17
+ * the trigger — never a concrete-class alias.
18
+ */
19
+ interface ForContextMenuContext {
20
+ /**
21
+ * Whether the menu is currently shown. Read-only at the contract level —
22
+ * the root backs it with its own `model<boolean>` and writes through its
23
+ * `openMenu` / `closeMenu` plumbing; the trigger only ever reads.
24
+ */
25
+ readonly open: Signal<boolean>;
26
+ /**
27
+ * When `true`, trigger activations are no-ops and the `contextmenu` event
28
+ * falls through to the native browser menu.
29
+ */
30
+ readonly disabled: Signal<boolean>;
31
+ /** Registers the trigger element so it receives return-focus on close. */
32
+ registerTrigger(el: HTMLElement): void;
33
+ /** Unregisters a previously registered trigger element. */
34
+ unregisterTrigger(el: HTMLElement): void;
35
+ /** Updates the virtual anchor to a 0×0 rect at (`x`, `y`) in viewport coordinates. */
36
+ setVirtualAnchor(x: number, y: number): void;
37
+ /**
38
+ * Updates the virtual anchor to a by-value snapshot of `rect`. Used by the
39
+ * keyboard activators (`Shift+F10`, the `ContextMenu` key) so the menu
40
+ * floats off the focused element instead of the pointer position.
41
+ */
42
+ setVirtualAnchorFromRect(rect: DOMRect): void;
43
+ /**
44
+ * Opens the menu and sends focus to its first or last enabled item
45
+ * (default `'first'`). Honours `disabled`. `modality` (default
46
+ * `'keyboard'`) records how the open was activated: a `'pointer'` open
47
+ * (right-click / long-press) keeps the programmatic initial focus from
48
+ * reflecting `data-highlighted`, while a `'keyboard'` open (`Shift+F10`,
49
+ * the `ContextMenu` key) highlights the focused item.
50
+ */
51
+ openMenu(initialFocus?: 'first' | 'last', modality?: MenuActivationModality): void;
52
+ }
53
+ /**
54
+ * Token under which `[forContextMenu]` exposes the {@link ForContextMenuContext}
55
+ * surface to its `[forContextMenuTrigger]`. Subclassed roots re-provide it with
56
+ * `{ provide: FOR_CONTEXT_MENU_CONTEXT, useExisting: MySubclass }`.
57
+ */
58
+ declare const FOR_CONTEXT_MENU_CONTEXT: InjectionToken<ForContextMenuContext>;
59
+
60
+ /**
61
+ * Headless implementation of a right-click / `Shift+F10` menu (variant of
62
+ * the [WAI-ARIA Menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/)).
63
+ * Apply on a wrapper that contains a `[forContextMenuTrigger]` and an
64
+ * `@if`-mounted `[forMenuContent]`.
65
+ *
66
+ * The menu is positioned at the pointer location at the time of the
67
+ * `contextmenu` event — implemented via floating-ui's virtual element so
68
+ * placement / flip / shift middleware still apply normally. Selecting an
69
+ * item, Escape, or any outside interaction closes.
70
+ *
71
+ * ```html
72
+ * <div forContextMenu [(open)]="open">
73
+ * <div forContextMenuTrigger class="region">Right-click here</div>
74
+ * @if (open()) {
75
+ * <div forMenuContent>…</div>
76
+ * }
77
+ * </div>
78
+ * ```
79
+ *
80
+ * Most of the directive's body (id generation, item collection, typeahead,
81
+ * navigate / focus helpers, escape / outside-click veto plumbing) is owned
82
+ * by the shared `_internal/menu-overlay` helper. The directive contributes
83
+ * the inputs / outputs / model that make up the public surface, the
84
+ * pointer-driven `VirtualElement` anchor (`setVirtualAnchor` /
85
+ * `setVirtualAnchorFromRect`), and the contextmenu-specific dismissable
86
+ * semantics (no exemption — a left-click on the right-click region while
87
+ * the menu is open should close it).
88
+ */
89
+ declare class ForContextMenu extends MenuOverlayHost implements ForMenuContext, ForContextMenuContext {
90
+ #private;
91
+ readonly open: _angular_core.ModelSignal<boolean>;
92
+ /**
93
+ * Side the menu is anchored to relative to the pointer. Defaults to
94
+ * `'bottom'`. Pair with `align` for the full positioning API.
95
+ *
96
+ * One of the floating-ui positioning inputs shared verbatim across the
97
+ * three menu roots — their non-seed defaults come from the single
98
+ * `MENU_POSITIONING_DEFAULTS` source and `menu-positioning-inputs.spec.ts`
99
+ * guards the three roots against drift.
100
+ */
101
+ readonly side: _angular_core.InputSignal<FloatingSide | undefined>;
102
+ /** Alignment along the chosen `side`. Defaults to `'start'`. */
103
+ readonly align: _angular_core.InputSignal<FloatingAlign | undefined>;
104
+ /**
105
+ * Gap (px) along the main axis. Default `0`. The default is read from
106
+ * `provideForContextMenuDefaults` for the surrounding scope.
107
+ */
108
+ readonly sideOffset: _angular_core.InputSignalWithTransform<number, unknown>;
109
+ /** Gap (px) along the cross axis. Default `0`. */
110
+ readonly alignOffset: _angular_core.InputSignalWithTransform<number, unknown>;
111
+ /** When `true` (default), `flip` and `shift` keep the menu inside the viewport. */
112
+ readonly avoidCollisions: _angular_core.InputSignalWithTransform<boolean, unknown>;
113
+ /**
114
+ * Padding (px) applied uniformly to flip / shift / size. Default `8`.
115
+ * The default is read from `provideForContextMenuDefaults` for the
116
+ * surrounding scope.
117
+ */
118
+ readonly collisionPadding: _angular_core.InputSignalWithTransform<number, unknown>;
119
+ /** Padding (px) for the `arrow` middleware. Default `0`. */
120
+ readonly arrowPadding: _angular_core.InputSignalWithTransform<number, unknown>;
121
+ /** Stickiness behaviour for `shift`. Default `'partial'`. */
122
+ readonly sticky: _angular_core.InputSignal<false | "partial" | "always">;
123
+ /** When `true`, sets `data-detached=""` while the virtual anchor is off-screen. */
124
+ readonly hideWhenDetached: _angular_core.InputSignalWithTransform<boolean, unknown>;
125
+ /**
126
+ * When `true` (default), the menu is clipped until floating-ui resolves
127
+ * its first position, preventing a flash at the viewport corner. Set to
128
+ * `false` so a dramatic `animate.enter` plays from its first frame.
129
+ */
130
+ readonly clipUntilPositioned: _angular_core.InputSignalWithTransform<boolean, unknown>;
131
+ /**
132
+ * When `true` (default), arrow-key navigation wraps from the last enabled
133
+ * item back to the first (and vice versa). When `false`, navigation stops
134
+ * at the ends.
135
+ */
136
+ readonly loop: _angular_core.InputSignalWithTransform<boolean, unknown>;
137
+ /**
138
+ * Writing direction. Drives ArrowLeft / ArrowRight semantics on submenu
139
+ * triggers and items underneath this menu (in RTL, ArrowLeft opens a submenu
140
+ * and ArrowRight closes it back). When unset (default `null`), the inherited
141
+ * ambient direction is resolved from the nearest ancestor carrying a `dir`
142
+ * attribute (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]`
143
+ * always wins, the resolved value is reflected to the host `dir` attribute,
144
+ * and it is inherited by descendant submenus.
145
+ */
146
+ readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
147
+ readonly dir: _angular_core.Signal<WritingDirection>;
148
+ /**
149
+ * When true, the contextmenu event is allowed to fall through to the
150
+ * native browser menu. Useful for letting the OS-provided context menu
151
+ * appear on certain regions while keeping the directive mounted.
152
+ */
153
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
154
+ /** When true (default), Escape, pointer-down outside, and focus outside close the menu. */
155
+ readonly dismissible: _angular_core.InputSignalWithTransform<boolean, unknown>;
156
+ /** When true (default), focus returns to the right-click target on close. */
157
+ readonly returnFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
158
+ /** Manual `aria-label` on `[forMenuContent]`. Use when there is no meaningful labelling element. */
159
+ readonly ariaLabel: _angular_core.InputSignal<string | null>;
160
+ /**
161
+ * Fires when Escape is pressed while the menu is open, just before it
162
+ * closes. Call `preventDefault()` on the emitted veto to keep the menu
163
+ * open and suppress the Escape-driven close.
164
+ */
165
+ readonly escapeKeyDown: _angular_core.OutputEmitterRef<VetoableNativeEvent<KeyboardEvent>>;
166
+ /**
167
+ * Fires on a pointer-down outside the menu, just before it closes. Call
168
+ * `preventDefault()` on the veto to keep the menu open.
169
+ */
170
+ readonly pointerDownOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<PointerEvent>>;
171
+ /**
172
+ * Fires when focus moves outside the menu, just before it closes. Call
173
+ * `preventDefault()` on the veto to keep the menu open.
174
+ */
175
+ readonly focusOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<FocusEvent>>;
176
+ /**
177
+ * Composite outside-interaction channel: fires for either a
178
+ * pointer-down-outside or a focus-outside, just before the menu closes.
179
+ * Call `preventDefault()` on the veto to keep the menu open regardless of
180
+ * which interaction triggered it.
181
+ */
182
+ readonly interactOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<PointerEvent | FocusEvent>>;
183
+ /**
184
+ * Fires just before the menu sends focus to its first / last enabled
185
+ * item on mount. Call `preventDefault()` on the emitted veto to skip
186
+ * the imperative focus move.
187
+ */
188
+ readonly autoFocusOnOpen: _angular_core.OutputEmitterRef<VetoableEvent>;
189
+ /**
190
+ * Fires just before focus returns to the trigger on unmount. Call
191
+ * `preventDefault()` on the veto to suppress the return-focus.
192
+ */
193
+ readonly autoFocusOnClose: _angular_core.OutputEmitterRef<VetoableEvent>;
194
+ protected readonly _overlay: forty_cdk_core.MenuOverlay<forty_cdk_core.MenuItemHandle>;
195
+ readonly anchor: _angular_core.Signal<ReferenceElement | null>;
196
+ /**
197
+ * ContextMenu exempts nothing — a left-click on the right-click region
198
+ * while the menu is open should close it like any other outside click.
199
+ */
200
+ readonly dismissableExemptions: _angular_core.Signal<readonly HTMLElement[]>;
201
+ /** Top-level: no parent menu. */
202
+ readonly parentMenu: null;
203
+ /** Updates the virtual anchor to a 0×0 rect at (`x`, `y`) in viewport coordinates. */
204
+ setVirtualAnchor(x: number, y: number): void;
205
+ /**
206
+ * Updates the virtual anchor to a snapshot of `rect`. Used by the keyboard
207
+ * activators (`Shift+F10`, `ContextMenu` key) so the menu floats off the
208
+ * focused element instead of the pointer position. The rect is captured
209
+ * by value, so subsequent layout changes don't shift the anchor.
210
+ */
211
+ setVirtualAnchorFromRect(rect: DOMRect): void;
212
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForContextMenu, never>;
213
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForContextMenu, "[forContextMenu]", ["forContextMenu"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "avoidCollisions": { "alias": "avoidCollisions"; "required": false; "isSignal": true; }; "collisionPadding": { "alias": "collisionPadding"; "required": false; "isSignal": true; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; "isSignal": true; }; "sticky": { "alias": "sticky"; "required": false; "isSignal": true; }; "hideWhenDetached": { "alias": "hideWhenDetached"; "required": false; "isSignal": true; }; "clipUntilPositioned": { "alias": "clipUntilPositioned"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "returnFocus": { "alias": "returnFocus"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "autoFocusOnOpen": "autoFocusOnOpen"; "autoFocusOnClose": "autoFocusOnClose"; }, never, never, true, never>;
214
+ }
215
+
216
+ /**
217
+ * Region that opens its parent `[forContextMenu]` on the `contextmenu` event
218
+ * (right-click / long-press on touch) and on the keyboard equivalents
219
+ * `Shift+F10` and the dedicated `ContextMenu` key. Pointer activations are
220
+ * anchored at the cursor; keyboard activations are anchored at the bounding
221
+ * rect of the focused element, so screen-reader / keyboard-only users get
222
+ * the menu next to whatever they're working on. The native context menu is
223
+ * suppressed via `event.preventDefault()`.
224
+ *
225
+ * Modality is detected by whether a `pointerdown` preceded the `contextmenu`
226
+ * event: a genuine right-click / long-press always has one, while the
227
+ * `contextmenu` some browsers synthesize for `Shift+F10` / the `ContextMenu`
228
+ * key does not. A pointer activation anchors at the cursor and skips
229
+ * `data-highlighted` on the initially focused item; a keyboard activation
230
+ * anchors at the focused element's rect and highlights it. The synthesized
231
+ * `contextmenu` that trails an already-handled keydown is swallowed so it
232
+ * cannot demote the rect anchor to a 0x0 point at the keyboard coordinates.
233
+ *
234
+ * Apply on any element. A default `tabindex="-1"` is host-bound so the
235
+ * trigger can receive programmatic focus and return-focus works out of the
236
+ * box on close — no consumer setup required. The default is overridable:
237
+ * set your own `tabindex` (e.g. `tabindex="0"` to put the trigger in the
238
+ * Tab order) and it wins. The keyboard activators (`Shift+F10`, the
239
+ * `ContextMenu` key) need the trigger — or something inside it — focusable,
240
+ * which the default guarantees.
241
+ *
242
+ * The root is normally resolved via DI from the enclosing `[forContextMenu]`.
243
+ * When the trigger is declared inside an `ng-template` stamped into the root
244
+ * (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration
245
+ * site and misses the root — pass it explicitly through the selector input,
246
+ * `routerLink`-style: `[forContextMenuTrigger]="root"` with
247
+ * `#root="forContextMenu"`.
248
+ *
249
+ * Disabling merges the trigger's own `disabled` input OR the root's
250
+ * `disabled`. When disabled, only `data-disabled` is reflected as a styling /
251
+ * state hook. The trigger is a generic region with no interactive ARIA role,
252
+ * so it emits neither the native `disabled` attribute (which applies only to
253
+ * form controls) nor `aria-disabled` (which is meaningful only on an
254
+ * interactive role); the disabled behaviour is enforced by the in-handler
255
+ * guards, which let the native browser menu show through instead.
256
+ */
257
+ declare class ForContextMenuTrigger {
258
+ #private;
259
+ /**
260
+ * Optional explicit reference to the `[forContextMenu]` root, named after
261
+ * the selector `routerLink`-style. The bare valueless attribute keeps
262
+ * resolving the enclosing root via DI; pass the root explicitly
263
+ * (`[forContextMenuTrigger]="root"`, with `#root="forContextMenu"`) when
264
+ * the trigger is declared in an `ng-template` stamped inside the root —
265
+ * DI resolves at the template's declaration site, so the enclosing root
266
+ * is invisible there. The empty string (what the valueless attribute
267
+ * yields) is treated as unset.
268
+ */
269
+ readonly forContextMenuTrigger: _angular_core.InputSignal<"" | ForContextMenuContext>;
270
+ protected readonly ctx: _angular_core.Signal<ForContextMenuContext>;
271
+ /** Disables this trigger only, in addition to the root's `disabled`. */
272
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
273
+ /** Whether the trigger is disabled — its own `disabled` input OR the root's. */
274
+ readonly effectiveDisabled: _angular_core.Signal<boolean>;
275
+ constructor();
276
+ protected onPointerDown(): void;
277
+ protected onContextMenu(event: MouseEvent): void;
278
+ protected onKeyDown(event: KeyboardEvent): void;
279
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForContextMenuTrigger, never>;
280
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForContextMenuTrigger, "[forContextMenuTrigger]", ["forContextMenuTrigger"], { "forContextMenuTrigger": { "alias": "forContextMenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
281
+ }
282
+
283
+ /**
284
+ * Defaults inherited by descendant context menus in the surrounding
285
+ * injector scope. Configure with `provideForContextMenuDefaults` either
286
+ * at the application root or in any component's `providers` array; partial
287
+ * overrides merge with the parent scope.
288
+ */
289
+ interface ForContextMenuDefaults {
290
+ /**
291
+ * Distance (px) between the virtual anchor (pointer position) and the
292
+ * floating content along the resolved `side` axis. Defaults to `0`
293
+ * since context menus open at the cursor.
294
+ */
295
+ sideOffset: number;
296
+ /**
297
+ * Padding (px) added to the viewport edges for collision-aware
298
+ * positioning. Higher values keep the floating content further from
299
+ * the edge when `flip` / `shift` runs.
300
+ */
301
+ collisionPadding: number;
302
+ }
303
+ /** Token holding the resolved context-menu defaults for the current scope. */
304
+ declare const FOR_CONTEXT_MENU_DEFAULTS: _angular_core.InjectionToken<ForContextMenuDefaults>;
305
+ /**
306
+ * Configures forty-cdk context-menu defaults for this injector scope.
307
+ * Partial overrides inherit unspecified keys from the parent scope (or
308
+ * library defaults at the root).
309
+ */
310
+ declare function provideForContextMenuDefaults(defaults?: Partial<ForContextMenuDefaults>): Provider[];
311
+
312
+ export { FOR_CONTEXT_MENU_CONTEXT, FOR_CONTEXT_MENU_DEFAULTS, ForContextMenu, ForContextMenuTrigger, provideForContextMenuDefaults };
313
+ export type { ForContextMenuContext, ForContextMenuDefaults };