@radix-ng/primitives 1.0.6 → 1.0.8
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/aspect-ratio/README.md +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +6 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +9 -34
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +43 -9
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +69 -18
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +93 -16
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +4 -3
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +43 -9
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +208 -2
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +50 -9
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +31 -5
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +276 -58
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-form.mjs +111 -27
- package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +16 -6
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +5 -4
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +39 -10
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +37 -22
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +18 -9
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +4 -4
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +26 -8
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +7 -13
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-signal-forms.mjs +184 -0
- package/fesm2022/radix-ng-primitives-signal-forms.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-slider.mjs +25 -10
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +32 -8
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +4 -4
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +49 -9
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +33 -16
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +24 -29
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +15 -2
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/package.json +11 -1
- package/types/radix-ng-primitives-accordion.d.ts +1 -0
- package/types/radix-ng-primitives-aspect-ratio.d.ts +10 -23
- package/types/radix-ng-primitives-autocomplete.d.ts +21 -2
- package/types/radix-ng-primitives-avatar.d.ts +51 -25
- package/types/radix-ng-primitives-checkbox.d.ts +78 -101
- package/types/radix-ng-primitives-combobox.d.ts +51 -2
- package/types/radix-ng-primitives-core.d.ts +206 -3
- package/types/radix-ng-primitives-date-field.d.ts +27 -2
- package/types/radix-ng-primitives-editable.d.ts +15 -2
- package/types/radix-ng-primitives-field.d.ts +165 -236
- package/types/radix-ng-primitives-form.d.ts +122 -37
- package/types/radix-ng-primitives-input.d.ts +8 -1
- package/types/radix-ng-primitives-label.d.ts +3 -2
- package/types/radix-ng-primitives-number-field.d.ts +15 -4
- package/types/radix-ng-primitives-progress.d.ts +59 -121
- package/types/radix-ng-primitives-radio.d.ts +7 -3
- package/types/radix-ng-primitives-select.d.ts +11 -3
- package/types/radix-ng-primitives-separator.d.ts +0 -7
- package/types/radix-ng-primitives-signal-forms.d.ts +97 -0
- package/types/radix-ng-primitives-slider.d.ts +9 -7
- package/types/radix-ng-primitives-switch.d.ts +15 -2
- package/types/radix-ng-primitives-time-field.d.ts +26 -2
- package/types/radix-ng-primitives-toggle-group.d.ts +13 -7
- package/types/radix-ng-primitives-toggle.d.ts +8 -8
- package/types/radix-ng-primitives-toolbar.d.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, Provider, InputSignal, WritableSignal, ModelSignal, Signal, InjectionToken, InputSignalWithTransform, OutputRef, Injector, ElementRef, EffectRef, EffectCleanupRegisterFn, CreateEffectOptions } from '@angular/core';
|
|
2
|
+
import { Type, Provider, InputSignal, WritableSignal, ModelSignal, Signal, InjectionToken, InputSignalWithTransform, OutputRef, OutputEmitterRef, Injector, ElementRef, EffectRef, EffectCleanupRegisterFn, CreateEffectOptions } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor } from '@angular/forms';
|
|
4
4
|
import { DateValue, Time, CalendarDateTime, ZonedDateTime } from '@internationalized/date';
|
|
5
5
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
@@ -859,6 +859,209 @@ interface RdxFormCheckboxControl extends RdxFormUiControl {
|
|
|
859
859
|
readonly value?: undefined;
|
|
860
860
|
}
|
|
861
861
|
|
|
862
|
+
/**
|
|
863
|
+
* Optional form-control UI state derived from a control's `invalid`/`errors`/`touched`/`dirty`
|
|
864
|
+
* inputs (the optional members of Signal Forms' `FormUiControl`), plus the two mutators every
|
|
865
|
+
* control needs.
|
|
866
|
+
*
|
|
867
|
+
* @see createFormUiState
|
|
868
|
+
*/
|
|
869
|
+
interface RdxFormUiState {
|
|
870
|
+
/** Invalid when the `invalid` input is set or the `errors` list is non-empty. */
|
|
871
|
+
readonly invalidState: Signal<boolean>;
|
|
872
|
+
/** Whether the control has been touched (reflects the `touched` model). */
|
|
873
|
+
readonly touchedState: Signal<boolean>;
|
|
874
|
+
/** Whether the value changed from its initial value — external `dirty` OR internal tracking. */
|
|
875
|
+
readonly dirtyState: Signal<boolean>;
|
|
876
|
+
/** Mark the control touched: bridges the CVA (if any) + sets the `touched` model + emits `touch`. */
|
|
877
|
+
markAsTouched(): void;
|
|
878
|
+
/** Flag the control dirty after a value change (feeds {@link dirtyState}). */
|
|
879
|
+
markDirty(): void;
|
|
880
|
+
}
|
|
881
|
+
/** Minimal `ControlValueAccessor` surface the form-UI state bridges for the dual (Reactive/template) path. */
|
|
882
|
+
interface RdxFormUiTouchTarget {
|
|
883
|
+
markAsTouched(): void;
|
|
884
|
+
}
|
|
885
|
+
/** Inputs a control passes to {@link createFormUiState} — its own `FormUiControl` signals. */
|
|
886
|
+
interface RdxFormUiStateOptions {
|
|
887
|
+
readonly invalid: Signal<boolean>;
|
|
888
|
+
readonly errors: Signal<readonly RdxValidationError[]>;
|
|
889
|
+
readonly touched: ModelSignal<boolean>;
|
|
890
|
+
readonly touch: OutputEmitterRef<void>;
|
|
891
|
+
readonly dirty: Signal<boolean>;
|
|
892
|
+
/**
|
|
893
|
+
* The control's `ControlValueAccessor`, if it has one (dual controls — switch, number-field, …).
|
|
894
|
+
* Omit or pass `null` for Signal-Forms-only controls without a CVA (e.g. select).
|
|
895
|
+
*/
|
|
896
|
+
readonly cva?: RdxFormUiTouchTarget | null;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Builds the shared form-UI state and its mutators from a control's input signals, removing the
|
|
900
|
+
* per-control copy-paste of the `invalidState`/`touchedState`/`dirtyState` computeds and the
|
|
901
|
+
* `markAsTouched`/`markDirty` logic.
|
|
902
|
+
*
|
|
903
|
+
* **Why the inputs stay on the control (not in here):** Angular's compiler only discovers
|
|
904
|
+
* `input()`/`model()` declared as field initializers, and Signal Forms binds form-written state
|
|
905
|
+
* (`errors`/`disabled`/`touched`) onto the single directive that carries the `value`/`checked`
|
|
906
|
+
* model — so the inputs must co-locate with `value` on the control directive. This helper takes
|
|
907
|
+
* those signals and centralizes only the derivation.
|
|
908
|
+
*
|
|
909
|
+
* Safe to call from a field initializer: `signal()`/`computed()` need no injection context.
|
|
910
|
+
*/
|
|
911
|
+
declare function createFormUiState(options: RdxFormUiStateOptions): RdxFormUiState;
|
|
912
|
+
/**
|
|
913
|
+
* The subset of a compound primitive's context that surfaces the shared form-UI state to its child
|
|
914
|
+
* parts (so a trigger/button/input can reflect `data-invalid`/`data-touched`/`data-dirty` and call
|
|
915
|
+
* `markAsTouched()`). Compound-control context interfaces should `extends` this.
|
|
916
|
+
*/
|
|
917
|
+
interface RdxFormUiStateContext {
|
|
918
|
+
invalidState: Signal<boolean>;
|
|
919
|
+
touchedState: Signal<boolean>;
|
|
920
|
+
dirtyState: Signal<boolean>;
|
|
921
|
+
markAsTouched: () => void;
|
|
922
|
+
}
|
|
923
|
+
/** Spread helper to wire {@link RdxFormUiStateContext} fields from an {@link RdxFormUiState} into a context factory. */
|
|
924
|
+
declare function formUiStateContext(state: RdxFormUiState): RdxFormUiStateContext;
|
|
925
|
+
/** DI token holding the control's {@link RdxFormUiState}, read by {@link RdxFormUiStateHost}. */
|
|
926
|
+
declare const RDX_FORM_UI_STATE: InjectionToken<RdxFormUiState>;
|
|
927
|
+
/**
|
|
928
|
+
* Tri-state *displayed* validity (`true` valid / `false` invalid / `null` neutral) an enclosing `Field`
|
|
929
|
+
* exposes so a control can reflect the field's single, gated display-state instead of its own eager
|
|
930
|
+
* invalid. A control inside a `rdxFieldRoot` reads this for its `data-valid` / `data-invalid` /
|
|
931
|
+
* `aria-invalid`; standalone (token absent) it falls back to its own binary invalidity. This keeps the
|
|
932
|
+
* field root, the control, and any trigger/group part on one display-state (Base UI's `valid: boolean |
|
|
933
|
+
* null`). `Field` provides it (`useFactory` over the root's `validState`).
|
|
934
|
+
*/
|
|
935
|
+
declare const RDX_FIELD_VALIDITY: InjectionToken<Signal<boolean | null>>;
|
|
936
|
+
/**
|
|
937
|
+
* Tri-state display validity: when inside a `Field` the field's gated `validState` is the **single
|
|
938
|
+
* source** (the control reflects it, including its `validationMode` neutral state); standalone, the
|
|
939
|
+
* control's own binary invalidity.
|
|
940
|
+
*
|
|
941
|
+
* **Contract:** inside a `Field` a control's own `invalid` / `errors` inputs are **not** displayed — the
|
|
942
|
+
* Field owns displayed validity. Drive validity through the Field instead: bind `rdxSignalField`
|
|
943
|
+
* (Signal Forms), or set `[invalid]` on `rdxFieldRoot`. The control's own `invalid`/`errors` are for
|
|
944
|
+
* standalone use.
|
|
945
|
+
*/
|
|
946
|
+
declare function resolveDisplayValid(fieldValidity: Signal<boolean | null> | null, ownInvalid: Signal<boolean>): boolean | null;
|
|
947
|
+
/**
|
|
948
|
+
* Provide a control's {@link RdxFormUiState} on its host element so {@link RdxFormUiStateHost} can
|
|
949
|
+
* reflect it. Pair with `hostDirectives: [RdxFormUiStateHost]`:
|
|
950
|
+
*
|
|
951
|
+
* ```ts
|
|
952
|
+
* providers: [provideFormUiState(() => inject(MyControl).formUi)],
|
|
953
|
+
* hostDirectives: [RdxFormUiStateHost]
|
|
954
|
+
* ```
|
|
955
|
+
*/
|
|
956
|
+
declare function provideFormUiState(state: () => RdxFormUiState): Provider;
|
|
957
|
+
/**
|
|
958
|
+
* Host directive that reflects a control's {@link RdxFormUiState} as the standard validation
|
|
959
|
+
* `data-*`/`aria-invalid` attributes and marks the control touched on focus-out — the binding block
|
|
960
|
+
* that was otherwise copy-pasted into every form control's `host`.
|
|
961
|
+
*
|
|
962
|
+
* Compose it via `hostDirectives` on a control (or group root) whose host element is the one that
|
|
963
|
+
* should carry the attributes, and provide the state with {@link provideFormUiState}. It reads the
|
|
964
|
+
* state from DI, so the control does not need to expose `invalidState`/`touchedState`/`dirtyState`
|
|
965
|
+
* or a `markAsTouched` method just for the host bindings.
|
|
966
|
+
*
|
|
967
|
+
* Note: the `focusout` listener marks touched for controls whose touched-trigger is blur/focus-out
|
|
968
|
+
* (text inputs, groups). Controls that latch touched on interaction instead (e.g. checkbox) still do
|
|
969
|
+
* so themselves; the extra focus-out call only ever sets `touched` to `true`, so it is harmless.
|
|
970
|
+
*
|
|
971
|
+
* Not for compound controls that surface state on a child part via context (e.g. select reflects on
|
|
972
|
+
* its trigger) — those keep their own child-part bindings.
|
|
973
|
+
*/
|
|
974
|
+
declare class RdxFormUiStateHost {
|
|
975
|
+
/** @ignore The injected state the host bindings read. */
|
|
976
|
+
protected readonly formUi: RdxFormUiState;
|
|
977
|
+
private readonly fieldValidity;
|
|
978
|
+
/** @ignore Tri-state display validity (enclosing Field's gated state, else own invalidity). */
|
|
979
|
+
protected readonly displayValid: Signal<boolean | null>;
|
|
980
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxFormUiStateHost, never>;
|
|
981
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxFormUiStateHost, never, never, {}, {}, never, never, true, never>;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Abstract base that declares the optional `FormUiControl` state inputs
|
|
985
|
+
* (`invalid`/`errors`/`touched`/`dirty` + the `touch` output) once and builds the control's
|
|
986
|
+
* {@link RdxFormUiState} from them, so a control directive can inherit the whole surface with a
|
|
987
|
+
* single `extends` instead of re-declaring it.
|
|
988
|
+
*
|
|
989
|
+
* The declarations must live on a decorated **directive class** (Angular only discovers
|
|
990
|
+
* `input()`/`model()`/`output()` as field initializers, and Signal Forms binds form-written state
|
|
991
|
+
* onto the single directive carrying the `value`/`checked` model) — inheritance keeps them on that
|
|
992
|
+
* directive, which a host directive could not. The control still declares its own `value`/`checked`
|
|
993
|
+
* model (the type-parametric part) and, for `data-*` reflection, either composes
|
|
994
|
+
* {@link RdxFormUiStateHost} or binds the attributes itself.
|
|
995
|
+
*
|
|
996
|
+
* Dual controls override {@link formUiTouchTarget} to bridge their `ControlValueAccessor` into
|
|
997
|
+
* `markAsTouched`.
|
|
998
|
+
*/
|
|
999
|
+
declare abstract class RdxFormUiControlBase {
|
|
1000
|
+
/** Whether the control is invalid. A non-empty {@link errors} list also marks it invalid. */
|
|
1001
|
+
readonly invalid: i0.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1002
|
+
/** Whether the control has been touched. A `model()` so Signal Forms can write it; set on blur/focus-out. */
|
|
1003
|
+
readonly touched: ModelSignal<boolean>;
|
|
1004
|
+
/** Whether the value changed from its initial value. Merged with internal tracking. */
|
|
1005
|
+
readonly dirty: i0.InputSignalWithTransform<boolean, BooleanInput>;
|
|
1006
|
+
/** Validation errors for the control. A non-empty list marks it invalid. */
|
|
1007
|
+
readonly errors: i0.InputSignal<readonly RdxValidationError[]>;
|
|
1008
|
+
/** Emits when the control is touched, notifying Signal Forms (stable Angular 22 contract). */
|
|
1009
|
+
readonly touch: OutputEmitterRef<void>;
|
|
1010
|
+
/** The shared form-UI state derived from the inputs above. Call `formUi.markDirty()` on value change. */
|
|
1011
|
+
readonly formUi: RdxFormUiState;
|
|
1012
|
+
/** The enclosing Field's tri-state display validity, if any. `protected` so a control whose own
|
|
1013
|
+
* invalidity is richer than `formUi.invalidState` (e.g. date/time-field add a parse check) can build
|
|
1014
|
+
* its own `displayValid` from it. */
|
|
1015
|
+
protected readonly fieldValidity: Signal<boolean | null> | null;
|
|
1016
|
+
/**
|
|
1017
|
+
* Tri-state *displayed* validity for controls that bind their own host attributes (radio, switch,
|
|
1018
|
+
* number-field): the enclosing Field's gated state when inside a `rdxFieldRoot`, else this control's
|
|
1019
|
+
* own binary invalidity (`formUi.invalidState`). Bind `data-valid`/`data-invalid`/`aria-invalid` to
|
|
1020
|
+
* this so a neutral field shows neither. Controls whose `invalidState` is richer than
|
|
1021
|
+
* `formUi.invalidState` override this with `resolveDisplayValid(this.fieldValidity, this.invalidState)`.
|
|
1022
|
+
*/
|
|
1023
|
+
readonly displayValid: Signal<boolean | null>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Override to bridge the control's `ControlValueAccessor` into `markAsTouched` (dual controls —
|
|
1026
|
+
* return `injectControlValueAccessor()` or a `{ markAsTouched }` adapter). Default: no CVA
|
|
1027
|
+
* (Signal-Forms-only controls such as select).
|
|
1028
|
+
*/
|
|
1029
|
+
protected formUiTouchTarget(): RdxFormUiTouchTarget | null;
|
|
1030
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxFormUiControlBase, never>;
|
|
1031
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxFormUiControlBase, never, never, { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; }, { "touched": "touchedChange"; "touch": "touch"; }, never, never, true, never>;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* When a `Field` reveals its validity (the `data-valid` / `data-invalid` styling and the error message)
|
|
1036
|
+
* — the form-system-agnostic equivalent of Base UI's `validationMode` and Angular Material's
|
|
1037
|
+
* `ErrorStateMatcher`. The control/adapter always reports the **actual** state (`invalid` / `errors` /
|
|
1038
|
+
* `touched` / `dirty`); the Field decides **when** to surface it from this mode.
|
|
1039
|
+
*
|
|
1040
|
+
* - `'always'` — reflect validity immediately (an empty required field shows its error on first render).
|
|
1041
|
+
* - `'onChange'` — reveal once the user has changed the value (dirty), or the form submitted. A blur
|
|
1042
|
+
* alone does not reveal — that is `'onBlur'`'s behavior.
|
|
1043
|
+
* - `'onBlur'` — reveal once the field has been touched (blurred), or the form submitted (the default).
|
|
1044
|
+
* - `'onSubmit'` — reveal only after a submit has been attempted.
|
|
1045
|
+
*
|
|
1046
|
+
* Server/external errors are **not** gated by this mode — they surface immediately (they were set
|
|
1047
|
+
* explicitly, e.g. from a submit response).
|
|
1048
|
+
*/
|
|
1049
|
+
type RdxValidationMode = 'always' | 'onChange' | 'onBlur' | 'onSubmit';
|
|
1050
|
+
/** The default validation-display mode when neither `rdxFieldRoot` nor `rdxFormRoot` sets one. */
|
|
1051
|
+
declare const RDX_DEFAULT_VALIDATION_MODE: RdxValidationMode;
|
|
1052
|
+
/** The field interaction state {@link isValidationRevealed} reads to decide whether to reveal validity. */
|
|
1053
|
+
interface RdxValidationInteraction {
|
|
1054
|
+
touched: boolean;
|
|
1055
|
+
dirty: boolean;
|
|
1056
|
+
submitAttempted: boolean;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Whether a Field should reveal its (client-side) validity given the {@link RdxValidationMode} and the
|
|
1060
|
+
* field's interaction state. `false` means stay neutral (neither `data-valid` nor `data-invalid`, error
|
|
1061
|
+
* hidden); `true` means reflect the actual validity.
|
|
1062
|
+
*/
|
|
1063
|
+
declare function isValidationRevealed(mode: RdxValidationMode, interaction: RdxValidationInteraction): boolean;
|
|
1064
|
+
|
|
862
1065
|
interface RdxCancelableChangeEventDetails<Reason extends string = string> {
|
|
863
1066
|
reason: Reason;
|
|
864
1067
|
event: Event;
|
|
@@ -1850,5 +2053,5 @@ declare enum RdxPositionAlign {
|
|
|
1850
2053
|
End = "end"
|
|
1851
2054
|
}
|
|
1852
2055
|
|
|
1853
|
-
export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, DOCS_BASE_URL, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RDX_FLOATING_REGISTRATION, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_TREE, RDX_INTERNAL_BACKDROP_ATTR, RDX_SCROLL_LOCKED_ATTR, RdxControlValueAccessor, RdxFloatingNode, RdxFloatingNodeRegistration, RdxFloatingRegistrationContext, RdxFloatingRootContext, RdxFloatingTree, RdxIdGenerator, RdxLiveAnnouncer, RdxPositionAlign, RdxPositionSide, RdxTriggerRegistry, SHIFT, SPACE, SPACE_CODE, TAB, TIME_GRANULARITIES, a, areAllDaysBetweenValid, clamp, createCancelableChangeEventDetails, createContent, createContext, createFloatingEvents, createFloatingRootContext, createFormatter, createMonth, createMonths, docsUrl, elementSize, getActiveElement, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMaxTransitionDuration, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectFloatingRootContext, injectId, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isItemEqualToValue, isNullish, isNumberString, isSegmentNavigationKey, isZonedDateTime, itemToStringLabel, itemToStringValue, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideFloatingRegistration, provideFloatingRootContext, provideFloatingTree, provideToken, provideValueAccessor, rdxCheckLabelElement, rdxCheckTriggerElement, rdxDevError, rdxDevWarning, resetRdxDevWarnings, resizeEffect, resolveFloatingTree, roundToStepPrecision, segmentBuilders, setupInternalBackdrop, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useAnchoredScrollLock, useArrowNavigation, useDateField, useFilter, useGraceArea, useListHighlight, usePointerDrag, useScrollLock, useTransitionStatus, watch };
|
|
1854
|
-
export type { AcceptableValue, AnyExceptLiteral, AriaLivePoliteness, BooleanInput, CreateMonthProps, DataOrientation, DateAndTimeSegmentObj, DateFormatterOptions, DateMatcher, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DayPeriod, Direction, EditableSegmentPart, FilterPredicates, Formatter, Granularity, HourCycle, InjectContext, ItemValueComparator, ListHighlight, Month, NonEditableSegmentPart, Nullable, NumberInput, PlaceholderMap, RdxAnchoredScrollLockOptions, RdxCancelableChangeEventDetails, RdxCancelableChangeEventTransaction, RdxFloatingEventMap, RdxFloatingEvents, RdxFloatingLifecycle, RdxFloatingNodeInit, RdxFloatingParentOverride, RdxFloatingRegistrationReader, RdxFloatingRegistrationStatus, RdxFloatingRootContextEventMap, RdxFloatingRootContextInit, RdxFormCheckboxControl, RdxFormStateInput, RdxFormUiControl, RdxFormValueControl, RdxInternalBackdropOptions, RdxPointerDragHandlers, RdxScrollLockOptions, RdxTransitionStatus, RdxTransitionStatusRef, RdxValidationError, SafeFunction, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps, UseFilterOptions, UseListHighlightOptions };
|
|
2056
|
+
export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, DOCS_BASE_URL, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RDX_DEFAULT_VALIDATION_MODE, RDX_FIELD_VALIDITY, RDX_FLOATING_REGISTRATION, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_TREE, RDX_FORM_UI_STATE, RDX_INTERNAL_BACKDROP_ATTR, RDX_SCROLL_LOCKED_ATTR, RdxControlValueAccessor, RdxFloatingNode, RdxFloatingNodeRegistration, RdxFloatingRegistrationContext, RdxFloatingRootContext, RdxFloatingTree, RdxFormUiControlBase, RdxFormUiStateHost, RdxIdGenerator, RdxLiveAnnouncer, RdxPositionAlign, RdxPositionSide, RdxTriggerRegistry, SHIFT, SPACE, SPACE_CODE, TAB, TIME_GRANULARITIES, a, areAllDaysBetweenValid, clamp, createCancelableChangeEventDetails, createContent, createContext, createFloatingEvents, createFloatingRootContext, createFormUiState, createFormatter, createMonth, createMonths, docsUrl, elementSize, formUiStateContext, getActiveElement, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMaxTransitionDuration, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectFloatingRootContext, injectId, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isItemEqualToValue, isNullish, isNumberString, isSegmentNavigationKey, isValidationRevealed, isZonedDateTime, itemToStringLabel, itemToStringValue, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideFloatingRegistration, provideFloatingRootContext, provideFloatingTree, provideFormUiState, provideToken, provideValueAccessor, rdxCheckLabelElement, rdxCheckTriggerElement, rdxDevError, rdxDevWarning, resetRdxDevWarnings, resizeEffect, resolveDisplayValid, resolveFloatingTree, roundToStepPrecision, segmentBuilders, setupInternalBackdrop, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useAnchoredScrollLock, useArrowNavigation, useDateField, useFilter, useGraceArea, useListHighlight, usePointerDrag, useScrollLock, useTransitionStatus, watch };
|
|
2057
|
+
export type { AcceptableValue, AnyExceptLiteral, AriaLivePoliteness, BooleanInput, CreateMonthProps, DataOrientation, DateAndTimeSegmentObj, DateFormatterOptions, DateMatcher, DateRange, DateSegmentObj, DateSegmentPart, DateStep, DayPeriod, Direction, EditableSegmentPart, FilterPredicates, Formatter, Granularity, HourCycle, InjectContext, ItemValueComparator, ListHighlight, Month, NonEditableSegmentPart, Nullable, NumberInput, PlaceholderMap, RdxAnchoredScrollLockOptions, RdxCancelableChangeEventDetails, RdxCancelableChangeEventTransaction, RdxFloatingEventMap, RdxFloatingEvents, RdxFloatingLifecycle, RdxFloatingNodeInit, RdxFloatingParentOverride, RdxFloatingRegistrationReader, RdxFloatingRegistrationStatus, RdxFloatingRootContextEventMap, RdxFloatingRootContextInit, RdxFormCheckboxControl, RdxFormStateInput, RdxFormUiControl, RdxFormUiState, RdxFormUiStateContext, RdxFormUiStateOptions, RdxFormUiTouchTarget, RdxFormValueControl, RdxInternalBackdropOptions, RdxPointerDragHandlers, RdxScrollLockOptions, RdxTransitionStatus, RdxTransitionStatusRef, RdxValidationError, RdxValidationInteraction, RdxValidationMode, SafeFunction, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeSegmentObj, TimeSegmentPart, TimeValue, UseDateFieldProps, UseFilterOptions, UseListHighlightOptions };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, InjectionToken, InputSignal, ModelSignal, WritableSignal } from '@angular/core';
|
|
3
3
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
-
import { DateMatcher, HourCycle, Granularity, Direction, BooleanInput, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
|
|
4
|
+
import { RdxFormUiControlBase, RdxFormValueControl, DateMatcher, HourCycle, Granularity, Direction, BooleanInput, DateStep, Formatter, SegmentValueObj, SegmentPart } from '@radix-ng/primitives/core';
|
|
5
5
|
import { DateValue } from '@internationalized/date';
|
|
6
6
|
|
|
7
|
-
declare class RdxDateFieldRootDirective {
|
|
7
|
+
declare class RdxDateFieldRootDirective extends RdxFormUiControlBase implements RdxFormValueControl<DateValue | undefined> {
|
|
8
8
|
/**
|
|
9
9
|
* The controlled value of the date field.
|
|
10
10
|
*/
|
|
@@ -96,6 +96,25 @@ declare class RdxDateFieldRootDirective {
|
|
|
96
96
|
* @ignore
|
|
97
97
|
*/
|
|
98
98
|
readonly isInvalid: Signal<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* @ignore Effective invalid: the built-in range/availability check OR the form-driven
|
|
101
|
+
* `invalid` / `errors` (Signal Forms). Reflected on the root and segments.
|
|
102
|
+
*/
|
|
103
|
+
readonly invalidState: Signal<boolean>;
|
|
104
|
+
/**
|
|
105
|
+
* @ignore Tri-state display validity: the enclosing Field's gated state when inside a `rdxFieldRoot`,
|
|
106
|
+
* else the date-field's own (parse + form) invalidity. Overrides the base (whose default uses only
|
|
107
|
+
* `formUi.invalidState`) so the standalone path keeps the built-in range/availability check.
|
|
108
|
+
*/
|
|
109
|
+
readonly displayValid: Signal<boolean | null>;
|
|
110
|
+
/** @ignore */
|
|
111
|
+
readonly touchedState: Signal<boolean>;
|
|
112
|
+
/** @ignore */
|
|
113
|
+
readonly dirtyState: Signal<boolean>;
|
|
114
|
+
/** @ignore Whether the user has focused a segment — gates dirty tracking so a form/initial seed of `value` doesn't mark dirty. */
|
|
115
|
+
private readonly userInteracted;
|
|
116
|
+
/** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on segment blur. */
|
|
117
|
+
markAsTouched(): void;
|
|
99
118
|
/**
|
|
100
119
|
* @ignore
|
|
101
120
|
*/
|
|
@@ -168,6 +187,8 @@ declare class RdxDateFieldInputDirective {
|
|
|
168
187
|
* @ignore
|
|
169
188
|
*/
|
|
170
189
|
readonly isInvalid: _angular_core.Signal<boolean>;
|
|
190
|
+
/** @ignore Tri-state display validity from the root (gated by an enclosing Field). */
|
|
191
|
+
readonly displayValid: _angular_core.Signal<boolean | null>;
|
|
171
192
|
/**
|
|
172
193
|
* @ignore
|
|
173
194
|
*/
|
|
@@ -211,6 +232,10 @@ interface DateFieldContextToken {
|
|
|
211
232
|
disabled: InputSignal<boolean>;
|
|
212
233
|
readonly: InputSignal<boolean>;
|
|
213
234
|
isInvalid: Signal<boolean>;
|
|
235
|
+
/** Effective invalid: the built-in range/availability check OR the form-driven invalid state. */
|
|
236
|
+
invalidState: Signal<boolean>;
|
|
237
|
+
/** Tri-state displayed validity (`true`/`false`/`null`): the field's gated state inside a Field, else own. */
|
|
238
|
+
displayValid: Signal<boolean | null>;
|
|
214
239
|
placeholder: ModelSignal<DateValue>;
|
|
215
240
|
hourCycle: InputSignal<HourCycle>;
|
|
216
241
|
step$: Signal<DateStep>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, WritableSignal } from '@angular/core';
|
|
3
3
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
-
import { BooleanInput, NumberInput, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
4
|
+
import { RdxFormUiControlBase, RdxFormValueControl, BooleanInput, NumberInput, RdxCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
5
5
|
import * as i1 from '@radix-ng/primitives/dismissable-layer';
|
|
6
6
|
import * as _radix_ng_primitives_editable from '@radix-ng/primitives/editable';
|
|
7
7
|
|
|
@@ -15,6 +15,11 @@ interface RdxEditableValueChangeEvent {
|
|
|
15
15
|
}
|
|
16
16
|
type EditableRootContext = {
|
|
17
17
|
disabled: Signal<boolean>;
|
|
18
|
+
invalidState: Signal<boolean>;
|
|
19
|
+
/** Tri-state displayed validity (`true`/`false`/`null`): the field's gated state inside a Field, else own. */
|
|
20
|
+
displayValid: Signal<boolean | null>;
|
|
21
|
+
touchedState: Signal<boolean>;
|
|
22
|
+
dirtyState: Signal<boolean>;
|
|
18
23
|
value: Signal<string | undefined>;
|
|
19
24
|
inputValue: WritableSignal<string | undefined>;
|
|
20
25
|
placeholder: Signal<{
|
|
@@ -43,10 +48,16 @@ declare const provideEditableRootContext: (useFactory: () => EditableRootContext
|
|
|
43
48
|
/**
|
|
44
49
|
* @group Components
|
|
45
50
|
*/
|
|
46
|
-
declare class RdxEditableRoot {
|
|
51
|
+
declare class RdxEditableRoot extends RdxFormUiControlBase implements RdxFormValueControl<string | undefined> {
|
|
47
52
|
private readonly focusOutside;
|
|
48
53
|
private readonly pointerDownOutside;
|
|
49
54
|
readonly value: _angular_core.ModelSignal<string | undefined>;
|
|
55
|
+
/** @ignore */
|
|
56
|
+
readonly invalidState: Signal<boolean>;
|
|
57
|
+
/** @ignore */
|
|
58
|
+
readonly touchedState: Signal<boolean>;
|
|
59
|
+
/** @ignore */
|
|
60
|
+
readonly dirtyState: Signal<boolean>;
|
|
50
61
|
/** Uncontrolled initial value. */
|
|
51
62
|
readonly defaultValue: _angular_core.InputSignal<string | undefined>;
|
|
52
63
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
@@ -80,6 +91,8 @@ declare class RdxEditableRoot {
|
|
|
80
91
|
private suppressFocusActivation;
|
|
81
92
|
constructor();
|
|
82
93
|
canActivateOnFocus(): boolean;
|
|
94
|
+
/** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on leaving edit mode. */
|
|
95
|
+
markAsTouched(): void;
|
|
83
96
|
handleDismiss(): void;
|
|
84
97
|
submit(event?: Event): void;
|
|
85
98
|
cancel(): void;
|