@universis/ngx-tables 0.7.29 → 0.8.0
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/universis-ngx-tables.umd.js +58 -10
- package/bundles/universis-ngx-tables.umd.js.map +1 -1
- package/bundles/universis-ngx-tables.umd.min.js +1 -1
- package/bundles/universis-ngx-tables.umd.min.js.map +1 -1
- package/esm2015/lib/components/advanced-table/advanced-table.component.js +60 -5
- package/esm2015/lib/i18n/tables.el.js +6 -2
- package/esm2015/lib/i18n/tables.en.js +6 -2
- package/esm5/lib/components/advanced-table/advanced-table.component.js +47 -6
- package/esm5/lib/i18n/tables.el.js +6 -2
- package/esm5/lib/i18n/tables.en.js +6 -2
- package/fesm2015/universis-ngx-tables.js +72 -10
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +58 -10
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/lib/components/advanced-table/advanced-table.component.d.ts +3 -0
- package/lib/i18n/tables.el.d.ts +4 -0
- package/lib/i18n/tables.en.d.ts +4 -0
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -1037,6 +1037,12 @@
|
|
|
1037
1037
|
ctx.oApi._fnProcessingDisplay(ctx, show);
|
|
1038
1038
|
});
|
|
1039
1039
|
});
|
|
1040
|
+
var ɵ0 = [];
|
|
1041
|
+
var EMPTY_DATASET = {
|
|
1042
|
+
recordsTotal: 0,
|
|
1043
|
+
recordsFiltered: 0,
|
|
1044
|
+
data: ɵ0,
|
|
1045
|
+
};
|
|
1040
1046
|
var TableTranslationChangeDetector = /** @class */ (function (_super) {
|
|
1041
1047
|
__extends(TableTranslationChangeDetector, _super);
|
|
1042
1048
|
function TableTranslationChangeDetector() {
|
|
@@ -1099,7 +1105,7 @@
|
|
|
1099
1105
|
this._http = _http;
|
|
1100
1106
|
this._columnSelector = _columnSelector;
|
|
1101
1107
|
this._firstLoad = true;
|
|
1102
|
-
this._showFooter =
|
|
1108
|
+
this._showFooter = false;
|
|
1103
1109
|
this._showHeader = true;
|
|
1104
1110
|
this._showPaging = false;
|
|
1105
1111
|
this._id = getRandomIdentifier();
|
|
@@ -1796,6 +1802,8 @@
|
|
|
1796
1802
|
return fnCallback(emptyDataSet);
|
|
1797
1803
|
}
|
|
1798
1804
|
}
|
|
1805
|
+
// reset error
|
|
1806
|
+
self.toggleError();
|
|
1799
1807
|
// get activated route params
|
|
1800
1808
|
var queryParams = self._activatedRoute.snapshot.queryParams;
|
|
1801
1809
|
// get columns
|
|
@@ -1876,7 +1884,7 @@
|
|
|
1876
1884
|
q.filter(expressions.join(' and '));
|
|
1877
1885
|
}
|
|
1878
1886
|
self.lastQueryParams = q.getParams();
|
|
1879
|
-
q.getList().then(function (items) {
|
|
1887
|
+
return q.getList().then(function (items) {
|
|
1880
1888
|
var dataSet = {
|
|
1881
1889
|
recordsTotal: items.total,
|
|
1882
1890
|
recordsFiltered: items.total,
|
|
@@ -1891,7 +1899,13 @@
|
|
|
1891
1899
|
return fnCallback(dataSet);
|
|
1892
1900
|
});
|
|
1893
1901
|
}).catch(function (err) {
|
|
1902
|
+
// log error to console
|
|
1894
1903
|
console.error('TABLES', err);
|
|
1904
|
+
// show error
|
|
1905
|
+
self.toggleError(err);
|
|
1906
|
+
// by returning empty dataset
|
|
1907
|
+
self.load.emit(EMPTY_DATASET);
|
|
1908
|
+
return fnCallback(EMPTY_DATASET);
|
|
1895
1909
|
});
|
|
1896
1910
|
}
|
|
1897
1911
|
self.lastQueryParams = q.getParams();
|
|
@@ -1909,7 +1923,13 @@
|
|
|
1909
1923
|
// return data
|
|
1910
1924
|
return fnCallback(dataSet);
|
|
1911
1925
|
}).catch(function (err) {
|
|
1926
|
+
// log error to console
|
|
1912
1927
|
console.error('TABLES', err);
|
|
1928
|
+
// show error
|
|
1929
|
+
self.toggleError(err);
|
|
1930
|
+
// by returning empty dataset
|
|
1931
|
+
self.load.emit(EMPTY_DATASET);
|
|
1932
|
+
return fnCallback(EMPTY_DATASET);
|
|
1913
1933
|
});
|
|
1914
1934
|
},
|
|
1915
1935
|
language: Object.assign({}, self.translator.transform('Tables.DataTable'), { emptyTable: ' ' }),
|
|
@@ -2142,9 +2162,28 @@
|
|
|
2142
2162
|
this.dataTable.context[0].oLanguage.sZeroRecords = this.emptyTable.nativeElement.innerHTML;
|
|
2143
2163
|
}
|
|
2144
2164
|
};
|
|
2165
|
+
AdvancedTableComponent.prototype.toggleError = function (err) {
|
|
2166
|
+
if (this.dataTable && this.dataTable.context[0]) {
|
|
2167
|
+
var innerMessage = this.errorTemplate.nativeElement.getElementsByTagName('small').item(0);
|
|
2168
|
+
if (err) {
|
|
2169
|
+
this.lastError = err;
|
|
2170
|
+
if (innerMessage) {
|
|
2171
|
+
innerMessage.innerHTML = err.error && err.error.message ? err.error.message : err.message;
|
|
2172
|
+
}
|
|
2173
|
+
this.dataTable.context[0].oLanguage.sEmptyTable =
|
|
2174
|
+
this.dataTable.context[0].oLanguage.sZeroRecords = this.errorTemplate.nativeElement.innerHTML;
|
|
2175
|
+
}
|
|
2176
|
+
else {
|
|
2177
|
+
if (innerMessage) {
|
|
2178
|
+
innerMessage.innerHTML = '';
|
|
2179
|
+
}
|
|
2180
|
+
this.dataTable.context[0].oLanguage.sEmptyTable = this.dataTable.context[0].oLanguage.sZeroRecords = '';
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
};
|
|
2145
2184
|
AdvancedTableComponent.prototype.clearEmptyTable = function () {
|
|
2146
2185
|
if (this.dataTable && this.dataTable.context[0]) {
|
|
2147
|
-
this.dataTable.context[0].oLanguage.sEmptyTable = '';
|
|
2186
|
+
this.dataTable.context[0].oLanguage.sEmptyTable = this.dataTable.context[0].oLanguage.sZeroRecords = '';
|
|
2148
2187
|
}
|
|
2149
2188
|
};
|
|
2150
2189
|
AdvancedTableComponent.prototype.export = function () {
|
|
@@ -2263,9 +2302,9 @@
|
|
|
2263
2302
|
{ type: i0.Component, args: [{
|
|
2264
2303
|
// tslint:disable-next-line: component-selector
|
|
2265
2304
|
selector: 'app-advanced-table',
|
|
2266
|
-
template: "\n <table #table class=\"dataTable\">\n </table>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n </div>\n </div>\n ",
|
|
2305
|
+
template: "\n <table #table class=\"dataTable\">\n </table>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n </div>\n </div>\n <div #errorTemplate class=\"d-none error-message\">\n <div class=\"text-center\">\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-danger border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-secondary\" [translate]=\"'Tables.DataError.Title'\"></h4>\n <p class=\"font-lg text-secondary mb-1\" [translate]=\"'Tables.DataError.Message'\"></p>\n <p class=\"font-lg text-secondary error-inner-message\">\n <small></small>\n </p>\n </div>\n </div>\n </div>\n ",
|
|
2267
2306
|
encapsulation: i0.ViewEncapsulation.None,
|
|
2268
|
-
styles: ["table.dataTable thead .sorting{background-image:none}table.dataTable thead .sorting_asc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEtJREFUKJFjYBgywAOKMQALFjE/BgaGTCibjYGBYRM+kz0ZGBh2MTAw8DAwMHAxMDBsY2BgCCBGMQzg1IRNMV5NuVAJXIALqmYwAgBBkAlPRCLcLwAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAArzAAAK8wHvFRX1AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAFNJREFUKJHVzTEKgDAQRNGHZfBg2sSTeDMLKwXPYuVJbBKQQEyrH6bZ+cPyWWaElz4kR5cOJ1b0FXnBVRYjjmIUsGGqvX6OmnImYk+JLTkzpPyBGwrtCvfBe56nAAAAAElFTkSuQmCC)}table.dataTable thead th{color:#73818e;font-size:.75rem;font-weight:600;padding-top:16px;padding-bottom:4px;border-bottom:none;padding-left:8px}table.dataTable tbody tr:first-child td:first-child{border-radius:6px 0}table.dataTable tbody tr:first-child td:last-child{border-radius:0 6px}table.dataTable tbody tr{border-radius:6px}table.dataTable tbody tr td:first-child{border-left:1px solid #c2cfd6}table.dataTable tbody tr td:last-child{border-right:1px solid #c2cfd6}table.dataTable tbody tr td{padding-top:8px;padding-bottom:8px;border-top:1px solid #c2cfd6}table.dataTable tbody tr:last-child td:first-child{border-radius:0 0 0 6px}table.dataTable tbody tr:last-child td:last-child{border-radius:0 0 6px}table.dataTable tbody tr:last-child td{border-bottom:1px solid #c2cfd6}table.dataTable td.dataTables_empty{border:none!important}table.dataTable.no-footer{border-bottom:none}.dataTables_paginate .btn.previous{margin-right:8px}.dataTables_paginate .btn.next{margin-left:8px}.dataTables_info,.dataTables_paginate{margin-top:1rem}.dataTables_paginate span .btn{border-radius:1.5rem}.dataTables_filter{display:none}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:0;overflow:auto}.dataTables_paginate{display:none}.dataTable.processing{opacity:15%}.dataTables_wrapper .dataTables_processing{background:0 0;position:absolute;display:inline-block;top:25%;z-index:5;color:#73818e}.text-decoration-line-through{text-decoration:line-through!important}tr.removed .checkbox+label{visibility:hidden}"]
|
|
2307
|
+
styles: ["table.dataTable thead .sorting{background-image:none}table.dataTable thead .sorting_asc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEtJREFUKJFjYBgywAOKMQALFjE/BgaGTCibjYGBYRM+kz0ZGBh2MTAw8DAwMHAxMDBsY2BgCCBGMQzg1IRNMV5NuVAJXIALqmYwAgBBkAlPRCLcLwAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAArzAAAK8wHvFRX1AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAFNJREFUKJHVzTEKgDAQRNGHZfBg2sSTeDMLKwXPYuVJbBKQQEyrH6bZ+cPyWWaElz4kR5cOJ1b0FXnBVRYjjmIUsGGqvX6OmnImYk+JLTkzpPyBGwrtCvfBe56nAAAAAElFTkSuQmCC)}table.dataTable thead th{color:#73818e;font-size:.75rem;font-weight:600;padding-top:16px;padding-bottom:4px;border-bottom:none;padding-left:8px}table.dataTable tbody tr:first-child td:first-child{border-radius:6px 0}table.dataTable tbody tr:first-child td:last-child{border-radius:0 6px}table.dataTable tbody tr{border-radius:6px}table.dataTable tbody tr td:first-child{border-left:1px solid #c2cfd6}table.dataTable tbody tr td:last-child{border-right:1px solid #c2cfd6}table.dataTable tbody tr td{padding-top:8px;padding-bottom:8px;border-top:1px solid #c2cfd6}table.dataTable tbody tr:last-child td:first-child{border-radius:0 0 0 6px}table.dataTable tbody tr:last-child td:last-child{border-radius:0 0 6px}table.dataTable tbody tr:last-child td{border-bottom:1px solid #c2cfd6}table.dataTable td.dataTables_empty{border:none!important}table.dataTable .error-inner-message>small{overflow-wrap:break-word}table.dataTable.no-footer{border-bottom:none}.dataTables_paginate .btn.previous{margin-right:8px}.dataTables_paginate .btn.next{margin-left:8px}.dataTables_info,.dataTables_paginate{margin-top:1rem}.dataTables_paginate span .btn{border-radius:1.5rem}.dataTables_filter{display:none}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:0;overflow:auto}.dataTables_paginate{display:none}.dataTable.processing{opacity:15%}.dataTables_wrapper .dataTables_processing{background:0 0;position:absolute;display:inline-block;top:25%;z-index:5;color:#73818e}.text-decoration-line-through{text-decoration:line-through!important}tr.removed .checkbox+label{visibility:hidden}"]
|
|
2269
2308
|
}] }
|
|
2270
2309
|
];
|
|
2271
2310
|
/** @nocollapse */
|
|
@@ -2287,6 +2326,7 @@
|
|
|
2287
2326
|
AdvancedTableComponent.propDecorators = {
|
|
2288
2327
|
table: [{ type: i0.ViewChild, args: ['table',] }],
|
|
2289
2328
|
emptyTable: [{ type: i0.ViewChild, args: ['emptyTable',] }],
|
|
2329
|
+
errorTemplate: [{ type: i0.ViewChild, args: ['errorTemplate',] }],
|
|
2290
2330
|
loadingTable: [{ type: i0.ViewChild, args: ['loadingTable',] }],
|
|
2291
2331
|
height: [{ type: i0.Input }],
|
|
2292
2332
|
showActions: [{ type: i0.Input }],
|
|
@@ -5196,7 +5236,11 @@
|
|
|
5196
5236
|
"MoveColumnHelp": "Χρησιμοποιήστε τα πλήκτρα 'Επάνω' και 'Κάτω' για να αλλάξετε την σειρά εμφάνισης των στηλών του πίνακα.",
|
|
5197
5237
|
"UnknownColumn": "Άγνωστο",
|
|
5198
5238
|
"SelectColumn": "Επιλογή",
|
|
5199
|
-
"ActionLinkColumn": "Ενέργειες"
|
|
5239
|
+
"ActionLinkColumn": "Ενέργειες",
|
|
5240
|
+
"DataError": {
|
|
5241
|
+
"Title": "Σφάλμα κατά την παραλαβή των δεδομένων",
|
|
5242
|
+
"Message": "Συνέβη σφάλμα κατά την παραλαβή των δεδομένων. Προσπαθήστε ξανά ή τροποποιήστε τα στοιχεία αναζήτησης."
|
|
5243
|
+
}
|
|
5200
5244
|
},
|
|
5201
5245
|
"TrueFalse": {
|
|
5202
5246
|
"long": {
|
|
@@ -5315,7 +5359,11 @@
|
|
|
5315
5359
|
"MoveColumnHelp": "Use 'Move up' and 'Move down' buttons to change column order.",
|
|
5316
5360
|
"UnknownColumn": "Unknown",
|
|
5317
5361
|
"SelectColumn": "Select",
|
|
5318
|
-
"ActionLinkColumn": "Actions"
|
|
5362
|
+
"ActionLinkColumn": "Actions",
|
|
5363
|
+
"DataError": {
|
|
5364
|
+
"Title": "Error while getting data",
|
|
5365
|
+
"Message": "An error occurred while getting data. Please try again or change your criteria."
|
|
5366
|
+
}
|
|
5319
5367
|
},
|
|
5320
5368
|
"TrueFalse": {
|
|
5321
5369
|
"long": {
|
|
@@ -5637,7 +5685,7 @@
|
|
|
5637
5685
|
return AdvancedSearchRouterState;
|
|
5638
5686
|
}(AdvancedSearchState));
|
|
5639
5687
|
|
|
5640
|
-
var ɵ0 = FORMATTERS;
|
|
5688
|
+
var ɵ0$1 = FORMATTERS;
|
|
5641
5689
|
var TablesModule = /** @class */ (function () {
|
|
5642
5690
|
function TablesModule(_translateService) {
|
|
5643
5691
|
this._translateService = _translateService;
|
|
@@ -5675,7 +5723,7 @@
|
|
|
5675
5723
|
providers: [common.DatePipe, i2.TemplatePipe,
|
|
5676
5724
|
{
|
|
5677
5725
|
provide: COLUMN_FORMATTERS,
|
|
5678
|
-
useValue: ɵ0
|
|
5726
|
+
useValue: ɵ0$1
|
|
5679
5727
|
},
|
|
5680
5728
|
AdvancedTableConfigurationResolver,
|
|
5681
5729
|
AdvancedSearchConfigurationResolver,
|
|
@@ -5783,6 +5831,7 @@
|
|
|
5783
5831
|
exports.COLUMN_FORMATTERS = COLUMN_FORMATTERS;
|
|
5784
5832
|
exports.AdvancedTableConfiguration = AdvancedTableConfiguration;
|
|
5785
5833
|
exports.AdvancedTableComponent = AdvancedTableComponent;
|
|
5834
|
+
exports.ɵ0 = ɵ0;
|
|
5786
5835
|
exports.AdvancedTableSettingsComponent = AdvancedTableSettingsComponent;
|
|
5787
5836
|
exports.AdvancedTableSearchBaseComponent = AdvancedTableSearchBaseComponent;
|
|
5788
5837
|
exports.AdvancedTableSearchComponent = AdvancedTableSearchComponent;
|
|
@@ -5802,7 +5851,6 @@
|
|
|
5802
5851
|
exports.ParseTitlePipe = ParseTitlePipe;
|
|
5803
5852
|
exports.AdvancedAggregatorService = AdvancedAggregatorService;
|
|
5804
5853
|
exports.TablesModule = TablesModule;
|
|
5805
|
-
exports.ɵ0 = ɵ0;
|
|
5806
5854
|
exports.ActivatedTableService = ActivatedTableService;
|
|
5807
5855
|
exports.ColumnSelectorService = ColumnSelectorService;
|
|
5808
5856
|
exports.ColumnSelectorComponent = ColumnSelectorComponent;
|