@radix-ng/primitives 1.0.0-beta.2 → 1.0.0-beta.4
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/LICENSE +1 -1
- package/README.md +76 -6
- package/fesm2022/radix-ng-primitives-accordion.mjs +5 -3
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +31 -24
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +1744 -0
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +1399 -606
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +13 -4
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +51 -10
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +1345 -64
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +271 -145
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +70 -0
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +519 -184
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +154 -64
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +3 -2
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +517 -0
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +296 -70
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +894 -299
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +32 -4
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +176 -207
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +250 -250
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +94 -45
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +107 -17
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +262 -79
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +172 -218
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +4 -2
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +5 -4
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +303 -234
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +5 -3
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +5 -3
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +15 -36
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +105 -145
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +14 -1
- package/types/radix-ng-primitives-accordion.d.ts +4 -3
- package/types/radix-ng-primitives-alert-dialog.d.ts +17 -11
- package/types/radix-ng-primitives-autocomplete.d.ts +661 -0
- package/types/radix-ng-primitives-calendar.d.ts +5 -3
- package/types/radix-ng-primitives-combobox.d.ts +727 -293
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +15 -5
- package/types/radix-ng-primitives-core.d.ts +762 -14
- package/types/radix-ng-primitives-date-field.d.ts +3 -2
- package/types/radix-ng-primitives-dialog.d.ts +107 -55
- package/types/radix-ng-primitives-direction-provider.d.ts +41 -0
- package/types/radix-ng-primitives-dismissable-layer.d.ts +147 -99
- package/types/radix-ng-primitives-drawer.d.ts +49 -22
- package/types/radix-ng-primitives-field.d.ts +1 -0
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +175 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +132 -1
- package/types/radix-ng-primitives-menu.d.ts +204 -112
- package/types/radix-ng-primitives-navigation-menu.d.ts +61 -101
- package/types/radix-ng-primitives-popover.d.ts +82 -115
- package/types/radix-ng-primitives-popper.d.ts +46 -10
- package/types/radix-ng-primitives-portal.d.ts +53 -8
- package/types/radix-ng-primitives-presence.d.ts +98 -17
- package/types/radix-ng-primitives-preview-card.d.ts +63 -95
- package/types/radix-ng-primitives-roving-focus.d.ts +7 -6
- package/types/radix-ng-primitives-scroll-area.d.ts +2 -2
- package/types/radix-ng-primitives-select.d.ts +192 -158
- package/types/radix-ng-primitives-slider.d.ts +5 -4
- package/types/radix-ng-primitives-stepper.d.ts +4 -3
- package/types/radix-ng-primitives-time-field.d.ts +3 -2
- package/types/radix-ng-primitives-toast.d.ts +7 -7
- package/types/radix-ng-primitives-toggle-group.d.ts +5 -4
- package/types/radix-ng-primitives-toolbar.d.ts +3 -2
- package/types/radix-ng-primitives-tooltip.d.ts +48 -84
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Signal, Injector, InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Operations the host directive supplies to {@link PresenceMachine}. The machine owns *when* the
|
|
6
|
+
* view is mounted/unmounted (the state transitions and exit-animation suspension); the host owns
|
|
7
|
+
* *how* — `RdxPresenceDirective` simply creates the embedded view in place, while `RdxPortalPresence`
|
|
8
|
+
* additionally relocates its root nodes into a portal container.
|
|
9
|
+
*/
|
|
10
|
+
interface PresenceMachineHost {
|
|
11
|
+
/** Reactive `present` flag driving the machine. */
|
|
12
|
+
readonly present: Signal<boolean>;
|
|
13
|
+
/** Whether we are running in a browser (animation/computed-style logic is skipped on the server). */
|
|
14
|
+
readonly isBrowser: boolean;
|
|
15
|
+
/** Injection context for the internal `effect` / `afterNextRender`. */
|
|
16
|
+
readonly injector: Injector;
|
|
17
|
+
/**
|
|
18
|
+
* Create (and, for the portal, relocate) the view. Returns the root `HTMLElement` nodes whose
|
|
19
|
+
* exit animations should suspend the unmount. For a single-root template this is one element —
|
|
20
|
+
* identical to the previous single-node behavior; dialog-shaped templates return backdrop + popup.
|
|
21
|
+
*/
|
|
22
|
+
mountView(): HTMLElement[];
|
|
23
|
+
/** Destroy the view (Angular removes the nodes from wherever they currently live). */
|
|
24
|
+
destroyView(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Reusable presence state machine extracted from `RdxPresenceDirective`. It keeps content mounted
|
|
28
|
+
* while a CSS exit animation runs anywhere inside the template — a `@keyframes` **or** a
|
|
29
|
+
* `transition` (`data-ending-style`), on a watched root **or any of its descendants** — and unmounts
|
|
30
|
+
* only once every exit animation started by the close has finished. With no exit animation it
|
|
31
|
+
* unmounts immediately. For a single watched node and a root-level keyframe this reduces exactly to
|
|
32
|
+
* the original `RdxPresenceDirective` behavior.
|
|
33
|
+
*
|
|
34
|
+
* Detection (ADR 0011) uses the Web Animations API: when `present()` flips `false` we snapshot a
|
|
35
|
+
* close timestamp, and after the next render collect `node.getAnimations({ subtree: true })`, keeping
|
|
36
|
+
* only animations that are running/pending and were *started by* the close (`startTime` null or
|
|
37
|
+
* `>= closeTimestamp`). The view stays mounted until all of their `finished` promises settle, bounded
|
|
38
|
+
* by a duration-based safety net. The legacy root-level computed-`animationName` check and the
|
|
39
|
+
* `animationstart`/`animationend` listeners are kept as an additional acceptor — they drive the
|
|
40
|
+
* zoneless jsdom suites (where `getAnimations` is absent) and cost nothing in a real browser.
|
|
41
|
+
*/
|
|
42
|
+
declare class PresenceMachine {
|
|
43
|
+
private readonly host;
|
|
44
|
+
private state;
|
|
45
|
+
private prevPresent;
|
|
46
|
+
/** Root nodes currently watched for exit animations (set on mount). */
|
|
47
|
+
private nodes;
|
|
48
|
+
/** Last-seen computed `animationName` per node, used to detect a *fresh* root exit animation. */
|
|
49
|
+
private readonly prevAnimationNames;
|
|
50
|
+
/** Root nodes whose exit animation the event path is still waiting on (jsdom / root-keyframe). */
|
|
51
|
+
private readonly pendingExits;
|
|
52
|
+
private removeListeners;
|
|
53
|
+
/**
|
|
54
|
+
* Timeline time captured the moment `present` flipped `false`, on the same clock as
|
|
55
|
+
* `Animation.startTime`. Animations started at or after it are the exit animations.
|
|
56
|
+
*/
|
|
57
|
+
private closeTimestamp;
|
|
58
|
+
/**
|
|
59
|
+
* Monotonic counter bumped on every mount/unmount transition. A suspended exit captures it and
|
|
60
|
+
* its `finished`/safety-net resolution is ignored if it changed in the meantime (re-open or a
|
|
61
|
+
* second close), so a stale promise can never tear down a freshly-reopened view.
|
|
62
|
+
*/
|
|
63
|
+
private exitVersion;
|
|
64
|
+
/** True while a WAAPI `finished`-promise wait owns completion; gates the event path off. */
|
|
65
|
+
private waapiPending;
|
|
66
|
+
private safetyTimer;
|
|
67
|
+
constructor(host: PresenceMachineHost);
|
|
68
|
+
/** Tear the machine down — destroys the view. Call from the host's `DestroyRef`. */
|
|
69
|
+
dispose(): void;
|
|
70
|
+
/** Decides whether to suspend the unmount for an exit animation (port of Radix' logic). */
|
|
71
|
+
private evaluateExit;
|
|
72
|
+
/**
|
|
73
|
+
* Running/pending animations across the watched subtrees that were *started by* the close.
|
|
74
|
+
* Pre-existing animations (an infinite spinner, a settled enter) have an earlier `startTime`
|
|
75
|
+
* and must not delay the unmount.
|
|
76
|
+
*/
|
|
77
|
+
private collectExitAnimations;
|
|
78
|
+
/**
|
|
79
|
+
* Force-completes the exit shortly after the longest declared duration, in case a `finished`
|
|
80
|
+
* promise never settles. Measures the animated targets (falling back to the roots).
|
|
81
|
+
*/
|
|
82
|
+
private armSafetyNet;
|
|
83
|
+
/** Settle a WAAPI/safety-net exit wait, ignoring it if a newer mount/unmount superseded it. */
|
|
84
|
+
private finishExit;
|
|
85
|
+
private clearSafetyNet;
|
|
86
|
+
private send;
|
|
87
|
+
private mount;
|
|
88
|
+
private unmount;
|
|
89
|
+
private addAnimationListeners;
|
|
90
|
+
private getAnimationName;
|
|
91
|
+
/** Current timeline time on the same clock as `Animation.startTime` (ms), or 0 if unavailable. */
|
|
92
|
+
private now;
|
|
93
|
+
}
|
|
3
94
|
|
|
4
95
|
/**
|
|
5
96
|
* Context interface for RdxPresence directive
|
|
@@ -25,31 +116,21 @@ declare function provideRdxPresenceContext(contextFactory: () => RdxPresenceCont
|
|
|
25
116
|
* Unlike a plain `*ngIf`, it keeps the content mounted while a CSS exit animation
|
|
26
117
|
* (`@keyframes` applied for the closed state) is running, and unmounts it only once that
|
|
27
118
|
* animation finishes. If the content has no exit animation, it unmounts immediately.
|
|
119
|
+
*
|
|
120
|
+
* The mount/unmount-with-exit logic lives in the shared {@link PresenceMachine}; this directive just
|
|
121
|
+
* creates the embedded view in place (`RdxPortalPresence` reuses the same machine and additionally
|
|
122
|
+
* relocates the view into a portal container).
|
|
28
123
|
*/
|
|
29
124
|
declare class RdxPresenceDirective {
|
|
30
|
-
private readonly context;
|
|
31
125
|
private readonly viewContainerRef;
|
|
32
126
|
private readonly templateRef;
|
|
33
|
-
private readonly injector;
|
|
34
|
-
private readonly isBrowser;
|
|
35
127
|
private viewRef;
|
|
36
|
-
private node;
|
|
37
|
-
private removeListeners;
|
|
38
|
-
private state;
|
|
39
|
-
private prevPresent;
|
|
40
|
-
private prevAnimationName;
|
|
41
128
|
constructor();
|
|
42
|
-
/** Decides whether to suspend the unmount for an exit animation (port of Radix' logic). */
|
|
43
|
-
private evaluateExit;
|
|
44
|
-
private send;
|
|
45
129
|
private mountView;
|
|
46
130
|
private destroyView;
|
|
47
|
-
private addAnimationListeners;
|
|
48
|
-
private getComputedStyles;
|
|
49
|
-
private getAnimationName;
|
|
50
131
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPresenceDirective, never>;
|
|
51
132
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPresenceDirective, never, never, {}, {}, never, never, true, never>;
|
|
52
133
|
}
|
|
53
134
|
|
|
54
|
-
export { RDX_PRESENCE_CONTEXT, RdxPresenceDirective, provideRdxPresenceContext };
|
|
55
|
-
export type { RdxPresenceContext };
|
|
135
|
+
export { PresenceMachine, RDX_PRESENCE_CONTEXT, RdxPresenceDirective, provideRdxPresenceContext };
|
|
136
|
+
export type { PresenceMachineHost, RdxPresenceContext };
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, ElementRef } from '@angular/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/portal';
|
|
4
4
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
5
|
-
import { BooleanInput, NumberInput } from '@radix-ng/primitives/core';
|
|
5
|
+
import { RdxFloatingRootContext, BooleanInput, RdxCancelableChangeEventDetails, NumberInput } from '@radix-ng/primitives/core';
|
|
6
6
|
import * as i1$1 from '@radix-ng/primitives/popper';
|
|
7
|
-
import { RdxPopperContentWrapper
|
|
7
|
+
import { RdxPopperContentWrapper } from '@radix-ng/primitives/popper';
|
|
8
8
|
import * as _radix_ng_primitives_preview_card from '@radix-ng/primitives/preview-card';
|
|
9
|
-
import
|
|
10
|
-
import { RdxPortalContainer } from '@radix-ng/primitives/portal';
|
|
11
|
-
import * as i2 from '@radix-ng/primitives/dismissable-layer';
|
|
9
|
+
import { RdxOutsidePressDomEvent } from '@radix-ng/primitives/dismissable-layer';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
12
|
+
* Structural directive that teleports the preview-card content into a container (default
|
|
13
|
+
* `document.body`) while the card is open, and keeps it mounted until any CSS exit `@keyframes`
|
|
14
|
+
* finishes.
|
|
15
|
+
*
|
|
16
|
+
* Apply it with the `*` microsyntax on the positioner —
|
|
17
|
+
* `<div *rdxPreviewCardPortal rdxPreviewCardPositioner>` — or as an explicit
|
|
18
|
+
* `<ng-template rdxPreviewCardPortal>`. For a custom container use the explicit form with `[container]`.
|
|
15
19
|
*/
|
|
16
|
-
declare class
|
|
17
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
18
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<
|
|
20
|
+
declare class RdxPreviewCardPortal {
|
|
21
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardPortal, never>;
|
|
22
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPortal, "ng-template[rdxPreviewCardPortal]", ["rdxPreviewCardPortal"], {}, {}, never, never, true, [{ directive: typeof i1.RdxPortalPresence; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Dev-mode guard: `rdxPreviewCardPortal` used to be an attribute directive on a `<div>`. It is now
|
|
26
|
+
* structural, so the old `<div rdxPreviewCardPortal>` markup would silently stop portaling — fail
|
|
27
|
+
* loudly instead.
|
|
28
|
+
*/
|
|
29
|
+
declare class RdxPreviewCardPortalMisuseGuard {
|
|
30
|
+
constructor();
|
|
31
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardPortalMisuseGuard, never>;
|
|
32
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPortalMisuseGuard, "[rdxPreviewCardPortal]:not(ng-template)", never, {}, {}, never, never, true, never>;
|
|
19
33
|
}
|
|
20
34
|
|
|
21
35
|
declare class RdxPreviewCardHandle<Payload = unknown> {
|
|
@@ -33,16 +47,19 @@ declare class RdxPreviewCardHandle<Payload = unknown> {
|
|
|
33
47
|
declare function createRdxPreviewCardHandle<Payload = unknown>(): RdxPreviewCardHandle<Payload>;
|
|
34
48
|
|
|
35
49
|
type RdxPreviewCardOpenChangeReason = 'trigger-hover' | 'trigger-focus' | 'trigger-press' | 'outside-press' | 'escape-key' | 'imperative-action' | 'none';
|
|
50
|
+
type RdxPreviewCardOpenChangeEventDetails = RdxCancelableChangeEventDetails<RdxPreviewCardOpenChangeReason>;
|
|
36
51
|
interface RdxPreviewCardOpenChange {
|
|
37
52
|
open: boolean;
|
|
38
53
|
triggerId: string | null;
|
|
39
54
|
trigger: HTMLElement | undefined;
|
|
40
55
|
reason: RdxPreviewCardOpenChangeReason;
|
|
41
56
|
event: Event;
|
|
57
|
+
eventDetails: RdxPreviewCardOpenChangeEventDetails;
|
|
42
58
|
}
|
|
43
59
|
interface RdxPreviewCardRootContext {
|
|
44
60
|
contentId: string;
|
|
45
61
|
isOpen: Signal<boolean>;
|
|
62
|
+
present: Signal<boolean>;
|
|
46
63
|
trigger: Signal<HTMLElement | undefined>;
|
|
47
64
|
triggers: Signal<HTMLElement[]>;
|
|
48
65
|
isHoverActive: Signal<boolean>;
|
|
@@ -73,6 +90,12 @@ type RdxPreviewCardTransitionStatus = 'starting' | 'ending' | undefined;
|
|
|
73
90
|
declare class RdxPreviewCardRoot {
|
|
74
91
|
private readonly popper;
|
|
75
92
|
private readonly destroyRef;
|
|
93
|
+
/**
|
|
94
|
+
* Per-popup floating root context (ADR 0015) — the shared store the popup's dismissal capability
|
|
95
|
+
* reads (`open`, `triggers`, the reference/floating elements). The tree node is registered by the
|
|
96
|
+
* popup; this context exists independently so dismissal can read `open()`.
|
|
97
|
+
*/
|
|
98
|
+
readonly floatingContext: RdxFloatingRootContext;
|
|
76
99
|
/** Shared open/close transition state machine (completes on the real animationend). */
|
|
77
100
|
private readonly transition;
|
|
78
101
|
private hasAppliedDefaultOpen;
|
|
@@ -111,11 +134,13 @@ declare class RdxPreviewCardRoot {
|
|
|
111
134
|
readonly triggers: _angular_core.WritableSignal<HTMLElement[]>;
|
|
112
135
|
readonly payload: _angular_core.WritableSignal<unknown>;
|
|
113
136
|
readonly isPointerDownOnTrigger: _angular_core.WritableSignal<boolean>;
|
|
137
|
+
private readonly preventUnmountOnClose;
|
|
114
138
|
readonly onOpenChange: _angular_core.OutputEmitterRef<RdxPreviewCardOpenChange>;
|
|
115
139
|
readonly onOpenChangeComplete: _angular_core.OutputEmitterRef<boolean>;
|
|
116
140
|
private readonly registeredTriggers;
|
|
117
141
|
private readonly viewportTriggerChange;
|
|
118
142
|
readonly state: Signal<"open" | "closed">;
|
|
143
|
+
readonly present: Signal<boolean>;
|
|
119
144
|
constructor();
|
|
120
145
|
show(trigger?: HTMLElement | undefined, payload?: unknown, triggerId?: string, reason?: RdxPreviewCardOpenChangeReason, event?: Event, fromHover?: boolean): void;
|
|
121
146
|
close(reason?: RdxPreviewCardOpenChangeReason, event?: Event): void;
|
|
@@ -129,7 +154,7 @@ declare class RdxPreviewCardRoot {
|
|
|
129
154
|
registerViewport(onTriggerChange: (previous: HTMLElement, next: HTMLElement) => void): () => boolean;
|
|
130
155
|
registerTransitionElement(element: HTMLElement): () => void;
|
|
131
156
|
private syncTriggerId;
|
|
132
|
-
private
|
|
157
|
+
private createOpenChangeEvent;
|
|
133
158
|
private clearHoverTimers;
|
|
134
159
|
private clearOpenTimer;
|
|
135
160
|
private clearCloseTimer;
|
|
@@ -185,19 +210,6 @@ declare class RdxPreviewCardTrigger {
|
|
|
185
210
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardTrigger, "[rdxPreviewCardTrigger]", never, { "handle": { "alias": "handle"; "required": false; "isSignal": true; }; "payload": { "alias": "payload"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$1.RdxPopperAnchor; inputs: {}; outputs: {}; }]>;
|
|
186
211
|
}
|
|
187
212
|
|
|
188
|
-
/**
|
|
189
|
-
* Moves the preview-card to a different part of the DOM.
|
|
190
|
-
*/
|
|
191
|
-
declare class RdxPreviewCardPortal {
|
|
192
|
-
protected readonly rootContext: _radix_ng_primitives_preview_card.RdxPreviewCardRootContext;
|
|
193
|
-
/**
|
|
194
|
-
* Optional container to portal the content into. Defaults to `document.body`.
|
|
195
|
-
*/
|
|
196
|
-
readonly container: _angular_core.InputSignal<RdxPortalContainer | undefined>;
|
|
197
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardPortal, never>;
|
|
198
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPortal, "[rdxPreviewCardPortal]", never, { "container": { "alias": "container"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$2.RdxPortal; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
213
|
/**
|
|
202
214
|
* An optional backdrop rendered behind the popup.
|
|
203
215
|
*/
|
|
@@ -209,104 +221,60 @@ declare class RdxPreviewCardBackdrop {
|
|
|
209
221
|
|
|
210
222
|
/**
|
|
211
223
|
* Positions the preview-card against its trigger.
|
|
224
|
+
*
|
|
225
|
+
* A "thin" positioner (ADR 0012): it inherits the popper positioning surface (inputs, `placed`
|
|
226
|
+
* output, unified vars + placement attrs) from {@link RdxPopperContentWrapper} and adds preview-card's
|
|
227
|
+
* own concerns — Base UI-aligned defaults via the config provider, the open/closed/instant state
|
|
228
|
+
* attributes, the deprecated `--radix-preview-card-*` aliases, and the grace-area hover bridge.
|
|
212
229
|
*/
|
|
213
|
-
declare class RdxPreviewCardPositioner {
|
|
230
|
+
declare class RdxPreviewCardPositioner extends RdxPopperContentWrapper {
|
|
214
231
|
protected readonly rootContext: _radix_ng_primitives_preview_card.RdxPreviewCardRootContext;
|
|
215
|
-
protected readonly
|
|
216
|
-
private readonly
|
|
232
|
+
protected readonly legacyVars: Record<string, string>;
|
|
233
|
+
private readonly containerRef;
|
|
217
234
|
private readonly triggerEl;
|
|
218
235
|
private readonly containerEl;
|
|
219
236
|
private readonly graceArea;
|
|
220
|
-
/**
|
|
221
|
-
* An element to position the popup against. Defaults to the trigger.
|
|
222
|
-
*/
|
|
223
|
-
readonly anchor: _angular_core.InputSignal<RdxPopperAnchorElement>;
|
|
224
|
-
/**
|
|
225
|
-
* The preferred side of the trigger to render against when open.
|
|
226
|
-
*/
|
|
227
|
-
readonly side: _angular_core.InputSignal<"top" | "right" | "bottom" | "left">;
|
|
228
|
-
/**
|
|
229
|
-
* Distance between the trigger and the popup in pixels.
|
|
230
|
-
*/
|
|
231
|
-
readonly sideOffset: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
232
|
-
/**
|
|
233
|
-
* How to align the popup relative to the specified side.
|
|
234
|
-
*/
|
|
235
|
-
readonly align: _angular_core.InputSignal<"start" | "center" | "end">;
|
|
236
|
-
/**
|
|
237
|
-
* An offset in pixels from the `start` or `end` alignment options.
|
|
238
|
-
*/
|
|
239
|
-
readonly alignOffset: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
240
|
-
/**
|
|
241
|
-
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
242
|
-
*/
|
|
243
|
-
readonly arrowPadding: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
244
|
-
/**
|
|
245
|
-
* Whether to override side and alignment preferences to prevent collisions.
|
|
246
|
-
*/
|
|
247
|
-
readonly avoidCollisions: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
248
|
-
/**
|
|
249
|
-
* The element used as the collision boundary.
|
|
250
|
-
*/
|
|
251
|
-
readonly collisionBoundary: _angular_core.InputSignal<ElementRef<HTMLElement> | ElementRef<HTMLElement>[] | undefined>;
|
|
252
|
-
/**
|
|
253
|
-
* Distance in pixels from the boundary edges where collision detection should occur.
|
|
254
|
-
*/
|
|
255
|
-
readonly collisionPadding: _angular_core.InputSignal<number | Partial<Record<"top" | "right" | "bottom" | "left", number>>>;
|
|
256
|
-
/**
|
|
257
|
-
* The sticky behavior on the alignment axis.
|
|
258
|
-
*/
|
|
259
|
-
readonly sticky: _angular_core.InputSignal<"always" | "partial">;
|
|
260
|
-
/**
|
|
261
|
-
* Whether to hide the popup when the trigger becomes fully occluded.
|
|
262
|
-
*/
|
|
263
|
-
readonly hideWhenDetached: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
264
|
-
/**
|
|
265
|
-
* The CSS position strategy used by Floating UI.
|
|
266
|
-
*/
|
|
267
|
-
readonly positionStrategy: _angular_core.InputSignal<"fixed" | "absolute">;
|
|
268
|
-
/**
|
|
269
|
-
* Whether to update position on every animation frame.
|
|
270
|
-
*/
|
|
271
|
-
readonly updatePositionStrategy: _angular_core.InputSignal<"always" | "optimized">;
|
|
272
|
-
/**
|
|
273
|
-
* Emits when the popup has been placed.
|
|
274
|
-
*/
|
|
275
|
-
readonly placed: _angular_core.OutputRef<void>;
|
|
276
237
|
constructor();
|
|
277
238
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardPositioner, never>;
|
|
278
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPositioner, "[rdxPreviewCardPositioner]", never, {
|
|
239
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPositioner, "[rdxPreviewCardPositioner]", never, {}, {}, never, never, true, never>;
|
|
279
240
|
}
|
|
280
241
|
|
|
281
242
|
/**
|
|
282
243
|
* A container for the preview-card contents.
|
|
244
|
+
*
|
|
245
|
+
* **ADR 0015 migration** onto the new floating dismissal engine (dismissal-only — a preview-card has
|
|
246
|
+
* no focus manager, ADR 0017 §1). Escape, an outside press, and a focus-out all close it (the legacy's
|
|
247
|
+
* trigger-press preventDefault is now automatic: the trigger is the registered reference, so a press on
|
|
248
|
+
* it is "inside" and never fires `pointerDownOutside`). A focus-out while a pointer is held on the
|
|
249
|
+
* trigger is still vetoed.
|
|
283
250
|
*/
|
|
284
251
|
declare class RdxPreviewCardPopup {
|
|
285
252
|
protected readonly rootContext: _radix_ng_primitives_preview_card.RdxPreviewCardRootContext;
|
|
286
|
-
private readonly
|
|
253
|
+
private readonly host;
|
|
254
|
+
private readonly floatingContext;
|
|
255
|
+
private readonly registration;
|
|
287
256
|
private readonly wrapper;
|
|
288
257
|
protected readonly align: _angular_core.Signal<"start" | "center" | "end" | undefined>;
|
|
289
258
|
protected readonly side: _angular_core.Signal<"top" | "right" | "bottom" | "left" | undefined>;
|
|
290
|
-
private dismissDetails;
|
|
291
259
|
/**
|
|
292
260
|
* Event handler called when the escape key is down. Can be prevented.
|
|
293
261
|
*/
|
|
294
|
-
readonly escapeKeyDown: _angular_core.
|
|
262
|
+
readonly escapeKeyDown: _angular_core.OutputEmitterRef<KeyboardEvent>;
|
|
295
263
|
/**
|
|
296
264
|
* Event handler called when a pointerdown event happens outside of the popup. Can be prevented.
|
|
297
265
|
*/
|
|
298
|
-
readonly pointerDownOutside: _angular_core.
|
|
266
|
+
readonly pointerDownOutside: _angular_core.OutputEmitterRef<RdxOutsidePressDomEvent>;
|
|
299
267
|
/**
|
|
300
268
|
* Event handler called when focus moves outside of the popup. Can be prevented.
|
|
301
269
|
*/
|
|
302
|
-
readonly focusOutside: _angular_core.
|
|
270
|
+
readonly focusOutside: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
303
271
|
/**
|
|
304
272
|
* Event handler called when an interaction happens outside of the popup. Can be prevented.
|
|
305
273
|
*/
|
|
306
|
-
readonly interactOutside: _angular_core.
|
|
274
|
+
readonly interactOutside: _angular_core.OutputEmitterRef<RdxOutsidePressDomEvent | FocusEvent>;
|
|
307
275
|
constructor();
|
|
308
276
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardPopup, never>;
|
|
309
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPopup, "[rdxPreviewCardPopup]", never, {}, { "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; }, never, never, true, [{ directive: typeof i1$1.RdxPopperContent; inputs: {}; outputs: {}; }, { directive: typeof
|
|
277
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardPopup, "[rdxPreviewCardPopup]", never, {}, { "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; }, never, never, true, [{ directive: typeof i1$1.RdxPopperContent; inputs: {}; outputs: {}; }, { directive: typeof _radix_ng_primitives_core.RdxFloatingNodeRegistration; inputs: {}; outputs: {}; }]>;
|
|
310
278
|
}
|
|
311
279
|
|
|
312
280
|
/**
|
|
@@ -348,12 +316,12 @@ declare class RdxPreviewCardViewport {
|
|
|
348
316
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPreviewCardViewport, "[rdxPreviewCardViewport]", never, {}, {}, never, never, true, never>;
|
|
349
317
|
}
|
|
350
318
|
|
|
351
|
-
declare const previewCardImports: (typeof
|
|
319
|
+
declare const previewCardImports: (typeof RdxPreviewCardPortal)[];
|
|
352
320
|
declare class RdxPreviewCardModule {
|
|
353
321
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPreviewCardModule, never>;
|
|
354
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxPreviewCardModule, never, [typeof RdxPreviewCardRoot, typeof RdxPreviewCardTrigger, typeof
|
|
322
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxPreviewCardModule, never, [typeof RdxPreviewCardRoot, typeof RdxPreviewCardTrigger, typeof RdxPreviewCardPortal, typeof RdxPreviewCardPortalMisuseGuard, typeof RdxPreviewCardBackdrop, typeof RdxPreviewCardPositioner, typeof RdxPreviewCardPopup, typeof RdxPreviewCardArrow, typeof RdxPreviewCardViewport], [typeof RdxPreviewCardRoot, typeof RdxPreviewCardTrigger, typeof RdxPreviewCardPortal, typeof RdxPreviewCardPortalMisuseGuard, typeof RdxPreviewCardBackdrop, typeof RdxPreviewCardPositioner, typeof RdxPreviewCardPopup, typeof RdxPreviewCardArrow, typeof RdxPreviewCardViewport]>;
|
|
355
323
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxPreviewCardModule>;
|
|
356
324
|
}
|
|
357
325
|
|
|
358
|
-
export { RdxPreviewCardArrow, RdxPreviewCardBackdrop, RdxPreviewCardHandle, RdxPreviewCardModule, RdxPreviewCardPopup, RdxPreviewCardPortal,
|
|
359
|
-
export type { RdxPreviewCardOpenChange, RdxPreviewCardOpenChangeReason, RdxPreviewCardRootContext, RdxPreviewCardTransitionStatus };
|
|
326
|
+
export { RdxPreviewCardArrow, RdxPreviewCardBackdrop, RdxPreviewCardHandle, RdxPreviewCardModule, RdxPreviewCardPopup, RdxPreviewCardPortal, RdxPreviewCardPortalMisuseGuard, RdxPreviewCardPositioner, RdxPreviewCardRoot, RdxPreviewCardTrigger, RdxPreviewCardViewport, createRdxPreviewCardHandle, injectRdxPreviewCardRootContext, previewCardImports, provideRdxPreviewCardRootContext };
|
|
327
|
+
export type { RdxPreviewCardOpenChange, RdxPreviewCardOpenChangeEventDetails, RdxPreviewCardOpenChangeReason, RdxPreviewCardRootContext, RdxPreviewCardTransitionStatus };
|
|
@@ -9,7 +9,7 @@ declare function focusFirst(candidates: HTMLElement[], preventScroll?: boolean,
|
|
|
9
9
|
|
|
10
10
|
declare const rootContext: () => {
|
|
11
11
|
loop: _angular_core.Signal<boolean>;
|
|
12
|
-
dir: _angular_core.Signal<Direction>;
|
|
12
|
+
dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
|
|
13
13
|
orientation: _angular_core.Signal<Orientation>;
|
|
14
14
|
currentTabStopId: _angular_core.ModelSignal<string | undefined>;
|
|
15
15
|
focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
|
|
@@ -21,7 +21,7 @@ declare const rootContext: () => {
|
|
|
21
21
|
type RovingFocusGroupContext = ReturnType<typeof rootContext>;
|
|
22
22
|
declare const injectRovingFocusGroupContext: _radix_ng_primitives_core.InjectContext<{
|
|
23
23
|
loop: _angular_core.Signal<boolean>;
|
|
24
|
-
dir: _angular_core.Signal<Direction>;
|
|
24
|
+
dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
|
|
25
25
|
orientation: _angular_core.Signal<Orientation>;
|
|
26
26
|
currentTabStopId: _angular_core.ModelSignal<string | undefined>;
|
|
27
27
|
focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
|
|
@@ -32,7 +32,7 @@ declare const injectRovingFocusGroupContext: _radix_ng_primitives_core.InjectCon
|
|
|
32
32
|
}>;
|
|
33
33
|
declare const provideRovingFocusGroupContext: (useFactory: () => {
|
|
34
34
|
loop: _angular_core.Signal<boolean>;
|
|
35
|
-
dir: _angular_core.Signal<Direction>;
|
|
35
|
+
dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
|
|
36
36
|
orientation: _angular_core.Signal<Orientation>;
|
|
37
37
|
currentTabStopId: _angular_core.ModelSignal<string | undefined>;
|
|
38
38
|
focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
|
|
@@ -55,7 +55,8 @@ declare class RdxRovingFocusGroupDirective {
|
|
|
55
55
|
/**
|
|
56
56
|
* The direction of navigation between items.
|
|
57
57
|
*/
|
|
58
|
-
readonly dirInput: _angular_core.InputSignal<Direction>;
|
|
58
|
+
readonly dirInput: _angular_core.InputSignal<Direction | undefined>;
|
|
59
|
+
private readonly effectiveDir;
|
|
59
60
|
/**
|
|
60
61
|
* Whether keyboard navigation should loop around
|
|
61
62
|
*/
|
|
@@ -85,7 +86,7 @@ declare class RdxRovingFocusGroupDirective {
|
|
|
85
86
|
private readonly _orientation;
|
|
86
87
|
readonly orientation: _angular_core.Signal<Orientation>;
|
|
87
88
|
private readonly _dir;
|
|
88
|
-
readonly dir: _angular_core.Signal<Direction>;
|
|
89
|
+
readonly dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
|
|
89
90
|
private readonly _loop;
|
|
90
91
|
readonly loop: _angular_core.Signal<boolean>;
|
|
91
92
|
readonly focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
|
|
@@ -121,7 +122,7 @@ declare class RdxRovingFocusItemDirective {
|
|
|
121
122
|
*/
|
|
122
123
|
protected readonly rootContext: {
|
|
123
124
|
loop: _angular_core.Signal<boolean>;
|
|
124
|
-
dir: _angular_core.Signal<
|
|
125
|
+
dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
|
|
125
126
|
orientation: _angular_core.Signal<_radix_ng_primitives_roving_focus.Orientation>;
|
|
126
127
|
currentTabStopId: _angular_core.ModelSignal<string | undefined>;
|
|
127
128
|
focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
|
|
@@ -83,7 +83,7 @@ declare class RdxScrollAreaRoot {
|
|
|
83
83
|
private readonly destroyRef;
|
|
84
84
|
readonly rootId: string;
|
|
85
85
|
/** Text direction of the scroll area. Affects horizontal (RTL) scroll math. */
|
|
86
|
-
readonly
|
|
86
|
+
readonly dirInput: _angular_core.InputSignal<Direction | undefined>;
|
|
87
87
|
readonly direction: Signal<Direction>;
|
|
88
88
|
/**
|
|
89
89
|
* The threshold in pixels that must be passed before the overflow edge attributes are applied.
|
|
@@ -135,7 +135,7 @@ declare class RdxScrollAreaRoot {
|
|
|
135
135
|
onTouchModalityChange(event: PointerEvent): void;
|
|
136
136
|
onPointerEnterOrMove(event: PointerEvent): void;
|
|
137
137
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxScrollAreaRoot, never>;
|
|
138
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxScrollAreaRoot, "[rdxScrollAreaRoot]", ["rdxScrollAreaRoot"], { "
|
|
138
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxScrollAreaRoot, "[rdxScrollAreaRoot]", ["rdxScrollAreaRoot"], { "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "overflowEdgeThreshold": { "alias": "overflowEdgeThreshold"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
interface ScrollAreaViewportContext {
|