@radix-ng/primitives 1.0.0-beta.1 → 1.0.0-beta.3
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/LICENSE +1 -1
- package/README.md +76 -6
- package/fesm2022/radix-ng-primitives-accordion.mjs +2 -2
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +30 -24
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +1786 -0
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs +14 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +2 -2
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +1983 -0
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +480 -469
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +11 -0
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +44 -46
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +154 -64
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +86 -6
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-fieldset.mjs +1 -1
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +1 -1
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-form.mjs +207 -0
- package/fesm2022/radix-ng-primitives-form.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-input.mjs +85 -4
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +44 -24
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +39 -55
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +2 -2
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +36 -51
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +12 -6
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +107 -17
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +262 -79
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +37 -51
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +3 -3
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +469 -258
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +3 -2
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +27 -3
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +2 -2
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +39 -42
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +13 -1
- package/schematics/ng-add/index.js +57 -0
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +1 -0
- package/schematics/ng-add/schema.json +6 -0
- package/types/radix-ng-primitives-alert-dialog.d.ts +17 -11
- package/types/radix-ng-primitives-autocomplete.d.ts +596 -0
- package/types/radix-ng-primitives-combobox.d.ts +1310 -0
- package/types/radix-ng-primitives-core.d.ts +148 -56
- package/types/radix-ng-primitives-dialog.d.ts +32 -25
- package/types/radix-ng-primitives-drawer.d.ts +49 -22
- package/types/radix-ng-primitives-field.d.ts +71 -2
- package/types/radix-ng-primitives-form.d.ts +124 -0
- package/types/radix-ng-primitives-input.d.ts +75 -5
- package/types/radix-ng-primitives-menu.d.ts +19 -10
- package/types/radix-ng-primitives-navigation-menu.d.ts +24 -26
- package/types/radix-ng-primitives-popover.d.ts +23 -23
- package/types/radix-ng-primitives-popper.d.ts +7 -1
- package/types/radix-ng-primitives-portal.d.ts +53 -8
- package/types/radix-ng-primitives-presence.d.ts +98 -17
- package/types/radix-ng-primitives-preview-card.d.ts +24 -23
- package/types/radix-ng-primitives-select.d.ts +294 -137
- package/types/radix-ng-primitives-tooltip.d.ts +26 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _radix_ng_primitives_field from '@radix-ng/primitives/field';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
4
|
-
import { BooleanInput } from '@radix-ng/primitives/core';
|
|
4
|
+
import { BooleanInput, RdxValidationError } from '@radix-ng/primitives/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Connects a form control to the field label, description, error, and state.
|
|
@@ -11,8 +11,11 @@ import { BooleanInput } from '@radix-ng/primitives/core';
|
|
|
11
11
|
declare class RdxFieldControl {
|
|
12
12
|
protected readonly rootContext: {
|
|
13
13
|
controlId: _angular_core.WritableSignal<string>;
|
|
14
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
14
15
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
15
16
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
17
|
+
messages: _angular_core.Signal<string[]>;
|
|
18
|
+
notifyEdited: () => void;
|
|
16
19
|
invalidState: _angular_core.Signal<boolean>;
|
|
17
20
|
disabledState: _angular_core.Signal<boolean>;
|
|
18
21
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -60,8 +63,11 @@ declare class RdxFieldControl {
|
|
|
60
63
|
declare class RdxFieldDescription {
|
|
61
64
|
protected readonly rootContext: {
|
|
62
65
|
controlId: _angular_core.WritableSignal<string>;
|
|
66
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
63
67
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
64
68
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
69
|
+
messages: _angular_core.Signal<string[]>;
|
|
70
|
+
notifyEdited: () => void;
|
|
65
71
|
invalidState: _angular_core.Signal<boolean>;
|
|
66
72
|
disabledState: _angular_core.Signal<boolean>;
|
|
67
73
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -101,8 +107,11 @@ declare class RdxFieldDescription {
|
|
|
101
107
|
declare class RdxFieldError {
|
|
102
108
|
protected readonly rootContext: {
|
|
103
109
|
controlId: _angular_core.WritableSignal<string>;
|
|
110
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
104
111
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
105
112
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
113
|
+
messages: _angular_core.Signal<string[]>;
|
|
114
|
+
notifyEdited: () => void;
|
|
106
115
|
invalidState: _angular_core.Signal<boolean>;
|
|
107
116
|
disabledState: _angular_core.Signal<boolean>;
|
|
108
117
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -128,6 +137,12 @@ declare class RdxFieldError {
|
|
|
128
137
|
* @group Props
|
|
129
138
|
*/
|
|
130
139
|
readonly id: _angular_core.InputSignal<string>;
|
|
140
|
+
/**
|
|
141
|
+
* The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render
|
|
142
|
+
* them explicitly via the `exportAs` reference — the directive never injects text content itself:
|
|
143
|
+
* `<p rdxFieldError #err="rdxFieldError">{{ err.messages().join(' ') }}</p>`.
|
|
144
|
+
*/
|
|
145
|
+
readonly messages: _angular_core.Signal<string[]>;
|
|
131
146
|
constructor();
|
|
132
147
|
protected readonly dataAttr: (value: boolean) => "" | undefined;
|
|
133
148
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxFieldError, never>;
|
|
@@ -142,8 +157,11 @@ declare class RdxFieldError {
|
|
|
142
157
|
declare class RdxFieldLabel {
|
|
143
158
|
protected readonly rootContext: {
|
|
144
159
|
controlId: _angular_core.WritableSignal<string>;
|
|
160
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
145
161
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
146
162
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
163
|
+
messages: _angular_core.Signal<string[]>;
|
|
164
|
+
notifyEdited: () => void;
|
|
147
165
|
invalidState: _angular_core.Signal<boolean>;
|
|
148
166
|
disabledState: _angular_core.Signal<boolean>;
|
|
149
167
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -195,11 +213,23 @@ interface RdxFieldState {
|
|
|
195
213
|
touched?: () => boolean;
|
|
196
214
|
filled?: () => boolean;
|
|
197
215
|
focused?: () => boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Optional source of error *content* (not just the invalid boolean). When provided and non-empty
|
|
218
|
+
* it forces `invalidState` true, and its messages (`message ?? kind` per error) surface through
|
|
219
|
+
* `RdxFieldError.messages()` ahead of any enclosing Form's external messages. Uses `core`'s
|
|
220
|
+
* framework-free shim type so the seam stays free of `@angular/forms/signals` (ADR 0004 amendment).
|
|
221
|
+
*/
|
|
222
|
+
errors?: () => RdxValidationError[];
|
|
198
223
|
}
|
|
199
224
|
declare const fieldRootContext: () => {
|
|
200
225
|
controlId: _angular_core.WritableSignal<string>;
|
|
226
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
201
227
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
202
228
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
229
|
+
/** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */
|
|
230
|
+
messages: _angular_core.Signal<string[]>;
|
|
231
|
+
/** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */
|
|
232
|
+
notifyEdited: () => void;
|
|
203
233
|
invalidState: _angular_core.Signal<boolean>;
|
|
204
234
|
disabledState: _angular_core.Signal<boolean>;
|
|
205
235
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -228,8 +258,13 @@ declare const fieldRootContext: () => {
|
|
|
228
258
|
type RdxFieldRootContext = ReturnType<typeof fieldRootContext>;
|
|
229
259
|
declare const injectFieldRootContext: _radix_ng_primitives_core.InjectContext<{
|
|
230
260
|
controlId: _angular_core.WritableSignal<string>;
|
|
261
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
231
262
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
232
263
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
264
|
+
/** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */
|
|
265
|
+
messages: _angular_core.Signal<string[]>;
|
|
266
|
+
/** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */
|
|
267
|
+
notifyEdited: () => void;
|
|
233
268
|
invalidState: _angular_core.Signal<boolean>;
|
|
234
269
|
disabledState: _angular_core.Signal<boolean>;
|
|
235
270
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -257,8 +292,13 @@ declare const injectFieldRootContext: _radix_ng_primitives_core.InjectContext<{
|
|
|
257
292
|
}>;
|
|
258
293
|
declare const provideFieldRootContext: (useFactory: () => {
|
|
259
294
|
controlId: _angular_core.WritableSignal<string>;
|
|
295
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
260
296
|
descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
261
297
|
errorIds: _angular_core.WritableSignal<string[]>;
|
|
298
|
+
/** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */
|
|
299
|
+
messages: _angular_core.Signal<string[]>;
|
|
300
|
+
/** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */
|
|
301
|
+
notifyEdited: () => void;
|
|
262
302
|
invalidState: _angular_core.Signal<boolean>;
|
|
263
303
|
disabledState: _angular_core.Signal<boolean>;
|
|
264
304
|
requiredState: _angular_core.Signal<boolean>;
|
|
@@ -337,6 +377,15 @@ declare class RdxFieldRoot {
|
|
|
337
377
|
* @group Props
|
|
338
378
|
*/
|
|
339
379
|
readonly focused: _angular_core.InputSignal<boolean | undefined>;
|
|
380
|
+
/**
|
|
381
|
+
* Identifies the field to an enclosing Form for external (server) error matching. Fields without a
|
|
382
|
+
* `name` never match external errors.
|
|
383
|
+
*
|
|
384
|
+
* @group Props
|
|
385
|
+
*/
|
|
386
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
387
|
+
/** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */
|
|
388
|
+
private readonly formContext;
|
|
340
389
|
readonly controlId: _angular_core.WritableSignal<string>;
|
|
341
390
|
readonly descriptionIds: _angular_core.WritableSignal<string[]>;
|
|
342
391
|
readonly errorIds: _angular_core.WritableSignal<string[]>;
|
|
@@ -348,6 +397,12 @@ declare class RdxFieldRoot {
|
|
|
348
397
|
private readonly stateProvider;
|
|
349
398
|
/** Whether an external adapter currently owns field state. */
|
|
350
399
|
readonly hasStateProvider: _angular_core.Signal<boolean>;
|
|
400
|
+
/** Error content from a registered state provider (e.g. a Signal Forms adapter). */
|
|
401
|
+
private readonly providerErrors;
|
|
402
|
+
/** External messages from the enclosing Form matched by this field's `name`. */
|
|
403
|
+
readonly externalErrors: _angular_core.Signal<string[]>;
|
|
404
|
+
/** Provider messages first (`message ?? kind`), then the Form's external messages. */
|
|
405
|
+
readonly messages: _angular_core.Signal<string[]>;
|
|
351
406
|
readonly invalidState: _angular_core.Signal<boolean>;
|
|
352
407
|
readonly disabledState: _angular_core.Signal<boolean>;
|
|
353
408
|
readonly requiredState: _angular_core.Signal<boolean>;
|
|
@@ -356,6 +411,20 @@ declare class RdxFieldRoot {
|
|
|
356
411
|
readonly filledState: _angular_core.Signal<boolean>;
|
|
357
412
|
readonly focusedState: _angular_core.Signal<boolean>;
|
|
358
413
|
protected readonly dataAttr: (value: boolean) => "" | undefined;
|
|
414
|
+
constructor();
|
|
415
|
+
/** Notify the enclosing Form (if any) that this field's control was edited (clear-on-edit). */
|
|
416
|
+
notifyEdited(): void;
|
|
417
|
+
/** Reset interaction state on native form reset: touched/dirty/focused → false, filled re-synced. */
|
|
418
|
+
resetState(): void;
|
|
419
|
+
/** Focus the field's control (used by the Form's first-invalid-focus on blocked submit). */
|
|
420
|
+
private focusControl;
|
|
421
|
+
private readonly host;
|
|
422
|
+
/**
|
|
423
|
+
* The field's control element, found by `controlId` but scoped to this field's own subtree — a
|
|
424
|
+
* duplicate or consumer-reused id elsewhere on the page can't steal focus/reset. The control
|
|
425
|
+
* registers its id through `setControlId`, so this matches the same element the labels point at.
|
|
426
|
+
*/
|
|
427
|
+
private controlElement;
|
|
359
428
|
/**
|
|
360
429
|
* Register an external owner of field state, returning the previous one.
|
|
361
430
|
* @ignore
|
|
@@ -367,7 +436,7 @@ declare class RdxFieldRoot {
|
|
|
367
436
|
*/
|
|
368
437
|
private resolve;
|
|
369
438
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxFieldRoot, never>;
|
|
370
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxFieldRoot, "[rdxFieldRoot]", ["rdxFieldRoot"], { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "filled": { "alias": "filled"; "required": false; "isSignal": true; }; "focused": { "alias": "focused"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
439
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxFieldRoot, "[rdxFieldRoot]", ["rdxFieldRoot"], { "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "filled": { "alias": "filled"; "required": false; "isSignal": true; }; "focused": { "alias": "focused"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
371
440
|
}
|
|
372
441
|
|
|
373
442
|
export { RdxFieldControl, RdxFieldDescription, RdxFieldError, RdxFieldLabel, RdxFieldRoot, injectFieldRootContext, provideFieldRootContext };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** A normalized external-error map: each field name maps to its message(s) in display order. */
|
|
5
|
+
type RdxFormErrors = Record<string, string | string[]>;
|
|
6
|
+
/** Payload of {@link RdxFormRoot.onFormSubmit}. */
|
|
7
|
+
interface RdxFormSubmitEvent {
|
|
8
|
+
/** The form's values serialized from `FormData` (repeated names collapse into arrays). */
|
|
9
|
+
values: Record<string, FormDataEntryValue | FormDataEntryValue[]>;
|
|
10
|
+
/** The original native submit event (already `preventDefault`-ed). */
|
|
11
|
+
event: SubmitEvent;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* What a {@link RdxFieldRoot} registers with an enclosing Form. Structural `() =>` accessors keep the
|
|
15
|
+
* Form entry free of any import from `field` (acyclic ng-packagr graph: `field` → `form`).
|
|
16
|
+
*/
|
|
17
|
+
interface RdxFormFieldRegistration {
|
|
18
|
+
/** The field's `name` (key external errors match against), or `undefined`. */
|
|
19
|
+
name: () => string | undefined;
|
|
20
|
+
/** The field's merged invalid state (includes external errors). */
|
|
21
|
+
invalid: () => boolean;
|
|
22
|
+
/** Whether the field is dirty. */
|
|
23
|
+
dirty: () => boolean;
|
|
24
|
+
/** Whether the field is touched. */
|
|
25
|
+
touched: () => boolean;
|
|
26
|
+
/** Focus the field's control (by its `controlId`). */
|
|
27
|
+
focus: () => void;
|
|
28
|
+
/** Reset the field's interaction state (touched/dirty/focused → false, filled re-sync). */
|
|
29
|
+
resetState: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* External owner of form-level state (e.g. a future Signal Forms `[rdxSignalForm]` adapter). Mirrors
|
|
33
|
+
* Field's `RdxFieldState` seam one level up. Each member is optional: a provided accessor wins over the
|
|
34
|
+
* built-in registry/`errors`-input behavior; absent accessors leave the built-in behavior untouched.
|
|
35
|
+
* Kept as framework-free `() =>` accessors (no `@angular/forms/signals` dependency). See ADR 0004.
|
|
36
|
+
*/
|
|
37
|
+
interface RdxFormState {
|
|
38
|
+
invalid?: () => boolean;
|
|
39
|
+
dirty?: () => boolean;
|
|
40
|
+
touched?: () => boolean;
|
|
41
|
+
submitting?: () => boolean;
|
|
42
|
+
/** Per-name external error source; while provided, the `errors` input + clear-on-edit are inert. */
|
|
43
|
+
errorsFor?: (name: string) => string[];
|
|
44
|
+
}
|
|
45
|
+
declare const formRootContext: () => {
|
|
46
|
+
errorsFor: (name: string | undefined) => string[];
|
|
47
|
+
notifyEdited: (name: string | undefined) => void;
|
|
48
|
+
register: (field: RdxFormFieldRegistration) => () => void;
|
|
49
|
+
setStateProvider: (provider: RdxFormState | null) => RdxFormState | null;
|
|
50
|
+
hasStateProvider: _angular_core.Signal<boolean>;
|
|
51
|
+
};
|
|
52
|
+
type RdxFormRootContext = ReturnType<typeof formRootContext>;
|
|
53
|
+
declare const injectFormRootContext: _radix_ng_primitives_core.InjectContext<{
|
|
54
|
+
errorsFor: (name: string | undefined) => string[];
|
|
55
|
+
notifyEdited: (name: string | undefined) => void;
|
|
56
|
+
register: (field: RdxFormFieldRegistration) => () => void;
|
|
57
|
+
setStateProvider: (provider: RdxFormState | null) => RdxFormState | null;
|
|
58
|
+
hasStateProvider: _angular_core.Signal<boolean>;
|
|
59
|
+
}>;
|
|
60
|
+
declare const provideFormRootContext: (useFactory: () => {
|
|
61
|
+
errorsFor: (name: string | undefined) => string[];
|
|
62
|
+
notifyEdited: (name: string | undefined) => void;
|
|
63
|
+
register: (field: RdxFormFieldRegistration) => () => void;
|
|
64
|
+
setStateProvider: (provider: RdxFormState | null) => RdxFormState | null;
|
|
65
|
+
hasStateProvider: _angular_core.Signal<boolean>;
|
|
66
|
+
}) => _angular_core.Provider;
|
|
67
|
+
/**
|
|
68
|
+
* The top of the forms layer cake: a single directive on the native `<form>` element that aggregates
|
|
69
|
+
* field state, maps external (server) errors onto fields by `name`, intercepts submit (values-as-object,
|
|
70
|
+
* focus the first invalid field), and resets field interaction state on native `reset`. It owns no
|
|
71
|
+
* values and runs no validation — Angular form systems (or Field inputs) remain the source of validity.
|
|
72
|
+
*
|
|
73
|
+
* @group Components
|
|
74
|
+
*/
|
|
75
|
+
declare class RdxFormRoot {
|
|
76
|
+
private readonly form;
|
|
77
|
+
/** External/server validation errors keyed by `Field.Root` `name`. */
|
|
78
|
+
readonly errors: _angular_core.InputSignal<RdxFormErrors | null | undefined>;
|
|
79
|
+
/** Emits the remaining error map after a field's external error is cleared by a user edit (or reset). */
|
|
80
|
+
readonly onClearErrors: _angular_core.OutputEmitterRef<RdxFormErrors>;
|
|
81
|
+
/** Emits the serialized form values when a valid form is submitted. */
|
|
82
|
+
readonly onFormSubmit: _angular_core.OutputEmitterRef<RdxFormSubmitEvent>;
|
|
83
|
+
private readonly fields;
|
|
84
|
+
private readonly stateProvider;
|
|
85
|
+
/** Whether an external adapter currently owns form-level state. */
|
|
86
|
+
readonly hasStateProvider: _angular_core.Signal<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Names whose external error has been cleared by a user edit. Reset to empty whenever a new `errors`
|
|
89
|
+
* object reference is assigned — the server just spoke, so everything it said is live again.
|
|
90
|
+
*/
|
|
91
|
+
private readonly clearedNames;
|
|
92
|
+
/** The `errors` input minus cleared names, normalized to `string[]`. */
|
|
93
|
+
private readonly effectiveErrors;
|
|
94
|
+
readonly anyInvalid: _angular_core.Signal<boolean>;
|
|
95
|
+
readonly anyDirty: _angular_core.Signal<boolean>;
|
|
96
|
+
readonly anyTouched: _angular_core.Signal<boolean>;
|
|
97
|
+
readonly submitting: _angular_core.Signal<boolean>;
|
|
98
|
+
/** Resolve a boolean aggregate: a registered provider's accessor wins, else OR over the registry. */
|
|
99
|
+
private aggregate;
|
|
100
|
+
/** Resolves the external messages for a field name (provider source wins over the `errors` input). */
|
|
101
|
+
errorsFor(name: string | undefined): string[];
|
|
102
|
+
/** Clears a field's external error after a user edit, emitting the remaining map. */
|
|
103
|
+
notifyEdited(name: string | undefined): void;
|
|
104
|
+
register(field: RdxFormFieldRegistration): () => void;
|
|
105
|
+
/** Register (or clear with `null`) an external owner of form-level state; returns the previous one. */
|
|
106
|
+
setStateProvider(provider: RdxFormState | null): RdxFormState | null;
|
|
107
|
+
onSubmit(event: SubmitEvent): void;
|
|
108
|
+
onReset(): void;
|
|
109
|
+
private readonly resetTimers;
|
|
110
|
+
constructor();
|
|
111
|
+
private remainingErrors;
|
|
112
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxFormRoot, never>;
|
|
113
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxFormRoot, "form[rdxFormRoot]", ["rdxFormRoot"], { "errors": { "alias": "errors"; "required": false; "isSignal": true; }; }, { "onClearErrors": "onClearErrors"; "onFormSubmit": "onFormSubmit"; }, never, never, true, never>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
declare const _importsForm: (typeof RdxFormRoot)[];
|
|
117
|
+
declare class RdxFormModule {
|
|
118
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxFormModule, never>;
|
|
119
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxFormModule, never, [typeof RdxFormRoot], [typeof RdxFormRoot]>;
|
|
120
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxFormModule>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { RdxFormModule, RdxFormRoot, _importsForm, injectFormRootContext, provideFormRootContext };
|
|
124
|
+
export type { RdxFormErrors, RdxFormFieldRegistration, RdxFormRootContext, RdxFormState, RdxFormSubmitEvent };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { RdxFormValueControl, BooleanInput } from '@radix-ng/primitives/core';
|
|
2
|
+
import { RdxFormValueControl, BooleanInput, RdxValidationError, NumberInput } from '@radix-ng/primitives/core';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The input value. Native text inputs always produce strings, so the model is
|
|
6
|
+
* `string` — matching Signal Forms' `FormValueControl<string>` round-trip.
|
|
7
|
+
*/
|
|
8
|
+
type RdxInputValue = string;
|
|
5
9
|
interface RdxInputValueChangeEventDetails {
|
|
6
10
|
event: Event;
|
|
7
11
|
cancel: () => void;
|
|
@@ -24,30 +28,44 @@ declare class RdxInputDirective implements RdxFormValueControl<RdxInputValue | u
|
|
|
24
28
|
private defaultValueApplied;
|
|
25
29
|
private readonly filledValue;
|
|
26
30
|
private readonly focusedValue;
|
|
31
|
+
private readonly dirtyValue;
|
|
27
32
|
/**
|
|
28
33
|
* The input id. Field labels and descriptions use this value for accessible relationships.
|
|
29
34
|
*
|
|
30
35
|
* @group Props
|
|
31
36
|
*/
|
|
32
37
|
readonly id: _angular_core.InputSignal<string>;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the input, submitted with the form data and used by Form-level
|
|
40
|
+
* error matching.
|
|
41
|
+
*
|
|
42
|
+
* @group Props
|
|
43
|
+
*/
|
|
44
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
33
45
|
/**
|
|
34
46
|
* The controlled input value.
|
|
35
47
|
*
|
|
36
48
|
* @group Props
|
|
37
49
|
*/
|
|
38
|
-
readonly value: _angular_core.ModelSignal<
|
|
50
|
+
readonly value: _angular_core.ModelSignal<string | undefined>;
|
|
39
51
|
/**
|
|
40
52
|
* The initial value when the input is uncontrolled.
|
|
41
53
|
*
|
|
42
54
|
* @group Props
|
|
43
55
|
*/
|
|
44
|
-
readonly defaultValue: _angular_core.InputSignal<
|
|
56
|
+
readonly defaultValue: _angular_core.InputSignal<string | undefined>;
|
|
45
57
|
/**
|
|
46
58
|
* Whether the input is disabled.
|
|
47
59
|
*
|
|
48
60
|
* @group Props
|
|
49
61
|
*/
|
|
50
62
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the input is read-only.
|
|
65
|
+
*
|
|
66
|
+
* @group Props
|
|
67
|
+
*/
|
|
68
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
51
69
|
/**
|
|
52
70
|
* Whether the input is required.
|
|
53
71
|
*
|
|
@@ -60,17 +78,69 @@ declare class RdxInputDirective implements RdxFormValueControl<RdxInputValue | u
|
|
|
60
78
|
* @group Props
|
|
61
79
|
*/
|
|
62
80
|
readonly invalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the input has been touched. A two-way model: the input sets it on
|
|
83
|
+
* blur (emitting `touchedChange`, which Signal Forms' `[formField]` listens
|
|
84
|
+
* to), and a form system can write it back.
|
|
85
|
+
*
|
|
86
|
+
* @group Props
|
|
87
|
+
*/
|
|
88
|
+
readonly touched: _angular_core.ModelSignal<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the input value has changed from its initial value. Merged with the
|
|
91
|
+
* internally tracked state; a form system can own it through this input.
|
|
92
|
+
*
|
|
93
|
+
* @group Props
|
|
94
|
+
*/
|
|
95
|
+
readonly dirty: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
96
|
+
/**
|
|
97
|
+
* Validation errors for the input. A non-empty list marks the input invalid.
|
|
98
|
+
*
|
|
99
|
+
* @group Props
|
|
100
|
+
*/
|
|
101
|
+
readonly errors: _angular_core.InputSignal<readonly RdxValidationError[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Minimum number of characters.
|
|
104
|
+
*
|
|
105
|
+
* @group Props
|
|
106
|
+
*/
|
|
107
|
+
readonly minLength: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
108
|
+
/**
|
|
109
|
+
* Maximum number of characters.
|
|
110
|
+
*
|
|
111
|
+
* @group Props
|
|
112
|
+
*/
|
|
113
|
+
readonly maxLength: _angular_core.InputSignalWithTransform<number | undefined, NumberInput>;
|
|
114
|
+
/**
|
|
115
|
+
* Patterns the value must match. Reflected to the native `pattern` attribute
|
|
116
|
+
* only when exactly one pattern is provided (the attribute holds a single regex).
|
|
117
|
+
*
|
|
118
|
+
* @group Props
|
|
119
|
+
*/
|
|
120
|
+
readonly pattern: _angular_core.InputSignal<readonly RegExp[]>;
|
|
63
121
|
/**
|
|
64
122
|
* Emits when the input value changes.
|
|
65
123
|
*
|
|
66
124
|
* @group Emits
|
|
67
125
|
*/
|
|
68
126
|
readonly onValueChange: _angular_core.OutputEmitterRef<RdxInputValueChangeEvent>;
|
|
127
|
+
/**
|
|
128
|
+
* Emits on blur, notifying a form system the input was touched. Stable
|
|
129
|
+
* Angular 22 Signal Forms listens to this `touch` output; the 21.x
|
|
130
|
+
* experimental implementation listens to the `touched` model's
|
|
131
|
+
* `touchedChange` instead — both are emitted, covering either version.
|
|
132
|
+
*
|
|
133
|
+
* @group Emits
|
|
134
|
+
*/
|
|
135
|
+
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
69
136
|
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
70
137
|
protected readonly disabledState: _angular_core.Signal<boolean>;
|
|
71
138
|
protected readonly requiredState: _angular_core.Signal<boolean>;
|
|
72
139
|
protected readonly filledState: _angular_core.Signal<boolean>;
|
|
73
140
|
protected readonly focusedState: _angular_core.Signal<boolean>;
|
|
141
|
+
protected readonly touchedState: _angular_core.Signal<boolean>;
|
|
142
|
+
protected readonly dirtyState: _angular_core.Signal<boolean>;
|
|
143
|
+
protected readonly patternAttr: _angular_core.Signal<string | undefined>;
|
|
74
144
|
protected readonly describedBy: _angular_core.Signal<string | undefined>;
|
|
75
145
|
constructor();
|
|
76
146
|
onFocus(): void;
|
|
@@ -80,7 +150,7 @@ declare class RdxInputDirective implements RdxFormValueControl<RdxInputValue | u
|
|
|
80
150
|
private writeValue;
|
|
81
151
|
protected readonly dataAttr: (value: boolean) => "" | undefined;
|
|
82
152
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxInputDirective, never>;
|
|
83
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxInputDirective, "input[rdxInput]", ["rdxInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, never>;
|
|
153
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxInputDirective, "input[rdxInput]", ["rdxInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "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; }; "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; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "pattern": { "alias": "pattern"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touched": "touchedChange"; "onValueChange": "onValueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
84
154
|
}
|
|
85
155
|
|
|
86
156
|
export { RdxInputDirective };
|
|
@@ -7,7 +7,6 @@ import { RdxPopperContentWrapper, RdxPopperAnchorElement } from '@radix-ng/primi
|
|
|
7
7
|
import * as _radix_ng_primitives_menu from '@radix-ng/primitives/menu';
|
|
8
8
|
import * as i2 from '@radix-ng/primitives/dismissable-layer';
|
|
9
9
|
import * as i1$1 from '@radix-ng/primitives/portal';
|
|
10
|
-
import { RdxPortalContainer } from '@radix-ng/primitives/portal';
|
|
11
10
|
import * as i3 from '@radix-ng/primitives/focus-scope';
|
|
12
11
|
|
|
13
12
|
type RdxMenuTransitionStatus = 'starting' | 'ending' | undefined;
|
|
@@ -230,16 +229,26 @@ declare class RdxMenuSubTrigger {
|
|
|
230
229
|
}
|
|
231
230
|
|
|
232
231
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
232
|
+
* Structural directive that teleports the menu popup into a container (default `document.body`) while
|
|
233
|
+
* the menu is open, and keeps it mounted until any CSS exit `@keyframes` finishes.
|
|
234
|
+
*
|
|
235
|
+
* This replaces the consumer-owned `@if (root.open())` mount: it adds both teleporting *and*
|
|
236
|
+
* exit-animation support. Apply it with the `*` microsyntax on the positioner —
|
|
237
|
+
* `<div *rdxMenuPortal rdxMenuPositioner>` — or as an explicit `<ng-template rdxMenuPortal>`. For a
|
|
238
|
+
* custom container, or a backdrop alongside the positioner (multi-root), use the explicit form.
|
|
235
239
|
*/
|
|
236
240
|
declare class RdxMenuPortal {
|
|
237
|
-
/**
|
|
238
|
-
* Optional container to portal the content into. Defaults to `document.body`.
|
|
239
|
-
*/
|
|
240
|
-
readonly container: _angular_core.InputSignal<RdxPortalContainer | undefined>;
|
|
241
241
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxMenuPortal, never>;
|
|
242
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxMenuPortal, "[rdxMenuPortal]", ["rdxMenuPortal"], {
|
|
242
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxMenuPortal, "ng-template[rdxMenuPortal]", ["rdxMenuPortal"], {}, {}, never, never, true, [{ directive: typeof i1$1.RdxPortalPresence; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Dev-mode guard: `rdxMenuPortal` is a structural directive. The old `<div rdxMenuPortal>` markup
|
|
246
|
+
* would silently stop portaling — fail loudly instead.
|
|
247
|
+
*/
|
|
248
|
+
declare class RdxMenuPortalMisuseGuard {
|
|
249
|
+
constructor();
|
|
250
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxMenuPortalMisuseGuard, never>;
|
|
251
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxMenuPortalMisuseGuard, "[rdxMenuPortal]:not(ng-template)", never, {}, {}, never, never, true, never>;
|
|
243
252
|
}
|
|
244
253
|
|
|
245
254
|
/**
|
|
@@ -616,9 +625,9 @@ declare class RdxMenuRadioItemIndicator {
|
|
|
616
625
|
|
|
617
626
|
declare class RdxMenuModule {
|
|
618
627
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxMenuModule, never>;
|
|
619
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxMenuModule, never, [typeof RdxMenuRoot, typeof RdxMenuTrigger, typeof RdxMenuSubTrigger, typeof RdxMenuPortal, typeof RdxMenuPositioner, typeof RdxMenuPopup, typeof RdxMenuViewport, typeof RdxMenuBackdrop, typeof RdxMenuArrow, typeof RdxMenuItem, typeof RdxMenuLinkItem, typeof RdxMenuGroup, typeof RdxMenuGroupLabel, typeof RdxMenuSeparator, typeof RdxMenuCheckboxItem, typeof RdxMenuCheckboxItemIndicator, typeof RdxMenuRadioGroup, typeof RdxMenuRadioItem, typeof RdxMenuRadioItemIndicator], [typeof RdxMenuRoot, typeof RdxMenuTrigger, typeof RdxMenuSubTrigger, typeof RdxMenuPortal, typeof RdxMenuPositioner, typeof RdxMenuPopup, typeof RdxMenuViewport, typeof RdxMenuBackdrop, typeof RdxMenuArrow, typeof RdxMenuItem, typeof RdxMenuLinkItem, typeof RdxMenuGroup, typeof RdxMenuGroupLabel, typeof RdxMenuSeparator, typeof RdxMenuCheckboxItem, typeof RdxMenuCheckboxItemIndicator, typeof RdxMenuRadioGroup, typeof RdxMenuRadioItem, typeof RdxMenuRadioItemIndicator]>;
|
|
628
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxMenuModule, never, [typeof RdxMenuRoot, typeof RdxMenuTrigger, typeof RdxMenuSubTrigger, typeof RdxMenuPortal, typeof RdxMenuPortalMisuseGuard, typeof RdxMenuPositioner, typeof RdxMenuPopup, typeof RdxMenuViewport, typeof RdxMenuBackdrop, typeof RdxMenuArrow, typeof RdxMenuItem, typeof RdxMenuLinkItem, typeof RdxMenuGroup, typeof RdxMenuGroupLabel, typeof RdxMenuSeparator, typeof RdxMenuCheckboxItem, typeof RdxMenuCheckboxItemIndicator, typeof RdxMenuRadioGroup, typeof RdxMenuRadioItem, typeof RdxMenuRadioItemIndicator], [typeof RdxMenuRoot, typeof RdxMenuTrigger, typeof RdxMenuSubTrigger, typeof RdxMenuPortal, typeof RdxMenuPortalMisuseGuard, typeof RdxMenuPositioner, typeof RdxMenuPopup, typeof RdxMenuViewport, typeof RdxMenuBackdrop, typeof RdxMenuArrow, typeof RdxMenuItem, typeof RdxMenuLinkItem, typeof RdxMenuGroup, typeof RdxMenuGroupLabel, typeof RdxMenuSeparator, typeof RdxMenuCheckboxItem, typeof RdxMenuCheckboxItemIndicator, typeof RdxMenuRadioGroup, typeof RdxMenuRadioItem, typeof RdxMenuRadioItemIndicator]>;
|
|
620
629
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxMenuModule>;
|
|
621
630
|
}
|
|
622
631
|
|
|
623
|
-
export { RdxMenuArrow, RdxMenuBackdrop, RdxMenuCheckboxItem, RdxMenuCheckboxItemIndicator, RdxMenuGroup, RdxMenuGroupLabel, RdxMenuItem, RdxMenuLinkItem, RdxMenuModule, RdxMenuPopup, RdxMenuPortal, RdxMenuPositioner, RdxMenuRadioGroup, RdxMenuRadioItem, RdxMenuRadioItemIndicator, RdxMenuRoot, RdxMenuSeparator, RdxMenuSubTrigger, RdxMenuTrigger, RdxMenuViewport, getCheckedState, injectRdxMenuCheckboxItemContext, injectRdxMenuRadioGroupContext, injectRdxMenuRadioItemContext, injectRdxMenuRootContext, isIndeterminate, provideRdxMenuCheckboxItemContext, provideRdxMenuRadioGroupContext, provideRdxMenuRadioItemContext, provideRdxMenuRootContext };
|
|
632
|
+
export { RdxMenuArrow, RdxMenuBackdrop, RdxMenuCheckboxItem, RdxMenuCheckboxItemIndicator, RdxMenuGroup, RdxMenuGroupLabel, RdxMenuItem, RdxMenuLinkItem, RdxMenuModule, RdxMenuPopup, RdxMenuPortal, RdxMenuPortalMisuseGuard, RdxMenuPositioner, RdxMenuRadioGroup, RdxMenuRadioItem, RdxMenuRadioItemIndicator, RdxMenuRoot, RdxMenuSeparator, RdxMenuSubTrigger, RdxMenuTrigger, RdxMenuViewport, getCheckedState, injectRdxMenuCheckboxItemContext, injectRdxMenuRadioGroupContext, injectRdxMenuRadioItemContext, injectRdxMenuRootContext, isIndeterminate, provideRdxMenuCheckboxItemContext, provideRdxMenuRadioGroupContext, provideRdxMenuRadioItemContext, provideRdxMenuRootContext };
|
|
624
633
|
export type { CheckedState, RdxMenuAutoFocus, RdxMenuAutoFocusInput, RdxMenuCheckboxItemContext, RdxMenuOrientation, RdxMenuRadioGroupContext, RdxMenuRadioItemContext, RdxMenuRootContext, RdxMenuTransitionStatus, RdxMenuTriggerInteraction, RdxMenuTriggerInteractionHandler };
|
|
@@ -1,26 +1,37 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef, Signal, ElementRef } from '@angular/core';
|
|
3
|
-
import * as i1 from '@radix-ng/primitives/
|
|
3
|
+
import * as i1 from '@radix-ng/primitives/portal';
|
|
4
4
|
import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
|
|
5
5
|
import { RdxTransitionStatus, BooleanInput, NumberInput } from '@radix-ng/primitives/core';
|
|
6
6
|
import * as i1$1 from '@radix-ng/primitives/popper';
|
|
7
7
|
import { RdxPopperContentWrapper, RdxPopperAnchorElement } from '@radix-ng/primitives/popper';
|
|
8
8
|
import * as _radix_ng_primitives_navigation_menu from '@radix-ng/primitives/navigation-menu';
|
|
9
9
|
import * as i1$2 from '@radix-ng/primitives/roving-focus';
|
|
10
|
-
import * as i1$3 from '@radix-ng/primitives/portal';
|
|
11
|
-
import { RdxPortalContainer } from '@radix-ng/primitives/portal';
|
|
12
10
|
import * as i2 from '@radix-ng/primitives/dismissable-layer';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* Structural directive that teleports the navigation menu popup into a container (default
|
|
14
|
+
* `document.body`) while the menu is open, and keeps it mounted until any CSS exit `@keyframes`
|
|
15
|
+
* finishes.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Apply it with the `*` microsyntax on the positioner —
|
|
18
|
+
* `<div *rdxNavigationMenuPortal rdxNavigationMenuPositioner>` — or as an explicit
|
|
19
|
+
* `<ng-template rdxNavigationMenuPortal>`. For a custom container use the explicit form with
|
|
20
|
+
* `[container]`.
|
|
20
21
|
*/
|
|
21
|
-
declare class
|
|
22
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
23
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<
|
|
22
|
+
declare class RdxNavigationMenuPortal {
|
|
23
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxNavigationMenuPortal, never>;
|
|
24
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxNavigationMenuPortal, "ng-template[rdxNavigationMenuPortal]", ["rdxNavigationMenuPortal"], {}, {}, never, never, true, [{ directive: typeof i1.RdxPortalPresence; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Dev-mode guard: `rdxNavigationMenuPortal` used to be an attribute directive on a `<div>`. It is now
|
|
28
|
+
* structural, so the old `<div rdxNavigationMenuPortal>` markup would silently stop portaling — fail
|
|
29
|
+
* loudly instead.
|
|
30
|
+
*/
|
|
31
|
+
declare class RdxNavigationMenuPortalMisuseGuard {
|
|
32
|
+
constructor();
|
|
33
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxNavigationMenuPortalMisuseGuard, never>;
|
|
34
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxNavigationMenuPortalMisuseGuard, "[rdxNavigationMenuPortal]:not(ng-template)", never, {}, {}, never, never, true, never>;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
37
|
type NavigationMenuOrientation = 'horizontal' | 'vertical';
|
|
@@ -300,19 +311,6 @@ declare class RdxNavigationMenuLink {
|
|
|
300
311
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxNavigationMenuLink, "[rdxNavigationMenuLink]", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "closeOnClick": { "alias": "closeOnClick"; "required": false; "isSignal": true; }; }, { "onSelect": "onSelect"; }, never, never, true, never>;
|
|
301
312
|
}
|
|
302
313
|
|
|
303
|
-
/**
|
|
304
|
-
* Moves the navigation menu popup to a different part of the DOM (by default `document.body`).
|
|
305
|
-
*/
|
|
306
|
-
declare class RdxNavigationMenuPortal {
|
|
307
|
-
protected readonly rootContext: _radix_ng_primitives_navigation_menu.RdxNavigationMenuRootContext;
|
|
308
|
-
/**
|
|
309
|
-
* Optional container to portal the popup into. Defaults to `document.body`.
|
|
310
|
-
*/
|
|
311
|
-
readonly container: _angular_core.InputSignal<RdxPortalContainer | undefined>;
|
|
312
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxNavigationMenuPortal, never>;
|
|
313
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxNavigationMenuPortal, "[rdxNavigationMenuPortal]", never, { "container": { "alias": "container"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1$3.RdxPortal; inputs: { "container": "container"; }; outputs: {}; }]>;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
314
|
/**
|
|
317
315
|
* An optional backdrop rendered behind the popup.
|
|
318
316
|
*/
|
|
@@ -477,12 +475,12 @@ declare class RdxNavigationMenuViewport {
|
|
|
477
475
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxNavigationMenuViewport, "[rdxNavigationMenuViewport]", never, { "forceMount": { "alias": "forceMount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
478
476
|
}
|
|
479
477
|
|
|
480
|
-
declare const navigationMenuImports: (typeof
|
|
478
|
+
declare const navigationMenuImports: (typeof RdxNavigationMenuPortal)[];
|
|
481
479
|
declare class RdxNavigationMenuModule {
|
|
482
480
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxNavigationMenuModule, never>;
|
|
483
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxNavigationMenuModule, never, [typeof RdxNavigationMenuRoot, typeof RdxNavigationMenuList, typeof RdxNavigationMenuItem, typeof RdxNavigationMenuTrigger, typeof RdxNavigationMenuIcon, typeof RdxNavigationMenuContent, typeof RdxNavigationMenuLink, typeof RdxNavigationMenuPortal, typeof
|
|
481
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<RdxNavigationMenuModule, never, [typeof RdxNavigationMenuRoot, typeof RdxNavigationMenuList, typeof RdxNavigationMenuItem, typeof RdxNavigationMenuTrigger, typeof RdxNavigationMenuIcon, typeof RdxNavigationMenuContent, typeof RdxNavigationMenuLink, typeof RdxNavigationMenuPortal, typeof RdxNavigationMenuPortalMisuseGuard, typeof RdxNavigationMenuBackdrop, typeof RdxNavigationMenuPositioner, typeof RdxNavigationMenuPopup, typeof RdxNavigationMenuArrow, typeof RdxNavigationMenuViewport], [typeof RdxNavigationMenuRoot, typeof RdxNavigationMenuList, typeof RdxNavigationMenuItem, typeof RdxNavigationMenuTrigger, typeof RdxNavigationMenuIcon, typeof RdxNavigationMenuContent, typeof RdxNavigationMenuLink, typeof RdxNavigationMenuPortal, typeof RdxNavigationMenuPortalMisuseGuard, typeof RdxNavigationMenuBackdrop, typeof RdxNavigationMenuPositioner, typeof RdxNavigationMenuPopup, typeof RdxNavigationMenuArrow, typeof RdxNavigationMenuViewport]>;
|
|
484
482
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<RdxNavigationMenuModule>;
|
|
485
483
|
}
|
|
486
484
|
|
|
487
|
-
export { RdxNavigationMenuArrow, RdxNavigationMenuBackdrop, RdxNavigationMenuContent, RdxNavigationMenuIcon, RdxNavigationMenuItem, RdxNavigationMenuLink, RdxNavigationMenuList, RdxNavigationMenuModule, RdxNavigationMenuPopup, RdxNavigationMenuPortal,
|
|
485
|
+
export { RdxNavigationMenuArrow, RdxNavigationMenuBackdrop, RdxNavigationMenuContent, RdxNavigationMenuIcon, RdxNavigationMenuItem, RdxNavigationMenuLink, RdxNavigationMenuList, RdxNavigationMenuModule, RdxNavigationMenuPopup, RdxNavigationMenuPortal, RdxNavigationMenuPortalMisuseGuard, RdxNavigationMenuPositioner, RdxNavigationMenuRoot, RdxNavigationMenuTrigger, RdxNavigationMenuViewport, injectNavigationMenuRootContext, navigationMenuImports, provideNavigationMenuRootContext };
|
|
488
486
|
export type { NavigationMenuDirection, NavigationMenuOrientation, RdxNavigationMenuContentEntry, RdxNavigationMenuOpenChange, RdxNavigationMenuOpenChangeReason, RdxNavigationMenuRootContext };
|