@ng-forge/dynamic-forms 0.10.0-next.2 → 0.10.0-next.4

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.
Files changed (60) hide show
  1. package/fesm2022/{ng-forge-dynamic-forms-array-field.component-PPh_uVVh.mjs → ng-forge-dynamic-forms-array-field.component-BfRH3TBm.mjs} +4 -3
  2. package/fesm2022/ng-forge-dynamic-forms-array-field.component-BfRH3TBm.mjs.map +1 -0
  3. package/fesm2022/{ng-forge-dynamic-forms-container-field.component-3dZDF3kh.mjs → ng-forge-dynamic-forms-container-field.component-bA-8ICHF.mjs} +4 -3
  4. package/fesm2022/ng-forge-dynamic-forms-container-field.component-bA-8ICHF.mjs.map +1 -0
  5. package/fesm2022/{ng-forge-dynamic-forms-container-utils-B7kCznbc.mjs → ng-forge-dynamic-forms-container-utils-BvXn8T_i.mjs} +2 -2
  6. package/fesm2022/ng-forge-dynamic-forms-container-utils-BvXn8T_i.mjs.map +1 -0
  7. package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-DtWBauY3.mjs → ng-forge-dynamic-forms-css-wrapper.component-DjhcONFh.mjs} +2 -2
  8. package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-DjhcONFh.mjs.map +1 -0
  9. package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-CbY8WZZB.mjs → ng-forge-dynamic-forms-emit-initialization-DhHwU6FJ.mjs} +2 -2
  10. package/fesm2022/ng-forge-dynamic-forms-emit-initialization-DhHwU6FJ.mjs.map +1 -0
  11. package/fesm2022/{ng-forge-dynamic-forms-group-field.component-Dr8Z628-.mjs → ng-forge-dynamic-forms-group-field.component-D0_nmXf2.mjs} +4 -3
  12. package/fesm2022/ng-forge-dynamic-forms-group-field.component-D0_nmXf2.mjs.map +1 -0
  13. package/fesm2022/ng-forge-dynamic-forms-integration.mjs +14 -10
  14. package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
  15. package/fesm2022/ng-forge-dynamic-forms-internal.mjs +3372 -0
  16. package/fesm2022/ng-forge-dynamic-forms-internal.mjs.map +1 -0
  17. package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-ww_BnAt_.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-CNc4a_Xv.mjs} +725 -3866
  18. package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-CNc4a_Xv.mjs.map +1 -0
  19. package/fesm2022/{ng-forge-dynamic-forms-page-field.component-DoGKs3LN.mjs → ng-forge-dynamic-forms-page-field.component-BJRNnoz-.mjs} +4 -3
  20. package/fesm2022/ng-forge-dynamic-forms-page-field.component-BJRNnoz-.mjs.map +1 -0
  21. package/fesm2022/{ng-forge-dynamic-forms-row-wrapper.component-CFtnatYj.mjs → ng-forge-dynamic-forms-row-wrapper.component-CwkYn5yl.mjs} +1 -1
  22. package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-CwkYn5yl.mjs.map +1 -0
  23. package/fesm2022/ng-forge-dynamic-forms-schema.mjs.map +1 -1
  24. package/fesm2022/{ng-forge-dynamic-forms-text-field.component-C3TPVvj_.mjs → ng-forge-dynamic-forms-text-field.component-DABkT0O7.mjs} +2 -2
  25. package/fesm2022/ng-forge-dynamic-forms-text-field.component-DABkT0O7.mjs.map +1 -0
  26. package/fesm2022/ng-forge-dynamic-forms.mjs +2 -1
  27. package/fesm2022/ng-forge-dynamic-forms.mjs.map +1 -1
  28. package/package.json +14 -1
  29. package/schematics/collection.json +10 -0
  30. package/schematics/generators.json +12 -0
  31. package/schematics/ng-add/index.js +87 -0
  32. package/schematics/ng-add/index.js.map +1 -0
  33. package/schematics/ng-add/nx-wrapper.js +5 -0
  34. package/schematics/ng-add/nx-wrapper.js.map +1 -0
  35. package/schematics/ng-add/recipes.js +60 -0
  36. package/schematics/ng-add/recipes.js.map +1 -0
  37. package/schematics/ng-add/rules/add-packages.js +73 -0
  38. package/schematics/ng-add/rules/add-packages.js.map +1 -0
  39. package/schematics/ng-add/rules/add-providers.js +132 -0
  40. package/schematics/ng-add/rules/add-providers.js.map +1 -0
  41. package/schematics/ng-add/rules/add-styles.js +123 -0
  42. package/schematics/ng-add/rules/add-styles.js.map +1 -0
  43. package/schematics/ng-add/schema.json +48 -0
  44. package/schematics/package.json +1 -0
  45. package/schematics/versions.js +33 -0
  46. package/schematics/versions.js.map +1 -0
  47. package/types/ng-forge-dynamic-forms-integration.d.ts +31 -464
  48. package/types/ng-forge-dynamic-forms-internal.d.ts +3508 -0
  49. package/types/ng-forge-dynamic-forms-schema.d.ts +2 -117
  50. package/types/ng-forge-dynamic-forms.d.ts +87 -7170
  51. package/fesm2022/ng-forge-dynamic-forms-array-field.component-PPh_uVVh.mjs.map +0 -1
  52. package/fesm2022/ng-forge-dynamic-forms-container-field.component-3dZDF3kh.mjs.map +0 -1
  53. package/fesm2022/ng-forge-dynamic-forms-container-utils-B7kCznbc.mjs.map +0 -1
  54. package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-DtWBauY3.mjs.map +0 -1
  55. package/fesm2022/ng-forge-dynamic-forms-emit-initialization-CbY8WZZB.mjs.map +0 -1
  56. package/fesm2022/ng-forge-dynamic-forms-group-field.component-Dr8Z628-.mjs.map +0 -1
  57. package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-ww_BnAt_.mjs.map +0 -1
  58. package/fesm2022/ng-forge-dynamic-forms-page-field.component-DoGKs3LN.mjs.map +0 -1
  59. package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-CFtnatYj.mjs.map +0 -1
  60. package/fesm2022/ng-forge-dynamic-forms-text-field.component-C3TPVvj_.mjs.map +0 -1
@@ -10,35 +10,7 @@ declare const STANDARD_SCHEMA_KIND: "standardSchema";
10
10
  * Angular schema callback function type.
11
11
  * This is the raw callback that Angular's schema() function accepts.
12
12
  *
13
- * Use this when you want to write Angular schema validation directly
14
- * without any wrapper. This is ideal for Angular-only projects that
15
- * want full access to Angular's form validation APIs.
16
- *
17
13
  * @typeParam T - The form value type
18
- *
19
- * @example
20
- * ```typescript
21
- * import { FormConfig } from '@ng-forge/dynamic-forms';
22
- * import { validateTree } from '@angular/forms/signals';
23
- *
24
- * const config = {
25
- * // Raw callback - no wrapper needed!
26
- * schema: (path) => {
27
- * validateTree(path, (ctx) => {
28
- * const { password, confirmPassword } = ctx.value();
29
- * if (password !== confirmPassword) {
30
- * return [{ kind: 'passwordMismatch', fieldTree: ctx.fieldTreeOf(path).confirmPassword }];
31
- * }
32
- * return null;
33
- * });
34
- * },
35
- * fields: [
36
- * { key: 'password', type: 'input', label: 'Password', required: true },
37
- * { key: 'confirmPassword', type: 'input', label: 'Confirm', required: true,
38
- * validationMessages: { passwordMismatch: 'Passwords must match' } },
39
- * ],
40
- * } as const satisfies FormConfig;
41
- * ```
42
14
  */
43
15
  type AngularSchemaCallback<T = unknown> = (path: SchemaPath<T> & SchemaPathTree<T>) => void;
44
16
  /**
@@ -46,35 +18,16 @@ type AngularSchemaCallback<T = unknown> = (path: SchemaPath<T> & SchemaPathTree<
46
18
  * This allows the dynamic forms system to identify and use standard-compliant schemas
47
19
  * for validation without coupling to any specific schema library.
48
20
  *
49
- * The `out` variance modifier makes this type covariant in T, meaning a
50
- * StandardSchemaMarker<SpecificType> is assignable to StandardSchemaMarker<BroaderType>.
51
- * This enables Zod/Valibot schemas to be used with FormConfig's inferred TValue.
52
- *
53
21
  * @typeParam T - The inferred type that the schema validates to (covariant)
54
- *
55
- * @example
56
- * ```typescript
57
- * import { z } from 'zod';
58
- * import { standardSchema } from '@ng-forge/dynamic-forms/schema';
59
- *
60
- * const userSchema = z.object({
61
- * name: z.string(),
62
- * email: z.string().email(),
63
- * });
64
- *
65
- * // Wrap the Zod schema with standardSchema marker
66
- * const formSchema = standardSchema(userSchema);
67
- * ```
68
22
  */
69
23
  interface StandardSchemaMarker<out T = unknown> {
70
24
  /**
71
25
  * Internal marker identifying this as a standard schema wrapper.
26
+ *
72
27
  * @internal
73
28
  */
74
29
  readonly ɵkind: typeof STANDARD_SCHEMA_KIND;
75
- /**
76
- * The underlying schema that implements the Standard Schema spec.
77
- */
30
+ /** The underlying schema that implements the Standard Schema spec. */
78
31
  readonly schema: StandardSchemaV1<T>;
79
32
  }
80
33
  /**
@@ -82,90 +35,22 @@ interface StandardSchemaMarker<out T = unknown> {
82
35
  * Supports both Standard Schema compliant schemas (Zod, Valibot, ArkType)
83
36
  * and raw Angular schema callbacks.
84
37
  *
85
- * The covariance from StandardSchemaMarker flows through, allowing
86
- * schemas with specific types to be assigned to broader form value types.
87
- *
88
38
  * @typeParam T - The inferred type that the schema validates to
89
- *
90
- * @example Standard Schema (Zod)
91
- * ```typescript
92
- * import { z } from 'zod';
93
- * import { standardSchema } from '@ng-forge/dynamic-forms/schema';
94
- *
95
- * const config = {
96
- * schema: standardSchema(z.object({ ... })),
97
- * fields: [...],
98
- * };
99
- * ```
100
- *
101
- * @example Angular Schema Callback
102
- * ```typescript
103
- * import { validateTree } from '@angular/forms/signals';
104
- *
105
- * const config = {
106
- * schema: (path) => {
107
- * validateTree(path, (ctx) => { ... });
108
- * },
109
- * fields: [...],
110
- * };
111
- * ```
112
39
  */
113
40
  type FormSchema<T = unknown> = StandardSchemaMarker<T> | AngularSchemaCallback<T>;
114
41
  /**
115
42
  * Wraps a Standard Schema compliant schema for use with dynamic forms.
116
43
  *
117
- * This function creates a marker wrapper around schemas that implement the
118
- * Standard Schema spec (Zod, Valibot, ArkType, etc.), allowing the dynamic
119
- * forms system to identify and use them for validation.
120
- *
121
44
  * @typeParam T - The inferred type that the schema validates to
122
45
  * @param schema - A schema implementing the Standard Schema V1 spec
123
46
  * @returns A wrapped schema marker that can be passed to dynamic form configuration
124
- *
125
- * @example
126
- * ```typescript
127
- * import { z } from 'zod';
128
- * import { standardSchema } from '@ng-forge/dynamic-forms/schema';
129
- *
130
- * const loginSchema = z.object({
131
- * email: z.string().email('Invalid email format'),
132
- * password: z.string().min(8, 'Password must be at least 8 characters'),
133
- * });
134
- *
135
- * // Wrap for use with dynamic forms
136
- * const formSchema = standardSchema(loginSchema);
137
- *
138
- * // Use in form configuration
139
- * const formConfig = {
140
- * schema: formSchema,
141
- * fields: [
142
- * input({ key: 'email', label: 'Email' }),
143
- * input({ key: 'password', label: 'Password', props: { type: 'password' } }),
144
- * ],
145
- * };
146
- * ```
147
47
  */
148
48
  declare function standardSchema<T>(schema: StandardSchemaV1<T>): StandardSchemaMarker<T>;
149
49
  /**
150
50
  * Type guard to check if a value is a StandardSchemaMarker.
151
51
  *
152
- * This is useful when processing form configuration to determine if a schema
153
- * has been provided and should be used for validation.
154
- *
155
52
  * @param value - The value to check
156
53
  * @returns True if the value is a StandardSchemaMarker, false otherwise
157
- *
158
- * @example
159
- * ```typescript
160
- * import { isStandardSchemaMarker } from '@ng-forge/dynamic-forms/schema';
161
- *
162
- * function processFormConfig(config: FormConfig) {
163
- * if (config.schema && isStandardSchemaMarker(config.schema)) {
164
- * // Use the schema for validation
165
- * const result = config.schema.schema['~standard'].validate(formValue);
166
- * }
167
- * }
168
- * ```
169
54
  */
170
55
  declare function isStandardSchemaMarker(value: unknown): value is StandardSchemaMarker;
171
56
  /**