tuain-ng-forms-lib 14.5.33 → 14.5.34
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 +1 -2
- package/esm2020/lib/classes/forms/piece-propagate.mjs +1 -2
- package/esm2020/lib/classes/forms/table/row-data.mjs +1 -6
- package/esm2020/lib/classes/forms/table/table.mjs +1 -22
- package/esm2020/lib/components/elements/tables/table.component.mjs +1 -3
- package/fesm2015/tuain-ng-forms-lib.mjs +0 -30
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +0 -30
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -433,7 +433,6 @@ 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...`);
|
|
437
436
|
this.defaultProcessAttributeChange(attrName, value);
|
|
438
437
|
this.customProcessAttributeChange(attrName, value);
|
|
439
438
|
});
|
|
@@ -452,7 +451,6 @@ class LibTableComponent extends ElementComponent {
|
|
|
452
451
|
defaultProcessAttributeChange(attribute, value) {
|
|
453
452
|
try {
|
|
454
453
|
if (attribute === 'visibleRecords') {
|
|
455
|
-
console.log('Se deben actualizar los visibleRecords');
|
|
456
454
|
this.updateTableData();
|
|
457
455
|
}
|
|
458
456
|
return super.defaultProcessAttributeChange(attribute, value);
|
|
@@ -642,7 +640,6 @@ class FormPiecePropagate extends FormPiece {
|
|
|
642
640
|
}
|
|
643
641
|
get attributeChange() { return this._attributeChange; }
|
|
644
642
|
propagateAttribute(name, value) {
|
|
645
|
-
console.log(`Propagando atributo ${name}`);
|
|
646
643
|
this._attributeChange?.next({ name, value });
|
|
647
644
|
}
|
|
648
645
|
setCustomAttribute(name, value) {
|
|
@@ -677,7 +674,6 @@ class FormElement extends FormPiecePropagate {
|
|
|
677
674
|
;
|
|
678
675
|
setAttr(attr, value) {
|
|
679
676
|
const { name: attrName, propagate: name } = attr;
|
|
680
|
-
console.log(`Asignando valor a ${attrName}`);
|
|
681
677
|
this[attrName] = value;
|
|
682
678
|
name && this.propagateAttribute(name, value);
|
|
683
679
|
}
|
|
@@ -1353,17 +1349,13 @@ class TableRecordData {
|
|
|
1353
1349
|
return true;
|
|
1354
1350
|
}
|
|
1355
1351
|
hasCondition(columnFilters) {
|
|
1356
|
-
console.log(`Evaluación de condición sobre un registro...`);
|
|
1357
1352
|
if (!columnFilters || columnFilters.length === 0) {
|
|
1358
1353
|
return true;
|
|
1359
1354
|
}
|
|
1360
1355
|
for (const condition of columnFilters) {
|
|
1361
1356
|
const { fieldCode, operator, values } = condition;
|
|
1362
|
-
console.log(`1. Evaluación condición columna ${fieldCode} / ${operator}`);
|
|
1363
1357
|
if (this.recordData.hasOwnProperty(fieldCode)) {
|
|
1364
1358
|
const fieldValue = this.recordData[fieldCode];
|
|
1365
|
-
console.log(`2. Evaluación condición columna ${fieldCode}/(${fieldValue}) con ${operator}`);
|
|
1366
|
-
console.log(values);
|
|
1367
1359
|
const stringValue = fieldValue.toString().toUpperCase();
|
|
1368
1360
|
if (operator === operators.G && fieldValue <= values[0]) {
|
|
1369
1361
|
return false;
|
|
@@ -1378,7 +1370,6 @@ class TableRecordData {
|
|
|
1378
1370
|
return false;
|
|
1379
1371
|
}
|
|
1380
1372
|
if (operator === operators.IN && !values.includes(fieldValue)) {
|
|
1381
|
-
console.log(`Evaluación falsa de condición IN...`);
|
|
1382
1373
|
return false;
|
|
1383
1374
|
}
|
|
1384
1375
|
if (operator === operators.EQ) {
|
|
@@ -1633,17 +1624,12 @@ class RecordTable extends FormElement {
|
|
|
1633
1624
|
}
|
|
1634
1625
|
}
|
|
1635
1626
|
updateVisibleRecords() {
|
|
1636
|
-
console.log('updateVisibleRecords');
|
|
1637
1627
|
let visibleRecords;
|
|
1638
1628
|
if (this.clientPaging) {
|
|
1639
|
-
console.log('this.clientPaging');
|
|
1640
|
-
console.log('a por getFilteredRecords');
|
|
1641
1629
|
let filteredRecords = this.getFilteredRecords();
|
|
1642
|
-
console.log('regresando de getFilteredRecords');
|
|
1643
1630
|
this.setAttr(attrs.totalRecordsNumber, filteredRecords.length);
|
|
1644
1631
|
const sliceNumber1 = (this.currentPage - 1) * this.recordsPerPage;
|
|
1645
1632
|
const sliceNumber2 = (this.currentPage - 1) * this.recordsPerPage + this.recordsPerPage;
|
|
1646
|
-
console.log('Actualizando visibleRecords');
|
|
1647
1633
|
visibleRecords = filteredRecords.slice(sliceNumber1, sliceNumber2);
|
|
1648
1634
|
const recordsLastPage = this.totalRecordsNumber % this.recordsPerPage;
|
|
1649
1635
|
const totalPages = Math.trunc(this.totalRecordsNumber / this.recordsPerPage + (recordsLastPage ? 1 : 0));
|
|
@@ -1654,7 +1640,6 @@ class RecordTable extends FormElement {
|
|
|
1654
1640
|
else {
|
|
1655
1641
|
visibleRecords = this.tableRecords;
|
|
1656
1642
|
}
|
|
1657
|
-
console.log('Actualizando visibleRecords al cierre');
|
|
1658
1643
|
this.setAttr(attrs.visibleRecords, visibleRecords);
|
|
1659
1644
|
}
|
|
1660
1645
|
updateFromServer(tableReceived) {
|
|
@@ -1769,19 +1754,15 @@ class RecordTable extends FormElement {
|
|
|
1769
1754
|
tableColumn && tableColumn.addFilterDefinition(filterDefinition);
|
|
1770
1755
|
}
|
|
1771
1756
|
getFilteredRecords() {
|
|
1772
|
-
console.log('getFilteredRecords');
|
|
1773
1757
|
let filteredRecords = this.tableRecords;
|
|
1774
1758
|
if (this.restrictedId) {
|
|
1775
|
-
console.log('por id');
|
|
1776
1759
|
filteredRecords = filteredRecords.filter(record => record.recordId === this.restrictedId);
|
|
1777
1760
|
}
|
|
1778
1761
|
if (this.globalFilterStrings.length > 0) {
|
|
1779
|
-
console.log('global');
|
|
1780
1762
|
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings, this._tableColumnObj));
|
|
1781
1763
|
}
|
|
1782
1764
|
const columnFilters = this.columns.filter(column => column.filter).map(column => column.filter);
|
|
1783
1765
|
if (columnFilters.length > 0) {
|
|
1784
|
-
console.log('Hay columnFilters...');
|
|
1785
1766
|
filteredRecords = filteredRecords.filter(record => record.hasCondition(columnFilters));
|
|
1786
1767
|
}
|
|
1787
1768
|
return filteredRecords;
|
|
@@ -1791,23 +1772,12 @@ class RecordTable extends FormElement {
|
|
|
1791
1772
|
return tableColumn?.filter ?? null;
|
|
1792
1773
|
}
|
|
1793
1774
|
addColumnFilter(columnName, columnValues, operator = null) {
|
|
1794
|
-
console.log('1. addColumnFilter');
|
|
1795
1775
|
const tableColumn = this.columnDefinition(columnName);
|
|
1796
|
-
console.log('2. addColumnFilter');
|
|
1797
|
-
console.log(tableColumn);
|
|
1798
1776
|
const columnFilterDefinition = tableColumn?.filterDefinition ?? null;
|
|
1799
|
-
console.log('3. addColumnFilter');
|
|
1800
|
-
console.log(columnFilterDefinition);
|
|
1801
1777
|
if (!columnFilterDefinition) {
|
|
1802
1778
|
return;
|
|
1803
1779
|
}
|
|
1804
|
-
console.log('4. addColumnFilter');
|
|
1805
|
-
console.log('tableColumn');
|
|
1806
|
-
console.log(tableColumn);
|
|
1807
|
-
console.log({ columnValues, operator });
|
|
1808
|
-
console.log('5. Adicionando filtro');
|
|
1809
1780
|
tableColumn && tableColumn.addFilter(columnValues, operator);
|
|
1810
|
-
console.log('4. updateVisibleRecords');
|
|
1811
1781
|
this.updateVisibleRecords();
|
|
1812
1782
|
}
|
|
1813
1783
|
removeColumnFilter(columnName) {
|