tuain-ng-forms-lib 17.1.20 → 17.1.22

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.
@@ -476,7 +476,7 @@ const CUSTOM_ATTRIBUTES = 'customAttributes';
476
476
  const signaledAttributes = [
477
477
  'allSelected', 'code', 'globalSearch', 'recordsPerPage', 'layout',
478
478
  'columns', 'selectedRecords', 'currentPage', 'totalRecordsNumber', 'visibleRecords',
479
- 'visible', 'disabled',
479
+ 'waiting', 'visible', 'disabled',
480
480
  ];
481
481
  class LibTableComponent extends ElementComponent {
482
482
  // Atributos sincronizados del objeto
@@ -490,6 +490,7 @@ class LibTableComponent extends ElementComponent {
490
490
  currentPage = signal(null);
491
491
  totalRecordsNumber = signal(null);
492
492
  visibleRecords = signal([]);
493
+ waiting = signal(false);
493
494
  globalFilterString = '';
494
495
  tableFieldStyles;
495
496
  loaded = false;
@@ -499,7 +500,6 @@ class LibTableComponent extends ElementComponent {
499
500
  globalActions;
500
501
  selectionActions;
501
502
  table = null;
502
- waiting = false;
503
503
  ngOnInit() {
504
504
  if (!this.table) {
505
505
  return;
@@ -557,7 +557,7 @@ class LibTableComponent extends ElementComponent {
557
557
  }
558
558
  }
559
559
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
560
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableComponent, selector: "lib-table", inputs: { table: "table", waiting: "waiting" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
560
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableComponent, selector: "lib-table", inputs: { table: "table" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
561
561
  }
562
562
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, decorators: [{
563
563
  type: Component,
@@ -568,8 +568,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
568
568
  }]
569
569
  }], propDecorators: { table: [{
570
570
  type: Input
571
- }], waiting: [{
572
- type: Input
573
571
  }] } });
574
572
 
575
573
  const NO_ERROR = '00';
@@ -1590,6 +1588,7 @@ const attrs = {
1590
1588
  currentPage: { name: 'currentPage', propagate: 'currentPage' },
1591
1589
  totalRecordsNumber: { name: 'totalRecordsNumber', propagate: 'totalRecordsNumber' },
1592
1590
  visibleRecords: { name: '_visibleRecords', propagate: 'visibleRecords' },
1591
+ waiting: { name: '_waiting', propagate: 'waiting' },
1593
1592
  };
1594
1593
  class RecordTable extends FormElement {
1595
1594
  _inlineActionTrigger = new Subject();
@@ -1745,7 +1744,7 @@ class RecordTable extends FormElement {
1745
1744
  set totalRecordsNumber(totalRecordsNumber) { this._totalRecordsNumber = totalRecordsNumber; }
1746
1745
  set recordsNumber(recordsNumber) { this._recordsNumber = recordsNumber; }
1747
1746
  set sorting(sorting) { this._sorting = sorting; }
1748
- set waiting(waiting) { this._waiting = waiting; }
1747
+ set waiting(waiting) { this.setAttr(attrs.waiting, waiting); }
1749
1748
  set clientPaging(clientPaging) { this._clientPaging = clientPaging; }
1750
1749
  set sortable(sortable) { this._sortable = sortable; }
1751
1750
  getLayout() { return this.layout; }
@@ -1755,8 +1754,8 @@ class RecordTable extends FormElement {
1755
1754
  activateGlobalSearch() { this._globalSearch = true; }
1756
1755
  inactivateGlobalSearch() { this._globalSearch = false; }
1757
1756
  columnDefinition(fieldCode) { return this._tableColumnObj[fieldCode]; }
1758
- putOnWait() { this._waiting = true; }
1759
- freeWaiting() { this._waiting = false; }
1757
+ putOnWait() { this.waiting = true; }
1758
+ freeWaiting() { this.waiting = false; }
1760
1759
  setWidget(widget) { this.widget = widget; }
1761
1760
  notifyGlobalAction(actionCode) {
1762
1761
  const tableEvent = {
@@ -1950,7 +1949,7 @@ class RecordTable extends FormElement {
1950
1949
  this.appendRecords(tableRecords);
1951
1950
  }
1952
1951
  }
1953
- this._waiting = false;
1952
+ this.freeWaiting();
1954
1953
  this.updateVisibleRecords();
1955
1954
  }
1956
1955
  getTableRecord(recordId) {
@@ -2349,10 +2348,10 @@ const neverVisible = 'NONE';
2349
2348
  const onStatesVisible = 'ONSTATES';
2350
2349
  class FormStructureAndData {
2351
2350
  _stateChange = new Subject();
2352
- formConfig;
2353
- state;
2354
- name = '';
2355
- title = '';
2351
+ _immutableData = {};
2352
+ _extraInfo = {};
2353
+ _exclusiveSectionsByAttr = {};
2354
+ loadInitialData = true;
2356
2355
  subject = null;
2357
2356
  stateFlow;
2358
2357
  fields = {};
@@ -2363,10 +2362,11 @@ class FormStructureAndData {
2363
2362
  actionArray;
2364
2363
  tableArray;
2365
2364
  sectionArray;
2366
- _immutableData = {};
2367
- _extraInfo = {};
2368
- _exclusiveSectionsByAttr = {};
2369
2365
  customAttributes = {};
2366
+ formConfig;
2367
+ state;
2368
+ name = '';
2369
+ title = '';
2370
2370
  constructor() {
2371
2371
  this.state = '';
2372
2372
  this.actionArray = [];
@@ -2402,9 +2402,10 @@ class FormStructureAndData {
2402
2402
  if (!definitionReceived) {
2403
2403
  return;
2404
2404
  }
2405
- this.name = this.name ?? definitionReceived?.form?.formCode;
2406
- this.title = (definitionReceived.form && definitionReceived.form.formTitle)
2407
- ? definitionReceived.form.formTitle : '';
2405
+ const { form = {} } = definitionReceived;
2406
+ this.name = this.name ?? form.formCode;
2407
+ this.title = form.formTitle ?? this.name;
2408
+ this.loadInitialData = form.loadInitialData ?? true;
2408
2409
  allStates = definitionReceived?.states;
2409
2410
  this.setStateFlow(definitionReceived?.states, definitionReceived?.transitions, definitionReceived?.defaultState, definitionReceived?.stateDescriptions);
2410
2411
  this.immutableData = definitionReceived.immutableData;
@@ -3100,6 +3101,7 @@ class BasicFormComponent extends FormStructureAndData {
3100
3101
  this.fileMgmtServices = fileMgmtServices;
3101
3102
  this._eventEmiter = this._eventManager;
3102
3103
  this.cleanStart();
3104
+ this.preStart();
3103
3105
  this.customPreProcessing();
3104
3106
  }
3105
3107
  cleanStart() {
@@ -3141,8 +3143,15 @@ class BasicFormComponent extends FormStructureAndData {
3141
3143
  get formVisible() { return this.visible; }
3142
3144
  get form() { return this; }
3143
3145
  // Métodos virtuales
3144
- customPreProcessing() { }
3146
+ preStart() { }
3145
3147
  start() { }
3148
+ /**
3149
+ * @deprecated Use preStart
3150
+ */
3151
+ customPreProcessing() { }
3152
+ /**
3153
+ * @deprecated Overload start
3154
+ */
3146
3155
  customFormStart() { }
3147
3156
  displayActionServerError() { }
3148
3157
  displayValidationServerError() { }
@@ -3294,8 +3303,10 @@ class BasicFormComponent extends FormStructureAndData {
3294
3303
  this.subscribeTableSubjects();
3295
3304
  // Se define el estado inicial y se solicita la acción inicial
3296
3305
  this.changeState(initialState || this.defaultState);
3297
- const recordResponse = await this.requestFormAction(formActions.getData);
3298
- this.checkErrorRecordReceived(recordResponse);
3306
+ if (this.loadInitialData) {
3307
+ const recordResponse = await this.requestFormAction(formActions.getData);
3308
+ this.checkErrorRecordReceived(recordResponse);
3309
+ }
3299
3310
  this.visible = true;
3300
3311
  this.enabledSections = this.visibleSections ?? [];
3301
3312
  this.start();