@radix-ng/primitives 0.8.1 → 0.9.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/accordion/index.d.ts +3 -3
- package/accordion/src/accordion-content.directive.d.ts +1 -1
- package/accordion/src/accordion-header.directive.d.ts +1 -1
- package/accordion/src/accordion-item.directive.d.ts +1 -1
- package/accordion/src/accordion-root.directive.d.ts +1 -1
- package/accordion/src/accordion-trigger.directive.d.ts +1 -1
- package/alert-dialog/index.d.ts +2 -2
- package/avatar/index.d.ts +2 -2
- package/avatar/src/avatar-fallback.directive.d.ts +3 -3
- package/avatar/src/avatar-image.directive.d.ts +6 -6
- package/avatar/src/avatar-root.directive.d.ts +4 -4
- package/checkbox/index.d.ts +2 -0
- package/checkbox/src/checkbox-button.directive.d.ts +8 -0
- package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
- package/checkbox/src/checkbox-input.directive.d.ts +9 -0
- package/checkbox/src/checkbox.directive.d.ts +7 -5
- package/collapsible/index.d.ts +1 -1
- package/collapsible/src/collapsible-content.directive.d.ts +1 -1
- package/collapsible/src/collapsible-root.directive.d.ts +1 -1
- package/collapsible/src/collapsible-trigger.directive.d.ts +1 -1
- package/dropdown-menu/index.d.ts +8 -3
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +12 -2
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.d.ts +7 -0
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.d.ts +12 -0
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.d.ts +19 -0
- package/dropdown-menu/src/dropdown-menu-item-selectable.d.ts +14 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +13 -4
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +1 -1
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +2 -2
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +33 -2
- package/esm2022/accordion/index.mjs +4 -4
- package/esm2022/accordion/src/accordion-content.directive.mjs +7 -9
- package/esm2022/accordion/src/accordion-header.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-item.directive.mjs +17 -9
- package/esm2022/accordion/src/accordion-root.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +5 -5
- package/esm2022/alert-dialog/index.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +5 -4
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +6 -9
- package/esm2022/avatar/index.mjs +1 -1
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-image.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-root.directive.mjs +6 -6
- package/esm2022/checkbox/index.mjs +3 -1
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +33 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +6 -5
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +41 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +18 -22
- package/esm2022/checkbox/src/checkbox.token.mjs +1 -1
- package/esm2022/collapsible/index.mjs +2 -2
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +13 -7
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +5 -5
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +5 -5
- package/esm2022/dropdown-menu/index.mjs +9 -4
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +36 -10
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +26 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio.directive.mjs +60 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +40 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +45 -13
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +5 -5
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +8 -8
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +134 -12
- package/esm2022/label/index.mjs +2 -2
- package/esm2022/label/src/label.directive.mjs +54 -0
- package/esm2022/menu/index.mjs +7 -7
- package/esm2022/menu/src/menu-content.directive.mjs +3 -3
- package/esm2022/menu/src/menu-directive.mjs +3 -3
- package/esm2022/menu/src/menu-group.directive.mjs +3 -3
- package/esm2022/menu/src/menu-item.directive.mjs +8 -4
- package/esm2022/menu/src/menu-label.directive.mjs +3 -3
- package/esm2022/menu/src/menu-separator.directive.mjs +4 -4
- package/esm2022/menubar/index.mjs +7 -7
- package/esm2022/menubar/src/menubar-content.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-radio-group.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-root.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-separator.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +4 -4
- package/esm2022/progress/src/progress-indicator.directive.mjs +19 -9
- package/esm2022/progress/src/progress-root.directive.mjs +63 -7
- package/esm2022/radio/src/radio-indicator.directive.mjs +4 -4
- package/esm2022/radio/src/radio-item.directive.mjs +4 -8
- package/esm2022/radio/src/radio-root.directive.mjs +5 -9
- package/esm2022/separator/src/separator.directive.mjs +3 -3
- package/esm2022/switch/index.mjs +29 -3
- package/esm2022/switch/src/switch-input.directive.mjs +12 -10
- package/esm2022/switch/src/switch-root.directive.mjs +47 -23
- package/esm2022/switch/src/switch-thumb.directive.mjs +7 -7
- package/esm2022/tabs/index.mjs +7 -7
- package/esm2022/tabs/src/tabs-content.directive.mjs +7 -5
- package/esm2022/tabs/src/tabs-context.service.mjs +3 -3
- package/esm2022/tabs/src/tabs-list.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-root.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +5 -5
- package/esm2022/toggle/index.mjs +2 -2
- package/esm2022/toggle/src/toggle.directive.mjs +39 -0
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +14 -13
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +1 -1
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +18 -34
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +5 -25
- package/esm2022/toggle-group/src/toggle-group.token.mjs +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +73 -67
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +49 -51
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +15 -15
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +91 -26
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +20 -14
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +386 -42
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +22 -16
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +26 -22
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +80 -14
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +10 -14
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +3 -3
- package/fesm2022/radix-ng-primitives-switch.mjs +94 -46
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +25 -23
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +34 -65
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +18 -28
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/label/index.d.ts +1 -1
- package/label/src/label.directive.d.ts +23 -0
- package/menu/index.d.ts +2 -2
- package/menubar/index.d.ts +2 -2
- package/package.json +1 -7
- package/progress/src/progress-indicator.directive.d.ts +12 -2
- package/progress/src/progress-root.directive.d.ts +38 -4
- package/radio/src/radio-item.directive.d.ts +1 -2
- package/radio/src/radio-root.directive.d.ts +1 -2
- package/switch/index.d.ts +11 -2
- package/switch/src/switch-input.directive.d.ts +1 -1
- package/switch/src/switch-root.directive.d.ts +26 -9
- package/switch/src/switch-thumb.directive.d.ts +1 -1
- package/tabs/index.d.ts +2 -2
- package/tabs/src/tabs-content.directive.d.ts +1 -1
- package/tabs/src/tabs-list.directive.d.ts +1 -1
- package/tabs/src/tabs-root.directive.d.ts +1 -1
- package/tabs/src/tabs-trigger.directive.d.ts +1 -1
- package/toggle/index.d.ts +2 -2
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/toggle-group/src/toggle-group-button.directive.d.ts +9 -6
- package/toggle-group/src/toggle-group-multi.directive.d.ts +18 -15
- package/toggle-group/src/toggle-group.directive.d.ts +3 -9
- package/esm2022/label/src/label-root.directive.mjs +0 -48
- package/esm2022/roving-focus/index.mjs +0 -3
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +0 -5
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +0 -109
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +0 -86
- package/esm2022/toggle/src/toggle-root.directive.mjs +0 -49
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -198
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/label/src/label-root.directive.d.ts +0 -13
- package/roving-focus/README.md +0 -1
- package/roving-focus/index.d.ts +0 -2
- package/roving-focus/src/roving-focus-group.directive.d.ts +0 -53
- package/roving-focus/src/roving-focus-item.directive.d.ts +0 -50
- package/toggle/src/toggle-root.directive.d.ts +0 -32
@@ -1,198 +0,0 @@
|
|
1
|
-
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
-
import { Directionality } from '@angular/cdk/bidi';
|
3
|
-
import * as i0 from '@angular/core';
|
4
|
-
import { InjectionToken, inject, DestroyRef, QueryList, booleanAttribute, Directive, Input, ElementRef, ChangeDetectorRef, numberAttribute } from '@angular/core';
|
5
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
6
|
-
import { filter } from 'rxjs';
|
7
|
-
|
8
|
-
const RdxRovingFocusGroupToken = new InjectionToken('RdxRovingFocusToken');
|
9
|
-
function injectRovingFocusGroup() {
|
10
|
-
return inject(RdxRovingFocusGroupToken);
|
11
|
-
}
|
12
|
-
class RdxRovingFocusGroupDirective {
|
13
|
-
constructor() {
|
14
|
-
this.directionality = inject(Directionality);
|
15
|
-
this.destroyRef = inject(DestroyRef);
|
16
|
-
/**
|
17
|
-
* Create a query list of all the roving focus items.
|
18
|
-
* We don't use ContentChildren as dynamically added items may not be in the correct order.
|
19
|
-
*/
|
20
|
-
this.items = new QueryList();
|
21
|
-
this.keyManager = new FocusKeyManager(this.items);
|
22
|
-
/**
|
23
|
-
* Determine the orientation of the roving focus group.
|
24
|
-
* @default vertical
|
25
|
-
*/
|
26
|
-
this.orientation = 'vertical';
|
27
|
-
/**
|
28
|
-
* Determine if focus should wrap when the end or beginning is reached.
|
29
|
-
* @default true
|
30
|
-
*/
|
31
|
-
this.wrap = true;
|
32
|
-
}
|
33
|
-
ngOnInit() {
|
34
|
-
this.keyManager.withWrap(this.wrap);
|
35
|
-
this.setOrientation(this.orientation);
|
36
|
-
this.directionality.change
|
37
|
-
.pipe(filter(() => this.orientation === 'horizontal'), takeUntilDestroyed(this.destroyRef))
|
38
|
-
.subscribe((direction) => this.keyManager.withHorizontalOrientation(direction));
|
39
|
-
}
|
40
|
-
ngOnChanges(changes) {
|
41
|
-
if ('orientation' in changes) {
|
42
|
-
this.setOrientation(this.orientation);
|
43
|
-
}
|
44
|
-
if ('wrap' in changes) {
|
45
|
-
this.keyManager.withWrap(this.wrap);
|
46
|
-
}
|
47
|
-
}
|
48
|
-
ngOnDestroy() {
|
49
|
-
this.keyManager.destroy();
|
50
|
-
}
|
51
|
-
/**
|
52
|
-
* Register a roving focus item.
|
53
|
-
* @param item The roving focus item to register.
|
54
|
-
*/
|
55
|
-
register(item) {
|
56
|
-
this.items.reset([...this.items.toArray(), item].sort((a, b) => a.order - b.order));
|
57
|
-
if (this.items.length === 1) {
|
58
|
-
this.keyManager.updateActiveItem(item);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
/**
|
62
|
-
* Unregister a roving focus item.
|
63
|
-
* @param item The roving focus item to unregister.
|
64
|
-
*/
|
65
|
-
unregister(item) {
|
66
|
-
const isActive = this.keyManager.activeItem === item;
|
67
|
-
this.items.reset(this.items.toArray().filter((i) => i !== item));
|
68
|
-
if (isActive) {
|
69
|
-
this.keyManager.updateActiveItem(0);
|
70
|
-
}
|
71
|
-
}
|
72
|
-
/**
|
73
|
-
* Handle key events on the roving focus items.
|
74
|
-
* @param event The key event.
|
75
|
-
* @internal
|
76
|
-
*/
|
77
|
-
onKeydown(event) {
|
78
|
-
this.keyManager.onKeydown(event);
|
79
|
-
}
|
80
|
-
/**
|
81
|
-
* Set the orientation of the roving focus group.
|
82
|
-
* @param orientation The orientation of the roving focus group.
|
83
|
-
*/
|
84
|
-
setOrientation(orientation) {
|
85
|
-
this.orientation = orientation;
|
86
|
-
if (orientation === 'horizontal') {
|
87
|
-
this.keyManager.withHorizontalOrientation(this.directionality.value);
|
88
|
-
}
|
89
|
-
else {
|
90
|
-
this.keyManager.withVerticalOrientation();
|
91
|
-
}
|
92
|
-
}
|
93
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRovingFocusGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
94
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.4", type: RdxRovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientation: ["rdxRovingFocusGroupOrientation", "orientation"], wrap: ["rdxRovingFocusGroupWrap", "wrap", booleanAttribute] }, providers: [{ provide: RdxRovingFocusGroupToken, useExisting: RdxRovingFocusGroupDirective }], usesOnChanges: true, ngImport: i0 }); }
|
95
|
-
}
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRovingFocusGroupDirective, decorators: [{
|
97
|
-
type: Directive,
|
98
|
-
args: [{
|
99
|
-
selector: '[rdxRovingFocusGroup]',
|
100
|
-
standalone: true,
|
101
|
-
providers: [{ provide: RdxRovingFocusGroupToken, useExisting: RdxRovingFocusGroupDirective }]
|
102
|
-
}]
|
103
|
-
}], propDecorators: { orientation: [{
|
104
|
-
type: Input,
|
105
|
-
args: [{ alias: 'rdxRovingFocusGroupOrientation' }]
|
106
|
-
}], wrap: [{
|
107
|
-
type: Input,
|
108
|
-
args: [{ alias: 'rdxRovingFocusGroupWrap', transform: booleanAttribute }]
|
109
|
-
}] } });
|
110
|
-
|
111
|
-
const RdxRovingFocusItemToken = new InjectionToken('RdxRovingFocusItemToken');
|
112
|
-
function injectRovingFocusItem() {
|
113
|
-
return inject(RdxRovingFocusItemToken);
|
114
|
-
}
|
115
|
-
class RdxRovingFocusItemDirective {
|
116
|
-
constructor() {
|
117
|
-
/**
|
118
|
-
* Access the group the roving focus item belongs to.
|
119
|
-
*/
|
120
|
-
this.group = injectRovingFocusGroup();
|
121
|
-
/**
|
122
|
-
* Access the element reference of the roving focus item.
|
123
|
-
*/
|
124
|
-
this.elementRef = inject((ElementRef));
|
125
|
-
/**
|
126
|
-
* Access the destroyRef
|
127
|
-
*/
|
128
|
-
this.destroyRef = inject(DestroyRef);
|
129
|
-
/**
|
130
|
-
* Access the change detector ref
|
131
|
-
*/
|
132
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
133
|
-
/**
|
134
|
-
* Define the order of the roving focus item in the group.
|
135
|
-
*/
|
136
|
-
this.order = 0;
|
137
|
-
/**
|
138
|
-
* Define if the item is disabled.
|
139
|
-
*/
|
140
|
-
this.disabled = false;
|
141
|
-
}
|
142
|
-
ngOnInit() {
|
143
|
-
this.group.register(this);
|
144
|
-
this.group.keyManager.change
|
145
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
146
|
-
.subscribe(() => this.changeDetectorRef.markForCheck());
|
147
|
-
}
|
148
|
-
ngOnDestroy() {
|
149
|
-
this.group.unregister(this);
|
150
|
-
}
|
151
|
-
/**
|
152
|
-
* Handle key events on the roving focus item.
|
153
|
-
* @param event The key event.
|
154
|
-
*/
|
155
|
-
_onKeydown(event) {
|
156
|
-
this.group.onKeydown(event);
|
157
|
-
}
|
158
|
-
/**
|
159
|
-
* Derive the tabindex of the roving focus item.
|
160
|
-
*/
|
161
|
-
_tabindex() {
|
162
|
-
return this.group.keyManager.activeItem === this ? 0 : -1;
|
163
|
-
}
|
164
|
-
/**
|
165
|
-
* Focus the roving focus item.
|
166
|
-
* @internal
|
167
|
-
*/
|
168
|
-
focus() {
|
169
|
-
this.elementRef?.nativeElement.focus();
|
170
|
-
}
|
171
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRovingFocusItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
172
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.4", type: RdxRovingFocusItemDirective, isStandalone: true, selector: "[rdxRovingFocusItem]", inputs: { order: ["order", "order", numberAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, host: { listeners: { "onKeydown": "_onKeydown($event)" }, properties: { "attr.tabindex": "_tabindex()" } }, providers: [{ provide: RdxRovingFocusItemToken, useExisting: RdxRovingFocusItemDirective }], ngImport: i0 }); }
|
173
|
-
}
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: RdxRovingFocusItemDirective, decorators: [{
|
175
|
-
type: Directive,
|
176
|
-
args: [{
|
177
|
-
selector: '[rdxRovingFocusItem]',
|
178
|
-
standalone: true,
|
179
|
-
host: {
|
180
|
-
'(onKeydown)': '_onKeydown($event)',
|
181
|
-
'[attr.tabindex]': '_tabindex()'
|
182
|
-
},
|
183
|
-
providers: [{ provide: RdxRovingFocusItemToken, useExisting: RdxRovingFocusItemDirective }]
|
184
|
-
}]
|
185
|
-
}], propDecorators: { order: [{
|
186
|
-
type: Input,
|
187
|
-
args: [{ transform: numberAttribute }]
|
188
|
-
}], disabled: [{
|
189
|
-
type: Input,
|
190
|
-
args: [{ transform: booleanAttribute }]
|
191
|
-
}] } });
|
192
|
-
|
193
|
-
/**
|
194
|
-
* Generated bundle index. Do not edit.
|
195
|
-
*/
|
196
|
-
|
197
|
-
export { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective, injectRovingFocusGroup, injectRovingFocusItem };
|
198
|
-
//# sourceMappingURL=radix-ng-primitives-roving-focus.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-roving-focus.mjs","sources":["../../../packages/primitives/roving-focus/src/roving-focus-group.directive.ts","../../../packages/primitives/roving-focus/src/roving-focus-item.directive.ts","../../../packages/primitives/roving-focus/radix-ng-primitives-roving-focus.ts"],"sourcesContent":["import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport {\n booleanAttribute,\n DestroyRef,\n Directive,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter } from 'rxjs';\n\nimport type { RdxRovingFocusItemDirective } from './roving-focus-item.directive';\n\nexport type Orientation = 'horizontal' | 'vertical';\n\nconst RdxRovingFocusGroupToken = new InjectionToken<RdxRovingFocusGroupDirective>(\n 'RdxRovingFocusToken'\n);\n\nexport function injectRovingFocusGroup(): RdxRovingFocusGroupDirective {\n return inject(RdxRovingFocusGroupToken);\n}\n\n@Directive({\n selector: '[rdxRovingFocusGroup]',\n standalone: true,\n providers: [{ provide: RdxRovingFocusGroupToken, useExisting: RdxRovingFocusGroupDirective }]\n})\nexport class RdxRovingFocusGroupDirective implements OnInit, OnChanges, OnDestroy {\n private readonly directionality = inject(Directionality);\n\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Create a query list of all the roving focus items.\n * We don't use ContentChildren as dynamically added items may not be in the correct order.\n */\n private readonly items = new QueryList<RdxRovingFocusItemDirective>();\n\n readonly keyManager = new FocusKeyManager<RdxRovingFocusItemDirective>(this.items);\n\n /**\n * Determine the orientation of the roving focus group.\n * @default vertical\n */\n @Input({ alias: 'rdxRovingFocusGroupOrientation' }) orientation: Orientation = 'vertical';\n\n /**\n * Determine if focus should wrap when the end or beginning is reached.\n * @default true\n */\n @Input({ alias: 'rdxRovingFocusGroupWrap', transform: booleanAttribute }) wrap = true;\n\n ngOnInit(): void {\n this.keyManager.withWrap(this.wrap);\n\n this.setOrientation(this.orientation);\n\n this.directionality.change\n .pipe(\n filter(() => this.orientation === 'horizontal'),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((direction) => this.keyManager.withHorizontalOrientation(direction));\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('orientation' in changes) {\n this.setOrientation(this.orientation);\n }\n\n if ('wrap' in changes) {\n this.keyManager.withWrap(this.wrap);\n }\n }\n\n ngOnDestroy(): void {\n this.keyManager.destroy();\n }\n\n /**\n * Register a roving focus item.\n * @param item The roving focus item to register.\n */\n register(item: RdxRovingFocusItemDirective): void {\n this.items.reset([...this.items.toArray(), item].sort((a, b) => a.order - b.order));\n\n if (this.items.length === 1) {\n this.keyManager.updateActiveItem(item);\n }\n }\n\n /**\n * Unregister a roving focus item.\n * @param item The roving focus item to unregister.\n */\n unregister(item: RdxRovingFocusItemDirective): void {\n const isActive = this.keyManager.activeItem === item;\n\n this.items.reset(this.items.toArray().filter((i) => i !== item));\n\n if (isActive) {\n this.keyManager.updateActiveItem(0);\n }\n }\n\n /**\n * Handle key events on the roving focus items.\n * @param event The key event.\n * @internal\n */\n onKeydown(event: KeyboardEvent): void {\n this.keyManager.onKeydown(event);\n }\n\n /**\n * Set the orientation of the roving focus group.\n * @param orientation The orientation of the roving focus group.\n */\n setOrientation(orientation: Orientation): void {\n this.orientation = orientation;\n\n if (orientation === 'horizontal') {\n this.keyManager.withHorizontalOrientation(this.directionality.value);\n } else {\n this.keyManager.withVerticalOrientation();\n }\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport {\n booleanAttribute,\n ChangeDetectorRef,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n InjectionToken,\n Input,\n numberAttribute,\n OnDestroy,\n OnInit\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { injectRovingFocusGroup } from './roving-focus-group.directive';\n\nconst RdxRovingFocusItemToken = new InjectionToken<RdxRovingFocusItemDirective>(\n 'RdxRovingFocusItemToken'\n);\n\nexport function injectRovingFocusItem(): RdxRovingFocusItemDirective {\n return inject(RdxRovingFocusItemToken);\n}\n\n@Directive({\n selector: '[rdxRovingFocusItem]',\n standalone: true,\n host: {\n '(onKeydown)': '_onKeydown($event)',\n '[attr.tabindex]': '_tabindex()'\n },\n providers: [{ provide: RdxRovingFocusItemToken, useExisting: RdxRovingFocusItemDirective }]\n})\nexport class RdxRovingFocusItemDirective implements OnInit, OnDestroy, FocusableOption {\n /**\n * Access the group the roving focus item belongs to.\n */\n private readonly group = injectRovingFocusGroup();\n\n /**\n * Access the element reference of the roving focus item.\n */\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Access the destroyRef\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Access the change detector ref\n */\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n /**\n * Define the order of the roving focus item in the group.\n */\n @Input({ transform: numberAttribute }) order = 0;\n\n /**\n * Define if the item is disabled.\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n ngOnInit(): void {\n this.group.register(this);\n\n this.group.keyManager.change\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n ngOnDestroy(): void {\n this.group.unregister(this);\n }\n\n /**\n * Handle key events on the roving focus item.\n * @param event The key event.\n */\n _onKeydown(event: KeyboardEvent): void {\n this.group.onKeydown(event);\n }\n\n /**\n * Derive the tabindex of the roving focus item.\n */\n _tabindex(): number {\n return this.group.keyManager.activeItem === this ? 0 : -1;\n }\n\n /**\n * Focus the roving focus item.\n * @internal\n */\n focus(): void {\n this.elementRef?.nativeElement.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\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AAE,eAAe,EAAE,CAAA;gBAKG,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;;;AChE1C;;AAEG;;;;"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import * as i0 from "@angular/core";
|
2
|
-
export declare class RdxLabelRootDirective {
|
3
|
-
id: string;
|
4
|
-
/**
|
5
|
-
* The id of the element the label is associated with.
|
6
|
-
* @default '-'
|
7
|
-
*/
|
8
|
-
readonly htmlFor: import("@angular/core").InputSignal<string>;
|
9
|
-
private readonly elementRef;
|
10
|
-
onMouseDown(event: MouseEvent): void;
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxLabelRootDirective, never>;
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelRootDirective, "label[LabelRoot]", ["LabelRoot"], { "id": { "alias": "id"; "required": false; }; "htmlFor": { "alias": "htmlFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
13
|
-
}
|
package/roving-focus/README.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# @radix-ng/primitives/roving-focus
|
package/roving-focus/index.d.ts
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
-
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
3
|
-
import type { RdxRovingFocusItemDirective } from './roving-focus-item.directive';
|
4
|
-
import * as i0 from "@angular/core";
|
5
|
-
export type Orientation = 'horizontal' | 'vertical';
|
6
|
-
export declare function injectRovingFocusGroup(): RdxRovingFocusGroupDirective;
|
7
|
-
export declare class RdxRovingFocusGroupDirective implements OnInit, OnChanges, OnDestroy {
|
8
|
-
private readonly directionality;
|
9
|
-
private readonly destroyRef;
|
10
|
-
/**
|
11
|
-
* Create a query list of all the roving focus items.
|
12
|
-
* We don't use ContentChildren as dynamically added items may not be in the correct order.
|
13
|
-
*/
|
14
|
-
private readonly items;
|
15
|
-
readonly keyManager: FocusKeyManager<RdxRovingFocusItemDirective>;
|
16
|
-
/**
|
17
|
-
* Determine the orientation of the roving focus group.
|
18
|
-
* @default vertical
|
19
|
-
*/
|
20
|
-
orientation: Orientation;
|
21
|
-
/**
|
22
|
-
* Determine if focus should wrap when the end or beginning is reached.
|
23
|
-
* @default true
|
24
|
-
*/
|
25
|
-
wrap: boolean;
|
26
|
-
ngOnInit(): void;
|
27
|
-
ngOnChanges(changes: SimpleChanges): void;
|
28
|
-
ngOnDestroy(): void;
|
29
|
-
/**
|
30
|
-
* Register a roving focus item.
|
31
|
-
* @param item The roving focus item to register.
|
32
|
-
*/
|
33
|
-
register(item: RdxRovingFocusItemDirective): void;
|
34
|
-
/**
|
35
|
-
* Unregister a roving focus item.
|
36
|
-
* @param item The roving focus item to unregister.
|
37
|
-
*/
|
38
|
-
unregister(item: RdxRovingFocusItemDirective): void;
|
39
|
-
/**
|
40
|
-
* Handle key events on the roving focus items.
|
41
|
-
* @param event The key event.
|
42
|
-
* @internal
|
43
|
-
*/
|
44
|
-
onKeydown(event: KeyboardEvent): void;
|
45
|
-
/**
|
46
|
-
* Set the orientation of the roving focus group.
|
47
|
-
* @param orientation The orientation of the roving focus group.
|
48
|
-
*/
|
49
|
-
setOrientation(orientation: Orientation): void;
|
50
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusGroupDirective, never>;
|
51
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientation": { "alias": "rdxRovingFocusGroupOrientation"; "required": false; }; "wrap": { "alias": "rdxRovingFocusGroupWrap"; "required": false; }; }, {}, never, never, true, never>;
|
52
|
-
static ngAcceptInputType_wrap: unknown;
|
53
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { FocusableOption } from '@angular/cdk/a11y';
|
2
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
export declare function injectRovingFocusItem(): RdxRovingFocusItemDirective;
|
5
|
-
export declare class RdxRovingFocusItemDirective implements OnInit, OnDestroy, FocusableOption {
|
6
|
-
/**
|
7
|
-
* Access the group the roving focus item belongs to.
|
8
|
-
*/
|
9
|
-
private readonly group;
|
10
|
-
/**
|
11
|
-
* Access the element reference of the roving focus item.
|
12
|
-
*/
|
13
|
-
private readonly elementRef;
|
14
|
-
/**
|
15
|
-
* Access the destroyRef
|
16
|
-
*/
|
17
|
-
private readonly destroyRef;
|
18
|
-
/**
|
19
|
-
* Access the change detector ref
|
20
|
-
*/
|
21
|
-
private readonly changeDetectorRef;
|
22
|
-
/**
|
23
|
-
* Define the order of the roving focus item in the group.
|
24
|
-
*/
|
25
|
-
order: number;
|
26
|
-
/**
|
27
|
-
* Define if the item is disabled.
|
28
|
-
*/
|
29
|
-
disabled: boolean;
|
30
|
-
ngOnInit(): void;
|
31
|
-
ngOnDestroy(): void;
|
32
|
-
/**
|
33
|
-
* Handle key events on the roving focus item.
|
34
|
-
* @param event The key event.
|
35
|
-
*/
|
36
|
-
_onKeydown(event: KeyboardEvent): void;
|
37
|
-
/**
|
38
|
-
* Derive the tabindex of the roving focus item.
|
39
|
-
*/
|
40
|
-
_tabindex(): number;
|
41
|
-
/**
|
42
|
-
* Focus the roving focus item.
|
43
|
-
* @internal
|
44
|
-
*/
|
45
|
-
focus(): void;
|
46
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusItemDirective, never>;
|
47
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusItemDirective, "[rdxRovingFocusItem]", never, { "order": { "alias": "order"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
48
|
-
static ngAcceptInputType_order: unknown;
|
49
|
-
static ngAcceptInputType_disabled: unknown;
|
50
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
2
|
-
import * as i0 from "@angular/core";
|
3
|
-
export interface ToggleProps {
|
4
|
-
/**
|
5
|
-
* The controlled state of the toggle.
|
6
|
-
*/
|
7
|
-
pressed?: boolean;
|
8
|
-
/**
|
9
|
-
* The state of the toggle when initially rendered. Use `defaultPressed`
|
10
|
-
* if you do not need to control the state of the toggle.
|
11
|
-
* @defaultValue false
|
12
|
-
*/
|
13
|
-
defaultPressed?: boolean;
|
14
|
-
/**
|
15
|
-
* The callback that fires when the state of the toggle changes.
|
16
|
-
*/
|
17
|
-
onPressedChange?: EventEmitter<boolean>;
|
18
|
-
}
|
19
|
-
export declare class RdxToggleRootDirective implements ToggleProps {
|
20
|
-
pressed: boolean;
|
21
|
-
disabled: boolean;
|
22
|
-
id: string;
|
23
|
-
/**
|
24
|
-
* Event emitted when the toggle is pressed.
|
25
|
-
*/
|
26
|
-
readonly onPressedChange: EventEmitter<boolean>;
|
27
|
-
protected toggle(): void;
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleRootDirective, never>;
|
29
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleRootDirective, "button[ToggleRoot]", ["ToggleRoot"], { "pressed": { "alias": "pressed"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, { "onPressedChange": "onPressedChange"; }, never, never, true, never>;
|
30
|
-
static ngAcceptInputType_pressed: unknown;
|
31
|
-
static ngAcceptInputType_disabled: unknown;
|
32
|
-
}
|