ngx-forms-typed
Version:
Angular Forms Typed provides types and helper functions fully compatible with original Angular forms
1 lines • 20 kB
Source Map (JSON)
{"version":3,"file":"ngx-forms-typed.mjs","sources":["../../../projects/forms/src/lib/forms-typed.ts","../../../projects/forms/src/lib/forms-util.ts","../../../projects/forms/src/lib/control-value-accessor-connector.ts","../../../projects/forms/src/public-api.ts","../../../projects/forms/src/ngx-forms-typed.ts"],"sourcesContent":["import {\r\n AbstractControl,\r\n AbstractControlOptions,\r\n AsyncValidatorFn,\r\n UntypedFormArray,\r\n UntypedFormControl,\r\n UntypedFormGroup,\r\n ValidatorFn,\r\n} from '@angular/forms';\r\nimport { Observable } from 'rxjs';\r\n\r\n/**\r\n * Type encapsulating the Angular Form options:\r\n * `emitEvent` - do we emit event;\r\n * `onlySelf` - do we bubble up to parent\r\n * `emitModelToViewChange` - When true or not supplied (the default), each change triggers an onChange event to update the view.\r\n * `emitViewToModelChange` - When true or not supplied (the default), each change triggers an ngModelChange event to update the model.\r\n */\r\nexport interface FormEventOptions {\r\n emitEvent?: boolean;\r\n onlySelf?: boolean;\r\n emitModelToViewChange?: boolean;\r\n emitViewToModelChange?: boolean;\r\n}\r\n\r\n/**\r\n * A type wrapper around the reset value. It could be partial of the type of the form. Or even describe which form fields are to be disabled\r\n */\r\nexport type ResetValue<K> = Partial<{ [key in keyof K]: K[key] | { value: K[key]; disabled: boolean } }>;\r\n\r\n/**\r\n * Typed form control is an `AbstractControl` with strong typed properties and methods. Can be created using `typedFormControl` function\r\n *\r\n * @example\r\n * const c = typedFormControl<string>(): TypedFormControl<string>;\r\n * c.valueChanges // Observable<string>\r\n * c.patchValue('s') // expects string\r\n * c.patchValue(1) // COMPILE TIME! type error!\r\n */\r\nexport interface TypedFormControl<K> extends UntypedFormControl, AbstractControl {\r\n valueChanges: Observable<K>;\r\n statusChanges: Observable<'VALID' | 'INVALID' | 'PENDING' | 'DISABLED'>;\r\n patchValue: (v: Partial<K>, options?: FormEventOptions) => void;\r\n setValue: (v: K, options?: FormEventOptions) => void;\r\n value: K;\r\n reset: (value?: ResetValue<K>, opts?: FormEventOptions) => void;\r\n}\r\n/**\r\n * A helper function to create a `TypedFormControl`. It only calls the constructor of FormControl, but **strongly types** the result.\r\n * @param v the value to initialize our `TypedFormControl` with - same as in `new FormControl(v, validators, asyncValidators)`\r\n * @param validators validators - same as in new `FormControl(v, validators, asyncValidators)`\r\n * @param asyncValidators async validators - same as in `new FormControl(v, validators, asyncValidators)`\r\n *\r\n * @example\r\n * const c = typedFormControl<string>(): TypedFormControl<string>;\r\n * c.valueChanges // Observable<string>\r\n * c.patchValue('s') // expects string\r\n * c.patchValue(1) // COMPILE TIME! type error!\r\n */\r\nexport function typedFormControl<T>(\r\n v?: T | { value: T; disabled: boolean },\r\n validatorsOrOptions?: ValidatorFn | ValidatorFn[] | AbstractControlOptions,\r\n asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[]\r\n): TypedFormControl<T> {\r\n return new UntypedFormControl(v, validatorsOrOptions, asyncValidators);\r\n}\r\n\r\n/**\r\n * Typed form control is an `FormArray` with strong typed properties and methods. Can be created using `typedFormArray` function\r\n *\r\n * @example\r\n * const c = typedFormArray<string>([typedFormControl('of type string')]): TypedFormArray<string[], string>;\r\n * c.valueChanges // Observable<string[]>\r\n * c.patchValue(['s']) // expects string[]\r\n * c.patchValue(1) // COMPILE TIME! type error!\r\n */\r\nexport interface TypedFormArray<K extends Array<T> = any[], T = any> extends UntypedFormArray {\r\n valueChanges: Observable<K>;\r\n statusChanges: Observable<'VALID' | 'INVALID' | 'PENDING' | 'DISABLED'>;\r\n patchValue: (v: K, options?: FormEventOptions) => void;\r\n setValue: (v: K, options?: FormEventOptions) => void;\r\n controls: Array<TypedFormControl<T>>;\r\n push: (control: TypedFormControl<T>) => void;\r\n insert: (index: number, control: TypedFormControl<T>) => void;\r\n at: (index: number) => TypedFormControl<T>;\r\n setControl: (index: number, control: TypedFormControl<T>) => void;\r\n value: K;\r\n}\r\n/**\r\n * A helper function to create a `TypedFormArray`. It only calls the constructor of FormArray, but **strongly types** the result.\r\n * @param v the value to initialize our `TypedFormArray` with - same as in `new TypedFormArray(v, validators, asyncValidators)`\r\n * @param validators validators - same as in new `TypedFormArray(v, validators, asyncValidators)`\r\n * @param asyncValidators async validators - same as in `new TypedFormArray(v, validators, asyncValidators)`\r\n *\r\n * @example\r\n * const c = typedFormArray<string>([typedFormControl('of type string')]): TypedFormArray<string[], string>;\r\n * c.valueChanges // Observable<string[]>\r\n * c.patchValue(['s']) // expects string[]\r\n * c.patchValue(1) // COMPILE TIME! type error!\r\n */\r\nexport function typedFormArray<T = any, K extends Array<T> = T[]>(\r\n controls: Array<TypedFormControl<T>>,\r\n validatorOrOptions?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,\r\n asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null\r\n): TypedFormArray<K, T> {\r\n return new UntypedFormArray(controls, validatorOrOptions, asyncValidators) as any;\r\n}\r\n\r\nexport type Controls<K> =\r\n | TypedControlsIn<K>\r\n | {\r\n [k in keyof K]: K[k] extends Array<infer T>\r\n ? TypedFormControl<K[k]> | TypedFormGroup<K[k]> | TypedFormArray<K[k], T>\r\n : TypedFormControl<K[k]> | TypedFormGroup<K[k]>;\r\n };\r\n\r\ntype NonGroup = string | number | boolean | Function | null | undefined | never;\r\n/**\r\n * This is a strongly typed thin wrapper type around `FormGroup`.\r\n * Can be created using the `typedFormGroup` function\r\n */\r\nexport type TypedFormGroup<K, C extends Controls<K> = TypedControlsIn<K>> = K extends NonGroup ? never : UntypedFormGroup & TypedFormControl<K> & {\r\n controls: K extends NonGroup ? never : C;\r\n valueChanges: Observable<K>;\r\n statusChanges: Observable<'VALID' | 'INVALID' | 'PENDING' | 'DISABLED'>;\r\n patchValue: (v: Partial<K>, options?: FormEventOptions) => void;\r\n setValue: (v: K, options?: FormEventOptions) => void;\r\n value: K;\r\n setControl: <T extends keyof C>(name: T extends string ? T : never, control: C[T]) => void;\r\n reset: (value?: ResetValue<K>, options?: FormEventOptions) => void;\r\n getRawValue: () => K;\r\n}\r\nexport function typedFormGroup<K, C extends Controls<K> = TypedControlsIn<K>, Key extends keyof K = keyof K>(\r\n controls: K extends NonGroup ? never : C,\r\n validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,\r\n asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null\r\n): TypedFormGroup<K, C> & { keys: Record<Key, string> } {\r\n const f = new UntypedFormGroup(controls, validatorOrOpts, asyncValidator) as any;\r\n f.keys = Object.keys(controls).reduce((acc, k) => ({ ...acc, [k]: k }), {});\r\n return f;\r\n}\r\n\r\n/**\r\n * Helper type for specifying what control we expect for each property from the model.\r\n */\r\nexport type TypedControlsIn<K, groups extends keyof K = never, arrays extends keyof K = never> = {\r\n [key in keyof K]-?: key extends groups\r\n ? TypedFormGroup<K[key]>\r\n : key extends arrays\r\n ? K[key] extends Array<infer T>\r\n ? TypedFormArray<T[], T>\r\n : never\r\n : TypedFormControl<K[key]>;\r\n};\r\n\r\n/**\r\n * Shorthand for a model with `TypedFormControl`s and `TypedFormArray`s only (i.e. no `TypedFormGroup`s in)\r\n */\r\nexport type TypedArraysIn<K, arrays extends keyof K> = TypedControlsIn<K, never, arrays>;\r\n/**\r\n * Shorthand for a model with `TypedFormControl`s and `TypedFormGroup`s only (i.e. no `TypedFormArray`s in)\r\n */\r\nexport type TypedGroupsIn<K, groups extends keyof K> = TypedControlsIn<K, groups, never>;\r\n","import { AbstractControl, FormArray, FormGroup, UntypedFormArray, UntypedFormGroup, Validators } from '@angular/forms';\r\nimport { TypedFormGroup, TypedFormArray } from './forms-typed';\r\n\r\nexport type Methods = keyof Pick<\r\n AbstractControl,\r\n | 'markAsDirty'\r\n | 'markAsTouched'\r\n | 'updateValueAndValidity'\r\n | 'disable'\r\n | 'enable'\r\n | 'markAsUntouched'\r\n | 'markAsPristine'\r\n | 'markAsPending'\r\n>;\r\n\r\ninterface FormGroupLike {\r\n controls: { [key: string]: AbstractControl };\r\n}\r\n\r\n/**\r\n * Does an aggregate action on a form's controls.\r\n *\r\n * @param form the form to whose controls we want to influence\r\n *\r\n * For example we want to call `markAsTouched` on each control in a form, for visualizing validation purposes.\r\n * @example\r\n * const form = new FormGroup({name: ..., email: ..., address: ..., ...});\r\n *\r\n * forEachControlIn(form).call('markAsTouched') - will iterate over all controls and call that method\r\n */\r\nexport function forEachControlIn(form: UntypedFormGroup | UntypedFormArray) {\r\n const controls: AbstractControl[] =\r\n form != null && form.controls != null\r\n ? Array.isArray(form.controls)\r\n ? form.controls\r\n : Object.getOwnPropertyNames(form.controls).map(name => (form as FormGroupLike).controls[name])\r\n : [];\r\n\r\n const composer = {\r\n /**\r\n * Enumerate which methods to call.\r\n * @param methods which methods to call - as typed string enum\r\n *\r\n * @example\r\n *\r\n * forEachControlIn(form).call('markAsPristine', 'markAsTouched', 'disable')\r\n */\r\n call(...methods: Methods[]) {\r\n if (controls != null && Array.isArray(controls)) {\r\n controls.forEach(c => {\r\n methods.forEach(m => {\r\n if (c[m] && typeof c[m] === 'function') {\r\n (c[m] as any)();\r\n }\r\n });\r\n\r\n // catch the case where we have a control that is form array/group - so for each of the children call methods\r\n if ((c as any).controls != null) {\r\n forEachControlIn(c as FormArray | FormGroup | TypedFormGroup<any> | TypedFormArray<any>).call(...methods);\r\n }\r\n });\r\n }\r\n return composer;\r\n },\r\n markAsDirtySimultaneouslyWith(c: AbstractControl) {\r\n if (c != null) {\r\n const markAsDirtyOriginal = c.markAsDirty.bind(c);\r\n c.markAsDirty = () => {\r\n markAsDirtyOriginal();\r\n composer.call('markAsDirty');\r\n };\r\n const markAsPristineOriginal = c.markAsPristine.bind(c);\r\n c.markAsPristine = () => {\r\n markAsPristineOriginal();\r\n composer.call('markAsPristine');\r\n };\r\n }\r\n return composer;\r\n },\r\n markAsTouchedSimultaneouslyWith(c: AbstractControl, touchIsChildInitiated?: () => boolean) {\r\n if (c != null) {\r\n const markAsTouchedOriginal = c.markAsTouched.bind(c);\r\n c.markAsTouched = () => {\r\n markAsTouchedOriginal();\r\n if (!touchIsChildInitiated || !touchIsChildInitiated()) {\r\n composer.call('markAsTouched');\r\n }\r\n };\r\n const markAsUntouchedOriginal = c.markAsUntouched.bind(c);\r\n c.markAsUntouched = () => {\r\n markAsUntouchedOriginal();\r\n composer.call('markAsUntouched');\r\n };\r\n }\r\n return composer;\r\n },\r\n /**\r\n * Get the errors in the controls from our form and append their errors to the `form` (in forEachControlIn(form) form)\r\n * @param parentControl the control that should be invalid if on of our controls is\r\n */\r\n addValidatorsTo(parentControl: AbstractControl) {\r\n if (parentControl != null) {\r\n parentControl.validator = Validators.compose([\r\n parentControl.validator,\r\n () => {\r\n // could overwrite some errors - but we only need it to communicate to the \"parent\" form that\r\n // these controls here are valid or not\r\n const errors = controls.reduce((e, next) => ({ ...e, ...next.errors }), {});\r\n\r\n return controls.some(c => c.errors != null) ? errors : null;\r\n }\r\n ]);\r\n }\r\n return composer;\r\n }\r\n };\r\n\r\n return composer;\r\n}\r\n","import { OnInit, Optional, Self, OnDestroy, Component, Directive } from '@angular/core';\r\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\r\nimport { TypedFormGroup, Controls } from './forms-typed';\r\nimport { forEachControlIn } from './forms-util';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Directive({\r\n\r\n})\r\nexport class ControlValueAccessorConnector<T, C extends Controls<T> = Controls<T>>\r\n implements OnInit, OnDestroy, ControlValueAccessor {\r\n protected subs = new Subscription();\r\n protected touchIsChildInitiated: boolean;\r\n\r\n public form: TypedFormGroup<T, C>;\r\n\r\n constructor(@Optional() @Self() private directive: NgControl, form: TypedFormGroup<T, C>) {\r\n if (directive) {\r\n directive.valueAccessor = this;\r\n }\r\n this.form = form;\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.directive && this.directive.control) {\r\n forEachControlIn(this.form)\r\n .markAsTouchedSimultaneouslyWith(this.directive.control, () => this.touchIsChildInitiated)\r\n .addValidatorsTo(this.directive.control);\r\n }\r\n\r\n const values = this.form.valueChanges.subscribe(v => this.onChange(v));\r\n const statuses = this.form.statusChanges.subscribe(s => {\r\n if (this.form.touched) {\r\n this.onTouch();\r\n }\r\n });\r\n\r\n this.subs.add(values);\r\n this.subs.add(statuses);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.subs.unsubscribe();\r\n }\r\n protected onChange = (_: T) => { };\r\n protected onTouch = () => { };\r\n writeValue(obj: any): void {\r\n this.form.patchValue(obj || {});\r\n }\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n registerOnTouched(fn: any): void {\r\n this.onTouch = () => {\r\n this.touchIsChildInitiated = true;\r\n fn();\r\n this.touchIsChildInitiated = false;\r\n };\r\n }\r\n setDisabledState(disable: boolean) {\r\n disable ? this.form.disable() : this.form.enable();\r\n forEachControlIn(this.form).call(disable ? 'disable' : 'enable');\r\n }\r\n}\r\n","/*\r\n * Public API Surface of forms\r\n */\r\nexport * from './lib/forms-typed';\r\nexport * from './lib/forms-util';\r\nexport * from './lib/control-value-accessor-connector';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AA+CA;;;;;;;;;;;AAWG;SACa,gBAAgB,CAC9B,CAAuC,EACvC,mBAA0E,EAC1E,eAAuD,EAAA;IAEvD,OAAO,IAAI,kBAAkB,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC;AACzE,CAAC;AAuBD;;;;;;;;;;;AAWG;SACa,cAAc,CAC5B,QAAoC,EACpC,kBAAgF,EAChF,eAA8D,EAAA;IAE9D,OAAO,IAAI,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,eAAe,CAAQ,CAAC;AACpF,CAAC;SA0Be,cAAc,CAC5B,QAAwC,EACxC,eAA6E,EAC7E,cAA6D,EAAA;IAE7D,MAAM,CAAC,GAAG,IAAI,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,cAAc,CAAQ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