@radix-ng/primitives 0.18.1 → 0.19.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/avatar/index.d.ts +1 -2
- package/avatar/src/avatar-fallback.directive.d.ts +11 -23
- package/avatar/src/avatar-image.directive.d.ts +10 -14
- package/avatar/src/avatar-root.directive.d.ts +5 -15
- package/checkbox/index.d.ts +11 -0
- package/checkbox/src/checkbox-button.directive.d.ts +1 -1
- package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
- package/checkbox/src/checkbox-input.directive.d.ts +1 -1
- package/checkbox/src/checkbox.directive.d.ts +1 -1
- package/compodoc/documentation.json +4895 -2139
- package/core/index.d.ts +2 -0
- package/core/src/control-value-accessor/index.d.ts +75 -0
- package/core/src/create-inject-context/assert-injector.d.ts +51 -0
- package/core/src/create-inject-context/index.d.ts +68 -0
- package/core/src/types.d.ts +23 -0
- package/esm2022/avatar/index.mjs +1 -1
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +38 -40
- package/esm2022/avatar/src/avatar-image.directive.mjs +25 -26
- package/esm2022/avatar/src/avatar-root.directive.mjs +13 -25
- package/esm2022/checkbox/index.mjs +31 -1
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox.directive.mjs +3 -3
- package/esm2022/core/index.mjs +3 -1
- package/esm2022/core/src/control-value-accessor/index.mjs +103 -0
- package/esm2022/core/src/create-inject-context/assert-injector.mjs +15 -0
- package/esm2022/core/src/create-inject-context/index.mjs +116 -0
- package/esm2022/core/src/types.mjs +2 -0
- package/esm2022/radio/index.mjs +2 -1
- package/esm2022/radio/src/radio-item-input.directive.mjs +37 -0
- package/esm2022/radio/src/radio-item.directive.mjs +55 -36
- package/esm2022/radio/src/radio-root.directive.mjs +24 -110
- package/esm2022/radio/src/radio-tokens.mjs +1 -1
- package/esm2022/roving-focus/index.mjs +3 -0
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +5 -0
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +138 -0
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +133 -0
- package/esm2022/roving-focus/src/utils.mjs +47 -0
- package/esm2022/select/src/select-item.directive.mjs +8 -2
- package/esm2022/slider/src/slider-orientation-context.service.mjs +3 -4
- package/esm2022/slider/src/slider-root.component.mjs +5 -2
- package/esm2022/toggle/src/toggle-input.directive.mjs +4 -3
- package/fesm2022/radix-ng-primitives-avatar.mjs +70 -85
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +35 -10
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +230 -3
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +142 -176
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +320 -0
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-select.mjs +7 -1
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +6 -4
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +3 -2
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/package.json +7 -1
- package/radio/index.d.ts +1 -0
- package/radio/src/radio-item-input.directive.d.ts +12 -0
- package/radio/src/radio-item.directive.d.ts +23 -14
- package/radio/src/radio-root.directive.d.ts +15 -31
- package/radio/src/radio-tokens.d.ts +3 -3
- package/roving-focus/README.md +3 -0
- package/roving-focus/index.d.ts +3 -0
- package/roving-focus/src/roving-focus-group.directive.d.ts +50 -0
- package/roving-focus/src/roving-focus-item.directive.d.ts +50 -0
- package/roving-focus/src/utils.d.ts +19 -0
- package/select/src/select-item.directive.d.ts +7 -1
- package/slider/src/slider-root.component.d.ts +2 -0
- package/toggle/src/toggle-input.directive.d.ts +1 -1
@@ -0,0 +1,50 @@
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
2
|
+
import { Direction, Orientation } from './utils';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class RdxRovingFocusGroupDirective {
|
5
|
+
private readonly ngZone;
|
6
|
+
private readonly elementRef;
|
7
|
+
orientation: Orientation | undefined;
|
8
|
+
dir: Direction;
|
9
|
+
loop: boolean;
|
10
|
+
preventScrollOnEntryFocus: boolean;
|
11
|
+
entryFocus: EventEmitter<Event>;
|
12
|
+
currentTabStopIdChange: EventEmitter<string | null>;
|
13
|
+
/** @ignore */
|
14
|
+
readonly currentTabStopId: import("@angular/core").WritableSignal<string | null>;
|
15
|
+
/** @ignore */
|
16
|
+
readonly focusableItems: import("@angular/core").WritableSignal<HTMLElement[]>;
|
17
|
+
private readonly isClickFocus;
|
18
|
+
private readonly isTabbingBackOut;
|
19
|
+
private readonly focusableItemsCount;
|
20
|
+
/** @ignore */
|
21
|
+
get dataOrientation(): Orientation;
|
22
|
+
/** @ignore */
|
23
|
+
get tabIndex(): 0 | -1;
|
24
|
+
/** @ignore */
|
25
|
+
handleBlur(): void;
|
26
|
+
/** @ignore */
|
27
|
+
handleMouseUp(): void;
|
28
|
+
/** @ignore */
|
29
|
+
handleFocus(event: FocusEvent): void;
|
30
|
+
/** @ignore */
|
31
|
+
handleMouseDown(): void;
|
32
|
+
/** @ignore */
|
33
|
+
onItemFocus(tabStopId: string): void;
|
34
|
+
/** @ignore */
|
35
|
+
onItemShiftTab(): void;
|
36
|
+
/** @ignore */
|
37
|
+
onFocusableItemAdd(): void;
|
38
|
+
/** @ignore */
|
39
|
+
onFocusableItemRemove(): void;
|
40
|
+
/** @ignore */
|
41
|
+
registerItem(item: HTMLElement): void;
|
42
|
+
/** @ignore */
|
43
|
+
unregisterItem(item: HTMLElement): void;
|
44
|
+
/** @ignore */
|
45
|
+
getFocusableItemsCount(): number;
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusGroupDirective, never>;
|
47
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientation": { "alias": "orientation"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "preventScrollOnEntryFocus": { "alias": "preventScrollOnEntryFocus"; "required": false; }; }, { "entryFocus": "entryFocus"; "currentTabStopIdChange": "currentTabStopIdChange"; }, never, never, true, never>;
|
48
|
+
static ngAcceptInputType_loop: unknown;
|
49
|
+
static ngAcceptInputType_preventScrollOnEntryFocus: unknown;
|
50
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import { RdxRovingFocusGroupDirective } from './roving-focus-group.directive';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class RdxRovingFocusItemDirective implements OnInit, OnDestroy {
|
5
|
+
private readonly elementRef;
|
6
|
+
private readonly ngZone;
|
7
|
+
protected readonly parent: RdxRovingFocusGroupDirective;
|
8
|
+
focusable: boolean;
|
9
|
+
active: boolean;
|
10
|
+
tabStopId: string;
|
11
|
+
allowShiftKey: boolean;
|
12
|
+
private readonly id;
|
13
|
+
/** @ignore */
|
14
|
+
readonly isCurrentTabStop: import("@angular/core").Signal<boolean>;
|
15
|
+
/**
|
16
|
+
* Lifecycle hook triggered on initialization.
|
17
|
+
* Registers the element with the parent roving focus group if it is focusable.
|
18
|
+
* @ignore
|
19
|
+
*/
|
20
|
+
ngOnInit(): void;
|
21
|
+
/**
|
22
|
+
* Lifecycle hook triggered on destruction.
|
23
|
+
* Unregisters the element from the parent roving focus group if it is focusable.
|
24
|
+
* @ignore
|
25
|
+
*/
|
26
|
+
ngOnDestroy(): void;
|
27
|
+
/**
|
28
|
+
* Determines the `tabIndex` of the element.
|
29
|
+
* Returns `0` if the element is the current tab stop; otherwise, returns `-1`.
|
30
|
+
* @ignore
|
31
|
+
*/
|
32
|
+
get tabIndex(): 0 | -1;
|
33
|
+
/** @ignore */
|
34
|
+
handleMouseDown(event: MouseEvent): void;
|
35
|
+
/** @ignore */
|
36
|
+
onFocus(): void;
|
37
|
+
/**
|
38
|
+
* Handles the `keydown` event for keyboard navigation within the roving focus group.
|
39
|
+
* Supports navigation based on orientation and direction, and focuses appropriate elements.
|
40
|
+
*
|
41
|
+
* @param event The `KeyboardEvent` object.
|
42
|
+
* @ignore
|
43
|
+
*/
|
44
|
+
handleKeydown(event: KeyboardEvent): void;
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusItemDirective, never>;
|
46
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusItemDirective, "[rdxRovingFocusItem]", never, { "focusable": { "alias": "focusable"; "required": false; }; "active": { "alias": "active"; "required": false; }; "tabStopId": { "alias": "tabStopId"; "required": false; }; "allowShiftKey": { "alias": "allowShiftKey"; "required": false; }; }, {}, never, never, true, never>;
|
47
|
+
static ngAcceptInputType_focusable: unknown;
|
48
|
+
static ngAcceptInputType_active: unknown;
|
49
|
+
static ngAcceptInputType_allowShiftKey: unknown;
|
50
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export type Orientation = 'horizontal' | 'vertical';
|
2
|
+
export type Direction = 'ltr' | 'rtl';
|
3
|
+
export declare const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
4
|
+
export declare const EVENT_OPTIONS: {
|
5
|
+
bubbles: boolean;
|
6
|
+
cancelable: boolean;
|
7
|
+
};
|
8
|
+
type FocusIntent = 'first' | 'last' | 'prev' | 'next';
|
9
|
+
export declare const MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent>;
|
10
|
+
export declare function getDirectionAwareKey(key: string, dir?: Direction): string;
|
11
|
+
export declare function getFocusIntent(event: KeyboardEvent, orientation?: Orientation, dir?: Direction): FocusIntent | undefined;
|
12
|
+
export declare function focusFirst(candidates: HTMLElement[], preventScroll?: boolean, rootNode?: Document | ShadowRoot): void;
|
13
|
+
/**
|
14
|
+
* Wraps an array around itself at a given start index
|
15
|
+
* Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`
|
16
|
+
*/
|
17
|
+
export declare function wrapArray<T>(array: T[], startIndex: number): T[];
|
18
|
+
export declare function generateId(): string;
|
19
|
+
export {};
|
@@ -30,15 +30,21 @@ export declare class RdxSelectItemDirective implements Highlightable {
|
|
30
30
|
private _disabled;
|
31
31
|
get viewValue(): string;
|
32
32
|
constructor();
|
33
|
-
/** Gets the label to be used when determining whether the option should be focused.
|
33
|
+
/** Gets the label to be used when determining whether the option should be focused.
|
34
|
+
* @ignore
|
35
|
+
*/
|
34
36
|
getLabel(): string;
|
35
37
|
/**
|
36
38
|
* `Selects the option while indicating the selection came from the user. Used to
|
37
39
|
* determine if the select's view -> model callback should be invoked.`
|
40
|
+
* @ignore
|
38
41
|
*/
|
39
42
|
selectViaInteraction(): void;
|
43
|
+
/** @ignore */
|
40
44
|
handleKeydown(event: KeyboardEvent): void;
|
45
|
+
/** @ignore */
|
41
46
|
setActiveStyles(): void;
|
47
|
+
/** @ignore */
|
42
48
|
setInactiveStyles(): void;
|
43
49
|
protected onPointerMove(): void;
|
44
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSelectItemDirective, never>;
|
@@ -21,7 +21,9 @@ export declare class RdxSliderRootComponent implements OnInit {
|
|
21
21
|
readonly valueIndexToChange: import("@angular/core").ModelSignal<number>;
|
22
22
|
/** @ignore */
|
23
23
|
readonly valuesBeforeSlideStart: import("@angular/core").ModelSignal<number[]>;
|
24
|
+
/** @ignore */
|
24
25
|
readonly isSlidingFromLeft: import("@angular/core").Signal<boolean>;
|
26
|
+
/** @ignore */
|
25
27
|
readonly isSlidingFromBottom: import("@angular/core").Signal<boolean>;
|
26
28
|
/** @ignore */
|
27
29
|
thumbElements: HTMLElement[];
|
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "@radix-ng/primitives/visually-hidden";
|
3
3
|
export declare class RdxToggleInputDirective {
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleInputDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleInputDirective, "[rdxToggleInput]", ["rdxToggleInput"], {}, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenInputDirective; inputs: { "name": "name"; "required": "required"; }; outputs: {}; }]>;
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleInputDirective, "[rdxToggleInput]", ["rdxToggleInput"], {}, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenInputDirective; inputs: { "name": "name"; "required": "required"; "value": "value"; }; outputs: {}; }]>;
|
6
6
|
}
|