@rxap/form-system 19.2.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 +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 +17 -17
- 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 +9603 -7779
- 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 +6 -5
- package/docs/html/classes/SubmitContextFormAdapter.html +10 -10
- package/docs/html/classes/TestNgControl.html +26 -26
- 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 -124
- 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 +20 -32
- 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 +14 -38
- package/docs/markdown/classes/InputSelectOptionsDirective.md +51 -76
- package/docs/markdown/classes/IsEqualToDirective.md +9 -19
- package/docs/markdown/classes/IsSelectableValueDirective.md +24 -48
- package/docs/markdown/classes/NoopResolveMethod.md +3 -3
- package/docs/markdown/classes/OptionsFromMethodDirective.md +140 -87
- package/docs/markdown/classes/OptionsFromRemoteMethodDirective.md +15 -70
- package/docs/markdown/classes/RxapFormSystemError.md +25 -13
- package/docs/markdown/classes/SubmitContextFormAdapter.md +32 -32
- package/docs/markdown/classes/TestNgControl.md +29 -29
- 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 -123
- 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 +19 -31
- 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 +13 -37
- package/docs/wiki/Class.InputSelectOptionsDirective.md +50 -75
- package/docs/wiki/Class.IsEqualToDirective.md +8 -18
- package/docs/wiki/Class.IsSelectableValueDirective.md +23 -47
- package/docs/wiki/Class.NoopResolveMethod.md +2 -2
- package/docs/wiki/Class.OptionsFromMethodDirective.md +139 -86
- package/docs/wiki/Class.OptionsFromRemoteMethodDirective.md +14 -69
- package/docs/wiki/Class.RxapFormSystemError.md +24 -12
- package/docs/wiki/Class.SubmitContextFormAdapter.md +31 -31
- package/docs/wiki/Class.TestNgControl.md +28 -28
- 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 +304 -450
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/package.json +49 -44
- package/types/rxap-form-system.d.ts +628 -0
- package/docs/html/classes/FormSystemDirectivesModule.html +0 -2
- package/docs/markdown/classes/FormSystemDirectivesModule.md +0 -19
- package/docs/wiki/Class.FormSystemDirectivesModule.md +0 -15
- package/index.d.ts +0 -41
- package/lib/control-data-source.d.ts +0 -13
- package/lib/control-with-data-source.d.ts +0 -5
- package/lib/decorators/metadata-keys.d.ts +0 -6
- package/lib/decorators/use-component.d.ts +0 -3
- package/lib/decorators/use-data-source.d.ts +0 -14
- package/lib/decorators/use-form-component.d.ts +0 -7
- package/lib/directives/array/for-form-array-items.directive.d.ts +0 -26
- package/lib/directives/array/form-array-add-item-button.directive.d.ts +0 -20
- package/lib/directives/array/form-array-item-button.d.ts +0 -30
- package/lib/directives/array/form-array-item-remove-button.directive.d.ts +0 -16
- package/lib/directives/array/form-array-item-restore-button.directive.d.ts +0 -9
- package/lib/directives/array/form-array-removable.directive.d.ts +0 -19
- package/lib/directives/autocomplete-options-from-method.directive.d.ts +0 -76
- package/lib/directives/control-hide-show.directive.d.ts +0 -40
- package/lib/directives/form-directives.module.d.ts +0 -8
- package/lib/directives/input-select-options.directive.d.ts +0 -74
- package/lib/directives/options-from-method.directive.d.ts +0 -39
- package/lib/directives/options-from-remote-method.directive.d.ts +0 -38
- package/lib/directives/test-ng-control.d.ts +0 -7
- package/lib/error.d.ts +0 -4
- package/lib/form-context-from-activated-route.factory.d.ts +0 -2
- package/lib/form-system-control.directive.d.ts +0 -37
- package/lib/mixins/adapters.d.ts +0 -9
- package/lib/mixins/apply-use-function.adapters.d.ts +0 -3
- package/lib/mixins/apply-use-method.adapters.d.ts +0 -4
- package/lib/mixins/extract-control-from-parent.mixin.d.ts +0 -5
- package/lib/mixins/extract-control.mixin.d.ts +0 -9
- package/lib/mixins/extract-data-sources.mixin.d.ts +0 -5
- package/lib/mixins/extract-form-definition.mixin.d.ts +0 -4
- package/lib/mixins/extract-function.mixin.d.ts +0 -9
- package/lib/mixins/extract-functions.mixin.d.ts +0 -19
- package/lib/mixins/extract-is-value-function.mixin.d.ts +0 -13
- package/lib/mixins/extract-method.mixin.d.ts +0 -9
- package/lib/mixins/extract-methods.mixin.d.ts +0 -20
- package/lib/mixins/extract-options-data-source.mixin.d.ts +0 -26
- package/lib/mixins/extract-options-method.mixin.d.ts +0 -17
- package/lib/mixins/extract-resolve-method.mixin.d.ts +0 -16
- package/lib/mixins/extract-to-display-function.mixin.d.ts +0 -13
- package/lib/submit-context-form-adapter.factory.d.ts +0 -13
- package/lib/validators/is-equal-to.d.ts +0 -17
- package/lib/validators/is-selectable-value.directive.d.ts +0 -16
|
@@ -251,10 +251,12 @@ export class GetCompanyMethod implements Method<ControlOption, { parameters:
|
|
|
251
251
|
Injectable,
|
|
252
252
|
Injector,
|
|
253
253
|
INJECTOR,
|
|
254
|
-
|
|
254
|
+
input,
|
|
255
255
|
isDevMode,
|
|
256
|
+
linkedSignal,
|
|
256
257
|
OnDestroy,
|
|
257
258
|
ProviderToken,
|
|
259
|
+
untracked,
|
|
258
260
|
} from '@angular/core';
|
|
259
261
|
import { NgControl } from '@angular/forms';
|
|
260
262
|
import { MatAutocomplete } from '@angular/material/autocomplete';
|
|
@@ -293,9 +295,10 @@ import {
|
|
|
293
295
|
UseToDisplayFunction,
|
|
294
296
|
} from '../mixins/extract-to-display-function.mixin';
|
|
295
297
|
import {
|
|
296
|
-
|
|
298
|
+
AbstractOptionsFromMethodDirective,
|
|
297
299
|
OptionsFromMethodDirectiveSettings,
|
|
298
300
|
} from './options-from-method.directive';
|
|
301
|
+
import { OptionsMethod } from '../mixins/extract-options-method.mixin';
|
|
299
302
|
|
|
300
303
|
export function UseAutocompleteOptionsMethod(
|
|
301
304
|
method: ProviderToken<MethodWithParameters<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>>,
|
|
@@ -370,34 +373,31 @@ export class NoopResolveMethod<Value> implements Method<ControlOption,
|
|
|
370
373
|
standalone: true,
|
|
371
374
|
})
|
|
372
375
|
export class AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>>
|
|
373
|
-
extends
|
|
376
|
+
extends AbstractOptionsFromMethodDirective<Value, Parameters>
|
|
374
377
|
implements AfterViewInit, OnDestroy {
|
|
375
378
|
|
|
376
379
|
static override ngTemplateContextGuard(
|
|
377
|
-
dir:
|
|
380
|
+
dir: AbstractOptionsFromMethodDirective,
|
|
378
381
|
ctx: any,
|
|
379
382
|
): ctx is AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
380
383
|
return true;
|
|
381
384
|
}
|
|
382
385
|
|
|
383
|
-
|
|
384
|
-
public
|
|
385
|
-
|
|
386
|
-
public declare resetOnChange?: Value;
|
|
387
|
-
@Input('rxapAutocompleteOptionsFromMethodMatAutocomplete')
|
|
388
|
-
public matAutocomplete?: MatAutocomplete;
|
|
386
|
+
public readonly parameters = input<Parameters | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodParameters' });
|
|
387
|
+
public readonly resetOnChange = input<Value | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResetOnChange' });
|
|
388
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodMatAutocomplete' });
|
|
389
389
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
390
|
-
|
|
391
|
-
public declare method: Method<ControlOptions, Parameters>;
|
|
390
|
+
public readonly method = input<OptionsMethod<ControlOptions<Value>, Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodCall' });
|
|
392
391
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
393
|
-
|
|
394
|
-
public resolveMethod?: MethodWithParameters<ControlOption, { value: Value } & Parameters>;
|
|
392
|
+
public readonly resolveMethod = input<MethodWithParameters<ControlOption, { value: Value } & Parameters> | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodResolve' });
|
|
395
393
|
|
|
396
|
-
|
|
397
|
-
public isValue?: (value: any) => boolean;
|
|
394
|
+
public readonly isValue = input<((value: any) => boolean) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodIsValue' });
|
|
398
395
|
|
|
399
|
-
|
|
400
|
-
|
|
396
|
+
public readonly toDisplay = input<((value: any) => string) | undefined>(undefined, { alias: 'rxapAutocompleteOptionsFromMethodToDisplay' });
|
|
397
|
+
|
|
398
|
+
protected readonly resolvedResolveMethod = linkedSignal(() => this.resolveMethod());
|
|
399
|
+
protected readonly resolvedIsValue = linkedSignal(() => this.isValue());
|
|
400
|
+
protected readonly resolvedToDisplay = linkedSignal(() => this.toDisplay());
|
|
401
401
|
|
|
402
402
|
protected override ngControl: NgControl | null = null;
|
|
403
403
|
protected override matFormField: MatFormField | null = null;
|
|
@@ -419,23 +419,30 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
419
419
|
this._subscription?.unsubscribe();
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
public override
|
|
423
|
-
|
|
422
|
+
public override ngAfterViewInit() {
|
|
423
|
+
const matAutocomplete = this.matAutocomplete();
|
|
424
|
+
if (matAutocomplete) {
|
|
424
425
|
this.settings ??= {};
|
|
425
426
|
this.settings.filteredOptions ??= true;
|
|
426
427
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
428
|
+
super.ngAfterViewInit();
|
|
429
|
+
if (!this.resolvedResolveMethod()) {
|
|
430
|
+
this.resolvedResolveMethod.set(this.extractResolveMethod());
|
|
431
|
+
}
|
|
432
|
+
if (!this.resolvedIsValue()) {
|
|
433
|
+
this.resolvedIsValue.set(this.extractIsValueFunction((value: any) => typeof value === 'string' && isUUID(value)));
|
|
434
|
+
}
|
|
435
|
+
if (!this.resolvedToDisplay()) {
|
|
436
|
+
this.resolvedToDisplay.set(this.extractToDisplayFunction((value: any): string => {
|
|
437
|
+
if (!value) {
|
|
438
|
+
return '';
|
|
439
|
+
}
|
|
440
|
+
const option = this.findOptionByValue(value);
|
|
441
|
+
return option?.display ?? (isDevMode() ? 'to display error' : '...');
|
|
442
|
+
}));
|
|
443
|
+
}
|
|
444
|
+
if (matAutocomplete) {
|
|
445
|
+
matAutocomplete.displayWith = this.resolvedToDisplay()!.bind(this);
|
|
439
446
|
}
|
|
440
447
|
if (!this.control) {
|
|
441
448
|
throw new Error('The control is not yet defined');
|
|
@@ -448,8 +455,8 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
448
455
|
// to trigger the toDisplay function in the mat-autocomplete
|
|
449
456
|
distinctUntilChanged(),
|
|
450
457
|
tap(async value => {
|
|
451
|
-
await this.load(this.parameters);
|
|
452
|
-
if (this.
|
|
458
|
+
await this.load(untracked(this.parameters));
|
|
459
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
453
460
|
this.triggerAutocompleteToDisplay();
|
|
454
461
|
}
|
|
455
462
|
}),
|
|
@@ -462,7 +469,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
462
469
|
}
|
|
463
470
|
const value = this.control?.value;
|
|
464
471
|
const c_parameters = {...parameters};
|
|
465
|
-
if (this.
|
|
472
|
+
if (this.resolvedIsValue()?.(value)) {
|
|
466
473
|
return this.resolveValue(value, c_parameters);
|
|
467
474
|
} else {
|
|
468
475
|
c_parameters.search ??= value;
|
|
@@ -475,14 +482,15 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
475
482
|
|
|
476
483
|
protected override renderTemplate() {
|
|
477
484
|
super.renderTemplate();
|
|
478
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
485
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
479
486
|
this.isAutocompleteToDisplayTriggered = true;
|
|
480
487
|
this.triggerAutocompleteToDisplay();
|
|
481
488
|
}
|
|
482
489
|
}
|
|
483
490
|
|
|
484
491
|
protected async resolveValue(value: Value, parameters: Parameters = {} as Parameters) {
|
|
485
|
-
|
|
492
|
+
const resolveMethod = this.resolvedResolveMethod();
|
|
493
|
+
if (!resolveMethod) {
|
|
486
494
|
if (isDevMode()) {
|
|
487
495
|
console.warn('The resolve method is not yet defined');
|
|
488
496
|
}
|
|
@@ -490,7 +498,7 @@ export class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
490
498
|
}
|
|
491
499
|
// only resolve the value if the option is not already loaded
|
|
492
500
|
if (!this.findOptionByValue(value)) {
|
|
493
|
-
const option = await
|
|
501
|
+
const option = await resolveMethod!.call({...parameters, value});
|
|
494
502
|
if (option.value !== value) {
|
|
495
503
|
throw new Error('The resolved value is not the same as the input value');
|
|
496
504
|
}
|
|
@@ -207,17 +207,7 @@
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
210
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
211
|
-
Directive,
|
|
212
|
-
ElementRef,
|
|
213
|
-
Inject,
|
|
214
|
-
Input,
|
|
215
|
-
OnDestroy,
|
|
216
|
-
OnInit,
|
|
217
|
-
Optional,
|
|
218
|
-
Renderer2,
|
|
219
|
-
Self,
|
|
220
|
-
} from '@angular/core';
|
|
210
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive, ElementRef, OnDestroy, OnInit, Renderer2, input, inject } from '@angular/core';
|
|
221
211
|
import {
|
|
222
212
|
AbstractControl,
|
|
223
213
|
FormDefinition,
|
|
@@ -285,40 +275,30 @@ export interface ControlHideShowDirective extends ExtractControlFromParentMixin,
|
|
|
285
275
|
standalone: true,
|
|
286
276
|
})
|
|
287
277
|
export class ControlHideShowDirective implements OnInit, OnDestroy {
|
|
278
|
+
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
279
|
+
private readonly elementRef = inject<ElementRef>(ElementRef);
|
|
280
|
+
private readonly parent = inject<ControlContainer | null>(ControlContainer, { optional: true });
|
|
281
|
+
private readonly ngControl = inject<NgControl | null>(NgControl, { self: true, optional: true });
|
|
288
282
|
|
|
289
|
-
|
|
290
|
-
public controlId
|
|
283
|
+
|
|
284
|
+
public readonly controlId = input<string>(undefined, { alias: "rxapControlHideShow" });
|
|
291
285
|
|
|
292
286
|
public control!: RxapFormControl;
|
|
293
287
|
|
|
294
288
|
private subscription = new Subscription();
|
|
295
289
|
|
|
296
|
-
constructor(
|
|
297
|
-
@Inject(Renderer2)
|
|
298
|
-
private readonly renderer: Renderer2,
|
|
299
|
-
@Inject(ElementRef)
|
|
300
|
-
private readonly elementRef: ElementRef,
|
|
301
|
-
@Optional()
|
|
302
|
-
@Inject(ControlContainer)
|
|
303
|
-
private readonly parent: ControlContainer | null,
|
|
304
|
-
@Self()
|
|
305
|
-
@Optional()
|
|
306
|
-
@Inject(NgControl)
|
|
307
|
-
private readonly ngControl: NgControl | null,
|
|
308
|
-
) {
|
|
309
|
-
}
|
|
310
|
-
|
|
311
290
|
public ngOnInit() {
|
|
312
291
|
|
|
313
292
|
if (!this.ngControl && !this.parent) {
|
|
314
293
|
throw new Error('Easier the ControlContainer or NgControl must be injectable');
|
|
315
294
|
}
|
|
316
295
|
|
|
317
|
-
|
|
296
|
+
const controlId = this.controlId();
|
|
297
|
+
if (!this.ngControl && !controlId) {
|
|
318
298
|
throw new Error('If the NgControl is not injectable then the control id must be defined!');
|
|
319
299
|
}
|
|
320
300
|
|
|
321
|
-
const control = this.ngControl?.control ?? this.extractControlFromParent(this.parent!,
|
|
301
|
+
const control = this.ngControl?.control ?? this.extractControlFromParent(this.parent!, controlId!);
|
|
322
302
|
|
|
323
303
|
if (!(control instanceof RxapFormControl)) {
|
|
324
304
|
throw new Error('The control is not an instance of RxapFormControl');
|
|
@@ -429,15 +429,7 @@
|
|
|
429
429
|
|
|
430
430
|
|
|
431
431
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
432
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
433
|
-
AfterViewInit,
|
|
434
|
-
ChangeDetectorRef,
|
|
435
|
-
Directive,
|
|
436
|
-
OnDestroy,
|
|
437
|
-
SkipSelf,
|
|
438
|
-
TemplateRef,
|
|
439
|
-
ViewContainerRef,
|
|
440
|
-
} from '@angular/core';
|
|
432
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { AfterViewInit, ChangeDetectorRef, Directive, OnDestroy, TemplateRef, ViewContainerRef, inject } from '@angular/core';
|
|
441
433
|
import {
|
|
442
434
|
ControlContainer,
|
|
443
435
|
UntypedFormArray,
|
|
@@ -470,19 +462,16 @@ export interface ForFormArrayItemsDirectiveContext {
|
|
|
470
462
|
standalone: true,
|
|
471
463
|
})
|
|
472
464
|
export class ForFormArrayItemsDirective implements AfterViewInit, OnDestroy {
|
|
465
|
+
private readonly container = inject(ControlContainer, { skipSelf: true });
|
|
466
|
+
private readonly template = inject<TemplateRef<ForFormArrayItemsDirectiveContext>>(TemplateRef);
|
|
467
|
+
private readonly viewContainerRef = inject(ViewContainerRef);
|
|
468
|
+
private readonly cdr = inject(ChangeDetectorRef);
|
|
469
|
+
|
|
473
470
|
|
|
474
471
|
private _formArrayValueSubscription?: Subscription;
|
|
475
472
|
|
|
476
473
|
private formArray!: RxapFormArray;
|
|
477
474
|
|
|
478
|
-
constructor(
|
|
479
|
-
@SkipSelf() private readonly container: ControlContainer,
|
|
480
|
-
private readonly template: TemplateRef<ForFormArrayItemsDirectiveContext>,
|
|
481
|
-
private readonly viewContainerRef: ViewContainerRef,
|
|
482
|
-
private readonly cdr: ChangeDetectorRef,
|
|
483
|
-
) {
|
|
484
|
-
}
|
|
485
|
-
|
|
486
475
|
ngAfterViewInit() {
|
|
487
476
|
if (this.container.control instanceof RxapFormArray) {
|
|
488
477
|
this.formArray = this.container.control;
|
|
@@ -326,20 +326,7 @@ value from the select object property company. This will result in unpredictable
|
|
|
326
326
|
|
|
327
327
|
|
|
328
328
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
329
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
330
|
-
AfterViewInit,
|
|
331
|
-
ChangeDetectorRef,
|
|
332
|
-
Directive,
|
|
333
|
-
Inject,
|
|
334
|
-
Injector,
|
|
335
|
-
INJECTOR,
|
|
336
|
-
Input,
|
|
337
|
-
isDevMode,
|
|
338
|
-
OnDestroy,
|
|
339
|
-
Optional,
|
|
340
|
-
TemplateRef,
|
|
341
|
-
ViewContainerRef,
|
|
342
|
-
} from '@angular/core';
|
|
329
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { AfterViewInit, ChangeDetectorRef, Directive, inject, Injector, INJECTOR, input, isDevMode, linkedSignal, OnDestroy, TemplateRef, untracked, ViewContainerRef } from '@angular/core';
|
|
343
330
|
import { NgControl } from '@angular/forms';
|
|
344
331
|
import {
|
|
345
332
|
BaseDataSource,
|
|
@@ -420,15 +407,26 @@ export interface InputSelectOptionsDirective extends OnDestroy, AfterViewInit,
|
|
|
420
407
|
standalone: true,
|
|
421
408
|
})
|
|
422
409
|
export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
410
|
+
protected readonly template = inject<TemplateRef<InputSelectOptionsTemplateContext>>(TemplateRef);
|
|
411
|
+
protected readonly dataSourceLoader = inject<DataSourceLoader>(DataSourceLoader);
|
|
412
|
+
protected readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);
|
|
413
|
+
protected readonly injector = inject<Injector>(INJECTOR);
|
|
414
|
+
protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);
|
|
415
|
+
protected ngControl = inject<NgControl | null>(NgControl, { optional: true }) ?? null;
|
|
416
|
+
protected matFormField = inject<MatFormField | null>(MAT_FORM_FIELD, { optional: true }) ?? null;
|
|
423
417
|
|
|
424
|
-
@Input('rxapInputSelectOptionsViewer')
|
|
425
|
-
public viewer: BaseDataSourceViewer = { id: '[rxapInputSelectOptions]' };
|
|
426
418
|
|
|
427
|
-
|
|
428
|
-
public metadata?: BaseDataSourceMetadata;
|
|
419
|
+
public readonly viewer = input<BaseDataSourceViewer>({ id: '[rxapInputSelectOptions]' }, { alias: "rxapInputSelectOptionsViewer" });
|
|
429
420
|
|
|
430
|
-
|
|
431
|
-
|
|
421
|
+
public readonly metadata = input<BaseDataSourceMetadata | undefined>(undefined, { alias: "rxapInputSelectOptionsMetadata" });
|
|
422
|
+
|
|
423
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: "rxapInputSelectOptionsMatAutocomplete" });
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The viewer used to connect to the data source. Defaults to the input value, but is
|
|
427
|
+
* replaced with a viewer bound to the control after the view init.
|
|
428
|
+
*/
|
|
429
|
+
protected readonly currentViewer = linkedSignal(() => this.viewer());
|
|
432
430
|
|
|
433
431
|
protected readonly subscription = new Subscription();
|
|
434
432
|
|
|
@@ -449,31 +447,9 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
449
447
|
*/
|
|
450
448
|
private isAutocompleteToDisplayTriggered = false;
|
|
451
449
|
|
|
452
|
-
constructor(
|
|
453
|
-
@Inject(TemplateRef)
|
|
454
|
-
protected readonly template: TemplateRef<InputSelectOptionsTemplateContext>,
|
|
455
|
-
@Inject(DataSourceLoader)
|
|
456
|
-
protected readonly dataSourceLoader: DataSourceLoader,
|
|
457
|
-
@Inject(ViewContainerRef)
|
|
458
|
-
protected readonly viewContainerRef: ViewContainerRef,
|
|
459
|
-
@Inject(INJECTOR)
|
|
460
|
-
protected readonly injector: Injector,
|
|
461
|
-
@Inject(ChangeDetectorRef)
|
|
462
|
-
protected readonly cdr: ChangeDetectorRef,
|
|
463
|
-
// The ngControl could be unknown on construction
|
|
464
|
-
// bc it is available after the content is init
|
|
465
|
-
@Optional()
|
|
466
|
-
@Inject(NgControl)
|
|
467
|
-
protected ngControl: NgControl | null = null,
|
|
468
|
-
@Optional()
|
|
469
|
-
@Inject(MAT_FORM_FIELD)
|
|
470
|
-
protected matFormField: MatFormField | null = null,
|
|
471
|
-
) {
|
|
472
|
-
}
|
|
473
|
-
|
|
474
450
|
public ngAfterViewInit() {
|
|
475
|
-
this.extractOptionsDatasource();
|
|
476
|
-
this.
|
|
451
|
+
this.extractOptionsDatasource(undefined, this.metadata());
|
|
452
|
+
this.currentViewer.set({
|
|
477
453
|
id: '[rxapInputSelectOptions]' + this.control.controlId,
|
|
478
454
|
viewChange: this.settings?.loadOnce ? EMPTY : this.control.value$.pipe(
|
|
479
455
|
throttleTime(1000),
|
|
@@ -486,9 +462,10 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
486
462
|
}),
|
|
487
463
|
),
|
|
488
464
|
control: this.control,
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
|
|
465
|
+
});
|
|
466
|
+
const matAutocomplete = this.matAutocomplete();
|
|
467
|
+
if (matAutocomplete) {
|
|
468
|
+
matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
492
469
|
this.settings ??= {};
|
|
493
470
|
this.settings.filteredOptions ??= true;
|
|
494
471
|
}
|
|
@@ -508,7 +485,7 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
508
485
|
}
|
|
509
486
|
|
|
510
487
|
private loadOptions(dataSource: BaseDataSource<ControlOptions | Record<string, any>> = this.dataSource) {
|
|
511
|
-
this.subscription.add(dataSource.connect(this.
|
|
488
|
+
this.subscription.add(dataSource.connect(this.currentViewer()).pipe(
|
|
512
489
|
switchMap(options => {
|
|
513
490
|
if (this.settings?.filteredOptions) {
|
|
514
491
|
return this.control.value$.pipe(
|
|
@@ -536,7 +513,7 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
536
513
|
}),
|
|
537
514
|
tap(options => this.renderTemplate(this.options = options)),
|
|
538
515
|
tap(() => {
|
|
539
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
516
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
540
517
|
this.isAutocompleteToDisplayTriggered = true;
|
|
541
518
|
// trigger a change detection after the options are rendered
|
|
542
519
|
// this is needed to trigger the mat-autocomplete options to display function
|
|
@@ -195,20 +195,7 @@
|
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
198
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
199
|
-
AfterViewInit,
|
|
200
|
-
ChangeDetectorRef,
|
|
201
|
-
Directive,
|
|
202
|
-
Inject,
|
|
203
|
-
Injector,
|
|
204
|
-
INJECTOR,
|
|
205
|
-
Input,
|
|
206
|
-
isDevMode,
|
|
207
|
-
OnDestroy,
|
|
208
|
-
Optional,
|
|
209
|
-
TemplateRef,
|
|
210
|
-
ViewContainerRef,
|
|
211
|
-
} from '@angular/core';
|
|
198
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { AfterViewInit, ChangeDetectorRef, Directive, inject, Injector, INJECTOR, input, isDevMode, linkedSignal, OnDestroy, TemplateRef, untracked, ViewContainerRef } from '@angular/core';
|
|
212
199
|
import { NgControl } from '@angular/forms';
|
|
213
200
|
import {
|
|
214
201
|
BaseDataSource,
|
|
@@ -289,15 +276,26 @@ export interface InputSelectOptionsDirective extends OnDestroy, AfterViewInit,
|
|
|
289
276
|
standalone: true,
|
|
290
277
|
})
|
|
291
278
|
export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
279
|
+
protected readonly template = inject<TemplateRef<InputSelectOptionsTemplateContext>>(TemplateRef);
|
|
280
|
+
protected readonly dataSourceLoader = inject<DataSourceLoader>(DataSourceLoader);
|
|
281
|
+
protected readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);
|
|
282
|
+
protected readonly injector = inject<Injector>(INJECTOR);
|
|
283
|
+
protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);
|
|
284
|
+
protected ngControl = inject<NgControl | null>(NgControl, { optional: true }) ?? null;
|
|
285
|
+
protected matFormField = inject<MatFormField | null>(MAT_FORM_FIELD, { optional: true }) ?? null;
|
|
292
286
|
|
|
293
|
-
@Input('rxapInputSelectOptionsViewer')
|
|
294
|
-
public viewer: BaseDataSourceViewer = { id: '[rxapInputSelectOptions]' };
|
|
295
287
|
|
|
296
|
-
|
|
297
|
-
public metadata?: BaseDataSourceMetadata;
|
|
288
|
+
public readonly viewer = input<BaseDataSourceViewer>({ id: '[rxapInputSelectOptions]' }, { alias: "rxapInputSelectOptionsViewer" });
|
|
298
289
|
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
public readonly metadata = input<BaseDataSourceMetadata | undefined>(undefined, { alias: "rxapInputSelectOptionsMetadata" });
|
|
291
|
+
|
|
292
|
+
public readonly matAutocomplete = input<MatAutocomplete | undefined>(undefined, { alias: "rxapInputSelectOptionsMatAutocomplete" });
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The viewer used to connect to the data source. Defaults to the input value, but is
|
|
296
|
+
* replaced with a viewer bound to the control after the view init.
|
|
297
|
+
*/
|
|
298
|
+
protected readonly currentViewer = linkedSignal(() => this.viewer());
|
|
301
299
|
|
|
302
300
|
protected readonly subscription = new Subscription();
|
|
303
301
|
|
|
@@ -318,31 +316,9 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
318
316
|
*/
|
|
319
317
|
private isAutocompleteToDisplayTriggered = false;
|
|
320
318
|
|
|
321
|
-
constructor(
|
|
322
|
-
@Inject(TemplateRef)
|
|
323
|
-
protected readonly template: TemplateRef<InputSelectOptionsTemplateContext>,
|
|
324
|
-
@Inject(DataSourceLoader)
|
|
325
|
-
protected readonly dataSourceLoader: DataSourceLoader,
|
|
326
|
-
@Inject(ViewContainerRef)
|
|
327
|
-
protected readonly viewContainerRef: ViewContainerRef,
|
|
328
|
-
@Inject(INJECTOR)
|
|
329
|
-
protected readonly injector: Injector,
|
|
330
|
-
@Inject(ChangeDetectorRef)
|
|
331
|
-
protected readonly cdr: ChangeDetectorRef,
|
|
332
|
-
// The ngControl could be unknown on construction
|
|
333
|
-
// bc it is available after the content is init
|
|
334
|
-
@Optional()
|
|
335
|
-
@Inject(NgControl)
|
|
336
|
-
protected ngControl: NgControl | null = null,
|
|
337
|
-
@Optional()
|
|
338
|
-
@Inject(MAT_FORM_FIELD)
|
|
339
|
-
protected matFormField: MatFormField | null = null,
|
|
340
|
-
) {
|
|
341
|
-
}
|
|
342
|
-
|
|
343
319
|
public ngAfterViewInit() {
|
|
344
|
-
this.extractOptionsDatasource();
|
|
345
|
-
this.
|
|
320
|
+
this.extractOptionsDatasource(undefined, this.metadata());
|
|
321
|
+
this.currentViewer.set({
|
|
346
322
|
id: '[rxapInputSelectOptions]' + this.control.controlId,
|
|
347
323
|
viewChange: this.settings?.loadOnce ? EMPTY : this.control.value$.pipe(
|
|
348
324
|
throttleTime(1000),
|
|
@@ -355,9 +331,10 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
355
331
|
}),
|
|
356
332
|
),
|
|
357
333
|
control: this.control,
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
|
|
334
|
+
});
|
|
335
|
+
const matAutocomplete = this.matAutocomplete();
|
|
336
|
+
if (matAutocomplete) {
|
|
337
|
+
matAutocomplete.displayWith = this.toDisplay.bind(this);
|
|
361
338
|
this.settings ??= {};
|
|
362
339
|
this.settings.filteredOptions ??= true;
|
|
363
340
|
}
|
|
@@ -377,7 +354,7 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
377
354
|
}
|
|
378
355
|
|
|
379
356
|
private loadOptions(dataSource: BaseDataSource<ControlOptions | Record<string, any>> = this.dataSource) {
|
|
380
|
-
this.subscription.add(dataSource.connect(this.
|
|
357
|
+
this.subscription.add(dataSource.connect(this.currentViewer()).pipe(
|
|
381
358
|
switchMap(options => {
|
|
382
359
|
if (this.settings?.filteredOptions) {
|
|
383
360
|
return this.control.value$.pipe(
|
|
@@ -405,7 +382,7 @@ export class InputSelectOptionsDirective implements OnDestroy, AfterViewInit {
|
|
|
405
382
|
}),
|
|
406
383
|
tap(options => this.renderTemplate(this.options = options)),
|
|
407
384
|
tap(() => {
|
|
408
|
-
if (this.matAutocomplete && !this.isAutocompleteToDisplayTriggered) {
|
|
385
|
+
if (this.matAutocomplete() && !this.isAutocompleteToDisplayTriggered) {
|
|
409
386
|
this.isAutocompleteToDisplayTriggered = true;
|
|
410
387
|
// trigger a change detection after the options are rendered
|
|
411
388
|
// this is needed to trigger the mat-autocomplete options to display function
|