@rolster/react-forms 18.2.10 → 18.3.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.
Files changed (33) hide show
  1. package/dist/cjs/index.js +280 -198
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/es/index.js +268 -182
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/esm/form-array/form-array-control.hook.d.ts +24 -18
  6. package/dist/esm/form-array/form-array-control.hook.js +32 -26
  7. package/dist/esm/form-array/form-array-control.hook.js.map +1 -1
  8. package/dist/esm/form-array/form-array-group.hook.d.ts +10 -9
  9. package/dist/esm/form-array/form-array-group.hook.js +33 -12
  10. package/dist/esm/form-array/form-array-group.hook.js.map +1 -1
  11. package/dist/esm/form-array/form-array.hook.d.ts +5 -11
  12. package/dist/esm/form-array/form-array.hook.js +45 -55
  13. package/dist/esm/form-array/form-array.hook.js.map +1 -1
  14. package/dist/esm/form-array/index.d.ts +2 -2
  15. package/dist/esm/form-array/index.js +2 -2
  16. package/dist/esm/form-array/index.js.map +1 -1
  17. package/dist/esm/form-control.hook.d.ts +16 -11
  18. package/dist/esm/form-control.hook.js +47 -48
  19. package/dist/esm/form-control.hook.js.map +1 -1
  20. package/dist/esm/form-group.hook.d.ts +3 -3
  21. package/dist/esm/form-group.hook.js +17 -17
  22. package/dist/esm/form-group.hook.js.map +1 -1
  23. package/dist/esm/form-ref.hook.d.ts +10 -10
  24. package/dist/esm/form-ref.hook.js +21 -17
  25. package/dist/esm/form-ref.hook.js.map +1 -1
  26. package/dist/esm/index.d.ts +2 -3
  27. package/dist/esm/index.js +2 -2
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/types.d.ts +25 -11
  30. package/package.json +6 -3
  31. package/dist/esm/form-array/types.d.ts +0 -23
  32. package/dist/esm/form-array/types.js +0 -2
  33. package/dist/esm/form-array/types.js.map +0 -1
package/dist/es/index.js CHANGED
@@ -1,29 +1,131 @@
1
- import { createFormControlProps, createFormGroupProps, createFormArrayProps } from '@rolster/helpers-forms';
2
- import { controlIsValid, groupIsValid, controlsAllChecked, controlsPartialChecked, controlsToState, controlsToValue, arrayIsValid, groupAllChecked, groupPartialChecked } from '@rolster/helpers-forms/helpers';
3
1
  import { v4 } from 'uuid';
4
- import { useState, useEffect, useRef } from 'react';
2
+ import { useState, useRef, useEffect } from 'react';
3
+
4
+ function itIsFormControlOptions(props) {
5
+ return (typeof props === 'object' && ('state' in props || 'validators' in props));
6
+ }
7
+ function itIsFormGroupOptions(props) {
8
+ return typeof props === 'object' && 'controls' in props;
9
+ }
10
+ function itIsFormArrayOptions(props) {
11
+ return (typeof props === 'object' && ('groups' in props || 'validators' in props));
12
+ }
13
+ function createFormControlOptions(...argsProps) {
14
+ const [props, validators] = argsProps;
15
+ if (!props) {
16
+ return { state: props, validators };
17
+ }
18
+ if (!validators && itIsFormControlOptions(props)) {
19
+ return props;
20
+ }
21
+ return {
22
+ state: props,
23
+ validators
24
+ };
25
+ }
26
+ function createFormGroupOptions(...argsProps) {
27
+ const [props, validators] = argsProps;
28
+ if (!validators && itIsFormGroupOptions(props)) {
29
+ return props;
30
+ }
31
+ return {
32
+ controls: props,
33
+ validators
34
+ };
35
+ }
36
+ function createFormArrayOptions(...argsProps) {
37
+ const [props, validators] = argsProps;
38
+ if (!props) {
39
+ return { groups: props, validators };
40
+ }
41
+ if (!validators && itIsFormArrayOptions(props)) {
42
+ return props;
43
+ }
44
+ return {
45
+ groups: props,
46
+ validators
47
+ };
48
+ }
49
+
50
+ const FALSY_VALUE = ['false', 'undefined', '0', 0];
51
+ function itIsDefined(object) {
52
+ return typeof object !== 'undefined' && object !== null;
53
+ }
54
+ function itIsUndefined(object) {
55
+ return !itIsDefined(object);
56
+ }
57
+ function parseBoolean(value) {
58
+ return !(itIsUndefined(value) ||
59
+ value === false ||
60
+ FALSY_VALUE.includes(value));
61
+ }
62
+
63
+ const controlIsValid = ({ state, validators }) => {
64
+ return validators.reduce((errors, validator) => {
65
+ const error = validator(state);
66
+ if (error) {
67
+ errors.push(error);
68
+ }
69
+ return errors;
70
+ }, []);
71
+ };
72
+ const controlsAllChecked = (controls, key) => {
73
+ return Object.values(controls).reduce((value, control) => value && parseBoolean(control[key]), true);
74
+ };
75
+ const controlsPartialChecked = (controls, key) => {
76
+ return Object.values(controls).reduce((value, control) => value || parseBoolean(control[key]), false);
77
+ };
78
+ const controlsToState = (controls) => {
79
+ return Object.entries(controls).reduce((result, [key, { state }]) => {
80
+ result[key] = state;
81
+ return result;
82
+ }, {});
83
+ };
84
+ const groupIsValid = ({ controls, validators }) => {
85
+ return validators.reduce((errors, validator) => {
86
+ const error = validator(controls);
87
+ if (error) {
88
+ errors.push(error);
89
+ }
90
+ return errors;
91
+ }, []);
92
+ };
93
+ function groupAllChecked(groups, key) {
94
+ return groups.reduce((value, group) => value && parseBoolean(group[key]), true);
95
+ }
96
+ function groupPartialChecked(groups, key) {
97
+ return groups.reduce((value, group) => value || parseBoolean(group[key]), false);
98
+ }
99
+ const arrayIsValid = ({ groups, validators }) => {
100
+ return validators.reduce((errors, validator) => {
101
+ const error = validator(groups);
102
+ if (error) {
103
+ errors.push(error);
104
+ }
105
+ return errors;
106
+ }, []);
107
+ };
5
108
 
6
109
  class RolsterArrayControl {
7
- constructor(props) {
8
- const { uuid, focused, dirty, disabled, initialState, state, touched, validators } = props;
9
- this.uuid = uuid;
10
- this.focused = focused || false;
110
+ constructor(options) {
111
+ this.initialState = options.initialState;
112
+ this.uuid = options.uuid;
113
+ this.focused = !!options.focused;
11
114
  this.unfocused = !this.focused;
12
- this.touched = touched || false;
115
+ this.touched = !!options.touched;
13
116
  this.untouched = !this.touched;
14
- this.dirty = dirty || false;
117
+ this.dirty = !!options.dirty;
15
118
  this.pristine = !this.dirty;
16
- this.disabled = disabled || false;
119
+ this.disabled = !!options.disabled;
17
120
  this.enabled = !this.disabled;
121
+ const { state, validators } = options;
18
122
  this.state = state;
19
123
  this.validators = validators;
20
- this.initialState = initialState;
21
124
  this.errors = validators ? controlIsValid({ state, validators }) : [];
22
125
  this.error = this.errors[0];
23
126
  this.valid = this.errors.length === 0;
24
127
  this.invalid = !this.valid;
25
128
  this.wrong = this.touched && this.invalid;
26
- this.value = state;
27
129
  }
28
130
  focus() {
29
131
  if (!this.focused) {
@@ -61,37 +163,43 @@ class RolsterArrayControl {
61
163
  setValidators(validators) {
62
164
  this.update({ validators });
63
165
  }
166
+ subscribe(listener) {
167
+ this.subscriber = listener;
168
+ }
64
169
  reset() {
65
170
  this.update({ state: this.initialState });
66
171
  }
67
172
  update(changes) {
68
- this.group?.parent?.refreshControl(this, {
69
- ...changes,
70
- initialState: this.initialState
71
- });
173
+ if (this.subscriber) {
174
+ this.subscriber({
175
+ ...this,
176
+ ...changes,
177
+ initialState: this.initialState
178
+ });
179
+ }
72
180
  }
73
181
  }
74
- function useFormArrayControl(controlProps, controlValidators) {
75
- const props = createFormControlProps(controlProps, controlValidators);
182
+ function useArrayControl(options, validators) {
183
+ const controlOptions = createFormControlOptions(options, validators);
76
184
  return new RolsterArrayControl({
77
- ...props,
185
+ ...controlOptions,
78
186
  uuid: v4(),
79
- initialState: props.state
187
+ initialState: controlOptions.state
80
188
  });
81
189
  }
82
- function useInputArrayControl(controlProps, controlValidators) {
83
- const props = createFormControlProps(controlProps, controlValidators);
84
- return new RolsterArrayControl({
85
- ...props,
86
- uuid: v4(),
87
- initialState: props.state
88
- });
190
+ function useReactArrayControl(options, validators) {
191
+ return useArrayControl(options, validators);
192
+ }
193
+ function useFormArrayControl(options, validators) {
194
+ return useArrayControl(options, validators);
195
+ }
196
+ function useInputArrayControl(options, validators) {
197
+ return useArrayControl(options, validators);
89
198
  }
90
199
 
91
200
  class RolsterArrayGroup {
92
- constructor(props) {
93
- const { controls, resource, uuid, validators } = props;
94
- Object.values(controls).forEach((control) => (control.group = this));
201
+ constructor(options) {
202
+ const { controls, resource, uuid, validators } = options;
95
203
  this.uuid = uuid;
96
204
  this.controls = controls;
97
205
  this.validators = validators;
@@ -101,53 +209,72 @@ class RolsterArrayGroup {
101
209
  this.valid =
102
210
  this.errors.length === 0 && controlsAllChecked(controls, 'valid');
103
211
  this.invalid = !this.valid;
104
- this.touched = controlsPartialChecked(controls, 'touched');
105
- this.toucheds = controlsAllChecked(controls, 'touched');
106
212
  this.dirty = controlsPartialChecked(controls, 'dirty');
107
213
  this.dirties = controlsAllChecked(controls, 'dirty');
214
+ this.touched = controlsPartialChecked(controls, 'touched');
215
+ this.toucheds = controlsAllChecked(controls, 'touched');
108
216
  this.untouched = !this.touched;
109
217
  this.untoucheds = !this.toucheds;
110
218
  this.pristine = !this.dirty;
111
219
  this.pristines = !this.dirties;
112
220
  this.wrong = this.touched && this.invalid;
113
221
  this.state = controlsToState(controls);
114
- this.value = controlsToValue(controls);
222
+ const subscriber = (options) => {
223
+ this.update({
224
+ controls: Object.entries(this.controls).reduce((controls, [key, control]) => {
225
+ controls[key] =
226
+ control.uuid === options.uuid
227
+ ? new RolsterArrayControl(options)
228
+ : control;
229
+ return controls;
230
+ }, {})
231
+ });
232
+ };
233
+ Object.values(controls).forEach((control) => {
234
+ control.subscribe(subscriber);
235
+ });
115
236
  }
116
237
  setValidators(validators) {
117
- this.parent?.refreshGroup(this, { validators });
238
+ this.update({ validators });
239
+ }
240
+ subscribe(listener) {
241
+ this.subscriber = listener;
242
+ }
243
+ update(changes) {
244
+ if (this.subscriber) {
245
+ this.subscriber({ ...this, ...changes });
246
+ }
118
247
  }
119
248
  }
120
- function useFormArrayGroup(groupProps, groupValidators) {
121
- const props = createFormGroupProps(groupProps, groupValidators);
122
- return new RolsterArrayGroup({ ...props, uuid: v4() });
249
+ function useFormArrayGroup(options, validators) {
250
+ const groupOptions = createFormGroupOptions(options, validators);
251
+ return new RolsterArrayGroup({ ...groupOptions, uuid: v4() });
123
252
  }
124
253
 
125
- function cloneFormArrayControl(control, changes) {
126
- return new RolsterArrayControl({ ...control, ...changes });
127
- }
128
- function cloneFormArrayGroup(group, changes) {
129
- return new RolsterArrayGroup({ ...group, ...changes });
130
- }
131
- function cloneFormControlForArrayGroup(group, control, changes) {
132
- const newControl = cloneFormArrayControl(control, changes);
133
- const { uuid } = newControl;
134
- const controls = Object.entries(group.controls).reduce((controls, [key, control]) => {
135
- controls[key] = control.uuid === uuid ? newControl : control;
136
- return controls;
137
- }, {});
138
- return new RolsterArrayGroup({ ...group, controls });
139
- }
140
- function useFormArray(arrayProps, arrayValidators) {
141
- const props = createFormArrayProps(arrayProps, arrayValidators);
142
- const [currentState] = useState(props.groups);
143
- const [state, setState] = useState([]);
144
- const [validators, setValidators] = useState(props.validators);
145
- const [controls, setControls] = useState([]);
146
- const [groups, setGroups] = useState(props.groups || []);
254
+ function useFormArray(options, arrayValidators) {
255
+ const arrayOptions = createFormArrayOptions(options, arrayValidators);
256
+ const { validators } = arrayOptions;
257
+ const groups = arrayOptions.groups || [];
258
+ const [arrayState, setArrayState] = useState({
259
+ controls: groups.map(({ controls }) => controls),
260
+ groups,
261
+ state: groups.map(({ controls }) => controlsToState(controls)),
262
+ validators
263
+ });
264
+ const currentState = useRef(groups);
147
265
  useEffect(() => {
148
- setControls(groups.map(({ controls }) => controls));
149
- setState(groups.map(({ controls }) => controlsToState(controls)));
150
- }, [groups]);
266
+ const subscriber = (options) => {
267
+ setArrayState((state) => ({
268
+ ...state,
269
+ groups: arrayState.groups.map((group) => group.uuid === options.uuid
270
+ ? new RolsterArrayGroup(options)
271
+ : group)
272
+ }));
273
+ };
274
+ arrayState.groups.forEach((group) => {
275
+ group.subscribe(subscriber);
276
+ });
277
+ }, [arrayState]);
151
278
  const errors = validators ? arrayIsValid({ groups, validators }) : [];
152
279
  const error = errors[0];
153
280
  const valid = errors.length === 0 && groupAllChecked(groups, 'valid');
@@ -155,161 +282,154 @@ function useFormArray(arrayProps, arrayValidators) {
155
282
  const toucheds = groupAllChecked(groups, 'touched');
156
283
  const dirties = groupAllChecked(groups, 'dirty');
157
284
  const dirty = groupPartialChecked(groups, 'dirty');
285
+ function setGroups(groups) {
286
+ setArrayState((currentState) => ({
287
+ ...currentState,
288
+ groups,
289
+ controls: groups.map(({ controls }) => controls),
290
+ state: groups.map(({ controls }) => controlsToState(controls))
291
+ }));
292
+ }
158
293
  function push(group) {
159
- setGroups([...groups, group]);
294
+ setGroups([...arrayState.groups, group]);
160
295
  }
161
- function merge(newGroups) {
162
- setGroups([...groups, ...newGroups]);
296
+ function merge(groups) {
297
+ setGroups([...arrayState.groups, ...groups]);
163
298
  }
164
299
  function set(groups) {
165
300
  setGroups(groups);
166
301
  }
167
- function refreshControl(control, changes) {
168
- if (control.group) {
169
- const group = cloneFormControlForArrayGroup(control.group, control, changes);
170
- setGroups(groups.map((currentGroup) => currentGroup.uuid === group.uuid ? group : currentGroup));
171
- }
172
- }
173
- function refreshGroup(group, changes) {
174
- const newGroup = cloneFormArrayGroup(group, changes);
175
- const { uuid } = newGroup;
176
- setGroups(groups.map((currentGroup) => currentGroup.uuid === uuid ? newGroup : currentGroup));
177
- }
178
- function remove(group) {
179
- setGroups(groups.filter(({ uuid }) => group.uuid !== uuid));
302
+ function remove({ uuid }) {
303
+ setGroups(arrayState.groups.filter((group) => group.uuid !== uuid));
180
304
  }
181
305
  function reset() {
182
- setGroups(currentState || []);
306
+ setGroups(currentState.current);
183
307
  }
184
- const formArray = {
185
- controls,
308
+ function setValidators(validators) {
309
+ setArrayState((state) => ({ ...state, validators }));
310
+ }
311
+ return {
312
+ ...arrayState,
186
313
  dirty,
187
314
  dirties,
188
315
  error,
189
316
  errors,
190
- groups,
191
317
  invalid: !valid,
192
318
  merge,
193
319
  pristine: !dirty,
194
320
  pristines: !dirties,
195
321
  push,
196
- refreshControl,
197
- refreshGroup,
198
322
  remove,
199
323
  reset,
200
324
  set,
201
325
  setValidators,
202
- state,
203
326
  touched,
204
327
  toucheds,
205
328
  untouched: !touched,
206
329
  untoucheds: !toucheds,
207
330
  valid,
208
- value: state,
209
331
  wrong: touched && !valid
210
332
  };
211
- groups.forEach((group) => (group.parent = formArray));
212
- return formArray;
213
333
  }
214
334
 
215
- function useControl(controlProps, controlValidators) {
216
- const props = createFormControlProps(controlProps, controlValidators);
217
- const [state, setCurrentState] = useState(props.state);
218
- const [value, setValue] = useState(props.state);
219
- const [touched, setTouched] = useState(props.touched || false);
220
- const [dirty, setDirty] = useState(false);
221
- const [focused, setFocused] = useState(false);
222
- const [disabled, setDisabled] = useState(false);
223
- const [initialValue] = useState(props.state);
224
- const [validators, setValidators] = useState(props.validators);
335
+ function useControl(controlOptions, controlValidators) {
336
+ const { state, touched, validators } = createFormControlOptions(controlOptions, controlValidators);
337
+ const [controlState, setControlState] = useState({
338
+ dirty: false,
339
+ disabled: false,
340
+ focused: false,
341
+ state: state,
342
+ touched: !!touched,
343
+ validators: validators
344
+ });
345
+ const initialState = useRef(state);
225
346
  const elementRef = useRef(null);
226
347
  const errors = validators ? controlIsValid({ state, validators }) : [];
227
- const error = errors[0];
228
348
  const valid = errors.length === 0;
229
- useEffect(() => {
230
- if (state !== null && state !== undefined) {
231
- setValue(state);
232
- }
233
- }, [state]);
234
349
  function focus() {
235
- setFocused(true);
350
+ setControlState((state) => ({ ...state, focused: true }));
236
351
  }
237
352
  function blur() {
238
- setFocused(false);
353
+ setControlState((state) => ({ ...state, focused: false }));
239
354
  }
240
355
  function disable() {
241
- setDisabled(true);
356
+ setControlState((state) => ({ ...state, disabled: true }));
242
357
  }
243
358
  function enable() {
244
- setDisabled(false);
359
+ setControlState((state) => ({ ...state, disabled: false }));
245
360
  }
246
361
  function touch() {
247
- setTouched(true);
362
+ setControlState((state) => ({ ...state, touched: true }));
248
363
  }
249
364
  function untouch() {
250
- setTouched(false);
365
+ setControlState((state) => ({ ...state, touched: false }));
251
366
  }
252
367
  function setState(state) {
253
- setDirty(true);
254
- setCurrentState(state);
368
+ setControlState((currentState) => ({
369
+ ...currentState,
370
+ dirty: true,
371
+ state
372
+ }));
373
+ }
374
+ function setValidators(validators) {
375
+ setControlState((state) => ({ ...state, validators }));
255
376
  }
256
377
  function reset() {
257
- setTouched(false);
258
- setDirty(false);
259
- setCurrentState(initialValue);
378
+ setControlState((currentState) => ({
379
+ ...currentState,
380
+ dirty: false,
381
+ state: initialState.current,
382
+ touched: false
383
+ }));
260
384
  }
261
385
  return {
386
+ ...controlState,
262
387
  blur,
263
- dirty,
264
388
  disable,
265
- disabled,
266
389
  elementRef,
267
390
  enable,
268
- enabled: !disabled,
269
- error,
391
+ enabled: !controlState.disabled,
392
+ error: errors[0],
270
393
  errors,
271
394
  focus,
272
- focused,
273
395
  invalid: !valid,
274
- pristine: !dirty,
396
+ pristine: !controlState.dirty,
275
397
  reset,
276
398
  setState,
277
399
  setValidators,
278
- state,
279
400
  touch,
280
- touched,
281
- unfocused: !focused,
401
+ unfocused: !controlState.focused,
282
402
  untouch,
283
- untouched: !touched,
403
+ untouched: !controlState.touched,
284
404
  valid,
285
- value,
286
- wrong: touched && !valid
405
+ wrong: controlState.touched && !valid
287
406
  };
288
407
  }
289
- function useReactControl(controlProps, controlValidators) {
290
- return useControl(controlProps, controlValidators);
408
+ function useReactControl(options, validators) {
409
+ return useControl(options, validators);
291
410
  }
292
- function useFormControl(controlProps, controlValidators) {
293
- return useControl(controlProps, controlValidators);
411
+ function useFormControl(options, validators) {
412
+ return useControl(options, validators);
294
413
  }
295
- function useInputControl(controlProps, controlValidators) {
296
- return useControl(controlProps, controlValidators);
414
+ function useInputControl(options, validators) {
415
+ return useControl(options, validators);
297
416
  }
298
417
 
299
- function useFormGroup(groupProps, groupValidators) {
300
- const props = createFormGroupProps(groupProps, groupValidators);
301
- const [validators, setValidators] = useState(props.validators);
302
- const { controls } = props;
303
- const errors = (() => validators ? groupIsValid({ controls, validators }) : [])();
304
- const valid = (() => errors.length === 0 && controlsAllChecked(controls, 'valid'))();
305
- const touched = (() => controlsPartialChecked(controls, 'touched'))();
306
- const toucheds = (() => controlsAllChecked(controls, 'touched'))();
307
- const dirty = (() => controlsPartialChecked(controls, 'dirty'))();
308
- const dirties = (() => controlsAllChecked(controls, 'dirty'))();
309
- const state = (() => controlsToState(controls))();
310
- const value = (() => controlsToValue(controls))();
418
+ function useFormGroup(options, groupValidators) {
419
+ const groupOptions = createFormGroupOptions(options, groupValidators);
420
+ const [validators, setValidators] = useState(groupOptions.validators);
421
+ const { controls } = groupOptions;
422
+ const errors = validators ? groupIsValid({ controls, validators }) : [];
423
+ const valid = errors.length === 0 && controlsAllChecked(controls, 'valid');
424
+ const state = controlsToState(controls);
425
+ const dirty = controlsPartialChecked(controls, 'dirty');
426
+ const dirties = controlsAllChecked(controls, 'dirty');
427
+ const touched = controlsPartialChecked(controls, 'touched');
428
+ const toucheds = controlsAllChecked(controls, 'touched');
311
429
  function reset() {
312
- Object.values(controls).forEach((control) => control.reset());
430
+ Object.values(controls).forEach((control) => {
431
+ control.reset();
432
+ });
313
433
  }
314
434
  return {
315
435
  controls,
@@ -321,50 +441,16 @@ function useFormGroup(groupProps, groupValidators) {
321
441
  pristine: !dirty,
322
442
  pristines: !dirties,
323
443
  reset,
324
- state,
325
444
  setValidators,
445
+ state,
326
446
  touched,
327
447
  toucheds,
328
448
  untouched: !touched,
329
449
  untoucheds: !toucheds,
330
450
  valid,
331
- value,
332
451
  wrong: touched && !valid
333
452
  };
334
453
  }
335
454
 
336
- function useInputRefControl(props) {
337
- const { setValue, state, validators } = props;
338
- const inputControl = useInputControl(state, validators);
339
- useEffect(() => {
340
- const { elementRef } = inputControl;
341
- elementRef?.current?.addEventListener('focus', () => {
342
- inputControl.focus();
343
- });
344
- elementRef?.current?.addEventListener('blur', () => {
345
- inputControl.blur();
346
- if (!inputControl.touched) {
347
- inputControl.touch();
348
- }
349
- });
350
- elementRef?.current?.addEventListener('change', ({ target }) => {
351
- setValue(inputControl, target.value);
352
- });
353
- }, []);
354
- return inputControl;
355
- }
356
- function useTextRefControl(controlProps, controlValidators) {
357
- return useInputRefControl({
358
- ...createFormControlProps(controlProps, controlValidators),
359
- setValue: (inputControl, value) => inputControl.setState(value)
360
- });
361
- }
362
- function useNumberRefControl(controlProps, controlValidators) {
363
- return useInputRefControl({
364
- ...createFormControlProps(controlProps, controlValidators),
365
- setValue: (inputControl, value) => inputControl.setState(+value)
366
- });
367
- }
368
-
369
- export { cloneFormArrayControl, cloneFormArrayGroup, cloneFormControlForArrayGroup, useFormArray, useFormArrayControl, useFormArrayGroup, useFormControl, useFormGroup, useInputArrayControl, useInputControl, useNumberRefControl, useReactControl, useTextRefControl };
455
+ export { useFormArray, useFormArrayControl, useFormArrayGroup, useFormControl, useFormGroup, useInputArrayControl, useInputControl, useReactArrayControl, useReactControl };
370
456
  //# sourceMappingURL=index.js.map