@rxap/forms 18.0.2 → 18.0.3-dev.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 (281) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +14 -1
  3. package/compodoc/changelog.html +777 -0
  4. package/compodoc/classes/ControlValueAccessor.html +607 -0
  5. package/compodoc/classes/FormArrayControlManager.html +1177 -0
  6. package/compodoc/classes/RxapFormArray.html +3898 -0
  7. package/compodoc/classes/RxapFormBuilder.html +1132 -0
  8. package/compodoc/classes/RxapFormControl.html +3573 -0
  9. package/compodoc/classes/RxapFormGroup.html +6619 -0
  10. package/compodoc/dependencies.html +217 -0
  11. package/compodoc/directives/FormControlErrorDirective.html +496 -0
  12. package/compodoc/directives/FormControlMarkDirtyDirective.html +446 -0
  13. package/compodoc/directives/FormControlMarkPristineDirective.html +445 -0
  14. package/compodoc/directives/FormControlMarkTouchedDirective.html +438 -0
  15. package/compodoc/directives/FormControlMarkUntouchedDirective.html +445 -0
  16. package/compodoc/directives/FormControlNameDirective.html +527 -0
  17. package/compodoc/directives/FormDirective.html +2415 -0
  18. package/compodoc/directives/FormGroupNameDirective.html +500 -0
  19. package/compodoc/directives/FormLoadedDirective.html +374 -0
  20. package/compodoc/directives/FormLoadingDirective.html +374 -0
  21. package/compodoc/directives/FormLoadingErrorDirective.html +370 -0
  22. package/compodoc/directives/FormSubmitDirective.html +690 -0
  23. package/compodoc/directives/FormSubmitFailedDirective.html +370 -0
  24. package/compodoc/directives/FormSubmitInvalidDirective.html +368 -0
  25. package/compodoc/directives/FormSubmitSuccessfulDirective.html +368 -0
  26. package/compodoc/directives/FormSubmittingDirective.html +374 -0
  27. package/compodoc/directives/ParentControlContainerDirective.html +274 -0
  28. package/compodoc/fonts/ionicons.eot +0 -0
  29. package/compodoc/fonts/ionicons.svg +2090 -0
  30. package/compodoc/fonts/ionicons.ttf +0 -0
  31. package/compodoc/fonts/ionicons.woff +0 -0
  32. package/compodoc/fonts/ionicons.woff2 +0 -0
  33. package/compodoc/fonts/roboto-v15-latin-300.eot +0 -0
  34. package/compodoc/fonts/roboto-v15-latin-300.svg +314 -0
  35. package/compodoc/fonts/roboto-v15-latin-300.ttf +0 -0
  36. package/compodoc/fonts/roboto-v15-latin-300.woff +0 -0
  37. package/compodoc/fonts/roboto-v15-latin-300.woff2 +0 -0
  38. package/compodoc/fonts/roboto-v15-latin-700.eot +0 -0
  39. package/compodoc/fonts/roboto-v15-latin-700.svg +310 -0
  40. package/compodoc/fonts/roboto-v15-latin-700.ttf +0 -0
  41. package/compodoc/fonts/roboto-v15-latin-700.woff +0 -0
  42. package/compodoc/fonts/roboto-v15-latin-700.woff2 +0 -0
  43. package/compodoc/fonts/roboto-v15-latin-italic.eot +0 -0
  44. package/compodoc/fonts/roboto-v15-latin-italic.svg +323 -0
  45. package/compodoc/fonts/roboto-v15-latin-italic.ttf +0 -0
  46. package/compodoc/fonts/roboto-v15-latin-italic.woff +0 -0
  47. package/compodoc/fonts/roboto-v15-latin-italic.woff2 +0 -0
  48. package/compodoc/fonts/roboto-v15-latin-regular.eot +0 -0
  49. package/compodoc/fonts/roboto-v15-latin-regular.svg +308 -0
  50. package/compodoc/fonts/roboto-v15-latin-regular.ttf +0 -0
  51. package/compodoc/fonts/roboto-v15-latin-regular.woff +0 -0
  52. package/compodoc/fonts/roboto-v15-latin-regular.woff2 +0 -0
  53. package/compodoc/graph/dependencies.svg +450 -0
  54. package/compodoc/images/compodoc-vectorise-inverted.png +0 -0
  55. package/compodoc/images/compodoc-vectorise-inverted.svg +201 -0
  56. package/compodoc/images/compodoc-vectorise.png +0 -0
  57. package/compodoc/images/compodoc-vectorise.svg +201 -0
  58. package/compodoc/images/favicon.ico +0 -0
  59. package/compodoc/index.html +197 -0
  60. package/compodoc/interfaces/AbstractControl.html +622 -0
  61. package/compodoc/interfaces/AbstractControlOptions.html +448 -0
  62. package/compodoc/interfaces/BoxedValue.html +436 -0
  63. package/compodoc/interfaces/ComplexityOptions.html +819 -0
  64. package/compodoc/interfaces/ControlOptions.html +689 -0
  65. package/compodoc/interfaces/ControlSetValueOptions.html +345 -0
  66. package/compodoc/interfaces/FormArrayOptions.html +544 -0
  67. package/compodoc/interfaces/FormDefinition.html +626 -0
  68. package/compodoc/interfaces/FormDefinitionArray.html +427 -0
  69. package/compodoc/interfaces/FormDefinitionMetadata.html +486 -0
  70. package/compodoc/interfaces/FormGroupOptions.html +427 -0
  71. package/compodoc/interfaces/FormLoadFailedMethod.html +360 -0
  72. package/compodoc/interfaces/FormLoadMethod.html +330 -0
  73. package/compodoc/interfaces/FormLoadSuccessfulMethod.html +360 -0
  74. package/compodoc/interfaces/FormOptions.html +427 -0
  75. package/compodoc/interfaces/FormSubmitFailedMethod.html +360 -0
  76. package/compodoc/interfaces/FormSubmitMethod.html +360 -0
  77. package/compodoc/interfaces/FormSubmitSuccessfulMethod.html +360 -0
  78. package/compodoc/interfaces/InjectableValidator.html +472 -0
  79. package/compodoc/interfaces/IsNumberOptions.html +515 -0
  80. package/compodoc/interfaces/LengthOptions.html +564 -0
  81. package/compodoc/interfaces/NgValidatorsErrors.html +613 -0
  82. package/compodoc/interfaces/RegexOptions.html +603 -0
  83. package/compodoc/interfaces/RxapAbstractControlOptionsWithDefinition.html +427 -0
  84. package/compodoc/js/compodoc.js +14 -0
  85. package/compodoc/js/lazy-load-graphs.js +44 -0
  86. package/compodoc/js/libs/EventDispatcher.js +5 -0
  87. package/compodoc/js/libs/bootstrap-native.js +2 -0
  88. package/compodoc/js/libs/clipboard.min.js +7 -0
  89. package/compodoc/js/libs/custom-elements-es5-adapter.js +15 -0
  90. package/compodoc/js/libs/custom-elements.min.js +38 -0
  91. package/compodoc/js/libs/d3.v3.min.js +2 -0
  92. package/compodoc/js/libs/deep-iterator.js +2 -0
  93. package/compodoc/js/libs/es6-shim.min.js +12 -0
  94. package/compodoc/js/libs/htmlparser.js +23 -0
  95. package/compodoc/js/libs/innersvg.js +9 -0
  96. package/compodoc/js/libs/lit-html.js +1 -0
  97. package/compodoc/js/libs/prism.js +46 -0
  98. package/compodoc/js/libs/promise.min.js +6 -0
  99. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -0
  100. package/compodoc/js/libs/tablesort.min.js +6 -0
  101. package/compodoc/js/libs/tablesort.number.min.js +6 -0
  102. package/compodoc/js/libs/vis.min.js +47 -0
  103. package/compodoc/js/libs/zepto.min.js +2 -0
  104. package/compodoc/js/menu-wc.js +339 -0
  105. package/compodoc/js/menu-wc_es5.js +40 -0
  106. package/compodoc/js/menu.js +270 -0
  107. package/compodoc/js/routes.js +301 -0
  108. package/compodoc/js/search/lunr.min.js +6 -0
  109. package/compodoc/js/search/search-lunr.js +67 -0
  110. package/compodoc/js/search/search.js +283 -0
  111. package/compodoc/js/search/search_index.js +4 -0
  112. package/compodoc/js/sourceCode.js +58 -0
  113. package/compodoc/js/svg-pan-zoom.controls.js +53 -0
  114. package/compodoc/js/tabs.js +21 -0
  115. package/compodoc/js/tree.js +147 -0
  116. package/compodoc/license.html +731 -0
  117. package/compodoc/miscellaneous/enumerations.html +291 -0
  118. package/compodoc/miscellaneous/functions.html +3827 -0
  119. package/compodoc/miscellaneous/typealiases.html +657 -0
  120. package/compodoc/miscellaneous/variables.html +554 -0
  121. package/compodoc/modules/RxapFormsModule/dependencies.svg +450 -0
  122. package/compodoc/modules/RxapFormsModule.html +864 -0
  123. package/compodoc/modules.html +200 -0
  124. package/compodoc/overview.html +681 -0
  125. package/compodoc/properties.html +195 -0
  126. package/compodoc/styles/bootstrap-card.css +219 -0
  127. package/compodoc/styles/bootstrap.min.css +6 -0
  128. package/compodoc/styles/compodoc.css +1124 -0
  129. package/compodoc/styles/dark.css +121 -0
  130. package/compodoc/styles/ionicons.min.css +11 -0
  131. package/compodoc/styles/laravel.css +113 -0
  132. package/compodoc/styles/material.css +131 -0
  133. package/compodoc/styles/original.css +51 -0
  134. package/compodoc/styles/postmark.css +238 -0
  135. package/compodoc/styles/prism.css +301 -0
  136. package/compodoc/styles/readthedocs.css +117 -0
  137. package/compodoc/styles/reset.css +129 -0
  138. package/compodoc/styles/stripe.css +106 -0
  139. package/compodoc/styles/style.css +7 -0
  140. package/compodoc/styles/tablesort.css +33 -0
  141. package/compodoc/styles/vagrant.css +130 -0
  142. package/docs/.nojekyll +1 -0
  143. package/docs/assets/highlight.css +92 -0
  144. package/docs/assets/icons.js +15 -0
  145. package/docs/assets/icons.svg +1 -0
  146. package/docs/assets/main.js +59 -0
  147. package/docs/assets/navigation.js +1 -0
  148. package/docs/assets/search.js +1 -0
  149. package/docs/assets/style.css +1412 -0
  150. package/docs/classes/ControlValueAccessor.html +8 -0
  151. package/docs/classes/FormArrayControlManager.html +6 -0
  152. package/docs/classes/FormControlErrorDirective.html +11 -0
  153. package/docs/classes/FormControlMarkDirtyDirective.html +4 -0
  154. package/docs/classes/FormControlMarkPristineDirective.html +4 -0
  155. package/docs/classes/FormControlMarkTouchedDirective.html +4 -0
  156. package/docs/classes/FormControlMarkUntouchedDirective.html +4 -0
  157. package/docs/classes/FormControlNameDirective.html +113 -0
  158. package/docs/classes/FormDirective.html +187 -0
  159. package/docs/classes/FormGroupNameDirective.html +101 -0
  160. package/docs/classes/FormLoadedDirective.html +8 -0
  161. package/docs/classes/FormLoadingDirective.html +8 -0
  162. package/docs/classes/FormLoadingErrorDirective.html +8 -0
  163. package/docs/classes/FormSubmitDirective.html +15 -0
  164. package/docs/classes/FormSubmitFailedDirective.html +8 -0
  165. package/docs/classes/FormSubmitInvalidDirective.html +8 -0
  166. package/docs/classes/FormSubmitSuccessfulDirective.html +8 -0
  167. package/docs/classes/FormSubmittingDirective.html +8 -0
  168. package/docs/classes/ParentControlContainerDirective.html +2 -0
  169. package/docs/classes/RxapFormArray.html +429 -0
  170. package/docs/classes/RxapFormBuilder.html +65 -0
  171. package/docs/classes/RxapFormControl.html +264 -0
  172. package/docs/classes/RxapFormGroup.html +260 -0
  173. package/docs/classes/RxapFormsModule.html +2 -0
  174. package/docs/documentation.json +91243 -0
  175. package/docs/enums/MetadataKeys.html +9 -0
  176. package/docs/functions/ControlAsyncValidator.html +1 -0
  177. package/docs/functions/ControlChange.html +1 -0
  178. package/docs/functions/ControlSetValue.html +1 -0
  179. package/docs/functions/ControlValidator.html +1 -0
  180. package/docs/functions/IsArray.html +1 -0
  181. package/docs/functions/IsBoolean.html +1 -0
  182. package/docs/functions/IsComplex.html +1 -0
  183. package/docs/functions/IsDate.html +1 -0
  184. package/docs/functions/IsEmail.html +1 -0
  185. package/docs/functions/IsEnum.html +1 -0
  186. package/docs/functions/IsIP.html +1 -0
  187. package/docs/functions/IsInt.html +1 -0
  188. package/docs/functions/IsNumber.html +2 -0
  189. package/docs/functions/IsObject.html +1 -0
  190. package/docs/functions/IsPhoneNumber.html +1 -0
  191. package/docs/functions/IsPort.html +1 -0
  192. package/docs/functions/IsString.html +1 -0
  193. package/docs/functions/IsUUID.html +1 -0
  194. package/docs/functions/IsUrl.html +1 -0
  195. package/docs/functions/RxapForm.html +1 -0
  196. package/docs/functions/ToFormMethod.html +1 -0
  197. package/docs/functions/ToFormSubmitMethod.html +3 -0
  198. package/docs/functions/UseFormArrayControl.html +1 -0
  199. package/docs/functions/UseFormArrayGroup.html +1 -0
  200. package/docs/functions/UseFormControl.html +1 -0
  201. package/docs/functions/UseFormGroup.html +1 -0
  202. package/docs/functions/_IsNumber.html +1 -0
  203. package/docs/functions/controlDisabledWhile.html +1 -0
  204. package/docs/functions/controlDisabled_.html +1 -0
  205. package/docs/functions/controlEnabledWhile.html +1 -0
  206. package/docs/functions/controlEnabled_.html +1 -0
  207. package/docs/functions/controlErrorChanges_.html +1 -0
  208. package/docs/functions/controlReadonly_.html +1 -0
  209. package/docs/functions/controlStatusChanges_.html +1 -0
  210. package/docs/functions/controlValueChanges_.html +1 -0
  211. package/docs/functions/disableControl.html +1 -0
  212. package/docs/functions/enableControl.html +1 -0
  213. package/docs/functions/hasErrorAndDirty.html +1 -0
  214. package/docs/functions/hasErrorAndTouched.html +1 -0
  215. package/docs/functions/isNumber-1.html +2 -0
  216. package/docs/functions/markAllDirty.html +1 -0
  217. package/docs/functions/markAllPristine.html +1 -0
  218. package/docs/functions/markAllUntouched.html +1 -0
  219. package/docs/functions/mergeControlValidators.html +1 -0
  220. package/docs/functions/selectControlValue_.html +1 -0
  221. package/docs/functions/validateControlOn.html +1 -0
  222. package/docs/hierarchy.html +1 -0
  223. package/docs/index.html +25 -0
  224. package/docs/interfaces/AbstractControl.html +373 -0
  225. package/docs/interfaces/AbstractControlOptions.html +5 -0
  226. package/docs/interfaces/BoxedValue.html +3 -0
  227. package/docs/interfaces/ComplexityOptions.html +11 -0
  228. package/docs/interfaces/ControlOptions.html +20 -0
  229. package/docs/interfaces/ControlSetValueOptions.html +3 -0
  230. package/docs/interfaces/FormArrayOptions.html +16 -0
  231. package/docs/interfaces/FormDefinition.html +13 -0
  232. package/docs/interfaces/FormDefinitionArray.html +179 -0
  233. package/docs/interfaces/FormDefinitionMetadata.html +17 -0
  234. package/docs/interfaces/FormGroupOptions.html +13 -0
  235. package/docs/interfaces/FormLoadFailedMethod.html +3 -0
  236. package/docs/interfaces/FormLoadMethod.html +3 -0
  237. package/docs/interfaces/FormLoadSuccessfulMethod.html +3 -0
  238. package/docs/interfaces/FormOptions.html +13 -0
  239. package/docs/interfaces/FormSubmitFailedMethod.html +3 -0
  240. package/docs/interfaces/FormSubmitMethod.html +3 -0
  241. package/docs/interfaces/FormSubmitSuccessfulMethod.html +3 -0
  242. package/docs/interfaces/InjectableValidator.html +3 -0
  243. package/docs/interfaces/IsNumberOptions.html +6 -0
  244. package/docs/interfaces/NgValidatorsErrors.html +8 -0
  245. package/docs/interfaces/RxapAbstractControlOptionsWithDefinition.html +13 -0
  246. package/docs/interfaces/_RxapAbstractControlOptions.html +12 -0
  247. package/docs/modules.html +128 -0
  248. package/docs/types/AsyncValidator.html +1 -0
  249. package/docs/types/AsyncValidatorFn.html +1 -0
  250. package/docs/types/ChangeFn.html +1 -0
  251. package/docs/types/ControlEventOptions.html +1 -0
  252. package/docs/types/ControlInsertedFn.html +1 -0
  253. package/docs/types/ControlPath.html +1 -0
  254. package/docs/types/ControlRemovedFn.html +1 -0
  255. package/docs/types/ControlState.html +1 -0
  256. package/docs/types/EmitEvent.html +1 -0
  257. package/docs/types/ExtractAbstractControl.html +1 -0
  258. package/docs/types/ExtractStrings.html +1 -0
  259. package/docs/types/FormBuilderFn.html +1 -0
  260. package/docs/types/FormType.html +1 -0
  261. package/docs/types/KeyValueControls.html +1 -0
  262. package/docs/types/OnlySelf.html +1 -0
  263. package/docs/types/OrBoxedValue.html +1 -0
  264. package/docs/types/RxapAbstractControlOptions.html +1 -0
  265. package/docs/types/SetValueFn.html +1 -0
  266. package/docs/types/ValidationErrors.html +1 -0
  267. package/docs/types/Validator.html +1 -0
  268. package/docs/types/ValidatorFn.html +1 -0
  269. package/docs/types/ValidatorOrOpts.html +1 -0
  270. package/docs/variables/RXAP_FORM_CONTEXT.html +1 -0
  271. package/docs/variables/RXAP_FORM_DEFINITION.html +1 -0
  272. package/docs/variables/RXAP_FORM_DEFINITION_BUILDER.html +1 -0
  273. package/docs/variables/RXAP_FORM_INITIAL_STATE.html +1 -0
  274. package/docs/variables/RXAP_FORM_LOAD_FAILED_METHOD.html +1 -0
  275. package/docs/variables/RXAP_FORM_LOAD_METHOD.html +1 -0
  276. package/docs/variables/RXAP_FORM_LOAD_SUCCESSFUL_METHOD.html +1 -0
  277. package/docs/variables/RXAP_FORM_SUBMIT_FAILED_METHOD.html +1 -0
  278. package/docs/variables/RXAP_FORM_SUBMIT_METHOD.html +1 -0
  279. package/docs/variables/RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD.html +1 -0
  280. package/docs/variables/RxapValidators.html +1 -0
  281. package/package.json +20 -18
@@ -0,0 +1,1132 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
6
+ <title>angular-forms</title>
7
+ <meta name="description" content="">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+
10
+ <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
11
+ <link rel="stylesheet" href="../styles/style.css">
12
+ <link rel="stylesheet" href="../styles/dark.css">
13
+ </head>
14
+ <body>
15
+ <script>
16
+ // Blocking script to avoid flickering dark mode
17
+ // Dark mode toggle button
18
+ var useDark = window.matchMedia('(prefers-color-scheme: dark)');
19
+ var darkModeState = useDark.matches;
20
+ var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
21
+ var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
22
+ var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
23
+
24
+ function checkToggle(check) {
25
+ for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
26
+ $darkModeToggleSwitchers[i].checked = check;
27
+ }
28
+ }
29
+
30
+ function toggleDarkMode(state) {
31
+ if (window.localStorage) {
32
+ localStorage.setItem('compodoc_darkmode-state', state);
33
+ }
34
+
35
+ checkToggle(state);
36
+
37
+ const hasClass = document.body.classList.contains('dark');
38
+
39
+ if (state) {
40
+ for (var i = 0; i < $darkModeToggles.length; i++) {
41
+ $darkModeToggles[i].classList.add('dark');
42
+ }
43
+ if (!hasClass) {
44
+ document.body.classList.add('dark');
45
+ }
46
+ } else {
47
+ for (var i = 0; i < $darkModeToggles.length; i++) {
48
+ $darkModeToggles[i].classList.remove('dark');
49
+ }
50
+ if (hasClass) {
51
+ document.body.classList.remove('dark');
52
+ }
53
+ }
54
+ }
55
+
56
+ useDark.addEventListener('change', function (evt) {
57
+ toggleDarkMode(evt.matches);
58
+ });
59
+ if (darkModeStateLocal) {
60
+ darkModeState = darkModeStateLocal === 'true';
61
+ }
62
+ toggleDarkMode(darkModeState);
63
+ </script>
64
+
65
+ <div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
66
+ <div class="d-flex">
67
+ <a href="../" class="navbar-brand">angular-forms</a>
68
+ <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
69
+ </div>
70
+ </div>
71
+
72
+ <div class="xs-menu menu" id="mobile-menu">
73
+ <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
74
+ </div>
75
+
76
+ <div class="container-fluid main">
77
+ <div class="row main">
78
+ <div class="d-none d-md-block menu">
79
+ <compodoc-menu mode="normal"></compodoc-menu>
80
+ </div>
81
+ <!-- START CONTENT -->
82
+ <div class="content class">
83
+ <div class="content-data">
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <ol class="breadcrumb">
97
+ <li class="breadcrumb-item">Classes</li>
98
+ <li class="breadcrumb-item" >RxapFormBuilder</li>
99
+ </ol>
100
+
101
+ <ul class="nav nav-tabs" role="tablist">
102
+ <li class="nav-item">
103
+ <a href="#info"
104
+ class="nav-link"
105
+ class="nav-link active"
106
+ role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
107
+ </li>
108
+ <li class="nav-item">
109
+ <a href="#source"
110
+ class="nav-link"
111
+
112
+ role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
113
+ </li>
114
+ </ul>
115
+
116
+ <div class="tab-content">
117
+ <div class="tab-pane fade active in" id="info">
118
+ <p class="comment">
119
+ <h3>File</h3>
120
+ </p>
121
+ <p class="comment">
122
+ <code>src/lib/form-builder.ts</code>
123
+ </p>
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <section data-compodoc="block-index">
131
+ <h3 id="index">Index</h3>
132
+ <table class="table table-sm table-bordered index-table">
133
+ <tbody>
134
+
135
+ <tr>
136
+ <td class="col-md-4">
137
+ <h6><b>Methods</b></h6>
138
+ </td>
139
+ </tr>
140
+ <tr>
141
+ <td class="col-md-4">
142
+ <ul class="index-list">
143
+ <li>
144
+ <span class="modifier">Public</span>
145
+ <a href="#build" >build</a>
146
+ </li>
147
+ </ul>
148
+ </td>
149
+ </tr>
150
+
151
+
152
+
153
+
154
+
155
+ </tbody>
156
+ </table>
157
+ </section>
158
+
159
+ <section data-compodoc="block-constructor">
160
+ <h3 id="constructor">Constructor</h3>
161
+ <table class="table table-sm table-bordered">
162
+ <tbody>
163
+ <tr>
164
+ <td class="col-md-4">
165
+ <code>constructor(definition: Constructor<Form>, injector: Injector, providers: StaticProvider[])</code>
166
+ </td>
167
+ </tr>
168
+ <tr>
169
+ <td class="col-md-4">
170
+ <div class="io-line">Defined in <a href="" data-line="87" class="link-to-prism">src/lib/form-builder.ts:87</a></div>
171
+ </td>
172
+ </tr>
173
+
174
+ <tr>
175
+ <td class="col-md-4">
176
+ <div>
177
+ <b>Parameters :</b>
178
+ <table class="params">
179
+ <thead>
180
+ <tr>
181
+ <td>Name</td>
182
+ <td>Type</td>
183
+ <td>Optional</td>
184
+ </tr>
185
+ </thead>
186
+ <tbody>
187
+ <tr>
188
+ <td>definition</td>
189
+
190
+ <td>
191
+ <code>Constructor&lt;Form&gt;</code>
192
+ </td>
193
+
194
+ <td>
195
+ No
196
+ </td>
197
+
198
+ </tr>
199
+ <tr>
200
+ <td>injector</td>
201
+
202
+ <td>
203
+ <code>Injector</code>
204
+ </td>
205
+
206
+ <td>
207
+ No
208
+ </td>
209
+
210
+ </tr>
211
+ <tr>
212
+ <td>providers</td>
213
+
214
+ <td>
215
+ <code>StaticProvider[]</code>
216
+ </td>
217
+
218
+ <td>
219
+ No
220
+ </td>
221
+
222
+ </tr>
223
+ </tbody>
224
+ </table>
225
+ </div>
226
+ </td>
227
+ </tr>
228
+ </tbody>
229
+ </table>
230
+ </section>
231
+
232
+
233
+ <section data-compodoc="block-methods">
234
+
235
+ <h3 id="methods">
236
+ Methods
237
+ </h3>
238
+ <table class="table table-sm table-bordered">
239
+ <tbody>
240
+ <tr>
241
+ <td class="col-md-4">
242
+ <a name="build"></a>
243
+ <span class="name">
244
+ <span class="modifier">Public</span>
245
+ <span ><b>build</b></span>
246
+ <a href="#build"><span class="icon ion-ios-link"></span></a>
247
+ </span>
248
+ </td>
249
+ </tr>
250
+ <tr>
251
+ <td class="col-md-4">
252
+ <span class="modifier-icon icon ion-ios-reset"></span>
253
+ <code>build(state: Readonly<any>, options: Partial<>)</code>
254
+ </td>
255
+ </tr>
256
+
257
+
258
+ <tr>
259
+ <td class="col-md-4">
260
+ <div class="io-line">Defined in <a href="" data-line="118"
261
+ class="link-to-prism">src/lib/form-builder.ts:118</a></div>
262
+ </td>
263
+ </tr>
264
+
265
+ <tr>
266
+ <td class="col-md-4">
267
+ <b>Type parameters :</b>
268
+ <ul class="type-parameters">
269
+ <li>T</li>
270
+ </ul>
271
+ </td>
272
+ </tr>
273
+
274
+ <tr>
275
+ <td class="col-md-4">
276
+
277
+ <div class="io-description">
278
+ <b>Parameters :</b>
279
+
280
+ <table class="params">
281
+ <thead>
282
+ <tr>
283
+ <td>Name</td>
284
+ <td>Type</td>
285
+ <td>Optional</td>
286
+ <td>Default value</td>
287
+ </tr>
288
+ </thead>
289
+ <tbody>
290
+ <tr>
291
+ <td>state</td>
292
+ <td>
293
+ <code>Readonly&lt;any&gt;</code>
294
+ </td>
295
+
296
+ <td>
297
+ No
298
+ </td>
299
+
300
+ <td>
301
+ <code>{}</code>
302
+ </td>
303
+
304
+ </tr>
305
+ <tr>
306
+ <td>options</td>
307
+ <td>
308
+ <code>Partial&lt;&gt;</code>
309
+ </td>
310
+
311
+ <td>
312
+ No
313
+ </td>
314
+
315
+ <td>
316
+ <code>{}</code>
317
+ </td>
318
+
319
+ </tr>
320
+ </tbody>
321
+ </table>
322
+ </div>
323
+ <div class="io-description">
324
+ <b>Returns : </b> <code>T</code>
325
+
326
+ </div>
327
+ <div class="io-description">
328
+
329
+ </div>
330
+ </td>
331
+ </tr>
332
+ </tbody>
333
+ </table>
334
+ </section>
335
+
336
+
337
+
338
+
339
+
340
+ </div>
341
+
342
+
343
+ <div class="tab-pane fade tab-source-code" id="source">
344
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
345
+ Injector,
346
+ isDevMode,
347
+ StaticProvider,
348
+ } from &#x27;@angular/core&#x27;;
349
+ import {
350
+ assertIsArray,
351
+ assertIsFunction,
352
+ assertIsObject,
353
+ Constructor,
354
+ HasRxapOnInitMethod,
355
+ } from &#x27;@rxap/utilities&#x27;;
356
+ import { MetadataKeys } from &#x27;./decorators/metadata-keys&#x27;;
357
+ import {
358
+ AbstractControl,
359
+ AsyncValidatorFn,
360
+ ValidatorFn,
361
+ Validators,
362
+ } from &#x27;@angular/forms&#x27;;
363
+ import {
364
+ ChangeFn,
365
+ FormDefinition,
366
+ FormDefinitionMetadata,
367
+ FormType,
368
+ RxapAbstractControlOptions,
369
+ RxapAbstractControlOptionsWithDefinition,
370
+ SetValueFn,
371
+ } from &#x27;./model&#x27;;
372
+ import { RxapFormArray } from &#x27;./form-array&#x27;;
373
+ import { RxapFormGroup } from &#x27;./form-group&#x27;;
374
+ import { RxapFormControl } from &#x27;./form-control&#x27;;
375
+ import { GetDefinitionMetadata } from &#x27;@rxap/definition&#x27;;
376
+ import { ControlSetValueOptions } from &#x27;./decorators/control-set-value&#x27;;
377
+ import { getMetadata } from &#x27;@rxap/reflect-metadata&#x27;;
378
+
379
+ export class FormArrayControlManager&lt;T extends FormDefinition&gt; {
380
+ constructor(private readonly form: T, private readonly controlId: keyof T) {
381
+ }
382
+
383
+ public inserted(
384
+ index: number,
385
+ controlOrDefinition: AbstractControl | FormDefinition,
386
+ ): void {
387
+ const controlContainer &#x3D; this.form[this.controlId];
388
+ if (Array.isArray(controlContainer)) {
389
+ controlContainer.splice(index, 0, controlOrDefinition);
390
+ } else {
391
+ throw new Error(
392
+ &#x27;Could not register inserted control or definition. The control id does not points to an array of control or definition instance!&#x27;,
393
+ );
394
+ }
395
+ }
396
+
397
+ public removed(index: number): void {
398
+ const controlContainer &#x3D; this.form[this.controlId];
399
+ if (Array.isArray(controlContainer)) {
400
+ controlContainer.splice(index, 1);
401
+ } else {
402
+ throw new Error(
403
+ &#x27;Could not register inserted control or definition. The control id does not points to an array of control or definition instance!&#x27;,
404
+ );
405
+ }
406
+ }
407
+ }
408
+
409
+ export class RxapFormBuilder&lt;
410
+ Data extends Record&lt;string, any&gt; &#x3D; any,
411
+ Form extends FormType&lt;Data&gt; &#x3D; FormType&lt;Data&gt;
412
+ &gt; {
413
+ private readonly formArrayGroups: Map&lt;
414
+ string,
415
+ RxapAbstractControlOptionsWithDefinition
416
+ &gt;;
417
+ private readonly formArrayControls: Map&lt;string, RxapAbstractControlOptions&gt;;
418
+ private readonly formControls: Map&lt;string, RxapAbstractControlOptions&gt;;
419
+ private readonly formGroups: Map&lt;
420
+ string,
421
+ RxapAbstractControlOptionsWithDefinition
422
+ &gt;;
423
+ private readonly formOptions: FormDefinitionMetadata;
424
+ private readonly validators: Map&lt;string, Set&lt;string&gt;&gt;;
425
+ private readonly asyncValidators: Map&lt;string, Set&lt;string&gt;&gt;;
426
+ private readonly controlChanges: Map&lt;string, Set&lt;string&gt;&gt;;
427
+ private readonly controlSetValue: Map&lt;string, Set&lt;ControlSetValueOptions&gt;&gt;;
428
+
429
+ private readonly providers: StaticProvider[];
430
+
431
+ constructor(
432
+ private readonly definition: Constructor&lt;Form&gt;,
433
+ private readonly injector: Injector &#x3D; Injector.NULL,
434
+ providers: StaticProvider[] &#x3D; [],
435
+ ) {
436
+ this.formArrayGroups &#x3D; this.extractArrayGroups();
437
+ this.formArrayControls &#x3D; this.extractArrayControls();
438
+ this.formControls &#x3D; this.extractControls();
439
+ this.formGroups &#x3D; this.extractGroups();
440
+ this.validators &#x3D; this.extractValidators();
441
+ this.asyncValidators &#x3D; this.extractAsyncValidators();
442
+ this.controlChanges &#x3D; this.extractControlChanges();
443
+ this.controlSetValue &#x3D; this.extractControlSetValue();
444
+ const formOptions &#x3D; (this.formOptions &#x3D; this.extractFormOptions());
445
+
446
+ // merge the providers from the from options with the providers from the
447
+ // constructor. If the provider is defined in the form options and constructor
448
+ // then the provider from the constructor will be used.
449
+ this.providers &#x3D; [ ...providers, ...(formOptions.providers ?? []) ].filter(
450
+ (provider: any, index, self) &#x3D;&gt;
451
+ provider[&#x27;provide&#x27;] &amp;&amp;
452
+ self.findIndex(
453
+ (selfProvider: any) &#x3D;&gt;
454
+ selfProvider.provide &amp;&amp;
455
+ selfProvider.provide &#x3D;&#x3D;&#x3D; provider.provide,
456
+ ) &#x3D;&#x3D;&#x3D; index,
457
+ );
458
+ }
459
+
460
+ public build&lt;T extends (FormDefinition&lt;Data&gt; | FormType&lt;Data&gt;)&gt;(
461
+ state: Readonly&lt;any&gt; &#x3D; {},
462
+ options: Partial&lt;FormDefinitionMetadata &amp; { controlId?: string }&gt; &#x3D; {},
463
+ ): T {
464
+ const injector &#x3D; Injector.create({
465
+ name: &#x60;rxap/form-builder/${ this.formOptions.id }&#x60;,
466
+ parent: this.injector,
467
+ providers: this.providers,
468
+ });
469
+
470
+ let form: Record&lt;string, Function&gt; &amp; FormDefinition;
471
+
472
+ // don&#x27;t use the notFoundValue feature of the injector.
473
+ // if used for each call of the get method an &quot;empty&quot; or &quot;fallback&quot;
474
+ // instance is created
475
+
476
+ try {
477
+ form &#x3D; injector.get(this.definition);
478
+ } catch (e: any) {
479
+ if (e.name &#x3D;&#x3D;&#x3D; &#x27;NullInjectorError&#x27;) {
480
+ if (e.message.includes(&#x60;No provider for ${ this.definition.name }&#x60;)) {
481
+ if (isDevMode()) {
482
+ console.warn(
483
+ &#x60;Could not inject the definition instance. Fallback and call the constructor of the definition class: ${ e.message }&#x60;);
484
+ }
485
+ form &#x3D; new this.definition() as any;
486
+ } else {
487
+ throw e;
488
+ }
489
+ } else {
490
+ throw new Error(&#x60;Could not inject the definition instance: ${ e.message }&#x60;);
491
+ }
492
+ }
493
+
494
+ const controls: Record&lt;string, AbstractControl&gt; &#x3D; {};
495
+
496
+ this.buildControls(state, form, controls);
497
+ this.buildGroups(state, form, controls);
498
+ this.buildArrayGroups(state, form, controls);
499
+ this.buildArrayControls(state, form, controls);
500
+
501
+ const formOptions &#x3D; {
502
+ ...this.formOptions,
503
+ controlId:
504
+ options.controlId ?? (options.id ? options.id : this.formOptions.id),
505
+ ...options,
506
+ };
507
+
508
+ form.rxapFormGroup &#x3D; new RxapFormGroup(controls, formOptions);
509
+
510
+ Reflect.set(form.rxapFormGroup, &#x27;_rxapFormDefinition&#x27;, form);
511
+
512
+ form.rxapMetadata &#x3D; this.formOptions;
513
+
514
+ if (HasRxapOnInitMethod(form)) {
515
+ form.rxapOnInit();
516
+ }
517
+
518
+ for (const control of Object.values(form.rxapFormGroup.controls)) {
519
+ if (control.controlId) {
520
+ const controlSetValueOnInit &#x3D; Array.from(
521
+ this.controlSetValue.get(control.controlId) ?? [],
522
+ ).filter((controlSetValueOptions) &#x3D;&gt; controlSetValueOptions.initial);
523
+ for (const onSetValue of this.coerceToFnArray&lt;SetValueFn&gt;(
524
+ form,
525
+ controlSetValueOnInit,
526
+ )) {
527
+ onSetValue(control.value, { initial: true });
528
+ }
529
+ }
530
+ }
531
+
532
+ return form as any;
533
+ }
534
+
535
+ private buildArrayControls(
536
+ builderFormState: any,
537
+ form: FormDefinition &amp; Record&lt;string, Function&gt;,
538
+ controls: Record&lt;string, AbstractControl&gt;,
539
+ ): void {
540
+ for (const [ controlId, options ] of this.formArrayControls.entries()) {
541
+ const formState &#x3D; this.coerceToArrayFormState(
542
+ controlId,
543
+ [],
544
+ builderFormState,
545
+ options.state,
546
+ );
547
+
548
+ assertIsArray(formState);
549
+
550
+ const formControls: any &#x3D; formState.map(
551
+ (fs, index) &#x3D;&gt; new RxapFormControl(fs, { controlId: index.toFixed(0) }),
552
+ );
553
+
554
+ const manager &#x3D; new FormArrayControlManager(form, controlId);
555
+
556
+ const formArray &#x3D;
557
+ (formControls.rxapFormArray &#x3D;
558
+ controls[controlId] &#x3D;
559
+ new RxapFormArray(
560
+ // TODO : add the formControlOptions property. To definition the form control options
561
+ formControls,
562
+ {
563
+ ...options,
564
+ controlId,
565
+ validators: [],
566
+ asyncValidators: [],
567
+ controlInsertedFn: manager.inserted.bind(manager),
568
+ controlRemovedFn: manager.removed.bind(manager),
569
+ builder: (state, controlOptions) &#x3D;&gt;
570
+ new RxapFormControl(state, controlOptions),
571
+ },
572
+ ));
573
+
574
+ // TODO : add support for injectable validators
575
+
576
+ formArray.setValidators(
577
+ this.coerceToValidatorArray(
578
+ form,
579
+ options.validators,
580
+ this.validators.get(controlId),
581
+ ),
582
+ false,
583
+ );
584
+ formArray.setAsyncValidators(
585
+ this.coerceToValidatorArray(
586
+ form,
587
+ options.asyncValidators,
588
+ this.asyncValidators.get(controlId),
589
+ ),
590
+ false,
591
+ );
592
+
593
+ Reflect.set(form, controlId, formControls);
594
+ }
595
+ }
596
+
597
+ private buildArrayGroups(
598
+ builderFormState: any,
599
+ form: FormDefinition &amp; Record&lt;string, Function&gt;,
600
+ controls: Record&lt;string, AbstractControl&gt;,
601
+ ): void {
602
+ for (const [ controlId, options ] of this.formArrayGroups.entries()) {
603
+ const formState &#x3D; this.coerceToArrayFormState(
604
+ controlId,
605
+ [],
606
+ builderFormState,
607
+ options.state,
608
+ );
609
+
610
+ assertIsArray(formState);
611
+
612
+ const formGroupBuilder &#x3D; new RxapFormBuilder(
613
+ options.definition,
614
+ this.injector,
615
+ this.providers,
616
+ );
617
+
618
+ // TODO : add the formGroupOptions property. To definition of the form group options
619
+ const formGroupDefinitions: any &#x3D; formState.map((fs, index) &#x3D;&gt;
620
+ formGroupBuilder.build(fs, { id: index.toFixed(0) }),
621
+ );
622
+
623
+ const manager &#x3D; new FormArrayControlManager(form, controlId);
624
+
625
+ const formArray &#x3D;
626
+ (formGroupDefinitions.rxapFormArray &#x3D;
627
+ controls[controlId] &#x3D;
628
+ new RxapFormArray(
629
+ formGroupDefinitions.map(
630
+ (fgd: FormDefinition) &#x3D;&gt; fgd.rxapFormGroup,
631
+ ),
632
+ {
633
+ ...options,
634
+ builder: formGroupBuilder.build.bind(formGroupBuilder) as any,
635
+ controlId,
636
+ validators: [],
637
+ asyncValidators: [],
638
+ controlInsertedFn: manager.inserted.bind(manager),
639
+ controlRemovedFn: manager.removed.bind(manager),
640
+ },
641
+ ));
642
+
643
+ // TODO : add support for injectable validators
644
+
645
+ formArray.setValidators(
646
+ this.coerceToValidatorArray(
647
+ form,
648
+ options.validators,
649
+ this.validators.get(controlId),
650
+ ),
651
+ false,
652
+ );
653
+ formArray.setAsyncValidators(
654
+ this.coerceToValidatorArray(
655
+ form,
656
+ options.asyncValidators,
657
+ this.asyncValidators.get(controlId),
658
+ ),
659
+ false,
660
+ );
661
+
662
+ Reflect.set(form, controlId, formGroupDefinitions);
663
+ }
664
+ }
665
+
666
+ private buildGroups(
667
+ builderFormState: any,
668
+ form: Record&lt;string, Function&gt;,
669
+ controls: Record&lt;string, AbstractControl&gt;,
670
+ ): void {
671
+ for (const [ controlId, options ] of this.formGroups.entries()) {
672
+ const formState &#x3D; this.coerceToGroupFormState(
673
+ controlId,
674
+ {},
675
+ builderFormState,
676
+ options.state,
677
+ );
678
+
679
+ assertIsObject(formState);
680
+
681
+ const formGroupDefinition: FormDefinition &#x3D; new RxapFormBuilder(
682
+ options.definition,
683
+ this.injector,
684
+ this.providers,
685
+ ).build(formState, {
686
+ ...options,
687
+ validators: [],
688
+ asyncValidators: [],
689
+ });
690
+
691
+ controls[controlId] &#x3D; formGroupDefinition.rxapFormGroup!;
692
+
693
+ const formGroup &#x3D; formGroupDefinition.rxapFormGroup;
694
+
695
+ // TODO : add support for injectable validators
696
+
697
+ formGroup.setValidators(
698
+ this.coerceToValidatorArray(
699
+ form,
700
+ options.validators,
701
+ this.validators.get(controlId),
702
+ ),
703
+ false,
704
+ );
705
+ formGroup.setAsyncValidators(
706
+ this.coerceToValidatorArray(
707
+ form,
708
+ options.asyncValidators,
709
+ this.asyncValidators.get(controlId),
710
+ ),
711
+ false,
712
+ );
713
+
714
+ // set the form group definition instance to the form definition instance
715
+ Reflect.set(form, controlId, formGroupDefinition);
716
+ }
717
+ }
718
+
719
+ private buildControls(
720
+ builderFormState: any,
721
+ form: Record&lt;string, Function&gt;,
722
+ controls: Record&lt;string, AbstractControl&gt;,
723
+ ): void {
724
+ for (const [ controlId, options ] of this.formControls.entries()) {
725
+ const control &#x3D; (controls[controlId] &#x3D; new (options.controlType ??
726
+ RxapFormControl)(
727
+ this.coerceToControlFormState(
728
+ controlId,
729
+ null,
730
+ builderFormState,
731
+ options.state,
732
+ ),
733
+ {
734
+ ...options,
735
+ controlId,
736
+ validators: [],
737
+ asyncValidators: [],
738
+ },
739
+ ));
740
+
741
+ const injectValidators: ValidatorFn[] &#x3D; [];
742
+ const injectAsyncValidators: AsyncValidatorFn[] &#x3D; [];
743
+
744
+ for (const injectValidator of options.injectValidators ?? []) {
745
+ const injectableValidator &#x3D; this.injector.get(injectValidator);
746
+ if (injectableValidator.validate) {
747
+ injectValidators.push(
748
+ injectableValidator.validate.bind(injectableValidator),
749
+ );
750
+ }
751
+ if (injectableValidator.asyncValidate) {
752
+ injectAsyncValidators.push(
753
+ injectableValidator.asyncValidate.bind(injectableValidator),
754
+ );
755
+ }
756
+ }
757
+
758
+ control.setValidators(
759
+ this.coerceToValidatorArray(
760
+ form,
761
+ options.validators,
762
+ this.validators.get(controlId),
763
+ injectValidators,
764
+ ),
765
+ false,
766
+ );
767
+ control.setAsyncValidators(
768
+ this.coerceToValidatorArray(
769
+ form,
770
+ options.asyncValidators,
771
+ this.asyncValidators.get(controlId),
772
+ injectAsyncValidators,
773
+ ),
774
+ false,
775
+ );
776
+
777
+ // register all control on change function with the form control
778
+ this.coerceToFnArray&lt;ChangeFn&gt;(
779
+ form,
780
+ this.controlChanges.get(controlId),
781
+ ).forEach((changeFn) &#x3D;&gt; control.registerOnChange(changeFn));
782
+
783
+ // register all control on set value function with the form control
784
+ this.coerceToFnArray&lt;SetValueFn&gt;(
785
+ form,
786
+ this.controlSetValue.get(controlId),
787
+ ).forEach((setValueFn) &#x3D;&gt; control.registerOnSetValue(setValueFn));
788
+
789
+ if (Array.isArray(options.validators)) {
790
+ if (
791
+ options.validators.includes(Validators.required) ||
792
+ options.validators.includes(Validators.requiredTrue)
793
+ ) {
794
+ Reflect.set(control, &#x27;hasRequiredValidator&#x27;, true);
795
+ }
796
+ }
797
+
798
+ // set the form control instance to the form definition instance
799
+ Reflect.set(form, controlId, control);
800
+ }
801
+ }
802
+
803
+ /**
804
+ * Coerce to a function array.
805
+ *
806
+ * @param form the current form definition instance
807
+ * @param methodKeys A set of propertyKeys that points to form
808
+ * definition instance methods
809
+ */
810
+ private coerceToFnArray&lt;T extends Function&gt;(
811
+ form: Record&lt;string, Function&gt;,
812
+ methodKeys?: Iterable&lt;string | { propertyKey: string }&gt;,
813
+ ): Array&lt;T&gt; {
814
+ const changes: Array&lt;T&gt; &#x3D; [];
815
+
816
+ if (methodKeys) {
817
+ for (const propertyKeyOrOptions of methodKeys) {
818
+ const propertyKey &#x3D;
819
+ typeof propertyKeyOrOptions &#x3D;&#x3D;&#x3D; &#x27;string&#x27;
820
+ ? propertyKeyOrOptions
821
+ : propertyKeyOrOptions.propertyKey;
822
+ assertIsFunction(form[propertyKey]);
823
+ changes.push((form[propertyKey] as T).bind(form));
824
+ }
825
+ }
826
+
827
+ return changes;
828
+ }
829
+
830
+ /**
831
+ * Coerce to a validator function array.
832
+ *
833
+ * @param form the current form definition instance
834
+ * @param optionsValidators The options validator functions
835
+ * @param validatorMethodKeys A set of propertyKeys that points to form
836
+ * definition instance methods
837
+ * @param injectValidators Injected validator functions
838
+ */
839
+ private coerceToValidatorArray&lt;VF extends ValidatorFn | AsyncValidatorFn&gt;(
840
+ form: Record&lt;string, Function&gt;,
841
+ optionsValidators?: Array&lt;VF&gt; | VF | null,
842
+ validatorMethodKeys?: Set&lt;string&gt;,
843
+ injectValidators?: Array&lt;VF&gt;,
844
+ ): Array&lt;VF&gt; {
845
+ const validators: Array&lt;VF&gt; &#x3D; (
846
+ optionsValidators ? Array.isArray(optionsValidators) ? optionsValidators : [ optionsValidators ] : []
847
+ ).slice();
848
+
849
+ if (validatorMethodKeys) {
850
+ validatorMethodKeys.forEach((propertyKey) &#x3D;&gt; {
851
+ assertIsFunction(form[propertyKey]);
852
+
853
+ validators.push(form[propertyKey].bind(form) as VF);
854
+ });
855
+ }
856
+
857
+ if (injectValidators) {
858
+ validators.push(...injectValidators);
859
+ }
860
+
861
+ return validators;
862
+ }
863
+
864
+ /**
865
+ * Coerce to the form state for the specified controlId. If none form state is
866
+ * found the default form state will be returned.
867
+ *
868
+ * @param controlId A control id
869
+ * @param defaultFormState The default form state
870
+ * @param builderFormState The form state provides as build state parameter
871
+ * @param optionsFormState The form state set by the decorator in the form definition
872
+ */
873
+ private coerceToControlFormState(
874
+ controlId: string,
875
+ defaultFormState: any,
876
+ builderFormState: Record&lt;string, any&gt;,
877
+ optionsFormState?: any,
878
+ ): any {
879
+ let formState &#x3D; defaultFormState;
880
+
881
+ if (builderFormState &amp;&amp; builderFormState[controlId] !&#x3D;&#x3D; undefined) {
882
+ formState &#x3D; builderFormState[controlId];
883
+ } else if (optionsFormState !&#x3D;&#x3D; undefined) {
884
+ formState &#x3D; optionsFormState ?? null;
885
+ }
886
+
887
+ if (typeof formState &#x3D;&#x3D;&#x3D; &#x27;function&#x27;) {
888
+ formState &#x3D; formState();
889
+ }
890
+
891
+ return formState;
892
+ }
893
+
894
+ /**
895
+ * Coerce to the form state for the specified controlId. If none form state is
896
+ * found the default form state will be returned.
897
+ *
898
+ * The difference to the method coerceToControlFormState is that null will be
899
+ * handled as undefined and the defaultFormState is used
900
+ *
901
+ * @param controlId A control id
902
+ * @param defaultFormState The default form state
903
+ * @param builderFormState The form state provides as build state parameter
904
+ * @param optionsFormState The form state set by the decorator in the form definition
905
+ */
906
+ private coerceToGroupFormState(
907
+ controlId: string,
908
+ defaultFormState: any,
909
+ builderFormState: Record&lt;string, any&gt;,
910
+ optionsFormState?: any,
911
+ ): any {
912
+ let formState &#x3D; defaultFormState;
913
+
914
+ if (builderFormState &amp;&amp; builderFormState[controlId]) {
915
+ formState &#x3D; builderFormState[controlId];
916
+ } else if (optionsFormState) {
917
+ formState &#x3D; optionsFormState;
918
+ }
919
+
920
+ if (typeof formState &#x3D;&#x3D;&#x3D; &#x27;function&#x27;) {
921
+ formState &#x3D; formState();
922
+ if (!formState) {
923
+ throw new Error(&#x60;The form state function for the form group &#x27;${ controlId }&#x27; returns a empty value (null/undefined)&#x60;);
924
+ }
925
+ if (typeof formState !&#x3D;&#x3D; &#x27;object&#x27;) {
926
+ throw new Error(&#x60;The form state function for the form group &#x27;${ controlId }&#x27; returns a non object like value instead &#x27;${ typeof formState }&#x27;&#x60;);
927
+ }
928
+ }
929
+
930
+ return formState;
931
+ }
932
+
933
+ /**
934
+ * Coerce to the form state for the specified controlId. If none form state is
935
+ * found the default form state will be returned.
936
+ *
937
+ * The difference to the method coerceToControlFormState is that null will be
938
+ * handled as undefined and the defaultFormState is used
939
+ *
940
+ * @param controlId A control id
941
+ * @param defaultFormState The default form state
942
+ * @param builderFormState The form state provides as build state parameter
943
+ * @param optionsFormState The form state set by the decorator in the form definition
944
+ */
945
+ private coerceToArrayFormState(
946
+ controlId: string,
947
+ defaultFormState: any[] | (() &#x3D;&gt; any[]),
948
+ builderFormState: Record&lt;string, any&gt;,
949
+ optionsFormState?: any,
950
+ ): any[] {
951
+ let formState &#x3D; defaultFormState;
952
+
953
+ if (builderFormState &amp;&amp; builderFormState[controlId] &amp;&amp; Array.isArray(builderFormState[controlId])) {
954
+ formState &#x3D; builderFormState[controlId];
955
+ } else if (optionsFormState &amp;&amp; Array.isArray(optionsFormState)) {
956
+ formState &#x3D; optionsFormState;
957
+ }
958
+
959
+ if (typeof formState &#x3D;&#x3D;&#x3D; &#x27;function&#x27;) {
960
+ formState &#x3D; formState();
961
+ if (!formState) {
962
+ throw new Error(&#x60;The form state function for the form array &#x27;${ controlId }&#x27; returns a empty value (null/undefined)&#x60;);
963
+ }
964
+ if (!Array.isArray(formState)) {
965
+ throw new Error(&#x60;The form state function for the form array &#x27;${ controlId }&#x27; returns a non array like value instead &#x27;${ typeof formState }&#x27;&#x60;);
966
+ }
967
+ }
968
+
969
+ return formState;
970
+ }
971
+
972
+ private extractControlChanges(): Map&lt;string, Set&lt;string&gt;&gt; {
973
+ return (
974
+ getMetadata(MetadataKeys.CONTROL_CHANGES, this.definition.prototype) ??
975
+ new Map&lt;string, Set&lt;string&gt;&gt;()
976
+ );
977
+ }
978
+
979
+ private extractControlSetValue(): Map&lt;string, Set&lt;ControlSetValueOptions&gt;&gt; {
980
+ return (
981
+ getMetadata(MetadataKeys.CONTROL_SET_VALUE, this.definition.prototype) ??
982
+ new Map&lt;string, Set&lt;ControlSetValueOptions&gt;&gt;()
983
+ );
984
+ }
985
+
986
+ private extractValidators(): Map&lt;string, Set&lt;string&gt;&gt; {
987
+ return (
988
+ getMetadata(MetadataKeys.CONTROL_VALIDATORS, this.definition.prototype) ??
989
+ new Map&lt;string, Set&lt;string&gt;&gt;()
990
+ );
991
+ }
992
+
993
+ private extractAsyncValidators(): Map&lt;string, Set&lt;string&gt;&gt; {
994
+ return (
995
+ getMetadata(
996
+ MetadataKeys.CONTROL_ASYNC_VALIDATORS,
997
+ this.definition.prototype,
998
+ ) ?? new Map&lt;string, Set&lt;string&gt;&gt;()
999
+ );
1000
+ }
1001
+
1002
+ private extractArrayGroups(): Map&lt;
1003
+ string,
1004
+ RxapAbstractControlOptionsWithDefinition
1005
+ &gt; {
1006
+ return (
1007
+ getMetadata(MetadataKeys.FORM_ARRAY_GROUPS, this.definition.prototype) ??
1008
+ new Map&lt;string, RxapAbstractControlOptionsWithDefinition&gt;()
1009
+ );
1010
+ }
1011
+
1012
+ private extractArrayControls(): Map&lt;string, RxapAbstractControlOptions&gt; {
1013
+ return (
1014
+ getMetadata(
1015
+ MetadataKeys.FORM_ARRAY_CONTROLS,
1016
+ this.definition.prototype,
1017
+ ) ?? new Map&lt;string, RxapAbstractControlOptions&gt;()
1018
+ );
1019
+ }
1020
+
1021
+ private extractGroups(): Map&lt;
1022
+ string,
1023
+ RxapAbstractControlOptionsWithDefinition
1024
+ &gt; {
1025
+ return (
1026
+ getMetadata(MetadataKeys.FORM_GROUPS, this.definition.prototype) ??
1027
+ new Map&lt;string, RxapAbstractControlOptionsWithDefinition&gt;()
1028
+ );
1029
+ }
1030
+
1031
+ private extractControls(): Map&lt;string, RxapAbstractControlOptions&gt; {
1032
+ return (
1033
+ getMetadata(MetadataKeys.FORM_CONTROLS, this.definition.prototype) ??
1034
+ new Map&lt;string, RxapAbstractControlOptions&gt;()
1035
+ );
1036
+ }
1037
+
1038
+ private extractFormOptions(): FormDefinitionMetadata {
1039
+ const options &#x3D; GetDefinitionMetadata(this.definition);
1040
+ if (!options || !options[&#x27;id&#x27;]) {
1041
+ throw new Error(&#x27;Ensure that the @UseForm decorator is used.&#x27;);
1042
+ }
1043
+ if (!options[&#x27;providers&#x27;]) {
1044
+ options[&#x27;providers&#x27;] &#x3D; [];
1045
+ }
1046
+ return options;
1047
+ }
1048
+ }
1049
+ </code></pre>
1050
+ </div>
1051
+ </div>
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+
1059
+
1060
+
1061
+ </div><div class="search-results">
1062
+ <div class="has-results">
1063
+ <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
1064
+ <ul class="search-results-list"></ul>
1065
+ </div>
1066
+ <div class="no-results">
1067
+ <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
1068
+ </div>
1069
+ </div>
1070
+ </div>
1071
+ <!-- END CONTENT -->
1072
+ </div>
1073
+ </div>
1074
+
1075
+ <label class="dark-mode-switch">
1076
+ <input type="checkbox">
1077
+ <span class="slider">
1078
+ <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
1079
+ <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
1080
+ </svg>
1081
+ </span>
1082
+ </label>
1083
+
1084
+ <script>
1085
+ var COMPODOC_CURRENT_PAGE_DEPTH = 1;
1086
+ var COMPODOC_CURRENT_PAGE_CONTEXT = 'class';
1087
+ var COMPODOC_CURRENT_PAGE_URL = 'RxapFormBuilder.html';
1088
+ var MAX_SEARCH_RESULTS = 15;
1089
+ </script>
1090
+
1091
+ <script>
1092
+ $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
1093
+ checkToggle(darkModeState);
1094
+ if ($darkModeToggleSwitchers.length > 0) {
1095
+ for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
1096
+ $darkModeToggleSwitchers[i].addEventListener('change', function (event) {
1097
+ darkModeState = !darkModeState;
1098
+ toggleDarkMode(darkModeState);
1099
+ });
1100
+ }
1101
+ }
1102
+ </script>
1103
+
1104
+ <script src="../js/libs/custom-elements.min.js"></script>
1105
+ <script src="../js/libs/lit-html.js"></script>
1106
+
1107
+ <script src="../js/menu-wc.js" defer></script>
1108
+ <script nomodule src="../js/menu-wc_es5.js" defer></script>
1109
+
1110
+ <script src="../js/libs/bootstrap-native.js"></script>
1111
+
1112
+ <script src="../js/libs/es6-shim.min.js"></script>
1113
+ <script src="../js/libs/EventDispatcher.js"></script>
1114
+ <script src="../js/libs/promise.min.js"></script>
1115
+ <script src="../js/libs/zepto.min.js"></script>
1116
+
1117
+ <script src="../js/compodoc.js"></script>
1118
+
1119
+ <script src="../js/tabs.js"></script>
1120
+ <script src="../js/menu.js"></script>
1121
+ <script src="../js/libs/clipboard.min.js"></script>
1122
+ <script src="../js/libs/prism.js"></script>
1123
+ <script src="../js/sourceCode.js"></script>
1124
+ <script src="../js/search/search.js"></script>
1125
+ <script src="../js/search/lunr.min.js"></script>
1126
+ <script src="../js/search/search-lunr.js"></script>
1127
+ <script src="../js/search/search_index.js"></script>
1128
+ <script src="../js/lazy-load-graphs.js"></script>
1129
+
1130
+
1131
+ </body>
1132
+ </html>