@rolster/react-forms 18.12.2 → 18.12.3
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 +22 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +22 -20
- package/dist/es/index.js.map +1 -1
- package/dist/esm/form-array/form-array-group.d.ts +39 -2
- package/dist/esm/form-array/form-array-group.js +10 -10
- package/dist/esm/form-array/form-array-group.js.map +1 -1
- package/dist/esm/form-array/form-array.js +12 -10
- package/dist/esm/form-array/form-array.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -147,7 +147,7 @@ function refactorForValid$2(controls, validators) {
|
|
|
147
147
|
valid: errors.length === 0 && helpers.controlsAllChecked(controls, 'valid')
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function refactorForControls$1(group, controls
|
|
150
|
+
function refactorForControls$1(action, group, controls) {
|
|
151
151
|
switch (action) {
|
|
152
152
|
case 'focused':
|
|
153
153
|
case 'touched':
|
|
@@ -178,7 +178,7 @@ function refactorForControls$1(group, controls, action) {
|
|
|
178
178
|
return {};
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
class
|
|
181
|
+
class RolsterArrayGroup {
|
|
182
182
|
constructor(options) {
|
|
183
183
|
this.uuid = options.uuid;
|
|
184
184
|
this.controls = options.controls;
|
|
@@ -198,19 +198,19 @@ class BaseArrayGroup {
|
|
|
198
198
|
this.errors = options.errors;
|
|
199
199
|
this.error = this.errors[0];
|
|
200
200
|
this.validators = options.validators;
|
|
201
|
-
|
|
201
|
+
this.subscriberControl = (action, control) => {
|
|
202
202
|
const controls = replaceControl(this.controls, control);
|
|
203
203
|
this.refresh(action, {
|
|
204
|
-
...refactorForControls$1(this, controls
|
|
204
|
+
...refactorForControls$1(action, this, controls),
|
|
205
205
|
controls
|
|
206
206
|
});
|
|
207
207
|
};
|
|
208
|
-
Object.values(this.controls).forEach((control) => {
|
|
209
|
-
control.subscribe(subscriber);
|
|
210
|
-
});
|
|
211
208
|
}
|
|
212
209
|
subscribe(subscriber) {
|
|
213
210
|
this.subscriber = subscriber;
|
|
211
|
+
Object.values(this.controls).forEach((control) => {
|
|
212
|
+
control.subscribe(this.subscriberControl);
|
|
213
|
+
});
|
|
214
214
|
}
|
|
215
215
|
setValidators(validators) {
|
|
216
216
|
this.refresh('validators', {
|
|
@@ -220,10 +220,10 @@ class BaseArrayGroup {
|
|
|
220
220
|
}
|
|
221
221
|
refresh(action, options) {
|
|
222
222
|
this.subscriber &&
|
|
223
|
-
this.subscriber(action, new
|
|
223
|
+
this.subscriber(action, new RolsterArrayGroup({ ...this, ...options }));
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
class
|
|
226
|
+
class ReactRolsterArrayGroup extends RolsterArrayGroup {
|
|
227
227
|
constructor(options) {
|
|
228
228
|
const { controls, validators } = options;
|
|
229
229
|
const errors = validators ? helpers.groupIsValid({ controls, validators }) : [];
|
|
@@ -240,7 +240,7 @@ class RolsterArrayGroup extends BaseArrayGroup {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
function formArrayGroup(options, validators) {
|
|
243
|
-
return new
|
|
243
|
+
return new ReactRolsterArrayGroup({
|
|
244
244
|
..._arguments.createFormGroupOptions(options, validators),
|
|
245
245
|
uuid: uuid.v4()
|
|
246
246
|
});
|
|
@@ -335,7 +335,7 @@ function refactorForGroups(groups, validators) {
|
|
|
335
335
|
value: groups.map(({ controls }) => helpers.controlsToValue(controls))
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function refactorForControls(state, groups
|
|
338
|
+
function refactorForControls(action, state, groups) {
|
|
339
339
|
switch (action) {
|
|
340
340
|
case 'validators':
|
|
341
341
|
return refactorForValid$1(groups, state.validators);
|
|
@@ -364,19 +364,21 @@ function useFormArray(options, validators) {
|
|
|
364
364
|
validators: _options.validators
|
|
365
365
|
});
|
|
366
366
|
react.useEffect(() => {
|
|
367
|
-
const subscriber = (action, group) => {
|
|
368
|
-
setState((state) => {
|
|
369
|
-
const groups = state.groups.map((_group) => _group.uuid === group.uuid ? group : _group);
|
|
370
|
-
return {
|
|
371
|
-
...state,
|
|
372
|
-
...refactorForControls(state, groups, action)
|
|
373
|
-
};
|
|
374
|
-
});
|
|
375
|
-
};
|
|
376
367
|
state.groups.forEach((group) => {
|
|
377
368
|
group.subscribe(subscriber);
|
|
378
369
|
});
|
|
379
370
|
}, [state.groups]);
|
|
371
|
+
const subscriber = react.useCallback((action, group) => {
|
|
372
|
+
setState((state) => {
|
|
373
|
+
const groups = state.groups.map((_group) => {
|
|
374
|
+
return _group.uuid === group.uuid ? group : _group;
|
|
375
|
+
});
|
|
376
|
+
return {
|
|
377
|
+
...state,
|
|
378
|
+
...refactorForControls(action, state, groups)
|
|
379
|
+
};
|
|
380
|
+
});
|
|
381
|
+
}, []);
|
|
380
382
|
const disable = react.useCallback(() => {
|
|
381
383
|
setState((state) => ({ ...state, disabled: true }));
|
|
382
384
|
}, []);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/utilities.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 RolsterArrayControl {\n constructor(options) {\n this.uuid = options.uuid;\n this.value = options.value;\n this.initialValue = options.initialValue;\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 this.valid = this.isValid(options.errors);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n }\n focus() {\n this.unfocused && this.refresh('focused', { focused: true });\n }\n blur() {\n this.focused && this.refresh('focused', { focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh('disabled', { disabled: true });\n }\n enable() {\n this.disabled && this.refresh('disabled', { disabled: false });\n }\n touch() {\n this.untouched && this.refresh('touched', { touched: true });\n }\n setInitialValue(value) {\n if (value !== this.initialValue) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: false,\n errors,\n initialValue: value,\n value\n });\n }\n }\n setValue(value) {\n if (value !== this.value) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: true,\n errors,\n value\n });\n }\n }\n setValidators(validators) {\n const errors = validators\n ? controlIsValid({ value: this.value, validators })\n : [];\n this.refresh('validators', { errors, 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 const errors = this.validators\n ? controlIsValid({\n value: this.initialValue,\n validators: this.validators\n })\n : [];\n this.refresh('reset', {\n dirty: false,\n errors,\n touched: false,\n value: this.initialValue\n });\n }\n isValid(errors) {\n return errors.length === 0;\n }\n builder(options) {\n return new RolsterArrayControl({ ...this, ...options });\n }\n refresh(action, options) {\n this.subscriber && this.subscriber(action, this.builder(options));\n }\n}\nclass ReactRolsterArrayControl extends RolsterArrayControl {\n constructor(options) {\n const { value, validators } = options;\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors });\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n return new ReactRolsterArrayControl({\n ..._options,\n initialValue: _options.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","export function replaceControl(controls, control) {\n return Object.entries(controls).reduce((controls, [key, _control]) => {\n if (_control.uuid === control.uuid) {\n controls[key] = control;\n }\n return controls;\n }, controls);\n}\n//# sourceMappingURL=utilities.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n };\n}\nfunction refactorForControls(group, controls, action) {\n switch (action) {\n case 'focused':\n case 'touched':\n return {\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n };\n case 'validators':\n return refactorForValid(controls, group.validators);\n case 'reset':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n value: controlsToValue(controls)\n };\n case 'list':\n case 'value':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n value: controlsToValue(controls)\n };\n default:\n return {};\n }\n}\nclass BaseArrayGroup {\n constructor(options) {\n this.uuid = options.uuid;\n this.controls = options.controls;\n this.value = options.value;\n this.resource = options.resource;\n this.dirty = !!options.dirty;\n this.dirties = !!options.dirties;\n this.pristine = !this.dirty;\n this.pristines = !this.dirties;\n this.touched = !!options.touched;\n this.toucheds = !!options.toucheds;\n this.untouched = !this.touched;\n this.untoucheds = !this.toucheds;\n this.valid = !!options.valid;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n const subscriber = (action, control) => {\n const controls = replaceControl(this.controls, control);\n this.refresh(action, {\n ...refactorForControls(this, controls, action),\n controls\n });\n };\n Object.values(this.controls).forEach((control) => {\n control.subscribe(subscriber);\n });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n setValidators(validators) {\n this.refresh('validators', {\n ...refactorForValid(this.controls, validators),\n validators\n });\n }\n refresh(action, options) {\n this.subscriber &&\n this.subscriber(action, new BaseArrayGroup({ ...this, ...options }));\n }\n}\nclass RolsterArrayGroup extends BaseArrayGroup {\n constructor(options) {\n const { controls, validators } = options;\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n super({\n ...options,\n errors,\n value: controlsToValue(controls),\n dirties: controlsAllChecked(controls, 'dirty'),\n dirty: controlsPartialChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n });\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 { controlIsValid, controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nimport { RolsterArrayControl } from './form-array-control';\nclass RolsterArrayList extends RolsterArrayControl {\n constructor(options) {\n const { controls, valueToControls, validators } = options;\n const value = controls.map((controls) => controlsToValue(controls));\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors, value });\n this.valueToControls = valueToControls;\n this.controls = controls;\n this.valid =\n errors.length === 0 &&\n controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n controls.forEach((reactControls) => {\n this._subscribe(reactControls);\n });\n }\n setInitialValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value)),\n initialValue: value\n });\n }\n setValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n reset() {\n this.refresh('list', {\n controls: this.initialValue.map((value) => this.valueToControls(value))\n });\n }\n push(controls) {\n this.refresh('list', {\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh('list', {\n controls: this.controls.filter((_controls) => _controls !== controls)\n });\n }\n builder(options) {\n return new RolsterArrayList({\n ...this,\n ...options,\n valueToControls: this.valueToControls\n });\n }\n refresh(action, options) {\n super.refresh(action, options);\n }\n _subscribe(reactControls) {\n Object.values(reactControls).forEach((control) => {\n control.subscribe((action, _control) => {\n const _reactControls = this.controls.map((_controls) => reactControls !== _controls\n ? _controls\n : replaceControl(reactControls, _control));\n this.refresh(action, { controls: _reactControls });\n });\n });\n }\n}\nexport function formArrayList(options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n controls: value.map((value) => options.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';\nfunction refactorForValid(groups, validators) {\n const errors = validators ? arrayIsValid({ groups, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && groupAllChecked(groups, 'valid')\n };\n}\nfunction refactorForGroups(groups, validators) {\n return {\n ...refactorForValid(groups, validators),\n groups,\n controls: groups.map(({ controls }) => controls),\n value: groups.map(({ controls }) => controlsToValue(controls))\n };\n}\nfunction refactorForControls(state, groups, action) {\n switch (action) {\n case 'validators':\n return refactorForValid(groups, state.validators);\n case 'reset':\n case 'list':\n case 'value':\n return refactorForGroups(groups, state.validators);\n default:\n return { groups };\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 ...refactorForValid(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 = (action, group) => {\n setState((state) => {\n const groups = state.groups.map((_group) => _group.uuid === group.uuid ? group : _group);\n return {\n ...state,\n ...refactorForControls(state, groups, action)\n };\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 ...refactorForGroups(groups, state.validators)\n }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n initialValue.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, group], state.validators)\n }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, ...groups], state.validators)\n }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(state.groups.filter((group) => group.uuid !== uuid), state.validators)\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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 const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(initialValue.current, state.validators)\n }));\n }, []);\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, useRef, useState } from 'react';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ 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 firstEffects = useRef({\n dirty: true,\n disabledFocused: true,\n touched: true,\n value: true\n });\n const [state, setState] = useState({\n ...refactorForValid(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 if (!firstEffects.current.value) {\n setState((state) => ({\n ...state,\n ...refactorForValid(controls, state.validators),\n controls,\n value: controlsToValue(controls)\n }));\n }\n else {\n firstEffects.current.value = false;\n }\n }, reduceControlsToArray(controls, 'value'));\n useEffect(() => {\n if (!firstEffects.current.disabledFocused) {\n setState((state) => ({\n ...state,\n controls\n }));\n }\n else {\n firstEffects.current.disabledFocused = false;\n }\n }, [\n ...reduceControlsToArray(controls, 'disabled'),\n ...reduceControlsToArray(controls, 'focused')\n ]);\n useEffect(() => {\n if (!firstEffects.current.dirty) {\n setState((state) => ({\n ...state,\n controls,\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty')\n }));\n }\n else {\n firstEffects.current.dirty = false;\n }\n }, reduceControlsToArray(controls, 'dirty'));\n useEffect(() => {\n if (!firstEffects.current.touched) {\n setState((state) => ({\n ...state,\n controls,\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n }));\n }\n else {\n firstEffects.current.touched = false;\n }\n }, reduceControlsToArray(controls, 'touched'));\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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","refactorForValid","groupIsValid","controlsAllChecked","refactorForControls","controlsPartialChecked","controlsToValue","createFormGroupOptions","arrayIsValid","groupAllChecked","createFormArrayOptions","useRef","useState","useEffect","useCallback","rolsterHasError","rolsterSomeErrors","reduceControlsToArray"],"mappings":";;;;;;;;;AAGO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC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IAAI,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/utilities.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 RolsterArrayControl {\n constructor(options) {\n this.uuid = options.uuid;\n this.value = options.value;\n this.initialValue = options.initialValue;\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 this.valid = this.isValid(options.errors);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n }\n focus() {\n this.unfocused && this.refresh('focused', { focused: true });\n }\n blur() {\n this.focused && this.refresh('focused', { focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh('disabled', { disabled: true });\n }\n enable() {\n this.disabled && this.refresh('disabled', { disabled: false });\n }\n touch() {\n this.untouched && this.refresh('touched', { touched: true });\n }\n setInitialValue(value) {\n if (value !== this.initialValue) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: false,\n errors,\n initialValue: value,\n value\n });\n }\n }\n setValue(value) {\n if (value !== this.value) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: true,\n errors,\n value\n });\n }\n }\n setValidators(validators) {\n const errors = validators\n ? controlIsValid({ value: this.value, validators })\n : [];\n this.refresh('validators', { errors, 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 const errors = this.validators\n ? controlIsValid({\n value: this.initialValue,\n validators: this.validators\n })\n : [];\n this.refresh('reset', {\n dirty: false,\n errors,\n touched: false,\n value: this.initialValue\n });\n }\n isValid(errors) {\n return errors.length === 0;\n }\n builder(options) {\n return new RolsterArrayControl({ ...this, ...options });\n }\n refresh(action, options) {\n this.subscriber && this.subscriber(action, this.builder(options));\n }\n}\nclass ReactRolsterArrayControl extends RolsterArrayControl {\n constructor(options) {\n const { value, validators } = options;\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors });\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n return new ReactRolsterArrayControl({\n ..._options,\n initialValue: _options.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","export function replaceControl(controls, control) {\n return Object.entries(controls).reduce((controls, [key, _control]) => {\n if (_control.uuid === control.uuid) {\n controls[key] = control;\n }\n return controls;\n }, controls);\n}\n//# sourceMappingURL=utilities.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n };\n}\nfunction refactorForControls(action, group, controls) {\n switch (action) {\n case 'focused':\n case 'touched':\n return {\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n };\n case 'validators':\n return refactorForValid(controls, group.validators);\n case 'reset':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n value: controlsToValue(controls)\n };\n case 'list':\n case 'value':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n value: controlsToValue(controls)\n };\n default:\n return {};\n }\n}\nexport class RolsterArrayGroup {\n constructor(options) {\n this.uuid = options.uuid;\n this.controls = options.controls;\n this.value = options.value;\n this.resource = options.resource;\n this.dirty = !!options.dirty;\n this.dirties = !!options.dirties;\n this.pristine = !this.dirty;\n this.pristines = !this.dirties;\n this.touched = !!options.touched;\n this.toucheds = !!options.toucheds;\n this.untouched = !this.touched;\n this.untoucheds = !this.toucheds;\n this.valid = !!options.valid;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n this.subscriberControl = (action, control) => {\n const controls = replaceControl(this.controls, control);\n this.refresh(action, {\n ...refactorForControls(action, this, controls),\n controls\n });\n };\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n Object.values(this.controls).forEach((control) => {\n control.subscribe(this.subscriberControl);\n });\n }\n setValidators(validators) {\n this.refresh('validators', {\n ...refactorForValid(this.controls, validators),\n validators\n });\n }\n refresh(action, options) {\n this.subscriber &&\n this.subscriber(action, new RolsterArrayGroup({ ...this, ...options }));\n }\n}\nclass ReactRolsterArrayGroup extends RolsterArrayGroup {\n constructor(options) {\n const { controls, validators } = options;\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n super({\n ...options,\n errors,\n value: controlsToValue(controls),\n dirties: controlsAllChecked(controls, 'dirty'),\n dirty: controlsPartialChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n });\n }\n}\nexport function formArrayGroup(options, validators) {\n return new ReactRolsterArrayGroup({\n ...createFormGroupOptions(options, validators),\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-group.js.map","import { controlIsValid, controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nimport { RolsterArrayControl } from './form-array-control';\nclass RolsterArrayList extends RolsterArrayControl {\n constructor(options) {\n const { controls, valueToControls, validators } = options;\n const value = controls.map((controls) => controlsToValue(controls));\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors, value });\n this.valueToControls = valueToControls;\n this.controls = controls;\n this.valid =\n errors.length === 0 &&\n controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n controls.forEach((reactControls) => {\n this._subscribe(reactControls);\n });\n }\n setInitialValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value)),\n initialValue: value\n });\n }\n setValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n reset() {\n this.refresh('list', {\n controls: this.initialValue.map((value) => this.valueToControls(value))\n });\n }\n push(controls) {\n this.refresh('list', {\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh('list', {\n controls: this.controls.filter((_controls) => _controls !== controls)\n });\n }\n builder(options) {\n return new RolsterArrayList({\n ...this,\n ...options,\n valueToControls: this.valueToControls\n });\n }\n refresh(action, options) {\n super.refresh(action, options);\n }\n _subscribe(reactControls) {\n Object.values(reactControls).forEach((control) => {\n control.subscribe((action, _control) => {\n const _reactControls = this.controls.map((_controls) => reactControls !== _controls\n ? _controls\n : replaceControl(reactControls, _control));\n this.refresh(action, { controls: _reactControls });\n });\n });\n }\n}\nexport function formArrayList(options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n controls: value.map((value) => options.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';\nfunction refactorForValid(groups, validators) {\n const errors = validators ? arrayIsValid({ groups, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && groupAllChecked(groups, 'valid')\n };\n}\nfunction refactorForGroups(groups, validators) {\n return {\n ...refactorForValid(groups, validators),\n groups,\n controls: groups.map(({ controls }) => controls),\n value: groups.map(({ controls }) => controlsToValue(controls))\n };\n}\nfunction refactorForControls(action, state, groups) {\n switch (action) {\n case 'validators':\n return refactorForValid(groups, state.validators);\n case 'reset':\n case 'list':\n case 'value':\n return refactorForGroups(groups, state.validators);\n default:\n return { groups };\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 ...refactorForValid(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 state.groups.forEach((group) => {\n group.subscribe(subscriber);\n });\n }, [state.groups]);\n const subscriber = useCallback((action, group) => {\n setState((state) => {\n const groups = state.groups.map((_group) => {\n return _group.uuid === group.uuid ? group : _group;\n });\n return {\n ...state,\n ...refactorForControls(action, state, groups)\n };\n });\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 setValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n initialValue.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, group], state.validators)\n }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, ...groups], state.validators)\n }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(state.groups.filter((group) => group.uuid !== uuid), state.validators)\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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 const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(initialValue.current, state.validators)\n }));\n }, []);\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, useRef, useState } from 'react';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ 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 firstEffects = useRef({\n dirty: true,\n disabledFocused: true,\n touched: true,\n value: true\n });\n const [state, setState] = useState({\n ...refactorForValid(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 if (!firstEffects.current.value) {\n setState((state) => ({\n ...state,\n ...refactorForValid(controls, state.validators),\n controls,\n value: controlsToValue(controls)\n }));\n }\n else {\n firstEffects.current.value = false;\n }\n }, reduceControlsToArray(controls, 'value'));\n useEffect(() => {\n if (!firstEffects.current.disabledFocused) {\n setState((state) => ({\n ...state,\n controls\n }));\n }\n else {\n firstEffects.current.disabledFocused = false;\n }\n }, [\n ...reduceControlsToArray(controls, 'disabled'),\n ...reduceControlsToArray(controls, 'focused')\n ]);\n useEffect(() => {\n if (!firstEffects.current.dirty) {\n setState((state) => ({\n ...state,\n controls,\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty')\n }));\n }\n else {\n firstEffects.current.dirty = false;\n }\n }, reduceControlsToArray(controls, 'dirty'));\n useEffect(() => {\n if (!firstEffects.current.touched) {\n setState((state) => ({\n ...state,\n controls,\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n }));\n }\n else {\n firstEffects.current.touched = false;\n }\n }, reduceControlsToArray(controls, 'touched'));\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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","refactorForValid","groupIsValid","controlsAllChecked","refactorForControls","controlsPartialChecked","controlsToValue","createFormGroupOptions","arrayIsValid","groupAllChecked","createFormArrayOptions","useRef","useState","useEffect","useCallback","rolsterHasError","rolsterSomeErrors","reduceControlsToArray"],"mappings":";;;;;;;;;AAGO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACjC,QAAQ,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AACjD,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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K;AACrD,YAAY,OAAO,CAAC,KAAK,EAAE,CAAC;AAC5B,SAAS,CAAC,CAAC;AACX,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,IAAI,OAAO;AACX,QAAQ,GAAG,KAAK;AAChB,QAAQ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,QAAQ,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK;AAC7B,QAAQ,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK;AAC9B,QAAQ,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO;AACjC,QAAQ,KAAK;AACb,QAAQ,aAAa;AACrB,QAAQ,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO;AACjC,QAAQ,UAAU,EAAE,CAAC,KAAK,CAAC,QAAQ;AACnC,QAAQ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;AAC5C,KAAK,CAAC;AACN;;ACxGO,SAAS,sBAAsB,CAAC,QAAQ,EAAE;AACjD,IAAI,OAAOG,6BAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AACM,SAAS,mBAAmB,CAAC,KAAK,EAAE;AAC3C,IAAI,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD;;;;;;;;;;;;;;;"}
|
package/dist/es/index.js
CHANGED
|
@@ -143,7 +143,7 @@ function refactorForValid$2(controls, validators) {
|
|
|
143
143
|
valid: errors.length === 0 && controlsAllChecked(controls, 'valid')
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function refactorForControls$1(group, controls
|
|
146
|
+
function refactorForControls$1(action, group, controls) {
|
|
147
147
|
switch (action) {
|
|
148
148
|
case 'focused':
|
|
149
149
|
case 'touched':
|
|
@@ -174,7 +174,7 @@ function refactorForControls$1(group, controls, action) {
|
|
|
174
174
|
return {};
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class RolsterArrayGroup {
|
|
178
178
|
constructor(options) {
|
|
179
179
|
this.uuid = options.uuid;
|
|
180
180
|
this.controls = options.controls;
|
|
@@ -194,19 +194,19 @@ class BaseArrayGroup {
|
|
|
194
194
|
this.errors = options.errors;
|
|
195
195
|
this.error = this.errors[0];
|
|
196
196
|
this.validators = options.validators;
|
|
197
|
-
|
|
197
|
+
this.subscriberControl = (action, control) => {
|
|
198
198
|
const controls = replaceControl(this.controls, control);
|
|
199
199
|
this.refresh(action, {
|
|
200
|
-
...refactorForControls$1(this, controls
|
|
200
|
+
...refactorForControls$1(action, this, controls),
|
|
201
201
|
controls
|
|
202
202
|
});
|
|
203
203
|
};
|
|
204
|
-
Object.values(this.controls).forEach((control) => {
|
|
205
|
-
control.subscribe(subscriber);
|
|
206
|
-
});
|
|
207
204
|
}
|
|
208
205
|
subscribe(subscriber) {
|
|
209
206
|
this.subscriber = subscriber;
|
|
207
|
+
Object.values(this.controls).forEach((control) => {
|
|
208
|
+
control.subscribe(this.subscriberControl);
|
|
209
|
+
});
|
|
210
210
|
}
|
|
211
211
|
setValidators(validators) {
|
|
212
212
|
this.refresh('validators', {
|
|
@@ -216,10 +216,10 @@ class BaseArrayGroup {
|
|
|
216
216
|
}
|
|
217
217
|
refresh(action, options) {
|
|
218
218
|
this.subscriber &&
|
|
219
|
-
this.subscriber(action, new
|
|
219
|
+
this.subscriber(action, new RolsterArrayGroup({ ...this, ...options }));
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
class
|
|
222
|
+
class ReactRolsterArrayGroup extends RolsterArrayGroup {
|
|
223
223
|
constructor(options) {
|
|
224
224
|
const { controls, validators } = options;
|
|
225
225
|
const errors = validators ? groupIsValid({ controls, validators }) : [];
|
|
@@ -236,7 +236,7 @@ class RolsterArrayGroup extends BaseArrayGroup {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
function formArrayGroup(options, validators) {
|
|
239
|
-
return new
|
|
239
|
+
return new ReactRolsterArrayGroup({
|
|
240
240
|
...createFormGroupOptions(options, validators),
|
|
241
241
|
uuid: v4()
|
|
242
242
|
});
|
|
@@ -331,7 +331,7 @@ function refactorForGroups(groups, validators) {
|
|
|
331
331
|
value: groups.map(({ controls }) => controlsToValue(controls))
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
function refactorForControls(state, groups
|
|
334
|
+
function refactorForControls(action, state, groups) {
|
|
335
335
|
switch (action) {
|
|
336
336
|
case 'validators':
|
|
337
337
|
return refactorForValid$1(groups, state.validators);
|
|
@@ -360,19 +360,21 @@ function useFormArray(options, validators) {
|
|
|
360
360
|
validators: _options.validators
|
|
361
361
|
});
|
|
362
362
|
useEffect(() => {
|
|
363
|
-
const subscriber = (action, group) => {
|
|
364
|
-
setState((state) => {
|
|
365
|
-
const groups = state.groups.map((_group) => _group.uuid === group.uuid ? group : _group);
|
|
366
|
-
return {
|
|
367
|
-
...state,
|
|
368
|
-
...refactorForControls(state, groups, action)
|
|
369
|
-
};
|
|
370
|
-
});
|
|
371
|
-
};
|
|
372
363
|
state.groups.forEach((group) => {
|
|
373
364
|
group.subscribe(subscriber);
|
|
374
365
|
});
|
|
375
366
|
}, [state.groups]);
|
|
367
|
+
const subscriber = useCallback((action, group) => {
|
|
368
|
+
setState((state) => {
|
|
369
|
+
const groups = state.groups.map((_group) => {
|
|
370
|
+
return _group.uuid === group.uuid ? group : _group;
|
|
371
|
+
});
|
|
372
|
+
return {
|
|
373
|
+
...state,
|
|
374
|
+
...refactorForControls(action, state, groups)
|
|
375
|
+
};
|
|
376
|
+
});
|
|
377
|
+
}, []);
|
|
376
378
|
const disable = useCallback(() => {
|
|
377
379
|
setState((state) => ({ ...state, disabled: true }));
|
|
378
380
|
}, []);
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/utilities.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 RolsterArrayControl {\n constructor(options) {\n this.uuid = options.uuid;\n this.value = options.value;\n this.initialValue = options.initialValue;\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 this.valid = this.isValid(options.errors);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n }\n focus() {\n this.unfocused && this.refresh('focused', { focused: true });\n }\n blur() {\n this.focused && this.refresh('focused', { focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh('disabled', { disabled: true });\n }\n enable() {\n this.disabled && this.refresh('disabled', { disabled: false });\n }\n touch() {\n this.untouched && this.refresh('touched', { touched: true });\n }\n setInitialValue(value) {\n if (value !== this.initialValue) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: false,\n errors,\n initialValue: value,\n value\n });\n }\n }\n setValue(value) {\n if (value !== this.value) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: true,\n errors,\n value\n });\n }\n }\n setValidators(validators) {\n const errors = validators\n ? controlIsValid({ value: this.value, validators })\n : [];\n this.refresh('validators', { errors, 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 const errors = this.validators\n ? controlIsValid({\n value: this.initialValue,\n validators: this.validators\n })\n : [];\n this.refresh('reset', {\n dirty: false,\n errors,\n touched: false,\n value: this.initialValue\n });\n }\n isValid(errors) {\n return errors.length === 0;\n }\n builder(options) {\n return new RolsterArrayControl({ ...this, ...options });\n }\n refresh(action, options) {\n this.subscriber && this.subscriber(action, this.builder(options));\n }\n}\nclass ReactRolsterArrayControl extends RolsterArrayControl {\n constructor(options) {\n const { value, validators } = options;\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors });\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n return new ReactRolsterArrayControl({\n ..._options,\n initialValue: _options.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","export function replaceControl(controls, control) {\n return Object.entries(controls).reduce((controls, [key, _control]) => {\n if (_control.uuid === control.uuid) {\n controls[key] = control;\n }\n return controls;\n }, controls);\n}\n//# sourceMappingURL=utilities.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n };\n}\nfunction refactorForControls(group, controls, action) {\n switch (action) {\n case 'focused':\n case 'touched':\n return {\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n };\n case 'validators':\n return refactorForValid(controls, group.validators);\n case 'reset':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n value: controlsToValue(controls)\n };\n case 'list':\n case 'value':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n value: controlsToValue(controls)\n };\n default:\n return {};\n }\n}\nclass BaseArrayGroup {\n constructor(options) {\n this.uuid = options.uuid;\n this.controls = options.controls;\n this.value = options.value;\n this.resource = options.resource;\n this.dirty = !!options.dirty;\n this.dirties = !!options.dirties;\n this.pristine = !this.dirty;\n this.pristines = !this.dirties;\n this.touched = !!options.touched;\n this.toucheds = !!options.toucheds;\n this.untouched = !this.touched;\n this.untoucheds = !this.toucheds;\n this.valid = !!options.valid;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n const subscriber = (action, control) => {\n const controls = replaceControl(this.controls, control);\n this.refresh(action, {\n ...refactorForControls(this, controls, action),\n controls\n });\n };\n Object.values(this.controls).forEach((control) => {\n control.subscribe(subscriber);\n });\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n }\n setValidators(validators) {\n this.refresh('validators', {\n ...refactorForValid(this.controls, validators),\n validators\n });\n }\n refresh(action, options) {\n this.subscriber &&\n this.subscriber(action, new BaseArrayGroup({ ...this, ...options }));\n }\n}\nclass RolsterArrayGroup extends BaseArrayGroup {\n constructor(options) {\n const { controls, validators } = options;\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n super({\n ...options,\n errors,\n value: controlsToValue(controls),\n dirties: controlsAllChecked(controls, 'dirty'),\n dirty: controlsPartialChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n });\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 { controlIsValid, controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nimport { RolsterArrayControl } from './form-array-control';\nclass RolsterArrayList extends RolsterArrayControl {\n constructor(options) {\n const { controls, valueToControls, validators } = options;\n const value = controls.map((controls) => controlsToValue(controls));\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors, value });\n this.valueToControls = valueToControls;\n this.controls = controls;\n this.valid =\n errors.length === 0 &&\n controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n controls.forEach((reactControls) => {\n this._subscribe(reactControls);\n });\n }\n setInitialValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value)),\n initialValue: value\n });\n }\n setValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n reset() {\n this.refresh('list', {\n controls: this.initialValue.map((value) => this.valueToControls(value))\n });\n }\n push(controls) {\n this.refresh('list', {\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh('list', {\n controls: this.controls.filter((_controls) => _controls !== controls)\n });\n }\n builder(options) {\n return new RolsterArrayList({\n ...this,\n ...options,\n valueToControls: this.valueToControls\n });\n }\n refresh(action, options) {\n super.refresh(action, options);\n }\n _subscribe(reactControls) {\n Object.values(reactControls).forEach((control) => {\n control.subscribe((action, _control) => {\n const _reactControls = this.controls.map((_controls) => reactControls !== _controls\n ? _controls\n : replaceControl(reactControls, _control));\n this.refresh(action, { controls: _reactControls });\n });\n });\n }\n}\nexport function formArrayList(options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n controls: value.map((value) => options.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';\nfunction refactorForValid(groups, validators) {\n const errors = validators ? arrayIsValid({ groups, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && groupAllChecked(groups, 'valid')\n };\n}\nfunction refactorForGroups(groups, validators) {\n return {\n ...refactorForValid(groups, validators),\n groups,\n controls: groups.map(({ controls }) => controls),\n value: groups.map(({ controls }) => controlsToValue(controls))\n };\n}\nfunction refactorForControls(state, groups, action) {\n switch (action) {\n case 'validators':\n return refactorForValid(groups, state.validators);\n case 'reset':\n case 'list':\n case 'value':\n return refactorForGroups(groups, state.validators);\n default:\n return { groups };\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 ...refactorForValid(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 = (action, group) => {\n setState((state) => {\n const groups = state.groups.map((_group) => _group.uuid === group.uuid ? group : _group);\n return {\n ...state,\n ...refactorForControls(state, groups, action)\n };\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 ...refactorForGroups(groups, state.validators)\n }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n initialValue.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, group], state.validators)\n }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, ...groups], state.validators)\n }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(state.groups.filter((group) => group.uuid !== uuid), state.validators)\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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 const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(initialValue.current, state.validators)\n }));\n }, []);\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, useRef, useState } from 'react';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ 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 firstEffects = useRef({\n dirty: true,\n disabledFocused: true,\n touched: true,\n value: true\n });\n const [state, setState] = useState({\n ...refactorForValid(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 if (!firstEffects.current.value) {\n setState((state) => ({\n ...state,\n ...refactorForValid(controls, state.validators),\n controls,\n value: controlsToValue(controls)\n }));\n }\n else {\n firstEffects.current.value = false;\n }\n }, reduceControlsToArray(controls, 'value'));\n useEffect(() => {\n if (!firstEffects.current.disabledFocused) {\n setState((state) => ({\n ...state,\n controls\n }));\n }\n else {\n firstEffects.current.disabledFocused = false;\n }\n }, [\n ...reduceControlsToArray(controls, 'disabled'),\n ...reduceControlsToArray(controls, 'focused')\n ]);\n useEffect(() => {\n if (!firstEffects.current.dirty) {\n setState((state) => ({\n ...state,\n controls,\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty')\n }));\n }\n else {\n firstEffects.current.dirty = false;\n }\n }, reduceControlsToArray(controls, 'dirty'));\n useEffect(() => {\n if (!firstEffects.current.touched) {\n setState((state) => ({\n ...state,\n controls,\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n }));\n }\n else {\n firstEffects.current.touched = false;\n }\n }, reduceControlsToArray(controls, 'touched'));\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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":["uuid","refactorForValid","refactorForControls","hasError","rolsterHasError","someErrors","rolsterSomeErrors"],"mappings":";;;;;AAGO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACjC,QAAQ,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AACjD,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,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAClD,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO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AE;AACjD,IAAI,OAAO,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AACM,SAAS,mBAAmB,CAAC,KAAK,EAAE;AAC3C,IAAI,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../esm/form-array/form-array-control.js","../esm/utilities.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 RolsterArrayControl {\n constructor(options) {\n this.uuid = options.uuid;\n this.value = options.value;\n this.initialValue = options.initialValue;\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 this.valid = this.isValid(options.errors);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n }\n focus() {\n this.unfocused && this.refresh('focused', { focused: true });\n }\n blur() {\n this.focused && this.refresh('focused', { focused: false, touched: true });\n }\n disable() {\n this.enabled && this.refresh('disabled', { disabled: true });\n }\n enable() {\n this.disabled && this.refresh('disabled', { disabled: false });\n }\n touch() {\n this.untouched && this.refresh('touched', { touched: true });\n }\n setInitialValue(value) {\n if (value !== this.initialValue) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: false,\n errors,\n initialValue: value,\n value\n });\n }\n }\n setValue(value) {\n if (value !== this.value) {\n const errors = this.validators\n ? controlIsValid({ value, validators: this.validators })\n : [];\n this.refresh('value', {\n dirty: true,\n errors,\n value\n });\n }\n }\n setValidators(validators) {\n const errors = validators\n ? controlIsValid({ value: this.value, validators })\n : [];\n this.refresh('validators', { errors, 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 const errors = this.validators\n ? controlIsValid({\n value: this.initialValue,\n validators: this.validators\n })\n : [];\n this.refresh('reset', {\n dirty: false,\n errors,\n touched: false,\n value: this.initialValue\n });\n }\n isValid(errors) {\n return errors.length === 0;\n }\n builder(options) {\n return new RolsterArrayControl({ ...this, ...options });\n }\n refresh(action, options) {\n this.subscriber && this.subscriber(action, this.builder(options));\n }\n}\nclass ReactRolsterArrayControl extends RolsterArrayControl {\n constructor(options) {\n const { value, validators } = options;\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors });\n }\n}\nfunction rolsterArrayControl(options, validators) {\n const _options = createFormControlOptions(options, validators);\n return new ReactRolsterArrayControl({\n ..._options,\n initialValue: _options.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","export function replaceControl(controls, control) {\n return Object.entries(controls).reduce((controls, [key, _control]) => {\n if (_control.uuid === control.uuid) {\n controls[key] = control;\n }\n return controls;\n }, controls);\n}\n//# sourceMappingURL=utilities.js.map","import { createFormGroupOptions } from '@rolster/forms/arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n };\n}\nfunction refactorForControls(action, group, controls) {\n switch (action) {\n case 'focused':\n case 'touched':\n return {\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n };\n case 'validators':\n return refactorForValid(controls, group.validators);\n case 'reset':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n value: controlsToValue(controls)\n };\n case 'list':\n case 'value':\n return {\n ...refactorForValid(controls, group.validators),\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty'),\n value: controlsToValue(controls)\n };\n default:\n return {};\n }\n}\nexport class RolsterArrayGroup {\n constructor(options) {\n this.uuid = options.uuid;\n this.controls = options.controls;\n this.value = options.value;\n this.resource = options.resource;\n this.dirty = !!options.dirty;\n this.dirties = !!options.dirties;\n this.pristine = !this.dirty;\n this.pristines = !this.dirties;\n this.touched = !!options.touched;\n this.toucheds = !!options.toucheds;\n this.untouched = !this.touched;\n this.untoucheds = !this.toucheds;\n this.valid = !!options.valid;\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n this.errors = options.errors;\n this.error = this.errors[0];\n this.validators = options.validators;\n this.subscriberControl = (action, control) => {\n const controls = replaceControl(this.controls, control);\n this.refresh(action, {\n ...refactorForControls(action, this, controls),\n controls\n });\n };\n }\n subscribe(subscriber) {\n this.subscriber = subscriber;\n Object.values(this.controls).forEach((control) => {\n control.subscribe(this.subscriberControl);\n });\n }\n setValidators(validators) {\n this.refresh('validators', {\n ...refactorForValid(this.controls, validators),\n validators\n });\n }\n refresh(action, options) {\n this.subscriber &&\n this.subscriber(action, new RolsterArrayGroup({ ...this, ...options }));\n }\n}\nclass ReactRolsterArrayGroup extends RolsterArrayGroup {\n constructor(options) {\n const { controls, validators } = options;\n const errors = validators ? groupIsValid({ controls, validators }) : [];\n super({\n ...options,\n errors,\n value: controlsToValue(controls),\n dirties: controlsAllChecked(controls, 'dirty'),\n dirty: controlsPartialChecked(controls, 'dirty'),\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched'),\n valid: errors.length === 0 && controlsAllChecked(controls, 'valid')\n });\n }\n}\nexport function formArrayGroup(options, validators) {\n return new ReactRolsterArrayGroup({\n ...createFormGroupOptions(options, validators),\n uuid: uuid()\n });\n}\n//# sourceMappingURL=form-array-group.js.map","import { controlIsValid, controlsAllChecked, controlsToValue } from '@rolster/forms/helpers';\nimport { v4 as uuid } from 'uuid';\nimport { replaceControl } from '../utilities';\nimport { RolsterArrayControl } from './form-array-control';\nclass RolsterArrayList extends RolsterArrayControl {\n constructor(options) {\n const { controls, valueToControls, validators } = options;\n const value = controls.map((controls) => controlsToValue(controls));\n const errors = validators ? controlIsValid({ value, validators }) : [];\n super({ ...options, errors, value });\n this.valueToControls = valueToControls;\n this.controls = controls;\n this.valid =\n errors.length === 0 &&\n controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true);\n this.invalid = !this.valid;\n this.wrong = this.touched && this.invalid;\n controls.forEach((reactControls) => {\n this._subscribe(reactControls);\n });\n }\n setInitialValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value)),\n initialValue: value\n });\n }\n setValue(value) {\n this.refresh('list', {\n controls: value.map((value) => this.valueToControls(value))\n });\n }\n reset() {\n this.refresh('list', {\n controls: this.initialValue.map((value) => this.valueToControls(value))\n });\n }\n push(controls) {\n this.refresh('list', {\n controls: [...this.controls, controls]\n });\n }\n remove(controls) {\n this.refresh('list', {\n controls: this.controls.filter((_controls) => _controls !== controls)\n });\n }\n builder(options) {\n return new RolsterArrayList({\n ...this,\n ...options,\n valueToControls: this.valueToControls\n });\n }\n refresh(action, options) {\n super.refresh(action, options);\n }\n _subscribe(reactControls) {\n Object.values(reactControls).forEach((control) => {\n control.subscribe((action, _control) => {\n const _reactControls = this.controls.map((_controls) => reactControls !== _controls\n ? _controls\n : replaceControl(reactControls, _control));\n this.refresh(action, { controls: _reactControls });\n });\n });\n }\n}\nexport function formArrayList(options) {\n const value = options?.value || [];\n return new RolsterArrayList({\n ...options,\n controls: value.map((value) => options.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';\nfunction refactorForValid(groups, validators) {\n const errors = validators ? arrayIsValid({ groups, validators }) : [];\n return {\n errors,\n valid: errors.length === 0 && groupAllChecked(groups, 'valid')\n };\n}\nfunction refactorForGroups(groups, validators) {\n return {\n ...refactorForValid(groups, validators),\n groups,\n controls: groups.map(({ controls }) => controls),\n value: groups.map(({ controls }) => controlsToValue(controls))\n };\n}\nfunction refactorForControls(action, state, groups) {\n switch (action) {\n case 'validators':\n return refactorForValid(groups, state.validators);\n case 'reset':\n case 'list':\n case 'value':\n return refactorForGroups(groups, state.validators);\n default:\n return { groups };\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 ...refactorForValid(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 state.groups.forEach((group) => {\n group.subscribe(subscriber);\n });\n }, [state.groups]);\n const subscriber = useCallback((action, group) => {\n setState((state) => {\n const groups = state.groups.map((_group) => {\n return _group.uuid === group.uuid ? group : _group;\n });\n return {\n ...state,\n ...refactorForControls(action, state, groups)\n };\n });\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 setValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n }, []);\n const setInitialValue = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(groups, state.validators)\n }));\n initialValue.current = groups;\n }, []);\n const push = useCallback((group) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, group], state.validators)\n }));\n }, []);\n const merge = useCallback((groups) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups([...state.groups, ...groups], state.validators)\n }));\n }, []);\n const remove = useCallback(({ uuid }) => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(state.groups.filter((group) => group.uuid !== uuid), state.validators)\n }));\n }, []);\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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 const reset = useCallback(() => {\n setState((state) => ({\n ...state,\n ...refactorForGroups(initialValue.current, state.validators)\n }));\n }, []);\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, useRef, useState } from 'react';\nfunction refactorForValid(controls, validators) {\n const errors = validators ? groupIsValid({ 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 firstEffects = useRef({\n dirty: true,\n disabledFocused: true,\n touched: true,\n value: true\n });\n const [state, setState] = useState({\n ...refactorForValid(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 if (!firstEffects.current.value) {\n setState((state) => ({\n ...state,\n ...refactorForValid(controls, state.validators),\n controls,\n value: controlsToValue(controls)\n }));\n }\n else {\n firstEffects.current.value = false;\n }\n }, reduceControlsToArray(controls, 'value'));\n useEffect(() => {\n if (!firstEffects.current.disabledFocused) {\n setState((state) => ({\n ...state,\n controls\n }));\n }\n else {\n firstEffects.current.disabledFocused = false;\n }\n }, [\n ...reduceControlsToArray(controls, 'disabled'),\n ...reduceControlsToArray(controls, 'focused')\n ]);\n useEffect(() => {\n if (!firstEffects.current.dirty) {\n setState((state) => ({\n ...state,\n controls,\n dirty: controlsPartialChecked(controls, 'dirty'),\n dirties: controlsAllChecked(controls, 'dirty')\n }));\n }\n else {\n firstEffects.current.dirty = false;\n }\n }, reduceControlsToArray(controls, 'dirty'));\n useEffect(() => {\n if (!firstEffects.current.touched) {\n setState((state) => ({\n ...state,\n controls,\n touched: controlsPartialChecked(controls, 'touched'),\n toucheds: controlsAllChecked(controls, 'touched')\n }));\n }\n else {\n firstEffects.current.touched = false;\n }\n }, reduceControlsToArray(controls, 'touched'));\n const setValidators = useCallback((validators) => {\n setState((state) => ({\n ...state,\n ...refactorForValid(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":["uuid","refactorForValid","refactorForControls","hasError","rolsterHasError","someErrors","rolsterSomeErrors"],"mappings":";;;;;AAGO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACjC,QAAQ,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AACjD,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,G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AAC,CAAC;AAC9B,QAAQ,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK;AAC7B,QAAQ,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK;AAC9B,QAAQ,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO;AACjC,QAAQ,KAAK;AACb,QAAQ,aAAa;AACrB,QAAQ,SAAS,EAAE,CAAC,KAAK,CAAC,OAAO;AACjC,QAAQ,UAAU,EAAE,CAAC,KAAK,CAAC,QAAQ;AACnC,QAAQ,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;AAC5C,KAAK,CAAC;AACN;;ACxGO,SAAS,sBAAsB,CAAC,QAAQ,EAAE;AACjD,IAAI,OAAO,qBAAqB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AACM,SAAS,mBAAmB,CAAC,KAAK,EAAE;AAC3C,IAAI,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD;;;;"}
|
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
import { FormArrayGroupOptions, ValidatorGroupFn } from '@rolster/forms';
|
|
2
|
-
import {
|
|
1
|
+
import { ControlsValue, FormArrayGroupOptions, ValidatorGroupFn } from '@rolster/forms';
|
|
2
|
+
import { ValidatorError } from '@rolster/validators';
|
|
3
|
+
import { ReactArrayAction, ReactArrayControls, ReactArrayGroup, ReactArrayGroupSubscriber } from '../types';
|
|
4
|
+
interface ArrayGroupOptions<C extends ReactArrayControls = ReactArrayControls, R = any> extends FormArrayGroupOptions<C, R> {
|
|
5
|
+
value: ControlsValue<C>;
|
|
6
|
+
errors: ValidatorError<any>[];
|
|
7
|
+
dirties?: boolean;
|
|
8
|
+
dirty?: boolean;
|
|
9
|
+
touched?: boolean;
|
|
10
|
+
toucheds?: boolean;
|
|
11
|
+
valid?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type Options<C extends ReactArrayControls, R = any> = Partial<ArrayGroupOptions<C, R>>;
|
|
14
|
+
export declare class RolsterArrayGroup<C extends ReactArrayControls = ReactArrayControls, R = any> implements ReactArrayGroup<C, R> {
|
|
15
|
+
readonly uuid: string;
|
|
16
|
+
readonly controls: C;
|
|
17
|
+
readonly value: ControlsValue<C>;
|
|
18
|
+
readonly dirty: boolean;
|
|
19
|
+
readonly dirties: boolean;
|
|
20
|
+
readonly pristine: boolean;
|
|
21
|
+
readonly pristines: boolean;
|
|
22
|
+
readonly touched: boolean;
|
|
23
|
+
readonly toucheds: boolean;
|
|
24
|
+
readonly untouched: boolean;
|
|
25
|
+
readonly untoucheds: boolean;
|
|
26
|
+
readonly valid: boolean;
|
|
27
|
+
readonly invalid: boolean;
|
|
28
|
+
readonly wrong: boolean;
|
|
29
|
+
readonly errors: ValidatorError<any>[];
|
|
30
|
+
readonly error?: ValidatorError<any>;
|
|
31
|
+
readonly validators?: ValidatorGroupFn<C>[];
|
|
32
|
+
readonly resource?: R;
|
|
33
|
+
private subscriberControl;
|
|
34
|
+
private subscriber?;
|
|
35
|
+
constructor(options: ArrayGroupOptions<C, R>);
|
|
36
|
+
subscribe(subscriber: ReactArrayGroupSubscriber<C, R>): void;
|
|
37
|
+
setValidators(validators: ValidatorGroupFn<C, any>[]): void;
|
|
38
|
+
protected refresh(action: ReactArrayAction, options: Options<C, R>): void;
|
|
39
|
+
}
|
|
3
40
|
type ReactGroupOptions<C extends ReactArrayControls = ReactArrayControls, R = any> = Omit<FormArrayGroupOptions<C, R>, 'uuid'>;
|
|
4
41
|
export declare function formArrayGroup<C extends ReactArrayControls = ReactArrayControls, R = any>(options: ReactGroupOptions<C, R>): ReactArrayGroup<C, R>;
|
|
5
42
|
export declare function formArrayGroup<C extends ReactArrayControls = ReactArrayControls, R = any>(controls: C, validators?: ValidatorGroupFn<C, R>[]): ReactArrayGroup<C, R>;
|
|
@@ -9,7 +9,7 @@ function refactorForValid(controls, validators) {
|
|
|
9
9
|
valid: errors.length === 0 && controlsAllChecked(controls, 'valid')
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function refactorForControls(group, controls
|
|
12
|
+
function refactorForControls(action, group, controls) {
|
|
13
13
|
switch (action) {
|
|
14
14
|
case 'focused':
|
|
15
15
|
case 'touched':
|
|
@@ -40,7 +40,7 @@ function refactorForControls(group, controls, action) {
|
|
|
40
40
|
return {};
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
class
|
|
43
|
+
export class RolsterArrayGroup {
|
|
44
44
|
constructor(options) {
|
|
45
45
|
this.uuid = options.uuid;
|
|
46
46
|
this.controls = options.controls;
|
|
@@ -60,19 +60,19 @@ class BaseArrayGroup {
|
|
|
60
60
|
this.errors = options.errors;
|
|
61
61
|
this.error = this.errors[0];
|
|
62
62
|
this.validators = options.validators;
|
|
63
|
-
|
|
63
|
+
this.subscriberControl = (action, control) => {
|
|
64
64
|
const controls = replaceControl(this.controls, control);
|
|
65
65
|
this.refresh(action, {
|
|
66
|
-
...refactorForControls(this, controls
|
|
66
|
+
...refactorForControls(action, this, controls),
|
|
67
67
|
controls
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
Object.values(this.controls).forEach((control) => {
|
|
71
|
-
control.subscribe(subscriber);
|
|
72
|
-
});
|
|
73
70
|
}
|
|
74
71
|
subscribe(subscriber) {
|
|
75
72
|
this.subscriber = subscriber;
|
|
73
|
+
Object.values(this.controls).forEach((control) => {
|
|
74
|
+
control.subscribe(this.subscriberControl);
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
77
|
setValidators(validators) {
|
|
78
78
|
this.refresh('validators', {
|
|
@@ -82,10 +82,10 @@ class BaseArrayGroup {
|
|
|
82
82
|
}
|
|
83
83
|
refresh(action, options) {
|
|
84
84
|
this.subscriber &&
|
|
85
|
-
this.subscriber(action, new
|
|
85
|
+
this.subscriber(action, new RolsterArrayGroup({ ...this, ...options }));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
class
|
|
88
|
+
class ReactRolsterArrayGroup extends RolsterArrayGroup {
|
|
89
89
|
constructor(options) {
|
|
90
90
|
const { controls, validators } = options;
|
|
91
91
|
const errors = validators ? groupIsValid({ controls, validators }) : [];
|
|
@@ -102,7 +102,7 @@ class RolsterArrayGroup extends BaseArrayGroup {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
export function formArrayGroup(options, validators) {
|
|
105
|
-
return new
|
|
105
|
+
return new ReactRolsterArrayGroup({
|
|
106
106
|
...createFormGroupOptions(options, validators),
|
|
107
107
|
uuid: uuid()
|
|
108
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-array-group.js","sourceRoot":"","sources":["../../../src/form-array/form-array-group.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,YAAY,EACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAQlC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAmB9C,SAAS,gBAAgB,CACvB,QAAW,EACX,UAAkC;IAElC,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAExE,OAAO;QACL,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,
|
|
1
|
+
{"version":3,"file":"form-array-group.js","sourceRoot":"","sources":["../../../src/form-array/form-array-group.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,YA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,sBAGJ,SAAQ,iBAAuB;IAC/B,YAAY,OAAoC;QAC9C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAEzC,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAExE,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,MAAM;YACN,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC;YAChC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC9C,KAAK,EAAE,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC;YAChD,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE,SAAS,CAAC;YACpD,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC;YACjD,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;CACF;AAeD,MAAM,UAAU,cAAc,CAI5B,OAAoC,EACpC,UAAqC;IAErC,OAAO,IAAI,sBAAsB,CAAC;QAChC,GAAG,sBAAsB,CAA6B,OAAO,EAAE,UAAU,CAAC;QAC1E,IAAI,EAAE,IAAI,EAAE;KACb,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -16,7 +16,7 @@ function refactorForGroups(groups, validators) {
|
|
|
16
16
|
value: groups.map(({ controls }) => controlsToValue(controls))
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function refactorForControls(state, groups
|
|
19
|
+
function refactorForControls(action, state, groups) {
|
|
20
20
|
switch (action) {
|
|
21
21
|
case 'validators':
|
|
22
22
|
return refactorForValid(groups, state.validators);
|
|
@@ -45,19 +45,21 @@ export function useFormArray(options, validators) {
|
|
|
45
45
|
validators: _options.validators
|
|
46
46
|
});
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
const subscriber = (action, group) => {
|
|
49
|
-
setState((state) => {
|
|
50
|
-
const groups = state.groups.map((_group) => _group.uuid === group.uuid ? group : _group);
|
|
51
|
-
return {
|
|
52
|
-
...state,
|
|
53
|
-
...refactorForControls(state, groups, action)
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
48
|
state.groups.forEach((group) => {
|
|
58
49
|
group.subscribe(subscriber);
|
|
59
50
|
});
|
|
60
51
|
}, [state.groups]);
|
|
52
|
+
const subscriber = useCallback((action, group) => {
|
|
53
|
+
setState((state) => {
|
|
54
|
+
const groups = state.groups.map((_group) => {
|
|
55
|
+
return _group.uuid === group.uuid ? group : _group;
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
...state,
|
|
59
|
+
...refactorForControls(action, state, groups)
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
61
63
|
const disable = useCallback(() => {
|
|
62
64
|
setState((state) => ({ ...state, disabled: true }));
|
|
63
65
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-array.js","sourceRoot":"","sources":["../../../src/form-array/form-array.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,QAAQ,IAAI,eAAe,EAC3B,UAAU,IAAI,iBAAiB,EAChC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"form-array.js","sourceRoot":"","sources":["../../../src/form-array/form-array.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,QAAQ,IAAI,eAAe,EAC3B,UAAU,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"description": "It implements a set of classes that allow managing the control of states of the input components in React",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"ts-jest": "^29.1.0",
|
|
52
52
|
"tslib": "^2.4.0",
|
|
53
53
|
"typescript": "^5.7.2",
|
|
54
|
-
"vite": "^6.2.
|
|
54
|
+
"vite": "^6.2.7"
|
|
55
55
|
},
|
|
56
56
|
"repository": {
|
|
57
57
|
"type": "git",
|