@radix-ng/primitives 1.0.0-beta.5 → 1.0.2
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/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +20 -44
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +134 -58
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +599 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +315 -68
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +91 -36
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +40 -15
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +63 -27
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +59 -29
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +57 -13
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +335 -73
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +66 -21
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +29 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +68 -36
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +6 -10
- package/types/radix-ng-primitives-accordion.d.ts +12 -16
- package/types/radix-ng-primitives-checkbox.d.ts +98 -70
- package/types/radix-ng-primitives-composite.d.ts +195 -0
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-menu.d.ts +46 -16
- package/types/radix-ng-primitives-menubar.d.ts +12 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-popover.d.ts +9 -5
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +11 -9
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +46 -32
- package/types/radix-ng-primitives-slider.d.ts +19 -4
- package/types/radix-ng-primitives-tabs.d.ts +69 -14
- package/types/radix-ng-primitives-toggle-group.d.ts +27 -16
- package/types/radix-ng-primitives-toggle.d.ts +5 -5
- package/types/radix-ng-primitives-toolbar.d.ts +84 -69
- package/collection/README.md +0 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +0 -72
- package/fesm2022/radix-ng-primitives-collection.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -388
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/roving-focus/README.md +0 -3
- package/types/radix-ng-primitives-collection.d.ts +0 -44
- package/types/radix-ng-primitives-roving-focus.d.ts +0 -187
|
@@ -456,29 +456,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
456
456
|
class RdxPopoverBackdrop {
|
|
457
457
|
constructor() {
|
|
458
458
|
this.rootContext = injectRdxPopoverRootContext();
|
|
459
|
+
const host = inject(ElementRef).nativeElement;
|
|
460
|
+
host.style.setProperty('-webkit-user-select', 'none');
|
|
459
461
|
// Register the backdrop as owned DOM footprint for primitive-specific checks. The focus manager's
|
|
460
462
|
// marker keep-set stays narrow and does not keep sibling backdrop roots.
|
|
461
463
|
const floatingContext = inject(RDX_FLOATING_ROOT_CONTEXT, { optional: true });
|
|
462
464
|
if (floatingContext) {
|
|
463
|
-
const host = inject(ElementRef).nativeElement;
|
|
464
465
|
floatingContext.addFloatingElement(host);
|
|
465
466
|
inject(DestroyRef).onDestroy(() => floatingContext.removeFloatingElement(host));
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
469
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
469
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxPopoverBackdrop, isStandalone: true, selector: "[rdxPopoverBackdrop]", host: { properties: { "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.data-instant": "rootContext.instant() ? \"\" : undefined", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-state": "rootContext.isOpen() ? \"open\" : \"closed\"" } }, ngImport: i0 }); }
|
|
470
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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.instant() ? \"\" : undefined", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-state": "rootContext.isOpen() ? \"open\" : \"closed\"", "style.pointer-events": "rootContext.openChangeReason() === \"trigger-hover\" ? \"none\" : null", "style.user-select": "\"none\"" } }, ngImport: i0 }); }
|
|
470
471
|
}
|
|
471
472
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverBackdrop, decorators: [{
|
|
472
473
|
type: Directive,
|
|
473
474
|
args: [{
|
|
474
475
|
selector: '[rdxPopoverBackdrop]',
|
|
475
476
|
host: {
|
|
477
|
+
role: 'presentation',
|
|
476
478
|
'[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
|
|
477
479
|
'[attr.data-ending-style]': 'rootContext.transitionStatus() === "ending" ? "" : undefined',
|
|
478
480
|
'[attr.data-instant]': 'rootContext.instant() ? "" : undefined',
|
|
479
481
|
'[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
|
|
480
482
|
'[attr.data-starting-style]': 'rootContext.transitionStatus() === "starting" ? "" : undefined',
|
|
481
|
-
'[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"'
|
|
483
|
+
'[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"',
|
|
484
|
+
'[style.pointer-events]': 'rootContext.openChangeReason() === "trigger-hover" ? "none" : null',
|
|
485
|
+
'[style.user-select]': '"none"'
|
|
482
486
|
}
|
|
483
487
|
}]
|
|
484
488
|
}], ctorParameters: () => [] });
|
|
@@ -586,13 +590,17 @@ class RdxPopoverPopup {
|
|
|
586
590
|
closeInteractionType: () => rootContext.closeInteractionType()
|
|
587
591
|
};
|
|
588
592
|
})
|
|
589
|
-
], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFloatingNodeRegistration }, { directive: i3.RdxFloatingFocusManager }], ngImport: i0 }); }
|
|
593
|
+
], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFloatingNodeRegistration }, { directive: i3.RdxFloatingFocusManager, inputs: ["initialFocus", "initialFocus", "returnFocus", "finalFocus"] }], ngImport: i0 }); }
|
|
590
594
|
}
|
|
591
595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverPopup, decorators: [{
|
|
592
596
|
type: Directive,
|
|
593
597
|
args: [{
|
|
594
598
|
selector: '[rdxPopoverPopup]',
|
|
595
|
-
hostDirectives: [
|
|
599
|
+
hostDirectives: [
|
|
600
|
+
RdxPopperContent,
|
|
601
|
+
RdxFloatingNodeRegistration,
|
|
602
|
+
{ directive: RdxFloatingFocusManager, inputs: ['initialFocus', 'returnFocus: finalFocus'] }
|
|
603
|
+
],
|
|
596
604
|
providers: [
|
|
597
605
|
provideFloatingFocusManagerConfig(() => {
|
|
598
606
|
const rootContext = injectRdxPopoverRootContext();
|
|
@@ -663,22 +671,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
663
671
|
class RdxPopoverDescription {
|
|
664
672
|
constructor() {
|
|
665
673
|
this.rootContext = injectRdxPopoverRootContext();
|
|
666
|
-
this.
|
|
667
|
-
this.
|
|
674
|
+
this.generatedId = injectId('rdx-popover-description-');
|
|
675
|
+
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
676
|
+
this.id = computed(() => this.idInput() ?? this.generatedId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
677
|
+
effect((onCleanup) => {
|
|
678
|
+
const id = this.id();
|
|
679
|
+
this.rootContext.setDescriptionId(id);
|
|
680
|
+
onCleanup(() => this.rootContext.setDescriptionId(undefined));
|
|
681
|
+
});
|
|
668
682
|
inject(DestroyRef).onDestroy(() => this.rootContext.setDescriptionId(undefined));
|
|
669
683
|
}
|
|
670
684
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
671
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
685
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPopoverDescription, isStandalone: true, selector: "[rdxPopoverDescription]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
|
|
672
686
|
}
|
|
673
687
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverDescription, decorators: [{
|
|
674
688
|
type: Directive,
|
|
675
689
|
args: [{
|
|
676
690
|
selector: '[rdxPopoverDescription]',
|
|
677
691
|
host: {
|
|
678
|
-
'[id]': 'id'
|
|
692
|
+
'[id]': 'id()'
|
|
679
693
|
}
|
|
680
694
|
}]
|
|
681
|
-
}], ctorParameters: () => [] });
|
|
695
|
+
}], ctorParameters: () => [], propDecorators: { idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
682
696
|
|
|
683
697
|
/**
|
|
684
698
|
* Structural directive that teleports the popover content into a container (default `document.body`)
|
|
@@ -778,22 +792,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
778
792
|
class RdxPopoverTitle {
|
|
779
793
|
constructor() {
|
|
780
794
|
this.rootContext = injectRdxPopoverRootContext();
|
|
781
|
-
this.
|
|
782
|
-
this.
|
|
795
|
+
this.generatedId = injectId('rdx-popover-title-');
|
|
796
|
+
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
797
|
+
this.id = computed(() => this.idInput() ?? this.generatedId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
798
|
+
effect((onCleanup) => {
|
|
799
|
+
const id = this.id();
|
|
800
|
+
this.rootContext.setTitleId(id);
|
|
801
|
+
onCleanup(() => this.rootContext.setTitleId(undefined));
|
|
802
|
+
});
|
|
783
803
|
inject(DestroyRef).onDestroy(() => this.rootContext.setTitleId(undefined));
|
|
784
804
|
}
|
|
785
805
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
786
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
806
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPopoverTitle, isStandalone: true, selector: "[rdxPopoverTitle]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
|
|
787
807
|
}
|
|
788
808
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverTitle, decorators: [{
|
|
789
809
|
type: Directive,
|
|
790
810
|
args: [{
|
|
791
811
|
selector: '[rdxPopoverTitle]',
|
|
792
812
|
host: {
|
|
793
|
-
'[id]': 'id'
|
|
813
|
+
'[id]': 'id()'
|
|
794
814
|
}
|
|
795
815
|
}]
|
|
796
|
-
}], ctorParameters: () => [] });
|
|
816
|
+
}], ctorParameters: () => [], propDecorators: { idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
797
817
|
|
|
798
818
|
/**
|
|
799
819
|
* A button that opens the popover.
|
|
@@ -842,6 +862,11 @@ class RdxPopoverTrigger {
|
|
|
842
862
|
});
|
|
843
863
|
this.isPressed = computed(() => this.triggerInteraction.isActive() && this.rootContext()?.openChangeReason() === 'trigger-press', ...(ngDevMode ? [{ debugName: "isPressed" }] : /* istanbul ignore next */ []));
|
|
844
864
|
this.generatedId = injectId('rdx-popover-trigger-');
|
|
865
|
+
effect(() => {
|
|
866
|
+
if (!this.handle() && !this.parentRootContext) {
|
|
867
|
+
rdxDevError('popover/trigger-missing-root', '`rdxPopoverTrigger` must be used inside `rdxPopoverRoot` or receive a `handle` connected to a root.', 'components/popover');
|
|
868
|
+
}
|
|
869
|
+
});
|
|
845
870
|
effect((onCleanup) => {
|
|
846
871
|
const handle = this.handle();
|
|
847
872
|
if (handle) {
|