@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,22 +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 { RdxTransitionStatus, BooleanInput, NumberInput } from '@radix-ng/primitives/core';
|
|
5
|
+
import { RdxTransitionStatus, 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_popover from '@radix-ng/primitives/popover';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import * as i2 from '@radix-ng/primitives/dismissable-layer';
|
|
12
|
-
import * as i3 from '@radix-ng/primitives/focus-scope';
|
|
9
|
+
import { RdxOutsidePressDomEvent } from '@radix-ng/primitives/dismissable-layer';
|
|
10
|
+
import * as i3 from '@radix-ng/primitives/floating-focus-manager';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* Structural directive that teleports the popover content into a container (default `document.body`)
|
|
14
|
+
* while the popover is open, and keeps it mounted until any CSS exit `@keyframes` finishes.
|
|
15
|
+
*
|
|
16
|
+
* Apply it with the `*` microsyntax on the positioner — `<div *rdxPopoverPortal rdxPopoverPositioner>`
|
|
17
|
+
* — or as an explicit `<ng-template rdxPopoverPortal>`. For a custom container use the explicit form
|
|
18
|
+
* with `[container]`.
|
|
19
|
+
*/
|
|
20
|
+
declare class RdxPopoverPortal {
|
|
21
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverPortal, never>;
|
|
22
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPortal, "ng-template[rdxPopoverPortal]", ["rdxPopoverPortal"], {}, {}, never, never, true, [{ directive: typeof i1.RdxPortalPresence; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Dev-mode guard: `rdxPopoverPortal` used to be an attribute directive on a `<div>`. It is now
|
|
26
|
+
* structural, so the old `<div rdxPopoverPortal>` markup would silently stop portaling — fail loudly
|
|
27
|
+
* instead.
|
|
16
28
|
*/
|
|
17
|
-
declare class
|
|
18
|
-
|
|
19
|
-
static
|
|
29
|
+
declare class RdxPopoverPortalMisuseGuard {
|
|
30
|
+
constructor();
|
|
31
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverPortalMisuseGuard, never>;
|
|
32
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPortalMisuseGuard, "[rdxPopoverPortal]:not(ng-template)", never, {}, {}, never, never, true, never>;
|
|
20
33
|
}
|
|
21
34
|
|
|
22
35
|
declare class RdxPopoverHandle<Payload = unknown> {
|
|
@@ -35,17 +48,20 @@ declare function createRdxPopoverHandle<Payload = unknown>(): RdxPopoverHandle<P
|
|
|
35
48
|
|
|
36
49
|
type RdxPopoverModal = boolean | 'trap-focus';
|
|
37
50
|
type RdxPopoverOpenChangeReason = 'trigger-hover' | 'trigger-focus' | 'trigger-press' | 'outside-press' | 'escape-key' | 'close-press' | 'focus-out' | 'imperative-action' | 'none';
|
|
51
|
+
type RdxPopoverOpenChangeEventDetails = RdxCancelableChangeEventDetails<RdxPopoverOpenChangeReason>;
|
|
38
52
|
interface RdxPopoverOpenChange {
|
|
39
53
|
open: boolean;
|
|
40
54
|
triggerId: string | null;
|
|
41
55
|
trigger: HTMLElement | undefined;
|
|
42
56
|
reason: RdxPopoverOpenChangeReason;
|
|
43
57
|
event: Event;
|
|
58
|
+
eventDetails: RdxPopoverOpenChangeEventDetails;
|
|
44
59
|
}
|
|
45
60
|
interface RdxPopoverRootContext {
|
|
46
61
|
contentId: string;
|
|
47
62
|
descriptionId: Signal<string | undefined>;
|
|
48
63
|
isOpen: Signal<boolean>;
|
|
64
|
+
present: Signal<boolean>;
|
|
49
65
|
modal: Signal<RdxPopoverModal>;
|
|
50
66
|
titleId: Signal<string | undefined>;
|
|
51
67
|
trigger: Signal<HTMLElement | undefined>;
|
|
@@ -55,6 +71,8 @@ interface RdxPopoverRootContext {
|
|
|
55
71
|
instant: Signal<boolean>;
|
|
56
72
|
openChangeReason: Signal<RdxPopoverOpenChangeReason>;
|
|
57
73
|
isPointerDownOnTrigger: Signal<boolean>;
|
|
74
|
+
/** Whether the current open was initiated by touch (ADR 0016 §3 — gates the anchored scroll lock). */
|
|
75
|
+
openedByTouch: Signal<boolean>;
|
|
58
76
|
close: (reason?: RdxPopoverOpenChangeReason, event?: Event) => void;
|
|
59
77
|
cancelHoverClose: () => void;
|
|
60
78
|
cancelHoverOpen: () => void;
|
|
@@ -66,6 +84,7 @@ interface RdxPopoverRootContext {
|
|
|
66
84
|
setDescriptionId: (id: string | undefined) => void;
|
|
67
85
|
setTitleId: (id: string | undefined) => void;
|
|
68
86
|
setPointerDownOnTrigger: (pointerDown: boolean) => void;
|
|
87
|
+
setOpenedByTouch: (value: boolean) => void;
|
|
69
88
|
setHoverDelays: (delay: number, closeDelay: number) => void;
|
|
70
89
|
registerPopupClose: () => () => void;
|
|
71
90
|
registerTransitionElement: (element: HTMLElement) => () => void;
|
|
@@ -82,6 +101,8 @@ type RdxPopoverTransitionStatus = RdxTransitionStatus;
|
|
|
82
101
|
declare class RdxPopoverRoot {
|
|
83
102
|
private readonly popper;
|
|
84
103
|
private readonly destroyRef;
|
|
104
|
+
/** Shared per-popup floating context (ADR 0015 §1): `open`, trigger registry, reference / floating els. */
|
|
105
|
+
readonly floatingContext: RdxFloatingRootContext;
|
|
85
106
|
private hasAppliedDefaultOpen;
|
|
86
107
|
private hasAppliedDefaultTriggerId;
|
|
87
108
|
private openTimer;
|
|
@@ -125,12 +146,16 @@ declare class RdxPopoverRoot {
|
|
|
125
146
|
readonly triggers: _angular_core.WritableSignal<HTMLElement[]>;
|
|
126
147
|
readonly payload: _angular_core.WritableSignal<unknown>;
|
|
127
148
|
readonly isPointerDownOnTrigger: _angular_core.WritableSignal<boolean>;
|
|
149
|
+
/** Whether the current open was initiated by touch (ADR 0016 §3 — gates the anchored scroll lock). */
|
|
150
|
+
readonly openedByTouch: _angular_core.WritableSignal<boolean>;
|
|
128
151
|
readonly popupCloseCount: _angular_core.WritableSignal<number>;
|
|
152
|
+
private readonly preventUnmountOnClose;
|
|
129
153
|
readonly onOpenChange: _angular_core.OutputEmitterRef<RdxPopoverOpenChange>;
|
|
130
154
|
readonly onOpenChangeComplete: _angular_core.OutputEmitterRef<boolean>;
|
|
131
155
|
private readonly registeredTriggers;
|
|
132
156
|
private readonly viewportTriggerChange;
|
|
133
157
|
readonly state: Signal<"open" | "closed">;
|
|
158
|
+
readonly present: Signal<boolean>;
|
|
134
159
|
constructor();
|
|
135
160
|
show(trigger?: HTMLElement | undefined, payload?: unknown, triggerId?: string, reason?: RdxPopoverOpenChangeReason, event?: Event, fromHover?: boolean): void;
|
|
136
161
|
close(reason?: RdxPopoverOpenChangeReason, event?: Event): void;
|
|
@@ -144,7 +169,7 @@ declare class RdxPopoverRoot {
|
|
|
144
169
|
registerViewport(onTriggerChange: (previous: HTMLElement, next: HTMLElement) => void): () => boolean;
|
|
145
170
|
registerTransitionElement(element: HTMLElement): () => void;
|
|
146
171
|
private syncTriggerId;
|
|
147
|
-
private
|
|
172
|
+
private createOpenChangeEvent;
|
|
148
173
|
private clearHoverTimers;
|
|
149
174
|
private clearOpenTimer;
|
|
150
175
|
private clearCloseTimer;
|
|
@@ -159,6 +184,8 @@ declare class RdxPopoverRoot {
|
|
|
159
184
|
declare class RdxPopoverTrigger {
|
|
160
185
|
private readonly parentRootContext;
|
|
161
186
|
readonly elementRef: ElementRef<HTMLElement>;
|
|
187
|
+
/** Pointer type of the most recent `pointerdown`, used to detect a touch open (ADR 0016 §3). */
|
|
188
|
+
private lastPointerType;
|
|
162
189
|
/**
|
|
163
190
|
* Associates this trigger with a detached popover root.
|
|
164
191
|
*/
|
|
@@ -196,143 +223,83 @@ declare class RdxPopoverTrigger {
|
|
|
196
223
|
protected handleClick(event: MouseEvent): void;
|
|
197
224
|
protected handlePointerEnter(event: PointerEvent): void;
|
|
198
225
|
protected handlePointerLeave(event: PointerEvent): void;
|
|
199
|
-
protected handlePointerDown(): void;
|
|
226
|
+
protected handlePointerDown(event: PointerEvent): void;
|
|
200
227
|
protected handlePointerUp(): void;
|
|
201
228
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverTrigger, never>;
|
|
202
229
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverTrigger, "button[rdxPopoverTrigger]", 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; }; "openOnHover": { "alias": "openOnHover"; "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: {}; }]>;
|
|
203
230
|
}
|
|
204
231
|
|
|
205
|
-
/**
|
|
206
|
-
* Moves the popover to a different part of the DOM.
|
|
207
|
-
*/
|
|
208
|
-
declare class RdxPopoverPortal {
|
|
209
|
-
protected readonly rootContext: _radix_ng_primitives_popover.RdxPopoverRootContext;
|
|
210
|
-
/**
|
|
211
|
-
* Optional container to portal the content into. Defaults to `document.body`.
|
|
212
|
-
*/
|
|
213
|
-
readonly container: _angular_core.InputSignal<RdxPortalContainer | undefined>;
|
|
214
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverPortal, never>;
|
|
215
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPortal, "[rdxPopoverPortal]", never, { "container": { "alias": "container"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$2.RdxPortal; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
232
|
/**
|
|
219
233
|
* An optional backdrop rendered behind the popup.
|
|
220
234
|
*/
|
|
221
235
|
declare class RdxPopoverBackdrop {
|
|
222
236
|
protected readonly rootContext: _radix_ng_primitives_popover.RdxPopoverRootContext;
|
|
237
|
+
constructor();
|
|
223
238
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverBackdrop, never>;
|
|
224
239
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverBackdrop, "[rdxPopoverBackdrop]", never, {}, {}, never, never, true, never>;
|
|
225
240
|
}
|
|
226
241
|
|
|
227
242
|
/**
|
|
228
243
|
* Positions the popover against its trigger.
|
|
244
|
+
*
|
|
245
|
+
* A "thin" positioner (ADR 0012): it inherits the popper positioning surface (inputs, `placed`
|
|
246
|
+
* output, unified vars + placement attrs) from {@link RdxPopperContentWrapper} and adds popover's own
|
|
247
|
+
* concerns — Base UI-aligned defaults via the config provider, the open/closed/instant state
|
|
248
|
+
* attributes, the deprecated `--radix-popover-*` aliases, and the grace-area hover bridge.
|
|
229
249
|
*/
|
|
230
|
-
declare class RdxPopoverPositioner {
|
|
250
|
+
declare class RdxPopoverPositioner extends RdxPopperContentWrapper {
|
|
231
251
|
protected readonly rootContext: _radix_ng_primitives_popover.RdxPopoverRootContext;
|
|
232
|
-
protected readonly
|
|
233
|
-
private readonly
|
|
252
|
+
protected readonly legacyVars: Record<string, string>;
|
|
253
|
+
private readonly containerRef;
|
|
234
254
|
private readonly triggerEl;
|
|
235
255
|
private readonly containerEl;
|
|
236
256
|
private readonly graceArea;
|
|
237
|
-
/**
|
|
238
|
-
* An element to position the popup against. Defaults to the trigger.
|
|
239
|
-
*/
|
|
240
|
-
readonly anchor: _angular_core.InputSignal<RdxPopperAnchorElement>;
|
|
241
|
-
/**
|
|
242
|
-
* The preferred side of the trigger to render against when open.
|
|
243
|
-
*/
|
|
244
|
-
readonly side: _angular_core.InputSignal<"top" | "right" | "bottom" | "left">;
|
|
245
|
-
/**
|
|
246
|
-
* Distance between the trigger and the popup in pixels.
|
|
247
|
-
*/
|
|
248
|
-
readonly sideOffset: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
249
|
-
/**
|
|
250
|
-
* How to align the popup relative to the specified side.
|
|
251
|
-
*/
|
|
252
|
-
readonly align: _angular_core.InputSignal<"start" | "center" | "end">;
|
|
253
|
-
/**
|
|
254
|
-
* An offset in pixels from the `start` or `end` alignment options.
|
|
255
|
-
*/
|
|
256
|
-
readonly alignOffset: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
257
|
-
/**
|
|
258
|
-
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
259
|
-
*/
|
|
260
|
-
readonly arrowPadding: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
261
|
-
/**
|
|
262
|
-
* Whether to override side and alignment preferences to prevent collisions.
|
|
263
|
-
*/
|
|
264
|
-
readonly avoidCollisions: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
265
|
-
/**
|
|
266
|
-
* The element used as the collision boundary.
|
|
267
|
-
*/
|
|
268
|
-
readonly collisionBoundary: _angular_core.InputSignal<ElementRef<HTMLElement> | ElementRef<HTMLElement>[] | undefined>;
|
|
269
|
-
/**
|
|
270
|
-
* Distance in pixels from the boundary edges where collision detection should occur.
|
|
271
|
-
*/
|
|
272
|
-
readonly collisionPadding: _angular_core.InputSignal<number | Partial<Record<"top" | "right" | "bottom" | "left", number>>>;
|
|
273
|
-
/**
|
|
274
|
-
* The sticky behavior on the alignment axis.
|
|
275
|
-
*/
|
|
276
|
-
readonly sticky: _angular_core.InputSignal<"always" | "partial">;
|
|
277
|
-
/**
|
|
278
|
-
* Whether to hide the popup when the trigger becomes fully occluded.
|
|
279
|
-
*/
|
|
280
|
-
readonly hideWhenDetached: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
281
|
-
/**
|
|
282
|
-
* The CSS position strategy used by Floating UI.
|
|
283
|
-
*/
|
|
284
|
-
readonly positionStrategy: _angular_core.InputSignal<"fixed" | "absolute">;
|
|
285
|
-
/**
|
|
286
|
-
* Whether to update position on every animation frame.
|
|
287
|
-
*/
|
|
288
|
-
readonly updatePositionStrategy: _angular_core.InputSignal<"always" | "optimized">;
|
|
289
|
-
/**
|
|
290
|
-
* Emits when the popup has been placed.
|
|
291
|
-
*/
|
|
292
|
-
readonly placed: _angular_core.OutputRef<void>;
|
|
293
257
|
constructor();
|
|
294
258
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverPositioner, never>;
|
|
295
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPositioner, "[rdxPopoverPositioner]", never, {
|
|
259
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPositioner, "[rdxPopoverPositioner]", never, {}, {}, never, never, true, never>;
|
|
296
260
|
}
|
|
297
261
|
|
|
298
262
|
/**
|
|
299
263
|
* A container for the popover contents.
|
|
264
|
+
*
|
|
265
|
+
* **ADR 0015/0017 Phase-4 migration** onto the new floating dismissal + focus engine (same pattern as
|
|
266
|
+
* Dialog; browser-verified via `popover.behavior` Playwright). Popover-specific:
|
|
267
|
+
* - **Hover-open disables the manager** (`enabled = isOpen && !isHoverActive`) — Base UI parity
|
|
268
|
+
* (`disabled={!mounted || openReason === triggerHover}`); a hover-opened popover does not trap / mark.
|
|
269
|
+
* (The legacy only suppressed auto-focus while still trapping — that Radix divergence is dropped.)
|
|
270
|
+
* - Trap = `'trap-focus' || (modal === true && hasPopupClose())`; scroll lock + real outside `inert`
|
|
271
|
+
* isolation key off the full modal (`modal === true`).
|
|
272
|
+
* - No `disablePointerDismissal` — outside-press + focus-out always close.
|
|
273
|
+
*
|
|
274
|
+
* Note: a positioned popover does **not** auto-focus into the popup on open (pre-existing — the legacy
|
|
275
|
+
* behaved the same; verified). The trap holds focus once it is inside. Auto-focus-on-open + redirecting a
|
|
276
|
+
* Tab from the trigger into the popup needs the deferred portal-focus bridge / guards (ADR 0017 §6a).
|
|
300
277
|
*/
|
|
301
278
|
declare class RdxPopoverPopup {
|
|
302
279
|
protected readonly rootContext: _radix_ng_primitives_popover.RdxPopoverRootContext;
|
|
303
|
-
private readonly
|
|
280
|
+
private readonly host;
|
|
281
|
+
private readonly floatingContext;
|
|
282
|
+
private readonly registration;
|
|
283
|
+
private readonly focusManager;
|
|
304
284
|
private readonly focusScope;
|
|
305
285
|
private readonly wrapper;
|
|
306
286
|
protected readonly align: _angular_core.Signal<"start" | "center" | "end" | undefined>;
|
|
307
287
|
protected readonly side: _angular_core.Signal<"top" | "right" | "bottom" | "left" | undefined>;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Event handler called when focus moves outside of the popup. Can be prevented.
|
|
319
|
-
*/
|
|
320
|
-
readonly focusOutside: _angular_core.OutputRef<FocusEvent>;
|
|
321
|
-
/**
|
|
322
|
-
* Event handler called when an interaction happens outside of the popup. Can be prevented.
|
|
323
|
-
*/
|
|
324
|
-
readonly interactOutside: _angular_core.OutputRef<PointerEvent | FocusEvent>;
|
|
325
|
-
/**
|
|
326
|
-
* Event handler called before focus moves into the popup. Can be prevented.
|
|
327
|
-
*/
|
|
288
|
+
/** Event handler called when the escape key is down. Can be prevented. */
|
|
289
|
+
readonly escapeKeyDown: _angular_core.OutputEmitterRef<KeyboardEvent>;
|
|
290
|
+
/** Event handler called when a pointerdown event happens outside of the popup. Can be prevented. */
|
|
291
|
+
readonly pointerDownOutside: _angular_core.OutputEmitterRef<RdxOutsidePressDomEvent>;
|
|
292
|
+
/** Event handler called when focus moves outside of the popup. Can be prevented. */
|
|
293
|
+
readonly focusOutside: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
294
|
+
/** Event handler called when an interaction (pointer / focus) happens outside of the popup. */
|
|
295
|
+
readonly interactOutside: _angular_core.OutputEmitterRef<RdxOutsidePressDomEvent | FocusEvent>;
|
|
296
|
+
/** Event handler called before focus moves into the popup. Can be prevented. */
|
|
328
297
|
readonly openAutoFocus: _angular_core.OutputRef<Event>;
|
|
329
|
-
/**
|
|
330
|
-
* Event handler called before focus returns after the popup is removed. Can be prevented.
|
|
331
|
-
*/
|
|
298
|
+
/** Event handler called before focus returns after the popup is removed. Can be prevented. */
|
|
332
299
|
readonly closeAutoFocus: _angular_core.OutputRef<Event>;
|
|
333
300
|
constructor();
|
|
334
301
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverPopup, never>;
|
|
335
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPopup, "[rdxPopoverPopup]", never, {}, { "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "openAutoFocus": "openAutoFocus"; "closeAutoFocus": "closeAutoFocus"; }, never, never, true, [{ directive: typeof i1$1.RdxPopperContent; inputs: {}; outputs: {}; }, { directive: typeof
|
|
302
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverPopup, "[rdxPopoverPopup]", never, {}, { "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "openAutoFocus": "openAutoFocus"; "closeAutoFocus": "closeAutoFocus"; }, never, never, true, [{ directive: typeof i1$1.RdxPopperContent; inputs: {}; outputs: {}; }, { directive: typeof _radix_ng_primitives_core.RdxFloatingNodeRegistration; inputs: {}; outputs: {}; }, { directive: typeof i3.RdxFloatingFocusManager; inputs: {}; outputs: {}; }]>;
|
|
336
303
|
}
|
|
337
304
|
|
|
338
305
|
/**
|
|
@@ -406,12 +373,12 @@ declare class RdxPopoverViewport {
|
|
|
406
373
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopoverViewport, "[rdxPopoverViewport]", never, {}, {}, never, never, true, never>;
|
|
407
374
|
}
|
|
408
375
|
|
|
409
|
-
declare const popoverImports: (typeof
|
|
376
|
+
declare const popoverImports: (typeof RdxPopoverPortal)[];
|
|
410
377
|
declare class RdxPopoverModule {
|
|
411
378
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopoverModule, never>;
|
|
412
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxPopoverModule, never, [typeof RdxPopoverRoot, typeof RdxPopoverTrigger, typeof
|
|
379
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxPopoverModule, never, [typeof RdxPopoverRoot, typeof RdxPopoverTrigger, typeof RdxPopoverPortal, typeof RdxPopoverPortalMisuseGuard, typeof RdxPopoverBackdrop, typeof RdxPopoverPositioner, typeof RdxPopoverPopup, typeof RdxPopoverArrow, typeof RdxPopoverTitle, typeof RdxPopoverDescription, typeof RdxPopoverClose, typeof RdxPopoverViewport], [typeof RdxPopoverRoot, typeof RdxPopoverTrigger, typeof RdxPopoverPortal, typeof RdxPopoverPortalMisuseGuard, typeof RdxPopoverBackdrop, typeof RdxPopoverPositioner, typeof RdxPopoverPopup, typeof RdxPopoverArrow, typeof RdxPopoverTitle, typeof RdxPopoverDescription, typeof RdxPopoverClose, typeof RdxPopoverViewport]>;
|
|
413
380
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxPopoverModule>;
|
|
414
381
|
}
|
|
415
382
|
|
|
416
|
-
export { RdxPopoverArrow, RdxPopoverBackdrop, RdxPopoverClose, RdxPopoverDescription, RdxPopoverHandle, RdxPopoverModule, RdxPopoverPopup, RdxPopoverPortal,
|
|
417
|
-
export type { RdxPopoverModal, RdxPopoverOpenChange, RdxPopoverOpenChangeReason, RdxPopoverRootContext, RdxPopoverTransitionStatus };
|
|
383
|
+
export { RdxPopoverArrow, RdxPopoverBackdrop, RdxPopoverClose, RdxPopoverDescription, RdxPopoverHandle, RdxPopoverModule, RdxPopoverPopup, RdxPopoverPortal, RdxPopoverPortalMisuseGuard, RdxPopoverPositioner, RdxPopoverRoot, RdxPopoverTitle, RdxPopoverTrigger, RdxPopoverViewport, createRdxPopoverHandle, injectRdxPopoverRootContext, popoverImports, provideRdxPopoverRootContext };
|
|
384
|
+
export type { RdxPopoverModal, RdxPopoverOpenChange, RdxPopoverOpenChangeEventDetails, RdxPopoverOpenChangeReason, RdxPopoverRootContext, RdxPopoverTransitionStatus };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef,
|
|
2
|
+
import { ElementRef, Provider, Type, InjectionToken } from '@angular/core';
|
|
3
3
|
import { ReferenceElement, Placement, Middleware, VirtualElement } from '@floating-ui/dom';
|
|
4
4
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
5
5
|
import { NumberInput, BooleanInput } from '@radix-ng/primitives/core';
|
|
@@ -18,6 +18,12 @@ declare class RdxPopper {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
declare class RdxPopperContent {
|
|
21
|
+
/**
|
|
22
|
+
* Optional so the directive can be composed onto a content part that is also used outside Popper
|
|
23
|
+
* positioning (e.g. select's `item-aligned` mode, where there is no `RdxPopperContentWrapper`
|
|
24
|
+
* ancestor). With no wrapper the `data-side` / `data-align` bindings and the animation guard
|
|
25
|
+
* simply no-op.
|
|
26
|
+
*/
|
|
21
27
|
protected readonly popperContentWrapper: {
|
|
22
28
|
placedSide: _angular_core.Signal<"top" | "right" | "bottom" | "left" | undefined>;
|
|
23
29
|
placedAlign: _angular_core.Signal<"start" | "center" | "end" | undefined>;
|
|
@@ -26,7 +32,7 @@ declare class RdxPopperContent {
|
|
|
26
32
|
shouldHideArrow: _angular_core.Signal<boolean>;
|
|
27
33
|
isPositioned: _angular_core.Signal<boolean>;
|
|
28
34
|
anchorHidden: _angular_core.Signal<boolean>;
|
|
29
|
-
};
|
|
35
|
+
} | null;
|
|
30
36
|
/**
|
|
31
37
|
* if the PopperContent hasn't been placed yet (not all measurements done)
|
|
32
38
|
* we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
@@ -77,12 +83,11 @@ declare const providePopperContentWrapperContext: (useFactory: () => {
|
|
|
77
83
|
shouldHideArrow: _angular_core.Signal<boolean>;
|
|
78
84
|
isPositioned: _angular_core.Signal<boolean>;
|
|
79
85
|
anchorHidden: _angular_core.Signal<boolean>;
|
|
80
|
-
}) =>
|
|
86
|
+
}) => Provider;
|
|
81
87
|
declare class RdxPopperContentWrapper {
|
|
82
88
|
private readonly elementRef;
|
|
83
89
|
private readonly injector;
|
|
84
90
|
private readonly context;
|
|
85
|
-
private readonly isBrowser;
|
|
86
91
|
/** Optional positioning defaults provided by a composing primitive (e.g. tooltip). */
|
|
87
92
|
private readonly config;
|
|
88
93
|
/**
|
|
@@ -193,26 +198,57 @@ declare class RdxPopperContentWrapper {
|
|
|
193
198
|
* The current alignment of the panel.
|
|
194
199
|
*/
|
|
195
200
|
readonly placedAlign: _angular_core.Signal<"start" | "center" | "end" | undefined>;
|
|
196
|
-
private readonly contentElementRef;
|
|
197
|
-
protected readonly contentZIndex: _angular_core.Signal<string | 0>;
|
|
198
201
|
protected readonly style: _angular_core.Signal<{
|
|
199
202
|
visibility: string;
|
|
200
203
|
pointerEvents: string;
|
|
201
204
|
position: "fixed" | "absolute";
|
|
202
205
|
transform: string;
|
|
203
206
|
minWidth: string;
|
|
204
|
-
zIndex: string | number;
|
|
205
207
|
top: string;
|
|
206
208
|
left: string;
|
|
207
209
|
'--radix-popper-transform-origin': string;
|
|
208
210
|
'--radix-popper-content-wrapper-width': string;
|
|
209
211
|
'--radix-popper-content-wrapper-height': string;
|
|
212
|
+
'--anchor-width': string;
|
|
213
|
+
'--anchor-height': string;
|
|
214
|
+
'--available-width': string;
|
|
215
|
+
'--available-height': string;
|
|
216
|
+
'--positioner-width': string;
|
|
217
|
+
'--positioner-height': string;
|
|
218
|
+
'--transform-origin': string;
|
|
210
219
|
}>;
|
|
211
220
|
private readonly afterRenderEffect;
|
|
212
221
|
constructor();
|
|
213
222
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxPopperContentWrapper, never>;
|
|
214
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopperContentWrapper, "[rdxPopperContentWrapper]", never, { "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; "isSignal": true; }; "avoidCollisions": { "alias": "avoidCollisions"; "required": false; "isSignal": true; }; "collisionBoundary": { "alias": "collisionBoundary"; "required": false; "isSignal": true; }; "collisionPadding": { "alias": "collisionPadding"; "required": false; "isSignal": true; }; "sticky": { "alias": "sticky"; "required": false; "isSignal": true; }; "hideWhenDetached": { "alias": "hideWhenDetached"; "required": false; "isSignal": true; }; "positionStrategy": { "alias": "positionStrategy"; "required": false; "isSignal": true; }; "updatePositionStrategy": { "alias": "updatePositionStrategy"; "required": false; "isSignal": true; }; }, { "placed": "placed"; }, ["arrow"
|
|
223
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxPopperContentWrapper, "[rdxPopperContentWrapper]", never, { "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; "isSignal": true; }; "avoidCollisions": { "alias": "avoidCollisions"; "required": false; "isSignal": true; }; "collisionBoundary": { "alias": "collisionBoundary"; "required": false; "isSignal": true; }; "collisionPadding": { "alias": "collisionPadding"; "required": false; "isSignal": true; }; "sticky": { "alias": "sticky"; "required": false; "isSignal": true; }; "hideWhenDetached": { "alias": "hideWhenDetached"; "required": false; "isSignal": true; }; "positionStrategy": { "alias": "positionStrategy"; "required": false; "isSignal": true; }; "updatePositionStrategy": { "alias": "updatePositionStrategy"; "required": false; "isSignal": true; }; }, { "placed": "placed"; }, ["arrow"], never, true, never>;
|
|
215
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Providers a "thin" positioner that `extends RdxPopperContentWrapper` must include. Angular
|
|
227
|
+
* inherits a base directive's inputs/outputs/host bindings/queries but **not** its `providers`, so
|
|
228
|
+
* the `useExisting` alias (lets the popup and arrow resolve the subclass through the
|
|
229
|
+
* {@link RdxPopperContentWrapper} token) and the wrapper context provider (what
|
|
230
|
+
* `injectPopperContentWrapperContext()` reads) are re-declared here in one place.
|
|
231
|
+
*
|
|
232
|
+
* Combine with {@link provideRdxPopperContentConfig} for per-primitive positioning defaults:
|
|
233
|
+
*
|
|
234
|
+
* ```ts
|
|
235
|
+
* providers: [
|
|
236
|
+
* ...provideRdxPopperContentWrapper(RdxComboboxPositioner),
|
|
237
|
+
* provideRdxPopperContentConfig({ sideOffset: 4, align: 'start' })
|
|
238
|
+
* ]
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
declare function provideRdxPopperContentWrapper(positioner: Type<RdxPopperContentWrapper>): Provider[];
|
|
242
|
+
/**
|
|
243
|
+
* Deprecated per-primitive aliases of the unified popper variables (ADR 0012). Since the wrapper now
|
|
244
|
+
* emits the unified `--anchor-*` / `--available-*` / `--transform-origin` set itself, a positioner no
|
|
245
|
+
* longer hand-writes a re-namespacing `[style]` map; it spreads this helper into a host `[style]`
|
|
246
|
+
* binding only to keep the legacy `--radix-<name>-content-*` / `--radix-<name>-trigger-*` names alive
|
|
247
|
+
* for one release of consumer back-compat. Migrate to the unified set; these are removed next minor.
|
|
248
|
+
*
|
|
249
|
+
* @deprecated Use the unified `--anchor-*` / `--available-*` / `--transform-origin` variables.
|
|
250
|
+
*/
|
|
251
|
+
declare function legacyPopperVars(name: string): Record<string, string>;
|
|
216
252
|
|
|
217
253
|
declare class RdxPopperArrow {
|
|
218
254
|
private readonly popperContentContext;
|
|
@@ -258,7 +294,7 @@ interface RdxPopperContentConfig {
|
|
|
258
294
|
declare const RdxPopperContentConfigToken: InjectionToken<RdxPopperContentConfig>;
|
|
259
295
|
declare function provideRdxPopperContentConfig(config: RdxPopperContentConfig): Provider;
|
|
260
296
|
|
|
261
|
-
declare const popperImports: (typeof RdxPopperAnchor | typeof RdxPopper | typeof
|
|
297
|
+
declare const popperImports: (typeof RdxPopperAnchor | typeof RdxPopper | typeof RdxPopperContentWrapper | typeof RdxPopperContent)[];
|
|
262
298
|
|
|
263
|
-
export { RdxPopper, RdxPopperAnchor, RdxPopperArrow, RdxPopperContent, RdxPopperContentConfigToken, RdxPopperContentWrapper, getSideAndAlignFromPlacement, injectPopperContentWrapperContext, isNotNull, popperImports, providePopperContentWrapperContext, provideRdxPopperContentConfig, transformOrigin };
|
|
299
|
+
export { RdxPopper, RdxPopperAnchor, RdxPopperArrow, RdxPopperContent, RdxPopperContentConfigToken, RdxPopperContentWrapper, getSideAndAlignFromPlacement, injectPopperContentWrapperContext, isNotNull, legacyPopperVars, popperImports, providePopperContentWrapperContext, provideRdxPopperContentConfig, provideRdxPopperContentWrapper, transformOrigin };
|
|
264
300
|
export type { Align, PopperContentWrapperContext, RdxPopperAnchorElement, RdxPopperContentConfig, Side };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
2
|
import { ElementRef } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* A target container for
|
|
5
|
+
* A target container for a portal. Accepts an `ElementRef`, a native element, or a CSS selector
|
|
6
6
|
* resolved against the document.
|
|
7
7
|
*/
|
|
8
8
|
type RdxPortalContainer = ElementRef<HTMLElement> | HTMLElement | string;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a {@link RdxPortalContainer} to a concrete element. Returns `null` when nothing usable is
|
|
11
|
+
* provided (a missing container, a selector matching nothing, or a non-element value), so callers can
|
|
12
|
+
* fall back to `document.body`. Shared by `RdxPortal` and `RdxPortalPresence`.
|
|
13
|
+
*/
|
|
14
|
+
declare function resolvePortalContainer(container: RdxPortalContainer | undefined, document: Document | null): HTMLElement | null;
|
|
15
|
+
|
|
9
16
|
declare class RdxPortal {
|
|
10
17
|
private readonly elementRef;
|
|
11
18
|
private readonly platformId;
|
|
@@ -15,16 +22,54 @@ declare class RdxPortal {
|
|
|
15
22
|
* Specify a container to portal the content into. Can be an `ElementRef`, a native element, or a
|
|
16
23
|
* CSS selector. Defaults to `document.body` when not set (or when a selector matches nothing).
|
|
17
24
|
*/
|
|
18
|
-
readonly container:
|
|
25
|
+
readonly container: i0.InputSignal<RdxPortalContainer | undefined>;
|
|
26
|
+
private readonly _computedContainer;
|
|
27
|
+
readonly computedContainer: i0.Signal<RdxPortalContainer | undefined>;
|
|
28
|
+
private readonly elementContainer;
|
|
29
|
+
constructor();
|
|
30
|
+
setContainer(container: RdxPortalContainer): void;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPortal, never>;
|
|
32
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPortal, "[rdxPortal]", ["rdxPortal"], { "container": { "alias": "container"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Structural directive merging what `RdxPortal` + `RdxPresenceDirective` did as a pair: it mounts its
|
|
37
|
+
* template while `present()` (from {@link RDX_PRESENCE_CONTEXT}) is `true`, **relocates every root
|
|
38
|
+
* node into a portal container** (default `document.body`), and on close runs the presence exit state
|
|
39
|
+
* machine — keeping the content mounted until every running CSS exit `@keyframes` on any root node
|
|
40
|
+
* finishes.
|
|
41
|
+
*
|
|
42
|
+
* Unlike `RdxPortal`, it adds **no wrapper element**: the template's root nodes become direct children
|
|
43
|
+
* of the container. Use the `*` microsyntax for the common single-root case
|
|
44
|
+
* (`<div *rdxXxxPortal rdxXxxPositioner>`) or the explicit `<ng-template rdxXxxPortal>` form for a
|
|
45
|
+
* custom container or multiple root nodes (e.g. a dialog backdrop + popup).
|
|
46
|
+
*
|
|
47
|
+
* SSR: on the server the view renders in place and is never relocated; after hydration the relocation
|
|
48
|
+
* effect moves the nodes into the container (same browser-guarded split `RdxPortal` uses).
|
|
49
|
+
*/
|
|
50
|
+
declare class RdxPortalPresence {
|
|
51
|
+
private readonly viewContainerRef;
|
|
52
|
+
private readonly templateRef;
|
|
53
|
+
private readonly document;
|
|
54
|
+
private readonly isBrowser;
|
|
55
|
+
/**
|
|
56
|
+
* Container to portal the content into. Can be an `ElementRef`, a native element, or a CSS
|
|
57
|
+
* selector. Defaults to `document.body` (or when a selector matches nothing).
|
|
58
|
+
*/
|
|
59
|
+
readonly container: i0.InputSignal<RdxPortalContainer | undefined>;
|
|
19
60
|
private readonly _computedContainer;
|
|
20
|
-
readonly computedContainer: _angular_core.Signal<RdxPortalContainer | undefined>;
|
|
21
61
|
private readonly elementContainer;
|
|
62
|
+
/** The live view's root nodes, exposed as a signal so the relocation effect re-runs on (re)mount. */
|
|
63
|
+
private readonly mountedNodes;
|
|
64
|
+
private viewRef;
|
|
22
65
|
constructor();
|
|
66
|
+
/** Imperatively override the portal container (parity with `RdxPortal.setContainer`). */
|
|
23
67
|
setContainer(container: RdxPortalContainer): void;
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
static
|
|
68
|
+
private mountView;
|
|
69
|
+
private destroyView;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPortalPresence, never>;
|
|
71
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPortalPresence, never, never, { "container": { "alias": "container"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
72
|
}
|
|
28
73
|
|
|
29
|
-
export { RdxPortal };
|
|
74
|
+
export { RdxPortal, RdxPortalPresence, resolvePortalContainer };
|
|
30
75
|
export type { RdxPortalContainer };
|