@universis/ngx-tables 6.13.2 → 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.
@@ -2081,7 +2081,11 @@
2081
2081
  this.order = new i0.EventEmitter();
2082
2082
  this.scroll = new i0.EventEmitter();
2083
2083
  this.selectedItems = new i0.EventEmitter();
2084
+ this.beforeServerData = new i0.EventEmitter();
2085
+ this.afterServerData = new i0.EventEmitter();
2084
2086
  this.loading = new i0.EventEmitter();
2087
+ this.showDetails = new i0.EventEmitter();
2088
+ this.hideDetails = new i0.EventEmitter();
2085
2089
  this.scrollable = true;
2086
2090
  this.serverSide = true;
2087
2091
  this.lengthMenu = [50, 100, 200, 500];
@@ -2877,6 +2881,64 @@
2877
2881
  }
2878
2882
  });
2879
2883
  }
2884
+ // display row details
2885
+ if (this.detailsTemplate) {
2886
+ /** @type {?} */
2887
+ var detailsString_1 = this._translateService.instant('Tables.RowDetails');
2888
+ /** @type {?} */
2889
+ var firstColumn = this.config.columns[0];
2890
+ /** @type {?} */
2891
+ var showDetailsColumnDefinition = {
2892
+ className: 'details-control pl-4 pr-0',
2893
+ data: firstColumn.property || firstColumn.name,
2894
+ defaultContent: '',
2895
+ title: '',
2896
+ sortable: false,
2897
+ visible: !this.customSelect,
2898
+ name: firstColumn.name,
2899
+ render: function () {
2900
+ return "<button role=\"button\" title=\"" + detailsString_1 + "\" arial-label=\"" + detailsString_1 + "\"></button>";
2901
+ },
2902
+ };
2903
+ // and finally add column
2904
+ // and finally add column
2905
+ tableColumns_1.unshift(showDetailsColumnDefinition);
2906
+ // user interface additions
2907
+ // Add event listener for opening and closing details
2908
+ // user interface additions
2909
+ // Add event listener for opening and closing details
2910
+ tableElement_1.on('click', 'td.details-control', function (e) {
2911
+ /** @type {?} */
2912
+ var tr = e.target.closest('tr');
2913
+ /** @type {?} */
2914
+ var row = self.dataTable.row(tr);
2915
+ /** @type {?} */
2916
+ var container = document.createElement('div');
2917
+ /** @type {?} */
2918
+ var detailsViewRef = _this._viewContainerRef.createEmbeddedView(_this.detailsTemplate, {
2919
+ rowData: row.data(),
2920
+ });
2921
+ detailsViewRef.detectChanges();
2922
+ if (detailsViewRef.rootNodes.length !== 1) {
2923
+ throw new Error('DetailsTemplate must have exactly one root node.');
2924
+ }
2925
+ container.appendChild(detailsViewRef.rootNodes[0]);
2926
+ if (row.child.isShown()) {
2927
+ // This row is already open - close it
2928
+ // This row is already open - close it
2929
+ _this.hideDetails.emit();
2930
+ row.child.hide();
2931
+ detailsViewRef.destroy();
2932
+ }
2933
+ else {
2934
+ // Open this row
2935
+ // Open this row
2936
+ _this.showDetails.emit({ row: row });
2937
+ row.child(container).show();
2938
+ row.child().addClass('dt-child');
2939
+ }
2940
+ });
2941
+ }
2880
2942
  /** @type {?} */
2881
2943
  var settings = {
2882
2944
  // set length menu
@@ -3100,8 +3162,10 @@
3100
3162
  }
3101
3163
  q.filter(expressions.join(' and '));
3102
3164
  }
3165
+ self.beforeServerData.emit(q);
3103
3166
  self.lastQueryParams = q.getParams();
3104
3167
  return q.getList().then(function (items) {
3168
+ self.afterServerData.emit(items);
3105
3169
  /** @type {?} */
3106
3170
  var dataSet = {
3107
3171
  recordsTotal: items.total,
@@ -3128,8 +3192,10 @@
3128
3192
  return fnCallback(EMPTY_DATASET);
3129
3193
  });
3130
3194
  }
3195
+ self.beforeServerData.emit(q);
3131
3196
  self.lastQueryParams = q.getParams();
3132
3197
  q.getList().then(function (items) {
3198
+ self.afterServerData.emit(items);
3133
3199
  /** @type {?} */
3134
3200
  var dataSet = {
3135
3201
  recordsTotal: items.total,
@@ -3873,7 +3939,7 @@
3873
3939
  selector: 'app-advanced-table',
3874
3940
  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 ",
3875
3941
  encapsulation: i0.ViewEncapsulation.None,
3876
- 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}"]
3942
+ 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'}"]
3877
3943
  }] }
3878
3944
  ];
3879
3945
  /** @nocollapse */
@@ -3914,7 +3980,11 @@
3914
3980
  order: [{ type: i0.Output, args: ['order',] }],
3915
3981
  scroll: [{ type: i0.Output, args: ['scroll',] }],
3916
3982
  selectedItems: [{ type: i0.Output, args: ['selectedItems',] }],
3983
+ beforeServerData: [{ type: i0.Output, args: ['beforeServerData',] }],
3984
+ afterServerData: [{ type: i0.Output, args: ['afterServerData',] }],
3917
3985
  loading: [{ type: i0.Output, args: ['loading',] }],
3986
+ showDetails: [{ type: i0.Output, args: ['showDetails',] }],
3987
+ hideDetails: [{ type: i0.Output, args: ['hideDetails',] }],
3918
3988
  scrollable: [{ type: i0.Input }],
3919
3989
  serverSide: [{ type: i0.Input }],
3920
3990
  lengthMenu: [{ type: i0.Input }],
@@ -3934,6 +4004,7 @@
3934
4004
  rowGroup: [{ type: i0.Input }],
3935
4005
  headerTemplate: [{ type: i0.Input }],
3936
4006
  footerTemplate: [{ type: i0.Input }],
4007
+ detailsTemplate: [{ type: i0.Input }],
3937
4008
  header: [{ type: i0.ViewChild, args: ['header',] }],
3938
4009
  footer: [{ type: i0.ViewChild, args: ['footer',] }],
3939
4010
  config: [{ type: i0.Input, args: ['config',] }],
@@ -7559,7 +7630,8 @@
7559
7630
  },
7560
7631
  "ExportList": "Εξαγωγή λίστας",
7561
7632
  "ExportLimitExceeded": "Το πλήθος των στοιχείων προς εξαγωγή ({{dataLength}}) ξεπερνάει το μέγιστο επιτρεπτό ({{exportLimit}}). Παρακαλούμε προσαρμόστε τα φίλτρα της αναζήτησης και προσπαθήστε ξανά.",
7562
- "ExportResults": "Δεδομένα λίστας"
7633
+ "ExportResults": "Δεδομένα λίστας",
7634
+ "RowDetails": "Λεπτομέρειες"
7563
7635
  },
7564
7636
  "TrueFalse": {
7565
7637
  "long": {
@@ -7690,7 +7762,8 @@
7690
7762
  },
7691
7763
  "ExportList": "Export list",
7692
7764
  "ExportLimitExceeded": "The number of items that are to be exported ({{dataLength}}) exceeds the export limit ({{exportLimit}}). Please apply more specific filters to the search.",
7693
- "ExportResults": "Exported list"
7765
+ "ExportResults": "Exported list",
7766
+ "RowDetails": "Details"
7694
7767
  },
7695
7768
  "TrueFalse": {
7696
7769
  "long": {