tuain-ng-forms-lib 12.0.37 → 12.0.38

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.
@@ -388,23 +388,25 @@
388
388
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
389
389
  }
390
390
 
391
- var VALUE = '';
391
+ var VALUE = 'value';
392
+ var FOCUS = 'focus';
392
393
  var FieldComponent = /** @class */ (function () {
393
394
  function FieldComponent() {
394
395
  }
395
396
  FieldComponent.prototype.ngOnInit = function () {
396
397
  var _this = this;
397
- var _a, _b, _c;
398
+ var _a, _b;
398
399
  if (this.field) {
399
400
  this.formConfig = (_a = this.field) === null || _a === void 0 ? void 0 : _a._formConfig;
400
401
  // Inicialización
401
402
  var mapping = Object.entries(this.formConfig.componentFieldAttrMap);
402
403
  for (var index = 0; index < mapping.length; index++) {
403
- var _d = __read(mapping[index], 2), fieldAttr1 = _d[0], compAttr1 = _d[1];
404
+ var _c = __read(mapping[index], 2), fieldAttr1 = _c[0], compAttr1 = _c[1];
404
405
  var compAttr = compAttr1.toString();
405
406
  var fieldAttr = fieldAttr1.toString();
406
- this.dafaultProcessFieldChange(compAttr, (_b = this.field) === null || _b === void 0 ? void 0 : _b[fieldAttr]);
407
- this.processFieldChange(compAttr, (_c = this.field) === null || _c === void 0 ? void 0 : _c[fieldAttr]);
407
+ var attributeValue = (_b = this.field) === null || _b === void 0 ? void 0 : _b[fieldAttr];
408
+ this.dafaultProcessFieldChange(compAttr, attributeValue);
409
+ this.processFieldChange(compAttr, attributeValue);
408
410
  }
409
411
  // Subscripción a cambios en atributos
410
412
  this.field.attributeChange.subscribe(function (event) {
@@ -420,6 +422,9 @@
420
422
  if (attribute === VALUE) {
421
423
  this.updateValue();
422
424
  }
425
+ else if (attribute === FOCUS) {
426
+ this.focus();
427
+ }
423
428
  else {
424
429
  this[attribute] = value;
425
430
  }
@@ -662,7 +667,6 @@
662
667
  this._visibleForced = false;
663
668
  this.disabled = (_a = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.disabled) !== null && _a !== void 0 ? _a : false;
664
669
  this.setVisibility((_b = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.visible) !== null && _b !== void 0 ? _b : true);
665
- this.widget = null;
666
670
  this.customAttributes = (_c = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.customAttributes) !== null && _c !== void 0 ? _c : {};
667
671
  }
668
672
  FormElement.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
@@ -1525,7 +1529,6 @@
1525
1529
  this.tableFieldStyles = this.formConfig.tableFieldStyles;
1526
1530
  this.selectable = this.table.selectable;
1527
1531
  this.hasActions = this.table.hasActions;
1528
- this.table.widget = this;
1529
1532
  this.inlineActions = this.table.getActions(this.formConfig.tableActions.inline);
1530
1533
  this.globalActions = this.table.getActions(this.formConfig.tableActions.global);
1531
1534
  this.selectionActions = this.table.getActions(this.formConfig.tableActions.selection);
@@ -1702,6 +1705,7 @@
1702
1705
  maxValue: '_maxValue',
1703
1706
  maxLength: '_maxLength',
1704
1707
  onValidation: '_onValidation',
1708
+ focus: 'focus',
1705
1709
  intrinsicErrorMessage: '_intrinsicErrorMessage',
1706
1710
  code: 'fieldCode',
1707
1711
  info: 'fieldInfo',
@@ -1805,6 +1809,7 @@
1805
1809
  enumerable: false,
1806
1810
  configurable: true
1807
1811
  });
1812
+ FieldDescriptor.prototype.focus = function () { this.setAttr(fldAttr.focus, true); };
1808
1813
  FieldDescriptor.prototype.setIntrinsicErrorMessage = function (message) { this.setAttr(fldAttr.intrinsicErrorMessage, message); };
1809
1814
  Object.defineProperty(FieldDescriptor.prototype, "intrinsicErrorMessage", {
1810
1815
  set: function (message) { this.setIntrinsicErrorMessage(message); },
@@ -4895,11 +4900,8 @@
4895
4900
  for (var requiredEmptyFields_1 = __values(requiredEmptyFields), requiredEmptyFields_1_1 = requiredEmptyFields_1.next(); !requiredEmptyFields_1_1.done; requiredEmptyFields_1_1 = requiredEmptyFields_1.next()) {
4896
4901
  var fieldCode = requiredEmptyFields_1_1.value;
4897
4902
  var requiredEmptyField = this.getField(fieldCode);
4898
- if (requiredEmptyField && requiredEmptyField.widget
4899
- && requiredEmptyField.widget.focus) {
4900
- requiredEmptyField.widget.focus();
4901
- break;
4902
- }
4903
+ requiredEmptyField === null || requiredEmptyField === void 0 ? void 0 : requiredEmptyField.focus();
4904
+ break;
4903
4905
  }
4904
4906
  }
4905
4907
  catch (e_21_1) { e_21 = { error: e_21_1 }; }
@@ -4918,11 +4920,8 @@
4918
4920
  for (var validationIssueFields_1 = __values(validationIssueFields), validationIssueFields_1_1 = validationIssueFields_1.next(); !validationIssueFields_1_1.done; validationIssueFields_1_1 = validationIssueFields_1.next()) {
4919
4921
  var fieldCode = validationIssueFields_1_1.value;
4920
4922
  var validationIssueField = this.getField(fieldCode);
4921
- if (validationIssueField && validationIssueField.widget
4922
- && validationIssueField.widget.focus) {
4923
- validationIssueField.widget.focus();
4924
- break;
4925
- }
4923
+ validationIssueField.focus();
4924
+ break;
4926
4925
  }
4927
4926
  }
4928
4927
  catch (e_22_1) { e_22 = { error: e_22_1 }; }