@universis/ngx-tables 6.13.3 → 6.13.4
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 +68 -3
- 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 +66 -2
- package/esm2015/lib/i18n/tables.el.js +3 -2
- package/esm2015/lib/i18n/tables.en.js +3 -2
- package/esm5/lib/components/advanced-table/advanced-table.component.js +71 -2
- package/esm5/lib/i18n/tables.el.js +3 -2
- package/esm5/lib/i18n/tables.en.js +3 -2
- package/fesm2015/universis-ngx-tables.js +64 -4
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +69 -4
- 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 +1 -0
- package/lib/i18n/tables.en.d.ts +1 -0
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -23,7 +23,7 @@ import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
|
|
|
23
23
|
import { GroupByPipe, NgPipesModule } from 'ngx-pipes';
|
|
24
24
|
import { template, at, cloneDeep, isEmpty } from 'lodash';
|
|
25
25
|
import { __extends, __awaiter, __generator, __values, __assign, __spread } from 'tslib';
|
|
26
|
-
import { Injectable, Directive, Optional, Input, Pipe, Component, EventEmitter, Output, ElementRef, ViewChild, ViewEncapsulation, NgModule, CUSTOM_ELEMENTS_SCHEMA, defineInjectable, inject, HostListener, ChangeDetectorRef, InjectionToken, Inject, Injector, ViewContainerRef
|
|
26
|
+
import { Injectable, Directive, Optional, Input, Pipe, Component, EventEmitter, Output, ElementRef, ViewChild, ViewEncapsulation, NgModule, CUSTOM_ELEMENTS_SCHEMA, defineInjectable, inject, HostListener, ChangeDetectionStrategy, ChangeDetectorRef, InjectionToken, Inject, Injector, ViewContainerRef } from '@angular/core';
|
|
27
27
|
import { ActivatedRoute, Router, NavigationStart, NavigationEnd, RouterModule } from '@angular/router';
|
|
28
28
|
import { createFeatureSelector, createSelector, select, Store } from '@ngrx/store';
|
|
29
29
|
import { skip, first, filter } from 'rxjs/operators';
|
|
@@ -1872,6 +1872,8 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1872
1872
|
this.beforeServerData = new EventEmitter();
|
|
1873
1873
|
this.afterServerData = new EventEmitter();
|
|
1874
1874
|
this.loading = new EventEmitter();
|
|
1875
|
+
this.showDetails = new EventEmitter();
|
|
1876
|
+
this.hideDetails = new EventEmitter();
|
|
1875
1877
|
this.scrollable = true;
|
|
1876
1878
|
this.serverSide = true;
|
|
1877
1879
|
this.lengthMenu = [50, 100, 200, 500];
|
|
@@ -2680,6 +2682,64 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
2680
2682
|
}
|
|
2681
2683
|
});
|
|
2682
2684
|
}
|
|
2685
|
+
// display row details
|
|
2686
|
+
if (this.detailsTemplate) {
|
|
2687
|
+
/** @type {?} */
|
|
2688
|
+
var detailsString_1 = this._translateService.instant('Tables.RowDetails');
|
|
2689
|
+
/** @type {?} */
|
|
2690
|
+
var firstColumn = this.config.columns[0];
|
|
2691
|
+
/** @type {?} */
|
|
2692
|
+
var showDetailsColumnDefinition = {
|
|
2693
|
+
className: 'details-control pl-4 pr-0',
|
|
2694
|
+
data: firstColumn.property || firstColumn.name,
|
|
2695
|
+
defaultContent: '',
|
|
2696
|
+
title: '',
|
|
2697
|
+
sortable: false,
|
|
2698
|
+
visible: !this.customSelect,
|
|
2699
|
+
name: firstColumn.name,
|
|
2700
|
+
render: function () {
|
|
2701
|
+
return "<button role=\"button\" title=\"" + detailsString_1 + "\" arial-label=\"" + detailsString_1 + "\"></button>";
|
|
2702
|
+
},
|
|
2703
|
+
};
|
|
2704
|
+
// and finally add column
|
|
2705
|
+
// and finally add column
|
|
2706
|
+
tableColumns_1.unshift(showDetailsColumnDefinition);
|
|
2707
|
+
// user interface additions
|
|
2708
|
+
// Add event listener for opening and closing details
|
|
2709
|
+
// user interface additions
|
|
2710
|
+
// Add event listener for opening and closing details
|
|
2711
|
+
tableElement_1.on('click', 'td.details-control', function (e) {
|
|
2712
|
+
/** @type {?} */
|
|
2713
|
+
var tr = e.target.closest('tr');
|
|
2714
|
+
/** @type {?} */
|
|
2715
|
+
var row = self.dataTable.row(tr);
|
|
2716
|
+
/** @type {?} */
|
|
2717
|
+
var container = document.createElement('div');
|
|
2718
|
+
/** @type {?} */
|
|
2719
|
+
var detailsViewRef = _this._viewContainerRef.createEmbeddedView(_this.detailsTemplate, {
|
|
2720
|
+
rowData: row.data(),
|
|
2721
|
+
});
|
|
2722
|
+
detailsViewRef.detectChanges();
|
|
2723
|
+
if (detailsViewRef.rootNodes.length !== 1) {
|
|
2724
|
+
throw new Error('DetailsTemplate must have exactly one root node.');
|
|
2725
|
+
}
|
|
2726
|
+
container.appendChild(detailsViewRef.rootNodes[0]);
|
|
2727
|
+
if (row.child.isShown()) {
|
|
2728
|
+
// This row is already open - close it
|
|
2729
|
+
// This row is already open - close it
|
|
2730
|
+
_this.hideDetails.emit();
|
|
2731
|
+
row.child.hide();
|
|
2732
|
+
detailsViewRef.destroy();
|
|
2733
|
+
}
|
|
2734
|
+
else {
|
|
2735
|
+
// Open this row
|
|
2736
|
+
// Open this row
|
|
2737
|
+
_this.showDetails.emit({ row: row });
|
|
2738
|
+
row.child(container).show();
|
|
2739
|
+
row.child().addClass('dt-child');
|
|
2740
|
+
}
|
|
2741
|
+
});
|
|
2742
|
+
}
|
|
2683
2743
|
/** @type {?} */
|
|
2684
2744
|
var settings = {
|
|
2685
2745
|
// set length menu
|
|
@@ -3681,7 +3741,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
3681
3741
|
selector: 'app-advanced-table',
|
|
3682
3742
|
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 ",
|
|
3683
3743
|
encapsulation: ViewEncapsulation.None,
|
|
3684
|
-
styles: ["div.dataTables_processing>div:last-child>div{background-color:var(--secondary)}table.dataTable thead .sorting{background-image:none}table.dataTable thead tr th{border-bottom:none;font-weight:500;font-size:.75rem}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 tbody tr.dtrg-group.dtrg-start th{border:2px solid #c2cfd6;border-bottom:1px solid #c2cfd6;color:#3e515b;background-color:#f0f3f5}table.dataTable tbody tr.dtrg-group.dtrg-end th{border-top:2px solid #c2cfd6;border-right:2px solid #c2cfd6;border-left:2px solid #c2cfd6;color:#3e515b;background-color:#f0f3f5}table.dataTable tbody tr:nth-last-child(1) th{border-bottom:2px 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}"]
|
|
3744
|
+
styles: ["div.dataTables_processing>div:last-child>div{background-color:var(--secondary)}table.dataTable thead .sorting{background-image:none}table.dataTable thead tr th{border-bottom:none;font-weight:500;font-size:.75rem}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 tbody tr.dtrg-group.dtrg-start th{border:2px solid #c2cfd6;border-bottom:1px solid #c2cfd6;color:#3e515b;background-color:#f0f3f5}table.dataTable tbody tr.dtrg-group.dtrg-end th{border-top:2px solid #c2cfd6;border-right:2px solid #c2cfd6;border-left:2px solid #c2cfd6;color:#3e515b;background-color:#f0f3f5}table.dataTable tbody tr:nth-last-child(1) th{border-bottom:2px 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}table.dataTable td.details-control{cursor:pointer}table.dataTable td.details-control button{border:none;background-color:inherit;outline:0}table.dataTable td.details-control button::after{content:'\\25B7'}table.dataTable tr.dt-hasChild td.details-control button::after{content:'\\25BD'}"]
|
|
3685
3745
|
}] }
|
|
3686
3746
|
];
|
|
3687
3747
|
/** @nocollapse */
|
|
@@ -3723,6 +3783,8 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
3723
3783
|
beforeServerData: [{ type: Output, args: ['beforeServerData',] }],
|
|
3724
3784
|
afterServerData: [{ type: Output, args: ['afterServerData',] }],
|
|
3725
3785
|
loading: [{ type: Output, args: ['loading',] }],
|
|
3786
|
+
showDetails: [{ type: Output, args: ['showDetails',] }],
|
|
3787
|
+
hideDetails: [{ type: Output, args: ['hideDetails',] }],
|
|
3726
3788
|
scrollable: [{ type: Input }],
|
|
3727
3789
|
serverSide: [{ type: Input }],
|
|
3728
3790
|
lengthMenu: [{ type: Input }],
|
|
@@ -3742,6 +3804,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
3742
3804
|
rowGroup: [{ type: Input }],
|
|
3743
3805
|
headerTemplate: [{ type: Input }],
|
|
3744
3806
|
footerTemplate: [{ type: Input }],
|
|
3807
|
+
detailsTemplate: [{ type: Input }],
|
|
3745
3808
|
header: [{ type: ViewChild, args: ['header',] }],
|
|
3746
3809
|
footer: [{ type: ViewChild, args: ['footer',] }],
|
|
3747
3810
|
config: [{ type: Input, args: ['config',] }],
|
|
@@ -7316,7 +7379,8 @@ var TABLES_EL = {
|
|
|
7316
7379
|
},
|
|
7317
7380
|
"ExportList": "Εξαγωγή λίστας",
|
|
7318
7381
|
"ExportLimitExceeded": "Το πλήθος των στοιχείων προς εξαγωγή ({{dataLength}}) ξεπερνάει το μέγιστο επιτρεπτό ({{exportLimit}}). Παρακαλούμε προσαρμόστε τα φίλτρα της αναζήτησης και προσπαθήστε ξανά.",
|
|
7319
|
-
"ExportResults": "Δεδομένα λίστας"
|
|
7382
|
+
"ExportResults": "Δεδομένα λίστας",
|
|
7383
|
+
"RowDetails": "Λεπτομέρειες"
|
|
7320
7384
|
},
|
|
7321
7385
|
"TrueFalse": {
|
|
7322
7386
|
"long": {
|
|
@@ -7447,7 +7511,8 @@ var TABLES_EN = {
|
|
|
7447
7511
|
},
|
|
7448
7512
|
"ExportList": "Export list",
|
|
7449
7513
|
"ExportLimitExceeded": "The number of items that are to be exported ({{dataLength}}) exceeds the export limit ({{exportLimit}}). Please apply more specific filters to the search.",
|
|
7450
|
-
"ExportResults": "Exported list"
|
|
7514
|
+
"ExportResults": "Exported list",
|
|
7515
|
+
"RowDetails": "Details"
|
|
7451
7516
|
},
|
|
7452
7517
|
"TrueFalse": {
|
|
7453
7518
|
"long": {
|