@radix-ng/primitives 1.0.5 → 1.0.6
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/fesm2022/radix-ng-primitives-accordion.mjs +35 -27
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +34 -34
- package/fesm2022/radix-ng-primitives-arrow.mjs +3 -3
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +5 -4
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +175 -125
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +25 -19
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +11 -7
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +140 -90
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +61 -40
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +35 -24
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +278 -177
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +50 -33
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +7 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +48 -22
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +44 -28
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +73 -45
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +70 -40
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +93 -67
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +5 -4
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +20 -16
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +107 -81
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +53 -39
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +69 -42
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-fieldset.mjs +8 -7
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +77 -40
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +7 -5
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-form.mjs +25 -16
- package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +41 -22
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +7 -5
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +274 -154
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +35 -17
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +41 -30
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +220 -183
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +87 -59
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +48 -38
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +150 -107
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +79 -47
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +20 -13
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +3 -3
- package/fesm2022/radix-ng-primitives-preview-card.mjs +119 -74
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +43 -31
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +58 -35
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +54 -38
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +595 -102
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +7 -5
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +101 -63
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +53 -39
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +23 -18
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +72 -47
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +72 -41
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +75 -56
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +29 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +16 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +38 -30
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +118 -63
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -20
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/package.json +2 -2
- package/types/radix-ng-primitives-autocomplete.d.ts +3 -1
- package/types/radix-ng-primitives-combobox.d.ts +28 -9
- package/types/radix-ng-primitives-context-menu.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +6 -3
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +11 -0
- package/types/radix-ng-primitives-menu.d.ts +47 -15
- package/types/radix-ng-primitives-menubar.d.ts +6 -1
- package/types/radix-ng-primitives-navigation-menu.d.ts +8 -6
- package/types/radix-ng-primitives-popover.d.ts +12 -4
- package/types/radix-ng-primitives-preview-card.d.ts +18 -5
- package/types/radix-ng-primitives-select.d.ts +186 -391
- package/types/radix-ng-primitives-tooltip.d.ts +17 -3
|
@@ -3,7 +3,7 @@ import { booleanAttribute, inject, DestroyRef, ElementRef, signal, model, input,
|
|
|
3
3
|
import * as i1 from '@radix-ng/primitives/popper';
|
|
4
4
|
import { RdxPopper, RdxPopperContentWrapper, RdxPopperArrow, RdxPopperContent, legacyPopperVars, provideRdxPopperContentWrapper, provideRdxPopperContentConfig, RdxPopperAnchor } from '@radix-ng/primitives/popper';
|
|
5
5
|
import * as i2 from '@radix-ng/primitives/core';
|
|
6
|
-
import { createContext, createFloatingRootContext, useTransitionStatus, injectId, createCancelableChangeEventDetails, provideFloatingTree, provideFloatingRootContext, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION, useAnchoredScrollLock, RdxFloatingNodeRegistration, rdxDevError, useGraceArea } from '@radix-ng/primitives/core';
|
|
6
|
+
import { createContext, createFloatingRootContext, useTransitionStatus, injectId, createCancelableChangeEventDetails, provideFloatingTree, provideFloatingRootContext, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION, useAnchoredScrollLock, RdxFloatingNodeRegistration, rdxDevError, useGraceArea, getMaxTransitionDuration } from '@radix-ng/primitives/core';
|
|
7
7
|
import * as i3 from '@radix-ng/primitives/floating-focus-manager';
|
|
8
8
|
import { getInteractionTypeFromEvent, RdxFloatingFocusManager, provideFloatingFocusManagerConfig, createRdxTriggerInteraction, useTriggerFocusGuards } from '@radix-ng/primitives/floating-focus-manager';
|
|
9
9
|
import { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';
|
|
@@ -34,16 +34,23 @@ class RdxPopoverRoot {
|
|
|
34
34
|
this.hoverCloseDelay = 0;
|
|
35
35
|
this.transition = useTransitionStatus((open) => {
|
|
36
36
|
this.instant.set(false);
|
|
37
|
+
this.instantType.set(undefined);
|
|
37
38
|
this.onOpenChangeComplete.emit(open);
|
|
38
39
|
});
|
|
39
|
-
this.isHoverActive = signal(false,
|
|
40
|
-
|
|
41
|
-
this.
|
|
40
|
+
this.isHoverActive = signal(false, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "isHoverActive" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this.instant = signal(false, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "instant" }] : /* istanbul ignore next */ []));
|
|
44
|
+
this.instantType = signal(undefined, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "instantType" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.openChangeReason = signal('none', /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "openChangeReason" }] : /* istanbul ignore next */ []));
|
|
42
48
|
this.transitionStatus = this.transition.status;
|
|
43
49
|
/**
|
|
44
50
|
* Whether the popover is currently open.
|
|
45
51
|
*/
|
|
46
|
-
this.open = model(false,
|
|
52
|
+
this.open = model(false, /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
47
54
|
/**
|
|
48
55
|
* Whether the popover is initially open.
|
|
49
56
|
*/
|
|
@@ -51,11 +58,13 @@ class RdxPopoverRoot {
|
|
|
51
58
|
/**
|
|
52
59
|
* ID of the trigger associated with a controlled popover.
|
|
53
60
|
*/
|
|
54
|
-
this.triggerId = model(null,
|
|
61
|
+
this.triggerId = model(null, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
|
|
55
63
|
/**
|
|
56
64
|
* ID of the trigger associated with an initially open uncontrolled popover.
|
|
57
65
|
*/
|
|
58
|
-
this.defaultTriggerId = input(null,
|
|
66
|
+
this.defaultTriggerId = input(null, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "defaultTriggerId" }] : /* istanbul ignore next */ []));
|
|
59
68
|
/**
|
|
60
69
|
* Determines whether the popover blocks outside interaction or only traps focus.
|
|
61
70
|
*/
|
|
@@ -63,22 +72,36 @@ class RdxPopoverRoot {
|
|
|
63
72
|
/**
|
|
64
73
|
* Associates this root with detached trigger elements.
|
|
65
74
|
*/
|
|
66
|
-
this.handle = input(
|
|
75
|
+
this.handle = input(/* @ts-ignore */
|
|
76
|
+
...(ngDevMode ? [undefined, { debugName: "handle" }] : /* istanbul ignore next */ []));
|
|
67
77
|
this.contentId = injectId('rdx-popover-content-');
|
|
68
|
-
this.beforeContentFocusGuard = signal(null,
|
|
69
|
-
|
|
70
|
-
this.
|
|
71
|
-
|
|
72
|
-
this.
|
|
73
|
-
|
|
74
|
-
this.
|
|
78
|
+
this.beforeContentFocusGuard = signal(null, /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "beforeContentFocusGuard" }] : /* istanbul ignore next */ []));
|
|
80
|
+
this.descriptionId = signal(undefined, /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "descriptionId" }] : /* istanbul ignore next */ []));
|
|
82
|
+
this.titleId = signal(undefined, /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []));
|
|
84
|
+
this.trigger = signal(undefined, /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.triggers = signal([], /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "triggers" }] : /* istanbul ignore next */ []));
|
|
88
|
+
this.payload = signal(undefined, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "payload" }] : /* istanbul ignore next */ []));
|
|
90
|
+
this.isPointerDownOnTrigger = signal(false, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "isPointerDownOnTrigger" }] : /* istanbul ignore next */ []));
|
|
75
92
|
/** Whether the current open was initiated by touch (ADR 0016 §3 — gates the anchored scroll lock). */
|
|
76
|
-
this.openedByTouch = signal(false,
|
|
77
|
-
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
this.
|
|
81
|
-
|
|
93
|
+
this.openedByTouch = signal(false, /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "openedByTouch" }] : /* istanbul ignore next */ []));
|
|
95
|
+
this.openInteractionType = signal(null, /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "openInteractionType" }] : /* istanbul ignore next */ []));
|
|
97
|
+
this.closeInteractionType = signal(null, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "closeInteractionType" }] : /* istanbul ignore next */ []));
|
|
99
|
+
this.popupCloseCount = signal(0, /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "popupCloseCount" }] : /* istanbul ignore next */ []));
|
|
101
|
+
this.preventUnmountOnClose = signal(false, /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "preventUnmountOnClose" }] : /* istanbul ignore next */ []));
|
|
103
|
+
this.pendingTriggerOpenInteractionType = signal(null, /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "pendingTriggerOpenInteractionType" }] : /* istanbul ignore next */ []));
|
|
82
105
|
this.onOpenChange = output();
|
|
83
106
|
this.onOpenChangeComplete = output();
|
|
84
107
|
this.registeredTriggers = new Map();
|
|
@@ -95,6 +118,12 @@ class RdxPopoverRoot {
|
|
|
95
118
|
this.preventUnmountOnClose.set(false);
|
|
96
119
|
}
|
|
97
120
|
}, { debugName: 'RdxPopoverRoot.clearPreventUnmountOnOpen' });
|
|
121
|
+
// `defaultOpen` / `defaultTriggerId` seed the controllable model exactly once. Unlike the
|
|
122
|
+
// house `if (defaultValue() !== undefined) value.set(...)` guard, these must NOT re-assert the
|
|
123
|
+
// default on every change: once seeded, the user is free to close the popover (or switch the
|
|
124
|
+
// active trigger) and a later read of the still-truthy default input must not snap it back. The
|
|
125
|
+
// one-shot `hasApplied…` latch encodes that "apply once, then hands off to the model" intent —
|
|
126
|
+
// do not "simplify" it into the re-asserting guard.
|
|
98
127
|
effect(() => {
|
|
99
128
|
const defaultOpen = this.defaultOpen();
|
|
100
129
|
if (!this.hasAppliedDefaultOpen && defaultOpen) {
|
|
@@ -161,7 +190,9 @@ class RdxPopoverRoot {
|
|
|
161
190
|
this.openedByTouch.set(interactionType === 'touch');
|
|
162
191
|
this.isHoverActive.set(fromHover);
|
|
163
192
|
this.openChangeReason.set(reason);
|
|
164
|
-
|
|
193
|
+
const openInstant = changedTriggerWhileOpen || reason === 'trigger-focus';
|
|
194
|
+
this.instant.set(openInstant);
|
|
195
|
+
this.instantType.set(!openInstant ? undefined : changedTriggerWhileOpen ? 'trigger-change' : 'focus');
|
|
165
196
|
if (changedTriggerWhileOpen) {
|
|
166
197
|
this.scheduleInstantReset();
|
|
167
198
|
}
|
|
@@ -194,7 +225,11 @@ class RdxPopoverRoot {
|
|
|
194
225
|
this.closeInteractionType.set(getInteractionTypeFromEvent(event));
|
|
195
226
|
this.isHoverActive.set(false);
|
|
196
227
|
this.openedByTouch.set(false);
|
|
197
|
-
|
|
228
|
+
const closeInstant = reason !== 'none' && reason !== 'trigger-hover';
|
|
229
|
+
this.instant.set(closeInstant);
|
|
230
|
+
// Closing by pressing the trigger again is a `'click'`; every other instant close
|
|
231
|
+
// (escape, outside press, focus-out, close button, imperative) reads as a `'dismiss'`.
|
|
232
|
+
this.instantType.set(!closeInstant ? undefined : reason === 'trigger-press' ? 'click' : 'dismiss');
|
|
198
233
|
this.openChangeReason.set(reason);
|
|
199
234
|
this.preventUnmountOnClose.set(change.shouldPreventUnmountOnClose());
|
|
200
235
|
this.open.set(false);
|
|
@@ -344,6 +379,7 @@ class RdxPopoverRoot {
|
|
|
344
379
|
this.instantFrame = undefined;
|
|
345
380
|
if (!this.destroyRef.destroyed && this.open()) {
|
|
346
381
|
this.instant.set(false);
|
|
382
|
+
this.instantType.set(undefined);
|
|
347
383
|
}
|
|
348
384
|
});
|
|
349
385
|
}
|
|
@@ -352,8 +388,8 @@ class RdxPopoverRoot {
|
|
|
352
388
|
this.pendingTriggerOpenInteractionType.set(null);
|
|
353
389
|
return pending ?? getInteractionTypeFromEvent(event);
|
|
354
390
|
}
|
|
355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
356
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
391
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
392
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxPopoverRoot, isStandalone: true, selector: "[rdxPopoverRoot]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, triggerId: { classPropertyName: "triggerId", publicName: "triggerId", isSignal: true, isRequired: false, transformFunction: null }, defaultTriggerId: { classPropertyName: "defaultTriggerId", publicName: "defaultTriggerId", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, handle: { classPropertyName: "handle", publicName: "handle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", triggerId: "triggerIdChange", onOpenChange: "onOpenChange", onOpenChangeComplete: "onOpenChangeComplete" }, providers: [
|
|
357
393
|
provideRdxPopoverRootContext(context),
|
|
358
394
|
// New floating foundation (ADR 0015/0017 migration). Inherit-or-create tree (nested sharing);
|
|
359
395
|
// the per-popup root context bridges open / triggers / reference.
|
|
@@ -361,7 +397,7 @@ class RdxPopoverRoot {
|
|
|
361
397
|
provideFloatingRootContext(() => inject(RdxPopoverRoot).floatingContext)
|
|
362
398
|
], exportAs: ["rdxPopoverRoot"], hostDirectives: [{ directive: i1.RdxPopper }], ngImport: i0 }); }
|
|
363
399
|
}
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverRoot, decorators: [{
|
|
365
401
|
type: Directive,
|
|
366
402
|
args: [{
|
|
367
403
|
selector: '[rdxPopoverRoot]',
|
|
@@ -390,6 +426,7 @@ function contextFor(root) {
|
|
|
390
426
|
hasPopupClose: computed(() => root.popupCloseCount() > 0),
|
|
391
427
|
isHoverActive: root.isHoverActive.asReadonly(),
|
|
392
428
|
instant: root.instant.asReadonly(),
|
|
429
|
+
instantType: root.instantType.asReadonly(),
|
|
393
430
|
openChangeReason: root.openChangeReason.asReadonly(),
|
|
394
431
|
isPointerDownOnTrigger: root.isPointerDownOnTrigger.asReadonly(),
|
|
395
432
|
openedByTouch: root.openedByTouch.asReadonly(),
|
|
@@ -428,14 +465,17 @@ class RdxPopoverArrow {
|
|
|
428
465
|
constructor() {
|
|
429
466
|
this.rootContext = injectRdxPopoverRootContext();
|
|
430
467
|
this.wrapper = inject(RdxPopperContentWrapper, { optional: true });
|
|
431
|
-
this.side = computed(() => this.wrapper?.placedSide(),
|
|
432
|
-
|
|
433
|
-
this.
|
|
468
|
+
this.side = computed(() => this.wrapper?.placedSide(), /* @ts-ignore */
|
|
469
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
470
|
+
this.align = computed(() => this.wrapper?.placedAlign(), /* @ts-ignore */
|
|
471
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
472
|
+
this.uncentered = computed(() => this.wrapper?.arrowUncentered() ?? false, /* @ts-ignore */
|
|
473
|
+
...(ngDevMode ? [{ debugName: "uncentered" }] : /* istanbul ignore next */ []));
|
|
434
474
|
}
|
|
435
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
436
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
475
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverArrow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
476
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverArrow, isStandalone: true, selector: "[rdxPopoverArrow]", host: { properties: { "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-side": "side()", "attr.data-align": "align()", "attr.data-uncentered": "uncentered() ? \"\" : undefined" } }, hostDirectives: [{ directive: i1.RdxPopperArrow }], ngImport: i0 }); }
|
|
437
477
|
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverArrow, decorators: [{
|
|
439
479
|
type: Directive,
|
|
440
480
|
args: [{
|
|
441
481
|
selector: '[rdxPopoverArrow]',
|
|
@@ -466,10 +506,10 @@ class RdxPopoverBackdrop {
|
|
|
466
506
|
inject(DestroyRef).onDestroy(() => floatingContext.removeFloatingElement(host));
|
|
467
507
|
}
|
|
468
508
|
}
|
|
469
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
470
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
509
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
510
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverBackdrop, isStandalone: true, selector: "[rdxPopoverBackdrop]", host: { attributes: { "role": "presentation" }, properties: { "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.data-instant": "rootContext.instantType()", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "style.pointer-events": "rootContext.openChangeReason() === \"trigger-hover\" ? \"none\" : null", "style.user-select": "\"none\"" } }, ngImport: i0 }); }
|
|
471
511
|
}
|
|
472
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverBackdrop, decorators: [{
|
|
473
513
|
type: Directive,
|
|
474
514
|
args: [{
|
|
475
515
|
selector: '[rdxPopoverBackdrop]',
|
|
@@ -477,11 +517,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
477
517
|
role: 'presentation',
|
|
478
518
|
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
|
|
479
519
|
'[attr.data-ending-style]': 'rootContext.transitionStatus() === "ending" ? "" : undefined',
|
|
480
|
-
'[attr.data-instant]': 'rootContext.
|
|
520
|
+
'[attr.data-instant]': 'rootContext.instantType()',
|
|
481
521
|
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
482
522
|
'[attr.data-starting-style]': 'rootContext.transitionStatus() === "starting" ? "" : undefined',
|
|
483
|
-
'[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"',
|
|
484
523
|
'[style.pointer-events]': 'rootContext.openChangeReason() === "trigger-hover" ? "none" : null',
|
|
524
|
+
// Inline `user-select: none` is a deliberate exception to the headless "no inline styles"
|
|
525
|
+
// rule (it carries no themeable state): it mirrors Base UI's backdrop, preventing the page
|
|
526
|
+
// text behind the popup from being accidentally selected during a drag-dismiss. The
|
|
527
|
+
// `-webkit-` prefix is applied imperatively below for older Safari.
|
|
485
528
|
'[style.user-select]': '"none"'
|
|
486
529
|
}
|
|
487
530
|
}]
|
|
@@ -512,8 +555,10 @@ class RdxPopoverPopup {
|
|
|
512
555
|
this.focusManager = inject(RdxFloatingFocusManager);
|
|
513
556
|
this.focusScope = inject(RdxFocusScope);
|
|
514
557
|
this.wrapper = inject(RdxPopperContentWrapper, { optional: true });
|
|
515
|
-
this.align = computed(() => this.wrapper?.placedAlign(),
|
|
516
|
-
|
|
558
|
+
this.align = computed(() => this.wrapper?.placedAlign(), /* @ts-ignore */
|
|
559
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
560
|
+
this.side = computed(() => this.wrapper?.placedSide(), /* @ts-ignore */
|
|
561
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
517
562
|
/** Event handler called when the escape key is down. Can be prevented. */
|
|
518
563
|
this.escapeKeyDown = output();
|
|
519
564
|
/** Event handler called when a pointerdown event happens outside of the popup. Can be prevented. */
|
|
@@ -569,8 +614,8 @@ class RdxPopoverPopup {
|
|
|
569
614
|
}
|
|
570
615
|
});
|
|
571
616
|
}
|
|
572
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
573
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
617
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
618
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverPopup, isStandalone: true, selector: "[rdxPopoverPopup]", outputs: { escapeKeyDown: "escapeKeyDown", pointerDownOutside: "pointerDownOutside", focusOutside: "focusOutside", interactOutside: "interactOutside", openAutoFocus: "openAutoFocus", closeAutoFocus: "closeAutoFocus" }, host: { attributes: { "role": "dialog" }, listeners: { "pointerenter": "rootContext.cancelHoverClose()" }, properties: { "attr.aria-describedby": "rootContext.descriptionId()", "attr.aria-labelledby": "rootContext.titleId()", "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.data-instant": "rootContext.instantType()", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-align": "align()", "attr.data-side": "side()", "id": "rootContext.contentId" } }, providers: [
|
|
574
619
|
provideFloatingFocusManagerConfig(() => {
|
|
575
620
|
const rootContext = injectRdxPopoverRootContext();
|
|
576
621
|
return {
|
|
@@ -592,7 +637,7 @@ class RdxPopoverPopup {
|
|
|
592
637
|
})
|
|
593
638
|
], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFloatingNodeRegistration }, { directive: i3.RdxFloatingFocusManager, inputs: ["initialFocus", "initialFocus", "returnFocus", "finalFocus"] }], ngImport: i0 }); }
|
|
594
639
|
}
|
|
595
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPopup, decorators: [{
|
|
596
641
|
type: Directive,
|
|
597
642
|
args: [{
|
|
598
643
|
selector: '[rdxPopoverPopup]',
|
|
@@ -628,10 +673,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
628
673
|
'[attr.aria-labelledby]': 'rootContext.titleId()',
|
|
629
674
|
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
|
|
630
675
|
'[attr.data-ending-style]': 'rootContext.transitionStatus() === "ending" ? "" : undefined',
|
|
631
|
-
'[attr.data-instant]': 'rootContext.
|
|
676
|
+
'[attr.data-instant]': 'rootContext.instantType()',
|
|
632
677
|
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
633
678
|
'[attr.data-starting-style]': 'rootContext.transitionStatus() === "starting" ? "" : undefined',
|
|
634
|
-
'[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"',
|
|
635
679
|
'[attr.data-align]': 'align()',
|
|
636
680
|
'[attr.data-side]': 'side()',
|
|
637
681
|
'[id]': 'rootContext.contentId',
|
|
@@ -651,10 +695,10 @@ class RdxPopoverClose {
|
|
|
651
695
|
inject(DestroyRef).onDestroy(unregister);
|
|
652
696
|
}
|
|
653
697
|
}
|
|
654
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
655
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverClose, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
699
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverClose, isStandalone: true, selector: "button[rdxPopoverClose]", host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.close(\"close-press\", $event)" } }, ngImport: i0 }); }
|
|
656
700
|
}
|
|
657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverClose, decorators: [{
|
|
658
702
|
type: Directive,
|
|
659
703
|
args: [{
|
|
660
704
|
selector: 'button[rdxPopoverClose]',
|
|
@@ -673,7 +717,8 @@ class RdxPopoverDescription {
|
|
|
673
717
|
this.rootContext = injectRdxPopoverRootContext();
|
|
674
718
|
this.generatedId = injectId('rdx-popover-description-');
|
|
675
719
|
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
676
|
-
this.id = computed(() => this.idInput() ?? this.generatedId,
|
|
720
|
+
this.id = computed(() => this.idInput() ?? this.generatedId, /* @ts-ignore */
|
|
721
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
677
722
|
effect((onCleanup) => {
|
|
678
723
|
const id = this.id();
|
|
679
724
|
this.rootContext.setDescriptionId(id);
|
|
@@ -681,10 +726,10 @@ class RdxPopoverDescription {
|
|
|
681
726
|
});
|
|
682
727
|
inject(DestroyRef).onDestroy(() => this.rootContext.setDescriptionId(undefined));
|
|
683
728
|
}
|
|
684
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
685
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
729
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
730
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxPopoverDescription, isStandalone: true, selector: "[rdxPopoverDescription]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
|
|
686
731
|
}
|
|
687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverDescription, decorators: [{
|
|
688
733
|
type: Directive,
|
|
689
734
|
args: [{
|
|
690
735
|
selector: '[rdxPopoverDescription]',
|
|
@@ -703,10 +748,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
703
748
|
* with `[container]`.
|
|
704
749
|
*/
|
|
705
750
|
class RdxPopoverPortal {
|
|
706
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
707
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
752
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverPortal, isStandalone: true, selector: "ng-template[rdxPopoverPortal]", providers: [provideRdxPresenceContext(() => ({ present: injectRdxPopoverRootContext().present }))], exportAs: ["rdxPopoverPortal"], hostDirectives: [{ directive: i1$1.RdxPortalPresence, inputs: ["container", "container"] }], ngImport: i0 }); }
|
|
708
753
|
}
|
|
709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPortal, decorators: [{
|
|
710
755
|
type: Directive,
|
|
711
756
|
args: [{
|
|
712
757
|
selector: 'ng-template[rdxPopoverPortal]',
|
|
@@ -728,10 +773,10 @@ class RdxPopoverPortalMisuseGuard {
|
|
|
728
773
|
'rdxPopoverPortalPresence has been removed.', 'components/popover');
|
|
729
774
|
}
|
|
730
775
|
}
|
|
731
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
732
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
776
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPortalMisuseGuard, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
777
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverPortalMisuseGuard, isStandalone: true, selector: "[rdxPopoverPortal]:not(ng-template)", ngImport: i0 }); }
|
|
733
778
|
}
|
|
734
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPortalMisuseGuard, decorators: [{
|
|
735
780
|
type: Directive,
|
|
736
781
|
args: [{
|
|
737
782
|
selector: '[rdxPopoverPortal]:not(ng-template)'
|
|
@@ -752,21 +797,23 @@ class RdxPopoverPositioner extends RdxPopperContentWrapper {
|
|
|
752
797
|
this.rootContext = injectRdxPopoverRootContext();
|
|
753
798
|
this.legacyVars = legacyPopperVars('popover');
|
|
754
799
|
this.containerRef = inject(ElementRef);
|
|
755
|
-
this.triggerEl = signal(null,
|
|
756
|
-
|
|
800
|
+
this.triggerEl = signal(null, /* @ts-ignore */
|
|
801
|
+
...(ngDevMode ? [{ debugName: "triggerEl" }] : /* istanbul ignore next */ []));
|
|
802
|
+
this.containerEl = signal(this.containerRef.nativeElement, /* @ts-ignore */
|
|
803
|
+
...(ngDevMode ? [{ debugName: "containerEl" }] : /* istanbul ignore next */ []));
|
|
757
804
|
this.graceArea = useGraceArea(this.triggerEl, this.containerEl);
|
|
758
805
|
effect(() => this.triggerEl.set(this.rootContext.trigger() ?? null));
|
|
759
806
|
this.graceArea.onPointerExit(() => {
|
|
760
807
|
this.rootContext.closeOnHover();
|
|
761
808
|
});
|
|
762
809
|
}
|
|
763
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
764
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
810
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
811
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverPositioner, isStandalone: true, selector: "[rdxPopoverPositioner]", host: { properties: { "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-instant": "rootContext.instantType()", "style": "legacyVars" } }, providers: [
|
|
765
812
|
...provideRdxPopperContentWrapper(RdxPopoverPositioner),
|
|
766
813
|
provideRdxPopperContentConfig({ arrowPadding: 5, collisionPadding: 5, updatePositionStrategy: 'always' })
|
|
767
814
|
], usesInheritance: true, ngImport: i0 }); }
|
|
768
815
|
}
|
|
769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverPositioner, decorators: [{
|
|
770
817
|
type: Directive,
|
|
771
818
|
args: [{
|
|
772
819
|
selector: '[rdxPopoverPositioner]',
|
|
@@ -777,7 +824,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
777
824
|
host: {
|
|
778
825
|
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
779
826
|
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
|
|
780
|
-
'[attr.data-instant]': 'rootContext.
|
|
827
|
+
'[attr.data-instant]': 'rootContext.instantType()',
|
|
781
828
|
// `data-side`/`data-align`/`data-anchor-hidden` and the unified `--anchor-*`/`--available-*`/
|
|
782
829
|
// `--transform-origin` vars come from the inherited wrapper (ADR 0012); only the deprecated
|
|
783
830
|
// `--radix-popover-*` aliases remain, for one release of back-compat.
|
|
@@ -794,7 +841,8 @@ class RdxPopoverTitle {
|
|
|
794
841
|
this.rootContext = injectRdxPopoverRootContext();
|
|
795
842
|
this.generatedId = injectId('rdx-popover-title-');
|
|
796
843
|
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
797
|
-
this.id = computed(() => this.idInput() ?? this.generatedId,
|
|
844
|
+
this.id = computed(() => this.idInput() ?? this.generatedId, /* @ts-ignore */
|
|
845
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
798
846
|
effect((onCleanup) => {
|
|
799
847
|
const id = this.id();
|
|
800
848
|
this.rootContext.setTitleId(id);
|
|
@@ -802,10 +850,10 @@ class RdxPopoverTitle {
|
|
|
802
850
|
});
|
|
803
851
|
inject(DestroyRef).onDestroy(() => this.rootContext.setTitleId(undefined));
|
|
804
852
|
}
|
|
805
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
806
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
854
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxPopoverTitle, isStandalone: true, selector: "[rdxPopoverTitle]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
|
|
807
855
|
}
|
|
808
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverTitle, decorators: [{
|
|
809
857
|
type: Directive,
|
|
810
858
|
args: [{
|
|
811
859
|
selector: '[rdxPopoverTitle]',
|
|
@@ -825,15 +873,18 @@ class RdxPopoverTrigger {
|
|
|
825
873
|
/**
|
|
826
874
|
* Associates this trigger with a detached popover root.
|
|
827
875
|
*/
|
|
828
|
-
this.handle = input(
|
|
876
|
+
this.handle = input(/* @ts-ignore */
|
|
877
|
+
...(ngDevMode ? [undefined, { debugName: "handle" }] : /* istanbul ignore next */ []));
|
|
829
878
|
/**
|
|
830
879
|
* Data associated with this trigger while it is active.
|
|
831
880
|
*/
|
|
832
|
-
this.payload = input(
|
|
881
|
+
this.payload = input(/* @ts-ignore */
|
|
882
|
+
...(ngDevMode ? [undefined, { debugName: "payload" }] : /* istanbul ignore next */ []));
|
|
833
883
|
/**
|
|
834
884
|
* ID used to identify this trigger when opening a detached popover imperatively.
|
|
835
885
|
*/
|
|
836
|
-
this.id = input(
|
|
886
|
+
this.id = input(/* @ts-ignore */
|
|
887
|
+
...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
837
888
|
/**
|
|
838
889
|
* Whether the trigger should ignore user interaction.
|
|
839
890
|
*/
|
|
@@ -850,9 +901,12 @@ class RdxPopoverTrigger {
|
|
|
850
901
|
* How long to wait before closing a hover-opened popover, in milliseconds.
|
|
851
902
|
*/
|
|
852
903
|
this.closeDelay = input(0, { ...(ngDevMode ? { debugName: "closeDelay" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
853
|
-
this.triggerId = computed(() => this.id() ?? this.generatedId,
|
|
854
|
-
|
|
855
|
-
this.
|
|
904
|
+
this.triggerId = computed(() => this.id() ?? this.generatedId, /* @ts-ignore */
|
|
905
|
+
...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
|
|
906
|
+
this.rootContext = computed(() => this.handle()?.context() ?? this.parentRootContext, /* @ts-ignore */
|
|
907
|
+
...(ngDevMode ? [{ debugName: "rootContext" }] : /* istanbul ignore next */ []));
|
|
908
|
+
this.isOpen = computed(() => this.rootContext()?.isOpen() === true && this.rootContext()?.trigger() === this.elementRef.nativeElement, /* @ts-ignore */
|
|
909
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
856
910
|
this.triggerInteraction = createRdxTriggerInteraction({
|
|
857
911
|
trigger: () => this.elementRef.nativeElement,
|
|
858
912
|
activeTrigger: () => this.rootContext()?.trigger(),
|
|
@@ -860,7 +914,8 @@ class RdxPopoverTrigger {
|
|
|
860
914
|
disabled: () => this.disabled(),
|
|
861
915
|
contentId: () => this.rootContext()?.contentId
|
|
862
916
|
});
|
|
863
|
-
this.isPressed = computed(() => this.triggerInteraction.isActive() && this.rootContext()?.openChangeReason() === 'trigger-press',
|
|
917
|
+
this.isPressed = computed(() => this.triggerInteraction.isActive() && this.rootContext()?.openChangeReason() === 'trigger-press', /* @ts-ignore */
|
|
918
|
+
...(ngDevMode ? [{ debugName: "isPressed" }] : /* istanbul ignore next */ []));
|
|
864
919
|
this.generatedId = injectId('rdx-popover-trigger-');
|
|
865
920
|
effect(() => {
|
|
866
921
|
if (!this.handle() && !this.parentRootContext) {
|
|
@@ -928,20 +983,19 @@ class RdxPopoverTrigger {
|
|
|
928
983
|
handlePointerUp() {
|
|
929
984
|
this.rootContext()?.setPointerDownOnTrigger(false);
|
|
930
985
|
}
|
|
931
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
932
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
986
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
987
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxPopoverTrigger, isStandalone: true, selector: "button[rdxPopoverTrigger]", inputs: { handle: { classPropertyName: "handle", publicName: "handle", isSignal: true, isRequired: false, transformFunction: null }, payload: { classPropertyName: "payload", publicName: "payload", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, openOnHover: { classPropertyName: "openOnHover", publicName: "openOnHover", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "handleClick($event)", "pointerenter": "handlePointerEnter($event)", "pointerleave": "handlePointerLeave($event)", "pointerdown": "handlePointerDown($event)", "pointerup": "handlePointerUp()", "pointercancel": "handlePointerUp()" }, properties: { "attr.aria-controls": "triggerInteraction.ariaControls()", "attr.aria-expanded": "triggerInteraction.ariaExpanded()", "attr.aria-haspopup": "\"dialog\"", "attr.data-popup-open": "triggerInteraction.dataPopupOpen()", "attr.data-pressed": "isPressed() ? \"\" : undefined", "attr.disabled": "triggerInteraction.disabled() ? \"\" : undefined", "id": "triggerId()" } }, hostDirectives: [{ directive: i1.RdxPopperAnchor }], ngImport: i0 }); }
|
|
933
988
|
}
|
|
934
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverTrigger, decorators: [{
|
|
935
990
|
type: Directive,
|
|
936
991
|
args: [{
|
|
937
992
|
selector: 'button[rdxPopoverTrigger]',
|
|
938
993
|
hostDirectives: [RdxPopperAnchor],
|
|
939
994
|
host: {
|
|
940
995
|
type: 'button',
|
|
941
|
-
'[attr.aria-controls]': '
|
|
996
|
+
'[attr.aria-controls]': 'triggerInteraction.ariaControls()',
|
|
942
997
|
'[attr.aria-expanded]': 'triggerInteraction.ariaExpanded()',
|
|
943
998
|
'[attr.aria-haspopup]': '"dialog"',
|
|
944
|
-
'[attr.data-state]': 'triggerInteraction.dataState()',
|
|
945
999
|
'[attr.data-popup-open]': 'triggerInteraction.dataPopupOpen()',
|
|
946
1000
|
'[attr.data-pressed]': 'isPressed() ? "" : undefined',
|
|
947
1001
|
'[attr.disabled]': 'triggerInteraction.disabled() ? "" : undefined',
|
|
@@ -968,8 +1022,10 @@ class RdxPopoverViewport {
|
|
|
968
1022
|
this.rootContext = injectRdxPopoverRootContext();
|
|
969
1023
|
this.elementRef = inject(ElementRef);
|
|
970
1024
|
this.destroyRef = inject(DestroyRef);
|
|
971
|
-
this.activationDirection = signal(undefined,
|
|
972
|
-
|
|
1025
|
+
this.activationDirection = signal(undefined, /* @ts-ignore */
|
|
1026
|
+
...(ngDevMode ? [{ debugName: "activationDirection" }] : /* istanbul ignore next */ []));
|
|
1027
|
+
this.transitioning = signal(false, /* @ts-ignore */
|
|
1028
|
+
...(ngDevMode ? [{ debugName: "transitioning" }] : /* istanbul ignore next */ []));
|
|
973
1029
|
const unregister = this.rootContext.registerViewport((previousTrigger, nextTrigger) => {
|
|
974
1030
|
this.startTransition(previousTrigger, nextTrigger);
|
|
975
1031
|
});
|
|
@@ -1020,8 +1076,7 @@ class RdxPopoverViewport {
|
|
|
1020
1076
|
if (this.previous !== previous) {
|
|
1021
1077
|
return;
|
|
1022
1078
|
}
|
|
1023
|
-
const
|
|
1024
|
-
const duration = Math.max(getMaxDuration(style.animationDuration, style.animationDelay), getMaxDuration(style.transitionDuration, style.transitionDelay));
|
|
1079
|
+
const duration = getMaxTransitionDuration(previous);
|
|
1025
1080
|
this.cleanupTimer = setTimeout(() => this.cleanupPrevious(), duration > 0 ? duration + 50 : 0);
|
|
1026
1081
|
}
|
|
1027
1082
|
cleanupPrevious() {
|
|
@@ -1033,15 +1088,16 @@ class RdxPopoverViewport {
|
|
|
1033
1088
|
this.previous = undefined;
|
|
1034
1089
|
this.transitioning.set(false);
|
|
1035
1090
|
}
|
|
1036
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1037
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1091
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverViewport, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1092
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxPopoverViewport, isStandalone: true, selector: "[rdxPopoverViewport]", host: { properties: { "attr.data-activation-direction": "activationDirection()", "attr.data-instant": "rootContext.instantType()", "attr.data-transitioning": "transitioning() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
1038
1093
|
}
|
|
1039
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverViewport, decorators: [{
|
|
1040
1095
|
type: Directive,
|
|
1041
1096
|
args: [{
|
|
1042
1097
|
selector: '[rdxPopoverViewport]',
|
|
1043
1098
|
host: {
|
|
1044
1099
|
'[attr.data-activation-direction]': 'activationDirection()',
|
|
1100
|
+
'[attr.data-instant]': 'rootContext.instantType()',
|
|
1045
1101
|
'[attr.data-transitioning]': 'transitioning() ? "" : undefined'
|
|
1046
1102
|
}
|
|
1047
1103
|
}]
|
|
@@ -1073,28 +1129,15 @@ function removeIds(element) {
|
|
|
1073
1129
|
function getCenter(rect) {
|
|
1074
1130
|
return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
|
|
1075
1131
|
}
|
|
1076
|
-
function getMaxDuration(durations, delays) {
|
|
1077
|
-
const durationValues = durations.split(',').map(parseDuration);
|
|
1078
|
-
const delayValues = delays.split(',').map(parseDuration);
|
|
1079
|
-
return durationValues.reduce((max, duration, index) => {
|
|
1080
|
-
const delay = delayValues[index % delayValues.length] ?? 0;
|
|
1081
|
-
return Math.max(max, duration + delay);
|
|
1082
|
-
}, 0);
|
|
1083
|
-
}
|
|
1084
|
-
function parseDuration(value) {
|
|
1085
|
-
const duration = Number.parseFloat(value);
|
|
1086
|
-
if (Number.isNaN(duration)) {
|
|
1087
|
-
return 0;
|
|
1088
|
-
}
|
|
1089
|
-
return value.trim().endsWith('ms') ? duration : duration * 1000;
|
|
1090
|
-
}
|
|
1091
1132
|
|
|
1092
1133
|
class RdxPopoverHandle {
|
|
1093
1134
|
constructor() {
|
|
1094
|
-
this.rootContext = signal(undefined,
|
|
1135
|
+
this.rootContext = signal(undefined, /* @ts-ignore */
|
|
1136
|
+
...(ngDevMode ? [{ debugName: "rootContext" }] : /* istanbul ignore next */ []));
|
|
1095
1137
|
this.triggers = new Map();
|
|
1096
1138
|
this.rootTriggerCleanups = new Map();
|
|
1097
|
-
this.isOpen = computed(() => this.rootContext()?.isOpen() ?? false,
|
|
1139
|
+
this.isOpen = computed(() => this.rootContext()?.isOpen() ?? false, /* @ts-ignore */
|
|
1140
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
1098
1141
|
}
|
|
1099
1142
|
open(triggerId) {
|
|
1100
1143
|
const trigger = this.triggers.get(triggerId);
|
|
@@ -1164,8 +1207,8 @@ const popoverImports = [
|
|
|
1164
1207
|
RdxPopoverViewport
|
|
1165
1208
|
];
|
|
1166
1209
|
class RdxPopoverModule {
|
|
1167
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1168
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1210
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1211
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverModule, imports: [RdxPopoverRoot,
|
|
1169
1212
|
RdxPopoverTrigger,
|
|
1170
1213
|
RdxPopoverPortal,
|
|
1171
1214
|
RdxPopoverPortalMisuseGuard,
|
|
@@ -1188,9 +1231,9 @@ class RdxPopoverModule {
|
|
|
1188
1231
|
RdxPopoverDescription,
|
|
1189
1232
|
RdxPopoverClose,
|
|
1190
1233
|
RdxPopoverViewport] }); }
|
|
1191
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1234
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverModule }); }
|
|
1192
1235
|
}
|
|
1193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxPopoverModule, decorators: [{
|
|
1194
1237
|
type: NgModule,
|
|
1195
1238
|
args: [{
|
|
1196
1239
|
imports: [...popoverImports],
|