@modyra/angular 0.2.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/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@modyra/angular",
3
+ "version": "0.2.0",
4
+ "description": "Type-safe Angular forms built entirely on native Signals.",
5
+ "funding": {
6
+ "type": "github",
7
+ "url": "https://github.com/sponsors/lorenzomusche"
8
+ },
9
+ "keywords": [
10
+ "angular",
11
+ "forms",
12
+ "signals",
13
+ "signal-forms",
14
+ "reactive-forms",
15
+ "declarative"
16
+ ],
17
+ "author": "Lorenzo Muscherà",
18
+ "license": "MIT",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/modyra/modyra.git",
22
+ "directory": "packages/angular"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/modyra/modyra/issues"
26
+ },
27
+ "homepage": "https://github.com/modyra/modyra#readme",
28
+ "peerDependencies": {
29
+ "@angular/core": ">=21.0.0",
30
+ "@angular/common": ">=21.0.0",
31
+ "@angular/platform-browser": ">=21.0.0",
32
+ "@angular/forms": ">=21.0.0",
33
+ "@modyra/zod": ">=0.1.0",
34
+ "zod": ">=3.25.0"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "@angular/forms": {
38
+ "optional": true
39
+ },
40
+ "@modyra/zod": {
41
+ "optional": true
42
+ },
43
+ "zod": {
44
+ "optional": true
45
+ }
46
+ },
47
+ "allowedNonPeerDependencies": [
48
+ "@modyra/core",
49
+ "@modyra/widgets"
50
+ ],
51
+ "dependencies": {
52
+ "tslib": ">=2.3.0",
53
+ "@modyra/core": "^0.2.0",
54
+ "@modyra/widgets": "^0.2.0"
55
+ },
56
+ "exports": {
57
+ ".": {
58
+ "import": "./fesm2022/modyra-angular.mjs",
59
+ "types": "./types/modyra-angular.d.ts",
60
+ "default": "./fesm2022/modyra-angular.mjs"
61
+ },
62
+ "./adapter": {
63
+ "import": "./fesm2022/modyra-angular-adapter.mjs",
64
+ "types": "./types/modyra-angular-adapter.d.ts",
65
+ "default": "./fesm2022/modyra-angular-adapter.mjs"
66
+ },
67
+ "./ui": {
68
+ "import": "./fesm2022/modyra-angular-ui.mjs",
69
+ "types": "./types/modyra-angular-ui.d.ts",
70
+ "default": "./fesm2022/modyra-angular-ui.mjs"
71
+ },
72
+ "./interop": {
73
+ "import": "./fesm2022/modyra-angular-interop.mjs",
74
+ "types": "./types/modyra-angular-interop.d.ts",
75
+ "default": "./fesm2022/modyra-angular-interop.mjs"
76
+ },
77
+ "./zod": {
78
+ "import": "./fesm2022/modyra-angular-zod.mjs",
79
+ "types": "./types/modyra-angular-zod.d.ts",
80
+ "default": "./fesm2022/modyra-angular-zod.mjs"
81
+ },
82
+ "./package.json": {
83
+ "default": "./package.json"
84
+ }
85
+ },
86
+ "sideEffects": false,
87
+ "main": "fesm2022/modyra-angular.mjs",
88
+ "module": "fesm2022/modyra-angular.mjs",
89
+ "typings": "types/modyra-angular.d.ts",
90
+ "publishConfig": {
91
+ "access": "public"
92
+ },
93
+ "type": "module"
94
+ }
@@ -0,0 +1,2 @@
1
+ export { MDY_DATE_LOCALE, MDY_DECLARATIVE_REGISTRY, MDY_FLOATING_LABELS_DEFAULT, MDY_FLOATING_LABELS_DENSITY_DEFAULT, MDY_FORM_ADAPTER, MDY_I18N_MESSAGES, MDY_INLINE_ERRORS, MdyAnyArrayDescriptor, MdyAnyFieldDescriptor, MdyAnyGroupDescriptor, MdyArrayDescriptor, MdyArrayHandle, MdyArrayItemValue, MdyAsyncValidatorFn, MdyAsyncValidatorOptions, MdyControlOption, MdyDateRange, MdyDeclarativeAdapter, MdyDeclarativeRegistry, MdyDraftOptions, MdyDraftStorage, MdyFieldConfig, MdyFieldDescriptor, MdyFieldError, MdyFieldHandle, MdyFieldHandleTree, MdyFieldOptions, MdyFieldRef, MdyFieldState, MdyFieldTree, MdyFormAdapter, MdyFormContext, MdyFormError, MdyFormOptions, MdyFormPatch, MdyFormSchema, MdyFormState, MdyFormSubmitEvent, MdyFormValidatorFn, MdyFormValue, MdyGroupDescriptor, MdyItemHandleTree, MdyLocaleOptions, MdyOptionsControl, MdySelectOption, MdySubmitMode, MdyTypedForm, MdyTypedFormLike, ValidatorFn, angularReactivity, array, field, group, mdyForm, provideModyraLocale } from '@modyra/angular';
2
+ //# sourceMappingURL=modyra-angular-adapter.d.ts.map
@@ -0,0 +1,43 @@
1
+ import { ControlValueAccessor } from '@angular/forms';
2
+ import * as i0 from '@angular/core';
3
+
4
+ /**
5
+ * Bridges any modyra renderer into classic Reactive Forms /
6
+ * `ngModel` — incremental adoption in existing codebases without an
7
+ * `<mdy-form>`:
8
+ *
9
+ * ```html
10
+ * <form [formGroup]="group">
11
+ * <mdy-control-text mdyCva name="email" formControlName="email" label="Email" />
12
+ * </form>
13
+ * ```
14
+ *
15
+ * The directive provides a private single-field adapter on the element (the
16
+ * renderer resolves it instead of a surrounding `<mdy-form>`) and implements
17
+ * `ControlValueAccessor` on top of it: `writeValue` → field value,
18
+ * user edits → `onChange`, first blur → `onTouched`, `setDisabledState` →
19
+ * field `disabled`. Validation stays in Reactive Forms — bind your own
20
+ * error display to the `FormControl`, or mirror errors into the renderer
21
+ * with `aria-*` inputs.
22
+ */
23
+ declare class MdyCvaDirective implements ControlValueAccessor {
24
+ private readonly adapter;
25
+ private readonly injector;
26
+ private readonly fieldName;
27
+ private readonly _disabled;
28
+ /** True while writeValue applies a model→view update (must not re-emit). */
29
+ private _writing;
30
+ private _onChange;
31
+ private _onTouched;
32
+ constructor();
33
+ private _state;
34
+ writeValue(value: unknown): void;
35
+ registerOnChange(fn: (value: unknown) => void): void;
36
+ registerOnTouched(fn: () => void): void;
37
+ setDisabledState(isDisabled: boolean): void;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<MdyCvaDirective, never>;
39
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MdyCvaDirective, "[mdyCva]", never, {}, {}, never, never, true, never>;
40
+ }
41
+
42
+ export { MdyCvaDirective };
43
+ //# sourceMappingURL=modyra-angular-interop.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { MDY_DEVTOOLS_HOTKEY, MDY_FLOATING_LABELS, MdyA11yAnnouncer, MdyBaseControl, MdyCalendarCellComponent, MdyCalendarComponent, MdyCalendarGridComponent, MdyCalendarHeaderComponent, MdyCheckboxComponent, MdyChipsDirective, MdyColorsComponent, MdyConditionalOptionsDirective, MdyControlComponent, MdyControlLabelComponent, MdyDatePickerComponent, MdyDateRangePickerComponent, MdyDevtoolsDirective, MdyDisabledDirective, MdyDynamicFormComponent, MdyEmailDirective, MdyErrorListComponent, MdyFileComponent, MdyFloatingLabelsDirective, MdyFormArrayComponent, MdyFormComponent, MdyFormWizardComponent, MdyFormsDevtoolsComponent, MdyFormsDevtoolsOverlayComponent, MdyFormsDevtoolsService, MdyGlassDirective, MdyIconComponent, MdyInlineErrorIconComponent, MdyInlineErrorsDirective, MdyLoadOptionsDirective, MdyMaxDirective, MdyMaxLengthDirective, MdyMinDirective, MdyMinLengthDirective, MdyMultiselectComponent, MdyNumberComponent, MdyOptionDirective, MdyOptionsAutoLoadingDirective, MdyOptionsLoader, MdyOptionsOverlayControl, MdyOverlayControl, MdyPatternDirective, MdyPrefixDirective, MdyRadioGroupComponent, MdyRangeCalendarComponent, MdyRangeCalendarGridComponent, MdyRequiredDirective, MdySegmentedButtonComponent, MdySelectComponent, MdySliderComponent, MdySuffixDirective, MdySupportingTextDirective, MdyTextComponent, MdyTextareaComponent, MdyTimepickerComponent, MdyToggleComponent, MdyValidatorBaseDirective, MdyWizardStepComponent } from '@modyra/angular';
2
+ //# sourceMappingURL=modyra-angular-ui.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { Injector } from '@angular/core';
2
+ import { MdyFormValidatorFn, MdyFormValue, MdyTypedForm } from '@modyra/angular/adapter';
3
+ import { MdyZodSchemaTree } from '@modyra/zod';
4
+ export { MdyZodSchemaTree } from '@modyra/zod';
5
+ import { z } from 'zod';
6
+
7
+ interface MdyZodFormOptions<TValue extends Record<string, unknown> = Record<string, unknown>> {
8
+ readonly submitMode?: "valid-only" | "always" | "manual";
9
+ readonly injector?: Injector;
10
+ /** Extra form-level validators, merged after the schema's refinements. */
11
+ readonly validators?: ReadonlyArray<MdyFormValidatorFn<TValue>>;
12
+ }
13
+ /**
14
+ * Builds an Angular typed form from a `z.object()` schema — one source of
15
+ * truth for TypeScript types, validators, messages and required flags.
16
+ * See `@modyra/zod` for the shared semantics; bind the result with
17
+ * `[form]` and `[field]` exactly like `mdyForm()`.
18
+ */
19
+ declare function mdyFormFromSchema<T extends z.ZodObject>(schema: T, options?: MdyZodFormOptions<MdyFormValue<MdyZodSchemaTree<T["shape"]>>>): MdyTypedForm<MdyZodSchemaTree<T["shape"]>>;
20
+
21
+ export { mdyFormFromSchema };
22
+ export type { MdyZodFormOptions };
23
+ //# sourceMappingURL=modyra-angular-zod.d.ts.map