@rxap/material-form-system 16.0.0-dev.1 → 16.0.0-dev.11
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 +533 -0
- package/LICENSE +621 -27
- package/LICENSE.md +621 -0
- package/README.md +7 -22
- package/esm2022/index.mjs +2 -3
- package/esm2022/lib/chip-input-adapter.directive.mjs +13 -26
- package/esm2022/lib/chip-list-iterator.directive.mjs +14 -25
- package/esm2022/lib/compare-with.directive.mjs +11 -24
- package/esm2022/lib/control-error.directive.mjs +20 -37
- package/esm2022/lib/control-errors.directive.mjs +16 -30
- package/esm2022/lib/form-controls/form-controls.component.mjs +44 -31
- package/esm2022/lib/form-field-hide-show.directive.mjs +16 -29
- package/esm2022/lib/input-clear-button.directive.mjs +16 -29
- package/esm2022/lib/material-form-system.module.mjs +32 -26
- package/esm2022/lib/required.directive.mjs +11 -24
- package/esm2022/rxap-material-form-system.mjs +1 -1
- package/fesm2022/rxap-material-form-system.mjs +197 -300
- package/fesm2022/rxap-material-form-system.mjs.map +1 -1
- package/index.d.ts +1 -2
- package/lib/chip-input-adapter.directive.d.ts +2 -7
- package/lib/chip-list-iterator.directive.d.ts +2 -7
- package/lib/compare-with.directive.d.ts +2 -7
- package/lib/control-error.directive.d.ts +6 -11
- package/lib/control-errors.directive.d.ts +6 -11
- package/lib/form-controls/form-controls.component.d.ts +6 -6
- package/lib/form-field-hide-show.directive.d.ts +3 -8
- package/lib/input-clear-button.directive.d.ts +3 -8
- package/lib/material-form-system.module.d.ts +1 -1
- package/lib/required.directive.d.ts +2 -7
- package/package.json +62 -52
- package/theme.css +1 -0
- package/collection.json +0 -10
- package/esm2022/lib/form-controls/form-controls.component.module.mjs +0 -41
- package/lib/form-controls/form-controls.component.module.d.ts +0 -13
- 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,47 +1,46 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { TemplateRef, ViewContainerRef, ChangeDetectorRef, Directive, Inject, Input,
|
|
4
|
-
import * as i1 from '@angular/material/
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import { controlErrorChanges$, RxapFormControl, FormDirective
|
|
2
|
+
import { TemplateRef, ViewContainerRef, ChangeDetectorRef, Directive, Inject, Input, HostBinding, HostListener, isDevMode, Renderer2, ElementRef, EventEmitter, Component, ChangeDetectionStrategy, Optional, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/form-field';
|
|
4
|
+
import { MAT_FORM_FIELD, MatFormField } from '@angular/material/form-field';
|
|
5
|
+
import * as i5 from '@rxap/forms';
|
|
6
|
+
import { controlErrorChanges$, RxapFormControl, FormDirective } from '@rxap/forms';
|
|
8
7
|
import { tap, startWith, catchError, take, filter } from 'rxjs/operators';
|
|
9
|
-
import
|
|
8
|
+
import * as i1$1 from '@angular/material/select';
|
|
9
|
+
import { MatSelect } from '@angular/material/select';
|
|
10
|
+
import { getFromObject, equals, coerceBoolean, clone, unique } from '@rxap/utilities';
|
|
11
|
+
import { __decorate, __metadata } from 'tslib';
|
|
10
12
|
import { Subscription, of } from 'rxjs';
|
|
11
13
|
import { RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_SHOW_METADATA, ExtractFormDefinitionMixin } from '@rxap/form-system';
|
|
12
14
|
import { Mixin } from '@rxap/mixin';
|
|
13
|
-
import { getMetadata } from '@rxap/
|
|
14
|
-
import * as
|
|
15
|
-
import { MatLegacySelect } from '@angular/material/legacy-select';
|
|
16
|
-
import * as i8 from '@angular/router';
|
|
15
|
+
import { getMetadata } from '@rxap/reflect-metadata';
|
|
16
|
+
import * as i7 from '@angular/router';
|
|
17
17
|
import { Router } from '@angular/router';
|
|
18
|
-
import * as
|
|
19
|
-
import {
|
|
20
|
-
import '@angular/
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import * as i2 from '@angular/flex-layout/flex';
|
|
18
|
+
import * as i6 from '@angular/material/snack-bar';
|
|
19
|
+
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
20
|
+
import * as i4 from '@angular/material/progress-spinner';
|
|
21
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
22
|
+
import { NgClass, NgIf, AsyncPipe } from '@angular/common';
|
|
24
23
|
import * as i3 from '@angular/flex-layout/extended';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
24
|
+
import { ExtendedModule } from '@angular/flex-layout/extended';
|
|
25
|
+
import * as i2 from '@angular/material/button';
|
|
26
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
27
|
+
import * as i1$2 from '@angular/flex-layout/flex';
|
|
28
|
+
import { FlexModule } from '@angular/flex-layout/flex';
|
|
29
|
+
import '@angular/localize/init';
|
|
30
30
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
31
31
|
import * as i2$1 from '@angular/forms';
|
|
32
|
-
import * as i1$3 from '@angular/material/
|
|
33
|
-
import { log } from '@rxap/utilities/rxjs';
|
|
32
|
+
import * as i1$3 from '@angular/material/chips';
|
|
34
33
|
|
|
35
34
|
class ControlErrorDirective {
|
|
36
|
-
static ngTemplateContextGuard(dir, ctx) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
35
|
constructor(formField, template, viewContainerRef, cdr) {
|
|
40
36
|
this.formField = formField;
|
|
41
37
|
this.template = template;
|
|
42
38
|
this.viewContainerRef = viewContainerRef;
|
|
43
39
|
this.cdr = cdr;
|
|
44
40
|
}
|
|
41
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
45
44
|
ngAfterContentInit() {
|
|
46
45
|
const control = this.formField._control.ngControl?.control;
|
|
47
46
|
if (control) {
|
|
@@ -54,6 +53,9 @@ class ControlErrorDirective {
|
|
|
54
53
|
throw new Error('The form field has not a control associated!');
|
|
55
54
|
}
|
|
56
55
|
}
|
|
56
|
+
ngOnDestroy() {
|
|
57
|
+
this._subscription?.unsubscribe();
|
|
58
|
+
}
|
|
57
59
|
render(errors) {
|
|
58
60
|
this.viewContainerRef.clear();
|
|
59
61
|
if (errors) {
|
|
@@ -72,25 +74,18 @@ class ControlErrorDirective {
|
|
|
72
74
|
}
|
|
73
75
|
this.cdr.detectChanges();
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirective, deps: [{ token: MAT_LEGACY_FORM_FIELD }, { token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
79
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: ControlErrorDirective, selector: "[rxapControlError]", inputs: { key: ["rxapControlErrorKey", "key"] }, ngImport: i0 }); }
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlErrorDirective, deps: [{ token: MAT_FORM_FIELD }, { token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
78
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ControlErrorDirective, isStandalone: true, selector: "[rxapControlError]", inputs: { key: ["rxapControlErrorKey", "key"] }, ngImport: i0 }); }
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
Required,
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], ControlErrorDirective.prototype, "key", void 0);
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirective, decorators: [{
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlErrorDirective, decorators: [{
|
|
86
81
|
type: Directive,
|
|
87
82
|
args: [{
|
|
88
|
-
// tslint:disable-next-line:directive-selector
|
|
89
83
|
selector: '[rxapControlError]',
|
|
84
|
+
standalone: true,
|
|
90
85
|
}]
|
|
91
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
86
|
+
}], ctorParameters: function () { return [{ type: i1.MatFormField, decorators: [{
|
|
92
87
|
type: Inject,
|
|
93
|
-
args: [
|
|
88
|
+
args: [MAT_FORM_FIELD]
|
|
94
89
|
}] }, { type: i0.TemplateRef, decorators: [{
|
|
95
90
|
type: Inject,
|
|
96
91
|
args: [TemplateRef]
|
|
@@ -102,31 +97,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
102
97
|
args: [ChangeDetectorRef]
|
|
103
98
|
}] }]; }, propDecorators: { key: [{
|
|
104
99
|
type: Input,
|
|
105
|
-
args: [
|
|
100
|
+
args: [{
|
|
101
|
+
required: true,
|
|
102
|
+
alias: 'rxapControlErrorKey',
|
|
103
|
+
}]
|
|
106
104
|
}] } });
|
|
107
|
-
class ControlErrorDirectiveModule {
|
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
109
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirectiveModule, declarations: [ControlErrorDirective], exports: [ControlErrorDirective] }); }
|
|
110
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirectiveModule }); }
|
|
111
|
-
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorDirectiveModule, decorators: [{
|
|
113
|
-
type: NgModule,
|
|
114
|
-
args: [{
|
|
115
|
-
declarations: [ControlErrorDirective],
|
|
116
|
-
exports: [ControlErrorDirective],
|
|
117
|
-
}]
|
|
118
|
-
}] });
|
|
119
105
|
|
|
120
106
|
class ControlErrorsDirective {
|
|
121
|
-
static ngTemplateContextGuard(dir, ctx) {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
107
|
constructor(formField, template, viewContainerRef, cdr) {
|
|
125
108
|
this.formField = formField;
|
|
126
109
|
this.template = template;
|
|
127
110
|
this.viewContainerRef = viewContainerRef;
|
|
128
111
|
this.cdr = cdr;
|
|
129
112
|
}
|
|
113
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
130
116
|
ngAfterContentInit() {
|
|
131
117
|
const control = this.formField._control.ngControl?.control;
|
|
132
118
|
if (control) {
|
|
@@ -139,6 +125,9 @@ class ControlErrorsDirective {
|
|
|
139
125
|
throw new Error('The form field has not a control associated!');
|
|
140
126
|
}
|
|
141
127
|
}
|
|
128
|
+
ngOnDestroy() {
|
|
129
|
+
this._subscription?.unsubscribe();
|
|
130
|
+
}
|
|
142
131
|
render(errors) {
|
|
143
132
|
this.viewContainerRef.clear();
|
|
144
133
|
if (errors) {
|
|
@@ -152,21 +141,18 @@ class ControlErrorsDirective {
|
|
|
152
141
|
}
|
|
153
142
|
this.cdr.detectChanges();
|
|
154
143
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorsDirective, deps: [{ token: MAT_LEGACY_FORM_FIELD }, { token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
159
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: ControlErrorsDirective, selector: "[rxapControlErrors]", ngImport: i0 }); }
|
|
144
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlErrorsDirective, deps: [{ token: MAT_FORM_FIELD }, { token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
145
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ControlErrorsDirective, isStandalone: true, selector: "[rxapControlErrors]", ngImport: i0 }); }
|
|
160
146
|
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ControlErrorsDirective, decorators: [{
|
|
162
148
|
type: Directive,
|
|
163
149
|
args: [{
|
|
164
|
-
// tslint:disable-next-line:directive-selector
|
|
165
150
|
selector: '[rxapControlErrors]',
|
|
151
|
+
standalone: true,
|
|
166
152
|
}]
|
|
167
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
153
|
+
}], ctorParameters: function () { return [{ type: i1.MatFormField, decorators: [{
|
|
168
154
|
type: Inject,
|
|
169
|
-
args: [
|
|
155
|
+
args: [MAT_FORM_FIELD]
|
|
170
156
|
}] }, { type: i0.TemplateRef, decorators: [{
|
|
171
157
|
type: Inject,
|
|
172
158
|
args: [TemplateRef]
|
|
@@ -177,31 +163,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
177
163
|
type: Inject,
|
|
178
164
|
args: [ChangeDetectorRef]
|
|
179
165
|
}] }]; } });
|
|
180
|
-
class ControlErrorsDirectiveModule {
|
|
181
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorsDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
182
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorsDirectiveModule, declarations: [ControlErrorsDirective], exports: [ControlErrorsDirective] }); }
|
|
183
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorsDirectiveModule }); }
|
|
184
|
-
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ControlErrorsDirectiveModule, decorators: [{
|
|
186
|
-
type: NgModule,
|
|
187
|
-
args: [{
|
|
188
|
-
declarations: [ControlErrorsDirective],
|
|
189
|
-
exports: [ControlErrorsDirective],
|
|
190
|
-
}]
|
|
191
|
-
}] });
|
|
192
166
|
|
|
193
167
|
class InputClearButtonDirective {
|
|
168
|
+
constructor(formField) {
|
|
169
|
+
this.formField = formField;
|
|
170
|
+
this.type = 'button';
|
|
171
|
+
this.tabIndex = '-1';
|
|
172
|
+
}
|
|
194
173
|
get control() {
|
|
195
174
|
return this.formField._control;
|
|
196
175
|
}
|
|
197
176
|
get isDisabled() {
|
|
198
177
|
return this.control.disabled;
|
|
199
178
|
}
|
|
200
|
-
constructor(formField) {
|
|
201
|
-
this.formField = formField;
|
|
202
|
-
this.type = 'button';
|
|
203
|
-
this.tabIndex = '-1';
|
|
204
|
-
}
|
|
205
179
|
onClick() {
|
|
206
180
|
if (this.control.ngControl) {
|
|
207
181
|
this.control.ngControl.reset();
|
|
@@ -210,17 +184,18 @@ class InputClearButtonDirective {
|
|
|
210
184
|
this.control.value = null;
|
|
211
185
|
}
|
|
212
186
|
}
|
|
213
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
214
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
187
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: InputClearButtonDirective, deps: [{ token: MAT_FORM_FIELD }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
188
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: InputClearButtonDirective, isStandalone: true, selector: "[rxapInputClearButton]", host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "this.type", "attr.tabindex": "this.tabIndex", "disabled": "this.isDisabled" } }, ngImport: i0 }); }
|
|
215
189
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: InputClearButtonDirective, decorators: [{
|
|
217
191
|
type: Directive,
|
|
218
192
|
args: [{
|
|
219
|
-
selector: '[rxapInputClearButton]'
|
|
193
|
+
selector: '[rxapInputClearButton]',
|
|
194
|
+
standalone: true,
|
|
220
195
|
}]
|
|
221
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
196
|
+
}], ctorParameters: function () { return [{ type: i1.MatFormField, decorators: [{
|
|
222
197
|
type: Inject,
|
|
223
|
-
args: [
|
|
198
|
+
args: [MAT_FORM_FIELD]
|
|
224
199
|
}] }]; }, propDecorators: { type: [{
|
|
225
200
|
type: HostBinding,
|
|
226
201
|
args: ['attr.type']
|
|
@@ -234,18 +209,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
234
209
|
type: HostListener,
|
|
235
210
|
args: ['click']
|
|
236
211
|
}] } });
|
|
237
|
-
class InputClearButtonDirectiveModule {
|
|
238
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputClearButtonDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
239
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: InputClearButtonDirectiveModule, declarations: [InputClearButtonDirective], exports: [InputClearButtonDirective] }); }
|
|
240
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputClearButtonDirectiveModule }); }
|
|
241
|
-
}
|
|
242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: InputClearButtonDirectiveModule, decorators: [{
|
|
243
|
-
type: NgModule,
|
|
244
|
-
args: [{
|
|
245
|
-
declarations: [InputClearButtonDirective],
|
|
246
|
-
exports: [InputClearButtonDirective]
|
|
247
|
-
}]
|
|
248
|
-
}] });
|
|
249
212
|
|
|
250
213
|
class RequiredDirective {
|
|
251
214
|
constructor(formField) {
|
|
@@ -263,30 +226,68 @@ class RequiredDirective {
|
|
|
263
226
|
throw new Error('The form field has not a control associated!');
|
|
264
227
|
}
|
|
265
228
|
}
|
|
266
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
267
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
229
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RequiredDirective, deps: [{ token: MAT_FORM_FIELD }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
230
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: RequiredDirective, isStandalone: true, selector: "[formControlName][rxapRequired]", ngImport: i0 }); }
|
|
268
231
|
}
|
|
269
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RequiredDirective, decorators: [{
|
|
270
233
|
type: Directive,
|
|
271
234
|
args: [{
|
|
272
|
-
selector: '[formControlName][rxapRequired]'
|
|
235
|
+
selector: '[formControlName][rxapRequired]',
|
|
236
|
+
standalone: true,
|
|
273
237
|
}]
|
|
274
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
238
|
+
}], ctorParameters: function () { return [{ type: i1.MatFormField, decorators: [{
|
|
275
239
|
type: Inject,
|
|
276
|
-
args: [
|
|
240
|
+
args: [MAT_FORM_FIELD]
|
|
277
241
|
}] }]; } });
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
242
|
+
|
|
243
|
+
class CompareWithDirective {
|
|
244
|
+
constructor(matSelect) {
|
|
245
|
+
this.matSelect = matSelect;
|
|
246
|
+
}
|
|
247
|
+
ngOnInit() {
|
|
248
|
+
this.matSelect.compareWith = this.compareWith.bind(this);
|
|
249
|
+
}
|
|
250
|
+
compareWith(o1, o2) {
|
|
251
|
+
if (this.objectPath) {
|
|
252
|
+
if (typeof o1 !== 'object' || typeof o2 !== 'object') {
|
|
253
|
+
if (isDevMode()) {
|
|
254
|
+
console.warn('At least one of the select options value is not an object');
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
|
|
259
|
+
if (isDevMode()) {
|
|
260
|
+
console.warn('At least one of the select options value is undefined or null');
|
|
261
|
+
}
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
const o1Value = getFromObject(o1, this.objectPath);
|
|
265
|
+
const o2Value = getFromObject(o2, this.objectPath);
|
|
266
|
+
if (o1Value === undefined || o2Value === undefined) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
return o1Value === o2Value;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
return equals(o1, o2);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CompareWithDirective, deps: [{ token: MatSelect }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
276
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: CompareWithDirective, isStandalone: true, selector: "mat-select[rxapCompareWith]", inputs: { objectPath: ["rxapCompareWith", "objectPath"] }, ngImport: i0 }); }
|
|
282
277
|
}
|
|
283
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
284
|
-
type:
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CompareWithDirective, decorators: [{
|
|
279
|
+
type: Directive,
|
|
285
280
|
args: [{
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
selector: 'mat-select[rxapCompareWith]',
|
|
282
|
+
standalone: true,
|
|
288
283
|
}]
|
|
289
|
-
}]
|
|
284
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatSelect, decorators: [{
|
|
285
|
+
type: Inject,
|
|
286
|
+
args: [MatSelect]
|
|
287
|
+
}] }]; }, propDecorators: { objectPath: [{
|
|
288
|
+
type: Input,
|
|
289
|
+
args: ['rxapCompareWith']
|
|
290
|
+
}] } });
|
|
290
291
|
|
|
291
292
|
class ExtractHideShowMixin {
|
|
292
293
|
extractOptions(formDefinition = this.formDefinition, controlId = this.control?.controlId ?? this.controlId) {
|
|
@@ -390,23 +391,24 @@ let FormFieldHideShowDirective = class FormFieldHideShowDirective {
|
|
|
390
391
|
reset() {
|
|
391
392
|
this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
|
|
392
393
|
}
|
|
393
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
394
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
394
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormFieldHideShowDirective, deps: [{ token: MAT_FORM_FIELD }, { token: Renderer2 }, { token: ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
395
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: FormFieldHideShowDirective, isStandalone: true, selector: "mat-form-field[rxapHideShow]", ngImport: i0 }); }
|
|
395
396
|
};
|
|
396
397
|
FormFieldHideShowDirective = __decorate([
|
|
397
398
|
Mixin(ExtractHideShowMixin, ExtractFormDefinitionMixin),
|
|
398
|
-
__metadata("design:paramtypes", [
|
|
399
|
+
__metadata("design:paramtypes", [MatFormField,
|
|
399
400
|
Renderer2,
|
|
400
401
|
ElementRef])
|
|
401
402
|
], FormFieldHideShowDirective);
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormFieldHideShowDirective, decorators: [{
|
|
403
404
|
type: Directive,
|
|
404
405
|
args: [{
|
|
405
|
-
selector: 'mat-form-field[rxapHideShow]'
|
|
406
|
+
selector: 'mat-form-field[rxapHideShow]',
|
|
407
|
+
standalone: true,
|
|
406
408
|
}]
|
|
407
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
409
|
+
}], ctorParameters: function () { return [{ type: i1.MatFormField, decorators: [{
|
|
408
410
|
type: Inject,
|
|
409
|
-
args: [
|
|
411
|
+
args: [MAT_FORM_FIELD]
|
|
410
412
|
}] }, { type: i0.Renderer2, decorators: [{
|
|
411
413
|
type: Inject,
|
|
412
414
|
args: [Renderer2]
|
|
@@ -414,118 +416,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
414
416
|
type: Inject,
|
|
415
417
|
args: [ElementRef]
|
|
416
418
|
}] }]; } });
|
|
417
|
-
class FormFieldHideShowDirectiveModule {
|
|
418
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormFieldHideShowDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
419
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: FormFieldHideShowDirectiveModule, declarations: [FormFieldHideShowDirective], exports: [FormFieldHideShowDirective] }); }
|
|
420
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormFieldHideShowDirectiveModule }); }
|
|
421
|
-
}
|
|
422
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormFieldHideShowDirectiveModule, decorators: [{
|
|
423
|
-
type: NgModule,
|
|
424
|
-
args: [{
|
|
425
|
-
declarations: [FormFieldHideShowDirective],
|
|
426
|
-
exports: [FormFieldHideShowDirective]
|
|
427
|
-
}]
|
|
428
|
-
}] });
|
|
429
|
-
|
|
430
|
-
class MaterialFormSystemModule {
|
|
431
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MaterialFormSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
432
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: MaterialFormSystemModule, exports: [ControlErrorDirectiveModule,
|
|
433
|
-
ControlErrorsDirectiveModule,
|
|
434
|
-
InputClearButtonDirectiveModule,
|
|
435
|
-
RequiredDirectiveModule,
|
|
436
|
-
FormFieldHideShowDirectiveModule] }); }
|
|
437
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MaterialFormSystemModule, imports: [ControlErrorDirectiveModule,
|
|
438
|
-
ControlErrorsDirectiveModule,
|
|
439
|
-
InputClearButtonDirectiveModule,
|
|
440
|
-
RequiredDirectiveModule,
|
|
441
|
-
FormFieldHideShowDirectiveModule] }); }
|
|
442
|
-
}
|
|
443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MaterialFormSystemModule, decorators: [{
|
|
444
|
-
type: NgModule,
|
|
445
|
-
args: [{
|
|
446
|
-
exports: [
|
|
447
|
-
ControlErrorDirectiveModule,
|
|
448
|
-
ControlErrorsDirectiveModule,
|
|
449
|
-
InputClearButtonDirectiveModule,
|
|
450
|
-
RequiredDirectiveModule,
|
|
451
|
-
FormFieldHideShowDirectiveModule
|
|
452
|
-
]
|
|
453
|
-
}]
|
|
454
|
-
}] });
|
|
455
|
-
|
|
456
|
-
class CompareWithDirective {
|
|
457
|
-
constructor(matSelect) {
|
|
458
|
-
this.matSelect = matSelect;
|
|
459
|
-
}
|
|
460
|
-
ngOnInit() {
|
|
461
|
-
this.matSelect.compareWith = this.compareWith.bind(this);
|
|
462
|
-
}
|
|
463
|
-
compareWith(o1, o2) {
|
|
464
|
-
if (this.objectPath) {
|
|
465
|
-
if (typeof o1 !== 'object' || typeof o2 !== 'object') {
|
|
466
|
-
if (isDevMode()) {
|
|
467
|
-
console.warn('At least one of the select options value is not an object');
|
|
468
|
-
}
|
|
469
|
-
return false;
|
|
470
|
-
}
|
|
471
|
-
if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
|
|
472
|
-
if (isDevMode()) {
|
|
473
|
-
console.warn('At least one of the select options value is undefined or null');
|
|
474
|
-
}
|
|
475
|
-
return false;
|
|
476
|
-
}
|
|
477
|
-
const o1Value = getFromObject(o1, this.objectPath);
|
|
478
|
-
const o2Value = getFromObject(o2, this.objectPath);
|
|
479
|
-
if (o1Value === undefined || o2Value === undefined) {
|
|
480
|
-
return false;
|
|
481
|
-
}
|
|
482
|
-
return o1Value === o2Value;
|
|
483
|
-
}
|
|
484
|
-
else {
|
|
485
|
-
return equals(o1, o2);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirective, deps: [{ token: MatLegacySelect }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
489
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: CompareWithDirective, selector: "mat-select[rxapCompareWith]", inputs: { objectPath: ["rxapCompareWith", "objectPath"] }, ngImport: i0 }); }
|
|
490
|
-
}
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirective, decorators: [{
|
|
492
|
-
type: Directive,
|
|
493
|
-
args: [{
|
|
494
|
-
selector: 'mat-select[rxapCompareWith]',
|
|
495
|
-
}]
|
|
496
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatLegacySelect, decorators: [{
|
|
497
|
-
type: Inject,
|
|
498
|
-
args: [MatLegacySelect]
|
|
499
|
-
}] }]; }, propDecorators: { objectPath: [{
|
|
500
|
-
type: Input,
|
|
501
|
-
args: ['rxapCompareWith']
|
|
502
|
-
}] } });
|
|
503
|
-
class CompareWithDirectiveModule {
|
|
504
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
505
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirectiveModule, declarations: [CompareWithDirective], exports: [CompareWithDirective] }); }
|
|
506
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirectiveModule }); }
|
|
507
|
-
}
|
|
508
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CompareWithDirectiveModule, decorators: [{
|
|
509
|
-
type: NgModule,
|
|
510
|
-
args: [{
|
|
511
|
-
declarations: [CompareWithDirective],
|
|
512
|
-
exports: [CompareWithDirective],
|
|
513
|
-
}]
|
|
514
|
-
}] });
|
|
515
419
|
|
|
516
420
|
class FormControlsComponent {
|
|
517
|
-
set allowResubmit(value) {
|
|
518
|
-
this._allowResubmit = coerceBoolean(value);
|
|
519
|
-
}
|
|
520
|
-
get allowResubmit() {
|
|
521
|
-
return this._allowResubmit;
|
|
522
|
-
}
|
|
523
421
|
constructor(formDirective, cdr, snackBar, router) {
|
|
524
422
|
this.formDirective = formDirective;
|
|
525
423
|
this.cdr = cdr;
|
|
526
424
|
this.snackBar = snackBar;
|
|
527
425
|
this.router = router;
|
|
528
|
-
this._allowResubmit = false;
|
|
529
426
|
this.invalid = false;
|
|
530
427
|
this.close = new EventEmitter();
|
|
531
428
|
this.submitted = new EventEmitter();
|
|
@@ -535,6 +432,13 @@ class FormControlsComponent {
|
|
|
535
432
|
* @private
|
|
536
433
|
*/
|
|
537
434
|
this._submitted = [];
|
|
435
|
+
this._allowResubmit = false;
|
|
436
|
+
}
|
|
437
|
+
get allowResubmit() {
|
|
438
|
+
return this._allowResubmit;
|
|
439
|
+
}
|
|
440
|
+
set allowResubmit(value) {
|
|
441
|
+
this._allowResubmit = coerceBoolean(value);
|
|
538
442
|
}
|
|
539
443
|
ngOnInit() {
|
|
540
444
|
this.submitting$ = this.formDirective.submitting$;
|
|
@@ -563,6 +467,7 @@ class FormControlsComponent {
|
|
|
563
467
|
this.formDirective.form.markAllAsDirty();
|
|
564
468
|
this.formDirective.form.markAllAsTouched();
|
|
565
469
|
this.formDirective.cdr.markForCheck();
|
|
470
|
+
// eslint-disable-next-line prefer-const
|
|
566
471
|
let submitSubscription;
|
|
567
472
|
const invalidSubmitSubscription = this.formDirective.invalidSubmit
|
|
568
473
|
.pipe(take(1), tap(() => submitSubscription?.unsubscribe()), tap(() => (this.invalid = true)), tap(() => this.cdr.detectChanges()), tap(() => this.snackBar.open($localize `:@@rxap-material.form-system.form-controls.form-is-invalid:Form is not valid`, 'ok', { duration: 5000 })))
|
|
@@ -590,67 +495,45 @@ class FormControlsComponent {
|
|
|
590
495
|
logCurrentFormState() {
|
|
591
496
|
console.log(clone(this.formDirective.form.value));
|
|
592
497
|
}
|
|
593
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
594
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
498
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormControlsComponent, deps: [{ token: FormDirective }, { token: ChangeDetectorRef }, { token: MatSnackBar }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
499
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: FormControlsComponent, isStandalone: true, selector: "rxap-form-controls", inputs: { navigateAfterSubmit: "navigateAfterSubmit", allowResubmit: "allowResubmit" }, outputs: { close: "close", submitted: "submitted" }, ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"32px\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"32px\" style=\"width: 100%\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting$ | async\"\n fxFlex=\"nogrow\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting$ | async\"\n color=\"warn\"\n fxFlex=\"nogrow\" mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit)\"\n [disabled]=\"submitting$ | async\"\n [ngClass]=\"{ invalid: invalid }\"\n color=\"primary\"\n fxFlex=\"nogrow\"\n mat-raised-button\n type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <span fxFlex=\"nogrow\">\n <ng-container i18n>Submit</ng-container>\n </span>\n <mat-spinner [diameter]=\"15\" [fxShow]=\"submitting$ | async\" color=\"accent\" fxFlex=\"nogrow\"\n mode=\"indeterminate\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"submit(true)\" *ngIf=\"allowResubmit\"\n [disabled]=\"submitting$ | async\"\n [ngClass]=\"{ invalid: invalid }\"\n color=\"primary\"\n fxFlex=\"nogrow\"\n mat-raised-button\n type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <span fxFlex=\"nogrow\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n <mat-spinner [diameter]=\"15\" [fxShow]=\"submitting$ | async\" color=\"accent\" fxFlex=\"nogrow\"\n mode=\"indeterminate\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"logCurrentFormState()\" *ngIf=\"isDevMode\" fxFlex=\"nogrow\" mat-button type=\"button\">Current Form\n State\n </button>\n </div>\n</div>\n", styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i1$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: ExtendedModule }, { kind: "directive", type: i3.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatSnackBarModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
595
500
|
}
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FormControlsComponent, decorators: [{
|
|
597
502
|
type: Component,
|
|
598
|
-
args: [{ selector: 'rxap-form-controls', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
599
|
-
|
|
503
|
+
args: [{ selector: 'rxap-form-controls', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
504
|
+
FlexModule,
|
|
505
|
+
MatButtonModule,
|
|
506
|
+
ExtendedModule,
|
|
507
|
+
NgClass,
|
|
508
|
+
MatProgressSpinnerModule,
|
|
509
|
+
NgIf,
|
|
510
|
+
AsyncPipe,
|
|
511
|
+
MatSnackBarModule,
|
|
512
|
+
], template: "<div fxLayout=\"row\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"32px\">\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"32px\" style=\"width: 100%\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting$ | async\"\n fxFlex=\"nogrow\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting$ | async\"\n color=\"warn\"\n fxFlex=\"nogrow\" mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit)\"\n [disabled]=\"submitting$ | async\"\n [ngClass]=\"{ invalid: invalid }\"\n color=\"primary\"\n fxFlex=\"nogrow\"\n mat-raised-button\n type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <span fxFlex=\"nogrow\">\n <ng-container i18n>Submit</ng-container>\n </span>\n <mat-spinner [diameter]=\"15\" [fxShow]=\"submitting$ | async\" color=\"accent\" fxFlex=\"nogrow\"\n mode=\"indeterminate\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"submit(true)\" *ngIf=\"allowResubmit\"\n [disabled]=\"submitting$ | async\"\n [ngClass]=\"{ invalid: invalid }\"\n color=\"primary\"\n fxFlex=\"nogrow\"\n mat-raised-button\n type=\"button\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"4px\">\n <span fxFlex=\"nogrow\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n <mat-spinner [diameter]=\"15\" [fxShow]=\"submitting$ | async\" color=\"accent\" fxFlex=\"nogrow\"\n mode=\"indeterminate\"></mat-spinner>\n </span>\n </button>\n <button (click)=\"logCurrentFormState()\" *ngIf=\"isDevMode\" fxFlex=\"nogrow\" mat-button type=\"button\">Current Form\n State\n </button>\n </div>\n</div>\n", styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"] }]
|
|
513
|
+
}], ctorParameters: function () { return [{ type: i5.FormDirective, decorators: [{
|
|
600
514
|
type: Inject,
|
|
601
515
|
args: [FormDirective]
|
|
602
516
|
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
603
517
|
type: Inject,
|
|
604
518
|
args: [ChangeDetectorRef]
|
|
605
|
-
}] }, { type:
|
|
519
|
+
}] }, { type: i6.MatSnackBar, decorators: [{
|
|
606
520
|
type: Inject,
|
|
607
|
-
args: [
|
|
608
|
-
}] }, { type:
|
|
521
|
+
args: [MatSnackBar]
|
|
522
|
+
}] }, { type: i7.Router, decorators: [{
|
|
609
523
|
type: Optional
|
|
610
524
|
}, {
|
|
611
525
|
type: Inject,
|
|
612
526
|
args: [Router]
|
|
613
|
-
}] }]; }, propDecorators: {
|
|
614
|
-
type: Input
|
|
615
|
-
}], navigateAfterSubmit: [{
|
|
527
|
+
}] }]; }, propDecorators: { navigateAfterSubmit: [{
|
|
616
528
|
type: Input
|
|
617
529
|
}], close: [{
|
|
618
530
|
type: Output
|
|
619
531
|
}], submitted: [{
|
|
620
532
|
type: Output
|
|
533
|
+
}], allowResubmit: [{
|
|
534
|
+
type: Input
|
|
621
535
|
}] } });
|
|
622
536
|
|
|
623
|
-
class FormControlsComponentModule {
|
|
624
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormControlsComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
625
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: FormControlsComponentModule, declarations: [FormControlsComponent], imports: [MatLegacyProgressSpinnerModule,
|
|
626
|
-
FlexLayoutModule,
|
|
627
|
-
MatLegacyButtonModule,
|
|
628
|
-
CommonModule,
|
|
629
|
-
RxapFormsModule,
|
|
630
|
-
MatLegacySnackBarModule], exports: [FormControlsComponent] }); }
|
|
631
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormControlsComponentModule, imports: [MatLegacyProgressSpinnerModule,
|
|
632
|
-
FlexLayoutModule,
|
|
633
|
-
MatLegacyButtonModule,
|
|
634
|
-
CommonModule,
|
|
635
|
-
RxapFormsModule,
|
|
636
|
-
MatLegacySnackBarModule] }); }
|
|
637
|
-
}
|
|
638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: FormControlsComponentModule, decorators: [{
|
|
639
|
-
type: NgModule,
|
|
640
|
-
args: [{
|
|
641
|
-
declarations: [FormControlsComponent],
|
|
642
|
-
imports: [
|
|
643
|
-
MatLegacyProgressSpinnerModule,
|
|
644
|
-
FlexLayoutModule,
|
|
645
|
-
MatLegacyButtonModule,
|
|
646
|
-
CommonModule,
|
|
647
|
-
RxapFormsModule,
|
|
648
|
-
MatLegacySnackBarModule,
|
|
649
|
-
],
|
|
650
|
-
exports: [FormControlsComponent]
|
|
651
|
-
}]
|
|
652
|
-
}] });
|
|
653
|
-
|
|
654
537
|
class ChipInputAdapterDirective {
|
|
655
538
|
constructor(matChipInput, ngControl) {
|
|
656
539
|
this.matChipInput = matChipInput;
|
|
@@ -670,27 +553,16 @@ class ChipInputAdapterDirective {
|
|
|
670
553
|
}))
|
|
671
554
|
.subscribe();
|
|
672
555
|
}
|
|
673
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
674
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
556
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ChipInputAdapterDirective, deps: [{ token: i1$3.MatChipInput }, { token: i2$1.NgControl }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
557
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ChipInputAdapterDirective, isStandalone: true, selector: "[matChipInputFor][rxapChipInputAdapter]", ngImport: i0 }); }
|
|
675
558
|
}
|
|
676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ChipInputAdapterDirective, decorators: [{
|
|
677
560
|
type: Directive,
|
|
678
561
|
args: [{
|
|
679
|
-
selector: '[matChipInputFor][rxapChipInputAdapter]'
|
|
562
|
+
selector: '[matChipInputFor][rxapChipInputAdapter]',
|
|
563
|
+
standalone: true,
|
|
680
564
|
}]
|
|
681
|
-
}], ctorParameters: function () { return [{ type: i1$3.
|
|
682
|
-
class ChipInputAdapterDirectiveModule {
|
|
683
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ChipInputAdapterDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
684
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: ChipInputAdapterDirectiveModule, declarations: [ChipInputAdapterDirective], exports: [ChipInputAdapterDirective] }); }
|
|
685
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ChipInputAdapterDirectiveModule }); }
|
|
686
|
-
}
|
|
687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ChipInputAdapterDirectiveModule, decorators: [{
|
|
688
|
-
type: NgModule,
|
|
689
|
-
args: [{
|
|
690
|
-
exports: [ChipInputAdapterDirective],
|
|
691
|
-
declarations: [ChipInputAdapterDirective]
|
|
692
|
-
}]
|
|
693
|
-
}] });
|
|
565
|
+
}], ctorParameters: function () { return [{ type: i1$3.MatChipInput }, { type: i2$1.NgControl }]; } });
|
|
694
566
|
|
|
695
567
|
function getTypeName(type) {
|
|
696
568
|
return type['name'] || typeof type;
|
|
@@ -712,7 +584,7 @@ class ChipListIteratorDirective {
|
|
|
712
584
|
}
|
|
713
585
|
ngOnInit() {
|
|
714
586
|
this._subscription = this.ngControl.valueChanges
|
|
715
|
-
?.pipe(startWith(this.ngControl.value),
|
|
587
|
+
?.pipe(startWith(this.ngControl.value), filter((value) => Array.isArray(value)), tap((items) => {
|
|
716
588
|
this._dirty = false;
|
|
717
589
|
// React on ngForOf changes only once all inputs have been initialized
|
|
718
590
|
const value = items;
|
|
@@ -743,7 +615,10 @@ class ChipListIteratorDirective {
|
|
|
743
615
|
// NgForOf is never "null" or "undefined" here because the differ detected
|
|
744
616
|
// that a new item needs to be inserted from the iterable. This implies that
|
|
745
617
|
// there is an iterable value for "_ngForOf".
|
|
746
|
-
const view = this.viewContainerRef.createEmbeddedView(this.template, {
|
|
618
|
+
const view = this.viewContainerRef.createEmbeddedView(this.template, {
|
|
619
|
+
$implicit: item.item,
|
|
620
|
+
onRemoved: this.onRemoved.bind(this),
|
|
621
|
+
}, currentIndex === null ? undefined : currentIndex);
|
|
747
622
|
const tuple = new RecordViewTuple(item, view);
|
|
748
623
|
insertTuples.push(tuple);
|
|
749
624
|
}
|
|
@@ -771,25 +646,47 @@ class ChipListIteratorDirective {
|
|
|
771
646
|
perViewChange(view, record) {
|
|
772
647
|
view.context.$implicit = record.item;
|
|
773
648
|
}
|
|
774
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
775
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
649
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ChipListIteratorDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i2$1.NgControl }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
650
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ChipListIteratorDirective, isStandalone: true, selector: "[rxapChipListIterator]", ngImport: i0 }); }
|
|
776
651
|
}
|
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ChipListIteratorDirective, decorators: [{
|
|
778
653
|
type: Directive,
|
|
779
654
|
args: [{
|
|
780
|
-
selector: '[rxapChipListIterator]'
|
|
655
|
+
selector: '[rxapChipListIterator]',
|
|
656
|
+
standalone: true,
|
|
781
657
|
}]
|
|
782
658
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i2$1.NgControl }, { type: i0.IterableDiffers }]; } });
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
static { this.ɵ
|
|
786
|
-
static { this.ɵ
|
|
659
|
+
|
|
660
|
+
class MaterialFormSystemModule {
|
|
661
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MaterialFormSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
662
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: MaterialFormSystemModule, imports: [ControlErrorDirective,
|
|
663
|
+
ControlErrorsDirective,
|
|
664
|
+
InputClearButtonDirective,
|
|
665
|
+
RequiredDirective,
|
|
666
|
+
FormFieldHideShowDirective], exports: [ControlErrorDirective,
|
|
667
|
+
ControlErrorsDirective,
|
|
668
|
+
InputClearButtonDirective,
|
|
669
|
+
RequiredDirective,
|
|
670
|
+
FormFieldHideShowDirective] }); }
|
|
671
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MaterialFormSystemModule }); }
|
|
787
672
|
}
|
|
788
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MaterialFormSystemModule, decorators: [{
|
|
789
674
|
type: NgModule,
|
|
790
675
|
args: [{
|
|
791
|
-
exports: [
|
|
792
|
-
|
|
676
|
+
exports: [
|
|
677
|
+
ControlErrorDirective,
|
|
678
|
+
ControlErrorsDirective,
|
|
679
|
+
InputClearButtonDirective,
|
|
680
|
+
RequiredDirective,
|
|
681
|
+
FormFieldHideShowDirective,
|
|
682
|
+
],
|
|
683
|
+
imports: [
|
|
684
|
+
ControlErrorDirective,
|
|
685
|
+
ControlErrorsDirective,
|
|
686
|
+
InputClearButtonDirective,
|
|
687
|
+
RequiredDirective,
|
|
688
|
+
FormFieldHideShowDirective,
|
|
689
|
+
],
|
|
793
690
|
}]
|
|
794
691
|
}] });
|
|
795
692
|
|
|
@@ -797,5 +694,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
|
797
694
|
* Generated bundle index. Do not edit.
|
|
798
695
|
*/
|
|
799
696
|
|
|
800
|
-
export { ChipInputAdapterDirective,
|
|
697
|
+
export { ChipInputAdapterDirective, ChipListIteratorDirective, CompareWithDirective, ControlErrorDirective, ControlErrorsDirective, ExtractHideShowMixin, FormControlsComponent, FormFieldHideShowDirective, InputClearButtonDirective, MaterialFormSystemModule, RequiredDirective };
|
|
801
698
|
//# sourceMappingURL=rxap-material-form-system.mjs.map
|