@stemy/ngx-dynamic-form 19.1.7 → 19.1.9
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.
|
@@ -3,6 +3,7 @@ import { DynamicInputControlModel, DYNAMIC_FORM_CONTROL_TYPE_EDITOR, serializabl
|
|
|
3
3
|
export { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX, DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX_GROUP, DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER, DYNAMIC_FORM_CONTROL_TYPE_EDITOR, DYNAMIC_FORM_CONTROL_TYPE_FILE_UPLOAD, DYNAMIC_FORM_CONTROL_TYPE_GROUP, DYNAMIC_FORM_CONTROL_TYPE_INPUT, DYNAMIC_FORM_CONTROL_TYPE_RADIO_GROUP, DYNAMIC_FORM_CONTROL_TYPE_SELECT, DYNAMIC_FORM_CONTROL_TYPE_TEXTAREA, DynamicCheckboxGroupModel, DynamicCheckboxModel, DynamicDatePickerModel, DynamicFileUploadModel, DynamicFormControlComponent, DynamicFormControlModel, DynamicFormsCoreModule, DynamicInputModel, DynamicListDirective, DynamicRadioGroupModel, DynamicTemplateDirective, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
|
4
4
|
import * as i2 from '@stemy/ngx-utils';
|
|
5
5
|
import { ObjectUtils, TimerUtils, cachedFactory, StringUtils, OpenApiService, TOASTER_SERVICE, ObservableUtils, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
6
|
+
import { __decorate } from 'tslib';
|
|
6
7
|
import { BehaviorSubject, isObservable, of, Subject, firstValueFrom, Subscription } from 'rxjs';
|
|
7
8
|
import { map, debounceTime, first, groupBy, mergeMap } from 'rxjs/operators';
|
|
8
9
|
import * as i0 from '@angular/core';
|
|
@@ -10,29 +11,22 @@ import { Injector, Injectable, Inject, EventEmitter, Directive, Input, Output, H
|
|
|
10
11
|
import { FormGroup, FormArray, FormsModule, ReactiveFormsModule, NG_VALIDATORS } from '@angular/forms';
|
|
11
12
|
import { CommonModule } from '@angular/common';
|
|
12
13
|
|
|
13
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
-
};
|
|
19
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
21
|
-
};
|
|
22
14
|
class DynamicEditorModel extends DynamicInputControlModel {
|
|
15
|
+
type = DYNAMIC_FORM_CONTROL_TYPE_EDITOR;
|
|
16
|
+
inputType;
|
|
17
|
+
convertObject;
|
|
23
18
|
constructor(config, layout) {
|
|
24
19
|
super(config, layout);
|
|
25
|
-
this.type = DYNAMIC_FORM_CONTROL_TYPE_EDITOR;
|
|
26
20
|
this.inputType = config.inputType || "javascript";
|
|
27
21
|
this.convertObject = config.convertObject !== false;
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
24
|
__decorate([
|
|
31
|
-
serializable()
|
|
32
|
-
__metadata("design:type", String)
|
|
25
|
+
serializable()
|
|
33
26
|
], DynamicEditorModel.prototype, "type", void 0);
|
|
34
27
|
|
|
35
28
|
class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
29
|
+
context;
|
|
36
30
|
get hidden() {
|
|
37
31
|
return this.isHidden;
|
|
38
32
|
}
|
|
@@ -42,6 +36,7 @@ class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
|
42
36
|
this.isHidden = value || false;
|
|
43
37
|
this.context?.filterGroups();
|
|
44
38
|
}
|
|
39
|
+
isHidden;
|
|
45
40
|
constructor(context, group, index = -1) {
|
|
46
41
|
super(context, group, index);
|
|
47
42
|
this.context = context;
|
|
@@ -49,6 +44,21 @@ class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
class DynamicFormArrayModel extends DynamicFormArrayModel$1 {
|
|
47
|
+
config;
|
|
48
|
+
filteredGroups;
|
|
49
|
+
sortable;
|
|
50
|
+
useTabs;
|
|
51
|
+
saveTab;
|
|
52
|
+
restoreTab;
|
|
53
|
+
getTabLabel;
|
|
54
|
+
additional;
|
|
55
|
+
groups = [];
|
|
56
|
+
tabIndex = 0;
|
|
57
|
+
_sortBy;
|
|
58
|
+
_sortDescending;
|
|
59
|
+
_formArray;
|
|
60
|
+
_filteredGroups;
|
|
61
|
+
_filterTimer;
|
|
52
62
|
get addItem() {
|
|
53
63
|
return this.config.addItem !== false;
|
|
54
64
|
}
|
|
@@ -96,8 +106,6 @@ class DynamicFormArrayModel extends DynamicFormArrayModel$1 {
|
|
|
96
106
|
constructor(config, layout) {
|
|
97
107
|
super(config, layout);
|
|
98
108
|
this.config = config;
|
|
99
|
-
this.groups = [];
|
|
100
|
-
this.tabIndex = 0;
|
|
101
109
|
this.filteredGroups = new BehaviorSubject([]);
|
|
102
110
|
this.sortable = config.sortable || false;
|
|
103
111
|
this.useTabs = config.useTabs || false;
|
|
@@ -160,6 +168,7 @@ class DynamicFormArrayModel extends DynamicFormArrayModel$1 {
|
|
|
160
168
|
}
|
|
161
169
|
|
|
162
170
|
class DynamicFormGroupModel extends DynamicFormGroupModel$1 {
|
|
171
|
+
groups;
|
|
163
172
|
constructor(config, layout) {
|
|
164
173
|
super(config, layout);
|
|
165
174
|
const controls = [...config.group];
|
|
@@ -186,6 +195,8 @@ class DynamicFormGroupModel extends DynamicFormGroupModel$1 {
|
|
|
186
195
|
|
|
187
196
|
const ignoredKeys = ["disabled", "label", "value", "classes"];
|
|
188
197
|
class DynamicFormOption extends DynamicFormOption$1 {
|
|
198
|
+
classes;
|
|
199
|
+
props;
|
|
189
200
|
constructor(config) {
|
|
190
201
|
super(config);
|
|
191
202
|
this.classes = config.classes || "";
|
|
@@ -198,10 +209,14 @@ class DynamicFormOption extends DynamicFormOption$1 {
|
|
|
198
209
|
}
|
|
199
210
|
}
|
|
200
211
|
class DynamicSelectModel extends DynamicSelectModel$1 {
|
|
212
|
+
groupBy;
|
|
213
|
+
inline;
|
|
214
|
+
getClasses;
|
|
215
|
+
allowEmpty;
|
|
216
|
+
options$ = null;
|
|
217
|
+
mOptions = [];
|
|
201
218
|
constructor(config, layout) {
|
|
202
219
|
super(config, layout);
|
|
203
|
-
this.options$ = null;
|
|
204
|
-
this.mOptions = [];
|
|
205
220
|
this.groupBy = config.groupBy || null;
|
|
206
221
|
this.inline = config.inline || false;
|
|
207
222
|
this.getClasses = ObjectUtils.isFunction(config.getClasses) ? config.getClasses : (() => "");
|
|
@@ -441,6 +456,7 @@ function validateItemsMaxValue(max) {
|
|
|
441
456
|
|
|
442
457
|
const indexLabels = ["$ix", "$pix"];
|
|
443
458
|
class FormSubject extends Subject {
|
|
459
|
+
notifyCallback;
|
|
444
460
|
constructor(notifyCallback) {
|
|
445
461
|
super();
|
|
446
462
|
this.notifyCallback = notifyCallback;
|
|
@@ -514,12 +530,15 @@ function getFormValidationErrors(controls, parentPath = "") {
|
|
|
514
530
|
}
|
|
515
531
|
|
|
516
532
|
class DynamicFormService extends DynamicFormService$1 {
|
|
533
|
+
openApi;
|
|
534
|
+
injector;
|
|
517
535
|
get api() {
|
|
518
536
|
return this.openApi.api;
|
|
519
537
|
}
|
|
520
538
|
get language() {
|
|
521
539
|
return this.api.language;
|
|
522
540
|
}
|
|
541
|
+
schemas;
|
|
523
542
|
constructor(cs, vs, openApi, injector) {
|
|
524
543
|
super(cs, vs);
|
|
525
544
|
this.openApi = openApi;
|
|
@@ -760,13 +779,14 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
760
779
|
return Array.isArray(res) ? res : [res];
|
|
761
780
|
};
|
|
762
781
|
const schema = this.schemas[name];
|
|
763
|
-
const
|
|
782
|
+
const controls = await this.getFormModelForSchemaDef(schema, fieldSets, customizeModels, "");
|
|
783
|
+
const group = [...controls];
|
|
764
784
|
// Add id fields if necessary
|
|
765
|
-
if (
|
|
785
|
+
if (controls.length > 0) {
|
|
766
786
|
const idFields = [
|
|
767
787
|
createFormInput("id", { hidden: true }),
|
|
768
788
|
createFormInput("_id", { hidden: true })
|
|
769
|
-
].filter(t => !
|
|
789
|
+
].filter(t => !controls.some(c => c.id == t.id));
|
|
770
790
|
group.unshift(...idFields);
|
|
771
791
|
}
|
|
772
792
|
const config = {
|
|
@@ -780,18 +800,18 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
780
800
|
properties: schema?.properties || {}
|
|
781
801
|
}, schema, DynamicFormGroupModel, config, "");
|
|
782
802
|
// Check if the customized root wrapper returned an array
|
|
783
|
-
|
|
803
|
+
controls.length = 0;
|
|
784
804
|
for (const model of root) {
|
|
785
805
|
if (model instanceof DynamicFormGroupModel && model.id === "root") {
|
|
786
806
|
return model;
|
|
787
807
|
}
|
|
788
808
|
else {
|
|
789
|
-
|
|
809
|
+
controls.push(model);
|
|
790
810
|
}
|
|
791
811
|
}
|
|
792
812
|
return new DynamicFormGroupModel({
|
|
793
813
|
...config,
|
|
794
|
-
group
|
|
814
|
+
group: controls
|
|
795
815
|
});
|
|
796
816
|
}
|
|
797
817
|
async getFormModelForSchemaDef(schema, fieldSets, customizeModels, path) {
|
|
@@ -1162,8 +1182,8 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
1162
1182
|
validators.itemsMaxValue = items.maximum;
|
|
1163
1183
|
}
|
|
1164
1184
|
}
|
|
1165
|
-
static
|
|
1166
|
-
static
|
|
1185
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicFormService, deps: [{ token: i1.DynamicFormComponentService }, { token: i1.DynamicFormValidationService }, { token: OpenApiService }, { token: Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1186
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicFormService });
|
|
1167
1187
|
}
|
|
1168
1188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicFormService, decorators: [{
|
|
1169
1189
|
type: Injectable
|
|
@@ -1176,6 +1196,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1176
1196
|
}] }] });
|
|
1177
1197
|
|
|
1178
1198
|
class AsyncSubmitDirective {
|
|
1199
|
+
toaster;
|
|
1200
|
+
cdr;
|
|
1201
|
+
elem;
|
|
1202
|
+
renderer;
|
|
1203
|
+
method;
|
|
1204
|
+
form;
|
|
1205
|
+
context;
|
|
1206
|
+
onSuccess;
|
|
1207
|
+
onError;
|
|
1208
|
+
loading;
|
|
1209
|
+
disabled;
|
|
1210
|
+
callback;
|
|
1211
|
+
onStatusChange;
|
|
1212
|
+
onSubmit;
|
|
1179
1213
|
get isDisabled() {
|
|
1180
1214
|
return this.disabled;
|
|
1181
1215
|
}
|
|
@@ -1251,8 +1285,8 @@ class AsyncSubmitDirective {
|
|
|
1251
1285
|
this.toaster.error(reason.message, reason.context);
|
|
1252
1286
|
});
|
|
1253
1287
|
}
|
|
1254
|
-
static
|
|
1255
|
-
static
|
|
1288
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AsyncSubmitDirective, deps: [{ token: TOASTER_SERVICE }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1289
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: AsyncSubmitDirective, isStandalone: false, selector: "[async-submit]", inputs: { method: ["async-submit", "method"], form: "form", context: "context" }, outputs: { onSuccess: "onSuccess", onError: "onError" }, host: { listeners: { "click": "click()" }, properties: { "class.disabled": "this.isDisabled", "class.loading": "this.isLoading" } }, exportAs: ["async-submit"], ngImport: i0 });
|
|
1256
1290
|
}
|
|
1257
1291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AsyncSubmitDirective, decorators: [{
|
|
1258
1292
|
type: Directive,
|
|
@@ -1287,21 +1321,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1287
1321
|
}] } });
|
|
1288
1322
|
|
|
1289
1323
|
class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
1324
|
+
formService;
|
|
1325
|
+
events;
|
|
1326
|
+
group = null;
|
|
1327
|
+
model = null;
|
|
1328
|
+
layout = null;
|
|
1329
|
+
blur = new EventEmitter();
|
|
1330
|
+
change = new EventEmitter();
|
|
1331
|
+
focus = new EventEmitter();
|
|
1332
|
+
groupModel;
|
|
1333
|
+
labelPrefix;
|
|
1334
|
+
getComponentType;
|
|
1335
|
+
contentTemplates;
|
|
1336
|
+
viewTemplates;
|
|
1290
1337
|
get status() {
|
|
1291
1338
|
return !this.group ? null : this.group.status;
|
|
1292
1339
|
}
|
|
1340
|
+
onValueChange;
|
|
1341
|
+
onStatusChange;
|
|
1342
|
+
onSubmit;
|
|
1343
|
+
onDetectChanges;
|
|
1344
|
+
subscription = new Subscription();
|
|
1345
|
+
groupSubscription = new Subscription();
|
|
1293
1346
|
constructor(formService, events, changeDetectorRef, componentService) {
|
|
1294
1347
|
super(changeDetectorRef, componentService);
|
|
1295
1348
|
this.formService = formService;
|
|
1296
1349
|
this.events = events;
|
|
1297
|
-
this.group = null;
|
|
1298
|
-
this.model = null;
|
|
1299
|
-
this.layout = null;
|
|
1300
|
-
this.blur = new EventEmitter();
|
|
1301
|
-
this.change = new EventEmitter();
|
|
1302
|
-
this.focus = new EventEmitter();
|
|
1303
|
-
this.subscription = new Subscription();
|
|
1304
|
-
this.groupSubscription = new Subscription();
|
|
1305
1350
|
this.groupModel = undefined;
|
|
1306
1351
|
this.labelPrefix = "";
|
|
1307
1352
|
this.getComponentType = () => null;
|
|
@@ -1329,7 +1374,7 @@ class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
|
1329
1374
|
this.model = this.groupModel?.group;
|
|
1330
1375
|
}
|
|
1331
1376
|
if (changes.model) {
|
|
1332
|
-
this.groupModel = new DynamicFormGroupModel({ id: "root", group: this.model });
|
|
1377
|
+
this.groupModel = new DynamicFormGroupModel({ id: "root", group: this.model || [] });
|
|
1333
1378
|
}
|
|
1334
1379
|
}
|
|
1335
1380
|
ngAfterViewInit() {
|
|
@@ -1382,8 +1427,8 @@ class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
|
1382
1427
|
}
|
|
1383
1428
|
return `form-control-${parts.join("-")}`;
|
|
1384
1429
|
}
|
|
1385
|
-
static
|
|
1386
|
-
static
|
|
1430
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormComponent, deps: [{ token: DynamicFormService }, { token: EventsService }, { token: i0.ChangeDetectorRef }, { token: i1.DynamicFormComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1431
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseFormComponent, isStandalone: false, selector: "dynamic-base-form", inputs: { group: "group", model: "model", layout: "layout", groupModel: "groupModel", labelPrefix: "labelPrefix", getComponentType: "getComponentType" }, outputs: { blur: "blur", change: "change", focus: "focus", onValueChange: "onValueChange", onStatusChange: "onStatusChange", onSubmit: "onSubmit", onDetectChanges: "onDetectChanges" }, queries: [{ propertyName: "contentTemplates", predicate: DynamicTemplateDirective }], viewQueries: [{ propertyName: "viewTemplates", predicate: DynamicTemplateDirective, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
1387
1432
|
}
|
|
1388
1433
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormComponent, decorators: [{
|
|
1389
1434
|
type: Component,
|
|
@@ -1434,6 +1479,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1434
1479
|
}] } });
|
|
1435
1480
|
|
|
1436
1481
|
class DynamicBaseFormControlContainerComponent extends DynamicFormControlContainerComponent {
|
|
1482
|
+
form;
|
|
1483
|
+
cdr;
|
|
1484
|
+
injector;
|
|
1485
|
+
contentTemplateList = null;
|
|
1486
|
+
klass = null;
|
|
1487
|
+
context = null;
|
|
1488
|
+
group = null;
|
|
1489
|
+
hostClass = null;
|
|
1490
|
+
inputTemplateList = null;
|
|
1491
|
+
layout = null;
|
|
1492
|
+
model = null;
|
|
1493
|
+
blur = new EventEmitter();
|
|
1494
|
+
change = new EventEmitter();
|
|
1495
|
+
focus = new EventEmitter();
|
|
1496
|
+
componentViewContainerRef = null;
|
|
1437
1497
|
get componentType() {
|
|
1438
1498
|
return this.form.getComponentType?.(this.model, this.injector)
|
|
1439
1499
|
?? this.componentService.getCustomComponentType(this.model);
|
|
@@ -1451,23 +1511,12 @@ class DynamicBaseFormControlContainerComponent extends DynamicFormControlContain
|
|
|
1451
1511
|
get formService() {
|
|
1452
1512
|
return this.form.formService;
|
|
1453
1513
|
}
|
|
1514
|
+
onDetectChanges;
|
|
1454
1515
|
constructor(form, cdr, injector, cfr, layoutService, validationService, componentService, relationService) {
|
|
1455
1516
|
super(cdr, cfr, layoutService, validationService, componentService, relationService);
|
|
1456
1517
|
this.form = form;
|
|
1457
1518
|
this.cdr = cdr;
|
|
1458
1519
|
this.injector = injector;
|
|
1459
|
-
this.contentTemplateList = null;
|
|
1460
|
-
this.klass = null;
|
|
1461
|
-
this.context = null;
|
|
1462
|
-
this.group = null;
|
|
1463
|
-
this.hostClass = null;
|
|
1464
|
-
this.inputTemplateList = null;
|
|
1465
|
-
this.layout = null;
|
|
1466
|
-
this.model = null;
|
|
1467
|
-
this.blur = new EventEmitter();
|
|
1468
|
-
this.change = new EventEmitter();
|
|
1469
|
-
this.focus = new EventEmitter();
|
|
1470
|
-
this.componentViewContainerRef = null;
|
|
1471
1520
|
}
|
|
1472
1521
|
ngOnInit() {
|
|
1473
1522
|
super.ngOnInit();
|
|
@@ -1514,10 +1563,10 @@ class DynamicBaseFormControlContainerComponent extends DynamicFormControlContain
|
|
|
1514
1563
|
return;
|
|
1515
1564
|
component.initialize(this.changeDetectorRef);
|
|
1516
1565
|
}
|
|
1517
|
-
static
|
|
1518
|
-
static
|
|
1566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlContainerComponent, deps: [{ token: DynamicBaseFormComponent }, { token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }, { token: i1.DynamicFormLayoutService }, { token: i1.DynamicFormValidationService }, { token: i1.DynamicFormComponentService }, { token: i1.DynamicFormRelationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1567
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseFormControlContainerComponent, isStandalone: false, selector: "dynamic-base-form-control", inputs: { context: "context", group: "group", hostClass: "hostClass", inputTemplateList: ["templates", "inputTemplateList"], layout: "layout", model: "model" }, outputs: { blur: "blur", change: "change", focus: "focus" }, host: { properties: { "class": "this.klass" } }, providers: [
|
|
1519
1568
|
{ provide: DynamicFormControlContainerComponent, useExisting: DynamicBaseFormControlContainerComponent }
|
|
1520
|
-
], queries: [{ propertyName: "contentTemplateList", predicate: DynamicTemplateDirective }], viewQueries: [{ propertyName: "componentViewContainerRef", first: true, predicate: ["componentViewContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1569
|
+
], queries: [{ propertyName: "contentTemplateList", predicate: DynamicTemplateDirective }], viewQueries: [{ propertyName: "componentViewContainerRef", first: true, predicate: ["componentViewContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1521
1570
|
}
|
|
1522
1571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlContainerComponent, decorators: [{
|
|
1523
1572
|
type: Component,
|
|
@@ -1564,24 +1613,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1564
1613
|
}] } });
|
|
1565
1614
|
|
|
1566
1615
|
class DynamicBaseFormArrayComponent extends DynamicFormArrayComponent {
|
|
1616
|
+
form;
|
|
1617
|
+
injector;
|
|
1618
|
+
cdr;
|
|
1619
|
+
formLayout = null;
|
|
1620
|
+
group = null;
|
|
1621
|
+
layout = null;
|
|
1622
|
+
model = null;
|
|
1623
|
+
templates = null;
|
|
1624
|
+
blur = new EventEmitter();
|
|
1625
|
+
change = new EventEmitter();
|
|
1626
|
+
customEvent = new EventEmitter();
|
|
1627
|
+
focus = new EventEmitter();
|
|
1628
|
+
components = null;
|
|
1567
1629
|
get useTabs() {
|
|
1568
1630
|
return this.model?.useTabs;
|
|
1569
1631
|
}
|
|
1632
|
+
subscription;
|
|
1570
1633
|
constructor(layoutService, validationService, form, injector, cdr) {
|
|
1571
1634
|
super(layoutService, validationService);
|
|
1572
1635
|
this.form = form;
|
|
1573
1636
|
this.injector = injector;
|
|
1574
1637
|
this.cdr = cdr;
|
|
1575
|
-
this.formLayout = null;
|
|
1576
|
-
this.group = null;
|
|
1577
|
-
this.layout = null;
|
|
1578
|
-
this.model = null;
|
|
1579
|
-
this.templates = null;
|
|
1580
|
-
this.blur = new EventEmitter();
|
|
1581
|
-
this.change = new EventEmitter();
|
|
1582
|
-
this.customEvent = new EventEmitter();
|
|
1583
|
-
this.focus = new EventEmitter();
|
|
1584
|
-
this.components = null;
|
|
1585
1638
|
}
|
|
1586
1639
|
initialize(cdr) {
|
|
1587
1640
|
this.subscription = this.model.filteredGroups.subscribe(filteredGroups => {
|
|
@@ -1632,8 +1685,8 @@ class DynamicBaseFormArrayComponent extends DynamicFormArrayComponent {
|
|
|
1632
1685
|
this.cdr.detectChanges();
|
|
1633
1686
|
this.components.forEach(t => t.cdr.detectChanges());
|
|
1634
1687
|
}
|
|
1635
|
-
static
|
|
1636
|
-
static
|
|
1688
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormArrayComponent, deps: [{ token: i1.DynamicFormLayoutService }, { token: i1.DynamicFormValidationService }, { token: DynamicBaseFormComponent }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1689
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseFormArrayComponent, isStandalone: false, selector: "dynamic-base-form-array", inputs: { formLayout: "formLayout", group: "group", layout: "layout", model: "model", templates: "templates" }, outputs: { blur: "blur", change: "change", customEvent: "customEvent", focus: "focus" }, viewQueries: [{ propertyName: "components", predicate: i0.forwardRef(() => DynamicBaseFormControlContainerComponent), descendants: true }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1637
1690
|
}
|
|
1638
1691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormArrayComponent, decorators: [{
|
|
1639
1692
|
type: Component,
|
|
@@ -1667,18 +1720,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1667
1720
|
}] } });
|
|
1668
1721
|
|
|
1669
1722
|
class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
1723
|
+
form;
|
|
1724
|
+
injector;
|
|
1725
|
+
cdr;
|
|
1726
|
+
formLayout = null;
|
|
1727
|
+
group = null;
|
|
1728
|
+
layout = null;
|
|
1729
|
+
model = null;
|
|
1730
|
+
blur = new EventEmitter();
|
|
1731
|
+
change = new EventEmitter();
|
|
1732
|
+
focus = new EventEmitter();
|
|
1733
|
+
subscription;
|
|
1670
1734
|
constructor(layoutService, validationService, form, injector, cdr) {
|
|
1671
1735
|
super(layoutService, validationService);
|
|
1672
1736
|
this.form = form;
|
|
1673
1737
|
this.injector = injector;
|
|
1674
1738
|
this.cdr = cdr;
|
|
1675
|
-
this.formLayout = null;
|
|
1676
|
-
this.group = null;
|
|
1677
|
-
this.layout = null;
|
|
1678
|
-
this.model = null;
|
|
1679
|
-
this.blur = new EventEmitter();
|
|
1680
|
-
this.change = new EventEmitter();
|
|
1681
|
-
this.focus = new EventEmitter();
|
|
1682
1739
|
}
|
|
1683
1740
|
ngAfterViewInit() {
|
|
1684
1741
|
this.subscription = this.control.valueChanges.pipe(debounceTime(500)).subscribe(value => {
|
|
@@ -1695,8 +1752,8 @@ class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
|
1695
1752
|
}
|
|
1696
1753
|
onValueChanged(value) {
|
|
1697
1754
|
}
|
|
1698
|
-
static
|
|
1699
|
-
static
|
|
1755
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlComponent, deps: [{ token: i1.DynamicFormLayoutService }, { token: i1.DynamicFormValidationService }, { token: DynamicBaseFormComponent, optional: true }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1756
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseFormControlComponent, isStandalone: false, selector: "dynamic-base-form-control", inputs: { formLayout: "formLayout", group: "group", layout: "layout", model: "model" }, outputs: { blur: "blur", change: "change", focus: "focus" }, usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1700
1757
|
}
|
|
1701
1758
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlComponent, decorators: [{
|
|
1702
1759
|
type: Component,
|
|
@@ -1725,20 +1782,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1725
1782
|
}] } });
|
|
1726
1783
|
|
|
1727
1784
|
class DynamicBaseFormGroupComponent extends DynamicFormGroupComponent {
|
|
1785
|
+
layoutService;
|
|
1786
|
+
validationService;
|
|
1787
|
+
formLayout = null;
|
|
1788
|
+
group = null;
|
|
1789
|
+
layout = null;
|
|
1790
|
+
model = null;
|
|
1791
|
+
templates = [];
|
|
1792
|
+
blur = new EventEmitter();
|
|
1793
|
+
change = new EventEmitter();
|
|
1794
|
+
customEvent = new EventEmitter();
|
|
1795
|
+
focus = new EventEmitter();
|
|
1796
|
+
components = null;
|
|
1728
1797
|
constructor(layoutService, validationService) {
|
|
1729
1798
|
super(layoutService, validationService);
|
|
1730
1799
|
this.layoutService = layoutService;
|
|
1731
1800
|
this.validationService = validationService;
|
|
1732
|
-
this.formLayout = null;
|
|
1733
|
-
this.group = null;
|
|
1734
|
-
this.layout = null;
|
|
1735
|
-
this.model = null;
|
|
1736
|
-
this.templates = [];
|
|
1737
|
-
this.blur = new EventEmitter();
|
|
1738
|
-
this.change = new EventEmitter();
|
|
1739
|
-
this.customEvent = new EventEmitter();
|
|
1740
|
-
this.focus = new EventEmitter();
|
|
1741
|
-
this.components = null;
|
|
1742
1801
|
}
|
|
1743
1802
|
getClass(context, place, model) {
|
|
1744
1803
|
return [
|
|
@@ -1765,8 +1824,8 @@ class DynamicBaseFormGroupComponent extends DynamicFormGroupComponent {
|
|
|
1765
1824
|
}
|
|
1766
1825
|
return null;
|
|
1767
1826
|
}
|
|
1768
|
-
static
|
|
1769
|
-
static
|
|
1827
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormGroupComponent, deps: [{ token: i1.DynamicFormLayoutService }, { token: i1.DynamicFormValidationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1828
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseFormGroupComponent, isStandalone: false, selector: "dynamic-base-form-group", inputs: { formLayout: "formLayout", group: "group", layout: "layout", model: "model", templates: "templates" }, outputs: { blur: "blur", change: "change", customEvent: "customEvent", focus: "focus" }, viewQueries: [{ propertyName: "components", predicate: i0.forwardRef(() => DynamicFormControlContainerComponent), descendants: true }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1770
1829
|
}
|
|
1771
1830
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormGroupComponent, decorators: [{
|
|
1772
1831
|
type: Component,
|
|
@@ -1800,6 +1859,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1800
1859
|
}] } });
|
|
1801
1860
|
|
|
1802
1861
|
class DynamicBaseSelectComponent extends DynamicBaseFormControlComponent {
|
|
1862
|
+
groups$;
|
|
1863
|
+
hasOptions;
|
|
1803
1864
|
ngOnInit() {
|
|
1804
1865
|
this.groups$ = new BehaviorSubject([]);
|
|
1805
1866
|
this.subscription = this.model.options$.subscribe(options => {
|
|
@@ -1848,8 +1909,8 @@ class DynamicBaseSelectComponent extends DynamicBaseFormControlComponent {
|
|
|
1848
1909
|
this.control.setValue(option.value);
|
|
1849
1910
|
this.onChange(option.value);
|
|
1850
1911
|
}
|
|
1851
|
-
static
|
|
1852
|
-
static
|
|
1912
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1913
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: DynamicBaseSelectComponent, isStandalone: false, selector: "dynamic-base-select", usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1853
1914
|
}
|
|
1854
1915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseSelectComponent, decorators: [{
|
|
1855
1916
|
type: Component,
|
|
@@ -1904,14 +1965,14 @@ class NgxDynamicFormModule {
|
|
|
1904
1965
|
static provideForms(config) {
|
|
1905
1966
|
return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));
|
|
1906
1967
|
}
|
|
1907
|
-
static
|
|
1908
|
-
static
|
|
1968
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1969
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicBaseFormComponent, DynamicBaseFormArrayComponent, DynamicBaseFormControlComponent, DynamicBaseFormControlContainerComponent, DynamicBaseFormGroupComponent, DynamicBaseSelectComponent, AsyncSubmitDirective], imports: [CommonModule,
|
|
1909
1970
|
FormsModule,
|
|
1910
1971
|
ReactiveFormsModule,
|
|
1911
1972
|
NgxUtilsModule], exports: [DynamicBaseFormComponent, DynamicBaseFormArrayComponent, DynamicBaseFormControlComponent, DynamicBaseFormControlContainerComponent, DynamicBaseFormGroupComponent, DynamicBaseSelectComponent, AsyncSubmitDirective, FormsModule,
|
|
1912
1973
|
ReactiveFormsModule,
|
|
1913
|
-
NgxUtilsModule] });
|
|
1914
|
-
static
|
|
1974
|
+
NgxUtilsModule] });
|
|
1975
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, providers: [
|
|
1915
1976
|
...pipes,
|
|
1916
1977
|
{ provide: NG_VALIDATORS, useValue: validateJSON, multi: true },
|
|
1917
1978
|
{ provide: NG_VALIDATORS, useValue: validateRequiredTranslation, multi: true },
|
|
@@ -1936,7 +1997,7 @@ class NgxDynamicFormModule {
|
|
|
1936
1997
|
ReactiveFormsModule,
|
|
1937
1998
|
NgxUtilsModule, FormsModule,
|
|
1938
1999
|
ReactiveFormsModule,
|
|
1939
|
-
NgxUtilsModule] });
|
|
2000
|
+
NgxUtilsModule] });
|
|
1940
2001
|
}
|
|
1941
2002
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, decorators: [{
|
|
1942
2003
|
type: NgModule,
|