@rxap/form-system 16.0.0-dev.2 → 16.0.0-dev.3
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 +294 -0
- package/README.md +7 -22
- package/esm2022/index.mjs +1 -1
- package/esm2022/lib/control-data-source.mjs +7 -8
- package/esm2022/lib/control-with-data-source.mjs +1 -1
- package/esm2022/lib/decorators/metadata-keys.mjs +1 -1
- package/esm2022/lib/decorators/use-component.mjs +2 -2
- package/esm2022/lib/decorators/use-data-source.mjs +6 -3
- package/esm2022/lib/decorators/use-form-component.mjs +2 -2
- package/esm2022/lib/directives/control-hide-show.directive.mjs +12 -13
- package/esm2022/lib/directives/input-select-options.directive.mjs +28 -18
- package/esm2022/lib/error.mjs +1 -1
- package/esm2022/lib/form-system-control.directive.mjs +12 -13
- package/esm2022/lib/mixins/extract-control-from-parent.mixin.mjs +5 -3
- package/esm2022/lib/mixins/extract-control.mixin.mjs +5 -3
- package/esm2022/lib/mixins/extract-data-sources.mixin.mjs +2 -2
- package/esm2022/lib/mixins/extract-form-definition.mixin.mjs +1 -1
- package/esm2022/lib/mixins/extract-options-data-source.mixin.mjs +6 -7
- package/esm2022/lib/validators/is-equal-to.mjs +18 -14
- package/esm2022/lib/validators/is-selectable-value.directive.mjs +20 -16
- package/esm2022/rxap-form-system.mjs +1 -1
- package/fesm2022/rxap-form-system.mjs +71 -43
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/lib/directives/control-hide-show.directive.d.ts +1 -1
- package/lib/directives/input-select-options.directive.d.ts +3 -3
- package/lib/form-system-control.directive.d.ts +1 -1
- package/lib/mixins/extract-control.mixin.d.ts +1 -1
- package/lib/mixins/extract-form-definition.mixin.d.ts +1 -1
- package/lib/mixins/extract-options-data-source.mixin.d.ts +2 -3
- package/package.json +58 -52
- package/LICENSE +0 -21
- package/collection.json +0 -10
- package/migration.json +0 -4
- package/src/schematics/ng-add/index.d.ts +0 -2
- package/src/schematics/ng-add/index.js +0 -8
- package/src/schematics/ng-add/index.js.map +0 -1
- package/src/schematics/ng-add/schema.json +0 -7
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
var IsSelectableValueDirective_1;
|
|
2
2
|
import { __decorate, __metadata } from "tslib";
|
|
3
|
-
import { NG_VALIDATORS } from '@angular/forms';
|
|
4
|
-
import { Directive, forwardRef, Inject, INJECTOR, Injector, Input, isDevMode } from '@angular/core';
|
|
5
|
-
import { DataSourceLoader } from '@rxap/data-source';
|
|
3
|
+
import { NG_VALIDATORS, } from '@angular/forms';
|
|
4
|
+
import { Directive, forwardRef, Inject, INJECTOR, Injector, Input, isDevMode, } from '@angular/core';
|
|
5
|
+
import { DataSourceLoader, } from '@rxap/data-source';
|
|
6
6
|
import { Mixin } from '@rxap/mixin';
|
|
7
7
|
import { ExtractOptionsDataSourceMixin } from '../mixins/extract-options-data-source.mixin';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "@rxap/data-source";
|
|
10
|
-
let IsSelectableValueDirective =
|
|
10
|
+
export let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
11
|
+
static { IsSelectableValueDirective_1 = this; }
|
|
11
12
|
constructor(dataSourceLoader, injector) {
|
|
12
13
|
this.dataSourceLoader = dataSourceLoader;
|
|
13
14
|
this.injector = injector;
|
|
@@ -23,13 +24,17 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
|
|
|
23
24
|
options = data;
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
|
-
options = Object.entries(data)
|
|
27
|
+
options = Object.entries(data)
|
|
28
|
+
.map(([value, display]) => ({
|
|
29
|
+
value,
|
|
30
|
+
display,
|
|
31
|
+
}));
|
|
27
32
|
}
|
|
28
33
|
if (!options.some(option => option.value === control.value)) {
|
|
29
34
|
return {
|
|
30
35
|
isSelectableValue: {
|
|
31
36
|
expected: 'Value should be from the list of provided options',
|
|
32
|
-
}
|
|
37
|
+
},
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
40
|
}
|
|
@@ -39,13 +44,13 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
|
|
|
39
44
|
}
|
|
40
45
|
return null;
|
|
41
46
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
43
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
47
|
+
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 }); }
|
|
48
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: IsSelectableValueDirective, isStandalone: true, selector: "[rxapIsSelectableValue]", inputs: { viewer: "viewer" }, providers: [
|
|
44
49
|
{
|
|
45
50
|
provide: NG_VALIDATORS,
|
|
46
51
|
multi: true,
|
|
47
|
-
useExisting: forwardRef(() => IsSelectableValueDirective_1)
|
|
48
|
-
}
|
|
52
|
+
useExisting: forwardRef(() => IsSelectableValueDirective_1),
|
|
53
|
+
},
|
|
49
54
|
], ngImport: i0 }); }
|
|
50
55
|
};
|
|
51
56
|
IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
|
|
@@ -53,8 +58,7 @@ IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
|
|
|
53
58
|
__metadata("design:paramtypes", [DataSourceLoader,
|
|
54
59
|
Injector])
|
|
55
60
|
], IsSelectableValueDirective);
|
|
56
|
-
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
|
|
58
62
|
type: Directive,
|
|
59
63
|
args: [{
|
|
60
64
|
selector: '[rxapIsSelectableValue]',
|
|
@@ -62,10 +66,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
62
66
|
{
|
|
63
67
|
provide: NG_VALIDATORS,
|
|
64
68
|
multi: true,
|
|
65
|
-
useExisting: forwardRef(() => IsSelectableValueDirective)
|
|
66
|
-
}
|
|
69
|
+
useExisting: forwardRef(() => IsSelectableValueDirective),
|
|
70
|
+
},
|
|
67
71
|
],
|
|
68
|
-
standalone: true
|
|
72
|
+
standalone: true,
|
|
69
73
|
}]
|
|
70
74
|
}], ctorParameters: function () { return [{ type: i1.DataSourceLoader, decorators: [{
|
|
71
75
|
type: Inject,
|
|
@@ -76,4 +80,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
76
80
|
}] }]; }, propDecorators: { viewer: [{
|
|
77
81
|
type: Input
|
|
78
82
|
}] } });
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
83
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtc2VsZWN0YWJsZS12YWx1ZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL2Zvcm0tc3lzdGVtL3NyYy9saWIvdmFsaWRhdG9ycy9pcy1zZWxlY3RhYmxlLXZhbHVlLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE9BQU8sRUFFTCxhQUFhLEdBR2QsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQ0wsU0FBUyxFQUNULFVBQVUsRUFDVixNQUFNLEVBQ04sUUFBUSxFQUNSLFFBQVEsRUFDUixLQUFLLEVBQ0w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E9wdGlvbnM7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGEpKSB7XG4gICAgICAgICAgb3B0aW9ucyA9IGRhdGE7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgb3B0aW9ucyA9IE9iamVjdC5lbnRyaWVzKGRhdGEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKFsgdmFsdWUsIGRpc3BsYXkgXSkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFvcHRpb25zLnNvbWUob3B0aW9uID0+IG9wdGlvbi52YWx1ZSA9PT0gY29udHJvbC52YWx1ZSkpIHtcbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaXNTZWxlY3RhYmxlVmFsdWU6IHtcbiAgICAgICAgICAgICAgZXhwZWN0ZWQ6ICdWYWx1ZSBzaG91bGQgYmUgZnJvbSB0aGUgbGlzdCBvZiBwcm92aWRlZCBvcHRpb25zJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmIChpc0Rldk1vZGUoKSkge1xuICAgICAgICBjb25zb2xlLndhcm4oJ1RoZSBsYXN0IHZhbHVlIGZyb20gdGhlIE9wdGlvbnNEYXRhU291cmNlIGlzIGVtcHR5JywgdGhpcyk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBudWxsO1xuICB9XG5cbn1cblxuXG4iXX0=
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
4
|
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnhhcC1mb3JtLXN5c3RlbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXIvZm9ybS1zeXN0ZW0vc3JjL3J4YXAtZm9ybS1zeXN0ZW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -4,7 +4,7 @@ import { BaseDataSource, RXAP_DATA_SOURCE_METADATA, PipeDataSource, DataSourceLo
|
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { InjectionToken, isDevMode, Injectable, Inject, Optional, ComponentFactoryResolver, ViewContainerRef, INJECTOR, ComponentRef, Injector, Directive, Input, Renderer2, ElementRef, Self, TemplateRef, ChangeDetectorRef, forwardRef } from '@angular/core';
|
|
6
6
|
import { startWith, distinctUntilChanged, shareReplay, map, tap, catchError, throttleTime, switchMap } from 'rxjs/operators';
|
|
7
|
-
import { getMetadata, setMetadataMapMap, setMetadataMap, setMetadata } from '@rxap/
|
|
7
|
+
import { getMetadata, setMetadataMapMap, setMetadataMap, setMetadata } from '@rxap/reflect-metadata';
|
|
8
8
|
import { RxapFormControl, RxapFormGroup, RxapFormArray } from '@rxap/forms';
|
|
9
9
|
import { __decorate, __metadata } from 'tslib';
|
|
10
10
|
import { Mixin } from '@rxap/mixin';
|
|
@@ -37,10 +37,10 @@ class ControlDataSource extends BaseDataSource {
|
|
|
37
37
|
}
|
|
38
38
|
this._data$ = this.control.valueChanges.pipe(startWith(this.control.value), distinctUntilChanged((a, b) => equals(a, b)), shareReplay(1));
|
|
39
39
|
}
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
41
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
40
|
+
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 }); }
|
|
41
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlDataSource }); }
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlDataSource, decorators: [{
|
|
44
44
|
type: Injectable
|
|
45
45
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
46
46
|
type: Inject,
|
|
@@ -89,7 +89,9 @@ class ExtractControlFromParentMixin {
|
|
|
89
89
|
if (!control) {
|
|
90
90
|
throw new RxapFormSystemError('Could not find the control instance', '');
|
|
91
91
|
}
|
|
92
|
-
if (!(control instanceof RxapFormControl) &&
|
|
92
|
+
if (!(control instanceof RxapFormControl) &&
|
|
93
|
+
!(control instanceof RxapFormGroup) &&
|
|
94
|
+
!(control instanceof RxapFormArray)) {
|
|
93
95
|
throw new RxapFormSystemError('The extracted control is not a RxapFormControl', '');
|
|
94
96
|
}
|
|
95
97
|
return control;
|
|
@@ -109,13 +111,18 @@ class ExtractFormDefinitionMixin {
|
|
|
109
111
|
|
|
110
112
|
function UseDataSource(dataSource, name, settings) {
|
|
111
113
|
return function (target, propertyKey) {
|
|
112
|
-
const value = {
|
|
114
|
+
const value = {
|
|
115
|
+
dataSource,
|
|
116
|
+
settings,
|
|
117
|
+
};
|
|
113
118
|
setMetadataMapMap(propertyKey, name, value, FormSystemMetadataKeys.DATA_SOURCES, target);
|
|
114
119
|
};
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
class ExtractControlMixin {
|
|
118
|
-
extractControl(ngControl = this.ngControl ??
|
|
123
|
+
extractControl(ngControl = this.ngControl ??
|
|
124
|
+
this.matFormField?._control?.ngControl ??
|
|
125
|
+
null) {
|
|
119
126
|
if (!ngControl) {
|
|
120
127
|
throw new Error('The ngControl is not defined!');
|
|
121
128
|
}
|
|
@@ -274,8 +281,8 @@ let FormSystemControlDirective = class FormSystemControlDirective {
|
|
|
274
281
|
}
|
|
275
282
|
return map.get(this.controlId);
|
|
276
283
|
}
|
|
277
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
278
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
284
|
+
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 }); }
|
|
285
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: FormSystemControlDirective, isStandalone: true, selector: "[rxapFormSystemControl]", inputs: { controlId: "controlId" }, ngImport: i0 }); }
|
|
279
286
|
};
|
|
280
287
|
__decorate([
|
|
281
288
|
Required,
|
|
@@ -297,11 +304,11 @@ FormSystemControlDirective = __decorate([
|
|
|
297
304
|
DataSourceLoader,
|
|
298
305
|
Injector])
|
|
299
306
|
], FormSystemControlDirective);
|
|
300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormSystemControlDirective, decorators: [{
|
|
301
308
|
type: Directive,
|
|
302
309
|
args: [{
|
|
303
310
|
selector: '[rxapFormSystemControl]',
|
|
304
|
-
standalone: true
|
|
311
|
+
standalone: true,
|
|
305
312
|
}]
|
|
306
313
|
}], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
|
|
307
314
|
type: Inject,
|
|
@@ -462,19 +469,19 @@ let ControlHideShowDirective = class ControlHideShowDirective {
|
|
|
462
469
|
reset() {
|
|
463
470
|
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
|
|
464
471
|
}
|
|
465
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
466
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
472
|
+
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 }); }
|
|
473
|
+
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 }); }
|
|
467
474
|
};
|
|
468
475
|
ControlHideShowDirective = __decorate([
|
|
469
476
|
Mixin(ExtractControlFromParentMixin, ExtractFormDefinitionMixin),
|
|
470
477
|
__metadata("design:paramtypes", [Renderer2,
|
|
471
478
|
ElementRef, Object, Object])
|
|
472
479
|
], ControlHideShowDirective);
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
480
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlHideShowDirective, decorators: [{
|
|
474
481
|
type: Directive,
|
|
475
482
|
args: [{
|
|
476
483
|
selector: '[rxapControlHideShow]',
|
|
477
|
-
standalone: true
|
|
484
|
+
standalone: true,
|
|
478
485
|
}]
|
|
479
486
|
}], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
|
|
480
487
|
type: Inject,
|
|
@@ -546,7 +553,8 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
546
553
|
if (!value) {
|
|
547
554
|
return '';
|
|
548
555
|
}
|
|
549
|
-
return this.options?.find((option) => option.value === value)?.display ??
|
|
556
|
+
return this.options?.find((option) => option.value === value)?.display ??
|
|
557
|
+
(isDevMode() ? 'to display error' : '');
|
|
550
558
|
}
|
|
551
559
|
ngOnDestroy() {
|
|
552
560
|
this.subscription?.unsubscribe();
|
|
@@ -562,8 +570,13 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
562
570
|
}
|
|
563
571
|
else {
|
|
564
572
|
return Object.entries(options)
|
|
565
|
-
.filter(([value, display]) => typeof display ===
|
|
566
|
-
|
|
573
|
+
.filter(([value, display]) => typeof display ===
|
|
574
|
+
'string' &&
|
|
575
|
+
display.toLowerCase().includes(controlValue))
|
|
576
|
+
.map(([value, display]) => ({
|
|
577
|
+
value,
|
|
578
|
+
display,
|
|
579
|
+
}));
|
|
567
580
|
}
|
|
568
581
|
}
|
|
569
582
|
return options;
|
|
@@ -584,7 +597,12 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
584
597
|
if (options) {
|
|
585
598
|
if (!Array.isArray(options)) {
|
|
586
599
|
for (const [value, display] of Object.entries(options)) {
|
|
587
|
-
this.viewContainerRef.createEmbeddedView(this.template, {
|
|
600
|
+
this.viewContainerRef.createEmbeddedView(this.template, {
|
|
601
|
+
$implicit: {
|
|
602
|
+
value,
|
|
603
|
+
display,
|
|
604
|
+
},
|
|
605
|
+
});
|
|
588
606
|
}
|
|
589
607
|
}
|
|
590
608
|
else {
|
|
@@ -600,8 +618,8 @@ let InputSelectOptionsDirective = class InputSelectOptionsDirective {
|
|
|
600
618
|
}
|
|
601
619
|
this.cdr.detectChanges();
|
|
602
620
|
}
|
|
603
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
604
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
621
|
+
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 }); }
|
|
622
|
+
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 }); }
|
|
605
623
|
};
|
|
606
624
|
__decorate([
|
|
607
625
|
Required,
|
|
@@ -619,11 +637,11 @@ InputSelectOptionsDirective = __decorate([
|
|
|
619
637
|
Injector,
|
|
620
638
|
ChangeDetectorRef, Object, Object])
|
|
621
639
|
], InputSelectOptionsDirective);
|
|
622
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: InputSelectOptionsDirective, decorators: [{
|
|
623
641
|
type: Directive,
|
|
624
642
|
args: [{
|
|
625
643
|
selector: '[rxapInputSelectOptions]',
|
|
626
|
-
standalone: true
|
|
644
|
+
standalone: true,
|
|
627
645
|
}]
|
|
628
646
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
629
647
|
type: Inject,
|
|
@@ -672,7 +690,12 @@ class IsEqualToDirective {
|
|
|
672
690
|
if (this._equalTo === null || this._equalTo === control.value) {
|
|
673
691
|
return null;
|
|
674
692
|
}
|
|
675
|
-
return {
|
|
693
|
+
return {
|
|
694
|
+
isEqualTo: {
|
|
695
|
+
value: this._equalTo,
|
|
696
|
+
actualValue: control.value,
|
|
697
|
+
},
|
|
698
|
+
};
|
|
676
699
|
}
|
|
677
700
|
/**
|
|
678
701
|
* @description
|
|
@@ -683,13 +706,13 @@ class IsEqualToDirective {
|
|
|
683
706
|
registerOnValidatorChange(fn) {
|
|
684
707
|
this._onChange = fn;
|
|
685
708
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
687
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
709
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsEqualToDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
710
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: IsEqualToDirective, isStandalone: true, selector: "[rxapIsEqualTo]", inputs: { equalTo: ["rxapIsEqualTo", "equalTo"] }, providers: [
|
|
688
711
|
{
|
|
689
712
|
provide: NG_VALIDATORS,
|
|
690
713
|
multi: true,
|
|
691
|
-
useExisting: forwardRef(() => IsEqualToDirective)
|
|
692
|
-
}
|
|
714
|
+
useExisting: forwardRef(() => IsEqualToDirective),
|
|
715
|
+
},
|
|
693
716
|
], ngImport: i0 }); }
|
|
694
717
|
}
|
|
695
718
|
__decorate([
|
|
@@ -697,7 +720,7 @@ __decorate([
|
|
|
697
720
|
__metadata("design:type", Object),
|
|
698
721
|
__metadata("design:paramtypes", [Object])
|
|
699
722
|
], IsEqualToDirective.prototype, "equalTo", null);
|
|
700
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
723
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsEqualToDirective, decorators: [{
|
|
701
724
|
type: Directive,
|
|
702
725
|
args: [{
|
|
703
726
|
selector: '[rxapIsEqualTo]',
|
|
@@ -705,10 +728,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
705
728
|
{
|
|
706
729
|
provide: NG_VALIDATORS,
|
|
707
730
|
multi: true,
|
|
708
|
-
useExisting: forwardRef(() => IsEqualToDirective)
|
|
709
|
-
}
|
|
731
|
+
useExisting: forwardRef(() => IsEqualToDirective),
|
|
732
|
+
},
|
|
710
733
|
],
|
|
711
|
-
standalone: true
|
|
734
|
+
standalone: true,
|
|
712
735
|
}]
|
|
713
736
|
}], propDecorators: { equalTo: [{
|
|
714
737
|
type: Input,
|
|
@@ -716,7 +739,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
716
739
|
}] } });
|
|
717
740
|
|
|
718
741
|
var IsSelectableValueDirective_1;
|
|
719
|
-
let IsSelectableValueDirective =
|
|
742
|
+
let IsSelectableValueDirective = class IsSelectableValueDirective {
|
|
743
|
+
static { IsSelectableValueDirective_1 = this; }
|
|
720
744
|
constructor(dataSourceLoader, injector) {
|
|
721
745
|
this.dataSourceLoader = dataSourceLoader;
|
|
722
746
|
this.injector = injector;
|
|
@@ -732,13 +756,17 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
|
|
|
732
756
|
options = data;
|
|
733
757
|
}
|
|
734
758
|
else {
|
|
735
|
-
options = Object.entries(data)
|
|
759
|
+
options = Object.entries(data)
|
|
760
|
+
.map(([value, display]) => ({
|
|
761
|
+
value,
|
|
762
|
+
display,
|
|
763
|
+
}));
|
|
736
764
|
}
|
|
737
765
|
if (!options.some(option => option.value === control.value)) {
|
|
738
766
|
return {
|
|
739
767
|
isSelectableValue: {
|
|
740
768
|
expected: 'Value should be from the list of provided options',
|
|
741
|
-
}
|
|
769
|
+
},
|
|
742
770
|
};
|
|
743
771
|
}
|
|
744
772
|
}
|
|
@@ -748,13 +776,13 @@ let IsSelectableValueDirective = IsSelectableValueDirective_1 = class IsSelectab
|
|
|
748
776
|
}
|
|
749
777
|
return null;
|
|
750
778
|
}
|
|
751
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
752
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
779
|
+
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 }); }
|
|
780
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: IsSelectableValueDirective, isStandalone: true, selector: "[rxapIsSelectableValue]", inputs: { viewer: "viewer" }, providers: [
|
|
753
781
|
{
|
|
754
782
|
provide: NG_VALIDATORS,
|
|
755
783
|
multi: true,
|
|
756
|
-
useExisting: forwardRef(() => IsSelectableValueDirective_1)
|
|
757
|
-
}
|
|
784
|
+
useExisting: forwardRef(() => IsSelectableValueDirective_1),
|
|
785
|
+
},
|
|
758
786
|
], ngImport: i0 }); }
|
|
759
787
|
};
|
|
760
788
|
IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
|
|
@@ -762,7 +790,7 @@ IsSelectableValueDirective = IsSelectableValueDirective_1 = __decorate([
|
|
|
762
790
|
__metadata("design:paramtypes", [DataSourceLoader,
|
|
763
791
|
Injector])
|
|
764
792
|
], IsSelectableValueDirective);
|
|
765
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsSelectableValueDirective, decorators: [{
|
|
766
794
|
type: Directive,
|
|
767
795
|
args: [{
|
|
768
796
|
selector: '[rxapIsSelectableValue]',
|
|
@@ -770,10 +798,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
770
798
|
{
|
|
771
799
|
provide: NG_VALIDATORS,
|
|
772
800
|
multi: true,
|
|
773
|
-
useExisting: forwardRef(() => IsSelectableValueDirective)
|
|
774
|
-
}
|
|
801
|
+
useExisting: forwardRef(() => IsSelectableValueDirective),
|
|
802
|
+
},
|
|
775
803
|
],
|
|
776
|
-
standalone: true
|
|
804
|
+
standalone: true,
|
|
777
805
|
}]
|
|
778
806
|
}], ctorParameters: function () { return [{ type: i1$1.DataSourceLoader, decorators: [{
|
|
779
807
|
type: Inject,
|