@rxap/form-system 18.2.0-dev.5 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/esm2022/lib/directives/autocomplete-options-from-method.directive.mjs +20 -11
- package/esm2022/lib/mixins/apply-use-function.adapters.mjs +3 -3
- package/esm2022/lib/mixins/extract-to-display-function.mixin.mjs +22 -0
- package/fesm2022/rxap-form-system.mjs +36 -13
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/lib/directives/autocomplete-options-from-method.directive.d.ts +5 -3
- package/lib/mixins/extract-to-display-function.mixin.d.ts +13 -0
- package/package.json +4 -4
|
@@ -7,6 +7,7 @@ import { MatFormField } from '@angular/material/form-field';
|
|
|
7
7
|
import { ExtractIsValueFunctionMixin } from '../mixins/extract-is-value-function.mixin';
|
|
8
8
|
import { UseMethodConfig } from '../mixins/extract-methods.mixin';
|
|
9
9
|
import { ExtractResolveMethodMixin } from '../mixins/extract-resolve-method.mixin';
|
|
10
|
+
import { ExtractToDisplayFunctionMixin } from '../mixins/extract-to-display-function.mixin';
|
|
10
11
|
import { OptionsFromMethodDirective, OptionsFromMethodDirectiveSettings } from './options-from-method.directive';
|
|
11
12
|
import { OpenApiRemoteMethodParameter } from '@rxap/open-api/remote-method';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
@@ -17,6 +18,7 @@ export declare function UseAutocompleteResolveMethod<Value = unknown>(method: Pr
|
|
|
17
18
|
value: string;
|
|
18
19
|
}>>>, config?: UseMethodConfig): any;
|
|
19
20
|
export declare function UseAutocompleteIsValueFunction(isValue: (value: any) => boolean): any;
|
|
21
|
+
export declare function UseAutocompleteToDisplayFunction(toDisplay: (value: any) => string): any;
|
|
20
22
|
export interface AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
21
23
|
$implicit: ControlOption;
|
|
22
24
|
}
|
|
@@ -26,7 +28,7 @@ export interface AutocompleteOptionsFromMethodDirectiveSettings extends OptionsF
|
|
|
26
28
|
export interface AutocompleteOptionsFromMethodDirectiveParameters<Value = any> {
|
|
27
29
|
search?: Value | null;
|
|
28
30
|
}
|
|
29
|
-
export interface AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>> extends ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, AfterViewInit, OnDestroy {
|
|
31
|
+
export interface AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>> extends ExtractResolveMethodMixin, ExtractIsValueFunctionMixin, ExtractToDisplayFunctionMixin, AfterViewInit, OnDestroy {
|
|
30
32
|
}
|
|
31
33
|
export declare class NoopResolveMethod<Value> implements Method<ControlOption, {
|
|
32
34
|
value: Value;
|
|
@@ -47,6 +49,7 @@ export declare class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
47
49
|
value: Value;
|
|
48
50
|
} & Parameters>;
|
|
49
51
|
isValue?: (value: any) => boolean;
|
|
52
|
+
toDisplay?: (value: any) => string;
|
|
50
53
|
protected ngControl: NgControl | null;
|
|
51
54
|
protected matFormField: MatFormField | null;
|
|
52
55
|
protected injector: Injector;
|
|
@@ -62,12 +65,11 @@ export declare class AutocompleteOptionsFromMethodDirective<Value = any, Paramet
|
|
|
62
65
|
private _subscription?;
|
|
63
66
|
ngOnDestroy(): void;
|
|
64
67
|
ngAfterViewInit(): Promise<void>;
|
|
65
|
-
toDisplay(value: any): string;
|
|
66
68
|
protected loadOptions(parameters?: Parameters): Promise<ControlOptions | null>;
|
|
67
69
|
protected renderTemplate(): void;
|
|
68
70
|
protected resolveValue(value: Value, parameters?: Parameters): Promise<ControlOptions | null>;
|
|
69
71
|
private triggerAutocompleteToDisplay;
|
|
70
72
|
private findOptionByValue;
|
|
71
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteOptionsFromMethodDirective<any, any>, never>;
|
|
72
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AutocompleteOptionsFromMethodDirective<any, any>, "[rxapAutocompleteOptionsFromMethod]", never, { "parameters": { "alias": "rxapAutocompleteOptionsFromMethodParameters"; "required": false; }; "resetOnChange": { "alias": "rxapAutocompleteOptionsFromMethodResetOnChange"; "required": false; }; "matAutocomplete": { "alias": "rxapAutocompleteOptionsFromMethodMatAutocomplete"; "required": false; }; "method": { "alias": "rxapAutocompleteOptionsFromMethodCall"; "required": false; }; "resolveMethod": { "alias": "rxapAutocompleteOptionsFromMethodResolve"; "required": false; }; "isValue": { "alias": "rxapAutocompleteOptionsFromMethodIsValue"; "required": false; }; }, {}, never, never, true, never>;
|
|
74
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AutocompleteOptionsFromMethodDirective<any, any>, "[rxapAutocompleteOptionsFromMethod]", never, { "parameters": { "alias": "rxapAutocompleteOptionsFromMethodParameters"; "required": false; }; "resetOnChange": { "alias": "rxapAutocompleteOptionsFromMethodResetOnChange"; "required": false; }; "matAutocomplete": { "alias": "rxapAutocompleteOptionsFromMethodMatAutocomplete"; "required": false; }; "method": { "alias": "rxapAutocompleteOptionsFromMethodCall"; "required": false; }; "resolveMethod": { "alias": "rxapAutocompleteOptionsFromMethodResolve"; "required": false; }; "isValue": { "alias": "rxapAutocompleteOptionsFromMethodIsValue"; "required": false; }; "toDisplay": { "alias": "rxapAutocompleteOptionsFromMethodToDisplay"; "required": false; }; }, {}, never, never, true, never>;
|
|
73
75
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RxapFormControl } from '@rxap/forms';
|
|
2
|
+
import { ExtractControlMixin } from './extract-control.mixin';
|
|
3
|
+
import { ExtractFormDefinitionMixin } from './extract-form-definition.mixin';
|
|
4
|
+
import { ExtractFunctionMixin } from './extract-function.mixin';
|
|
5
|
+
import { UseFunctionConfig, UseFunctionType } from './extract-functions.mixin';
|
|
6
|
+
export declare const TO_DISPLAY_FUNCTION_NAME = "to-display";
|
|
7
|
+
export declare function UseToDisplayFunction(fnc: UseFunctionType<[any], string>): any;
|
|
8
|
+
export declare function UseToDisplayFunction(fnc: UseFunctionType<any[], any>, config: UseFunctionConfig<string, any[], any, [any]>): any;
|
|
9
|
+
export interface ExtractToDisplayFunctionMixin extends ExtractFormDefinitionMixin, ExtractFunctionMixin, ExtractControlMixin {
|
|
10
|
+
}
|
|
11
|
+
export declare class ExtractToDisplayFunctionMixin {
|
|
12
|
+
protected extractToDisplayFunction(defaultFunction?: UseFunctionType<[any], string> | null, control?: RxapFormControl, formDefinition?: import("@rxap/forms").FormDefinition<any, any, any>): UseFunctionType<[any], string>;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "18.2.0
|
|
2
|
+
"version": "18.2.0",
|
|
3
3
|
"name": "@rxap/form-system",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@angular/router": "^18.2.0",
|
|
14
14
|
"@rxap/data-source": "^18.1.4",
|
|
15
15
|
"@rxap/definition": "^18.0.6",
|
|
16
|
-
"@rxap/forms": "^18.
|
|
16
|
+
"@rxap/forms": "^18.2.0-dev.0",
|
|
17
17
|
"@rxap/mixin": "^16.0.9",
|
|
18
18
|
"@rxap/open-api": "^18.0.7-dev.0",
|
|
19
19
|
"@rxap/pattern": "^1.1.8",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"package": "@rxap/forms",
|
|
106
|
-
"version": "18.
|
|
106
|
+
"version": "18.2.0-dev.0"
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"package": "@rxap/mixin",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"directory": "packages/angular/form-system"
|
|
154
154
|
},
|
|
155
155
|
"sideEffects": false,
|
|
156
|
-
"gitHead": "
|
|
156
|
+
"gitHead": "cdaf38d7d0b5f14fc9bc53f9bac58ac81dd32c6e",
|
|
157
157
|
"module": "fesm2022/rxap-form-system.mjs",
|
|
158
158
|
"typings": "index.d.ts",
|
|
159
159
|
"exports": {
|