@rxap/forms 16.0.0-dev.2 → 16.0.0-dev.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +591 -0
  2. package/README.md +7 -22
  3. package/esm2022/index.mjs +2 -1
  4. package/esm2022/lib/control-actions.mjs +7 -7
  5. package/esm2022/lib/control-value-accessor.mjs +10 -4
  6. package/esm2022/lib/decorators/control-async-validator.mjs +2 -2
  7. package/esm2022/lib/decorators/control-change.mjs +2 -2
  8. package/esm2022/lib/decorators/control-set-value.mjs +3 -3
  9. package/esm2022/lib/decorators/control-validator.mjs +2 -2
  10. package/esm2022/lib/decorators/form.mjs +1 -1
  11. package/esm2022/lib/decorators/metadata-keys.mjs +1 -1
  12. package/esm2022/lib/decorators/use-form-array.mjs +6 -3
  13. package/esm2022/lib/decorators/use-form-control.mjs +2 -2
  14. package/esm2022/lib/decorators/use-form-group.mjs +6 -3
  15. package/esm2022/lib/directives/form-control-error.directive.mjs +9 -10
  16. package/esm2022/lib/directives/form-control-mark-dirty.directive.mjs +8 -9
  17. package/esm2022/lib/directives/form-control-mark-pristine.directive.mjs +8 -9
  18. package/esm2022/lib/directives/form-control-mark-touched.directive.mjs +7 -8
  19. package/esm2022/lib/directives/form-control-mark-untouched.directive.mjs +8 -9
  20. package/esm2022/lib/directives/form-control-name.directive.mjs +12 -13
  21. package/esm2022/lib/directives/form-group-name.directive.mjs +12 -13
  22. package/esm2022/lib/directives/form-loaded.directive.mjs +8 -9
  23. package/esm2022/lib/directives/form-loading-error.directive.mjs +7 -8
  24. package/esm2022/lib/directives/form-loading.directive.mjs +8 -9
  25. package/esm2022/lib/directives/form-submit-failed.directive.mjs +7 -8
  26. package/esm2022/lib/directives/form-submit-invalid.directive.mjs +7 -8
  27. package/esm2022/lib/directives/form-submit-successful.directive.mjs +7 -8
  28. package/esm2022/lib/directives/form-submit.directive.mjs +12 -13
  29. package/esm2022/lib/directives/form-submitting.directive.mjs +8 -9
  30. package/esm2022/lib/directives/form.directive.mjs +37 -33
  31. package/esm2022/lib/directives/forms.module.mjs +100 -0
  32. package/esm2022/lib/directives/models.mjs +1 -1
  33. package/esm2022/lib/directives/parent-control-container.directive.mjs +11 -11
  34. package/esm2022/lib/directives/tokens.mjs +1 -1
  35. package/esm2022/lib/form-array.mjs +12 -7
  36. package/esm2022/lib/form-builder.mjs +27 -20
  37. package/esm2022/lib/form-control.mjs +3 -3
  38. package/esm2022/lib/form-group.mjs +9 -5
  39. package/esm2022/lib/model.mjs +1 -1
  40. package/esm2022/lib/tokens.mjs +1 -1
  41. package/esm2022/lib/types.mjs +1 -1
  42. package/esm2022/lib/validators/index.mjs +1 -1
  43. package/esm2022/lib/validators/is-array.mjs +3 -3
  44. package/esm2022/lib/validators/is-boolean.mjs +3 -3
  45. package/esm2022/lib/validators/is-complex.mjs +7 -9
  46. package/esm2022/lib/validators/is-date.mjs +3 -3
  47. package/esm2022/lib/validators/is-email.mjs +5 -5
  48. package/esm2022/lib/validators/is-enum.mjs +4 -4
  49. package/esm2022/lib/validators/is-int.mjs +5 -5
  50. package/esm2022/lib/validators/is-ip.mjs +4 -4
  51. package/esm2022/lib/validators/is-number.mjs +10 -5
  52. package/esm2022/lib/validators/is-object.mjs +7 -4
  53. package/esm2022/lib/validators/is-phone-number.mjs +5 -5
  54. package/esm2022/lib/validators/is-port.mjs +3 -3
  55. package/esm2022/lib/validators/is-string.mjs +3 -3
  56. package/esm2022/lib/validators/is-url.mjs +5 -5
  57. package/esm2022/lib/validators/is-uuid.mjs +4 -4
  58. package/esm2022/rxap-forms.mjs +1 -1
  59. package/fesm2022/rxap-forms.mjs +440 -319
  60. package/fesm2022/rxap-forms.mjs.map +1 -1
  61. package/index.d.ts +1 -0
  62. package/lib/control-actions.d.ts +1 -1
  63. package/lib/directives/form-control-error.directive.d.ts +2 -2
  64. package/lib/directives/form-control-name.directive.d.ts +1 -1
  65. package/lib/directives/form-group-name.directive.d.ts +1 -1
  66. package/lib/directives/form-loaded.directive.d.ts +1 -1
  67. package/lib/directives/form-loading-error.directive.d.ts +1 -1
  68. package/lib/directives/form-loading.directive.d.ts +1 -1
  69. package/lib/directives/form-submit-failed.directive.d.ts +1 -1
  70. package/lib/directives/form-submit-invalid.directive.d.ts +1 -1
  71. package/lib/directives/form-submit-successful.directive.d.ts +1 -1
  72. package/lib/directives/form-submit.directive.d.ts +1 -1
  73. package/lib/directives/form-submitting.directive.d.ts +1 -1
  74. package/lib/directives/form.directive.d.ts +3 -3
  75. package/lib/directives/forms.module.d.ts +23 -0
  76. package/lib/directives/models.d.ts +1 -1
  77. package/lib/directives/tokens.d.ts +1 -1
  78. package/lib/form-array.d.ts +2 -2
  79. package/lib/form-control.d.ts +4 -4
  80. package/lib/form-group.d.ts +2 -2
  81. package/lib/model.d.ts +2 -2
  82. package/lib/validators/is-complex.d.ts +1 -1
  83. package/lib/validators/is-email.d.ts +1 -1
  84. package/lib/validators/is-enum.d.ts +1 -1
  85. package/lib/validators/is-int.d.ts +1 -1
  86. package/lib/validators/is-ip.d.ts +1 -1
  87. package/lib/validators/is-number.d.ts +1 -1
  88. package/lib/validators/is-phone-number.d.ts +2 -2
  89. package/lib/validators/is-url.d.ts +1 -1
  90. package/lib/validators/is-uuid.d.ts +1 -1
  91. package/package.json +70 -48
  92. package/LICENSE +0 -24
  93. package/collection.json +0 -10
  94. package/migration.json +0 -10
  95. package/src/migrations/v12-2-1/index.d.ts +0 -5
  96. package/src/migrations/v12-2-1/index.js +0 -76
  97. package/src/migrations/v12-2-1/index.js.map +0 -1
  98. package/src/schematics/ng-add/index.d.ts +0 -2
  99. package/src/schematics/ng-add/index.js +0 -8
  100. package/src/schematics/ng-add/index.js.map +0 -1
  101. package/src/schematics/ng-add/schema.json +0 -7
package/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './lib/decorators/use-form-control';
16
16
  export * from './lib/decorators/use-form-group';
17
17
  export * from './lib/decorators/form';
18
18
  export * from './lib/directives/form.directive';
19
+ export * from './lib/directives/forms.module';
19
20
  export * from './lib/directives/form-submit-failed.directive';
20
21
  export * from './lib/directives/form-loading.directive';
21
22
  export * from './lib/directives/form-submitting.directive';
@@ -1,5 +1,5 @@
1
1
  import { Observable, Subscription } from 'rxjs';
2
- import { AbstractControl, ControlOptions, ControlState, ValidatorFn, ControlPath } from './types';
2
+ import { AbstractControl, ControlOptions, ControlPath, ControlState, ValidatorFn } from './types';
3
3
  import { RxapFormArray } from './form-array';
4
4
  import { RxapFormGroup } from './form-group';
5
5
  import { RxapFormControl } from './form-control';
@@ -1,9 +1,9 @@
1
- import { TemplateRef, OnInit, OnDestroy, ViewContainerRef } from '@angular/core';
1
+ import { OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { ValidationErrors } from '../types';
3
3
  import { ControlContainer } from '@angular/forms';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
- * @deprecated removed
6
+ * @deprecated removed use the rxapControlError or rxapControlErrors directive
7
7
  */
8
8
  export declare class FormControlErrorDirective implements OnInit, OnDestroy {
9
9
  private readonly template;
@@ -1,4 +1,4 @@
1
- import { FormControlName, ControlContainer, Validator, ValidatorFn, AsyncValidator, AsyncValidatorFn, ControlValueAccessor } from '@angular/forms';
1
+ import { AsyncValidator, AsyncValidatorFn, ControlContainer, ControlValueAccessor, FormControlName, Validator, ValidatorFn } from '@angular/forms';
2
2
  import { RxapFormControl } from '../form-control';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { FormGroupName, ControlContainer } from '@angular/forms';
1
+ import { ControlContainer, FormGroupName } from '@angular/forms';
2
2
  import { RxapFormGroup } from '../form-group';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormLoadedDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormLoadingErrorDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormLoadingDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormSubmitFailedDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormSubmitInvalidDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormSubmitSuccessfulDirective implements AfterViewInit, OnDestroy {
@@ -1,4 +1,4 @@
1
- import { OnDestroy, EventEmitter } from '@angular/core';
1
+ import { EventEmitter, OnDestroy } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import { Router } from '@angular/router';
4
4
  import { ConfirmClick } from '@rxap/directives';
@@ -1,4 +1,4 @@
1
- import { TemplateRef, ViewContainerRef, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { FormDirective } from './form.directive';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FormSubmittingDirective implements AfterViewInit, OnDestroy {
@@ -1,12 +1,12 @@
1
- import { OnInit, EventEmitter, ChangeDetectorRef, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { FormGroupDirective } from '@angular/forms';
3
3
  import { RxapFormGroup } from '../form-group';
4
4
  import { FormDefinition } from '../model';
5
- import { FormSubmitMethod, FormLoadMethod, FormLoadFailedMethod, FormLoadSuccessfulMethod, FormSubmitFailedMethod, FormSubmitSuccessfulMethod } from './models';
5
+ import { FormLoadFailedMethod, FormLoadMethod, FormLoadSuccessfulMethod, FormSubmitFailedMethod, FormSubmitMethod, FormSubmitSuccessfulMethod } from './models';
6
6
  import { BehaviorSubject } from 'rxjs';
7
7
  import { RxapFormBuilder } from '../form-builder';
8
8
  import { LoadingIndicatorService } from '@rxap/services';
9
- import { ToggleSubject } from '@rxap/utilities/rxjs';
9
+ import { ToggleSubject } from '@rxap/rxjs';
10
10
  import * as i0 from "@angular/core";
11
11
  export declare class FormDirective<T = any> extends FormGroupDirective implements OnInit, OnChanges, OnDestroy {
12
12
  readonly cdr: ChangeDetectorRef;
@@ -0,0 +1,23 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./form.directive";
3
+ import * as i2 from "./form-submit-failed.directive";
4
+ import * as i3 from "./form-loading.directive";
5
+ import * as i4 from "./form-submitting.directive";
6
+ import * as i5 from "./form-loading-error.directive";
7
+ import * as i6 from "./form-loaded.directive";
8
+ import * as i7 from "./form-control-error.directive";
9
+ import * as i8 from "./form-control-mark-dirty.directive";
10
+ import * as i9 from "./form-control-mark-touched.directive";
11
+ import * as i10 from "./form-control-mark-untouched.directive";
12
+ import * as i11 from "./form-control-mark-pristine.directive";
13
+ import * as i12 from "./form-submit.directive";
14
+ import * as i13 from "./form-group-name.directive";
15
+ import * as i14 from "./form-control-name.directive";
16
+ import * as i15 from "./parent-control-container.directive";
17
+ import * as i16 from "./form-submit-successful.directive";
18
+ import * as i17 from "./form-submit-invalid.directive";
19
+ export declare class RxapFormsModule {
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<RxapFormsModule, never>;
21
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RxapFormsModule, never, [typeof i1.FormDirective, typeof i2.FormSubmitFailedDirective, typeof i3.FormLoadingDirective, typeof i4.FormSubmittingDirective, typeof i5.FormLoadingErrorDirective, typeof i6.FormLoadedDirective, typeof i7.FormControlErrorDirective, typeof i8.FormControlMarkDirtyDirective, typeof i9.FormControlMarkTouchedDirective, typeof i10.FormControlMarkUntouchedDirective, typeof i11.FormControlMarkPristineDirective, typeof i12.FormSubmitDirective, typeof i13.FormGroupNameDirective, typeof i14.FormControlNameDirective, typeof i15.ParentControlContainerDirective, typeof i16.FormSubmitSuccessfulDirective, typeof i17.FormSubmitInvalidDirective], [typeof i1.FormDirective, typeof i2.FormSubmitFailedDirective, typeof i3.FormLoadingDirective, typeof i4.FormSubmittingDirective, typeof i5.FormLoadingErrorDirective, typeof i6.FormLoadedDirective, typeof i7.FormControlErrorDirective, typeof i8.FormControlMarkDirtyDirective, typeof i9.FormControlMarkTouchedDirective, typeof i10.FormControlMarkUntouchedDirective, typeof i11.FormControlMarkPristineDirective, typeof i12.FormSubmitDirective, typeof i13.FormGroupNameDirective, typeof i14.FormControlNameDirective, typeof i15.ParentControlContainerDirective, typeof i16.FormSubmitSuccessfulDirective, typeof i17.FormSubmitInvalidDirective]>;
22
+ static ɵinj: i0.ɵɵInjectorDeclaration<RxapFormsModule>;
23
+ }
@@ -1,4 +1,4 @@
1
- import { Method } from '@rxap/utilities/rxjs';
1
+ import { Method } from '@rxap/pattern';
2
2
  export interface FormSubmitMethod<T> extends Method<any, T> {
3
3
  call(parameters: T): any | Promise<any>;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { FormDefinition } from '../model';
3
3
  import { RxapFormBuilder } from '../form-builder';
4
- import { FormSubmitMethod, FormLoadMethod } from './models';
4
+ import { FormLoadMethod, FormSubmitMethod } from './models';
5
5
  export declare const RXAP_FORM_DEFINITION: InjectionToken<FormDefinition<any, any, any>>;
6
6
  export declare const RXAP_FORM_DEFINITION_BUILDER: InjectionToken<RxapFormBuilder<any, import("../model").FormType<any>>>;
7
7
  export declare const RXAP_FORM_SUBMIT_METHOD: InjectionToken<FormSubmitMethod<any>>;
@@ -1,7 +1,7 @@
1
1
  import { UntypedFormArray } from '@angular/forms';
2
- import { ControlEventOptions, ExtractStrings, EmitEvent, ControlPath, ControlState, OnlySelf, AbstractControl, AsyncValidator, ControlOptions, Validator } from './types';
2
+ import { AbstractControl, AsyncValidator, ControlEventOptions, ControlOptions, ControlPath, ControlState, EmitEvent, ExtractStrings, OnlySelf, Validator } from './types';
3
3
  import { Observable, Subscription } from 'rxjs';
4
- import { FormArrayOptions, FormType, FormDefinition } from './model';
4
+ import { FormArrayOptions, FormDefinition, FormType } from './model';
5
5
  export declare class RxapFormArray<T = any, E extends object = any, Parent extends object = any> extends UntypedFormArray implements AbstractControl<T[]> {
6
6
  controls: Array<AbstractControl<T>>;
7
7
  private _readonly;
@@ -1,7 +1,7 @@
1
1
  import { UntypedFormControl } from '@angular/forms';
2
- import { ControlEventOptions, ExtractStrings, EmitEvent, ControlState, OnlySelf, OrBoxedValue, ControlOptions, AsyncValidator, Validator } from './types';
3
- import { Subject, Subscription, Observable } from 'rxjs';
4
- import { RxapAbstractControlOptions, SetValueFn, FormType, FormDefinition } from './model';
2
+ import { AsyncValidator, ControlEventOptions, ControlOptions, ControlState, EmitEvent, ExtractStrings, OnlySelf, OrBoxedValue, Validator } from './types';
3
+ import { Observable, Subject, Subscription } from 'rxjs';
4
+ import { FormDefinition, FormType, RxapAbstractControlOptions, SetValueFn } from './model';
5
5
  export declare class RxapFormControl<T = any, E extends object = any, Parent extends object = any> extends UntypedFormControl {
6
6
  /**
7
7
  * @internal
@@ -22,11 +22,11 @@ export declare class RxapFormControl<T = any, E extends object = any, Parent ext
22
22
  readonly disabled$: Observable<boolean>;
23
23
  readonly enabled$: Observable<boolean>;
24
24
  get readonly(): boolean;
25
+ set readonly(value: boolean);
25
26
  readonly status$: Observable<ControlState>;
26
27
  readonly errors$: Observable<E | null>;
27
28
  readonly controlId: string;
28
29
  private readonly _onSetValue;
29
- set readonly(value: boolean);
30
30
  readonly stateChanges: Subject<void>;
31
31
  readonly readonly$: Observable<boolean>;
32
32
  get controlPath(): string;
@@ -1,7 +1,7 @@
1
1
  import { Observable, Subscription } from 'rxjs';
2
2
  import { UntypedFormGroup } from '@angular/forms';
3
- import { ControlEventOptions, ExtractStrings, EmitEvent, KeyValueControls, ExtractAbstractControl, ControlState, OnlySelf, AsyncValidator, AbstractControl, ControlOptions, Validator, ValidationErrors } from './types';
4
- import { FormGroupOptions, FormType, FormDefinition } from './model';
3
+ import { AbstractControl, AsyncValidator, ControlEventOptions, ControlOptions, ControlState, EmitEvent, ExtractAbstractControl, ExtractStrings, KeyValueControls, OnlySelf, ValidationErrors, Validator } from './types';
4
+ import { FormDefinition, FormGroupOptions, FormType } from './model';
5
5
  export declare class RxapFormGroup<T = any, E extends ValidationErrors = any> extends UntypedFormGroup {
6
6
  controls: ExtractAbstractControl<KeyValueControls<T>, T>;
7
7
  /**
package/lib/model.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AbstractControlOptions, AsyncValidatorFn, ValidatorFn } from '@angular/forms';
2
2
  import { Constructor } from '@rxap/utilities';
3
3
  import type { RxapFormGroup } from './form-group';
4
- import { StaticProvider, Type, InjectionToken, AbstractType } from '@angular/core';
4
+ import { AbstractType, InjectionToken, StaticProvider, Type } from '@angular/core';
5
5
  import { RxapFormControl } from './form-control';
6
6
  import { AbstractControl, ControlOptions } from './types';
7
7
  import { BaseDefinitionMetadata } from '@rxap/definition';
@@ -48,7 +48,7 @@ export interface FormDefinitionArray<T> extends Array<T> {
48
48
  rxapFormArray: RxapFormArray;
49
49
  }
50
50
  export type FormType<T> = Partial<FormDefinition<T>> & {
51
- [K in keyof T]: T[K] extends (infer U)[] ? FormDefinitionArray<FormType<U>> | RxapFormControl<T[K]> | RxapFormArray<U> : T[K] extends Record<string, any> ? (FormType<T[K]> & Partial<FormDefinition<T[K]>>) | RxapFormControl<T[K]> : RxapFormControl<T[K]>;
51
+ [K in keyof T]: T[K] extends (infer U)[] ? FormDefinitionArray<FormType<U>> | FormDefinitionArray<RxapFormControl<U>> | RxapFormControl<T[K]> | RxapFormArray<U> : T[K] extends Record<string, any> ? (FormType<T[K]> & Partial<FormDefinition<T[K]>>) | RxapFormControl<T[K]> : RxapFormControl<T[K]>;
52
52
  };
53
53
  export interface FormOptions extends RxapAbstractControlOptions {
54
54
  id: string;
@@ -11,7 +11,7 @@ export interface ComplexityOptions {
11
11
  range?: number;
12
12
  exact?: number;
13
13
  }
14
- export declare function IsComplex({ message, options }: {
14
+ export declare function IsComplex({ message, options, }: {
15
15
  message?: string;
16
16
  options: ComplexityOptions;
17
17
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,6 +1,6 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
2
  import { IsEmailOptions } from '@rxap/validator';
3
- export declare function IsEmail({ message, options }?: {
3
+ export declare function IsEmail({ message, options, }?: {
4
4
  message?: string;
5
5
  options?: IsEmailOptions;
6
6
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,5 +1,5 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- export declare function IsEnum({ message, entity }: {
2
+ export declare function IsEnum({ message, entity, }: {
3
3
  message?: string;
4
4
  entity: any;
5
5
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,6 +1,6 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
2
  import { IsNumberOptions } from './is-number';
3
- export declare function IsInt({ message, options }?: {
3
+ export declare function IsInt({ message, options, }?: {
4
4
  message?: string;
5
5
  options?: IsNumberOptions;
6
6
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,5 +1,5 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- export declare function IsIP({ message, version }?: {
2
+ export declare function IsIP({ message, version, }?: {
3
3
  message?: string;
4
4
  version?: string | number;
5
5
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -18,7 +18,7 @@ export declare function isNumber(value: unknown, options?: IsNumberOptions): val
18
18
  * @constructor
19
19
  */
20
20
  export declare function IsNumber(control: AbstractControl): ValidationErrors | null;
21
- export declare function _IsNumber({ message, options }?: {
21
+ export declare function _IsNumber({ message, options, }?: {
22
22
  message?: string;
23
23
  options?: IsNumberOptions;
24
24
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,6 +1,6 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- import { MobilePhoneLocale, IsMobilePhoneOptions } from '@rxap/validator';
3
- export declare function IsPhoneNumber({ message, locale, options }?: {
2
+ import { IsMobilePhoneOptions, MobilePhoneLocale } from '@rxap/validator';
3
+ export declare function IsPhoneNumber({ message, locale, options, }?: {
4
4
  message?: string;
5
5
  locale?: 'any' | MobilePhoneLocale | MobilePhoneLocale[];
6
6
  options?: IsMobilePhoneOptions;
@@ -1,6 +1,6 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
2
  import { IsURLOptions } from '@rxap/validator';
3
- export declare function IsUrl({ message, options }?: {
3
+ export declare function IsUrl({ message, options, }?: {
4
4
  message?: string;
5
5
  options?: IsURLOptions;
6
6
  }): (control: AbstractControl) => ValidationErrors | null;
@@ -1,5 +1,5 @@
1
1
  import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- export declare function IsUUID({ message, version }?: {
2
+ export declare function IsUUID({ message, version, }?: {
3
3
  message?: string;
4
4
  version?: string;
5
5
  }): (control: AbstractControl) => ValidationErrors | null;
package/package.json CHANGED
@@ -1,62 +1,85 @@
1
1
  {
2
2
  "name": "@rxap/forms",
3
- "version": "16.0.0-dev.2",
4
- "private": false,
5
- "author": "Merzough Münker",
6
- "homepage": "https://gitlab.com/rxap/packages/libs/forms",
7
- "repository": "git@gitlab.com:rxap/packages.git",
3
+ "version": "16.0.0-dev.3",
4
+ "peerDependencies": {
5
+ "@angular/core": "^16.0.0",
6
+ "@angular/forms": "^16.0.0",
7
+ "@angular/router": "^16.0.0",
8
+ "@rxap/definition": "^16.0.0-dev.3",
9
+ "@rxap/directives": "^16.0.0-dev.3",
10
+ "@rxap/pattern": "^1.0.1-dev.0",
11
+ "@rxap/reflect-metadata": "^1.0.1-dev.0",
12
+ "@rxap/rxjs": "^1.0.1-dev.0",
13
+ "@rxap/services": "^16.0.0-dev.3",
14
+ "@rxap/utilities": "^16.0.0-dev.2",
15
+ "@rxap/validator": "^3.0.0-dev.2",
16
+ "rxjs": "^7.8.0",
17
+ "@angular/platform-browser": "16.1.4"
18
+ },
19
+ "sideEffects": false,
20
+ "dependencies": {
21
+ "tslib": "2.5.3"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "directory": "../../../dist/packages/angular/forms"
26
+ },
8
27
  "keywords": [
9
28
  "rxap",
10
- "forms",
11
- "angular"
29
+ "angular",
30
+ "ngx"
12
31
  ],
32
+ "homepage": "https:/gitlab.com/rxap/packages/packages/angular/forms",
13
33
  "bugs": {
14
34
  "url": "https://gitlab.com/rxap/packages/-/issues",
15
35
  "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
16
36
  },
17
- "description": "A typed extension for @angular/forms.",
18
- "license": "BSD-3-Clause",
19
- "peerDependencies": {
20
- "@angular-devkit/core": "^15.0.3",
21
- "@angular-devkit/schematics": "^15.0.3",
22
- "@angular/cdk": "^16.0.1",
23
- "@angular/common": "^16.0.2",
24
- "@angular/core": "^16.0.2",
25
- "@angular/forms": "^16.0.2",
26
- "@angular/platform-browser": "^16.0.2",
27
- "@angular/platform-browser-dynamic": "^16.0.2",
28
- "@angular/router": "^16.0.2",
29
- "@rxap/definition": "^16.0.0-dev.2",
30
- "@rxap/directives": "^16.0.0-dev.2",
31
- "@rxap/services": "^16.0.0-dev.2",
32
- "@rxap/utilities": "^16.0.0-dev.1",
33
- "reflect-metadata": "^0.1.13",
34
- "rxjs": "^6.6.0"
37
+ "license": "GPL-3.0-or-later",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://gitlab.com/rxap/packages.git",
41
+ "directory": "packages/angular/forms"
35
42
  },
36
- "dependencies": {
37
- "@rxap/schematics-utilities": "^16.0.0-dev.1",
38
- "@rxap/validator": "^3.0.0-dev.1",
39
- "ts-morph": "^13.0.3",
40
- "tslib": "^2.3.1"
43
+ "author": {
44
+ "name": "Merzough Münker",
45
+ "email": "mmuenker@digitaix.com"
41
46
  },
42
- "schematics": "./collection.json",
43
- "ng-update": {
44
- "migrations": "./migration.json",
47
+ "nx-migrations": {
45
48
  "packageGroup": [
46
- "@rxap/definition",
47
- "@rxap/directives",
48
- "@rxap/forms",
49
- "@rxap/services",
50
- "@rxap/utilities"
49
+ {
50
+ "package": "@rxap/definition",
51
+ "version": "16.0.0-dev.3"
52
+ },
53
+ {
54
+ "package": "@rxap/directives",
55
+ "version": "16.0.0-dev.3"
56
+ },
57
+ {
58
+ "package": "@rxap/pattern",
59
+ "version": "1.0.1-dev.0"
60
+ },
61
+ {
62
+ "package": "@rxap/reflect-metadata",
63
+ "version": "1.0.1-dev.0"
64
+ },
65
+ {
66
+ "package": "@rxap/rxjs",
67
+ "version": "1.0.1-dev.0"
68
+ },
69
+ {
70
+ "package": "@rxap/services",
71
+ "version": "16.0.0-dev.3"
72
+ },
73
+ {
74
+ "package": "@rxap/utilities",
75
+ "version": "16.0.0-dev.2"
76
+ },
77
+ {
78
+ "package": "@rxap/validator",
79
+ "version": "3.0.0-dev.2"
80
+ }
51
81
  ]
52
82
  },
53
- "publishConfig": {
54
- "directory": "../../dist/libs/forms",
55
- "access": "public"
56
- },
57
- "ng-add": {
58
- "save": "dependencies"
59
- },
60
83
  "module": "fesm2022/rxap-forms.mjs",
61
84
  "typings": "index.d.ts",
62
85
  "exports": {
@@ -69,6 +92,5 @@
69
92
  "esm": "./esm2022/rxap-forms.mjs",
70
93
  "default": "./fesm2022/rxap-forms.mjs"
71
94
  }
72
- },
73
- "sideEffects": false
74
- }
95
+ }
96
+ }
package/LICENSE DELETED
@@ -1,24 +0,0 @@
1
- Copyright (c) 2021, Merzough Münker
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
- 3. Neither the name of Merzough Münker nor the
12
- names of its contributors may be used to endorse or promote products
13
- derived from this software without specific prior written permission.
14
-
15
- THIS SOFTWARE IS PROVIDED BY MERZOGUH MÜNKER ''AS IS'' AND ANY
16
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
- DISCLAIMED. IN NO EVENT SHALL MERZOGUH MÜNKER BE LIABLE FOR ANY
19
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/collection.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "schematics": {
3
- "ng-add": {
4
- "description": "Setup the package @rxap/forms for the workspace.",
5
- "factory": "./src/schematics/ng-add/index",
6
- "schema": "./src/schematics/ng-add/schema.json"
7
- }
8
- },
9
- "$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json"
10
- }
package/migration.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "schematics": {
3
- "v12-2-1": {
4
- "version": "12.2.1",
5
- "factory": "./src/migrations/v12-2-1/index",
6
- "description": "updates to v12.2.1"
7
- }
8
- },
9
- "$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json"
10
- }
@@ -1,5 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function CreateEmptyInterface(content: string, className: string): string;
3
- export declare function AddMissingType(content: string): string | null;
4
- export declare function UpdateType(content: string): string | null;
5
- export default function (): Rule;
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateType = exports.AddMissingType = exports.CreateEmptyInterface = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- function CreateEmptyInterface(content, className) {
6
- var _a;
7
- const project = new ts_morph_1.Project({
8
- manipulationSettings: {
9
- indentationText: ts_morph_1.IndentationText.TwoSpaces,
10
- quoteKind: ts_morph_1.QuoteKind.Single,
11
- },
12
- useInMemoryFileSystem: true,
13
- });
14
- const sourceFile = project.createSourceFile('file.ts', content);
15
- const interfaceStructure = {
16
- name: `I${className}`,
17
- isExported: true,
18
- };
19
- sourceFile.insertInterface(((_a = sourceFile
20
- .getImportDeclarations()
21
- .map((id) => id.getChildIndex())
22
- .sort()
23
- .reverse()[0]) !== null && _a !== void 0 ? _a : -1) + 1, interfaceStructure);
24
- return sourceFile.getFullText();
25
- }
26
- exports.CreateEmptyInterface = CreateEmptyInterface;
27
- function AddMissingType(content) {
28
- const regex = /new RxapFormBuilder\(([^,\)]+)/;
29
- let match = content.match(regex);
30
- if (match) {
31
- while ((match = content.match(regex))) {
32
- const formClass = match[1].trim();
33
- if (!content.includes(`I${formClass}`)) {
34
- content = CreateEmptyInterface(content, formClass);
35
- }
36
- content = content.replace(regex, 'new RxapFormBuilder<I$1>($1');
37
- }
38
- return content;
39
- }
40
- return null;
41
- }
42
- exports.AddMissingType = AddMissingType;
43
- function UpdateType(content) {
44
- const regex = /RxapFormBuilder<([^I][^>]+)>/;
45
- let match = content.match(regex);
46
- if (match) {
47
- while ((match = content.match(regex))) {
48
- const formClass = match[1].trim();
49
- if (!content.includes(`I${formClass}`)) {
50
- content = CreateEmptyInterface(content, formClass);
51
- }
52
- content = content.replace(regex, 'RxapFormBuilder<I$1>');
53
- }
54
- return content;
55
- }
56
- return null;
57
- }
58
- exports.UpdateType = UpdateType;
59
- function default_1() {
60
- return (host) => {
61
- host.visit((path, entry) => {
62
- var _a, _b;
63
- if (entry && path.match(/\.ts$/) && !path.match(/\/node_modules\//)) {
64
- let originalContent;
65
- let content = (originalContent = entry.content.toString('utf-8'));
66
- content = (_a = AddMissingType(content)) !== null && _a !== void 0 ? _a : content;
67
- content = (_b = UpdateType(content)) !== null && _b !== void 0 ? _b : content;
68
- if (originalContent !== content) {
69
- host.overwrite(path, content);
70
- }
71
- }
72
- });
73
- };
74
- }
75
- exports.default = default_1;
76
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/migrations/v12-2-1/index.ts"],"names":[],"mappings":";;;AAMA,uCAMkB;A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AC;gBACzC,IAAI,eAAe,KAAK,OAAO,EAAE;oBAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;iBAC/B;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC"}
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (): Rule;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_utilities_1 = require("@rxap/schematics-utilities");
4
- function default_1() {
5
- return (0, schematics_utilities_1.InstallPeerDependencies)();
6
- }
7
- exports.default = default_1;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,qEAAqE;AAErE;IACE,OAAO,IAAA,8CAAuB,GAAE,CAAC;AACnC,CAAC;AAFD,4BAEC"}
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "forms-ng-add",
4
- "type": "object",
5
- "properties": {},
6
- "required": []
7
- }