tuain-ng-forms-lib 17.3.7 → 19.0.1

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.
Files changed (71) hide show
  1. package/README.md +280 -335
  2. package/fesm2022/tuain-ng-forms-lib.mjs +297 -103
  3. package/fesm2022/tuain-ng-forms-lib.mjs.map +1 -1
  4. package/lib/classes/forms/action.d.ts +3 -2
  5. package/lib/classes/forms/element.d.ts +2 -1
  6. package/lib/classes/forms/field.d.ts +5 -4
  7. package/lib/classes/forms/form.d.ts +4 -2
  8. package/lib/classes/forms/piece-propagate.d.ts +2 -1
  9. package/lib/classes/forms/piece.d.ts +4 -3
  10. package/lib/classes/forms/section.d.ts +3 -2
  11. package/lib/classes/forms/subsection.d.ts +2 -1
  12. package/lib/classes/forms/table/action.d.ts +2 -1
  13. package/lib/classes/forms/table/column.d.ts +2 -1
  14. package/lib/classes/forms/table/row-data.d.ts +3 -2
  15. package/lib/classes/forms/table/table.d.ts +3 -1
  16. package/lib/components/elements/layout/piece.component.d.ts +2 -2
  17. package/lib/components/forms/basic-form.d.ts +4 -4
  18. package/lib/interfaces/action.interface.d.ts +23 -0
  19. package/lib/interfaces/field.interface.d.ts +70 -0
  20. package/lib/interfaces/form-config.interface.d.ts +24 -16
  21. package/lib/interfaces/form.interface.d.ts +106 -0
  22. package/lib/interfaces/index.d.ts +7 -0
  23. package/lib/interfaces/piece.interface.d.ts +67 -0
  24. package/lib/interfaces/section.interface.d.ts +56 -0
  25. package/lib/interfaces/sse-live-connection.interface.d.ts +67 -0
  26. package/lib/interfaces/table.interface.d.ts +139 -0
  27. package/lib/services/file-manager.service.d.ts +4 -4
  28. package/lib/services/form-manager.service.d.ts +3 -3
  29. package/lib/services/icon-dictionary.service.d.ts +1 -1
  30. package/lib/services/sse-live-connection.service.d.ts +56 -0
  31. package/lib/tokens/sse-live-connection.token.d.ts +7 -0
  32. package/package.json +6 -7
  33. package/public-api.d.ts +2 -0
  34. package/esm2022/lib/classes/forms/action.mjs +0 -112
  35. package/esm2022/lib/classes/forms/element.mjs +0 -25
  36. package/esm2022/lib/classes/forms/field.mjs +0 -484
  37. package/esm2022/lib/classes/forms/form.constants.mjs +0 -55
  38. package/esm2022/lib/classes/forms/form.mjs +0 -589
  39. package/esm2022/lib/classes/forms/piece-propagate.mjs +0 -36
  40. package/esm2022/lib/classes/forms/piece.mjs +0 -139
  41. package/esm2022/lib/classes/forms/section.mjs +0 -150
  42. package/esm2022/lib/classes/forms/subsection.mjs +0 -96
  43. package/esm2022/lib/classes/forms/table/action.mjs +0 -49
  44. package/esm2022/lib/classes/forms/table/column.mjs +0 -74
  45. package/esm2022/lib/classes/forms/table/row-data.mjs +0 -116
  46. package/esm2022/lib/classes/forms/table/table.mjs +0 -537
  47. package/esm2022/lib/components/elements/action.component.mjs +0 -71
  48. package/esm2022/lib/components/elements/field.component.mjs +0 -113
  49. package/esm2022/lib/components/elements/layout/element.component.mjs +0 -23
  50. package/esm2022/lib/components/elements/layout/form-error.component.mjs +0 -25
  51. package/esm2022/lib/components/elements/layout/form-header.component.mjs +0 -25
  52. package/esm2022/lib/components/elements/layout/piece.component.mjs +0 -59
  53. package/esm2022/lib/components/elements/layout/section.component.mjs +0 -57
  54. package/esm2022/lib/components/elements/layout/sub-section.component.mjs +0 -57
  55. package/esm2022/lib/components/elements/tables/table-record-action.component.mjs +0 -71
  56. package/esm2022/lib/components/elements/tables/table-record-field.component.mjs +0 -32
  57. package/esm2022/lib/components/elements/tables/table.component.mjs +0 -109
  58. package/esm2022/lib/components/forms/basic-form.mjs +0 -1408
  59. package/esm2022/lib/components/shared/constants.mjs +0 -2
  60. package/esm2022/lib/interfaces/form-config.interface.mjs +0 -2
  61. package/esm2022/lib/interfaces/icon-resolver.interface.mjs +0 -2
  62. package/esm2022/lib/interfaces/index.mjs +0 -3
  63. package/esm2022/lib/services/base-icon-resolver.service.mjs +0 -40
  64. package/esm2022/lib/services/event-manager.service.mjs +0 -55
  65. package/esm2022/lib/services/file-manager.service.mjs +0 -14
  66. package/esm2022/lib/services/form-manager.service.mjs +0 -88
  67. package/esm2022/lib/services/icon-dictionary.service.mjs +0 -162
  68. package/esm2022/lib/tokens/icon-resolver.token.mjs +0 -3
  69. package/esm2022/lib/tuain-ng-forms-lib.module.mjs +0 -54
  70. package/esm2022/public-api.mjs +0 -43
  71. package/esm2022/tuain-ng-forms-lib.mjs +0 -5
@@ -1,12 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, signal, computed, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, inject, DestroyRef, model, Injectable, NgModule } from '@angular/core';
2
+ import { InjectionToken, signal, computed, ChangeDetectionStrategy, Component, Input, EventEmitter, Output, inject, DestroyRef, model, Injectable, NgModule } from '@angular/core';
3
3
  import { Subject, takeUntil, BehaviorSubject, ReplaySubject } from 'rxjs';
4
4
  import yn from 'yn';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { nanoid } from 'nanoid';
7
+ import { fetchEventSource } from '@microsoft/fetch-event-source';
7
8
 
8
9
  const ICON_RESOLVER = new InjectionToken('ICON_RESOLVER');
9
10
 
11
+ /**
12
+ * Token con el que cada app provee su configuración del stream SSE.
13
+ * Sigue el mismo patrón que `ICON_RESOLVER`.
14
+ */
15
+ const SSE_LIVE_CONNECTION_CONFIG = new InjectionToken('SSE_LIVE_CONNECTION_CONFIG');
16
+
10
17
  class FormPiece {
11
18
  destroy$ = new Subject();
12
19
  _formState = '';
@@ -117,7 +124,7 @@ class FormPiece {
117
124
  set disabled(disabled) { this.enabled = !disabled; }
118
125
  enable() { this.enabled = true; }
119
126
  disable() { this.enabled = false; }
120
- formStateChangeCustomSubscribe(form, formChangeSubject) { }
127
+ formStateChangeCustomSubscribe(_form, _formChangeSubject) { }
121
128
  formStateChange(state) {
122
129
  if (state) {
123
130
  this._formState = state;
@@ -249,7 +256,7 @@ class FormElement extends FormPiecePropagate {
249
256
  }
250
257
  }
251
258
  catch (e) {
252
- console.log(`Atributo ${attrName} no presente o valor ${value} inconsistente. ${e}`);
259
+ console.error(`Atributo ${attrName} no presente o valor ${value} inconsistente. ${e}`);
253
260
  }
254
261
  }
255
262
  isField() { return this.elementType === ElementType.Field; }
@@ -566,7 +573,7 @@ class FieldDescriptor extends FormElement {
566
573
  /**
567
574
  * @deprecated Since v17. Use options instead. Will be removed in v19.
568
575
  */
569
- setFieldOptions(newOptions) { return this.options = newOptions; }
576
+ setFieldOptions(newOptions) { this.options = newOptions; }
570
577
  /**
571
578
  * @deprecated Since v17. Use intrinsicErrorMessage instead. Will be removed in v19.
572
579
  */
@@ -592,7 +599,6 @@ class FieldDescriptor extends FormElement {
592
599
  && Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0) {
593
600
  return true;
594
601
  }
595
- ;
596
602
  if (this._fieldType === this._formConfig.fieldTypes.phone) {
597
603
  if (!Array.isArray(fieldCurrentValue)) {
598
604
  return true;
@@ -602,7 +608,6 @@ class FieldDescriptor extends FormElement {
602
608
  }
603
609
  return false;
604
610
  }
605
- ;
606
611
  const arrayFieldTypes = this._formConfig.arrayFieldTypes ?? null;
607
612
  if (arrayFieldTypes && Object.keys(arrayFieldTypes).includes(this._fieldType)) {
608
613
  let arraySize = arrayFieldTypes[this._fieldType];
@@ -612,7 +617,6 @@ class FieldDescriptor extends FormElement {
612
617
  }
613
618
  return (Array.isArray(fieldCurrentValue) && fieldCurrentValue.length < arraySize);
614
619
  }
615
- ;
616
620
  return fieldCurrentValue === '';
617
621
  }
618
622
  notifyEditionPartial() {
@@ -812,7 +816,7 @@ class FormAction extends FormElement {
812
816
  }
813
817
  }
814
818
  }
815
- updateRestrictedVisibility(event) {
819
+ updateRestrictedVisibility(_event) {
816
820
  const newVisible = this._absoluteVisible && this.viewOnState(this._formState);
817
821
  (this._visible !== newVisible) && this.setVisibility(newVisible);
818
822
  }
@@ -839,7 +843,7 @@ class FormAction extends FormElement {
839
843
  this[propertyName] = receivedAction[propertyName];
840
844
  }
841
845
  catch (e) {
842
- console.log(`Error actualizando la propiedad ${propertyName} de la acción ${this.actionCode}. ${e}`);
846
+ console.error(`Error actualizando la propiedad ${propertyName} de la acción ${this.actionCode}. ${e}`);
843
847
  }
844
848
  }
845
849
  }
@@ -1008,7 +1012,7 @@ class RecordFormSection extends FormPiecePropagate {
1008
1012
  }
1009
1013
  get title() { return this._sectionTitle; }
1010
1014
  set title(title) { this._sectionTitle = title; }
1011
- getVisibleSubsections(state) {
1015
+ getVisibleSubsections(_state) {
1012
1016
  return this._subSections.filter(subSection => subSection.visible);
1013
1017
  }
1014
1018
  getSubsection(subSectionCode) {
@@ -1223,7 +1227,6 @@ class TableRecordData {
1223
1227
  const rawRecordData = recordData.filter(fieldData => fieldData.fieldCode && fieldNames.includes(fieldData.fieldCode));
1224
1228
  rawRecordData.forEach(fieldData => {
1225
1229
  const { fieldCode, fieldValue } = fieldData;
1226
- const fieldDef = recordDefinition.find(column => column.fieldCode === fieldCode);
1227
1230
  this.recordData[fieldCode] = fieldValue ?? '';
1228
1231
  if (fieldCode === selectionFieldName) {
1229
1232
  this.selected = fieldValue;
@@ -1234,7 +1237,6 @@ class TableRecordData {
1234
1237
  const fields = Object.keys(recordData);
1235
1238
  fields.forEach(fieldCode => {
1236
1239
  const fieldValue = recordData[fieldCode];
1237
- const fieldDef = recordDefinition.find(column => column.fieldCode === fieldCode);
1238
1240
  this.recordData[fieldCode] = fieldValue ?? '';
1239
1241
  });
1240
1242
  }
@@ -1257,7 +1259,7 @@ class TableRecordData {
1257
1259
  let wordIsPresent = false;
1258
1260
  for (const fieldCode in this.recordData) {
1259
1261
  const columnDef = columnObj?.[fieldCode];
1260
- if (columnDef?.searchable && this.recordData.hasOwnProperty(fieldCode)) {
1262
+ if (columnDef?.searchable && Object.prototype.hasOwnProperty.call(this.recordData, fieldCode)) {
1261
1263
  const term = word.toUpperCase();
1262
1264
  let fieldValue;
1263
1265
  if (columnDef.fieldType.toUpperCase().includes('DATE')) {
@@ -1284,7 +1286,7 @@ class TableRecordData {
1284
1286
  }
1285
1287
  for (const condition of columnFilters) {
1286
1288
  const { fieldCode, operator, values } = condition;
1287
- if (this.recordData.hasOwnProperty(fieldCode)) {
1289
+ if (Object.prototype.hasOwnProperty.call(this.recordData, fieldCode)) {
1288
1290
  const fieldValue = this.recordData[fieldCode];
1289
1291
  const stringValue = fieldValue.toString().toUpperCase();
1290
1292
  if (operator === ComparisonOperator.G && fieldValue <= values[0]) {
@@ -1465,6 +1467,7 @@ class RecordTable extends FormElement {
1465
1467
  get selectionField() { return this._selectionField; }
1466
1468
  get allSelected() { return this._allSelected; }
1467
1469
  get tableCode() { return this._tableCode; }
1470
+ get code() { return this._tableCode; }
1468
1471
  get tableTitle() { return this._tableTitle; }
1469
1472
  get currentPage() { return this._currentPage; }
1470
1473
  get totalPages() { return this._totalPages; }
@@ -1715,7 +1718,6 @@ class RecordTable extends FormElement {
1715
1718
  this.updateVisibleRecords();
1716
1719
  }
1717
1720
  getTableRecord(recordId) {
1718
- const recordIdKey = (typeof recordId === 'object') ? JSON.stringify(recordId) : recordId;
1719
1721
  return (this._tableRecordObj && recordId && this._tableRecordObj[recordId])
1720
1722
  ? this._tableRecordObj[recordId] : null;
1721
1723
  }
@@ -1860,9 +1862,7 @@ const HIDE = 'hide';
1860
1862
  const ENABLE = 'enable';
1861
1863
  const DISABLE = 'disable';
1862
1864
  const CLEAN = 'clean';
1863
- const alwaysVisible = 'ALWAYS';
1864
1865
  const neverVisible = 'NONE';
1865
- const onStatesVisible = 'ONSTATES';
1866
1866
  class FormStructureAndData {
1867
1867
  _stateChange = new Subject();
1868
1868
  _immutableData = {};
@@ -2091,7 +2091,7 @@ class FormStructureAndData {
2091
2091
  field && (field.required = required);
2092
2092
  }
2093
2093
  catch (e) {
2094
- console.log(`Error modificando campo ${code}: ${e}`);
2094
+ console.error(`Error modificando campo ${code}: ${e}`);
2095
2095
  }
2096
2096
  }
2097
2097
  }
@@ -2159,7 +2159,7 @@ class FormStructureAndData {
2159
2159
  processedFields += 1;
2160
2160
  }
2161
2161
  catch (e) {
2162
- console.log(`Error procesando funcion en campo ${field}: ${e}`);
2162
+ console.error(`Error procesando funcion en campo ${field}: ${e}`);
2163
2163
  }
2164
2164
  }
2165
2165
  }
@@ -2222,7 +2222,7 @@ class FormStructureAndData {
2222
2222
  for (let index = 0; index < codes.length; index++) {
2223
2223
  const code = codes[index];
2224
2224
  if (code) {
2225
- resultObject[code] = this.fields?.[code]?.getValue() ?? null;
2225
+ resultObject[code] = this.fields?.[code]?.value ?? null;
2226
2226
  }
2227
2227
  }
2228
2228
  return resultObject;
@@ -2445,7 +2445,7 @@ class PieceComponent {
2445
2445
  enabled = computed(() => !this.disabled());
2446
2446
  customAttributes = signal({});
2447
2447
  setForm(form) { this.form = form; }
2448
- propagatedAttributeChange(attribute, value) { }
2448
+ propagatedAttributeChange(_attribute, _value) { }
2449
2449
  updatePieceAttribute(signaledAttributes, signaledAttribute, value) {
2450
2450
  if (!signaledAttributes.includes(signaledAttribute)) {
2451
2451
  return;
@@ -2468,7 +2468,7 @@ class PieceComponent {
2468
2468
  }
2469
2469
  }
2470
2470
  }
2471
- customAttributeChange(subAttribute, value) { }
2471
+ customAttributeChange(_subAttribute, _value) { }
2472
2472
  updateCustomAttribute(attrName, attrValue) {
2473
2473
  this.customAttributes.update(old => ({ ...old, [attrName]: attrValue }));
2474
2474
  this.customAttributeChange(attrName, attrValue);
@@ -2481,10 +2481,10 @@ class PieceComponent {
2481
2481
  this.customAttributeChange(attrName, attrValue);
2482
2482
  });
2483
2483
  }
2484
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PieceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2485
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PieceComponent, isStandalone: true, selector: "lib-piece", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2484
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: PieceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2485
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: PieceComponent, isStandalone: true, selector: "lib-piece", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2486
2486
  }
2487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PieceComponent, decorators: [{
2487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: PieceComponent, decorators: [{
2488
2488
  type: Component,
2489
2489
  args: [{
2490
2490
  standalone: true,
@@ -2499,10 +2499,10 @@ class ElementComponent extends PieceComponent {
2499
2499
  start() {
2500
2500
  this.setForm(this.element?.form);
2501
2501
  }
2502
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2503
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ElementComponent, isStandalone: true, selector: "lib-element", inputs: { element: "element" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2502
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: ElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2503
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: ElementComponent, isStandalone: true, selector: "lib-element", inputs: { element: "element" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2504
2504
  }
2505
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ElementComponent, decorators: [{
2505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: ElementComponent, decorators: [{
2506
2506
  type: Component,
2507
2507
  args: [{
2508
2508
  standalone: true,
@@ -2518,10 +2518,10 @@ class FormErrorComponent {
2518
2518
  errorTitle = '';
2519
2519
  errorMessage = '';
2520
2520
  errorType = '';
2521
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2522
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormErrorComponent, isStandalone: true, selector: "lib-form-error", inputs: { errorTitle: "errorTitle", errorMessage: "errorMessage", errorType: "errorType" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2521
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2522
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: FormErrorComponent, isStandalone: true, selector: "lib-form-error", inputs: { errorTitle: "errorTitle", errorMessage: "errorMessage", errorType: "errorType" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2523
2523
  }
2524
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormErrorComponent, decorators: [{
2524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FormErrorComponent, decorators: [{
2525
2525
  type: Component,
2526
2526
  args: [{
2527
2527
  standalone: true,
@@ -2543,10 +2543,10 @@ class FormHeaderComponent {
2543
2543
  goBackForm() {
2544
2544
  this.goBackEvent.emit();
2545
2545
  }
2546
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2547
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormHeaderComponent, isStandalone: true, selector: "lib-form-header", inputs: { form: "form" }, outputs: { goBackEvent: "goBackEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2546
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FormHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2547
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: FormHeaderComponent, isStandalone: true, selector: "lib-form-header", inputs: { form: "form" }, outputs: { goBackEvent: "goBackEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2548
2548
  }
2549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormHeaderComponent, decorators: [{
2549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FormHeaderComponent, decorators: [{
2550
2550
  type: Component,
2551
2551
  args: [{
2552
2552
  standalone: true,
@@ -2599,10 +2599,10 @@ class SectionComponent extends PieceComponent {
2599
2599
  start() {
2600
2600
  this.setForm(this.section?.form);
2601
2601
  }
2602
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2603
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SectionComponent, isStandalone: true, selector: "lib-section", inputs: { section: "section" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2602
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2603
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: SectionComponent, isStandalone: true, selector: "lib-section", inputs: { section: "section" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2604
2604
  }
2605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, decorators: [{
2605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SectionComponent, decorators: [{
2606
2606
  type: Component,
2607
2607
  args: [{
2608
2608
  standalone: true,
@@ -2651,10 +2651,10 @@ class SubSectionComponent extends PieceComponent {
2651
2651
  start() {
2652
2652
  this.setForm(this.subSection?.form);
2653
2653
  }
2654
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubSectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2655
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SubSectionComponent, isStandalone: true, selector: "lib-subsection", inputs: { subSection: "subSection" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2654
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SubSectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2655
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: SubSectionComponent, isStandalone: true, selector: "lib-subsection", inputs: { subSection: "subSection" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2656
2656
  }
2657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubSectionComponent, decorators: [{
2657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SubSectionComponent, decorators: [{
2658
2658
  type: Component,
2659
2659
  args: [{
2660
2660
  standalone: true,
@@ -2717,10 +2717,10 @@ class ActionComponent extends ElementComponent {
2717
2717
  this.action.notifyActivation();
2718
2718
  }
2719
2719
  }
2720
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2721
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ActionComponent, isStandalone: true, selector: "lib-action", inputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2720
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: ActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2721
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: ActionComponent, isStandalone: true, selector: "lib-action", inputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2722
2722
  }
2723
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ActionComponent, decorators: [{
2723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: ActionComponent, decorators: [{
2724
2724
  type: Component,
2725
2725
  args: [{
2726
2726
  standalone: true,
@@ -2825,10 +2825,10 @@ class FieldComponent extends ElementComponent {
2825
2825
  this.updateObject(false);
2826
2826
  this.onInputChange();
2827
2827
  }
2828
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2829
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: FieldComponent, isStandalone: true, 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, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2828
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2829
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.22", type: FieldComponent, isStandalone: true, 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, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2830
2830
  }
2831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, decorators: [{
2831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: FieldComponent, decorators: [{
2832
2832
  type: Component,
2833
2833
  args: [{
2834
2834
  standalone: true,
@@ -2929,10 +2929,10 @@ class LibTableComponent extends ElementComponent {
2929
2929
  this.table?.addColumnFilter(column.fieldCode, values);
2930
2930
  }
2931
2931
  }
2932
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2933
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableComponent, isStandalone: true, selector: "lib-table", inputs: { table: "table" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2932
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2933
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: LibTableComponent, isStandalone: true, selector: "lib-table", inputs: { table: "table" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2934
2934
  }
2935
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, decorators: [{
2935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableComponent, decorators: [{
2936
2936
  type: Component,
2937
2937
  args: [{
2938
2938
  standalone: true,
@@ -2953,10 +2953,10 @@ class LibTableRecordFieldComponent {
2953
2953
  this.start();
2954
2954
  }
2955
2955
  start() { }
2956
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2957
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableRecordFieldComponent, isStandalone: true, selector: "lib-table-record-field", inputs: { fieldCode: "fieldCode", fieldType: "fieldType", fieldValue: "fieldValue", column: "column" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2956
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableRecordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2957
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: LibTableRecordFieldComponent, isStandalone: true, selector: "lib-table-record-field", inputs: { fieldCode: "fieldCode", fieldType: "fieldType", fieldValue: "fieldValue", column: "column" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2958
2958
  }
2959
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordFieldComponent, decorators: [{
2959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableRecordFieldComponent, decorators: [{
2960
2960
  type: Component,
2961
2961
  args: [{
2962
2962
  standalone: true,
@@ -3021,10 +3021,10 @@ class LibTableRecordActionComponent extends PieceComponent {
3021
3021
  this.actionSelected.emit(tableEvent);
3022
3022
  }
3023
3023
  class() { }
3024
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3025
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableRecordActionComponent, isStandalone: true, selector: "lib-table-record-action", inputs: { recordId: "recordId", recordData: "recordData", action: "action" }, outputs: { actionSelected: "actionSelected" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3024
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableRecordActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3025
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: LibTableRecordActionComponent, isStandalone: true, selector: "lib-table-record-action", inputs: { recordId: "recordId", recordData: "recordData", action: "action" }, outputs: { actionSelected: "actionSelected" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3026
3026
  }
3027
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordActionComponent, decorators: [{
3027
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibTableRecordActionComponent, decorators: [{
3028
3028
  type: Component,
3029
3029
  args: [{
3030
3030
  standalone: true,
@@ -3048,9 +3048,9 @@ class LibFormManagerService {
3048
3048
  this.cleanStack();
3049
3049
  }
3050
3050
  // Métodos virtuales para las aplicaciones
3051
- getFormDefinition(formCode) { }
3052
- execServerAction(actionDetail) { }
3053
- goToForm(formCode, token, subject) { }
3051
+ getFormDefinition(_formCode) { }
3052
+ execServerAction(_actionDetail) { }
3053
+ goToForm(_formCode, _token, _subject) { }
3054
3054
  async loadStack() { }
3055
3055
  saveStack() { }
3056
3056
  cleanStack() { this.pageStack = []; }
@@ -3089,7 +3089,7 @@ class LibFormManagerService {
3089
3089
  return token;
3090
3090
  }
3091
3091
  unstack(token = null) {
3092
- let index = (token) ? this.findFormInStack(token).index : this.pageStack.length - 2;
3092
+ const index = (token) ? this.findFormInStack(token).index : this.pageStack.length - 2;
3093
3093
  let formInfo = null;
3094
3094
  if (index >= 0) {
3095
3095
  formInfo = this.pageStack[index];
@@ -3120,10 +3120,10 @@ class LibFormManagerService {
3120
3120
  const formInfo = this.unstack(targetToken);
3121
3121
  formInfo && formInfo.name && this.goToForm(formInfo.name, formInfo.token, formInfo.subject ?? null);
3122
3122
  }
3123
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFormManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3124
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFormManagerService });
3123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFormManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3124
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFormManagerService });
3125
3125
  }
3126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFormManagerService, decorators: [{
3126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFormManagerService, decorators: [{
3127
3127
  type: Injectable
3128
3128
  }], ctorParameters: () => [] });
3129
3129
 
@@ -3182,19 +3182,18 @@ class LibEventManagerService {
3182
3182
  }
3183
3183
 
3184
3184
  class LibFileManagementService {
3185
- openFile(fileBase64Data, fileName, fileType) { }
3186
- saveFileFromURL(fileUrl, fileName = null, fileType = null) { }
3187
- saveFile(fileBase64Data, fileName, fileType) { }
3188
- printPdfFile(pdfBufferData) { }
3189
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFileManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3190
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFileManagementService });
3185
+ openFile(_fileBase64Data, _fileName, _fileType) { }
3186
+ saveFileFromURL(_fileUrl, _fileName = null, _fileType = null) { }
3187
+ saveFile(_fileBase64Data, _fileName, _fileType) { }
3188
+ printPdfFile(_pdfBufferData) { }
3189
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFileManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3190
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFileManagementService });
3191
3191
  }
3192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFileManagementService, decorators: [{
3192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: LibFileManagementService, decorators: [{
3193
3193
  type: Injectable
3194
3194
  }] });
3195
3195
 
3196
3196
  const PAYLOAD_VERSION = 'TUAINEXCHANGE_1.0';
3197
- const INLINE_ACTION = 'INLINE';
3198
3197
  const GLOBAL_ACTION = 'GLOBAL';
3199
3198
  const GET_DATA_ACTION = 'GETDATA';
3200
3199
  const SUBJECT = 'subject';
@@ -3314,9 +3313,9 @@ class BasicFormComponent extends FormStructureAndData {
3314
3313
  displayActionServerError() { }
3315
3314
  displayValidationServerError() { }
3316
3315
  displayTableServerError() { }
3317
- showFieldInfo(code, detail) { }
3318
- showModalDialog(title, body, options, callback, params) { }
3319
- openUploadDialog(title, body, options, callback, params) { }
3316
+ showFieldInfo(_code, _detail) { }
3317
+ showModalDialog(_title, _body, _options, _callback, _params) { }
3318
+ openUploadDialog(_title, _body, _options, _callback, _params) { }
3320
3319
  subscribeAppEvent(eventName, callback) {
3321
3320
  this._eventEmiter.subscribe(eventName, callback);
3322
3321
  }
@@ -3666,7 +3665,7 @@ class BasicFormComponent extends FormStructureAndData {
3666
3665
  const clientSectionMethods = this._formSectionsCanDeactivate[code];
3667
3666
  if (clientSectionMethods) {
3668
3667
  for (const clientSectionMethod of clientSectionMethods) {
3669
- const { callback, properties } = clientSectionMethod;
3668
+ const { callback } = clientSectionMethod;
3670
3669
  const canActivate = callback(sectionObject);
3671
3670
  if (canActivate === false) {
3672
3671
  return false;
@@ -3684,7 +3683,7 @@ class BasicFormComponent extends FormStructureAndData {
3684
3683
  const clientSectionMethods = this._formSectionsActivate[code];
3685
3684
  if (clientSectionMethods) {
3686
3685
  for (const clientSectionMethod of clientSectionMethods) {
3687
- const { callback, properties } = clientSectionMethod;
3686
+ const { callback } = clientSectionMethod;
3688
3687
  callback(sectionObject);
3689
3688
  }
3690
3689
  }
@@ -3698,7 +3697,7 @@ class BasicFormComponent extends FormStructureAndData {
3698
3697
  const clientSectionMethods = this._formSectionsInactivate[code];
3699
3698
  if (clientSectionMethods) {
3700
3699
  for (const clientSectionMethod of clientSectionMethods) {
3701
- const { callback, properties } = clientSectionMethod;
3700
+ const { callback } = clientSectionMethod;
3702
3701
  callback(sectionObject);
3703
3702
  }
3704
3703
  }
@@ -3711,7 +3710,7 @@ class BasicFormComponent extends FormStructureAndData {
3711
3710
  }
3712
3711
  if (this._actionsInProgress[code]) {
3713
3712
  const { sent } = this._actionsInProgress[code];
3714
- console.log(`Reingreso sobre acción ${code} con ejecución previa ${sent}`);
3713
+ console.error(`Reingreso sobre acción ${code} con ejecución previa ${sent}`);
3715
3714
  return;
3716
3715
  }
3717
3716
  this._actionsInProgress[code] = { sent: new Date() };
@@ -3721,7 +3720,7 @@ class BasicFormComponent extends FormStructureAndData {
3721
3720
  if (clientActionMethods) {
3722
3721
  const clientActionPromises = [];
3723
3722
  for (const clientActionMethod of clientActionMethods) {
3724
- const { callback, properties } = clientActionMethod;
3723
+ const { callback } = clientActionMethod;
3725
3724
  const continueActionPromise = callback(actionObject);
3726
3725
  clientActionPromises.push(continueActionPromise);
3727
3726
  }
@@ -3750,7 +3749,7 @@ class BasicFormComponent extends FormStructureAndData {
3750
3749
  if (backend) {
3751
3750
  if (this._serverActionsInProgress[code]) {
3752
3751
  const { sent } = this._serverActionsInProgress[code];
3753
- console.log(`Reingreso server en acción ${code} con ejecución previa ${sent}`);
3752
+ console.error(`Reingreso server en acción ${code} con ejecución previa ${sent}`);
3754
3753
  return;
3755
3754
  }
3756
3755
  this._serverActionsInProgress[code] = { sent: new Date() };
@@ -3764,7 +3763,7 @@ class BasicFormComponent extends FormStructureAndData {
3764
3763
  }
3765
3764
  else {
3766
3765
  for (let index = 0; index < this._actionServerError.length; index++) {
3767
- const { callback, properties } = this._actionServerError[index];
3766
+ const { callback } = this._actionServerError[index];
3768
3767
  callback(action);
3769
3768
  }
3770
3769
  }
@@ -3822,7 +3821,7 @@ class BasicFormComponent extends FormStructureAndData {
3822
3821
  this.removeEventHandler(this._fieldValidationsStart, codes);
3823
3822
  this.removeEventHandler(this._fieldValidationsFinish, codes);
3824
3823
  }
3825
- async startFieldInputValidation(code, intrinsicValidation = true) {
3824
+ async startFieldInputValidation(code, _intrinsicValidation = true) {
3826
3825
  this.notifyFormActivity();
3827
3826
  const fieldToValidate = this.getField(code);
3828
3827
  if (!fieldToValidate) {
@@ -3832,7 +3831,7 @@ class BasicFormComponent extends FormStructureAndData {
3832
3831
  if (validationCallbacks) {
3833
3832
  const clientValidationPromises = [];
3834
3833
  for (const validationMethod of validationCallbacks) {
3835
- const { callback, properties } = validationMethod;
3834
+ const { callback } = validationMethod;
3836
3835
  const continueValidationPromise = callback(fieldToValidate);
3837
3836
  clientValidationPromises.push(continueValidationPromise);
3838
3837
  }
@@ -3850,7 +3849,7 @@ class BasicFormComponent extends FormStructureAndData {
3850
3849
  if (eventHandlerCallbacks) {
3851
3850
  const clientEventPromises = [];
3852
3851
  for (const eventHandlerMethod of eventHandlerCallbacks) {
3853
- const { callback, properties } = eventHandlerMethod;
3852
+ const { callback } = eventHandlerMethod;
3854
3853
  const clientEventPromise = callback(eventName, eventData, fieldToTrigger);
3855
3854
  clientEventPromises.push(clientEventPromise);
3856
3855
  }
@@ -3866,7 +3865,7 @@ class BasicFormComponent extends FormStructureAndData {
3866
3865
  if (validationCallbacks) {
3867
3866
  const clientValidationPromises = [];
3868
3867
  for (const validationMethod of validationCallbacks) {
3869
- const { callback, properties } = validationMethod;
3868
+ const { callback } = validationMethod;
3870
3869
  const clientValidationPromise = callback(fieldToValidate);
3871
3870
  clientValidationPromises.push(clientValidationPromise);
3872
3871
  }
@@ -3898,7 +3897,7 @@ class BasicFormComponent extends FormStructureAndData {
3898
3897
  fieldObj?.setErrorCode(this.errorCode);
3899
3898
  fieldObj?.setErrorMessage(this.errorMessage);
3900
3899
  for (let index = 0; index < this._fieldServerError.length; index++) {
3901
- const { callback, properties } = this._fieldServerError[index];
3900
+ const { callback } = this._fieldServerError[index];
3902
3901
  callback(fieldObj);
3903
3902
  }
3904
3903
  }
@@ -4052,7 +4051,7 @@ class BasicFormComponent extends FormStructureAndData {
4052
4051
  if (tableActionMethods) {
4053
4052
  const clientActionPromises = [];
4054
4053
  for (const tableActionMethod of tableActionMethods) {
4055
- const { callback, properties } = tableActionMethod;
4054
+ const { callback } = tableActionMethod;
4056
4055
  const clientActionPromise = callback(tableActionDetail);
4057
4056
  clientActionPromises.push(clientActionPromise);
4058
4057
  }
@@ -4088,7 +4087,7 @@ class BasicFormComponent extends FormStructureAndData {
4088
4087
  }
4089
4088
  else {
4090
4089
  for (let index = 0; index < this._tableServerError.length; index++) {
4091
- const { callback, properties } = this._tableServerError[index];
4090
+ const { callback } = this._tableServerError[index];
4092
4091
  callback(tableObject);
4093
4092
  }
4094
4093
  }
@@ -4136,7 +4135,7 @@ class BasicFormComponent extends FormStructureAndData {
4136
4135
  if (tableActionMethods) {
4137
4136
  const clientActionPromises = [];
4138
4137
  for (const tableActionMethod of tableActionMethods) {
4139
- const { callback, properties } = tableActionMethod;
4138
+ const { callback } = tableActionMethod;
4140
4139
  const clientActionPromise = callback(tableActionDetail);
4141
4140
  clientActionPromises.push(clientActionPromise);
4142
4141
  }
@@ -4215,7 +4214,7 @@ class BasicFormComponent extends FormStructureAndData {
4215
4214
  if (tableEventHandlers) {
4216
4215
  const clientActionPromises = [];
4217
4216
  for (const tableSelectionMethod of tableEventHandlers) {
4218
- const { callback, properties } = tableSelectionMethod;
4217
+ const { callback } = tableSelectionMethod;
4219
4218
  const clientActionPromise = callback(tableSelectionDetail);
4220
4219
  clientActionPromises.push(clientActionPromise);
4221
4220
  }
@@ -4293,7 +4292,7 @@ class BasicFormComponent extends FormStructureAndData {
4293
4292
  if (tableActionMethods) {
4294
4293
  const clientActionPromises = [];
4295
4294
  for (const tableActionMethod of tableActionMethods) {
4296
- const { callback, properties } = tableActionMethod;
4295
+ const { callback } = tableActionMethod;
4297
4296
  const clientActionPromise = callback(tableActionDetail);
4298
4297
  clientActionPromises.push(clientActionPromise);
4299
4298
  }
@@ -4362,7 +4361,7 @@ class BasicFormComponent extends FormStructureAndData {
4362
4361
  if (tableEventHandlers) {
4363
4362
  const clientActionPromises = [];
4364
4363
  for (const tableActionMethod of tableEventHandlers) {
4365
- const { callback, properties } = tableActionMethod;
4364
+ const { callback } = tableActionMethod;
4366
4365
  const clientActionPromise = callback(tableActionDetail);
4367
4366
  clientActionPromises.push(clientActionPromise);
4368
4367
  }
@@ -4463,7 +4462,7 @@ class BasicFormComponent extends FormStructureAndData {
4463
4462
  }
4464
4463
  notifyFormActivity() {
4465
4464
  if (this._notifyFormActivity) {
4466
- this._eventEmiter.next('formActivity', { code: this.formCode });
4465
+ this._eventEmiter.next('formActivity', { code: this.name });
4467
4466
  }
4468
4467
  }
4469
4468
  /**
@@ -4581,10 +4580,10 @@ class BasicFormComponent extends FormStructureAndData {
4581
4580
  preocessInputParams(params) {
4582
4581
  return this.processInputParams(params);
4583
4582
  }
4584
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BasicFormComponent, deps: [{ token: LibFormManagerService }, { token: LibEventManagerService }, { token: LibFileManagementService }], target: i0.ɵɵFactoryTarget.Component });
4585
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: BasicFormComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4583
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: BasicFormComponent, deps: [{ token: LibFormManagerService }, { token: LibEventManagerService }, { token: LibFileManagementService }], target: i0.ɵɵFactoryTarget.Component });
4584
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: BasicFormComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4586
4585
  }
4587
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BasicFormComponent, decorators: [{
4586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: BasicFormComponent, decorators: [{
4588
4587
  type: Component,
4589
4588
  args: [{
4590
4589
  standalone: true,
@@ -4786,13 +4785,208 @@ class BaseIconResolverService {
4786
4785
  return name?.replace(/[-_](.)/g, (_, c) => c.toUpperCase())
4787
4786
  ?.replace(/^(.)/, (_, c) => c.toLowerCase()) ?? 'default';
4788
4787
  }
4789
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseIconResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4790
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseIconResolverService });
4788
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: BaseIconResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4789
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: BaseIconResolverService });
4791
4790
  }
4792
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseIconResolverService, decorators: [{
4791
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: BaseIconResolverService, decorators: [{
4793
4792
  type: Injectable
4794
4793
  }] });
4795
4794
 
4795
+ const DEFAULT_STREAM_PATH = '/liveconnect/stream';
4796
+ const DEFAULT_SESSION_ENDED_EVENT = 'sessionEnded';
4797
+ const SESSION_EVENT_CLASS = 'session';
4798
+ const SESSION_REPLACED_EVENT_TYPE = 'sessionReplaced';
4799
+ const SESSION_CLOSED_EVENT_TYPE = 'sessionClosed';
4800
+ /** Error que detiene los reintentos de `fetchEventSource` (handshake rechazado). */
4801
+ class FatalSseError extends Error {
4802
+ }
4803
+ /**
4804
+ * Canal de eventos servidor→cliente sobre Server-Sent Events (SSE).
4805
+ *
4806
+ * Reemplaza al `LiveConnectionService` basado en Socket.IO que vivía duplicado
4807
+ * en cada app. El uso siempre fue unidireccional (un único handshake y luego
4808
+ * solo recepción), así que SSE encaja sin perder funcionalidad y además gana
4809
+ * reconexión automática nativa.
4810
+ *
4811
+ * El servicio es agnóstico de la app: toda la integración (URL, token de auth,
4812
+ * allow-list, re-emisión al bus, logger) llega por `SSE_LIVE_CONNECTION_CONFIG`.
4813
+ * El ciclo de vida (cuándo abrir/cerrar) lo controla cada app llamando
4814
+ * `open()`/`close()` — típicamente atado a `sessionEstablished`/`sessionEnded`,
4815
+ * y en móvil además al `appStateChange` de Capacitor.
4816
+ */
4817
+ class SseLiveConnectionService {
4818
+ _config = inject(SSE_LIVE_CONNECTION_CONFIG);
4819
+ _abort = null;
4820
+ _currentSessionId = null;
4821
+ _connected = false;
4822
+ isConnected() {
4823
+ return this._connected;
4824
+ }
4825
+ /**
4826
+ * Abre el stream SSE para la sesión dada (cierra cualquier stream anterior).
4827
+ * El handshake viaja en el header `Authorization`, no en la URL.
4828
+ */
4829
+ async open(sessionData) {
4830
+ this.close();
4831
+ if (!sessionData) {
4832
+ return;
4833
+ }
4834
+ this._currentSessionId = sessionData?.sessionId ?? null;
4835
+ const logger = this._config.logger;
4836
+ const allowed = this._allowedSet();
4837
+ const token = await this._config.getAuthToken(sessionData);
4838
+ const scheme = this._config.authScheme ?? 'Bearer';
4839
+ const authorization = scheme ? `${scheme} ${token}` : token;
4840
+ const abort = new AbortController();
4841
+ this._abort = abort;
4842
+ this.openEventSource(this._buildStreamUrl(), {
4843
+ signal: abort.signal,
4844
+ openWhenHidden: this._config.keepOpenWhenHidden ?? true,
4845
+ headers: { Authorization: authorization },
4846
+ onopen: async (response) => {
4847
+ const contentType = response.headers.get('content-type') ?? '';
4848
+ if (response.ok && contentType.includes('text/event-stream')) {
4849
+ this._connected = true;
4850
+ return;
4851
+ }
4852
+ // 4xx (p. ej. 401) => fatal, no reintentar. 5xx/otros => reintentar.
4853
+ if (response.status >= 400 && response.status < 500) {
4854
+ throw new FatalSseError(`handshake rechazado: ${response.status}`);
4855
+ }
4856
+ throw new Error(`handshake inesperado: ${response.status}`);
4857
+ },
4858
+ onmessage: msg => {
4859
+ if (!msg.data) {
4860
+ return; // comentarios/heartbeats no traen `data`
4861
+ }
4862
+ let eventData;
4863
+ try {
4864
+ eventData = JSON.parse(msg.data);
4865
+ }
4866
+ catch {
4867
+ logger?.warn?.('[SseLiveConnection] Payload no-JSON descartado');
4868
+ return;
4869
+ }
4870
+ logger?.debug?.(`[SseLiveConnection] Evento recibido: ${msg.data}`);
4871
+ if (this._handleSessionReplaced(eventData)) {
4872
+ return;
4873
+ }
4874
+ if (this._handleSessionClosed(eventData)) {
4875
+ return;
4876
+ }
4877
+ const eventClass = eventData?.eventClass;
4878
+ if (typeof eventClass !== 'string' || !allowed.has(eventClass)) {
4879
+ logger?.warn?.('[SseLiveConnection] Evento no permitido rechazado:', eventClass);
4880
+ return;
4881
+ }
4882
+ this._config.emit(eventClass, eventData);
4883
+ },
4884
+ onerror: err => {
4885
+ this._connected = false;
4886
+ if (err instanceof FatalSseError) {
4887
+ logger?.warn?.('[SseLiveConnection]', err.message);
4888
+ throw err; // detiene los reintentos
4889
+ }
4890
+ logger?.warn?.('[SseLiveConnection] error de stream, reintentando', err?.message ?? err);
4891
+ // devolver undefined => fetch-event-source reintenta con backoff propio
4892
+ },
4893
+ }).catch(err => {
4894
+ this._connected = false;
4895
+ if (!(err instanceof FatalSseError) && err?.name !== 'AbortError') {
4896
+ logger?.warn?.('[SseLiveConnection] stream finalizado', err?.message ?? err);
4897
+ }
4898
+ });
4899
+ }
4900
+ /**
4901
+ * Punto de indirección (seam) sobre `fetchEventSource`: permite sustituirlo en
4902
+ * tests (`fetchEventSource` es un binding ESM de solo lectura, no espiable).
4903
+ * En producción delega directamente en la librería.
4904
+ */
4905
+ openEventSource(url, options) {
4906
+ return fetchEventSource(url, options);
4907
+ }
4908
+ /** Cierra el stream actual (idempotente). */
4909
+ close() {
4910
+ if (this._abort) {
4911
+ this._abort.abort();
4912
+ this._abort = null;
4913
+ }
4914
+ this._connected = false;
4915
+ }
4916
+ _buildStreamUrl() {
4917
+ const base = (this._config.buildUrl() ?? '').replace(/\/+$/, '');
4918
+ const path = this._config.streamPath ?? DEFAULT_STREAM_PATH;
4919
+ return `${base}${path.startsWith('/') ? path : '/' + path}`;
4920
+ }
4921
+ _allowedSet() {
4922
+ const allowed = this._config.allowedEvents;
4923
+ return allowed instanceof Set ? allowed : new Set(allowed);
4924
+ }
4925
+ /**
4926
+ * Maneja el evento de lifecycle `sessionReplaced` (otra apertura de sesión
4927
+ * para el mismo usuario). Si el `newSessionId` difiere de la sesión local,
4928
+ * emite el evento de fin de sesión para forzar logout. Se ejecuta antes del
4929
+ * filtro de allow-list porque no se re-emite al bus genérico.
4930
+ * Devuelve `true` cuando consume el evento.
4931
+ */
4932
+ _handleSessionReplaced(eventData) {
4933
+ if ((this._config.handleSessionReplaced ?? true) === false) {
4934
+ return false;
4935
+ }
4936
+ if (eventData?.eventClass !== SESSION_EVENT_CLASS ||
4937
+ eventData?.eventType !== SESSION_REPLACED_EVENT_TYPE) {
4938
+ return false;
4939
+ }
4940
+ const newSessionId = eventData?.eventDetail?.newSessionId ?? null;
4941
+ if (!this._currentSessionId) {
4942
+ return true; // no hay sesión local que cerrar
4943
+ }
4944
+ if (newSessionId && newSessionId === this._currentSessionId) {
4945
+ return true; // corresponde a la propia sesión recién abierta
4946
+ }
4947
+ this._config.logger?.warn?.('[SseLiveConnection] Sesión reemplazada por otra apertura para el mismo usuario', { currentSessionId: this._currentSessionId, newSessionId });
4948
+ const sessionEndedName = this._config.sessionEndedEventName ?? DEFAULT_SESSION_ENDED_EVENT;
4949
+ this._config.emit(sessionEndedName, null);
4950
+ return true;
4951
+ }
4952
+ /**
4953
+ * Maneja el evento de control `sessionClosed` dirigido a ESTA sesión (el gateway lo envía con
4954
+ * recipientType 'session' al detectar que la sesión expiró/dejó de ser válida). Ordena cerrar la
4955
+ * sesión en el navegador. Se ejecuta antes del allow-list porque no se re-emite al bus genérico.
4956
+ * Emite `sessionClosedEventName` (o, en su defecto, el de fin de sesión) para que la app muestre
4957
+ * su propio mensaje antes del logout. Devuelve `true` cuando consume el evento.
4958
+ */
4959
+ _handleSessionClosed(eventData) {
4960
+ if ((this._config.handleSessionClosed ?? true) === false) {
4961
+ return false;
4962
+ }
4963
+ if (eventData?.eventClass !== SESSION_EVENT_CLASS ||
4964
+ eventData?.eventType !== SESSION_CLOSED_EVENT_TYPE) {
4965
+ return false;
4966
+ }
4967
+ if (!this._currentSessionId) {
4968
+ return true; // no hay sesión local que cerrar
4969
+ }
4970
+ // Defensivo: el evento va dirigido por sessionId, pero si trae uno y no coincide, lo ignoramos.
4971
+ const targetSessionId = eventData?.eventDetail?.sessionId ?? null;
4972
+ if (targetSessionId && targetSessionId !== this._currentSessionId) {
4973
+ return true;
4974
+ }
4975
+ this._config.logger?.warn?.('[SseLiveConnection] El servidor cerró esta sesión', {
4976
+ currentSessionId: this._currentSessionId,
4977
+ });
4978
+ const eventName = this._config.sessionClosedEventName ?? this._config.sessionEndedEventName ?? DEFAULT_SESSION_ENDED_EVENT;
4979
+ this._config.emit(eventName, null);
4980
+ return true;
4981
+ }
4982
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SseLiveConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4983
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SseLiveConnectionService, providedIn: 'root' });
4984
+ }
4985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: SseLiveConnectionService, decorators: [{
4986
+ type: Injectable,
4987
+ args: [{ providedIn: 'root' }]
4988
+ }] });
4989
+
4796
4990
  const COMPONENTS = [
4797
4991
  ActionComponent,
4798
4992
  FieldComponent,
@@ -4808,8 +5002,8 @@ const COMPONENTS = [
4808
5002
  * @deprecated Since v17. Use standalone components directly. Will be removed in v19.
4809
5003
  */
4810
5004
  class TuainNgFormsLibModule {
4811
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4812
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, imports: [ActionComponent,
5005
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuainNgFormsLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5006
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.22", ngImport: i0, type: TuainNgFormsLibModule, imports: [ActionComponent,
4813
5007
  FieldComponent,
4814
5008
  FormErrorComponent,
4815
5009
  FormHeaderComponent,
@@ -4826,9 +5020,9 @@ class TuainNgFormsLibModule {
4826
5020
  LibTableRecordActionComponent,
4827
5021
  LibTableRecordFieldComponent,
4828
5022
  LibTableComponent] });
4829
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule });
5023
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuainNgFormsLibModule });
4830
5024
  }
4831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, decorators: [{
5025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuainNgFormsLibModule, decorators: [{
4832
5026
  type: NgModule,
4833
5027
  args: [{
4834
5028
  imports: COMPONENTS,
@@ -4845,5 +5039,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
4845
5039
  * Generated bundle index. Do not edit.
4846
5040
  */
4847
5041
 
4848
- export { ActionComponent, BaseIconResolverService, BasicFormComponent, ComparisonOperator, ElementComponent, ElementType, FieldComponent, FieldDescriptor, FormAction, FormActionType, FormElement, FormErrorComponent, FormHeaderComponent, FormPiece, FormPiecePropagate, FormStructureAndData, HEADER, ICON_RESOLVER, IconDictionaryService, LibEventManagerService, LibFileManagementService, LibFormManagerService, LibTableComponent, LibTableRecordActionComponent, LibTableRecordFieldComponent, NO_ERROR, PieceComponent, RecordFormSection, RecordFormSubSection, RecordTable, RecordTableColumn, SectionComponent, SubSectionComponent, TableAction, TableRecordData, TuainNgFormsLibModule, elementTypes, formActions, iconDictionary, operators };
5042
+ export { ActionComponent, BaseIconResolverService, BasicFormComponent, ComparisonOperator, ElementComponent, ElementType, FieldComponent, FieldDescriptor, FormAction, FormActionType, FormElement, FormErrorComponent, FormHeaderComponent, FormPiece, FormPiecePropagate, FormStructureAndData, HEADER, ICON_RESOLVER, IconDictionaryService, LibEventManagerService, LibFileManagementService, LibFormManagerService, LibTableComponent, LibTableRecordActionComponent, LibTableRecordFieldComponent, NO_ERROR, PieceComponent, RecordFormSection, RecordFormSubSection, RecordTable, RecordTableColumn, SSE_LIVE_CONNECTION_CONFIG, SectionComponent, SseLiveConnectionService, SubSectionComponent, TableAction, TableRecordData, TuainNgFormsLibModule, elementTypes, formActions, iconDictionary, operators };
4849
5043
  //# sourceMappingURL=tuain-ng-forms-lib.mjs.map