@radix-ng/primitives 1.0.0-beta.4 → 1.0.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/composite/README.md +3 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +12 -36
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +33 -18
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +515 -0
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-core.mjs +7 -0
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +54 -12
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +12 -7
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +294 -8
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +9 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +71 -20
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +68 -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-number-field.mjs +7 -2
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +117 -35
- 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 +77 -36
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +40 -8
- package/fesm2022/radix-ng-primitives-roving-focus.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 +62 -37
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +259 -28
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +11 -7
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +10 -5
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +64 -30
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +69 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +37 -13
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +50 -24
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +180 -35
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/navigation-menu/README.md +5 -2
- package/package.json +5 -1
- package/types/radix-ng-primitives-accordion.d.ts +9 -13
- package/types/radix-ng-primitives-checkbox.d.ts +27 -15
- package/types/radix-ng-primitives-composite.d.ts +152 -0
- package/types/radix-ng-primitives-core.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +13 -2
- package/types/radix-ng-primitives-drawer.d.ts +40 -2
- package/types/radix-ng-primitives-editable.d.ts +11 -5
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +113 -16
- package/types/radix-ng-primitives-menu.d.ts +13 -5
- package/types/radix-ng-primitives-menubar.d.ts +10 -5
- package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
- package/types/radix-ng-primitives-number-field.d.ts +8 -3
- package/types/radix-ng-primitives-popover.d.ts +26 -10
- package/types/radix-ng-primitives-popper.d.ts +1 -0
- package/types/radix-ng-primitives-radio.d.ts +22 -13
- package/types/radix-ng-primitives-roving-focus.d.ts +15 -1
- package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
- package/types/radix-ng-primitives-select.d.ts +16 -20
- package/types/radix-ng-primitives-slider.d.ts +60 -9
- package/types/radix-ng-primitives-stepper.d.ts +11 -4
- package/types/radix-ng-primitives-switch.d.ts +10 -4
- package/types/radix-ng-primitives-tabs.d.ts +20 -11
- package/types/radix-ng-primitives-toggle-group.d.ts +34 -17
- package/types/radix-ng-primitives-toggle.d.ts +14 -7
- package/types/radix-ng-primitives-toolbar.d.ts +22 -14
- package/types/radix-ng-primitives-tooltip.d.ts +38 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal } from '@angular/core';
|
|
3
3
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
-
import { RdxControlValueAccessor, NumberInput, BooleanInput } from '@radix-ng/primitives/core';
|
|
4
|
+
import { RdxControlValueAccessor, NumberInput, BooleanInput, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
5
5
|
export { clamp } from '@radix-ng/primitives/core';
|
|
6
6
|
import * as _radix_ng_primitives_slider from '@radix-ng/primitives/slider';
|
|
7
7
|
|
|
@@ -18,6 +18,8 @@ declare function getMidpoint(element: Element): {
|
|
|
18
18
|
x: number;
|
|
19
19
|
y: number;
|
|
20
20
|
};
|
|
21
|
+
/** Calculates the control-relative percent for an edge-aligned thumb. */
|
|
22
|
+
declare function getInsetThumbPositionPercent(control: Element, thumb: Element, thumbValuePercent: number, vertical: boolean): number | undefined;
|
|
21
23
|
/** Converts an array of values into clamped 0–100 percentages. */
|
|
22
24
|
declare function valueArrayToPercentages(values: readonly number[], min: number, max: number): number[];
|
|
23
25
|
/** Number of decimal places in `num`, handling exponential notation for tiny values. */
|
|
@@ -90,6 +92,25 @@ declare const ALL_KEYS: Set<string>;
|
|
|
90
92
|
declare function areValuesEqual(a: number | number[], b: number | number[]): boolean;
|
|
91
93
|
|
|
92
94
|
type SliderValue = number | number[];
|
|
95
|
+
type RdxSliderThumbAlignment = 'center' | 'edge' | 'edge-client-only';
|
|
96
|
+
type RdxSliderValueChangeReason = 'input-change' | 'track-press' | 'drag' | 'keyboard' | 'none';
|
|
97
|
+
type RdxSliderValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxSliderValueChangeReason> & {
|
|
98
|
+
activeThumbIndex: number;
|
|
99
|
+
};
|
|
100
|
+
type RdxSliderValueCommitReason = RdxSliderValueChangeReason;
|
|
101
|
+
interface RdxSliderValueCommitEventDetails {
|
|
102
|
+
reason: RdxSliderValueCommitReason;
|
|
103
|
+
event: Event;
|
|
104
|
+
trigger: HTMLElement | undefined;
|
|
105
|
+
}
|
|
106
|
+
interface RdxSliderValueChangeEvent {
|
|
107
|
+
value: SliderValue;
|
|
108
|
+
eventDetails: RdxSliderValueChangeEventDetails;
|
|
109
|
+
}
|
|
110
|
+
interface RdxSliderValueCommitEvent {
|
|
111
|
+
value: SliderValue;
|
|
112
|
+
eventDetails: RdxSliderValueCommitEventDetails;
|
|
113
|
+
}
|
|
93
114
|
/** Minimal shape a thumb registers with the root, used for hit-testing and focus. */
|
|
94
115
|
interface RdxSliderThumbRef {
|
|
95
116
|
/** The thumb wrapper element. */
|
|
@@ -109,6 +130,7 @@ interface RdxSliderThumbRef {
|
|
|
109
130
|
declare class RdxSliderRoot {
|
|
110
131
|
/** @ignore */
|
|
111
132
|
protected readonly cva: RdxControlValueAccessor<SliderValue>;
|
|
133
|
+
private readonly document;
|
|
112
134
|
readonly id: _angular_core.InputSignal<string>;
|
|
113
135
|
/**
|
|
114
136
|
* The minimum value of the slider.
|
|
@@ -151,6 +173,13 @@ declare class RdxSliderRoot {
|
|
|
151
173
|
* @default 'push'
|
|
152
174
|
*/
|
|
153
175
|
readonly thumbCollisionBehavior: _angular_core.InputSignal<ThumbCollisionBehavior>;
|
|
176
|
+
/**
|
|
177
|
+
* How the thumbs align with the control when the value is at min/max.
|
|
178
|
+
* `center` aligns the thumb center to the control edge; `edge`/`edge-client-only`
|
|
179
|
+
* inset thumbs so their outer edge aligns to the control edge.
|
|
180
|
+
* @default 'center'
|
|
181
|
+
*/
|
|
182
|
+
readonly thumbAlignment: _angular_core.InputSignal<RdxSliderThumbAlignment>;
|
|
154
183
|
/** Options forwarded to `Intl.NumberFormat` when displaying and announcing values. */
|
|
155
184
|
readonly format: _angular_core.InputSignal<Intl.NumberFormatOptions | undefined>;
|
|
156
185
|
/** Locale used for value formatting. */
|
|
@@ -170,9 +199,9 @@ declare class RdxSliderRoot {
|
|
|
170
199
|
readonly value: _angular_core.ModelSignal<SliderValue | undefined>;
|
|
171
200
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
172
201
|
/** Emitted when the value changes (during interaction). */
|
|
173
|
-
readonly onValueChange: _angular_core.OutputEmitterRef<
|
|
202
|
+
readonly onValueChange: _angular_core.OutputEmitterRef<RdxSliderValueChangeEvent>;
|
|
174
203
|
/** Emitted when interaction ends, with the final value — useful for committing to a backend. */
|
|
175
|
-
readonly onValueCommitted: _angular_core.OutputEmitterRef<
|
|
204
|
+
readonly onValueCommitted: _angular_core.OutputEmitterRef<RdxSliderValueCommitEvent>;
|
|
176
205
|
/** @ignore */
|
|
177
206
|
readonly controlRef: _angular_core.WritableSignal<HTMLElement | null>;
|
|
178
207
|
/** @ignore Active thumb index (-1 when none). */
|
|
@@ -181,6 +210,8 @@ declare class RdxSliderRoot {
|
|
|
181
210
|
readonly lastUsedThumbIndex: _angular_core.WritableSignal<number>;
|
|
182
211
|
/** @ignore Whether a pointer drag is in progress. */
|
|
183
212
|
readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
213
|
+
/** @ignore Edge-aligned thumb/indicator positions, in control-relative percentages. */
|
|
214
|
+
readonly indicatorPosition: _angular_core.WritableSignal<[number | undefined, number | undefined]>;
|
|
184
215
|
/** @ignore Pointer-drag scratch state (not reactive). */
|
|
185
216
|
pressedThumbIndex: number;
|
|
186
217
|
/** @ignore */
|
|
@@ -192,7 +223,13 @@ declare class RdxSliderRoot {
|
|
|
192
223
|
/** @ignore */
|
|
193
224
|
lastChangeReason: string;
|
|
194
225
|
/** @ignore */
|
|
226
|
+
lastChangeEvent: Event | undefined;
|
|
227
|
+
/** @ignore */
|
|
195
228
|
readonly isDisabled: Signal<boolean>;
|
|
229
|
+
/** @ignore */
|
|
230
|
+
readonly inset: Signal<boolean>;
|
|
231
|
+
/** @ignore */
|
|
232
|
+
readonly renderBeforeHydration: Signal<boolean>;
|
|
196
233
|
/** @ignore The current value source (controlled value, else default, else min). */
|
|
197
234
|
private readonly currentRaw;
|
|
198
235
|
/** Whether the slider has multiple thumbs (the value is an array). */
|
|
@@ -213,6 +250,8 @@ declare class RdxSliderRoot {
|
|
|
213
250
|
/** @ignore */
|
|
214
251
|
focusThumb(index: number): void;
|
|
215
252
|
/** @ignore */
|
|
253
|
+
setIndicatorPosition(index: number, position: number | undefined): void;
|
|
254
|
+
/** @ignore */
|
|
216
255
|
formatValue(value: number): string;
|
|
217
256
|
/** @ignore Output value matching the original value shape (number vs array). */
|
|
218
257
|
private outputValue;
|
|
@@ -221,19 +260,21 @@ declare class RdxSliderRoot {
|
|
|
221
260
|
* Applies a new full set of values, preserving the single/range value shape.
|
|
222
261
|
* Returns `false` when the value did not change.
|
|
223
262
|
*/
|
|
224
|
-
setValue(nextValues: number[], reason:
|
|
263
|
+
setValue(nextValues: number[], reason: RdxSliderValueChangeReason, event?: Event, activeThumbIndex?: number): boolean;
|
|
225
264
|
/** @ignore Keyboard / native input path: clamps to neighbours, commits immediately. */
|
|
226
|
-
handleInputChange(valueInput: number, index: number, reason?:
|
|
265
|
+
handleInputChange(valueInput: number, index: number, reason?: RdxSliderValueChangeReason, event?: Event): void;
|
|
227
266
|
/** @ignore Emits the committed value at the end of a pointer drag. */
|
|
228
|
-
commitValue(): void;
|
|
267
|
+
commitValue(event?: Event, reason?: RdxSliderValueCommitReason): void;
|
|
229
268
|
/** @ignore */
|
|
230
269
|
markAsTouched(): void;
|
|
231
270
|
/** @ignore */
|
|
232
271
|
setDragging(dragging: boolean): void;
|
|
233
272
|
/** @ignore */
|
|
234
273
|
resetPressedThumb(): void;
|
|
274
|
+
/** @ignore */
|
|
275
|
+
getOwnerWindow(): Window | undefined;
|
|
235
276
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderRoot, never>;
|
|
236
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderRoot, "div[rdxSliderRoot]", ["rdxSliderRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "minStepsBetweenValues": { "alias": "minStepsBetweenValues"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "thumbCollisionBehavior": { "alias": "thumbCollisionBehavior"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; "onValueCommitted": "onValueCommitted"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "value"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
277
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderRoot, "div[rdxSliderRoot]", ["rdxSliderRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "minStepsBetweenValues": { "alias": "minStepsBetweenValues"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "thumbCollisionBehavior": { "alias": "thumbCollisionBehavior"; "required": false; "isSignal": true; }; "thumbAlignment": { "alias": "thumbAlignment"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; "onValueCommitted": "onValueCommitted"; }, never, never, true, [{ directive: typeof _radix_ng_primitives_core.RdxControlValueAccessor; inputs: { "value": "value"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
237
278
|
}
|
|
238
279
|
|
|
239
280
|
/**
|
|
@@ -249,14 +290,22 @@ declare class RdxSliderControl {
|
|
|
249
290
|
private styles;
|
|
250
291
|
private moveCount;
|
|
251
292
|
private currentInteractionValue;
|
|
293
|
+
private touchId;
|
|
294
|
+
private insetThumbOffset;
|
|
295
|
+
private readonly onTouchStart;
|
|
252
296
|
private readonly onMove;
|
|
253
297
|
private readonly onUp;
|
|
254
298
|
private readonly onCancel;
|
|
299
|
+
private readonly onTouchMove;
|
|
300
|
+
private readonly onTouchEnd;
|
|
255
301
|
constructor();
|
|
256
302
|
protected onPointerDown(event: PointerEvent): void;
|
|
303
|
+
private handleTouchStart;
|
|
257
304
|
private handleMove;
|
|
258
305
|
private handleUp;
|
|
259
306
|
private stopListening;
|
|
307
|
+
private getFingerCoords;
|
|
308
|
+
private isTargetDisabledThumb;
|
|
260
309
|
private startPressing;
|
|
261
310
|
private setValueFromPointer;
|
|
262
311
|
/** Projects a pointer position onto the track and resolves it to a value (+ collision). */
|
|
@@ -311,8 +360,10 @@ declare class RdxSliderThumb implements RdxSliderThumbRef {
|
|
|
311
360
|
/** The value represented by this thumb. */
|
|
312
361
|
readonly value: _angular_core.Signal<number | undefined>;
|
|
313
362
|
private readonly percent;
|
|
363
|
+
private readonly insetPosition;
|
|
314
364
|
protected readonly thumbStyle: _angular_core.Signal<Record<string, string | number>>;
|
|
315
365
|
constructor();
|
|
366
|
+
private updateInsetPosition;
|
|
316
367
|
protected onPointerDown(event: PointerEvent): void;
|
|
317
368
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderThumb, never>;
|
|
318
369
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderThumb, "div[rdxSliderThumb]", ["rdxSliderThumb"], { "indexInput": { "alias": "index"; "required": false; "isSignal": true; }; "thumbDisabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -374,5 +425,5 @@ declare class RdxSliderModule {
|
|
|
374
425
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxSliderModule>;
|
|
375
426
|
}
|
|
376
427
|
|
|
377
|
-
export { ALL_KEYS, ARROW_KEYS, COMPOSITE_KEYS, RdxSliderControl, RdxSliderIndicator, RdxSliderModule, RdxSliderRoot, RdxSliderThumb, RdxSliderThumbInput, RdxSliderTrack, RdxSliderValue, areValuesEqual, asc, formatNumber, getControlOffset, getDecimalPrecision, getDefaultAriaValueText, getMidpoint, getNewValue, getPushedThumbValues, getSliderValue, injectSliderRootContext, provideSliderRootContext, replaceArrayItemAtIndex, resolveThumbCollision, roundValueToStep, validateMinimumDistance, valueArrayToPercentages, valueToPercent };
|
|
378
|
-
export type { RdxSliderThumbRef, ResolveThumbCollisionParams, ResolveThumbCollisionResult, SliderOrientation, SliderValue, ThumbCollisionBehavior };
|
|
428
|
+
export { ALL_KEYS, ARROW_KEYS, COMPOSITE_KEYS, RdxSliderControl, RdxSliderIndicator, RdxSliderModule, RdxSliderRoot, RdxSliderThumb, RdxSliderThumbInput, RdxSliderTrack, RdxSliderValue, areValuesEqual, asc, formatNumber, getControlOffset, getDecimalPrecision, getDefaultAriaValueText, getInsetThumbPositionPercent, getMidpoint, getNewValue, getPushedThumbValues, getSliderValue, injectSliderRootContext, provideSliderRootContext, replaceArrayItemAtIndex, resolveThumbCollision, roundValueToStep, validateMinimumDistance, valueArrayToPercentages, valueToPercent };
|
|
429
|
+
export type { RdxSliderThumbAlignment, RdxSliderThumbRef, RdxSliderValueChangeEvent, RdxSliderValueChangeEventDetails, RdxSliderValueChangeReason, RdxSliderValueCommitEvent, RdxSliderValueCommitEventDetails, RdxSliderValueCommitReason, ResolveThumbCollisionParams, ResolveThumbCollisionResult, SliderOrientation, SliderValue, ThumbCollisionBehavior };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { InputSignalWithTransform, Signal, ModelSignal, InputSignal, WritableSignal, InjectionToken } from '@angular/core';
|
|
3
|
-
import { NumberInput, BooleanInput, Direction } from '@radix-ng/primitives/core';
|
|
3
|
+
import { NumberInput, BooleanInput, Direction, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
4
4
|
import * as _radix_ng_primitives_stepper from '@radix-ng/primitives/stepper';
|
|
5
5
|
import * as i1 from '@radix-ng/primitives/separator';
|
|
6
6
|
|
|
@@ -66,10 +66,17 @@ interface StepperRootContext {
|
|
|
66
66
|
dir: Signal<Direction>;
|
|
67
67
|
linear: InputSignalWithTransform<boolean, BooleanInput>;
|
|
68
68
|
totalStepperItems: WritableSignal<HTMLElement[]>;
|
|
69
|
+
goToStep(step: number, event?: Event, reason?: string): void;
|
|
69
70
|
}
|
|
70
71
|
declare const STEPPER_ROOT_CONTEXT: InjectionToken<StepperRootContext>;
|
|
71
72
|
declare function injectStepperRootContext(): StepperRootContext;
|
|
72
73
|
|
|
74
|
+
type RdxStepperValueChangeReason = 'trigger-press' | 'keyboard' | 'none';
|
|
75
|
+
type RdxStepperValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxStepperValueChangeReason>;
|
|
76
|
+
interface RdxStepperValueChangeEvent {
|
|
77
|
+
value: number;
|
|
78
|
+
eventDetails: RdxStepperValueChangeEventDetails;
|
|
79
|
+
}
|
|
73
80
|
declare class RdxStepperRootDirective implements StepperRootContext {
|
|
74
81
|
private readonly liveAnnouncer;
|
|
75
82
|
readonly defaultValue: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
@@ -80,7 +87,7 @@ declare class RdxStepperRootDirective implements StepperRootContext {
|
|
|
80
87
|
readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
|
|
81
88
|
/** @ignore */
|
|
82
89
|
readonly totalStepperItemsArray: _angular_core.Signal<HTMLElement[]>;
|
|
83
|
-
readonly onValueChange: _angular_core.OutputEmitterRef<
|
|
90
|
+
readonly onValueChange: _angular_core.OutputEmitterRef<RdxStepperValueChangeEvent>;
|
|
84
91
|
/** @ignore */
|
|
85
92
|
readonly isFirstStep: _angular_core.Signal<boolean>;
|
|
86
93
|
/** @ignore */
|
|
@@ -96,7 +103,7 @@ declare class RdxStepperRootDirective implements StepperRootContext {
|
|
|
96
103
|
private readonly nextStepperItem;
|
|
97
104
|
private readonly prevStepperItem;
|
|
98
105
|
constructor();
|
|
99
|
-
goToStep(step: number): void;
|
|
106
|
+
goToStep(step: number, event?: Event, reason?: RdxStepperValueChangeReason): void;
|
|
100
107
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxStepperRootDirective, never>;
|
|
101
108
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperRootDirective, "[rdxStepperRoot]", ["rdxStepperRoot"], { "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
|
102
109
|
}
|
|
@@ -120,4 +127,4 @@ declare class RdxStepperModule {
|
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
export { RdxStepperDescriptionDirective, RdxStepperIndicatorDirective, RdxStepperItemDirective, RdxStepperModule, RdxStepperRootDirective, RdxStepperSeparatorDirective, RdxStepperTitleDirective, RdxStepperTriggerDirective, STEPPER_ROOT_CONTEXT, injectStepperRootContext };
|
|
123
|
-
export type { StepperRootContext, StepperState };
|
|
130
|
+
export type { RdxStepperValueChangeEvent, RdxStepperValueChangeEventDetails, RdxStepperValueChangeReason, StepperRootContext, StepperState };
|
|
@@ -2,7 +2,7 @@ import * as _radix_ng_primitives_switch from '@radix-ng/primitives/switch';
|
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { Signal } from '@angular/core';
|
|
4
4
|
import * as i1 from '@radix-ng/primitives/core';
|
|
5
|
-
import { RdxFormCheckboxControl, RdxControlValueAccessor, BooleanInput } from '@radix-ng/primitives/core';
|
|
5
|
+
import { RdxCancelableChangeEventDetails, RdxFormCheckboxControl, RdxControlValueAccessor, BooleanInput } from '@radix-ng/primitives/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The hidden native checkbox that mirrors the switch state for form submission and screen readers.
|
|
@@ -15,6 +15,12 @@ declare class RdxSwitchInput {
|
|
|
15
15
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSwitchInput, "input[rdxSwitchInput]", ["rdxSwitchInput"], {}, {}, never, never, true, never>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
type RdxSwitchCheckedChangeReason = 'trigger-press' | 'none';
|
|
19
|
+
type RdxSwitchCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxSwitchCheckedChangeReason>;
|
|
20
|
+
interface RdxSwitchCheckedChangeEvent {
|
|
21
|
+
checked: boolean;
|
|
22
|
+
eventDetails: RdxSwitchCheckedChangeEventDetails;
|
|
23
|
+
}
|
|
18
24
|
/**
|
|
19
25
|
* A control that toggles between on and off.
|
|
20
26
|
*
|
|
@@ -68,13 +74,13 @@ declare class RdxSwitchRoot implements RdxFormCheckboxControl {
|
|
|
68
74
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
69
75
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
70
76
|
/** Event handler called when the checked state of the switch changes. */
|
|
71
|
-
readonly onCheckedChange: _angular_core.OutputEmitterRef<
|
|
77
|
+
readonly onCheckedChange: _angular_core.OutputEmitterRef<RdxSwitchCheckedChangeEvent>;
|
|
72
78
|
/** @ignore */
|
|
73
79
|
readonly checkedState: _angular_core.Signal<boolean>;
|
|
74
80
|
/** @ignore */
|
|
75
81
|
protected readonly isDisabled: _angular_core.Signal<boolean>;
|
|
76
82
|
/** @ignore Toggles the checked state unless disabled or read-only. */
|
|
77
|
-
toggle(): void;
|
|
83
|
+
toggle(event?: Event): void;
|
|
78
84
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSwitchRoot, never>;
|
|
79
85
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSwitchRoot, "button[rdxSwitchRoot]", ["rdxSwitchRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "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; }; "submitValue": { "alias": "value"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, [{ directive: typeof i1.RdxControlValueAccessor; inputs: { "value": "checked"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
80
86
|
}
|
|
@@ -118,4 +124,4 @@ declare class RdxSwitchModule {
|
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
export { RdxSwitchInput, RdxSwitchModule, RdxSwitchRoot, RdxSwitchThumb, injectSwitchContext, provideSwitchContext, switchImports };
|
|
121
|
-
export type { RdxSwitchContext };
|
|
127
|
+
export type { RdxSwitchCheckedChangeEvent, RdxSwitchCheckedChangeEventDetails, RdxSwitchCheckedChangeReason, RdxSwitchContext };
|
|
@@ -2,9 +2,9 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { Signal } from '@angular/core';
|
|
3
3
|
import * as i1 from '@radix-ng/primitives/presence';
|
|
4
4
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
5
|
-
import { DataOrientation, BooleanInput } from '@radix-ng/primitives/core';
|
|
5
|
+
import { DataOrientation, RdxCancelableChangeEventDetails, BooleanInput } from '@radix-ng/primitives/core';
|
|
6
6
|
import * as _radix_ng_primitives_tabs from '@radix-ng/primitives/tabs';
|
|
7
|
-
import * as i1$1 from '@radix-ng/primitives/
|
|
7
|
+
import * as i1$1 from '@radix-ng/primitives/composite';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Structural directive that mounts the tab panel contents only while the panel is active,
|
|
@@ -28,6 +28,12 @@ type RdxTabsActivationDirection = 'left' | 'right' | 'up' | 'down' | 'none';
|
|
|
28
28
|
/** A value that identifies a tab / panel pair. */
|
|
29
29
|
type RdxTabsValue = string | number | null;
|
|
30
30
|
|
|
31
|
+
type RdxTabsValueChangeReason = 'trigger-press' | 'keyboard' | 'focus' | 'none';
|
|
32
|
+
type RdxTabsValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxTabsValueChangeReason>;
|
|
33
|
+
interface RdxTabsValueChangeEvent {
|
|
34
|
+
value: RdxTabsValue;
|
|
35
|
+
eventDetails: RdxTabsValueChangeEventDetails;
|
|
36
|
+
}
|
|
31
37
|
/**
|
|
32
38
|
* Groups the tabs and the corresponding panels.
|
|
33
39
|
*
|
|
@@ -54,7 +60,7 @@ declare class RdxTabsRoot {
|
|
|
54
60
|
/**
|
|
55
61
|
* Event emitted when the selected tab changes.
|
|
56
62
|
*/
|
|
57
|
-
readonly onValueChange: _angular_core.OutputEmitterRef<
|
|
63
|
+
readonly onValueChange: _angular_core.OutputEmitterRef<RdxTabsValueChangeEvent>;
|
|
58
64
|
/** @ignore Set by `[rdxTabsList]`. */
|
|
59
65
|
readonly activateOnFocus: _angular_core.WritableSignal<boolean>;
|
|
60
66
|
/** @ignore Set by `[rdxTabsList]`. */
|
|
@@ -63,7 +69,7 @@ declare class RdxTabsRoot {
|
|
|
63
69
|
readonly activationDirection: _angular_core.WritableSignal<RdxTabsActivationDirection>;
|
|
64
70
|
constructor();
|
|
65
71
|
/** @ignore */
|
|
66
|
-
setValue(value: RdxTabsValue): void;
|
|
72
|
+
setValue(value: RdxTabsValue, event?: Event, reason?: RdxTabsValueChangeReason): void;
|
|
67
73
|
private computeDirection;
|
|
68
74
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxTabsRoot, never>;
|
|
69
75
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTabsRoot, "[rdxTabsRoot]", ["rdxTabsRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
|
@@ -77,7 +83,7 @@ declare class RdxTabsRoot {
|
|
|
77
83
|
declare class RdxTabsList {
|
|
78
84
|
protected readonly rootContext: _radix_ng_primitives_tabs.RdxTabsRootContext;
|
|
79
85
|
private readonly elementRef;
|
|
80
|
-
private readonly
|
|
86
|
+
private readonly compositeRoot;
|
|
81
87
|
/**
|
|
82
88
|
* Whether a tab is activated when it receives focus (automatic activation).
|
|
83
89
|
* When `false`, tabs are only activated on click or Enter/Space.
|
|
@@ -91,9 +97,12 @@ declare class RdxTabsList {
|
|
|
91
97
|
* @default true
|
|
92
98
|
*/
|
|
93
99
|
readonly loopFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
100
|
+
private readonly tabMetadata;
|
|
101
|
+
private readonly disabledIndices;
|
|
102
|
+
private readonly activeIndex;
|
|
94
103
|
constructor();
|
|
95
104
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxTabsList, never>;
|
|
96
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTabsList, "[rdxTabsList]", ["rdxTabsList"], { "activateOnFocus": { "alias": "activateOnFocus"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$1.
|
|
105
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTabsList, "[rdxTabsList]", ["rdxTabsList"], { "activateOnFocus": { "alias": "activateOnFocus"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$1.RdxCompositeRoot; inputs: {}; outputs: {}; }]>;
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
/**
|
|
@@ -103,7 +112,7 @@ declare class RdxTabsList {
|
|
|
103
112
|
*/
|
|
104
113
|
declare class RdxTabsTab {
|
|
105
114
|
protected readonly rootContext: _radix_ng_primitives_tabs.RdxTabsRootContext;
|
|
106
|
-
private readonly
|
|
115
|
+
private readonly compositeItem;
|
|
107
116
|
/**
|
|
108
117
|
* A unique value that associates the tab with a panel.
|
|
109
118
|
*/
|
|
@@ -124,9 +133,9 @@ declare class RdxTabsTab {
|
|
|
124
133
|
/** @ignore */
|
|
125
134
|
protected onKeyDown(event: KeyboardEvent): void;
|
|
126
135
|
/** @ignore */
|
|
127
|
-
protected onFocus(): void;
|
|
136
|
+
protected onFocus(event: FocusEvent): void;
|
|
128
137
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxTabsTab, never>;
|
|
129
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTabsTab, "[rdxTabsTab]", ["rdxTabsTab"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$1.
|
|
138
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxTabsTab, "[rdxTabsTab]", ["rdxTabsTab"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$1.RdxCompositeItem; inputs: {}; outputs: {}; }]>;
|
|
130
139
|
}
|
|
131
140
|
|
|
132
141
|
/**
|
|
@@ -227,7 +236,7 @@ interface RdxTabsRootContext {
|
|
|
227
236
|
/** The `[rdxTabsList]` host element, used to resolve tab order and indicator geometry. */
|
|
228
237
|
readonly tabListElement: Signal<HTMLElement | null>;
|
|
229
238
|
/** Select a tab by value. No-op when the value is unchanged. */
|
|
230
|
-
setValue(value: RdxTabsValue): void;
|
|
239
|
+
setValue(value: RdxTabsValue, event?: Event, reason?: string): void;
|
|
231
240
|
/** Mirror the list's `activateOnFocus` input onto the root context. */
|
|
232
241
|
setActivateOnFocus(value: boolean): void;
|
|
233
242
|
/** Register the list host element. */
|
|
@@ -244,4 +253,4 @@ declare class RdxTabsModule {
|
|
|
244
253
|
}
|
|
245
254
|
|
|
246
255
|
export { RdxTabsIndicator, RdxTabsList, RdxTabsModule, RdxTabsPanel, RdxTabsPanelPresence, RdxTabsRoot, RdxTabsTab, injectTabsRootContext, provideTabsRootContext, tabsImports };
|
|
247
|
-
export type { RdxTabsActivationDirection, RdxTabsRootContext, RdxTabsValue };
|
|
256
|
+
export type { RdxTabsActivationDirection, RdxTabsRootContext, RdxTabsValue, RdxTabsValueChangeEvent, RdxTabsValueChangeEventDetails, RdxTabsValueChangeReason };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
2
|
-
import { DataOrientation, BooleanInput } from '@radix-ng/primitives/core';
|
|
3
1
|
import * as _angular_core from '@angular/core';
|
|
4
2
|
import { Signal } from '@angular/core';
|
|
5
|
-
import * as
|
|
6
|
-
import { Direction } from '@radix-ng/primitives/
|
|
3
|
+
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
+
import { DataOrientation, RdxCancelableChangeEventDetails, BooleanInput, Direction } from '@radix-ng/primitives/core';
|
|
7
5
|
import { ControlValueAccessor } from '@angular/forms';
|
|
6
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
8
7
|
|
|
8
|
+
type RdxToggleGroupContextChangeReason = 'none';
|
|
9
9
|
/**
|
|
10
10
|
* Shared state a {@link RdxToggle} reads when it participates in a toggle group.
|
|
11
11
|
*/
|
|
@@ -14,20 +14,26 @@ interface RdxToggleGroupContext {
|
|
|
14
14
|
readonly value: Signal<string[]>;
|
|
15
15
|
/** Whether the whole group is disabled. */
|
|
16
16
|
readonly disabled: Signal<boolean>;
|
|
17
|
-
/** Whether more than one item can be pressed at a time. */
|
|
18
|
-
readonly multiple: Signal<boolean>;
|
|
19
17
|
/** The orientation of the group. */
|
|
20
18
|
readonly orientation: Signal<DataOrientation>;
|
|
19
|
+
/** Whether the group value was initialized by `value` or `defaultValue`. */
|
|
20
|
+
readonly isValueInitialized: Signal<boolean>;
|
|
21
21
|
/** Toggle the pressed state of `value` within the group. */
|
|
22
|
-
toggle(value: string): void;
|
|
22
|
+
toggle(value: string, event?: Event, eventDetails?: RdxCancelableChangeEventDetails<RdxToggleGroupContextChangeReason>): void;
|
|
23
23
|
}
|
|
24
24
|
declare const injectToggleGroupContext: _radix_ng_primitives_core.InjectContext<RdxToggleGroupContext>;
|
|
25
25
|
declare const provideToggleGroupContext: (useFactory: () => RdxToggleGroupContext) => _angular_core.Provider;
|
|
26
26
|
|
|
27
|
+
type RdxToggleGroupValueChangeReason = 'none';
|
|
28
|
+
type RdxToggleGroupValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxToggleGroupValueChangeReason>;
|
|
29
|
+
interface RdxToggleGroupValueChangeEvent {
|
|
30
|
+
value: string[];
|
|
31
|
+
eventDetails: RdxToggleGroupValueChangeEventDetails;
|
|
32
|
+
}
|
|
27
33
|
/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */
|
|
28
34
|
declare function toggleGroupContext(instance: RdxToggleGroupBase): RdxToggleGroupContext;
|
|
29
35
|
/**
|
|
30
|
-
* Shared state and behavior for the toggle group. Concrete directives add the
|
|
36
|
+
* Shared state and behavior for the toggle group. Concrete directives add the composite root
|
|
31
37
|
* ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar
|
|
32
38
|
* ({@link RdxToggleGroupWithoutFocus}).
|
|
33
39
|
*/
|
|
@@ -58,17 +64,21 @@ declare abstract class RdxToggleGroupBase implements ControlValueAccessor {
|
|
|
58
64
|
*/
|
|
59
65
|
readonly orientation: _angular_core.InputSignal<DataOrientation>;
|
|
60
66
|
/** Event emitted when the pressed values change. */
|
|
61
|
-
readonly onValueChange: _angular_core.OutputEmitterRef<
|
|
67
|
+
readonly onValueChange: _angular_core.OutputEmitterRef<RdxToggleGroupValueChangeEvent>;
|
|
62
68
|
/** @ignore */
|
|
63
69
|
readonly pressedValues: _angular_core.Signal<string[]>;
|
|
70
|
+
/** @ignore */
|
|
71
|
+
readonly isValueInitialized: _angular_core.Signal<boolean>;
|
|
64
72
|
protected readonly accessorDisabled: _angular_core.WritableSignal<boolean>;
|
|
65
73
|
/** @ignore */
|
|
66
74
|
readonly isDisabled: _angular_core.Signal<boolean>;
|
|
67
75
|
private onChange?;
|
|
68
76
|
protected onTouched?: () => void;
|
|
69
77
|
constructor();
|
|
78
|
+
/** @ignore Extra disabled state inherited from composite parents such as Toolbar. */
|
|
79
|
+
protected isExternallyDisabled(): boolean;
|
|
70
80
|
/** @ignore */
|
|
71
|
-
toggle(value: string): void;
|
|
81
|
+
toggle(value: string, event?: Event, eventDetails?: RdxToggleGroupValueChangeEventDetails): void;
|
|
72
82
|
/** @ignore */
|
|
73
83
|
writeValue(value: string[] | string | null): void;
|
|
74
84
|
/** @ignore */
|
|
@@ -82,37 +92,44 @@ declare abstract class RdxToggleGroupBase implements ControlValueAccessor {
|
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
/**
|
|
85
|
-
* A set of two-state buttons that can be toggled on or off. Owns
|
|
95
|
+
* A set of two-state buttons that can be toggled on or off. Owns composite keyboard focus over its
|
|
86
96
|
* `[rdxToggle]` children.
|
|
87
97
|
*
|
|
88
98
|
* @see https://base-ui.com/react/components/toggle-group
|
|
89
99
|
*/
|
|
90
100
|
declare class RdxToggleGroup extends RdxToggleGroupBase {
|
|
101
|
+
private readonly elementRef;
|
|
91
102
|
/** Text direction for arrow-key navigation. */
|
|
92
103
|
readonly dirInput: _angular_core.InputSignal<Direction | undefined>;
|
|
93
|
-
readonly dir: _angular_core.Signal<
|
|
104
|
+
readonly dir: _angular_core.Signal<Direction>;
|
|
94
105
|
/**
|
|
95
106
|
* Whether keyboard navigation should loop from the last item back to the first.
|
|
96
107
|
*
|
|
97
108
|
* @default true
|
|
98
109
|
*/
|
|
99
110
|
readonly loopFocus: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
100
|
-
private readonly
|
|
111
|
+
private readonly compositeRoot;
|
|
112
|
+
private readonly itemMetadata;
|
|
113
|
+
private readonly disabledIndices;
|
|
114
|
+
private readonly activeIndex;
|
|
101
115
|
constructor();
|
|
102
116
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxToggleGroup, never>;
|
|
103
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxToggleGroup, "[rdxToggleGroup]", ["rdxToggleGroup"], { "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.
|
|
117
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxToggleGroup, "[rdxToggleGroup]", ["rdxToggleGroup"], { "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loopFocus": { "alias": "loopFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxCompositeRoot; inputs: {}; outputs: {}; }]>;
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
/**
|
|
107
|
-
* A toggle group that does NOT create its own
|
|
121
|
+
* A toggle group that does NOT create its own composite root, for use inside a container that
|
|
108
122
|
* already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest
|
|
109
|
-
* ancestor
|
|
123
|
+
* ancestor composite root instead. Mirrors Base UI's behavior of skipping its composite root
|
|
110
124
|
* when nested in a toolbar.
|
|
111
125
|
*/
|
|
112
126
|
declare class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {
|
|
127
|
+
private readonly toolbarRootContext;
|
|
128
|
+
private readonly toolbarGroupContext;
|
|
129
|
+
protected isExternallyDisabled(): boolean;
|
|
113
130
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxToggleGroupWithoutFocus, never>;
|
|
114
131
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxToggleGroupWithoutFocus, "[rdxToggleGroupWithoutFocus]", ["rdxToggleGroupWithoutFocus"], {}, {}, never, never, true, never>;
|
|
115
132
|
}
|
|
116
133
|
|
|
117
134
|
export { RdxToggleGroup, RdxToggleGroupBase, RdxToggleGroupWithoutFocus, injectToggleGroupContext, provideToggleGroupContext, toggleGroupContext };
|
|
118
|
-
export type { RdxToggleGroupContext };
|
|
135
|
+
export type { RdxToggleGroupContext, RdxToggleGroupValueChangeEvent, RdxToggleGroupValueChangeEventDetails, RdxToggleGroupValueChangeReason };
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { BooleanInput } from '@radix-ng/primitives/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/
|
|
2
|
+
import { BooleanInput, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/composite';
|
|
4
4
|
import * as i1$1 from '@radix-ng/primitives/visually-hidden';
|
|
5
5
|
|
|
6
|
+
type RdxTogglePressedChangeReason = 'none';
|
|
7
|
+
type RdxTogglePressedChangeEventDetails = RdxCancelableChangeEventDetails<RdxTogglePressedChangeReason>;
|
|
8
|
+
interface RdxTogglePressedChangeEvent {
|
|
9
|
+
pressed: boolean;
|
|
10
|
+
eventDetails: RdxTogglePressedChangeEventDetails;
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* A two-state button that can be either on (pressed) or off.
|
|
8
14
|
*
|
|
9
15
|
* Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed
|
|
10
|
-
* state from the group's value (matched by `value`) and participates in the group's
|
|
16
|
+
* state from the group's value (matched by `value`) and participates in the group's composite focus.
|
|
11
17
|
*
|
|
12
18
|
* @see https://base-ui.com/react/components/toggle
|
|
13
19
|
*/
|
|
14
20
|
declare class RdxToggle {
|
|
15
21
|
private readonly group;
|
|
16
|
-
private readonly
|
|
22
|
+
private readonly compositeItem;
|
|
17
23
|
/**
|
|
18
24
|
* A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.
|
|
19
25
|
*/
|
|
@@ -42,7 +48,7 @@ declare class RdxToggle {
|
|
|
42
48
|
*/
|
|
43
49
|
readonly nativeButton: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
44
50
|
/** Event emitted when the pressed state changes (standalone). */
|
|
45
|
-
readonly onPressedChange: _angular_core.OutputEmitterRef<
|
|
51
|
+
readonly onPressedChange: _angular_core.OutputEmitterRef<RdxTogglePressedChangeEvent>;
|
|
46
52
|
private readonly internalPressed;
|
|
47
53
|
/** @ignore Whether the toggle is currently pressed (from the group when grouped). */
|
|
48
54
|
readonly pressedState: _angular_core.Signal<boolean>;
|
|
@@ -50,11 +56,11 @@ declare class RdxToggle {
|
|
|
50
56
|
readonly isDisabled: _angular_core.Signal<boolean>;
|
|
51
57
|
constructor();
|
|
52
58
|
/** @ignore */
|
|
53
|
-
protected onClick(): void;
|
|
59
|
+
protected onClick(event?: Event): void;
|
|
54
60
|
/** @ignore */
|
|
55
61
|
protected onKeyDown(event: KeyboardEvent): void;
|
|
56
62
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxToggle, never>;
|
|
57
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxToggle, "[rdxToggle]", ["rdxToggle"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultPressed": { "alias": "defaultPressed"; "required": false; "isSignal": true; }; "pressed": { "alias": "pressed"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "nativeButton": { "alias": "nativeButton"; "required": false; "isSignal": true; }; }, { "pressed": "pressedChange"; "onPressedChange": "onPressedChange"; }, never, never, true, [{ directive: typeof i1.
|
|
63
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxToggle, "[rdxToggle]", ["rdxToggle"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultPressed": { "alias": "defaultPressed"; "required": false; "isSignal": true; }; "pressed": { "alias": "pressed"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "nativeButton": { "alias": "nativeButton"; "required": false; "isSignal": true; }; }, { "pressed": "pressedChange"; "onPressedChange": "onPressedChange"; }, never, never, true, [{ directive: typeof i1.RdxCompositeItem; inputs: {}; outputs: {}; }]>;
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
declare class RdxToggleVisuallyHiddenInputDirective {
|
|
@@ -63,3 +69,4 @@ declare class RdxToggleVisuallyHiddenInputDirective {
|
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
export { RdxToggle, RdxToggleVisuallyHiddenInputDirective };
|
|
72
|
+
export type { RdxTogglePressedChangeEvent, RdxTogglePressedChangeEventDetails, RdxTogglePressedChangeReason };
|