tuain-ng-forms-lib 12.0.63 → 12.0.67
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 +29 -15
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/table/column.js +13 -1
- package/esm2015/lib/classes/forms/table/table.js +13 -15
- package/esm2015/lib/components/elements/tables/table.component.js +2 -2
- package/fesm2015/tuain-ng-forms-lib.js +25 -15
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- 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 +1 -1
- package/package.json +1 -1
|
@@ -718,7 +718,10 @@
|
|
|
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 {
|
|
@@ -1288,6 +1291,8 @@
|
|
|
1288
1291
|
var RecordTableColumn = /** @class */ (function () {
|
|
1289
1292
|
function RecordTableColumn(recTableColReceived, formConfig) {
|
|
1290
1293
|
var _a, _b, _c;
|
|
1294
|
+
// Filtros
|
|
1295
|
+
this.filterVisible = false;
|
|
1291
1296
|
this._formConfig = formConfig;
|
|
1292
1297
|
this.filterDef = null;
|
|
1293
1298
|
if (recTableColReceived) {
|
|
@@ -1298,6 +1303,7 @@
|
|
|
1298
1303
|
this.fieldAlignment = (recTableColReceived.alignment != null) ? recTableColReceived.alignment.toLowerCase() : defaultTypeAlignment;
|
|
1299
1304
|
this.visible = (_a = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.visible) !== null && _a !== void 0 ? _a : true;
|
|
1300
1305
|
this.sortable = (_b = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.sortable) !== null && _b !== void 0 ? _b : false;
|
|
1306
|
+
this.sortDirections = (this.sortable) ? ['ascend', 'descend', null] : [null];
|
|
1301
1307
|
this.fieldFormat = recTableColReceived.format || '';
|
|
1302
1308
|
this.customAttributes = (_c = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.customAttributes) !== null && _c !== void 0 ? _c : {};
|
|
1303
1309
|
}
|
|
@@ -1344,6 +1350,15 @@
|
|
|
1344
1350
|
enumerable: false,
|
|
1345
1351
|
configurable: true
|
|
1346
1352
|
});
|
|
1353
|
+
RecordTableColumn.prototype.serSortDirections = function (ascend, descend) {
|
|
1354
|
+
this.sortDirections = [null];
|
|
1355
|
+
if (ascend) {
|
|
1356
|
+
this.sortDirections.unshift('ascend');
|
|
1357
|
+
}
|
|
1358
|
+
if (descend) {
|
|
1359
|
+
this.sortDirections.unshift('descend');
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1347
1362
|
return RecordTableColumn;
|
|
1348
1363
|
}());
|
|
1349
1364
|
|
|
@@ -1844,6 +1859,11 @@
|
|
|
1844
1859
|
}
|
|
1845
1860
|
return filteredRecords;
|
|
1846
1861
|
};
|
|
1862
|
+
RecordTable.prototype.getColumnFilter = function (columnName) {
|
|
1863
|
+
var _a;
|
|
1864
|
+
var tableColumn = this.columnDefinition(columnName);
|
|
1865
|
+
return (_a = tableColumn === null || tableColumn === void 0 ? void 0 : tableColumn.filter) !== null && _a !== void 0 ? _a : null;
|
|
1866
|
+
};
|
|
1847
1867
|
RecordTable.prototype.addColumnFilter = function (columnName, columnValues, operator) {
|
|
1848
1868
|
if (operator === void 0) { operator = null; }
|
|
1849
1869
|
var _a;
|
|
@@ -1882,8 +1902,8 @@
|
|
|
1882
1902
|
configurable: true
|
|
1883
1903
|
});
|
|
1884
1904
|
// Ordenamiento de registros local
|
|
1885
|
-
RecordTable.prototype.sort = function (columnName) {
|
|
1886
|
-
this.setRequiredOrder(columnName);
|
|
1905
|
+
RecordTable.prototype.sort = function (columnName, direction) {
|
|
1906
|
+
this.setRequiredOrder(columnName, direction);
|
|
1887
1907
|
if (this.clientPaging) {
|
|
1888
1908
|
this.localSortData();
|
|
1889
1909
|
}
|
|
@@ -1891,18 +1911,12 @@
|
|
|
1891
1911
|
this.notifyGetDataAction();
|
|
1892
1912
|
}
|
|
1893
1913
|
};
|
|
1894
|
-
RecordTable.prototype.setRequiredOrder = function (columnField) {
|
|
1895
|
-
if (
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
}
|
|
1901
|
-
else {
|
|
1902
|
-
var tableSort = this.sorting;
|
|
1903
|
-
tableSort.direction = (tableSort.direction === TABLE_SORT_ASCENDING) ? TABLE_SORT_DESCENDING : TABLE_SORT_ASCENDING;
|
|
1904
|
-
this.setAttr('sorting', tableSort);
|
|
1905
|
-
}
|
|
1914
|
+
RecordTable.prototype.setRequiredOrder = function (columnField, direction) {
|
|
1915
|
+
if (direction === void 0) { direction = null; }
|
|
1916
|
+
this.setAttr('sorting', {
|
|
1917
|
+
columnName: columnField,
|
|
1918
|
+
direction: (direction === 'ascend') ? TABLE_SORT_ASCENDING : TABLE_SORT_DESCENDING,
|
|
1919
|
+
});
|
|
1906
1920
|
};
|
|
1907
1921
|
RecordTable.prototype.localSortData = function () {
|
|
1908
1922
|
var _this = this;
|