tuain-ng-forms-lib 17.1.22 → 17.1.24

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, Component, Input, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { signal, computed, Component, Input, model, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, ReplaySubject } from 'rxjs';
4
4
  import yn from 'yn';
5
5
  import { nanoid } from 'nanoid';
@@ -181,8 +181,10 @@ class FieldComponent extends ElementComponent {
181
181
  tooltip = signal('');
182
182
  validateOnServer = signal(false);
183
183
  visibleLabel = signal(true);
184
- value; // Valor del componente relacionado con el campo (pueden diferir en formato y tipo)
184
+ // value: any; // Valor del componente relacionado con el campo (pueden diferir en formato y tipo)
185
+ value = model(); // Valor del componente relacionado con el campo (pueden diferir en formato y tipo)
185
186
  field = null;
187
+ // field = input.required<FieldDescriptor>();
186
188
  updatePropagatedAttributes() {
187
189
  this.updatePieceAttributes(this.field, signaledAttributes$4);
188
190
  }
@@ -215,15 +217,15 @@ class FieldComponent extends ElementComponent {
215
217
  this.start();
216
218
  }
217
219
  updateValue() {
218
- this.value = this.field?.value;
220
+ this.value.set(this.field?.value);
219
221
  }
220
222
  onInputChange() { setTimeout(() => this.field?.notifyEditionPartial(), 50); }
221
223
  onChangeContent() { setTimeout(() => this.field?.notifyEditionFinish(), 50); }
222
224
  onShowInfo(detail = null) { setTimeout(() => this.field?.notifyEditionDetailRequest(detail), 50); }
223
225
  focus() { }
224
- updateObject(widgetUpdate = true) { this.field?.setValue(this.value, widgetUpdate); }
226
+ updateObject(widgetUpdate = true) { this.field?.setValue(this.value(), widgetUpdate); }
225
227
  inputChanged() {
226
- this.field?.setValue(this.value);
228
+ this.field?.setValue(this.value());
227
229
  this.onChangeContent();
228
230
  }
229
231
  inputTyped() {
@@ -231,7 +233,7 @@ class FieldComponent extends ElementComponent {
231
233
  this.onInputChange();
232
234
  }
233
235
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
234
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FieldComponent, selector: "lib-field", inputs: { field: "field" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
236
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: FieldComponent, selector: "lib-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
235
237
  }
236
238
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, decorators: [{
237
239
  type: Component,
@@ -3093,7 +3095,7 @@ class BasicFormComponent extends FormStructureAndData {
3093
3095
  errorDetail = '';
3094
3096
  // Control de estado
3095
3097
  visible = false;
3096
- busy = false;
3098
+ busy = signal(false);
3097
3099
  constructor(formManagerService, _eventManager, fileMgmtServices) {
3098
3100
  super();
3099
3101
  this.formManagerService = formManagerService;
@@ -3117,7 +3119,7 @@ class BasicFormComponent extends FormStructureAndData {
3117
3119
  this._definitionObtained = false;
3118
3120
  // Se limpian los manejadores de eventos
3119
3121
  this.visible = false;
3120
- this.busy = false;
3122
+ this.busy.set(false);
3121
3123
  this._formChangeState = [];
3122
3124
  this._formSectionsCanDeactivate = {};
3123
3125
  this._formSectionsActivate = {};
@@ -3279,9 +3281,9 @@ class BasicFormComponent extends FormStructureAndData {
3279
3281
  return;
3280
3282
  }
3281
3283
  if (forceReload || !this._definitionObtained) {
3282
- this.busy = true;
3284
+ this.busy.set(true);
3283
3285
  const formDefinition = await this.formManagerService.getFormDefinition(this.name);
3284
- this.busy = false;
3286
+ this.busy.set(false);
3285
3287
  this.loadDefinition(formDefinition);
3286
3288
  this._definitionObtained = true;
3287
3289
  }
@@ -3358,12 +3360,12 @@ class BasicFormComponent extends FormStructureAndData {
3358
3360
  this.errorName = '';
3359
3361
  this.errorMessage = '';
3360
3362
  this.errorDetail = '';
3361
- this.busy = true;
3363
+ this.busy.set(true);
3362
3364
  const formActionResponse = await this.formManagerService.execServerAction(actionDetail);
3363
3365
  if (!formActionResponse) {
3364
3366
  return null;
3365
3367
  }
3366
- this.busy = false;
3368
+ this.busy.set(false);
3367
3369
  if (formActionResponse.hasError()) {
3368
3370
  const error = formActionResponse.error;
3369
3371
  this.errorCode = error.errorCode;
@@ -4253,9 +4255,9 @@ class BasicFormComponent extends FormStructureAndData {
4253
4255
  */
4254
4256
  set formCode(name) { this.name = name; }
4255
4257
  /**
4256
- * @deprecated Use busy
4258
+ * @deprecated Use busy signal
4257
4259
  */
4258
- get inServerProcess() { return this.busy; }
4260
+ get inServerProcess() { return this.busy(); }
4259
4261
  /**
4260
4262
  * @deprecated Use state
4261
4263
  */