@universis/ngx-tables 0.6.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.
Files changed (103) hide show
  1. package/LICENSE +163 -0
  2. package/README.md +121 -0
  3. package/bundles/universis-ngx-tables.umd.js +4591 -0
  4. package/bundles/universis-ngx-tables.umd.js.map +1 -0
  5. package/bundles/universis-ngx-tables.umd.min.js +2 -0
  6. package/bundles/universis-ngx-tables.umd.min.js.map +1 -0
  7. package/esm2015/lib/components/add-items/add-items.component.js +142 -0
  8. package/esm2015/lib/components/advanced-aggregator/advanced-aggregator.component.js +120 -0
  9. package/esm2015/lib/components/advanced-aggregator-list/advanced-aggregator-list.component.js +53 -0
  10. package/esm2015/lib/components/advanced-list/advanced-list.component.js +173 -0
  11. package/esm2015/lib/components/advanced-row-action/advanced-row-action.component.js +175 -0
  12. package/esm2015/lib/components/advanced-search-form/advanced-search-form.component.js +134 -0
  13. package/esm2015/lib/components/advanced-select/advanced-select.component.js +51 -0
  14. package/esm2015/lib/components/advanced-select/advanced-select.service.js +40 -0
  15. package/esm2015/lib/components/advanced-table/advanced-filter-value-provider.service.js +37 -0
  16. package/esm2015/lib/components/advanced-table/advanced-table-resolvers.js +44 -0
  17. package/esm2015/lib/components/advanced-table/advanced-table-search-base.js +23 -0
  18. package/esm2015/lib/components/advanced-table/advanced-table-search.component.js +519 -0
  19. package/esm2015/lib/components/advanced-table/advanced-table-settings.component.js +109 -0
  20. package/esm2015/lib/components/advanced-table/advanced-table.component.js +1007 -0
  21. package/esm2015/lib/components/advanced-table/advanced-table.formatters.interface.js +16 -0
  22. package/esm2015/lib/components/advanced-table/advanced-table.formatters.js +271 -0
  23. package/esm2015/lib/components/advanced-table/advanced-table.interfaces.js +2 -0
  24. package/esm2015/lib/components/advanced-table-modal/advanced-table-modal-base.component.js +379 -0
  25. package/esm2015/lib/components/table-simple-header/table-simple-header.component.js +52 -0
  26. package/esm2015/lib/directives/advanced-table-editor.directive.js +157 -0
  27. package/esm2015/lib/directives/btnexp.directive.js +225 -0
  28. package/esm2015/lib/i18n/tables.el.js +104 -0
  29. package/esm2015/lib/i18n/tables.en.js +103 -0
  30. package/esm2015/lib/pipes/advanced-aggregator.pipe.js +35 -0
  31. package/esm2015/lib/pipes/advansed-aggregator-list-title-parse.pipe.js +46 -0
  32. package/esm2015/lib/services/advanced-aggregator/advanced-aggregator.service.js +117 -0
  33. package/esm2015/lib/tables.activated-table.service.js +36 -0
  34. package/esm2015/lib/tables.module.js +134 -0
  35. package/esm2015/public_api.js +22 -0
  36. package/esm2015/universis-ngx-tables.js +14 -0
  37. package/esm5/lib/components/add-items/add-items.component.js +153 -0
  38. package/esm5/lib/components/advanced-aggregator/advanced-aggregator.component.js +169 -0
  39. package/esm5/lib/components/advanced-aggregator-list/advanced-aggregator-list.component.js +56 -0
  40. package/esm5/lib/components/advanced-list/advanced-list.component.js +185 -0
  41. package/esm5/lib/components/advanced-row-action/advanced-row-action.component.js +179 -0
  42. package/esm5/lib/components/advanced-search-form/advanced-search-form.component.js +137 -0
  43. package/esm5/lib/components/advanced-select/advanced-select.component.js +56 -0
  44. package/esm5/lib/components/advanced-select/advanced-select.service.js +43 -0
  45. package/esm5/lib/components/advanced-table/advanced-filter-value-provider.service.js +50 -0
  46. package/esm5/lib/components/advanced-table/advanced-table-resolvers.js +48 -0
  47. package/esm5/lib/components/advanced-table/advanced-table-search-base.js +29 -0
  48. package/esm5/lib/components/advanced-table/advanced-table-search.component.js +556 -0
  49. package/esm5/lib/components/advanced-table/advanced-table-settings.component.js +115 -0
  50. package/esm5/lib/components/advanced-table/advanced-table.component.js +1035 -0
  51. package/esm5/lib/components/advanced-table/advanced-table.formatters.interface.js +16 -0
  52. package/esm5/lib/components/advanced-table/advanced-table.formatters.js +313 -0
  53. package/esm5/lib/components/advanced-table/advanced-table.interfaces.js +2 -0
  54. package/esm5/lib/components/advanced-table-modal/advanced-table-modal-base.component.js +295 -0
  55. package/esm5/lib/components/table-simple-header/table-simple-header.component.js +58 -0
  56. package/esm5/lib/directives/advanced-table-editor.directive.js +175 -0
  57. package/esm5/lib/directives/btnexp.directive.js +253 -0
  58. package/esm5/lib/i18n/tables.el.js +104 -0
  59. package/esm5/lib/i18n/tables.en.js +103 -0
  60. package/esm5/lib/pipes/advanced-aggregator.pipe.js +39 -0
  61. package/esm5/lib/pipes/advansed-aggregator-list-title-parse.pipe.js +49 -0
  62. package/esm5/lib/services/advanced-aggregator/advanced-aggregator.service.js +130 -0
  63. package/esm5/lib/tables.activated-table.service.js +43 -0
  64. package/esm5/lib/tables.module.js +139 -0
  65. package/esm5/public_api.js +22 -0
  66. package/esm5/universis-ngx-tables.js +14 -0
  67. package/fesm2015/universis-ngx-tables.js +4127 -0
  68. package/fesm2015/universis-ngx-tables.js.map +1 -0
  69. package/fesm5/universis-ngx-tables.js +4313 -0
  70. package/fesm5/universis-ngx-tables.js.map +1 -0
  71. package/lib/advanced-aggregator.d.ts +124 -0
  72. package/lib/components/add-items/add-items.component.d.ts +44 -0
  73. package/lib/components/advanced-aggregator/advanced-aggregator.component.d.ts +45 -0
  74. package/lib/components/advanced-aggregator-list/advanced-aggregator-list.component.d.ts +25 -0
  75. package/lib/components/advanced-list/advanced-list.component.d.ts +42 -0
  76. package/lib/components/advanced-row-action/advanced-row-action.component.d.ts +42 -0
  77. package/lib/components/advanced-search-form/advanced-search-form.component.d.ts +27 -0
  78. package/lib/components/advanced-select/advanced-select.component.d.ts +14 -0
  79. package/lib/components/advanced-select/advanced-select.service.d.ts +9 -0
  80. package/lib/components/advanced-table/advanced-filter-value-provider.service.d.ts +8 -0
  81. package/lib/components/advanced-table/advanced-table-resolvers.d.ts +12 -0
  82. package/lib/components/advanced-table/advanced-table-search-base.d.ts +7 -0
  83. package/lib/components/advanced-table/advanced-table-search.component.d.ts +80 -0
  84. package/lib/components/advanced-table/advanced-table-settings.component.d.ts +35 -0
  85. package/lib/components/advanced-table/advanced-table.component.d.ts +142 -0
  86. package/lib/components/advanced-table/advanced-table.formatters.d.ts +62 -0
  87. package/lib/components/advanced-table/advanced-table.formatters.interface.d.ts +15 -0
  88. package/lib/components/advanced-table/advanced-table.interfaces.d.ts +27 -0
  89. package/lib/components/advanced-table-modal/advanced-table-modal-base.component.d.ts +82 -0
  90. package/lib/components/table-simple-header/table-simple-header.component.d.ts +14 -0
  91. package/lib/directives/advanced-table-editor.directive.d.ts +25 -0
  92. package/lib/directives/btnexp.directive.d.ts +68 -0
  93. package/lib/i18n/tables.el.d.ts +102 -0
  94. package/lib/i18n/tables.en.d.ts +101 -0
  95. package/lib/pipes/advanced-aggregator.pipe.d.ts +21 -0
  96. package/lib/pipes/advansed-aggregator-list-title-parse.pipe.d.ts +21 -0
  97. package/lib/services/advanced-aggregator/advanced-aggregator.service.d.ts +32 -0
  98. package/lib/tables.activated-table.service.d.ts +9 -0
  99. package/lib/tables.module.d.ts +7 -0
  100. package/package.json +51 -0
  101. package/public_api.d.ts +18 -0
  102. package/universis-ngx-tables.d.ts +12 -0
  103. package/universis-ngx-tables.metadata.json +1 -0
@@ -0,0 +1,124 @@
1
+ /**
2
+ *
3
+ * @interface AdvancedAggregatorFilters An object that contains data used for filtering
4
+ *
5
+ * @property {Array<string>} filters A list of expressions to use for filtering
6
+ * @property {string} text The search text used by the user to run against the declared search expression
7
+ *
8
+ */
9
+ export declare interface AdvancedAggregatorFilters {
10
+ filters: string[],
11
+ text: string;
12
+ }
13
+
14
+ /**
15
+ *
16
+ * @interface AdvancedAggregatorColumn A column in the advanced aggregator list
17
+ *
18
+ * @property {string} name The name of the column. It's used as it's key
19
+ * @property {string} title The title that will be shown as column label
20
+ * @property {string='text', 'boolean'} type The data type of the column value
21
+ * @property {string} variant The a visualization variant of the column
22
+ * @property {string} length The length of the list cell
23
+ * @property {string} trueValue For booleans, the value that represent the true state
24
+ * @property {boolean} hidden Whether the column should be shown on the UI
25
+ *
26
+ */
27
+ export declare interface AdvancedAggregatorColumn {
28
+ name: string;
29
+ property: string;
30
+ title: string;
31
+ type?: string;
32
+ variant?: string;
33
+ length?: string;
34
+ trueValue?: string;
35
+ hidden?: boolean;
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @interface AdvancedAggregatorAction An action that can be used in a column
41
+ *
42
+ * @property {string} name The name of the action
43
+ * @property {string='edit'} type The type of the action
44
+ * @property {string} title The title that is shown on mouse hover
45
+ * @property {string} identifier An identifier that will be emitted along with the row data
46
+ * @property {string} icon The icon to show as identifier
47
+ *
48
+ */
49
+ export declare interface AdvancedAggregatorAction {
50
+ name: string;
51
+ type: string;
52
+ title: string;
53
+ identifier: string;
54
+ icon: string;
55
+ }
56
+
57
+ /**
58
+ *
59
+ * @interface AdvancedAggregatorFunction An aggregator function that should return a value for each subgroup
60
+ *
61
+ * @property {string} name The name of the aggregator function
62
+ * @property {string} label The label of the aggregator
63
+ *
64
+ */
65
+ export declare interface AdvancedAggregatorFunction {
66
+ name: string;
67
+ label: string;
68
+ }
69
+
70
+ /**
71
+ *
72
+ * @interface AdvancedAggregatorGroup The declaration of a property that can be used to group the data
73
+ *
74
+ * @property {string} name The name of the group. Should match the name of the column property
75
+ * @property {string} property The property name
76
+ * @property {string} label The label to be shown as the select option at the advanced search component
77
+ * @property {string} title The title to show on top of the grouped list
78
+ * @property {string} default Whether the column is used by default. If none, the first found is used
79
+ *
80
+ */
81
+ export declare interface AdvancedAggregatorGroup {
82
+ name: string;
83
+ property: string;
84
+ label: string;
85
+ title: string;
86
+ default?: boolean;
87
+ }
88
+
89
+ /**
90
+ *
91
+ * @interface AdvancedAggregatorPostProcessor A declaration for a post processor function
92
+ *
93
+ * @property {string} name The name of the post processor. It will be used as identifier
94
+ *
95
+ */
96
+ export declare interface AdvancedAggregatorPostProcessor {
97
+ name: string;
98
+ }
99
+
100
+ /**
101
+ *
102
+ * @interface AdvancedAggregatorConfig The configuration of the advanced aggregator list component
103
+ *
104
+ * @property {string} model The model which is going to be displayed
105
+ * @property {string} query The query to use in order to fetch data
106
+ * @property {string} title The Title of the list
107
+ * @property {string} orderBy The property according which the list should be ordered
108
+ * @property {Array<AdvancedAggregatorGroup>} groupProperties The list of the available grouping properties
109
+ * @property {Array<AdvancedAggregatorFunction>} aggregator The list of functions that can summarize the data
110
+ * @property {Array<AdvancedAggregatorAction>} actions The list of actions that are available for the list items
111
+ * @property {Array<AdvancedAggregatorColumn>} columns The list of fields to be used from the target models
112
+ *
113
+ */
114
+ export declare interface AdvancedAggregatorConfig {
115
+ model: string;
116
+ query: string;
117
+ title: string;
118
+ orderBy: string;
119
+ groupProperties: Array<AdvancedAggregatorGroup>;
120
+ aggregators?: Array<AdvancedAggregatorFunction>;
121
+ postProcessors?: Array<AdvancedAggregatorPostProcessor>;
122
+ actions?: Array<AdvancedAggregatorAction>;
123
+ columns: Array<AdvancedAggregatorColumn>;
124
+ }
@@ -0,0 +1,44 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { RouterModalOkCancel } from '@universis/common/routing';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
+ import { Observable } from 'rxjs';
5
+ import { TranslateService } from '@ngx-translate/core';
6
+ import { AngularDataContext } from '@themost/angular';
7
+ import { AdvancedTableModalBaseComponent } from '../advanced-table-modal/advanced-table-modal-base.component';
8
+ import { AdvancedFormComponent } from '@universis/forms';
9
+ import { AppEventService, ErrorService, LoadingService, ModalService, ToastService } from '@universis/common';
10
+ export declare class AddItemsComponent extends RouterModalOkCancel implements OnInit, OnDestroy {
11
+ private _errorService;
12
+ private _modalService;
13
+ private _appEvent;
14
+ private _toastService;
15
+ private _loadingService;
16
+ private _translateService;
17
+ private _context;
18
+ loading: boolean;
19
+ lastError: any;
20
+ execute: Observable<any>;
21
+ items: Array<any>;
22
+ target: any;
23
+ tableConfiguration: any;
24
+ formName: any;
25
+ messages: Array<any>;
26
+ formComponent: AdvancedFormComponent;
27
+ selectComponent: AdvancedTableModalBaseComponent;
28
+ private formLoadSubscription;
29
+ private formChangeSubscription;
30
+ private selectedSubscription;
31
+ constructor(router: Router, activatedRoute: ActivatedRoute, _errorService: ErrorService, _modalService: ModalService, _appEvent: AppEventService, _toastService: ToastService, _loadingService: LoadingService, _translateService: TranslateService, _context: AngularDataContext);
32
+ ngOnInit(): void;
33
+ cancel(): Promise<any>;
34
+ ngOnDestroy(): void;
35
+ private executeSubscription;
36
+ readonly formData: any;
37
+ ok(): Promise<any>;
38
+ onChange($event: any): void;
39
+ clearMessages(): void;
40
+ onFilterChange(event: {
41
+ name: string;
42
+ emit: boolean;
43
+ }): void;
44
+ }
@@ -0,0 +1,45 @@
1
+ import { OnInit, EventEmitter, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import { AdvancedAggregatorService } from '../../services/advanced-aggregator/advanced-aggregator.service';
3
+ import { AdvancedAggregatorConfig, AdvancedAggregatorFilters } from '../../advanced-aggregator';
4
+ import { LoadingService } from '@universis/common';
5
+ /**
6
+ *
7
+ * @class AdvancedAggregatorComponent
8
+ * @classdesc An advanced list with the capability of aggregate data based on configurable filters
9
+ *
10
+ */
11
+ export declare class AdvancedAggregatorComponent implements OnInit, OnDestroy {
12
+ private _changeDetector;
13
+ private _advancedAggregatorService;
14
+ private _loadingService;
15
+ private _config;
16
+ private _aggregators;
17
+ private _postProcessors;
18
+ body: any;
19
+ groups: any[];
20
+ config: AdvancedAggregatorConfig;
21
+ aggregators: any;
22
+ postProcessors: any;
23
+ params: any;
24
+ selectedGroups$: any;
25
+ filters$: any;
26
+ searchExpression: string;
27
+ eventHandler: EventEmitter<{}>;
28
+ constructor(_changeDetector: ChangeDetectorRef, _advancedAggregatorService: AdvancedAggregatorService, _loadingService: LoadingService);
29
+ ngOnInit(): Promise<void>;
30
+ ngOnDestroy(): Promise<void>;
31
+ /**
32
+ *
33
+ * Retrieves the data
34
+ *
35
+ */
36
+ fetch(filters: AdvancedAggregatorFilters): Promise<void>;
37
+ /**
38
+ *
39
+ * Triggers the event handler event
40
+ *
41
+ * @param {*} event The event data
42
+ *
43
+ */
44
+ onActionEvent(event: any): void;
45
+ }
@@ -0,0 +1,25 @@
1
+ import { OnInit, EventEmitter } from '@angular/core';
2
+ import { TemplatePipe } from '@universis/common';
3
+ export declare class AdvancedAggregatorListComponent implements OnInit {
4
+ private _template;
5
+ /**
6
+ * @property {AdvancedAggregatorConfig} config The configuration object to use
7
+ */
8
+ config: any;
9
+ /**
10
+ * @property {Array<Array<any>>} body The list of data entries to show as the list body
11
+ */
12
+ body: any;
13
+ clickEvent: EventEmitter<{}>;
14
+ constructor(_template: TemplatePipe);
15
+ ngOnInit(): void;
16
+ /**
17
+ *
18
+ * Triggers the output event emitter
19
+ *
20
+ * @param type The type of the event as it's declared in the configuration
21
+ * @param item The value of the current item
22
+ * }
23
+ */
24
+ callCallback(type: string, data: any): void;
25
+ }
@@ -0,0 +1,42 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { AngularDataContext } from '@themost/angular';
3
+ import { TranslateService } from '@ngx-translate/core';
4
+ import { ActivatedRoute } from '@angular/router';
5
+ import { AdvancedTableComponent, AdvancedTableDataResult } from '../advanced-table/advanced-table.component';
6
+ import { ErrorService, ModalService, UserActivityService } from '@universis/common';
7
+ import { TableConfiguration } from '../advanced-table/advanced-table.interfaces';
8
+ import { ToastService } from '@universis/common';
9
+ export declare class AdvancedListComponent implements OnInit, OnDestroy {
10
+ private _context;
11
+ private _translateService;
12
+ private _activatedRoute;
13
+ private _errorService;
14
+ private _toastService;
15
+ private _modalService;
16
+ private _userActivityService;
17
+ recordsTotal: number;
18
+ config: TableConfiguration;
19
+ private subscription;
20
+ private dataSubscription;
21
+ private reloadSubscription;
22
+ entitySet: string;
23
+ category: string;
24
+ description: string;
25
+ longDescription: string;
26
+ tableConfiguration: any;
27
+ searchConfiguration: any;
28
+ table: AdvancedTableComponent;
29
+ allowSaveOption: boolean;
30
+ constructor(_context: AngularDataContext, _translateService: TranslateService, _activatedRoute: ActivatedRoute, _errorService: ErrorService, _toastService: ToastService, _modalService: ModalService, _userActivityService: UserActivityService);
31
+ ngOnDestroy(): void;
32
+ ngOnInit(): Promise<void>;
33
+ /**
34
+ * Data load event handler of advanced table component
35
+ * @param {AdvancedTableDataResult} data
36
+ */
37
+ onDataLoad(data: AdvancedTableDataResult): void;
38
+ /**
39
+ * Remove selected items
40
+ */
41
+ remove(): Promise<void>;
42
+ }
@@ -0,0 +1,42 @@
1
+ import { OnInit, OnDestroy, AfterViewInit } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
+ import { AngularDataContext } from '@themost/angular';
5
+ import 'rxjs/add/observable/combineLatest';
6
+ import { ErrorService, ModalService } from '@universis/common';
7
+ import { RouterModalOkCancel } from '@universis/common/routing';
8
+ import { AppEventService } from '@universis/common';
9
+ import { Observable } from 'rxjs';
10
+ import { AdvancedFormComponent } from '@universis/forms';
11
+ import { ProgressbarComponent } from 'ngx-bootstrap/progressbar';
12
+ export declare class AdvancedRowActionComponent extends RouterModalOkCancel implements OnInit, AfterViewInit, OnDestroy {
13
+ private _translateService;
14
+ private _context;
15
+ private _errorService;
16
+ private _modalService;
17
+ private _appEvent;
18
+ invalidSubscription: any;
19
+ items: any;
20
+ modalIcon: string;
21
+ description: string;
22
+ formTemplate: string;
23
+ progressType: string;
24
+ data: any;
25
+ additionalMessage: string;
26
+ errorMessage: string;
27
+ lastError: any;
28
+ loading: boolean;
29
+ progressComponent: ProgressbarComponent;
30
+ formComponent: AdvancedFormComponent;
31
+ refresh: any;
32
+ execute: Observable<any>;
33
+ private refreshSubscription;
34
+ private executeSubscription;
35
+ constructor(router: Router, activatedRoute: ActivatedRoute, _translateService: TranslateService, _context: AngularDataContext, _errorService: ErrorService, _modalService: ModalService, _appEvent: AppEventService);
36
+ readonly form: AdvancedFormComponent;
37
+ ngOnInit(): void;
38
+ ngAfterViewInit(): void;
39
+ ngOnDestroy(): void;
40
+ cancel(): Promise<any>;
41
+ ok(): Promise<void>;
42
+ }
@@ -0,0 +1,27 @@
1
+ import { AfterViewInit, EventEmitter, OnDestroy, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { FormioComponent, FormioForm } from 'angular-formio';
3
+ import { AngularDataContext } from '@themost/angular';
4
+ import { ActivatedRoute } from '@angular/router';
5
+ import { AdvancedTableSearchBaseComponent } from '../advanced-table/advanced-table-search-base';
6
+ import { TranslateService } from '@ngx-translate/core';
7
+ import { HttpClient } from '@angular/common/http';
8
+ export declare class AdvancedSearchFormComponent extends AdvancedTableSearchBaseComponent implements OnInit, OnDestroy, AfterViewInit, OnChanges {
9
+ private _context;
10
+ private _translateService;
11
+ private _activatedRoute;
12
+ private _http;
13
+ formComponent: FormioComponent;
14
+ form: any;
15
+ formSrc: string;
16
+ refreshForm: EventEmitter<any>;
17
+ submission: any;
18
+ private filterSubscription;
19
+ loading: boolean;
20
+ constructor(_context: AngularDataContext, _translateService: TranslateService, _activatedRoute: ActivatedRoute, _http: HttpClient);
21
+ ngOnChanges(changes: SimpleChanges): void;
22
+ ngOnInit(): void;
23
+ onChange(event: object): void;
24
+ onFormLoad(form: FormioForm): void;
25
+ ngAfterViewInit(): void;
26
+ ngOnDestroy(): void;
27
+ }
@@ -0,0 +1,14 @@
1
+ import { AdvancedTableModalBaseComponent } from "../advanced-table-modal/advanced-table-modal-base.component";
2
+ import { ActivatedRoute, Router } from "@angular/router";
3
+ import { AdvancedFilterValueProvider } from "../advanced-table/advanced-filter-value-provider.service";
4
+ import { AngularDataContext } from "@themost/angular";
5
+ import { EventEmitter } from "@angular/core";
6
+ import { BsModalRef } from "ngx-bootstrap/modal";
7
+ import { DatePipe } from "@angular/common";
8
+ export declare class AdvancedSelectComponent extends AdvancedTableModalBaseComponent {
9
+ private _modalRef;
10
+ dismiss: EventEmitter<any>;
11
+ constructor(router: Router, activatedRoute: ActivatedRoute, context: AngularDataContext, advancedFilterValueProvider: AdvancedFilterValueProvider, datePipe: DatePipe, _modalRef: BsModalRef);
12
+ ok(): Promise<void>;
13
+ cancel(): Promise<void>;
14
+ }
@@ -0,0 +1,9 @@
1
+ import { ModalService } from '@universis/common';
2
+ export declare class AdvancedSelectService {
3
+ private _modal;
4
+ constructor(_modal: ModalService);
5
+ select(initialState: any): Promise<{
6
+ result: string;
7
+ items: Array<any>;
8
+ }>;
9
+ }
@@ -0,0 +1,8 @@
1
+ export declare class AdvancedFilterValueProvider {
2
+ values: {};
3
+ private _template;
4
+ constructor();
5
+ buildFilter(filter: any): any;
6
+ asyncBuildFilter(filter: any): Promise<any>;
7
+ getValues(): Promise<{}>;
8
+ }
@@ -0,0 +1,12 @@
1
+ import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
2
+ import { HttpClient } from '@angular/common/http';
3
+ export declare class AdvancedTableConfigurationResolver implements Resolve<string> {
4
+ private _http;
5
+ constructor(_http: HttpClient);
6
+ resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<any> | any;
7
+ }
8
+ export declare class AdvancedSearchConfigurationResolver implements Resolve<string> {
9
+ private _http;
10
+ constructor(_http: HttpClient);
11
+ resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<any> | any;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ export declare class AdvancedTableSearchBaseComponent {
3
+ private _filter;
4
+ filterChange: EventEmitter<{}>;
5
+ filter: any;
6
+ onKeyEnter(event: KeyboardEvent): void;
7
+ }
@@ -0,0 +1,80 @@
1
+ import { OnInit, EventEmitter, AfterViewInit, TemplateRef, OnDestroy } from '@angular/core';
2
+ import { AdvancedTableComponent } from './advanced-table.component';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
+ import { AngularDataContext } from '@themost/angular';
5
+ import { DatePipe } from '@angular/common';
6
+ import { UserStorageService, ModalService } from '@universis/common';
7
+ import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
8
+ import { TranslateService } from '@ngx-translate/core';
9
+ import { AdvancedFilterValueProvider } from './advanced-filter-value-provider.service';
10
+ import { AdvancedTableSearchBaseComponent } from './advanced-table-search-base';
11
+ import { TemplatePipe } from '@universis/common';
12
+ export interface AdvancedSearchViewStatus {
13
+ advancedView: boolean;
14
+ }
15
+ export declare class AdvancedTableSearchComponent extends AdvancedTableSearchBaseComponent implements OnInit, AfterViewInit, OnDestroy {
16
+ protected _context: AngularDataContext;
17
+ protected _activatedRoute: ActivatedRoute;
18
+ protected datePipe: DatePipe;
19
+ private _modalService;
20
+ private _userStorage;
21
+ private _translate;
22
+ private _advancedSearchValueProvider;
23
+ private _template;
24
+ private _router;
25
+ private _modal;
26
+ private queryParamSubscription;
27
+ private configChangesSubscription;
28
+ table: AdvancedTableComponent;
29
+ collapsed: boolean;
30
+ allowSave: boolean;
31
+ showMore: boolean;
32
+ mergeQueryParams: boolean;
33
+ searchText: any;
34
+ viewChange: EventEmitter<AdvancedSearchViewStatus>;
35
+ text: string;
36
+ modalRef: BsModalRef;
37
+ storageKey: any;
38
+ storageValue: any;
39
+ userSearchList: any;
40
+ selectedList: any;
41
+ constructor(_context: AngularDataContext, _activatedRoute: ActivatedRoute, datePipe: DatePipe, _modalService: BsModalService, _userStorage: UserStorageService, _translate: TranslateService, _advancedSearchValueProvider: AdvancedFilterValueProvider, _template: TemplatePipe, _router: Router, _modal: ModalService);
42
+ ngOnInit(): void;
43
+ /**
44
+ * Applies query given by the queryParams of the activated route
45
+ * @param queryParams
46
+ */
47
+ private applyQueryParams;
48
+ ngOnDestroy(): void;
49
+ ngAfterViewInit(): void;
50
+ onSearchKeyDown(event: any): false | Promise<boolean>;
51
+ transformDate(date: any): any;
52
+ convertToString(nameFilter: any): string;
53
+ private loadUserSearchList;
54
+ onSelectUserSearch(event: any): any;
55
+ searchInListByName(name: String): any;
56
+ updateSavedSearchListItemByName(name: String, newItem: any): void;
57
+ updateSavedSearchListItemByObject(itemInList: any, newItem: any): void;
58
+ deleteItemFromSavedSearchListByObject(itemInList: any): void;
59
+ saveSearch(templateToLoad: TemplateRef<any>, newList?: boolean): void;
60
+ confirmModal(saveFormName: any): void;
61
+ closeModal(): void;
62
+ uploadListOnUserStorage(): void;
63
+ /**
64
+ * @deprecated This method is going to be deprecated. Use search() method instead.
65
+ * @param {*} event
66
+ */
67
+ asyncAdvancedSearch(event?: any): Promise<boolean>;
68
+ search(): Promise<void>;
69
+ getQuery(): Promise<any>;
70
+ advancedSearch(event: any): Promise<boolean>;
71
+ clear(): Promise<boolean>;
72
+ /**
73
+ * Gets the view state of search control
74
+ */
75
+ readonly viewState: AdvancedSearchViewStatus;
76
+ /**
77
+ * Switches view between simple and advanced search
78
+ */
79
+ toggleView(): Promise<void>;
80
+ }
@@ -0,0 +1,35 @@
1
+ import { AfterViewInit, ElementRef, OnInit, TemplateRef } from '@angular/core';
2
+ import { AdvancedTableComponent } from './advanced-table.component';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { AngularDataContext } from '@themost/angular';
5
+ import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
6
+ import { ActivatedTableService } from '../../tables.activated-table.service';
7
+ import { UserStorageService } from '@universis/common';
8
+ import { FormBuilder, FormGroup, ValidatorFn } from '@angular/forms';
9
+ export declare class AdvancedTableSettingsComponent implements OnInit, AfterViewInit {
10
+ protected _context: AngularDataContext;
11
+ protected _activatedRoute: ActivatedRoute;
12
+ private elRef;
13
+ private modalService;
14
+ private userStorage;
15
+ private formBuilder;
16
+ private _activatedTable;
17
+ table: AdvancedTableComponent;
18
+ modal_settings_template: ElementRef;
19
+ modalRef: BsModalRef;
20
+ storageKey: any;
21
+ params: any;
22
+ private savedTableSettings;
23
+ form: FormGroup;
24
+ columns: any[];
25
+ tableColumns: any;
26
+ activeTableConfig: any;
27
+ constructor(_context: AngularDataContext, _activatedRoute: ActivatedRoute, elRef: ElementRef, modalService: BsModalService, userStorage: UserStorageService, formBuilder: FormBuilder, _activatedTable: ActivatedTableService);
28
+ ngOnInit(): void;
29
+ ngAfterViewInit(): void;
30
+ private addCheckboxes;
31
+ openTableSettings(table_settings_modal: TemplateRef<any>): void;
32
+ saveTableSettings(): void;
33
+ dismiss(): void;
34
+ minSelectedColumns(min?: number): ValidatorFn;
35
+ }
@@ -0,0 +1,142 @@
1
+ import { ElementRef, EventEmitter, InjectionToken, Injector, OnDestroy, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { AngularDataContext } from '@themost/angular';
3
+ import { TranslatePipe, TranslateService } from '@ngx-translate/core';
4
+ import { ActivatedRoute } from '@angular/router';
5
+ import { TableConfiguration } from './advanced-table.interfaces';
6
+ import { ClientDataQueryable } from '@themost/client';
7
+ import { AdvancedFilterValueProvider } from './advanced-filter-value-provider.service';
8
+ import { BehaviorSubject } from 'rxjs';
9
+ import { TemplatePipe, LoadingService } from '@universis/common';
10
+ import { IAdvancedTableFormatters } from './advanced-table.formatters.interface';
11
+ import 'datatables.net';
12
+ import 'datatables.net-scroller';
13
+ import { HttpClient } from '@angular/common/http';
14
+ export interface AdvancedTableDataResult {
15
+ recordsTotal: number;
16
+ recordsFiltered: number;
17
+ data: Array<any>;
18
+ }
19
+ export declare let COLUMN_FORMATTERS: InjectionToken<{}>;
20
+ export declare class AdvancedTableConfiguration {
21
+ static cast(input: any, clone?: boolean): TableConfiguration;
22
+ }
23
+ export declare class AdvancedTableComponent implements OnInit, OnDestroy, OnChanges {
24
+ private _context;
25
+ private _columnFormatters;
26
+ private _activatedRoute;
27
+ private _translateService;
28
+ private _injector;
29
+ private _advancedFilterValueProvider;
30
+ private _element;
31
+ private _template;
32
+ private _loading;
33
+ private _http;
34
+ private _query;
35
+ private _config;
36
+ private _firstLoad;
37
+ private _showFooter;
38
+ private _showPaging;
39
+ private _id;
40
+ smartSelect: boolean;
41
+ configChanges: BehaviorSubject<any>;
42
+ table: ElementRef;
43
+ emptyTable: ElementRef;
44
+ loadingTable: ElementRef;
45
+ height: number;
46
+ showActions: boolean;
47
+ autoLoad: boolean;
48
+ load: EventEmitter<AdvancedTableDataResult>;
49
+ init: EventEmitter<any>;
50
+ reload: EventEmitter<any>;
51
+ select: EventEmitter<any>;
52
+ selectedItems: EventEmitter<any>;
53
+ scrollable: boolean;
54
+ serverSide: boolean;
55
+ lengthMenu: number[];
56
+ paging: boolean;
57
+ pageLength: number;
58
+ scrollY: number;
59
+ scrollX: boolean;
60
+ /**
61
+ * Enables row selection. The defaulr value is false
62
+ */
63
+ selectable: boolean;
64
+ /**
65
+ * Enables or disable multiple selection. The default values is true.
66
+ */
67
+ multipleSelect: boolean;
68
+ /**
69
+ * Enables custom selection and hides select column. The default value is false
70
+ */
71
+ customSelect: boolean;
72
+ selected: any[];
73
+ unselected: any[];
74
+ /**
75
+ * Gets or sets a URL to load table configuration from
76
+ */
77
+ configSrc: string;
78
+ /**
79
+ * Gets or sets table configuration
80
+ */
81
+ config: TableConfiguration;
82
+ /**
83
+ * Indicates whether table footer will be visible or not
84
+ */
85
+ showFooter: boolean;
86
+ /**
87
+ * Indicates whether paging information will be visible or not
88
+ */
89
+ showPaging: boolean;
90
+ /**
91
+ * Gets or sets an active query for this table
92
+ */
93
+ query: ClientDataQueryable;
94
+ readonly translator: TranslatePipe;
95
+ dataTable: any;
96
+ dtOptions: any;
97
+ private lastQueryParams;
98
+ private reloadSubscription;
99
+ constructor(_context: AngularDataContext, _columnFormatters: IAdvancedTableFormatters, _activatedRoute: ActivatedRoute, _translateService: TranslateService, _injector: Injector, _advancedFilterValueProvider: AdvancedFilterValueProvider, _element: ElementRef, _template: TemplatePipe, _loading: LoadingService, _http: HttpClient);
100
+ search(searchText: any): void;
101
+ fetch(clearSelected?: boolean): void;
102
+ destroy(): void;
103
+ /**
104
+ * Selects the specified data row
105
+ */
106
+ selectRow(row: any, silent?: boolean): void;
107
+ /**
108
+ * Unselects the specified data row if it's selected
109
+ */
110
+ unSelectRow(row: any, silent?: boolean): void;
111
+ selectAny(): void;
112
+ selectNone(): void;
113
+ toggleSelectRow(row: any): void;
114
+ /**
115
+ * Datatables column renderer for select checkbox
116
+ * @param data
117
+ * @param type
118
+ * @param row
119
+ * @param meta
120
+ * @private
121
+ */
122
+ private _renderSelect;
123
+ ngOnInit(): void;
124
+ readonly lastQuery: ClientDataQueryable;
125
+ /**
126
+ * Fetches and updates a single row
127
+ * @param find - Any object which is being converted to a query
128
+ */
129
+ fetchOne(find: any): Promise<void>;
130
+ ngOnDestroy(): void;
131
+ /**
132
+ * Handle selection change
133
+ * @param $event
134
+ */
135
+ onSelectionChange($event: any): void;
136
+ private resetEmptyTable;
137
+ private clearEmptyTable;
138
+ export(): void;
139
+ handleColumns(columnsToShow: any): void;
140
+ getConfig(): TableConfiguration;
141
+ ngOnChanges(changes: SimpleChanges): void;
142
+ }