@stemy/ngx-dynamic-form 19.1.5 → 19.1.7
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,7 +3,6 @@ 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';
|
|
7
6
|
import { BehaviorSubject, isObservable, of, Subject, firstValueFrom, Subscription } from 'rxjs';
|
|
8
7
|
import { map, debounceTime, first, groupBy, mergeMap } from 'rxjs/operators';
|
|
9
8
|
import * as i0 from '@angular/core';
|
|
@@ -11,22 +10,29 @@ import { Injector, Injectable, Inject, EventEmitter, Directive, Input, Output, H
|
|
|
11
10
|
import { FormGroup, FormArray, FormsModule, ReactiveFormsModule, NG_VALIDATORS } from '@angular/forms';
|
|
12
11
|
import { CommonModule } from '@angular/common';
|
|
13
12
|
|
|
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
|
+
};
|
|
14
22
|
class DynamicEditorModel extends DynamicInputControlModel {
|
|
15
|
-
type = DYNAMIC_FORM_CONTROL_TYPE_EDITOR;
|
|
16
|
-
inputType;
|
|
17
|
-
convertObject;
|
|
18
23
|
constructor(config, layout) {
|
|
19
24
|
super(config, layout);
|
|
25
|
+
this.type = DYNAMIC_FORM_CONTROL_TYPE_EDITOR;
|
|
20
26
|
this.inputType = config.inputType || "javascript";
|
|
21
27
|
this.convertObject = config.convertObject !== false;
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
__decorate([
|
|
25
|
-
serializable()
|
|
31
|
+
serializable(),
|
|
32
|
+
__metadata("design:type", String)
|
|
26
33
|
], DynamicEditorModel.prototype, "type", void 0);
|
|
27
34
|
|
|
28
35
|
class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
29
|
-
context;
|
|
30
36
|
get hidden() {
|
|
31
37
|
return this.isHidden;
|
|
32
38
|
}
|
|
@@ -36,7 +42,6 @@ class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
|
36
42
|
this.isHidden = value || false;
|
|
37
43
|
this.context?.filterGroups();
|
|
38
44
|
}
|
|
39
|
-
isHidden;
|
|
40
45
|
constructor(context, group, index = -1) {
|
|
41
46
|
super(context, group, index);
|
|
42
47
|
this.context = context;
|
|
@@ -44,21 +49,6 @@ class DynamicFormArrayGroupModel extends DynamicFormArrayGroupModel$1 {
|
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
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;
|
|
62
52
|
get addItem() {
|
|
63
53
|
return this.config.addItem !== false;
|
|
64
54
|
}
|
|
@@ -106,6 +96,8 @@ class DynamicFormArrayModel extends DynamicFormArrayModel$1 {
|
|
|
106
96
|
constructor(config, layout) {
|
|
107
97
|
super(config, layout);
|
|
108
98
|
this.config = config;
|
|
99
|
+
this.groups = [];
|
|
100
|
+
this.tabIndex = 0;
|
|
109
101
|
this.filteredGroups = new BehaviorSubject([]);
|
|
110
102
|
this.sortable = config.sortable || false;
|
|
111
103
|
this.useTabs = config.useTabs || false;
|
|
@@ -168,7 +160,6 @@ class DynamicFormArrayModel extends DynamicFormArrayModel$1 {
|
|
|
168
160
|
}
|
|
169
161
|
|
|
170
162
|
class DynamicFormGroupModel extends DynamicFormGroupModel$1 {
|
|
171
|
-
groups;
|
|
172
163
|
constructor(config, layout) {
|
|
173
164
|
super(config, layout);
|
|
174
165
|
const controls = [...config.group];
|
|
@@ -195,8 +186,6 @@ class DynamicFormGroupModel extends DynamicFormGroupModel$1 {
|
|
|
195
186
|
|
|
196
187
|
const ignoredKeys = ["disabled", "label", "value", "classes"];
|
|
197
188
|
class DynamicFormOption extends DynamicFormOption$1 {
|
|
198
|
-
classes;
|
|
199
|
-
props;
|
|
200
189
|
constructor(config) {
|
|
201
190
|
super(config);
|
|
202
191
|
this.classes = config.classes || "";
|
|
@@ -209,14 +198,10 @@ class DynamicFormOption extends DynamicFormOption$1 {
|
|
|
209
198
|
}
|
|
210
199
|
}
|
|
211
200
|
class DynamicSelectModel extends DynamicSelectModel$1 {
|
|
212
|
-
groupBy;
|
|
213
|
-
inline;
|
|
214
|
-
getClasses;
|
|
215
|
-
allowEmpty;
|
|
216
|
-
options$ = null;
|
|
217
|
-
mOptions = [];
|
|
218
201
|
constructor(config, layout) {
|
|
219
202
|
super(config, layout);
|
|
203
|
+
this.options$ = null;
|
|
204
|
+
this.mOptions = [];
|
|
220
205
|
this.groupBy = config.groupBy || null;
|
|
221
206
|
this.inline = config.inline || false;
|
|
222
207
|
this.getClasses = ObjectUtils.isFunction(config.getClasses) ? config.getClasses : (() => "");
|
|
@@ -338,13 +323,16 @@ function customizeFormModel(...providers) {
|
|
|
338
323
|
const factory = cachedFactory(providers);
|
|
339
324
|
return async (property, schema, model, config, injector) => {
|
|
340
325
|
const customizers = factory(injector);
|
|
326
|
+
const models = [model];
|
|
341
327
|
for (const customizer of customizers) {
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
344
|
-
|
|
328
|
+
const index = models.findIndex(m => customizer.acceptModel(m));
|
|
329
|
+
if (index >= 0) {
|
|
330
|
+
const custom = await customizer.customizeModel(models[index], config, property, schema);
|
|
331
|
+
const result = Array.isArray(custom) ? custom : [custom];
|
|
332
|
+
models.splice(index, 1, ...result);
|
|
345
333
|
}
|
|
346
334
|
}
|
|
347
|
-
return
|
|
335
|
+
return models;
|
|
348
336
|
};
|
|
349
337
|
}
|
|
350
338
|
|
|
@@ -453,7 +441,6 @@ function validateItemsMaxValue(max) {
|
|
|
453
441
|
|
|
454
442
|
const indexLabels = ["$ix", "$pix"];
|
|
455
443
|
class FormSubject extends Subject {
|
|
456
|
-
notifyCallback;
|
|
457
444
|
constructor(notifyCallback) {
|
|
458
445
|
super();
|
|
459
446
|
this.notifyCallback = notifyCallback;
|
|
@@ -527,15 +514,12 @@ function getFormValidationErrors(controls, parentPath = "") {
|
|
|
527
514
|
}
|
|
528
515
|
|
|
529
516
|
class DynamicFormService extends DynamicFormService$1 {
|
|
530
|
-
openApi;
|
|
531
|
-
injector;
|
|
532
517
|
get api() {
|
|
533
518
|
return this.openApi.api;
|
|
534
519
|
}
|
|
535
520
|
get language() {
|
|
536
521
|
return this.api.language;
|
|
537
522
|
}
|
|
538
|
-
schemas;
|
|
539
523
|
constructor(cs, vs, openApi, injector) {
|
|
540
524
|
super(cs, vs);
|
|
541
525
|
this.openApi = openApi;
|
|
@@ -776,19 +760,18 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
776
760
|
return Array.isArray(res) ? res : [res];
|
|
777
761
|
};
|
|
778
762
|
const schema = this.schemas[name];
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
763
|
+
const group = await this.getFormModelForSchemaDef(schema, fieldSets, customizeModels, "");
|
|
764
|
+
// Add id fields if necessary
|
|
765
|
+
if (group.length > 0) {
|
|
766
|
+
const idFields = [
|
|
767
|
+
createFormInput("id", { hidden: true }),
|
|
768
|
+
createFormInput("_id", { hidden: true })
|
|
769
|
+
].filter(t => !group.some(c => c.id == t.id));
|
|
770
|
+
group.unshift(...idFields);
|
|
771
|
+
}
|
|
784
772
|
const config = {
|
|
785
773
|
id: "root",
|
|
786
|
-
group
|
|
787
|
-
// -- Hidden id fields --
|
|
788
|
-
...idFields,
|
|
789
|
-
// -- Main form controls --
|
|
790
|
-
...controls
|
|
791
|
-
],
|
|
774
|
+
group,
|
|
792
775
|
fieldSets
|
|
793
776
|
};
|
|
794
777
|
const root = await customizeModels({
|
|
@@ -797,18 +780,18 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
797
780
|
properties: schema?.properties || {}
|
|
798
781
|
}, schema, DynamicFormGroupModel, config, "");
|
|
799
782
|
// Check if the customized root wrapper returned an array
|
|
800
|
-
|
|
783
|
+
group.length = 0;
|
|
801
784
|
for (const model of root) {
|
|
802
785
|
if (model instanceof DynamicFormGroupModel && model.id === "root") {
|
|
803
786
|
return model;
|
|
804
787
|
}
|
|
805
788
|
else {
|
|
806
|
-
|
|
789
|
+
group.push(model);
|
|
807
790
|
}
|
|
808
791
|
}
|
|
809
792
|
return new DynamicFormGroupModel({
|
|
810
793
|
...config,
|
|
811
|
-
group
|
|
794
|
+
group
|
|
812
795
|
});
|
|
813
796
|
}
|
|
814
797
|
async getFormModelForSchemaDef(schema, fieldSets, customizeModels, path) {
|
|
@@ -1179,8 +1162,8 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
1179
1162
|
validators.itemsMaxValue = items.maximum;
|
|
1180
1163
|
}
|
|
1181
1164
|
}
|
|
1182
|
-
static
|
|
1183
|
-
static
|
|
1165
|
+
static { this.ɵ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 }); }
|
|
1166
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicFormService }); }
|
|
1184
1167
|
}
|
|
1185
1168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicFormService, decorators: [{
|
|
1186
1169
|
type: Injectable
|
|
@@ -1193,20 +1176,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1193
1176
|
}] }] });
|
|
1194
1177
|
|
|
1195
1178
|
class AsyncSubmitDirective {
|
|
1196
|
-
toaster;
|
|
1197
|
-
cdr;
|
|
1198
|
-
elem;
|
|
1199
|
-
renderer;
|
|
1200
|
-
method;
|
|
1201
|
-
form;
|
|
1202
|
-
context;
|
|
1203
|
-
onSuccess;
|
|
1204
|
-
onError;
|
|
1205
|
-
loading;
|
|
1206
|
-
disabled;
|
|
1207
|
-
callback;
|
|
1208
|
-
onStatusChange;
|
|
1209
|
-
onSubmit;
|
|
1210
1179
|
get isDisabled() {
|
|
1211
1180
|
return this.disabled;
|
|
1212
1181
|
}
|
|
@@ -1282,8 +1251,8 @@ class AsyncSubmitDirective {
|
|
|
1282
1251
|
this.toaster.error(reason.message, reason.context);
|
|
1283
1252
|
});
|
|
1284
1253
|
}
|
|
1285
|
-
static
|
|
1286
|
-
static
|
|
1254
|
+
static { this.ɵ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 }); }
|
|
1255
|
+
static { this.ɵ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 }); }
|
|
1287
1256
|
}
|
|
1288
1257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AsyncSubmitDirective, decorators: [{
|
|
1289
1258
|
type: Directive,
|
|
@@ -1318,32 +1287,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1318
1287
|
}] } });
|
|
1319
1288
|
|
|
1320
1289
|
class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
1321
|
-
formService;
|
|
1322
|
-
events;
|
|
1323
|
-
group = null;
|
|
1324
|
-
model = null;
|
|
1325
|
-
layout = null;
|
|
1326
|
-
blur = new EventEmitter();
|
|
1327
|
-
change = new EventEmitter();
|
|
1328
|
-
focus = new EventEmitter();
|
|
1329
|
-
groupModel;
|
|
1330
|
-
labelPrefix;
|
|
1331
|
-
getComponentType;
|
|
1332
|
-
contentTemplates;
|
|
1333
|
-
viewTemplates;
|
|
1334
1290
|
get status() {
|
|
1335
1291
|
return !this.group ? null : this.group.status;
|
|
1336
1292
|
}
|
|
1337
|
-
onValueChange;
|
|
1338
|
-
onStatusChange;
|
|
1339
|
-
onSubmit;
|
|
1340
|
-
onDetectChanges;
|
|
1341
|
-
subscription = new Subscription();
|
|
1342
|
-
groupSubscription = new Subscription();
|
|
1343
1293
|
constructor(formService, events, changeDetectorRef, componentService) {
|
|
1344
1294
|
super(changeDetectorRef, componentService);
|
|
1345
1295
|
this.formService = formService;
|
|
1346
1296
|
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();
|
|
1347
1305
|
this.groupModel = undefined;
|
|
1348
1306
|
this.labelPrefix = "";
|
|
1349
1307
|
this.getComponentType = () => null;
|
|
@@ -1424,8 +1382,8 @@ class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
|
1424
1382
|
}
|
|
1425
1383
|
return `form-control-${parts.join("-")}`;
|
|
1426
1384
|
}
|
|
1427
|
-
static
|
|
1428
|
-
static
|
|
1385
|
+
static { this.ɵ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 }); }
|
|
1386
|
+
static { this.ɵ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 }); }
|
|
1429
1387
|
}
|
|
1430
1388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormComponent, decorators: [{
|
|
1431
1389
|
type: Component,
|
|
@@ -1476,21 +1434,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1476
1434
|
}] } });
|
|
1477
1435
|
|
|
1478
1436
|
class DynamicBaseFormControlContainerComponent extends DynamicFormControlContainerComponent {
|
|
1479
|
-
form;
|
|
1480
|
-
cdr;
|
|
1481
|
-
injector;
|
|
1482
|
-
contentTemplateList = null;
|
|
1483
|
-
klass = null;
|
|
1484
|
-
context = null;
|
|
1485
|
-
group = null;
|
|
1486
|
-
hostClass = null;
|
|
1487
|
-
inputTemplateList = null;
|
|
1488
|
-
layout = null;
|
|
1489
|
-
model = null;
|
|
1490
|
-
blur = new EventEmitter();
|
|
1491
|
-
change = new EventEmitter();
|
|
1492
|
-
focus = new EventEmitter();
|
|
1493
|
-
componentViewContainerRef = null;
|
|
1494
1437
|
get componentType() {
|
|
1495
1438
|
return this.form.getComponentType?.(this.model, this.injector)
|
|
1496
1439
|
?? this.componentService.getCustomComponentType(this.model);
|
|
@@ -1508,12 +1451,23 @@ class DynamicBaseFormControlContainerComponent extends DynamicFormControlContain
|
|
|
1508
1451
|
get formService() {
|
|
1509
1452
|
return this.form.formService;
|
|
1510
1453
|
}
|
|
1511
|
-
onDetectChanges;
|
|
1512
1454
|
constructor(form, cdr, injector, cfr, layoutService, validationService, componentService, relationService) {
|
|
1513
1455
|
super(cdr, cfr, layoutService, validationService, componentService, relationService);
|
|
1514
1456
|
this.form = form;
|
|
1515
1457
|
this.cdr = cdr;
|
|
1516
1458
|
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;
|
|
1517
1471
|
}
|
|
1518
1472
|
ngOnInit() {
|
|
1519
1473
|
super.ngOnInit();
|
|
@@ -1560,10 +1514,10 @@ class DynamicBaseFormControlContainerComponent extends DynamicFormControlContain
|
|
|
1560
1514
|
return;
|
|
1561
1515
|
component.initialize(this.changeDetectorRef);
|
|
1562
1516
|
}
|
|
1563
|
-
static
|
|
1564
|
-
static
|
|
1517
|
+
static { this.ɵ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 }); }
|
|
1518
|
+
static { this.ɵ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: [
|
|
1565
1519
|
{ provide: DynamicFormControlContainerComponent, useExisting: DynamicBaseFormControlContainerComponent }
|
|
1566
|
-
], 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 });
|
|
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 }); }
|
|
1567
1521
|
}
|
|
1568
1522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlContainerComponent, decorators: [{
|
|
1569
1523
|
type: Component,
|
|
@@ -1610,28 +1564,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1610
1564
|
}] } });
|
|
1611
1565
|
|
|
1612
1566
|
class DynamicBaseFormArrayComponent extends DynamicFormArrayComponent {
|
|
1613
|
-
form;
|
|
1614
|
-
injector;
|
|
1615
|
-
cdr;
|
|
1616
|
-
formLayout = null;
|
|
1617
|
-
group = null;
|
|
1618
|
-
layout = null;
|
|
1619
|
-
model = null;
|
|
1620
|
-
templates = null;
|
|
1621
|
-
blur = new EventEmitter();
|
|
1622
|
-
change = new EventEmitter();
|
|
1623
|
-
customEvent = new EventEmitter();
|
|
1624
|
-
focus = new EventEmitter();
|
|
1625
|
-
components = null;
|
|
1626
1567
|
get useTabs() {
|
|
1627
1568
|
return this.model?.useTabs;
|
|
1628
1569
|
}
|
|
1629
|
-
subscription;
|
|
1630
1570
|
constructor(layoutService, validationService, form, injector, cdr) {
|
|
1631
1571
|
super(layoutService, validationService);
|
|
1632
1572
|
this.form = form;
|
|
1633
1573
|
this.injector = injector;
|
|
1634
1574
|
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;
|
|
1635
1585
|
}
|
|
1636
1586
|
initialize(cdr) {
|
|
1637
1587
|
this.subscription = this.model.filteredGroups.subscribe(filteredGroups => {
|
|
@@ -1682,8 +1632,8 @@ class DynamicBaseFormArrayComponent extends DynamicFormArrayComponent {
|
|
|
1682
1632
|
this.cdr.detectChanges();
|
|
1683
1633
|
this.components.forEach(t => t.cdr.detectChanges());
|
|
1684
1634
|
}
|
|
1685
|
-
static
|
|
1686
|
-
static
|
|
1635
|
+
static { this.ɵ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 }); }
|
|
1636
|
+
static { this.ɵ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 }); }
|
|
1687
1637
|
}
|
|
1688
1638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormArrayComponent, decorators: [{
|
|
1689
1639
|
type: Component,
|
|
@@ -1717,22 +1667,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1717
1667
|
}] } });
|
|
1718
1668
|
|
|
1719
1669
|
class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
1720
|
-
form;
|
|
1721
|
-
injector;
|
|
1722
|
-
cdr;
|
|
1723
|
-
formLayout = null;
|
|
1724
|
-
group = null;
|
|
1725
|
-
layout = null;
|
|
1726
|
-
model = null;
|
|
1727
|
-
blur = new EventEmitter();
|
|
1728
|
-
change = new EventEmitter();
|
|
1729
|
-
focus = new EventEmitter();
|
|
1730
|
-
subscription;
|
|
1731
1670
|
constructor(layoutService, validationService, form, injector, cdr) {
|
|
1732
1671
|
super(layoutService, validationService);
|
|
1733
1672
|
this.form = form;
|
|
1734
1673
|
this.injector = injector;
|
|
1735
1674
|
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();
|
|
1736
1682
|
}
|
|
1737
1683
|
ngAfterViewInit() {
|
|
1738
1684
|
this.subscription = this.control.valueChanges.pipe(debounceTime(500)).subscribe(value => {
|
|
@@ -1749,8 +1695,8 @@ class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
|
1749
1695
|
}
|
|
1750
1696
|
onValueChanged(value) {
|
|
1751
1697
|
}
|
|
1752
|
-
static
|
|
1753
|
-
static
|
|
1698
|
+
static { this.ɵ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 }); }
|
|
1699
|
+
static { this.ɵ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 }); }
|
|
1754
1700
|
}
|
|
1755
1701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormControlComponent, decorators: [{
|
|
1756
1702
|
type: Component,
|
|
@@ -1779,22 +1725,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1779
1725
|
}] } });
|
|
1780
1726
|
|
|
1781
1727
|
class DynamicBaseFormGroupComponent extends DynamicFormGroupComponent {
|
|
1782
|
-
layoutService;
|
|
1783
|
-
validationService;
|
|
1784
|
-
formLayout = null;
|
|
1785
|
-
group = null;
|
|
1786
|
-
layout = null;
|
|
1787
|
-
model = null;
|
|
1788
|
-
templates = [];
|
|
1789
|
-
blur = new EventEmitter();
|
|
1790
|
-
change = new EventEmitter();
|
|
1791
|
-
customEvent = new EventEmitter();
|
|
1792
|
-
focus = new EventEmitter();
|
|
1793
|
-
components = null;
|
|
1794
1728
|
constructor(layoutService, validationService) {
|
|
1795
1729
|
super(layoutService, validationService);
|
|
1796
1730
|
this.layoutService = layoutService;
|
|
1797
1731
|
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;
|
|
1798
1742
|
}
|
|
1799
1743
|
getClass(context, place, model) {
|
|
1800
1744
|
return [
|
|
@@ -1821,8 +1765,8 @@ class DynamicBaseFormGroupComponent extends DynamicFormGroupComponent {
|
|
|
1821
1765
|
}
|
|
1822
1766
|
return null;
|
|
1823
1767
|
}
|
|
1824
|
-
static
|
|
1825
|
-
static
|
|
1768
|
+
static { this.ɵ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 }); }
|
|
1769
|
+
static { this.ɵ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 }); }
|
|
1826
1770
|
}
|
|
1827
1771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseFormGroupComponent, decorators: [{
|
|
1828
1772
|
type: Component,
|
|
@@ -1856,8 +1800,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1856
1800
|
}] } });
|
|
1857
1801
|
|
|
1858
1802
|
class DynamicBaseSelectComponent extends DynamicBaseFormControlComponent {
|
|
1859
|
-
groups$;
|
|
1860
|
-
hasOptions;
|
|
1861
1803
|
ngOnInit() {
|
|
1862
1804
|
this.groups$ = new BehaviorSubject([]);
|
|
1863
1805
|
this.subscription = this.model.options$.subscribe(options => {
|
|
@@ -1906,8 +1848,8 @@ class DynamicBaseSelectComponent extends DynamicBaseFormControlComponent {
|
|
|
1906
1848
|
this.control.setValue(option.value);
|
|
1907
1849
|
this.onChange(option.value);
|
|
1908
1850
|
}
|
|
1909
|
-
static
|
|
1910
|
-
static
|
|
1851
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1852
|
+
static { this.ɵ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 }); }
|
|
1911
1853
|
}
|
|
1912
1854
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: DynamicBaseSelectComponent, decorators: [{
|
|
1913
1855
|
type: Component,
|
|
@@ -1962,14 +1904,14 @@ class NgxDynamicFormModule {
|
|
|
1962
1904
|
static provideForms(config) {
|
|
1963
1905
|
return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));
|
|
1964
1906
|
}
|
|
1965
|
-
static
|
|
1966
|
-
static
|
|
1907
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1908
|
+
static { this.ɵ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,
|
|
1967
1909
|
FormsModule,
|
|
1968
1910
|
ReactiveFormsModule,
|
|
1969
1911
|
NgxUtilsModule], exports: [DynamicBaseFormComponent, DynamicBaseFormArrayComponent, DynamicBaseFormControlComponent, DynamicBaseFormControlContainerComponent, DynamicBaseFormGroupComponent, DynamicBaseSelectComponent, AsyncSubmitDirective, FormsModule,
|
|
1970
1912
|
ReactiveFormsModule,
|
|
1971
|
-
NgxUtilsModule] });
|
|
1972
|
-
static
|
|
1913
|
+
NgxUtilsModule] }); }
|
|
1914
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, providers: [
|
|
1973
1915
|
...pipes,
|
|
1974
1916
|
{ provide: NG_VALIDATORS, useValue: validateJSON, multi: true },
|
|
1975
1917
|
{ provide: NG_VALIDATORS, useValue: validateRequiredTranslation, multi: true },
|
|
@@ -1994,7 +1936,7 @@ class NgxDynamicFormModule {
|
|
|
1994
1936
|
ReactiveFormsModule,
|
|
1995
1937
|
NgxUtilsModule, FormsModule,
|
|
1996
1938
|
ReactiveFormsModule,
|
|
1997
|
-
NgxUtilsModule] });
|
|
1939
|
+
NgxUtilsModule] }); }
|
|
1998
1940
|
}
|
|
1999
1941
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormModule, decorators: [{
|
|
2000
1942
|
type: NgModule,
|