@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,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, computed, Directive, input, signal, TemplateRef, booleanAttribute, effect, untracked, ElementRef, output, DestroyRef, numberAttribute, model, ViewContainerRef, Renderer2, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, computed, Directive, input, signal, TemplateRef, booleanAttribute, effect, untracked, ElementRef, output, DestroyRef, isDevMode, numberAttribute, model, ViewContainerRef, Renderer2, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@radix-ng/primitives/popper';
|
|
4
4
|
import { RdxPopperContentWrapper, RdxPopperArrow, RdxPopperContent, provideRdxPopperContentConfig, RdxPopper } from '@radix-ng/primitives/popper';
|
|
5
5
|
import { createContext, ENTER, SPACE, ARROW_DOWN, ARROW_UP, HOME, END, useGraceArea, useTransitionStatus, injectDocument, ARROW_LEFT, ARROW_RIGHT, getMaxTransitionDuration } from '@radix-ng/primitives/core';
|
|
@@ -9,9 +9,8 @@ import { outputFromObservable, outputToObservable } from '@angular/core/rxjs-int
|
|
|
9
9
|
import * as i2 from '@radix-ng/primitives/dismissable-layer';
|
|
10
10
|
import { RdxDismissableLayer, RdxDismissableLayersContextToken } from '@radix-ng/primitives/dismissable-layer';
|
|
11
11
|
import * as i1$2 from '@radix-ng/primitives/portal';
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';
|
|
12
|
+
import { RdxPortalPresence } from '@radix-ng/primitives/portal';
|
|
13
|
+
import { provideRdxPresenceContext } from '@radix-ng/primitives/presence';
|
|
15
14
|
|
|
16
15
|
const [injectNavigationMenuRootContext, provideNavigationMenuRootContext] = createContext('RdxNavigationMenuRootContext', 'components/navigation-menu');
|
|
17
16
|
|
|
@@ -485,66 +484,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
485
484
|
}], ctorParameters: () => [], propDecorators: { escapeKeyDown: [{ type: i0.Output, args: ["escapeKeyDown"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }], focusOutside: [{ type: i0.Output, args: ["focusOutside"] }] } });
|
|
486
485
|
|
|
487
486
|
/**
|
|
488
|
-
*
|
|
487
|
+
* Structural directive that teleports the navigation menu popup into a container (default
|
|
488
|
+
* `document.body`) while the menu is open, and keeps it mounted until any CSS exit `@keyframes`
|
|
489
|
+
* finishes.
|
|
490
|
+
*
|
|
491
|
+
* Apply it with the `*` microsyntax on the positioner —
|
|
492
|
+
* `<div *rdxNavigationMenuPortal rdxNavigationMenuPositioner>` — or as an explicit
|
|
493
|
+
* `<ng-template rdxNavigationMenuPortal>`. For a custom container use the explicit form with
|
|
494
|
+
* `[container]`.
|
|
489
495
|
*/
|
|
490
496
|
class RdxNavigationMenuPortal {
|
|
491
|
-
constructor() {
|
|
492
|
-
this.rootContext = injectNavigationMenuRootContext();
|
|
493
|
-
/**
|
|
494
|
-
* Optional container to portal the popup into. Defaults to `document.body`.
|
|
495
|
-
*/
|
|
496
|
-
this.container = input(...(ngDevMode ? [undefined, { debugName: "container" }] : /* istanbul ignore next */ []));
|
|
497
|
-
}
|
|
498
497
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNavigationMenuPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
499
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
498
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxNavigationMenuPortal, isStandalone: true, selector: "ng-template[rdxNavigationMenuPortal]", providers: [provideRdxPresenceContext(() => ({ present: injectNavigationMenuRootContext().isOpen }))], exportAs: ["rdxNavigationMenuPortal"], hostDirectives: [{ directive: i1$2.RdxPortalPresence, inputs: ["container", "container"] }], ngImport: i0 }); }
|
|
500
499
|
}
|
|
501
500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNavigationMenuPortal, decorators: [{
|
|
502
501
|
type: Directive,
|
|
503
502
|
args: [{
|
|
504
|
-
selector: '[rdxNavigationMenuPortal]',
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
inputs: ['container']
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
host: {
|
|
512
|
-
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
513
|
-
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
|
|
514
|
-
'[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"'
|
|
515
|
-
}
|
|
503
|
+
selector: 'ng-template[rdxNavigationMenuPortal]',
|
|
504
|
+
exportAs: 'rdxNavigationMenuPortal',
|
|
505
|
+
hostDirectives: [{ directive: RdxPortalPresence, inputs: ['container'] }],
|
|
506
|
+
providers: [provideRdxPresenceContext(() => ({ present: injectNavigationMenuRootContext().isOpen }))]
|
|
516
507
|
}]
|
|
517
|
-
}]
|
|
518
|
-
|
|
508
|
+
}] });
|
|
519
509
|
/**
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
* <ng-template rdxNavigationMenuPortalPresence>…</ng-template>
|
|
524
|
-
* ```
|
|
510
|
+
* Dev-mode guard: `rdxNavigationMenuPortal` used to be an attribute directive on a `<div>`. It is now
|
|
511
|
+
* structural, so the old `<div rdxNavigationMenuPortal>` markup would silently stop portaling — fail
|
|
512
|
+
* loudly instead.
|
|
525
513
|
*/
|
|
526
|
-
class
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
514
|
+
class RdxNavigationMenuPortalMisuseGuard {
|
|
515
|
+
constructor() {
|
|
516
|
+
if (isDevMode()) {
|
|
517
|
+
throw new Error('[rdxNavigationMenuPortal] is now a structural directive. ' +
|
|
518
|
+
'Use `*rdxNavigationMenuPortal` on the positioner element or ' +
|
|
519
|
+
'`<ng-template rdxNavigationMenuPortal>`. rdxNavigationMenuPortalPresence has been removed. ' +
|
|
520
|
+
'See https://radix-ng.com/components/navigation-menu.md');
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNavigationMenuPortalMisuseGuard, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
524
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxNavigationMenuPortalMisuseGuard, isStandalone: true, selector: "[rdxNavigationMenuPortal]:not(ng-template)", ngImport: i0 }); }
|
|
534
525
|
}
|
|
535
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxNavigationMenuPortalMisuseGuard, decorators: [{
|
|
536
527
|
type: Directive,
|
|
537
528
|
args: [{
|
|
538
|
-
selector: 'ng-template
|
|
539
|
-
hostDirectives: [RdxPresenceDirective],
|
|
540
|
-
providers: [
|
|
541
|
-
provideRdxPresenceContext(() => {
|
|
542
|
-
const context = injectNavigationMenuRootContext();
|
|
543
|
-
return { present: context.isOpen };
|
|
544
|
-
})
|
|
545
|
-
]
|
|
529
|
+
selector: '[rdxNavigationMenuPortal]:not(ng-template)'
|
|
546
530
|
}]
|
|
547
|
-
}] });
|
|
531
|
+
}], ctorParameters: () => [] });
|
|
548
532
|
|
|
549
533
|
/**
|
|
550
534
|
* Positions the shared popup against the active trigger.
|
|
@@ -1248,7 +1232,7 @@ const navigationMenuImports = [
|
|
|
1248
1232
|
RdxNavigationMenuContent,
|
|
1249
1233
|
RdxNavigationMenuLink,
|
|
1250
1234
|
RdxNavigationMenuPortal,
|
|
1251
|
-
|
|
1235
|
+
RdxNavigationMenuPortalMisuseGuard,
|
|
1252
1236
|
RdxNavigationMenuBackdrop,
|
|
1253
1237
|
RdxNavigationMenuPositioner,
|
|
1254
1238
|
RdxNavigationMenuPopup,
|
|
@@ -1265,7 +1249,7 @@ class RdxNavigationMenuModule {
|
|
|
1265
1249
|
RdxNavigationMenuContent,
|
|
1266
1250
|
RdxNavigationMenuLink,
|
|
1267
1251
|
RdxNavigationMenuPortal,
|
|
1268
|
-
|
|
1252
|
+
RdxNavigationMenuPortalMisuseGuard,
|
|
1269
1253
|
RdxNavigationMenuBackdrop,
|
|
1270
1254
|
RdxNavigationMenuPositioner,
|
|
1271
1255
|
RdxNavigationMenuPopup,
|
|
@@ -1278,7 +1262,7 @@ class RdxNavigationMenuModule {
|
|
|
1278
1262
|
RdxNavigationMenuContent,
|
|
1279
1263
|
RdxNavigationMenuLink,
|
|
1280
1264
|
RdxNavigationMenuPortal,
|
|
1281
|
-
|
|
1265
|
+
RdxNavigationMenuPortalMisuseGuard,
|
|
1282
1266
|
RdxNavigationMenuBackdrop,
|
|
1283
1267
|
RdxNavigationMenuPositioner,
|
|
1284
1268
|
RdxNavigationMenuPopup,
|
|
@@ -1298,5 +1282,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1298
1282
|
* Generated bundle index. Do not edit.
|
|
1299
1283
|
*/
|
|
1300
1284
|
|
|
1301
|
-
export { RdxNavigationMenuArrow, RdxNavigationMenuBackdrop, RdxNavigationMenuContent, RdxNavigationMenuIcon, RdxNavigationMenuItem, RdxNavigationMenuLink, RdxNavigationMenuList, RdxNavigationMenuModule, RdxNavigationMenuPopup, RdxNavigationMenuPortal,
|
|
1285
|
+
export { RdxNavigationMenuArrow, RdxNavigationMenuBackdrop, RdxNavigationMenuContent, RdxNavigationMenuIcon, RdxNavigationMenuItem, RdxNavigationMenuLink, RdxNavigationMenuList, RdxNavigationMenuModule, RdxNavigationMenuPopup, RdxNavigationMenuPortal, RdxNavigationMenuPortalMisuseGuard, RdxNavigationMenuPositioner, RdxNavigationMenuRoot, RdxNavigationMenuTrigger, RdxNavigationMenuViewport, injectNavigationMenuRootContext, navigationMenuImports, provideNavigationMenuRootContext };
|
|
1302
1286
|
//# sourceMappingURL=radix-ng-primitives-navigation-menu.mjs.map
|