@rxap/form-system 16.0.0-dev.1 → 16.0.0-dev.2
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/esm2022/index.mjs +1 -3
- package/esm2022/lib/directives/control-hide-show.directive.mjs +5 -17
- package/esm2022/lib/directives/input-select-options.directive.mjs +9 -21
- package/esm2022/lib/form-system-control.directive.mjs +4 -3
- package/esm2022/lib/mixins/extract-control.mixin.mjs +1 -1
- package/esm2022/lib/validators/is-equal-to.mjs +5 -17
- package/esm2022/lib/validators/is-selectable-value.directive.mjs +5 -17
- package/fesm2022/rxap-form-system.mjs +168 -242
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/index.d.ts +0 -2
- package/lib/directives/control-hide-show.directive.d.ts +1 -6
- package/lib/directives/input-select-options.directive.d.ts +3 -8
- package/lib/form-system-control.directive.d.ts +1 -1
- package/lib/mixins/extract-control.mixin.d.ts +1 -1
- package/lib/validators/is-equal-to.d.ts +1 -6
- package/lib/validators/is-selectable-value.directive.d.ts +1 -6
- package/package.json +7 -7
- package/esm2022/lib/directives/form-directives.module.mjs +0 -22
- package/esm2022/lib/form-system.module.mjs +0 -18
- package/lib/directives/form-directives.module.d.ts +0 -8
- package/lib/form-system.module.d.ts +0 -7
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { RxapError, equals, Required } from '@rxap/utilities';
|
|
2
|
+
import * as i1$1 from '@rxap/data-source';
|
|
3
|
+
import { BaseDataSource, RXAP_DATA_SOURCE_METADATA, PipeDataSource, DataSourceLoader } from '@rxap/data-source';
|
|
1
4
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { ControlContainer, NgControl, NG_VALIDATORS } from '@angular/forms';
|
|
5
|
+
import { InjectionToken, isDevMode, Injectable, Inject, Optional, ComponentFactoryResolver, ViewContainerRef, INJECTOR, ComponentRef, Injector, Directive, Input, Renderer2, ElementRef, Self, TemplateRef, ChangeDetectorRef, forwardRef } from '@angular/core';
|
|
6
|
+
import { startWith, distinctUntilChanged, shareReplay, map, tap, catchError, throttleTime, switchMap } from 'rxjs/operators';
|
|
7
|
+
import { getMetadata, setMetadataMapMap, setMetadataMap, setMetadata } from '@rxap/utilities/reflect-metadata';
|
|
7
8
|
import { RxapFormControl, RxapFormGroup, RxapFormArray } from '@rxap/forms';
|
|
8
|
-
import
|
|
9
|
-
import { PipeDataSource, DataSourceLoader, BaseDataSource, RXAP_DATA_SOURCE_METADATA } from '@rxap/data-source';
|
|
9
|
+
import { __decorate, __metadata } from 'tslib';
|
|
10
10
|
import { Mixin } from '@rxap/mixin';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
11
|
+
import * as i1 from '@angular/forms';
|
|
12
|
+
import { NgControl, ControlContainer, NG_VALIDATORS } from '@angular/forms';
|
|
13
13
|
import { Subscription, of, EMPTY } from 'rxjs';
|
|
14
|
-
import * as i3 from '@angular/material/
|
|
15
|
-
import {
|
|
16
|
-
import '@angular/material/
|
|
14
|
+
import * as i3 from '@angular/material/form-field';
|
|
15
|
+
import { MAT_FORM_FIELD } from '@angular/material/form-field';
|
|
16
|
+
import '@angular/material/autocomplete';
|
|
17
17
|
|
|
18
18
|
class RxapFormSystemError extends RxapError {
|
|
19
19
|
constructor(message, code, className) {
|
|
@@ -21,6 +21,41 @@ class RxapFormSystemError extends RxapError {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const RXAP_FORM_CONTROL_SOURCE = new InjectionToken('rxap/forms/data-source');
|
|
25
|
+
class ControlDataSource extends BaseDataSource {
|
|
26
|
+
constructor(control, metadata = null) {
|
|
27
|
+
super(metadata);
|
|
28
|
+
this.control = control;
|
|
29
|
+
}
|
|
30
|
+
init() {
|
|
31
|
+
if (this._initialised) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
super.init();
|
|
35
|
+
if (isDevMode()) {
|
|
36
|
+
console.log(this.control);
|
|
37
|
+
}
|
|
38
|
+
this._data$ = this.control.valueChanges.pipe(startWith(this.control.value), distinctUntilChanged((a, b) => equals(a, b)), shareReplay(1));
|
|
39
|
+
}
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource, deps: [{ token: RXAP_FORM_CONTROL_SOURCE }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
41
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource }); }
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource, decorators: [{
|
|
44
|
+
type: Injectable
|
|
45
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
46
|
+
type: Inject,
|
|
47
|
+
args: [RXAP_FORM_CONTROL_SOURCE]
|
|
48
|
+
}] }, { type: undefined, decorators: [{
|
|
49
|
+
type: Optional
|
|
50
|
+
}, {
|
|
51
|
+
type: Inject,
|
|
52
|
+
args: [RXAP_DATA_SOURCE_METADATA]
|
|
53
|
+
}] }]; } });
|
|
54
|
+
function controlDataSource(control) {
|
|
55
|
+
// TODO : remove as any (wait for @rxap/forms update)
|
|
56
|
+
return new ControlDataSource(control, { id: control.controlId });
|
|
57
|
+
}
|
|
58
|
+
|
|
24
59
|
var FormSystemMetadataKeys;
|
|
25
60
|
(function (FormSystemMetadataKeys) {
|
|
26
61
|
FormSystemMetadataKeys["COMPONENTS"] = "rxap/form-system/components";
|
|
@@ -42,6 +77,108 @@ class ExtractDataSourcesMixin {
|
|
|
42
77
|
}
|
|
43
78
|
}
|
|
44
79
|
|
|
80
|
+
class ExtractControlFromParentMixin {
|
|
81
|
+
extractControlFromParent(parent, controlPath) {
|
|
82
|
+
if (!controlPath) {
|
|
83
|
+
throw new RxapFormSystemError('The control path is empty', '');
|
|
84
|
+
}
|
|
85
|
+
if (!parent.control) {
|
|
86
|
+
throw new RxapFormSystemError('The control property of ControlContainer is not defined', '');
|
|
87
|
+
}
|
|
88
|
+
const control = parent.control.get(controlPath);
|
|
89
|
+
if (!control) {
|
|
90
|
+
throw new RxapFormSystemError('Could not find the control instance', '');
|
|
91
|
+
}
|
|
92
|
+
if (!(control instanceof RxapFormControl) && !(control instanceof RxapFormGroup) && !(control instanceof RxapFormArray)) {
|
|
93
|
+
throw new RxapFormSystemError('The extracted control is not a RxapFormControl', '');
|
|
94
|
+
}
|
|
95
|
+
return control;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
class ExtractFormDefinitionMixin {
|
|
100
|
+
// TODO : change to AbstractControl from @rxap/forms
|
|
101
|
+
extractFormDefinition(control) {
|
|
102
|
+
const formDefinition = control.rxapFormDefinition;
|
|
103
|
+
if (!formDefinition) {
|
|
104
|
+
throw new RxapFormSystemError('Could not find the form definition instance', '');
|
|
105
|
+
}
|
|
106
|
+
return formDefinition;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function UseDataSource(dataSource, name, settings) {
|
|
111
|
+
return function (target, propertyKey) {
|
|
112
|
+
const value = { dataSource, settings };
|
|
113
|
+
setMetadataMapMap(propertyKey, name, value, FormSystemMetadataKeys.DATA_SOURCES, target);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
class ExtractControlMixin {
|
|
118
|
+
extractControl(ngControl = this.ngControl ?? this.matFormField?._control?.ngControl ?? null) {
|
|
119
|
+
if (!ngControl) {
|
|
120
|
+
throw new Error('The ngControl is not defined!');
|
|
121
|
+
}
|
|
122
|
+
if (!(ngControl instanceof NgControl)) {
|
|
123
|
+
throw new Error('The AbstractControlDirective is not a NgControl!');
|
|
124
|
+
}
|
|
125
|
+
this.ngControl = ngControl;
|
|
126
|
+
const control = this.ngControl.control;
|
|
127
|
+
if (!(control instanceof RxapFormControl)) {
|
|
128
|
+
throw new Error('Control is not a RxapFormControl!');
|
|
129
|
+
}
|
|
130
|
+
return this.control = control;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const DATA_SOURCE_NAME = 'options';
|
|
135
|
+
function ComposeOptionsTransformers(...fnc) {
|
|
136
|
+
return base => fnc.reduce((source, transform) => transform(source), base);
|
|
137
|
+
}
|
|
138
|
+
function UseOptionsDataSource(dataSource, settings) {
|
|
139
|
+
return function (target, propertyKey) {
|
|
140
|
+
UseDataSource(dataSource, DATA_SOURCE_NAME, settings)(target, propertyKey);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
|
|
144
|
+
extractOptionsDatasource(control) {
|
|
145
|
+
control ??= this.extractControl();
|
|
146
|
+
if (!(control instanceof RxapFormControl)) {
|
|
147
|
+
throw new Error('Ensure to use a RxapFromControl');
|
|
148
|
+
}
|
|
149
|
+
const formDefinition = this.extractFormDefinition(control);
|
|
150
|
+
const useDataSourceValueMap = this.extractDataSources(formDefinition, control.controlId);
|
|
151
|
+
if (!useDataSourceValueMap.has('options')) {
|
|
152
|
+
throw new Error(`The data source with the name 'options' is not defined`);
|
|
153
|
+
}
|
|
154
|
+
const useDataSourceValue = this.useDataSourceValue = useDataSourceValueMap.get('options');
|
|
155
|
+
this.settings = this.useDataSourceValue.settings ?? {};
|
|
156
|
+
let dataSource;
|
|
157
|
+
try {
|
|
158
|
+
dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource, this.metadata, this.injector);
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
if (e.name && e.name === 'NullInjectorError') {
|
|
162
|
+
if (isDevMode()) {
|
|
163
|
+
console.error('Cloud not inject the options data source', this.useDataSourceValue);
|
|
164
|
+
}
|
|
165
|
+
throw new Error('Cloud not inject the options data source:\n' + e.message);
|
|
166
|
+
}
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
if (this.settings?.transformer) {
|
|
170
|
+
dataSource = new PipeDataSource(dataSource, map(this.settings.transformer), tap(options => useDataSourceValue.lastValue = options));
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
dataSource = new PipeDataSource(dataSource, tap(options => useDataSourceValue.lastValue = options));
|
|
174
|
+
}
|
|
175
|
+
return this.dataSource = dataSource;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
ExtractOptionsDataSourceMixin = __decorate([
|
|
179
|
+
Mixin(ExtractControlMixin, ExtractFormDefinitionMixin, ExtractDataSourcesMixin)
|
|
180
|
+
], ExtractOptionsDataSourceMixin);
|
|
181
|
+
|
|
45
182
|
let FormSystemControlDirective = class FormSystemControlDirective {
|
|
46
183
|
constructor(parent, cfr, viewContainerRef, dataSourceLoader, injector) {
|
|
47
184
|
this.parent = parent;
|
|
@@ -138,7 +275,7 @@ let FormSystemControlDirective = class FormSystemControlDirective {
|
|
|
138
275
|
return map.get(this.controlId);
|
|
139
276
|
}
|
|
140
277
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemControlDirective, deps: [{ token: ControlContainer }, { token: ComponentFactoryResolver }, { token: ViewContainerRef }, { token: DataSourceLoader }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
141
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: FormSystemControlDirective, selector: "[rxapFormSystemControl]", inputs: { controlId: "controlId" }, ngImport: i0 }); }
|
|
278
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: FormSystemControlDirective, isStandalone: true, selector: "[rxapFormSystemControl]", inputs: { controlId: "controlId" }, ngImport: i0 }); }
|
|
142
279
|
};
|
|
143
280
|
__decorate([
|
|
144
281
|
Required,
|
|
@@ -163,7 +300,8 @@ FormSystemControlDirective = __decorate([
|
|
|
163
300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemControlDirective, decorators: [{
|
|
164
301
|
type: Directive,
|
|
165
302
|
args: [{
|
|
166
|
-
selector: '[rxapFormSystemControl]'
|
|
303
|
+
selector: '[rxapFormSystemControl]',
|
|
304
|
+
standalone: true
|
|
167
305
|
}]
|
|
168
306
|
}], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
|
|
169
307
|
type: Inject,
|
|
@@ -184,157 +322,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
184
322
|
type: Input
|
|
185
323
|
}], control: [], componentRef: [] } });
|
|
186
324
|
|
|
187
|
-
class FormSystemModule {
|
|
188
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
189
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: FormSystemModule, declarations: [FormSystemControlDirective], exports: [FormSystemControlDirective] }); }
|
|
190
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemModule }); }
|
|
191
|
-
}
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemModule, decorators: [{
|
|
193
|
-
type: NgModule,
|
|
194
|
-
args: [{
|
|
195
|
-
declarations: [FormSystemControlDirective],
|
|
196
|
-
exports: [FormSystemControlDirective],
|
|
197
|
-
imports: []
|
|
198
|
-
}]
|
|
199
|
-
}] });
|
|
200
|
-
|
|
201
|
-
const RXAP_FORM_CONTROL_SOURCE = new InjectionToken('rxap/forms/data-source');
|
|
202
|
-
class ControlDataSource extends BaseDataSource {
|
|
203
|
-
constructor(control, metadata = null) {
|
|
204
|
-
super(metadata);
|
|
205
|
-
this.control = control;
|
|
206
|
-
}
|
|
207
|
-
init() {
|
|
208
|
-
if (this._initialised) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
super.init();
|
|
212
|
-
if (isDevMode()) {
|
|
213
|
-
console.log(this.control);
|
|
214
|
-
}
|
|
215
|
-
this._data$ = this.control.valueChanges.pipe(startWith(this.control.value), distinctUntilChanged((a, b) => equals(a, b)), shareReplay(1));
|
|
216
|
-
}
|
|
217
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource, deps: [{ token: RXAP_FORM_CONTROL_SOURCE }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
218
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource }); }
|
|
219
|
-
}
|
|
220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlDataSource, decorators: [{
|
|
221
|
-
type: Injectable
|
|
222
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
223
|
-
type: Inject,
|
|
224
|
-
args: [RXAP_FORM_CONTROL_SOURCE]
|
|
225
|
-
}] }, { type: undefined, decorators: [{
|
|
226
|
-
type: Optional
|
|
227
|
-
}, {
|
|
228
|
-
type: Inject,
|
|
229
|
-
args: [RXAP_DATA_SOURCE_METADATA]
|
|
230
|
-
}] }]; } });
|
|
231
|
-
function controlDataSource(control) {
|
|
232
|
-
// TODO : remove as any (wait for @rxap/forms update)
|
|
233
|
-
return new ControlDataSource(control, { id: control.controlId });
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
class ExtractControlFromParentMixin {
|
|
237
|
-
extractControlFromParent(parent, controlPath) {
|
|
238
|
-
if (!controlPath) {
|
|
239
|
-
throw new RxapFormSystemError('The control path is empty', '');
|
|
240
|
-
}
|
|
241
|
-
if (!parent.control) {
|
|
242
|
-
throw new RxapFormSystemError('The control property of ControlContainer is not defined', '');
|
|
243
|
-
}
|
|
244
|
-
const control = parent.control.get(controlPath);
|
|
245
|
-
if (!control) {
|
|
246
|
-
throw new RxapFormSystemError('Could not find the control instance', '');
|
|
247
|
-
}
|
|
248
|
-
if (!(control instanceof RxapFormControl) && !(control instanceof RxapFormGroup) && !(control instanceof RxapFormArray)) {
|
|
249
|
-
throw new RxapFormSystemError('The extracted control is not a RxapFormControl', '');
|
|
250
|
-
}
|
|
251
|
-
return control;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
class ExtractFormDefinitionMixin {
|
|
256
|
-
// TODO : change to AbstractControl from @rxap/forms
|
|
257
|
-
extractFormDefinition(control) {
|
|
258
|
-
const formDefinition = control.rxapFormDefinition;
|
|
259
|
-
if (!formDefinition) {
|
|
260
|
-
throw new RxapFormSystemError('Could not find the form definition instance', '');
|
|
261
|
-
}
|
|
262
|
-
return formDefinition;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function UseDataSource(dataSource, name, settings) {
|
|
267
|
-
return function (target, propertyKey) {
|
|
268
|
-
const value = { dataSource, settings };
|
|
269
|
-
setMetadataMapMap(propertyKey, name, value, FormSystemMetadataKeys.DATA_SOURCES, target);
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
class ExtractControlMixin {
|
|
274
|
-
extractControl(ngControl = this.ngControl ?? this.matFormField?._control?.ngControl ?? null) {
|
|
275
|
-
if (!ngControl) {
|
|
276
|
-
throw new Error('The ngControl is not defined!');
|
|
277
|
-
}
|
|
278
|
-
if (!(ngControl instanceof NgControl)) {
|
|
279
|
-
throw new Error('The AbstractControlDirective is not a NgControl!');
|
|
280
|
-
}
|
|
281
|
-
this.ngControl = ngControl;
|
|
282
|
-
const control = this.ngControl.control;
|
|
283
|
-
if (!(control instanceof RxapFormControl)) {
|
|
284
|
-
throw new Error('Control is not a RxapFormControl!');
|
|
285
|
-
}
|
|
286
|
-
return this.control = control;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
const DATA_SOURCE_NAME = 'options';
|
|
291
|
-
function ComposeOptionsTransformers(...fnc) {
|
|
292
|
-
return base => fnc.reduce((source, transform) => transform(source), base);
|
|
293
|
-
}
|
|
294
|
-
function UseOptionsDataSource(dataSource, settings) {
|
|
295
|
-
return function (target, propertyKey) {
|
|
296
|
-
UseDataSource(dataSource, DATA_SOURCE_NAME, settings)(target, propertyKey);
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
|
|
300
|
-
extractOptionsDatasource(control) {
|
|
301
|
-
control ??= this.extractControl();
|
|
302
|
-
if (!(control instanceof RxapFormControl)) {
|
|
303
|
-
throw new Error('Ensure to use a RxapFromControl');
|
|
304
|
-
}
|
|
305
|
-
const formDefinition = this.extractFormDefinition(control);
|
|
306
|
-
const useDataSourceValueMap = this.extractDataSources(formDefinition, control.controlId);
|
|
307
|
-
if (!useDataSourceValueMap.has('options')) {
|
|
308
|
-
throw new Error(`The data source with the name 'options' is not defined`);
|
|
309
|
-
}
|
|
310
|
-
const useDataSourceValue = this.useDataSourceValue = useDataSourceValueMap.get('options');
|
|
311
|
-
this.settings = this.useDataSourceValue.settings ?? {};
|
|
312
|
-
let dataSource;
|
|
313
|
-
try {
|
|
314
|
-
dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource, this.metadata, this.injector);
|
|
315
|
-
}
|
|
316
|
-
catch (e) {
|
|
317
|
-
if (e.name && e.name === 'NullInjectorError') {
|
|
318
|
-
if (isDevMode()) {
|
|
319
|
-
console.error('Cloud not inject the options data source', this.useDataSourceValue);
|
|
320
|
-
}
|
|
321
|
-
throw new Error('Cloud not inject the options data source:\n' + e.message);
|
|
322
|
-
}
|
|
323
|
-
throw e;
|
|
324
|
-
}
|
|
325
|
-
if (this.settings?.transformer) {
|
|
326
|
-
dataSource = new PipeDataSource(dataSource, map(this.settings.transformer), tap(options => useDataSourceValue.lastValue = options));
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
dataSource = new PipeDataSource(dataSource, tap(options => useDataSourceValue.lastValue = options));
|
|
330
|
-
}
|
|
331
|
-
return this.dataSource = dataSource;
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
ExtractOptionsDataSourceMixin = __decorate([
|
|
335
|
-
Mixin(ExtractControlMixin, ExtractFormDefinitionMixin, ExtractDataSourcesMixin)
|
|
336
|
-
], ExtractOptionsDataSourceMixin);
|
|
337
|
-
|
|
338
325
|
function UseComponent(component, setProperties = {}) {
|
|
339
326
|
return function (target, propertyKey) {
|
|
340
327
|
setMetadataMap(propertyKey, component, FormSystemMetadataKeys.COMPONENTS, target);
|
|
@@ -476,7 +463,7 @@ let ControlHideShowDirective = class ControlHideShowDirective {
|
|
|
476
463
|
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
|
|
477
464
|
}
|
|
478
465
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirective, deps: [{ token: Renderer2 }, { token: ElementRef }, { token: ControlContainer, optional: true }, { token: NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
479
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: ControlHideShowDirective, selector: "[rxapControlHideShow]", inputs: { controlId: ["rxapControlHideShow", "controlId"] }, ngImport: i0 }); }
|
|
466
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: ControlHideShowDirective, isStandalone: true, selector: "[rxapControlHideShow]", inputs: { controlId: ["rxapControlHideShow", "controlId"] }, ngImport: i0 }); }
|
|
480
467
|
};
|
|
481
468
|
ControlHideShowDirective = __decorate([
|
|
482
469
|
Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin),
|
|
@@ -486,7 +473,8 @@ ControlHideShowDirective = __decorate([
|
|
|
486
473
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirective, decorators: [{
|
|
487
474
|
type: Directive,
|
|
488
475
|
args: [{
|
|
489
|
-
selector: '[rxapControlHideShow]'
|
|
476
|
+
selector: '[rxapControlHideShow]',
|
|
477
|
+
standalone: true
|
|
490
478
|
}]
|
|
491
479
|
}], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
|
|
492
480
|
type: Inject,
|
|
@@ -510,18 +498,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
510
498
|
type: Input,
|
|
511
499
|
args: ['rxapControlHideShow']
|
|
512
500
|
}] } });
|
|
513
|
-
class ControlHideShowDirectiveModule {
|
|
514
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
515
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirectiveModule, declarations: [ControlHideShowDirective], exports: [ControlHideShowDirective] }); }
|
|
516
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirectiveModule }); }
|
|
517
|
-
}
|
|
518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirectiveModule, decorators: [{
|
|
519
|
-
type: NgModule,
|
|
520
|
-
args: [{
|
|
521
|
-
declarations: [ControlHideShowDirective],
|
|
522
|
-
exports: [ControlHideShowDirective]
|
|
523
|
-
}]
|
|
524
|
-
}] });
|
|
525
501
|
|
|
526
502
|
let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
527
503
|
constructor(template, dataSourceLoader, viewContainerRef, injector, cdr,
|
|
@@ -624,8 +600,8 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
624
600
|
}
|
|
625
601
|
this.cdr.detectChanges();
|
|
626
602
|
}
|
|
627
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirective, deps: [{ token: TemplateRef }, { token: DataSourceLoader }, { token: ViewContainerRef }, { token: INJECTOR }, { token: ChangeDetectorRef }, { token: NgControl, optional: true }, { token:
|
|
628
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: InputSelectOptionsDirective, selector: "[rxapInputSelectOptions]", inputs: { viewer: ["rxapInputSelectOptionsViewer", "viewer"], metadata: ["rxapInputSelectOptionsMetadata", "metadata"], matAutocomplete: ["rxapInputSelectOptionsMatAutocomplete", "matAutocomplete"] }, ngImport: i0 }); }
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirective, deps: [{ token: TemplateRef }, { token: DataSourceLoader }, { token: ViewContainerRef }, { token: INJECTOR }, { token: ChangeDetectorRef }, { token: NgControl, optional: true }, { token: MAT_FORM_FIELD, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
604
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: InputSelectOptionsDirective, isStandalone: true, selector: "[rxapInputSelectOptions]", inputs: { viewer: ["rxapInputSelectOptionsViewer", "viewer"], metadata: ["rxapInputSelectOptionsMetadata", "metadata"], matAutocomplete: ["rxapInputSelectOptionsMatAutocomplete", "matAutocomplete"] }, ngImport: i0 }); }
|
|
629
605
|
};
|
|
630
606
|
__decorate([
|
|
631
607
|
Required,
|
|
@@ -646,7 +622,8 @@ InputSelectOptionsDirective = __decorate([
|
|
|
646
622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirective, decorators: [{
|
|
647
623
|
type: Directive,
|
|
648
624
|
args: [{
|
|
649
|
-
selector: '[rxapInputSelectOptions]'
|
|
625
|
+
selector: '[rxapInputSelectOptions]',
|
|
626
|
+
standalone: true
|
|
650
627
|
}]
|
|
651
628
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
652
629
|
type: Inject,
|
|
@@ -668,11 +645,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
668
645
|
}, {
|
|
669
646
|
type: Inject,
|
|
670
647
|
args: [NgControl]
|
|
671
|
-
}] }, { type: i3.
|
|
648
|
+
}] }, { type: i3.MatFormField, decorators: [{
|
|
672
649
|
type: Optional
|
|
673
650
|
}, {
|
|
674
651
|
type: Inject,
|
|
675
|
-
args: [
|
|
652
|
+
args: [MAT_FORM_FIELD]
|
|
676
653
|
}] }]; }, propDecorators: { viewer: [{
|
|
677
654
|
type: Input,
|
|
678
655
|
args: ['rxapInputSelectOptionsViewer']
|
|
@@ -683,35 +660,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
683
660
|
type: Input,
|
|
684
661
|
args: ['rxapInputSelectOptionsMatAutocomplete']
|
|
685
662
|
}], control: [], dataSource: [] } });
|
|
686
|
-
class InputSelectOptionsDirectiveModule {
|
|
687
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
688
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirectiveModule, declarations: [InputSelectOptionsDirective], exports: [InputSelectOptionsDirective] }); }
|
|
689
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirectiveModule }); }
|
|
690
|
-
}
|
|
691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirectiveModule, decorators: [{
|
|
692
|
-
type: NgModule,
|
|
693
|
-
args: [{
|
|
694
|
-
declarations: [InputSelectOptionsDirective],
|
|
695
|
-
exports: [InputSelectOptionsDirective]
|
|
696
|
-
}]
|
|
697
|
-
}] });
|
|
698
|
-
|
|
699
|
-
class FormSystemDirectivesModule {
|
|
700
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
701
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: FormSystemDirectivesModule, exports: [InputSelectOptionsDirectiveModule,
|
|
702
|
-
ControlHideShowDirectiveModule] }); }
|
|
703
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemDirectivesModule, imports: [InputSelectOptionsDirectiveModule,
|
|
704
|
-
ControlHideShowDirectiveModule] }); }
|
|
705
|
-
}
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemDirectivesModule, decorators: [{
|
|
707
|
-
type: NgModule,
|
|
708
|
-
args: [{
|
|
709
|
-
exports: [
|
|
710
|
-
InputSelectOptionsDirectiveModule,
|
|
711
|
-
ControlHideShowDirectiveModule
|
|
712
|
-
]
|
|
713
|
-
}]
|
|
714
|
-
}] });
|
|
715
663
|
|
|
716
664
|
class IsEqualToDirective {
|
|
717
665
|
set equalTo(value) {
|
|
@@ -736,7 +684,7 @@ class IsEqualToDirective {
|
|
|
736
684
|
this._onChange = fn;
|
|
737
685
|
}
|
|
738
686
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
739
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: IsEqualToDirective, selector: "[rxapIsEqualTo]", inputs: { equalTo: ["rxapIsEqualTo", "equalTo"] }, providers: [
|
|
687
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: IsEqualToDirective, isStandalone: true, selector: "[rxapIsEqualTo]", inputs: { equalTo: ["rxapIsEqualTo", "equalTo"] }, providers: [
|
|
740
688
|
{
|
|
741
689
|
provide: NG_VALIDATORS,
|
|
742
690
|
multi: true,
|
|
@@ -759,24 +707,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
759
707
|
multi: true,
|
|
760
708
|
useExisting: forwardRef(() => IsEqualToDirective)
|
|
761
709
|
}
|
|
762
|
-
]
|
|
710
|
+
],
|
|
711
|
+
standalone: true
|
|
763
712
|
}]
|
|
764
713
|
}], propDecorators: { equalTo: [{
|
|
765
714
|
type: Input,
|
|
766
715
|
args: ['rxapIsEqualTo']
|
|
767
716
|
}] } });
|
|
768
|
-
class IsEqualToDirectiveModule {
|
|
769
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
770
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirectiveModule, declarations: [IsEqualToDirective], exports: [IsEqualToDirective] }); }
|
|
771
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirectiveModule }); }
|
|
772
|
-
}
|
|
773
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirectiveModule, decorators: [{
|
|
774
|
-
type: NgModule,
|
|
775
|
-
args: [{
|
|
776
|
-
declarations: [IsEqualToDirective],
|
|
777
|
-
exports: [IsEqualToDirective]
|
|
778
|
-
}]
|
|
779
|
-
}] });
|
|
780
717
|
|
|
781
718
|
var IsSelectableValueDirective_1;
|
|
782
719
|
let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectableValueDirective {
|
|
@@ -812,7 +749,7 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
|
|
|
812
749
|
return null;
|
|
813
750
|
}
|
|
814
751
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirective, deps: [{ token: DataSourceLoader }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
815
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: IsSelectableValueDirective, selector: "[rxapIsSelectableValue]", inputs: { viewer: "viewer" }, providers: [
|
|
752
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: IsSelectableValueDirective, isStandalone: true, selector: "[rxapIsSelectableValue]", inputs: { viewer: "viewer" }, providers: [
|
|
816
753
|
{
|
|
817
754
|
provide: NG_VALIDATORS,
|
|
818
755
|
multi: true,
|
|
@@ -835,7 +772,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
835
772
|
multi: true,
|
|
836
773
|
useExisting: forwardRef(() => IsSelectableValueDirective)
|
|
837
774
|
}
|
|
838
|
-
]
|
|
775
|
+
],
|
|
776
|
+
standalone: true
|
|
839
777
|
}]
|
|
840
778
|
}], ctorParameters: function () { return [{ type: i1$1.DataSourceLoader, decorators: [{
|
|
841
779
|
type: Inject,
|
|
@@ -846,18 +784,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
846
784
|
}] }]; }, propDecorators: { viewer: [{
|
|
847
785
|
type: Input
|
|
848
786
|
}] } });
|
|
849
|
-
class IsSelectableValueDirectiveModule {
|
|
850
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
851
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirectiveModule, declarations: [IsSelectableValueDirective], exports: [IsSelectableValueDirective] }); }
|
|
852
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirectiveModule }); }
|
|
853
|
-
}
|
|
854
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirectiveModule, decorators: [{
|
|
855
|
-
type: NgModule,
|
|
856
|
-
args: [{
|
|
857
|
-
declarations: [IsSelectableValueDirective],
|
|
858
|
-
exports: [IsSelectableValueDirective]
|
|
859
|
-
}]
|
|
860
|
-
}] });
|
|
861
787
|
|
|
862
788
|
// endregion
|
|
863
789
|
|
|
@@ -865,5 +791,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
865
791
|
* Generated bundle index. Do not edit.
|
|
866
792
|
*/
|
|
867
793
|
|
|
868
|
-
export { ComposeOptionsTransformers, ControlDataSource, ControlHideShowDirective,
|
|
794
|
+
export { ComposeOptionsTransformers, ControlDataSource, ControlHideShowDirective, DATA_SOURCE_NAME, ExtractControlFromParentMixin, ExtractControlMixin, ExtractDataSourcesMixin, ExtractFormDefinitionMixin, ExtractOptionsDataSourceMixin, FormSystemControlDirective, FormSystemMetadataKeys, InputSelectOptionsDirective, IsEqualToDirective, IsSelectableValueDirective, RXAP_FORM_CONTROL_SOURCE, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_SHOW_METADATA, RxapFormSystemError, UseComponent, UseDataSource, UseFormComponent, UseHideFunction, UseOptionsDataSource, UseShowFunction, controlDataSource };
|
|
869
795
|
//# sourceMappingURL=rxap-form-system.mjs.map
|