@radix-ng/primitives 0.19.0 → 0.20.0
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/compodoc/documentation.json +2749 -955
- package/esm2022/popover/index.mjs +41 -0
- package/esm2022/popover/radix-ng-primitives-popover.mjs +5 -0
- package/esm2022/popover/src/popover-arrow.directive.mjs +112 -0
- package/esm2022/popover/src/popover-arrow.token.mjs +3 -0
- package/esm2022/popover/src/popover-close.directive.mjs +37 -0
- package/esm2022/popover/src/popover-content.directive.mjs +227 -0
- package/esm2022/popover/src/popover-root.directive.mjs +142 -0
- package/esm2022/popover/src/popover-root.inject.mjs +7 -0
- package/esm2022/popover/src/popover-root.token.mjs +3 -0
- package/esm2022/popover/src/popover-trigger.directive.mjs +42 -0
- package/esm2022/popover/src/popover.constants.mjs +90 -0
- package/esm2022/popover/src/popover.types.mjs +14 -0
- package/esm2022/popover/src/popover.utils.mjs +115 -0
- package/esm2022/radio/src/radio-item-input.directive.mjs +2 -2
- package/esm2022/radio/src/radio-item.directive.mjs +10 -13
- package/esm2022/radio/src/radio-root.directive.mjs +16 -20
- package/esm2022/radio/src/radio-tokens.mjs +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +796 -0
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-radio.mjs +24 -31
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/package.json +12 -6
- package/popover/README.md +3 -0
- package/popover/index.d.ts +17 -0
- package/popover/src/popover-arrow.directive.d.ts +37 -0
- package/popover/src/popover-arrow.token.d.ts +3 -0
- package/popover/src/popover-close.directive.d.ts +15 -0
- package/popover/src/popover-content.directive.d.ts +84 -0
- package/popover/src/popover-root.directive.d.ts +58 -0
- package/popover/src/popover-root.inject.d.ts +2 -0
- package/popover/src/popover-root.token.d.ts +3 -0
- package/popover/src/popover-trigger.directive.d.ts +18 -0
- package/popover/src/popover.constants.d.ts +8 -0
- package/popover/src/popover.types.d.ts +34 -0
- package/popover/src/popover.utils.d.ts +12 -0
- package/radio/src/radio-item.directive.d.ts +2 -2
- package/radio/src/radio-root.directive.d.ts +9 -8
- package/radio/src/radio-tokens.d.ts +6 -4
@@ -0,0 +1,58 @@
|
|
1
|
+
import { OnInit, ViewContainerRef } from '@angular/core';
|
2
|
+
import { RdxPopoverContentDirective } from './popover-content.directive';
|
3
|
+
import { RdxPopoverTriggerDirective } from './popover-trigger.directive';
|
4
|
+
import { RdxPopoverState } from './popover.types';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class RdxPopoverRootDirective implements OnInit {
|
7
|
+
/**
|
8
|
+
* The open state of the popover when it is initially rendered. Use when you do not need to control its open state.
|
9
|
+
*/
|
10
|
+
readonly defaultOpen: import("@angular/core").InputSignal<boolean>;
|
11
|
+
/**
|
12
|
+
* The controlled open state of the popover. Must be used in conjunction with onOpenChange.
|
13
|
+
*/
|
14
|
+
readonly open: import("@angular/core").InputSignal<boolean | undefined>;
|
15
|
+
/**
|
16
|
+
* Event handler called when the open state of the popover changes.
|
17
|
+
*/
|
18
|
+
readonly onOpenChange: import("@angular/core").OutputEmitterRef<boolean>;
|
19
|
+
/** @ignore */
|
20
|
+
readonly popoverContentDirective: import("@angular/core").Signal<RdxPopoverContentDirective>;
|
21
|
+
/** @ignore */
|
22
|
+
readonly popoverTriggerDirective: import("@angular/core").Signal<RdxPopoverTriggerDirective>;
|
23
|
+
/** @ignore */
|
24
|
+
readonly popoverArrowDirective: import("@angular/core").Signal<import("@radix-ng/primitives/popover").RdxPopoverArrowDirective | undefined>;
|
25
|
+
/** @ignore */
|
26
|
+
readonly viewContainerRef: ViewContainerRef;
|
27
|
+
/** @ignore */
|
28
|
+
private readonly document;
|
29
|
+
/** @ignore */
|
30
|
+
readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
31
|
+
/** @ignore */
|
32
|
+
readonly state: import("@angular/core").Signal<RdxPopoverState>;
|
33
|
+
/** @ignore */
|
34
|
+
private isControlledExternally;
|
35
|
+
constructor();
|
36
|
+
/** @ignore */
|
37
|
+
ngOnInit(): void;
|
38
|
+
/** @ignore */
|
39
|
+
controlledExternally(): import("@angular/core").Signal<boolean>;
|
40
|
+
/** @ignore */
|
41
|
+
handleOpen(): void;
|
42
|
+
/** @ignore */
|
43
|
+
handleClose(): void;
|
44
|
+
/** @ignore */
|
45
|
+
handleToggle(): void;
|
46
|
+
/** @ignore */
|
47
|
+
private setOpen;
|
48
|
+
/** @ignore */
|
49
|
+
private show;
|
50
|
+
/** @ignore */
|
51
|
+
private hide;
|
52
|
+
/** @ignore */
|
53
|
+
private onIsOpenChangeEffect;
|
54
|
+
/** @ignore */
|
55
|
+
private onOpenChangeEffect;
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverRootDirective, never>;
|
57
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPopoverRootDirective, "[rdxPopoverRoot]", ["rdxPopoverRoot"], { "defaultOpen": { "alias": "defaultOpen"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "onOpenChange": "onOpenChange"; }, ["popoverContentDirective", "popoverTriggerDirective", "popoverArrowDirective"], never, true, never>;
|
58
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { CdkOverlayOrigin } from '@angular/cdk/overlay';
|
2
|
+
import { ElementRef } from '@angular/core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@angular/cdk/overlay";
|
5
|
+
export declare class RdxPopoverTriggerDirective {
|
6
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
7
|
+
readonly popoverId: import("@angular/core").Signal<string>;
|
8
|
+
/** @ignore */
|
9
|
+
readonly popoverRoot: import("@radix-ng/primitives/popover").RdxPopoverRootDirective;
|
10
|
+
/** @ignore */
|
11
|
+
readonly elementRef: ElementRef<HTMLElement>;
|
12
|
+
/** @ignore */
|
13
|
+
readonly overlayOrigin: CdkOverlayOrigin;
|
14
|
+
/** @ignore */
|
15
|
+
onClick(): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverTriggerDirective, never>;
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPopoverTriggerDirective, "[rdxPopoverTrigger]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkOverlayOrigin; inputs: {}; outputs: {}; }]>;
|
18
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { ConnectionPositionPair } from '@angular/cdk/overlay';
|
2
|
+
export declare enum RdxPopoverSide {
|
3
|
+
Top = "top",
|
4
|
+
Right = "right",
|
5
|
+
Bottom = "bottom",
|
6
|
+
Left = "left"
|
7
|
+
}
|
8
|
+
export declare enum RdxPopoverAlign {
|
9
|
+
Start = "start",
|
10
|
+
Center = "center",
|
11
|
+
End = "end"
|
12
|
+
}
|
13
|
+
export type RdxPopoverState = 'open' | 'closed';
|
14
|
+
export type RdxSideAndAlign = {
|
15
|
+
side: RdxPopoverSide;
|
16
|
+
align: RdxPopoverAlign;
|
17
|
+
};
|
18
|
+
export type RdxSideAndAlignOffsets = {
|
19
|
+
sideOffset: number;
|
20
|
+
alignOffset: number;
|
21
|
+
};
|
22
|
+
export type RdxPopoverPositions = {
|
23
|
+
[key in RdxPopoverSide]: {
|
24
|
+
[key in RdxPopoverAlign]: ConnectionPositionPair;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
export type RdxAllPossibleConnectedPositions = ReadonlyMap<`${RdxPopoverSide}|${RdxPopoverAlign}`, ConnectionPositionPair>;
|
28
|
+
export type RdxArrowPositionParams = {
|
29
|
+
top: string;
|
30
|
+
bottom: string;
|
31
|
+
left: string;
|
32
|
+
right: string;
|
33
|
+
transform: string;
|
34
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay';
|
2
|
+
import { RdxAllPossibleConnectedPositions, RdxArrowPositionParams, RdxSideAndAlign, RdxSideAndAlignOffsets } from './popover.types';
|
3
|
+
export declare function getAllPossibleConnectedPositions(): RdxAllPossibleConnectedPositions;
|
4
|
+
export declare function getSideAndAlignFromAllPossibleConnectedPositions(position: ConnectionPositionPair): RdxSideAndAlign;
|
5
|
+
export declare function getContentPosition(sideAndAlignWithOffsets: RdxSideAndAlign & RdxSideAndAlignOffsets): ConnectedPosition;
|
6
|
+
export declare function getArrowPositionParams(sideAndAlign: RdxSideAndAlign, arrowWidthAndHeight: {
|
7
|
+
width: number;
|
8
|
+
height: number;
|
9
|
+
}, triggerWidthAndHeight: {
|
10
|
+
width: number;
|
11
|
+
height: number;
|
12
|
+
}): RdxArrowPositionParams;
|
@@ -11,13 +11,13 @@ export declare class RdxRadioItemDirective implements OnInit {
|
|
11
11
|
readonly id: import("@angular/core").InputSignal<string | undefined>;
|
12
12
|
readonly required: import("@angular/core").InputSignal<boolean | undefined>;
|
13
13
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
14
|
+
protected readonly disabledState: import("@angular/core").Signal<boolean>;
|
15
|
+
readonly checkedState: import("@angular/core").Signal<boolean>;
|
14
16
|
private readonly ARROW_KEYS;
|
15
17
|
private readonly isArrowKeyPressedSignal;
|
16
18
|
/** @ignore */
|
17
19
|
ngOnInit(): void;
|
18
20
|
/** @ignore */
|
19
|
-
get checked(): boolean;
|
20
|
-
/** @ignore */
|
21
21
|
onClick(): void;
|
22
22
|
/** @ignore */
|
23
23
|
onKeyDown(event: KeyboardEvent): void;
|
@@ -1,19 +1,21 @@
|
|
1
|
-
import {
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
3
3
|
import { Orientation } from '@radix-ng/primitives/roving-focus';
|
4
4
|
import { RadioGroupDirective, RadioGroupProps } from './radio-tokens';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
import * as i1 from "@radix-ng/primitives/roving-focus";
|
7
7
|
export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor {
|
8
|
-
readonly value: import("@angular/core").ModelSignal<string |
|
9
|
-
disabled: boolean
|
8
|
+
readonly value: import("@angular/core").ModelSignal<string | null>;
|
9
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
10
10
|
defaultValue?: string;
|
11
|
-
required: boolean
|
12
|
-
orientation: Orientation
|
11
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
12
|
+
readonly orientation: import("@angular/core").InputSignal<Orientation | undefined>;
|
13
13
|
/**
|
14
14
|
* Event handler called when the value changes.
|
15
15
|
*/
|
16
|
-
readonly onValueChange:
|
16
|
+
readonly onValueChange: import("@angular/core").OutputEmitterRef<string>;
|
17
|
+
private readonly disable;
|
18
|
+
readonly disableState: import("@angular/core").Signal<boolean>;
|
17
19
|
/**
|
18
20
|
* The callback function to call when the value of the radio group changes.
|
19
21
|
*/
|
@@ -51,6 +53,5 @@ export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGro
|
|
51
53
|
setDisabledState(isDisabled: boolean): void;
|
52
54
|
protected onKeydown(): void;
|
53
55
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioGroupDirective, never>;
|
54
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "[rdxRadioRoot]", ["rdxRadioRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "required": { "alias": "required"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "dir": "dir"; "orientation": "orientation"; "loop": "loop"; }; outputs: {}; }]>;
|
55
|
-
static ngAcceptInputType_disabled: unknown;
|
56
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "[rdxRadioRoot]", ["rdxRadioRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "dir": "dir"; "orientation": "orientation"; "loop": "loop"; }; outputs: {}; }]>;
|
56
57
|
}
|
@@ -1,12 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { InjectionToken, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';
|
2
3
|
export interface RadioGroupProps {
|
3
4
|
name?: string;
|
4
|
-
disabled?: boolean
|
5
|
+
disabled?: InputSignalWithTransform<boolean, BooleanInput>;
|
5
6
|
defaultValue?: string;
|
6
|
-
value
|
7
|
+
value: ModelSignal<string | null>;
|
8
|
+
disableState: Signal<boolean>;
|
7
9
|
}
|
8
10
|
export interface RadioGroupDirective extends RadioGroupProps {
|
9
|
-
select(value: string |
|
11
|
+
select(value: string | null): void;
|
10
12
|
onTouched(): void;
|
11
13
|
}
|
12
14
|
export declare const RDX_RADIO_GROUP: InjectionToken<RadioGroupDirective>;
|