@rxap/form-system 21.0.1-dev.1 → 22.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/compodoc/changelog.html +32 -0
- package/compodoc/dependencies.html +16 -16
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +2468 -1730
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/classes/AbstractOptionsFromMethodDirective.html +6 -6
- package/docs/html/classes/AutocompleteOptionsFromMethodDirective.html +6 -6
- package/docs/html/classes/ControlDataSource.html +13 -13
- package/docs/html/classes/ControlHideShowDirective.html +4 -4
- package/docs/html/classes/ExtractControlFromParentMixin.html +2 -2
- package/docs/html/classes/ExtractControlMixin.html +2 -2
- package/docs/html/classes/ExtractDataSourcesMixin.html +2 -2
- package/docs/html/classes/ExtractFormDefinitionMixin.html +2 -2
- package/docs/html/classes/ExtractFunctionMixin.html +2 -2
- package/docs/html/classes/ExtractFunctionsMixin.html +2 -2
- package/docs/html/classes/ExtractIsValueFunctionMixin.html +2 -2
- package/docs/html/classes/ExtractMethodMixin.html +2 -2
- package/docs/html/classes/ExtractMethodsMixin.html +2 -2
- package/docs/html/classes/ExtractOptionsDataSourceMixin.html +2 -2
- package/docs/html/classes/ExtractOptionsMethodMixin.html +2 -2
- package/docs/html/classes/ExtractRemoteMethodsMixin.html +2 -2
- package/docs/html/classes/ExtractResolveMethodMixin.html +2 -2
- package/docs/html/classes/ExtractToDisplayFunctionMixin.html +2 -2
- package/docs/html/classes/ForFormArrayItemsDirective.html +3 -3
- package/docs/html/classes/FormArrayAddItemButtonDirective.html +4 -4
- package/docs/html/classes/FormArrayItemButton.html +4 -4
- package/docs/html/classes/FormArrayItemRemoveButtonDirective.html +5 -5
- package/docs/html/classes/FormArrayItemRestoreButtonDirective.html +4 -4
- package/docs/html/classes/FormArrayRemovableDirective.html +4 -4
- package/docs/html/classes/FormSystemControlDirective.html +8 -8
- package/docs/html/classes/InputSelectOptionsDirective.html +5 -5
- package/docs/html/classes/IsEqualToDirective.html +4 -4
- package/docs/html/classes/IsSelectableValueDirective.html +3 -3
- package/docs/html/classes/NoopResolveMethod.html +2 -2
- package/docs/html/classes/OptionsFromMethodDirective.html +6 -6
- package/docs/html/classes/OptionsFromRemoteMethodDirective.html +3 -3
- package/docs/html/classes/RxapFormSystemError.html +5 -5
- package/docs/html/classes/SubmitContextFormAdapter.html +10 -10
- package/docs/html/classes/TestNgControl.html +36 -27
- package/docs/html/enums/FormSystemMetadataKeys.html +2 -2
- package/docs/html/functions/ApplyUseFunctionAdapters.html +1 -1
- package/docs/html/functions/ApplyUseMethodAdapters.html +1 -1
- package/docs/html/functions/ComposeOptionsTransformers.html +1 -1
- package/docs/html/functions/FormContextFromActivatedRouteFactory.html +1 -1
- package/docs/html/functions/ResolveByUuidParameter.html +1 -1
- package/docs/html/functions/ResolveByUuidResultFactory.html +1 -1
- package/docs/html/functions/SubmitContextFormAdapterFactory.html +1 -1
- package/docs/html/functions/UseAutocompleteIsValueFunction.html +1 -1
- package/docs/html/functions/UseAutocompleteOptionsMethod.html +1 -1
- package/docs/html/functions/UseAutocompleteResolveMethod.html +1 -1
- package/docs/html/functions/UseAutocompleteToDisplayFunction.html +1 -1
- package/docs/html/functions/UseComponent.html +1 -1
- package/docs/html/functions/UseDataSource.html +1 -1
- package/docs/html/functions/UseFormComponent.html +2 -2
- package/docs/html/functions/UseFunction.html +1 -1
- package/docs/html/functions/UseHideFunction.html +1 -1
- package/docs/html/functions/UseIsValueFunction.html +1 -1
- package/docs/html/functions/UseMethod.html +1 -1
- package/docs/html/functions/UseOptionsDataSource.html +1 -1
- package/docs/html/functions/UseOptionsMethod.html +1 -1
- package/docs/html/functions/UseOptionsRemoteMethod.html +1 -1
- package/docs/html/functions/UseRemoteMethod.html +1 -1
- package/docs/html/functions/UseResolveMethod.html +1 -1
- package/docs/html/functions/UseShowFunction.html +1 -1
- package/docs/html/functions/UseToDisplayFunction.html +1 -1
- package/docs/html/functions/controlDataSource-1.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.html +2 -2
- package/docs/html/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.html +2 -2
- package/docs/html/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.html +2 -2
- package/docs/html/interfaces/ControlHideShowOptions.html +2 -2
- package/docs/html/interfaces/ControlWithDataSource.html +2 -2
- package/docs/html/interfaces/ForFormArrayItemsDirectiveContext.html +2 -2
- package/docs/html/interfaces/InputSelectOptionsSettings.html +4 -4
- package/docs/html/interfaces/InputSelectOptionsTemplateContext.html +2 -2
- package/docs/html/interfaces/OptionsFromMethodDirectiveSettings.html +1 -1
- package/docs/html/interfaces/OptionsFromMethodTemplateContext.html +2 -2
- package/docs/html/interfaces/OptionsFromRemoteMethodTemplateContext.html +2 -2
- package/docs/html/interfaces/UseDataSourceSettings.html +2 -2
- package/docs/html/interfaces/UseDataSourceValue.html +3 -3
- package/docs/html/interfaces/UseFunctionConfig.html +2 -2
- package/docs/html/interfaces/UseFunctionDefinition.html +2 -2
- package/docs/html/interfaces/UseMethodConfig.html +2 -2
- package/docs/html/interfaces/UseMethodDefinition.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/ControlHideShowFunction.html +1 -1
- package/docs/html/types/FunctionParameterAdapterFunction.html +1 -1
- package/docs/html/types/FunctionResultAdapterFunction.html +1 -1
- package/docs/html/types/MethodParameterAdapterFunction.html +1 -1
- package/docs/html/types/MethodResultAdapterFunction.html +1 -1
- package/docs/html/types/OptionsMethod.html +1 -1
- package/docs/html/types/UseFunctionType.html +1 -1
- package/docs/html/types/UseOptionsDataSourceSettings.html +1 -1
- package/docs/html/variables/DATA_SOURCE_NAME.html +1 -1
- package/docs/html/variables/IS_VALUE_FUNCTION_NAME.html +1 -1
- package/docs/html/variables/OPTIONS_METHOD_NAME.html +1 -1
- package/docs/html/variables/REMOTE_METHOD_NAME.html +1 -1
- package/docs/html/variables/RESOLVE_METHOD_NAME.html +1 -1
- package/docs/html/variables/RXAP_FORM_CONTROL_SOURCE.html +1 -1
- package/docs/html/variables/RXAP_FORM_SYSTEM_HIDE_METADATA.html +1 -1
- package/docs/html/variables/RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS.html +1 -1
- package/docs/html/variables/RXAP_FORM_SYSTEM_SHOW_METADATA.html +1 -1
- package/docs/html/variables/RXAP_USE_FUNCTION.html +1 -1
- package/docs/html/variables/RXAP_USE_METHOD.html +1 -1
- package/docs/html/variables/RXAP_USE_REMOTE_METHOD.html +1 -1
- package/docs/html/variables/SUBMIT_CONTEXT_FORM_ADAPTER_METHOD.html +1 -1
- package/docs/html/variables/TO_DISPLAY_FUNCTION_NAME.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AbstractOptionsFromMethodDirective.md +30 -30
- package/docs/markdown/classes/AutocompleteOptionsFromMethodDirective.md +43 -43
- package/docs/markdown/classes/ControlDataSource.md +51 -51
- package/docs/markdown/classes/ControlHideShowDirective.md +8 -8
- package/docs/markdown/classes/ExtractControlFromParentMixin.md +3 -3
- package/docs/markdown/classes/ExtractControlMixin.md +6 -6
- package/docs/markdown/classes/ExtractDataSourcesMixin.md +3 -3
- package/docs/markdown/classes/ExtractFormDefinitionMixin.md +3 -3
- package/docs/markdown/classes/ExtractFunctionMixin.md +5 -5
- package/docs/markdown/classes/ExtractFunctionsMixin.md +3 -3
- package/docs/markdown/classes/ExtractIsValueFunctionMixin.md +11 -11
- package/docs/markdown/classes/ExtractMethodMixin.md +5 -5
- package/docs/markdown/classes/ExtractMethodsMixin.md +3 -3
- package/docs/markdown/classes/ExtractOptionsDataSourceMixin.md +14 -14
- package/docs/markdown/classes/ExtractOptionsMethodMixin.md +11 -11
- package/docs/markdown/classes/ExtractRemoteMethodsMixin.md +3 -3
- package/docs/markdown/classes/ExtractResolveMethodMixin.md +11 -11
- package/docs/markdown/classes/ExtractToDisplayFunctionMixin.md +11 -11
- package/docs/markdown/classes/ForFormArrayItemsDirective.md +4 -4
- package/docs/markdown/classes/FormArrayAddItemButtonDirective.md +11 -11
- package/docs/markdown/classes/FormArrayItemButton.md +18 -18
- package/docs/markdown/classes/FormArrayItemRemoveButtonDirective.md +19 -19
- package/docs/markdown/classes/FormArrayItemRestoreButtonDirective.md +18 -18
- package/docs/markdown/classes/FormArrayRemovableDirective.md +9 -9
- package/docs/markdown/classes/FormSystemControlDirective.md +11 -11
- package/docs/markdown/classes/InputSelectOptionsDirective.md +27 -27
- package/docs/markdown/classes/IsEqualToDirective.md +6 -6
- package/docs/markdown/classes/IsSelectableValueDirective.md +16 -16
- package/docs/markdown/classes/NoopResolveMethod.md +3 -3
- package/docs/markdown/classes/OptionsFromMethodDirective.md +30 -30
- package/docs/markdown/classes/OptionsFromRemoteMethodDirective.md +9 -9
- package/docs/markdown/classes/RxapFormSystemError.md +16 -16
- package/docs/markdown/classes/SubmitContextFormAdapter.md +32 -32
- package/docs/markdown/classes/TestNgControl.md +145 -27
- package/docs/markdown/enumerations/FormSystemMetadataKeys.md +6 -6
- package/docs/markdown/functions/ApplyUseFunctionAdapters.md +2 -2
- package/docs/markdown/functions/ApplyUseMethodAdapters.md +2 -2
- package/docs/markdown/functions/ComposeOptionsTransformers.md +2 -2
- package/docs/markdown/functions/FormContextFromActivatedRouteFactory.md +2 -2
- package/docs/markdown/functions/ResolveByUuidParameter.md +2 -2
- package/docs/markdown/functions/ResolveByUuidResultFactory.md +2 -2
- package/docs/markdown/functions/SubmitContextFormAdapterFactory.md +2 -2
- package/docs/markdown/functions/UseAutocompleteIsValueFunction.md +2 -2
- package/docs/markdown/functions/UseAutocompleteOptionsMethod.md +4 -4
- package/docs/markdown/functions/UseAutocompleteResolveMethod.md +2 -2
- package/docs/markdown/functions/UseAutocompleteToDisplayFunction.md +2 -2
- package/docs/markdown/functions/UseComponent.md +2 -2
- package/docs/markdown/functions/UseDataSource.md +2 -2
- package/docs/markdown/functions/UseFormComponent.md +2 -2
- package/docs/markdown/functions/UseFunction.md +2 -2
- package/docs/markdown/functions/UseHideFunction.md +2 -2
- package/docs/markdown/functions/UseIsValueFunction.md +3 -3
- package/docs/markdown/functions/UseMethod.md +2 -2
- package/docs/markdown/functions/UseOptionsDataSource.md +2 -2
- package/docs/markdown/functions/UseOptionsMethod.md +2 -2
- package/docs/markdown/functions/UseOptionsRemoteMethod.md +2 -2
- package/docs/markdown/functions/UseRemoteMethod.md +2 -2
- package/docs/markdown/functions/UseResolveMethod.md +3 -3
- package/docs/markdown/functions/UseShowFunction.md +2 -2
- package/docs/markdown/functions/UseToDisplayFunction.md +3 -3
- package/docs/markdown/functions/controlDataSource.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.md +3 -3
- package/docs/markdown/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.md +3 -3
- package/docs/markdown/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.md +3 -3
- package/docs/markdown/interfaces/ControlHideShowOptions.md +3 -3
- package/docs/markdown/interfaces/ControlWithDataSource.md +3 -3
- package/docs/markdown/interfaces/ForFormArrayItemsDirectiveContext.md +9 -9
- package/docs/markdown/interfaces/InputSelectOptionsSettings.md +6 -6
- package/docs/markdown/interfaces/InputSelectOptionsTemplateContext.md +3 -3
- package/docs/markdown/interfaces/OptionsFromMethodDirectiveSettings.md +2 -2
- package/docs/markdown/interfaces/OptionsFromMethodTemplateContext.md +3 -3
- package/docs/markdown/interfaces/OptionsFromRemoteMethodTemplateContext.md +3 -3
- package/docs/markdown/interfaces/UseDataSourceSettings.md +3 -3
- package/docs/markdown/interfaces/UseDataSourceValue.md +5 -5
- package/docs/markdown/interfaces/UseFunctionConfig.md +3 -3
- package/docs/markdown/interfaces/UseFunctionDefinition.md +4 -4
- package/docs/markdown/interfaces/UseMethodConfig.md +3 -3
- package/docs/markdown/interfaces/UseMethodDefinition.md +4 -4
- package/docs/markdown/type-aliases/ControlHideShowFunction.md +2 -2
- package/docs/markdown/type-aliases/FunctionParameterAdapterFunction.md +2 -2
- package/docs/markdown/type-aliases/FunctionResultAdapterFunction.md +2 -2
- package/docs/markdown/type-aliases/MethodParameterAdapterFunction.md +2 -2
- package/docs/markdown/type-aliases/MethodResultAdapterFunction.md +2 -2
- package/docs/markdown/type-aliases/OptionsMethod.md +2 -2
- package/docs/markdown/type-aliases/UseFunctionType.md +2 -2
- package/docs/markdown/type-aliases/UseOptionsDataSourceSettings.md +2 -2
- package/docs/markdown/variables/DATA_SOURCE_NAME.md +2 -2
- package/docs/markdown/variables/IS_VALUE_FUNCTION_NAME.md +2 -2
- package/docs/markdown/variables/OPTIONS_METHOD_NAME.md +2 -2
- package/docs/markdown/variables/REMOTE_METHOD_NAME.md +2 -2
- package/docs/markdown/variables/RESOLVE_METHOD_NAME.md +2 -2
- package/docs/markdown/variables/RXAP_FORM_CONTROL_SOURCE.md +2 -2
- package/docs/markdown/variables/RXAP_FORM_SYSTEM_HIDE_METADATA.md +2 -2
- package/docs/markdown/variables/RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS.md +2 -2
- package/docs/markdown/variables/RXAP_FORM_SYSTEM_SHOW_METADATA.md +2 -2
- package/docs/markdown/variables/RXAP_USE_FUNCTION.md +2 -2
- package/docs/markdown/variables/RXAP_USE_METHOD.md +2 -2
- package/docs/markdown/variables/RXAP_USE_REMOTE_METHOD.md +2 -2
- package/docs/markdown/variables/SUBMIT_CONTEXT_FORM_ADAPTER_METHOD.md +2 -2
- package/docs/markdown/variables/TO_DISPLAY_FUNCTION_NAME.md +2 -2
- package/docs/wiki/Class.AbstractOptionsFromMethodDirective.md +29 -29
- package/docs/wiki/Class.AutocompleteOptionsFromMethodDirective.md +42 -42
- package/docs/wiki/Class.ControlDataSource.md +50 -50
- package/docs/wiki/Class.ControlHideShowDirective.md +7 -7
- package/docs/wiki/Class.ExtractControlFromParentMixin.md +2 -2
- package/docs/wiki/Class.ExtractControlMixin.md +5 -5
- package/docs/wiki/Class.ExtractDataSourcesMixin.md +2 -2
- package/docs/wiki/Class.ExtractFormDefinitionMixin.md +2 -2
- package/docs/wiki/Class.ExtractFunctionMixin.md +4 -4
- package/docs/wiki/Class.ExtractFunctionsMixin.md +2 -2
- package/docs/wiki/Class.ExtractIsValueFunctionMixin.md +10 -10
- package/docs/wiki/Class.ExtractMethodMixin.md +4 -4
- package/docs/wiki/Class.ExtractMethodsMixin.md +2 -2
- package/docs/wiki/Class.ExtractOptionsDataSourceMixin.md +13 -13
- package/docs/wiki/Class.ExtractOptionsMethodMixin.md +10 -10
- package/docs/wiki/Class.ExtractRemoteMethodsMixin.md +2 -2
- package/docs/wiki/Class.ExtractResolveMethodMixin.md +10 -10
- package/docs/wiki/Class.ExtractToDisplayFunctionMixin.md +10 -10
- package/docs/wiki/Class.ForFormArrayItemsDirective.md +3 -3
- package/docs/wiki/Class.FormArrayAddItemButtonDirective.md +10 -10
- package/docs/wiki/Class.FormArrayItemButton.md +17 -17
- package/docs/wiki/Class.FormArrayItemRemoveButtonDirective.md +18 -18
- package/docs/wiki/Class.FormArrayItemRestoreButtonDirective.md +17 -17
- package/docs/wiki/Class.FormArrayRemovableDirective.md +8 -8
- package/docs/wiki/Class.FormSystemControlDirective.md +10 -10
- package/docs/wiki/Class.InputSelectOptionsDirective.md +26 -26
- package/docs/wiki/Class.IsEqualToDirective.md +5 -5
- package/docs/wiki/Class.IsSelectableValueDirective.md +15 -15
- package/docs/wiki/Class.NoopResolveMethod.md +2 -2
- package/docs/wiki/Class.OptionsFromMethodDirective.md +29 -29
- package/docs/wiki/Class.OptionsFromRemoteMethodDirective.md +8 -8
- package/docs/wiki/Class.RxapFormSystemError.md +15 -15
- package/docs/wiki/Class.SubmitContextFormAdapter.md +31 -31
- package/docs/wiki/Class.TestNgControl.md +144 -26
- package/docs/wiki/Enumeration.FormSystemMetadataKeys.md +5 -5
- package/docs/wiki/Function.ApplyUseFunctionAdapters.md +1 -1
- package/docs/wiki/Function.ApplyUseMethodAdapters.md +1 -1
- package/docs/wiki/Function.ComposeOptionsTransformers.md +1 -1
- package/docs/wiki/Function.FormContextFromActivatedRouteFactory.md +1 -1
- package/docs/wiki/Function.ResolveByUuidParameter.md +1 -1
- package/docs/wiki/Function.ResolveByUuidResultFactory.md +1 -1
- package/docs/wiki/Function.SubmitContextFormAdapterFactory.md +1 -1
- package/docs/wiki/Function.UseAutocompleteIsValueFunction.md +1 -1
- package/docs/wiki/Function.UseAutocompleteOptionsMethod.md +3 -3
- package/docs/wiki/Function.UseAutocompleteResolveMethod.md +1 -1
- package/docs/wiki/Function.UseAutocompleteToDisplayFunction.md +1 -1
- package/docs/wiki/Function.UseComponent.md +1 -1
- package/docs/wiki/Function.UseDataSource.md +1 -1
- package/docs/wiki/Function.UseFormComponent.md +1 -1
- package/docs/wiki/Function.UseFunction.md +1 -1
- package/docs/wiki/Function.UseHideFunction.md +1 -1
- package/docs/wiki/Function.UseIsValueFunction.md +2 -2
- package/docs/wiki/Function.UseMethod.md +1 -1
- package/docs/wiki/Function.UseOptionsDataSource.md +1 -1
- package/docs/wiki/Function.UseOptionsMethod.md +1 -1
- package/docs/wiki/Function.UseOptionsRemoteMethod.md +1 -1
- package/docs/wiki/Function.UseRemoteMethod.md +1 -1
- package/docs/wiki/Function.UseResolveMethod.md +2 -2
- package/docs/wiki/Function.UseShowFunction.md +1 -1
- package/docs/wiki/Function.UseToDisplayFunction.md +2 -2
- package/docs/wiki/Function.controlDataSource.md +1 -1
- package/docs/wiki/Interface.AutocompleteOptionsFromMethodDirectiveParameters.md +2 -2
- package/docs/wiki/Interface.AutocompleteOptionsFromMethodDirectiveSettings.md +2 -2
- package/docs/wiki/Interface.AutocompleteOptionsFromRemoteMethodTemplateContext.md +2 -2
- package/docs/wiki/Interface.ControlHideShowOptions.md +2 -2
- package/docs/wiki/Interface.ControlWithDataSource.md +2 -2
- package/docs/wiki/Interface.ForFormArrayItemsDirectiveContext.md +8 -8
- package/docs/wiki/Interface.InputSelectOptionsSettings.md +5 -5
- package/docs/wiki/Interface.InputSelectOptionsTemplateContext.md +2 -2
- package/docs/wiki/Interface.OptionsFromMethodDirectiveSettings.md +1 -1
- package/docs/wiki/Interface.OptionsFromMethodTemplateContext.md +2 -2
- package/docs/wiki/Interface.OptionsFromRemoteMethodTemplateContext.md +2 -2
- package/docs/wiki/Interface.UseDataSourceSettings.md +2 -2
- package/docs/wiki/Interface.UseDataSourceValue.md +4 -4
- package/docs/wiki/Interface.UseFunctionConfig.md +2 -2
- package/docs/wiki/Interface.UseFunctionDefinition.md +3 -3
- package/docs/wiki/Interface.UseMethodConfig.md +2 -2
- package/docs/wiki/Interface.UseMethodDefinition.md +3 -3
- package/docs/wiki/TypeAlias.ControlHideShowFunction.md +1 -1
- package/docs/wiki/TypeAlias.FunctionParameterAdapterFunction.md +1 -1
- package/docs/wiki/TypeAlias.FunctionResultAdapterFunction.md +1 -1
- package/docs/wiki/TypeAlias.MethodParameterAdapterFunction.md +1 -1
- package/docs/wiki/TypeAlias.MethodResultAdapterFunction.md +1 -1
- package/docs/wiki/TypeAlias.OptionsMethod.md +1 -1
- package/docs/wiki/TypeAlias.UseFunctionType.md +1 -1
- package/docs/wiki/TypeAlias.UseOptionsDataSourceSettings.md +1 -1
- package/docs/wiki/Variable.DATA_SOURCE_NAME.md +1 -1
- package/docs/wiki/Variable.IS_VALUE_FUNCTION_NAME.md +1 -1
- package/docs/wiki/Variable.OPTIONS_METHOD_NAME.md +1 -1
- package/docs/wiki/Variable.REMOTE_METHOD_NAME.md +1 -1
- package/docs/wiki/Variable.RESOLVE_METHOD_NAME.md +1 -1
- package/docs/wiki/Variable.RXAP_FORM_CONTROL_SOURCE.md +1 -1
- package/docs/wiki/Variable.RXAP_FORM_SYSTEM_HIDE_METADATA.md +1 -1
- package/docs/wiki/Variable.RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS.md +1 -1
- package/docs/wiki/Variable.RXAP_FORM_SYSTEM_SHOW_METADATA.md +1 -1
- package/docs/wiki/Variable.RXAP_USE_FUNCTION.md +1 -1
- package/docs/wiki/Variable.RXAP_USE_METHOD.md +1 -1
- package/docs/wiki/Variable.RXAP_USE_REMOTE_METHOD.md +1 -1
- package/docs/wiki/Variable.SUBMIT_CONTEXT_FORM_ADAPTER_METHOD.md +1 -1
- package/docs/wiki/Variable.TO_DISPLAY_FUNCTION_NAME.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-form-system.mjs +1978 -1562
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/package.json +41 -41
- package/types/rxap-form-system.d.ts +667 -610
|
@@ -1,1645 +1,2061 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { __decorate, __metadata } from
|
|
5
|
-
import {
|
|
6
|
-
import { Mixin } from
|
|
7
|
-
import { RxapFormControl, RxapFormGroup,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { RxapError,
|
|
11
|
-
import { ToMethod } from
|
|
12
|
-
import { debounceTime, map as map$1,
|
|
13
|
-
import { MatButton } from
|
|
14
|
-
import { isDefined } from
|
|
15
|
-
import { isUUID } from
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectorRef, Directive, ElementRef, EnvironmentInjector, INJECTOR, Inject, Injectable, InjectionToken, Optional, Renderer2, TemplateRef, ViewContainerRef, createComponent, effect, forwardRef, inject, input, isDevMode, linkedSignal, runInInjectionContext, signal, untracked } from "@angular/core";
|
|
3
|
+
import { ControlContainer, NG_VALIDATORS, NgControl, UntypedFormArray, UntypedFormGroup } from "@angular/forms";
|
|
4
|
+
import { __decorate, __metadata } from "tslib";
|
|
5
|
+
import { BaseDataSource, DataSourceLoader, PipeDataSource, RXAP_DATA_SOURCE_METADATA } from "@rxap/data-source";
|
|
6
|
+
import { Mixin } from "@rxap/mixin";
|
|
7
|
+
import { RXAP_FORM_CONTEXT, RxapFormArray, RxapFormControl, RxapFormGroup, controlValueChanges$ } from "@rxap/forms";
|
|
8
|
+
import { catchError, distinctUntilChanged, map, shareReplay, startWith, switchMap, tap, throttleTime } from "rxjs/operators";
|
|
9
|
+
import { getMetadata, setMetadata, setMetadataMap, setMetadataMapMap } from "@rxap/reflect-metadata";
|
|
10
|
+
import { RxapError, equals, isPromise, isPromiseLike } from "@rxap/utilities";
|
|
11
|
+
import { ToMethod } from "@rxap/pattern";
|
|
12
|
+
import { EMPTY, Subscription, debounceTime, distinctUntilChanged as distinctUntilChanged$1, isObservable, map as map$1, of, pairwise, startWith as startWith$1, tap as tap$1 } from "rxjs";
|
|
13
|
+
import { MatButton } from "@angular/material/button";
|
|
14
|
+
import { isDefined } from "@rxap/rxjs";
|
|
15
|
+
import { isUUID } from "@rxap/validator";
|
|
16
|
+
import { MAT_FORM_FIELD, MatFormField } from "@angular/material/form-field";
|
|
17
|
+
import { ProxyRemoteMethod, RemoteMethodLoader } from "@rxap/remote-method";
|
|
18
|
+
var IsEqualToDirective = class IsEqualToDirective {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.equalTo = input.required({
|
|
21
|
+
...ngDevMode ? { debugName: "equalTo" } : /* istanbul ignore next */ {},
|
|
22
|
+
alias: "rxapIsEqualTo"
|
|
23
|
+
});
|
|
24
|
+
effect(() => {
|
|
25
|
+
this.equalTo();
|
|
26
|
+
untracked(() => this._onChange?.());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
validate(control) {
|
|
30
|
+
const equalTo = this.equalTo();
|
|
31
|
+
if (equalTo === null || equalTo === control.value) return null;
|
|
32
|
+
return { isEqualTo: {
|
|
33
|
+
value: equalTo,
|
|
34
|
+
actualValue: control.value
|
|
35
|
+
} };
|
|
36
|
+
}
|
|
37
|
+
registerOnValidatorChange(fn) {
|
|
38
|
+
this._onChange = fn;
|
|
39
|
+
}
|
|
40
|
+
static {
|
|
41
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.3.0",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: IsEqualToDirective,
|
|
46
|
+
deps: [],
|
|
47
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
52
|
+
minVersion: "17.1.0",
|
|
53
|
+
version: "22.3.0",
|
|
54
|
+
type: IsEqualToDirective,
|
|
55
|
+
isStandalone: true,
|
|
56
|
+
selector: "[rxapIsEqualTo]",
|
|
57
|
+
inputs: { equalTo: {
|
|
58
|
+
classPropertyName: "equalTo",
|
|
59
|
+
publicName: "rxapIsEqualTo",
|
|
60
|
+
isSignal: true,
|
|
61
|
+
isRequired: true,
|
|
62
|
+
transformFunction: null
|
|
63
|
+
} },
|
|
64
|
+
providers: [{
|
|
65
|
+
provide: NG_VALIDATORS,
|
|
66
|
+
multi: true,
|
|
67
|
+
useExisting: forwardRef(() => IsEqualToDirective)
|
|
68
|
+
}],
|
|
69
|
+
ngImport: i0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
74
|
+
minVersion: "12.0.0",
|
|
75
|
+
version: "22.3.0",
|
|
76
|
+
ngImport: i0,
|
|
77
|
+
type: IsEqualToDirective,
|
|
78
|
+
decorators: [{
|
|
79
|
+
type: Directive,
|
|
80
|
+
args: [{
|
|
81
|
+
selector: "[rxapIsEqualTo]",
|
|
82
|
+
providers: [{
|
|
83
|
+
provide: NG_VALIDATORS,
|
|
84
|
+
multi: true,
|
|
85
|
+
useExisting: forwardRef(() => IsEqualToDirective)
|
|
86
|
+
}],
|
|
87
|
+
standalone: true
|
|
88
|
+
}]
|
|
89
|
+
}],
|
|
90
|
+
ctorParameters: () => [],
|
|
91
|
+
propDecorators: { equalTo: [{
|
|
92
|
+
type: i0.Input,
|
|
93
|
+
args: [{
|
|
94
|
+
isSignal: true,
|
|
95
|
+
alias: "rxapIsEqualTo",
|
|
96
|
+
required: true
|
|
97
|
+
}]
|
|
98
|
+
}] }
|
|
99
|
+
});
|
|
72
100
|
var FormSystemMetadataKeys;
|
|
73
|
-
(function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
(function(FormSystemMetadataKeys) {
|
|
102
|
+
FormSystemMetadataKeys["COMPONENTS"] = "rxap/form-system/components";
|
|
103
|
+
FormSystemMetadataKeys["DATA_SOURCES"] = "rxap/form-system/data-sources";
|
|
104
|
+
FormSystemMetadataKeys["COMPONENTS_PROPERTIES"] = "rxap/form-system/components-properties";
|
|
105
|
+
FormSystemMetadataKeys["FORM_COMPONENT"] = "rxap/window-form-system/form-component";
|
|
78
106
|
})(FormSystemMetadataKeys || (FormSystemMetadataKeys = {}));
|
|
79
|
-
|
|
80
107
|
function UseDataSource(dataSource, name, settings) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
class ExtractControlMixin {
|
|
91
|
-
extractControl(ngControl = this.ngControl ??
|
|
92
|
-
this.matFormField?._control?.ngControl ??
|
|
93
|
-
null) {
|
|
94
|
-
if (!ngControl) {
|
|
95
|
-
throw new Error('The ngControl is not defined!');
|
|
96
|
-
}
|
|
97
|
-
this.ngControl = ngControl;
|
|
98
|
-
const control = this.ngControl.control;
|
|
99
|
-
if (!(control instanceof RxapFormControl)) {
|
|
100
|
-
throw new Error('Control is not a RxapFormControl!');
|
|
101
|
-
}
|
|
102
|
-
return this.control = control;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
class RxapFormSystemError extends RxapError {
|
|
107
|
-
constructor(message, code, className) {
|
|
108
|
-
super('@rxap/form-system', message, code, className);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
class ExtractDataSourcesMixin {
|
|
113
|
-
extractDataSources(formDefinition, controlId) {
|
|
114
|
-
const map = getMetadata(FormSystemMetadataKeys.DATA_SOURCES, Object.getPrototypeOf(formDefinition));
|
|
115
|
-
if (!map) {
|
|
116
|
-
throw new RxapFormSystemError('Could not extract the use data source map from the form definition instance', '');
|
|
117
|
-
}
|
|
118
|
-
if (!map.has(controlId)) {
|
|
119
|
-
throw new RxapFormSystemError('A use data source definition does not exists in the form definition metadata', '');
|
|
120
|
-
}
|
|
121
|
-
return map.get(controlId);
|
|
122
|
-
}
|
|
108
|
+
return function(target, propertyKey) {
|
|
109
|
+
setMetadataMapMap(propertyKey, name, {
|
|
110
|
+
dataSource,
|
|
111
|
+
settings
|
|
112
|
+
}, FormSystemMetadataKeys.DATA_SOURCES, target);
|
|
113
|
+
};
|
|
123
114
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
115
|
+
var ExtractControlMixin = class {
|
|
116
|
+
extractControl(ngControl = this.ngControl ?? this.matFormField?._control?.ngControl ?? null) {
|
|
117
|
+
if (!ngControl) throw new Error("The ngControl is not defined!");
|
|
118
|
+
this.ngControl = ngControl;
|
|
119
|
+
const control = this.ngControl.control;
|
|
120
|
+
if (!(control instanceof RxapFormControl)) throw new Error("Control is not a RxapFormControl!");
|
|
121
|
+
return this.control = control;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var RxapFormSystemError = class extends RxapError {
|
|
125
|
+
constructor(message, code, className) {
|
|
126
|
+
super("@rxap/form-system", message, code, className);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
var ExtractDataSourcesMixin = class {
|
|
130
|
+
extractDataSources(formDefinition, controlId) {
|
|
131
|
+
const map = getMetadata(FormSystemMetadataKeys.DATA_SOURCES, Object.getPrototypeOf(formDefinition));
|
|
132
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use data source map from the form definition instance", "");
|
|
133
|
+
if (!map.has(controlId)) throw new RxapFormSystemError("A use data source definition does not exists in the form definition metadata", "");
|
|
134
|
+
return map.get(controlId);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var ExtractFormDefinitionMixin = class {
|
|
138
|
+
extractFormDefinition(control) {
|
|
139
|
+
const formDefinition = control.rxapFormDefinition;
|
|
140
|
+
if (!formDefinition) throw new RxapFormSystemError("Could not find the form definition instance", "");
|
|
141
|
+
return formDefinition;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const DATA_SOURCE_NAME = "options";
|
|
137
145
|
function ComposeOptionsTransformers(...fnc) {
|
|
138
|
-
|
|
146
|
+
return (base) => fnc.reduce((source, transform) => transform(source), base);
|
|
139
147
|
}
|
|
140
148
|
function UseOptionsDataSource(dataSource, settings) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
return function(target, propertyKey) {
|
|
150
|
+
UseDataSource(dataSource, DATA_SOURCE_NAME, settings)(target, propertyKey);
|
|
151
|
+
};
|
|
144
152
|
}
|
|
145
153
|
let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
throw new Error('Cloud not inject the options data source:\n' + e.message);
|
|
169
|
-
}
|
|
170
|
-
throw e;
|
|
171
|
-
}
|
|
172
|
-
if (this.settings?.transformer) {
|
|
173
|
-
dataSource = new PipeDataSource(dataSource, map(this.settings.transformer), tap(options => useDataSourceValue.lastValue = options));
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
dataSource = new PipeDataSource(dataSource, tap(options => useDataSourceValue.lastValue = options));
|
|
177
|
-
}
|
|
178
|
-
return this.dataSource = dataSource;
|
|
179
|
-
}
|
|
154
|
+
extractOptionsDatasource(control, metadata) {
|
|
155
|
+
control ??= this.extractControl();
|
|
156
|
+
if (!(control instanceof RxapFormControl)) throw new Error("Ensure to use a RxapFromControl");
|
|
157
|
+
const formDefinition = this.extractFormDefinition(control);
|
|
158
|
+
const useDataSourceValueMap = this.extractDataSources(formDefinition, control.controlId);
|
|
159
|
+
if (!useDataSourceValueMap.has("options")) throw new Error(`The data source with the name 'options' is not defined`);
|
|
160
|
+
const useDataSourceValue = this.useDataSourceValue = useDataSourceValueMap.get("options");
|
|
161
|
+
this.settings = this.useDataSourceValue.settings ?? {};
|
|
162
|
+
let dataSource;
|
|
163
|
+
try {
|
|
164
|
+
dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource, metadata, this.injector);
|
|
165
|
+
} catch (e) {
|
|
166
|
+
if (e?.name === "NullInjectorError" || /NG0201/.test(e?.message ?? "")) {
|
|
167
|
+
if (isDevMode()) console.error("Cloud not inject the options data source", this.useDataSourceValue);
|
|
168
|
+
throw new Error("Cloud not inject the options data source:\n" + e.message);
|
|
169
|
+
}
|
|
170
|
+
throw e;
|
|
171
|
+
}
|
|
172
|
+
if (this.settings?.transformer) dataSource = new PipeDataSource(dataSource, map(this.settings.transformer), tap((options) => useDataSourceValue.lastValue = options));
|
|
173
|
+
else dataSource = new PipeDataSource(dataSource, tap((options) => useDataSourceValue.lastValue = options));
|
|
174
|
+
return this.dataSource = dataSource;
|
|
175
|
+
}
|
|
180
176
|
};
|
|
181
|
-
ExtractOptionsDataSourceMixin = __decorate([
|
|
182
|
-
Mixin(ExtractControlMixin, ExtractFormDefinitionMixin, ExtractDataSourcesMixin)
|
|
183
|
-
], ExtractOptionsDataSourceMixin);
|
|
184
|
-
|
|
177
|
+
ExtractOptionsDataSourceMixin = __decorate([Mixin(ExtractControlMixin, ExtractFormDefinitionMixin, ExtractDataSourcesMixin)], ExtractOptionsDataSourceMixin);
|
|
185
178
|
let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
179
|
+
constructor() {
|
|
180
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
181
|
+
this.injector = inject(INJECTOR);
|
|
182
|
+
this.viewer = input({ id: "[rxapIsSelectableValue]" }, ...ngDevMode ? [{ debugName: "viewer" }] : /* istanbul ignore next */ []);
|
|
183
|
+
}
|
|
184
|
+
validate(control) {
|
|
185
|
+
if (control.value) {
|
|
186
|
+
this.extractOptionsDatasource(control);
|
|
187
|
+
const data = this.useDataSourceValue?.lastValue;
|
|
188
|
+
if (data) {
|
|
189
|
+
let options;
|
|
190
|
+
if (Array.isArray(data)) options = data;
|
|
191
|
+
else options = Object.entries(data).map(([value, display]) => ({
|
|
192
|
+
value,
|
|
193
|
+
display
|
|
194
|
+
}));
|
|
195
|
+
if (!options.some((option) => option.value === control.value)) return { isSelectableValue: { expected: "Value should be from the list of provided options" } };
|
|
196
|
+
} else if (isDevMode()) console.warn("The last value from the OptionsDataSource is empty", this);
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
static {
|
|
201
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
202
|
+
minVersion: "12.0.0",
|
|
203
|
+
version: "22.3.0",
|
|
204
|
+
ngImport: i0,
|
|
205
|
+
type: IsSelectableValueDirective,
|
|
206
|
+
deps: [],
|
|
207
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
static {
|
|
211
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
212
|
+
minVersion: "17.1.0",
|
|
213
|
+
version: "22.3.0",
|
|
214
|
+
type: IsSelectableValueDirective,
|
|
215
|
+
isStandalone: true,
|
|
216
|
+
selector: "[rxapIsSelectableValue]",
|
|
217
|
+
inputs: { viewer: {
|
|
218
|
+
classPropertyName: "viewer",
|
|
219
|
+
publicName: "viewer",
|
|
220
|
+
isSignal: true,
|
|
221
|
+
isRequired: false,
|
|
222
|
+
transformFunction: null
|
|
223
|
+
} },
|
|
224
|
+
providers: [{
|
|
225
|
+
provide: NG_VALIDATORS,
|
|
226
|
+
multi: true,
|
|
227
|
+
useExisting: forwardRef(() => IsSelectableValueDirective)
|
|
228
|
+
}],
|
|
229
|
+
ngImport: i0
|
|
230
|
+
});
|
|
231
|
+
}
|
|
229
232
|
};
|
|
230
|
-
IsSelectableValueDirective = __decorate([
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
233
|
+
IsSelectableValueDirective = __decorate([Mixin(ExtractOptionsDataSourceMixin)], IsSelectableValueDirective);
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
235
|
+
minVersion: "12.0.0",
|
|
236
|
+
version: "22.3.0",
|
|
237
|
+
ngImport: i0,
|
|
238
|
+
type: IsSelectableValueDirective,
|
|
239
|
+
decorators: [{
|
|
240
|
+
type: Directive,
|
|
241
|
+
args: [{
|
|
242
|
+
selector: "[rxapIsSelectableValue]",
|
|
243
|
+
providers: [{
|
|
244
|
+
provide: NG_VALIDATORS,
|
|
245
|
+
multi: true,
|
|
246
|
+
useExisting: forwardRef(() => IsSelectableValueDirective)
|
|
247
|
+
}],
|
|
248
|
+
standalone: true
|
|
249
|
+
}]
|
|
250
|
+
}],
|
|
251
|
+
propDecorators: { viewer: [{
|
|
252
|
+
type: i0.Input,
|
|
253
|
+
args: [{
|
|
254
|
+
isSignal: true,
|
|
255
|
+
alias: "viewer",
|
|
256
|
+
required: false
|
|
257
|
+
}]
|
|
258
|
+
}] }
|
|
259
|
+
});
|
|
248
260
|
function ResolveByUuidParameter({ value }) {
|
|
249
|
-
|
|
250
|
-
parameters: {
|
|
251
|
-
uuid: value,
|
|
252
|
-
},
|
|
253
|
-
};
|
|
261
|
+
return { parameters: { uuid: value } };
|
|
254
262
|
}
|
|
255
263
|
function ResolveByUuidResultFactory(transformer) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
264
|
+
return (entity) => {
|
|
265
|
+
return transformer(entity);
|
|
266
|
+
};
|
|
259
267
|
}
|
|
260
|
-
|
|
261
268
|
function ApplyUseFunctionAdapters(injector, fnc, config) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
reject(e);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
return fnc;
|
|
269
|
+
if (config?.adapter?.result || config?.adapter?.args) return function(...args) {
|
|
270
|
+
return new Promise((resolve, reject) => {
|
|
271
|
+
runInInjectionContext(injector, () => {
|
|
272
|
+
args = config?.adapter?.args?.(args) ?? args;
|
|
273
|
+
const result = fnc.call(this, ...args);
|
|
274
|
+
if (isPromiseLike(result)) {
|
|
275
|
+
const p = result.then((result) => {
|
|
276
|
+
resolve(config?.adapter?.result?.(result) ?? result);
|
|
277
|
+
});
|
|
278
|
+
if (isPromise(p)) p.catch(reject);
|
|
279
|
+
} else try {
|
|
280
|
+
resolve(config?.adapter?.result?.(result) ?? result);
|
|
281
|
+
} catch (e) {
|
|
282
|
+
reject(e);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
return fnc;
|
|
289
288
|
}
|
|
290
|
-
|
|
291
289
|
function ApplyUseMethodAdapters(injector, method, config) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
reject(e);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
return method;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
class ExtractControlFromParentMixin {
|
|
322
|
-
extractControlFromParent(parent, controlPath) {
|
|
323
|
-
if (!controlPath) {
|
|
324
|
-
throw new RxapFormSystemError('The control path is empty', '');
|
|
325
|
-
}
|
|
326
|
-
if (!parent.control) {
|
|
327
|
-
throw new RxapFormSystemError('The control property of ControlContainer is not defined', '');
|
|
328
|
-
}
|
|
329
|
-
const control = parent.control.get(controlPath);
|
|
330
|
-
if (!control) {
|
|
331
|
-
throw new RxapFormSystemError('Could not find the control instance', '');
|
|
332
|
-
}
|
|
333
|
-
if (!(control instanceof RxapFormControl) &&
|
|
334
|
-
!(control instanceof RxapFormGroup) &&
|
|
335
|
-
!(control instanceof RxapFormArray)) {
|
|
336
|
-
throw new RxapFormSystemError('The extracted control is not a RxapFormControl', '');
|
|
337
|
-
}
|
|
338
|
-
return control;
|
|
339
|
-
}
|
|
290
|
+
if (config?.adapter?.result || config?.adapter?.parameter) return ToMethod((parameter, ...args) => {
|
|
291
|
+
return new Promise((resolve, reject) => {
|
|
292
|
+
runInInjectionContext(injector, () => {
|
|
293
|
+
parameter = config?.adapter?.parameter?.(parameter) ?? parameter;
|
|
294
|
+
const result = method.call(parameter, ...args);
|
|
295
|
+
if (isPromiseLike(result)) {
|
|
296
|
+
const p = result.then((result) => {
|
|
297
|
+
resolve(config?.adapter?.result?.(result) ?? result);
|
|
298
|
+
});
|
|
299
|
+
if (isPromise(p)) p.catch(reject);
|
|
300
|
+
} else try {
|
|
301
|
+
resolve(config?.adapter?.result?.(result) ?? result);
|
|
302
|
+
} catch (e) {
|
|
303
|
+
reject(e);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
return method;
|
|
340
309
|
}
|
|
341
|
-
|
|
342
|
-
|
|
310
|
+
var ExtractControlFromParentMixin = class {
|
|
311
|
+
extractControlFromParent(parent, controlPath) {
|
|
312
|
+
if (!controlPath) throw new RxapFormSystemError("The control path is empty", "");
|
|
313
|
+
if (!parent.control) throw new RxapFormSystemError("The control property of ControlContainer is not defined", "");
|
|
314
|
+
const control = parent.control.get(controlPath);
|
|
315
|
+
if (!control) throw new RxapFormSystemError("Could not find the control instance", "");
|
|
316
|
+
if (!(control instanceof RxapFormControl) && !(control instanceof RxapFormGroup) && !(control instanceof RxapFormArray)) throw new RxapFormSystemError("The extracted control is not a RxapFormControl", "");
|
|
317
|
+
return control;
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const RXAP_USE_FUNCTION = "rxap/form-system/function/use";
|
|
343
321
|
function UseFunction(fnc, name, config) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
const map = getMetadata(RXAP_USE_FUNCTION, Object.getPrototypeOf(formDefinition));
|
|
351
|
-
if (!map) {
|
|
352
|
-
if (defaultMap) {
|
|
353
|
-
return defaultMap;
|
|
354
|
-
}
|
|
355
|
-
throw new Error('Could not extract the use remote function map from the form definition instance');
|
|
356
|
-
}
|
|
357
|
-
if (!map.has(controlId)) {
|
|
358
|
-
if (defaultMap) {
|
|
359
|
-
return defaultMap;
|
|
360
|
-
}
|
|
361
|
-
throw new Error('A use remote function definition does not exists in the form definition metadata');
|
|
362
|
-
}
|
|
363
|
-
return map.get(controlId);
|
|
364
|
-
}
|
|
322
|
+
return function(target, propertyKey) {
|
|
323
|
+
setMetadataMapMap(propertyKey, name, {
|
|
324
|
+
fnc,
|
|
325
|
+
config
|
|
326
|
+
}, RXAP_USE_FUNCTION, target);
|
|
327
|
+
};
|
|
365
328
|
}
|
|
366
|
-
|
|
329
|
+
var ExtractFunctionsMixin = class {
|
|
330
|
+
extractFunctions(defaultMap = null, formDefinition, controlId) {
|
|
331
|
+
const map = getMetadata(RXAP_USE_FUNCTION, Object.getPrototypeOf(formDefinition));
|
|
332
|
+
if (!map) {
|
|
333
|
+
if (defaultMap) return defaultMap;
|
|
334
|
+
throw new Error("Could not extract the use remote function map from the form definition instance");
|
|
335
|
+
}
|
|
336
|
+
if (!map.has(controlId)) {
|
|
337
|
+
if (defaultMap) return defaultMap;
|
|
338
|
+
throw new Error("A use remote function definition does not exists in the form definition metadata");
|
|
339
|
+
}
|
|
340
|
+
return map.get(controlId);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
367
343
|
let ExtractFunctionMixin = class ExtractFunctionMixin {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return ApplyUseFunctionAdapters(this.injector, fnc, config);
|
|
378
|
-
}
|
|
344
|
+
extractFunction(defaultFunction = null, formDefinition, controlId, name) {
|
|
345
|
+
const map = this.extractFunctions(/* @__PURE__ */ new Map(), formDefinition, controlId);
|
|
346
|
+
if (!map.has(name)) {
|
|
347
|
+
if (defaultFunction) return defaultFunction;
|
|
348
|
+
throw new Error(`A function with the name '${name}' is not attached to the control '${controlId}' use the @UseFunction decorator to attach a function to the control`);
|
|
349
|
+
}
|
|
350
|
+
const { fnc, config } = map.get(name);
|
|
351
|
+
return ApplyUseFunctionAdapters(this.injector, fnc, config);
|
|
352
|
+
}
|
|
379
353
|
};
|
|
380
|
-
ExtractFunctionMixin = __decorate([
|
|
381
|
-
|
|
382
|
-
], ExtractFunctionMixin);
|
|
383
|
-
|
|
384
|
-
const IS_VALUE_FUNCTION_NAME = 'is-value';
|
|
354
|
+
ExtractFunctionMixin = __decorate([Mixin(ExtractFunctionsMixin)], ExtractFunctionMixin);
|
|
355
|
+
const IS_VALUE_FUNCTION_NAME = "is-value";
|
|
385
356
|
function UseIsValueFunction(fnc, config) {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
357
|
+
return function(target, propertyKey) {
|
|
358
|
+
UseFunction(fnc, IS_VALUE_FUNCTION_NAME, config)(target, propertyKey);
|
|
359
|
+
};
|
|
389
360
|
}
|
|
390
361
|
let ExtractIsValueFunctionMixin = class ExtractIsValueFunctionMixin {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
362
|
+
extractIsValueFunction(defaultFunction = null, control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
363
|
+
return this.extractFunction(defaultFunction, formDefinition, control.controlId, IS_VALUE_FUNCTION_NAME);
|
|
364
|
+
}
|
|
394
365
|
};
|
|
395
|
-
ExtractIsValueFunctionMixin = __decorate([
|
|
396
|
-
|
|
397
|
-
], ExtractIsValueFunctionMixin);
|
|
398
|
-
|
|
399
|
-
const RXAP_USE_METHOD = 'rxap/form-system/method/use';
|
|
366
|
+
ExtractIsValueFunctionMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractFunctionMixin, ExtractControlMixin)], ExtractIsValueFunctionMixin);
|
|
367
|
+
const RXAP_USE_METHOD = "rxap/form-system/method/use";
|
|
400
368
|
function UseMethod(method, name, config) {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
const map = getMetadata(RXAP_USE_METHOD, Object.getPrototypeOf(formDefinition));
|
|
408
|
-
if (!map) {
|
|
409
|
-
console.log(map);
|
|
410
|
-
throw new Error('Could not extract the use remote method map from the form definition instance');
|
|
411
|
-
}
|
|
412
|
-
if (!map.has(controlId)) {
|
|
413
|
-
throw new Error('A use remote method definition does not exists in the form definition metadata');
|
|
414
|
-
}
|
|
415
|
-
return map.get(controlId);
|
|
416
|
-
}
|
|
369
|
+
return function(target, propertyKey) {
|
|
370
|
+
setMetadataMapMap(propertyKey, name, {
|
|
371
|
+
method,
|
|
372
|
+
config
|
|
373
|
+
}, RXAP_USE_METHOD, target);
|
|
374
|
+
};
|
|
417
375
|
}
|
|
418
|
-
|
|
376
|
+
var ExtractMethodsMixin = class {
|
|
377
|
+
extractMethods(formDefinition, controlId) {
|
|
378
|
+
const map = getMetadata(RXAP_USE_METHOD, Object.getPrototypeOf(formDefinition));
|
|
379
|
+
if (!map) {
|
|
380
|
+
console.log(map);
|
|
381
|
+
throw new Error("Could not extract the use remote method map from the form definition instance");
|
|
382
|
+
}
|
|
383
|
+
if (!map.has(controlId)) throw new Error("A use remote method definition does not exists in the form definition metadata");
|
|
384
|
+
return map.get(controlId);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
419
387
|
let ExtractMethodMixin = class ExtractMethodMixin {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return ApplyUseMethodAdapters(this.injector, method, config);
|
|
428
|
-
}
|
|
388
|
+
extractMethod(formDefinition, controlId, name) {
|
|
389
|
+
const map = this.extractMethods(formDefinition, controlId);
|
|
390
|
+
if (!map.has(name)) throw new Error(`A method with the name '${name}' is not attached to the control '${controlId}' use the @UseMethod decorator to attach a method to the control`);
|
|
391
|
+
const { method: methodToken, config } = map.get(name);
|
|
392
|
+
const method = this.injector.get(methodToken);
|
|
393
|
+
return ApplyUseMethodAdapters(this.injector, method, config);
|
|
394
|
+
}
|
|
429
395
|
};
|
|
430
|
-
ExtractMethodMixin = __decorate([
|
|
431
|
-
|
|
432
|
-
], ExtractMethodMixin);
|
|
433
|
-
|
|
434
|
-
const OPTIONS_METHOD_NAME = 'options';
|
|
396
|
+
ExtractMethodMixin = __decorate([Mixin(ExtractMethodsMixin)], ExtractMethodMixin);
|
|
397
|
+
const OPTIONS_METHOD_NAME = "options";
|
|
435
398
|
function UseOptionsMethod(method, config) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
399
|
+
return function(target, propertyKey) {
|
|
400
|
+
UseMethod(method, OPTIONS_METHOD_NAME, config)(target, propertyKey);
|
|
401
|
+
};
|
|
439
402
|
}
|
|
440
403
|
let ExtractOptionsMethodMixin = class ExtractOptionsMethodMixin {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
404
|
+
extractOptionsMethod(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
405
|
+
return this.extractMethod(formDefinition, control.controlId, OPTIONS_METHOD_NAME);
|
|
406
|
+
}
|
|
444
407
|
};
|
|
445
|
-
ExtractOptionsMethodMixin = __decorate([
|
|
446
|
-
|
|
447
|
-
], ExtractOptionsMethodMixin);
|
|
448
|
-
|
|
449
|
-
const RESOLVE_METHOD_NAME = 'resolve';
|
|
408
|
+
ExtractOptionsMethodMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractMethodMixin, ExtractControlMixin)], ExtractOptionsMethodMixin);
|
|
409
|
+
const RESOLVE_METHOD_NAME = "resolve";
|
|
450
410
|
function UseResolveMethod(method, config) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
411
|
+
return function(target, propertyKey) {
|
|
412
|
+
UseMethod(method, RESOLVE_METHOD_NAME, config)(target, propertyKey);
|
|
413
|
+
};
|
|
454
414
|
}
|
|
455
415
|
let ExtractResolveMethodMixin = class ExtractResolveMethodMixin {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
416
|
+
extractResolveMethod(control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
417
|
+
return this.extractMethod(formDefinition, control.controlId, RESOLVE_METHOD_NAME);
|
|
418
|
+
}
|
|
459
419
|
};
|
|
460
|
-
ExtractResolveMethodMixin = __decorate([
|
|
461
|
-
|
|
462
|
-
], ExtractResolveMethodMixin);
|
|
463
|
-
|
|
464
|
-
const TO_DISPLAY_FUNCTION_NAME = 'to-display';
|
|
420
|
+
ExtractResolveMethodMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractMethodMixin, ExtractControlMixin)], ExtractResolveMethodMixin);
|
|
421
|
+
const TO_DISPLAY_FUNCTION_NAME = "to-display";
|
|
465
422
|
function UseToDisplayFunction(fnc, config) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
423
|
+
return function(target, propertyKey) {
|
|
424
|
+
UseFunction(fnc, TO_DISPLAY_FUNCTION_NAME, config)(target, propertyKey);
|
|
425
|
+
};
|
|
469
426
|
}
|
|
470
427
|
let ExtractToDisplayFunctionMixin = class ExtractToDisplayFunctionMixin {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
428
|
+
extractToDisplayFunction(defaultFunction = null, control = this.extractControl(), formDefinition = this.extractFormDefinition(control)) {
|
|
429
|
+
return this.extractFunction(defaultFunction, formDefinition, control.controlId, TO_DISPLAY_FUNCTION_NAME);
|
|
430
|
+
}
|
|
474
431
|
};
|
|
475
|
-
ExtractToDisplayFunctionMixin = __decorate([
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
i0.ɵɵ
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
432
|
+
ExtractToDisplayFunctionMixin = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractFunctionMixin, ExtractControlMixin)], ExtractToDisplayFunctionMixin);
|
|
433
|
+
var ForFormArrayItemsDirective = class ForFormArrayItemsDirective {
|
|
434
|
+
constructor() {
|
|
435
|
+
this.container = inject(ControlContainer, { skipSelf: true });
|
|
436
|
+
this.template = inject(TemplateRef);
|
|
437
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
438
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
439
|
+
}
|
|
440
|
+
ngAfterViewInit() {
|
|
441
|
+
if (this.container.control instanceof RxapFormArray) {
|
|
442
|
+
this.formArray = this.container.control;
|
|
443
|
+
this.container.control.value$.pipe(debounceTime(100), map$1((value) => value.length), distinctUntilChanged$1(), startWith$1(0), pairwise(), tap$1(([a, b]) => {
|
|
444
|
+
if (a !== b) this.render(b);
|
|
445
|
+
})).subscribe();
|
|
446
|
+
} else throw new Error("The control container is not an instance of RxapFormArray");
|
|
447
|
+
}
|
|
448
|
+
ngOnDestroy() {
|
|
449
|
+
this._formArrayValueSubscription?.unsubscribe();
|
|
450
|
+
}
|
|
451
|
+
render(length) {
|
|
452
|
+
this.viewContainerRef.clear();
|
|
453
|
+
for (let index = 0; index < length; index++) {
|
|
454
|
+
const group = this.formArray.at(index);
|
|
455
|
+
if (group instanceof UntypedFormGroup) this.viewContainerRef.createEmbeddedView(this.template, {
|
|
456
|
+
$implicit: group,
|
|
457
|
+
index,
|
|
458
|
+
first: index === 0,
|
|
459
|
+
last: index === length - 1,
|
|
460
|
+
even: index % 2 === 0,
|
|
461
|
+
odd: index % 2 !== 0,
|
|
462
|
+
array: this.formArray
|
|
463
|
+
});
|
|
464
|
+
else throw new Error("rxapForFormArrayItem only support FormArray with FormGroup as items");
|
|
465
|
+
}
|
|
466
|
+
this.cdr.detectChanges();
|
|
467
|
+
}
|
|
468
|
+
static {
|
|
469
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
470
|
+
minVersion: "12.0.0",
|
|
471
|
+
version: "22.3.0",
|
|
472
|
+
ngImport: i0,
|
|
473
|
+
type: ForFormArrayItemsDirective,
|
|
474
|
+
deps: [],
|
|
475
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
static {
|
|
479
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
480
|
+
minVersion: "14.0.0",
|
|
481
|
+
version: "22.3.0",
|
|
482
|
+
type: ForFormArrayItemsDirective,
|
|
483
|
+
isStandalone: true,
|
|
484
|
+
selector: "[rxapForFormArrayItem]",
|
|
485
|
+
ngImport: i0
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
490
|
+
minVersion: "12.0.0",
|
|
491
|
+
version: "22.3.0",
|
|
492
|
+
ngImport: i0,
|
|
493
|
+
type: ForFormArrayItemsDirective,
|
|
494
|
+
decorators: [{
|
|
495
|
+
type: Directive,
|
|
496
|
+
args: [{
|
|
497
|
+
selector: "[rxapForFormArrayItem]",
|
|
498
|
+
standalone: true
|
|
499
|
+
}]
|
|
500
|
+
}]
|
|
501
|
+
});
|
|
502
|
+
var FormArrayAddItemButtonDirective = class FormArrayAddItemButtonDirective {
|
|
503
|
+
constructor() {
|
|
504
|
+
this.parent = inject(ControlContainer, { skipSelf: true });
|
|
505
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
506
|
+
this.type = "button";
|
|
507
|
+
}
|
|
508
|
+
get disabled() {
|
|
509
|
+
return this.isDisabled;
|
|
510
|
+
}
|
|
511
|
+
get isDisabled() {
|
|
512
|
+
return !!this.formArray?.disabled;
|
|
513
|
+
}
|
|
514
|
+
ngAfterViewInit() {
|
|
515
|
+
if (this.parent.control instanceof RxapFormArray) this.formArray = this.parent.control;
|
|
516
|
+
const matButton = this.matButton;
|
|
517
|
+
if (matButton) this._controlDisabledSubscription = this.formArray.disabled$.pipe(tap$1((isDisabled) => matButton.disabled = isDisabled)).subscribe();
|
|
518
|
+
}
|
|
519
|
+
ngOnDestroy() {
|
|
520
|
+
this._controlDisabledSubscription?.unsubscribe();
|
|
521
|
+
}
|
|
522
|
+
onClick() {
|
|
523
|
+
this.formArray.insertAt();
|
|
524
|
+
}
|
|
525
|
+
static {
|
|
526
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
527
|
+
minVersion: "12.0.0",
|
|
528
|
+
version: "22.3.0",
|
|
529
|
+
ngImport: i0,
|
|
530
|
+
type: FormArrayAddItemButtonDirective,
|
|
531
|
+
deps: [],
|
|
532
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
static {
|
|
536
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
537
|
+
minVersion: "14.0.0",
|
|
538
|
+
version: "22.3.0",
|
|
539
|
+
type: FormArrayAddItemButtonDirective,
|
|
540
|
+
isStandalone: true,
|
|
541
|
+
selector: "[rxapFormArrayItemAddButton]",
|
|
542
|
+
host: {
|
|
543
|
+
attributes: { "type": "button" },
|
|
544
|
+
listeners: { "click": "onClick()" },
|
|
545
|
+
properties: { "disabled": "disabled" }
|
|
546
|
+
},
|
|
547
|
+
ngImport: i0
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
552
|
+
minVersion: "12.0.0",
|
|
553
|
+
version: "22.3.0",
|
|
554
|
+
ngImport: i0,
|
|
555
|
+
type: FormArrayAddItemButtonDirective,
|
|
556
|
+
decorators: [{
|
|
557
|
+
type: Directive,
|
|
558
|
+
args: [{
|
|
559
|
+
selector: "[rxapFormArrayItemAddButton]",
|
|
560
|
+
standalone: true,
|
|
561
|
+
host: {
|
|
562
|
+
"type": "button",
|
|
563
|
+
"[disabled]": "disabled",
|
|
564
|
+
"(click)": "onClick()"
|
|
565
|
+
}
|
|
566
|
+
}]
|
|
567
|
+
}]
|
|
568
|
+
});
|
|
569
|
+
var FormArrayItemButton = class FormArrayItemButton {
|
|
570
|
+
constructor() {
|
|
571
|
+
this.type = "button";
|
|
572
|
+
this.parent = inject(ControlContainer, { skipSelf: true });
|
|
573
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
574
|
+
this.renderer = inject(Renderer2);
|
|
575
|
+
this.elementRef = inject(ElementRef);
|
|
576
|
+
}
|
|
577
|
+
get disabled() {
|
|
578
|
+
return this.isDisabled;
|
|
579
|
+
}
|
|
580
|
+
get isDeleted() {
|
|
581
|
+
return this.deletedControl.value;
|
|
582
|
+
}
|
|
583
|
+
get index() {
|
|
584
|
+
return this.formArray.controls.findIndex((control) => control === this.formGroup);
|
|
585
|
+
}
|
|
586
|
+
get isDisabled() {
|
|
587
|
+
return !!this.formGroup?.parent?.disabled;
|
|
588
|
+
}
|
|
589
|
+
ngAfterViewInit() {
|
|
590
|
+
if (this.parent.control instanceof RxapFormGroup) {
|
|
591
|
+
this.formGroup = this.parent.control;
|
|
592
|
+
if (this.formGroup.controls.deleted) {
|
|
593
|
+
if (this.formGroup.controls.deleted instanceof RxapFormControl) this.deletedControl = this.formGroup.controls.deleted;
|
|
594
|
+
else throw new Error(`The parent FormGroup instance does have a 'deleted' control, but it is not a RxapFormControl instance`);
|
|
595
|
+
} else {
|
|
596
|
+
this.deletedControl = new RxapFormControl(false, { controlId: "deleted" });
|
|
597
|
+
this.formGroup.addControl("deleted", this.deletedControl);
|
|
598
|
+
}
|
|
599
|
+
if (this.formGroup.parent instanceof RxapFormArray) this.formArray = this.formGroup.parent;
|
|
600
|
+
else throw new Error(`The parent of the FormGroup is not a RxapFormArray instance`);
|
|
601
|
+
} else throw new Error(`The parent is not a form group instance`);
|
|
602
|
+
const matButton = this.matButton;
|
|
603
|
+
if (matButton) this._controlDisabledSubscription = this.formGroup.disabled$.pipe(tap$1((isDisabled) => matButton.disabled = isDisabled)).subscribe();
|
|
604
|
+
this.deletedControl.value$.pipe(tap$1(() => this.updateDisplayStyle())).subscribe();
|
|
605
|
+
}
|
|
606
|
+
ngOnDestroy() {
|
|
607
|
+
this._controlDisabledSubscription?.unsubscribe();
|
|
608
|
+
this._deletedControlValueSubscription?.unsubscribe();
|
|
609
|
+
}
|
|
610
|
+
static {
|
|
611
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
612
|
+
minVersion: "12.0.0",
|
|
613
|
+
version: "22.3.0",
|
|
614
|
+
ngImport: i0,
|
|
615
|
+
type: FormArrayItemButton,
|
|
616
|
+
deps: [],
|
|
617
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
static {
|
|
621
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
622
|
+
minVersion: "14.0.0",
|
|
623
|
+
version: "22.3.0",
|
|
624
|
+
type: FormArrayItemButton,
|
|
625
|
+
isStandalone: true,
|
|
626
|
+
host: {
|
|
627
|
+
attributes: { "type": "button" },
|
|
628
|
+
listeners: { "click": "onClick()" },
|
|
629
|
+
properties: { "disabled": "disabled" }
|
|
630
|
+
},
|
|
631
|
+
ngImport: i0
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
636
|
+
minVersion: "12.0.0",
|
|
637
|
+
version: "22.3.0",
|
|
638
|
+
ngImport: i0,
|
|
639
|
+
type: FormArrayItemButton,
|
|
640
|
+
decorators: [{
|
|
641
|
+
type: Directive,
|
|
642
|
+
args: [{ host: {
|
|
643
|
+
"type": "button",
|
|
644
|
+
"[disabled]": "disabled",
|
|
645
|
+
"(click)": "onClick()"
|
|
646
|
+
} }]
|
|
647
|
+
}]
|
|
648
|
+
});
|
|
649
|
+
var FormArrayItemRemoveButtonDirective = class FormArrayItemRemoveButtonDirective extends FormArrayItemButton {
|
|
650
|
+
constructor() {
|
|
651
|
+
super(...arguments);
|
|
652
|
+
this.shouldTemporarilyDeleted = input(() => false, ...ngDevMode ? [{ debugName: "shouldTemporarilyDeleted" }] : /* istanbul ignore next */ []);
|
|
653
|
+
}
|
|
654
|
+
onClick() {
|
|
655
|
+
if (this.shouldTemporarilyDeleted()(this.formGroup)) this.deletedControl.setValue(true);
|
|
656
|
+
else this.formArray.removeAt(this.index);
|
|
657
|
+
}
|
|
658
|
+
updateDisplayStyle() {
|
|
659
|
+
if (this.isDeleted) this.renderer.setStyle(this.elementRef.nativeElement, "display", "none");
|
|
660
|
+
else this.renderer.removeStyle(this.elementRef.nativeElement, "display");
|
|
661
|
+
}
|
|
662
|
+
static {
|
|
663
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
664
|
+
minVersion: "12.0.0",
|
|
665
|
+
version: "22.3.0",
|
|
666
|
+
ngImport: i0,
|
|
667
|
+
type: FormArrayItemRemoveButtonDirective,
|
|
668
|
+
deps: null,
|
|
669
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
static {
|
|
673
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
674
|
+
minVersion: "17.1.0",
|
|
675
|
+
version: "22.3.0",
|
|
676
|
+
type: FormArrayItemRemoveButtonDirective,
|
|
677
|
+
isStandalone: true,
|
|
678
|
+
selector: "button[rxapFormArrayItemRemoveButton]",
|
|
679
|
+
inputs: { shouldTemporarilyDeleted: {
|
|
680
|
+
classPropertyName: "shouldTemporarilyDeleted",
|
|
681
|
+
publicName: "shouldTemporarilyDeleted",
|
|
682
|
+
isSignal: true,
|
|
683
|
+
isRequired: false,
|
|
684
|
+
transformFunction: null
|
|
685
|
+
} },
|
|
686
|
+
usesInheritance: true,
|
|
687
|
+
ngImport: i0
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
692
|
+
minVersion: "12.0.0",
|
|
693
|
+
version: "22.3.0",
|
|
694
|
+
ngImport: i0,
|
|
695
|
+
type: FormArrayItemRemoveButtonDirective,
|
|
696
|
+
decorators: [{
|
|
697
|
+
type: Directive,
|
|
698
|
+
args: [{
|
|
699
|
+
selector: "button[rxapFormArrayItemRemoveButton]",
|
|
700
|
+
standalone: true
|
|
701
|
+
}]
|
|
702
|
+
}],
|
|
703
|
+
propDecorators: { shouldTemporarilyDeleted: [{
|
|
704
|
+
type: i0.Input,
|
|
705
|
+
args: [{
|
|
706
|
+
isSignal: true,
|
|
707
|
+
alias: "shouldTemporarilyDeleted",
|
|
708
|
+
required: false
|
|
709
|
+
}]
|
|
710
|
+
}] }
|
|
711
|
+
});
|
|
712
|
+
var FormArrayItemRestoreButtonDirective = class FormArrayItemRestoreButtonDirective extends FormArrayItemButton {
|
|
713
|
+
onClick() {
|
|
714
|
+
this.formGroup.controls.deleted.setValue(false);
|
|
715
|
+
}
|
|
716
|
+
updateDisplayStyle() {
|
|
717
|
+
if (this.isDeleted) this.renderer.removeStyle(this.elementRef.nativeElement, "display");
|
|
718
|
+
else this.renderer.setStyle(this.elementRef.nativeElement, "display", "none");
|
|
719
|
+
}
|
|
720
|
+
static {
|
|
721
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
722
|
+
minVersion: "12.0.0",
|
|
723
|
+
version: "22.3.0",
|
|
724
|
+
ngImport: i0,
|
|
725
|
+
type: FormArrayItemRestoreButtonDirective,
|
|
726
|
+
deps: null,
|
|
727
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
static {
|
|
731
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
732
|
+
minVersion: "14.0.0",
|
|
733
|
+
version: "22.3.0",
|
|
734
|
+
type: FormArrayItemRestoreButtonDirective,
|
|
735
|
+
isStandalone: true,
|
|
736
|
+
selector: "button[rxapFormArrayItemRestoreButton]",
|
|
737
|
+
usesInheritance: true,
|
|
738
|
+
ngImport: i0
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
743
|
+
minVersion: "12.0.0",
|
|
744
|
+
version: "22.3.0",
|
|
745
|
+
ngImport: i0,
|
|
746
|
+
type: FormArrayItemRestoreButtonDirective,
|
|
747
|
+
decorators: [{
|
|
748
|
+
type: Directive,
|
|
749
|
+
args: [{
|
|
750
|
+
selector: "button[rxapFormArrayItemRestoreButton]",
|
|
751
|
+
standalone: true
|
|
752
|
+
}]
|
|
753
|
+
}]
|
|
754
|
+
});
|
|
755
|
+
var FormArrayRemovableDirective = class FormArrayRemovableDirective {
|
|
756
|
+
constructor() {
|
|
757
|
+
this.parent = inject(ControlContainer);
|
|
758
|
+
}
|
|
759
|
+
get isDeleted() {
|
|
760
|
+
return this.deletedControl.value;
|
|
761
|
+
}
|
|
762
|
+
get isDisabled() {
|
|
763
|
+
return !!this.formGroup?.parent?.disabled;
|
|
764
|
+
}
|
|
765
|
+
ngAfterViewInit() {
|
|
766
|
+
if (this.parent.control instanceof RxapFormGroup) {
|
|
767
|
+
this.formGroup = this.parent.control;
|
|
768
|
+
if (this.formGroup.controls.deleted) {
|
|
769
|
+
if (this.formGroup.controls.deleted instanceof RxapFormControl) this.deletedControl = this.formGroup.controls.deleted;
|
|
770
|
+
else throw new Error(`The parent FormGroup instance does have a 'deleted' control, but it is not a RxapFormControl instance`);
|
|
771
|
+
} else {
|
|
772
|
+
this.deletedControl = new RxapFormControl(false, { controlId: "deleted" });
|
|
773
|
+
this.formGroup.addControl("deleted", this.deletedControl);
|
|
774
|
+
}
|
|
775
|
+
if (!(this.formGroup.parent instanceof UntypedFormArray)) throw new Error(`The parent of the FormGroup is not a FormArray instance`);
|
|
776
|
+
} else throw new Error(`The parent is not a form group instance`);
|
|
777
|
+
this._deletedControlValueSubscription = this.deletedControl.value$.pipe(tap$1((isDeleted) => {
|
|
778
|
+
for (const [name, control] of Object.entries(this.formGroup.controls)) if (name !== "deleted") {
|
|
779
|
+
if (isDeleted) control.disable({ onlySelf: true });
|
|
780
|
+
else if (!this.isDisabled) control.enable({ onlySelf: true });
|
|
781
|
+
}
|
|
782
|
+
})).subscribe();
|
|
783
|
+
}
|
|
784
|
+
ngOnDestroy() {
|
|
785
|
+
this._deletedControlValueSubscription?.unsubscribe();
|
|
786
|
+
}
|
|
787
|
+
static {
|
|
788
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
789
|
+
minVersion: "12.0.0",
|
|
790
|
+
version: "22.3.0",
|
|
791
|
+
ngImport: i0,
|
|
792
|
+
type: FormArrayRemovableDirective,
|
|
793
|
+
deps: [],
|
|
794
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
static {
|
|
798
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
799
|
+
minVersion: "14.0.0",
|
|
800
|
+
version: "22.3.0",
|
|
801
|
+
type: FormArrayRemovableDirective,
|
|
802
|
+
isStandalone: true,
|
|
803
|
+
selector: "[rxapFormArrayRemovable]",
|
|
804
|
+
ngImport: i0
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
809
|
+
minVersion: "12.0.0",
|
|
810
|
+
version: "22.3.0",
|
|
811
|
+
ngImport: i0,
|
|
812
|
+
type: FormArrayRemovableDirective,
|
|
813
|
+
decorators: [{
|
|
814
|
+
type: Directive,
|
|
815
|
+
args: [{
|
|
816
|
+
selector: "[rxapFormArrayRemovable]",
|
|
817
|
+
standalone: true
|
|
818
|
+
}]
|
|
819
|
+
}]
|
|
820
|
+
});
|
|
776
821
|
let AbstractOptionsFromMethodDirective = class AbstractOptionsFromMethodDirective {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AbstractOptionsFromMethodDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
861
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AbstractOptionsFromMethodDirective, isStandalone: true, ngImport: i0 }); }
|
|
822
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
823
|
+
return true;
|
|
824
|
+
}
|
|
825
|
+
constructor() {
|
|
826
|
+
this.loading = signal(true, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
827
|
+
this.optionsMethod = linkedSignal(() => this.method(), ...ngDevMode ? [{ debugName: "optionsMethod" }] : /* istanbul ignore next */ []);
|
|
828
|
+
this.options = null;
|
|
829
|
+
this.ngControl = null;
|
|
830
|
+
this.matFormField = null;
|
|
831
|
+
this.settings = {};
|
|
832
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
833
|
+
this.injector = inject(INJECTOR);
|
|
834
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
835
|
+
this.template = inject(TemplateRef);
|
|
836
|
+
this.initialized = signal(false, ...ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []);
|
|
837
|
+
effect(() => {
|
|
838
|
+
const parameters = this.parameters();
|
|
839
|
+
if (!this.initialized()) return;
|
|
840
|
+
untracked(() => this.load(parameters));
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
ngAfterViewInit() {
|
|
844
|
+
this.matFormField = this.injector.get(MatFormField, null);
|
|
845
|
+
this.ngControl = this.matFormField?._control.ngControl ?? this.injector.get(NgControl, null);
|
|
846
|
+
this.control = this.ngControl?.control ?? void 0;
|
|
847
|
+
if (!this.optionsMethod()) this.optionsMethod.set(this.extractOptionsMethod());
|
|
848
|
+
this.initialized.set(true);
|
|
849
|
+
}
|
|
850
|
+
ngOnDestroy() {
|
|
851
|
+
this._loadOptionsSubscription?.unsubscribe();
|
|
852
|
+
}
|
|
853
|
+
async loadOptions(parameters) {
|
|
854
|
+
return this.optionsMethod().call(parameters, this.control);
|
|
855
|
+
}
|
|
856
|
+
renderTemplate() {
|
|
857
|
+
if (!this.options) throw new Error("The options are not yet loaded");
|
|
858
|
+
this.viewContainerRef.clear();
|
|
859
|
+
for (const option of this.options) this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
|
|
860
|
+
const resetOnChange = untracked(this.resetOnChange);
|
|
861
|
+
if (resetOnChange !== void 0) this.control?.reset(resetOnChange);
|
|
862
|
+
this.cdr.detectChanges();
|
|
863
|
+
}
|
|
864
|
+
setOptions(options) {
|
|
865
|
+
if (!options) {
|
|
866
|
+
this.options = null;
|
|
867
|
+
this.viewContainerRef.clear();
|
|
868
|
+
} else {
|
|
869
|
+
this.options = options.slice();
|
|
870
|
+
this.renderTemplate();
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
async load(parameters = untracked(this.parameters)) {
|
|
874
|
+
this.loading.set(true);
|
|
875
|
+
try {
|
|
876
|
+
const result = await this.loadOptions(parameters);
|
|
877
|
+
if (isObservable(result)) {
|
|
878
|
+
this._loadOptionsSubscription?.unsubscribe();
|
|
879
|
+
this._loadOptionsSubscription = result.pipe(tap$1((options) => this.setOptions(options))).subscribe();
|
|
880
|
+
} else this.setOptions(result);
|
|
881
|
+
} finally {
|
|
882
|
+
this.loading.set(false);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
static {
|
|
886
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
887
|
+
minVersion: "12.0.0",
|
|
888
|
+
version: "22.3.0",
|
|
889
|
+
ngImport: i0,
|
|
890
|
+
type: AbstractOptionsFromMethodDirective,
|
|
891
|
+
deps: [],
|
|
892
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
static {
|
|
896
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
897
|
+
minVersion: "14.0.0",
|
|
898
|
+
version: "22.3.0",
|
|
899
|
+
type: AbstractOptionsFromMethodDirective,
|
|
900
|
+
isStandalone: true,
|
|
901
|
+
ngImport: i0
|
|
902
|
+
});
|
|
903
|
+
}
|
|
862
904
|
};
|
|
863
|
-
AbstractOptionsFromMethodDirective = __decorate([
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
905
|
+
AbstractOptionsFromMethodDirective = __decorate([Mixin(ExtractOptionsMethodMixin), __metadata("design:paramtypes", [])], AbstractOptionsFromMethodDirective);
|
|
906
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
907
|
+
minVersion: "12.0.0",
|
|
908
|
+
version: "22.3.0",
|
|
909
|
+
ngImport: i0,
|
|
910
|
+
type: AbstractOptionsFromMethodDirective,
|
|
911
|
+
decorators: [{ type: Directive }],
|
|
912
|
+
ctorParameters: () => []
|
|
913
|
+
});
|
|
914
|
+
var OptionsFromMethodDirective = class OptionsFromMethodDirective extends AbstractOptionsFromMethodDirective {
|
|
915
|
+
constructor() {
|
|
916
|
+
super(...arguments);
|
|
917
|
+
this.parameters = input(void 0, {
|
|
918
|
+
...ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {},
|
|
919
|
+
alias: "rxapOptionsFromMethodParameters"
|
|
920
|
+
});
|
|
921
|
+
this.resetOnChange = input(void 0, {
|
|
922
|
+
...ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {},
|
|
923
|
+
alias: "rxapOptionsFromMethodResetOnChange"
|
|
924
|
+
});
|
|
925
|
+
this.method = input(void 0, {
|
|
926
|
+
...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
|
|
927
|
+
alias: "rxapOptionsFromMethodCall"
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
static {
|
|
931
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
932
|
+
minVersion: "12.0.0",
|
|
933
|
+
version: "22.3.0",
|
|
934
|
+
ngImport: i0,
|
|
935
|
+
type: OptionsFromMethodDirective,
|
|
936
|
+
deps: null,
|
|
937
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
static {
|
|
941
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
942
|
+
minVersion: "17.1.0",
|
|
943
|
+
version: "22.3.0",
|
|
944
|
+
type: OptionsFromMethodDirective,
|
|
945
|
+
isStandalone: true,
|
|
946
|
+
selector: "[rxapOptionsFromMethod]",
|
|
947
|
+
inputs: {
|
|
948
|
+
parameters: {
|
|
949
|
+
classPropertyName: "parameters",
|
|
950
|
+
publicName: "rxapOptionsFromMethodParameters",
|
|
951
|
+
isSignal: true,
|
|
952
|
+
isRequired: false,
|
|
953
|
+
transformFunction: null
|
|
954
|
+
},
|
|
955
|
+
resetOnChange: {
|
|
956
|
+
classPropertyName: "resetOnChange",
|
|
957
|
+
publicName: "rxapOptionsFromMethodResetOnChange",
|
|
958
|
+
isSignal: true,
|
|
959
|
+
isRequired: false,
|
|
960
|
+
transformFunction: null
|
|
961
|
+
},
|
|
962
|
+
method: {
|
|
963
|
+
classPropertyName: "method",
|
|
964
|
+
publicName: "rxapOptionsFromMethodCall",
|
|
965
|
+
isSignal: true,
|
|
966
|
+
isRequired: false,
|
|
967
|
+
transformFunction: null
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
exportAs: ["rxapOptionsFromMethod"],
|
|
971
|
+
usesInheritance: true,
|
|
972
|
+
ngImport: i0
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
977
|
+
minVersion: "12.0.0",
|
|
978
|
+
version: "22.3.0",
|
|
979
|
+
ngImport: i0,
|
|
980
|
+
type: OptionsFromMethodDirective,
|
|
981
|
+
decorators: [{
|
|
982
|
+
type: Directive,
|
|
983
|
+
args: [{
|
|
984
|
+
selector: "[rxapOptionsFromMethod]",
|
|
985
|
+
standalone: true,
|
|
986
|
+
exportAs: "rxapOptionsFromMethod"
|
|
987
|
+
}]
|
|
988
|
+
}],
|
|
989
|
+
propDecorators: {
|
|
990
|
+
parameters: [{
|
|
991
|
+
type: i0.Input,
|
|
992
|
+
args: [{
|
|
993
|
+
isSignal: true,
|
|
994
|
+
alias: "rxapOptionsFromMethodParameters",
|
|
995
|
+
required: false
|
|
996
|
+
}]
|
|
997
|
+
}],
|
|
998
|
+
resetOnChange: [{
|
|
999
|
+
type: i0.Input,
|
|
1000
|
+
args: [{
|
|
1001
|
+
isSignal: true,
|
|
1002
|
+
alias: "rxapOptionsFromMethodResetOnChange",
|
|
1003
|
+
required: false
|
|
1004
|
+
}]
|
|
1005
|
+
}],
|
|
1006
|
+
method: [{
|
|
1007
|
+
type: i0.Input,
|
|
1008
|
+
args: [{
|
|
1009
|
+
isSignal: true,
|
|
1010
|
+
alias: "rxapOptionsFromMethodCall",
|
|
1011
|
+
required: false
|
|
1012
|
+
}]
|
|
1013
|
+
}]
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
891
1016
|
function UseAutocompleteOptionsMethod(method, config = {}) {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1017
|
+
config.adapter ??= {};
|
|
1018
|
+
config.adapter.parameter ??= (parameters) => ({ parameters });
|
|
1019
|
+
return UseOptionsMethod(method, config);
|
|
895
1020
|
}
|
|
896
1021
|
function UseAutocompleteResolveMethod(method, config = {}) {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1022
|
+
config.adapter ??= {};
|
|
1023
|
+
config.adapter.parameter ??= (parameters) => ({ parameters });
|
|
1024
|
+
return UseResolveMethod(method, config);
|
|
900
1025
|
}
|
|
901
1026
|
function UseAutocompleteIsValueFunction(isValue) {
|
|
902
|
-
|
|
1027
|
+
return UseIsValueFunction(isValue);
|
|
903
1028
|
}
|
|
904
1029
|
function UseAutocompleteToDisplayFunction(toDisplay) {
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
class NoopResolveMethod {
|
|
908
|
-
call({ value }) {
|
|
909
|
-
return Promise.resolve({ value, display: value + '' });
|
|
910
|
-
}
|
|
911
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoopResolveMethod, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
912
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoopResolveMethod, providedIn: 'root' }); }
|
|
1030
|
+
return UseToDisplayFunction(toDisplay);
|
|
913
1031
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1032
|
+
var NoopResolveMethod = class NoopResolveMethod {
|
|
1033
|
+
call({ value }) {
|
|
1034
|
+
return Promise.resolve({
|
|
1035
|
+
value,
|
|
1036
|
+
display: value + ""
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
static {
|
|
1040
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1041
|
+
minVersion: "12.0.0",
|
|
1042
|
+
version: "22.3.0",
|
|
1043
|
+
ngImport: i0,
|
|
1044
|
+
type: NoopResolveMethod,
|
|
1045
|
+
deps: [],
|
|
1046
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
static {
|
|
1050
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1051
|
+
minVersion: "12.0.0",
|
|
1052
|
+
version: "22.3.0",
|
|
1053
|
+
ngImport: i0,
|
|
1054
|
+
type: NoopResolveMethod,
|
|
1055
|
+
providedIn: "root"
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1060
|
+
minVersion: "12.0.0",
|
|
1061
|
+
version: "22.3.0",
|
|
1062
|
+
ngImport: i0,
|
|
1063
|
+
type: NoopResolveMethod,
|
|
1064
|
+
decorators: [{
|
|
1065
|
+
type: Injectable,
|
|
1066
|
+
args: [{ providedIn: "root" }]
|
|
1067
|
+
}]
|
|
1068
|
+
});
|
|
918
1069
|
let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethodDirective extends AbstractOptionsFromMethodDirective {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1070
|
+
constructor() {
|
|
1071
|
+
super(...arguments);
|
|
1072
|
+
this.parameters = input(void 0, {
|
|
1073
|
+
...ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {},
|
|
1074
|
+
alias: "rxapAutocompleteOptionsFromMethodParameters"
|
|
1075
|
+
});
|
|
1076
|
+
this.resetOnChange = input(void 0, {
|
|
1077
|
+
...ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {},
|
|
1078
|
+
alias: "rxapAutocompleteOptionsFromMethodResetOnChange"
|
|
1079
|
+
});
|
|
1080
|
+
this.matAutocomplete = input(void 0, {
|
|
1081
|
+
...ngDevMode ? { debugName: "matAutocomplete" } : /* istanbul ignore next */ {},
|
|
1082
|
+
alias: "rxapAutocompleteOptionsFromMethodMatAutocomplete"
|
|
1083
|
+
});
|
|
1084
|
+
this.method = input(void 0, {
|
|
1085
|
+
...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
|
|
1086
|
+
alias: "rxapAutocompleteOptionsFromMethodCall"
|
|
1087
|
+
});
|
|
1088
|
+
this.resolveMethod = input(void 0, {
|
|
1089
|
+
...ngDevMode ? { debugName: "resolveMethod" } : /* istanbul ignore next */ {},
|
|
1090
|
+
alias: "rxapAutocompleteOptionsFromMethodResolve"
|
|
1091
|
+
});
|
|
1092
|
+
this.isValue = input(void 0, {
|
|
1093
|
+
...ngDevMode ? { debugName: "isValue" } : /* istanbul ignore next */ {},
|
|
1094
|
+
alias: "rxapAutocompleteOptionsFromMethodIsValue"
|
|
1095
|
+
});
|
|
1096
|
+
this.toDisplay = input(void 0, {
|
|
1097
|
+
...ngDevMode ? { debugName: "toDisplay" } : /* istanbul ignore next */ {},
|
|
1098
|
+
alias: "rxapAutocompleteOptionsFromMethodToDisplay"
|
|
1099
|
+
});
|
|
1100
|
+
this.resolvedResolveMethod = linkedSignal(() => this.resolveMethod(), ...ngDevMode ? [{ debugName: "resolvedResolveMethod" }] : /* istanbul ignore next */ []);
|
|
1101
|
+
this.resolvedIsValue = linkedSignal(() => this.isValue(), ...ngDevMode ? [{ debugName: "resolvedIsValue" }] : /* istanbul ignore next */ []);
|
|
1102
|
+
this.resolvedToDisplay = linkedSignal(() => this.toDisplay(), ...ngDevMode ? [{ debugName: "resolvedToDisplay" }] : /* istanbul ignore next */ []);
|
|
1103
|
+
this.ngControl = null;
|
|
1104
|
+
this.matFormField = null;
|
|
1105
|
+
this.injector = inject(INJECTOR);
|
|
1106
|
+
this.settings = {};
|
|
1107
|
+
this.isAutocompleteToDisplayTriggered = false;
|
|
1108
|
+
}
|
|
1109
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
1110
|
+
return true;
|
|
1111
|
+
}
|
|
1112
|
+
ngOnDestroy() {
|
|
1113
|
+
super.ngOnDestroy();
|
|
1114
|
+
this._subscription?.unsubscribe();
|
|
1115
|
+
}
|
|
1116
|
+
ngAfterViewInit() {
|
|
1117
|
+
const matAutocomplete = this.matAutocomplete();
|
|
1118
|
+
if (matAutocomplete) {
|
|
1119
|
+
this.settings ??= {};
|
|
1120
|
+
this.settings.filteredOptions ??= true;
|
|
1121
|
+
}
|
|
1122
|
+
super.ngAfterViewInit();
|
|
1123
|
+
if (!this.resolvedResolveMethod()) this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
1124
|
+
if (!this.resolvedIsValue()) this.resolvedIsValue.set(this.extractIsValueFunction((value) => typeof value === "string" && isUUID(value)));
|
|
1125
|
+
if (!this.resolvedToDisplay()) this.resolvedToDisplay.set(this.extractToDisplayFunction((value) => {
|
|
1126
|
+
if (!value) return "";
|
|
1127
|
+
return this.findOptionByValue(value)?.display ?? (isDevMode() ? "to display error" : "...");
|
|
1128
|
+
}));
|
|
1129
|
+
if (matAutocomplete) matAutocomplete.displayWith = this.resolvedToDisplay().bind(this);
|
|
1130
|
+
if (!this.control) throw new Error("The control is not yet defined");
|
|
1131
|
+
const value$ = controlValueChanges$(this.control);
|
|
1132
|
+
this._subscription = value$.pipe(isDefined(), distinctUntilChanged$1(), tap$1(async (value) => {
|
|
1133
|
+
await this.load(untracked(this.parameters));
|
|
1134
|
+
if (this.resolvedIsValue()?.(value)) this.triggerAutocompleteToDisplay();
|
|
1135
|
+
})).subscribe();
|
|
1136
|
+
}
|
|
1137
|
+
loadOptions(parameters = {}) {
|
|
1138
|
+
if (!this.control) throw new Error("The control is not yet defined");
|
|
1139
|
+
const value = this.control?.value;
|
|
1140
|
+
const c_parameters = { ...parameters };
|
|
1141
|
+
if (this.resolvedIsValue()?.(value)) return this.resolveValue(value, c_parameters);
|
|
1142
|
+
else {
|
|
1143
|
+
c_parameters.search ??= value;
|
|
1144
|
+
if (!c_parameters.search) return Promise.resolve([]);
|
|
1145
|
+
return super.loadOptions(c_parameters);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
renderTemplate() {
|
|
1149
|
+
super.renderTemplate();
|
|
1150
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
1151
|
+
this.isAutocompleteToDisplayTriggered = true;
|
|
1152
|
+
this.triggerAutocompleteToDisplay();
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
async resolveValue(value, parameters = {}) {
|
|
1156
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
1157
|
+
if (!resolveMethod) {
|
|
1158
|
+
if (isDevMode()) console.warn("The resolve method is not yet defined");
|
|
1159
|
+
return null;
|
|
1160
|
+
}
|
|
1161
|
+
if (!this.findOptionByValue(value)) {
|
|
1162
|
+
const option = await resolveMethod.call({
|
|
1163
|
+
...parameters,
|
|
1164
|
+
value
|
|
1165
|
+
});
|
|
1166
|
+
if (option.value !== value) throw new Error("The resolved value is not the same as the input value");
|
|
1167
|
+
return [option];
|
|
1168
|
+
}
|
|
1169
|
+
return this.options;
|
|
1170
|
+
}
|
|
1171
|
+
triggerAutocompleteToDisplay() {
|
|
1172
|
+
this.ngControl?.control?.setValue(this.ngControl?.control?.value);
|
|
1173
|
+
}
|
|
1174
|
+
findOptionByValue(value) {
|
|
1175
|
+
return this.options?.find((option) => option.value === value) ?? null;
|
|
1176
|
+
}
|
|
1177
|
+
static {
|
|
1178
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1179
|
+
minVersion: "12.0.0",
|
|
1180
|
+
version: "22.3.0",
|
|
1181
|
+
ngImport: i0,
|
|
1182
|
+
type: AutocompleteOptionsFromMethodDirective,
|
|
1183
|
+
deps: null,
|
|
1184
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
static {
|
|
1188
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1189
|
+
minVersion: "17.1.0",
|
|
1190
|
+
version: "22.3.0",
|
|
1191
|
+
type: AutocompleteOptionsFromMethodDirective,
|
|
1192
|
+
isStandalone: true,
|
|
1193
|
+
selector: "[rxapAutocompleteOptionsFromMethod]",
|
|
1194
|
+
inputs: {
|
|
1195
|
+
parameters: {
|
|
1196
|
+
classPropertyName: "parameters",
|
|
1197
|
+
publicName: "rxapAutocompleteOptionsFromMethodParameters",
|
|
1198
|
+
isSignal: true,
|
|
1199
|
+
isRequired: false,
|
|
1200
|
+
transformFunction: null
|
|
1201
|
+
},
|
|
1202
|
+
resetOnChange: {
|
|
1203
|
+
classPropertyName: "resetOnChange",
|
|
1204
|
+
publicName: "rxapAutocompleteOptionsFromMethodResetOnChange",
|
|
1205
|
+
isSignal: true,
|
|
1206
|
+
isRequired: false,
|
|
1207
|
+
transformFunction: null
|
|
1208
|
+
},
|
|
1209
|
+
matAutocomplete: {
|
|
1210
|
+
classPropertyName: "matAutocomplete",
|
|
1211
|
+
publicName: "rxapAutocompleteOptionsFromMethodMatAutocomplete",
|
|
1212
|
+
isSignal: true,
|
|
1213
|
+
isRequired: false,
|
|
1214
|
+
transformFunction: null
|
|
1215
|
+
},
|
|
1216
|
+
method: {
|
|
1217
|
+
classPropertyName: "method",
|
|
1218
|
+
publicName: "rxapAutocompleteOptionsFromMethodCall",
|
|
1219
|
+
isSignal: true,
|
|
1220
|
+
isRequired: false,
|
|
1221
|
+
transformFunction: null
|
|
1222
|
+
},
|
|
1223
|
+
resolveMethod: {
|
|
1224
|
+
classPropertyName: "resolveMethod",
|
|
1225
|
+
publicName: "rxapAutocompleteOptionsFromMethodResolve",
|
|
1226
|
+
isSignal: true,
|
|
1227
|
+
isRequired: false,
|
|
1228
|
+
transformFunction: null
|
|
1229
|
+
},
|
|
1230
|
+
isValue: {
|
|
1231
|
+
classPropertyName: "isValue",
|
|
1232
|
+
publicName: "rxapAutocompleteOptionsFromMethodIsValue",
|
|
1233
|
+
isSignal: true,
|
|
1234
|
+
isRequired: false,
|
|
1235
|
+
transformFunction: null
|
|
1236
|
+
},
|
|
1237
|
+
toDisplay: {
|
|
1238
|
+
classPropertyName: "toDisplay",
|
|
1239
|
+
publicName: "rxapAutocompleteOptionsFromMethodToDisplay",
|
|
1240
|
+
isSignal: true,
|
|
1241
|
+
isRequired: false,
|
|
1242
|
+
transformFunction: null
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
usesInheritance: true,
|
|
1246
|
+
ngImport: i0
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1045
1249
|
};
|
|
1046
|
-
AutocompleteOptionsFromMethodDirective = __decorate([
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1250
|
+
AutocompleteOptionsFromMethodDirective = __decorate([Mixin(ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, ExtractToDisplayFunctionMixin)], AutocompleteOptionsFromMethodDirective);
|
|
1251
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1252
|
+
minVersion: "12.0.0",
|
|
1253
|
+
version: "22.3.0",
|
|
1254
|
+
ngImport: i0,
|
|
1255
|
+
type: AutocompleteOptionsFromMethodDirective,
|
|
1256
|
+
decorators: [{
|
|
1257
|
+
type: Directive,
|
|
1258
|
+
args: [{
|
|
1259
|
+
selector: "[rxapAutocompleteOptionsFromMethod]",
|
|
1260
|
+
standalone: true
|
|
1261
|
+
}]
|
|
1262
|
+
}],
|
|
1263
|
+
propDecorators: {
|
|
1264
|
+
parameters: [{
|
|
1265
|
+
type: i0.Input,
|
|
1266
|
+
args: [{
|
|
1267
|
+
isSignal: true,
|
|
1268
|
+
alias: "rxapAutocompleteOptionsFromMethodParameters",
|
|
1269
|
+
required: false
|
|
1270
|
+
}]
|
|
1271
|
+
}],
|
|
1272
|
+
resetOnChange: [{
|
|
1273
|
+
type: i0.Input,
|
|
1274
|
+
args: [{
|
|
1275
|
+
isSignal: true,
|
|
1276
|
+
alias: "rxapAutocompleteOptionsFromMethodResetOnChange",
|
|
1277
|
+
required: false
|
|
1278
|
+
}]
|
|
1279
|
+
}],
|
|
1280
|
+
matAutocomplete: [{
|
|
1281
|
+
type: i0.Input,
|
|
1282
|
+
args: [{
|
|
1283
|
+
isSignal: true,
|
|
1284
|
+
alias: "rxapAutocompleteOptionsFromMethodMatAutocomplete",
|
|
1285
|
+
required: false
|
|
1286
|
+
}]
|
|
1287
|
+
}],
|
|
1288
|
+
method: [{
|
|
1289
|
+
type: i0.Input,
|
|
1290
|
+
args: [{
|
|
1291
|
+
isSignal: true,
|
|
1292
|
+
alias: "rxapAutocompleteOptionsFromMethodCall",
|
|
1293
|
+
required: false
|
|
1294
|
+
}]
|
|
1295
|
+
}],
|
|
1296
|
+
resolveMethod: [{
|
|
1297
|
+
type: i0.Input,
|
|
1298
|
+
args: [{
|
|
1299
|
+
isSignal: true,
|
|
1300
|
+
alias: "rxapAutocompleteOptionsFromMethodResolve",
|
|
1301
|
+
required: false
|
|
1302
|
+
}]
|
|
1303
|
+
}],
|
|
1304
|
+
isValue: [{
|
|
1305
|
+
type: i0.Input,
|
|
1306
|
+
args: [{
|
|
1307
|
+
isSignal: true,
|
|
1308
|
+
alias: "rxapAutocompleteOptionsFromMethodIsValue",
|
|
1309
|
+
required: false
|
|
1310
|
+
}]
|
|
1311
|
+
}],
|
|
1312
|
+
toDisplay: [{
|
|
1313
|
+
type: i0.Input,
|
|
1314
|
+
args: [{
|
|
1315
|
+
isSignal: true,
|
|
1316
|
+
alias: "rxapAutocompleteOptionsFromMethodToDisplay",
|
|
1317
|
+
required: false
|
|
1318
|
+
}]
|
|
1319
|
+
}]
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
const RXAP_FORM_SYSTEM_SHOW_METADATA = "rxap/form-system/show-function";
|
|
1323
|
+
const RXAP_FORM_SYSTEM_HIDE_METADATA = "rxap/form-system/hide-function";
|
|
1324
|
+
const RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS = "rxap/form-system/hide-show-options";
|
|
1061
1325
|
function UseHideFunction(hideFunction, options = {}) {
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1326
|
+
return function(target, propertyKey) {
|
|
1327
|
+
setMetadataMap(propertyKey, hideFunction, RXAP_FORM_SYSTEM_HIDE_METADATA, target);
|
|
1328
|
+
if (Object.keys(options).length) setMetadataMap(propertyKey, options, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, target);
|
|
1329
|
+
};
|
|
1068
1330
|
}
|
|
1069
1331
|
function UseShowFunction(showFunction, options = {}) {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1332
|
+
return function(target, propertyKey) {
|
|
1333
|
+
setMetadataMap(propertyKey, showFunction, RXAP_FORM_SYSTEM_SHOW_METADATA, target);
|
|
1334
|
+
if (Object.keys(options).length) setMetadataMap(propertyKey, options, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, target);
|
|
1335
|
+
};
|
|
1076
1336
|
}
|
|
1077
1337
|
let ControlHideShowDirective = class ControlHideShowDirective {
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1338
|
+
constructor() {
|
|
1339
|
+
this.renderer = inject(Renderer2);
|
|
1340
|
+
this.elementRef = inject(ElementRef);
|
|
1341
|
+
this.parent = inject(ControlContainer, { optional: true });
|
|
1342
|
+
this.ngControl = inject(NgControl, {
|
|
1343
|
+
self: true,
|
|
1344
|
+
optional: true
|
|
1345
|
+
});
|
|
1346
|
+
this.controlId = input(void 0, {
|
|
1347
|
+
...ngDevMode ? { debugName: "controlId" } : /* istanbul ignore next */ {},
|
|
1348
|
+
alias: "rxapControlHideShow"
|
|
1349
|
+
});
|
|
1350
|
+
this.subscription = new Subscription();
|
|
1351
|
+
}
|
|
1352
|
+
ngOnInit() {
|
|
1353
|
+
if (!this.ngControl && !this.parent) throw new Error("Easier the ControlContainer or NgControl must be injectable");
|
|
1354
|
+
const controlId = this.controlId();
|
|
1355
|
+
if (!this.ngControl && !controlId) throw new Error("If the NgControl is not injectable then the control id must be defined!");
|
|
1356
|
+
const control = this.ngControl?.control ?? this.extractControlFromParent(this.parent, controlId);
|
|
1357
|
+
if (!(control instanceof RxapFormControl)) throw new Error("The control is not an instance of RxapFormControl");
|
|
1358
|
+
this.control = control;
|
|
1359
|
+
const formDefinition = this.extractFormDefinition(control);
|
|
1360
|
+
const hideFunction = this.extractHideFunction(formDefinition);
|
|
1361
|
+
const showFunction = this.extractShowFunction(formDefinition);
|
|
1362
|
+
const options = this.extractOptions(formDefinition);
|
|
1363
|
+
let changeTrigger = formDefinition.rxapFormGroup.valueChanges;
|
|
1364
|
+
if (options.rootChange) changeTrigger = formDefinition.rxapFormGroup.root.valueChanges;
|
|
1365
|
+
changeTrigger = changeTrigger.pipe(startWith(null));
|
|
1366
|
+
if (showFunction) this.subscription.add(changeTrigger.pipe(tap(() => {
|
|
1367
|
+
switch (showFunction.call(formDefinition, control)) {
|
|
1368
|
+
case true:
|
|
1369
|
+
this.show();
|
|
1370
|
+
break;
|
|
1371
|
+
case false:
|
|
1372
|
+
this.hide();
|
|
1373
|
+
break;
|
|
1374
|
+
case null: this.reset();
|
|
1375
|
+
}
|
|
1376
|
+
}), catchError((err) => {
|
|
1377
|
+
console.error(err);
|
|
1378
|
+
return of(null);
|
|
1379
|
+
})).subscribe());
|
|
1380
|
+
if (hideFunction) this.subscription.add(changeTrigger.pipe(tap(() => {
|
|
1381
|
+
switch (hideFunction.call(formDefinition, control)) {
|
|
1382
|
+
case true:
|
|
1383
|
+
this.hide();
|
|
1384
|
+
break;
|
|
1385
|
+
case false:
|
|
1386
|
+
this.show();
|
|
1387
|
+
break;
|
|
1388
|
+
case null: this.reset();
|
|
1389
|
+
}
|
|
1390
|
+
}), catchError((err) => {
|
|
1391
|
+
console.error(err);
|
|
1392
|
+
return of(null);
|
|
1393
|
+
})).subscribe());
|
|
1394
|
+
}
|
|
1395
|
+
ngOnDestroy() {
|
|
1396
|
+
this.subscription.unsubscribe();
|
|
1397
|
+
}
|
|
1398
|
+
extractOptions(formDefinition) {
|
|
1399
|
+
const map = getMetadata("rxap/form-system/hide-show-options", Object.getPrototypeOf(formDefinition)) ?? null;
|
|
1400
|
+
if (!map || !map.has(this.control.controlId)) return {};
|
|
1401
|
+
return map.get(this.control.controlId);
|
|
1402
|
+
}
|
|
1403
|
+
extractHideFunction(formDefinition) {
|
|
1404
|
+
const map = getMetadata("rxap/form-system/hide-function", Object.getPrototypeOf(formDefinition)) ?? null;
|
|
1405
|
+
if (!map || !map.has(this.control.controlId)) return null;
|
|
1406
|
+
return map.get(this.control.controlId);
|
|
1407
|
+
}
|
|
1408
|
+
extractShowFunction(formDefinition) {
|
|
1409
|
+
const map = getMetadata("rxap/form-system/show-function", Object.getPrototypeOf(formDefinition)) ?? null;
|
|
1410
|
+
if (!map || !map.has(this.control.controlId)) return null;
|
|
1411
|
+
return map.get(this.control.controlId);
|
|
1412
|
+
}
|
|
1413
|
+
hide() {
|
|
1414
|
+
this.renderer.setStyle(this.elementRef.nativeElement, "display", "none");
|
|
1415
|
+
}
|
|
1416
|
+
show() {
|
|
1417
|
+
this.renderer.setStyle(this.elementRef.nativeElement, "display", "block");
|
|
1418
|
+
}
|
|
1419
|
+
reset() {
|
|
1420
|
+
this.renderer.removeStyle(this.elementRef.nativeElement, "display");
|
|
1421
|
+
}
|
|
1422
|
+
static {
|
|
1423
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1424
|
+
minVersion: "12.0.0",
|
|
1425
|
+
version: "22.3.0",
|
|
1426
|
+
ngImport: i0,
|
|
1427
|
+
type: ControlHideShowDirective,
|
|
1428
|
+
deps: [],
|
|
1429
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
static {
|
|
1433
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1434
|
+
minVersion: "17.1.0",
|
|
1435
|
+
version: "22.3.0",
|
|
1436
|
+
type: ControlHideShowDirective,
|
|
1437
|
+
isStandalone: true,
|
|
1438
|
+
selector: "[rxapControlHideShow]",
|
|
1439
|
+
inputs: { controlId: {
|
|
1440
|
+
classPropertyName: "controlId",
|
|
1441
|
+
publicName: "rxapControlHideShow",
|
|
1442
|
+
isSignal: true,
|
|
1443
|
+
isRequired: false,
|
|
1444
|
+
transformFunction: null
|
|
1445
|
+
} },
|
|
1446
|
+
ngImport: i0
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1184
1449
|
};
|
|
1185
|
-
ControlHideShowDirective = __decorate([
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1450
|
+
ControlHideShowDirective = __decorate([Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin)], ControlHideShowDirective);
|
|
1451
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1452
|
+
minVersion: "12.0.0",
|
|
1453
|
+
version: "22.3.0",
|
|
1454
|
+
ngImport: i0,
|
|
1455
|
+
type: ControlHideShowDirective,
|
|
1456
|
+
decorators: [{
|
|
1457
|
+
type: Directive,
|
|
1458
|
+
args: [{
|
|
1459
|
+
selector: "[rxapControlHideShow]",
|
|
1460
|
+
standalone: true
|
|
1461
|
+
}]
|
|
1462
|
+
}],
|
|
1463
|
+
propDecorators: { controlId: [{
|
|
1464
|
+
type: i0.Input,
|
|
1465
|
+
args: [{
|
|
1466
|
+
isSignal: true,
|
|
1467
|
+
alias: "rxapControlHideShow",
|
|
1468
|
+
required: false
|
|
1469
|
+
}]
|
|
1470
|
+
}] }
|
|
1471
|
+
});
|
|
1196
1472
|
let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1473
|
+
constructor() {
|
|
1474
|
+
this.template = inject(TemplateRef);
|
|
1475
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1476
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1477
|
+
this.injector = inject(INJECTOR);
|
|
1478
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1479
|
+
this.ngControl = inject(NgControl, { optional: true }) ?? null;
|
|
1480
|
+
this.matFormField = inject(MAT_FORM_FIELD, { optional: true }) ?? null;
|
|
1481
|
+
this.viewer = input({ id: "[rxapInputSelectOptions]" }, {
|
|
1482
|
+
...ngDevMode ? { debugName: "viewer" } : /* istanbul ignore next */ {},
|
|
1483
|
+
alias: "rxapInputSelectOptionsViewer"
|
|
1484
|
+
});
|
|
1485
|
+
this.metadata = input(void 0, {
|
|
1486
|
+
...ngDevMode ? { debugName: "metadata" } : /* istanbul ignore next */ {},
|
|
1487
|
+
alias: "rxapInputSelectOptionsMetadata"
|
|
1488
|
+
});
|
|
1489
|
+
this.matAutocomplete = input(void 0, {
|
|
1490
|
+
...ngDevMode ? { debugName: "matAutocomplete" } : /* istanbul ignore next */ {},
|
|
1491
|
+
alias: "rxapInputSelectOptionsMatAutocomplete"
|
|
1492
|
+
});
|
|
1493
|
+
this.currentViewer = linkedSignal(() => this.viewer(), ...ngDevMode ? [{ debugName: "currentViewer" }] : /* istanbul ignore next */ []);
|
|
1494
|
+
this.subscription = new Subscription();
|
|
1495
|
+
this.options = null;
|
|
1496
|
+
this.isAutocompleteToDisplayTriggered = false;
|
|
1497
|
+
}
|
|
1498
|
+
ngAfterViewInit() {
|
|
1499
|
+
this.extractOptionsDatasource(void 0, this.metadata());
|
|
1500
|
+
this.currentViewer.set({
|
|
1501
|
+
id: "[rxapInputSelectOptions]" + this.control.controlId,
|
|
1502
|
+
viewChange: this.settings?.loadOnce ? EMPTY : this.control.value$.pipe(throttleTime(1e3), distinctUntilChanged((a, b) => equals(a, b)), map((value) => {
|
|
1503
|
+
if (this.settings?.ignoreSelectedValue) return {};
|
|
1504
|
+
return value;
|
|
1505
|
+
})),
|
|
1506
|
+
control: this.control
|
|
1507
|
+
});
|
|
1508
|
+
const matAutocomplete = this.matAutocomplete();
|
|
1509
|
+
if (matAutocomplete) {
|
|
1510
|
+
matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
1511
|
+
this.settings ??= {};
|
|
1512
|
+
this.settings.filteredOptions ??= true;
|
|
1513
|
+
}
|
|
1514
|
+
this.loadOptions();
|
|
1515
|
+
}
|
|
1516
|
+
toDisplay(value) {
|
|
1517
|
+
if (!value) return "";
|
|
1518
|
+
return this.options?.find((option) => option.value === value)?.display ?? (isDevMode() ? "to display error" : "");
|
|
1519
|
+
}
|
|
1520
|
+
ngOnDestroy() {
|
|
1521
|
+
this.subscription?.unsubscribe();
|
|
1522
|
+
}
|
|
1523
|
+
loadOptions(dataSource = this.dataSource) {
|
|
1524
|
+
this.subscription.add(dataSource.connect(this.currentViewer()).pipe(switchMap((options) => {
|
|
1525
|
+
if (this.settings?.filteredOptions) return this.control.value$.pipe(map((controlValue) => {
|
|
1526
|
+
if (typeof controlValue === "string" && controlValue) {
|
|
1527
|
+
controlValue = controlValue.toLowerCase();
|
|
1528
|
+
if (Array.isArray(options)) return options.filter((option) => option.display.toLowerCase().includes(controlValue));
|
|
1529
|
+
else return Object.entries(options).filter(([value, display]) => typeof display === "string" && display.toLowerCase().includes(controlValue)).map(([value, display]) => ({
|
|
1530
|
+
value,
|
|
1531
|
+
display
|
|
1532
|
+
}));
|
|
1533
|
+
}
|
|
1534
|
+
return options;
|
|
1535
|
+
}));
|
|
1536
|
+
return of(options);
|
|
1537
|
+
}), tap((options) => this.renderTemplate(this.options = options)), tap(() => {
|
|
1538
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
1539
|
+
this.isAutocompleteToDisplayTriggered = true;
|
|
1540
|
+
this.ngControl?.control?.setValue(this.ngControl?.control?.value);
|
|
1541
|
+
}
|
|
1542
|
+
})).subscribe());
|
|
1543
|
+
}
|
|
1544
|
+
renderTemplate(options = this.options) {
|
|
1545
|
+
this.viewContainerRef.clear();
|
|
1546
|
+
if (options) {
|
|
1547
|
+
if (!Array.isArray(options)) for (const [value, display] of Object.entries(options)) this.viewContainerRef.createEmbeddedView(this.template, { $implicit: {
|
|
1548
|
+
value,
|
|
1549
|
+
display
|
|
1550
|
+
} });
|
|
1551
|
+
else for (const option of options) this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
|
|
1552
|
+
} else if (isDevMode()) console.warn(`The options for the control ${this.control.fullControlPath} is empty/null/undefined!`);
|
|
1553
|
+
this.cdr.detectChanges();
|
|
1554
|
+
}
|
|
1555
|
+
static {
|
|
1556
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1557
|
+
minVersion: "12.0.0",
|
|
1558
|
+
version: "22.3.0",
|
|
1559
|
+
ngImport: i0,
|
|
1560
|
+
type: InputSelectOptionsDirective,
|
|
1561
|
+
deps: [],
|
|
1562
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
static {
|
|
1566
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1567
|
+
minVersion: "17.1.0",
|
|
1568
|
+
version: "22.3.0",
|
|
1569
|
+
type: InputSelectOptionsDirective,
|
|
1570
|
+
isStandalone: true,
|
|
1571
|
+
selector: "[rxapInputSelectOptions]",
|
|
1572
|
+
inputs: {
|
|
1573
|
+
viewer: {
|
|
1574
|
+
classPropertyName: "viewer",
|
|
1575
|
+
publicName: "rxapInputSelectOptionsViewer",
|
|
1576
|
+
isSignal: true,
|
|
1577
|
+
isRequired: false,
|
|
1578
|
+
transformFunction: null
|
|
1579
|
+
},
|
|
1580
|
+
metadata: {
|
|
1581
|
+
classPropertyName: "metadata",
|
|
1582
|
+
publicName: "rxapInputSelectOptionsMetadata",
|
|
1583
|
+
isSignal: true,
|
|
1584
|
+
isRequired: false,
|
|
1585
|
+
transformFunction: null
|
|
1586
|
+
},
|
|
1587
|
+
matAutocomplete: {
|
|
1588
|
+
classPropertyName: "matAutocomplete",
|
|
1589
|
+
publicName: "rxapInputSelectOptionsMatAutocomplete",
|
|
1590
|
+
isSignal: true,
|
|
1591
|
+
isRequired: false,
|
|
1592
|
+
transformFunction: null
|
|
1593
|
+
}
|
|
1594
|
+
},
|
|
1595
|
+
ngImport: i0
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1315
1598
|
};
|
|
1316
|
-
InputSelectOptionsDirective = __decorate([
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1599
|
+
InputSelectOptionsDirective = __decorate([Mixin(ExtractOptionsDataSourceMixin)], InputSelectOptionsDirective);
|
|
1600
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1601
|
+
minVersion: "12.0.0",
|
|
1602
|
+
version: "22.3.0",
|
|
1603
|
+
ngImport: i0,
|
|
1604
|
+
type: InputSelectOptionsDirective,
|
|
1605
|
+
decorators: [{
|
|
1606
|
+
type: Directive,
|
|
1607
|
+
args: [{
|
|
1608
|
+
selector: "[rxapInputSelectOptions]",
|
|
1609
|
+
standalone: true
|
|
1610
|
+
}]
|
|
1611
|
+
}],
|
|
1612
|
+
propDecorators: {
|
|
1613
|
+
viewer: [{
|
|
1614
|
+
type: i0.Input,
|
|
1615
|
+
args: [{
|
|
1616
|
+
isSignal: true,
|
|
1617
|
+
alias: "rxapInputSelectOptionsViewer",
|
|
1618
|
+
required: false
|
|
1619
|
+
}]
|
|
1620
|
+
}],
|
|
1621
|
+
metadata: [{
|
|
1622
|
+
type: i0.Input,
|
|
1623
|
+
args: [{
|
|
1624
|
+
isSignal: true,
|
|
1625
|
+
alias: "rxapInputSelectOptionsMetadata",
|
|
1626
|
+
required: false
|
|
1627
|
+
}]
|
|
1628
|
+
}],
|
|
1629
|
+
matAutocomplete: [{
|
|
1630
|
+
type: i0.Input,
|
|
1631
|
+
args: [{
|
|
1632
|
+
isSignal: true,
|
|
1633
|
+
alias: "rxapInputSelectOptionsMatAutocomplete",
|
|
1634
|
+
required: false
|
|
1635
|
+
}]
|
|
1636
|
+
}]
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
const REMOTE_METHOD_NAME = "options";
|
|
1640
|
+
const RXAP_USE_REMOTE_METHOD = "rxap/form-system/remote-method/use";
|
|
1329
1641
|
function UseRemoteMethod(remoteMethod, name) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1642
|
+
return function(target, propertyKey) {
|
|
1643
|
+
setMetadataMapMap(propertyKey, name, remoteMethod, RXAP_USE_REMOTE_METHOD, target);
|
|
1644
|
+
};
|
|
1333
1645
|
}
|
|
1334
1646
|
function UseOptionsRemoteMethod(dataSource) {
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
class ExtractRemoteMethodsMixin {
|
|
1340
|
-
extractRemoteMethods(formDefinition, controlId) {
|
|
1341
|
-
const map = getMetadata(RXAP_USE_REMOTE_METHOD, Object.getPrototypeOf(formDefinition));
|
|
1342
|
-
if (!map) {
|
|
1343
|
-
throw new RxapFormSystemError('Could not extract the use remote method map from the form definition instance', '');
|
|
1344
|
-
}
|
|
1345
|
-
if (!map.has(controlId)) {
|
|
1346
|
-
throw new RxapFormSystemError('A use remote method definition does not exists in the form definition metadata', '');
|
|
1347
|
-
}
|
|
1348
|
-
return map.get(controlId);
|
|
1349
|
-
}
|
|
1647
|
+
return function(target, propertyKey) {
|
|
1648
|
+
UseRemoteMethod(dataSource, REMOTE_METHOD_NAME)(target, propertyKey);
|
|
1649
|
+
};
|
|
1350
1650
|
}
|
|
1651
|
+
var ExtractRemoteMethodsMixin = class {
|
|
1652
|
+
extractRemoteMethods(formDefinition, controlId) {
|
|
1653
|
+
const map = getMetadata(RXAP_USE_REMOTE_METHOD, Object.getPrototypeOf(formDefinition));
|
|
1654
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use remote method map from the form definition instance", "");
|
|
1655
|
+
if (!map.has(controlId)) throw new RxapFormSystemError("A use remote method definition does not exists in the form definition metadata", "");
|
|
1656
|
+
return map.get(controlId);
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1351
1659
|
let OptionsFromRemoteMethodDirective = class OptionsFromRemoteMethodDirective {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1660
|
+
constructor() {
|
|
1661
|
+
this.ngControl = inject(NgControl);
|
|
1662
|
+
this.template = inject(TemplateRef);
|
|
1663
|
+
this.remoteMethodLoader = inject(RemoteMethodLoader);
|
|
1664
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1665
|
+
this.injector = inject(INJECTOR);
|
|
1666
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1667
|
+
this.parameters = input(void 0, {
|
|
1668
|
+
...ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {},
|
|
1669
|
+
alias: "rxapOptionsFromRemoteMethodParameters"
|
|
1670
|
+
});
|
|
1671
|
+
this.resetOnChange = input(void 0, {
|
|
1672
|
+
...ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {},
|
|
1673
|
+
alias: "rxapOptionsFromRemoteMethodResetOnChange"
|
|
1674
|
+
});
|
|
1675
|
+
this.withoutParameters = input(false, {
|
|
1676
|
+
...ngDevMode ? { debugName: "withoutParameters" } : /* istanbul ignore next */ {},
|
|
1677
|
+
alias: "rxapOptionsFromRemoteMethodWithoutParameters"
|
|
1678
|
+
});
|
|
1679
|
+
effect(() => {
|
|
1680
|
+
const parameters = this.parameters();
|
|
1681
|
+
if (parameters === void 0) return;
|
|
1682
|
+
untracked(() => {
|
|
1683
|
+
this.remoteMethodToken ??= this.extractRemoteMethodToken();
|
|
1684
|
+
return this.renderTemplate(parameters);
|
|
1685
|
+
});
|
|
1686
|
+
});
|
|
1687
|
+
effect(() => {
|
|
1688
|
+
if (!this.withoutParameters()) return;
|
|
1689
|
+
untracked(() => {
|
|
1690
|
+
this.remoteMethodToken ??= this.extractRemoteMethodToken();
|
|
1691
|
+
return this.renderTemplate();
|
|
1692
|
+
});
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
extractRemoteMethodToken() {
|
|
1696
|
+
const control = this.ngControl.control;
|
|
1697
|
+
if (!(control instanceof RxapFormControl)) throw new Error("Control is not a RxapFormControl!");
|
|
1698
|
+
const formDefinition = this.extractFormDefinition(control);
|
|
1699
|
+
const remoteMethodsTokens = this.extractRemoteMethods(formDefinition, control.controlId);
|
|
1700
|
+
if (!remoteMethodsTokens.has("options")) throw new Error(`The remote method with the name 'options' is not defined`);
|
|
1701
|
+
return remoteMethodsTokens.get(REMOTE_METHOD_NAME);
|
|
1702
|
+
}
|
|
1703
|
+
async renderTemplate(parameters) {
|
|
1704
|
+
const options = await this.remoteMethodLoader.call$(this.remoteMethodToken, parameters, void 0, this.injector);
|
|
1705
|
+
this.viewContainerRef.clear();
|
|
1706
|
+
for (const option of options) this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
|
|
1707
|
+
const resetOnChange = untracked(this.resetOnChange);
|
|
1708
|
+
if (resetOnChange !== void 0) this.ngControl.reset(resetOnChange);
|
|
1709
|
+
this.cdr.detectChanges();
|
|
1710
|
+
}
|
|
1711
|
+
static {
|
|
1712
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1713
|
+
minVersion: "12.0.0",
|
|
1714
|
+
version: "22.3.0",
|
|
1715
|
+
ngImport: i0,
|
|
1716
|
+
type: OptionsFromRemoteMethodDirective,
|
|
1717
|
+
deps: [],
|
|
1718
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
static {
|
|
1722
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1723
|
+
minVersion: "17.1.0",
|
|
1724
|
+
version: "22.3.0",
|
|
1725
|
+
type: OptionsFromRemoteMethodDirective,
|
|
1726
|
+
isStandalone: true,
|
|
1727
|
+
selector: "[rxapOptionsFromRemoteMethod]",
|
|
1728
|
+
inputs: {
|
|
1729
|
+
parameters: {
|
|
1730
|
+
classPropertyName: "parameters",
|
|
1731
|
+
publicName: "rxapOptionsFromRemoteMethodParameters",
|
|
1732
|
+
isSignal: true,
|
|
1733
|
+
isRequired: false,
|
|
1734
|
+
transformFunction: null
|
|
1735
|
+
},
|
|
1736
|
+
resetOnChange: {
|
|
1737
|
+
classPropertyName: "resetOnChange",
|
|
1738
|
+
publicName: "rxapOptionsFromRemoteMethodResetOnChange",
|
|
1739
|
+
isSignal: true,
|
|
1740
|
+
isRequired: false,
|
|
1741
|
+
transformFunction: null
|
|
1742
|
+
},
|
|
1743
|
+
withoutParameters: {
|
|
1744
|
+
classPropertyName: "withoutParameters",
|
|
1745
|
+
publicName: "rxapOptionsFromRemoteMethodWithoutParameters",
|
|
1746
|
+
isSignal: true,
|
|
1747
|
+
isRequired: false,
|
|
1748
|
+
transformFunction: null
|
|
1749
|
+
}
|
|
1750
|
+
},
|
|
1751
|
+
ngImport: i0
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
OptionsFromRemoteMethodDirective = __decorate([Mixin(ExtractFormDefinitionMixin, ExtractRemoteMethodsMixin), __metadata("design:paramtypes", [])], OptionsFromRemoteMethodDirective);
|
|
1756
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1757
|
+
minVersion: "12.0.0",
|
|
1758
|
+
version: "22.3.0",
|
|
1759
|
+
ngImport: i0,
|
|
1760
|
+
type: OptionsFromRemoteMethodDirective,
|
|
1761
|
+
decorators: [{
|
|
1762
|
+
type: Directive,
|
|
1763
|
+
args: [{
|
|
1764
|
+
selector: "[rxapOptionsFromRemoteMethod]",
|
|
1765
|
+
standalone: true
|
|
1766
|
+
}]
|
|
1767
|
+
}],
|
|
1768
|
+
ctorParameters: () => [],
|
|
1769
|
+
propDecorators: {
|
|
1770
|
+
parameters: [{
|
|
1771
|
+
type: i0.Input,
|
|
1772
|
+
args: [{
|
|
1773
|
+
isSignal: true,
|
|
1774
|
+
alias: "rxapOptionsFromRemoteMethodParameters",
|
|
1775
|
+
required: false
|
|
1776
|
+
}]
|
|
1777
|
+
}],
|
|
1778
|
+
resetOnChange: [{
|
|
1779
|
+
type: i0.Input,
|
|
1780
|
+
args: [{
|
|
1781
|
+
isSignal: true,
|
|
1782
|
+
alias: "rxapOptionsFromRemoteMethodResetOnChange",
|
|
1783
|
+
required: false
|
|
1784
|
+
}]
|
|
1785
|
+
}],
|
|
1786
|
+
withoutParameters: [{
|
|
1787
|
+
type: i0.Input,
|
|
1788
|
+
args: [{
|
|
1789
|
+
isSignal: true,
|
|
1790
|
+
alias: "rxapOptionsFromRemoteMethodWithoutParameters",
|
|
1791
|
+
required: false
|
|
1792
|
+
}]
|
|
1793
|
+
}]
|
|
1794
|
+
}
|
|
1795
|
+
});
|
|
1796
|
+
var TestNgControl = class extends NgControl {
|
|
1797
|
+
constructor(_control) {
|
|
1798
|
+
super();
|
|
1799
|
+
this._control = _control;
|
|
1800
|
+
}
|
|
1801
|
+
get control() {
|
|
1802
|
+
return this._control;
|
|
1803
|
+
}
|
|
1804
|
+
viewToModelUpdate(newValue) {
|
|
1805
|
+
throw new Error("Method not implemented.");
|
|
1806
|
+
}
|
|
1409
1807
|
};
|
|
1410
|
-
OptionsFromRemoteMethodDirective = __decorate([
|
|
1411
|
-
Mixin(ExtractFormDefinitionMixin, ExtractRemoteMethodsMixin),
|
|
1412
|
-
__metadata("design:paramtypes", [])
|
|
1413
|
-
], OptionsFromRemoteMethodDirective);
|
|
1414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromRemoteMethodDirective, decorators: [{
|
|
1415
|
-
type: Directive,
|
|
1416
|
-
args: [{
|
|
1417
|
-
selector: '[rxapOptionsFromRemoteMethod]',
|
|
1418
|
-
standalone: true,
|
|
1419
|
-
}]
|
|
1420
|
-
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromRemoteMethodParameters", required: false }] }], resetOnChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromRemoteMethodResetOnChange", required: false }] }], withoutParameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromRemoteMethodWithoutParameters", required: false }] }] } });
|
|
1421
|
-
|
|
1422
|
-
class TestNgControl extends NgControl {
|
|
1423
|
-
constructor(_control) {
|
|
1424
|
-
super();
|
|
1425
|
-
this._control = _control;
|
|
1426
|
-
}
|
|
1427
|
-
get control() {
|
|
1428
|
-
return this._control;
|
|
1429
|
-
}
|
|
1430
|
-
viewToModelUpdate(newValue) {
|
|
1431
|
-
throw new Error('Method not implemented.');
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
1808
|
function UseComponent(component, setProperties = {}) {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1809
|
+
return function(target, propertyKey) {
|
|
1810
|
+
setMetadataMap(propertyKey, component, FormSystemMetadataKeys.COMPONENTS, target);
|
|
1811
|
+
setMetadataMap(propertyKey, setProperties, FormSystemMetadataKeys.COMPONENTS_PROPERTIES, target);
|
|
1812
|
+
};
|
|
1440
1813
|
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Links a component with a form definition
|
|
1444
|
-
*
|
|
1445
|
-
* @param component
|
|
1446
|
-
*/
|
|
1447
1814
|
function UseFormComponent(component) {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
const RXAP_FORM_CONTROL_SOURCE = new InjectionToken('rxap/forms/data-source');
|
|
1454
|
-
class ControlDataSource extends BaseDataSource {
|
|
1455
|
-
constructor(control, metadata = null) {
|
|
1456
|
-
super(metadata);
|
|
1457
|
-
this.control = control;
|
|
1458
|
-
}
|
|
1459
|
-
init() {
|
|
1460
|
-
if (this._initialised) {
|
|
1461
|
-
return;
|
|
1462
|
-
}
|
|
1463
|
-
super.init();
|
|
1464
|
-
if (isDevMode()) {
|
|
1465
|
-
console.log(this.control);
|
|
1466
|
-
}
|
|
1467
|
-
this._data$ = this.control.valueChanges.pipe(startWith$1(this.control.value), distinctUntilChanged$1((a, b) => equals(a, b)), shareReplay(1));
|
|
1468
|
-
}
|
|
1469
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlDataSource, deps: [{ token: RXAP_FORM_CONTROL_SOURCE }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1470
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlDataSource }); }
|
|
1815
|
+
return function(target) {
|
|
1816
|
+
setMetadata(FormSystemMetadataKeys.FORM_COMPONENT, component, target);
|
|
1817
|
+
};
|
|
1471
1818
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1819
|
+
const RXAP_FORM_CONTROL_SOURCE = new InjectionToken("rxap/forms/data-source");
|
|
1820
|
+
var ControlDataSource = class ControlDataSource extends BaseDataSource {
|
|
1821
|
+
constructor(control, metadata = null) {
|
|
1822
|
+
super(metadata);
|
|
1823
|
+
this.control = control;
|
|
1824
|
+
}
|
|
1825
|
+
init() {
|
|
1826
|
+
if (this._initialised) return;
|
|
1827
|
+
super.init();
|
|
1828
|
+
if (isDevMode()) console.log(this.control);
|
|
1829
|
+
this._data$ = this.control.valueChanges.pipe(startWith(this.control.value), distinctUntilChanged((a, b) => equals(a, b)), shareReplay(1));
|
|
1830
|
+
}
|
|
1831
|
+
static {
|
|
1832
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1833
|
+
minVersion: "12.0.0",
|
|
1834
|
+
version: "22.3.0",
|
|
1835
|
+
ngImport: i0,
|
|
1836
|
+
type: ControlDataSource,
|
|
1837
|
+
deps: [{ token: RXAP_FORM_CONTROL_SOURCE }, {
|
|
1838
|
+
token: RXAP_DATA_SOURCE_METADATA,
|
|
1839
|
+
optional: true
|
|
1840
|
+
}],
|
|
1841
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
static {
|
|
1845
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1846
|
+
minVersion: "12.0.0",
|
|
1847
|
+
version: "22.3.0",
|
|
1848
|
+
ngImport: i0,
|
|
1849
|
+
type: ControlDataSource
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1854
|
+
minVersion: "12.0.0",
|
|
1855
|
+
version: "22.3.0",
|
|
1856
|
+
ngImport: i0,
|
|
1857
|
+
type: ControlDataSource,
|
|
1858
|
+
decorators: [{ type: Injectable }],
|
|
1859
|
+
ctorParameters: () => [{
|
|
1860
|
+
type: void 0,
|
|
1861
|
+
decorators: [{
|
|
1862
|
+
type: Inject,
|
|
1863
|
+
args: [RXAP_FORM_CONTROL_SOURCE]
|
|
1864
|
+
}]
|
|
1865
|
+
}, {
|
|
1866
|
+
type: void 0,
|
|
1867
|
+
decorators: [{ type: Optional }, {
|
|
1868
|
+
type: Inject,
|
|
1869
|
+
args: [RXAP_DATA_SOURCE_METADATA]
|
|
1870
|
+
}]
|
|
1871
|
+
}]
|
|
1872
|
+
});
|
|
1483
1873
|
function controlDataSource(control) {
|
|
1484
|
-
|
|
1485
|
-
return new ControlDataSource(control, { id: control.controlId });
|
|
1874
|
+
return new ControlDataSource(control, { id: control.controlId });
|
|
1486
1875
|
}
|
|
1487
|
-
|
|
1488
1876
|
function FormContextFromActivatedRouteFactory(route) {
|
|
1489
|
-
|
|
1877
|
+
return route.snapshot.params;
|
|
1490
1878
|
}
|
|
1491
|
-
|
|
1492
1879
|
let FormSystemControlDirective = class FormSystemControlDirective {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1596
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: FormSystemControlDirective, isStandalone: true, selector: "[rxapFormSystemControl]", inputs: { controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
1880
|
+
constructor() {
|
|
1881
|
+
this.parent = inject(ControlContainer);
|
|
1882
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
1883
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1884
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1885
|
+
this.injector = inject(INJECTOR);
|
|
1886
|
+
this.controlId = input.required(...ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []);
|
|
1887
|
+
}
|
|
1888
|
+
ngOnInit() {
|
|
1889
|
+
this.control = this.extractControl();
|
|
1890
|
+
const formDefinition = this.extractFormDefinition();
|
|
1891
|
+
this.componentRef = this.createComponent(formDefinition);
|
|
1892
|
+
this.setDataSources(formDefinition, this.componentRef.instance);
|
|
1893
|
+
this.setComponentProperties(formDefinition, this.componentRef.instance);
|
|
1894
|
+
this.viewContainerRef.insert(this.componentRef.hostView);
|
|
1895
|
+
}
|
|
1896
|
+
registerOnChange(fn) {
|
|
1897
|
+
this.componentRef.instance.registerOnChange(fn);
|
|
1898
|
+
}
|
|
1899
|
+
registerOnTouched(fn) {
|
|
1900
|
+
this.componentRef.instance.registerOnTouched(fn);
|
|
1901
|
+
}
|
|
1902
|
+
writeValue(value) {
|
|
1903
|
+
this.componentRef.instance.writeValue(value);
|
|
1904
|
+
}
|
|
1905
|
+
setDisabledState(isDisabled) {
|
|
1906
|
+
if (this.componentRef.instance.setDisabledState) this.componentRef.instance.setDisabledState(isDisabled);
|
|
1907
|
+
}
|
|
1908
|
+
setDataSources(formDefinition, component) {
|
|
1909
|
+
if (!component.setDataSource) throw new RxapFormSystemError("The ControlWithDataSource interface is not implemented for the control component, but the control has defined data sources", "");
|
|
1910
|
+
const useDataSourceValueMap = this.extractDataSources(formDefinition, this.controlId());
|
|
1911
|
+
for (const [name, useDataSourceValue] of useDataSourceValueMap.entries()) {
|
|
1912
|
+
let dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource);
|
|
1913
|
+
const settings = useDataSourceValue.settings;
|
|
1914
|
+
if (settings?.transformer) dataSource = new PipeDataSource(dataSource, map(settings.transformer));
|
|
1915
|
+
component.setDataSource(name, dataSource, useDataSourceValue.settings);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
setComponentProperties(formDefinition, component) {
|
|
1919
|
+
const componentProperties = this.extractComponentProperties(formDefinition);
|
|
1920
|
+
for (const [key, value] of Object.entries(componentProperties)) Reflect.set(component, key, value);
|
|
1921
|
+
}
|
|
1922
|
+
createComponent(formDefinition) {
|
|
1923
|
+
const component = this.extractComponent(formDefinition);
|
|
1924
|
+
return createComponent(component, {
|
|
1925
|
+
environmentInjector: this.environmentInjector,
|
|
1926
|
+
elementInjector: this.injector
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
extractControl() {
|
|
1930
|
+
if (!this.parent.control) throw new RxapFormSystemError("The control property of ControlContainer is not defined", "");
|
|
1931
|
+
const control = this.parent.control.get(this.controlId());
|
|
1932
|
+
if (!control) throw new RxapFormSystemError("Could not find the control instance", "");
|
|
1933
|
+
if (!(control instanceof RxapFormControl)) throw new RxapFormSystemError("The extracted control is not a RxapFormControl", "");
|
|
1934
|
+
return control;
|
|
1935
|
+
}
|
|
1936
|
+
extractFormDefinition() {
|
|
1937
|
+
const formDefinition = this.control.rxapFormDefinition;
|
|
1938
|
+
if (!formDefinition) throw new RxapFormSystemError("Could not find the form definition instance", "");
|
|
1939
|
+
return formDefinition;
|
|
1940
|
+
}
|
|
1941
|
+
extractComponent(formDefinition) {
|
|
1942
|
+
const map = getMetadata(FormSystemMetadataKeys.COMPONENTS, Object.getPrototypeOf(formDefinition));
|
|
1943
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use component map from the form definition instance", "");
|
|
1944
|
+
const controlId = this.controlId();
|
|
1945
|
+
if (!map.has(controlId)) throw new RxapFormSystemError("A use component definition does not exists in the form definition metadata", "");
|
|
1946
|
+
return map.get(controlId);
|
|
1947
|
+
}
|
|
1948
|
+
extractComponentProperties(formDefinition) {
|
|
1949
|
+
const map = getMetadata(FormSystemMetadataKeys.COMPONENTS_PROPERTIES, Object.getPrototypeOf(formDefinition));
|
|
1950
|
+
if (!map) throw new RxapFormSystemError("Could not extract the use component properties map from the form definition instance", "");
|
|
1951
|
+
const controlId = this.controlId();
|
|
1952
|
+
if (!map.has(controlId)) throw new RxapFormSystemError("A use component definition does not exists in the form definition metadata", "");
|
|
1953
|
+
return map.get(controlId);
|
|
1954
|
+
}
|
|
1955
|
+
static {
|
|
1956
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1957
|
+
minVersion: "12.0.0",
|
|
1958
|
+
version: "22.3.0",
|
|
1959
|
+
ngImport: i0,
|
|
1960
|
+
type: FormSystemControlDirective,
|
|
1961
|
+
deps: [],
|
|
1962
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
static {
|
|
1966
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1967
|
+
minVersion: "17.1.0",
|
|
1968
|
+
version: "22.3.0",
|
|
1969
|
+
type: FormSystemControlDirective,
|
|
1970
|
+
isStandalone: true,
|
|
1971
|
+
selector: "[rxapFormSystemControl]",
|
|
1972
|
+
inputs: { controlId: {
|
|
1973
|
+
classPropertyName: "controlId",
|
|
1974
|
+
publicName: "controlId",
|
|
1975
|
+
isSignal: true,
|
|
1976
|
+
isRequired: true,
|
|
1977
|
+
transformFunction: null
|
|
1978
|
+
} },
|
|
1979
|
+
ngImport: i0
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1597
1982
|
};
|
|
1598
|
-
FormSystemControlDirective = __decorate([
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1983
|
+
FormSystemControlDirective = __decorate([Mixin(ExtractDataSourcesMixin)], FormSystemControlDirective);
|
|
1984
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1985
|
+
minVersion: "12.0.0",
|
|
1986
|
+
version: "22.3.0",
|
|
1987
|
+
ngImport: i0,
|
|
1988
|
+
type: FormSystemControlDirective,
|
|
1989
|
+
decorators: [{
|
|
1990
|
+
type: Directive,
|
|
1991
|
+
args: [{
|
|
1992
|
+
selector: "[rxapFormSystemControl]",
|
|
1993
|
+
standalone: true
|
|
1994
|
+
}]
|
|
1995
|
+
}],
|
|
1996
|
+
propDecorators: { controlId: [{
|
|
1997
|
+
type: i0.Input,
|
|
1998
|
+
args: [{
|
|
1999
|
+
isSignal: true,
|
|
2000
|
+
alias: "controlId",
|
|
2001
|
+
required: true
|
|
2002
|
+
}]
|
|
2003
|
+
}] }
|
|
2004
|
+
});
|
|
2005
|
+
const SUBMIT_CONTEXT_FORM_ADAPTER_METHOD = new InjectionToken("submit-context-form-adapter-method");
|
|
2006
|
+
var SubmitContextFormAdapter = class SubmitContextFormAdapter extends ProxyRemoteMethod {
|
|
2007
|
+
constructor(remoteMethod, context) {
|
|
2008
|
+
super(remoteMethod);
|
|
2009
|
+
this.context = context;
|
|
2010
|
+
}
|
|
2011
|
+
transformParameters(value) {
|
|
2012
|
+
return {
|
|
2013
|
+
parameters: this.context ?? {},
|
|
2014
|
+
requestBody: value
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
static {
|
|
2018
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2019
|
+
minVersion: "12.0.0",
|
|
2020
|
+
version: "22.3.0",
|
|
2021
|
+
ngImport: i0,
|
|
2022
|
+
type: SubmitContextFormAdapter,
|
|
2023
|
+
deps: [{ token: SUBMIT_CONTEXT_FORM_ADAPTER_METHOD }, { token: RXAP_FORM_CONTEXT }],
|
|
2024
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
static {
|
|
2028
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2029
|
+
minVersion: "12.0.0",
|
|
2030
|
+
version: "22.3.0",
|
|
2031
|
+
ngImport: i0,
|
|
2032
|
+
type: SubmitContextFormAdapter
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
};
|
|
2036
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2037
|
+
minVersion: "12.0.0",
|
|
2038
|
+
version: "22.3.0",
|
|
2039
|
+
ngImport: i0,
|
|
2040
|
+
type: SubmitContextFormAdapter,
|
|
2041
|
+
decorators: [{ type: Injectable }],
|
|
2042
|
+
ctorParameters: () => [{
|
|
2043
|
+
type: void 0,
|
|
2044
|
+
decorators: [{
|
|
2045
|
+
type: Inject,
|
|
2046
|
+
args: [SUBMIT_CONTEXT_FORM_ADAPTER_METHOD]
|
|
2047
|
+
}]
|
|
2048
|
+
}, {
|
|
2049
|
+
type: void 0,
|
|
2050
|
+
decorators: [{
|
|
2051
|
+
type: Inject,
|
|
2052
|
+
args: [RXAP_FORM_CONTEXT]
|
|
2053
|
+
}]
|
|
2054
|
+
}]
|
|
2055
|
+
});
|
|
1633
2056
|
function SubmitContextFormAdapterFactory(remoteMethod, context) {
|
|
1634
|
-
|
|
2057
|
+
return new SubmitContextFormAdapter(remoteMethod, context);
|
|
1635
2058
|
}
|
|
1636
|
-
|
|
1637
|
-
// region validators
|
|
1638
|
-
// endregion
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Generated bundle index. Do not edit.
|
|
1642
|
-
*/
|
|
1643
|
-
|
|
1644
2059
|
export { AbstractOptionsFromMethodDirective, ApplyUseFunctionAdapters, ApplyUseMethodAdapters, AutocompleteOptionsFromMethodDirective, ComposeOptionsTransformers, ControlDataSource, ControlHideShowDirective, DATA_SOURCE_NAME, ExtractControlFromParentMixin, ExtractControlMixin, ExtractDataSourcesMixin, ExtractFormDefinitionMixin, ExtractFunctionMixin, ExtractFunctionsMixin, ExtractIsValueFunctionMixin, ExtractMethodMixin, ExtractMethodsMixin, ExtractOptionsDataSourceMixin, ExtractOptionsMethodMixin, ExtractRemoteMethodsMixin, ExtractResolveMethodMixin, ExtractToDisplayFunctionMixin, ForFormArrayItemsDirective, FormArrayAddItemButtonDirective, FormArrayItemButton, FormArrayItemRemoveButtonDirective, FormArrayItemRestoreButtonDirective, FormArrayRemovableDirective, FormContextFromActivatedRouteFactory, FormSystemControlDirective, FormSystemMetadataKeys, IS_VALUE_FUNCTION_NAME, InputSelectOptionsDirective, IsEqualToDirective, IsSelectableValueDirective, NoopResolveMethod, OPTIONS_METHOD_NAME, OptionsFromMethodDirective, OptionsFromRemoteMethodDirective, REMOTE_METHOD_NAME, RESOLVE_METHOD_NAME, RXAP_FORM_CONTROL_SOURCE, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_SHOW_METADATA, RXAP_USE_FUNCTION, RXAP_USE_METHOD, RXAP_USE_REMOTE_METHOD, ResolveByUuidParameter, ResolveByUuidResultFactory, RxapFormSystemError, SUBMIT_CONTEXT_FORM_ADAPTER_METHOD, SubmitContextFormAdapter, SubmitContextFormAdapterFactory, TO_DISPLAY_FUNCTION_NAME, TestNgControl, UseAutocompleteIsValueFunction, UseAutocompleteOptionsMethod, UseAutocompleteResolveMethod, UseAutocompleteToDisplayFunction, UseComponent, UseDataSource, UseFormComponent, UseFunction, UseHideFunction, UseIsValueFunction, UseMethod, UseOptionsDataSource, UseOptionsMethod, UseOptionsRemoteMethod, UseRemoteMethod, UseResolveMethod, UseShowFunction, UseToDisplayFunction, controlDataSource };
|
|
1645
|
-
|
|
2060
|
+
|
|
2061
|
+
//# sourceMappingURL=rxap-form-system.mjs.map
|