@universis/ngx-tables 0.8.0 → 0.8.2

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.
@@ -6,11 +6,12 @@ import { TableConfiguration } from './advanced-table.interfaces';
6
6
  import { ClientDataQueryable } from '@themost/client';
7
7
  import { AdvancedFilterValueProvider } from './advanced-filter-value-provider.service';
8
8
  import { BehaviorSubject } from 'rxjs';
9
- import { TemplatePipe, LoadingService } from '@universis/common';
9
+ import { TemplatePipe, LoadingService, ConfigurationService, ModalService, ErrorService, ExportSpreadsheetService } from '@universis/common';
10
10
  import { IAdvancedTableFormatters } from './advanced-table.formatters.interface';
11
11
  import 'datatables.net';
12
12
  import 'datatables.net-scroller';
13
13
  import 'datatables.net-colreorder';
14
+ import 'datatables.net-buttons';
14
15
  import { HttpClient } from '@angular/common/http';
15
16
  import { ColumnSelectorService } from '../column-selector/column-selector.service';
16
17
  export interface AdvancedTableDataResult {
@@ -19,6 +20,9 @@ export interface AdvancedTableDataResult {
19
20
  data: Array<any>;
20
21
  }
21
22
  export declare let COLUMN_FORMATTERS: InjectionToken<{}>;
23
+ export declare class ExportLimitExceededError extends RangeError {
24
+ constructor(message: string);
25
+ }
22
26
  export declare class AdvancedTableConfiguration {
23
27
  static cast(input: any, clone?: boolean): TableConfiguration;
24
28
  }
@@ -34,6 +38,10 @@ export declare class AdvancedTableComponent implements OnInit, OnDestroy, OnChan
34
38
  private _loading;
35
39
  private _http;
36
40
  private _columnSelector;
41
+ private _configuration;
42
+ private _exportSpreadsheet;
43
+ private _modalService;
44
+ private _errorService;
37
45
  private _query;
38
46
  private _config;
39
47
  private _firstLoad;
@@ -99,6 +107,7 @@ export declare class AdvancedTableComponent implements OnInit, OnDestroy, OnChan
99
107
  * Gets or sets table configuration
100
108
  */
101
109
  config: TableConfiguration;
110
+ readonly lastQueryTotalItems: number;
102
111
  /**
103
112
  * Indicates whether table footer will be visible or not
104
113
  */
@@ -119,8 +128,9 @@ export declare class AdvancedTableComponent implements OnInit, OnDestroy, OnChan
119
128
  dataTable: any;
120
129
  dtOptions: any;
121
130
  private lastQueryParams;
131
+ private _lastQueryTotalItems;
122
132
  private reloadSubscription;
123
- constructor(_context: AngularDataContext, _columnFormatters: IAdvancedTableFormatters, _activatedRoute: ActivatedRoute, _translateService: TranslateService, _injector: Injector, _advancedFilterValueProvider: AdvancedFilterValueProvider, _element: ElementRef, _template: TemplatePipe, _loading: LoadingService, _http: HttpClient, _columnSelector: ColumnSelectorService);
133
+ constructor(_context: AngularDataContext, _columnFormatters: IAdvancedTableFormatters, _activatedRoute: ActivatedRoute, _translateService: TranslateService, _injector: Injector, _advancedFilterValueProvider: AdvancedFilterValueProvider, _element: ElementRef, _template: TemplatePipe, _loading: LoadingService, _http: HttpClient, _columnSelector: ColumnSelectorService, _configuration: ConfigurationService, _exportSpreadsheet: ExportSpreadsheetService, _modalService: ModalService, _errorService: ErrorService);
124
134
  search(searchText: any): void;
125
135
  fetch(clearSelected?: boolean): void;
126
136
  destroy(): void;
@@ -168,4 +178,16 @@ export declare class AdvancedTableComponent implements OnInit, OnDestroy, OnChan
168
178
  ngOnChanges(changes: SimpleChanges): void;
169
179
  reset(load?: boolean): void;
170
180
  selectColumns(): void;
181
+ /**
182
+ *
183
+ * @param options to pass an errorHandler callback, if desired
184
+ * @returns void
185
+ */
186
+ exportView(options?: {
187
+ errorHandler?: (reason?: any) => any;
188
+ }): Promise<void>;
189
+ getExportableData(): {
190
+ body: any[];
191
+ header: any[];
192
+ };
171
193
  }
@@ -4,6 +4,12 @@ import { ConfigurationService, ErrorService, LoadingService } from '@universis/c
4
4
  import { TranslateService } from '@ngx-translate/core';
5
5
  import { ClientDataQueryable } from '@themost/client';
6
6
  import { TableConfiguration } from '../components/advanced-table/advanced-table.interfaces';
7
+ export declare const MAX_EXPORT_ITEMS = 500;
8
+ export declare interface ExportLimitConfiguration {
9
+ tables?: {
10
+ exportLimit?: number;
11
+ };
12
+ }
7
13
  export declare class BtnExpDirective {
8
14
  private _activatedTable;
9
15
  private _context;
@@ -82,6 +82,9 @@ export declare const TABLES_EL: {
82
82
  "Title": string;
83
83
  "Message": string;
84
84
  };
85
+ "ExportList": string;
86
+ "ExportLimitExceeded": string;
87
+ "ExportResults": string;
85
88
  };
86
89
  "TrueFalse": {
87
90
  "long": {
@@ -81,6 +81,9 @@ export declare const TABLES_EN: {
81
81
  "Title": string;
82
82
  "Message": string;
83
83
  };
84
+ "ExportList": string;
85
+ "ExportLimitExceeded": string;
86
+ "ExportResults": string;
84
87
  };
85
88
  "TrueFalse": {
86
89
  "long": {
@@ -1,9 +1,20 @@
1
1
  import { ActivatedRoute, Router } from '@angular/router';
2
2
  import { AdvancedTableComponent } from './components/advanced-table/advanced-table.component';
3
+ import { BehaviorSubject, Observable } from 'rxjs';
3
4
  export declare class ActivatedTableService {
4
5
  private _router;
5
6
  private _activatedRoute;
6
7
  private _activeTable;
8
+ /**
9
+ * Get the last table that was set as active
10
+ * Note: Emitted value may be null (e.g. reset on route changes)
11
+ */
12
+ readonly lastActiveTable: BehaviorSubject<AdvancedTableComponent | null>;
13
+ /**
14
+ * Omit the last emitted value to observe only new active table changes
15
+ * Note: Emitted value may be null (e.g. reset on route changes)
16
+ */
17
+ readonly nextActiveTable: Observable<AdvancedTableComponent | null>;
7
18
  constructor(_router: Router, _activatedRoute: ActivatedRoute);
8
19
  activeTable: AdvancedTableComponent;
9
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universis/ngx-tables",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "dependencies": {
5
5
  "datatables": "^1.10.18",
6
6
  "datatables.net": "1.10.24",
@@ -22,7 +22,7 @@
22
22
  "@ngrx/effects": "^6.1.2",
23
23
  "@ngrx/entity": "^6.1.2",
24
24
  "@ngrx/store": "^6.1.2",
25
- "@universis/common": "^1.2.10",
25
+ "@universis/common": "^1.5.9",
26
26
  "@universis/forms": "^0.5.6",
27
27
  "@universis/theme": "^1.1.5",
28
28
  "angular-formio": "^4.3.14",
@@ -31,8 +31,8 @@
31
31
  "lodash": "^4.17.4",
32
32
  "@ngx-translate/core": "^10.0.2",
33
33
  "@ngx-translate/http-loader": "^3.0.1",
34
- "@themost/angular": "^6.5.2",
35
- "@themost/client": "^2.5.3",
34
+ "@themost/angular": "~6.5.2",
35
+ "@themost/client": "~2.5.6",
36
36
  "ngx-bootstrap": "^3 || ^4 || ^5",
37
37
  "tslib": "^1.9.0"
38
38
  },