@rolster/react-forms 18.10.3 → 18.11.1

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/dist/cjs/index.js CHANGED
@@ -117,13 +117,13 @@ class RolsterArrayGroup {
117
117
  this.errors.length === 0 && helpers.controlsAllChecked(controls, 'valid');
118
118
  this.invalid = !this.valid;
119
119
  this.dirty = helpers.controlsPartialChecked(controls, 'dirty');
120
- this.dirtyAll = helpers.controlsAllChecked(controls, 'dirty');
120
+ this.dirties = helpers.controlsAllChecked(controls, 'dirty');
121
121
  this.touched = helpers.controlsPartialChecked(controls, 'touched');
122
- this.touchedAll = helpers.controlsAllChecked(controls, 'touched');
123
- this.untouched = !this.touched;
124
- this.untouchedAll = !this.touchedAll;
122
+ this.toucheds = helpers.controlsAllChecked(controls, 'touched');
125
123
  this.pristine = !this.dirty;
126
- this.pristineAll = !this.dirtyAll;
124
+ this.pristines = !this.dirties;
125
+ this.untouched = !this.touched;
126
+ this.untoucheds = !this.toucheds;
127
127
  this.wrong = this.touched && this.invalid;
128
128
  this.value = helpers.controlsToValue(controls);
129
129
  const subscriber = (options) => {
@@ -220,57 +220,53 @@ function formArrayList(valueToControls, options) {
220
220
  });
221
221
  }
222
222
 
223
+ function errorsInArray(groups, validators) {
224
+ return validators ? helpers.arrayIsValid({ groups, validators }) : [];
225
+ }
226
+ function validStateInArray(groups, validators) {
227
+ const errors = errorsInArray(groups, validators);
228
+ return {
229
+ errors,
230
+ valid: errors.length === 0 && helpers.groupAllChecked(groups, 'valid')
231
+ };
232
+ }
233
+ function replaceStateInArray(groups, validators) {
234
+ return {
235
+ ...validStateInArray(groups, validators),
236
+ groups,
237
+ controls: groups.map(({ controls }) => controls),
238
+ value: groups.map(({ controls }) => helpers.controlsToValue(controls))
239
+ };
240
+ }
223
241
  function useFormArray(options, validators) {
224
242
  const _options = _arguments.createFormArrayOptions(options, validators);
225
243
  const groups = _options.groups || [];
226
- const _value = react.useRef(groups);
244
+ const initialValue = react.useRef(groups);
227
245
  const [state, setState] = react.useState({
246
+ ...validStateInArray(groups, _options.validators),
228
247
  controls: groups.map(({ controls }) => controls),
248
+ dirty: false,
249
+ dirties: false,
229
250
  disabled: false,
230
251
  groups,
252
+ touched: false,
253
+ toucheds: false,
231
254
  value: groups.map(({ controls }) => helpers.controlsToValue(controls)),
232
255
  validators: _options.validators
233
256
  });
234
- const [errors, setErrors] = react.useState([]);
235
- const [controlState, setControlState] = react.useState({
236
- valid: false,
237
- dirty: false,
238
- dirtyAll: false,
239
- touched: false,
240
- touchedAll: false
241
- });
242
257
  react.useEffect(() => {
243
258
  const subscriber = (options) => {
244
- setValue(state.groups.map((group) => group.uuid === options.uuid
245
- ? new RolsterArrayGroup(options)
246
- : group));
259
+ setState((state) => ({
260
+ ...state,
261
+ ...replaceStateInArray(state.groups.map((group) => group.uuid === options.uuid
262
+ ? new RolsterArrayGroup(options)
263
+ : group), state.validators)
264
+ }));
247
265
  };
248
266
  state.groups.forEach((group) => {
249
267
  group.subscribe(subscriber);
250
268
  });
251
- setState((_state) => ({
252
- ..._state,
253
- controls: state.groups.map(({ controls }) => controls),
254
- value: state.groups.map(({ controls }) => helpers.controlsToValue(controls))
255
- }));
256
269
  }, [state.groups]);
257
- react.useEffect(() => {
258
- setErrors(state.validators
259
- ? helpers.arrayIsValid({
260
- groups: state.groups,
261
- validators: state.validators
262
- })
263
- : []);
264
- }, [state.groups, state.validators]);
265
- react.useEffect(() => {
266
- setControlState({
267
- valid: errors.length === 0 && helpers.groupAllChecked(state.groups, 'valid'),
268
- dirty: helpers.groupPartialChecked(state.groups, 'dirty'),
269
- dirtyAll: helpers.groupAllChecked(state.groups, 'dirty'),
270
- touched: helpers.groupPartialChecked(state.groups, 'touched'),
271
- touchedAll: helpers.groupAllChecked(state.groups, 'touched')
272
- });
273
- }, [state.groups, errors]);
274
270
  const disable = react.useCallback(() => {
275
271
  setState((state) => ({ ...state, disabled: true }));
276
272
  }, []);
@@ -278,45 +274,62 @@ function useFormArray(options, validators) {
278
274
  setState((state) => ({ ...state, disabled: false }));
279
275
  }, []);
280
276
  const setValue = react.useCallback((groups) => {
281
- setState((state) => ({ ...state, groups }));
277
+ setState((state) => ({
278
+ ...state,
279
+ ...replaceStateInArray(groups, state.validators)
280
+ }));
282
281
  }, []);
283
282
  const setInitialValue = react.useCallback((groups) => {
284
- setState((state) => ({ ...state, groups }));
285
- _value.current = groups;
283
+ setState((state) => ({
284
+ ...state,
285
+ ...replaceStateInArray(groups, state.validators)
286
+ }));
287
+ initialValue.current = groups;
286
288
  }, []);
287
289
  const push = react.useCallback((group) => {
288
- setState((state) => ({ ...state, groups: [...state.groups, group] }));
290
+ setState((state) => ({
291
+ ...state,
292
+ ...replaceStateInArray([...state.groups, group], state.validators)
293
+ }));
289
294
  }, []);
290
295
  const merge = react.useCallback((groups) => {
291
- setState((state) => ({ ...state, groups: [...state.groups, ...groups] }));
296
+ setState((state) => ({
297
+ ...state,
298
+ ...replaceStateInArray([...state.groups, ...groups], state.validators)
299
+ }));
292
300
  }, []);
293
301
  const remove = react.useCallback(({ uuid }) => {
294
302
  setState((state) => ({
295
303
  ...state,
296
- groups: state.groups.filter((group) => group.uuid !== uuid)
304
+ ...replaceStateInArray(state.groups.filter((group) => group.uuid !== uuid), state.validators)
297
305
  }));
298
306
  }, []);
299
307
  const reset = react.useCallback(() => {
300
- setState((state) => ({ ...state, groups: _value.current }));
308
+ setState((state) => ({
309
+ ...state,
310
+ ...replaceStateInArray(initialValue.current, state.validators)
311
+ }));
301
312
  }, []);
302
313
  const setValidators = react.useCallback((validators) => {
303
- setState((state) => ({ ...state, validators }));
314
+ setState((state) => ({
315
+ ...state,
316
+ ...validStateInArray(state.groups, validators),
317
+ validators
318
+ }));
304
319
  }, []);
305
- const hasError = react.useCallback((key) => helpers.hasError(errors, key), [errors]);
306
- const someErrors = react.useCallback((keys) => helpers.someErrors(errors, keys), [errors]);
320
+ const hasError = react.useCallback((key) => helpers.hasError(state.errors, key), [state.errors]);
321
+ const someErrors = react.useCallback((keys) => helpers.someErrors(state.errors, keys), [state.errors]);
307
322
  return {
308
323
  ...state,
309
- ...controlState,
310
324
  disable,
311
325
  enable,
312
326
  enabled: !state.disabled,
313
- error: errors[0],
314
- errors: errors,
327
+ error: state.errors[0],
315
328
  hasError,
316
- invalid: !controlState.valid,
329
+ invalid: !state.valid,
317
330
  merge,
318
- pristine: !controlState.dirty,
319
- pristineAll: !controlState.dirtyAll,
331
+ pristine: !state.dirty,
332
+ pristines: !state.dirties,
320
333
  push,
321
334
  remove,
322
335
  reset,
@@ -324,33 +337,28 @@ function useFormArray(options, validators) {
324
337
  setValidators,
325
338
  setValue,
326
339
  someErrors,
327
- untouched: !controlState.touched,
328
- untouchedAll: !controlState.touchedAll,
329
- wrong: controlState.touched && !controlState.valid
340
+ untouched: !state.touched,
341
+ untoucheds: !state.toucheds,
342
+ wrong: state.touched && !state.valid
330
343
  };
331
344
  }
332
345
 
346
+ function errorsInControl(value, validators) {
347
+ return validators ? helpers.controlIsValid({ value, validators }) : [];
348
+ }
333
349
  function useControl(options, validators) {
334
350
  const _options = _arguments.createFormControlOptions(options, validators);
351
+ const initialValue = react.useRef(_options.value);
335
352
  const [state, setState] = react.useState({
336
353
  dirty: false,
337
354
  disabled: false,
355
+ errors: errorsInControl(_options.value, _options.validators),
338
356
  focused: false,
339
357
  touched: !!_options.touched,
340
- validators: _options.validators,
341
- value: _options.value
358
+ value: _options.value,
359
+ validators: _options.validators
342
360
  });
343
- const [errors, setErrors] = react.useState([]);
344
- const initialValue = react.useRef(_options.value);
345
361
  const elementRef = react.useRef(null);
346
- react.useEffect(() => {
347
- setErrors(state.validators
348
- ? helpers.controlIsValid({
349
- value: state.value,
350
- validators: state.validators
351
- })
352
- : []);
353
- }, [state.value, state.validators]);
354
362
  const focus = react.useCallback(() => {
355
363
  setState((state) => ({ ...state, focused: true }));
356
364
  }, []);
@@ -368,25 +376,40 @@ function useControl(options, validators) {
368
376
  }, []);
369
377
  const setInitialValue = react.useCallback((value) => {
370
378
  initialValue.current = value;
371
- setState((state) => ({ ...state, dirty: true, value }));
379
+ setState((state) => ({
380
+ ...state,
381
+ dirty: true,
382
+ errors: errorsInControl(value, state.validators),
383
+ value
384
+ }));
372
385
  }, []);
373
386
  const setValue = react.useCallback((value) => {
374
- setState((state) => ({ ...state, dirty: true, value }));
387
+ setState((state) => ({
388
+ ...state,
389
+ dirty: true,
390
+ errors: errorsInControl(value, state.validators),
391
+ value
392
+ }));
375
393
  }, []);
376
394
  const setValidators = react.useCallback((validators) => {
377
- setState((state) => ({ ...state, validators }));
395
+ setState((state) => ({
396
+ ...state,
397
+ errors: errorsInControl(state.value, validators),
398
+ validators
399
+ }));
378
400
  }, []);
379
401
  const reset = react.useCallback(() => {
380
402
  setState((state) => ({
381
403
  ...state,
382
404
  dirty: false,
405
+ errors: errorsInControl(initialValue.current, state.validators),
383
406
  value: initialValue.current,
384
407
  touched: false
385
408
  }));
386
409
  }, []);
387
- const hasError = react.useCallback((key) => helpers.hasError(errors, key), [errors]);
388
- const someErrors = react.useCallback((keys) => helpers.someErrors(errors, keys), [errors]);
389
- const valid = errors.length === 0;
410
+ const hasError = react.useCallback((key) => helpers.hasError(state.errors, key), [state.errors]);
411
+ const someErrors = react.useCallback((keys) => helpers.someErrors(state.errors, keys), [state.errors]);
412
+ const valid = state.errors.length === 0;
390
413
  return {
391
414
  ...state,
392
415
  blur,
@@ -394,8 +417,7 @@ function useControl(options, validators) {
394
417
  elementRef,
395
418
  enable,
396
419
  enabled: !state.disabled,
397
- error: errors[0],
398
- errors,
420
+ error: state.errors[0],
399
421
  focus,
400
422
  hasError,
401
423
  invalid: !valid,
@@ -422,53 +444,92 @@ function useInputControl(options, validators) {
422
444
  return useControl(options, validators);
423
445
  }
424
446
 
425
- function useFormGroup(options, groupValidators) {
426
- const _options = _arguments.createFormGroupOptions(options, groupValidators);
427
- const [validators, setValidators] = react.useState(_options.validators);
447
+ function errorsInGroup(controls, validators) {
448
+ return validators ? helpers.groupIsValid({ controls, validators }) : [];
449
+ }
450
+ function validStateInGroup(controls, validators) {
451
+ const errors = errorsInGroup(controls, validators);
452
+ return {
453
+ errors,
454
+ valid: errors.length === 0 && helpers.controlsAllChecked(controls, 'valid')
455
+ };
456
+ }
457
+ function useFormGroup(options, validators) {
458
+ const _options = _arguments.createFormGroupOptions(options, validators);
428
459
  const { controls } = _options;
429
- const errors = validators ? helpers.groupIsValid({ controls, validators }) : [];
430
- const valid = errors.length === 0 && helpers.controlsAllChecked(controls, 'valid');
431
- const value = helpers.controlsToValue(controls);
432
- const dirty = helpers.controlsPartialChecked(controls, 'dirty');
433
- const dirtyAll = helpers.controlsAllChecked(controls, 'dirty');
434
- const touched = helpers.controlsPartialChecked(controls, 'touched');
435
- const touchedAll = helpers.controlsAllChecked(controls, 'touched');
436
- function reset() {
460
+ const [state, setState] = react.useState({
461
+ ...validStateInGroup(controls, _options.validators),
462
+ controls,
463
+ dirties: helpers.controlsAllChecked(controls, 'dirty'),
464
+ dirty: helpers.controlsPartialChecked(controls, 'dirty'),
465
+ touched: helpers.controlsPartialChecked(controls, 'touched'),
466
+ toucheds: helpers.controlsAllChecked(controls, 'touched'),
467
+ value: helpers.controlsToValue(controls),
468
+ validators: _options.validators
469
+ });
470
+ react.useEffect(() => {
471
+ setState((state) => ({
472
+ ...state,
473
+ controls,
474
+ dirty: helpers.controlsPartialChecked(controls, 'dirty'),
475
+ dirties: helpers.controlsAllChecked(controls, 'dirty')
476
+ }));
477
+ }, helpers.reduceControlsToArray(controls, 'dirty'));
478
+ react.useEffect(() => {
479
+ setState((state) => ({
480
+ ...state,
481
+ controls,
482
+ touched: helpers.controlsPartialChecked(controls, 'touched'),
483
+ toucheds: helpers.controlsAllChecked(controls, 'touched')
484
+ }));
485
+ }, helpers.reduceControlsToArray(controls, 'touched'));
486
+ react.useEffect(() => {
487
+ setState((state) => ({
488
+ ...state,
489
+ ...validStateInGroup(controls, state.validators),
490
+ controls,
491
+ value: helpers.controlsToValue(controls)
492
+ }));
493
+ }, helpers.reduceControlsToArray(controls, 'value'));
494
+ const setValidators = react.useCallback((validators) => {
495
+ setState((state) => ({
496
+ ...state,
497
+ ...validStateInGroup(state.controls, validators)
498
+ }));
499
+ }, []);
500
+ const reset = react.useCallback(() => {
437
501
  Object.values(controls).forEach((control) => {
438
502
  control.reset();
439
503
  });
440
- }
504
+ }, []);
441
505
  return {
442
- controls,
443
- dirty,
444
- dirtyAll,
445
- error: errors[0],
446
- errors,
447
- invalid: !valid,
448
- pristine: !dirty,
449
- pristineAll: !dirtyAll,
506
+ ...state,
507
+ error: state.errors[0],
508
+ invalid: !state.valid,
509
+ pristine: !state.dirty,
510
+ pristines: !state.dirties,
450
511
  reset,
451
512
  setValidators,
452
- touched,
453
- touchedAll,
454
- untouched: !touched,
455
- untouchedAll: !touchedAll,
456
- valid,
457
- value,
458
- wrong: touched && !valid
513
+ untouched: !state.touched,
514
+ untoucheds: !state.toucheds,
515
+ wrong: state.touched && !state.valid
459
516
  };
460
517
  }
461
518
 
462
- function formGroupToArray({ controls }) {
463
- return Object.values(controls).map(({ value }) => value);
519
+ function reduceControlsToValues(controls) {
520
+ return helpers.reduceControlsToArray(controls, 'value');
521
+ }
522
+ function reduceGroupToValues(group) {
523
+ return reduceControlsToValues(group.controls);
464
524
  }
465
525
 
466
526
  exports.formArrayControl = formArrayControl;
467
527
  exports.formArrayGroup = formArrayGroup;
468
528
  exports.formArrayList = formArrayList;
469
- exports.formGroupToArray = formGroupToArray;
470
529
  exports.inputArrayControl = inputArrayControl;
471
530
  exports.reactArrayControl = reactArrayControl;
531
+ exports.reduceControlsToValues = reduceControlsToValues;
532
+ exports.reduceGroupToValues = reduceGroupToValues;
472
533
  exports.useFormArray = useFormArray;
473
534
  exports.useFormControl = useFormControl;
474
535
  exports.useFormGroup = useFormGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/form-array/form-array-group.js","../esm/form-array/form-array-list.js","../esm/form-array/form-array.js","../esm/form-control.js","../esm/form-group.js","../esm/helpers.js"],"sourcesContent":["import { createFormControlOptions } from '@rolster/forms/arguments';\nimport { controlIsValid, hasError, someErrors } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nexport class RolsterReactArrayControl {\n constructor(options) {\n this.initialValue = options.initialValue;\n this.uuid = options.uuid;\n this.focused = !!options.focused;\n this.unfocused = !this.focused;\n this.touched = !!options.touched;\n this.untouched = !this.touched;\n this.dirty = !!options.dirty;\n this.pristine = !this.dirty;\n this.disabled = !!options.disabled;\n this.enabled = !this.disabled;\n const { value, validators } = options;\n this.value = value;\n this.validators = validators;\n this.errors = validators ? controlIsValid({ value, validators }) : [];\n this.error = this.errors[0];\n }\n focus() {\n this.unfocused && this.refresh({ focused: true });\n }\n blur() {\n this.focused && this.refresh({ focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh({ disabled: true });\n }\n enable() {\n this.disabled && this.refresh({ disabled: false });\n }\n touch() {\n this.untouched && this.refresh({ touched: true });\n }\n setInitialValue(value) {\n this.initialValue = value;\n this.setValue(value);\n }\n setValue(value) {\n this.refresh({ value });\n }\n setValidators(validators) {\n this.refresh({ validators });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n hasError(key) {\n return hasError(this.errors, key);\n }\n someErrors(keys) {\n return someErrors(this.errors, keys);\n }\n reset() {\n this.refresh({\n dirty: false,\n touched: false,\n value: this.initialValue\n });\n }\n refresh(changes) {\n this.subscriber &&\n this.subscriber({\n ...this,\n ...changes,\n initialValue: this.initialValue\n });\n }\n}\nexport class RolsterArrayControl extends RolsterReactArrayControl {\n constructor(options) {\n super(options);\n this.valid = this.errors.length === 0;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n }\n clone(options) {\n return new RolsterArrayControl(options);\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const controlOptions = createFormControlOptions(options, validators);\n return new RolsterArrayControl({\n ...controlOptions,\n initialValue: controlOptions.value,\n uuid: uuid()\n });\n}\nexport function reactArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\nexport function formArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\nexport function inputArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\n//# sourceMappingURL=form-array-control.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nexport class RolsterArrayGroup {\n constructor(options) {\n const { controls, resource, uuid, validators } = options;\n this.uuid = uuid;\n this.controls = controls;\n this.validators = validators;\n this.resource = resource;\n this.errors = validators ? groupIsValid({ controls, validators }) : [];\n this.error = this.errors[0];\n this.valid =\n this.errors.length === 0 && controlsAllChecked(controls, 'valid');\n this.invalid = !this.valid;\n this.dirty = controlsPartialChecked(controls, 'dirty');\n this.dirtyAll = controlsAllChecked(controls, 'dirty');\n this.touched = controlsPartialChecked(controls, 'touched');\n this.touchedAll = controlsAllChecked(controls, 'touched');\n this.untouched = !this.touched;\n this.untouchedAll = !this.touchedAll;\n this.pristine = !this.dirty;\n this.pristineAll = !this.dirtyAll;\n this.wrong = this.touched && this.invalid;\n this.value = controlsToValue(controls);\n const subscriber = (options) => {\n this.refresh({\n controls: Object.entries(this.controls).reduce((controls, [key, control]) => {\n controls[key] =\n control.uuid === options.uuid ? control.clone(options) : control;\n return controls;\n }, {})\n });\n };\n Object.values(controls).forEach((control) => {\n control.subscribe(subscriber);\n });\n }\n setValidators(validators) {\n this.refresh({ validators });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n refresh(changes) {\n this.subscriber && this.subscriber({ ...this, ...changes });\n }\n}\nexport function formArrayGroup(options, validators) {\n return new RolsterArrayGroup({\n ...createFormGroupOptions(options, validators),\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-group.js.map","import { controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { RolsterReactArrayControl } from './form-array-control';\nexport class RolsterArrayList extends RolsterReactArrayControl {\n constructor(options) {\n const value = options.controls.map((controls) => controlsToValue(controls));\n super({ ...options, value });\n this.valueToControls = options.valueToControls;\n this.controls = options.controls;\n this.valid =\n this.errors.length === 0 &&\n this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n options.controls.forEach((controls) => {\n this.subscribeControls(controls);\n });\n }\n setValue(value) {\n this.refresh({\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n clone(options) {\n return new RolsterArrayList(options);\n }\n push(controls) {\n this.refresh({\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh({\n controls: this.controls.filter((currentControls) => currentControls !== controls)\n });\n }\n refresh(changes) {\n super.refresh(changes);\n }\n subscribeControls(newControls) {\n Object.values(newControls).forEach((control) => {\n control.subscribe((options) => {\n const controls = this.controls.map((_controls) => _controls !== newControls\n ? _controls\n : Object.entries(newControls).reduce((controls, [key, control]) => {\n controls[key] =\n control.uuid === options.uuid\n ? control.clone(options)\n : control;\n return controls;\n }, {}));\n this.refresh({ controls });\n });\n });\n }\n}\nexport function formArrayList(valueToControls, options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n valueToControls,\n controls: value.map((value) => valueToControls(value)),\n initialValue: value,\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-list.js.map","import { createFormArrayOptions } from '@rolster/forms/arguments';\nimport { arrayIsValid, controlsToValue, groupAllChecked, groupPartialChecked, hasError as rolsterHasError, someErrors as rolsterSomeErrors } from '@rolster/forms/helpers';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { RolsterArrayGroup } from './form-array-group';\nexport function useFormArray(options, validators) {\n const _options = createFormArrayOptions(options, validators);\n const groups = _options.groups || [];\n const _value = useRef(groups);\n const [state, setState] = useState({\n controls: groups.map(({ controls }) => controls),\n disabled: false,\n groups,\n value: groups.map(({ controls }) => controlsToValue(controls)),\n validators: _options.validators\n });\n const [errors, setErrors] = useState([]);\n const [controlState, setControlState] = useState({\n valid: false,\n dirty: false,\n dirtyAll: false,\n touched: false,\n touchedAll: false\n });\n useEffect(() => {\n const subscriber = (options) => {\n setValue(state.groups.map((group) => group.uuid === options.uuid\n ? new RolsterArrayGroup(options)\n : group));\n };\n state.groups.forEach((group) => {\n group.subscribe(subscriber);\n });\n setState((_state) => ({\n ..._state,\n controls: state.groups.map(({ controls }) => controls),\n value: state.groups.map(({ controls }) => controlsToValue(controls))\n }));\n }, [state.groups]);\n useEffect(() => {\n setErrors(state.validators\n ? arrayIsValid({\n groups: state.groups,\n validators: state.validators\n })\n : []);\n }, [state.groups, state.validators]);\n useEffect(() => {\n setControlState({\n valid: errors.length === 0 && groupAllChecked(state.groups, 'valid'),\n dirty: groupPartialChecked(state.groups, 'dirty'),\n dirtyAll: groupAllChecked(state.groups, 'dirty'),\n touched: groupPartialChecked(state.groups, 'touched'),\n touchedAll: groupAllChecked(state.groups, 'touched')\n });\n }, [state.groups, errors]);\n const disable = useCallback(() => {\n setState((state) => ({ ...state, disabled: true }));\n }, []);\n const enable = useCallback(() => {\n setState((state) => ({ ...state, disabled: false }));\n }, []);\n const setValue = useCallback((groups) => {\n setState((state) => ({ ...state, groups }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({ ...state, groups }));\n _value.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({ ...state, groups: [...state.groups, group] }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({ ...state, groups: [...state.groups, ...groups] }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n groups: state.groups.filter((group) => group.uuid !== uuid)\n }));\n }, []);\n const reset = useCallback(() => {\n setState((state) => ({ ...state, groups: _value.current }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({ ...state, validators }));\n }, []);\n const hasError = useCallback((key) => rolsterHasError(errors, key), [errors]);\n const someErrors = useCallback((keys) => rolsterSomeErrors(errors, keys), [errors]);\n return {\n ...state,\n ...controlState,\n disable,\n enable,\n enabled: !state.disabled,\n error: errors[0],\n errors: errors,\n hasError,\n invalid: !controlState.valid,\n merge,\n pristine: !controlState.dirty,\n pristineAll: !controlState.dirtyAll,\n push,\n remove,\n reset,\n setInitialValue,\n setValidators,\n setValue,\n someErrors,\n untouched: !controlState.touched,\n untouchedAll: !controlState.touchedAll,\n wrong: controlState.touched && !controlState.valid\n };\n}\n//# sourceMappingURL=form-array.js.map","import { createFormControlOptions } from '@rolster/forms/arguments';\nimport { controlIsValid, hasError as rolsterHasError, someErrors as rolsterSomeErrors } from '@rolster/forms/helpers';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nfunction useControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n const [state, setState] = useState({\n dirty: false,\n disabled: false,\n focused: false,\n touched: !!_options.touched,\n validators: _options.validators,\n value: _options.value\n });\n const [errors, setErrors] = useState([]);\n const initialValue = useRef(_options.value);\n const elementRef = useRef(null);\n useEffect(() => {\n setErrors(state.validators\n ? controlIsValid({\n value: state.value,\n validators: state.validators\n })\n : []);\n }, [state.value, state.validators]);\n const focus = useCallback(() => {\n setState((state) => ({ ...state, focused: true }));\n }, []);\n const blur = useCallback(() => {\n setState((state) => ({ ...state, focused: false, touched: true }));\n }, []);\n const disable = useCallback(() => {\n setState((state) => ({ ...state, disabled: true }));\n }, []);\n const enable = useCallback(() => {\n setState((state) => ({ ...state, disabled: false }));\n }, []);\n const touch = useCallback(() => {\n setState((state) => ({ ...state, touched: true }));\n }, []);\n const setInitialValue = useCallback((value) => {\n initialValue.current = value;\n setState((state) => ({ ...state, dirty: true, value }));\n }, []);\n const setValue = useCallback((value) => {\n setState((state) => ({ ...state, dirty: true, value }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({ ...state, validators }));\n }, []);\n const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n dirty: false,\n value: initialValue.current,\n touched: false\n }));\n }, []);\n const hasError = useCallback((key) => rolsterHasError(errors, key), [errors]);\n const someErrors = useCallback((keys) => rolsterSomeErrors(errors, keys), [errors]);\n const valid = errors.length === 0;\n return {\n ...state,\n blur,\n disable,\n elementRef,\n enable,\n enabled: !state.disabled,\n error: errors[0],\n errors,\n focus,\n hasError,\n invalid: !valid,\n pristine: !state.dirty,\n reset,\n setInitialValue,\n setValidators,\n setValue,\n someErrors,\n touch,\n unfocused: !state.focused,\n untouched: !state.touched,\n valid,\n wrong: state.touched && !valid\n };\n}\nexport function useReactControl(options, validators) {\n return useControl(options, validators);\n}\nexport function useFormControl(options, validators) {\n return useControl(options, validators);\n}\nexport function useInputControl(options, validators) {\n return useControl(options, validators);\n}\n//# sourceMappingURL=form-control.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { useState } from 'react';\nexport function useFormGroup(options, groupValidators) {\n const _options = createFormGroupOptions(options, groupValidators);\n const [validators, setValidators] = useState(_options.validators);\n const { controls } = _options;\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n const valid = errors.length === 0 && controlsAllChecked(controls, 'valid');\n const value = controlsToValue(controls);\n const dirty = controlsPartialChecked(controls, 'dirty');\n const dirtyAll = controlsAllChecked(controls, 'dirty');\n const touched = controlsPartialChecked(controls, 'touched');\n const touchedAll = controlsAllChecked(controls, 'touched');\n function reset() {\n Object.values(controls).forEach((control) => {\n control.reset();\n });\n }\n return {\n controls,\n dirty,\n dirtyAll,\n error: errors[0],\n errors,\n invalid: !valid,\n pristine: !dirty,\n pristineAll: !dirtyAll,\n reset,\n setValidators,\n touched,\n touchedAll,\n untouched: !touched,\n untouchedAll: !touchedAll,\n valid,\n value,\n wrong: touched && !valid\n };\n}\n//# sourceMappingURL=form-group.js.map","export function formGroupToArray({ controls }) {\n return Object.values(controls).map(({ value }) => value);\n}\n//# sourceMappingURL=helpers.js.map"],"names":["controlIsValid","hasError","someErrors","createFormControlOptions","uuid","groupIsValid","controlsAllChecked","controlsPartialChecked","controlsToValue","createFormGroupOptions","createFormArrayOptions","useRef","useState","useEffect","arrayIsValid","groupAllChecked","groupPartialChecked","useCallback","rolsterHasError","rolsterSomeErrors"],"mappings":";;;;;;;;;AAGO,MAAM,wBAAwB,CAAC;AACtC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AACjD,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACjC,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AACzC,QAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;AACvC,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AACzC,QAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;AACvC,QAAQ,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACrC,QAAQ,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;AACpC,QAAQ,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC3C,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;AACtC,QAAQ,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;AAC9C,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AACrC,QAAQ,IAAI,CAAC,MAAM,GAAG,UAAU,GAAGA,sBAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EA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GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC;AAC7D;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/form-array/form-array-group.js","../esm/form-array/form-array-list.js","../esm/form-array/form-array.js","../esm/form-control.js","../esm/form-group.js","../esm/helpers.js"],"sourcesContent":["import { createFormControlOptions } from '@rolster/forms/arguments';\nimport { controlIsValid, hasError, someErrors } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nexport class RolsterReactArrayControl {\n constructor(options) {\n this.initialValue = options.initialValue;\n this.uuid = options.uuid;\n this.focused = !!options.focused;\n this.unfocused = !this.focused;\n this.touched = !!options.touched;\n this.untouched = !this.touched;\n this.dirty = !!options.dirty;\n this.pristine = !this.dirty;\n this.disabled = !!options.disabled;\n this.enabled = !this.disabled;\n const { value, validators } = options;\n this.value = value;\n this.validators = validators;\n this.errors = validators ? controlIsValid({ value, validators }) : [];\n this.error = this.errors[0];\n }\n focus() {\n this.unfocused && this.refresh({ focused: true });\n }\n blur() {\n this.focused && this.refresh({ focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh({ disabled: true });\n }\n enable() {\n this.disabled && this.refresh({ disabled: false });\n }\n touch() {\n this.untouched && this.refresh({ touched: true });\n }\n setInitialValue(value) {\n this.initialValue = value;\n this.setValue(value);\n }\n setValue(value) {\n this.refresh({ value });\n }\n setValidators(validators) {\n this.refresh({ validators });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n hasError(key) {\n return hasError(this.errors, key);\n }\n someErrors(keys) {\n return someErrors(this.errors, keys);\n }\n reset() {\n this.refresh({\n dirty: false,\n touched: false,\n value: this.initialValue\n });\n }\n refresh(changes) {\n this.subscriber &&\n this.subscriber({\n ...this,\n ...changes,\n initialValue: this.initialValue\n });\n }\n}\nexport class RolsterArrayControl extends RolsterReactArrayControl {\n constructor(options) {\n super(options);\n this.valid = this.errors.length === 0;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n }\n clone(options) {\n return new RolsterArrayControl(options);\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const controlOptions = createFormControlOptions(options, validators);\n return new RolsterArrayControl({\n ...controlOptions,\n initialValue: controlOptions.value,\n uuid: uuid()\n });\n}\nexport function reactArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\nexport function formArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\nexport function inputArrayControl(options, validators) {\n return rolsterArrayControl(options, validators);\n}\n//# sourceMappingURL=form-array-control.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nexport class RolsterArrayGroup {\n constructor(options) {\n const { controls, resource, uuid, validators } = options;\n this.uuid = uuid;\n this.controls = controls;\n this.validators = validators;\n this.resource = resource;\n this.errors = validators ? groupIsValid({ controls, validators }) : [];\n this.error = this.errors[0];\n this.valid =\n this.errors.length === 0 && controlsAllChecked(controls, 'valid');\n this.invalid = !this.valid;\n this.dirty = controlsPartialChecked(controls, 'dirty');\n this.dirties = controlsAllChecked(controls, 'dirty');\n this.touched = controlsPartialChecked(controls, 'touched');\n this.toucheds = controlsAllChecked(controls, 'touched');\n this.pristine = !this.dirty;\n this.pristines = !this.dirties;\n this.untouched = !this.touched;\n this.untoucheds = !this.toucheds;\n this.wrong = this.touched && this.invalid;\n this.value = controlsToValue(controls);\n const subscriber = (options) => {\n this.refresh({\n controls: Object.entries(this.controls).reduce((controls, [key, control]) => {\n controls[key] =\n control.uuid === options.uuid ? control.clone(options) : control;\n return controls;\n }, {})\n });\n };\n Object.values(controls).forEach((control) => {\n control.subscribe(subscriber);\n });\n }\n setValidators(validators) {\n this.refresh({ validators });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n refresh(changes) {\n this.subscriber && this.subscriber({ ...this, ...changes });\n }\n}\nexport function formArrayGroup(options, validators) {\n return new RolsterArrayGroup({\n ...createFormGroupOptions(options, validators),\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-group.js.map","import { controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { RolsterReactArrayControl } from './form-array-control';\nexport class RolsterArrayList extends RolsterReactArrayControl {\n constructor(options) {\n const value = options.controls.map((controls) => controlsToValue(controls));\n super({ ...options, value });\n this.valueToControls = options.valueToControls;\n this.controls = options.controls;\n this.valid =\n this.errors.length === 0 &&\n this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n options.controls.forEach((controls) => {\n this.subscribeControls(controls);\n });\n }\n setValue(value) {\n this.refresh({\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n clone(options) {\n return new RolsterArrayList(options);\n }\n push(controls) {\n this.refresh({\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh({\n controls: this.controls.filter((currentControls) => currentControls !== controls)\n });\n }\n refresh(changes) {\n super.refresh(changes);\n }\n subscribeControls(newControls) {\n Object.values(newControls).forEach((control) => {\n control.subscribe((options) => {\n const controls = this.controls.map((_controls) => _controls !== newControls\n ? _controls\n : Object.entries(newControls).reduce((controls, [key, control]) => {\n controls[key] =\n control.uuid === options.uuid\n ? control.clone(options)\n : control;\n return controls;\n }, {}));\n this.refresh({ controls });\n });\n });\n }\n}\nexport function formArrayList(valueToControls, options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n valueToControls,\n controls: value.map((value) => valueToControls(value)),\n initialValue: value,\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-list.js.map","import { createFormArrayOptions } from '@rolster/forms/arguments';\nimport { arrayIsValid, controlsToValue, groupAllChecked, hasError as rolsterHasError, someErrors as rolsterSomeErrors } from '@rolster/forms/helpers';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { RolsterArrayGroup } from './form-array-group';\nfunction errorsInArray(groups, validators) {\n return validators ? arrayIsValid({ groups, validators }) : [];\n}\nfunction validStateInArray(groups, validators) {\n const errors = errorsInArray(groups, validators);\n return {\n errors,\n valid: errors.length === 0 && groupAllChecked(groups, 'valid')\n };\n}\nfunction replaceStateInArray(groups, validators) {\n return {\n ...validStateInArray(groups, validators),\n groups,\n controls: groups.map(({ controls }) => controls),\n value: groups.map(({ controls }) => controlsToValue(controls))\n };\n}\nexport function useFormArray(options, validators) {\n const _options = createFormArrayOptions(options, validators);\n const groups = _options.groups || [];\n const initialValue = useRef(groups);\n const [state, setState] = useState({\n ...validStateInArray(groups, _options.validators),\n controls: groups.map(({ controls }) => controls),\n dirty: false,\n dirties: false,\n disabled: false,\n groups,\n touched: false,\n toucheds: false,\n value: groups.map(({ controls }) => controlsToValue(controls)),\n validators: _options.validators\n });\n useEffect(() => {\n const subscriber = (options) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray(state.groups.map((group) => group.uuid === options.uuid\n ? new RolsterArrayGroup(options)\n : group), state.validators)\n }));\n };\n state.groups.forEach((group) => {\n group.subscribe(subscriber);\n });\n }, [state.groups]);\n const disable = useCallback(() => {\n setState((state) => ({ ...state, disabled: true }));\n }, []);\n const enable = useCallback(() => {\n setState((state) => ({ ...state, disabled: false }));\n }, []);\n const setValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray(groups, state.validators)\n }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray(groups, state.validators)\n }));\n initialValue.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray([...state.groups, group], state.validators)\n }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray([...state.groups, ...groups], state.validators)\n }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray(state.groups.filter((group) => group.uuid !== uuid), state.validators)\n }));\n }, []);\n const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n ...replaceStateInArray(initialValue.current, state.validators)\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...validStateInArray(state.groups, validators),\n validators\n }));\n }, []);\n const hasError = useCallback((key) => rolsterHasError(state.errors, key), [state.errors]);\n const someErrors = useCallback((keys) => rolsterSomeErrors(state.errors, keys), [state.errors]);\n return {\n ...state,\n disable,\n enable,\n enabled: !state.disabled,\n error: state.errors[0],\n hasError,\n invalid: !state.valid,\n merge,\n pristine: !state.dirty,\n pristines: !state.dirties,\n push,\n remove,\n reset,\n setInitialValue,\n setValidators,\n setValue,\n someErrors,\n untouched: !state.touched,\n untoucheds: !state.toucheds,\n wrong: state.touched && !state.valid\n };\n}\n//# sourceMappingURL=form-array.js.map","import { createFormControlOptions } from '@rolster/forms/arguments';\nimport { controlIsValid, hasError as rolsterHasError, someErrors as rolsterSomeErrors } from '@rolster/forms/helpers';\nimport { useCallback, useRef, useState } from 'react';\nfunction errorsInControl(value, validators) {\n return validators ? controlIsValid({ value, validators }) : [];\n}\nfunction useControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n const initialValue = useRef(_options.value);\n const [state, setState] = useState({\n dirty: false,\n disabled: false,\n errors: errorsInControl(_options.value, _options.validators),\n focused: false,\n touched: !!_options.touched,\n value: _options.value,\n validators: _options.validators\n });\n const elementRef = useRef(null);\n const focus = useCallback(() => {\n setState((state) => ({ ...state, focused: true }));\n }, []);\n const blur = useCallback(() => {\n setState((state) => ({ ...state, focused: false, touched: true }));\n }, []);\n const disable = useCallback(() => {\n setState((state) => ({ ...state, disabled: true }));\n }, []);\n const enable = useCallback(() => {\n setState((state) => ({ ...state, disabled: false }));\n }, []);\n const touch = useCallback(() => {\n setState((state) => ({ ...state, touched: true }));\n }, []);\n const setInitialValue = useCallback((value) => {\n initialValue.current = value;\n setState((state) => ({\n ...state,\n dirty: true,\n errors: errorsInControl(value, state.validators),\n value\n }));\n }, []);\n const setValue = useCallback((value) => {\n setState((state) => ({\n ...state,\n dirty: true,\n errors: errorsInControl(value, state.validators),\n value\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n errors: errorsInControl(state.value, validators),\n validators\n }));\n }, []);\n const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n dirty: false,\n errors: errorsInControl(initialValue.current, state.validators),\n value: initialValue.current,\n touched: false\n }));\n }, []);\n const hasError = useCallback((key) => rolsterHasError(state.errors, key), [state.errors]);\n const someErrors = useCallback((keys) => rolsterSomeErrors(state.errors, keys), [state.errors]);\n const valid = state.errors.length === 0;\n return {\n ...state,\n blur,\n disable,\n elementRef,\n enable,\n enabled: !state.disabled,\n error: state.errors[0],\n focus,\n hasError,\n invalid: !valid,\n pristine: !state.dirty,\n reset,\n setInitialValue,\n setValidators,\n setValue,\n someErrors,\n touch,\n unfocused: !state.focused,\n untouched: !state.touched,\n valid,\n wrong: state.touched && !valid\n };\n}\nexport function useReactControl(options, validators) {\n return useControl(options, validators);\n}\nexport function useFormControl(options, validators) {\n return useControl(options, validators);\n}\nexport function useInputControl(options, validators) {\n return useControl(options, validators);\n}\n//# sourceMappingURL=form-control.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid, reduceControlsToArray } from '@rolster/forms/helpers';\nimport { useCallback, useEffect, useState } from 'react';\nfunction errorsInGroup(controls, validators) {\n return validators ? groupIsValid({ controls, validators }) : [];\n}\nfunction validStateInGroup(controls, validators) {\n const errors = errorsInGroup(controls, validators);\n return {\n errors,\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n };\n}\nexport function useFormGroup(options, validators) {\n const _options = createFormGroupOptions(options, validators);\n const { controls } = _options;\n const [state, setState] = useState({\n ...validStateInGroup(controls, _options.validators),\n controls,\n dirties: controlsAllChecked(controls, 'dirty'),\n dirty: controlsPartialChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n value: controlsToValue(controls),\n validators: _options.validators\n });\n useEffect(() => {\n setState((state) => ({\n ...state,\n controls,\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty')\n }));\n }, reduceControlsToArray(controls, 'dirty'));\n useEffect(() => {\n setState((state) => ({\n ...state,\n controls,\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n }));\n }, reduceControlsToArray(controls, 'touched'));\n useEffect(() => {\n setState((state) => ({\n ...state,\n ...validStateInGroup(controls, state.validators),\n controls,\n value: controlsToValue(controls)\n }));\n }, reduceControlsToArray(controls, 'value'));\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...validStateInGroup(state.controls, validators)\n }));\n }, []);\n const reset = useCallback(() => {\n Object.values(controls).forEach((control) => {\n control.reset();\n });\n }, []);\n return {\n ...state,\n error: state.errors[0],\n invalid: !state.valid,\n pristine: !state.dirty,\n pristines: !state.dirties,\n reset,\n setValidators,\n untouched: !state.touched,\n untoucheds: !state.toucheds,\n wrong: state.touched && !state.valid\n };\n}\n//# sourceMappingURL=form-group.js.map","import { reduceControlsToArray } from '@rolster/forms/helpers';\nexport function reduceControlsToValues(controls) {\n return reduceControlsToArray(controls, 'value');\n}\nexport function reduceGroupToValues(group) {\n return reduceControlsToValues(group.controls);\n}\n//# sourceMappingURL=helpers.js.map"],"names":["controlIsValid","hasError","someErrors","createFormControlOptions","uuid","groupIsValid","controlsAllChecked","controlsPartialChecked","controlsToValue","createFormGroupOptions","arrayIsValid","groupAllChecked","createFormArrayOptions","useRef","useState","useEffect","useCallback","rolsterHasError","rolsterSomeErrors","reduceControlsToArray"],"mappings":";;;;;;;;;AAGO,MAAM,wBAAwB,CAAC;AACtC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC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