@ngx-formly/core 5.10.31 → 5.10.32

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.
@@ -36,8 +36,12 @@ function getFieldId(formId, field, index) {
36
36
  return field.id;
37
37
  /** @type {?} */
38
38
  var type = field.type;
39
- if (!type && field.template)
39
+ if (!type && field.template) {
40
40
  type = 'template';
41
+ }
42
+ if (isFunction(type)) {
43
+ type = ((/** @type {?} */ (type))).prototype.constructor.name;
44
+ }
41
45
  return [formId, type, field.key, index].join('_');
42
46
  }
43
47
  /**
@@ -3547,27 +3551,32 @@ FieldFormExtension = /** @class */ (function () {
3547
3551
  /**
3548
3552
  * @private
3549
3553
  * @param {?} field
3554
+ * @param {?=} disabled
3550
3555
  * @return {?}
3551
3556
  */
3552
3557
  FieldFormExtension.prototype.setValidators = /**
3553
3558
  * @private
3554
3559
  * @param {?} field
3560
+ * @param {?=} disabled
3555
3561
  * @return {?}
3556
3562
  */
3557
- function (field) {
3563
+ function (field, disabled) {
3558
3564
  var _this = this;
3565
+ if (disabled === void 0) { disabled = false; }
3559
3566
  /** @type {?} */
3560
3567
  var markForCheck = false;
3568
+ if (disabled === false && field.key && field.templateOptions && field.templateOptions.disabled) {
3569
+ disabled = true;
3570
+ }
3561
3571
  (field.fieldGroup || []).forEach((/**
3562
3572
  * @param {?} f
3563
3573
  * @return {?}
3564
3574
  */
3565
- function (f) { return _this.setValidators(f) && (markForCheck = true); }));
3575
+ function (f) { return _this.setValidators(f, disabled) && (markForCheck = true); }));
3566
3576
  if (field.key || !field.parent || (!field.key && !field.fieldGroup)) {
3567
3577
  var c_1 = field.formControl;
3568
- /** @type {?} */
3569
- var disabled = field.templateOptions ? field.templateOptions.disabled : false;
3570
- if (field.key && c_1) {
3578
+ field.templateOptions = field.templateOptions || {};
3579
+ if (field.key && c_1 && c_1 instanceof FormControl) {
3571
3580
  if (disabled && c_1.enabled) {
3572
3581
  c_1.disable({ emitEvent: false, onlySelf: true });
3573
3582
  markForCheck = true;