tuain-ng-forms-lib 14.5.32 → 14.5.33
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.
- package/esm2020/lib/classes/forms/element.mjs +2 -1
- package/esm2020/lib/classes/forms/piece-propagate.mjs +2 -1
- package/esm2020/lib/classes/forms/table/table.mjs +14 -1
- package/esm2020/lib/components/elements/tables/table.component.mjs +3 -1
- package/fesm2015/tuain-ng-forms-lib.mjs +17 -0
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +17 -0
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -433,6 +433,7 @@ class LibTableComponent extends ElementComponent {
|
|
|
433
433
|
// Subscripción a cambios en atributos
|
|
434
434
|
this.table?.attributeChange.subscribe(event => {
|
|
435
435
|
const { name: attrName, value } = event;
|
|
436
|
+
console.log(`Llegó atributo ${attrName} propagado...`);
|
|
436
437
|
this.defaultProcessAttributeChange(attrName, value);
|
|
437
438
|
this.customProcessAttributeChange(attrName, value);
|
|
438
439
|
});
|
|
@@ -451,6 +452,7 @@ class LibTableComponent extends ElementComponent {
|
|
|
451
452
|
defaultProcessAttributeChange(attribute, value) {
|
|
452
453
|
try {
|
|
453
454
|
if (attribute === 'visibleRecords') {
|
|
455
|
+
console.log('Se deben actualizar los visibleRecords');
|
|
454
456
|
this.updateTableData();
|
|
455
457
|
}
|
|
456
458
|
return super.defaultProcessAttributeChange(attribute, value);
|
|
@@ -640,6 +642,7 @@ class FormPiecePropagate extends FormPiece {
|
|
|
640
642
|
}
|
|
641
643
|
get attributeChange() { return this._attributeChange; }
|
|
642
644
|
propagateAttribute(name, value) {
|
|
645
|
+
console.log(`Propagando atributo ${name}`);
|
|
643
646
|
this._attributeChange?.next({ name, value });
|
|
644
647
|
}
|
|
645
648
|
setCustomAttribute(name, value) {
|
|
@@ -674,6 +677,7 @@ class FormElement extends FormPiecePropagate {
|
|
|
674
677
|
;
|
|
675
678
|
setAttr(attr, value) {
|
|
676
679
|
const { name: attrName, propagate: name } = attr;
|
|
680
|
+
console.log(`Asignando valor a ${attrName}`);
|
|
677
681
|
this[attrName] = value;
|
|
678
682
|
name && this.propagateAttribute(name, value);
|
|
679
683
|
}
|
|
@@ -1629,12 +1633,17 @@ class RecordTable extends FormElement {
|
|
|
1629
1633
|
}
|
|
1630
1634
|
}
|
|
1631
1635
|
updateVisibleRecords() {
|
|
1636
|
+
console.log('updateVisibleRecords');
|
|
1632
1637
|
let visibleRecords;
|
|
1633
1638
|
if (this.clientPaging) {
|
|
1639
|
+
console.log('this.clientPaging');
|
|
1640
|
+
console.log('a por getFilteredRecords');
|
|
1634
1641
|
let filteredRecords = this.getFilteredRecords();
|
|
1642
|
+
console.log('regresando de getFilteredRecords');
|
|
1635
1643
|
this.setAttr(attrs.totalRecordsNumber, filteredRecords.length);
|
|
1636
1644
|
const sliceNumber1 = (this.currentPage - 1) * this.recordsPerPage;
|
|
1637
1645
|
const sliceNumber2 = (this.currentPage - 1) * this.recordsPerPage + this.recordsPerPage;
|
|
1646
|
+
console.log('Actualizando visibleRecords');
|
|
1638
1647
|
visibleRecords = filteredRecords.slice(sliceNumber1, sliceNumber2);
|
|
1639
1648
|
const recordsLastPage = this.totalRecordsNumber % this.recordsPerPage;
|
|
1640
1649
|
const totalPages = Math.trunc(this.totalRecordsNumber / this.recordsPerPage + (recordsLastPage ? 1 : 0));
|
|
@@ -1645,6 +1654,7 @@ class RecordTable extends FormElement {
|
|
|
1645
1654
|
else {
|
|
1646
1655
|
visibleRecords = this.tableRecords;
|
|
1647
1656
|
}
|
|
1657
|
+
console.log('Actualizando visibleRecords al cierre');
|
|
1648
1658
|
this.setAttr(attrs.visibleRecords, visibleRecords);
|
|
1649
1659
|
}
|
|
1650
1660
|
updateFromServer(tableReceived) {
|
|
@@ -1759,11 +1769,14 @@ class RecordTable extends FormElement {
|
|
|
1759
1769
|
tableColumn && tableColumn.addFilterDefinition(filterDefinition);
|
|
1760
1770
|
}
|
|
1761
1771
|
getFilteredRecords() {
|
|
1772
|
+
console.log('getFilteredRecords');
|
|
1762
1773
|
let filteredRecords = this.tableRecords;
|
|
1763
1774
|
if (this.restrictedId) {
|
|
1775
|
+
console.log('por id');
|
|
1764
1776
|
filteredRecords = filteredRecords.filter(record => record.recordId === this.restrictedId);
|
|
1765
1777
|
}
|
|
1766
1778
|
if (this.globalFilterStrings.length > 0) {
|
|
1779
|
+
console.log('global');
|
|
1767
1780
|
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings, this._tableColumnObj));
|
|
1768
1781
|
}
|
|
1769
1782
|
const columnFilters = this.columns.filter(column => column.filter).map(column => column.filter);
|
|
@@ -1789,8 +1802,12 @@ class RecordTable extends FormElement {
|
|
|
1789
1802
|
return;
|
|
1790
1803
|
}
|
|
1791
1804
|
console.log('4. addColumnFilter');
|
|
1805
|
+
console.log('tableColumn');
|
|
1806
|
+
console.log(tableColumn);
|
|
1792
1807
|
console.log({ columnValues, operator });
|
|
1808
|
+
console.log('5. Adicionando filtro');
|
|
1793
1809
|
tableColumn && tableColumn.addFilter(columnValues, operator);
|
|
1810
|
+
console.log('4. updateVisibleRecords');
|
|
1794
1811
|
this.updateVisibleRecords();
|
|
1795
1812
|
}
|
|
1796
1813
|
removeColumnFilter(columnName) {
|