@reformer/core 11.0.0-beta.5 → 11.0.0-beta.6

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.
@@ -52,9 +52,9 @@ export interface CreateFormFromModelArgs<T> {
52
52
  * component: Section,
53
53
  * children: [
54
54
  * // Layout несёт только component/componentProps; правила — в отдельной ValidationSchema.
55
- * { value: model.$.email, component: InputField },
55
+ * { value: model.$.email, component: Input },
56
56
  * // вложенная группа: `model.$.profile.name` (≡ под-модель `model.profile.$.name` — тот же сигнал)
57
- * { value: model.$.profile.name, component: InputField },
57
+ * { value: model.$.profile.name, component: Input },
58
58
  * ],
59
59
  * };
60
60
  *
@@ -93,8 +93,8 @@ export declare function createFormFromModel<T>(args: CreateFormFromModelArgs<T>)
93
93
  * // Layout-схема НЕ несёт validators — только component/componentProps.
94
94
  * const schema = {
95
95
  * children: [
96
- * { value: model.$.email, component: InputField },
97
- * { value: model.$.password, component: InputField },
96
+ * { value: model.$.email, component: Input },
97
+ * { value: model.$.password, component: Input },
98
98
  * ],
99
99
  * };
100
100
  *
@@ -125,8 +125,8 @@ export declare function createForm<T>(config: GroupNodeConfig<T>): FormProxy<T>;
125
125
  * @example Legacy (back-compat) — плоская схема без модели
126
126
  * ```typescript
127
127
  * const form = createForm<UserForm>({
128
- * email: { value: '', component: InputField },
129
- * password: { value: '', component: InputField },
128
+ * email: { value: '', component: Input },
129
+ * password: { value: '', component: Input },
130
130
  * });
131
131
  * ```
132
132
  */
@@ -11,7 +11,7 @@ import { ConfigWithSchema, ConfigWithValue, UnknownRecord } from '../types/index
11
11
  * import { NodeFactory } from '@reformer/core';
12
12
  *
13
13
  * const factory = new NodeFactory();
14
- * const node = factory.createNode({ value: '', component: InputField }); // → FieldNode<string>
14
+ * const node = factory.createNode({ value: '', component: Input }); // → FieldNode<string>
15
15
  * ```
16
16
  */
17
17
  export declare class NodeFactory {
@@ -37,25 +37,25 @@ export declare class NodeFactory {
37
37
  * // FieldNode
38
38
  * const field = factory.createNode({
39
39
  * value: 'test@mail.com',
40
- * component: InputField,
40
+ * component: Input,
41
41
  * validators: [required, email]
42
42
  * });
43
43
  *
44
44
  * // GroupNode
45
45
  * const group = factory.createNode({
46
- * email: { value: '', component: InputField },
47
- * password: { value: '', component: InputField }
46
+ * email: { value: '', component: Input },
47
+ * password: { value: '', component: Input }
48
48
  * });
49
49
  *
50
50
  * // ArrayNode (объект)
51
51
  * const array = factory.createNode({
52
- * schema: { title: { value: '', component: InputField } },
52
+ * schema: { title: { value: '', component: Input } },
53
53
  * initialItems: [{ title: 'Item 1' }]
54
54
  * });
55
55
  *
56
56
  * // ArrayNode (массив) - новый формат
57
57
  * const array2 = factory.createNode([
58
- * { title: { value: '', component: InputField } }, // schema
58
+ * { title: { value: '', component: Input } }, // schema
59
59
  * { title: 'Item 1' }, // initial item 1
60
60
  * { title: 'Item 2' } // initial item 2
61
61
  * ]);
@@ -80,7 +80,7 @@ export declare class NodeFactory {
80
80
  *
81
81
  * // Массив с начальными элементами
82
82
  * const array = factory.createArrayNodeFromArray([
83
- * { title: { value: '', component: InputField } }, // schema
83
+ * { title: { value: '', component: Input } }, // schema
84
84
  * { title: 'Item 1' }, // initial value
85
85
  * { title: 'Item 2' } // initial value
86
86
  * ]);
@@ -94,7 +94,7 @@ export declare class NodeFactory {
94
94
  * ✅ НОВОЕ: Извлечено из GroupNode для централизации логики
95
95
  *
96
96
  * Преобразует схему формы в объект со значениями:
97
- * - `{ name: { value: 'John', component: InputField } } → { name: 'John' }`
97
+ * - `{ name: { value: 'John', component: Input } } → { name: 'John' }`
98
98
  * - Поддерживает вложенные группы
99
99
  * - Поддерживает массивы
100
100
  *
@@ -106,10 +106,10 @@ export declare class NodeFactory {
106
106
  * const factory = new NodeFactory();
107
107
  *
108
108
  * const schema = {
109
- * name: { value: 'John', component: InputField },
110
- * age: { value: 30, component: InputField },
109
+ * name: { value: 'John', component: Input },
110
+ * age: { value: 30, component: Input },
111
111
  * address: {
112
- * city: { value: 'Moscow', component: InputField }
112
+ * city: { value: 'Moscow', component: Input }
113
113
  * }
114
114
  * };
115
115
  *
@@ -132,7 +132,7 @@ export declare class NodeFactory {
132
132
  * ```typescript
133
133
  * const factory = new NodeFactory();
134
134
  *
135
- * factory.isFieldConfig({ value: '', component: InputField }); // true
135
+ * factory.isFieldConfig({ value: '', component: Input }); // true
136
136
  * factory.isFieldConfig({ email: { value: '' } }); // false
137
137
  * factory.isFieldConfig(null); // false
138
138
  * ```
@@ -155,7 +155,7 @@ export declare class NodeFactory {
155
155
  * const factory = new NodeFactory();
156
156
  *
157
157
  * factory.isArrayConfig({ schema: {}, initialItems: [] }); // true
158
- * factory.isArrayConfig({ value: '', component: InputField }); // false
158
+ * factory.isArrayConfig({ value: '', component: Input }); // false
159
159
  * factory.isArrayConfig({ email: { value: '' } }); // false
160
160
  * ```
161
161
  */
@@ -176,11 +176,11 @@ export declare class NodeFactory {
176
176
  * const factory = new NodeFactory();
177
177
  *
178
178
  * factory.isGroupConfig({
179
- * email: { value: '', component: InputField },
180
- * password: { value: '', component: InputField }
179
+ * email: { value: '', component: Input },
180
+ * password: { value: '', component: Input }
181
181
  * }); // true
182
182
  *
183
- * factory.isGroupConfig({ value: '', component: InputField }); // false
183
+ * factory.isGroupConfig({ value: '', component: Input }); // false
184
184
  * factory.isGroupConfig({ schema: {} }); // false
185
185
  * factory.isGroupConfig(null); // false
186
186
  * ```
@@ -11,8 +11,8 @@ import { FormProxy } from '../types/form-proxy';
11
11
  * @example
12
12
  * ```typescript
13
13
  * const array = new ArrayNode({
14
- * title: { value: '', component: InputField },
15
- * price: { value: 0, component: InputField },
14
+ * title: { value: '', component: Input },
15
+ * price: { value: 0, component: Input },
16
16
  * });
17
17
  *
18
18
  * array.push({ title: 'Item 1', price: 100 });
@@ -141,7 +141,7 @@ export declare class ArrayNode<T extends object> extends FormNode<T[]> {
141
141
  * @example
142
142
  * ```typescript
143
143
  * const arrayNode = new ArrayNode(
144
- * { name: { value: '', component: InputField } },
144
+ * { name: { value: '', component: Input } },
145
145
  * [{ name: 'Initial 1' }, { name: 'Initial 2' }]
146
146
  * );
147
147
  *
@@ -11,7 +11,7 @@ import { FieldConfig, FieldStatus, ValidationError } from '../types/index';
11
11
  * ```typescript
12
12
  * const field = new FieldNode({
13
13
  * value: '',
14
- * component: InputField,
14
+ * component: Input,
15
15
  * validators: [required, email],
16
16
  * });
17
17
  *
@@ -103,7 +103,7 @@ export declare class FieldNode<T> extends FormNode<T> {
103
103
  *
104
104
  * @example
105
105
  * ```typescript
106
- * const field = new FieldNode({ value: 'initial', component: InputField });
106
+ * const field = new FieldNode({ value: 'initial', component: Input });
107
107
  *
108
108
  * field.setValue('changed');
109
109
  * field.reset('temp value');
@@ -202,7 +202,7 @@ export declare class FieldNode<T> extends FormNode<T> {
202
202
  * const form = createForm({
203
203
  * email: {
204
204
  * value: '',
205
- * component: InputField,
205
+ * component: Input,
206
206
  * updateOn: 'submit', // Изначально валидация только при submit
207
207
  * validators: [required, email],
208
208
  * },
@@ -15,8 +15,8 @@ import { SubmitOptions, SubmitResult } from '../form-submitter';
15
15
  * @example
16
16
  * ```typescript
17
17
  * const form = new GroupNode({
18
- * email: { valueSignal: model.$.email, component: InputField },
19
- * password: { valueSignal: model.$.password, component: InputField },
18
+ * email: { valueSignal: model.$.email, component: Input },
19
+ * password: { valueSignal: model.$.password, component: Input },
20
20
  * });
21
21
  *
22
22
  * // Прямой доступ к полям через Proxy
@@ -136,8 +136,8 @@ export declare class GroupNode<T> extends FormNode<T> {
136
136
  * @example
137
137
  * ```typescript
138
138
  * const form = new GroupNode({
139
- * email: { value: '', component: InputField },
140
- * name: { value: '', component: InputField },
139
+ * email: { value: '', component: Input },
140
+ * name: { value: '', component: Input },
141
141
  * });
142
142
  *
143
143
  * const proxy = form.getProxy();
@@ -189,11 +189,11 @@ export declare class GroupNode<T> extends FormNode<T> {
189
189
  * @example
190
190
  * ```typescript
191
191
  * const form = new GroupNode({
192
- * email: { value: '', component: InputField },
192
+ * email: { value: '', component: Input },
193
193
  * address: {
194
- * city: { value: '', component: InputField }
194
+ * city: { value: '', component: Input }
195
195
  * },
196
- * items: [{ name: { value: '', component: InputField } }]
196
+ * items: [{ name: { value: '', component: Input } }]
197
197
  * });
198
198
  *
199
199
  * form.getFieldByPath('email'); // FieldNode
@@ -36,8 +36,8 @@ export interface ModelArrayControl<TItem extends object> {
36
36
  * const model = createModel<{ rows: { name: string; qty: number }[] }>({ rows: [] });
37
37
  *
38
38
  * const rowItem = (item: FormModel<{ name: string; qty: number }>) => ({
39
- * name: { value: item.$.name, component: InputField },
40
- * qty: { value: item.$.qty, component: InputField },
39
+ * name: { value: item.$.name, component: Input },
40
+ * qty: { value: item.$.qty, component: Input },
41
41
  * });
42
42
  *
43
43
  * const form = createForm({
@@ -89,14 +89,14 @@ type NonEmptyFieldConfig<T> = RequireAtLeastOne<FieldConfig<T>>;
89
89
  * }
90
90
  *
91
91
  * const schema: FormSchema<Form> = {
92
- * name: { value: '', component: InputField },
92
+ * name: { value: '', component: Input },
93
93
  * address: {
94
- * city: { value: '', component: InputField },
95
- * street: { value: '', component: InputField },
94
+ * city: { value: '', component: Input },
95
+ * street: { value: '', component: Input },
96
96
  * },
97
97
  * items: [{
98
- * title: { value: '', component: InputField },
99
- * price: { value: 0, component: InputField },
98
+ * title: { value: '', component: Input },
99
+ * price: { value: 0, component: Input },
100
100
  * }],
101
101
  * };
102
102
  * ```