@rxap/form-system 16.0.0-dev.0 → 16.0.0-dev.10

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +338 -0
  2. package/LICENSE +621 -21
  3. package/LICENSE.md +621 -0
  4. package/README.md +7 -22
  5. package/esm2022/index.mjs +4 -2
  6. package/esm2022/lib/control-data-source.mjs +7 -8
  7. package/esm2022/lib/control-with-data-source.mjs +1 -1
  8. package/esm2022/lib/decorators/metadata-keys.mjs +1 -1
  9. package/esm2022/lib/decorators/use-component.mjs +2 -2
  10. package/esm2022/lib/decorators/use-data-source.mjs +6 -3
  11. package/esm2022/lib/decorators/use-form-component.mjs +2 -2
  12. package/esm2022/lib/directives/control-hide-show.directive.mjs +13 -26
  13. package/esm2022/lib/directives/form-directives.module.mjs +17 -14
  14. package/esm2022/lib/directives/input-select-options.directive.mjs +33 -44
  15. package/esm2022/lib/directives/options-from-remote-method.directive.mjs +131 -0
  16. package/esm2022/lib/error.mjs +1 -1
  17. package/esm2022/lib/form-context-from-activated-route.factory.mjs +4 -0
  18. package/esm2022/lib/form-system-control.directive.mjs +15 -27
  19. package/esm2022/lib/mixins/extract-control-from-parent.mixin.mjs +5 -3
  20. package/esm2022/lib/mixins/extract-control.mixin.mjs +5 -3
  21. package/esm2022/lib/mixins/extract-data-sources.mixin.mjs +2 -2
  22. package/esm2022/lib/mixins/extract-form-definition.mixin.mjs +1 -1
  23. package/esm2022/lib/mixins/extract-options-data-source.mixin.mjs +9 -10
  24. package/esm2022/lib/submit-context-form-adapter.factory.mjs +35 -0
  25. package/esm2022/lib/validators/is-equal-to.mjs +23 -35
  26. package/esm2022/lib/validators/is-selectable-value.directive.mjs +21 -29
  27. package/esm2022/rxap-form-system.mjs +1 -1
  28. package/fesm2022/rxap-form-system.mjs +397 -287
  29. package/fesm2022/rxap-form-system.mjs.map +1 -1
  30. package/index.d.ts +3 -1
  31. package/lib/directives/control-hide-show.directive.d.ts +2 -7
  32. package/lib/directives/form-directives.module.d.ts +1 -1
  33. package/lib/directives/input-select-options.directive.d.ts +6 -11
  34. package/lib/directives/options-from-remote-method.directive.d.ts +38 -0
  35. package/lib/form-context-from-activated-route.factory.d.ts +2 -0
  36. package/lib/form-system-control.directive.d.ts +2 -2
  37. package/lib/mixins/extract-control.mixin.d.ts +2 -2
  38. package/lib/mixins/extract-form-definition.mixin.d.ts +1 -1
  39. package/lib/mixins/extract-options-data-source.mixin.d.ts +6 -7
  40. package/lib/submit-context-form-adapter.factory.d.ts +13 -0
  41. package/lib/validators/is-equal-to.d.ts +1 -6
  42. package/lib/validators/is-selectable-value.directive.d.ts +1 -6
  43. package/package.json +74 -53
  44. package/theme.css +1 -0
  45. package/collection.json +0 -10
  46. package/esm2022/lib/form-system.module.mjs +0 -18
  47. package/lib/form-system.module.d.ts +0 -7
  48. package/migration.json +0 -4
  49. package/src/schematics/ng-add/index.d.ts +0 -2
  50. package/src/schematics/ng-add/index.js +0 -8
  51. package/src/schematics/ng-add/index.js.map +0 -1
  52. package/src/schematics/ng-add/schema.json +0 -7
@@ -1,19 +1,21 @@
1
+ import { RxapError, equals } 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 { ComponentFactoryResolver, ViewContainerRef, INJECTOR, ComponentRef, Injector, Directive, Inject, Input, NgModule, InjectionToken, isDevMode, Injectable, Optional, Renderer2, ElementRef, Self, TemplateRef, ChangeDetectorRef, forwardRef } from '@angular/core';
5
+ import { InjectionToken, isDevMode, Injectable, Inject, Optional, TemplateRef, ViewContainerRef, INJECTOR, ChangeDetectorRef, Injector, Directive, Input, ComponentFactoryResolver, Renderer2, ElementRef, Self, NgModule, forwardRef } from '@angular/core';
6
+ import { startWith, distinctUntilChanged, shareReplay, map, tap, catchError, throttleTime, switchMap } from 'rxjs/operators';
7
+ import * as i2 from '@rxap/remote-method';
8
+ import { ProxyRemoteMethod, RemoteMethodLoader } from '@rxap/remote-method';
9
+ import { RXAP_FORM_CONTEXT, RxapFormControl, RxapFormGroup, RxapFormArray } from '@rxap/forms';
3
10
  import { __decorate, __metadata } from 'tslib';
4
- import { RxapError, Required, equals } from '@rxap/utilities';
5
11
  import * as i1 from '@angular/forms';
6
- import { ControlContainer, NgControl, NG_VALIDATORS } from '@angular/forms';
7
- import { RxapFormControl, RxapFormGroup, RxapFormArray } from '@rxap/forms';
8
- import * as i1$1 from '@rxap/data-source';
9
- import { PipeDataSource, DataSourceLoader, BaseDataSource, RXAP_DATA_SOURCE_METADATA } from '@rxap/data-source';
12
+ import { NgControl, ControlContainer, NG_VALIDATORS } from '@angular/forms';
10
13
  import { Mixin } from '@rxap/mixin';
11
- import { getMetadata, setMetadataMapMap, setMetadataMap, setMetadata } from '@rxap/utilities/reflect-metadata';
12
- import { map, startWith, distinctUntilChanged, shareReplay, tap, catchError, throttleTime, switchMap } from 'rxjs/operators';
14
+ import { setMetadataMapMap, getMetadata, setMetadataMap, setMetadata } from '@rxap/reflect-metadata';
13
15
  import { Subscription, of, EMPTY } from 'rxjs';
14
- import * as i3 from '@angular/material/legacy-form-field';
15
- import { MAT_LEGACY_FORM_FIELD } from '@angular/material/legacy-form-field';
16
- import '@angular/material/legacy-autocomplete';
16
+ import * as i3 from '@angular/material/form-field';
17
+ import { MAT_FORM_FIELD } from '@angular/material/form-field';
18
+ import '@angular/material/autocomplete';
17
19
 
18
20
  class RxapFormSystemError extends RxapError {
19
21
  constructor(message, code, className) {
@@ -21,6 +23,206 @@ class RxapFormSystemError extends RxapError {
21
23
  }
22
24
  }
23
25
 
26
+ const RXAP_FORM_CONTROL_SOURCE = new InjectionToken('rxap/forms/data-source');
27
+ class ControlDataSource extends BaseDataSource {
28
+ constructor(control, metadata = null) {
29
+ super(metadata);
30
+ this.control = control;
31
+ }
32
+ init() {
33
+ if (this._initialised) {
34
+ return;
35
+ }
36
+ super.init();
37
+ if (isDevMode()) {
38
+ console.log(this.control);
39
+ }
40
+ this._data$ = this.control.valueChanges.pipe(startWith(this.control.value), distinctUntilChanged((a, b) => equals(a, b)), shareReplay(1));
41
+ }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlDataSource, deps: [{ token: RXAP_FORM_CONTROL_SOURCE }, { token: RXAP_DATA_SOURCE_METADATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
43
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlDataSource }); }
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlDataSource, decorators: [{
46
+ type: Injectable
47
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
48
+ type: Inject,
49
+ args: [RXAP_FORM_CONTROL_SOURCE]
50
+ }] }, { type: undefined, decorators: [{
51
+ type: Optional
52
+ }, {
53
+ type: Inject,
54
+ args: [RXAP_DATA_SOURCE_METADATA]
55
+ }] }]; } });
56
+ function controlDataSource(control) {
57
+ // TODO : remove as any (wait for @rxap/forms update)
58
+ return new ControlDataSource(control, { id: control.controlId });
59
+ }
60
+
61
+ function FormContextFromActivatedRouteFactory(route) {
62
+ return route.snapshot.params;
63
+ }
64
+
65
+ const SUBMIT_CONTEXT_FORM_ADAPTER_METHOD = new InjectionToken('submit-context-form-adapter-method');
66
+ class SubmitContextFormAdapter extends ProxyRemoteMethod {
67
+ constructor(remoteMethod, context) {
68
+ super(remoteMethod);
69
+ this.context = context;
70
+ }
71
+ transformParameters(value) {
72
+ if (!this.context) {
73
+ throw new Error('The provided context is null');
74
+ }
75
+ return {
76
+ parameters: this.context,
77
+ requestBody: value,
78
+ };
79
+ }
80
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SubmitContextFormAdapter, deps: [{ token: SUBMIT_CONTEXT_FORM_ADAPTER_METHOD }, { token: RXAP_FORM_CONTEXT }], target: i0.ɵɵFactoryTarget.Injectable }); }
81
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SubmitContextFormAdapter }); }
82
+ }
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SubmitContextFormAdapter, decorators: [{
84
+ type: Injectable
85
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
86
+ type: Inject,
87
+ args: [SUBMIT_CONTEXT_FORM_ADAPTER_METHOD]
88
+ }] }, { type: undefined, decorators: [{
89
+ type: Inject,
90
+ args: [RXAP_FORM_CONTEXT]
91
+ }] }]; } });
92
+ function SubmitContextFormAdapterFactory(remoteMethod, context) {
93
+ return new SubmitContextFormAdapter(remoteMethod, context);
94
+ }
95
+
96
+ class ExtractFormDefinitionMixin {
97
+ // TODO : change to AbstractControl from @rxap/forms
98
+ extractFormDefinition(control) {
99
+ const formDefinition = control.rxapFormDefinition;
100
+ if (!formDefinition) {
101
+ throw new RxapFormSystemError('Could not find the form definition instance', '');
102
+ }
103
+ return formDefinition;
104
+ }
105
+ }
106
+
107
+ const REMOTE_METHOD_NAME = 'options';
108
+ const RXAP_USE_REMOTE_METHOD = 'rxap/form-system/remote-method/use';
109
+ function UseRemoteMethod(remoteMethod, name) {
110
+ return function (target, propertyKey) {
111
+ setMetadataMapMap(propertyKey, name, remoteMethod, RXAP_USE_REMOTE_METHOD, target);
112
+ };
113
+ }
114
+ function UseOptionsRemoteMethod(dataSource) {
115
+ return function (target, propertyKey) {
116
+ UseRemoteMethod(dataSource, REMOTE_METHOD_NAME)(target, propertyKey);
117
+ };
118
+ }
119
+ class ExtractRemoteMethodsMixin {
120
+ extractRemoteMethods(formDefinition, controlId) {
121
+ const map = getMetadata(RXAP_USE_REMOTE_METHOD, Object.getPrototypeOf(formDefinition));
122
+ if (!map) {
123
+ throw new RxapFormSystemError('Could not extract the use remote method map from the form definition instance', '');
124
+ }
125
+ if (!map.has(controlId)) {
126
+ throw new RxapFormSystemError('A use remote method definition does not exists in the form definition metadata', '');
127
+ }
128
+ return map.get(controlId);
129
+ }
130
+ }
131
+ let OptionsFromRemoteMethodDirective = class OptionsFromRemoteMethodDirective {
132
+ constructor(ngControl, template, remoteMethodLoader, viewContainerRef, injector, cdr) {
133
+ this.ngControl = ngControl;
134
+ this.template = template;
135
+ this.remoteMethodLoader = remoteMethodLoader;
136
+ this.viewContainerRef = viewContainerRef;
137
+ this.injector = injector;
138
+ this.cdr = cdr;
139
+ this.withoutParameters = false;
140
+ }
141
+ ngOnChanges(changes) {
142
+ const parametersChanges = changes['parameters'];
143
+ if (parametersChanges) {
144
+ if (!this.remoteMethodToken) {
145
+ this.remoteMethodToken = this.extractRemoteMethodToken();
146
+ }
147
+ this.renderTemplate(parametersChanges.currentValue);
148
+ }
149
+ if (changes['withoutParameters']?.currentValue) {
150
+ if (!this.remoteMethodToken) {
151
+ this.remoteMethodToken = this.extractRemoteMethodToken();
152
+ }
153
+ this.renderTemplate();
154
+ }
155
+ }
156
+ extractRemoteMethodToken() {
157
+ const control = this.ngControl.control;
158
+ if (!(control instanceof RxapFormControl)) {
159
+ throw new Error('Control is not a RxapFormControl!');
160
+ }
161
+ const formDefinition = this.extractFormDefinition(control);
162
+ const remoteMethodsTokens = this.extractRemoteMethods(formDefinition, control.controlId);
163
+ if (!remoteMethodsTokens.has(REMOTE_METHOD_NAME)) {
164
+ throw new Error(`The remote method with the name 'options' is not defined`);
165
+ }
166
+ return remoteMethodsTokens.get(REMOTE_METHOD_NAME);
167
+ }
168
+ async renderTemplate(parameters) {
169
+ const options = await this.remoteMethodLoader.call$(this.remoteMethodToken, parameters, undefined, this.injector);
170
+ this.viewContainerRef.clear();
171
+ for (const option of options) {
172
+ this.viewContainerRef.createEmbeddedView(this.template, { $implicit: option });
173
+ }
174
+ if (this.resetOnChange !== undefined) {
175
+ this.ngControl.reset(this.resetOnChange);
176
+ }
177
+ this.cdr.detectChanges();
178
+ }
179
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsFromRemoteMethodDirective, deps: [{ token: NgControl }, { token: TemplateRef }, { token: RemoteMethodLoader }, { token: ViewContainerRef }, { token: INJECTOR }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
180
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: OptionsFromRemoteMethodDirective, isStandalone: true, selector: "[rxapOptionsFromRemoteMethod]", inputs: { parameters: ["rxapOptionsFromRemoteMethodParameters", "parameters"], resetOnChange: ["rxapOptionsFromRemoteMethodResetOnChange", "resetOnChange"], withoutParameters: ["rxapOptionsFromRemoteMethodWithoutParameters", "withoutParameters"] }, usesOnChanges: true, ngImport: i0 }); }
181
+ };
182
+ OptionsFromRemoteMethodDirective = __decorate([
183
+ Mixin(ExtractFormDefinitionMixin, ExtractRemoteMethodsMixin),
184
+ __metadata("design:paramtypes", [NgControl,
185
+ TemplateRef,
186
+ RemoteMethodLoader,
187
+ ViewContainerRef,
188
+ Injector,
189
+ ChangeDetectorRef])
190
+ ], OptionsFromRemoteMethodDirective);
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsFromRemoteMethodDirective, decorators: [{
192
+ type: Directive,
193
+ args: [{
194
+ selector: '[rxapOptionsFromRemoteMethod]',
195
+ standalone: true,
196
+ }]
197
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
198
+ type: Inject,
199
+ args: [NgControl]
200
+ }] }, { type: i0.TemplateRef, decorators: [{
201
+ type: Inject,
202
+ args: [TemplateRef]
203
+ }] }, { type: i2.RemoteMethodLoader, decorators: [{
204
+ type: Inject,
205
+ args: [RemoteMethodLoader]
206
+ }] }, { type: i0.ViewContainerRef, decorators: [{
207
+ type: Inject,
208
+ args: [ViewContainerRef]
209
+ }] }, { type: i0.Injector, decorators: [{
210
+ type: Inject,
211
+ args: [INJECTOR]
212
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
213
+ type: Inject,
214
+ args: [ChangeDetectorRef]
215
+ }] }]; }, propDecorators: { parameters: [{
216
+ type: Input,
217
+ args: ['rxapOptionsFromRemoteMethodParameters']
218
+ }], resetOnChange: [{
219
+ type: Input,
220
+ args: ['rxapOptionsFromRemoteMethodResetOnChange']
221
+ }], withoutParameters: [{
222
+ type: Input,
223
+ args: ['rxapOptionsFromRemoteMethodWithoutParameters']
224
+ }] } });
225
+
24
226
  var FormSystemMetadataKeys;
25
227
  (function (FormSystemMetadataKeys) {
26
228
  FormSystemMetadataKeys["COMPONENTS"] = "rxap/form-system/components";
@@ -42,6 +244,104 @@ class ExtractDataSourcesMixin {
42
244
  }
43
245
  }
44
246
 
247
+ class ExtractControlFromParentMixin {
248
+ extractControlFromParent(parent, controlPath) {
249
+ if (!controlPath) {
250
+ throw new RxapFormSystemError('The control path is empty', '');
251
+ }
252
+ if (!parent.control) {
253
+ throw new RxapFormSystemError('The control property of ControlContainer is not defined', '');
254
+ }
255
+ const control = parent.control.get(controlPath);
256
+ if (!control) {
257
+ throw new RxapFormSystemError('Could not find the control instance', '');
258
+ }
259
+ if (!(control instanceof RxapFormControl) &&
260
+ !(control instanceof RxapFormGroup) &&
261
+ !(control instanceof RxapFormArray)) {
262
+ throw new RxapFormSystemError('The extracted control is not a RxapFormControl', '');
263
+ }
264
+ return control;
265
+ }
266
+ }
267
+
268
+ function UseDataSource(dataSource, name, settings) {
269
+ return function (target, propertyKey) {
270
+ const value = {
271
+ dataSource,
272
+ settings,
273
+ };
274
+ setMetadataMapMap(propertyKey, name, value, FormSystemMetadataKeys.DATA_SOURCES, target);
275
+ };
276
+ }
277
+
278
+ class ExtractControlMixin {
279
+ extractControl(ngControl = this.ngControl ??
280
+ this.matFormField?._control?.ngControl ??
281
+ null) {
282
+ if (!ngControl) {
283
+ throw new Error('The ngControl is not defined!');
284
+ }
285
+ if (!(ngControl instanceof NgControl)) {
286
+ throw new Error('The AbstractControlDirective is not a NgControl!');
287
+ }
288
+ this.ngControl = ngControl;
289
+ const control = this.ngControl.control;
290
+ if (!(control instanceof RxapFormControl)) {
291
+ throw new Error('Control is not a RxapFormControl!');
292
+ }
293
+ return this.control = control;
294
+ }
295
+ }
296
+
297
+ const DATA_SOURCE_NAME = 'options';
298
+ function ComposeOptionsTransformers(...fnc) {
299
+ return base => fnc.reduce((source, transform) => transform(source), base);
300
+ }
301
+ function UseOptionsDataSource(dataSource, settings) {
302
+ return function (target, propertyKey) {
303
+ UseDataSource(dataSource, DATA_SOURCE_NAME, settings)(target, propertyKey);
304
+ };
305
+ }
306
+ let ExtractOptionsDataSourceMixin = class ExtractOptionsDataSourceMixin {
307
+ extractOptionsDatasource(control) {
308
+ control ??= this.extractControl();
309
+ if (!(control instanceof RxapFormControl)) {
310
+ throw new Error('Ensure to use a RxapFromControl');
311
+ }
312
+ const formDefinition = this.extractFormDefinition(control);
313
+ const useDataSourceValueMap = this.extractDataSources(formDefinition, control.controlId);
314
+ if (!useDataSourceValueMap.has('options')) {
315
+ throw new Error(`The data source with the name 'options' is not defined`);
316
+ }
317
+ const useDataSourceValue = this.useDataSourceValue = useDataSourceValueMap.get('options');
318
+ this.settings = this.useDataSourceValue.settings ?? {};
319
+ let dataSource;
320
+ try {
321
+ dataSource = this.dataSourceLoader.load(useDataSourceValue.dataSource, this.metadata, this.injector);
322
+ }
323
+ catch (e) {
324
+ if (e.name && e.name === 'NullInjectorError') {
325
+ if (isDevMode()) {
326
+ console.error('Cloud not inject the options data source', this.useDataSourceValue);
327
+ }
328
+ throw new Error('Cloud not inject the options data source:\n' + e.message);
329
+ }
330
+ throw e;
331
+ }
332
+ if (this.settings?.transformer) {
333
+ dataSource = new PipeDataSource(dataSource, map(this.settings.transformer), tap(options => useDataSourceValue.lastValue = options));
334
+ }
335
+ else {
336
+ dataSource = new PipeDataSource(dataSource, tap(options => useDataSourceValue.lastValue = options));
337
+ }
338
+ return this.dataSource = dataSource;
339
+ }
340
+ };
341
+ ExtractOptionsDataSourceMixin = __decorate([
342
+ Mixin(ExtractControlMixin, ExtractFormDefinitionMixin, ExtractDataSourcesMixin)
343
+ ], ExtractOptionsDataSourceMixin);
344
+
45
345
  let FormSystemControlDirective = class FormSystemControlDirective {
46
346
  constructor(parent, cfr, viewContainerRef, dataSourceLoader, injector) {
47
347
  this.parent = parent;
@@ -137,21 +437,9 @@ let FormSystemControlDirective = class FormSystemControlDirective {
137
437
  }
138
438
  return map.get(this.controlId);
139
439
  }
140
- 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 }); }
440
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemControlDirective, deps: [{ token: ControlContainer }, { token: ComponentFactoryResolver }, { token: ViewContainerRef }, { token: DataSourceLoader }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Directive }); }
441
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: FormSystemControlDirective, isStandalone: true, selector: "[rxapFormSystemControl]", inputs: { controlId: "controlId" }, ngImport: i0 }); }
142
442
  };
143
- __decorate([
144
- Required,
145
- __metadata("design:type", String)
146
- ], FormSystemControlDirective.prototype, "controlId", void 0);
147
- __decorate([
148
- Required,
149
- __metadata("design:type", RxapFormControl)
150
- ], FormSystemControlDirective.prototype, "control", void 0);
151
- __decorate([
152
- Required,
153
- __metadata("design:type", ComponentRef)
154
- ], FormSystemControlDirective.prototype, "componentRef", void 0);
155
443
  FormSystemControlDirective = __decorate([
156
444
  Mixin(ExtractDataSourcesMixin),
157
445
  __metadata("design:paramtypes", [ControlContainer,
@@ -160,10 +448,11 @@ FormSystemControlDirective = __decorate([
160
448
  DataSourceLoader,
161
449
  Injector])
162
450
  ], FormSystemControlDirective);
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemControlDirective, decorators: [{
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemControlDirective, decorators: [{
164
452
  type: Directive,
165
453
  args: [{
166
- selector: '[rxapFormSystemControl]'
454
+ selector: '[rxapFormSystemControl]',
455
+ standalone: true,
167
456
  }]
168
457
  }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
169
458
  type: Inject,
@@ -181,159 +470,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
181
470
  type: Inject,
182
471
  args: [INJECTOR]
183
472
  }] }]; }, propDecorators: { controlId: [{
184
- type: Input
185
- }], control: [], componentRef: [] } });
186
-
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);
473
+ type: Input,
474
+ args: [{ required: true }]
475
+ }] } });
337
476
 
338
477
  function UseComponent(component, setProperties = {}) {
339
478
  return function (target, propertyKey) {
@@ -475,18 +614,19 @@ let ControlHideShowDirective = class ControlHideShowDirective {
475
614
  reset() {
476
615
  this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
477
616
  }
478
- 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 }); }
617
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlHideShowDirective, deps: [{ token: Renderer2 }, { token: ElementRef }, { token: ControlContainer, optional: true }, { token: NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
618
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ControlHideShowDirective, isStandalone: true, selector: "[rxapControlHideShow]", inputs: { controlId: ["rxapControlHideShow", "controlId"] }, ngImport: i0 }); }
480
619
  };
481
620
  ControlHideShowDirective = __decorate([
482
621
  Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin),
483
622
  __metadata("design:paramtypes", [Renderer2,
484
623
  ElementRef, Object, Object])
485
624
  ], ControlHideShowDirective);
486
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlHideShowDirective, decorators: [{
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlHideShowDirective, decorators: [{
487
626
  type: Directive,
488
627
  args: [{
489
- selector: '[rxapControlHideShow]'
628
+ selector: '[rxapControlHideShow]',
629
+ standalone: true,
490
630
  }]
491
631
  }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
492
632
  type: Inject,
@@ -510,18 +650,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
510
650
  type: Input,
511
651
  args: ['rxapControlHideShow']
512
652
  }] } });
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
653
 
526
654
  let InputSelectOptionsDirective = class InputSelectOptionsDirective {
527
655
  constructor(template, dataSourceLoader, viewContainerRef, injector, cdr,
@@ -570,7 +698,8 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
570
698
  if (!value) {
571
699
  return '';
572
700
  }
573
- return this.options?.find((option) => option.value === value)?.display ?? (isDevMode() ? 'to display error' : '');
701
+ return this.options?.find((option) => option.value === value)?.display ??
702
+ (isDevMode() ? 'to display error' : '');
574
703
  }
575
704
  ngOnDestroy() {
576
705
  this.subscription?.unsubscribe();
@@ -586,8 +715,13 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
586
715
  }
587
716
  else {
588
717
  return Object.entries(options)
589
- .filter(([value, display]) => typeof display === 'string' && display.toLowerCase().includes(controlValue))
590
- .map(([value, display]) => ({ value, display }));
718
+ .filter(([value, display]) => typeof display ===
719
+ 'string' &&
720
+ display.toLowerCase().includes(controlValue))
721
+ .map(([value, display]) => ({
722
+ value,
723
+ display,
724
+ }));
591
725
  }
592
726
  }
593
727
  return options;
@@ -608,7 +742,12 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
608
742
  if (options) {
609
743
  if (!Array.isArray(options)) {
610
744
  for (const [value, display] of Object.entries(options)) {
611
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: { value, display } });
745
+ this.viewContainerRef.createEmbeddedView(this.template, {
746
+ $implicit: {
747
+ value,
748
+ display,
749
+ },
750
+ });
612
751
  }
613
752
  }
614
753
  else {
@@ -624,17 +763,9 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
624
763
  }
625
764
  this.cdr.detectChanges();
626
765
  }
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: MAT_LEGACY_FORM_FIELD, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
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 }); }
766
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", 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 }); }
767
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: InputSelectOptionsDirective, isStandalone: true, selector: "[rxapInputSelectOptions]", inputs: { viewer: ["rxapInputSelectOptionsViewer", "viewer"], metadata: ["rxapInputSelectOptionsMetadata", "metadata"], matAutocomplete: ["rxapInputSelectOptionsMatAutocomplete", "matAutocomplete"] }, ngImport: i0 }); }
629
768
  };
630
- __decorate([
631
- Required,
632
- __metadata("design:type", RxapFormControl)
633
- ], InputSelectOptionsDirective.prototype, "control", void 0);
634
- __decorate([
635
- Required,
636
- __metadata("design:type", BaseDataSource)
637
- ], InputSelectOptionsDirective.prototype, "dataSource", void 0);
638
769
  InputSelectOptionsDirective = __decorate([
639
770
  Mixin(ExtractOptionsDataSourceMixin),
640
771
  __metadata("design:paramtypes", [TemplateRef,
@@ -643,10 +774,11 @@ InputSelectOptionsDirective = __decorate([
643
774
  Injector,
644
775
  ChangeDetectorRef, Object, Object])
645
776
  ], InputSelectOptionsDirective);
646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputSelectOptionsDirective, decorators: [{
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: InputSelectOptionsDirective, decorators: [{
647
778
  type: Directive,
648
779
  args: [{
649
- selector: '[rxapInputSelectOptions]'
780
+ selector: '[rxapInputSelectOptions]',
781
+ standalone: true,
650
782
  }]
651
783
  }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
652
784
  type: Inject,
@@ -668,11 +800,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
668
800
  }, {
669
801
  type: Inject,
670
802
  args: [NgControl]
671
- }] }, { type: i3.MatLegacyFormField, decorators: [{
803
+ }] }, { type: i3.MatFormField, decorators: [{
672
804
  type: Optional
673
805
  }, {
674
806
  type: Inject,
675
- args: [MAT_LEGACY_FORM_FIELD]
807
+ args: [MAT_FORM_FIELD]
676
808
  }] }]; }, propDecorators: { viewer: [{
677
809
  type: Input,
678
810
  args: ['rxapInputSelectOptionsViewer']
@@ -682,34 +814,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
682
814
  }], matAutocomplete: [{
683
815
  type: Input,
684
816
  args: ['rxapInputSelectOptionsMatAutocomplete']
685
- }], 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
- }] });
817
+ }] } });
698
818
 
699
819
  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] }); }
820
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
821
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: FormSystemDirectivesModule, imports: [InputSelectOptionsDirective,
822
+ ControlHideShowDirective], exports: [InputSelectOptionsDirective,
823
+ ControlHideShowDirective] }); }
824
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemDirectivesModule }); }
705
825
  }
706
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormSystemDirectivesModule, decorators: [{
826
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemDirectivesModule, decorators: [{
707
827
  type: NgModule,
708
828
  args: [{
709
829
  exports: [
710
- InputSelectOptionsDirectiveModule,
711
- ControlHideShowDirectiveModule
712
- ]
830
+ InputSelectOptionsDirective,
831
+ ControlHideShowDirective,
832
+ ],
833
+ imports: [
834
+ InputSelectOptionsDirective,
835
+ ControlHideShowDirective,
836
+ ],
713
837
  }]
714
838
  }] });
715
839
 
@@ -724,7 +848,12 @@ class IsEqualToDirective {
724
848
  if (this._equalTo === null || this._equalTo === control.value) {
725
849
  return null;
726
850
  }
727
- return { isEqualTo: { value: this._equalTo, actualValue: control.value } };
851
+ return {
852
+ isEqualTo: {
853
+ value: this._equalTo,
854
+ actualValue: control.value,
855
+ },
856
+ };
728
857
  }
729
858
  /**
730
859
  * @description
@@ -735,21 +864,16 @@ class IsEqualToDirective {
735
864
  registerOnValidatorChange(fn) {
736
865
  this._onChange = fn;
737
866
  }
738
- 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: [
867
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsEqualToDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
868
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: IsEqualToDirective, isStandalone: true, selector: "[rxapIsEqualTo]", inputs: { equalTo: ["rxapIsEqualTo", "equalTo"] }, providers: [
740
869
  {
741
870
  provide: NG_VALIDATORS,
742
871
  multi: true,
743
- useExisting: forwardRef(() => IsEqualToDirective)
744
- }
872
+ useExisting: forwardRef(() => IsEqualToDirective),
873
+ },
745
874
  ], ngImport: i0 }); }
746
875
  }
747
- __decorate([
748
- Required,
749
- __metadata("design:type", Object),
750
- __metadata("design:paramtypes", [Object])
751
- ], IsEqualToDirective.prototype, "equalTo", null);
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsEqualToDirective, decorators: [{
876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsEqualToDirective, decorators: [{
753
877
  type: Directive,
754
878
  args: [{
755
879
  selector: '[rxapIsEqualTo]',
@@ -757,29 +881,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
757
881
  {
758
882
  provide: NG_VALIDATORS,
759
883
  multi: true,
760
- useExisting: forwardRef(() => IsEqualToDirective)
761
- }
762
- ]
884
+ useExisting: forwardRef(() => IsEqualToDirective),
885
+ },
886
+ ],
887
+ standalone: true,
763
888
  }]
764
889
  }], propDecorators: { equalTo: [{
765
890
  type: Input,
766
- args: ['rxapIsEqualTo']
891
+ args: [{
892
+ required: true,
893
+ alias: 'rxapIsEqualTo',
894
+ }]
767
895
  }] } });
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
896
 
781
897
  var IsSelectableValueDirective_1;
782
- let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectableValueDirective {
898
+ let IsSelectableValueDirective = class IsSelectableValueDirective {
899
+ static { IsSelectableValueDirective_1 = this; }
783
900
  constructor(dataSourceLoader, injector) {
784
901
  this.dataSourceLoader = dataSourceLoader;
785
902
  this.injector = injector;
@@ -795,13 +912,17 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
795
912
  options = data;
796
913
  }
797
914
  else {
798
- options = Object.entries(data).map(([value, display]) => ({ value, display }));
915
+ options = Object.entries(data)
916
+ .map(([value, display]) => ({
917
+ value,
918
+ display,
919
+ }));
799
920
  }
800
921
  if (!options.some(option => option.value === control.value)) {
801
922
  return {
802
923
  isSelectableValue: {
803
924
  expected: 'Value should be from the list of provided options',
804
- }
925
+ },
805
926
  };
806
927
  }
807
928
  }
@@ -811,13 +932,13 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
811
932
  }
812
933
  return null;
813
934
  }
814
- 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: [
935
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsSelectableValueDirective, deps: [{ token: DataSourceLoader }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Directive }); }
936
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: IsSelectableValueDirective, isStandalone: true, selector: "[rxapIsSelectableValue]", inputs: { viewer: "viewer" }, providers: [
816
937
  {
817
938
  provide: NG_VALIDATORS,
818
939
  multi: true,
819
- useExisting: forwardRef(() => IsSelectableValueDirective_1)
820
- }
940
+ useExisting: forwardRef(() => IsSelectableValueDirective_1),
941
+ },
821
942
  ], ngImport: i0 }); }
822
943
  };
823
944
  IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
@@ -825,7 +946,7 @@ IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
825
946
  __metadata("design:paramtypes", [DataSourceLoader,
826
947
  Injector])
827
948
  ], IsSelectableValueDirective);
828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
949
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
829
950
  type: Directive,
830
951
  args: [{
831
952
  selector: '[rxapIsSelectableValue]',
@@ -833,9 +954,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
833
954
  {
834
955
  provide: NG_VALIDATORS,
835
956
  multi: true,
836
- useExisting: forwardRef(() => IsSelectableValueDirective)
837
- }
838
- ]
957
+ useExisting: forwardRef(() => IsSelectableValueDirective),
958
+ },
959
+ ],
960
+ standalone: true,
839
961
  }]
840
962
  }], ctorParameters: function () { return [{ type: i1$1.DataSourceLoader, decorators: [{
841
963
  type: Inject,
@@ -846,18 +968,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
846
968
  }] }]; }, propDecorators: { viewer: [{
847
969
  type: Input
848
970
  }] } });
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
971
 
862
972
  // endregion
863
973
 
@@ -865,5 +975,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
865
975
  * Generated bundle index. Do not edit.
866
976
  */
867
977
 
868
- export { ComposeOptionsTransformers, ControlDataSource, ControlHideShowDirective, ControlHideShowDirectiveModule, DATA_SOURCE_NAME, ExtractControlFromParentMixin, ExtractControlMixin, ExtractDataSourcesMixin, ExtractFormDefinitionMixin, ExtractOptionsDataSourceMixin, FormSystemControlDirective, FormSystemDirectivesModule, FormSystemMetadataKeys, FormSystemModule, InputSelectOptionsDirective, InputSelectOptionsDirectiveModule, IsEqualToDirective, IsEqualToDirectiveModule, IsSelectableValueDirective, IsSelectableValueDirectiveModule, 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 };
978
+ export { ComposeOptionsTransformers, ControlDataSource, ControlHideShowDirective, DATA_SOURCE_NAME, ExtractControlFromParentMixin, ExtractControlMixin, ExtractDataSourcesMixin, ExtractFormDefinitionMixin, ExtractOptionsDataSourceMixin, ExtractRemoteMethodsMixin, FormContextFromActivatedRouteFactory, FormSystemControlDirective, FormSystemDirectivesModule, FormSystemMetadataKeys, InputSelectOptionsDirective, IsEqualToDirective, IsSelectableValueDirective, OptionsFromRemoteMethodDirective, REMOTE_METHOD_NAME, RXAP_FORM_CONTROL_SOURCE, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_SHOW_METADATA, RXAP_USE_REMOTE_METHOD, RxapFormSystemError, SUBMIT_CONTEXT_FORM_ADAPTER_METHOD, SubmitContextFormAdapter, SubmitContextFormAdapterFactory, UseComponent, UseDataSource, UseFormComponent, UseHideFunction, UseOptionsDataSource, UseOptionsRemoteMethod, UseRemoteMethod, UseShowFunction, controlDataSource };
869
979
  //# sourceMappingURL=rxap-form-system.mjs.map