tuain-ng-forms-lib 12.0.68 → 12.0.72

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.
@@ -775,7 +775,7 @@
775
775
  HAS: 'HAS',
776
776
  NOTHAS: 'NOTHAS',
777
777
  BETWEEN: 'BETWEEN',
778
- IN: 'IN'
778
+ IN: 'IN',
779
779
  };
780
780
 
781
781
  var FormElement = /** @class */ (function () {
@@ -1490,7 +1490,7 @@
1490
1490
  if (operator === operators.LE && fieldValue > values[0]) {
1491
1491
  return false;
1492
1492
  }
1493
- if (operator === operators.IN && !values.include(fieldValue)) {
1493
+ if (operator === operators.IN && !values.includes(fieldValue)) {
1494
1494
  return false;
1495
1495
  }
1496
1496
  if (operator === operators.EQ) {
@@ -1555,6 +1555,7 @@
1555
1555
  _this._actionsObj = {};
1556
1556
  _this.tableRecords = [];
1557
1557
  _this.globalSearch = false;
1558
+ _this.restrictedId = null;
1558
1559
  _this.tableTitle = tableReceived.tableTitle;
1559
1560
  _this._appendPages = (_a = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.append) !== null && _a !== void 0 ? _a : false;
1560
1561
  _this.selectable = (_b = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.selectable) !== null && _b !== void 0 ? _b : false;
@@ -1619,7 +1620,7 @@
1619
1620
  // Filtros predefinidos en el formulario
1620
1621
  if (tableReceived.filters) {
1621
1622
  for (var index = 0; index < tableReceived.filters.length; index++) {
1622
- _this.addFilterDefinition(tableReceived.filters[index]);
1623
+ _this.addFilterDefinition(tableReceived.filters[index].fieldCode, tableReceived.filters[index]);
1623
1624
  }
1624
1625
  }
1625
1626
  return _this;
@@ -1840,6 +1841,20 @@
1840
1841
  });
1841
1842
  };
1842
1843
  // Filtros
1844
+ RecordTable.prototype.setFilterById = function (id) {
1845
+ if (this.restrictedId === id) {
1846
+ return;
1847
+ }
1848
+ this.restrictedId = id;
1849
+ this.updateVisibleRecords();
1850
+ };
1851
+ RecordTable.prototype.cleanIdFilter = function () {
1852
+ if (this.restrictedId === null) {
1853
+ return;
1854
+ }
1855
+ this.restrictedId = null;
1856
+ this.updateVisibleRecords();
1857
+ };
1843
1858
  RecordTable.prototype.setGlobalFilterString = function (text) {
1844
1859
  var _a;
1845
1860
  this.globalFilterStrings = (_a = text.split(' ').filter(function (t) { return t && t.trim().length > 0; }).map(function (t) { return t.trim(); })) !== null && _a !== void 0 ? _a : [];
@@ -1847,13 +1862,16 @@
1847
1862
  this.changePage(1);
1848
1863
  }
1849
1864
  };
1850
- RecordTable.prototype.addFilterDefinition = function (filterDefinition) {
1851
- var tableColumn = this.columnDefinition(filterDefinition.fieldCode);
1865
+ RecordTable.prototype.addFilterDefinition = function (columnName, filterDefinition) {
1866
+ var tableColumn = this.columnDefinition(columnName);
1852
1867
  tableColumn && tableColumn.addFilterDefinition(filterDefinition);
1853
1868
  };
1854
1869
  RecordTable.prototype.getFilteredRecords = function () {
1855
1870
  var _this = this;
1856
1871
  var filteredRecords = this.tableRecords;
1872
+ if (this.restrictedId) {
1873
+ filteredRecords = filteredRecords.filter(function (record) { return record.recordId === _this.restrictedId; });
1874
+ }
1857
1875
  if (this.globalFilterStrings.length > 0) {
1858
1876
  filteredRecords = filteredRecords.filter(function (record) { return record.hasPattern(_this.globalFilterStrings); });
1859
1877
  }