@rxap/form-system 21.0.1-dev.0 → 21.0.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/compodoc/changelog.html +15 -0
- package/compodoc/classes/ExtractOptionsDataSourceMixin.html +24 -80
- package/compodoc/classes/ExtractRemoteMethodsMixin.html +36 -52
- package/compodoc/dependencies.html +11 -11
- package/compodoc/directives/AbstractOptionsFromMethodDirective.html +1354 -0
- package/compodoc/directives/AutocompleteOptionsFromMethodDirective.html +376 -229
- package/compodoc/directives/ControlHideShowDirective.html +43 -152
- package/compodoc/directives/ForFormArrayItemsDirective.html +6 -101
- package/compodoc/directives/FormArrayAddItemButtonDirective.html +84 -222
- package/compodoc/directives/FormArrayItemButton.html +182 -200
- package/compodoc/directives/FormArrayItemRemoveButtonDirective.html +230 -211
- package/compodoc/directives/FormArrayItemRestoreButtonDirective.html +188 -158
- package/compodoc/directives/FormArrayRemovableDirective.html +39 -61
- package/compodoc/directives/FormSystemControlDirective.html +64 -148
- package/compodoc/directives/InputSelectOptionsDirective.html +390 -268
- package/compodoc/directives/IsEqualToDirective.html +61 -117
- package/compodoc/directives/IsSelectableValueDirective.html +50 -204
- package/compodoc/directives/OptionsFromMethodDirective.html +380 -164
- package/compodoc/directives/OptionsFromRemoteMethodDirective.html +123 -212
- package/compodoc/graph/dependencies.svg +4 -70
- package/compodoc/injectables/ControlDataSource.html +4 -10
- package/compodoc/injectables/NoopResolveMethod.html +48 -40
- package/compodoc/injectables/SubmitContextFormAdapter.html +4 -9
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.html +46 -38
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.html +46 -38
- package/compodoc/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.html +46 -38
- package/compodoc/interfaces/ControlHideShowOptions.html +10 -30
- package/compodoc/interfaces/ForFormArrayItemsDirectiveContext.html +6 -17
- package/compodoc/interfaces/InputSelectOptionsSettings.html +26 -49
- package/compodoc/interfaces/InputSelectOptionsTemplateContext.html +26 -49
- package/compodoc/interfaces/OptionsFromMethodDirectiveSettings.html +63 -45
- package/compodoc/interfaces/OptionsFromMethodTemplateContext.html +63 -45
- package/compodoc/interfaces/OptionsFromRemoteMethodTemplateContext.html +34 -50
- package/compodoc/js/menu-wc.js +3 -32
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/modules.html +0 -17
- package/compodoc/overview.html +2 -114
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +8836 -7240
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AbstractOptionsFromMethodDirective.html +38 -0
- package/docs/html/classes/AutocompleteOptionsFromMethodDirective.html +19 -16
- package/docs/html/classes/ControlDataSource.html +13 -13
- package/docs/html/classes/ControlHideShowDirective.html +5 -5
- 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 -4
- 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 +4 -4
- 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 +10 -7
- package/docs/html/classes/IsEqualToDirective.html +5 -5
- package/docs/html/classes/IsSelectableValueDirective.html +4 -5
- package/docs/html/classes/NoopResolveMethod.html +2 -2
- package/docs/html/classes/OptionsFromMethodDirective.html +24 -24
- package/docs/html/classes/OptionsFromRemoteMethodDirective.html +5 -11
- package/docs/html/classes/RxapFormSystemError.html +5 -5
- package/docs/html/classes/SubmitContextFormAdapter.html +10 -10
- package/docs/html/classes/TestNgControl.html +4 -4
- 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 +436 -0
- package/docs/markdown/classes/AutocompleteOptionsFromMethodDirective.md +131 -122
- package/docs/markdown/classes/ControlDataSource.md +51 -51
- package/docs/markdown/classes/ControlHideShowDirective.md +11 -31
- 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 +19 -31
- package/docs/markdown/classes/ExtractOptionsMethodMixin.md +12 -12
- 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 +5 -25
- package/docs/markdown/classes/FormArrayAddItemButtonDirective.md +14 -26
- package/docs/markdown/classes/FormArrayItemButton.md +21 -41
- package/docs/markdown/classes/FormArrayItemRemoveButtonDirective.md +28 -58
- package/docs/markdown/classes/FormArrayItemRestoreButtonDirective.md +25 -45
- package/docs/markdown/classes/FormArrayRemovableDirective.md +10 -18
- package/docs/markdown/classes/FormSystemControlDirective.md +13 -37
- package/docs/markdown/classes/InputSelectOptionsDirective.md +50 -75
- package/docs/markdown/classes/IsEqualToDirective.md +9 -19
- package/docs/markdown/classes/IsSelectableValueDirective.md +23 -47
- package/docs/markdown/classes/NoopResolveMethod.md +3 -3
- package/docs/markdown/classes/OptionsFromMethodDirective.md +140 -85
- package/docs/markdown/classes/OptionsFromRemoteMethodDirective.md +14 -67
- package/docs/markdown/classes/RxapFormSystemError.md +13 -13
- package/docs/markdown/classes/SubmitContextFormAdapter.md +32 -32
- package/docs/markdown/classes/TestNgControl.md +5 -5
- 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 +3 -3
- 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 +432 -0
- package/docs/wiki/Class.AutocompleteOptionsFromMethodDirective.md +130 -121
- package/docs/wiki/Class.ControlDataSource.md +50 -50
- package/docs/wiki/Class.ControlHideShowDirective.md +10 -30
- 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 +18 -30
- package/docs/wiki/Class.ExtractOptionsMethodMixin.md +11 -11
- 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 +4 -24
- package/docs/wiki/Class.FormArrayAddItemButtonDirective.md +13 -25
- package/docs/wiki/Class.FormArrayItemButton.md +20 -40
- package/docs/wiki/Class.FormArrayItemRemoveButtonDirective.md +27 -57
- package/docs/wiki/Class.FormArrayItemRestoreButtonDirective.md +24 -44
- package/docs/wiki/Class.FormArrayRemovableDirective.md +9 -17
- package/docs/wiki/Class.FormSystemControlDirective.md +12 -36
- package/docs/wiki/Class.InputSelectOptionsDirective.md +49 -74
- package/docs/wiki/Class.IsEqualToDirective.md +8 -18
- package/docs/wiki/Class.IsSelectableValueDirective.md +22 -46
- package/docs/wiki/Class.NoopResolveMethod.md +2 -2
- package/docs/wiki/Class.OptionsFromMethodDirective.md +139 -84
- package/docs/wiki/Class.OptionsFromRemoteMethodDirective.md +13 -66
- package/docs/wiki/Class.RxapFormSystemError.md +12 -12
- package/docs/wiki/Class.SubmitContextFormAdapter.md +31 -31
- package/docs/wiki/Class.TestNgControl.md +4 -4
- 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/_Sidebar.md +1 -1
- package/docs/wiki/globals.md +2 -2
- package/fesm2022/rxap-form-system.mjs +274 -420
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/package.json +28 -28
- package/types/rxap-form-system.d.ts +90 -80
- package/docs/html/classes/FormSystemDirectivesModule.html +0 -2
- package/docs/markdown/classes/FormSystemDirectivesModule.md +0 -19
- package/docs/wiki/Class.FormSystemDirectivesModule.md +0 -15
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { NG_VALIDATORS, UntypedFormGroup, UntypedFormArray, NgControl, ControlContainer } from '@angular/forms';
|
|
2
|
+
import { input, effect, untracked, forwardRef, Directive, isDevMode, inject, INJECTOR, runInInjectionContext, TemplateRef, ViewContainerRef, ChangeDetectorRef, Renderer2, ElementRef, signal, linkedSignal, Injectable, InjectionToken, Inject, Optional, EnvironmentInjector, createComponent } from '@angular/core';
|
|
3
|
+
import { NG_VALIDATORS, ControlContainer, UntypedFormGroup, UntypedFormArray, NgControl } from '@angular/forms';
|
|
5
4
|
import { __decorate, __metadata } from 'tslib';
|
|
6
|
-
import * as i1 from '@rxap/data-source';
|
|
7
5
|
import { PipeDataSource, DataSourceLoader, BaseDataSource, RXAP_DATA_SOURCE_METADATA } from '@rxap/data-source';
|
|
8
6
|
import { Mixin } from '@rxap/mixin';
|
|
9
7
|
import { RxapFormControl, RxapFormGroup, RxapFormArray, controlValueChanges$, RXAP_FORM_CONTEXT } from '@rxap/forms';
|
|
@@ -12,29 +10,28 @@ import { setMetadataMapMap, getMetadata, setMetadataMap, setMetadata } from '@rx
|
|
|
12
10
|
import { RxapError, isPromiseLike, isPromise, equals } from '@rxap/utilities';
|
|
13
11
|
import { ToMethod } from '@rxap/pattern';
|
|
14
12
|
import { debounceTime, map as map$1, distinctUntilChanged, startWith, pairwise, tap as tap$1, isObservable, Subscription, of, EMPTY } from 'rxjs';
|
|
15
|
-
import
|
|
16
|
-
import '@angular/material/autocomplete';
|
|
13
|
+
import { MatButton } from '@angular/material/button';
|
|
17
14
|
import { isDefined } from '@rxap/rxjs';
|
|
18
15
|
import { isUUID } from '@rxap/validator';
|
|
19
|
-
import * as i3 from '@angular/material/form-field';
|
|
20
16
|
import { MatFormField, MAT_FORM_FIELD } from '@angular/material/form-field';
|
|
21
|
-
import * as i2$1 from '@rxap/remote-method';
|
|
22
17
|
import { RemoteMethodLoader, ProxyRemoteMethod } from '@rxap/remote-method';
|
|
23
18
|
|
|
24
19
|
class IsEqualToDirective {
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
this.
|
|
29
|
-
|
|
20
|
+
constructor() {
|
|
21
|
+
this.equalTo = input.required({ ...(ngDevMode ? { debugName: "equalTo" } : /* istanbul ignore next */ {}), alias: 'rxapIsEqualTo' });
|
|
22
|
+
effect(() => {
|
|
23
|
+
this.equalTo();
|
|
24
|
+
untracked(() => this._onChange?.());
|
|
25
|
+
});
|
|
30
26
|
}
|
|
31
27
|
validate(control) {
|
|
32
|
-
|
|
28
|
+
const equalTo = this.equalTo();
|
|
29
|
+
if (equalTo === null || equalTo === control.value) {
|
|
33
30
|
return null;
|
|
34
31
|
}
|
|
35
32
|
return {
|
|
36
33
|
isEqualTo: {
|
|
37
|
-
value:
|
|
34
|
+
value: equalTo,
|
|
38
35
|
actualValue: control.value,
|
|
39
36
|
},
|
|
40
37
|
};
|
|
@@ -49,7 +46,7 @@ class IsEqualToDirective {
|
|
|
49
46
|
this._onChange = fn;
|
|
50
47
|
}
|
|
51
48
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsEqualToDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
52
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
49
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: IsEqualToDirective, isStandalone: true, selector: "[rxapIsEqualTo]", inputs: { equalTo: { classPropertyName: "equalTo", publicName: "rxapIsEqualTo", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
53
50
|
{
|
|
54
51
|
provide: NG_VALIDATORS,
|
|
55
52
|
multi: true,
|
|
@@ -70,13 +67,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
70
67
|
],
|
|
71
68
|
standalone: true,
|
|
72
69
|
}]
|
|
73
|
-
}], propDecorators: { equalTo: [{
|
|
74
|
-
type: Input,
|
|
75
|
-
args: [{
|
|
76
|
-
required: true,
|
|
77
|
-
alias: 'rxapIsEqualTo',
|
|
78
|
-
}]
|
|
79
|
-
}] } });
|
|
70
|
+
}], ctorParameters: () => [], propDecorators: { equalTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapIsEqualTo", required: true }] }] } });
|
|
80
71
|
|
|
81
72
|
var FormSystemMetadataKeys;
|
|
82
73
|
(function (FormSystemMetadataKeys) {
|
|
@@ -152,7 +143,7 @@ function UseOptionsDataSource(dataSource, settings) {
|
|
|
152
143
|
};
|
|
153
144
|
}
|
|
154
145
|
let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
|
|
155
|
-
extractOptionsDatasource(control) {
|
|
146
|
+
extractOptionsDatasource(control, metadata) {
|
|
156
147
|
control ??= this.extractControl();
|
|
157
148
|
if (!(control instanceof RxapFormControl)) {
|
|
158
149
|
throw new Error('Ensure to use a RxapFromControl');
|
|
@@ -166,10 +157,11 @@ let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
|
|
|
166
157
|
this.settings = this.useDataSourceValue.settings ?? {};
|
|
167
158
|
let dataSource;
|
|
168
159
|
try {
|
|
169
|
-
dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource,
|
|
160
|
+
dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource, metadata, this.injector);
|
|
170
161
|
}
|
|
171
162
|
catch (e) {
|
|
172
|
-
|
|
163
|
+
// Angular >= 19 throws a RuntimeError (NG0201) instead of a NullInjectorError
|
|
164
|
+
if (e?.name === 'NullInjectorError' || /NG0201/.test(e?.message ?? '')) {
|
|
173
165
|
if (isDevMode()) {
|
|
174
166
|
console.error('Cloud not inject the options data source', this.useDataSourceValue);
|
|
175
167
|
}
|
|
@@ -191,10 +183,10 @@ ExtractOptionsDataSourceMixin = __decorate([
|
|
|
191
183
|
], ExtractOptionsDataSourceMixin);
|
|
192
184
|
|
|
193
185
|
let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
194
|
-
constructor(
|
|
195
|
-
this.dataSourceLoader =
|
|
196
|
-
this.injector =
|
|
197
|
-
this.viewer = { id: '[rxapIsSelectableValue]' };
|
|
186
|
+
constructor() {
|
|
187
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
188
|
+
this.injector = inject(INJECTOR);
|
|
189
|
+
this.viewer = input({ id: '[rxapIsSelectableValue]' }, ...(ngDevMode ? [{ debugName: "viewer" }] : /* istanbul ignore next */ []));
|
|
198
190
|
}
|
|
199
191
|
validate(control) {
|
|
200
192
|
if (control.value) {
|
|
@@ -226,8 +218,8 @@ let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
|
226
218
|
}
|
|
227
219
|
return null;
|
|
228
220
|
}
|
|
229
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsSelectableValueDirective, deps: [
|
|
230
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsSelectableValueDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
222
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: IsSelectableValueDirective, isStandalone: true, selector: "[rxapIsSelectableValue]", inputs: { viewer: { classPropertyName: "viewer", publicName: "viewer", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
231
223
|
{
|
|
232
224
|
provide: NG_VALIDATORS,
|
|
233
225
|
multi: true,
|
|
@@ -236,9 +228,7 @@ let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
|
236
228
|
], ngImport: i0 }); }
|
|
237
229
|
};
|
|
238
230
|
IsSelectableValueDirective = __decorate([
|
|
239
|
-
Mixin(ExtractOptionsDataSourceMixin)
|
|
240
|
-
__metadata("design:paramtypes", [DataSourceLoader,
|
|
241
|
-
Injector])
|
|
231
|
+
Mixin(ExtractOptionsDataSourceMixin)
|
|
242
232
|
], IsSelectableValueDirective);
|
|
243
233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
|
|
244
234
|
type: Directive,
|
|
@@ -253,15 +243,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
253
243
|
],
|
|
254
244
|
standalone: true,
|
|
255
245
|
}]
|
|
256
|
-
}],
|
|
257
|
-
type: Inject,
|
|
258
|
-
args: [DataSourceLoader]
|
|
259
|
-
}] }, { type: i0.Injector, decorators: [{
|
|
260
|
-
type: Inject,
|
|
261
|
-
args: [INJECTOR]
|
|
262
|
-
}] }], propDecorators: { viewer: [{
|
|
263
|
-
type: Input
|
|
264
|
-
}] } });
|
|
246
|
+
}], propDecorators: { viewer: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewer", required: false }] }] } });
|
|
265
247
|
|
|
266
248
|
function ResolveByUuidParameter({ value }) {
|
|
267
249
|
return {
|
|
@@ -496,11 +478,11 @@ ExtractToDisplayFunctionMixin = __decorate([
|
|
|
496
478
|
|
|
497
479
|
// TODO : move to rxap packages
|
|
498
480
|
class ForFormArrayItemsDirective {
|
|
499
|
-
constructor(
|
|
500
|
-
this.container =
|
|
501
|
-
this.template =
|
|
502
|
-
this.viewContainerRef =
|
|
503
|
-
this.cdr =
|
|
481
|
+
constructor() {
|
|
482
|
+
this.container = inject(ControlContainer, { skipSelf: true });
|
|
483
|
+
this.template = inject(TemplateRef);
|
|
484
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
485
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
504
486
|
}
|
|
505
487
|
ngAfterViewInit() {
|
|
506
488
|
if (this.container.control instanceof RxapFormArray) {
|
|
@@ -539,7 +521,7 @@ class ForFormArrayItemsDirective {
|
|
|
539
521
|
}
|
|
540
522
|
this.cdr.detectChanges();
|
|
541
523
|
}
|
|
542
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ForFormArrayItemsDirective, deps: [
|
|
524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ForFormArrayItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
543
525
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: ForFormArrayItemsDirective, isStandalone: true, selector: "[rxapForFormArrayItem]", ngImport: i0 }); }
|
|
544
526
|
}
|
|
545
527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ForFormArrayItemsDirective, decorators: [{
|
|
@@ -548,15 +530,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
548
530
|
selector: '[rxapForFormArrayItem]',
|
|
549
531
|
standalone: true,
|
|
550
532
|
}]
|
|
551
|
-
}]
|
|
552
|
-
type: SkipSelf
|
|
553
|
-
}] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }] });
|
|
533
|
+
}] });
|
|
554
534
|
|
|
555
535
|
// TODO : move to rxap packages
|
|
556
536
|
class FormArrayAddItemButtonDirective {
|
|
557
|
-
constructor(
|
|
558
|
-
this.parent =
|
|
559
|
-
this.matButton =
|
|
537
|
+
constructor() {
|
|
538
|
+
this.parent = inject(ControlContainer, { skipSelf: true });
|
|
539
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
560
540
|
this.type = 'button';
|
|
561
541
|
}
|
|
562
542
|
get disabled() {
|
|
@@ -569,8 +549,9 @@ class FormArrayAddItemButtonDirective {
|
|
|
569
549
|
if (this.parent.control instanceof RxapFormArray) {
|
|
570
550
|
this.formArray = this.parent.control;
|
|
571
551
|
}
|
|
572
|
-
|
|
573
|
-
|
|
552
|
+
const matButton = this.matButton;
|
|
553
|
+
if (matButton) {
|
|
554
|
+
this._controlDisabledSubscription = this.formArray.disabled$.pipe(tap$1(isDisabled => matButton.disabled = isDisabled)).subscribe();
|
|
574
555
|
}
|
|
575
556
|
}
|
|
576
557
|
ngOnDestroy() {
|
|
@@ -579,40 +560,30 @@ class FormArrayAddItemButtonDirective {
|
|
|
579
560
|
onClick() {
|
|
580
561
|
this.formArray.insertAt();
|
|
581
562
|
}
|
|
582
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayAddItemButtonDirective, deps: [
|
|
583
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayAddItemButtonDirective, isStandalone: true, selector: "[rxapFormArrayItemAddButton]", host: {
|
|
563
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayAddItemButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
564
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayAddItemButtonDirective, isStandalone: true, selector: "[rxapFormArrayItemAddButton]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" }, properties: { "disabled": "disabled" } }, ngImport: i0 }); }
|
|
584
565
|
}
|
|
585
566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayAddItemButtonDirective, decorators: [{
|
|
586
567
|
type: Directive,
|
|
587
568
|
args: [{
|
|
588
569
|
selector: '[rxapFormArrayItemAddButton]',
|
|
589
570
|
standalone: true,
|
|
571
|
+
host: {
|
|
572
|
+
'type': 'button',
|
|
573
|
+
'[disabled]': 'disabled',
|
|
574
|
+
'(click)': 'onClick()',
|
|
575
|
+
},
|
|
590
576
|
}]
|
|
591
|
-
}]
|
|
592
|
-
type: Optional
|
|
593
|
-
}, {
|
|
594
|
-
type: SkipSelf
|
|
595
|
-
}] }, { type: i2.MatButton, decorators: [{
|
|
596
|
-
type: Optional
|
|
597
|
-
}] }], propDecorators: { type: [{
|
|
598
|
-
type: HostBinding,
|
|
599
|
-
args: ['type']
|
|
600
|
-
}], disabled: [{
|
|
601
|
-
type: HostBinding,
|
|
602
|
-
args: ['disabled']
|
|
603
|
-
}], onClick: [{
|
|
604
|
-
type: HostListener,
|
|
605
|
-
args: ['click']
|
|
606
|
-
}] } });
|
|
577
|
+
}] });
|
|
607
578
|
|
|
608
579
|
// TODO : move to rxap packages
|
|
609
580
|
class FormArrayItemButton {
|
|
610
|
-
constructor(
|
|
611
|
-
this.parent = parent;
|
|
612
|
-
this.matButton = matButton;
|
|
613
|
-
this.renderer = renderer;
|
|
614
|
-
this.elementRef = elementRef;
|
|
581
|
+
constructor() {
|
|
615
582
|
this.type = 'button';
|
|
583
|
+
this.parent = inject(ControlContainer, { skipSelf: true });
|
|
584
|
+
this.matButton = inject(MatButton, { optional: true });
|
|
585
|
+
this.renderer = inject(Renderer2);
|
|
586
|
+
this.elementRef = inject(ElementRef);
|
|
616
587
|
}
|
|
617
588
|
get disabled() {
|
|
618
589
|
return this.isDisabled;
|
|
@@ -651,8 +622,9 @@ class FormArrayItemButton {
|
|
|
651
622
|
else {
|
|
652
623
|
throw new Error(`The parent is not a form group instance`);
|
|
653
624
|
}
|
|
654
|
-
|
|
655
|
-
|
|
625
|
+
const matButton = this.matButton;
|
|
626
|
+
if (matButton) {
|
|
627
|
+
this._controlDisabledSubscription = this.formGroup.disabled$.pipe(tap$1(isDisabled => matButton.disabled = isDisabled)).subscribe();
|
|
656
628
|
}
|
|
657
629
|
this.deletedControl.value$.pipe(tap$1(() => this.updateDisplayStyle())).subscribe();
|
|
658
630
|
}
|
|
@@ -660,22 +632,19 @@ class FormArrayItemButton {
|
|
|
660
632
|
this._controlDisabledSubscription?.unsubscribe();
|
|
661
633
|
this._deletedControlValueSubscription?.unsubscribe();
|
|
662
634
|
}
|
|
663
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemButton, deps: [
|
|
664
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayItemButton, isStandalone: true, host: {
|
|
635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
636
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayItemButton, isStandalone: true, host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" }, properties: { "disabled": "disabled" } }, ngImport: i0 }); }
|
|
665
637
|
}
|
|
666
638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemButton, decorators: [{
|
|
667
|
-
type: Directive
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
type: HostBinding,
|
|
677
|
-
args: ['disabled']
|
|
678
|
-
}] } });
|
|
639
|
+
type: Directive,
|
|
640
|
+
args: [{
|
|
641
|
+
host: {
|
|
642
|
+
'type': 'button',
|
|
643
|
+
'[disabled]': 'disabled',
|
|
644
|
+
'(click)': 'onClick()',
|
|
645
|
+
},
|
|
646
|
+
}]
|
|
647
|
+
}] });
|
|
679
648
|
|
|
680
649
|
// TODO : move to rxap packages
|
|
681
650
|
class FormArrayItemRemoveButtonDirective extends FormArrayItemButton {
|
|
@@ -686,10 +655,10 @@ class FormArrayItemRemoveButtonDirective extends FormArrayItemButton {
|
|
|
686
655
|
* true - in the given form group the deleted control is set to true
|
|
687
656
|
* false - the form group is removed from the (parent) form array
|
|
688
657
|
*/
|
|
689
|
-
this.shouldTemporarilyDeleted = () => false;
|
|
658
|
+
this.shouldTemporarilyDeleted = input(() => false, ...(ngDevMode ? [{ debugName: "shouldTemporarilyDeleted" }] : /* istanbul ignore next */ []));
|
|
690
659
|
}
|
|
691
660
|
onClick() {
|
|
692
|
-
const templateDelete = this.shouldTemporarilyDeleted(this.formGroup);
|
|
661
|
+
const templateDelete = this.shouldTemporarilyDeleted()(this.formGroup);
|
|
693
662
|
if (templateDelete) {
|
|
694
663
|
this.deletedControl.setValue(true);
|
|
695
664
|
}
|
|
@@ -706,7 +675,7 @@ class FormArrayItemRemoveButtonDirective extends FormArrayItemButton {
|
|
|
706
675
|
}
|
|
707
676
|
}
|
|
708
677
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemRemoveButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
709
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
678
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: FormArrayItemRemoveButtonDirective, isStandalone: true, selector: "button[rxapFormArrayItemRemoveButton]", inputs: { shouldTemporarilyDeleted: { classPropertyName: "shouldTemporarilyDeleted", publicName: "shouldTemporarilyDeleted", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
710
679
|
}
|
|
711
680
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemRemoveButtonDirective, decorators: [{
|
|
712
681
|
type: Directive,
|
|
@@ -714,12 +683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
714
683
|
selector: 'button[rxapFormArrayItemRemoveButton]',
|
|
715
684
|
standalone: true,
|
|
716
685
|
}]
|
|
717
|
-
}], propDecorators: { shouldTemporarilyDeleted: [{
|
|
718
|
-
type: Input
|
|
719
|
-
}], onClick: [{
|
|
720
|
-
type: HostListener,
|
|
721
|
-
args: ['click']
|
|
722
|
-
}] } });
|
|
686
|
+
}], propDecorators: { shouldTemporarilyDeleted: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldTemporarilyDeleted", required: false }] }] } });
|
|
723
687
|
|
|
724
688
|
// TODO : move to rxap packages
|
|
725
689
|
class FormArrayItemRestoreButtonDirective extends FormArrayItemButton {
|
|
@@ -735,7 +699,7 @@ class FormArrayItemRestoreButtonDirective extends FormArrayItemButton {
|
|
|
735
699
|
}
|
|
736
700
|
}
|
|
737
701
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemRestoreButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
738
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayItemRestoreButtonDirective, isStandalone: true, selector: "button[rxapFormArrayItemRestoreButton]",
|
|
702
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayItemRestoreButtonDirective, isStandalone: true, selector: "button[rxapFormArrayItemRestoreButton]", usesInheritance: true, ngImport: i0 }); }
|
|
739
703
|
}
|
|
740
704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayItemRestoreButtonDirective, decorators: [{
|
|
741
705
|
type: Directive,
|
|
@@ -743,15 +707,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
743
707
|
selector: 'button[rxapFormArrayItemRestoreButton]',
|
|
744
708
|
standalone: true,
|
|
745
709
|
}]
|
|
746
|
-
}]
|
|
747
|
-
type: HostListener,
|
|
748
|
-
args: ['click']
|
|
749
|
-
}] } });
|
|
710
|
+
}] });
|
|
750
711
|
|
|
751
712
|
// TODO : move to rxap packages
|
|
752
713
|
class FormArrayRemovableDirective {
|
|
753
|
-
constructor(
|
|
754
|
-
this.parent =
|
|
714
|
+
constructor() {
|
|
715
|
+
this.parent = inject(ControlContainer);
|
|
755
716
|
}
|
|
756
717
|
get isDeleted() {
|
|
757
718
|
return this.deletedControl.value;
|
|
@@ -797,7 +758,7 @@ class FormArrayRemovableDirective {
|
|
|
797
758
|
ngOnDestroy() {
|
|
798
759
|
this._deletedControlValueSubscription?.unsubscribe();
|
|
799
760
|
}
|
|
800
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayRemovableDirective, deps: [
|
|
761
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayRemovableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
801
762
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormArrayRemovableDirective, isStandalone: true, selector: "[rxapFormArrayRemovable]", ngImport: i0 }); }
|
|
802
763
|
}
|
|
803
764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormArrayRemovableDirective, decorators: [{
|
|
@@ -806,13 +767,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
806
767
|
selector: '[rxapFormArrayRemovable]',
|
|
807
768
|
standalone: true,
|
|
808
769
|
}]
|
|
809
|
-
}]
|
|
810
|
-
type: Optional
|
|
811
|
-
}] }] });
|
|
770
|
+
}] });
|
|
812
771
|
|
|
813
|
-
|
|
772
|
+
/**
|
|
773
|
+
* Shared implementation of the options from method directives. The concrete directives
|
|
774
|
+
* only declare the (aliased) signal inputs.
|
|
775
|
+
*/
|
|
776
|
+
let AbstractOptionsFromMethodDirective = class AbstractOptionsFromMethodDirective {
|
|
777
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
814
780
|
constructor() {
|
|
815
781
|
this.loading = signal(true, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
782
|
+
/**
|
|
783
|
+
* The method used to load the options. Defaults to the method defined with the input. If the
|
|
784
|
+
* input is not set the method is extracted from the form definition.
|
|
785
|
+
*/
|
|
786
|
+
this.optionsMethod = linkedSignal(() => this.method(), ...(ngDevMode ? [{ debugName: "optionsMethod" }] : /* istanbul ignore next */ []));
|
|
816
787
|
this.options = null;
|
|
817
788
|
this.ngControl = null;
|
|
818
789
|
this.matFormField = null;
|
|
@@ -821,38 +792,30 @@ let OptionsFromMethodDirective = class OptionsFromMethodDirective {
|
|
|
821
792
|
this.injector = inject(INJECTOR);
|
|
822
793
|
this.cdr = inject(ChangeDetectorRef);
|
|
823
794
|
this.template = inject(TemplateRef);
|
|
795
|
+
this.initialized = signal(false, ...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
796
|
+
// load the options as soon as the directive is initialized and each time the parameters change
|
|
797
|
+
effect(() => {
|
|
798
|
+
const parameters = this.parameters();
|
|
799
|
+
if (!this.initialized()) {
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
untracked(() => this.load(parameters));
|
|
803
|
+
});
|
|
824
804
|
}
|
|
825
|
-
|
|
826
|
-
return true;
|
|
827
|
-
}
|
|
828
|
-
async ngAfterViewInit() {
|
|
805
|
+
ngAfterViewInit() {
|
|
829
806
|
this.matFormField = this.injector.get(MatFormField, null);
|
|
830
807
|
this.ngControl = this.matFormField?._control.ngControl ?? this.injector.get(NgControl, null);
|
|
831
808
|
this.control = this.ngControl?.control ?? undefined;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
// then the options are not loaded.
|
|
835
|
-
if (!this.options) {
|
|
836
|
-
await this.load(this.parameters);
|
|
809
|
+
if (!this.optionsMethod()) {
|
|
810
|
+
this.optionsMethod.set(this.extractOptionsMethod());
|
|
837
811
|
}
|
|
812
|
+
this.initialized.set(true);
|
|
838
813
|
}
|
|
839
814
|
ngOnDestroy() {
|
|
840
815
|
this._loadOptionsSubscription?.unsubscribe();
|
|
841
816
|
}
|
|
842
|
-
async ngOnChanges(changes) {
|
|
843
|
-
// only try to load the options if the method is defined
|
|
844
|
-
// else the initial load will be triggered in the ngAfterViewInit
|
|
845
|
-
if (!this.method) {
|
|
846
|
-
console.debug('The method is not yet defined');
|
|
847
|
-
return;
|
|
848
|
-
}
|
|
849
|
-
const parametersChanges = changes['parameters'];
|
|
850
|
-
if (parametersChanges) {
|
|
851
|
-
await this.load(parametersChanges.currentValue);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
817
|
async loadOptions(parameters) {
|
|
855
|
-
return this.
|
|
818
|
+
return this.optionsMethod().call(parameters, this.control);
|
|
856
819
|
}
|
|
857
820
|
renderTemplate() {
|
|
858
821
|
if (!this.options) {
|
|
@@ -862,8 +825,9 @@ let OptionsFromMethodDirective = class OptionsFromMethodDirective {
|
|
|
862
825
|
for (const option of this.options) {
|
|
863
826
|
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
|
|
864
827
|
}
|
|
865
|
-
|
|
866
|
-
|
|
828
|
+
const resetOnChange = untracked(this.resetOnChange);
|
|
829
|
+
if (resetOnChange !== undefined) {
|
|
830
|
+
this.control?.reset(resetOnChange);
|
|
867
831
|
}
|
|
868
832
|
this.cdr.detectChanges();
|
|
869
833
|
}
|
|
@@ -877,7 +841,7 @@ let OptionsFromMethodDirective = class OptionsFromMethodDirective {
|
|
|
877
841
|
this.renderTemplate();
|
|
878
842
|
}
|
|
879
843
|
}
|
|
880
|
-
async load(parameters = this.parameters) {
|
|
844
|
+
async load(parameters = untracked(this.parameters)) {
|
|
881
845
|
this.loading.set(true);
|
|
882
846
|
try {
|
|
883
847
|
const result = await this.loadOptions(parameters);
|
|
@@ -893,12 +857,27 @@ let OptionsFromMethodDirective = class OptionsFromMethodDirective {
|
|
|
893
857
|
this.loading.set(false);
|
|
894
858
|
}
|
|
895
859
|
}
|
|
896
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type:
|
|
897
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type:
|
|
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 }); }
|
|
898
862
|
};
|
|
899
|
-
|
|
900
|
-
Mixin(ExtractOptionsMethodMixin)
|
|
901
|
-
|
|
863
|
+
AbstractOptionsFromMethodDirective = __decorate([
|
|
864
|
+
Mixin(ExtractOptionsMethodMixin),
|
|
865
|
+
__metadata("design:paramtypes", [])
|
|
866
|
+
], AbstractOptionsFromMethodDirective);
|
|
867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AbstractOptionsFromMethodDirective, decorators: [{
|
|
868
|
+
type: Directive
|
|
869
|
+
}], ctorParameters: () => [] });
|
|
870
|
+
class OptionsFromMethodDirective extends AbstractOptionsFromMethodDirective {
|
|
871
|
+
constructor() {
|
|
872
|
+
super(...arguments);
|
|
873
|
+
this.parameters = input(undefined, { ...(ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {}), alias: 'rxapOptionsFromMethodParameters' });
|
|
874
|
+
this.resetOnChange = input(undefined, { ...(ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {}), alias: 'rxapOptionsFromMethodResetOnChange' });
|
|
875
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
876
|
+
this.method = input(undefined, { ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: 'rxapOptionsFromMethodCall' });
|
|
877
|
+
}
|
|
878
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromMethodDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
879
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: OptionsFromMethodDirective, isStandalone: true, selector: "[rxapOptionsFromMethod]", inputs: { parameters: { classPropertyName: "parameters", publicName: "rxapOptionsFromMethodParameters", isSignal: true, isRequired: false, transformFunction: null }, resetOnChange: { classPropertyName: "resetOnChange", publicName: "rxapOptionsFromMethodResetOnChange", isSignal: true, isRequired: false, transformFunction: null }, method: { classPropertyName: "method", publicName: "rxapOptionsFromMethodCall", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["rxapOptionsFromMethod"], usesInheritance: true, ngImport: i0 }); }
|
|
880
|
+
}
|
|
902
881
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromMethodDirective, decorators: [{
|
|
903
882
|
type: Directive,
|
|
904
883
|
args: [{
|
|
@@ -907,16 +886,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
907
886
|
standalone: true,
|
|
908
887
|
exportAs: 'rxapOptionsFromMethod',
|
|
909
888
|
}]
|
|
910
|
-
}], propDecorators: { parameters: [{
|
|
911
|
-
type: Input,
|
|
912
|
-
args: ['rxapOptionsFromMethodParameters']
|
|
913
|
-
}], resetOnChange: [{
|
|
914
|
-
type: Input,
|
|
915
|
-
args: ['rxapOptionsFromMethodResetOnChange']
|
|
916
|
-
}], method: [{
|
|
917
|
-
type: Input,
|
|
918
|
-
args: ['rxapOptionsFromMethodCall']
|
|
919
|
-
}] } });
|
|
889
|
+
}], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromMethodParameters", required: false }] }], resetOnChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromMethodResetOnChange", required: false }] }], method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapOptionsFromMethodCall", required: false }] }] } });
|
|
920
890
|
|
|
921
891
|
function UseAutocompleteOptionsMethod(method, config = {}) {
|
|
922
892
|
config.adapter ??= {};
|
|
@@ -945,9 +915,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
945
915
|
type: Injectable,
|
|
946
916
|
args: [{ providedIn: 'root' }]
|
|
947
917
|
}] });
|
|
948
|
-
let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethodDirective extends
|
|
918
|
+
let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethodDirective extends AbstractOptionsFromMethodDirective {
|
|
949
919
|
constructor() {
|
|
950
920
|
super(...arguments);
|
|
921
|
+
this.parameters = input(undefined, { ...(ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodParameters' });
|
|
922
|
+
this.resetOnChange = input(undefined, { ...(ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodResetOnChange' });
|
|
923
|
+
this.matAutocomplete = input(undefined, { ...(ngDevMode ? { debugName: "matAutocomplete" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodMatAutocomplete' });
|
|
924
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
925
|
+
this.method = input(undefined, { ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodCall' });
|
|
926
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
927
|
+
this.resolveMethod = input(undefined, { ...(ngDevMode ? { debugName: "resolveMethod" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodResolve' });
|
|
928
|
+
this.isValue = input(undefined, { ...(ngDevMode ? { debugName: "isValue" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodIsValue' });
|
|
929
|
+
this.toDisplay = input(undefined, { ...(ngDevMode ? { debugName: "toDisplay" } : /* istanbul ignore next */ {}), alias: 'rxapAutocompleteOptionsFromMethodToDisplay' });
|
|
930
|
+
this.resolvedResolveMethod = linkedSignal(() => this.resolveMethod(), ...(ngDevMode ? [{ debugName: "resolvedResolveMethod" }] : /* istanbul ignore next */ []));
|
|
931
|
+
this.resolvedIsValue = linkedSignal(() => this.isValue(), ...(ngDevMode ? [{ debugName: "resolvedIsValue" }] : /* istanbul ignore next */ []));
|
|
932
|
+
this.resolvedToDisplay = linkedSignal(() => this.toDisplay(), ...(ngDevMode ? [{ debugName: "resolvedToDisplay" }] : /* istanbul ignore next */ []));
|
|
951
933
|
this.ngControl = null;
|
|
952
934
|
this.matFormField = null;
|
|
953
935
|
this.injector = inject(INJECTOR);
|
|
@@ -968,23 +950,30 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
968
950
|
super.ngOnDestroy();
|
|
969
951
|
this._subscription?.unsubscribe();
|
|
970
952
|
}
|
|
971
|
-
|
|
972
|
-
|
|
953
|
+
ngAfterViewInit() {
|
|
954
|
+
const matAutocomplete = this.matAutocomplete();
|
|
955
|
+
if (matAutocomplete) {
|
|
973
956
|
this.settings ??= {};
|
|
974
957
|
this.settings.filteredOptions ??= true;
|
|
975
958
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
959
|
+
super.ngAfterViewInit();
|
|
960
|
+
if (!this.resolvedResolveMethod()) {
|
|
961
|
+
this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
962
|
+
}
|
|
963
|
+
if (!this.resolvedIsValue()) {
|
|
964
|
+
this.resolvedIsValue.set(this.extractIsValueFunction((value) => typeof value === 'string' && isUUID(value)));
|
|
965
|
+
}
|
|
966
|
+
if (!this.resolvedToDisplay()) {
|
|
967
|
+
this.resolvedToDisplay.set(this.extractToDisplayFunction((value) => {
|
|
968
|
+
if (!value) {
|
|
969
|
+
return '';
|
|
970
|
+
}
|
|
971
|
+
const option = this.findOptionByValue(value);
|
|
972
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
973
|
+
}));
|
|
974
|
+
}
|
|
975
|
+
if (matAutocomplete) {
|
|
976
|
+
matAutocomplete.displayWith = this.resolvedToDisplay().bind(this);
|
|
988
977
|
}
|
|
989
978
|
if (!this.control) {
|
|
990
979
|
throw new Error('The control is not yet defined');
|
|
@@ -995,8 +984,8 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
995
984
|
// this is required because in the resolveValue method the control value is set
|
|
996
985
|
// to trigger the toDisplay function in the mat-autocomplete
|
|
997
986
|
distinctUntilChanged(), tap$1(async (value) => {
|
|
998
|
-
await this.load(this.parameters);
|
|
999
|
-
if (this.
|
|
987
|
+
await this.load(untracked(this.parameters));
|
|
988
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
1000
989
|
this.triggerAutocompleteToDisplay();
|
|
1001
990
|
}
|
|
1002
991
|
})).subscribe();
|
|
@@ -1007,7 +996,7 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
1007
996
|
}
|
|
1008
997
|
const value = this.control?.value;
|
|
1009
998
|
const c_parameters = { ...parameters };
|
|
1010
|
-
if (this.
|
|
999
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
1011
1000
|
return this.resolveValue(value, c_parameters);
|
|
1012
1001
|
}
|
|
1013
1002
|
else {
|
|
@@ -1020,13 +1009,14 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
1020
1009
|
}
|
|
1021
1010
|
renderTemplate() {
|
|
1022
1011
|
super.renderTemplate();
|
|
1023
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
1012
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
1024
1013
|
this.isAutocompleteToDisplayTriggered = true;
|
|
1025
1014
|
this.triggerAutocompleteToDisplay();
|
|
1026
1015
|
}
|
|
1027
1016
|
}
|
|
1028
1017
|
async resolveValue(value, parameters = {}) {
|
|
1029
|
-
|
|
1018
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
1019
|
+
if (!resolveMethod) {
|
|
1030
1020
|
if (isDevMode()) {
|
|
1031
1021
|
console.warn('The resolve method is not yet defined');
|
|
1032
1022
|
}
|
|
@@ -1034,7 +1024,7 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
1034
1024
|
}
|
|
1035
1025
|
// only resolve the value if the option is not already loaded
|
|
1036
1026
|
if (!this.findOptionByValue(value)) {
|
|
1037
|
-
const option = await
|
|
1027
|
+
const option = await resolveMethod.call({ ...parameters, value });
|
|
1038
1028
|
if (option.value !== value) {
|
|
1039
1029
|
throw new Error('The resolved value is not the same as the input value');
|
|
1040
1030
|
}
|
|
@@ -1051,7 +1041,7 @@ let AutocompleteOptionsFromMethodDirective = class AutocompleteOptionsFromMethod
|
|
|
1051
1041
|
return this.options?.find((option) => option.value === value) ?? null;
|
|
1052
1042
|
}
|
|
1053
1043
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AutocompleteOptionsFromMethodDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1054
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
1044
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: AutocompleteOptionsFromMethodDirective, isStandalone: true, selector: "[rxapAutocompleteOptionsFromMethod]", inputs: { parameters: { classPropertyName: "parameters", publicName: "rxapAutocompleteOptionsFromMethodParameters", isSignal: true, isRequired: false, transformFunction: null }, resetOnChange: { classPropertyName: "resetOnChange", publicName: "rxapAutocompleteOptionsFromMethodResetOnChange", isSignal: true, isRequired: false, transformFunction: null }, matAutocomplete: { classPropertyName: "matAutocomplete", publicName: "rxapAutocompleteOptionsFromMethodMatAutocomplete", isSignal: true, isRequired: false, transformFunction: null }, method: { classPropertyName: "method", publicName: "rxapAutocompleteOptionsFromMethodCall", isSignal: true, isRequired: false, transformFunction: null }, resolveMethod: { classPropertyName: "resolveMethod", publicName: "rxapAutocompleteOptionsFromMethodResolve", isSignal: true, isRequired: false, transformFunction: null }, isValue: { classPropertyName: "isValue", publicName: "rxapAutocompleteOptionsFromMethodIsValue", isSignal: true, isRequired: false, transformFunction: null }, toDisplay: { classPropertyName: "toDisplay", publicName: "rxapAutocompleteOptionsFromMethodToDisplay", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
1055
1045
|
};
|
|
1056
1046
|
AutocompleteOptionsFromMethodDirective = __decorate([
|
|
1057
1047
|
Mixin(ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, ExtractToDisplayFunctionMixin)
|
|
@@ -1063,28 +1053,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1063
1053
|
selector: '[rxapAutocompleteOptionsFromMethod]',
|
|
1064
1054
|
standalone: true,
|
|
1065
1055
|
}]
|
|
1066
|
-
}], propDecorators: { parameters: [{
|
|
1067
|
-
type: Input,
|
|
1068
|
-
args: ['rxapAutocompleteOptionsFromMethodParameters']
|
|
1069
|
-
}], resetOnChange: [{
|
|
1070
|
-
type: Input,
|
|
1071
|
-
args: ['rxapAutocompleteOptionsFromMethodResetOnChange']
|
|
1072
|
-
}], matAutocomplete: [{
|
|
1073
|
-
type: Input,
|
|
1074
|
-
args: ['rxapAutocompleteOptionsFromMethodMatAutocomplete']
|
|
1075
|
-
}], method: [{
|
|
1076
|
-
type: Input,
|
|
1077
|
-
args: ['rxapAutocompleteOptionsFromMethodCall']
|
|
1078
|
-
}], resolveMethod: [{
|
|
1079
|
-
type: Input,
|
|
1080
|
-
args: ['rxapAutocompleteOptionsFromMethodResolve']
|
|
1081
|
-
}], isValue: [{
|
|
1082
|
-
type: Input,
|
|
1083
|
-
args: ['rxapAutocompleteOptionsFromMethodIsValue']
|
|
1084
|
-
}], toDisplay: [{
|
|
1085
|
-
type: Input,
|
|
1086
|
-
args: ['rxapAutocompleteOptionsFromMethodToDisplay']
|
|
1087
|
-
}] } });
|
|
1056
|
+
}], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodParameters", required: false }] }], resetOnChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodResetOnChange", required: false }] }], matAutocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodMatAutocomplete", required: false }] }], method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodCall", required: false }] }], resolveMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodResolve", required: false }] }], isValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodIsValue", required: false }] }], toDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAutocompleteOptionsFromMethodToDisplay", required: false }] }] } });
|
|
1088
1057
|
|
|
1089
1058
|
const RXAP_FORM_SYSTEM_SHOW_METADATA = 'rxap/form-system/show-function';
|
|
1090
1059
|
const RXAP_FORM_SYSTEM_HIDE_METADATA = 'rxap/form-system/hide-function';
|
|
@@ -1106,21 +1075,23 @@ function UseShowFunction(showFunction, options = {}) {
|
|
|
1106
1075
|
};
|
|
1107
1076
|
}
|
|
1108
1077
|
let ControlHideShowDirective = class ControlHideShowDirective {
|
|
1109
|
-
constructor(
|
|
1110
|
-
this.renderer =
|
|
1111
|
-
this.elementRef =
|
|
1112
|
-
this.parent =
|
|
1113
|
-
this.ngControl =
|
|
1078
|
+
constructor() {
|
|
1079
|
+
this.renderer = inject(Renderer2);
|
|
1080
|
+
this.elementRef = inject(ElementRef);
|
|
1081
|
+
this.parent = inject(ControlContainer, { optional: true });
|
|
1082
|
+
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
1083
|
+
this.controlId = input(undefined, { ...(ngDevMode ? { debugName: "controlId" } : /* istanbul ignore next */ {}), alias: "rxapControlHideShow" });
|
|
1114
1084
|
this.subscription = new Subscription();
|
|
1115
1085
|
}
|
|
1116
1086
|
ngOnInit() {
|
|
1117
1087
|
if (!this.ngControl && !this.parent) {
|
|
1118
1088
|
throw new Error('Easier the ControlContainer or NgControl must be injectable');
|
|
1119
1089
|
}
|
|
1120
|
-
|
|
1090
|
+
const controlId = this.controlId();
|
|
1091
|
+
if (!this.ngControl && !controlId) {
|
|
1121
1092
|
throw new Error('If the NgControl is not injectable then the control id must be defined!');
|
|
1122
1093
|
}
|
|
1123
|
-
const control = this.ngControl?.control ?? this.extractControlFromParent(this.parent,
|
|
1094
|
+
const control = this.ngControl?.control ?? this.extractControlFromParent(this.parent, controlId);
|
|
1124
1095
|
if (!(control instanceof RxapFormControl)) {
|
|
1125
1096
|
throw new Error('The control is not an instance of RxapFormControl');
|
|
1126
1097
|
}
|
|
@@ -1208,13 +1179,11 @@ let ControlHideShowDirective = class ControlHideShowDirective {
|
|
|
1208
1179
|
reset() {
|
|
1209
1180
|
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
|
|
1210
1181
|
}
|
|
1211
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlHideShowDirective, deps: [
|
|
1212
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
1182
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlHideShowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1183
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: ControlHideShowDirective, isStandalone: true, selector: "[rxapControlHideShow]", inputs: { controlId: { classPropertyName: "controlId", publicName: "rxapControlHideShow", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1213
1184
|
};
|
|
1214
1185
|
ControlHideShowDirective = __decorate([
|
|
1215
|
-
Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin)
|
|
1216
|
-
__metadata("design:paramtypes", [Renderer2,
|
|
1217
|
-
ElementRef, Object, Object])
|
|
1186
|
+
Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin)
|
|
1218
1187
|
], ControlHideShowDirective);
|
|
1219
1188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlHideShowDirective, decorators: [{
|
|
1220
1189
|
type: Directive,
|
|
@@ -1222,42 +1191,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1222
1191
|
selector: '[rxapControlHideShow]',
|
|
1223
1192
|
standalone: true,
|
|
1224
1193
|
}]
|
|
1225
|
-
}],
|
|
1226
|
-
type: Inject,
|
|
1227
|
-
args: [Renderer2]
|
|
1228
|
-
}] }, { type: i0.ElementRef, decorators: [{
|
|
1229
|
-
type: Inject,
|
|
1230
|
-
args: [ElementRef]
|
|
1231
|
-
}] }, { type: i1$1.ControlContainer, decorators: [{
|
|
1232
|
-
type: Optional
|
|
1233
|
-
}, {
|
|
1234
|
-
type: Inject,
|
|
1235
|
-
args: [ControlContainer]
|
|
1236
|
-
}] }, { type: i1$1.NgControl, decorators: [{
|
|
1237
|
-
type: Self
|
|
1238
|
-
}, {
|
|
1239
|
-
type: Optional
|
|
1240
|
-
}, {
|
|
1241
|
-
type: Inject,
|
|
1242
|
-
args: [NgControl]
|
|
1243
|
-
}] }], propDecorators: { controlId: [{
|
|
1244
|
-
type: Input,
|
|
1245
|
-
args: ['rxapControlHideShow']
|
|
1246
|
-
}] } });
|
|
1194
|
+
}], propDecorators: { controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapControlHideShow", required: false }] }] } });
|
|
1247
1195
|
|
|
1248
1196
|
let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
1249
|
-
constructor(
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
this.
|
|
1254
|
-
this.
|
|
1255
|
-
this.
|
|
1256
|
-
this.
|
|
1257
|
-
this.
|
|
1258
|
-
this.
|
|
1259
|
-
this.
|
|
1260
|
-
|
|
1197
|
+
constructor() {
|
|
1198
|
+
this.template = inject(TemplateRef);
|
|
1199
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1200
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1201
|
+
this.injector = inject(INJECTOR);
|
|
1202
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1203
|
+
this.ngControl = inject(NgControl, { optional: true }) ?? null;
|
|
1204
|
+
this.matFormField = inject(MAT_FORM_FIELD, { optional: true }) ?? null;
|
|
1205
|
+
this.viewer = input({ id: '[rxapInputSelectOptions]' }, { ...(ngDevMode ? { debugName: "viewer" } : /* istanbul ignore next */ {}), alias: "rxapInputSelectOptionsViewer" });
|
|
1206
|
+
this.metadata = input(undefined, { ...(ngDevMode ? { debugName: "metadata" } : /* istanbul ignore next */ {}), alias: "rxapInputSelectOptionsMetadata" });
|
|
1207
|
+
this.matAutocomplete = input(undefined, { ...(ngDevMode ? { debugName: "matAutocomplete" } : /* istanbul ignore next */ {}), alias: "rxapInputSelectOptionsMatAutocomplete" });
|
|
1208
|
+
/**
|
|
1209
|
+
* The viewer used to connect to the data source. Defaults to the input value, but is
|
|
1210
|
+
* replaced with a viewer bound to the control after the view init.
|
|
1211
|
+
*/
|
|
1212
|
+
this.currentViewer = linkedSignal(() => this.viewer(), ...(ngDevMode ? [{ debugName: "currentViewer" }] : /* istanbul ignore next */ []));
|
|
1261
1213
|
this.subscription = new Subscription();
|
|
1262
1214
|
this.options = null;
|
|
1263
1215
|
/**
|
|
@@ -1270,8 +1222,8 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
1270
1222
|
this.isAutocompleteToDisplayTriggered = false;
|
|
1271
1223
|
}
|
|
1272
1224
|
ngAfterViewInit() {
|
|
1273
|
-
this.extractOptionsDatasource();
|
|
1274
|
-
this.
|
|
1225
|
+
this.extractOptionsDatasource(undefined, this.metadata());
|
|
1226
|
+
this.currentViewer.set({
|
|
1275
1227
|
id: '[rxapInputSelectOptions]' + this.control.controlId,
|
|
1276
1228
|
viewChange: this.settings?.loadOnce ? EMPTY : this.control.value$.pipe(throttleTime(1000), distinctUntilChanged$1((a, b) => equals(a, b)), map(value => {
|
|
1277
1229
|
if (this.settings?.ignoreSelectedValue) {
|
|
@@ -1280,9 +1232,10 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
1280
1232
|
return value;
|
|
1281
1233
|
})),
|
|
1282
1234
|
control: this.control,
|
|
1283
|
-
};
|
|
1284
|
-
|
|
1285
|
-
|
|
1235
|
+
});
|
|
1236
|
+
const matAutocomplete = this.matAutocomplete();
|
|
1237
|
+
if (matAutocomplete) {
|
|
1238
|
+
matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
1286
1239
|
this.settings ??= {};
|
|
1287
1240
|
this.settings.filteredOptions ??= true;
|
|
1288
1241
|
}
|
|
@@ -1299,7 +1252,7 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
1299
1252
|
this.subscription?.unsubscribe();
|
|
1300
1253
|
}
|
|
1301
1254
|
loadOptions(dataSource = this.dataSource) {
|
|
1302
|
-
this.subscription.add(dataSource.connect(this.
|
|
1255
|
+
this.subscription.add(dataSource.connect(this.currentViewer()).pipe(switchMap(options => {
|
|
1303
1256
|
if (this.settings?.filteredOptions) {
|
|
1304
1257
|
return this.control.value$.pipe(map(controlValue => {
|
|
1305
1258
|
if (typeof controlValue === 'string' && controlValue) {
|
|
@@ -1323,7 +1276,7 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
1323
1276
|
}
|
|
1324
1277
|
return of(options);
|
|
1325
1278
|
}), tap(options => this.renderTemplate(this.options = options)), tap(() => {
|
|
1326
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
1279
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
1327
1280
|
this.isAutocompleteToDisplayTriggered = true;
|
|
1328
1281
|
// trigger a change detection after the options are rendered
|
|
1329
1282
|
// this is needed to trigger the mat-autocomplete options to display function
|
|
@@ -1357,16 +1310,11 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
1357
1310
|
}
|
|
1358
1311
|
this.cdr.detectChanges();
|
|
1359
1312
|
}
|
|
1360
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: InputSelectOptionsDirective, deps: [
|
|
1361
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
1313
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: InputSelectOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1314
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: InputSelectOptionsDirective, isStandalone: true, selector: "[rxapInputSelectOptions]", inputs: { viewer: { classPropertyName: "viewer", publicName: "rxapInputSelectOptionsViewer", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "rxapInputSelectOptionsMetadata", isSignal: true, isRequired: false, transformFunction: null }, matAutocomplete: { classPropertyName: "matAutocomplete", publicName: "rxapInputSelectOptionsMatAutocomplete", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1362
1315
|
};
|
|
1363
1316
|
InputSelectOptionsDirective = __decorate([
|
|
1364
|
-
Mixin(ExtractOptionsDataSourceMixin)
|
|
1365
|
-
__metadata("design:paramtypes", [TemplateRef,
|
|
1366
|
-
DataSourceLoader,
|
|
1367
|
-
ViewContainerRef,
|
|
1368
|
-
Injector,
|
|
1369
|
-
ChangeDetectorRef, Object, Object])
|
|
1317
|
+
Mixin(ExtractOptionsDataSourceMixin)
|
|
1370
1318
|
], InputSelectOptionsDirective);
|
|
1371
1319
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: InputSelectOptionsDirective, decorators: [{
|
|
1372
1320
|
type: Directive,
|
|
@@ -1374,62 +1322,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1374
1322
|
selector: '[rxapInputSelectOptions]',
|
|
1375
1323
|
standalone: true,
|
|
1376
1324
|
}]
|
|
1377
|
-
}],
|
|
1378
|
-
type: Inject,
|
|
1379
|
-
args: [TemplateRef]
|
|
1380
|
-
}] }, { type: i1.DataSourceLoader, decorators: [{
|
|
1381
|
-
type: Inject,
|
|
1382
|
-
args: [DataSourceLoader]
|
|
1383
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1384
|
-
type: Inject,
|
|
1385
|
-
args: [ViewContainerRef]
|
|
1386
|
-
}] }, { type: i0.Injector, decorators: [{
|
|
1387
|
-
type: Inject,
|
|
1388
|
-
args: [INJECTOR]
|
|
1389
|
-
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
1390
|
-
type: Inject,
|
|
1391
|
-
args: [ChangeDetectorRef]
|
|
1392
|
-
}] }, { type: i1$1.NgControl, decorators: [{
|
|
1393
|
-
type: Optional
|
|
1394
|
-
}, {
|
|
1395
|
-
type: Inject,
|
|
1396
|
-
args: [NgControl]
|
|
1397
|
-
}] }, { type: i3.MatFormField, decorators: [{
|
|
1398
|
-
type: Optional
|
|
1399
|
-
}, {
|
|
1400
|
-
type: Inject,
|
|
1401
|
-
args: [MAT_FORM_FIELD]
|
|
1402
|
-
}] }], propDecorators: { viewer: [{
|
|
1403
|
-
type: Input,
|
|
1404
|
-
args: ['rxapInputSelectOptionsViewer']
|
|
1405
|
-
}], metadata: [{
|
|
1406
|
-
type: Input,
|
|
1407
|
-
args: ['rxapInputSelectOptionsMetadata']
|
|
1408
|
-
}], matAutocomplete: [{
|
|
1409
|
-
type: Input,
|
|
1410
|
-
args: ['rxapInputSelectOptionsMatAutocomplete']
|
|
1411
|
-
}] } });
|
|
1412
|
-
|
|
1413
|
-
class FormSystemDirectivesModule {
|
|
1414
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1415
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: FormSystemDirectivesModule, imports: [InputSelectOptionsDirective,
|
|
1416
|
-
ControlHideShowDirective], exports: [InputSelectOptionsDirective,
|
|
1417
|
-
ControlHideShowDirective] }); }
|
|
1418
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemDirectivesModule }); }
|
|
1419
|
-
}
|
|
1420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemDirectivesModule, decorators: [{
|
|
1421
|
-
type: NgModule,
|
|
1422
|
-
args: [{
|
|
1423
|
-
exports: [
|
|
1424
|
-
InputSelectOptionsDirective,
|
|
1425
|
-
ControlHideShowDirective,
|
|
1426
|
-
],
|
|
1427
|
-
imports: [
|
|
1428
|
-
InputSelectOptionsDirective,
|
|
1429
|
-
ControlHideShowDirective,
|
|
1430
|
-
],
|
|
1431
|
-
}]
|
|
1432
|
-
}] });
|
|
1325
|
+
}], propDecorators: { viewer: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapInputSelectOptionsViewer", required: false }] }], metadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapInputSelectOptionsMetadata", required: false }] }], matAutocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapInputSelectOptionsMatAutocomplete", required: false }] }] } });
|
|
1433
1326
|
|
|
1434
1327
|
const REMOTE_METHOD_NAME = 'options';
|
|
1435
1328
|
const RXAP_USE_REMOTE_METHOD = 'rxap/form-system/remote-method/use';
|
|
@@ -1456,29 +1349,36 @@ class ExtractRemoteMethodsMixin {
|
|
|
1456
1349
|
}
|
|
1457
1350
|
}
|
|
1458
1351
|
let OptionsFromRemoteMethodDirective = class OptionsFromRemoteMethodDirective {
|
|
1459
|
-
constructor(
|
|
1460
|
-
this.ngControl =
|
|
1461
|
-
this.template =
|
|
1462
|
-
this.remoteMethodLoader =
|
|
1463
|
-
this.viewContainerRef =
|
|
1464
|
-
this.injector =
|
|
1465
|
-
this.cdr =
|
|
1466
|
-
this.
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
if
|
|
1472
|
-
|
|
1352
|
+
constructor() {
|
|
1353
|
+
this.ngControl = inject(NgControl);
|
|
1354
|
+
this.template = inject(TemplateRef);
|
|
1355
|
+
this.remoteMethodLoader = inject(RemoteMethodLoader);
|
|
1356
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1357
|
+
this.injector = inject(INJECTOR);
|
|
1358
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1359
|
+
this.parameters = input(undefined, { ...(ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {}), alias: "rxapOptionsFromRemoteMethodParameters" });
|
|
1360
|
+
this.resetOnChange = input(undefined, { ...(ngDevMode ? { debugName: "resetOnChange" } : /* istanbul ignore next */ {}), alias: "rxapOptionsFromRemoteMethodResetOnChange" });
|
|
1361
|
+
this.withoutParameters = input(false, { ...(ngDevMode ? { debugName: "withoutParameters" } : /* istanbul ignore next */ {}), alias: "rxapOptionsFromRemoteMethodWithoutParameters" });
|
|
1362
|
+
effect(() => {
|
|
1363
|
+
const parameters = this.parameters();
|
|
1364
|
+
// the parameters are only relevant if the input is bound
|
|
1365
|
+
if (parameters === undefined) {
|
|
1366
|
+
return;
|
|
1473
1367
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1368
|
+
untracked(() => {
|
|
1369
|
+
this.remoteMethodToken ??= this.extractRemoteMethodToken();
|
|
1370
|
+
return this.renderTemplate(parameters);
|
|
1371
|
+
});
|
|
1372
|
+
});
|
|
1373
|
+
effect(() => {
|
|
1374
|
+
if (!this.withoutParameters()) {
|
|
1375
|
+
return;
|
|
1479
1376
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1377
|
+
untracked(() => {
|
|
1378
|
+
this.remoteMethodToken ??= this.extractRemoteMethodToken();
|
|
1379
|
+
return this.renderTemplate();
|
|
1380
|
+
});
|
|
1381
|
+
});
|
|
1482
1382
|
}
|
|
1483
1383
|
extractRemoteMethodToken() {
|
|
1484
1384
|
const control = this.ngControl.control;
|
|
@@ -1498,22 +1398,18 @@ let OptionsFromRemoteMethodDirective = class OptionsFromRemoteMethodDirective {
|
|
|
1498
1398
|
for (const option of options) {
|
|
1499
1399
|
this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
|
|
1500
1400
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1401
|
+
const resetOnChange = untracked(this.resetOnChange);
|
|
1402
|
+
if (resetOnChange !== undefined) {
|
|
1403
|
+
this.ngControl.reset(resetOnChange);
|
|
1503
1404
|
}
|
|
1504
1405
|
this.cdr.detectChanges();
|
|
1505
1406
|
}
|
|
1506
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromRemoteMethodDirective, deps: [
|
|
1507
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
1407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromRemoteMethodDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1408
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: OptionsFromRemoteMethodDirective, isStandalone: true, selector: "[rxapOptionsFromRemoteMethod]", inputs: { parameters: { classPropertyName: "parameters", publicName: "rxapOptionsFromRemoteMethodParameters", isSignal: true, isRequired: false, transformFunction: null }, resetOnChange: { classPropertyName: "resetOnChange", publicName: "rxapOptionsFromRemoteMethodResetOnChange", isSignal: true, isRequired: false, transformFunction: null }, withoutParameters: { classPropertyName: "withoutParameters", publicName: "rxapOptionsFromRemoteMethodWithoutParameters", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1508
1409
|
};
|
|
1509
1410
|
OptionsFromRemoteMethodDirective = __decorate([
|
|
1510
1411
|
Mixin(ExtractFormDefinitionMixin, ExtractRemoteMethodsMixin),
|
|
1511
|
-
__metadata("design:paramtypes", [
|
|
1512
|
-
TemplateRef,
|
|
1513
|
-
RemoteMethodLoader,
|
|
1514
|
-
ViewContainerRef,
|
|
1515
|
-
Injector,
|
|
1516
|
-
ChangeDetectorRef])
|
|
1412
|
+
__metadata("design:paramtypes", [])
|
|
1517
1413
|
], OptionsFromRemoteMethodDirective);
|
|
1518
1414
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OptionsFromRemoteMethodDirective, decorators: [{
|
|
1519
1415
|
type: Directive,
|
|
@@ -1521,34 +1417,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1521
1417
|
selector: '[rxapOptionsFromRemoteMethod]',
|
|
1522
1418
|
standalone: true,
|
|
1523
1419
|
}]
|
|
1524
|
-
}], ctorParameters: () => [{ type:
|
|
1525
|
-
type: Inject,
|
|
1526
|
-
args: [NgControl]
|
|
1527
|
-
}] }, { type: i0.TemplateRef, decorators: [{
|
|
1528
|
-
type: Inject,
|
|
1529
|
-
args: [TemplateRef]
|
|
1530
|
-
}] }, { type: i2$1.RemoteMethodLoader, decorators: [{
|
|
1531
|
-
type: Inject,
|
|
1532
|
-
args: [RemoteMethodLoader]
|
|
1533
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1534
|
-
type: Inject,
|
|
1535
|
-
args: [ViewContainerRef]
|
|
1536
|
-
}] }, { type: i0.Injector, decorators: [{
|
|
1537
|
-
type: Inject,
|
|
1538
|
-
args: [INJECTOR]
|
|
1539
|
-
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
1540
|
-
type: Inject,
|
|
1541
|
-
args: [ChangeDetectorRef]
|
|
1542
|
-
}] }], propDecorators: { parameters: [{
|
|
1543
|
-
type: Input,
|
|
1544
|
-
args: ['rxapOptionsFromRemoteMethodParameters']
|
|
1545
|
-
}], resetOnChange: [{
|
|
1546
|
-
type: Input,
|
|
1547
|
-
args: ['rxapOptionsFromRemoteMethodResetOnChange']
|
|
1548
|
-
}], withoutParameters: [{
|
|
1549
|
-
type: Input,
|
|
1550
|
-
args: ['rxapOptionsFromRemoteMethodWithoutParameters']
|
|
1551
|
-
}] } });
|
|
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 }] }] } });
|
|
1552
1421
|
|
|
1553
1422
|
class TestNgControl extends NgControl {
|
|
1554
1423
|
constructor(_control) {
|
|
@@ -1621,12 +1490,16 @@ function FormContextFromActivatedRouteFactory(route) {
|
|
|
1621
1490
|
}
|
|
1622
1491
|
|
|
1623
1492
|
let FormSystemControlDirective = class FormSystemControlDirective {
|
|
1624
|
-
constructor(
|
|
1625
|
-
this.parent =
|
|
1626
|
-
this.
|
|
1627
|
-
this.viewContainerRef =
|
|
1628
|
-
this.dataSourceLoader =
|
|
1629
|
-
this.injector =
|
|
1493
|
+
constructor() {
|
|
1494
|
+
this.parent = inject(ControlContainer);
|
|
1495
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
1496
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1497
|
+
this.dataSourceLoader = inject(DataSourceLoader);
|
|
1498
|
+
this.injector = inject(INJECTOR);
|
|
1499
|
+
/**
|
|
1500
|
+
* Defines the form control id
|
|
1501
|
+
*/
|
|
1502
|
+
this.controlId = input.required(...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
1630
1503
|
}
|
|
1631
1504
|
ngOnInit() {
|
|
1632
1505
|
this.control = this.extractControl();
|
|
@@ -1654,7 +1527,7 @@ let FormSystemControlDirective = class FormSystemControlDirective {
|
|
|
1654
1527
|
if (!component.setDataSource) {
|
|
1655
1528
|
throw new RxapFormSystemError('The ControlWithDataSource interface is not implemented for the control component, but the control has defined data sources', '');
|
|
1656
1529
|
}
|
|
1657
|
-
const useDataSourceValueMap = this.extractDataSources(formDefinition, this.controlId);
|
|
1530
|
+
const useDataSourceValueMap = this.extractDataSources(formDefinition, this.controlId());
|
|
1658
1531
|
for (const [name, useDataSourceValue] of useDataSourceValueMap.entries()) {
|
|
1659
1532
|
let dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource);
|
|
1660
1533
|
const settings = useDataSourceValue.settings;
|
|
@@ -1672,14 +1545,16 @@ let FormSystemControlDirective = class FormSystemControlDirective {
|
|
|
1672
1545
|
}
|
|
1673
1546
|
createComponent(formDefinition) {
|
|
1674
1547
|
const component = this.extractComponent(formDefinition);
|
|
1675
|
-
|
|
1676
|
-
|
|
1548
|
+
return createComponent(component, {
|
|
1549
|
+
environmentInjector: this.environmentInjector,
|
|
1550
|
+
elementInjector: this.injector,
|
|
1551
|
+
});
|
|
1677
1552
|
}
|
|
1678
1553
|
extractControl() {
|
|
1679
1554
|
if (!this.parent.control) {
|
|
1680
1555
|
throw new RxapFormSystemError('The control property of ControlContainer is not defined', '');
|
|
1681
1556
|
}
|
|
1682
|
-
const control = this.parent.control.get(this.controlId);
|
|
1557
|
+
const control = this.parent.control.get(this.controlId());
|
|
1683
1558
|
if (!control) {
|
|
1684
1559
|
throw new RxapFormSystemError('Could not find the control instance', '');
|
|
1685
1560
|
}
|
|
@@ -1700,31 +1575,28 @@ let FormSystemControlDirective = class FormSystemControlDirective {
|
|
|
1700
1575
|
if (!map) {
|
|
1701
1576
|
throw new RxapFormSystemError('Could not extract the use component map from the form definition instance', '');
|
|
1702
1577
|
}
|
|
1703
|
-
|
|
1578
|
+
const controlId = this.controlId();
|
|
1579
|
+
if (!map.has(controlId)) {
|
|
1704
1580
|
throw new RxapFormSystemError('A use component definition does not exists in the form definition metadata', '');
|
|
1705
1581
|
}
|
|
1706
|
-
return map.get(
|
|
1582
|
+
return map.get(controlId);
|
|
1707
1583
|
}
|
|
1708
1584
|
extractComponentProperties(formDefinition) {
|
|
1709
1585
|
const map = getMetadata(FormSystemMetadataKeys.COMPONENTS_PROPERTIES, Object.getPrototypeOf(formDefinition));
|
|
1710
1586
|
if (!map) {
|
|
1711
1587
|
throw new RxapFormSystemError('Could not extract the use component properties map from the form definition instance', '');
|
|
1712
1588
|
}
|
|
1713
|
-
|
|
1589
|
+
const controlId = this.controlId();
|
|
1590
|
+
if (!map.has(controlId)) {
|
|
1714
1591
|
throw new RxapFormSystemError('A use component definition does not exists in the form definition metadata', '');
|
|
1715
1592
|
}
|
|
1716
|
-
return map.get(
|
|
1593
|
+
return map.get(controlId);
|
|
1717
1594
|
}
|
|
1718
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemControlDirective, deps: [
|
|
1719
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
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 }); }
|
|
1720
1597
|
};
|
|
1721
1598
|
FormSystemControlDirective = __decorate([
|
|
1722
|
-
Mixin(ExtractDataSourcesMixin)
|
|
1723
|
-
__metadata("design:paramtypes", [ControlContainer,
|
|
1724
|
-
ComponentFactoryResolver,
|
|
1725
|
-
ViewContainerRef,
|
|
1726
|
-
DataSourceLoader,
|
|
1727
|
-
Injector])
|
|
1599
|
+
Mixin(ExtractDataSourcesMixin)
|
|
1728
1600
|
], FormSystemControlDirective);
|
|
1729
1601
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormSystemControlDirective, decorators: [{
|
|
1730
1602
|
type: Directive,
|
|
@@ -1732,25 +1604,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1732
1604
|
selector: '[rxapFormSystemControl]',
|
|
1733
1605
|
standalone: true,
|
|
1734
1606
|
}]
|
|
1735
|
-
}],
|
|
1736
|
-
type: Inject,
|
|
1737
|
-
args: [ControlContainer]
|
|
1738
|
-
}] }, { type: i0.ComponentFactoryResolver, decorators: [{
|
|
1739
|
-
type: Inject,
|
|
1740
|
-
args: [ComponentFactoryResolver]
|
|
1741
|
-
}] }, { type: i0.ViewContainerRef, decorators: [{
|
|
1742
|
-
type: Inject,
|
|
1743
|
-
args: [ViewContainerRef]
|
|
1744
|
-
}] }, { type: i1.DataSourceLoader, decorators: [{
|
|
1745
|
-
type: Inject,
|
|
1746
|
-
args: [DataSourceLoader]
|
|
1747
|
-
}] }, { type: i0.Injector, decorators: [{
|
|
1748
|
-
type: Inject,
|
|
1749
|
-
args: [INJECTOR]
|
|
1750
|
-
}] }], propDecorators: { controlId: [{
|
|
1751
|
-
type: Input,
|
|
1752
|
-
args: [{ required: true }]
|
|
1753
|
-
}] } });
|
|
1607
|
+
}], propDecorators: { controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: true }] }] } });
|
|
1754
1608
|
|
|
1755
1609
|
const SUBMIT_CONTEXT_FORM_ADAPTER_METHOD = new InjectionToken('submit-context-form-adapter-method');
|
|
1756
1610
|
class SubmitContextFormAdapter extends ProxyRemoteMethod {
|
|
@@ -1787,5 +1641,5 @@ function SubmitContextFormAdapterFactory(remoteMethod, context) {
|
|
|
1787
1641
|
* Generated bundle index. Do not edit.
|
|
1788
1642
|
*/
|
|
1789
1643
|
|
|
1790
|
-
export { 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,
|
|
1644
|
+
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 };
|
|
1791
1645
|
//# sourceMappingURL=rxap-form-system.mjs.map
|