@radix-ng/primitives 0.51.0 → 1.0.0-beta.1
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/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +123 -0
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +845 -744
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +363 -0
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +172 -0
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +6 -6
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-select.mjs +791 -509
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +39 -18
- package/portal/README.md +2 -0
- package/preview-card/README.md +3 -0
- package/schematics/collection.json +1 -0
- package/schematics/ng-add/index.d.ts +3 -2
- package/schematics/ng-add/index.js +62 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/package-config.d.ts +4 -2
- package/schematics/ng-add/package-config.js +10 -2
- package/schematics/ng-add/package-config.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +14 -0
- package/select/README.md +2 -0
- package/types/radix-ng-primitives-accordion.d.ts +51 -16
- package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
- package/types/radix-ng-primitives-arrow.d.ts +1 -1
- package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
- package/types/radix-ng-primitives-avatar.d.ts +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/types/radix-ng-primitives-calendar.d.ts +39 -20
- package/types/radix-ng-primitives-checkbox.d.ts +204 -35
- package/types/radix-ng-primitives-collapsible.d.ts +114 -40
- package/types/radix-ng-primitives-collection.d.ts +38 -34
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +61 -116
- package/types/radix-ng-primitives-core.d.ts +345 -235
- package/types/radix-ng-primitives-cropper.d.ts +89 -56
- package/types/radix-ng-primitives-date-field.d.ts +49 -28
- package/types/radix-ng-primitives-dialog.d.ts +283 -165
- package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +426 -0
- package/types/radix-ng-primitives-editable.d.ts +91 -14
- package/types/radix-ng-primitives-field.d.ts +374 -0
- package/types/radix-ng-primitives-fieldset.d.ts +49 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/types/radix-ng-primitives-label.d.ts +0 -1
- package/types/radix-ng-primitives-menu.d.ts +584 -99
- package/types/radix-ng-primitives-menubar.d.ts +61 -50
- package/types/radix-ng-primitives-meter.d.ts +194 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
- package/types/radix-ng-primitives-number-field.d.ts +405 -145
- package/types/radix-ng-primitives-pagination.d.ts +2 -2
- package/types/radix-ng-primitives-popover.d.ts +366 -351
- package/types/radix-ng-primitives-popper.d.ts +68 -11
- package/types/radix-ng-primitives-portal.d.ts +14 -6
- package/types/radix-ng-primitives-presence.d.ts +28 -76
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +175 -48
- package/types/radix-ng-primitives-radio.d.ts +55 -25
- package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
- package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
- package/types/radix-ng-primitives-select.d.ts +475 -177
- package/types/radix-ng-primitives-separator.d.ts +7 -32
- package/types/radix-ng-primitives-slider.d.ts +315 -201
- package/types/radix-ng-primitives-stepper.d.ts +5 -7
- package/types/radix-ng-primitives-switch.d.ts +86 -71
- package/types/radix-ng-primitives-tabs.d.ts +213 -79
- package/types/radix-ng-primitives-time-field.d.ts +42 -27
- package/types/radix-ng-primitives-toast.d.ts +378 -0
- package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
- package/types/radix-ng-primitives-toggle.d.ts +43 -53
- package/types/radix-ng-primitives-toolbar.d.ts +164 -38
- package/types/radix-ng-primitives-tooltip.d.ts +348 -384
- package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
- package/dropdown-menu/README.md +0 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
- package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/select2/README.md +0 -3
- package/tooltip2/README.md +0 -3
- package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
- package/types/radix-ng-primitives-hover-card.d.ts +0 -471
- package/types/radix-ng-primitives-select2.d.ts +0 -511
- package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, Provider,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { Type, Provider, InputSignal, WritableSignal, ModelSignal, Signal, InjectionToken, InputSignalWithTransform, OutputRef, ElementRef, Injector, EffectRef, EffectCleanupRegisterFn, CreateEffectOptions } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
+
import { DateValue, Time, CalendarDateTime, ZonedDateTime } from '@internationalized/date';
|
|
5
|
+
|
|
6
|
+
type DataOrientation = 'vertical' | 'horizontal';
|
|
7
|
+
/** Layout direction for bidirectional text. */
|
|
8
|
+
type Direction = 'ltr' | 'rtl';
|
|
9
|
+
/**
|
|
10
|
+
* Nullable from `Type` adds `null` and `undefined`
|
|
11
|
+
*
|
|
12
|
+
* @example ```ts
|
|
13
|
+
* // Expect: string | number | undefined | null
|
|
14
|
+
* type Value = Nulling<string | number>;
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
type Nullable<Type> = null | Type | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* SafeFunction is a type for functions that accept any number of arguments of unknown types
|
|
20
|
+
* and return a value of an unknown type. This is useful when you want to define a function
|
|
21
|
+
* without being strict about the input or output types, maintaining flexibility.
|
|
22
|
+
*
|
|
23
|
+
* @example ```ts
|
|
24
|
+
* const safeFn: SafeFunction = (...args) => {
|
|
25
|
+
* return args.length > 0 ? args[0] : null;
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* const result = safeFn(1, 'hello'); // result: 1
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
type SafeFunction = (...args: unknown[]) => unknown;
|
|
32
|
+
type AcceptableValue = string | number | bigint | Record<string, any> | null;
|
|
33
|
+
/** Type describing the allowed values for a boolean `input()` using `booleanAttribute` coercion. */
|
|
34
|
+
type BooleanInput = string | boolean | null | undefined;
|
|
35
|
+
/** Type describing the allowed values for a number `input()` using `numberAttribute` coercion. */
|
|
36
|
+
type NumberInput = string | number | null | undefined;
|
|
8
37
|
|
|
9
38
|
/**
|
|
10
39
|
* A reusable ControlValueAccessor implementation for form controls
|
|
@@ -83,20 +112,6 @@ declare function injectControlValueAccessor<T>(): RdxControlValueAccessor<T>;
|
|
|
83
112
|
*/
|
|
84
113
|
declare function provideValueAccessor<T>(type: Type<T>): Provider;
|
|
85
114
|
|
|
86
|
-
declare class RdxAutoFocusDirective {
|
|
87
|
-
#private;
|
|
88
|
-
private _autoSelect;
|
|
89
|
-
/**
|
|
90
|
-
* @default false
|
|
91
|
-
*/
|
|
92
|
-
set autoFocus(value: boolean);
|
|
93
|
-
set autoSelect(value: boolean);
|
|
94
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxAutoFocusDirective, never>;
|
|
95
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxAutoFocusDirective, "[rdxAutoFocus]", never, { "autoFocus": { "alias": "rdxAutoFocus"; "required": false; }; "autoSelect": { "alias": "autoSelect"; "required": false; }; }, {}, never, never, true, never>;
|
|
96
|
-
static ngAcceptInputType_autoFocus: unknown;
|
|
97
|
-
static ngAcceptInputType_autoSelect: unknown;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
115
|
/**
|
|
101
116
|
* The `clamp` function restricts a number within a specified range by returning the value itself if it
|
|
102
117
|
* falls within the range, or the closest boundary value if it exceeds the range.
|
|
@@ -136,141 +151,17 @@ declare function roundToStepPrecision(value: number, step: number): number;
|
|
|
136
151
|
*/
|
|
137
152
|
declare function snapValueToStep(value: number, min: number | undefined, max: number | undefined, step: number): number;
|
|
138
153
|
|
|
139
|
-
declare function injectDocument(): Document;
|
|
140
|
-
|
|
141
|
-
declare function elementSize({ elementRef, injector }: {
|
|
142
|
-
elementRef: ElementRef<HTMLElement>;
|
|
143
|
-
injector: Injector;
|
|
144
|
-
}): i0.Signal<{
|
|
145
|
-
width: number;
|
|
146
|
-
height: number;
|
|
147
|
-
}>;
|
|
148
|
-
|
|
149
|
-
declare class RdxFocusInitialDirective {
|
|
150
|
-
/** @ignore */
|
|
151
|
-
private readonly nativeElement;
|
|
152
|
-
/** @ignore */
|
|
153
|
-
focus(): void;
|
|
154
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RdxFocusInitialDirective, never>;
|
|
155
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxFocusInitialDirective, "[rdxFocusInitial]", never, {}, {}, never, never, true, never>;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
declare function getActiveElement(): Element | null;
|
|
159
|
-
|
|
160
|
-
/** Service that generates unique IDs for DOM nodes. */
|
|
161
|
-
declare class _IdGenerator {
|
|
162
|
-
private readonly _appId;
|
|
163
|
-
/**
|
|
164
|
-
* Generates a unique ID with a specific prefix.
|
|
165
|
-
* @param prefix Prefix to add to the ID.
|
|
166
|
-
*/
|
|
167
|
-
getId(prefix: string): string;
|
|
168
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<_IdGenerator, never>;
|
|
169
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<_IdGenerator>;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
declare function injectNgControl(params: {
|
|
173
|
-
optional: true;
|
|
174
|
-
}): FormControlDirective | FormControlName | NgModel | undefined;
|
|
175
|
-
declare function injectNgControl(params: {
|
|
176
|
-
optional: false;
|
|
177
|
-
}): FormControlDirective | FormControlName | NgModel;
|
|
178
|
-
declare function injectNgControl(): FormControlDirective | FormControlName | NgModel;
|
|
179
|
-
|
|
180
|
-
declare function injectIsClient(): boolean;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Compare two objects using reference equality and stable deep hashing.
|
|
184
|
-
* @param {any} object1 First object
|
|
185
|
-
* @param {any} object2 Second object
|
|
186
|
-
* @return {boolean} true if equal and false if not
|
|
187
|
-
*/
|
|
188
|
-
declare function isEqual(object1: any, object2: any): boolean;
|
|
189
|
-
|
|
190
|
-
declare function isInsideForm(el: ElementRef<HTMLElement> | null): boolean;
|
|
191
|
-
|
|
192
|
-
declare function isNullish(value: any): value is null | undefined;
|
|
193
|
-
|
|
194
|
-
declare const isNumber: (v: any) => v is number;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* The function `isValueEqualOrExist` checks if a value is equal to or exists in another value or
|
|
198
|
-
* array.
|
|
199
|
-
* @param {T | T[] | undefined} base - It represents the base value that you want to compare with the `current` value.
|
|
200
|
-
* @param {T | T[] | undefined} current - The `current` parameter represents the current value that you want to compare with the `base` value or values.
|
|
201
|
-
* @returns The `isValueEqualOrExist` function returns a boolean value. It checks if the `base` value
|
|
202
|
-
* is equal to the `current` value or if the `current` value exists within the `base` value. The
|
|
203
|
-
* function handles cases where `base` can be a single value, an array of values, or undefined.
|
|
204
|
-
*/
|
|
205
|
-
declare function isValueEqualOrExist<T>(base: T | T[] | undefined, current: T | T[] | undefined): boolean;
|
|
206
|
-
|
|
207
|
-
declare const ALT = "Alt";
|
|
208
|
-
declare const ARROW_DOWN = "ArrowDown";
|
|
209
|
-
declare const ARROW_LEFT = "ArrowLeft";
|
|
210
|
-
declare const ARROW_RIGHT = "ArrowRight";
|
|
211
|
-
declare const ARROW_UP = "ArrowUp";
|
|
212
|
-
declare const BACKSPACE = "Backspace";
|
|
213
|
-
declare const CAPS_LOCK = "CapsLock";
|
|
214
|
-
declare const CONTROL = "Control";
|
|
215
|
-
declare const DELETE = "Delete";
|
|
216
|
-
declare const END = "End";
|
|
217
|
-
declare const ENTER = "Enter";
|
|
218
|
-
declare const ESCAPE = "Escape";
|
|
219
|
-
declare const F1 = "F1";
|
|
220
|
-
declare const F10 = "F10";
|
|
221
|
-
declare const F11 = "F11";
|
|
222
|
-
declare const F12 = "F12";
|
|
223
|
-
declare const F2 = "F2";
|
|
224
|
-
declare const F3 = "F3";
|
|
225
|
-
declare const F4 = "F4";
|
|
226
|
-
declare const F5 = "F5";
|
|
227
|
-
declare const F6 = "F6";
|
|
228
|
-
declare const F7 = "F7";
|
|
229
|
-
declare const F8 = "F8";
|
|
230
|
-
declare const F9 = "F9";
|
|
231
|
-
declare const HOME = "Home";
|
|
232
|
-
declare const META = "Meta";
|
|
233
|
-
declare const PAGE_DOWN = "PageDown";
|
|
234
|
-
declare const PAGE_UP = "PageUp";
|
|
235
|
-
declare const SHIFT = "Shift";
|
|
236
|
-
declare const SPACE = " ";
|
|
237
|
-
declare const TAB = "Tab";
|
|
238
|
-
declare const CTRL = "Control";
|
|
239
|
-
declare const ASTERISK = "*";
|
|
240
|
-
declare const a = "a";
|
|
241
|
-
declare const P = "P";
|
|
242
|
-
declare const A = "A";
|
|
243
|
-
declare const p = "p";
|
|
244
|
-
declare const n = "n";
|
|
245
|
-
declare const j = "j";
|
|
246
|
-
declare const k = "k";
|
|
247
|
-
declare const SPACE_CODE = "Space";
|
|
248
|
-
|
|
249
154
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* @template T - The type associated with the injection token.
|
|
255
|
-
* @param token - The InjectionToken or abstract type you want to provide.
|
|
256
|
-
* @param type - The class type whose existing instance will be used for this token.
|
|
257
|
-
* @returns A Provider configuration object for Angular's DI system.
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
*
|
|
261
|
-
* @Directive({
|
|
262
|
-
* providers: [
|
|
263
|
-
* provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),
|
|
264
|
-
* provideValueAccessor(RdxToggleGroupDirective)
|
|
265
|
-
* ]
|
|
266
|
-
* })
|
|
267
|
-
* export class RdxToggleGroupDirective {}
|
|
155
|
+
* Retrieves the context value from Angular's dependency injection.
|
|
156
|
+
* Overloaded so the non-optional call returns a non-nullable `T` (no `!` needed),
|
|
157
|
+
* while the optional call may return `null`.
|
|
268
158
|
*/
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
159
|
+
interface InjectContext<T> {
|
|
160
|
+
(): T;
|
|
161
|
+
(optional: false): T;
|
|
162
|
+
(optional: true): T | null;
|
|
163
|
+
(optional?: boolean): T | null;
|
|
164
|
+
}
|
|
274
165
|
/**
|
|
275
166
|
* Creates a context with injector and provider functions for a given type
|
|
276
167
|
* @template T The type of the context value
|
|
@@ -279,7 +170,7 @@ declare function injectWindow(): Window & typeof globalThis;
|
|
|
279
170
|
* - injectContext: Function to retrieve the context value
|
|
280
171
|
* - provideContext: Function to create a provider for the context
|
|
281
172
|
*/
|
|
282
|
-
declare function createContext<T>(description: string): readonly [injectContext:
|
|
173
|
+
declare function createContext<T>(description: string): readonly [injectContext: InjectContext<T>, provideContext: (useFactory: () => T) => Provider];
|
|
283
174
|
|
|
284
175
|
declare const DATE_SEGMENT_PARTS: readonly ["day", "month", "year"];
|
|
285
176
|
declare const TIME_SEGMENT_PARTS: readonly ["hour", "minute", "second", "dayPeriod"];
|
|
@@ -343,6 +234,7 @@ type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj;
|
|
|
343
234
|
type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj;
|
|
344
235
|
type SegmentContentObj = Record<EditableSegmentPart, string>;
|
|
345
236
|
|
|
237
|
+
type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
346
238
|
type CreateMonthProps = {
|
|
347
239
|
/**
|
|
348
240
|
* The date object representing the month's date (usually the first day of the month).
|
|
@@ -697,87 +589,237 @@ declare function handleAndDispatchCustomEvent<E extends CustomEvent, OriginalEve
|
|
|
697
589
|
originalEvent: OriginalEvent;
|
|
698
590
|
} & (E extends CustomEvent<infer D> ? D : never)): void;
|
|
699
591
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Generates unique, SSR-stable IDs for DOM nodes.
|
|
594
|
+
*
|
|
595
|
+
* IDs are deterministic per prefix (a monotonic counter) so the server and the client produce the
|
|
596
|
+
* same sequence and hydration does not mismatch. The application's `APP_ID` is folded into the
|
|
597
|
+
* prefix so multiple Angular apps on one page don't collide; the default `ng` app id is omitted to
|
|
598
|
+
* keep IDs short for the common single-app case.
|
|
599
|
+
*
|
|
600
|
+
* Prefer the {@link injectId} hook at call sites; inject this service directly only when you need to
|
|
601
|
+
* generate IDs lazily outside an injection context.
|
|
602
|
+
*/
|
|
603
|
+
declare class RdxIdGenerator {
|
|
604
|
+
private readonly appId;
|
|
605
|
+
/** Generates a unique ID with the given prefix. */
|
|
606
|
+
getId(prefix: string): string;
|
|
607
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxIdGenerator, never>;
|
|
608
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RdxIdGenerator>;
|
|
705
609
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
610
|
+
/**
|
|
611
|
+
* Returns a unique, SSR-stable ID for the given prefix — the Angular counterpart of React's
|
|
612
|
+
* `useId`. Must be called in an injection context (e.g. a field initializer or constructor).
|
|
613
|
+
*
|
|
614
|
+
* @example
|
|
615
|
+
* readonly contentId = injectId('rdx-dialog-content-');
|
|
616
|
+
*/
|
|
617
|
+
declare function injectId(prefix: string): string;
|
|
618
|
+
|
|
619
|
+
declare const ALT = "Alt";
|
|
620
|
+
declare const ARROW_DOWN = "ArrowDown";
|
|
621
|
+
declare const ARROW_LEFT = "ArrowLeft";
|
|
622
|
+
declare const ARROW_RIGHT = "ArrowRight";
|
|
623
|
+
declare const ARROW_UP = "ArrowUp";
|
|
624
|
+
declare const BACKSPACE = "Backspace";
|
|
625
|
+
declare const CAPS_LOCK = "CapsLock";
|
|
626
|
+
declare const CONTROL = "Control";
|
|
627
|
+
declare const DELETE = "Delete";
|
|
628
|
+
declare const END = "End";
|
|
629
|
+
declare const ENTER = "Enter";
|
|
630
|
+
declare const ESCAPE = "Escape";
|
|
631
|
+
declare const F1 = "F1";
|
|
632
|
+
declare const F10 = "F10";
|
|
633
|
+
declare const F11 = "F11";
|
|
634
|
+
declare const F12 = "F12";
|
|
635
|
+
declare const F2 = "F2";
|
|
636
|
+
declare const F3 = "F3";
|
|
637
|
+
declare const F4 = "F4";
|
|
638
|
+
declare const F5 = "F5";
|
|
639
|
+
declare const F6 = "F6";
|
|
640
|
+
declare const F7 = "F7";
|
|
641
|
+
declare const F8 = "F8";
|
|
642
|
+
declare const F9 = "F9";
|
|
643
|
+
declare const HOME = "Home";
|
|
644
|
+
declare const META = "Meta";
|
|
645
|
+
declare const PAGE_DOWN = "PageDown";
|
|
646
|
+
declare const PAGE_UP = "PageUp";
|
|
647
|
+
declare const SHIFT = "Shift";
|
|
648
|
+
declare const SPACE = " ";
|
|
649
|
+
declare const TAB = "Tab";
|
|
650
|
+
declare const CTRL = "Control";
|
|
651
|
+
declare const ASTERISK = "*";
|
|
652
|
+
declare const a = "a";
|
|
653
|
+
declare const P = "P";
|
|
654
|
+
declare const A = "A";
|
|
655
|
+
declare const p = "p";
|
|
656
|
+
declare const n = "n";
|
|
657
|
+
declare const j = "j";
|
|
658
|
+
declare const k = "k";
|
|
659
|
+
declare const SPACE_CODE = "Space";
|
|
660
|
+
|
|
661
|
+
type AriaLivePoliteness = 'off' | 'polite' | 'assertive';
|
|
662
|
+
/**
|
|
663
|
+
* Announces messages to screen readers through an `aria-live` region, without moving focus.
|
|
664
|
+
*
|
|
665
|
+
* Own replacement for CDK's `LiveAnnouncer` — lazily appends a visually hidden live region to
|
|
666
|
+
* the document body and writes messages into it. No-op on the server.
|
|
667
|
+
*/
|
|
668
|
+
declare class RdxLiveAnnouncer {
|
|
669
|
+
private readonly document;
|
|
670
|
+
private readonly isBrowser;
|
|
671
|
+
private liveElement;
|
|
672
|
+
private previousTimeout;
|
|
673
|
+
constructor();
|
|
674
|
+
/**
|
|
675
|
+
* Announces a message to screen readers.
|
|
676
|
+
*
|
|
677
|
+
* @param message The message to announce.
|
|
678
|
+
* @param politeness The politeness of the announcer element (defaults to `'polite'`).
|
|
679
|
+
* @param duration If provided, the message is cleared after this many milliseconds.
|
|
680
|
+
*/
|
|
681
|
+
announce(message: string, politeness?: AriaLivePoliteness, duration?: number): void;
|
|
682
|
+
/** Clears the current announcement. */
|
|
683
|
+
clear(): void;
|
|
684
|
+
private getLiveElement;
|
|
685
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxLiveAnnouncer, never>;
|
|
686
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RdxLiveAnnouncer>;
|
|
710
687
|
}
|
|
711
|
-
type RdxPositionSideAndAlign = {
|
|
712
|
-
side: RdxPositionSide;
|
|
713
|
-
align: RdxPositionAlign;
|
|
714
|
-
};
|
|
715
|
-
type RdxPositionSideAndAlignOffsets = {
|
|
716
|
-
sideOffset: number;
|
|
717
|
-
alignOffset: number;
|
|
718
|
-
};
|
|
719
|
-
type RdxPositions = Readonly<{
|
|
720
|
-
[key in RdxPositionSide]: Readonly<{
|
|
721
|
-
[key in RdxPositionAlign]: Readonly<ConnectionPositionPair>;
|
|
722
|
-
}>;
|
|
723
|
-
}>;
|
|
724
|
-
type RdxPositioningDefaults = Readonly<{
|
|
725
|
-
offsets: Readonly<{
|
|
726
|
-
side: number;
|
|
727
|
-
align: number;
|
|
728
|
-
}>;
|
|
729
|
-
arrow: Readonly<{
|
|
730
|
-
width: number;
|
|
731
|
-
height: number;
|
|
732
|
-
}>;
|
|
733
|
-
}>;
|
|
734
|
-
type RdxAllPossibleConnectedPositions = ReadonlyMap<`${RdxPositionSide}|${RdxPositionAlign}`, ConnectionPositionPair>;
|
|
735
|
-
type RdxArrowPositionParams = {
|
|
736
|
-
top: string;
|
|
737
|
-
left: string;
|
|
738
|
-
transform: string;
|
|
739
|
-
transformOrigin: string;
|
|
740
|
-
};
|
|
741
688
|
|
|
742
|
-
|
|
743
|
-
declare
|
|
689
|
+
/** Narrows to `null | undefined`. */
|
|
690
|
+
declare function isNullish(value: any): value is null | undefined;
|
|
691
|
+
/**
|
|
692
|
+
* Structural equality for the value shapes a primitive can hold: primitives (incl. `NaN`), arrays,
|
|
693
|
+
* plain objects, and the common built-ins `Date`, `RegExp`, `Map`, and `Set`. Reference cycles are
|
|
694
|
+
* handled. Other opaque objects (e.g. class instances with no own enumerable properties) fall back
|
|
695
|
+
* to per-key comparison and so only match when they expose equal enumerable state.
|
|
696
|
+
*/
|
|
697
|
+
declare function isEqual(a: any, b: any): boolean;
|
|
744
698
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
699
|
+
/**
|
|
700
|
+
* Creates an Angular provider that binds the given token to the existing instance
|
|
701
|
+
* of the specified class. This is especially useful when you want multiple
|
|
702
|
+
* tokens (or interfaces) to resolve to the same directive/component instance.
|
|
703
|
+
*
|
|
704
|
+
* @template T - The type associated with the injection token.
|
|
705
|
+
* @param token - The InjectionToken or abstract type you want to provide.
|
|
706
|
+
* @param type - The class type whose existing instance will be used for this token.
|
|
707
|
+
* @returns A Provider configuration object for Angular's DI system.
|
|
708
|
+
*
|
|
709
|
+
* @example
|
|
710
|
+
*
|
|
711
|
+
* @Directive({
|
|
712
|
+
* providers: [
|
|
713
|
+
* provideToken(RdxFooToken, RdxFooDirective),
|
|
714
|
+
* provideValueAccessor(RdxFooDirective)
|
|
715
|
+
* ]
|
|
716
|
+
* })
|
|
717
|
+
* export class RdxFooDirective {}
|
|
718
|
+
*/
|
|
719
|
+
declare function provideToken<T>(token: InjectionToken<T>, type: Type<unknown>): Provider;
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Local mirror of Angular Signal Forms' control contracts
|
|
723
|
+
* (`@angular/forms/signals`, stable in Angular 22).
|
|
724
|
+
*
|
|
725
|
+
* These interfaces intentionally do **not** import from `@angular/forms/signals`
|
|
726
|
+
* so primitives can declare `implements RdxFormValueControl<T>` /
|
|
727
|
+
* `implements RdxFormCheckboxControl` while the library baseline is still on
|
|
728
|
+
* Angular 21, where the real API is experimental. They mirror Angular's contract
|
|
729
|
+
* closely enough to lock the public surface (the required `value` / `checked`
|
|
730
|
+
* signal) and catch naming regressions on CI — e.g. a rewrite renaming
|
|
731
|
+
* `value` → `modelValue` (as the slider once had) would no longer type-check.
|
|
732
|
+
*
|
|
733
|
+
* Optional state types are widened only where Radix NG controls legitimately
|
|
734
|
+
* differ from Angular's exact types (e.g. `input<string>()` produces
|
|
735
|
+
* `string | undefined`, and boolean inputs carry a coercion transform).
|
|
736
|
+
*
|
|
737
|
+
* Replace with the real imports once the baseline moves to Angular 22.
|
|
738
|
+
* See `.claude/skills/project-knowledge/references/signal-forms-readiness.md`.
|
|
739
|
+
*/
|
|
740
|
+
/** An optional control-state member exposed as an Angular input signal (with or without a coercion transform). */
|
|
741
|
+
type RdxFormStateInput<T> = InputSignal<T> | InputSignalWithTransform<T, any>;
|
|
742
|
+
/**
|
|
743
|
+
* Minimal stand-in for Angular's `ValidationError`. The real type is a tagged
|
|
744
|
+
* union (`RequiredValidationError`, `PatternValidationError`, …); this keeps a
|
|
745
|
+
* shared shape until the v22 type is available.
|
|
746
|
+
*/
|
|
747
|
+
interface RdxValidationError {
|
|
748
|
+
readonly kind: string;
|
|
749
|
+
readonly message?: string;
|
|
750
|
+
}
|
|
751
|
+
/** Optional state shared by value and checkbox controls (mirror of Angular's `FormUiControl`). */
|
|
752
|
+
interface RdxFormUiControl {
|
|
753
|
+
readonly disabled?: RdxFormStateInput<boolean>;
|
|
754
|
+
readonly readonly?: RdxFormStateInput<boolean>;
|
|
755
|
+
readonly required?: RdxFormStateInput<boolean>;
|
|
756
|
+
readonly invalid?: RdxFormStateInput<boolean>;
|
|
757
|
+
readonly hidden?: RdxFormStateInput<boolean>;
|
|
758
|
+
readonly pending?: RdxFormStateInput<boolean>;
|
|
759
|
+
readonly touched?: RdxFormStateInput<boolean>;
|
|
760
|
+
readonly dirty?: RdxFormStateInput<boolean>;
|
|
761
|
+
readonly name?: RdxFormStateInput<string | undefined>;
|
|
762
|
+
readonly errors?: RdxFormStateInput<readonly RdxValidationError[]>;
|
|
763
|
+
readonly minLength?: RdxFormStateInput<number | undefined>;
|
|
764
|
+
readonly maxLength?: RdxFormStateInput<number | undefined>;
|
|
765
|
+
readonly pattern?: RdxFormStateInput<readonly RegExp[]>;
|
|
766
|
+
/** Notifies the form that the control was touched (mirror of Angular's `touch` output). */
|
|
767
|
+
readonly touch?: OutputRef<void>;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Mirror of `FormValueControl<TValue>` — a control that edits a single value via
|
|
771
|
+
* `value = model<TValue>()`. It must **not** expose `checked`.
|
|
772
|
+
*/
|
|
773
|
+
interface RdxFormValueControl<TValue> extends RdxFormUiControl {
|
|
774
|
+
readonly value: ModelSignal<TValue>;
|
|
775
|
+
readonly checked?: undefined;
|
|
776
|
+
readonly min?: RdxFormStateInput<NonNullable<TValue> | undefined>;
|
|
777
|
+
readonly max?: RdxFormStateInput<NonNullable<TValue> | undefined>;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Mirror of `FormCheckboxControl` — a control that toggles via
|
|
781
|
+
* `checked = model<boolean>()`. It must **not** expose `value`.
|
|
782
|
+
*/
|
|
783
|
+
interface RdxFormCheckboxControl extends RdxFormUiControl {
|
|
784
|
+
readonly checked: ModelSignal<boolean>;
|
|
785
|
+
readonly value?: undefined;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
declare function injectDocument(): Document;
|
|
789
|
+
|
|
790
|
+
declare function elementSize({ elementRef, injector }: {
|
|
791
|
+
elementRef: ElementRef<HTMLElement>;
|
|
792
|
+
injector: Injector;
|
|
793
|
+
}): i0.Signal<{
|
|
752
794
|
width: number;
|
|
753
795
|
height: number;
|
|
754
|
-
}
|
|
796
|
+
}>;
|
|
797
|
+
|
|
798
|
+
declare function getActiveElement(): Element | null;
|
|
755
799
|
|
|
756
|
-
type DataOrientation = 'vertical' | 'horizontal';
|
|
757
800
|
/**
|
|
758
|
-
*
|
|
801
|
+
* Creates a resize observer effect for element
|
|
759
802
|
*
|
|
760
|
-
* @
|
|
761
|
-
*
|
|
762
|
-
*
|
|
763
|
-
*
|
|
803
|
+
* @param options Configuration options
|
|
804
|
+
* @param options.injector Angular injector
|
|
805
|
+
* @param options.element Signal returning the element to observe
|
|
806
|
+
* @param options.onResize Callback when element is resized
|
|
807
|
+
* @returns EffectRef that can be destroyed when needed
|
|
764
808
|
*/
|
|
765
|
-
|
|
809
|
+
declare function resizeEffect(options: {
|
|
810
|
+
injector: Injector;
|
|
811
|
+
element: Signal<ElementRef | HTMLElement | null | undefined>;
|
|
812
|
+
onResize: ResizeObserverCallback;
|
|
813
|
+
}): EffectRef;
|
|
814
|
+
|
|
766
815
|
/**
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* without being strict about the input or output types, maintaining flexibility.
|
|
770
|
-
*
|
|
771
|
-
* @example ```ts
|
|
772
|
-
* const safeFn: SafeFunction = (...args) => {
|
|
773
|
-
* return args.length > 0 ? args[0] : null;
|
|
774
|
-
* };
|
|
816
|
+
* Locks `document.body` scrolling while `active()` is `true`, and restores the original overflow
|
|
817
|
+
* when it becomes `false` or the calling context is destroyed.
|
|
775
818
|
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
819
|
+
* Lock ownership is shared across all callers via a single module-level counter, so nested or
|
|
820
|
+
* concurrent overlays compose correctly. Must be called in an injection context.
|
|
778
821
|
*/
|
|
779
|
-
|
|
780
|
-
type AcceptableValue = string | number | bigint | Record<string, any> | null;
|
|
822
|
+
declare function useScrollLock(active: Signal<boolean>): void;
|
|
781
823
|
|
|
782
824
|
type ArrowKeyOptions = 'horizontal' | 'vertical' | 'both';
|
|
783
825
|
interface ArrowNavigationOptions {
|
|
@@ -844,19 +886,75 @@ interface ArrowNavigationOptions {
|
|
|
844
886
|
declare function useArrowNavigation(e: KeyboardEvent, currentElement: HTMLElement, parentElement: HTMLElement | undefined, options?: ArrowNavigationOptions): HTMLElement | null;
|
|
845
887
|
|
|
846
888
|
/**
|
|
847
|
-
*
|
|
889
|
+
* Keeps hover content open while the pointer crosses the gap between a trigger and a popup.
|
|
890
|
+
*/
|
|
891
|
+
declare function useGraceArea(triggerEl: Signal<HTMLElement | null | undefined>, containerEl: Signal<HTMLElement | null | undefined>, resetMs?: number): {
|
|
892
|
+
isPointerInTransit: Signal<boolean>;
|
|
893
|
+
onPointerExit: (callback: (value: void) => void) => () => void;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
interface RdxPointerDragHandlers {
|
|
897
|
+
/** Whether a press may begin a drag (e.g. enabled, not on an opt-out element, at a scroll edge). */
|
|
898
|
+
canStart: (event: PointerEvent) => boolean;
|
|
899
|
+
/** A drag actually began (the pointer moved past the start threshold). */
|
|
900
|
+
onStart: (event: PointerEvent) => void;
|
|
901
|
+
/** Pointer moved during a drag. Return `false` to end the gesture early (treated as not committed). */
|
|
902
|
+
onMove: (event: PointerEvent) => void | boolean;
|
|
903
|
+
/** The drag ended. `committed` is true only for a normal `pointerup`, false for cancel/lost-capture/early-stop. */
|
|
904
|
+
onEnd: (event: PointerEvent, committed: boolean) => void;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Shared pointer-drag lifecycle for gesture primitives (drawer swipe, toast swipe, etc.).
|
|
848
908
|
*
|
|
849
|
-
* @
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*
|
|
909
|
+
* A press only becomes a drag once the pointer moves past {@link DRAG_THRESHOLD}; until then it is a
|
|
910
|
+
* plain tap, so clicks on buttons inside the element keep working (the gesture never captures the
|
|
911
|
+
* pointer for a tap). Once dragging, the pointer is captured so a drag that leaves the element still
|
|
912
|
+
* completes, and `lostpointercapture` / `pointercancel` count as a non-committed end — a swallowed
|
|
913
|
+
* `pointerup` (native context menu, OS gesture, tab switch) can never wedge the gesture. Only the
|
|
914
|
+
* primary pointer is tracked, so a second finger can't start a parallel gesture. No-op outside the
|
|
915
|
+
* browser, keeping SSR safe.
|
|
916
|
+
*
|
|
917
|
+
* `onEnd` is NOT called if the host is destroyed mid-drag — callers that pair `onStart`/`onEnd`
|
|
918
|
+
* (e.g. to pause/resume timers) should balance that case in their own `DestroyRef` cleanup.
|
|
919
|
+
*
|
|
920
|
+
* Must be called from an injection context (a directive/component constructor).
|
|
854
921
|
*/
|
|
855
|
-
declare function
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
922
|
+
declare function usePointerDrag(handlers: RdxPointerDragHandlers): void;
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Lifecycle phase of an open/close transition.
|
|
926
|
+
*
|
|
927
|
+
* - `'starting'` — the part has just mounted/opened; the enter animation is about to run.
|
|
928
|
+
* - `'ending'` — the part is closing; the exit animation is running.
|
|
929
|
+
* - `undefined` — settled (no transition in progress).
|
|
930
|
+
*/
|
|
931
|
+
type RdxTransitionStatus = 'starting' | 'ending' | undefined;
|
|
932
|
+
interface RdxTransitionStatusRef {
|
|
933
|
+
/** Reactive transition phase, intended for `data-starting-style` / `data-ending-style` bindings. */
|
|
934
|
+
readonly status: Signal<RdxTransitionStatus>;
|
|
935
|
+
/**
|
|
936
|
+
* Registers the element whose CSS transition/animation duration determines when the close
|
|
937
|
+
* transition is considered complete. Returns a cleanup that unregisters it.
|
|
938
|
+
*/
|
|
939
|
+
registerElement: (element: HTMLElement) => () => void;
|
|
940
|
+
/** Drives a new transition for the given open state. Cancels any in-flight transition. */
|
|
941
|
+
start: (open: boolean) => void;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Shared open/close transition state machine used by overlay primitives (dialog, popover, …).
|
|
945
|
+
*
|
|
946
|
+
* On `start(open)` it flips `status` to `'starting'`/`'ending'`, then — after the next render and
|
|
947
|
+
* (for opening) one animation frame — clears it and waits for the registered element's running CSS
|
|
948
|
+
* animations/transitions to finish (via the Web Animations API) before invoking `onComplete(open)`.
|
|
949
|
+
* Completing on the real `animationend` rather than a duration timer keeps it from firing a frame
|
|
950
|
+
* late. A duration-based timer remains as a safety net, and if no element is registered or it has no
|
|
951
|
+
* animation (also SSR / jsdom, where computed durations are `0`) completion is synchronous.
|
|
952
|
+
*
|
|
953
|
+
* Must be called in an injection context (uses {@link Injector} and {@link DestroyRef}).
|
|
954
|
+
*/
|
|
955
|
+
declare function useTransitionStatus(onComplete: (open: boolean) => void): RdxTransitionStatusRef;
|
|
956
|
+
/** Longest of an element's CSS transition / animation durations (including delays), in milliseconds. */
|
|
957
|
+
declare function getMaxTransitionDuration(element: HTMLElement): number;
|
|
860
958
|
|
|
861
959
|
/**
|
|
862
960
|
* We want to have the Tuple in order to use the types in the function signature
|
|
@@ -898,5 +996,17 @@ declare interface CreateExplicitEffectOptions extends CreateEffectOptions {
|
|
|
898
996
|
*/
|
|
899
997
|
declare function watch<Input extends readonly unknown[], Params = Input>(deps: readonly [...ExplicitEffectValues<Input>], fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void, options?: CreateExplicitEffectOptions | undefined): EffectRef;
|
|
900
998
|
|
|
901
|
-
|
|
902
|
-
|
|
999
|
+
declare enum RdxPositionSide {
|
|
1000
|
+
Top = "top",
|
|
1001
|
+
Right = "right",
|
|
1002
|
+
Bottom = "bottom",
|
|
1003
|
+
Left = "left"
|
|
1004
|
+
}
|
|
1005
|
+
declare enum RdxPositionAlign {
|
|
1006
|
+
Start = "start",
|
|
1007
|
+
Center = "center",
|
|
1008
|
+
End = "end"
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RdxControlValueAccessor, RdxIdGenerator, RdxLiveAnnouncer, RdxPositionAlign, RdxPositionSide, SHIFT, SPACE, SPACE_CODE, TAB, a, areAllDaysBetweenValid, clamp, createContent, createContext, createFormatter, createMonth, createMonths, elementSize, getActiveElement, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMaxTransitionDuration, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectId, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isNullish, isNumberString, isSegmentNavigationKey, isZonedDateTime, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideToken, provideValueAccessor, resizeEffect, roundToStepPrecision, segmentBuilders, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useArrowNavigation, useDateField, useGraceArea, usePointerDrag, useScrollLock, useTransitionStatus, watch };
|
|
1012
|
+
export type { AcceptableValue, AnyExceptLiteral, AriaLivePoliteness, BooleanInput, CreateMonthProps, DataOrientation, DateAndTimeSegmentObj, DateFormatterOptions, DateMatcher, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DayPeriod, Direction, EditableSegmentPart, Formatter, Granularity, HourCycle, InjectContext, Month, NonEditableSegmentPart, Nullable, NumberInput, PlaceholderMap, RdxFormCheckboxControl, RdxFormStateInput, RdxFormUiControl, RdxFormValueControl, RdxPointerDragHandlers, RdxTransitionStatus, RdxTransitionStatusRef, RdxValidationError, SafeFunction, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps };
|