tuain-ng-forms-lib 14.5.33 → 14.5.35
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 -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/field.component.mjs +3 -1
- package/esm2020/lib/components/elements/tables/table.component.mjs +1 -3
- package/fesm2015/tuain-ng-forms-lib.mjs +3 -30
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +3 -30
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -142,6 +142,7 @@ class FieldComponent extends ElementComponent {
|
|
|
142
142
|
if (componentAttr) {
|
|
143
143
|
const value = (_j = this.field) === null || _j === void 0 ? void 0 : _j[fieldAttr];
|
|
144
144
|
this.defaultProcessAttributeChange(componentAttr, value);
|
|
145
|
+
console.log(`1. customProcessAttributeChange ${componentAttr} ${value}`);
|
|
145
146
|
this.customProcessAttributeChange(componentAttr, value);
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -153,6 +154,7 @@ class FieldComponent extends ElementComponent {
|
|
|
153
154
|
const fullName = `customAttributes.${customAttribute}`;
|
|
154
155
|
if (value) {
|
|
155
156
|
this.defaultProcessAttributeChange(fullName, value);
|
|
157
|
+
console.log(`2. customProcessAttributeChange ${fullName} ${value}`);
|
|
156
158
|
this.customProcessAttributeChange(fullName, value);
|
|
157
159
|
}
|
|
158
160
|
}
|
|
@@ -447,7 +449,6 @@ class LibTableComponent extends ElementComponent {
|
|
|
447
449
|
// Subscripción a cambios en atributos
|
|
448
450
|
(_s = this.table) === null || _s === void 0 ? void 0 : _s.attributeChange.subscribe(event => {
|
|
449
451
|
const { name: attrName, value } = event;
|
|
450
|
-
console.log(`Llegó atributo ${attrName} propagado...`);
|
|
451
452
|
this.defaultProcessAttributeChange(attrName, value);
|
|
452
453
|
this.customProcessAttributeChange(attrName, value);
|
|
453
454
|
});
|
|
@@ -466,7 +467,6 @@ class LibTableComponent extends ElementComponent {
|
|
|
466
467
|
defaultProcessAttributeChange(attribute, value) {
|
|
467
468
|
try {
|
|
468
469
|
if (attribute === 'visibleRecords') {
|
|
469
|
-
console.log('Se deben actualizar los visibleRecords');
|
|
470
470
|
this.updateTableData();
|
|
471
471
|
}
|
|
472
472
|
return super.defaultProcessAttributeChange(attribute, value);
|
|
@@ -660,7 +660,6 @@ class FormPiecePropagate extends FormPiece {
|
|
|
660
660
|
get attributeChange() { return this._attributeChange; }
|
|
661
661
|
propagateAttribute(name, value) {
|
|
662
662
|
var _a;
|
|
663
|
-
console.log(`Propagando atributo ${name}`);
|
|
664
663
|
(_a = this._attributeChange) === null || _a === void 0 ? void 0 : _a.next({ name, value });
|
|
665
664
|
}
|
|
666
665
|
setCustomAttribute(name, value) {
|
|
@@ -696,8 +695,8 @@ class FormElement extends FormPiecePropagate {
|
|
|
696
695
|
;
|
|
697
696
|
setAttr(attr, value) {
|
|
698
697
|
const { name: attrName, propagate: name } = attr;
|
|
699
|
-
console.log(`Asignando valor a ${attrName}`);
|
|
700
698
|
this[attrName] = value;
|
|
699
|
+
console.log(`Propagamos ${name} con valor ${value}`);
|
|
701
700
|
name && this.propagateAttribute(name, value);
|
|
702
701
|
}
|
|
703
702
|
isField() { return this.elementType === elementTypes.field; }
|
|
@@ -1384,17 +1383,13 @@ class TableRecordData {
|
|
|
1384
1383
|
return true;
|
|
1385
1384
|
}
|
|
1386
1385
|
hasCondition(columnFilters) {
|
|
1387
|
-
console.log(`Evaluación de condición sobre un registro...`);
|
|
1388
1386
|
if (!columnFilters || columnFilters.length === 0) {
|
|
1389
1387
|
return true;
|
|
1390
1388
|
}
|
|
1391
1389
|
for (const condition of columnFilters) {
|
|
1392
1390
|
const { fieldCode, operator, values } = condition;
|
|
1393
|
-
console.log(`1. Evaluación condición columna ${fieldCode} / ${operator}`);
|
|
1394
1391
|
if (this.recordData.hasOwnProperty(fieldCode)) {
|
|
1395
1392
|
const fieldValue = this.recordData[fieldCode];
|
|
1396
|
-
console.log(`2. Evaluación condición columna ${fieldCode}/(${fieldValue}) con ${operator}`);
|
|
1397
|
-
console.log(values);
|
|
1398
1393
|
const stringValue = fieldValue.toString().toUpperCase();
|
|
1399
1394
|
if (operator === operators.G && fieldValue <= values[0]) {
|
|
1400
1395
|
return false;
|
|
@@ -1409,7 +1404,6 @@ class TableRecordData {
|
|
|
1409
1404
|
return false;
|
|
1410
1405
|
}
|
|
1411
1406
|
if (operator === operators.IN && !values.includes(fieldValue)) {
|
|
1412
|
-
console.log(`Evaluación falsa de condición IN...`);
|
|
1413
1407
|
return false;
|
|
1414
1408
|
}
|
|
1415
1409
|
if (operator === operators.EQ) {
|
|
@@ -1662,17 +1656,12 @@ class RecordTable extends FormElement {
|
|
|
1662
1656
|
}
|
|
1663
1657
|
}
|
|
1664
1658
|
updateVisibleRecords() {
|
|
1665
|
-
console.log('updateVisibleRecords');
|
|
1666
1659
|
let visibleRecords;
|
|
1667
1660
|
if (this.clientPaging) {
|
|
1668
|
-
console.log('this.clientPaging');
|
|
1669
|
-
console.log('a por getFilteredRecords');
|
|
1670
1661
|
let filteredRecords = this.getFilteredRecords();
|
|
1671
|
-
console.log('regresando de getFilteredRecords');
|
|
1672
1662
|
this.setAttr(attrs.totalRecordsNumber, filteredRecords.length);
|
|
1673
1663
|
const sliceNumber1 = (this.currentPage - 1) * this.recordsPerPage;
|
|
1674
1664
|
const sliceNumber2 = (this.currentPage - 1) * this.recordsPerPage + this.recordsPerPage;
|
|
1675
|
-
console.log('Actualizando visibleRecords');
|
|
1676
1665
|
visibleRecords = filteredRecords.slice(sliceNumber1, sliceNumber2);
|
|
1677
1666
|
const recordsLastPage = this.totalRecordsNumber % this.recordsPerPage;
|
|
1678
1667
|
const totalPages = Math.trunc(this.totalRecordsNumber / this.recordsPerPage + (recordsLastPage ? 1 : 0));
|
|
@@ -1683,7 +1672,6 @@ class RecordTable extends FormElement {
|
|
|
1683
1672
|
else {
|
|
1684
1673
|
visibleRecords = this.tableRecords;
|
|
1685
1674
|
}
|
|
1686
|
-
console.log('Actualizando visibleRecords al cierre');
|
|
1687
1675
|
this.setAttr(attrs.visibleRecords, visibleRecords);
|
|
1688
1676
|
}
|
|
1689
1677
|
updateFromServer(tableReceived) {
|
|
@@ -1800,19 +1788,15 @@ class RecordTable extends FormElement {
|
|
|
1800
1788
|
tableColumn && tableColumn.addFilterDefinition(filterDefinition);
|
|
1801
1789
|
}
|
|
1802
1790
|
getFilteredRecords() {
|
|
1803
|
-
console.log('getFilteredRecords');
|
|
1804
1791
|
let filteredRecords = this.tableRecords;
|
|
1805
1792
|
if (this.restrictedId) {
|
|
1806
|
-
console.log('por id');
|
|
1807
1793
|
filteredRecords = filteredRecords.filter(record => record.recordId === this.restrictedId);
|
|
1808
1794
|
}
|
|
1809
1795
|
if (this.globalFilterStrings.length > 0) {
|
|
1810
|
-
console.log('global');
|
|
1811
1796
|
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings, this._tableColumnObj));
|
|
1812
1797
|
}
|
|
1813
1798
|
const columnFilters = this.columns.filter(column => column.filter).map(column => column.filter);
|
|
1814
1799
|
if (columnFilters.length > 0) {
|
|
1815
|
-
console.log('Hay columnFilters...');
|
|
1816
1800
|
filteredRecords = filteredRecords.filter(record => record.hasCondition(columnFilters));
|
|
1817
1801
|
}
|
|
1818
1802
|
return filteredRecords;
|
|
@@ -1824,23 +1808,12 @@ class RecordTable extends FormElement {
|
|
|
1824
1808
|
}
|
|
1825
1809
|
addColumnFilter(columnName, columnValues, operator = null) {
|
|
1826
1810
|
var _a;
|
|
1827
|
-
console.log('1. addColumnFilter');
|
|
1828
1811
|
const tableColumn = this.columnDefinition(columnName);
|
|
1829
|
-
console.log('2. addColumnFilter');
|
|
1830
|
-
console.log(tableColumn);
|
|
1831
1812
|
const columnFilterDefinition = (_a = tableColumn === null || tableColumn === void 0 ? void 0 : tableColumn.filterDefinition) !== null && _a !== void 0 ? _a : null;
|
|
1832
|
-
console.log('3. addColumnFilter');
|
|
1833
|
-
console.log(columnFilterDefinition);
|
|
1834
1813
|
if (!columnFilterDefinition) {
|
|
1835
1814
|
return;
|
|
1836
1815
|
}
|
|
1837
|
-
console.log('4. addColumnFilter');
|
|
1838
|
-
console.log('tableColumn');
|
|
1839
|
-
console.log(tableColumn);
|
|
1840
|
-
console.log({ columnValues, operator });
|
|
1841
|
-
console.log('5. Adicionando filtro');
|
|
1842
1816
|
tableColumn && tableColumn.addFilter(columnValues, operator);
|
|
1843
|
-
console.log('4. updateVisibleRecords');
|
|
1844
1817
|
this.updateVisibleRecords();
|
|
1845
1818
|
}
|
|
1846
1819
|
removeColumnFilter(columnName) {
|