@rolster/forms 2.7.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/arguments.js +46 -46
- package/dist/cjs/arguments.js.map +1 -1
- package/dist/cjs/helpers.js +53 -53
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/index.js +510 -510
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/arguments.js +46 -46
- package/dist/es/arguments.js.map +1 -1
- package/dist/es/helpers.js +53 -53
- package/dist/es/helpers.js.map +1 -1
- package/dist/es/index.js +510 -510
- package/dist/es/index.js.map +1 -1
- package/dist/esm/arguments.d.ts +18 -18
- package/dist/esm/arguments.js +47 -47
- package/dist/esm/arguments.js.map +1 -1
- package/dist/esm/form-array/arguments.d.ts +6 -6
- package/dist/esm/form-array/arguments.js +1 -1
- package/dist/esm/form-array/form-array-control.d.ts +20 -20
- package/dist/esm/form-array/form-array-control.js +13 -13
- package/dist/esm/form-array/form-array-group.d.ts +13 -13
- package/dist/esm/form-array/form-array-group.js +14 -14
- package/dist/esm/form-array/form-array-list.d.ts +20 -20
- package/dist/esm/form-array/form-array-list.js +51 -51
- package/dist/esm/form-array/form-array.d.ts +54 -54
- package/dist/esm/form-array/form-array.js +145 -145
- package/dist/esm/form-array/form-array.js.map +1 -1
- package/dist/esm/form-array/index.d.ts +5 -5
- package/dist/esm/form-array/index.js +5 -5
- package/dist/esm/form-array/types.d.ts +2 -2
- package/dist/esm/form-array/types.js +1 -1
- package/dist/esm/form-control.d.ts +52 -52
- package/dist/esm/form-control.js +119 -119
- package/dist/esm/form-control.js.map +1 -1
- package/dist/esm/form-group.d.ts +34 -34
- package/dist/esm/form-group.js +93 -93
- package/dist/esm/form-group.js.map +1 -1
- package/dist/esm/helpers.d.ts +25 -25
- package/dist/esm/helpers.js +55 -55
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +4 -4
- package/dist/esm/types.d.ts +139 -139
- package/dist/esm/types.js +1 -1
- package/package.json +5 -5
- package/readme.md +2 -2
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../esm/arguments.js","../esm/helpers.js","../esm/form-control.js","../esm/form-array/form-array-control.js","../esm/form-group.js","../esm/form-array/form-array-group.js","../esm/form-array/form-array-list.js","../esm/form-array/form-array.js"],"sourcesContent":["function itIsControlOptions(options) {\r\n return (typeof options === 'object' &&\r\n ('value' in options || 'validators' in options));\r\n}\r\nfunction itIsGroupOptions(options) {\r\n return typeof options === 'object' && 'controls' in options;\r\n}\r\nfunction itIsArrayOptions(options) {\r\n return (typeof options === 'object' &&\r\n ('groups' in options || 'validators' in options));\r\n}\r\nexport function createFormControlOptions(...controlOptions) {\r\n const [options, validators] = controlOptions;\r\n if (!options) {\r\n return { value: options, validators };\r\n }\r\n if (!validators && itIsControlOptions(options)) {\r\n return options;\r\n }\r\n return {\r\n value: options,\r\n validators\r\n };\r\n}\r\nexport function createFormGroupOptions(...groupOptions) {\r\n const [options, validators] = groupOptions;\r\n if (!validators && itIsGroupOptions(options)) {\r\n return options;\r\n }\r\n return {\r\n controls: options,\r\n validators\r\n };\r\n}\r\nexport function createFormArrayOptions(...arrayOptions) {\r\n const [options, validators] = arrayOptions;\r\n if (!options) {\r\n return { groups: options, validators };\r\n }\r\n if (!validators && itIsArrayOptions(options)) {\r\n return options;\r\n }\r\n return {\r\n groups: options,\r\n validators\r\n };\r\n}\r\n//# sourceMappingURL=arguments.js.map","import { parseBoolean } from '@rolster/commons';\r\nfunction reduceErrors(errors) {\r\n return errors.reduce((keys, { id }) => [...keys, id], []);\r\n}\r\nexport const controlIsValid = ({ value, validators }) => {\r\n return validators.reduce((errors, validator) => {\r\n const error = validator(value);\r\n if (error) {\r\n errors.push(error);\r\n }\r\n return errors;\r\n }, []);\r\n};\r\nexport const controlsAllChecked = (controls, key) => {\r\n return Object.values(controls).reduce((value, control) => control.disabled ? value : value && parseBoolean(control[key]), true);\r\n};\r\nexport const controlsPartialChecked = (controls, key) => {\r\n return Object.values(controls).reduce((value, control) => control.disabled ? value : value || parseBoolean(control[key]), false);\r\n};\r\nexport const controlsToValue = (controls) => {\r\n return Object.entries(controls).reduce((result, [key, { value }]) => {\r\n result[key] = value;\r\n return result;\r\n }, {});\r\n};\r\nexport const groupIsValid = ({ controls, validators }) => {\r\n return validators.reduce((errors, validator) => {\r\n const error = validator(controls);\r\n if (error) {\r\n errors.push(error);\r\n }\r\n return errors;\r\n }, []);\r\n};\r\nexport function groupAllChecked(groups, key) {\r\n return groups.reduce((value, group) => value && parseBoolean(group[key]), true);\r\n}\r\nexport function groupPartialChecked(groups, key) {\r\n return groups.reduce((value, group) => value || parseBoolean(group[key]), false);\r\n}\r\nexport const arrayIsValid = ({ groups, validators }) => {\r\n return validators.reduce((errors, validator) => {\r\n const error = validator(groups);\r\n if (error) {\r\n errors.push(error);\r\n }\r\n return errors;\r\n }, []);\r\n};\r\nexport function hasError(errors, key) {\r\n return reduceErrors(errors).includes(key);\r\n}\r\nexport function someErrors(errors, keys) {\r\n return reduceErrors(errors).some((key) => keys.includes(key));\r\n}\r\n//# sourceMappingURL=helpers.js.map","import { observable } from '@rolster/commons';\r\nimport { createFormControlOptions } from './arguments';\r\nimport { controlIsValid, hasError, someErrors } from './helpers';\r\nexport class FormControl {\r\n constructor(controlOptions, controlValidators) {\r\n this.currentFocused = false;\r\n this.currentTouched = false;\r\n this.currentDirty = false;\r\n this.currentDisabled = false;\r\n this.currentValid = true;\r\n this.currentErrors = [];\r\n const { value, validators } = createFormControlOptions(controlOptions, controlValidators);\r\n this.observable = observable(value);\r\n this.initialValue = value;\r\n this.validators = validators;\r\n this.currentValue = value;\r\n this.updateValueAndValidity(value, validators);\r\n }\r\n get focused() {\r\n return this.currentFocused;\r\n }\r\n get unfocused() {\r\n return !this.currentFocused;\r\n }\r\n get touched() {\r\n return this.currentTouched;\r\n }\r\n get untouched() {\r\n return !this.currentTouched;\r\n }\r\n get dirty() {\r\n return this.currentDirty;\r\n }\r\n get pristine() {\r\n return !this.currentDirty;\r\n }\r\n get disabled() {\r\n return this.currentDisabled;\r\n }\r\n get enabled() {\r\n return !this.currentDisabled;\r\n }\r\n get valid() {\r\n return this.currentValid;\r\n }\r\n get invalid() {\r\n return !this.currentValid;\r\n }\r\n get value() {\r\n return this.currentValue;\r\n }\r\n get errors() {\r\n return this.currentErrors;\r\n }\r\n get error() {\r\n return this.currentError;\r\n }\r\n get wrong() {\r\n return this.touched && this.invalid;\r\n }\r\n hasError(key) {\r\n return hasError(this.errors, key);\r\n }\r\n someErrors(keys) {\r\n return someErrors(this.errors, keys);\r\n }\r\n reset() {\r\n this.setValue(this.initialValue);\r\n this.currentDirty = false;\r\n this.currentTouched = false;\r\n }\r\n focus() {\r\n this.currentFocused = true;\r\n }\r\n blur() {\r\n this.currentFocused = false;\r\n this.currentTouched = true;\r\n }\r\n disable() {\r\n this.currentDisabled = true;\r\n }\r\n enable() {\r\n this.currentDisabled = false;\r\n }\r\n touch() {\r\n this.currentTouched = true;\r\n }\r\n setValue(value) {\r\n if (this.enabled) {\r\n this.currentValue = value;\r\n this.currentDirty = true;\r\n this.updateValueAndValidity(value, this.validators);\r\n this.observable.next(value);\r\n }\r\n }\r\n setValidators(validators = []) {\r\n this.validators = validators;\r\n this.updateValueAndValidity(this.value, validators);\r\n }\r\n subscribe(subscriber) {\r\n return this.observable.subscribe(subscriber);\r\n }\r\n updateValueAndValidity(value, validators) {\r\n if (validators) {\r\n const errors = controlIsValid({ value, validators });\r\n this.currentError = errors[0];\r\n this.currentErrors = errors;\r\n this.currentValid = errors.length === 0;\r\n }\r\n else {\r\n this.currentValid = true;\r\n this.currentError = undefined;\r\n this.currentErrors = [];\r\n }\r\n }\r\n}\r\nexport function formControl(options, validators) {\r\n return new FormControl(createFormControlOptions(options, validators));\r\n}\r\n//# sourceMappingURL=form-control.js.map","import { v4 as uuid } from 'uuid';\r\nimport { createFormControlOptions } from '../arguments';\r\nimport { FormControl } from '../form-control';\r\nexport class FormArrayControl extends FormControl {\r\n constructor(controlOptions, controlValidators) {\r\n const { value, validators } = createFormControlOptions(controlOptions, controlValidators);\r\n super(value, validators);\r\n this.uuid = uuid();\r\n }\r\n}\r\nexport function formArrayControl(options, validators) {\r\n return new FormArrayControl(createFormControlOptions(options, validators));\r\n}\r\n//# sourceMappingURL=form-array-control.js.map","import { observable } from '@rolster/commons';\r\nimport { createFormGroupOptions } from './arguments';\r\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from './helpers';\r\nexport class FormGroup {\r\n constructor(groupOptions, groupValidators) {\r\n this.currentErrors = [];\r\n this.currentValid = true;\r\n const { controls, validators } = createFormGroupOptions(groupOptions, groupValidators);\r\n this.currentControls = controls;\r\n this.validators = validators;\r\n this.updateValueAndValidity(controls, validators);\r\n this.observable = observable(this.value);\r\n Object.values(controls).forEach((control) => {\r\n control.subscribe(() => {\r\n this.updateValueAndValidity(this.controls, this.validators);\r\n this.observable.next(this.value);\r\n });\r\n });\r\n }\r\n get controls() {\r\n return this.currentControls;\r\n }\r\n get touched() {\r\n return controlsPartialChecked(this.controls, 'touched');\r\n }\r\n get touchedAll() {\r\n return controlsAllChecked(this.controls, 'touched');\r\n }\r\n get untouched() {\r\n return !this.touched;\r\n }\r\n get untouchedAll() {\r\n return !this.touchedAll;\r\n }\r\n get dirty() {\r\n return controlsPartialChecked(this.controls, 'dirty');\r\n }\r\n get dirtyAll() {\r\n return controlsAllChecked(this.controls, 'dirty');\r\n }\r\n get pristine() {\r\n return !this.dirty;\r\n }\r\n get pristineAll() {\r\n return this.dirtyAll;\r\n }\r\n get valid() {\r\n return this.currentValid && controlsAllChecked(this.controls, 'valid');\r\n }\r\n get invalid() {\r\n return !this.valid;\r\n }\r\n get value() {\r\n return controlsToValue(this.controls);\r\n }\r\n get errors() {\r\n return this.currentErrors;\r\n }\r\n get error() {\r\n return this.currentError;\r\n }\r\n get wrong() {\r\n return this.touched && this.invalid;\r\n }\r\n reset() {\r\n Object.values(this.controls).forEach((control) => {\r\n control.reset();\r\n });\r\n }\r\n setValidators(validators) {\r\n this.validators = validators;\r\n this.updateValueAndValidity(this.controls, validators);\r\n }\r\n subscribe(subscriber) {\r\n return this.observable.subscribe(subscriber);\r\n }\r\n updateValueAndValidity(controls, validators) {\r\n if (validators) {\r\n const errors = groupIsValid({ controls, validators });\r\n this.currentErrors = errors;\r\n this.currentError = errors[0];\r\n this.currentValid = errors.length === 0;\r\n }\r\n else {\r\n this.currentErrors = [];\r\n this.currentError = undefined;\r\n this.currentValid = true;\r\n }\r\n }\r\n}\r\nexport function formGroup(options, validators) {\r\n return new FormGroup(createFormGroupOptions(options, validators));\r\n}\r\n//# sourceMappingURL=form-group.js.map","import { v4 as uuid } from 'uuid';\r\nimport { createFormGroupOptions } from '../arguments';\r\nimport { FormGroup } from '../form-group';\r\nexport class FormArrayGroup extends FormGroup {\r\n constructor(groupOptions, groupValidators) {\r\n const { controls, resource, validators } = createFormGroupOptions(groupOptions, groupValidators);\r\n super(controls, validators);\r\n this.uuid = uuid();\r\n this.resource = resource;\r\n }\r\n}\r\nexport function formArrayGroup(options, validators) {\r\n return new FormArrayGroup(createFormGroupOptions(options, validators));\r\n}\r\n//# sourceMappingURL=form-array-group.js.map","import { v4 as uuid } from 'uuid';\r\nimport { FormControl } from '../form-control';\r\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue } from '../helpers';\r\nexport class FormArrayList extends FormControl {\r\n constructor(valueToControls, value, validators) {\r\n const initialValue = value || [];\r\n super(initialValue, validators);\r\n this.valueToControls = valueToControls;\r\n this.currentControls = initialValue.map((value) => this.createControls(value));\r\n this.uuid = uuid();\r\n }\r\n get controls() {\r\n return this.currentControls;\r\n }\r\n get touched() {\r\n return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'touched'), true);\r\n }\r\n get dirty() {\r\n return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'dirty'), true);\r\n }\r\n get valid() {\r\n return (this.currentValid &&\r\n this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true));\r\n }\r\n get value() {\r\n return this.controls.map((controls) => controlsToValue(controls));\r\n }\r\n setValue(values) {\r\n this.currentControls = values.map((value) => this.createControls(value));\r\n }\r\n push(controls) {\r\n this.currentControls = this.currentControls.concat([controls]);\r\n }\r\n remove(controls) {\r\n this.currentControls = this.currentControls.filter((currentControls) => currentControls !== controls);\r\n }\r\n createControls(value) {\r\n const controls = this.valueToControls(value);\r\n Object.values(controls).forEach((control) => {\r\n control.subscribe(() => {\r\n const { value, validators } = this;\r\n this.updateValueAndValidity(value, validators);\r\n this.observable.next(value);\r\n });\r\n });\r\n return controls;\r\n }\r\n}\r\nexport function formArrayList(valueToControl, value, validators) {\r\n return new FormArrayList(valueToControl, value, validators);\r\n}\r\n//# sourceMappingURL=form-array-list.js.map","import { observable } from '@rolster/commons';\r\nimport { createFormArrayOptions } from '../arguments';\r\nimport { arrayIsValid, groupAllChecked, groupPartialChecked, hasError, someErrors } from '../helpers';\r\nexport class FormArray {\r\n constructor(arrayOptions, arrayValidators) {\r\n this.currentGroups = [];\r\n this.currentValid = true;\r\n this.currentDisabled = false;\r\n this.currentErrors = [];\r\n const { groups, validators } = createFormArrayOptions(arrayOptions, arrayValidators);\r\n this.unsusbcriptions = new Map();\r\n this.initialState = groups;\r\n this.validators = validators;\r\n this.refresh(this.initialState);\r\n this.observable = observable(this.value);\r\n groups?.forEach((group) => {\r\n this.subscription(group);\r\n });\r\n }\r\n get groups() {\r\n return this.currentGroups;\r\n }\r\n get controls() {\r\n return this.groups.map(({ controls }) => controls);\r\n }\r\n get touched() {\r\n return groupPartialChecked(this.groups, 'touched');\r\n }\r\n get touchedAll() {\r\n return groupAllChecked(this.groups, 'touchedAll');\r\n }\r\n get untouched() {\r\n return !this.touched;\r\n }\r\n get untouchedAll() {\r\n return !this.touchedAll;\r\n }\r\n get dirty() {\r\n return groupPartialChecked(this.groups, 'dirty');\r\n }\r\n get dirtyAll() {\r\n return groupAllChecked(this.groups, 'dirtyAll');\r\n }\r\n get pristine() {\r\n return !this.dirty;\r\n }\r\n get pristineAll() {\r\n return !this.dirtyAll;\r\n }\r\n get disabled() {\r\n return this.currentDisabled;\r\n }\r\n get enabled() {\r\n return !this.currentDisabled;\r\n }\r\n get valid() {\r\n return this.currentValid && groupAllChecked(this.groups, 'valid');\r\n }\r\n get invalid() {\r\n return !this.currentValid;\r\n }\r\n get value() {\r\n return this.groups.map(({ value: state }) => state);\r\n }\r\n get error() {\r\n return this.currentError;\r\n }\r\n get errors() {\r\n return this.currentErrors;\r\n }\r\n get wrong() {\r\n return this.touched && this.invalid;\r\n }\r\n hasError(key) {\r\n return hasError(this.errors, key);\r\n }\r\n someErrors(keys) {\r\n return someErrors(this.errors, keys);\r\n }\r\n reset() {\r\n this.refresh(this.initialState);\r\n }\r\n disable() {\r\n this.currentDisabled = true;\r\n }\r\n enable() {\r\n this.currentDisabled = false;\r\n }\r\n push(group) {\r\n this.subscription(group);\r\n this.refresh([...this.groups, group]);\r\n }\r\n merge(groups) {\r\n groups.forEach((group) => {\r\n this.subscription(group);\r\n });\r\n this.refresh([...this.groups, ...groups]);\r\n }\r\n set(groups) {\r\n this.currentGroups.forEach(({ uuid }) => {\r\n this.unsusbcriptions.delete(uuid);\r\n });\r\n groups.forEach((group) => {\r\n this.subscription(group);\r\n });\r\n this.refresh(groups); // Update groups\r\n }\r\n remove({ uuid }) {\r\n this.refresh(this.groups.filter((group) => group.uuid !== uuid));\r\n }\r\n setValidators(validators) {\r\n this.validators = validators;\r\n this.updateValidityStatus(this.groups, validators);\r\n }\r\n subscribe(subscriber) {\r\n return this.observable.subscribe(subscriber);\r\n }\r\n subscription(group) {\r\n const unsusbcription = group.subscribe(() => {\r\n this.updateValidityStatus(this.groups, this.validators);\r\n });\r\n this.unsusbcriptions.set(group.uuid, unsusbcription);\r\n }\r\n updateValidityStatus(groups, validators) {\r\n if (validators) {\r\n const errors = arrayIsValid({ groups, validators });\r\n this.currentErrors = errors;\r\n this.currentError = errors[0];\r\n this.currentValid = errors.length === 0;\r\n }\r\n else {\r\n this.currentValid = true;\r\n this.currentErrors = [];\r\n this.currentError = undefined;\r\n }\r\n }\r\n refresh(newGroups) {\r\n const groups = newGroups || [];\r\n this.currentGroups = groups;\r\n this.updateValidityStatus(groups, this.validators);\r\n }\r\n}\r\nexport function formArray(options, validators) {\r\n return new FormArray(createFormArrayOptions(options, validators));\r\n}\r\n//# sourceMappingURL=form-array.js.map"],"names":["uuid"],"mappings":";;;AAAA,SAAS,kBAAkB,CAAC,OAAO,EAAE;AACrC,IAAI,QAAQ,OAAO,OAAO,KAAK,QAAQ;AACvC,SAAS,OAAO,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,EAAE;AACzD,CAAC;AACD,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,UAAU,IAAI,OAAO,CAAC;AAChE,CAAC;AACD,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,QAAQ,OAAO,OAAO,KAAK,QAAQ;AACvC,SAAS,QAAQ,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,EAAE;AAC1D,CAAC;AACM,SAAS,wBAAwB,CAAC,GAAG,cAAc,EAAE;AAC5D,IAAI,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,cAAc,CAAC;AACjD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAC9C,KAAK;AACL,IAAI,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE;AACpD,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,OAAO;AACtB,QAAQ,UAAU;AAClB,K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3D,KAAK;AACL,CAAC;AACM,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE;AAC/C,IAAI,OAAO,IAAI,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AACtE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../esm/arguments.js","../esm/helpers.js","../esm/form-control.js","../esm/form-array/form-array-control.js","../esm/form-group.js","../esm/form-array/form-array-group.js","../esm/form-array/form-array-list.js","../esm/form-array/form-array.js"],"sourcesContent":["function itIsControlOptions(options) {\n return (typeof options === 'object' &&\n ('value' in options || 'validators' in options));\n}\nfunction itIsGroupOptions(options) {\n return typeof options === 'object' && 'controls' in options;\n}\nfunction itIsArrayOptions(options) {\n return (typeof options === 'object' &&\n ('groups' in options || 'validators' in options));\n}\nexport function createFormControlOptions(...controlOptions) {\n const [options, validators] = controlOptions;\n if (!options) {\n return { value: options, validators };\n }\n if (!validators && itIsControlOptions(options)) {\n return options;\n }\n return {\n value: options,\n validators\n };\n}\nexport function createFormGroupOptions(...groupOptions) {\n const [options, validators] = groupOptions;\n if (!validators && itIsGroupOptions(options)) {\n return options;\n }\n return {\n controls: options,\n validators\n };\n}\nexport function createFormArrayOptions(...arrayOptions) {\n const [options, validators] = arrayOptions;\n if (!options) {\n return { groups: options, validators };\n }\n if (!validators && itIsArrayOptions(options)) {\n return options;\n }\n return {\n groups: options,\n validators\n };\n}\n//# sourceMappingURL=arguments.js.map","import { parseBoolean } from '@rolster/commons';\nfunction reduceErrors(errors) {\n return errors.reduce((keys, { id }) => [...keys, id], []);\n}\nexport const controlIsValid = ({ value, validators }) => {\n return validators.reduce((errors, validator) => {\n const error = validator(value);\n if (error) {\n errors.push(error);\n }\n return errors;\n }, []);\n};\nexport const controlsAllChecked = (controls, key) => {\n return Object.values(controls).reduce((value, control) => control.disabled ? value : value && parseBoolean(control[key]), true);\n};\nexport const controlsPartialChecked = (controls, key) => {\n return Object.values(controls).reduce((value, control) => control.disabled ? value : value || parseBoolean(control[key]), false);\n};\nexport const controlsToValue = (controls) => {\n return Object.entries(controls).reduce((result, [key, { value }]) => {\n result[key] = value;\n return result;\n }, {});\n};\nexport const groupIsValid = ({ controls, validators }) => {\n return validators.reduce((errors, validator) => {\n const error = validator(controls);\n if (error) {\n errors.push(error);\n }\n return errors;\n }, []);\n};\nexport function groupAllChecked(groups, key) {\n return groups.reduce((value, group) => value && parseBoolean(group[key]), true);\n}\nexport function groupPartialChecked(groups, key) {\n return groups.reduce((value, group) => value || parseBoolean(group[key]), false);\n}\nexport const arrayIsValid = ({ groups, validators }) => {\n return validators.reduce((errors, validator) => {\n const error = validator(groups);\n if (error) {\n errors.push(error);\n }\n return errors;\n }, []);\n};\nexport function hasError(errors, key) {\n return reduceErrors(errors).includes(key);\n}\nexport function someErrors(errors, keys) {\n return reduceErrors(errors).some((key) => keys.includes(key));\n}\n//# sourceMappingURL=helpers.js.map","import { observable } from '@rolster/commons';\nimport { createFormControlOptions } from './arguments';\nimport { controlIsValid, hasError, someErrors } from './helpers';\nexport class FormControl {\n constructor(controlOptions, controlValidators) {\n this.currentFocused = false;\n this.currentTouched = false;\n this.currentDirty = false;\n this.currentDisabled = false;\n this.currentValid = true;\n this.currentErrors = [];\n const { value, validators } = createFormControlOptions(controlOptions, controlValidators);\n this.observable = observable(value);\n this.initialValue = value;\n this.validators = validators;\n this.currentValue = value;\n this.updateValueAndValidity(value, validators);\n }\n get focused() {\n return this.currentFocused;\n }\n get unfocused() {\n return !this.currentFocused;\n }\n get touched() {\n return this.currentTouched;\n }\n get untouched() {\n return !this.currentTouched;\n }\n get dirty() {\n return this.currentDirty;\n }\n get pristine() {\n return !this.currentDirty;\n }\n get disabled() {\n return this.currentDisabled;\n }\n get enabled() {\n return !this.currentDisabled;\n }\n get valid() {\n return this.currentValid;\n }\n get invalid() {\n return !this.currentValid;\n }\n get value() {\n return this.currentValue;\n }\n get errors() {\n return this.currentErrors;\n }\n get error() {\n return this.currentError;\n }\n get wrong() {\n return this.touched && this.invalid;\n }\n hasError(key) {\n return hasError(this.errors, key);\n }\n someErrors(keys) {\n return someErrors(this.errors, keys);\n }\n reset() {\n this.setValue(this.initialValue);\n this.currentDirty = false;\n this.currentTouched = false;\n }\n focus() {\n this.currentFocused = true;\n }\n blur() {\n this.currentFocused = false;\n this.currentTouched = true;\n }\n disable() {\n this.currentDisabled = true;\n }\n enable() {\n this.currentDisabled = false;\n }\n touch() {\n this.currentTouched = true;\n }\n setValue(value) {\n if (this.enabled) {\n this.currentValue = value;\n this.currentDirty = true;\n this.updateValueAndValidity(value, this.validators);\n this.observable.next(value);\n }\n }\n setValidators(validators = []) {\n this.validators = validators;\n this.updateValueAndValidity(this.value, validators);\n }\n subscribe(subscriber) {\n return this.observable.subscribe(subscriber);\n }\n updateValueAndValidity(value, validators) {\n if (validators) {\n const errors = controlIsValid({ value, validators });\n this.currentError = errors[0];\n this.currentErrors = errors;\n this.currentValid = errors.length === 0;\n }\n else {\n this.currentValid = true;\n this.currentError = undefined;\n this.currentErrors = [];\n }\n }\n}\nexport function formControl(options, validators) {\n return new FormControl(createFormControlOptions(options, validators));\n}\n//# sourceMappingURL=form-control.js.map","import { v4 as uuid } from 'uuid';\nimport { createFormControlOptions } from '../arguments';\nimport { FormControl } from '../form-control';\nexport class FormArrayControl extends FormControl {\n constructor(controlOptions, controlValidators) {\n const { value, validators } = createFormControlOptions(controlOptions, controlValidators);\n super(value, validators);\n this.uuid = uuid();\n }\n}\nexport function formArrayControl(options, validators) {\n return new FormArrayControl(createFormControlOptions(options, validators));\n}\n//# sourceMappingURL=form-array-control.js.map","import { observable } from '@rolster/commons';\nimport { createFormGroupOptions } from './arguments';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue, groupIsValid } from './helpers';\nexport class FormGroup {\n constructor(groupOptions, groupValidators) {\n this.currentErrors = [];\n this.currentValid = true;\n const { controls, validators } = createFormGroupOptions(groupOptions, groupValidators);\n this.currentControls = controls;\n this.validators = validators;\n this.updateValueAndValidity(controls, validators);\n this.observable = observable(this.value);\n Object.values(controls).forEach((control) => {\n control.subscribe(() => {\n this.updateValueAndValidity(this.controls, this.validators);\n this.observable.next(this.value);\n });\n });\n }\n get controls() {\n return this.currentControls;\n }\n get touched() {\n return controlsPartialChecked(this.controls, 'touched');\n }\n get touchedAll() {\n return controlsAllChecked(this.controls, 'touched');\n }\n get untouched() {\n return !this.touched;\n }\n get untouchedAll() {\n return !this.touchedAll;\n }\n get dirty() {\n return controlsPartialChecked(this.controls, 'dirty');\n }\n get dirtyAll() {\n return controlsAllChecked(this.controls, 'dirty');\n }\n get pristine() {\n return !this.dirty;\n }\n get pristineAll() {\n return this.dirtyAll;\n }\n get valid() {\n return this.currentValid && controlsAllChecked(this.controls, 'valid');\n }\n get invalid() {\n return !this.valid;\n }\n get value() {\n return controlsToValue(this.controls);\n }\n get errors() {\n return this.currentErrors;\n }\n get error() {\n return this.currentError;\n }\n get wrong() {\n return this.touched && this.invalid;\n }\n reset() {\n Object.values(this.controls).forEach((control) => {\n control.reset();\n });\n }\n setValidators(validators) {\n this.validators = validators;\n this.updateValueAndValidity(this.controls, validators);\n }\n subscribe(subscriber) {\n return this.observable.subscribe(subscriber);\n }\n updateValueAndValidity(controls, validators) {\n if (validators) {\n const errors = groupIsValid({ controls, validators });\n this.currentErrors = errors;\n this.currentError = errors[0];\n this.currentValid = errors.length === 0;\n }\n else {\n this.currentErrors = [];\n this.currentError = undefined;\n this.currentValid = true;\n }\n }\n}\nexport function formGroup(options, validators) {\n return new FormGroup(createFormGroupOptions(options, validators));\n}\n//# sourceMappingURL=form-group.js.map","import { v4 as uuid } from 'uuid';\nimport { createFormGroupOptions } from '../arguments';\nimport { FormGroup } from '../form-group';\nexport class FormArrayGroup extends FormGroup {\n constructor(groupOptions, groupValidators) {\n const { controls, resource, validators } = createFormGroupOptions(groupOptions, groupValidators);\n super(controls, validators);\n this.uuid = uuid();\n this.resource = resource;\n }\n}\nexport function formArrayGroup(options, validators) {\n return new FormArrayGroup(createFormGroupOptions(options, validators));\n}\n//# sourceMappingURL=form-array-group.js.map","import { v4 as uuid } from 'uuid';\nimport { FormControl } from '../form-control';\nimport { controlsAllChecked, controlsPartialChecked, controlsToValue } from '../helpers';\nexport class FormArrayList extends FormControl {\n constructor(valueToControls, value, validators) {\n const initialValue = value || [];\n super(initialValue, validators);\n this.valueToControls = valueToControls;\n this.currentControls = initialValue.map((value) => this.createControls(value));\n this.uuid = uuid();\n }\n get controls() {\n return this.currentControls;\n }\n get touched() {\n return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'touched'), true);\n }\n get dirty() {\n return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'dirty'), true);\n }\n get valid() {\n return (this.currentValid &&\n this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true));\n }\n get value() {\n return this.controls.map((controls) => controlsToValue(controls));\n }\n setValue(values) {\n this.currentControls = values.map((value) => this.createControls(value));\n }\n push(controls) {\n this.currentControls = this.currentControls.concat([controls]);\n }\n remove(controls) {\n this.currentControls = this.currentControls.filter((currentControls) => currentControls !== controls);\n }\n createControls(value) {\n const controls = this.valueToControls(value);\n Object.values(controls).forEach((control) => {\n control.subscribe(() => {\n const { value, validators } = this;\n this.updateValueAndValidity(value, validators);\n this.observable.next(value);\n });\n });\n return controls;\n }\n}\nexport function formArrayList(valueToControl, value, validators) {\n return new FormArrayList(valueToControl, value, validators);\n}\n//# sourceMappingURL=form-array-list.js.map","import { observable } from '@rolster/commons';\nimport { createFormArrayOptions } from '../arguments';\nimport { arrayIsValid, groupAllChecked, groupPartialChecked, hasError, someErrors } from '../helpers';\nexport class FormArray {\n constructor(arrayOptions, arrayValidators) {\n this.currentGroups = [];\n this.currentValid = true;\n this.currentDisabled = false;\n this.currentErrors = [];\n const { groups, validators } = createFormArrayOptions(arrayOptions, arrayValidators);\n this.unsusbcriptions = new Map();\n this.initialState = groups;\n this.validators = validators;\n this.refresh(this.initialState);\n this.observable = observable(this.value);\n groups?.forEach((group) => {\n this.subscription(group);\n });\n }\n get groups() {\n return this.currentGroups;\n }\n get controls() {\n return this.groups.map(({ controls }) => controls);\n }\n get touched() {\n return groupPartialChecked(this.groups, 'touched');\n }\n get touchedAll() {\n return groupAllChecked(this.groups, 'touchedAll');\n }\n get untouched() {\n return !this.touched;\n }\n get untouchedAll() {\n return !this.touchedAll;\n }\n get dirty() {\n return groupPartialChecked(this.groups, 'dirty');\n }\n get dirtyAll() {\n return groupAllChecked(this.groups, 'dirtyAll');\n }\n get pristine() {\n return !this.dirty;\n }\n get pristineAll() {\n return !this.dirtyAll;\n }\n get disabled() {\n return this.currentDisabled;\n }\n get enabled() {\n return !this.currentDisabled;\n }\n get valid() {\n return this.currentValid && groupAllChecked(this.groups, 'valid');\n }\n get invalid() {\n return !this.currentValid;\n }\n get value() {\n return this.groups.map(({ value: state }) => state);\n }\n get error() {\n return this.currentError;\n }\n get errors() {\n return this.currentErrors;\n }\n get wrong() {\n return this.touched && this.invalid;\n }\n hasError(key) {\n return hasError(this.errors, key);\n }\n someErrors(keys) {\n return someErrors(this.errors, keys);\n }\n reset() {\n this.refresh(this.initialState);\n }\n disable() {\n this.currentDisabled = true;\n }\n enable() {\n this.currentDisabled = false;\n }\n push(group) {\n this.subscription(group);\n this.refresh([...this.groups, group]);\n }\n merge(groups) {\n groups.forEach((group) => {\n this.subscription(group);\n });\n this.refresh([...this.groups, ...groups]);\n }\n set(groups) {\n this.currentGroups.forEach(({ uuid }) => {\n this.unsusbcriptions.delete(uuid);\n });\n groups.forEach((group) => {\n this.subscription(group);\n });\n this.refresh(groups); // Update groups\n }\n remove({ uuid }) {\n this.refresh(this.groups.filter((group) => group.uuid !== uuid));\n }\n setValidators(validators) {\n this.validators = validators;\n this.updateValidityStatus(this.groups, validators);\n }\n subscribe(subscriber) {\n return this.observable.subscribe(subscriber);\n }\n subscription(group) {\n const unsusbcription = group.subscribe(() => {\n this.updateValidityStatus(this.groups, this.validators);\n });\n this.unsusbcriptions.set(group.uuid, unsusbcription);\n }\n updateValidityStatus(groups, validators) {\n if (validators) {\n const errors = arrayIsValid({ groups, validators });\n this.currentErrors = errors;\n this.currentError = errors[0];\n this.currentValid = errors.length === 0;\n }\n else {\n this.currentValid = true;\n this.currentErrors = [];\n this.currentError = undefined;\n }\n }\n refresh(newGroups) {\n const groups = newGroups || [];\n this.currentGroups = groups;\n this.updateValidityStatus(groups, this.validators);\n }\n}\nexport function formArray(options, validators) {\n return new FormArray(createFormArrayOptions(options, validators));\n}\n//# sourceMappingURL=form-array.js.map"],"names":["uuid"],"mappings":";;;AAAA,SAAS,kBAAkB,CAAC,OAAO,EAAE;AACrC,IAAI,QAAQ,OAAO,OAAO,KAAK,QAAQ;AACvC,SAAS,OAAO,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,EAAE;AACzD,CAAC;AACD,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,UAAU,IAAI,OAAO,CAAC;AAChE,CAAC;AACD,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,QAAQ,OAAO,OAAO,KAAK,QAAQ;AACvC,SAAS,QAAQ,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,EAAE;AAC1D,CAAC;AACM,SAAS,wBAAwB,CAAC,GAAG,cAAc,EAAE;AAC5D,IAAI,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,cAAc,CAAC;AACjD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAC9C,KAAK;AACL,IAAI,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE;AACpD,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,OAAO;AACtB,QAAQ,UAAU;AAClB,KAAK,CA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K;AACL,CAAC;AACM,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE;AAC/C,IAAI,OAAO,IAAI,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AACtE;;;;"}
|
package/dist/esm/arguments.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { AbstractArrayControls, AbstractArrayGroup, AbstractControls, FormArrayOptions, FormControlOptions, FormGroupOptions, ValidatorArrayFn, ValidatorGroupFn } from './types';
|
|
3
|
-
type ArgsControlOptions<T = any> = [
|
|
4
|
-
FormControlOptions<T> | T | undefined,
|
|
5
|
-
Undefined<ValidatorFn<T>[]>
|
|
6
|
-
];
|
|
7
|
-
type ArgsGroupOptions<C extends AbstractControls> = [
|
|
8
|
-
FormGroupOptions<C> | C,
|
|
9
|
-
Undefined<ValidatorGroupFn<C>[]>
|
|
10
|
-
];
|
|
11
|
-
type ArgsArrayOptions<C extends AbstractArrayControls, R, G extends AbstractArrayGroup<C, R>> = [
|
|
12
|
-
Undefined<FormArrayOptions<C, R, G> | AbstractArrayGroup<C, R>[]>,
|
|
13
|
-
Undefined<ValidatorArrayFn<C, R, G>[]>
|
|
14
|
-
];
|
|
15
|
-
export declare function createFormControlOptions<T, O extends FormControlOptions<T>>(...controlOptions: ArgsControlOptions<T>): O;
|
|
16
|
-
export declare function createFormGroupOptions<C extends AbstractControls, O extends FormGroupOptions<C>>(...groupOptions: ArgsGroupOptions<C>): O;
|
|
17
|
-
export declare function createFormArrayOptions<C extends AbstractArrayControls, R, G extends AbstractArrayGroup<C, R>, O extends FormArrayOptions<C, R, G>>(...arrayOptions: ArgsArrayOptions<C, R, G>): O;
|
|
18
|
-
export {};
|
|
1
|
+
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
+
import { AbstractArrayControls, AbstractArrayGroup, AbstractControls, FormArrayOptions, FormControlOptions, FormGroupOptions, ValidatorArrayFn, ValidatorGroupFn } from './types';
|
|
3
|
+
type ArgsControlOptions<T = any> = [
|
|
4
|
+
FormControlOptions<T> | T | undefined,
|
|
5
|
+
Undefined<ValidatorFn<T>[]>
|
|
6
|
+
];
|
|
7
|
+
type ArgsGroupOptions<C extends AbstractControls> = [
|
|
8
|
+
FormGroupOptions<C> | C,
|
|
9
|
+
Undefined<ValidatorGroupFn<C>[]>
|
|
10
|
+
];
|
|
11
|
+
type ArgsArrayOptions<C extends AbstractArrayControls, R, G extends AbstractArrayGroup<C, R>> = [
|
|
12
|
+
Undefined<FormArrayOptions<C, R, G> | AbstractArrayGroup<C, R>[]>,
|
|
13
|
+
Undefined<ValidatorArrayFn<C, R, G>[]>
|
|
14
|
+
];
|
|
15
|
+
export declare function createFormControlOptions<T, O extends FormControlOptions<T>>(...controlOptions: ArgsControlOptions<T>): O;
|
|
16
|
+
export declare function createFormGroupOptions<C extends AbstractControls, O extends FormGroupOptions<C>>(...groupOptions: ArgsGroupOptions<C>): O;
|
|
17
|
+
export declare function createFormArrayOptions<C extends AbstractArrayControls, R, G extends AbstractArrayGroup<C, R>, O extends FormArrayOptions<C, R, G>>(...arrayOptions: ArgsArrayOptions<C, R, G>): O;
|
|
18
|
+
export {};
|
package/dist/esm/arguments.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
function itIsControlOptions(options) {
|
|
2
|
-
return (typeof options === 'object' &&
|
|
3
|
-
('value' in options || 'validators' in options));
|
|
4
|
-
}
|
|
5
|
-
function itIsGroupOptions(options) {
|
|
6
|
-
return typeof options === 'object' && 'controls' in options;
|
|
7
|
-
}
|
|
8
|
-
function itIsArrayOptions(options) {
|
|
9
|
-
return (typeof options === 'object' &&
|
|
10
|
-
('groups' in options || 'validators' in options));
|
|
11
|
-
}
|
|
12
|
-
export function createFormControlOptions(...controlOptions) {
|
|
13
|
-
const [options, validators] = controlOptions;
|
|
14
|
-
if (!options) {
|
|
15
|
-
return { value: options, validators };
|
|
16
|
-
}
|
|
17
|
-
if (!validators && itIsControlOptions(options)) {
|
|
18
|
-
return options;
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
value: options,
|
|
22
|
-
validators
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export function createFormGroupOptions(...groupOptions) {
|
|
26
|
-
const [options, validators] = groupOptions;
|
|
27
|
-
if (!validators && itIsGroupOptions(options)) {
|
|
28
|
-
return options;
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
controls: options,
|
|
32
|
-
validators
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export function createFormArrayOptions(...arrayOptions) {
|
|
36
|
-
const [options, validators] = arrayOptions;
|
|
37
|
-
if (!options) {
|
|
38
|
-
return { groups: options, validators };
|
|
39
|
-
}
|
|
40
|
-
if (!validators && itIsArrayOptions(options)) {
|
|
41
|
-
return options;
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
groups: options,
|
|
45
|
-
validators
|
|
46
|
-
};
|
|
47
|
-
}
|
|
1
|
+
function itIsControlOptions(options) {
|
|
2
|
+
return (typeof options === 'object' &&
|
|
3
|
+
('value' in options || 'validators' in options));
|
|
4
|
+
}
|
|
5
|
+
function itIsGroupOptions(options) {
|
|
6
|
+
return typeof options === 'object' && 'controls' in options;
|
|
7
|
+
}
|
|
8
|
+
function itIsArrayOptions(options) {
|
|
9
|
+
return (typeof options === 'object' &&
|
|
10
|
+
('groups' in options || 'validators' in options));
|
|
11
|
+
}
|
|
12
|
+
export function createFormControlOptions(...controlOptions) {
|
|
13
|
+
const [options, validators] = controlOptions;
|
|
14
|
+
if (!options) {
|
|
15
|
+
return { value: options, validators };
|
|
16
|
+
}
|
|
17
|
+
if (!validators && itIsControlOptions(options)) {
|
|
18
|
+
return options;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
value: options,
|
|
22
|
+
validators
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function createFormGroupOptions(...groupOptions) {
|
|
26
|
+
const [options, validators] = groupOptions;
|
|
27
|
+
if (!validators && itIsGroupOptions(options)) {
|
|
28
|
+
return options;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
controls: options,
|
|
32
|
+
validators
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function createFormArrayOptions(...arrayOptions) {
|
|
36
|
+
const [options, validators] = arrayOptions;
|
|
37
|
+
if (!options) {
|
|
38
|
+
return { groups: options, validators };
|
|
39
|
+
}
|
|
40
|
+
if (!validators && itIsArrayOptions(options)) {
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
groups: options,
|
|
45
|
+
validators
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
48
|
//# sourceMappingURL=arguments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arguments.js","sourceRoot":"","sources":["../../src/arguments.ts"],"names":[],"mappings":"AA+BA,SAAS,kBAAkB,CACzB,OAAY;IAEZ,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,CAAC,OAAO,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAGvB,OAAY;IACZ,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,UAAU,IAAI,OAAO,CAAC;AAC9D,CAAC;AAED,SAAS,gBAAgB,CAKvB,OAAY;IACZ,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,CAAC,QAAQ,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,CACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,GAAG,cAAqC;IAExC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,cAAc,CAAC;IAE7C,IAAI,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"arguments.js","sourceRoot":"","sources":["../../src/arguments.ts"],"names":[],"mapp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OAAO,EAAE,CAAC;QACb,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAO,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,UAAU,IAAI,gBAAgB,CAAa,OAAO,CAAC,EAAE,CAAC;QACzD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO;QACL,MAAM,EAAE,OAAqC;QAC7C,UAAU;KACN,CAAC;AACT,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { FormControlOptions } from '../types';
|
|
3
|
-
export type ArgsListOptions<T = any> = [
|
|
4
|
-
FormControlOptions<T> | T | undefined,
|
|
5
|
-
Undefined<ValidatorFn<T>[]>
|
|
6
|
-
];
|
|
1
|
+
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
+
import { FormControlOptions } from '../types';
|
|
3
|
+
export type ArgsListOptions<T = any> = [
|
|
4
|
+
FormControlOptions<T> | T | undefined,
|
|
5
|
+
Undefined<ValidatorFn<T>[]>
|
|
6
|
+
];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=arguments.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { FormControl } from '../form-control';
|
|
3
|
-
import { AbstractArrayControl, FormArrayControlOptions } from '../types';
|
|
4
|
-
type ArrayControlOptions<T> = Omit<FormArrayControlOptions<T>, 'uuid'>;
|
|
5
|
-
export declare class FormArrayControl<T = any> extends FormControl<T> implements AbstractArrayControl<T> {
|
|
6
|
-
readonly uuid: string;
|
|
7
|
-
constructor();
|
|
8
|
-
constructor(options: ArrayControlOptions<T>);
|
|
9
|
-
constructor(value: T, validators?: ValidatorFn<T>[]);
|
|
10
|
-
}
|
|
11
|
-
export type FormArrayVoid<T = any> = FormArrayControl<T | undefined>;
|
|
12
|
-
type ArrayValueOptions<T> = Omit<ArrayControlOptions<T>, 'validators'>;
|
|
13
|
-
type ArrayValidatorsOptions<T> = Omit<ArrayControlOptions<T>, 'value'>;
|
|
14
|
-
export declare function formArrayControl<T>(): FormArrayControl<T | undefined>;
|
|
15
|
-
export declare function formArrayControl<T>(options: ArrayValueOptions<T>): FormArrayControl<T>;
|
|
16
|
-
export declare function formArrayControl<T>(options: ArrayValidatorsOptions<T>): FormArrayControl<T | undefined>;
|
|
17
|
-
export declare function formArrayControl<T>(options: FormArrayControlOptions<T>): FormArrayControl<T>;
|
|
18
|
-
export declare function formArrayControl<T>(value: undefined, validators?: ValidatorFn<T>[]): FormArrayControl<T | undefined>;
|
|
19
|
-
export declare function formArrayControl<T>(value: T, validators?: ValidatorFn<T>[]): FormArrayControl<T>;
|
|
20
|
-
export {};
|
|
1
|
+
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
+
import { FormControl } from '../form-control';
|
|
3
|
+
import { AbstractArrayControl, FormArrayControlOptions } from '../types';
|
|
4
|
+
type ArrayControlOptions<T> = Omit<FormArrayControlOptions<T>, 'uuid'>;
|
|
5
|
+
export declare class FormArrayControl<T = any> extends FormControl<T> implements AbstractArrayControl<T> {
|
|
6
|
+
readonly uuid: string;
|
|
7
|
+
constructor();
|
|
8
|
+
constructor(options: ArrayControlOptions<T>);
|
|
9
|
+
constructor(value: T, validators?: ValidatorFn<T>[]);
|
|
10
|
+
}
|
|
11
|
+
export type FormArrayVoid<T = any> = FormArrayControl<T | undefined>;
|
|
12
|
+
type ArrayValueOptions<T> = Omit<ArrayControlOptions<T>, 'validators'>;
|
|
13
|
+
type ArrayValidatorsOptions<T> = Omit<ArrayControlOptions<T>, 'value'>;
|
|
14
|
+
export declare function formArrayControl<T>(): FormArrayControl<T | undefined>;
|
|
15
|
+
export declare function formArrayControl<T>(options: ArrayValueOptions<T>): FormArrayControl<T>;
|
|
16
|
+
export declare function formArrayControl<T>(options: ArrayValidatorsOptions<T>): FormArrayControl<T | undefined>;
|
|
17
|
+
export declare function formArrayControl<T>(options: FormArrayControlOptions<T>): FormArrayControl<T>;
|
|
18
|
+
export declare function formArrayControl<T>(value: undefined, validators?: ValidatorFn<T>[]): FormArrayControl<T | undefined>;
|
|
19
|
+
export declare function formArrayControl<T>(value: T, validators?: ValidatorFn<T>[]): FormArrayControl<T>;
|
|
20
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { v4 as uuid } from 'uuid';
|
|
2
|
-
import { createFormControlOptions } from '../arguments';
|
|
3
|
-
import { FormControl } from '../form-control';
|
|
4
|
-
export class FormArrayControl extends FormControl {
|
|
5
|
-
constructor(controlOptions, controlValidators) {
|
|
6
|
-
const { value, validators } = createFormControlOptions(controlOptions, controlValidators);
|
|
7
|
-
super(value, validators);
|
|
8
|
-
this.uuid = uuid();
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export function formArrayControl(options, validators) {
|
|
12
|
-
return new FormArrayControl(createFormControlOptions(options, validators));
|
|
13
|
-
}
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import { createFormControlOptions } from '../arguments';
|
|
3
|
+
import { FormControl } from '../form-control';
|
|
4
|
+
export class FormArrayControl extends FormControl {
|
|
5
|
+
constructor(controlOptions, controlValidators) {
|
|
6
|
+
const { value, validators } = createFormControlOptions(controlOptions, controlValidators);
|
|
7
|
+
super(value, validators);
|
|
8
|
+
this.uuid = uuid();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function formArrayControl(options, validators) {
|
|
12
|
+
return new FormArrayControl(createFormControlOptions(options, validators));
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=form-array-control.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FormGroup } from '../form-group';
|
|
2
|
-
import { AbstractReactiveArrayGroup, FormArrayGroupOptions, ValidatorGroupFn } from '../types';
|
|
3
|
-
import { FormArrayControls } from './types';
|
|
4
|
-
type ArrayGroupOptions<T extends FormArrayControls> = Omit<FormArrayGroupOptions<T>, 'uuid'>;
|
|
5
|
-
export declare class FormArrayGroup<C extends FormArrayControls = FormArrayControls, R = any> extends FormGroup<C> implements AbstractReactiveArrayGroup<C> {
|
|
6
|
-
readonly uuid: string;
|
|
7
|
-
readonly resource?: R;
|
|
8
|
-
constructor(options: ArrayGroupOptions<C>);
|
|
9
|
-
constructor(controls: C, validators?: ValidatorGroupFn<C>[]);
|
|
10
|
-
}
|
|
11
|
-
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(options: ArrayGroupOptions<C>): FormArrayGroup<C>;
|
|
12
|
-
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(controls: C, validators?: ValidatorGroupFn<C>[]): FormArrayGroup<C>;
|
|
13
|
-
export {};
|
|
1
|
+
import { FormGroup } from '../form-group';
|
|
2
|
+
import { AbstractReactiveArrayGroup, FormArrayGroupOptions, ValidatorGroupFn } from '../types';
|
|
3
|
+
import { FormArrayControls } from './types';
|
|
4
|
+
type ArrayGroupOptions<T extends FormArrayControls> = Omit<FormArrayGroupOptions<T>, 'uuid'>;
|
|
5
|
+
export declare class FormArrayGroup<C extends FormArrayControls = FormArrayControls, R = any> extends FormGroup<C> implements AbstractReactiveArrayGroup<C> {
|
|
6
|
+
readonly uuid: string;
|
|
7
|
+
readonly resource?: R;
|
|
8
|
+
constructor(options: ArrayGroupOptions<C>);
|
|
9
|
+
constructor(controls: C, validators?: ValidatorGroupFn<C>[]);
|
|
10
|
+
}
|
|
11
|
+
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(options: ArrayGroupOptions<C>): FormArrayGroup<C>;
|
|
12
|
+
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(controls: C, validators?: ValidatorGroupFn<C>[]): FormArrayGroup<C>;
|
|
13
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { v4 as uuid } from 'uuid';
|
|
2
|
-
import { createFormGroupOptions } from '../arguments';
|
|
3
|
-
import { FormGroup } from '../form-group';
|
|
4
|
-
export class FormArrayGroup extends FormGroup {
|
|
5
|
-
constructor(groupOptions, groupValidators) {
|
|
6
|
-
const { controls, resource, validators } = createFormGroupOptions(groupOptions, groupValidators);
|
|
7
|
-
super(controls, validators);
|
|
8
|
-
this.uuid = uuid();
|
|
9
|
-
this.resource = resource;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export function formArrayGroup(options, validators) {
|
|
13
|
-
return new FormArrayGroup(createFormGroupOptions(options, validators));
|
|
14
|
-
}
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import { createFormGroupOptions } from '../arguments';
|
|
3
|
+
import { FormGroup } from '../form-group';
|
|
4
|
+
export class FormArrayGroup extends FormGroup {
|
|
5
|
+
constructor(groupOptions, groupValidators) {
|
|
6
|
+
const { controls, resource, validators } = createFormGroupOptions(groupOptions, groupValidators);
|
|
7
|
+
super(controls, validators);
|
|
8
|
+
this.uuid = uuid();
|
|
9
|
+
this.resource = resource;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function formArrayGroup(options, validators) {
|
|
13
|
+
return new FormArrayGroup(createFormGroupOptions(options, validators));
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=form-array-group.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { FormControl } from '../form-control';
|
|
3
|
-
import { AbstractArrayList, ArrayControlsValue, ArrayListValueToControls } from '../types';
|
|
4
|
-
import { FormArrayControls } from './types';
|
|
5
|
-
export declare class FormArrayList<C extends FormArrayControls = FormArrayControls> extends FormControl<ArrayControlsValue<C>[]> implements AbstractArrayList<C> {
|
|
6
|
-
private valueToControls;
|
|
7
|
-
readonly uuid: string;
|
|
8
|
-
private currentControls;
|
|
9
|
-
constructor(valueToControls: ArrayListValueToControls<C>, value?: ArrayControlsValue<C>[], validators?: ValidatorFn<ArrayControlsValue<C>[]>[]);
|
|
10
|
-
get controls(): C[];
|
|
11
|
-
get touched(): boolean;
|
|
12
|
-
get dirty(): boolean;
|
|
13
|
-
get valid(): boolean;
|
|
14
|
-
get value(): ArrayControlsValue<C>[];
|
|
15
|
-
setValue(values: ArrayControlsValue<C>[]): void;
|
|
16
|
-
push(controls: C): void;
|
|
17
|
-
remove(controls: C): void;
|
|
18
|
-
private createControls;
|
|
19
|
-
}
|
|
20
|
-
export declare function formArrayList<C extends FormArrayControls = FormArrayControls>(valueToControl: ArrayListValueToControls<C>, value?: ArrayControlsValue<C>[], validators?: ValidatorFn<ArrayControlsValue<C>[]>[]): FormArrayList<C>;
|
|
1
|
+
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
+
import { FormControl } from '../form-control';
|
|
3
|
+
import { AbstractArrayList, ArrayControlsValue, ArrayListValueToControls } from '../types';
|
|
4
|
+
import { FormArrayControls } from './types';
|
|
5
|
+
export declare class FormArrayList<C extends FormArrayControls = FormArrayControls> extends FormControl<ArrayControlsValue<C>[]> implements AbstractArrayList<C> {
|
|
6
|
+
private valueToControls;
|
|
7
|
+
readonly uuid: string;
|
|
8
|
+
private currentControls;
|
|
9
|
+
constructor(valueToControls: ArrayListValueToControls<C>, value?: ArrayControlsValue<C>[], validators?: ValidatorFn<ArrayControlsValue<C>[]>[]);
|
|
10
|
+
get controls(): C[];
|
|
11
|
+
get touched(): boolean;
|
|
12
|
+
get dirty(): boolean;
|
|
13
|
+
get valid(): boolean;
|
|
14
|
+
get value(): ArrayControlsValue<C>[];
|
|
15
|
+
setValue(values: ArrayControlsValue<C>[]): void;
|
|
16
|
+
push(controls: C): void;
|
|
17
|
+
remove(controls: C): void;
|
|
18
|
+
private createControls;
|
|
19
|
+
}
|
|
20
|
+
export declare function formArrayList<C extends FormArrayControls = FormArrayControls>(valueToControl: ArrayListValueToControls<C>, value?: ArrayControlsValue<C>[], validators?: ValidatorFn<ArrayControlsValue<C>[]>[]): FormArrayList<C>;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { v4 as uuid } from 'uuid';
|
|
2
|
-
import { FormControl } from '../form-control';
|
|
3
|
-
import { controlsAllChecked, controlsPartialChecked, controlsToValue } from '../helpers';
|
|
4
|
-
export class FormArrayList extends FormControl {
|
|
5
|
-
constructor(valueToControls, value, validators) {
|
|
6
|
-
const initialValue = value || [];
|
|
7
|
-
super(initialValue, validators);
|
|
8
|
-
this.valueToControls = valueToControls;
|
|
9
|
-
this.currentControls = initialValue.map((value) => this.createControls(value));
|
|
10
|
-
this.uuid = uuid();
|
|
11
|
-
}
|
|
12
|
-
get controls() {
|
|
13
|
-
return this.currentControls;
|
|
14
|
-
}
|
|
15
|
-
get touched() {
|
|
16
|
-
return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'touched'), true);
|
|
17
|
-
}
|
|
18
|
-
get dirty() {
|
|
19
|
-
return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'dirty'), true);
|
|
20
|
-
}
|
|
21
|
-
get valid() {
|
|
22
|
-
return (this.currentValid &&
|
|
23
|
-
this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true));
|
|
24
|
-
}
|
|
25
|
-
get value() {
|
|
26
|
-
return this.controls.map((controls) => controlsToValue(controls));
|
|
27
|
-
}
|
|
28
|
-
setValue(values) {
|
|
29
|
-
this.currentControls = values.map((value) => this.createControls(value));
|
|
30
|
-
}
|
|
31
|
-
push(controls) {
|
|
32
|
-
this.currentControls = this.currentControls.concat([controls]);
|
|
33
|
-
}
|
|
34
|
-
remove(controls) {
|
|
35
|
-
this.currentControls = this.currentControls.filter((currentControls) => currentControls !== controls);
|
|
36
|
-
}
|
|
37
|
-
createControls(value) {
|
|
38
|
-
const controls = this.valueToControls(value);
|
|
39
|
-
Object.values(controls).forEach((control) => {
|
|
40
|
-
control.subscribe(() => {
|
|
41
|
-
const { value, validators } = this;
|
|
42
|
-
this.updateValueAndValidity(value, validators);
|
|
43
|
-
this.observable.next(value);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
return controls;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export function formArrayList(valueToControl, value, validators) {
|
|
50
|
-
return new FormArrayList(valueToControl, value, validators);
|
|
51
|
-
}
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
|
+
import { FormControl } from '../form-control';
|
|
3
|
+
import { controlsAllChecked, controlsPartialChecked, controlsToValue } from '../helpers';
|
|
4
|
+
export class FormArrayList extends FormControl {
|
|
5
|
+
constructor(valueToControls, value, validators) {
|
|
6
|
+
const initialValue = value || [];
|
|
7
|
+
super(initialValue, validators);
|
|
8
|
+
this.valueToControls = valueToControls;
|
|
9
|
+
this.currentControls = initialValue.map((value) => this.createControls(value));
|
|
10
|
+
this.uuid = uuid();
|
|
11
|
+
}
|
|
12
|
+
get controls() {
|
|
13
|
+
return this.currentControls;
|
|
14
|
+
}
|
|
15
|
+
get touched() {
|
|
16
|
+
return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'touched'), true);
|
|
17
|
+
}
|
|
18
|
+
get dirty() {
|
|
19
|
+
return this.controls.reduce((valid, controls) => valid && controlsPartialChecked(controls, 'dirty'), true);
|
|
20
|
+
}
|
|
21
|
+
get valid() {
|
|
22
|
+
return (this.currentValid &&
|
|
23
|
+
this.controls.reduce((valid, controls) => valid && controlsAllChecked(controls, 'valid'), true));
|
|
24
|
+
}
|
|
25
|
+
get value() {
|
|
26
|
+
return this.controls.map((controls) => controlsToValue(controls));
|
|
27
|
+
}
|
|
28
|
+
setValue(values) {
|
|
29
|
+
this.currentControls = values.map((value) => this.createControls(value));
|
|
30
|
+
}
|
|
31
|
+
push(controls) {
|
|
32
|
+
this.currentControls = this.currentControls.concat([controls]);
|
|
33
|
+
}
|
|
34
|
+
remove(controls) {
|
|
35
|
+
this.currentControls = this.currentControls.filter((currentControls) => currentControls !== controls);
|
|
36
|
+
}
|
|
37
|
+
createControls(value) {
|
|
38
|
+
const controls = this.valueToControls(value);
|
|
39
|
+
Object.values(controls).forEach((control) => {
|
|
40
|
+
control.subscribe(() => {
|
|
41
|
+
const { value, validators } = this;
|
|
42
|
+
this.updateValueAndValidity(value, validators);
|
|
43
|
+
this.observable.next(value);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
return controls;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function formArrayList(valueToControl, value, validators) {
|
|
50
|
+
return new FormArrayList(valueToControl, value, validators);
|
|
51
|
+
}
|
|
52
52
|
//# sourceMappingURL=form-array-list.js.map
|