@rxap/form-system 21.0.1-dev.0 → 21.0.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 +40 -0
- package/compodoc/changelog.html +38 -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
|
@@ -182,8 +182,8 @@
|
|
|
182
182
|
|
|
183
183
|
<tr>
|
|
184
184
|
<td class="col-md-4">
|
|
185
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
186
|
-
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:
|
|
185
|
+
<div class="io-line">Defined in <a href="" data-line="117"
|
|
186
|
+
class="link-to-prism">src/lib/directives/autocomplete-options-from-method.directive.ts:117</a></div>
|
|
187
187
|
</td>
|
|
188
188
|
</tr>
|
|
189
189
|
|
|
@@ -284,10 +284,12 @@ export class GetCompanyMethod implements Method<ControlOption, { parameters:
|
|
|
284
284
|
Injectable,
|
|
285
285
|
Injector,
|
|
286
286
|
INJECTOR,
|
|
287
|
-
|
|
287
|
+
input,
|
|
288
288
|
isDevMode,
|
|
289
|
+
linkedSignal,
|
|
289
290
|
OnDestroy,
|
|
290
291
|
ProviderToken,
|
|
292
|
+
untracked,
|
|
291
293
|
} from '@angular/core';
|
|
292
294
|
import { NgControl } from '@angular/forms';
|
|
293
295
|
import { MatAutocomplete } from '@angular/material/autocomplete';
|
|
@@ -326,9 +328,10 @@ import {
|
|
|
326
328
|
UseToDisplayFunction,
|
|
327
329
|
} from '../mixins/extract-to-display-function.mixin';
|
|
328
330
|
import {
|
|
329
|
-
|
|
331
|
+
AbstractOptionsFromMethodDirective,
|
|
330
332
|
OptionsFromMethodDirectiveSettings,
|
|
331
333
|
} from './options-from-method.directive';
|
|
334
|
+
import { OptionsMethod } from '../mixins/extract-options-method.mixin';
|
|
332
335
|
|
|
333
336
|
export function UseAutocompleteOptionsMethod(
|
|
334
337
|
method: ProviderToken<MethodWithParameters<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>>,
|
|
@@ -403,34 +406,31 @@ export class NoopResolveMethod<Value> implements Method<ControlOption,
|
|
|
403
406
|
standalone: true,
|
|
404
407
|
})
|
|
405
408
|
export class AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>>
|
|
406
|
-
extends
|
|
409
|
+
extends AbstractOptionsFromMethodDirective<Value, Parameters>
|
|
407
410
|
implements AfterViewInit, OnDestroy {
|
|
408
411
|
|
|
409
412
|
static override ngTemplateContextGuard(
|
|
410
|
-
dir:
|
|
413
|
+
dir: AbstractOptionsFromMethodDirective,
|
|
411
414
|
ctx: any,
|
|
412
415
|
): ctx is AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
413
416
|
return true;
|
|
414
417
|
}
|
|
415
418
|
|
|
416
|
-
|
|
417
|
-
public
|
|
418
|
-
|
|
419
|
-
public declare resetOnChange?: Value;
|
|
420
|
-
@Input('rxapAutocompleteOptionsFromMethodMatAutocomplete')
|
|
421
|
-
public matAutocomplete?: MatAutocomplete;
|
|
419
|
+
public readonly parameters = input<Parameters | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodParameters' });
|
|
420
|
+
public readonly resetOnChange = input<Value | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResetOnChange' });
|
|
421
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodMatAutocomplete' });
|
|
422
422
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
423
|
-
|
|
424
|
-
public declare method: Method<ControlOptions, Parameters>;
|
|
423
|
+
public readonly method = input<OptionsMethod<ControlOptions<Value>, Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodCall' });
|
|
425
424
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
426
|
-
|
|
427
|
-
public resolveMethod?: MethodWithParameters<ControlOption, { value: Value } & Parameters>;
|
|
425
|
+
public readonly resolveMethod = input<MethodWithParameters<ControlOption, { value: Value } & Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResolve' });
|
|
428
426
|
|
|
429
|
-
|
|
430
|
-
public isValue?: (value: any) => boolean;
|
|
427
|
+
public readonly isValue = input<((value: any) => boolean) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodIsValue' });
|
|
431
428
|
|
|
432
|
-
|
|
433
|
-
|
|
429
|
+
public readonly toDisplay = input<((value: any) => string) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodToDisplay' });
|
|
430
|
+
|
|
431
|
+
protected readonly resolvedResolveMethod = linkedSignal(() => this.resolveMethod());
|
|
432
|
+
protected readonly resolvedIsValue = linkedSignal(() => this.isValue());
|
|
433
|
+
protected readonly resolvedToDisplay = linkedSignal(() => this.toDisplay());
|
|
434
434
|
|
|
435
435
|
protected override ngControl: NgControl | null = null;
|
|
436
436
|
protected override matFormField: MatFormField | null = null;
|
|
@@ -452,23 +452,30 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
452
452
|
this._subscription?.unsubscribe();
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
public override
|
|
456
|
-
|
|
455
|
+
public override ngAfterViewInit() {
|
|
456
|
+
const matAutocomplete = this.matAutocomplete();
|
|
457
|
+
if (matAutocomplete) {
|
|
457
458
|
this.settings ??= {};
|
|
458
459
|
this.settings.filteredOptions ??= true;
|
|
459
460
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
461
|
+
super.ngAfterViewInit();
|
|
462
|
+
if (!this.resolvedResolveMethod()) {
|
|
463
|
+
this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
464
|
+
}
|
|
465
|
+
if (!this.resolvedIsValue()) {
|
|
466
|
+
this.resolvedIsValue.set(this.extractIsValueFunction((value: any) => typeof value === 'string' && isUUID(value)));
|
|
467
|
+
}
|
|
468
|
+
if (!this.resolvedToDisplay()) {
|
|
469
|
+
this.resolvedToDisplay.set(this.extractToDisplayFunction((value: any): string => {
|
|
470
|
+
if (!value) {
|
|
471
|
+
return '';
|
|
472
|
+
}
|
|
473
|
+
const option = this.findOptionByValue(value);
|
|
474
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
475
|
+
}));
|
|
476
|
+
}
|
|
477
|
+
if (matAutocomplete) {
|
|
478
|
+
matAutocomplete.displayWith = this.resolvedToDisplay()!.bind(this);
|
|
472
479
|
}
|
|
473
480
|
if (!this.control) {
|
|
474
481
|
throw new Error('The control is not yet defined');
|
|
@@ -481,8 +488,8 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
481
488
|
// to trigger the toDisplay function in the mat-autocomplete
|
|
482
489
|
distinctUntilChanged(),
|
|
483
490
|
tap(async value => {
|
|
484
|
-
await this.load(this.parameters);
|
|
485
|
-
if (this.
|
|
491
|
+
await this.load(untracked(this.parameters));
|
|
492
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
486
493
|
this.triggerAutocompleteToDisplay();
|
|
487
494
|
}
|
|
488
495
|
}),
|
|
@@ -495,7 +502,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
495
502
|
}
|
|
496
503
|
const value = this.control?.value;
|
|
497
504
|
const c_parameters = {...parameters};
|
|
498
|
-
if (this.
|
|
505
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
499
506
|
return this.resolveValue(value, c_parameters);
|
|
500
507
|
} else {
|
|
501
508
|
c_parameters.search ??= value;
|
|
@@ -508,14 +515,15 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
508
515
|
|
|
509
516
|
protected override renderTemplate() {
|
|
510
517
|
super.renderTemplate();
|
|
511
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
518
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
512
519
|
this.isAutocompleteToDisplayTriggered = true;
|
|
513
520
|
this.triggerAutocompleteToDisplay();
|
|
514
521
|
}
|
|
515
522
|
}
|
|
516
523
|
|
|
517
524
|
protected async resolveValue(value: Value, parameters: Parameters = {} as Parameters) {
|
|
518
|
-
|
|
525
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
526
|
+
if (!resolveMethod) {
|
|
519
527
|
if (isDevMode()) {
|
|
520
528
|
console.warn('The resolve method is not yet defined');
|
|
521
529
|
}
|
|
@@ -523,7 +531,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
523
531
|
}
|
|
524
532
|
// only resolve the value if the option is not already loaded
|
|
525
533
|
if (!this.findOptionByValue(value)) {
|
|
526
|
-
const option = await
|
|
534
|
+
const option = await resolveMethod!.call({...parameters, value});
|
|
527
535
|
if (option.value !== value) {
|
|
528
536
|
throw new Error('The resolved value is not the same as the input value');
|
|
529
537
|
}
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
</tr>
|
|
169
169
|
<tr>
|
|
170
170
|
<td class="col-md-4">
|
|
171
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
171
|
+
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/lib/submit-context-form-adapter.factory.ts:13</a></div>
|
|
172
172
|
</td>
|
|
173
173
|
</tr>
|
|
174
174
|
|
|
@@ -245,8 +245,8 @@
|
|
|
245
245
|
|
|
246
246
|
<tr>
|
|
247
247
|
<td class="col-md-4">
|
|
248
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
249
|
-
class="link-to-prism">src/lib/submit-context-form-adapter.factory.ts:
|
|
248
|
+
<div class="io-line">Defined in <a href="" data-line="23"
|
|
249
|
+
class="link-to-prism">src/lib/submit-context-form-adapter.factory.ts:23</a></div>
|
|
250
250
|
</td>
|
|
251
251
|
</tr>
|
|
252
252
|
|
|
@@ -298,11 +298,7 @@
|
|
|
298
298
|
|
|
299
299
|
|
|
300
300
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
301
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
302
|
-
Inject,
|
|
303
|
-
Injectable,
|
|
304
|
-
InjectionToken,
|
|
305
|
-
} from '@angular/core';
|
|
301
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Inject, Injectable, InjectionToken } from '@angular/core';
|
|
306
302
|
import { RXAP_FORM_CONTEXT } from '@rxap/forms';
|
|
307
303
|
import type {
|
|
308
304
|
OpenApiRemoteMethod,
|
|
@@ -315,7 +311,6 @@ export const SUBMIT_CONTEXT_FORM_ADAPTER_METHOD = new InjectionToken('
|
|
|
315
311
|
@Injectable()
|
|
316
312
|
export class SubmitContextFormAdapter
|
|
317
313
|
extends ProxyRemoteMethod<unknown, Record<string, unknown>, OpenApiRemoteMethodParameter<Record<string, unknown>>> {
|
|
318
|
-
|
|
319
314
|
constructor(
|
|
320
315
|
@Inject(SUBMIT_CONTEXT_FORM_ADAPTER_METHOD)
|
|
321
316
|
remoteMethod: OpenApiRemoteMethod<unknown, OpenApiRemoteMethodParameter<Record<string, unknown>>, Record<string, unknown>>,
|
|
@@ -257,10 +257,12 @@ export class GetCompanyMethod implements Method<ControlOption, { parameters:
|
|
|
257
257
|
Injectable,
|
|
258
258
|
Injector,
|
|
259
259
|
INJECTOR,
|
|
260
|
-
|
|
260
|
+
input,
|
|
261
261
|
isDevMode,
|
|
262
|
+
linkedSignal,
|
|
262
263
|
OnDestroy,
|
|
263
264
|
ProviderToken,
|
|
265
|
+
untracked,
|
|
264
266
|
} from '@angular/core';
|
|
265
267
|
import { NgControl } from '@angular/forms';
|
|
266
268
|
import { MatAutocomplete } from '@angular/material/autocomplete';
|
|
@@ -299,9 +301,10 @@ import {
|
|
|
299
301
|
UseToDisplayFunction,
|
|
300
302
|
} from '../mixins/extract-to-display-function.mixin';
|
|
301
303
|
import {
|
|
302
|
-
|
|
304
|
+
AbstractOptionsFromMethodDirective,
|
|
303
305
|
OptionsFromMethodDirectiveSettings,
|
|
304
306
|
} from './options-from-method.directive';
|
|
307
|
+
import { OptionsMethod } from '../mixins/extract-options-method.mixin';
|
|
305
308
|
|
|
306
309
|
export function UseAutocompleteOptionsMethod(
|
|
307
310
|
method: ProviderToken<MethodWithParameters<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>>,
|
|
@@ -376,34 +379,31 @@ export class NoopResolveMethod<Value> implements Method<ControlOption,
|
|
|
376
379
|
standalone: true,
|
|
377
380
|
})
|
|
378
381
|
export class AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>>
|
|
379
|
-
extends
|
|
382
|
+
extends AbstractOptionsFromMethodDirective<Value, Parameters>
|
|
380
383
|
implements AfterViewInit, OnDestroy {
|
|
381
384
|
|
|
382
385
|
static override ngTemplateContextGuard(
|
|
383
|
-
dir:
|
|
386
|
+
dir: AbstractOptionsFromMethodDirective,
|
|
384
387
|
ctx: any,
|
|
385
388
|
): ctx is AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
386
389
|
return true;
|
|
387
390
|
}
|
|
388
391
|
|
|
389
|
-
|
|
390
|
-
public
|
|
391
|
-
|
|
392
|
-
public declare resetOnChange?: Value;
|
|
393
|
-
@Input('rxapAutocompleteOptionsFromMethodMatAutocomplete')
|
|
394
|
-
public matAutocomplete?: MatAutocomplete;
|
|
392
|
+
public readonly parameters = input<Parameters | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodParameters' });
|
|
393
|
+
public readonly resetOnChange = input<Value | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResetOnChange' });
|
|
394
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodMatAutocomplete' });
|
|
395
395
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
396
|
-
|
|
397
|
-
public declare method: Method<ControlOptions, Parameters>;
|
|
396
|
+
public readonly method = input<OptionsMethod<ControlOptions<Value>, Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodCall' });
|
|
398
397
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
399
|
-
|
|
400
|
-
public resolveMethod?: MethodWithParameters<ControlOption, { value: Value } & Parameters>;
|
|
398
|
+
public readonly resolveMethod = input<MethodWithParameters<ControlOption, { value: Value } & Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResolve' });
|
|
401
399
|
|
|
402
|
-
|
|
403
|
-
public isValue?: (value: any) => boolean;
|
|
400
|
+
public readonly isValue = input<((value: any) => boolean) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodIsValue' });
|
|
404
401
|
|
|
405
|
-
|
|
406
|
-
|
|
402
|
+
public readonly toDisplay = input<((value: any) => string) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodToDisplay' });
|
|
403
|
+
|
|
404
|
+
protected readonly resolvedResolveMethod = linkedSignal(() => this.resolveMethod());
|
|
405
|
+
protected readonly resolvedIsValue = linkedSignal(() => this.isValue());
|
|
406
|
+
protected readonly resolvedToDisplay = linkedSignal(() => this.toDisplay());
|
|
407
407
|
|
|
408
408
|
protected override ngControl: NgControl | null = null;
|
|
409
409
|
protected override matFormField: MatFormField | null = null;
|
|
@@ -425,23 +425,30 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
425
425
|
this._subscription?.unsubscribe();
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
public override
|
|
429
|
-
|
|
428
|
+
public override ngAfterViewInit() {
|
|
429
|
+
const matAutocomplete = this.matAutocomplete();
|
|
430
|
+
if (matAutocomplete) {
|
|
430
431
|
this.settings ??= {};
|
|
431
432
|
this.settings.filteredOptions ??= true;
|
|
432
433
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
434
|
+
super.ngAfterViewInit();
|
|
435
|
+
if (!this.resolvedResolveMethod()) {
|
|
436
|
+
this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
437
|
+
}
|
|
438
|
+
if (!this.resolvedIsValue()) {
|
|
439
|
+
this.resolvedIsValue.set(this.extractIsValueFunction((value: any) => typeof value === 'string' && isUUID(value)));
|
|
440
|
+
}
|
|
441
|
+
if (!this.resolvedToDisplay()) {
|
|
442
|
+
this.resolvedToDisplay.set(this.extractToDisplayFunction((value: any): string => {
|
|
443
|
+
if (!value) {
|
|
444
|
+
return '';
|
|
445
|
+
}
|
|
446
|
+
const option = this.findOptionByValue(value);
|
|
447
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
if (matAutocomplete) {
|
|
451
|
+
matAutocomplete.displayWith = this.resolvedToDisplay()!.bind(this);
|
|
445
452
|
}
|
|
446
453
|
if (!this.control) {
|
|
447
454
|
throw new Error('The control is not yet defined');
|
|
@@ -454,8 +461,8 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
454
461
|
// to trigger the toDisplay function in the mat-autocomplete
|
|
455
462
|
distinctUntilChanged(),
|
|
456
463
|
tap(async value => {
|
|
457
|
-
await this.load(this.parameters);
|
|
458
|
-
if (this.
|
|
464
|
+
await this.load(untracked(this.parameters));
|
|
465
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
459
466
|
this.triggerAutocompleteToDisplay();
|
|
460
467
|
}
|
|
461
468
|
}),
|
|
@@ -468,7 +475,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
468
475
|
}
|
|
469
476
|
const value = this.control?.value;
|
|
470
477
|
const c_parameters = {...parameters};
|
|
471
|
-
if (this.
|
|
478
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
472
479
|
return this.resolveValue(value, c_parameters);
|
|
473
480
|
} else {
|
|
474
481
|
c_parameters.search ??= value;
|
|
@@ -481,14 +488,15 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
481
488
|
|
|
482
489
|
protected override renderTemplate() {
|
|
483
490
|
super.renderTemplate();
|
|
484
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
491
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
485
492
|
this.isAutocompleteToDisplayTriggered = true;
|
|
486
493
|
this.triggerAutocompleteToDisplay();
|
|
487
494
|
}
|
|
488
495
|
}
|
|
489
496
|
|
|
490
497
|
protected async resolveValue(value: Value, parameters: Parameters = {} as Parameters) {
|
|
491
|
-
|
|
498
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
499
|
+
if (!resolveMethod) {
|
|
492
500
|
if (isDevMode()) {
|
|
493
501
|
console.warn('The resolve method is not yet defined');
|
|
494
502
|
}
|
|
@@ -496,7 +504,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
496
504
|
}
|
|
497
505
|
// only resolve the value if the option is not already loaded
|
|
498
506
|
if (!this.findOptionByValue(value)) {
|
|
499
|
-
const option = await
|
|
507
|
+
const option = await resolveMethod!.call({...parameters, value});
|
|
500
508
|
if (option.value !== value) {
|
|
501
509
|
throw new Error('The resolved value is not the same as the input value');
|
|
502
510
|
}
|
|
@@ -263,10 +263,12 @@ export class GetCompanyMethod implements Method<ControlOption, { parameters:
|
|
|
263
263
|
Injectable,
|
|
264
264
|
Injector,
|
|
265
265
|
INJECTOR,
|
|
266
|
-
|
|
266
|
+
input,
|
|
267
267
|
isDevMode,
|
|
268
|
+
linkedSignal,
|
|
268
269
|
OnDestroy,
|
|
269
270
|
ProviderToken,
|
|
271
|
+
untracked,
|
|
270
272
|
} from '@angular/core';
|
|
271
273
|
import { NgControl } from '@angular/forms';
|
|
272
274
|
import { MatAutocomplete } from '@angular/material/autocomplete';
|
|
@@ -305,9 +307,10 @@ import {
|
|
|
305
307
|
UseToDisplayFunction,
|
|
306
308
|
} from '../mixins/extract-to-display-function.mixin';
|
|
307
309
|
import {
|
|
308
|
-
|
|
310
|
+
AbstractOptionsFromMethodDirective,
|
|
309
311
|
OptionsFromMethodDirectiveSettings,
|
|
310
312
|
} from './options-from-method.directive';
|
|
313
|
+
import { OptionsMethod } from '../mixins/extract-options-method.mixin';
|
|
311
314
|
|
|
312
315
|
export function UseAutocompleteOptionsMethod(
|
|
313
316
|
method: ProviderToken<MethodWithParameters<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>>,
|
|
@@ -382,34 +385,31 @@ export class NoopResolveMethod<Value> implements Method<ControlOption,
|
|
|
382
385
|
standalone: true,
|
|
383
386
|
})
|
|
384
387
|
export class AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>>
|
|
385
|
-
extends
|
|
388
|
+
extends AbstractOptionsFromMethodDirective<Value, Parameters>
|
|
386
389
|
implements AfterViewInit, OnDestroy {
|
|
387
390
|
|
|
388
391
|
static override ngTemplateContextGuard(
|
|
389
|
-
dir:
|
|
392
|
+
dir: AbstractOptionsFromMethodDirective,
|
|
390
393
|
ctx: any,
|
|
391
394
|
): ctx is AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
392
395
|
return true;
|
|
393
396
|
}
|
|
394
397
|
|
|
395
|
-
|
|
396
|
-
public
|
|
397
|
-
|
|
398
|
-
public declare resetOnChange?: Value;
|
|
399
|
-
@Input('rxapAutocompleteOptionsFromMethodMatAutocomplete')
|
|
400
|
-
public matAutocomplete?: MatAutocomplete;
|
|
398
|
+
public readonly parameters = input<Parameters | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodParameters' });
|
|
399
|
+
public readonly resetOnChange = input<Value | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResetOnChange' });
|
|
400
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodMatAutocomplete' });
|
|
401
401
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
402
|
-
|
|
403
|
-
public declare method: Method<ControlOptions, Parameters>;
|
|
402
|
+
public readonly method = input<OptionsMethod<ControlOptions<Value>, Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodCall' });
|
|
404
403
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
405
|
-
|
|
406
|
-
public resolveMethod?: MethodWithParameters<ControlOption, { value: Value } & Parameters>;
|
|
404
|
+
public readonly resolveMethod = input<MethodWithParameters<ControlOption, { value: Value } & Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResolve' });
|
|
407
405
|
|
|
408
|
-
|
|
409
|
-
public isValue?: (value: any) => boolean;
|
|
406
|
+
public readonly isValue = input<((value: any) => boolean) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodIsValue' });
|
|
410
407
|
|
|
411
|
-
|
|
412
|
-
|
|
408
|
+
public readonly toDisplay = input<((value: any) => string) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodToDisplay' });
|
|
409
|
+
|
|
410
|
+
protected readonly resolvedResolveMethod = linkedSignal(() => this.resolveMethod());
|
|
411
|
+
protected readonly resolvedIsValue = linkedSignal(() => this.isValue());
|
|
412
|
+
protected readonly resolvedToDisplay = linkedSignal(() => this.toDisplay());
|
|
413
413
|
|
|
414
414
|
protected override ngControl: NgControl | null = null;
|
|
415
415
|
protected override matFormField: MatFormField | null = null;
|
|
@@ -431,23 +431,30 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
431
431
|
this._subscription?.unsubscribe();
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
public override
|
|
435
|
-
|
|
434
|
+
public override ngAfterViewInit() {
|
|
435
|
+
const matAutocomplete = this.matAutocomplete();
|
|
436
|
+
if (matAutocomplete) {
|
|
436
437
|
this.settings ??= {};
|
|
437
438
|
this.settings.filteredOptions ??= true;
|
|
438
439
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
440
|
+
super.ngAfterViewInit();
|
|
441
|
+
if (!this.resolvedResolveMethod()) {
|
|
442
|
+
this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
443
|
+
}
|
|
444
|
+
if (!this.resolvedIsValue()) {
|
|
445
|
+
this.resolvedIsValue.set(this.extractIsValueFunction((value: any) => typeof value === 'string' && isUUID(value)));
|
|
446
|
+
}
|
|
447
|
+
if (!this.resolvedToDisplay()) {
|
|
448
|
+
this.resolvedToDisplay.set(this.extractToDisplayFunction((value: any): string => {
|
|
449
|
+
if (!value) {
|
|
450
|
+
return '';
|
|
451
|
+
}
|
|
452
|
+
const option = this.findOptionByValue(value);
|
|
453
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
454
|
+
}));
|
|
455
|
+
}
|
|
456
|
+
if (matAutocomplete) {
|
|
457
|
+
matAutocomplete.displayWith = this.resolvedToDisplay()!.bind(this);
|
|
451
458
|
}
|
|
452
459
|
if (!this.control) {
|
|
453
460
|
throw new Error('The control is not yet defined');
|
|
@@ -460,8 +467,8 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
460
467
|
// to trigger the toDisplay function in the mat-autocomplete
|
|
461
468
|
distinctUntilChanged(),
|
|
462
469
|
tap(async value => {
|
|
463
|
-
await this.load(this.parameters);
|
|
464
|
-
if (this.
|
|
470
|
+
await this.load(untracked(this.parameters));
|
|
471
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
465
472
|
this.triggerAutocompleteToDisplay();
|
|
466
473
|
}
|
|
467
474
|
}),
|
|
@@ -474,7 +481,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
474
481
|
}
|
|
475
482
|
const value = this.control?.value;
|
|
476
483
|
const c_parameters = {...parameters};
|
|
477
|
-
if (this.
|
|
484
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
478
485
|
return this.resolveValue(value, c_parameters);
|
|
479
486
|
} else {
|
|
480
487
|
c_parameters.search ??= value;
|
|
@@ -487,14 +494,15 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
487
494
|
|
|
488
495
|
protected override renderTemplate() {
|
|
489
496
|
super.renderTemplate();
|
|
490
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
497
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
491
498
|
this.isAutocompleteToDisplayTriggered = true;
|
|
492
499
|
this.triggerAutocompleteToDisplay();
|
|
493
500
|
}
|
|
494
501
|
}
|
|
495
502
|
|
|
496
503
|
protected async resolveValue(value: Value, parameters: Parameters = {} as Parameters) {
|
|
497
|
-
|
|
504
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
505
|
+
if (!resolveMethod) {
|
|
498
506
|
if (isDevMode()) {
|
|
499
507
|
console.warn('The resolve method is not yet defined');
|
|
500
508
|
}
|
|
@@ -502,7 +510,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
502
510
|
}
|
|
503
511
|
// only resolve the value if the option is not already loaded
|
|
504
512
|
if (!this.findOptionByValue(value)) {
|
|
505
|
-
const option = await
|
|
513
|
+
const option = await resolveMethod!.call({...parameters, value});
|
|
506
514
|
if (option.value !== value) {
|
|
507
515
|
throw new Error('The resolved value is not the same as the input value');
|
|
508
516
|
}
|