@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ng/primitives",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Headless, signals-first UI primitives for Angular.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"headless"
|
|
20
20
|
],
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@angular/core": "^
|
|
22
|
+
"@angular/core": "^21.0.0",
|
|
23
23
|
"@floating-ui/dom": "^1.7.6",
|
|
24
24
|
"@internationalized/date": "^3.12.2",
|
|
25
25
|
"@internationalized/number": "^3.6.7"
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"types": "./types/radix-ng-primitives-collapsible.d.ts",
|
|
80
80
|
"default": "./fesm2022/radix-ng-primitives-collapsible.mjs"
|
|
81
81
|
},
|
|
82
|
-
"./collection": {
|
|
83
|
-
"types": "./types/radix-ng-primitives-collection.d.ts",
|
|
84
|
-
"default": "./fesm2022/radix-ng-primitives-collection.mjs"
|
|
85
|
-
},
|
|
86
82
|
"./combobox": {
|
|
87
83
|
"types": "./types/radix-ng-primitives-combobox.d.ts",
|
|
88
84
|
"default": "./fesm2022/radix-ng-primitives-combobox.mjs"
|
|
89
85
|
},
|
|
86
|
+
"./composite": {
|
|
87
|
+
"types": "./types/radix-ng-primitives-composite.d.ts",
|
|
88
|
+
"default": "./fesm2022/radix-ng-primitives-composite.mjs"
|
|
89
|
+
},
|
|
90
90
|
"./config": {
|
|
91
91
|
"types": "./types/radix-ng-primitives-config.d.ts",
|
|
92
92
|
"default": "./fesm2022/radix-ng-primitives-config.mjs"
|
|
@@ -211,10 +211,6 @@
|
|
|
211
211
|
"types": "./types/radix-ng-primitives-radio.d.ts",
|
|
212
212
|
"default": "./fesm2022/radix-ng-primitives-radio.mjs"
|
|
213
213
|
},
|
|
214
|
-
"./roving-focus": {
|
|
215
|
-
"types": "./types/radix-ng-primitives-roving-focus.d.ts",
|
|
216
|
-
"default": "./fesm2022/radix-ng-primitives-roving-focus.mjs"
|
|
217
|
-
},
|
|
218
214
|
"./scroll-area": {
|
|
219
215
|
"types": "./types/radix-ng-primitives-scroll-area.d.ts",
|
|
220
216
|
"default": "./fesm2022/radix-ng-primitives-scroll-area.mjs"
|
|
@@ -3,7 +3,8 @@ import { Signal, WritableSignal, ElementRef, InputSignalWithTransform, InputSign
|
|
|
3
3
|
import * as _radix_ng_primitives_accordion from '@radix-ng/primitives/accordion';
|
|
4
4
|
import * as i1 from '@radix-ng/primitives/collapsible';
|
|
5
5
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
6
|
-
import { BooleanInput,
|
|
6
|
+
import { BooleanInput, DataOrientation, AcceptableValue } from '@radix-ng/primitives/core';
|
|
7
|
+
import * as i2 from '@radix-ng/primitives/composite';
|
|
7
8
|
|
|
8
9
|
declare class RdxAccordionContentDirective {
|
|
9
10
|
protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
|
|
@@ -39,6 +40,7 @@ declare const provideAccordionItemContext: (useFactory: () => AccordionItemConte
|
|
|
39
40
|
declare class RdxAccordionItemDirective {
|
|
40
41
|
readonly elementRef: ElementRef<HTMLElement>;
|
|
41
42
|
private readonly collapsibleContext;
|
|
43
|
+
private readonly listItem;
|
|
42
44
|
protected readonly rootContext: _radix_ng_primitives_accordion.AccordionRootContext;
|
|
43
45
|
/**
|
|
44
46
|
* A string value for the accordion item. All items within an accordion should use a unique value.
|
|
@@ -64,21 +66,17 @@ declare class RdxAccordionItemDirective {
|
|
|
64
66
|
readonly index: Signal<number>;
|
|
65
67
|
constructor();
|
|
66
68
|
updateOpen: () => void;
|
|
67
|
-
handleArrowKey(event: Event): void;
|
|
68
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionItemDirective, never>;
|
|
69
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onOpenChange": "onOpenChange"; }, never, never, true, [{ directive: typeof i1.RdxCollapsibleRootDirective; inputs: { "disabled": "disabled"; "open": "open"; }; outputs: {}; }]>;
|
|
70
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionItemDirective, "[rdxAccordionItem]", ["rdxAccordionItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onOpenChange": "onOpenChange"; }, never, never, true, [{ directive: typeof i1.RdxCollapsibleRootDirective; inputs: { "disabled": "disabled"; "open": "open"; }; outputs: {}; }, { directive: typeof i2.RdxCompositeListItem; inputs: {}; outputs: {}; }]>;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
type AccordionRootContext = {
|
|
73
74
|
disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
|
74
|
-
direction: Signal<Direction>;
|
|
75
75
|
orientation: InputSignal<DataOrientation>;
|
|
76
76
|
value: ModelSignal<AcceptableValue | AcceptableValue[] | undefined>;
|
|
77
77
|
collapsible: Signal<boolean>;
|
|
78
78
|
isSingle: Signal<boolean>;
|
|
79
|
-
loopFocus: InputSignalWithTransform<boolean, BooleanInput>;
|
|
80
79
|
keepMounted: InputSignalWithTransform<boolean, BooleanInput>;
|
|
81
|
-
elementRef: ElementRef<HTMLElement>;
|
|
82
80
|
changeModelValue: (value: string) => void;
|
|
83
81
|
};
|
|
84
82
|
declare const injectAccordionRootContext: _radix_ng_primitives_core.InjectContext<AccordionRootContext>;
|
|
@@ -87,15 +85,7 @@ declare const provideAccordionRootContext: (useFactory: () => AccordionRootConte
|
|
|
87
85
|
* @group Components
|
|
88
86
|
*/
|
|
89
87
|
declare class RdxAccordionRootDirective {
|
|
90
|
-
readonly elementRef: ElementRef<HTMLElement>;
|
|
91
88
|
readonly id: InputSignal<string>;
|
|
92
|
-
/**
|
|
93
|
-
* The reading direction of the accordion when applicable. If omitted, assumes LTR (left-to-right) reading mode.
|
|
94
|
-
*
|
|
95
|
-
* @group Props
|
|
96
|
-
*/
|
|
97
|
-
readonly dirInput: InputSignal<Direction | undefined>;
|
|
98
|
-
readonly dir: Signal<Direction>;
|
|
99
89
|
/** Whether the Accordion is disabled.
|
|
100
90
|
* @defaultValue false
|
|
101
91
|
* @group Props
|
|
@@ -104,8 +94,12 @@ declare class RdxAccordionRootDirective {
|
|
|
104
94
|
/**
|
|
105
95
|
* The orientation of the accordion.
|
|
106
96
|
*
|
|
97
|
+
* Deprecated following the APG guidance update to remove roving focus.
|
|
98
|
+
* This prop no longer affects keyboard focus behavior.
|
|
99
|
+
*
|
|
107
100
|
* @defaultValue 'vertical'
|
|
108
101
|
* @group Props
|
|
102
|
+
* @deprecated
|
|
109
103
|
*/
|
|
110
104
|
readonly orientation: InputSignal<DataOrientation>;
|
|
111
105
|
/**
|
|
@@ -145,10 +139,12 @@ declare class RdxAccordionRootDirective {
|
|
|
145
139
|
*/
|
|
146
140
|
readonly multiple: InputSignalWithTransform<boolean, BooleanInput>;
|
|
147
141
|
/**
|
|
148
|
-
*
|
|
142
|
+
* Deprecated following the APG guidance update to remove roving focus.
|
|
143
|
+
* This prop no longer affects keyboard focus behavior.
|
|
149
144
|
*
|
|
150
145
|
* @defaultValue true
|
|
151
146
|
* @group Props
|
|
147
|
+
* @deprecated
|
|
152
148
|
*/
|
|
153
149
|
readonly loopFocus: InputSignalWithTransform<boolean, BooleanInput>;
|
|
154
150
|
/**
|
|
@@ -173,7 +169,7 @@ declare class RdxAccordionRootDirective {
|
|
|
173
169
|
private isValueEqualOrExist;
|
|
174
170
|
private isEqual;
|
|
175
171
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAccordionRootDirective, never>;
|
|
176
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]", ["rdxAccordionRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "
|
|
172
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAccordionRootDirective, "[rdxAccordionRoot]", ["rdxAccordionRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i2.RdxCompositeList; inputs: {}; outputs: {}; }]>;
|
|
177
173
|
}
|
|
178
174
|
|
|
179
175
|
declare class RdxAccordionTriggerDirective {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import * as _radix_ng_primitives_types_radix_ng_primitives_core from '@radix-ng/primitives/types/radix-ng-primitives-core';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { Signal } from '@angular/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/presence';
|
|
4
|
-
import * as _radix_ng_primitives_types_radix_ng_primitives_core from '@radix-ng/primitives/types/radix-ng-primitives-core';
|
|
5
4
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
6
5
|
import { BooleanInput, RdxCancelableChangeEventDetails, RdxFormCheckboxControl } from '@radix-ng/primitives/core';
|
|
7
6
|
import { ControlValueAccessor } from '@angular/forms';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Directive: rdxCheckboxButton
|
|
10
|
+
* Purpose: Turns a native <button> into an accessible checkbox control bound to the Radix Checkbox context.
|
|
11
|
+
* It mirrors the checkbox state via ARIA/data attributes, toggles on click, and prevents Enter activation per WAI-ARIA.
|
|
12
|
+
* In forms, it stops the button's click from bubbling so only the hidden input emits the native event used for form/validator integration.
|
|
13
|
+
*/
|
|
14
|
+
declare class RdxCheckboxButtonDirective {
|
|
15
15
|
protected readonly rootContext: {
|
|
16
16
|
checked: _angular_core.Signal<boolean>;
|
|
17
17
|
indeterminate: _angular_core.Signal<boolean>;
|
|
@@ -21,26 +21,31 @@ declare class RdxCheckboxInputDirective {
|
|
|
21
21
|
name: _angular_core.InputSignal<string | undefined>;
|
|
22
22
|
parent: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
23
23
|
form: _angular_core.InputSignal<string | undefined>;
|
|
24
|
-
readonly: _angular_core.
|
|
24
|
+
readonly: _angular_core.Signal<boolean>;
|
|
25
25
|
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
26
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
26
27
|
toggle(event?: Event): void;
|
|
27
28
|
};
|
|
28
|
-
private readonly
|
|
29
|
+
private readonly group;
|
|
30
|
+
private readonly elementRef;
|
|
31
|
+
/** A `parent` checkbox lists the ids of the children it controls. */
|
|
32
|
+
protected readonly ariaControls: _angular_core.Signal<string | undefined>;
|
|
29
33
|
constructor();
|
|
30
|
-
|
|
31
|
-
static
|
|
34
|
+
protected clicked(event: MouseEvent): void;
|
|
35
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxButtonDirective, never>;
|
|
36
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxButtonDirective, "button[rdxCheckboxButton]", never, {}, {}, never, never, true, never>;
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/**
|
|
35
40
|
* Internal tri-state used only for the derived `parent` (select-all) state in
|
|
36
|
-
* `rdxCheckboxGroup` and
|
|
41
|
+
* `rdxCheckboxGroup` and compatibility helpers. The public `checked` member is
|
|
37
42
|
* a plain `boolean`; mixed state is exposed via the separate `indeterminate`
|
|
38
43
|
* member (Base UI shape).
|
|
39
44
|
*/
|
|
40
45
|
type CheckedState = boolean | 'indeterminate';
|
|
41
46
|
declare function isIndeterminate(checked?: CheckedState): checked is 'indeterminate';
|
|
42
47
|
declare function getState(checked: CheckedState): "indeterminate" | "checked" | "unchecked";
|
|
43
|
-
type RdxCheckboxCheckedChangeReason = '
|
|
48
|
+
type RdxCheckboxCheckedChangeReason = 'none';
|
|
44
49
|
type RdxCheckboxCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxCheckboxCheckedChangeReason>;
|
|
45
50
|
interface RdxCheckboxCheckedChangeEvent {
|
|
46
51
|
checked: boolean;
|
|
@@ -55,8 +60,9 @@ declare const rootContext: () => {
|
|
|
55
60
|
name: _angular_core.InputSignal<string | undefined>;
|
|
56
61
|
parent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
57
62
|
form: _angular_core.InputSignal<string | undefined>;
|
|
58
|
-
readonly: _angular_core.
|
|
63
|
+
readonly: _angular_core.Signal<boolean>;
|
|
59
64
|
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
65
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
60
66
|
toggle(event?: Event): void;
|
|
61
67
|
};
|
|
62
68
|
type CheckboxRootContext = ReturnType<typeof rootContext>;
|
|
@@ -69,8 +75,9 @@ declare const injectCheckboxRootContext: _radix_ng_primitives_core.InjectContext
|
|
|
69
75
|
name: _angular_core.InputSignal<string | undefined>;
|
|
70
76
|
parent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
71
77
|
form: _angular_core.InputSignal<string | undefined>;
|
|
72
|
-
readonly: _angular_core.
|
|
78
|
+
readonly: _angular_core.Signal<boolean>;
|
|
73
79
|
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
80
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
74
81
|
toggle(event?: Event): void;
|
|
75
82
|
}>;
|
|
76
83
|
declare const provideCheckboxRootContext: (useFactory: () => {
|
|
@@ -82,8 +89,9 @@ declare const provideCheckboxRootContext: (useFactory: () => {
|
|
|
82
89
|
name: _angular_core.InputSignal<string | undefined>;
|
|
83
90
|
parent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
84
91
|
form: _angular_core.InputSignal<string | undefined>;
|
|
85
|
-
readonly: _angular_core.
|
|
92
|
+
readonly: _angular_core.Signal<boolean>;
|
|
86
93
|
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
94
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
87
95
|
toggle(event?: Event): void;
|
|
88
96
|
}) => _angular_core.Provider;
|
|
89
97
|
/**
|
|
@@ -91,6 +99,9 @@ declare const provideCheckboxRootContext: (useFactory: () => {
|
|
|
91
99
|
*/
|
|
92
100
|
declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
|
|
93
101
|
private readonly controlValueAccessor;
|
|
102
|
+
private readonly elementRef;
|
|
103
|
+
private readonly renderer;
|
|
104
|
+
private uncheckedInputElement;
|
|
94
105
|
/** The group this checkbox belongs to, if it is rendered inside a `rdxCheckboxGroup`. */
|
|
95
106
|
private readonly group;
|
|
96
107
|
/**
|
|
@@ -108,6 +119,13 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
|
|
|
108
119
|
* @group Props
|
|
109
120
|
*/
|
|
110
121
|
readonly checked: _angular_core.ModelSignal<boolean>;
|
|
122
|
+
/**
|
|
123
|
+
* The state of the checkbox when it is initially rendered.
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
126
|
+
* @group Props
|
|
127
|
+
*/
|
|
128
|
+
readonly defaultChecked: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
|
|
111
129
|
/**
|
|
112
130
|
* Whether the checkbox is in a mixed state: neither ticked nor unticked.
|
|
113
131
|
* Orthogonal to `checked` and not part of the submitted form value. A user
|
|
@@ -126,6 +144,13 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
|
|
|
126
144
|
* @group Props
|
|
127
145
|
*/
|
|
128
146
|
readonly submitValue: _angular_core.InputSignal<string>;
|
|
147
|
+
/**
|
|
148
|
+
* The value submitted with the form when the checkbox is unchecked.
|
|
149
|
+
* By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.
|
|
150
|
+
*
|
|
151
|
+
* @group Props
|
|
152
|
+
*/
|
|
153
|
+
readonly uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
129
154
|
/**
|
|
130
155
|
* Whether or not the checkbox button is disabled. This prevents the user from interacting with it.
|
|
131
156
|
* @group Props
|
|
@@ -136,6 +161,8 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
|
|
|
136
161
|
* @group Props
|
|
137
162
|
*/
|
|
138
163
|
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
164
|
+
/** Alias matching Base UI's `readOnly` prop spelling. */
|
|
165
|
+
readonly readOnly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
139
166
|
/**
|
|
140
167
|
* Whether or not the checkbox is required.
|
|
141
168
|
* @group Props
|
|
@@ -178,62 +205,20 @@ declare class RdxCheckboxRootDirective implements RdxFormCheckboxControl {
|
|
|
178
205
|
readonly indeterminateState: _angular_core.Signal<boolean>;
|
|
179
206
|
/** @ignore The effective disabled state, including the group. */
|
|
180
207
|
readonly disabledState: _angular_core.Signal<boolean>;
|
|
208
|
+
readonly readOnlyState: _angular_core.Signal<boolean>;
|
|
181
209
|
readonly state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
182
210
|
constructor();
|
|
183
211
|
toggle(event?: Event): void;
|
|
212
|
+
private syncUncheckedInput;
|
|
213
|
+
private ensureUncheckedInput;
|
|
214
|
+
private removeUncheckedInput;
|
|
215
|
+
private setOptionalAttribute;
|
|
216
|
+
private setBooleanAttribute;
|
|
184
217
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxRootDirective, never>;
|
|
185
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxRootDirective, "[rdxCheckboxRoot]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "submitValue": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "parent": { "alias": "parent"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "indeterminate": "indeterminateChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "checked"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
218
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxRootDirective, "[rdxCheckboxRoot]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "submitValue": { "alias": "value"; "required": false; "isSignal": true; }; "uncheckedValue": { "alias": "uncheckedValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "parent": { "alias": "parent"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "indeterminate": "indeterminateChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "checked"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
186
219
|
}
|
|
187
220
|
|
|
188
|
-
|
|
189
|
-
* Directive: rdxCheckboxButton
|
|
190
|
-
* Purpose: Turns a native <button> into an accessible checkbox control bound to the Radix Checkbox context.
|
|
191
|
-
* It mirrors the checkbox state via ARIA/data attributes, toggles on click, and prevents Enter activation per WAI-ARIA.
|
|
192
|
-
* In forms, it stops the button's click from bubbling so only the hidden input emits the native event used for form/validator integration.
|
|
193
|
-
*/
|
|
194
|
-
declare class RdxCheckboxButtonDirective {
|
|
195
|
-
protected readonly rootContext: {
|
|
196
|
-
checked: _angular_core.Signal<boolean>;
|
|
197
|
-
indeterminate: _angular_core.Signal<boolean>;
|
|
198
|
-
disabled: _angular_core.Signal<boolean>;
|
|
199
|
-
required: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
200
|
-
value: _angular_core.InputSignal<string>;
|
|
201
|
-
name: _angular_core.InputSignal<string | undefined>;
|
|
202
|
-
parent: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
203
|
-
form: _angular_core.InputSignal<string | undefined>;
|
|
204
|
-
readonly: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
205
|
-
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
206
|
-
toggle(event?: Event): void;
|
|
207
|
-
};
|
|
208
|
-
private readonly group;
|
|
209
|
-
private readonly elementRef;
|
|
210
|
-
/** A `parent` checkbox lists the ids of the children it controls. */
|
|
211
|
-
protected readonly ariaControls: _angular_core.Signal<string | undefined>;
|
|
212
|
-
constructor();
|
|
213
|
-
protected clicked(event: MouseEvent): void;
|
|
214
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxButtonDirective, never>;
|
|
215
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxButtonDirective, "button[rdxCheckboxButton]", never, {}, {}, never, never, true, never>;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
declare class RdxCheckboxIndicatorDirective {
|
|
219
|
-
protected readonly rootContext: {
|
|
220
|
-
checked: _angular_core.Signal<boolean>;
|
|
221
|
-
indeterminate: _angular_core.Signal<boolean>;
|
|
222
|
-
disabled: _angular_core.Signal<boolean>;
|
|
223
|
-
required: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
224
|
-
value: _angular_core.InputSignal<string>;
|
|
225
|
-
name: _angular_core.InputSignal<string | undefined>;
|
|
226
|
-
parent: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
227
|
-
form: _angular_core.InputSignal<string | undefined>;
|
|
228
|
-
readonly: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
229
|
-
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
230
|
-
toggle(event?: Event): void;
|
|
231
|
-
};
|
|
232
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxIndicatorDirective, never>;
|
|
233
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxIndicatorDirective, "[rdxCheckboxIndicator]", never, {}, {}, never, never, true, never>;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
type RdxCheckboxGroupValueChangeReason = 'child-press' | 'parent-press' | 'none';
|
|
221
|
+
type RdxCheckboxGroupValueChangeReason = 'none';
|
|
237
222
|
type RdxCheckboxGroupValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxCheckboxGroupValueChangeReason>;
|
|
238
223
|
interface RdxCheckboxGroupValueChangeEvent {
|
|
239
224
|
value: string[];
|
|
@@ -338,12 +323,55 @@ declare class RdxCheckboxGroupDirective implements ControlValueAccessor {
|
|
|
338
323
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxGroupDirective, "[rdxCheckboxGroup]", ["rdxCheckboxGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "allValues": { "alias": "allValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
|
339
324
|
}
|
|
340
325
|
|
|
341
|
-
declare
|
|
326
|
+
declare class RdxCheckboxIndicatorDirective {
|
|
327
|
+
protected readonly rootContext: {
|
|
328
|
+
checked: _angular_core.Signal<boolean>;
|
|
329
|
+
indeterminate: _angular_core.Signal<boolean>;
|
|
330
|
+
disabled: _angular_core.Signal<boolean>;
|
|
331
|
+
required: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
332
|
+
value: _angular_core.InputSignal<string>;
|
|
333
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
334
|
+
parent: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
335
|
+
form: _angular_core.InputSignal<string | undefined>;
|
|
336
|
+
readonly: _angular_core.Signal<boolean>;
|
|
337
|
+
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
338
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
339
|
+
toggle(event?: Event): void;
|
|
340
|
+
};
|
|
341
|
+
/** Keep the indicator in the DOM when unchecked so CSS exit animations can play. */
|
|
342
|
+
readonly keepMounted: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
343
|
+
protected readonly isVisible: _angular_core.Signal<boolean>;
|
|
344
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxIndicatorDirective, never>;
|
|
345
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxIndicatorDirective, "[rdxCheckboxIndicator]", never, { "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
declare class RdxCheckboxInputDirective {
|
|
349
|
+
protected readonly rootContext: {
|
|
350
|
+
checked: _angular_core.Signal<boolean>;
|
|
351
|
+
indeterminate: _angular_core.Signal<boolean>;
|
|
352
|
+
disabled: _angular_core.Signal<boolean>;
|
|
353
|
+
required: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
354
|
+
value: _angular_core.InputSignal<string>;
|
|
355
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
356
|
+
parent: _angular_core.InputSignalWithTransform<boolean, _radix_ng_primitives_types_radix_ng_primitives_core.BooleanInput>;
|
|
357
|
+
form: _angular_core.InputSignal<string | undefined>;
|
|
358
|
+
readonly: _angular_core.Signal<boolean>;
|
|
359
|
+
state: _angular_core.Signal<"indeterminate" | "checked" | "unchecked">;
|
|
360
|
+
uncheckedValue: _angular_core.InputSignal<string | undefined>;
|
|
361
|
+
toggle(event?: Event): void;
|
|
362
|
+
};
|
|
363
|
+
private readonly input;
|
|
364
|
+
constructor();
|
|
365
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxInputDirective, never>;
|
|
366
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCheckboxInputDirective, "input[rdxCheckboxInput]", never, {}, {}, never, never, true, never>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare const checkboxImports: (typeof RdxCheckboxRootDirective | typeof RdxCheckboxGroupDirective | typeof RdxCheckboxButtonDirective | typeof RdxCheckboxIndicatorDirective | typeof RdxCheckboxInputDirective)[];
|
|
342
370
|
declare class RdxCheckboxModule {
|
|
343
371
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCheckboxModule, never>;
|
|
344
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCheckboxModule, never, [typeof RdxCheckboxInputDirective, typeof RdxCheckboxRootDirective, typeof RdxCheckboxButtonDirective, typeof RdxCheckboxIndicatorDirective, typeof
|
|
372
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCheckboxModule, never, [typeof RdxCheckboxInputDirective, typeof RdxCheckboxRootDirective, typeof RdxCheckboxButtonDirective, typeof RdxCheckboxIndicatorDirective, typeof RdxCheckboxGroupDirective], [typeof RdxCheckboxInputDirective, typeof RdxCheckboxRootDirective, typeof RdxCheckboxButtonDirective, typeof RdxCheckboxIndicatorDirective, typeof RdxCheckboxGroupDirective]>;
|
|
345
373
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxCheckboxModule>;
|
|
346
374
|
}
|
|
347
375
|
|
|
348
|
-
export { RdxCheckboxButtonDirective, RdxCheckboxGroupDirective, RdxCheckboxIndicatorDirective,
|
|
376
|
+
export { RdxCheckboxButtonDirective, RdxCheckboxGroupDirective, RdxCheckboxIndicatorDirective, RdxCheckboxInputDirective, RdxCheckboxModule, RdxCheckboxRootDirective, checkboxImports, getState, injectCheckboxGroupContext, injectCheckboxRootContext, isIndeterminate, provideCheckboxGroupContext, provideCheckboxRootContext };
|
|
349
377
|
export type { CheckboxRootContext, CheckedState, RdxCheckboxCheckedChangeEvent, RdxCheckboxCheckedChangeEventDetails, RdxCheckboxCheckedChangeReason, RdxCheckboxGroupContext, RdxCheckboxGroupValueChangeEvent, RdxCheckboxGroupValueChangeEventDetails, RdxCheckboxGroupValueChangeReason };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal, ElementRef } from '@angular/core';
|
|
3
|
+
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
+
import { Direction, BooleanInput } from '@radix-ng/primitives/core';
|
|
5
|
+
import * as _radix_ng_primitives_composite from '@radix-ng/primitives/composite';
|
|
6
|
+
|
|
7
|
+
type RdxCompositeOrientation = 'horizontal' | 'vertical' | 'both';
|
|
8
|
+
type RdxCompositeModifierKey = 'Shift' | 'Control' | 'Alt' | 'Meta';
|
|
9
|
+
type RdxCompositeItemMetadata = Record<string, unknown>;
|
|
10
|
+
interface RdxCompositeItemRegistration<Metadata extends RdxCompositeItemMetadata = RdxCompositeItemMetadata> {
|
|
11
|
+
element: HTMLElement;
|
|
12
|
+
metadata: Signal<Metadata | null | undefined>;
|
|
13
|
+
}
|
|
14
|
+
type RdxCompositeMetadata<Metadata extends RdxCompositeItemMetadata = RdxCompositeItemMetadata> = {
|
|
15
|
+
index: number;
|
|
16
|
+
} & Metadata;
|
|
17
|
+
interface RdxCompositeListContext {
|
|
18
|
+
listElement: HTMLElement;
|
|
19
|
+
items: Signal<RdxCompositeItemRegistration[]>;
|
|
20
|
+
itemMap: Signal<Map<HTMLElement, RdxCompositeMetadata>>;
|
|
21
|
+
registerItem: <Metadata extends RdxCompositeItemMetadata>(item: RdxCompositeItemRegistration<Metadata>) => () => void;
|
|
22
|
+
indexOf: (element: HTMLElement) => number;
|
|
23
|
+
}
|
|
24
|
+
interface RdxCompositeRootContext {
|
|
25
|
+
rootElement: HTMLElement;
|
|
26
|
+
highlightedIndex: Signal<number>;
|
|
27
|
+
highlightItemOnHover: Signal<boolean>;
|
|
28
|
+
orientation: Signal<RdxCompositeOrientation>;
|
|
29
|
+
dir: Signal<Direction>;
|
|
30
|
+
isIndexDisabled: (index: number) => boolean;
|
|
31
|
+
setHighlightedIndex: (index: number, shouldScrollIntoView?: boolean) => void;
|
|
32
|
+
relayKeyboardEvent: (event: KeyboardEvent) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Registers the host with the nearest composite list without changing focus behavior.
|
|
37
|
+
*/
|
|
38
|
+
declare class RdxCompositeListItem {
|
|
39
|
+
private readonly listContext;
|
|
40
|
+
private readonly elementRef;
|
|
41
|
+
private readonly hasRendered;
|
|
42
|
+
/** Arbitrary metadata included in the list's ordered item map. */
|
|
43
|
+
readonly metadataInput: _angular_core.InputSignal<RdxCompositeItemMetadata | null | undefined>;
|
|
44
|
+
private readonly _metadata;
|
|
45
|
+
readonly index: _angular_core.Signal<number>;
|
|
46
|
+
readonly inListElement: _angular_core.Signal<boolean>;
|
|
47
|
+
constructor();
|
|
48
|
+
setMetadata(value: RdxCompositeItemMetadata | null | undefined): void;
|
|
49
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCompositeListItem, never>;
|
|
50
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCompositeListItem, "[rdxCompositeListItem]", ["rdxCompositeListItem"], { "metadataInput": { "alias": "metadata"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Internal Base UI-style composite item. Registers itself with the nearest composite root and
|
|
55
|
+
* receives the roving `tabindex` from the root's highlighted index.
|
|
56
|
+
*/
|
|
57
|
+
declare class RdxCompositeItem {
|
|
58
|
+
private readonly rootContext;
|
|
59
|
+
private readonly listItem;
|
|
60
|
+
private readonly elementRef;
|
|
61
|
+
readonly index: _angular_core.Signal<number>;
|
|
62
|
+
private readonly inRootElement;
|
|
63
|
+
protected readonly highlighted: _angular_core.Signal<boolean>;
|
|
64
|
+
protected readonly tabIndex: _angular_core.Signal<-1 | 0 | null>;
|
|
65
|
+
setMetadata(value: RdxCompositeItemMetadata | null | undefined): void;
|
|
66
|
+
protected handleFocus(): void;
|
|
67
|
+
protected handleMouseMove(): void;
|
|
68
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCompositeItem, never>;
|
|
69
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCompositeItem, "[rdxCompositeItem]", ["rdxCompositeItem"], {}, {}, never, never, true, [{ directive: typeof RdxCompositeListItem; inputs: { "metadata": "metadata"; }; outputs: {}; }]>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare const injectRdxCompositeListContext: _radix_ng_primitives_core.InjectContext<RdxCompositeListContext>;
|
|
73
|
+
declare const provideRdxCompositeListContext: (useFactory: () => RdxCompositeListContext) => _angular_core.Provider;
|
|
74
|
+
/**
|
|
75
|
+
* Base UI-style composite list. Owns item registration and DOM-order metadata without applying
|
|
76
|
+
* roving tabindex or keyboard navigation.
|
|
77
|
+
*/
|
|
78
|
+
declare class RdxCompositeList {
|
|
79
|
+
readonly elementRef: ElementRef<HTMLElement>;
|
|
80
|
+
private readonly registeredItems;
|
|
81
|
+
/** Emits when the ordered item map changes. */
|
|
82
|
+
readonly onMapChange: _angular_core.OutputEmitterRef<Map<HTMLElement, RdxCompositeMetadata>>;
|
|
83
|
+
/** Items registered with this list, sorted in DOM order. */
|
|
84
|
+
readonly items: _angular_core.Signal<RdxCompositeItemRegistration<RdxCompositeItemMetadata>[]>;
|
|
85
|
+
/** Ordered metadata keyed by item element. */
|
|
86
|
+
readonly itemMap: _angular_core.Signal<Map<HTMLElement, RdxCompositeMetadata>>;
|
|
87
|
+
constructor();
|
|
88
|
+
registerItem<Metadata extends RdxCompositeItemMetadata>(item: RdxCompositeItemRegistration<Metadata>): () => void;
|
|
89
|
+
indexOf(element: HTMLElement): number;
|
|
90
|
+
elements(): HTMLElement[];
|
|
91
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCompositeList, never>;
|
|
92
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCompositeList, "[rdxCompositeList]", ["rdxCompositeList"], {}, { "onMapChange": "onMapChange"; }, never, never, true, never>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare const injectRdxCompositeRootContext: _radix_ng_primitives_core.InjectContext<RdxCompositeRootContext>;
|
|
96
|
+
declare const provideRdxCompositeRootContext: (useFactory: () => RdxCompositeRootContext) => _angular_core.Provider;
|
|
97
|
+
/**
|
|
98
|
+
* Internal Base UI-style composite root for roving index and arrow-key navigation.
|
|
99
|
+
*/
|
|
100
|
+
declare class RdxCompositeRoot {
|
|
101
|
+
readonly elementRef: ElementRef<HTMLElement>;
|
|
102
|
+
private readonly compositeList;
|
|
103
|
+
private hasSetInitialIndex;
|
|
104
|
+
/** The composite orientation. */
|
|
105
|
+
readonly orientationInput: _angular_core.InputSignal<RdxCompositeOrientation>;
|
|
106
|
+
private readonly _orientation;
|
|
107
|
+
readonly orientation: _angular_core.Signal<RdxCompositeOrientation>;
|
|
108
|
+
/** Text direction for horizontal arrow-key navigation. */
|
|
109
|
+
readonly dirInput: _angular_core.InputSignal<Direction | undefined>;
|
|
110
|
+
private readonly effectiveDir;
|
|
111
|
+
private readonly _dir;
|
|
112
|
+
readonly dir: _angular_core.Signal<Direction>;
|
|
113
|
+
/** Whether arrow-key navigation wraps at the first/last item. */
|
|
114
|
+
readonly loopFocusInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
115
|
+
private readonly _loopFocus;
|
|
116
|
+
readonly loopFocus: _angular_core.Signal<boolean>;
|
|
117
|
+
/** Enables Home and End keys. */
|
|
118
|
+
readonly enableHomeAndEndKeysInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
119
|
+
private readonly _enableHomeAndEndKeys;
|
|
120
|
+
readonly enableHomeAndEndKeys: _angular_core.Signal<boolean>;
|
|
121
|
+
/** Indices that are skipped by keyboard navigation. */
|
|
122
|
+
readonly disabledIndicesInput: _angular_core.InputSignal<readonly number[] | undefined>;
|
|
123
|
+
private readonly _disabledIndices;
|
|
124
|
+
readonly disabledIndices: _angular_core.Signal<readonly number[] | undefined>;
|
|
125
|
+
/** Modifier keys that should not block composite navigation. */
|
|
126
|
+
readonly modifierKeysInput: _angular_core.InputSignal<readonly RdxCompositeModifierKey[]>;
|
|
127
|
+
private readonly _modifierKeys;
|
|
128
|
+
readonly modifierKeys: _angular_core.Signal<readonly RdxCompositeModifierKey[]>;
|
|
129
|
+
/** Whether hovering an item should focus it. */
|
|
130
|
+
readonly highlightItemOnHover: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
131
|
+
/** Whether handled navigation keys stop propagation. */
|
|
132
|
+
readonly stopEventPropagation: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
133
|
+
/** The currently highlighted item index. */
|
|
134
|
+
readonly highlightedIndex: _angular_core.ModelSignal<number>;
|
|
135
|
+
/** Emits when this root changes the highlighted index. */
|
|
136
|
+
readonly onHighlightedIndexChange: _angular_core.OutputEmitterRef<number>;
|
|
137
|
+
/** Emits when the ordered item map changes. */
|
|
138
|
+
readonly onMapChange: _angular_core.OutputEmitterRef<Map<HTMLElement, RdxCompositeMetadata>>;
|
|
139
|
+
readonly items: _angular_core.Signal<_radix_ng_primitives_composite.RdxCompositeItemRegistration<_radix_ng_primitives_composite.RdxCompositeItemMetadata>[]>;
|
|
140
|
+
readonly itemMap: _angular_core.Signal<Map<HTMLElement, RdxCompositeMetadata>>;
|
|
141
|
+
constructor();
|
|
142
|
+
indexOf(element: HTMLElement): number;
|
|
143
|
+
setOrientation(value: RdxCompositeOrientation): void;
|
|
144
|
+
setLoopFocus(value: boolean): void;
|
|
145
|
+
setDir(value: Direction): void;
|
|
146
|
+
setEnableHomeAndEndKeys(value: boolean): void;
|
|
147
|
+
setDisabledIndices(value: readonly number[] | undefined): void;
|
|
148
|
+
setModifierKeys(value: readonly RdxCompositeModifierKey[]): void;
|
|
149
|
+
isIndexDisabled(index: number): boolean;
|
|
150
|
+
setHighlightedIndex(index: number, shouldScrollIntoView?: boolean): void;
|
|
151
|
+
relayKeyboardEvent(event: KeyboardEvent): void;
|
|
152
|
+
protected handleKeydown(event: KeyboardEvent): void;
|
|
153
|
+
private handleCompositeKeydown;
|
|
154
|
+
private getNextIndex;
|
|
155
|
+
private elements;
|
|
156
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCompositeRoot, never>;
|
|
157
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxCompositeRoot, "[rdxCompositeRoot]", ["rdxCompositeRoot"], { "orientationInput": { "alias": "orientation"; "required": false; "isSignal": true; }; "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loopFocusInput": { "alias": "loopFocus"; "required": false; "isSignal": true; }; "enableHomeAndEndKeysInput": { "alias": "enableHomeAndEndKeys"; "required": false; "isSignal": true; }; "disabledIndicesInput": { "alias": "disabledIndices"; "required": false; "isSignal": true; }; "modifierKeysInput": { "alias": "modifierKeys"; "required": false; "isSignal": true; }; "highlightItemOnHover": { "alias": "highlightItemOnHover"; "required": false; "isSignal": true; }; "stopEventPropagation": { "alias": "stopEventPropagation"; "required": false; "isSignal": true; }; "highlightedIndex": { "alias": "highlightedIndex"; "required": false; "isSignal": true; }; }, { "highlightedIndex": "highlightedIndexChange"; "onHighlightedIndexChange": "onHighlightedIndexChange"; "onMapChange": "onMapChange"; }, never, never, true, [{ directive: typeof RdxCompositeList; inputs: {}; outputs: {}; }]>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare const ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
|
|
161
|
+
declare const ARROW_KEYS: Set<string>;
|
|
162
|
+
declare const COMPOSITE_KEYS: Set<string>;
|
|
163
|
+
declare const MODIFIER_KEYS: RdxCompositeModifierKey[];
|
|
164
|
+
declare function sortByDocumentPosition<T extends {
|
|
165
|
+
element: HTMLElement;
|
|
166
|
+
}>(items: readonly T[]): T[];
|
|
167
|
+
declare function isModifierKeySet(event: KeyboardEvent, allowedModifierKeys: readonly RdxCompositeModifierKey[]): boolean;
|
|
168
|
+
declare function isNativeTextInput(target: EventTarget | null): target is HTMLInputElement | HTMLTextAreaElement;
|
|
169
|
+
declare function getCompositeNavigationKeys(orientation: RdxCompositeOrientation, dir: Direction): {
|
|
170
|
+
forwardKeys: string[];
|
|
171
|
+
backwardKeys: string[];
|
|
172
|
+
};
|
|
173
|
+
declare function shouldKeepNativeTextInputBehavior(event: KeyboardEvent, target: HTMLInputElement | HTMLTextAreaElement, orientation: RdxCompositeOrientation, dir: Direction): boolean;
|
|
174
|
+
declare function isIndexOutOfListBounds<T>(list: readonly T[], index: number): boolean;
|
|
175
|
+
declare function getMinListIndex(list: readonly HTMLElement[], disabledIndices?: readonly number[]): number;
|
|
176
|
+
declare function getMaxListIndex(list: readonly HTMLElement[], disabledIndices?: readonly number[]): number;
|
|
177
|
+
declare function findNonDisabledListIndex(list: readonly HTMLElement[], options?: {
|
|
178
|
+
startingIndex?: number;
|
|
179
|
+
decrement?: boolean;
|
|
180
|
+
disabledIndices?: readonly number[];
|
|
181
|
+
}): number;
|
|
182
|
+
declare function isListIndexDisabled(list: readonly HTMLElement[], index: number, disabledIndices?: readonly number[]): boolean;
|
|
183
|
+
declare function isElementDisabled(element: HTMLElement | null): boolean;
|
|
184
|
+
declare function isElementVisible(element: HTMLElement | null): boolean;
|
|
185
|
+
declare function scrollIntoViewIfNeeded(scrollContainer: HTMLElement | null, element: HTMLElement | null, direction: Direction, orientation: RdxCompositeOrientation): void;
|
|
186
|
+
|
|
187
|
+
declare const compositeImports: (typeof RdxCompositeList | typeof RdxCompositeListItem | typeof RdxCompositeRoot | typeof RdxCompositeItem)[];
|
|
188
|
+
declare class RdxCompositeModule {
|
|
189
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxCompositeModule, never>;
|
|
190
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxCompositeModule, never, [typeof RdxCompositeList, typeof RdxCompositeListItem, typeof RdxCompositeRoot, typeof RdxCompositeItem], [typeof RdxCompositeList, typeof RdxCompositeListItem, typeof RdxCompositeRoot, typeof RdxCompositeItem]>;
|
|
191
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxCompositeModule>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { ACTIVE_COMPOSITE_ITEM, ARROW_KEYS, COMPOSITE_KEYS, MODIFIER_KEYS, RdxCompositeItem, RdxCompositeList, RdxCompositeListItem, RdxCompositeModule, RdxCompositeRoot, compositeImports, findNonDisabledListIndex, getCompositeNavigationKeys, getMaxListIndex, getMinListIndex, injectRdxCompositeListContext, injectRdxCompositeRootContext, isElementDisabled, isElementVisible, isIndexOutOfListBounds, isListIndexDisabled, isModifierKeySet, isNativeTextInput, provideRdxCompositeListContext, provideRdxCompositeRootContext, scrollIntoViewIfNeeded, shouldKeepNativeTextInputBehavior, sortByDocumentPosition };
|
|
195
|
+
export type { RdxCompositeItemMetadata, RdxCompositeItemRegistration, RdxCompositeListContext, RdxCompositeMetadata, RdxCompositeModifierKey, RdxCompositeOrientation, RdxCompositeRootContext };
|