tuain-ng-forms-lib 12.0.64 → 12.0.68
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/bundles/tuain-ng-forms-lib.umd.js +48 -32
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/form.constants.js +11 -11
- package/esm2015/lib/classes/forms/table/column.js +14 -1
- package/esm2015/lib/classes/forms/table/row-data.js +4 -4
- package/esm2015/lib/classes/forms/table/table.js +13 -15
- package/esm2015/lib/components/elements/tables/table.component.js +7 -6
- package/fesm2015/tuain-ng-forms-lib.js +44 -32
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/form.constants.d.ts +3 -3
- package/lib/classes/forms/table/column.d.ts +3 -0
- package/lib/classes/forms/table/table.d.ts +3 -2
- package/lib/components/elements/tables/table.component.d.ts +3 -3
- package/package.json +1 -1
|
@@ -718,18 +718,22 @@
|
|
|
718
718
|
LibTableComponent.prototype.toggleSelectAll = function () { return (this.allSelected) ? this.table.unSelectAll() : this.table.selectAll(); };
|
|
719
719
|
LibTableComponent.prototype.globalFilterCompleted = function () { this.changePage(1); };
|
|
720
720
|
LibTableComponent.prototype.changePage = function (requestedPage) { this.table.changePage(requestedPage); };
|
|
721
|
-
LibTableComponent.prototype.tableColumnSort = function (columnName) {
|
|
721
|
+
LibTableComponent.prototype.tableColumnSort = function (columnName, direction) {
|
|
722
|
+
if (direction === void 0) { direction = null; }
|
|
723
|
+
this.table.sort(columnName, direction !== null && direction !== void 0 ? direction : 'ascend');
|
|
724
|
+
};
|
|
722
725
|
LibTableComponent.prototype.globalFilterChanged = function () { var _a, _b; this.table.setGlobalFilterString((_b = (_a = this.globalFilterString) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : ''); };
|
|
723
726
|
LibTableComponent.prototype.syncAttribute = function (name, value) {
|
|
724
727
|
try {
|
|
725
728
|
this[name] = value;
|
|
729
|
+
return true;
|
|
726
730
|
}
|
|
727
|
-
catch (
|
|
728
|
-
|
|
731
|
+
catch (_a) {
|
|
732
|
+
return false;
|
|
729
733
|
}
|
|
730
734
|
};
|
|
731
|
-
LibTableComponent.prototype.filterHasChanged = function (
|
|
732
|
-
this.table.addColumnFilter(
|
|
735
|
+
LibTableComponent.prototype.filterHasChanged = function (column, values) {
|
|
736
|
+
this.table.addColumnFilter(column.fieldCode, values);
|
|
733
737
|
};
|
|
734
738
|
return LibTableComponent;
|
|
735
739
|
}());
|
|
@@ -762,16 +766,16 @@
|
|
|
762
766
|
validate: 'VALIDATE',
|
|
763
767
|
};
|
|
764
768
|
var operators = {
|
|
765
|
-
G: '
|
|
766
|
-
L: '
|
|
767
|
-
GE: '
|
|
768
|
-
LE: '
|
|
769
|
-
EQ: '
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
BETWEEN: '
|
|
774
|
-
IN: '
|
|
769
|
+
G: 'G',
|
|
770
|
+
L: 'L',
|
|
771
|
+
GE: 'GE',
|
|
772
|
+
LE: 'LE',
|
|
773
|
+
EQ: 'EQ',
|
|
774
|
+
NEQ: 'NEQ',
|
|
775
|
+
HAS: 'HAS',
|
|
776
|
+
NOTHAS: 'NOTHAS',
|
|
777
|
+
BETWEEN: 'BETWEEN',
|
|
778
|
+
IN: 'IN'
|
|
775
779
|
};
|
|
776
780
|
|
|
777
781
|
var FormElement = /** @class */ (function () {
|
|
@@ -1300,10 +1304,14 @@
|
|
|
1300
1304
|
this.fieldAlignment = (recTableColReceived.alignment != null) ? recTableColReceived.alignment.toLowerCase() : defaultTypeAlignment;
|
|
1301
1305
|
this.visible = (_a = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.visible) !== null && _a !== void 0 ? _a : true;
|
|
1302
1306
|
this.sortable = (_b = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.sortable) !== null && _b !== void 0 ? _b : false;
|
|
1307
|
+
this.sortDirections = (this.sortable) ? ['ascend', 'descend'] : [null];
|
|
1303
1308
|
this.fieldFormat = recTableColReceived.format || '';
|
|
1304
1309
|
this.customAttributes = (_c = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.customAttributes) !== null && _c !== void 0 ? _c : {};
|
|
1305
1310
|
}
|
|
1306
1311
|
}
|
|
1312
|
+
RecordTableColumn.prototype.hideFilter = function () {
|
|
1313
|
+
this.filterVisible = false;
|
|
1314
|
+
};
|
|
1307
1315
|
RecordTableColumn.prototype.addFilterDefinition = function (filterDefinition) {
|
|
1308
1316
|
var _a;
|
|
1309
1317
|
this.filterDef = {
|
|
@@ -1346,6 +1354,15 @@
|
|
|
1346
1354
|
enumerable: false,
|
|
1347
1355
|
configurable: true
|
|
1348
1356
|
});
|
|
1357
|
+
RecordTableColumn.prototype.serSortDirections = function (ascend, descend) {
|
|
1358
|
+
this.sortDirections = [];
|
|
1359
|
+
if (ascend) {
|
|
1360
|
+
this.sortDirections.unshift('ascend');
|
|
1361
|
+
}
|
|
1362
|
+
if (descend) {
|
|
1363
|
+
this.sortDirections.unshift('descend');
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1349
1366
|
return RecordTableColumn;
|
|
1350
1367
|
}());
|
|
1351
1368
|
|
|
@@ -1479,13 +1496,13 @@
|
|
|
1479
1496
|
if (operator === operators.EQ) {
|
|
1480
1497
|
return fieldValue === values[0];
|
|
1481
1498
|
}
|
|
1482
|
-
if (operator === operators.
|
|
1499
|
+
if (operator === operators.NEQ && fieldValue === values[0]) {
|
|
1483
1500
|
return false;
|
|
1484
1501
|
}
|
|
1485
|
-
if (operator === operators.
|
|
1502
|
+
if (operator === operators.HAS && !stringValue.includes(values[0].toString().toUpperCase())) {
|
|
1486
1503
|
return false;
|
|
1487
1504
|
}
|
|
1488
|
-
if (operator === operators.
|
|
1505
|
+
if (operator === operators.NOTHAS && stringValue.includes(values[0].toString().toUpperCase())) {
|
|
1489
1506
|
return false;
|
|
1490
1507
|
}
|
|
1491
1508
|
if (operator === operators.BETWEEN && (fieldValue < values[0] || fieldValue > values[1])) {
|
|
@@ -1846,6 +1863,11 @@
|
|
|
1846
1863
|
}
|
|
1847
1864
|
return filteredRecords;
|
|
1848
1865
|
};
|
|
1866
|
+
RecordTable.prototype.getColumnFilter = function (columnName) {
|
|
1867
|
+
var _a;
|
|
1868
|
+
var tableColumn = this.columnDefinition(columnName);
|
|
1869
|
+
return (_a = tableColumn === null || tableColumn === void 0 ? void 0 : tableColumn.filter) !== null && _a !== void 0 ? _a : null;
|
|
1870
|
+
};
|
|
1849
1871
|
RecordTable.prototype.addColumnFilter = function (columnName, columnValues, operator) {
|
|
1850
1872
|
if (operator === void 0) { operator = null; }
|
|
1851
1873
|
var _a;
|
|
@@ -1884,8 +1906,8 @@
|
|
|
1884
1906
|
configurable: true
|
|
1885
1907
|
});
|
|
1886
1908
|
// Ordenamiento de registros local
|
|
1887
|
-
RecordTable.prototype.sort = function (columnName) {
|
|
1888
|
-
this.setRequiredOrder(columnName);
|
|
1909
|
+
RecordTable.prototype.sort = function (columnName, direction) {
|
|
1910
|
+
this.setRequiredOrder(columnName, direction);
|
|
1889
1911
|
if (this.clientPaging) {
|
|
1890
1912
|
this.localSortData();
|
|
1891
1913
|
}
|
|
@@ -1893,18 +1915,12 @@
|
|
|
1893
1915
|
this.notifyGetDataAction();
|
|
1894
1916
|
}
|
|
1895
1917
|
};
|
|
1896
|
-
RecordTable.prototype.setRequiredOrder = function (columnField) {
|
|
1897
|
-
if (
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
}
|
|
1903
|
-
else {
|
|
1904
|
-
var tableSort = this.sorting;
|
|
1905
|
-
tableSort.direction = (tableSort.direction === TABLE_SORT_ASCENDING) ? TABLE_SORT_DESCENDING : TABLE_SORT_ASCENDING;
|
|
1906
|
-
this.setAttr('sorting', tableSort);
|
|
1907
|
-
}
|
|
1918
|
+
RecordTable.prototype.setRequiredOrder = function (columnField, direction) {
|
|
1919
|
+
if (direction === void 0) { direction = null; }
|
|
1920
|
+
this.setAttr('sorting', {
|
|
1921
|
+
columnName: columnField,
|
|
1922
|
+
direction: (direction === 'ascend') ? TABLE_SORT_ASCENDING : TABLE_SORT_DESCENDING,
|
|
1923
|
+
});
|
|
1908
1924
|
};
|
|
1909
1925
|
RecordTable.prototype.localSortData = function () {
|
|
1910
1926
|
var _this = this;
|