@stemy/ngx-dynamic-form 10.2.30 → 10.2.33
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/bundles/stemy-ngx-dynamic-form.umd.js +131 -42
- package/bundles/stemy-ngx-dynamic-form.umd.js.map +1 -1
- package/bundles/stemy-ngx-dynamic-form.umd.min.js +1 -1
- package/bundles/stemy-ngx-dynamic-form.umd.min.js.map +1 -1
- package/esm2015/ngx-dynamic-form/common-types.js +1 -1
- package/esm2015/ngx-dynamic-form/components/base/dynamic-base-form-array.component.js +32 -6
- package/esm2015/ngx-dynamic-form/components/base/dynamic-base-form-control-container.component.js +2 -2
- package/esm2015/ngx-dynamic-form/components/base/dynamic-base-form-group.component.js +14 -2
- package/esm2015/ngx-dynamic-form/components/base/dynamic-base-form.component.js +6 -5
- package/esm2015/ngx-dynamic-form/directives/async-submit.directive.js +1 -1
- package/esm2015/ngx-dynamic-form/services/dynamic-form.service.js +51 -19
- package/esm2015/ngx-dynamic-form/utils/dynamic-form-array.model.js +9 -1
- package/esm2015/ngx-dynamic-form/utils/form-subject.js +11 -4
- package/esm2015/ngx-dynamic-form/utils/misc.js +1 -1
- package/esm2015/public_api.js +2 -1
- package/fesm2015/stemy-ngx-dynamic-form.js +121 -38
- package/fesm2015/stemy-ngx-dynamic-form.js.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +11 -10
- package/ngx-dynamic-form/components/base/dynamic-base-form-array.component.d.ts +9 -3
- package/ngx-dynamic-form/components/base/dynamic-base-form-group.component.d.ts +1 -0
- package/ngx-dynamic-form/components/base/dynamic-base-form.component.d.ts +4 -4
- package/ngx-dynamic-form/directives/async-submit.directive.d.ts +2 -2
- package/ngx-dynamic-form/services/dynamic-form.service.d.ts +15 -12
- package/ngx-dynamic-form/utils/dynamic-form-array.model.d.ts +10 -0
- package/ngx-dynamic-form/utils/form-subject.d.ts +4 -3
- package/ngx-dynamic-form/utils/misc.d.ts +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -1
- package/stemy-ngx-dynamic-form.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@stemy/ngx-utils'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@stemy/ngx-dynamic-form', ['exports', '@stemy/ngx-utils', 'rxjs', '@angular/core', '@angular/forms', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.stemy = global.stemy || {}, global.stemy['ngx-dynamic-form'] = {}), global.ngxUtils, global.rxjs, global.ng.core, global.ng.forms, global.
|
|
5
|
-
}(this, (function (exports, ngxUtils, rxjs, core$1, forms,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@stemy/ngx-utils'), require('@ng-dynamic-forms/core'), require('rxjs'), require('@angular/core'), require('@angular/forms'), require('rxjs/operators'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@stemy/ngx-dynamic-form', ['exports', '@stemy/ngx-utils', '@ng-dynamic-forms/core', 'rxjs', '@angular/core', '@angular/forms', 'rxjs/operators', '@angular/common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.stemy = global.stemy || {}, global.stemy['ngx-dynamic-form'] = {}), global.ngxUtils, global.core, global.rxjs, global.ng.core, global.ng.forms, global.rxjs.operators, global.ng.common));
|
|
5
|
+
}(this, (function (exports, ngxUtils, core, rxjs, core$1, forms, operators, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
// --- Decorator functions ---
|
|
8
8
|
function defaultSerializer(id, parent) {
|
|
@@ -484,6 +484,24 @@
|
|
|
484
484
|
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
+
var DynamicFormArrayModel = /** @class */ (function (_super) {
|
|
488
|
+
__extends(DynamicFormArrayModel, _super);
|
|
489
|
+
function DynamicFormArrayModel(config, layout) {
|
|
490
|
+
var _this = _super.call(this, config, layout) || this;
|
|
491
|
+
_this.useTabs = config.useTabs || false;
|
|
492
|
+
_this.saveTab = ngxUtils.ObjectUtils.isFunction(config.saveTab) ? config.saveTab : (function (index, model) {
|
|
493
|
+
model.tabIndex = index;
|
|
494
|
+
});
|
|
495
|
+
_this.restoreTab = ngxUtils.ObjectUtils.isFunction(config.restoreTab) ? config.restoreTab : (function (model) {
|
|
496
|
+
return model.tabIndex;
|
|
497
|
+
});
|
|
498
|
+
_this.additional = config.additional || {};
|
|
499
|
+
return _this;
|
|
500
|
+
}
|
|
501
|
+
return DynamicFormArrayModel;
|
|
502
|
+
}(core.DynamicFormArrayModel));
|
|
503
|
+
|
|
504
|
+
var indexLabels = ["$ix", "$pix"];
|
|
487
505
|
var FormSubject = /** @class */ (function (_super) {
|
|
488
506
|
__extends(FormSubject, _super);
|
|
489
507
|
function FormSubject(notifyCallback) {
|
|
@@ -495,12 +513,18 @@
|
|
|
495
513
|
var _this = this;
|
|
496
514
|
val.then(function (v) { return _this.next(v); });
|
|
497
515
|
};
|
|
498
|
-
FormSubject.prototype.notify = function (controlModel, control) {
|
|
516
|
+
FormSubject.prototype.notify = function (controlModel, control, root) {
|
|
517
|
+
var indexes = {};
|
|
499
518
|
var path = controlModel;
|
|
500
|
-
|
|
519
|
+
var ix = 0;
|
|
520
|
+
while (path) {
|
|
521
|
+
if (!isNaN(path.index)) {
|
|
522
|
+
var key = indexLabels[ix++] || "$pix" + ix;
|
|
523
|
+
indexes[key] = path.index;
|
|
524
|
+
}
|
|
501
525
|
path = path.parent;
|
|
502
526
|
}
|
|
503
|
-
var value = this.notifyCallback(controlModel, control,
|
|
527
|
+
var value = this.notifyCallback(controlModel, control, root, indexes);
|
|
504
528
|
if (!(value instanceof Promise)) {
|
|
505
529
|
value = Promise.resolve(value);
|
|
506
530
|
}
|
|
@@ -556,21 +580,12 @@
|
|
|
556
580
|
return parts;
|
|
557
581
|
}
|
|
558
582
|
|
|
559
|
-
var DynamicFormArrayModel = /** @class */ (function (_super) {
|
|
560
|
-
__extends(DynamicFormArrayModel, _super);
|
|
561
|
-
function DynamicFormArrayModel(config, layout) {
|
|
562
|
-
var _this = _super.call(this, config, layout) || this;
|
|
563
|
-
_this.additional = config.additional || {};
|
|
564
|
-
return _this;
|
|
565
|
-
}
|
|
566
|
-
return DynamicFormArrayModel;
|
|
567
|
-
}(core.DynamicFormArrayModel));
|
|
568
|
-
|
|
569
583
|
var DynamicFormService = /** @class */ (function (_super) {
|
|
570
584
|
__extends(DynamicFormService, _super);
|
|
571
|
-
function DynamicFormService(cs, vs, openApi) {
|
|
585
|
+
function DynamicFormService(cs, vs, openApi, injector) {
|
|
572
586
|
var _this = _super.call(this, cs, vs) || this;
|
|
573
587
|
_this.openApi = openApi;
|
|
588
|
+
_this.injector = injector;
|
|
574
589
|
_this.onDetectChanges = new core$1.EventEmitter();
|
|
575
590
|
return _this;
|
|
576
591
|
}
|
|
@@ -601,20 +616,20 @@
|
|
|
601
616
|
DynamicFormService.prototype.serialize = function (formModel, formGroup) {
|
|
602
617
|
return this.serializeRecursive(formModel, formGroup);
|
|
603
618
|
};
|
|
604
|
-
DynamicFormService.prototype.notifyChanges = function (formModel, formGroup) {
|
|
605
|
-
this.notifyChangesRecursive(formModel, formGroup);
|
|
619
|
+
DynamicFormService.prototype.notifyChanges = function (formModel, formGroup, root) {
|
|
620
|
+
this.notifyChangesRecursive(formModel, formGroup, root);
|
|
606
621
|
};
|
|
607
|
-
DynamicFormService.prototype.updateSelectOptions = function (formControlModel, formControl) {
|
|
622
|
+
DynamicFormService.prototype.updateSelectOptions = function (formControlModel, formControl, root) {
|
|
608
623
|
if (formControlModel instanceof core.DynamicSelectModel) {
|
|
609
624
|
var options = formControlModel.options$;
|
|
610
625
|
if (options instanceof FormSubject) {
|
|
611
|
-
options.notify(formControlModel, formControl);
|
|
626
|
+
options.notify(formControlModel, formControl, root);
|
|
612
627
|
return;
|
|
613
628
|
}
|
|
614
629
|
while (options instanceof rxjs.Subject && options.source) {
|
|
615
630
|
options = options.source;
|
|
616
631
|
if (options instanceof FormSubject) {
|
|
617
|
-
options.notify(formControlModel, formControl);
|
|
632
|
+
options.notify(formControlModel, formControl, root);
|
|
618
633
|
}
|
|
619
634
|
}
|
|
620
635
|
}
|
|
@@ -732,7 +747,7 @@
|
|
|
732
747
|
});
|
|
733
748
|
});
|
|
734
749
|
};
|
|
735
|
-
DynamicFormService.prototype.notifyChangesRecursive = function (formModel, formGroup) {
|
|
750
|
+
DynamicFormService.prototype.notifyChangesRecursive = function (formModel, formGroup, root) {
|
|
736
751
|
if (!formModel || !formGroup)
|
|
737
752
|
return;
|
|
738
753
|
for (var i in formModel) {
|
|
@@ -743,15 +758,15 @@
|
|
|
743
758
|
var subArray = subControl;
|
|
744
759
|
for (var i_2 = 0; i_2 < length; i_2++) {
|
|
745
760
|
var itemModel = subModel.get(i_2);
|
|
746
|
-
this.notifyChangesRecursive(itemModel.group, subArray.at(i_2));
|
|
761
|
+
this.notifyChangesRecursive(itemModel.group, subArray.at(i_2), root);
|
|
747
762
|
}
|
|
748
763
|
continue;
|
|
749
764
|
}
|
|
750
765
|
if (subModel instanceof core.DynamicFormGroupModel) {
|
|
751
|
-
this.notifyChangesRecursive(subModel.group, subControl);
|
|
766
|
+
this.notifyChangesRecursive(subModel.group, subControl, root);
|
|
752
767
|
continue;
|
|
753
768
|
}
|
|
754
|
-
this.updateSelectOptions(subModel, subControl);
|
|
769
|
+
this.updateSelectOptions(subModel, subControl, root);
|
|
755
770
|
}
|
|
756
771
|
};
|
|
757
772
|
DynamicFormService.prototype.showErrorsForGroup = function (formGroup) {
|
|
@@ -777,6 +792,7 @@
|
|
|
777
792
|
DynamicFormService.prototype.getFormModelForSchema = function (name, customizeModel) {
|
|
778
793
|
return __awaiter(this, void 0, void 0, function () {
|
|
779
794
|
var _c, customizeModels;
|
|
795
|
+
var _this = this;
|
|
780
796
|
return __generator(this, function (_d) {
|
|
781
797
|
switch (_d.label) {
|
|
782
798
|
case 0:
|
|
@@ -789,7 +805,7 @@
|
|
|
789
805
|
var model = new modelType(config);
|
|
790
806
|
if (!ngxUtils.ObjectUtils.isFunction(customizeModel))
|
|
791
807
|
return [model];
|
|
792
|
-
var res = customizeModel(property, schema, model, config);
|
|
808
|
+
var res = customizeModel(property, schema, model, config, _this.injector);
|
|
793
809
|
return Array.isArray(res) ? res : [res];
|
|
794
810
|
};
|
|
795
811
|
return [2 /*return*/, this.getFormModelForSchemaDef(this.schemas[name], customizeModels)];
|
|
@@ -849,6 +865,21 @@
|
|
|
849
865
|
}
|
|
850
866
|
return [];
|
|
851
867
|
};
|
|
868
|
+
DynamicFormService.prototype.findModelByPath = function (parent, path) {
|
|
869
|
+
if (path.length == 0)
|
|
870
|
+
return parent;
|
|
871
|
+
var next = path.shift();
|
|
872
|
+
if (Array.isArray(parent)) {
|
|
873
|
+
return this.findModelByPath(parent.find(function (t) { return t.id == next; }), path);
|
|
874
|
+
}
|
|
875
|
+
if (parent instanceof core.DynamicFormGroupModel) {
|
|
876
|
+
return this.findModelByPath(parent.group.find(function (t) { return t.id == next; }), path);
|
|
877
|
+
}
|
|
878
|
+
if (parent instanceof DynamicFormArrayModel) {
|
|
879
|
+
return this.findModelByPath(parent.groups.find(function (t) { return t.index == next; }), path);
|
|
880
|
+
}
|
|
881
|
+
return parent;
|
|
882
|
+
};
|
|
852
883
|
DynamicFormService.prototype.getFormControlConfig = function (property, schema) {
|
|
853
884
|
var validators = this.getValidators(property, schema);
|
|
854
885
|
var errorMessages = Object.keys(validators).reduce(function (res, key) {
|
|
@@ -870,7 +901,10 @@
|
|
|
870
901
|
var _a;
|
|
871
902
|
var ref = ((_a = property.items) === null || _a === void 0 ? void 0 : _a.$ref) || property.$ref || "";
|
|
872
903
|
var subSchema = this.schemas[ref.split("/").pop()];
|
|
873
|
-
return Object.assign(this.getFormControlConfig(property, schema), {
|
|
904
|
+
return Object.assign(this.getFormControlConfig(property, schema), {
|
|
905
|
+
groupFactory: function () { return _this.getFormModelForSchemaDef(subSchema, customizeModels); },
|
|
906
|
+
useTabs: property.useTabs || false
|
|
907
|
+
});
|
|
874
908
|
};
|
|
875
909
|
DynamicFormService.prototype.getFormGroupConfig = function (property, schema, customizeModels) {
|
|
876
910
|
var ref = property.$ref || "";
|
|
@@ -879,7 +913,7 @@
|
|
|
879
913
|
};
|
|
880
914
|
DynamicFormService.prototype.getFormInputConfig = function (property, schema) {
|
|
881
915
|
var _a;
|
|
882
|
-
var inputType = ngxUtils.StringUtils.has(property.id, "password", "Password") ? "password" : (((_a = property.items) === null || _a === void 0 ? void 0 : _a.type) || property.type);
|
|
916
|
+
var inputType = ngxUtils.StringUtils.has(property.id, "password", "Password") ? "password" : (property.format || ((_a = property.items) === null || _a === void 0 ? void 0 : _a.type) || property.type);
|
|
883
917
|
switch (inputType) {
|
|
884
918
|
case "boolean":
|
|
885
919
|
inputType = "checkbox";
|
|
@@ -904,6 +938,7 @@
|
|
|
904
938
|
max: isNaN(sub.maximum) ? Number.MAX_SAFE_INTEGER : sub.maximum,
|
|
905
939
|
minLength: isNaN(sub.minLength) ? Number.MIN_SAFE_INTEGER : sub.minLength,
|
|
906
940
|
maxLength: isNaN(sub.maxLength) ? Number.MAX_SAFE_INTEGER : sub.maxLength,
|
|
941
|
+
placeholder: property.placeholder || ""
|
|
907
942
|
});
|
|
908
943
|
};
|
|
909
944
|
DynamicFormService.prototype.getFormTextareaConfig = function (property, schema) {
|
|
@@ -981,23 +1016,34 @@
|
|
|
981
1016
|
});
|
|
982
1017
|
}
|
|
983
1018
|
if (isStringWithVal(property.optionsPath)) {
|
|
984
|
-
return new FormSelectSubject(function (formModel, control,
|
|
1019
|
+
return new FormSelectSubject(function (formModel, control, root, indexes) {
|
|
985
1020
|
var path = property.optionsPath;
|
|
986
1021
|
var target = control;
|
|
1022
|
+
var model = formModel;
|
|
987
1023
|
if (path.startsWith("$root")) {
|
|
988
1024
|
path = path.substr(5);
|
|
989
1025
|
while (target.parent) {
|
|
990
1026
|
target = target.parent;
|
|
991
1027
|
}
|
|
1028
|
+
model = root;
|
|
992
1029
|
}
|
|
993
1030
|
while (path.startsWith(".")) {
|
|
994
1031
|
path = path.substr(1);
|
|
995
1032
|
if (target.parent) {
|
|
996
1033
|
target = target.parent;
|
|
997
1034
|
}
|
|
1035
|
+
model = model.parent || root;
|
|
998
1036
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1037
|
+
Object.keys(indexes).forEach(function (key) {
|
|
1038
|
+
path = path.replace(key, indexes[key]);
|
|
1039
|
+
});
|
|
1040
|
+
model = _this.findModelByPath(model, path.split("."));
|
|
1041
|
+
var modelOptions = (model instanceof core.DynamicSelectModel ? model.options : []);
|
|
1042
|
+
var value = ngxUtils.ObjectUtils.getValue(target.value, path);
|
|
1043
|
+
var options = (!ngxUtils.ObjectUtils.isArray(value) ? [] : value).map(function (value) {
|
|
1044
|
+
var modelOption = modelOptions.find(function (t) { return t.value == value; });
|
|
1045
|
+
return { value: value, label: (modelOption === null || modelOption === void 0 ? void 0 : modelOption.label) || value };
|
|
1046
|
+
});
|
|
1001
1047
|
return _this.translateOptions(options);
|
|
1002
1048
|
});
|
|
1003
1049
|
}
|
|
@@ -1086,7 +1132,8 @@
|
|
|
1086
1132
|
DynamicFormService.ctorParameters = function () { return [
|
|
1087
1133
|
{ type: core.DynamicFormComponentService },
|
|
1088
1134
|
{ type: core.DynamicFormValidationService },
|
|
1089
|
-
{ type: ngxUtils.OpenApiService }
|
|
1135
|
+
{ type: ngxUtils.OpenApiService, decorators: [{ type: core$1.Inject, args: [ngxUtils.OpenApiService,] }] },
|
|
1136
|
+
{ type: core$1.Injector, decorators: [{ type: core$1.Inject, args: [core$1.Injector,] }] }
|
|
1090
1137
|
]; };
|
|
1091
1138
|
|
|
1092
1139
|
var AsyncSubmitDirective = /** @class */ (function () {
|
|
@@ -1208,8 +1255,8 @@
|
|
|
1208
1255
|
_this.blur = new core$1.EventEmitter();
|
|
1209
1256
|
_this.change = new core$1.EventEmitter();
|
|
1210
1257
|
_this.focus = new core$1.EventEmitter();
|
|
1211
|
-
_this.onStatusChange = new core$1.EventEmitter();
|
|
1212
1258
|
_this.onValueChange = new core$1.EventEmitter();
|
|
1259
|
+
_this.onStatusChange = new core$1.EventEmitter();
|
|
1213
1260
|
_this.onSubmit = new core$1.EventEmitter();
|
|
1214
1261
|
_this.templates = new core$1.QueryList();
|
|
1215
1262
|
_this.subscription = new rxjs.Subscription();
|
|
@@ -1231,8 +1278,9 @@
|
|
|
1231
1278
|
this.groupSubscription = ngxUtils.ObservableUtils.multiSubscription(this.group.statusChanges.subscribe(function () {
|
|
1232
1279
|
_this.onStatusChange.emit(_this);
|
|
1233
1280
|
}), this.group.valueChanges.subscribe(function () {
|
|
1234
|
-
_this.
|
|
1235
|
-
|
|
1281
|
+
_this.formService.notifyChanges(_this.model, _this.group, _this.model);
|
|
1282
|
+
}), this.change.subscribe(function (ev) {
|
|
1283
|
+
_this.onValueChange.emit(Object.assign(Object.assign({}, ev), { form: _this }));
|
|
1236
1284
|
}));
|
|
1237
1285
|
}
|
|
1238
1286
|
};
|
|
@@ -1342,28 +1390,46 @@
|
|
|
1342
1390
|
focus: [{ type: core$1.Output }],
|
|
1343
1391
|
contentTemplates: [{ type: core$1.ContentChildren, args: [core.DynamicTemplateDirective,] }],
|
|
1344
1392
|
viewTemplates: [{ type: core$1.ViewChildren, args: [core.DynamicTemplateDirective,] }],
|
|
1345
|
-
onStatusChange: [{ type: core$1.Output }],
|
|
1346
1393
|
onValueChange: [{ type: core$1.Output }],
|
|
1394
|
+
onStatusChange: [{ type: core$1.Output }],
|
|
1347
1395
|
onSubmit: [{ type: core$1.Output }],
|
|
1348
1396
|
ngForm: [{ type: core$1.ViewChild, args: [forms.NgForm,] }]
|
|
1349
1397
|
};
|
|
1350
1398
|
|
|
1351
1399
|
var DynamicBaseFormArrayComponent = /** @class */ (function (_super) {
|
|
1352
1400
|
__extends(DynamicBaseFormArrayComponent, _super);
|
|
1353
|
-
function DynamicBaseFormArrayComponent(layoutService, validationService) {
|
|
1401
|
+
function DynamicBaseFormArrayComponent(layoutService, validationService, injector) {
|
|
1354
1402
|
var _this = _super.call(this, layoutService, validationService) || this;
|
|
1355
1403
|
_this.layoutService = layoutService;
|
|
1356
1404
|
_this.validationService = validationService;
|
|
1405
|
+
_this.injector = injector;
|
|
1357
1406
|
_this.blur = new core$1.EventEmitter();
|
|
1358
1407
|
_this.change = new core$1.EventEmitter();
|
|
1359
1408
|
_this.customEvent = new core$1.EventEmitter();
|
|
1360
1409
|
_this.focus = new core$1.EventEmitter();
|
|
1361
1410
|
return _this;
|
|
1362
1411
|
}
|
|
1412
|
+
Object.defineProperty(DynamicBaseFormArrayComponent.prototype, "useTabs", {
|
|
1413
|
+
get: function () {
|
|
1414
|
+
var _a;
|
|
1415
|
+
return (_a = this.model) === null || _a === void 0 ? void 0 : _a.useTabs;
|
|
1416
|
+
},
|
|
1417
|
+
enumerable: false,
|
|
1418
|
+
configurable: true
|
|
1419
|
+
});
|
|
1420
|
+
DynamicBaseFormArrayComponent.prototype.saveTab = function (index) {
|
|
1421
|
+
this.model.saveTab(index, this.model, this.injector);
|
|
1422
|
+
};
|
|
1423
|
+
DynamicBaseFormArrayComponent.prototype.restoreTab = function () {
|
|
1424
|
+
return this.model.restoreTab(this.model, this.injector);
|
|
1425
|
+
};
|
|
1363
1426
|
DynamicBaseFormArrayComponent.prototype.getClass = function (context, place, model) {
|
|
1427
|
+
var _a;
|
|
1364
1428
|
return [
|
|
1365
1429
|
context == "element" ? this.getModelClass(model) : null,
|
|
1366
|
-
|
|
1430
|
+
context == "element" ? this.getAdditionalClass(model) : null,
|
|
1431
|
+
_super.prototype.getClass.call(this, context, place, model),
|
|
1432
|
+
model instanceof core.DynamicFormValueControlModel ? (_a = model.additional) === null || _a === void 0 ? void 0 : _a.classes : null
|
|
1367
1433
|
].filter(function (cls) { return !!cls; }).join(" ");
|
|
1368
1434
|
};
|
|
1369
1435
|
DynamicBaseFormArrayComponent.prototype.getModelClass = function (model) {
|
|
@@ -1375,6 +1441,16 @@
|
|
|
1375
1441
|
}
|
|
1376
1442
|
return "form-control-" + parts.join("-");
|
|
1377
1443
|
};
|
|
1444
|
+
DynamicBaseFormArrayComponent.prototype.getAdditionalClass = function (model) {
|
|
1445
|
+
var _a, _b;
|
|
1446
|
+
if (model instanceof DynamicFormArrayModel) {
|
|
1447
|
+
return (_a = model.additional) === null || _a === void 0 ? void 0 : _a.classes;
|
|
1448
|
+
}
|
|
1449
|
+
if (model instanceof core.DynamicFormValueControlModel) {
|
|
1450
|
+
return (_b = model.additional) === null || _b === void 0 ? void 0 : _b.classes;
|
|
1451
|
+
}
|
|
1452
|
+
return null;
|
|
1453
|
+
};
|
|
1378
1454
|
return DynamicBaseFormArrayComponent;
|
|
1379
1455
|
}(core.DynamicFormArrayComponent));
|
|
1380
1456
|
DynamicBaseFormArrayComponent.decorators = [
|
|
@@ -1386,7 +1462,8 @@
|
|
|
1386
1462
|
];
|
|
1387
1463
|
DynamicBaseFormArrayComponent.ctorParameters = function () { return [
|
|
1388
1464
|
{ type: core.DynamicFormLayoutService },
|
|
1389
|
-
{ type: core.DynamicFormValidationService }
|
|
1465
|
+
{ type: core.DynamicFormValidationService },
|
|
1466
|
+
{ type: core$1.Injector }
|
|
1390
1467
|
]; };
|
|
1391
1468
|
DynamicBaseFormArrayComponent.propDecorators = {
|
|
1392
1469
|
formLayout: [{ type: core$1.Input }],
|
|
@@ -1457,7 +1534,7 @@
|
|
|
1457
1534
|
if (form !== _this.form)
|
|
1458
1535
|
return;
|
|
1459
1536
|
_this.changeDetectorRef.detectChanges();
|
|
1460
|
-
_this.formService.updateSelectOptions(_this.model, _this.control);
|
|
1537
|
+
_this.formService.updateSelectOptions(_this.model, _this.control, _this.form.model);
|
|
1461
1538
|
});
|
|
1462
1539
|
};
|
|
1463
1540
|
DynamicBaseFormControlContainerComponent.prototype.ngOnDestroy = function () {
|
|
@@ -1533,6 +1610,7 @@
|
|
|
1533
1610
|
DynamicBaseFormGroupComponent.prototype.getClass = function (context, place, model) {
|
|
1534
1611
|
return [
|
|
1535
1612
|
context == "element" ? this.getModelClass(model) : null,
|
|
1613
|
+
context == "element" ? this.getAdditionalClass(model) : null,
|
|
1536
1614
|
_super.prototype.getClass.call(this, context, place, model)
|
|
1537
1615
|
].filter(function (cls) { return !!cls; }).join(" ");
|
|
1538
1616
|
};
|
|
@@ -1545,6 +1623,16 @@
|
|
|
1545
1623
|
}
|
|
1546
1624
|
return "form-control-" + parts.join("-");
|
|
1547
1625
|
};
|
|
1626
|
+
DynamicBaseFormGroupComponent.prototype.getAdditionalClass = function (model) {
|
|
1627
|
+
var _a, _b;
|
|
1628
|
+
if (model instanceof DynamicFormArrayModel) {
|
|
1629
|
+
return (_a = model.additional) === null || _a === void 0 ? void 0 : _a.classes;
|
|
1630
|
+
}
|
|
1631
|
+
if (model instanceof core.DynamicFormValueControlModel) {
|
|
1632
|
+
return (_b = model.additional) === null || _b === void 0 ? void 0 : _b.classes;
|
|
1633
|
+
}
|
|
1634
|
+
return null;
|
|
1635
|
+
};
|
|
1548
1636
|
return DynamicBaseFormGroupComponent;
|
|
1549
1637
|
}(core.DynamicFormGroupComponent));
|
|
1550
1638
|
DynamicBaseFormGroupComponent.decorators = [
|
|
@@ -1649,6 +1737,7 @@
|
|
|
1649
1737
|
exports.DynamicBaseFormComponent = DynamicBaseFormComponent;
|
|
1650
1738
|
exports.DynamicBaseFormControlContainerComponent = DynamicBaseFormControlContainerComponent;
|
|
1651
1739
|
exports.DynamicBaseFormGroupComponent = DynamicBaseFormGroupComponent;
|
|
1740
|
+
exports.DynamicFormArrayModel = DynamicFormArrayModel;
|
|
1652
1741
|
exports.DynamicFormService = DynamicFormService;
|
|
1653
1742
|
exports.FormFile = FormFile;
|
|
1654
1743
|
exports.FormInput = FormInput;
|