@rxap/forms 12.7.3 → 13.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/esm2020/index.mjs +53 -0
  2. package/esm2020/lib/control-actions.mjs +77 -0
  3. package/esm2020/lib/control-value-accessor.mjs +14 -0
  4. package/esm2020/lib/decorators/control-async-validator.mjs +10 -0
  5. package/esm2020/lib/decorators/control-change.mjs +10 -0
  6. package/esm2020/lib/decorators/control-set-value.mjs +11 -0
  7. package/esm2020/lib/decorators/control-validator.mjs +10 -0
  8. package/esm2020/lib/decorators/form.mjs +7 -0
  9. package/esm2020/lib/decorators/metadata-keys.mjs +12 -0
  10. package/esm2020/lib/decorators/use-form-array.mjs +13 -0
  11. package/esm2020/lib/decorators/use-form-control.mjs +8 -0
  12. package/esm2020/lib/decorators/use-form-group.mjs +8 -0
  13. package/esm2020/lib/directives/form-control-error.directive.mjs +59 -0
  14. package/esm2020/lib/directives/form-control-mark-dirty.directive.mjs +31 -0
  15. package/esm2020/lib/directives/form-control-mark-pristine.directive.mjs +31 -0
  16. package/esm2020/lib/directives/form-control-mark-touched.directive.mjs +24 -0
  17. package/esm2020/lib/directives/form-control-mark-untouched.directive.mjs +31 -0
  18. package/esm2020/lib/directives/form-control-name.directive.mjs +64 -0
  19. package/esm2020/lib/directives/form-group-name.directive.mjs +61 -0
  20. package/esm2020/lib/directives/form-loaded.directive.mjs +41 -0
  21. package/esm2020/lib/directives/form-loading-error.directive.mjs +41 -0
  22. package/esm2020/lib/directives/form-loading.directive.mjs +41 -0
  23. package/esm2020/lib/directives/form-submit-failed.directive.mjs +41 -0
  24. package/esm2020/lib/directives/form-submit-invalid.directive.mjs +39 -0
  25. package/esm2020/lib/directives/form-submit-successful.directive.mjs +39 -0
  26. package/esm2020/lib/directives/form-submit.directive.mjs +74 -0
  27. package/esm2020/lib/directives/form-submitting.directive.mjs +41 -0
  28. package/esm2020/lib/directives/form.directive.mjs +541 -0
  29. package/esm2020/lib/directives/forms.module.mjs +100 -0
  30. package/esm2020/lib/directives/models.mjs +12 -0
  31. package/esm2020/lib/directives/parent-control-container.directive.mjs +25 -0
  32. package/esm2020/lib/directives/tokens.mjs +10 -0
  33. package/esm2020/lib/form-array.mjs +225 -0
  34. package/esm2020/lib/form-builder.mjs +374 -0
  35. package/esm2020/lib/form-control.mjs +169 -0
  36. package/esm2020/lib/form-group.mjs +181 -0
  37. package/esm2020/lib/model.mjs +2 -0
  38. package/esm2020/lib/tokens.mjs +4 -0
  39. package/esm2020/lib/types.mjs +2 -0
  40. package/esm2020/lib/validators/index.mjs +29 -0
  41. package/esm2020/lib/validators/is-array.mjs +18 -0
  42. package/esm2020/lib/validators/is-boolean.mjs +18 -0
  43. package/esm2020/lib/validators/is-complex.mjs +87 -0
  44. package/esm2020/lib/validators/is-date.mjs +18 -0
  45. package/esm2020/lib/validators/is-email.mjs +19 -0
  46. package/esm2020/lib/validators/is-enum.mjs +18 -0
  47. package/esm2020/lib/validators/is-int.mjs +19 -0
  48. package/esm2020/lib/validators/is-ip.mjs +19 -0
  49. package/esm2020/lib/validators/is-number.mjs +56 -0
  50. package/esm2020/lib/validators/is-object.mjs +18 -0
  51. package/esm2020/lib/validators/is-phone-number.mjs +19 -0
  52. package/esm2020/lib/validators/is-string.mjs +18 -0
  53. package/esm2020/lib/validators/is-url.mjs +19 -0
  54. package/esm2020/rxap-forms.mjs +5 -0
  55. package/fesm2015/rxap-forms.mjs +2721 -0
  56. package/fesm2015/rxap-forms.mjs.map +1 -0
  57. package/{fesm2015/rxap-forms.js → fesm2020/rxap-forms.mjs} +161 -147
  58. package/fesm2020/rxap-forms.mjs.map +1 -0
  59. package/package.json +35 -21
  60. package/src/schematics/ng-add/index.js +1 -1
  61. package/src/schematics/ng-add/index.js.map +1 -1
  62. package/bundles/rxap-forms.umd.js +0 -3521
  63. package/bundles/rxap-forms.umd.js.map +0 -1
  64. package/esm2015/index.js +0 -53
  65. package/esm2015/index.js.map +0 -1
  66. package/esm2015/lib/control-actions.js +0 -80
  67. package/esm2015/lib/control-actions.js.map +0 -1
  68. package/esm2015/lib/control-value-accessor.js +0 -14
  69. package/esm2015/lib/control-value-accessor.js.map +0 -1
  70. package/esm2015/lib/decorators/control-async-validator.js +0 -10
  71. package/esm2015/lib/decorators/control-async-validator.js.map +0 -1
  72. package/esm2015/lib/decorators/control-change.js +0 -10
  73. package/esm2015/lib/decorators/control-change.js.map +0 -1
  74. package/esm2015/lib/decorators/control-set-value.js +0 -8
  75. package/esm2015/lib/decorators/control-set-value.js.map +0 -1
  76. package/esm2015/lib/decorators/control-validator.js +0 -10
  77. package/esm2015/lib/decorators/control-validator.js.map +0 -1
  78. package/esm2015/lib/decorators/form.js +0 -7
  79. package/esm2015/lib/decorators/form.js.map +0 -1
  80. package/esm2015/lib/decorators/metadata-keys.js +0 -12
  81. package/esm2015/lib/decorators/metadata-keys.js.map +0 -1
  82. package/esm2015/lib/decorators/use-form-array.js +0 -13
  83. package/esm2015/lib/decorators/use-form-array.js.map +0 -1
  84. package/esm2015/lib/decorators/use-form-control.js +0 -8
  85. package/esm2015/lib/decorators/use-form-control.js.map +0 -1
  86. package/esm2015/lib/decorators/use-form-group.js +0 -8
  87. package/esm2015/lib/decorators/use-form-group.js.map +0 -1
  88. package/esm2015/lib/directives/form-control-error.directive.js +0 -61
  89. package/esm2015/lib/directives/form-control-error.directive.js.map +0 -1
  90. package/esm2015/lib/directives/form-control-mark-dirty.directive.js +0 -31
  91. package/esm2015/lib/directives/form-control-mark-dirty.directive.js.map +0 -1
  92. package/esm2015/lib/directives/form-control-mark-pristine.directive.js +0 -31
  93. package/esm2015/lib/directives/form-control-mark-pristine.directive.js.map +0 -1
  94. package/esm2015/lib/directives/form-control-mark-touched.directive.js +0 -25
  95. package/esm2015/lib/directives/form-control-mark-touched.directive.js.map +0 -1
  96. package/esm2015/lib/directives/form-control-mark-untouched.directive.js +0 -31
  97. package/esm2015/lib/directives/form-control-mark-untouched.directive.js.map +0 -1
  98. package/esm2015/lib/directives/form-control-name.directive.js +0 -64
  99. package/esm2015/lib/directives/form-control-name.directive.js.map +0 -1
  100. package/esm2015/lib/directives/form-group-name.directive.js +0 -61
  101. package/esm2015/lib/directives/form-group-name.directive.js.map +0 -1
  102. package/esm2015/lib/directives/form-loaded.directive.js +0 -42
  103. package/esm2015/lib/directives/form-loaded.directive.js.map +0 -1
  104. package/esm2015/lib/directives/form-loading-error.directive.js +0 -42
  105. package/esm2015/lib/directives/form-loading-error.directive.js.map +0 -1
  106. package/esm2015/lib/directives/form-loading.directive.js +0 -42
  107. package/esm2015/lib/directives/form-loading.directive.js.map +0 -1
  108. package/esm2015/lib/directives/form-submit-failed.directive.js +0 -42
  109. package/esm2015/lib/directives/form-submit-failed.directive.js.map +0 -1
  110. package/esm2015/lib/directives/form-submit-invalid.directive.js +0 -40
  111. package/esm2015/lib/directives/form-submit-invalid.directive.js.map +0 -1
  112. package/esm2015/lib/directives/form-submit-successful.directive.js +0 -40
  113. package/esm2015/lib/directives/form-submit-successful.directive.js.map +0 -1
  114. package/esm2015/lib/directives/form-submit.directive.js +0 -75
  115. package/esm2015/lib/directives/form-submit.directive.js.map +0 -1
  116. package/esm2015/lib/directives/form-submitting.directive.js +0 -42
  117. package/esm2015/lib/directives/form-submitting.directive.js.map +0 -1
  118. package/esm2015/lib/directives/form.directive.js +0 -544
  119. package/esm2015/lib/directives/form.directive.js.map +0 -1
  120. package/esm2015/lib/directives/forms.module.js +0 -100
  121. package/esm2015/lib/directives/forms.module.js.map +0 -1
  122. package/esm2015/lib/directives/models.js +0 -12
  123. package/esm2015/lib/directives/models.js.map +0 -1
  124. package/esm2015/lib/directives/parent-control-container.directive.js +0 -25
  125. package/esm2015/lib/directives/parent-control-container.directive.js.map +0 -1
  126. package/esm2015/lib/directives/tokens.js +0 -10
  127. package/esm2015/lib/directives/tokens.js.map +0 -1
  128. package/esm2015/lib/form-array.js +0 -217
  129. package/esm2015/lib/form-array.js.map +0 -1
  130. package/esm2015/lib/form-builder.js +0 -349
  131. package/esm2015/lib/form-builder.js.map +0 -1
  132. package/esm2015/lib/form-control.js +0 -170
  133. package/esm2015/lib/form-control.js.map +0 -1
  134. package/esm2015/lib/form-group.js +0 -183
  135. package/esm2015/lib/form-group.js.map +0 -1
  136. package/esm2015/lib/model.js +0 -2
  137. package/esm2015/lib/model.js.map +0 -1
  138. package/esm2015/lib/tokens.js +0 -4
  139. package/esm2015/lib/tokens.js.map +0 -1
  140. package/esm2015/lib/types.js +0 -2
  141. package/esm2015/lib/types.js.map +0 -1
  142. package/esm2015/lib/validators/index.js +0 -29
  143. package/esm2015/lib/validators/index.js.map +0 -1
  144. package/esm2015/lib/validators/is-array.js +0 -18
  145. package/esm2015/lib/validators/is-array.js.map +0 -1
  146. package/esm2015/lib/validators/is-boolean.js +0 -18
  147. package/esm2015/lib/validators/is-boolean.js.map +0 -1
  148. package/esm2015/lib/validators/is-complex.js +0 -87
  149. package/esm2015/lib/validators/is-complex.js.map +0 -1
  150. package/esm2015/lib/validators/is-date.js +0 -18
  151. package/esm2015/lib/validators/is-date.js.map +0 -1
  152. package/esm2015/lib/validators/is-email.js +0 -19
  153. package/esm2015/lib/validators/is-email.js.map +0 -1
  154. package/esm2015/lib/validators/is-enum.js +0 -18
  155. package/esm2015/lib/validators/is-enum.js.map +0 -1
  156. package/esm2015/lib/validators/is-int.js +0 -19
  157. package/esm2015/lib/validators/is-int.js.map +0 -1
  158. package/esm2015/lib/validators/is-ip.js +0 -19
  159. package/esm2015/lib/validators/is-ip.js.map +0 -1
  160. package/esm2015/lib/validators/is-number.js +0 -57
  161. package/esm2015/lib/validators/is-number.js.map +0 -1
  162. package/esm2015/lib/validators/is-object.js +0 -18
  163. package/esm2015/lib/validators/is-object.js.map +0 -1
  164. package/esm2015/lib/validators/is-phone-number.js +0 -19
  165. package/esm2015/lib/validators/is-phone-number.js.map +0 -1
  166. package/esm2015/lib/validators/is-string.js +0 -18
  167. package/esm2015/lib/validators/is-string.js.map +0 -1
  168. package/esm2015/lib/validators/is-url.js +0 -19
  169. package/esm2015/lib/validators/is-url.js.map +0 -1
  170. package/esm2015/rxap-forms.js +0 -5
  171. package/esm2015/rxap-forms.js.map +0 -1
  172. package/fesm2015/rxap-forms.js.map +0 -1
@@ -1,100 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { FormDirective } from './form.directive';
3
- import { FormSubmitFailedDirective } from './form-submit-failed.directive';
4
- import { FormLoadingDirective } from './form-loading.directive';
5
- import { FormSubmittingDirective } from './form-submitting.directive';
6
- import { FormLoadingErrorDirective } from './form-loading-error.directive';
7
- import { FormLoadedDirective } from './form-loaded.directive';
8
- import { FormControlErrorDirective } from './form-control-error.directive';
9
- import { FormControlMarkDirtyDirective } from './form-control-mark-dirty.directive';
10
- import { FormControlMarkTouchedDirective } from './form-control-mark-touched.directive';
11
- import { FormControlMarkUntouchedDirective } from './form-control-mark-untouched.directive';
12
- import { FormControlMarkPristineDirective } from './form-control-mark-pristine.directive';
13
- import { FormSubmitDirective } from './form-submit.directive';
14
- import { FormGroupNameDirective } from './form-group-name.directive';
15
- import { FormControlNameDirective } from './form-control-name.directive';
16
- import { ParentControlContainerDirective } from './parent-control-container.directive';
17
- import { FormSubmitSuccessfulDirective } from './form-submit-successful.directive';
18
- import { FormSubmitInvalidDirective } from './form-submit-invalid.directive';
19
- import * as i0 from "@angular/core";
20
- export class RxapFormsModule {
21
- }
22
- RxapFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RxapFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
23
- RxapFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RxapFormsModule, declarations: [FormDirective,
24
- FormSubmitFailedDirective,
25
- FormLoadingDirective,
26
- FormSubmittingDirective,
27
- FormLoadingErrorDirective,
28
- FormLoadedDirective,
29
- FormControlErrorDirective,
30
- FormControlMarkDirtyDirective,
31
- FormControlMarkTouchedDirective,
32
- FormControlMarkUntouchedDirective,
33
- FormControlMarkPristineDirective,
34
- FormSubmitDirective,
35
- FormGroupNameDirective,
36
- FormControlNameDirective,
37
- ParentControlContainerDirective,
38
- FormSubmitSuccessfulDirective,
39
- FormSubmitInvalidDirective], exports: [FormDirective,
40
- FormSubmitFailedDirective,
41
- FormLoadingDirective,
42
- FormSubmittingDirective,
43
- FormLoadingErrorDirective,
44
- FormLoadedDirective,
45
- FormControlErrorDirective,
46
- FormControlMarkDirtyDirective,
47
- FormControlMarkTouchedDirective,
48
- FormControlMarkUntouchedDirective,
49
- FormControlMarkPristineDirective,
50
- FormSubmitDirective,
51
- FormGroupNameDirective,
52
- FormControlNameDirective,
53
- ParentControlContainerDirective,
54
- FormSubmitSuccessfulDirective,
55
- FormSubmitInvalidDirective] });
56
- RxapFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RxapFormsModule });
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RxapFormsModule, decorators: [{
58
- type: NgModule,
59
- args: [{
60
- declarations: [
61
- FormDirective,
62
- FormSubmitFailedDirective,
63
- FormLoadingDirective,
64
- FormSubmittingDirective,
65
- FormLoadingErrorDirective,
66
- FormLoadedDirective,
67
- FormControlErrorDirective,
68
- FormControlMarkDirtyDirective,
69
- FormControlMarkTouchedDirective,
70
- FormControlMarkUntouchedDirective,
71
- FormControlMarkPristineDirective,
72
- FormSubmitDirective,
73
- FormGroupNameDirective,
74
- FormControlNameDirective,
75
- ParentControlContainerDirective,
76
- FormSubmitSuccessfulDirective,
77
- FormSubmitInvalidDirective,
78
- ],
79
- exports: [
80
- FormDirective,
81
- FormSubmitFailedDirective,
82
- FormLoadingDirective,
83
- FormSubmittingDirective,
84
- FormLoadingErrorDirective,
85
- FormLoadedDirective,
86
- FormControlErrorDirective,
87
- FormControlMarkDirtyDirective,
88
- FormControlMarkTouchedDirective,
89
- FormControlMarkUntouchedDirective,
90
- FormControlMarkPristineDirective,
91
- FormSubmitDirective,
92
- FormGroupNameDirective,
93
- FormControlNameDirective,
94
- ParentControlContainerDirective,
95
- FormSubmitSuccessfulDirective,
96
- FormSubmitInvalidDirective,
97
- ]
98
- }]
99
- }] });
100
- //# sourceMappingURL=forms.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forms.module.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/forms.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,6BAA6B,E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C/B,6BAA6B;wBAC7B,0BAA0B;qBAC3B;iBACF","sourcesContent":["import { NgModule } from '@angular/core';\nimport { FormDirective } from './form.directive';\nimport { FormSubmitFailedDirective } from './form-submit-failed.directive';\nimport { FormLoadingDirective } from './form-loading.directive';\nimport { FormSubmittingDirective } from './form-submitting.directive';\nimport { FormLoadingErrorDirective } from './form-loading-error.directive';\nimport { FormLoadedDirective } from './form-loaded.directive';\nimport { FormControlErrorDirective } from './form-control-error.directive';\nimport { FormControlMarkDirtyDirective } from './form-control-mark-dirty.directive';\nimport { FormControlMarkTouchedDirective } from './form-control-mark-touched.directive';\nimport { FormControlMarkUntouchedDirective } from './form-control-mark-untouched.directive';\nimport { FormControlMarkPristineDirective } from './form-control-mark-pristine.directive';\nimport { FormSubmitDirective } from './form-submit.directive';\nimport { FormGroupNameDirective } from './form-group-name.directive';\nimport { FormControlNameDirective } from './form-control-name.directive';\nimport { ParentControlContainerDirective } from './parent-control-container.directive';\nimport { FormSubmitSuccessfulDirective } from './form-submit-successful.directive';\nimport { FormSubmitInvalidDirective } from './form-submit-invalid.directive';\n\n\n@NgModule({\n declarations: [\n FormDirective,\n FormSubmitFailedDirective,\n FormLoadingDirective,\n FormSubmittingDirective,\n FormLoadingErrorDirective,\n FormLoadedDirective,\n FormControlErrorDirective,\n FormControlMarkDirtyDirective,\n FormControlMarkTouchedDirective,\n FormControlMarkUntouchedDirective,\n FormControlMarkPristineDirective,\n FormSubmitDirective,\n FormGroupNameDirective,\n FormControlNameDirective,\n ParentControlContainerDirective,\n FormSubmitSuccessfulDirective,\n FormSubmitInvalidDirective,\n ],\n exports: [\n FormDirective,\n FormSubmitFailedDirective,\n FormLoadingDirective,\n FormSubmittingDirective,\n FormLoadingErrorDirective,\n FormLoadedDirective,\n FormControlErrorDirective,\n FormControlMarkDirtyDirective,\n FormControlMarkTouchedDirective,\n FormControlMarkUntouchedDirective,\n FormControlMarkPristineDirective,\n FormSubmitDirective,\n FormGroupNameDirective,\n FormControlNameDirective,\n ParentControlContainerDirective,\n FormSubmitSuccessfulDirective,\n FormSubmitInvalidDirective,\n ]\n})\nexport class RxapFormsModule {}\n"]}
@@ -1,12 +0,0 @@
1
- export function ToFormMethod(call) {
2
- return { call };
3
- }
4
- /**
5
- * @deprecated use ToFormMethod instead
6
- *
7
- * @param call the call method implementation
8
- */
9
- export function ToFormSubmitMethod(call) {
10
- return ToFormMethod(call);
11
- }
12
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/models.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,YAAY,CAA2C,IAAkC;IACvG,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAI,IAA2B;IAC/D,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { Method } from '@rxap/utilities/rxjs';\n\nexport interface FormSubmitMethod<T> extends Method<any, T> {\n call(parameters: T): any | Promise<any>;\n}\n\nexport interface FormLoadMethod<T = any> extends Method<T> {\n call(): T | Promise<T>;\n}\n\nexport interface FormLoadFailedMethod extends Method {\n call(error: Error): Promise<any> | any;\n}\n\nexport interface FormLoadSuccessfulMethod<T = any> extends Method {\n call(value: T): Promise<any> | any;\n}\n\nexport interface FormSubmitFailedMethod extends Method {\n call(error: Error): Promise<any> | any;\n}\n\nexport interface FormSubmitSuccessfulMethod<T = any> extends Method {\n call(result: T): Promise<any> | any;\n}\n\nexport function ToFormMethod<T, FormMethod extends Method<R, P>, R, P>(call: (value: P) => R | Promise<R>): Method<R, P> {\n return { call };\n}\n\n/**\n * @deprecated use ToFormMethod instead\n *\n * @param call the call method implementation\n */\nexport function ToFormSubmitMethod<T>(call: (value: T) => boolean): FormSubmitMethod<T> {\n return ToFormMethod(call);\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { Directive } from '@angular/core';
2
- import { ControlContainer } from '@angular/forms';
3
- import * as i0 from "@angular/core";
4
- export class ParentControlContainerDirective {
5
- }
6
- ParentControlContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
7
- ParentControlContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: ParentControlContainerDirective, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
8
- {
9
- provide: ControlContainer,
10
- useExisting: ControlContainer
11
- }
12
- ], ngImport: i0 });
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
14
- type: Directive,
15
- args: [{
16
- selector: '[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]',
17
- providers: [
18
- {
19
- provide: ControlContainer,
20
- useExisting: ControlContainer
21
- }
22
- ]
23
- }]
24
- }] });
25
- //# sourceMappingURL=parent-control-container.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parent-control-container.directive.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/parent-control-container.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;;AAWlD,MAAM,OAAO,+BAA+B;;4HAA/B,+BAA+B;gHAA/B,+BAA+B,+GAP/B;QACT;YACE,OAAO,EAAM,gBAAgB;YAC7B,WAAW,EAAE,gBAAgB;SAC9B;KACF;2FAEU,+BAA+B;kBAT3C,SAAS;mBAAC;oBACT,QAAQ,EAAG,sFAAsF;oBACjG,SAAS,EAAE;wBACT;4BACE,OAAO,EAAM,gBAAgB;4BAC7B,WAAW,EAAE,gBAAgB;yBAC9B;qBACF;iBACF","sourcesContent":["import { Directive } from '@angular/core';\nimport { ControlContainer } from '@angular/forms';\n\n@Directive({\n selector: '[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]',\n providers: [\n {\n provide: ControlContainer,\n useExisting: ControlContainer\n }\n ]\n})\nexport class ParentControlContainerDirective {}\n"]}
@@ -1,10 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export const RXAP_FORM_DEFINITION = new InjectionToken('rxap/forms/definition');
3
- export const RXAP_FORM_DEFINITION_BUILDER = new InjectionToken('rxap/forms/definition-builder');
4
- export const RXAP_FORM_SUBMIT_METHOD = new InjectionToken('rxap/form/submit-method');
5
- export const RXAP_FORM_SUBMIT_FAILED_METHOD = new InjectionToken('rxap/form/submit-failed-method');
6
- export const RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/submit-successful-method');
7
- export const RXAP_FORM_LOAD_METHOD = new InjectionToken('rxap/form/load-method');
8
- export const RXAP_FORM_LOAD_FAILED_METHOD = new InjectionToken('rxap/form/load-failed-method');
9
- export const RXAP_FORM_LOAD_SUCCESSFUL_METHOD = new InjectionToken('rxap/form/load-successful-method');
10
- //# sourceMappingURL=tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../libs/forms/src/lib/directives/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAiB,uBAAuB,CAAC,CAAC;AAEhG,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAAkB,+BAA+B,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAwB,yBAAyB,CAAC,CAAC;AAE5G,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,cAAc,CAAwB,gCAAgC,CAAC,CAAC;AAE1H,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,cAAc,CAAwB,oCAAoC,CAAC,CAAC;AAElI,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAiB,uBAAuB,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAAiB,8BAA8B,CAAC,CAAC;AAE/G,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,cAAc,CAAiB,kCAAkC,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { FormDefinition } from '../model';\nimport { RxapFormBuilder } from '../form-builder';\nimport {\n FormSubmitMethod,\n FormLoadMethod\n} from './models';\n\nexport const RXAP_FORM_DEFINITION = new InjectionToken<FormDefinition>('rxap/forms/definition');\n\nexport const RXAP_FORM_DEFINITION_BUILDER = new InjectionToken<RxapFormBuilder>('rxap/forms/definition-builder');\n\nexport const RXAP_FORM_SUBMIT_METHOD = new InjectionToken<FormSubmitMethod<any>>('rxap/form/submit-method');\n\nexport const RXAP_FORM_SUBMIT_FAILED_METHOD = new InjectionToken<FormSubmitMethod<any>>('rxap/form/submit-failed-method');\n\nexport const RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD = new InjectionToken<FormSubmitMethod<any>>('rxap/form/submit-successful-method');\n\nexport const RXAP_FORM_LOAD_METHOD = new InjectionToken<FormLoadMethod>('rxap/form/load-method');\n\nexport const RXAP_FORM_LOAD_FAILED_METHOD = new InjectionToken<FormLoadMethod>('rxap/form/load-failed-method');\n\nexport const RXAP_FORM_LOAD_SUCCESSFUL_METHOD = new InjectionToken<FormLoadMethod>('rxap/form/load-successful-method');\n"]}
@@ -1,217 +0,0 @@
1
- import { FormArray as NgFormArray, AbstractControl as NgAbstractControl } from '@angular/forms';
2
- import { distinctUntilChanged, map } from 'rxjs/operators';
3
- import { isObservable, Subject } from 'rxjs';
4
- import { controlDisabled$, mergeControlValidators, hasErrorAndDirty, hasErrorAndTouched, controlStatusChanges$, enableControl, controlEnabledWhile, disableControl, controlValueChanges$, controlEnabled$, controlErrorChanges$, markAllDirty, controlDisabledWhile, markAllPristine, markAllUntouched } from './control-actions';
5
- import { coerceArray } from '@rxap/utilities';
6
- export class RxapFormArray extends NgFormArray {
7
- constructor(controls, options) {
8
- super(controls, options);
9
- this.controls = controls;
10
- this._readonly = false;
11
- this.value$ = controlValueChanges$(this);
12
- this.disabled$ = controlDisabled$(this);
13
- this.enabled$ = controlEnabled$(this);
14
- this.status$ = controlStatusChanges$(this);
15
- this.errors$ = controlErrorChanges$(this);
16
- this.touchChanges = new Subject();
17
- this.touch$ = this.touchChanges
18
- .asObservable()
19
- .pipe(distinctUntilChanged());
20
- this.dirtyChanges = new Subject();
21
- this.dirty$ = this.dirtyChanges
22
- .asObservable()
23
- .pipe(distinctUntilChanged());
24
- this.controlId = options.controlId;
25
- this._builder = options.builder;
26
- this._controlInsertedFn = options.controlInsertedFn;
27
- this._controlRemovedFn = options.controlRemovedFn;
28
- }
29
- get readonly() {
30
- var _a, _b;
31
- return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.readonly) !== null && _b !== void 0 ? _b : this._readonly;
32
- }
33
- set readonly(value) {
34
- this._readonly = value;
35
- this.controls.forEach(control => { var _a; return (_a = control.stateChanges) === null || _a === void 0 ? void 0 : _a.next(); });
36
- }
37
- /**
38
- * @internal
39
- */
40
- get rxapFormDefinition() {
41
- return this.parent.rxapFormDefinition;
42
- }
43
- get controlPath() {
44
- const parent = this.parent;
45
- if (parent) {
46
- if (parent.controlPath) {
47
- if (parent === this.root) {
48
- return this.controlId;
49
- }
50
- else {
51
- return [parent.controlPath, this.controlId].join('.');
52
- }
53
- }
54
- }
55
- return this.controlId;
56
- }
57
- get fullControlPath() {
58
- const parent = this.parent;
59
- if (parent) {
60
- if (parent.fullControlPath) {
61
- return [parent.fullControlPath, this.controlId].join('.');
62
- }
63
- }
64
- return this.controlId;
65
- }
66
- select(mapFn) {
67
- return this.value$.pipe(map(mapFn), distinctUntilChanged());
68
- }
69
- at(index) {
70
- return super.at(index);
71
- }
72
- getRawValue() {
73
- return super.getRawValue();
74
- }
75
- insert(index, control) {
76
- console.warn('It is not recommend to use the FormArray.insert method');
77
- return super.insert(index, control);
78
- }
79
- /**
80
- * inserts a new control at the specified index. If the index is undefined
81
- * the new control will be added to the end.
82
- *
83
- * @param index (optional) the index where the control should be created
84
- * @param state (optional) the initial state of the new control
85
- */
86
- insertAt(index, state) {
87
- const insertIndex = index !== null && index !== void 0 ? index : this.controls.length;
88
- const controlOrDefinition = this._builder(state, {
89
- controlId: insertIndex.toFixed(0),
90
- });
91
- this._controlInsertedFn(insertIndex, controlOrDefinition);
92
- if (insertIndex < this.controls.length) {
93
- // update the control ids for all controls, that are moved.
94
- for (let i = insertIndex; i < this.controls.length; i++) {
95
- Reflect.set(this.controls[i], 'controlId', (i + 1).toFixed(0));
96
- }
97
- }
98
- // call the super insert after the update, bc the insert method will
99
- // trigger a change detection
100
- if (controlOrDefinition instanceof NgAbstractControl) {
101
- super.insert(insertIndex, controlOrDefinition);
102
- }
103
- else {
104
- super.insert(insertIndex, controlOrDefinition.rxapFormGroup);
105
- }
106
- }
107
- disabledWhile(observable, options) {
108
- return controlDisabledWhile(this, observable, options);
109
- }
110
- enabledWhile(observable, options) {
111
- return controlEnabledWhile(this, observable, options);
112
- }
113
- mergeValidators(validators) {
114
- mergeControlValidators(this, validators);
115
- }
116
- mergeAsyncValidators(validators) {
117
- this.setAsyncValidators([
118
- ...coerceArray(this.asyncValidator),
119
- ...coerceArray(validators),
120
- ]);
121
- this.updateValueAndValidity();
122
- }
123
- markAllAsDirty() {
124
- markAllDirty(this);
125
- }
126
- markAllAsPristine() {
127
- markAllPristine(this);
128
- }
129
- setValue(valueOrObservable, options) {
130
- if (isObservable(valueOrObservable)) {
131
- return valueOrObservable.subscribe((value) => super.setValue(value, options));
132
- }
133
- super.setValue(valueOrObservable, options);
134
- }
135
- markAllAsUntouched() {
136
- markAllUntouched(this);
137
- }
138
- validateOn(observableValidation) {
139
- return observableValidation.subscribe((maybeError) => {
140
- this.setErrors(maybeError);
141
- });
142
- }
143
- hasErrorAndTouched(errorCode, path) {
144
- return hasErrorAndTouched(this, errorCode, path);
145
- }
146
- patchValue(valueOrObservable, options) {
147
- if (isObservable(valueOrObservable)) {
148
- return valueOrObservable.subscribe((value) => {
149
- super.patchValue(value, options);
150
- });
151
- }
152
- super.patchValue(valueOrObservable, options);
153
- }
154
- hasErrorAndDirty(errorCode, path) {
155
- return hasErrorAndDirty(this, errorCode, path);
156
- }
157
- removeAt(index) {
158
- console.warn('It is not recommend to use the FormArray.removeAt method');
159
- super.removeAt(index);
160
- this._controlRemovedFn(index);
161
- }
162
- setEnable(enable = true, opts) {
163
- enableControl(this, enable, opts);
164
- }
165
- push(control) {
166
- console.warn('It is not recommend to use the FormArray.push method');
167
- return super.push(control);
168
- }
169
- setDisable(disable = true, opts) {
170
- disableControl(this, disable, opts);
171
- }
172
- setControl(index, control) {
173
- console.warn('It is not recommend to use the FormArray.setControl method');
174
- return super.setControl(index, control);
175
- }
176
- markAsTouched(opts) {
177
- super.markAsTouched(opts);
178
- this.touchChanges.next(true);
179
- }
180
- markAsUntouched(opts) {
181
- super.markAsUntouched(opts);
182
- this.touchChanges.next(false);
183
- }
184
- markAsPristine(opts) {
185
- super.markAsPristine(opts);
186
- this.dirtyChanges.next(false);
187
- }
188
- markAsDirty(opts) {
189
- super.markAsDirty(opts);
190
- this.dirtyChanges.next(true);
191
- }
192
- reset(value, options) {
193
- super.reset(value, options);
194
- }
195
- setValidators(newValidator, updateValueAndValidity = true) {
196
- super.setValidators(newValidator);
197
- if (updateValueAndValidity) {
198
- super.updateValueAndValidity();
199
- }
200
- }
201
- setAsyncValidators(newValidator, updateValueAndValidity = true) {
202
- super.setAsyncValidators(newValidator);
203
- if (updateValueAndValidity) {
204
- super.updateValueAndValidity();
205
- }
206
- }
207
- hasError(errorCode, path) {
208
- return super.hasError(errorCode, path);
209
- }
210
- setErrors(errors, opts = {}) {
211
- return super.setErrors(errors, opts);
212
- }
213
- getError(errorCode, path) {
214
- return super.getError(errorCode, path);
215
- }
216
- }
217
- //# sourceMappingURL=form-array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-array.js","sourceRoot":"","sources":["../../../../../libs/forms/src/lib/form-array.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,WAAW,EACxB,eAAe,IAAI,iBAAiB,EACrC,MAAM,gBAAgB,CAAC;AAaxB,OAAO,EACL,oBAAoB,EACpB,GAAG,EACJ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,OAAO,EAGR,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAU9C,MAAM,OAAO,aAGX,SAAQ,WAAW;IAsEnB,YACS,QAAmC,EAC1C,OAAyB;QAEzB,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAHlB,aAAQ,GAAR,QAAQ,CAA2B;QApEpC,cAAS,GAAY,KAAK,CAAC;QA8CnB,WAAM,GAAG,oBAAoB,CAAM,IAAI,CAAC,CAAC;QAEzC,cAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEnC,aAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAEjC,YAAO,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACtC,YAAO,GAAG,oBAAoB,CAAI,IAAI,CAAC,CAAC;QAEvC,iBAAY,GAAG,IAAI,OAAO,EAAW,CAAC;QACvC,WAAM,GAAG,IAAI,CAAC,YAAY;aACvC,YAAY,EAAE;aACd,IAAI,CAAC,oB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AClB,YAAuB,EACvB,yBAAkC,IAAI;QAEtC,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAClC,IAAI,sBAAsB,EAAE;YAC1B,KAAK,CAAC,sBAAsB,EAAE,CAAC;SAChC;IACH,CAAC;IAEM,kBAAkB,CACvB,YAA4B,EAC5B,yBAAkC,IAAI;QAEtC,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACvC,IAAI,sBAAsB,EAAE;YAC1B,KAAK,CAAC,sBAAsB,EAAE,CAAC;SAChC;IACH,CAAC;IAEM,QAAQ,CAAC,SAA4B,EAAE,IAAkB;QAC9D,OAAO,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAEM,SAAS,CAAC,MAAyB,EAAE,OAAkB,EAAE;QAC9D,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAEM,QAAQ,CACb,SAAY,EACZ,IAAkB;QAElB,OAAO,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAgB,CAAC;IACxD,CAAC;CACF","sourcesContent":["import {\n FormArray as NgFormArray,\n AbstractControl as NgAbstractControl\n} from '@angular/forms';\nimport {\n ControlEventOptions,\n ExtractStrings,\n EmitEvent,\n ControlPath,\n ControlState,\n OnlySelf,\n AbstractControl,\n AsyncValidator,\n ControlOptions,\n Validator\n} from './types';\nimport {\n distinctUntilChanged,\n map\n} from 'rxjs/operators';\nimport {\n isObservable,\n Subject,\n Observable,\n Subscription\n} from 'rxjs';\nimport {\n controlDisabled$,\n mergeControlValidators,\n hasErrorAndDirty,\n hasErrorAndTouched,\n controlStatusChanges$,\n enableControl,\n controlEnabledWhile,\n disableControl,\n controlValueChanges$,\n controlEnabled$,\n controlErrorChanges$,\n markAllDirty,\n controlDisabledWhile,\n markAllPristine,\n markAllUntouched\n} from './control-actions';\nimport { coerceArray } from '@rxap/utilities';\nimport {\n FormArrayOptions,\n FormBuilderFn,\n ControlRemovedFn,\n ControlInsertedFn,\n FormType,\n FormDefinition\n} from './model';\n\nexport class RxapFormArray<T = any,\n E extends object = any,\n Parent extends object = any>\n extends NgFormArray\n implements AbstractControl<T[]> {\n\n private _readonly: boolean = false;\n\n public get readonly(): boolean {\n return (this.parent as any)?.readonly ?? this._readonly;\n }\n\n public set readonly(value: boolean) {\n this._readonly = value;\n this.controls.forEach(control => (control as any).stateChanges?.next());\n }\n\n /**\n * @internal\n */\n public get rxapFormDefinition():\n | (FormType<Parent> & FormDefinition<Parent>)\n | undefined {\n return (this.parent as any).rxapFormDefinition;\n }\n\n public get controlPath(): string {\n const parent: any = this.parent;\n if (parent) {\n if (parent.controlPath) {\n if (parent === this.root) {\n return this.controlId;\n } else {\n return [parent.controlPath, this.controlId].join('.');\n }\n }\n }\n return this.controlId;\n }\n public readonly value!: T[];\n\n public get fullControlPath(): string {\n const parent: any = this.parent;\n if (parent) {\n if (parent.fullControlPath) {\n return [parent.fullControlPath, this.controlId].join('.');\n }\n }\n return this.controlId;\n }\n public readonly valueChanges!: Observable<T[]>;\n\n public readonly value$ = controlValueChanges$<T[]>(this);\n public readonly status!: ControlState;\n public readonly disabled$ = controlDisabled$(this);\n public readonly statusChanges!: Observable<ControlState>;\n public readonly enabled$ = controlEnabled$(this);\n public readonly errors!: E | null;\n public readonly status$ = controlStatusChanges$(this);\n public readonly errors$ = controlErrorChanges$<E>(this);\n public readonly controlId: string;\n private readonly touchChanges = new Subject<boolean>();\n public readonly touch$ = this.touchChanges\n .asObservable()\n .pipe(distinctUntilChanged());\n private readonly dirtyChanges = new Subject<boolean>();\n public readonly dirty$ = this.dirtyChanges\n .asObservable()\n .pipe(distinctUntilChanged());\n private readonly _builder: FormBuilderFn;\n private readonly _controlInsertedFn: ControlInsertedFn;\n private readonly _controlRemovedFn: ControlRemovedFn;\n\n constructor(\n public controls: Array<AbstractControl<T>>,\n options: FormArrayOptions\n ) {\n super(controls, options);\n this.controlId = options.controlId;\n this._builder = options.builder;\n this._controlInsertedFn = options.controlInsertedFn;\n this._controlRemovedFn = options.controlRemovedFn;\n }\n\n public select<R>(mapFn: (state: T[]) => R): Observable<R> {\n return this.value$.pipe(map(mapFn), distinctUntilChanged());\n }\n\n public at(index: number): AbstractControl<T> {\n return super.at(index) as AbstractControl<T>;\n }\n\n public getRawValue(): T[] {\n return super.getRawValue();\n }\n\n public insert(index: number, control: AbstractControl<T>): void {\n console.warn('It is not recommend to use the FormArray.insert method');\n return super.insert(index, control);\n }\n\n /**\n * inserts a new control at the specified index. If the index is undefined\n * the new control will be added to the end.\n *\n * @param index (optional) the index where the control should be created\n * @param state (optional) the initial state of the new control\n */\n public insertAt(index?: number, state?: T): void {\n const insertIndex = index ?? this.controls.length;\n const controlOrDefinition = this._builder(state, {\n controlId: insertIndex.toFixed(0),\n });\n\n this._controlInsertedFn(insertIndex, controlOrDefinition);\n\n if (insertIndex < this.controls.length) {\n // update the control ids for all controls, that are moved.\n for (let i = insertIndex; i < this.controls.length; i++) {\n Reflect.set(this.controls[i], 'controlId', (i + 1).toFixed(0));\n }\n }\n\n // call the super insert after the update, bc the insert method will\n // trigger a change detection\n if (controlOrDefinition instanceof NgAbstractControl) {\n super.insert(insertIndex, controlOrDefinition);\n } else {\n super.insert(insertIndex, controlOrDefinition.rxapFormGroup!);\n }\n }\n\n public disabledWhile(\n observable: Observable<boolean>,\n options?: ControlOptions\n ) {\n return controlDisabledWhile(this, observable, options);\n }\n\n public enabledWhile(\n observable: Observable<boolean>,\n options?: ControlOptions\n ) {\n return controlEnabledWhile(this, observable, options);\n }\n\n public mergeValidators(validators: Validator) {\n mergeControlValidators(this, validators);\n }\n\n public mergeAsyncValidators(validators: AsyncValidator) {\n this.setAsyncValidators([\n ...coerceArray(this.asyncValidator),\n ...coerceArray(validators),\n ]);\n this.updateValueAndValidity();\n }\n\n public markAllAsDirty(): void {\n markAllDirty(this);\n }\n\n public markAllAsPristine(): void {\n markAllPristine(this);\n }\n\n public setValue(\n valueOrObservable: T[] | Observable<T[]>,\n options?: ControlEventOptions\n ): Subscription | void {\n if (isObservable(valueOrObservable)) {\n return valueOrObservable.subscribe((value) =>\n super.setValue(value, options)\n );\n }\n\n super.setValue(valueOrObservable, options);\n }\n\n public markAllAsUntouched(): void {\n markAllUntouched(this);\n }\n\n public validateOn(observableValidation: Observable<null | object>) {\n return observableValidation.subscribe((maybeError) => {\n this.setErrors(maybeError);\n });\n }\n\n public hasErrorAndTouched(\n errorCode: ExtractStrings<E>,\n path?: ControlPath\n ): boolean {\n return hasErrorAndTouched(this, errorCode, path);\n }\n\n public patchValue(\n valueOrObservable: any,\n options?: ControlEventOptions\n ): Subscription | void {\n if (isObservable<T[]>(valueOrObservable)) {\n return valueOrObservable.subscribe((value: T[]) => {\n super.patchValue(value, options);\n });\n }\n\n super.patchValue(valueOrObservable as T[], options);\n }\n\n public hasErrorAndDirty(\n errorCode: ExtractStrings<E>,\n path?: ControlPath\n ): boolean {\n return hasErrorAndDirty(this, errorCode, path);\n }\n public removeAt(index: number) {\n console.warn('It is not recommend to use the FormArray.removeAt method');\n super.removeAt(index);\n this._controlRemovedFn(index);\n }\n\n public setEnable(enable = true, opts?: ControlEventOptions) {\n enableControl(this, enable, opts);\n }\n public push(control: AbstractControl<T>): void {\n console.warn('It is not recommend to use the FormArray.push method');\n return super.push(control);\n }\n\n public setDisable(disable = true, opts?: ControlEventOptions) {\n disableControl(this, disable, opts);\n }\n\n public setControl(index: number, control: AbstractControl<T>): void {\n console.warn('It is not recommend to use the FormArray.setControl method');\n return super.setControl(index, control);\n }\n\n public markAsTouched(opts?: OnlySelf): void {\n super.markAsTouched(opts);\n this.touchChanges.next(true);\n }\n\n public markAsUntouched(opts?: OnlySelf): void {\n super.markAsUntouched(opts);\n this.touchChanges.next(false);\n }\n\n public markAsPristine(opts?: OnlySelf): void {\n super.markAsPristine(opts);\n this.dirtyChanges.next(false);\n }\n\n public markAsDirty(opts?: OnlySelf): void {\n super.markAsDirty(opts);\n this.dirtyChanges.next(true);\n }\n\n public reset(value?: T[], options?: ControlEventOptions): void {\n super.reset(value, options);\n }\n\n public setValidators(\n newValidator: Validator,\n updateValueAndValidity: boolean = true\n ): void {\n super.setValidators(newValidator);\n if (updateValueAndValidity) {\n super.updateValueAndValidity();\n }\n }\n\n public setAsyncValidators(\n newValidator: AsyncValidator,\n updateValueAndValidity: boolean = true\n ): void {\n super.setAsyncValidators(newValidator);\n if (updateValueAndValidity) {\n super.updateValueAndValidity();\n }\n }\n\n public hasError(errorCode: ExtractStrings<E>, path?: ControlPath) {\n return super.hasError(errorCode, path);\n }\n\n public setErrors(errors: Partial<E> | null, opts: EmitEvent = {}) {\n return super.setErrors(errors, opts);\n }\n\n public getError<K extends ExtractStrings<E>>(\n errorCode: K,\n path?: ControlPath\n ) {\n return super.getError(errorCode, path) as E[K] | null;\n }\n}\n"]}