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.
- package/accordion/README.md +122 -0
- package/aspect-ratio/README.md +76 -0
- package/avatar/README.md +100 -0
- package/breadcrumbs/README.md +49 -0
- package/breakpoints/README.md +81 -0
- package/button/README.md +49 -0
- package/calendar/README.md +458 -0
- package/carousel/README.md +358 -0
- package/checkbox/README.md +146 -0
- package/combobox/README.md +535 -0
- package/context-menu/README.md +139 -0
- package/date-field/README.md +184 -0
- package/date-picker/README.md +338 -0
- package/dialog/README.md +388 -0
- package/disclosure/README.md +114 -0
- package/drag-drop/README.md +359 -0
- package/drawer/README.md +560 -0
- package/dropdown-menu/README.md +176 -0
- package/fesm2022/forty-cdk-accordion.mjs +348 -0
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
- package/fesm2022/forty-cdk-avatar.mjs +308 -0
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
- package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
- package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
- package/fesm2022/forty-cdk-button.mjs +134 -0
- package/fesm2022/forty-cdk-button.mjs.map +1 -0
- package/fesm2022/forty-cdk-calendar.mjs +2034 -0
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
- package/fesm2022/forty-cdk-carousel.mjs +968 -0
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
- package/fesm2022/forty-cdk-checkbox.mjs +226 -0
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-combobox.mjs +2596 -0
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
- package/fesm2022/forty-cdk-context-menu.mjs +413 -0
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-core.mjs +9022 -0
- package/fesm2022/forty-cdk-core.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-field.mjs +744 -0
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-dialog.mjs +707 -0
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
- package/fesm2022/forty-cdk-disclosure.mjs +190 -0
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
- package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
- package/fesm2022/forty-cdk-drawer.mjs +1641 -0
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-field.mjs +425 -0
- package/fesm2022/forty-cdk-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-fieldset.mjs +164 -0
- package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
- package/fesm2022/forty-cdk-file-upload.mjs +221 -0
- package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
- package/fesm2022/forty-cdk-hover-card.mjs +496 -0
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
- package/fesm2022/forty-cdk-input.mjs +274 -0
- package/fesm2022/forty-cdk-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +1279 -0
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-menu.mjs +1439 -0
- package/fesm2022/forty-cdk-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-menubar.mjs +787 -0
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
- package/fesm2022/forty-cdk-meter.mjs +211 -0
- package/fesm2022/forty-cdk-meter.mjs.map +1 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-number-input.mjs +559 -0
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-otp-input.mjs +527 -0
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-pagination.mjs +323 -0
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
- package/fesm2022/forty-cdk-popover.mjs +698 -0
- package/fesm2022/forty-cdk-popover.mjs.map +1 -0
- package/fesm2022/forty-cdk-progress.mjs +226 -0
- package/fesm2022/forty-cdk-progress.mjs.map +1 -0
- package/fesm2022/forty-cdk-radio-group.mjs +378 -0
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
- package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
- package/fesm2022/forty-cdk-search.mjs +205 -0
- package/fesm2022/forty-cdk-search.mjs.map +1 -0
- package/fesm2022/forty-cdk-select.mjs +1661 -0
- package/fesm2022/forty-cdk-select.mjs.map +1 -0
- package/fesm2022/forty-cdk-separator.mjs +82 -0
- package/fesm2022/forty-cdk-separator.mjs.map +1 -0
- package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
- package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
- package/fesm2022/forty-cdk-slider.mjs +803 -0
- package/fesm2022/forty-cdk-slider.mjs.map +1 -0
- package/fesm2022/forty-cdk-stepper.mjs +886 -0
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
- package/fesm2022/forty-cdk-switch.mjs +137 -0
- package/fesm2022/forty-cdk-switch.mjs.map +1 -0
- package/fesm2022/forty-cdk-table.mjs +1518 -0
- package/fesm2022/forty-cdk-table.mjs.map +1 -0
- package/fesm2022/forty-cdk-tabs.mjs +400 -0
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-field.mjs +593 -0
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-toast.mjs +1153 -0
- package/fesm2022/forty-cdk-toast.mjs.map +1 -0
- package/fesm2022/forty-cdk-toggle.mjs +516 -0
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
- package/fesm2022/forty-cdk-toolbar.mjs +374 -0
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
- package/fesm2022/forty-cdk-tooltip.mjs +672 -0
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
- package/fesm2022/forty-cdk-tree.mjs +2007 -0
- package/fesm2022/forty-cdk-tree.mjs.map +1 -0
- package/fesm2022/forty-cdk-virtualization.mjs +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk.mjs +0 -43310
- package/fesm2022/forty-cdk.mjs.map +1 -1
- package/field/README.md +97 -0
- package/fieldset/README.md +86 -0
- package/file-upload/README.md +73 -0
- package/hover-card/README.md +171 -0
- package/input/README.md +156 -0
- package/listbox/README.md +424 -0
- package/menu/README.md +181 -0
- package/menubar/README.md +140 -0
- package/meter/README.md +128 -0
- package/navigation-menu/README.md +253 -0
- package/number-input/README.md +171 -0
- package/otp-input/README.md +198 -0
- package/package.json +213 -1
- package/pagination/README.md +61 -0
- package/pane-resizer/README.md +136 -0
- package/popover/README.md +262 -0
- package/progress/README.md +115 -0
- package/radio-group/README.md +129 -0
- package/scroll-area/README.md +184 -0
- package/search/README.md +42 -0
- package/select/README.md +488 -0
- package/separator/README.md +84 -0
- package/signal-forms/README.md +72 -0
- package/slider/README.md +152 -0
- package/stepper/README.md +292 -0
- package/switch/README.md +116 -0
- package/table/README.md +769 -0
- package/tabs/README.md +130 -0
- package/time-field/README.md +157 -0
- package/time-picker/README.md +172 -0
- package/toast/README.md +398 -0
- package/toggle/README.md +224 -0
- package/toolbar/README.md +109 -0
- package/tooltip/README.md +274 -0
- package/tree/README.md +708 -0
- package/types/forty-cdk-accordion.d.ts +242 -0
- package/types/forty-cdk-aspect-ratio.d.ts +59 -0
- package/types/forty-cdk-avatar.d.ts +133 -0
- package/types/forty-cdk-breadcrumbs.d.ts +92 -0
- package/types/forty-cdk-breakpoints.d.ts +141 -0
- package/types/forty-cdk-button.d.ts +80 -0
- package/types/forty-cdk-calendar.d.ts +914 -0
- package/types/forty-cdk-carousel.d.ts +530 -0
- package/types/forty-cdk-checkbox.d.ts +141 -0
- package/types/forty-cdk-combobox.d.ts +1259 -0
- package/types/forty-cdk-context-menu.d.ts +313 -0
- package/types/forty-cdk-core.d.ts +5774 -0
- package/types/forty-cdk-date-field.d.ts +307 -0
- package/types/forty-cdk-date-picker.d.ts +622 -0
- package/types/forty-cdk-dialog.d.ts +546 -0
- package/types/forty-cdk-disclosure.d.ts +127 -0
- package/types/forty-cdk-drag-drop.d.ts +456 -0
- package/types/forty-cdk-drawer.d.ts +871 -0
- package/types/forty-cdk-dropdown-menu.d.ts +242 -0
- package/types/forty-cdk-field.d.ts +236 -0
- package/types/forty-cdk-fieldset.d.ts +119 -0
- package/types/forty-cdk-file-upload.d.ts +124 -0
- package/types/forty-cdk-hover-card.d.ts +320 -0
- package/types/forty-cdk-input.d.ts +169 -0
- package/types/forty-cdk-internationalized-date.d.ts +1 -1
- package/types/forty-cdk-listbox.d.ts +513 -0
- package/types/forty-cdk-menu.d.ts +629 -0
- package/types/forty-cdk-menubar.d.ts +451 -0
- package/types/forty-cdk-meter.d.ts +122 -0
- package/types/forty-cdk-navigation-menu.d.ts +514 -0
- package/types/forty-cdk-number-input.d.ts +319 -0
- package/types/forty-cdk-otp-input.d.ts +248 -0
- package/types/forty-cdk-pagination.d.ts +214 -0
- package/types/forty-cdk-pane-resizer.d.ts +145 -0
- package/types/forty-cdk-popover.d.ts +509 -0
- package/types/forty-cdk-progress.d.ts +143 -0
- package/types/forty-cdk-radio-group.d.ts +222 -0
- package/types/forty-cdk-scroll-area.d.ts +258 -0
- package/types/forty-cdk-search.d.ts +142 -0
- package/types/forty-cdk-select.d.ts +899 -0
- package/types/forty-cdk-separator.d.ts +59 -0
- package/types/forty-cdk-signal-forms.d.ts +58 -0
- package/types/forty-cdk-slider.d.ts +379 -0
- package/types/forty-cdk-stepper.d.ts +650 -0
- package/types/forty-cdk-switch.d.ts +87 -0
- package/types/forty-cdk-table.d.ts +723 -0
- package/types/forty-cdk-tabs.d.ts +235 -0
- package/types/forty-cdk-time-field.d.ts +307 -0
- package/types/forty-cdk-time-picker.d.ts +578 -0
- package/types/forty-cdk-toast.d.ts +598 -0
- package/types/forty-cdk-toggle.d.ts +310 -0
- package/types/forty-cdk-toolbar.d.ts +217 -0
- package/types/forty-cdk-tooltip.d.ts +436 -0
- package/types/forty-cdk-tree.d.ts +688 -0
- 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 };
|