@radix-ng/primitives 0.50.0 → 1.0.0-beta.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/collection/README.md +1 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +134 -66
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +224 -132
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +26 -10
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +68 -75
- 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 +104 -103
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +414 -80
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +193 -92
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +72 -0
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-config.mjs +5 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +143 -427
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +757 -757
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +55 -53
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +93 -86
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +658 -330
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +98 -76
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
- 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-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +29 -14
- 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 +11 -11
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1484 -353
- 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 +1060 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -366
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +980 -995
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +137 -82
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +40 -16
- 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 +231 -92
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +211 -70
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +127 -77
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +791 -511
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +16 -45
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +976 -720
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +69 -71
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +128 -124
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +388 -115
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +111 -117
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +122 -248
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +99 -62
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +307 -94
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1079
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +46 -87
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +85 -63
- 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/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +102 -67
- package/types/radix-ng-primitives-alert-dialog.d.ts +114 -0
- package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +1 -1
- package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +1 -1
- package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +2 -3
- package/types/radix-ng-primitives-checkbox.d.ts +337 -0
- package/types/radix-ng-primitives-collapsible.d.ts +159 -0
- package/types/radix-ng-primitives-collection.d.ts +44 -0
- package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +73 -0
- package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +311 -236
- package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +6 -5
- package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +42 -27
- package/types/radix-ng-primitives-dialog.d.ts +323 -0
- package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +448 -0
- package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +1 -1
- package/types/radix-ng-primitives-field.d.ts +373 -0
- package/types/radix-ng-primitives-fieldset.d.ts +48 -0
- package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +13 -5
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -1
- package/types/radix-ng-primitives-menu.d.ts +612 -0
- package/types/radix-ng-primitives-menubar.d.ts +66 -0
- package/types/radix-ng-primitives-meter.d.ts +193 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +488 -0
- package/types/radix-ng-primitives-number-field.d.ts +464 -0
- package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +2 -2
- package/types/radix-ng-primitives-popover.d.ts +416 -0
- package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +50 -9
- package/types/radix-ng-primitives-portal.d.ts +30 -0
- package/types/radix-ng-primitives-presence.d.ts +55 -0
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +206 -0
- package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +56 -26
- package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +38 -27
- package/types/radix-ng-primitives-select.d.ts +512 -0
- package/types/radix-ng-primitives-separator.d.ts +38 -0
- package/types/radix-ng-primitives-slider.d.ts +377 -0
- package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +21 -22
- package/types/radix-ng-primitives-switch.d.ts +121 -0
- package/types/radix-ng-primitives-tabs.d.ts +247 -0
- package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +46 -31
- package/types/radix-ng-primitives-toggle-group.d.ts +116 -0
- package/types/radix-ng-primitives-toggle.d.ts +65 -0
- package/types/radix-ng-primitives-toolbar.d.ts +180 -0
- package/types/radix-ng-primitives-tooltip.d.ts +395 -0
- package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +19 -19
- package/alert-dialog/index.d.ts +0 -57
- package/checkbox/index.d.ts +0 -164
- package/collapsible/index.d.ts +0 -85
- package/context-menu/index.d.ts +0 -129
- package/dialog/index.d.ts +0 -205
- package/dropdown-menu/README.md +0 -1
- package/dropdown-menu/index.d.ts +0 -171
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -583
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1246
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -740
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/hover-card/index.d.ts +0 -472
- package/menu/index.d.ts +0 -139
- package/menubar/index.d.ts +0 -56
- package/navigation-menu/index.d.ts +0 -405
- package/number-field/index.d.ts +0 -203
- package/popover/index.d.ts +0 -403
- package/portal/index.d.ts +0 -22
- package/presence/index.d.ts +0 -103
- package/progress/index.d.ts +0 -79
- package/select/index.d.ts +0 -214
- package/separator/index.d.ts +0 -63
- package/slider/index.d.ts +0 -263
- package/switch/index.d.ts +0 -105
- package/tabs/index.d.ts +0 -112
- package/toggle/index.d.ts +0 -75
- package/toggle-group/index.d.ts +0 -194
- package/toolbar/index.d.ts +0 -55
- package/tooltip/index.d.ts +0 -433
- package/tooltip2/README.md +0 -3
- package/tooltip2/index.d.ts +0 -325
- /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
- /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/core';
|
|
4
|
+
import { RdxControlValueAccessor, NumberInput, BooleanInput } from '@radix-ng/primitives/core';
|
|
5
|
+
export { clamp } from '@radix-ng/primitives/core';
|
|
6
|
+
import * as _radix_ng_primitives_slider from '@radix-ng/primitives/slider';
|
|
7
|
+
|
|
8
|
+
type SliderOrientation = 'horizontal' | 'vertical';
|
|
9
|
+
type ThumbCollisionBehavior = 'push' | 'swap' | 'none';
|
|
10
|
+
/** Ascending comparator. */
|
|
11
|
+
declare function asc(a: number, b: number): number;
|
|
12
|
+
/** Maps a value within `[min, max]` to a 0–100 percentage. */
|
|
13
|
+
declare function valueToPercent(value: number, min: number, max: number): number;
|
|
14
|
+
/** Replaces the item at `index` then re-sorts the array ascending. */
|
|
15
|
+
declare function replaceArrayItemAtIndex(array: readonly number[], index: number, newValue: number): number[];
|
|
16
|
+
/** The center point of an element in client coordinates. */
|
|
17
|
+
declare function getMidpoint(element: Element): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
/** Converts an array of values into clamped 0–100 percentages. */
|
|
22
|
+
declare function valueArrayToPercentages(values: readonly number[], min: number, max: number): number[];
|
|
23
|
+
/** Number of decimal places in `num`, handling exponential notation for tiny values. */
|
|
24
|
+
declare function getDecimalPrecision(num: number): number;
|
|
25
|
+
/** Snaps `value` to the nearest step, using `min` as the origin of the step grid. */
|
|
26
|
+
declare function roundValueToStep(value: number, step: number, min: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves the value(s) for the keyboard / hidden-input path: clamps to the
|
|
29
|
+
* bounds, and for range sliders also clamps to neighbouring thumbs and re-sorts.
|
|
30
|
+
* Returns a `number` for single sliders and a sorted `number[]` for range sliders.
|
|
31
|
+
*/
|
|
32
|
+
declare function getSliderValue(valueInput: number, index: number, min: number, max: number, range: boolean, values: readonly number[]): number | number[];
|
|
33
|
+
/** Returns `false` if any adjacent pair of values is closer than the minimum distance. */
|
|
34
|
+
declare function validateMinimumDistance(values: number | number[], step: number, minStepsBetweenValues: number): boolean;
|
|
35
|
+
/** Keyboard step helper: increments/decrements `thumbValue` and clamps to bounds. */
|
|
36
|
+
declare function getNewValue(thumbValue: number, increment: number, direction: 1 | -1, min: number, max: number): number;
|
|
37
|
+
interface GetPushedThumbValuesParams {
|
|
38
|
+
values: readonly number[];
|
|
39
|
+
index: number;
|
|
40
|
+
nextValue: number;
|
|
41
|
+
min: number;
|
|
42
|
+
max: number;
|
|
43
|
+
step: number;
|
|
44
|
+
minStepsBetweenValues: number;
|
|
45
|
+
initialValues?: readonly number[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The "push" collision algorithm: moves the pressed thumb and pushes its
|
|
49
|
+
* neighbours only as far as needed, letting them spring back toward their
|
|
50
|
+
* initial positions as the pressed thumb retreats.
|
|
51
|
+
*/
|
|
52
|
+
declare function getPushedThumbValues(params: GetPushedThumbValuesParams): number[];
|
|
53
|
+
interface ResolveThumbCollisionParams {
|
|
54
|
+
behavior: ThumbCollisionBehavior;
|
|
55
|
+
values: readonly number[];
|
|
56
|
+
currentValues?: readonly number[];
|
|
57
|
+
initialValues?: readonly number[] | null;
|
|
58
|
+
pressedIndex: number;
|
|
59
|
+
nextValue: number;
|
|
60
|
+
min: number;
|
|
61
|
+
max: number;
|
|
62
|
+
step: number;
|
|
63
|
+
minStepsBetweenValues: number;
|
|
64
|
+
}
|
|
65
|
+
interface ResolveThumbCollisionResult {
|
|
66
|
+
value: number | number[];
|
|
67
|
+
thumbIndex: number;
|
|
68
|
+
didSwap: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** Dispatches the pressed thumb's new value through the configured collision behavior. */
|
|
71
|
+
declare function resolveThumbCollision(params: ResolveThumbCollisionParams): ResolveThumbCollisionResult;
|
|
72
|
+
/**
|
|
73
|
+
* Border + padding on the leading/trailing edge of the control along the active
|
|
74
|
+
* axis. Uses physical longhands (`left`/`right`/`top`/`bottom`) rather than
|
|
75
|
+
* logical ones (`inline-start`/…) because `getComputedStyle` resolves the
|
|
76
|
+
* physical properties in every browser, whereas logical longhands return an
|
|
77
|
+
* empty string in some engines.
|
|
78
|
+
*/
|
|
79
|
+
declare function getControlOffset(styles: CSSStyleDeclaration | null, vertical: boolean, rtl: boolean): {
|
|
80
|
+
start: number;
|
|
81
|
+
end: number;
|
|
82
|
+
};
|
|
83
|
+
/** Formats a number with a cached `Intl.NumberFormat` instance. */
|
|
84
|
+
declare function formatNumber(value: number | null | undefined, locale: string | undefined, options: Intl.NumberFormatOptions | undefined): string;
|
|
85
|
+
/** Default `aria-valuetext` for a two-thumb range, or a formatted value when `format` is set. */
|
|
86
|
+
declare function getDefaultAriaValueText(values: readonly number[], index: number, format: Intl.NumberFormatOptions | undefined, locale: string | undefined): string | undefined;
|
|
87
|
+
declare const ARROW_KEYS: string[];
|
|
88
|
+
declare const COMPOSITE_KEYS: Set<string>;
|
|
89
|
+
declare const ALL_KEYS: Set<string>;
|
|
90
|
+
declare function areValuesEqual(a: number | number[], b: number | number[]): boolean;
|
|
91
|
+
|
|
92
|
+
type SliderValue = number | number[];
|
|
93
|
+
/** Minimal shape a thumb registers with the root, used for hit-testing and focus. */
|
|
94
|
+
interface RdxSliderThumbRef {
|
|
95
|
+
/** The thumb wrapper element. */
|
|
96
|
+
readonly element: HTMLElement;
|
|
97
|
+
/** The nested `input[type=range]`, registered once it is initialised. */
|
|
98
|
+
inputElement: HTMLInputElement | null;
|
|
99
|
+
/** Whether this thumb is disabled (own state OR root disabled). */
|
|
100
|
+
readonly disabled: Signal<boolean>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Groups all parts of the slider and owns its state, value-change logic and
|
|
104
|
+
* thumb registration. A single directive drives both orientations — there are no
|
|
105
|
+
* separate horizontal/vertical components.
|
|
106
|
+
*
|
|
107
|
+
* @see https://base-ui.com/react/components/slider
|
|
108
|
+
*/
|
|
109
|
+
declare class RdxSliderRoot {
|
|
110
|
+
/** @ignore */
|
|
111
|
+
protected readonly cva: RdxControlValueAccessor<SliderValue>;
|
|
112
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
113
|
+
/**
|
|
114
|
+
* The minimum value of the slider.
|
|
115
|
+
* @default 0
|
|
116
|
+
*/
|
|
117
|
+
readonly min: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
118
|
+
/**
|
|
119
|
+
* The maximum value of the slider.
|
|
120
|
+
* @default 100
|
|
121
|
+
*/
|
|
122
|
+
readonly max: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
123
|
+
/**
|
|
124
|
+
* The granularity with which the value can change through user interaction.
|
|
125
|
+
* @default 1
|
|
126
|
+
*/
|
|
127
|
+
readonly step: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
128
|
+
/**
|
|
129
|
+
* The granularity with which the value changes on Page Up / Page Down keys and Shift + Arrow keys.
|
|
130
|
+
* @default 10
|
|
131
|
+
*/
|
|
132
|
+
readonly largeStep: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
133
|
+
/**
|
|
134
|
+
* The minimum number of steps that must separate two thumbs in a range slider.
|
|
135
|
+
* @default 0
|
|
136
|
+
*/
|
|
137
|
+
readonly minStepsBetweenValues: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
138
|
+
/**
|
|
139
|
+
* The orientation of the slider.
|
|
140
|
+
* @default 'horizontal'
|
|
141
|
+
*/
|
|
142
|
+
readonly orientation: _angular_core.InputSignal<SliderOrientation>;
|
|
143
|
+
/**
|
|
144
|
+
* The reading direction. Mirrors the horizontal axis when set to `'rtl'`.
|
|
145
|
+
* @default 'ltr'
|
|
146
|
+
*/
|
|
147
|
+
readonly dir: _angular_core.InputSignal<"ltr" | "rtl">;
|
|
148
|
+
/**
|
|
149
|
+
* How thumbs behave when they meet in a range slider.
|
|
150
|
+
* @default 'push'
|
|
151
|
+
*/
|
|
152
|
+
readonly thumbCollisionBehavior: _angular_core.InputSignal<ThumbCollisionBehavior>;
|
|
153
|
+
/** Options forwarded to `Intl.NumberFormat` when displaying and announcing values. */
|
|
154
|
+
readonly format: _angular_core.InputSignal<Intl.NumberFormatOptions | undefined>;
|
|
155
|
+
/** Locale used for value formatting. */
|
|
156
|
+
readonly locale: _angular_core.InputSignal<string | undefined>;
|
|
157
|
+
/** Name of the hidden inputs rendered by each thumb, for form submission. */
|
|
158
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
159
|
+
/** Id of the form the slider belongs to. */
|
|
160
|
+
readonly form: _angular_core.InputSignal<string | undefined>;
|
|
161
|
+
/**
|
|
162
|
+
* When `true`, the user cannot interact with the slider.
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
165
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
166
|
+
/** The uncontrolled value of the slider when it is initially rendered. */
|
|
167
|
+
readonly defaultValue: _angular_core.InputSignal<SliderValue | undefined>;
|
|
168
|
+
/** The controlled value of the slider. Use with `(onValueChange)` or two-way `[(value)]`. */
|
|
169
|
+
readonly value: _angular_core.ModelSignal<SliderValue | undefined>;
|
|
170
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
171
|
+
/** Emitted when the value changes (during interaction). */
|
|
172
|
+
readonly onValueChange: _angular_core.OutputEmitterRef<SliderValue>;
|
|
173
|
+
/** Emitted when interaction ends, with the final value — useful for committing to a backend. */
|
|
174
|
+
readonly onValueCommitted: _angular_core.OutputEmitterRef<SliderValue>;
|
|
175
|
+
/** @ignore */
|
|
176
|
+
readonly controlRef: _angular_core.WritableSignal<HTMLElement | null>;
|
|
177
|
+
/** @ignore Active thumb index (-1 when none). */
|
|
178
|
+
readonly active: _angular_core.WritableSignal<number>;
|
|
179
|
+
/** @ignore Last thumb index that was focused/used, drives z-index stacking. */
|
|
180
|
+
readonly lastUsedThumbIndex: _angular_core.WritableSignal<number>;
|
|
181
|
+
/** @ignore Whether a pointer drag is in progress. */
|
|
182
|
+
readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
183
|
+
/** @ignore Pointer-drag scratch state (not reactive). */
|
|
184
|
+
pressedThumbIndex: number;
|
|
185
|
+
/** @ignore */
|
|
186
|
+
pressedThumbCenterOffset: number | null;
|
|
187
|
+
/** @ignore */
|
|
188
|
+
pressedInput: HTMLInputElement | null;
|
|
189
|
+
/** @ignore Snapshot of values at drag start, the baseline for push/swap. */
|
|
190
|
+
pressedValues: number[] | null;
|
|
191
|
+
/** @ignore */
|
|
192
|
+
lastChangeReason: string;
|
|
193
|
+
/** @ignore */
|
|
194
|
+
readonly isDisabled: Signal<boolean>;
|
|
195
|
+
/** @ignore The current value source (controlled value, else default, else min). */
|
|
196
|
+
private readonly currentRaw;
|
|
197
|
+
/** Whether the slider has multiple thumbs (the value is an array). */
|
|
198
|
+
readonly range: Signal<boolean>;
|
|
199
|
+
/** The clamped values rendered to the user, sorted ascending for range sliders. */
|
|
200
|
+
readonly values: Signal<number[]>;
|
|
201
|
+
private readonly thumbs;
|
|
202
|
+
/** Registered thumbs in DOM order. */
|
|
203
|
+
readonly thumbList: Signal<RdxSliderThumbRef[]>;
|
|
204
|
+
/** @ignore */
|
|
205
|
+
registerThumb(thumb: RdxSliderThumbRef): void;
|
|
206
|
+
/** @ignore */
|
|
207
|
+
unregisterThumb(thumb: RdxSliderThumbRef): void;
|
|
208
|
+
/** @ignore */
|
|
209
|
+
thumbIndexOf(thumb: RdxSliderThumbRef): number;
|
|
210
|
+
/** @ignore */
|
|
211
|
+
setActive(index: number): void;
|
|
212
|
+
/** @ignore */
|
|
213
|
+
focusThumb(index: number): void;
|
|
214
|
+
/** @ignore */
|
|
215
|
+
formatValue(value: number): string;
|
|
216
|
+
/** @ignore Output value matching the original value shape (number vs array). */
|
|
217
|
+
private outputValue;
|
|
218
|
+
/**
|
|
219
|
+
* @ignore
|
|
220
|
+
* Applies a new full set of values, preserving the single/range value shape.
|
|
221
|
+
* Returns `false` when the value did not change.
|
|
222
|
+
*/
|
|
223
|
+
setValue(nextValues: number[], reason: string): boolean;
|
|
224
|
+
/** @ignore Keyboard / native input path: clamps to neighbours, commits immediately. */
|
|
225
|
+
handleInputChange(valueInput: number, index: number, reason?: string): void;
|
|
226
|
+
/** @ignore Emits the committed value at the end of a pointer drag. */
|
|
227
|
+
commitValue(): void;
|
|
228
|
+
/** @ignore */
|
|
229
|
+
markAsTouched(): void;
|
|
230
|
+
/** @ignore */
|
|
231
|
+
setDragging(dragging: boolean): void;
|
|
232
|
+
/** @ignore */
|
|
233
|
+
resetPressedThumb(): void;
|
|
234
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderRoot, never>;
|
|
235
|
+
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; }; "dir": { "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 i1.RdxControlValueAccessor; inputs: { "value": "value"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The interactive area of the slider. Handles pointer presses and drags on the
|
|
240
|
+
* track, mapping pointer position to a value and moving the closest thumb.
|
|
241
|
+
*
|
|
242
|
+
* @see https://base-ui.com/react/components/slider
|
|
243
|
+
*/
|
|
244
|
+
declare class RdxSliderControl {
|
|
245
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
246
|
+
private readonly elementRef;
|
|
247
|
+
private readonly document;
|
|
248
|
+
private styles;
|
|
249
|
+
private moveCount;
|
|
250
|
+
private currentInteractionValue;
|
|
251
|
+
private readonly onMove;
|
|
252
|
+
private readonly onUp;
|
|
253
|
+
private readonly onCancel;
|
|
254
|
+
constructor();
|
|
255
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
256
|
+
private handleMove;
|
|
257
|
+
private handleUp;
|
|
258
|
+
private stopListening;
|
|
259
|
+
private startPressing;
|
|
260
|
+
private setValueFromPointer;
|
|
261
|
+
/** Projects a pointer position onto the track and resolves it to a value (+ collision). */
|
|
262
|
+
private getFingerState;
|
|
263
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderControl, never>;
|
|
264
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderControl, "div[rdxSliderControl]", ["rdxSliderControl"], {}, {}, never, never, true, never>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The track of the slider — the positioning context for the indicator and thumbs.
|
|
269
|
+
*
|
|
270
|
+
* @see https://base-ui.com/react/components/slider
|
|
271
|
+
*/
|
|
272
|
+
declare class RdxSliderTrack {
|
|
273
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
274
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderTrack, never>;
|
|
275
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderTrack, "div[rdxSliderTrack]", ["rdxSliderTrack"], {}, {}, never, never, true, never>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Visualises the portion of the track between the slider's minimum (or the first
|
|
280
|
+
* thumb in a range) and the active value.
|
|
281
|
+
*
|
|
282
|
+
* @see https://base-ui.com/react/components/slider
|
|
283
|
+
*/
|
|
284
|
+
declare class RdxSliderIndicator {
|
|
285
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
286
|
+
protected readonly indicatorStyle: _angular_core.Signal<Record<string, string | number>>;
|
|
287
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderIndicator, never>;
|
|
288
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderIndicator, "div[rdxSliderIndicator]", ["rdxSliderIndicator"], {}, {}, never, never, true, never>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* A draggable handle. Render one per value; place an `input[rdxSliderThumbInput]`
|
|
293
|
+
* inside it for keyboard, accessibility and form submission.
|
|
294
|
+
*
|
|
295
|
+
* @see https://base-ui.com/react/components/slider
|
|
296
|
+
*/
|
|
297
|
+
declare class RdxSliderThumb implements RdxSliderThumbRef {
|
|
298
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
299
|
+
readonly element: HTMLElement;
|
|
300
|
+
/** The nested range input, set by `[rdxSliderThumbInput]`. */
|
|
301
|
+
inputElement: HTMLInputElement | null;
|
|
302
|
+
/** Explicit index for this thumb (required for SSR range sliders). */
|
|
303
|
+
readonly indexInput: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
304
|
+
/** Disables this individual thumb. */
|
|
305
|
+
readonly thumbDisabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
306
|
+
/** The position of this thumb among its siblings. */
|
|
307
|
+
readonly index: _angular_core.Signal<number>;
|
|
308
|
+
/** Whether this thumb is disabled (own state OR root disabled). */
|
|
309
|
+
readonly disabled: _angular_core.Signal<boolean>;
|
|
310
|
+
/** The value represented by this thumb. */
|
|
311
|
+
readonly value: _angular_core.Signal<number | undefined>;
|
|
312
|
+
private readonly percent;
|
|
313
|
+
protected readonly thumbStyle: _angular_core.Signal<Record<string, string | number>>;
|
|
314
|
+
constructor();
|
|
315
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
316
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderThumb, never>;
|
|
317
|
+
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>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* The native `input[type=range]` nested inside a thumb. It is visually hidden but
|
|
322
|
+
* remains the focusable element that drives keyboard interaction, accessibility
|
|
323
|
+
* and form submission.
|
|
324
|
+
*
|
|
325
|
+
* @see https://base-ui.com/react/components/slider
|
|
326
|
+
*/
|
|
327
|
+
declare class RdxSliderThumbInput {
|
|
328
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
329
|
+
protected readonly thumb: RdxSliderThumb;
|
|
330
|
+
private readonly element;
|
|
331
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
332
|
+
readonly ariaValueTextInput: _angular_core.InputSignal<string | undefined>;
|
|
333
|
+
protected readonly writingMode: _angular_core.Signal<"vertical-rl" | "vertical-lr" | undefined>;
|
|
334
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | undefined>;
|
|
335
|
+
protected readonly valueText: _angular_core.Signal<string | undefined>;
|
|
336
|
+
constructor();
|
|
337
|
+
protected onChange(event: Event): void;
|
|
338
|
+
protected onFocus(): void;
|
|
339
|
+
protected onBlur(): void;
|
|
340
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
341
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderThumbInput, never>;
|
|
342
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderThumbInput, "input[rdxSliderThumbInput]", ["rdxSliderThumbInput"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaValueTextInput": { "alias": "aria-valuetext"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Displays the slider's current value(s) as formatted text. Renders into an
|
|
347
|
+
* `output` element; the displayed value honours the root `format` and `locale`.
|
|
348
|
+
*
|
|
349
|
+
* @see https://base-ui.com/react/components/slider
|
|
350
|
+
*/
|
|
351
|
+
declare class RdxSliderValue {
|
|
352
|
+
protected readonly root: _radix_ng_primitives_slider.RdxSliderRoot;
|
|
353
|
+
/** The separator placed between values of a range slider. */
|
|
354
|
+
readonly separator: _angular_core.InputSignal<string>;
|
|
355
|
+
protected readonly display: _angular_core.Signal<string>;
|
|
356
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderValue, never>;
|
|
357
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSliderValue, "output[rdxSliderValue]", ["rdxSliderValue"], { "separator": { "alias": "separator"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The Slider context exposes the root directive instance to every child part.
|
|
362
|
+
* The root owns all state, value-change logic and thumb registration; parts read
|
|
363
|
+
* signals and call methods off it.
|
|
364
|
+
*
|
|
365
|
+
* @see https://base-ui.com/react/components/slider
|
|
366
|
+
*/
|
|
367
|
+
declare const injectSliderRootContext: (optional?: boolean) => RdxSliderRoot | null;
|
|
368
|
+
declare const provideSliderRootContext: (useFactory: () => RdxSliderRoot) => _angular_core.Provider;
|
|
369
|
+
|
|
370
|
+
declare class RdxSliderModule {
|
|
371
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSliderModule, never>;
|
|
372
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxSliderModule, never, [typeof RdxSliderRoot, typeof RdxSliderControl, typeof RdxSliderTrack, typeof RdxSliderIndicator, typeof RdxSliderThumb, typeof RdxSliderThumbInput, typeof RdxSliderValue], [typeof RdxSliderRoot, typeof RdxSliderControl, typeof RdxSliderTrack, typeof RdxSliderIndicator, typeof RdxSliderThumb, typeof RdxSliderThumbInput, typeof RdxSliderValue]>;
|
|
373
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxSliderModule>;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
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 };
|
|
377
|
+
export type { RdxSliderThumbRef, ResolveThumbCollisionParams, ResolveThumbCollisionResult, SliderOrientation, SliderValue, ThumbCollisionBehavior };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InputSignalWithTransform, Signal, ModelSignal, InputSignal, WritableSignal, InjectionToken
|
|
3
|
-
import { NumberInput, BooleanInput } from '@
|
|
4
|
-
import
|
|
2
|
+
import { InputSignalWithTransform, Signal, ModelSignal, InputSignal, WritableSignal, InjectionToken } from '@angular/core';
|
|
3
|
+
import { NumberInput, BooleanInput, Direction } from '@radix-ng/primitives/core';
|
|
4
|
+
import * as _radix_ng_primitives_stepper from '@radix-ng/primitives/stepper';
|
|
5
5
|
import * as i1 from '@radix-ng/primitives/separator';
|
|
6
6
|
|
|
7
7
|
type StepperState = 'completed' | 'active' | 'inactive';
|
|
@@ -27,27 +27,17 @@ declare class RdxStepperTitleDirective {
|
|
|
27
27
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperTitleDirective, "[rdxStepperTitle]", never, {}, {}, never, never, true, never>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
interface StepperRootContext {
|
|
31
|
-
value: ModelSignal<number | undefined>;
|
|
32
|
-
orientation: InputSignal<'vertical' | 'horizontal'>;
|
|
33
|
-
dir: InputSignal<Direction>;
|
|
34
|
-
linear: InputSignalWithTransform<boolean, BooleanInput>;
|
|
35
|
-
totalStepperItems: WritableSignal<HTMLElement[]>;
|
|
36
|
-
}
|
|
37
|
-
declare const STEPPER_ROOT_CONTEXT: InjectionToken<StepperRootContext>;
|
|
38
|
-
declare function injectStepperRootContext(): StepperRootContext;
|
|
39
|
-
|
|
40
30
|
declare class RdxStepperSeparatorDirective {
|
|
41
|
-
protected readonly rootContext: StepperRootContext;
|
|
31
|
+
protected readonly rootContext: _radix_ng_primitives_stepper.StepperRootContext;
|
|
42
32
|
protected readonly itemContext: StepperItemContext;
|
|
43
33
|
private readonly rdxSeparator;
|
|
44
34
|
constructor();
|
|
45
35
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxStepperSeparatorDirective, never>;
|
|
46
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperSeparatorDirective, "[rdxStepperSeparator]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxSeparatorRootDirective; inputs: { "orientation": "orientation";
|
|
36
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperSeparatorDirective, "[rdxStepperSeparator]", never, {}, {}, never, never, true, [{ directive: typeof i1.RdxSeparatorRootDirective; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
declare class RdxStepperItemDirective implements StepperItemContext {
|
|
50
|
-
protected readonly rootContext: StepperRootContext;
|
|
40
|
+
protected readonly rootContext: _radix_ng_primitives_stepper.StepperRootContext;
|
|
51
41
|
/** @ignore */
|
|
52
42
|
readonly titleId: string;
|
|
53
43
|
/** @ignore */
|
|
@@ -70,6 +60,16 @@ declare class RdxStepperIndicatorDirective {
|
|
|
70
60
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperIndicatorDirective, "[rdxStepperIndicator]", ["rdxStepperIndicator"], {}, {}, never, never, true, never>;
|
|
71
61
|
}
|
|
72
62
|
|
|
63
|
+
interface StepperRootContext {
|
|
64
|
+
value: ModelSignal<number | undefined>;
|
|
65
|
+
orientation: InputSignal<'vertical' | 'horizontal'>;
|
|
66
|
+
dir: InputSignal<Direction>;
|
|
67
|
+
linear: InputSignalWithTransform<boolean, BooleanInput>;
|
|
68
|
+
totalStepperItems: WritableSignal<HTMLElement[]>;
|
|
69
|
+
}
|
|
70
|
+
declare const STEPPER_ROOT_CONTEXT: InjectionToken<StepperRootContext>;
|
|
71
|
+
declare function injectStepperRootContext(): StepperRootContext;
|
|
72
|
+
|
|
73
73
|
declare class RdxStepperRootDirective implements StepperRootContext {
|
|
74
74
|
private readonly liveAnnouncer;
|
|
75
75
|
readonly defaultValue: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
@@ -100,15 +100,14 @@ declare class RdxStepperRootDirective implements StepperRootContext {
|
|
|
100
100
|
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; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
declare class RdxStepperTriggerDirective
|
|
104
|
-
protected readonly rootContext: StepperRootContext;
|
|
103
|
+
declare class RdxStepperTriggerDirective {
|
|
104
|
+
protected readonly rootContext: _radix_ng_primitives_stepper.StepperRootContext;
|
|
105
105
|
protected readonly itemContext: StepperItemContext;
|
|
106
106
|
private readonly elementRef;
|
|
107
107
|
readonly stepperItems: _angular_core.Signal<HTMLElement[]>;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
handleKeyDown(event: KeyboardEvent): void;
|
|
108
|
+
constructor();
|
|
109
|
+
handleMouseDown(event: Event): void;
|
|
110
|
+
handleKeyDown(event: Event): void;
|
|
112
111
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxStepperTriggerDirective, never>;
|
|
113
112
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxStepperTriggerDirective, "button[rdxStepperTrigger]", never, {}, {}, never, never, true, never>;
|
|
114
113
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as _radix_ng_primitives_switch from '@radix-ng/primitives/switch';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { Signal } from '@angular/core';
|
|
4
|
+
import * as i1 from '@radix-ng/primitives/core';
|
|
5
|
+
import { RdxFormCheckboxControl, RdxControlValueAccessor, BooleanInput } from '@radix-ng/primitives/core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The hidden native checkbox that mirrors the switch state for form submission and screen readers.
|
|
9
|
+
*
|
|
10
|
+
* @see https://base-ui.com/react/components/switch
|
|
11
|
+
*/
|
|
12
|
+
declare class RdxSwitchInput {
|
|
13
|
+
protected readonly rootContext: _radix_ng_primitives_switch.RdxSwitchContext;
|
|
14
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSwitchInput, never>;
|
|
15
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSwitchInput, "input[rdxSwitchInput]", ["rdxSwitchInput"], {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A control that toggles between on and off.
|
|
20
|
+
*
|
|
21
|
+
* @see https://base-ui.com/react/components/switch
|
|
22
|
+
*/
|
|
23
|
+
declare class RdxSwitchRoot implements RdxFormCheckboxControl {
|
|
24
|
+
/** @ignore */
|
|
25
|
+
protected readonly cva: RdxControlValueAccessor<boolean | undefined>;
|
|
26
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
27
|
+
/**
|
|
28
|
+
* The state of the switch when it is initially rendered. Use when you do not need to control its state.
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
readonly defaultChecked: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
33
|
+
/**
|
|
34
|
+
* The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.
|
|
35
|
+
*/
|
|
36
|
+
readonly checked: _angular_core.ModelSignal<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* When `true`, prevents the user from interacting with the switch.
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
43
|
+
/**
|
|
44
|
+
* When `true`, the switch is focusable but cannot be toggled.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
49
|
+
/**
|
|
50
|
+
* When `true`, the switch must be on before the owning form can be submitted.
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
55
|
+
/** Name of the hidden form input rendered by `[rdxSwitchInput]`. */
|
|
56
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* Value submitted with the form when the switch is on.
|
|
59
|
+
*
|
|
60
|
+
* Bound publicly as `[value]`; the TS member is named `submitValue` so the
|
|
61
|
+
* directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a
|
|
62
|
+
* `value` member for `RdxFormValueControl` and forbids it on checkbox-style
|
|
63
|
+
* controls.
|
|
64
|
+
*
|
|
65
|
+
* @default 'on'
|
|
66
|
+
*/
|
|
67
|
+
readonly submitValue: _angular_core.InputSignal<string>;
|
|
68
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
69
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
70
|
+
/** Event handler called when the checked state of the switch changes. */
|
|
71
|
+
readonly onCheckedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
72
|
+
/** @ignore */
|
|
73
|
+
readonly checkedState: _angular_core.Signal<boolean>;
|
|
74
|
+
/** @ignore */
|
|
75
|
+
protected readonly isDisabled: _angular_core.Signal<boolean>;
|
|
76
|
+
/** @ignore Toggles the checked state unless disabled or read-only. */
|
|
77
|
+
toggle(): void;
|
|
78
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSwitchRoot, never>;
|
|
79
|
+
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
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The moving part of the switch that indicates whether it is on or off.
|
|
84
|
+
*
|
|
85
|
+
* @see https://base-ui.com/react/components/switch
|
|
86
|
+
*/
|
|
87
|
+
declare class RdxSwitchThumb {
|
|
88
|
+
protected readonly rootContext: _radix_ng_primitives_switch.RdxSwitchContext;
|
|
89
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSwitchThumb, never>;
|
|
90
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxSwitchThumb, "span[rdxSwitchThumb]", ["rdxSwitchThumb"], {}, {}, never, never, true, never>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface RdxSwitchContext {
|
|
94
|
+
/** Whether the switch is on. */
|
|
95
|
+
readonly checked: Signal<boolean>;
|
|
96
|
+
/** Whether the switch is disabled. */
|
|
97
|
+
readonly disabled: Signal<boolean>;
|
|
98
|
+
/** Whether the switch is read-only (focusable, but cannot be toggled). */
|
|
99
|
+
readonly readonly: Signal<boolean>;
|
|
100
|
+
/** Whether the switch must be on to submit the owning form. */
|
|
101
|
+
readonly required: Signal<boolean>;
|
|
102
|
+
/** Name of the hidden form input. */
|
|
103
|
+
readonly name: Signal<string | undefined>;
|
|
104
|
+
/** Value submitted with the form when the switch is on. */
|
|
105
|
+
readonly value: Signal<string>;
|
|
106
|
+
readonly ariaLabel: Signal<string | undefined>;
|
|
107
|
+
readonly ariaLabelledBy: Signal<string | undefined>;
|
|
108
|
+
markAsTouched(): void;
|
|
109
|
+
}
|
|
110
|
+
declare const injectSwitchContext: (optional?: boolean) => RdxSwitchContext | null;
|
|
111
|
+
declare const provideSwitchContext: (useFactory: () => RdxSwitchContext) => _angular_core.Provider;
|
|
112
|
+
|
|
113
|
+
declare const switchImports: (typeof RdxSwitchInput | typeof RdxSwitchRoot | typeof RdxSwitchThumb)[];
|
|
114
|
+
declare class RdxSwitchModule {
|
|
115
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxSwitchModule, never>;
|
|
116
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxSwitchModule, never, [typeof RdxSwitchRoot, typeof RdxSwitchInput, typeof RdxSwitchThumb], [typeof RdxSwitchRoot, typeof RdxSwitchInput, typeof RdxSwitchThumb]>;
|
|
117
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxSwitchModule>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { RdxSwitchInput, RdxSwitchModule, RdxSwitchRoot, RdxSwitchThumb, injectSwitchContext, provideSwitchContext, switchImports };
|
|
121
|
+
export type { RdxSwitchContext };
|