@radix-ng/primitives 1.0.0-beta.2 → 1.0.0-beta.3
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-alert-dialog.mjs +30 -24
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +1786 -0
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-combobox.mjs +107 -47
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +43 -45
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +153 -63
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +40 -20
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +38 -54
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +35 -50
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +11 -5
- 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 +36 -50
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +106 -92
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +37 -40
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +5 -1
- package/types/radix-ng-primitives-alert-dialog.d.ts +17 -11
- package/types/radix-ng-primitives-autocomplete.d.ts +596 -0
- package/types/radix-ng-primitives-combobox.d.ts +61 -16
- package/types/radix-ng-primitives-dialog.d.ts +32 -25
- package/types/radix-ng-primitives-drawer.d.ts +49 -22
- package/types/radix-ng-primitives-menu.d.ts +19 -10
- package/types/radix-ng-primitives-navigation-menu.d.ts +24 -26
- package/types/radix-ng-primitives-popover.d.ts +23 -23
- package/types/radix-ng-primitives-popper.d.ts +7 -1
- 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 +24 -23
- package/types/radix-ng-primitives-select.d.ts +52 -55
- package/types/radix-ng-primitives-tooltip.d.ts +26 -19
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, model, input, booleanAttribute, output, computed, signal, untracked, effect, Directive, InjectionToken, ElementRef, Injector, DestroyRef, afterNextRender,
|
|
2
|
+
import { inject, model, input, booleanAttribute, output, computed, signal, untracked, effect, Directive, InjectionToken, ElementRef, Injector, DestroyRef, afterNextRender, linkedSignal, isDevMode, numberAttribute, forwardRef } from '@angular/core';
|
|
3
3
|
import { isEqual, getActiveElement, createContext, useTransitionStatus, isNullish, injectId, useListHighlight, useScrollLock, handleAndDispatchCustomEvent } from '@radix-ng/primitives/core';
|
|
4
4
|
import * as i1 from '@radix-ng/primitives/popper';
|
|
5
|
-
import { RdxPopper,
|
|
6
|
-
import * as
|
|
5
|
+
import { RdxPopper, RdxPopperContent, RdxPopperContentWrapper, RdxPopperAnchor } from '@radix-ng/primitives/popper';
|
|
6
|
+
import * as i4 from '@radix-ng/primitives/collection';
|
|
7
7
|
import { RdxCollectionProvider, RdxCollectionItem } from '@radix-ng/primitives/collection';
|
|
8
8
|
import { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i3 from '@radix-ng/primitives/dismissable-layer';
|
|
10
10
|
import { RdxDismissableLayer, provideRdxDismissableLayerConfig } from '@radix-ng/primitives/dismissable-layer';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i2 from '@radix-ng/primitives/focus-scope';
|
|
12
12
|
import { RdxFocusScope } from '@radix-ng/primitives/focus-scope';
|
|
13
|
-
import * as i1$
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';
|
|
13
|
+
import * as i1$1 from '@radix-ng/primitives/portal';
|
|
14
|
+
import { RdxPortalPresence } from '@radix-ng/primitives/portal';
|
|
15
|
+
import { provideRdxPresenceContext } from '@radix-ng/primitives/presence';
|
|
17
16
|
import { injectFieldRootContext } from '@radix-ng/primitives/field';
|
|
18
17
|
|
|
19
18
|
const OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];
|
|
@@ -300,32 +299,40 @@ const [injectSelectPopupContext, provideSelectPopupContext] = createContext('Rdx
|
|
|
300
299
|
const RDX_SELECT_POSITIONER_TOKEN = new InjectionToken('RDX_SELECT_POSITIONER_TOKEN');
|
|
301
300
|
/**
|
|
302
301
|
* The popup listbox. Holds DOM focus while open and navigates with the highlight model
|
|
303
|
-
* (`aria-activedescendant`) — items are not individually focusable.
|
|
304
|
-
*
|
|
302
|
+
* (`aria-activedescendant`) — items are not individually focusable.
|
|
303
|
+
*
|
|
304
|
+
* Since ADR 0010 §6 the popup is the **inner** element (the positioner is its ancestor): it carries
|
|
305
|
+
* `role="listbox"`, the `contentId`, and — via the composed {@link RdxPopperContent} — the
|
|
306
|
+
* `data-side` / `data-align` attributes and the until-positioned animation guard previously held by
|
|
307
|
+
* the deleted `rdxSelectPositionerContent`. `RdxPopperContent` also makes the popup the element the
|
|
308
|
+
* `RdxPopperContentWrapper` ancestor reads its content z-index from. In item-aligned mode there is no
|
|
309
|
+
* wrapper, so `RdxPopperContent` no-ops.
|
|
305
310
|
*
|
|
306
311
|
* @group Components
|
|
307
312
|
*/
|
|
308
313
|
class RdxSelectPopup {
|
|
309
|
-
set positioner(port) {
|
|
310
|
-
if (port) {
|
|
311
|
-
port.placed.subscribe(() => {
|
|
312
|
-
this.highlightSelectedItem();
|
|
313
|
-
this.scrollSelectedIntoView();
|
|
314
|
-
this.isPositioned.set(true);
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
314
|
constructor() {
|
|
319
315
|
this.dismissableLayer = inject(RdxDismissableLayer);
|
|
320
316
|
this.currentElement = inject(ElementRef);
|
|
321
317
|
this.collection = inject(RdxCollectionProvider);
|
|
322
318
|
this.injector = inject(Injector);
|
|
323
319
|
this.rootContext = injectSelectRootContext();
|
|
324
|
-
/**
|
|
320
|
+
/**
|
|
321
|
+
* The collected items (DOM order). Exposed so the `item-aligned` positioner — now the popup's
|
|
322
|
+
* **ancestor** — can read them without injecting {@link RdxCollectionProvider} (which the popup
|
|
323
|
+
* provides as a descendant, so an upward `inject` would not find it).
|
|
324
|
+
*/
|
|
325
|
+
this.items = this.collection.items;
|
|
326
|
+
/**
|
|
327
|
+
* Highlight-model navigation over the collected items (DOM order). `loop` is disabled so arrow
|
|
328
|
+
* navigation stops at the first / last item instead of wrapping around — matching native
|
|
329
|
+
* `<select>` behavior.
|
|
330
|
+
*/
|
|
325
331
|
this.highlight = useListHighlight({
|
|
326
332
|
items: this.collection.items,
|
|
327
333
|
isNavigable: (item) => !item.disabled(),
|
|
328
334
|
getId: (item) => item.element.id,
|
|
335
|
+
loop: signal(false),
|
|
329
336
|
injector: this.injector
|
|
330
337
|
});
|
|
331
338
|
this.selectedItem = signal(undefined, ...(ngDevMode ? [{ debugName: "selectedItem" }] : /* istanbul ignore next */ []));
|
|
@@ -347,6 +354,35 @@ class RdxSelectPopup {
|
|
|
347
354
|
*/
|
|
348
355
|
this.pointerDownOutside = outputFromObservable(outputToObservable(this.dismissableLayer.pointerDownOutside));
|
|
349
356
|
this.content = signal(null, ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
357
|
+
/**
|
|
358
|
+
* The positioner — now an **ancestor** element — provides {@link RDX_SELECT_POSITIONER_TOKEN}
|
|
359
|
+
* (Popper or item-aligned). We react to its `placed` to highlight and scroll the selected item
|
|
360
|
+
* into view and flag the popup as positioned.
|
|
361
|
+
*/
|
|
362
|
+
this.positioner = inject(RDX_SELECT_POSITIONER_TOKEN, { optional: true });
|
|
363
|
+
this.positioner?.placed.subscribe(() => {
|
|
364
|
+
this.highlightSelectedItem();
|
|
365
|
+
this.scrollSelectedIntoView();
|
|
366
|
+
this.isPositioned.set(true);
|
|
367
|
+
// In Popper mode the popup lives inside the positioner, which stays `visibility: hidden`
|
|
368
|
+
// until it is placed — so the mount-time `mountAutoFocus` call no-ops on the hidden
|
|
369
|
+
// listbox and keyboard navigation never starts. Focus it now that it is visible (skip if
|
|
370
|
+
// focus already moved inside, e.g. item-aligned mode or a re-placement).
|
|
371
|
+
const popup = this.content();
|
|
372
|
+
if (popup && !popup.contains(document.activeElement)) {
|
|
373
|
+
popup.focus({ preventScroll: true });
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
// Keep the highlighted item in view during keyboard navigation. The highlight model is pure
|
|
377
|
+
// state (it never moves DOM focus or scrolls), so without this the highlight can move past the
|
|
378
|
+
// visible viewport — behind the scroll buttons. Only keyboard moves scroll; hover highlights
|
|
379
|
+
// must not (the cursor is already over a visible item).
|
|
380
|
+
effect(() => {
|
|
381
|
+
const item = this.highlight.highlightedItem();
|
|
382
|
+
if (item && this.keyboardActive) {
|
|
383
|
+
item.element.scrollIntoView?.({ block: 'nearest' });
|
|
384
|
+
}
|
|
385
|
+
});
|
|
350
386
|
// Lock page scroll while a modal popup is open (content mounts only while open).
|
|
351
387
|
useScrollLock(this.rootContext.modal);
|
|
352
388
|
// The popup's animation determines when the open/close transition (onOpenChangeComplete) is done.
|
|
@@ -368,7 +404,8 @@ class RdxSelectPopup {
|
|
|
368
404
|
event.preventDefault();
|
|
369
405
|
this.content()?.focus({ preventScroll: true });
|
|
370
406
|
});
|
|
371
|
-
|
|
407
|
+
// The popup is now the listbox host itself (no longer the positioner's first child).
|
|
408
|
+
this.content.set(this.currentElement.nativeElement);
|
|
372
409
|
});
|
|
373
410
|
effect((onCleanup) => {
|
|
374
411
|
if (!this.content())
|
|
@@ -470,20 +507,20 @@ class RdxSelectPopup {
|
|
|
470
507
|
}
|
|
471
508
|
}
|
|
472
509
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
473
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSelectPopup, isStandalone: true, selector: "[rdxSelectPopup]", outputs: { escapeKeyDown: "escapeKeyDown", pointerDownOutside: "pointerDownOutside" }, host: { attributes: { "role": "listbox", "tabindex": "-1" }, listeners: { "keydown": "handleKeyDown($event)" }, properties: { "attr.aria-activedescendant": "highlight.activeId()", "attr.aria-multiselectable": "rootContext.multiple() ? \"true\" : undefined", "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-open": "rootContext.open() ? \"\" : undefined", "attr.data-closed": "rootContext.open() ? undefined : \"\"", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "dir": "rootContext.dir()", "style": "{\n display: 'flex',\n flexDirection: 'column',\n outline: 'none'\n }" } }, providers: [
|
|
510
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSelectPopup, isStandalone: true, selector: "[rdxSelectPopup]", outputs: { escapeKeyDown: "escapeKeyDown", pointerDownOutside: "pointerDownOutside" }, host: { attributes: { "role": "listbox", "tabindex": "-1" }, listeners: { "keydown": "handleKeyDown($event)" }, properties: { "id": "rootContext.contentId", "attr.aria-activedescendant": "highlight.activeId()", "attr.aria-multiselectable": "rootContext.multiple() ? \"true\" : undefined", "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-open": "rootContext.open() ? \"\" : undefined", "attr.data-closed": "rootContext.open() ? undefined : \"\"", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "dir": "rootContext.dir()", "style": "{\n display: 'flex',\n flexDirection: 'column',\n outline: 'none'\n }" } }, providers: [
|
|
474
511
|
provideSelectPopupContext(context$1),
|
|
475
512
|
provideRdxDismissableLayerConfig(() => {
|
|
476
513
|
return {
|
|
477
514
|
disableOutsidePointerEvents: injectSelectRootContext().modal
|
|
478
515
|
};
|
|
479
516
|
})
|
|
480
|
-
],
|
|
517
|
+
], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFocusScope }, { directive: i3.RdxDismissableLayer }, { directive: i4.RdxCollectionProvider }], ngImport: i0 }); }
|
|
481
518
|
}
|
|
482
519
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPopup, decorators: [{
|
|
483
520
|
type: Directive,
|
|
484
521
|
args: [{
|
|
485
522
|
selector: '[rdxSelectPopup]',
|
|
486
|
-
hostDirectives: [RdxFocusScope, RdxDismissableLayer, RdxCollectionProvider],
|
|
523
|
+
hostDirectives: [RdxPopperContent, RdxFocusScope, RdxDismissableLayer, RdxCollectionProvider],
|
|
487
524
|
providers: [
|
|
488
525
|
provideSelectPopupContext(context$1),
|
|
489
526
|
provideRdxDismissableLayerConfig(() => {
|
|
@@ -495,6 +532,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
495
532
|
host: {
|
|
496
533
|
role: 'listbox',
|
|
497
534
|
tabindex: '-1',
|
|
535
|
+
'[id]': 'rootContext.contentId',
|
|
498
536
|
'[attr.aria-activedescendant]': 'highlight.activeId()',
|
|
499
537
|
'[attr.aria-multiselectable]': 'rootContext.multiple() ? "true" : undefined',
|
|
500
538
|
'[attr.data-state]': 'rootContext.open() ? "open" : "closed"',
|
|
@@ -511,10 +549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
511
549
|
}`
|
|
512
550
|
}
|
|
513
551
|
}]
|
|
514
|
-
}], ctorParameters: () => [], propDecorators: { escapeKeyDown: [{ type: i0.Output, args: ["escapeKeyDown"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }]
|
|
515
|
-
type: ContentChild,
|
|
516
|
-
args: [RDX_SELECT_POSITIONER_TOKEN, { descendants: true }]
|
|
517
|
-
}] } });
|
|
552
|
+
}], ctorParameters: () => [], propDecorators: { escapeKeyDown: [{ type: i0.Output, args: ["escapeKeyDown"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }] } });
|
|
518
553
|
|
|
519
554
|
const context = () => {
|
|
520
555
|
const context = inject(RdxSelectItem);
|
|
@@ -590,7 +625,7 @@ class RdxSelectItem {
|
|
|
590
625
|
this.onPointerUp(keyEvent);
|
|
591
626
|
}
|
|
592
627
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
593
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSelectItem, isStandalone: true, selector: "[rdxSelectItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "pointerup": "onPointerUp($event)", "pointerleave": "onPointerLeave($event)", "pointermove": "onPointerMove($event)" }, properties: { "attr.id": "id", "attr.aria-selected": "isSelected()", "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-state": "isSelected() ? \"checked\" : \"unchecked\"", "attr.data-selected": "isSelected() ? \"\" : undefined", "attr.data-highlighted": "isHighlighted() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideSelectItemContext(context)], exportAs: ["rdxSelectItem"], hostDirectives: [{ directive:
|
|
628
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSelectItem, isStandalone: true, selector: "[rdxSelectItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "pointerup": "onPointerUp($event)", "pointerleave": "onPointerLeave($event)", "pointermove": "onPointerMove($event)" }, properties: { "attr.id": "id", "attr.aria-selected": "isSelected()", "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-state": "isSelected() ? \"checked\" : \"unchecked\"", "attr.data-selected": "isSelected() ? \"\" : undefined", "attr.data-highlighted": "isHighlighted() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideSelectItemContext(context)], exportAs: ["rdxSelectItem"], hostDirectives: [{ directive: i4.RdxCollectionItem, inputs: ["value", "value", "disabled", "disabled"] }], ngImport: i0 }); }
|
|
594
629
|
}
|
|
595
630
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectItem, decorators: [{
|
|
596
631
|
type: Directive,
|
|
@@ -708,51 +743,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
708
743
|
}]
|
|
709
744
|
}], ctorParameters: () => [] });
|
|
710
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Structural directive that teleports the select popup into a container (default `document.body`)
|
|
748
|
+
* while the select is open, and keeps it mounted until any CSS exit `@keyframes` finishes.
|
|
749
|
+
*
|
|
750
|
+
* Apply it with the `*` microsyntax on the popup — `<div *rdxSelectPortal rdxSelectPopup>` — or as an
|
|
751
|
+
* explicit `<ng-template rdxSelectPortal>`. For a custom container use the explicit form with
|
|
752
|
+
* `[container]`. Unlike the previous attribute portal it no longer parks an empty wrapper `<div>` in
|
|
753
|
+
* `document.body` while the select is closed.
|
|
754
|
+
*/
|
|
711
755
|
class RdxSelectPortal {
|
|
712
|
-
constructor() {
|
|
713
|
-
/**
|
|
714
|
-
* Optional container to portal the content into. Defaults to `document.body` when not set.
|
|
715
|
-
*/
|
|
716
|
-
this.container = input(...(ngDevMode ? [undefined, { debugName: "container" }] : /* istanbul ignore next */ []));
|
|
717
|
-
}
|
|
718
756
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
719
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
757
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSelectPortal, isStandalone: true, selector: "ng-template[rdxSelectPortal]", providers: [provideRdxPresenceContext(() => ({ present: injectSelectRootContext().open }))], exportAs: ["rdxSelectPortal"], hostDirectives: [{ directive: i1$1.RdxPortalPresence, inputs: ["container", "container"] }], ngImport: i0 }); }
|
|
720
758
|
}
|
|
721
759
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPortal, decorators: [{
|
|
722
760
|
type: Directive,
|
|
723
761
|
args: [{
|
|
724
|
-
selector: '[rdxSelectPortal]',
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
inputs: ['container']
|
|
729
|
-
}
|
|
730
|
-
]
|
|
762
|
+
selector: 'ng-template[rdxSelectPortal]',
|
|
763
|
+
exportAs: 'rdxSelectPortal',
|
|
764
|
+
hostDirectives: [{ directive: RdxPortalPresence, inputs: ['container'] }],
|
|
765
|
+
providers: [provideRdxPresenceContext(() => ({ present: injectSelectRootContext().open }))]
|
|
731
766
|
}]
|
|
732
|
-
}]
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
767
|
+
}] });
|
|
768
|
+
/**
|
|
769
|
+
* Dev-mode guard: `rdxSelectPortal` used to be an attribute directive on a `<div>`. It is now
|
|
770
|
+
* structural, so the old `<div rdxSelectPortal>` markup would silently stop portaling — fail loudly
|
|
771
|
+
* instead.
|
|
772
|
+
*/
|
|
773
|
+
class RdxSelectPortalMisuseGuard {
|
|
774
|
+
constructor() {
|
|
775
|
+
if (isDevMode()) {
|
|
776
|
+
throw new Error('[rdxSelectPortal] is now a structural directive. ' +
|
|
777
|
+
'Use `*rdxSelectPortal` on the popup element or `<ng-template rdxSelectPortal>`. ' +
|
|
778
|
+
'rdxSelectPortalPresence has been removed. See https://radix-ng.com/components/select.md');
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPortalMisuseGuard, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
782
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSelectPortalMisuseGuard, isStandalone: true, selector: "[rdxSelectPortal]:not(ng-template)", ngImport: i0 }); }
|
|
742
783
|
}
|
|
743
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPortalMisuseGuard, decorators: [{
|
|
744
785
|
type: Directive,
|
|
745
786
|
args: [{
|
|
746
|
-
selector: 'ng-template
|
|
747
|
-
hostDirectives: [RdxPresenceDirective],
|
|
748
|
-
providers: [
|
|
749
|
-
provideRdxPresenceContext(() => {
|
|
750
|
-
const context = injectSelectRootContext();
|
|
751
|
-
return { present: context.open };
|
|
752
|
-
})
|
|
753
|
-
]
|
|
787
|
+
selector: '[rdxSelectPortal]:not(ng-template)'
|
|
754
788
|
}]
|
|
755
|
-
}] });
|
|
789
|
+
}], ctorParameters: () => [] });
|
|
756
790
|
|
|
757
791
|
class RdxSelectPositioner {
|
|
758
792
|
constructor() {
|
|
@@ -812,7 +846,7 @@ class RdxSelectPositioner {
|
|
|
812
846
|
this.placed = outputFromObservable(outputToObservable(inject(RdxPopperContentWrapper).placed));
|
|
813
847
|
}
|
|
814
848
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
815
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSelectPositioner, isStandalone: true, selector: "[rdxSelectPositioner]", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrowPadding: { classPropertyName: "arrowPadding", publicName: "arrowPadding", isSignal: true, isRequired: false, transformFunction: null }, avoidCollisions: { classPropertyName: "avoidCollisions", publicName: "avoidCollisions", isSignal: true, isRequired: false, transformFunction: null }, collisionBoundary: { classPropertyName: "collisionBoundary", publicName: "collisionBoundary", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, updatePositionStrategy: { classPropertyName: "updatePositionStrategy", publicName: "updatePositionStrategy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { placed: "placed" }, host: { properties: { "style": "{\n 'boxSizing': 'border-box',\n '--radix-
|
|
849
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSelectPositioner, isStandalone: true, selector: "[rdxSelectPositioner]", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrowPadding: { classPropertyName: "arrowPadding", publicName: "arrowPadding", isSignal: true, isRequired: false, transformFunction: null }, avoidCollisions: { classPropertyName: "avoidCollisions", publicName: "avoidCollisions", isSignal: true, isRequired: false, transformFunction: null }, collisionBoundary: { classPropertyName: "collisionBoundary", publicName: "collisionBoundary", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, updatePositionStrategy: { classPropertyName: "updatePositionStrategy", publicName: "updatePositionStrategy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { placed: "placed" }, host: { properties: { "style": "{\n 'boxSizing': 'border-box',\n '--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-select-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-select-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-select-trigger-height': 'var(--radix-popper-anchor-height)',\n }" } }, providers: [
|
|
816
850
|
{
|
|
817
851
|
provide: RDX_SELECT_POSITIONER_TOKEN,
|
|
818
852
|
useExisting: forwardRef(() => RdxSelectPositioner)
|
|
@@ -851,35 +885,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
851
885
|
// re-namespace exposed content custom properties
|
|
852
886
|
'[style]': `{
|
|
853
887
|
'boxSizing': 'border-box',
|
|
854
|
-
'--radix-
|
|
855
|
-
'--radix-
|
|
856
|
-
'--radix-
|
|
857
|
-
'--radix-
|
|
858
|
-
'--radix-
|
|
888
|
+
'--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
889
|
+
'--radix-select-content-available-width': 'var(--radix-popper-available-width)',
|
|
890
|
+
'--radix-select-content-available-height': 'var(--radix-popper-available-height)',
|
|
891
|
+
'--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
892
|
+
'--radix-select-trigger-height': 'var(--radix-popper-anchor-height)',
|
|
859
893
|
}`
|
|
860
894
|
}
|
|
861
895
|
}]
|
|
862
896
|
}], propDecorators: { side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], alignOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignOffset", required: false }] }], arrowPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowPadding", required: false }] }], avoidCollisions: [{ type: i0.Input, args: [{ isSignal: true, alias: "avoidCollisions", required: false }] }], collisionBoundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionBoundary", required: false }] }], collisionPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "collisionPadding", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], hideWhenDetached: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideWhenDetached", required: false }] }], updatePositionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "updatePositionStrategy", required: false }] }], placed: [{ type: i0.Output, args: ["placed"] }] } });
|
|
863
897
|
|
|
864
|
-
class RdxSelectPositionerContent {
|
|
865
|
-
constructor() {
|
|
866
|
-
this.rootContext = injectSelectRootContext();
|
|
867
|
-
}
|
|
868
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPositionerContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
869
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSelectPositionerContent, isStandalone: true, selector: "[rdxSelectPositionerContent]", host: { attributes: { "role": "listbox" }, properties: { "id": "rootContext.contentId" } }, hostDirectives: [{ directive: i1.RdxPopperContent }], ngImport: i0 }); }
|
|
870
|
-
}
|
|
871
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSelectPositionerContent, decorators: [{
|
|
872
|
-
type: Directive,
|
|
873
|
-
args: [{
|
|
874
|
-
selector: '[rdxSelectPositionerContent]',
|
|
875
|
-
hostDirectives: [RdxPopperContent],
|
|
876
|
-
host: {
|
|
877
|
-
role: 'listbox',
|
|
878
|
-
'[id]': 'rootContext.contentId'
|
|
879
|
-
}
|
|
880
|
-
}]
|
|
881
|
-
}] });
|
|
882
|
-
|
|
883
898
|
/**
|
|
884
899
|
* A visual divider between groups of items.
|
|
885
900
|
*
|
|
@@ -1071,6 +1086,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1071
1086
|
const _importsSelect = [
|
|
1072
1087
|
RdxSelectRoot,
|
|
1073
1088
|
RdxSelectPortal,
|
|
1089
|
+
RdxSelectPortalMisuseGuard,
|
|
1074
1090
|
RdxSelectTrigger,
|
|
1075
1091
|
RdxSelectValue,
|
|
1076
1092
|
RdxSelectPopup,
|
|
@@ -1080,9 +1096,7 @@ const _importsSelect = [
|
|
|
1080
1096
|
RdxSelectItemText,
|
|
1081
1097
|
RdxSelectGroupLabel,
|
|
1082
1098
|
RdxSelectGroup,
|
|
1083
|
-
RdxSelectPositionerContent,
|
|
1084
1099
|
RdxSelectPositioner,
|
|
1085
|
-
RdxSelectPortalPresence,
|
|
1086
1100
|
RdxSelectIcon,
|
|
1087
1101
|
RdxSelectSeparator,
|
|
1088
1102
|
RdxSelectBackdrop
|
|
@@ -1092,5 +1106,5 @@ const _importsSelect = [
|
|
|
1092
1106
|
* Generated bundle index. Do not edit.
|
|
1093
1107
|
*/
|
|
1094
1108
|
|
|
1095
|
-
export { CONTENT_MARGIN, OPEN_KEYS, RDX_SELECT_POSITIONER_TOKEN, RdxSelectBackdrop, RdxSelectGroup, RdxSelectGroupLabel, RdxSelectIcon, RdxSelectItem, RdxSelectItemIndicator, RdxSelectItemText, RdxSelectList, RdxSelectPopup, RdxSelectPortal,
|
|
1109
|
+
export { CONTENT_MARGIN, OPEN_KEYS, RDX_SELECT_POSITIONER_TOKEN, RdxSelectBackdrop, RdxSelectGroup, RdxSelectGroupLabel, RdxSelectIcon, RdxSelectItem, RdxSelectItemIndicator, RdxSelectItemText, RdxSelectList, RdxSelectPopup, RdxSelectPortal, RdxSelectPortalMisuseGuard, RdxSelectPositioner, RdxSelectRoot, RdxSelectSeparator, RdxSelectTrigger, RdxSelectValue, SELECTION_KEYS, _importsSelect, compare, focusFirst, injectSelectItemContext, injectSelectPopupContext, injectSelectRootContext, provideSelectItemContext, provideSelectPopupContext, provideSelectRootContext, shouldShowPlaceholder, valueComparator };
|
|
1096
1110
|
//# sourceMappingURL=radix-ng-primitives-select.mjs.map
|