@rxap/form-system 18.1.3 → 18.2.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/esm2022/index.mjs +2 -1
- package/esm2022/lib/directives/autocomplete-options-from-method.directive.mjs +157 -0
- package/esm2022/lib/directives/options-from-method.directive.mjs +17 -7
- package/fesm2022/rxap-form-system.mjs +239 -83
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/directives/autocomplete-options-from-method.directive.d.ts +62 -0
- package/lib/directives/options-from-method.directive.d.ts +6 -6
- package/package.json +29 -27
package/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './lib/directives/array/form-array-item-button';
|
|
|
17
17
|
export * from './lib/directives/array/form-array-item-remove-button.directive';
|
|
18
18
|
export * from './lib/directives/array/form-array-item-restore-button.directive';
|
|
19
19
|
export * from './lib/directives/array/form-array-removable.directive';
|
|
20
|
+
export * from './lib/directives/autocomplete-options-from-method.directive';
|
|
20
21
|
export * from './lib/directives/control-hide-show.directive';
|
|
21
22
|
export * from './lib/directives/form-directives.module';
|
|
22
23
|
export * from './lib/directives/input-select-options.directive';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AfterViewInit, Injector, OnDestroy, ProviderToken } from '@angular/core';
|
|
2
|
+
import { MatAutocomplete } from '@angular/material/autocomplete';
|
|
3
|
+
import { ControlOption, ControlOptions } from '@rxap/utilities';
|
|
4
|
+
import { Method, MethodWithParameters } from '@rxap/pattern';
|
|
5
|
+
import { NgControl } from '@angular/forms';
|
|
6
|
+
import { MatFormField } from '@angular/material/form-field';
|
|
7
|
+
import { UseMethodConfig } from '../mixins/extract-methods.mixin';
|
|
8
|
+
import { ExtractResolveMethodMixin } from '../mixins/extract-resolve-method.mixin';
|
|
9
|
+
import { OptionsFromMethodDirective, OptionsFromMethodDirectiveSettings } from './options-from-method.directive';
|
|
10
|
+
import { OpenApiRemoteMethodParameter } from '@rxap/open-api/remote-method';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
export declare function UseAutocompleteOptionsMethod(method: ProviderToken<MethodWithParameters<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>>): any;
|
|
13
|
+
export declare function UseAutocompleteOptionsMethod(method: ProviderToken<MethodWithParameters<ControlOptions, OpenApiRemoteMethodParameter<AutocompleteOptionsFromMethodDirectiveParameters>>>): any;
|
|
14
|
+
export declare function UseAutocompleteOptionsMethod(method: ProviderToken<MethodWithParameters>, config: UseMethodConfig<ControlOptions, AutocompleteOptionsFromMethodDirectiveParameters>): any;
|
|
15
|
+
export declare function UseAutocompleteResolveMethod<Value = unknown>(method: ProviderToken<MethodWithParameters<ControlOption<Value>, OpenApiRemoteMethodParameter<{
|
|
16
|
+
value: string;
|
|
17
|
+
}>>>, config?: UseMethodConfig): any;
|
|
18
|
+
export interface AutocompleteOptionsFromRemoteMethodTemplateContext {
|
|
19
|
+
$implicit: ControlOption;
|
|
20
|
+
}
|
|
21
|
+
export interface AutocompleteOptionsFromMethodDirectiveSettings extends OptionsFromMethodDirectiveSettings {
|
|
22
|
+
filteredOptions?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface AutocompleteOptionsFromMethodDirectiveParameters<Value = any> {
|
|
25
|
+
search?: Value | null;
|
|
26
|
+
}
|
|
27
|
+
export interface AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>> extends ExtractResolveMethodMixin, AfterViewInit, OnDestroy {
|
|
28
|
+
}
|
|
29
|
+
export declare class AutocompleteOptionsFromMethodDirective<Value = any, Parameters extends AutocompleteOptionsFromMethodDirectiveParameters<Value> = AutocompleteOptionsFromMethodDirectiveParameters<Value>> extends OptionsFromMethodDirective<Value, Parameters> implements AfterViewInit, OnDestroy {
|
|
30
|
+
static ngTemplateContextGuard(dir: OptionsFromMethodDirective, ctx: any): ctx is AutocompleteOptionsFromRemoteMethodTemplateContext;
|
|
31
|
+
parameters?: Parameters;
|
|
32
|
+
resetOnChange?: Value;
|
|
33
|
+
matAutocomplete?: MatAutocomplete;
|
|
34
|
+
method: Method<ControlOptions, Parameters>;
|
|
35
|
+
resolveMethod?: MethodWithParameters<ControlOption, {
|
|
36
|
+
value: Value;
|
|
37
|
+
} & Parameters>;
|
|
38
|
+
protected ngControl: NgControl | null;
|
|
39
|
+
protected matFormField: MatFormField | null;
|
|
40
|
+
protected injector: Injector;
|
|
41
|
+
protected settings: AutocompleteOptionsFromMethodDirectiveSettings;
|
|
42
|
+
/**
|
|
43
|
+
* This flag is used to prevent the setValue is called for each refresh
|
|
44
|
+
* of the options list. This is needed because the setValue method will
|
|
45
|
+
* trigger a new refresh of the options list. This results in an endless
|
|
46
|
+
* call stack. This flag is set to true if the setValue method is called
|
|
47
|
+
* once.
|
|
48
|
+
*/
|
|
49
|
+
private isAutocompleteToDisplayTriggered;
|
|
50
|
+
private _subscription?;
|
|
51
|
+
ngOnDestroy(): void;
|
|
52
|
+
ngAfterViewInit(): Promise<void>;
|
|
53
|
+
toDisplay(value: any): string;
|
|
54
|
+
isValue(value: any): boolean;
|
|
55
|
+
protected loadOptions(parameters?: Parameters): Promise<ControlOptions | null>;
|
|
56
|
+
protected renderTemplate(): void;
|
|
57
|
+
protected resolveValue(value: Value, parameters?: Parameters): Promise<ControlOptions | null>;
|
|
58
|
+
private triggerAutocompleteToDisplay;
|
|
59
|
+
private findOptionByValue;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteOptionsFromMethodDirective<any, any>, never>;
|
|
61
|
+
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; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, Injector, OnChanges, SimpleChanges, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { NgControl } from '@angular/forms';
|
|
2
|
+
import { AbstractControlDirective, NgControl } from '@angular/forms';
|
|
3
3
|
import { MatFormField } from '@angular/material/form-field';
|
|
4
4
|
import { Method } from '@rxap/pattern';
|
|
5
5
|
import { ControlOption, ControlOptions } from '@rxap/utilities';
|
|
@@ -17,19 +17,19 @@ export declare class OptionsFromMethodDirective<Value = any, Parameters = any> i
|
|
|
17
17
|
parameters?: Parameters;
|
|
18
18
|
resetOnChange?: Value;
|
|
19
19
|
options: ControlOptions | null;
|
|
20
|
-
|
|
20
|
+
method: Method<ControlOptions, Parameters>;
|
|
21
|
+
protected ngControl: NgControl | AbstractControlDirective | null;
|
|
21
22
|
protected matFormField: MatFormField | null;
|
|
22
23
|
protected settings: OptionsFromMethodDirectiveSettings;
|
|
23
|
-
protected method: Method<ControlOptions, Parameters>;
|
|
24
24
|
protected readonly viewContainerRef: ViewContainerRef;
|
|
25
25
|
protected readonly injector: Injector;
|
|
26
26
|
protected readonly cdr: ChangeDetectorRef;
|
|
27
27
|
private readonly template;
|
|
28
28
|
ngAfterViewInit(): Promise<void>;
|
|
29
29
|
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
30
|
-
protected loadOptions(parameters?: Parameters): Promise<ControlOptions>;
|
|
30
|
+
protected loadOptions(parameters?: Parameters): Promise<ControlOptions | null>;
|
|
31
31
|
protected renderTemplate(): void;
|
|
32
|
-
protected setOptions(options: ControlOptions): void;
|
|
32
|
+
protected setOptions(options: ControlOptions | null): void;
|
|
33
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<OptionsFromMethodDirective<any, any>, never>;
|
|
34
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<OptionsFromMethodDirective<any, any>, "[rxapOptionsFromMethod]", never, { "parameters": { "alias": "rxapOptionsFromMethodParameters"; "required": false; }; "resetOnChange": { "alias": "rxapOptionsFromMethodResetOnChange"; "required": false; }; }, {}, never, never, true, never>;
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OptionsFromMethodDirective<any, any>, "[rxapOptionsFromMethod]", never, { "parameters": { "alias": "rxapOptionsFromMethodParameters"; "required": false; }; "resetOnChange": { "alias": "rxapOptionsFromMethodResetOnChange"; "required": false; }; "method": { "alias": "rxapOptionsFromMethodCall"; "required": false; }; }, {}, never, never, true, never>;
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "18.
|
|
2
|
+
"version": "18.2.0-dev.0",
|
|
3
3
|
"name": "@rxap/form-system",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -11,15 +11,17 @@
|
|
|
11
11
|
"@angular/forms": "^18.2.0",
|
|
12
12
|
"@angular/material": "^18.2.0",
|
|
13
13
|
"@angular/router": "^18.2.0",
|
|
14
|
-
"@rxap/data-source": "^18.1.4
|
|
15
|
-
"@rxap/definition": "^18.0.6
|
|
16
|
-
"@rxap/forms": "^18.1.1
|
|
17
|
-
"@rxap/mixin": "^16.0.9
|
|
18
|
-
"@rxap/open-api": "^18.0.
|
|
19
|
-
"@rxap/pattern": "^1.1.8
|
|
20
|
-
"@rxap/reflect-metadata": "^1.0.10
|
|
21
|
-
"@rxap/remote-method": "^18.0.6
|
|
22
|
-
"@rxap/
|
|
14
|
+
"@rxap/data-source": "^18.1.4",
|
|
15
|
+
"@rxap/definition": "^18.0.6",
|
|
16
|
+
"@rxap/forms": "^18.1.1",
|
|
17
|
+
"@rxap/mixin": "^16.0.9",
|
|
18
|
+
"@rxap/open-api": "^18.0.7-dev.0",
|
|
19
|
+
"@rxap/pattern": "^1.1.8",
|
|
20
|
+
"@rxap/reflect-metadata": "^1.0.10",
|
|
21
|
+
"@rxap/remote-method": "^18.0.6",
|
|
22
|
+
"@rxap/rxjs": "^1.1.9",
|
|
23
|
+
"@rxap/utilities": "^16.3.1",
|
|
24
|
+
"@rxap/validator": "^3.0.8",
|
|
23
25
|
"rxjs": "^7.8.1"
|
|
24
26
|
},
|
|
25
27
|
"author": {
|
|
@@ -77,67 +79,67 @@
|
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
"package": "@rxap/config",
|
|
80
|
-
"version": "18.2.1
|
|
82
|
+
"version": "18.2.1"
|
|
81
83
|
},
|
|
82
84
|
{
|
|
83
85
|
"package": "@rxap/data-source",
|
|
84
|
-
"version": "18.1.4
|
|
86
|
+
"version": "18.1.4"
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
"package": "@rxap/data-structure-tree",
|
|
88
|
-
"version": "1.1.9
|
|
90
|
+
"version": "1.1.9"
|
|
89
91
|
},
|
|
90
92
|
{
|
|
91
93
|
"package": "@rxap/definition",
|
|
92
|
-
"version": "18.0.6
|
|
94
|
+
"version": "18.0.6"
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
"package": "@rxap/directives",
|
|
96
|
-
"version": "18.0.6
|
|
98
|
+
"version": "18.0.6"
|
|
97
99
|
},
|
|
98
100
|
{
|
|
99
101
|
"package": "@rxap/environment",
|
|
100
|
-
"version": "18.0.6
|
|
102
|
+
"version": "18.0.6"
|
|
101
103
|
},
|
|
102
104
|
{
|
|
103
105
|
"package": "@rxap/forms",
|
|
104
|
-
"version": "18.1.1
|
|
106
|
+
"version": "18.1.1"
|
|
105
107
|
},
|
|
106
108
|
{
|
|
107
109
|
"package": "@rxap/mixin",
|
|
108
|
-
"version": "16.0.9
|
|
110
|
+
"version": "16.0.9"
|
|
109
111
|
},
|
|
110
112
|
{
|
|
111
113
|
"package": "@rxap/open-api",
|
|
112
|
-
"version": "18.0.
|
|
114
|
+
"version": "18.0.7-dev.0"
|
|
113
115
|
},
|
|
114
116
|
{
|
|
115
117
|
"package": "@rxap/pattern",
|
|
116
|
-
"version": "1.1.8
|
|
118
|
+
"version": "1.1.8"
|
|
117
119
|
},
|
|
118
120
|
{
|
|
119
121
|
"package": "@rxap/reflect-metadata",
|
|
120
|
-
"version": "1.0.10
|
|
122
|
+
"version": "1.0.10"
|
|
121
123
|
},
|
|
122
124
|
{
|
|
123
125
|
"package": "@rxap/remote-method",
|
|
124
|
-
"version": "18.0.6
|
|
126
|
+
"version": "18.0.6"
|
|
125
127
|
},
|
|
126
128
|
{
|
|
127
129
|
"package": "@rxap/rxjs",
|
|
128
|
-
"version": "1.1.9
|
|
130
|
+
"version": "1.1.9"
|
|
129
131
|
},
|
|
130
132
|
{
|
|
131
133
|
"package": "@rxap/services",
|
|
132
|
-
"version": "18.0.6
|
|
134
|
+
"version": "18.0.6"
|
|
133
135
|
},
|
|
134
136
|
{
|
|
135
137
|
"package": "@rxap/utilities",
|
|
136
|
-
"version": "16.3.1
|
|
138
|
+
"version": "16.3.1"
|
|
137
139
|
},
|
|
138
140
|
{
|
|
139
141
|
"package": "@rxap/validator",
|
|
140
|
-
"version": "3.0.8
|
|
142
|
+
"version": "3.0.8"
|
|
141
143
|
}
|
|
142
144
|
]
|
|
143
145
|
},
|
|
@@ -151,7 +153,7 @@
|
|
|
151
153
|
"directory": "packages/angular/form-system"
|
|
152
154
|
},
|
|
153
155
|
"sideEffects": false,
|
|
154
|
-
"gitHead": "
|
|
156
|
+
"gitHead": "ceaf6319d18986282cb57ea8aa4a910f48cb530b",
|
|
155
157
|
"module": "fesm2022/rxap-form-system.mjs",
|
|
156
158
|
"typings": "index.d.ts",
|
|
157
159
|
"exports": {
|