@recursyve/nice-data-filter-kit 12.1.29 → 13.0.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.
Files changed (100) hide show
  1. package/_index.scss +1 -7
  2. package/{esm2015/lib/api/dto/saved-reports.dto.js → esm2020/lib/api/dto/saved-reports.dto.mjs} +0 -0
  3. package/esm2020/lib/api/filter.api.mjs +51 -0
  4. package/{esm2015/lib/api/models/saved-reports.model.js → esm2020/lib/api/models/saved-reports.model.mjs} +0 -0
  5. package/{esm2015/lib/api/public-api.js → esm2020/lib/api/public-api.mjs} +0 -0
  6. package/esm2020/lib/api/saved-report.api.mjs +48 -0
  7. package/esm2020/lib/components/base-list/base-list.component.mjs +288 -0
  8. package/{esm2015/lib/components/base-list/base-list.constant.js → esm2020/lib/components/base-list/base-list.constant.mjs} +0 -0
  9. package/esm2020/lib/components/base-list/base-list.module.mjs +171 -0
  10. package/{esm2015/lib/components/base-list/directives/base-list-buttons.directive.js → esm2020/lib/components/base-list/directives/base-list-buttons.directive.mjs} +3 -3
  11. package/{esm2015/lib/components/base-list/directives/base-list-cards.directive.js → esm2020/lib/components/base-list/directives/base-list-cards.directive.mjs} +3 -3
  12. package/{esm2015/lib/components/base-list/directives/base-list-custom-content.directive.js → esm2020/lib/components/base-list/directives/base-list-custom-content.directive.mjs} +3 -3
  13. package/{esm2015/lib/components/base-list/directives/base-list-directives.module.js → esm2020/lib/components/base-list/directives/base-list-directives.module.mjs} +4 -4
  14. package/{esm2015/lib/components/base-list/directives/base-list-filters.directive.js → esm2020/lib/components/base-list/directives/base-list-filters.directive.mjs} +3 -3
  15. package/{esm2015/lib/components/base-list/directives/base-list-table.directive.js → esm2020/lib/components/base-list/directives/base-list-table.directive.mjs} +3 -3
  16. package/{esm2015/lib/components/base-list/directives/base-list-title.directive.js → esm2020/lib/components/base-list/directives/base-list-title.directive.mjs} +3 -3
  17. package/{esm2015/lib/components/base-list/models/columns.model.js → esm2020/lib/components/base-list/models/columns.model.mjs} +0 -0
  18. package/{esm2015/lib/components/base-list/models/export.model.js → esm2020/lib/components/base-list/models/export.model.mjs} +0 -0
  19. package/esm2020/lib/components/base-list/models/layout.model.mjs +149 -0
  20. package/esm2020/lib/components/base-list/providers/base-filter.service.mjs +34 -0
  21. package/{esm2015/lib/components/base-list/providers/base-list-saved-report.service.js → esm2020/lib/components/base-list/providers/base-list-saved-report.service.mjs} +3 -3
  22. package/{esm2015/lib/components/base-list/public-api.js → esm2020/lib/components/base-list/public-api.mjs} +0 -0
  23. package/esm2020/lib/components/base-list/store/base-list.query.mjs +35 -0
  24. package/esm2020/lib/components/base-list/store/base-list.service.mjs +341 -0
  25. package/esm2020/lib/components/base-list/store/base-list.store.mjs +81 -0
  26. package/{esm2015/lib/components/multi-state-list/models/list-states.model.js → esm2020/lib/components/multi-state-list/models/list-states.model.mjs} +0 -0
  27. package/esm2020/lib/components/multi-state-list/multi-state-list.component.mjs +71 -0
  28. package/{esm2015/lib/components/multi-state-list/multi-state-list.constant.js → esm2020/lib/components/multi-state-list/multi-state-list.constant.mjs} +0 -0
  29. package/{esm2015/lib/components/multi-state-list/multi-state-list.module.js → esm2020/lib/components/multi-state-list/multi-state-list.module.mjs} +6 -14
  30. package/{esm2015/lib/components/multi-state-list/providers/multi-state-filter.service.js → esm2020/lib/components/multi-state-list/providers/multi-state-filter.service.mjs} +0 -0
  31. package/{esm2015/lib/components/multi-state-list/public-api.js → esm2020/lib/components/multi-state-list/public-api.mjs} +0 -0
  32. package/{esm2015/lib/components/multi-state-list/store/multi-state-list.query.js → esm2020/lib/components/multi-state-list/store/multi-state-list.query.mjs} +3 -3
  33. package/{esm2015/lib/components/multi-state-list/store/multi-state-list.service.js → esm2020/lib/components/multi-state-list/store/multi-state-list.service.mjs} +5 -6
  34. package/esm2020/lib/components/multi-state-list/store/multi-state-list.store.mjs +24 -0
  35. package/{esm2015/lib/components/public-api.js → esm2020/lib/components/public-api.mjs} +0 -0
  36. package/esm2020/lib/components/query-builder/filter-selection/filter-selection.component.mjs +41 -0
  37. package/{esm2015/lib/components/query-builder/pipes/filter-group-icon.pipe.js → esm2020/lib/components/query-builder/pipes/filter-group-icon.pipe.mjs} +3 -3
  38. package/{esm2015/lib/components/query-builder/providers/filter-group.service.js → esm2020/lib/components/query-builder/providers/filter-group.service.mjs} +0 -0
  39. package/{esm2015/lib/components/query-builder/public-api.js → esm2020/lib/components/query-builder/public-api.mjs} +0 -0
  40. package/{esm2015/lib/components/query-builder/query-builder-trigger.directive.js → esm2020/lib/components/query-builder/query-builder-trigger.directive.mjs} +3 -3
  41. package/esm2020/lib/components/query-builder/query-builder.component.mjs +93 -0
  42. package/{esm2015/lib/components/query-builder/query-builder.form.js → esm2020/lib/components/query-builder/query-builder.form.mjs} +0 -0
  43. package/esm2020/lib/components/query-builder/query-builder.module.mjs +116 -0
  44. package/esm2020/lib/components/query-builder/rule/components/date/date-filter.component.mjs +29 -0
  45. package/{esm2015/lib/components/query-builder/rule/components/filter.component.js → esm2020/lib/components/query-builder/rule/components/filter.component.mjs} +3 -3
  46. package/esm2020/lib/components/query-builder/rule/components/number/number-filter.component.mjs +28 -0
  47. package/esm2020/lib/components/query-builder/rule/components/radio/radio-filter.component.mjs +30 -0
  48. package/esm2020/lib/components/query-builder/rule/components/select/select-filter.component.mjs +83 -0
  49. package/esm2020/lib/components/query-builder/rule/components/text/text-filter.component.mjs +31 -0
  50. package/esm2020/lib/components/query-builder/rule/rule.component.mjs +78 -0
  51. package/{esm2015/lib/components/query-builder/utils/qb-filter.utils.js → esm2020/lib/components/query-builder/utils/qb-filter.utils.mjs} +23 -9
  52. package/{esm2015/lib/models/filter.model.js → esm2020/lib/models/filter.model.mjs} +0 -0
  53. package/{esm2015/lib/models/public-api.js → esm2020/lib/models/public-api.mjs} +0 -0
  54. package/{esm2015/lib/models/query.model.js → esm2020/lib/models/query.model.mjs} +0 -0
  55. package/{esm2015/lib/utils/date.adapter.js → esm2020/lib/utils/date.adapter.mjs} +3 -3
  56. package/esm2020/lib/utils/filter.utils.mjs +40 -0
  57. package/{esm2015/lib/utils/public-api.js → esm2020/lib/utils/public-api.mjs} +0 -0
  58. package/{esm2015/lib/utils/query-params.utils.js → esm2020/lib/utils/query-params.utils.mjs} +0 -0
  59. package/{esm2015/lib/utils/string.utils.js → esm2020/lib/utils/string.utils.mjs} +0 -0
  60. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  61. package/{esm2015/recursyve-nice-data-filter-kit.js → esm2020/recursyve-nice-data-filter-kit.mjs} +0 -0
  62. package/fesm2015/recursyve-nice-data-filter-kit.mjs +2448 -0
  63. package/fesm2015/recursyve-nice-data-filter-kit.mjs.map +1 -0
  64. package/fesm2020/recursyve-nice-data-filter-kit.mjs +2446 -0
  65. package/fesm2020/recursyve-nice-data-filter-kit.mjs.map +1 -0
  66. package/lib/components/base-list/base-list.module.d.ts +15 -16
  67. package/lib/components/base-list/models/layout.model.d.ts +0 -4
  68. package/lib/components/multi-state-list/multi-state-list.module.d.ts +15 -16
  69. package/lib/components/query-builder/query-builder.module.d.ts +10 -11
  70. package/package.json +30 -16
  71. package/src/lib/components/base-list/base-list.theme.scss +5 -5
  72. package/src/lib/components/query-builder/filter-selection/filter-selection.theme.scss +42 -0
  73. package/src/lib/components/query-builder/query-builder.theme.scss +2 -0
  74. package/src/lib/components/query-builder/rule/rule.theme.scss +83 -1
  75. package/src/lib/nice-data-filter.theme.scss +7 -0
  76. package/bundles/recursyve-nice-data-filter-kit.umd.js +0 -3189
  77. package/bundles/recursyve-nice-data-filter-kit.umd.js.map +0 -1
  78. package/esm2015/lib/api/filter.api.js +0 -52
  79. package/esm2015/lib/api/saved-report.api.js +0 -49
  80. package/esm2015/lib/components/base-list/base-list.component.js +0 -297
  81. package/esm2015/lib/components/base-list/base-list.module.js +0 -180
  82. package/esm2015/lib/components/base-list/models/layout.model.js +0 -164
  83. package/esm2015/lib/components/base-list/providers/base-filter.service.js +0 -40
  84. package/esm2015/lib/components/base-list/store/base-list.query.js +0 -35
  85. package/esm2015/lib/components/base-list/store/base-list.service.js +0 -330
  86. package/esm2015/lib/components/base-list/store/base-list.store.js +0 -78
  87. package/esm2015/lib/components/multi-state-list/multi-state-list.component.js +0 -75
  88. package/esm2015/lib/components/multi-state-list/store/multi-state-list.store.js +0 -22
  89. package/esm2015/lib/components/query-builder/filter-selection/filter-selection.component.js +0 -48
  90. package/esm2015/lib/components/query-builder/query-builder.component.js +0 -100
  91. package/esm2015/lib/components/query-builder/query-builder.module.js +0 -120
  92. package/esm2015/lib/components/query-builder/rule/components/date/date-filter.component.js +0 -35
  93. package/esm2015/lib/components/query-builder/rule/components/number/number-filter.component.js +0 -34
  94. package/esm2015/lib/components/query-builder/rule/components/radio/radio-filter.component.js +0 -36
  95. package/esm2015/lib/components/query-builder/rule/components/select/select-filter.component.js +0 -94
  96. package/esm2015/lib/components/query-builder/rule/components/text/text-filter.component.js +0 -37
  97. package/esm2015/lib/components/query-builder/rule/rule.component.js +0 -86
  98. package/esm2015/lib/utils/filter.utils.js +0 -41
  99. package/fesm2015/recursyve-nice-data-filter-kit.js +0 -2519
  100. package/fesm2015/recursyve-nice-data-filter-kit.js.map +0 -1
@@ -1,2519 +0,0 @@
1
- import { HttpParams } from '@angular/common/http';
2
- import * as i18 from '@recursyve/nice-ui-kit.v2';
3
- import { isNullOrUndefined, ObjectUtils, FileUtils, ArrayUtils, ExportBottomSheetComponent, NiceLoadingSpinnerModule, NiceTypeaheadModule, NiceExportBottomSheetModule } from '@recursyve/nice-ui-kit.v2';
4
- import * as i0 from '@angular/core';
5
- import { Directive, Input, NgModule, Injectable, InjectionToken, Optional, Inject, Component, forwardRef, ViewEncapsulation, Pipe, EventEmitter, ChangeDetectionStrategy, Output, HostListener, TemplateRef, ContentChild, ContentChildren } from '@angular/core';
6
- import { Store, StoreConfig, Query, arrayUpsert, arrayRemove } from '@datorama/akita';
7
- import { __decorate, __metadata, __awaiter } from 'tslib';
8
- import * as i3 from '@angular/router';
9
- import { RouterModule } from '@angular/router';
10
- import { Subject, of } from 'rxjs';
11
- import { takeUntil, map, debounceTime, switchMap, distinctUntilChanged } from 'rxjs/operators';
12
- import * as i4 from '@angular/flex-layout';
13
- import { FlexLayoutModule, FlexModule, ExtendedModule } from '@angular/flex-layout';
14
- import * as i4$1 from '@angular/material/bottom-sheet';
15
- import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
16
- import * as i6$1 from '@angular/material/icon';
17
- import { MatIconModule } from '@angular/material/icon';
18
- import * as i7 from '@angular/material/button';
19
- import { MatButtonModule } from '@angular/material/button';
20
- import * as i8 from '@angular/material/paginator';
21
- import { MatPaginatorModule } from '@angular/material/paginator';
22
- import * as i9 from '@angular/material/card';
23
- import { MatCardModule } from '@angular/material/card';
24
- import * as i1$1 from '@angular/forms';
25
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
26
- import * as i1$5 from '@recursyve/ngx-form-generator';
27
- import { Control, Required, Array as Array$1, GeneratedFormGroup, ngxFormGeneratorFactory } from '@recursyve/ngx-form-generator';
28
- import * as i1 from '@angular/material/form-field';
29
- import * as i5$1 from '@angular/material/select';
30
- import { MatSelectModule } from '@angular/material/select';
31
- import * as i6 from '@angular/material/core';
32
- import { NativeDateAdapter, MAT_DATE_LOCALE, MatRippleModule, DateAdapter } from '@angular/material/core';
33
- import * as i3$1 from '@angular/material/input';
34
- import { MatInputModule } from '@angular/material/input';
35
- import * as i5 from 'ngx-mask';
36
- import { NgxMaskModule } from 'ngx-mask';
37
- import * as i1$2 from '@angular/material/radio';
38
- import { MatRadioModule } from '@angular/material/radio';
39
- import * as i13 from '@angular/common';
40
- import { CommonModule } from '@angular/common';
41
- import * as i2 from '@angular/material/datepicker';
42
- import { MatDatepickerModule } from '@angular/material/datepicker';
43
- import * as i1$3 from '@angular/cdk/overlay';
44
- import { OverlayModule } from '@angular/cdk/overlay';
45
- import * as i2$2 from '@angular/cdk/platform';
46
- import { ComponentPortal } from '@angular/cdk/portal';
47
- import * as i2$1 from '@angular/material/list';
48
- import { MatListModule } from '@angular/material/list';
49
- import * as i1$4 from '@ngx-translate/core';
50
- import { TranslateModule } from '@ngx-translate/core';
51
- import * as i11 from '@angular/material/table';
52
- import { MatTableModule } from '@angular/material/table';
53
- import * as i12 from '@angular/material/sort';
54
- import { MatSortModule } from '@angular/material/sort';
55
- import * as i16 from '@angular/material/tooltip';
56
- import { MatTooltipModule } from '@angular/material/tooltip';
57
- import * as i17 from '@angular/material/badge';
58
- import { MatBadgeModule } from '@angular/material/badge';
59
-
60
- class QueryParamsUtils {
61
- static extractFilterParameters(params) {
62
- const filters = {};
63
- if (!isNullOrUndefined(params.start)) {
64
- filters.start = Number(params.start);
65
- }
66
- if (!isNullOrUndefined(params.length)) {
67
- filters.length = Number(params.length);
68
- }
69
- if (!isNullOrUndefined(params.order)) {
70
- try {
71
- filters.order = JSON.parse(params.order);
72
- }
73
- catch (e) {
74
- delete filters.order;
75
- }
76
- }
77
- if (!isNullOrUndefined(params.search)) {
78
- filters.search = params.search;
79
- }
80
- if (!isNullOrUndefined(params.rules)) {
81
- try {
82
- filters.rules = JSON.parse(params.rules);
83
- }
84
- catch (e) {
85
- delete filters.rules;
86
- }
87
- }
88
- return filters;
89
- }
90
- static filterParametersToParamsMap(filterParameters) {
91
- const params = {};
92
- if (!isNullOrUndefined(filterParameters.start)) {
93
- params.start = filterParameters.start;
94
- }
95
- if (!isNullOrUndefined(filterParameters.length)) {
96
- params.length = filterParameters.length;
97
- }
98
- if (!isNullOrUndefined(filterParameters.order)) {
99
- params.order = JSON.stringify(filterParameters.order);
100
- }
101
- else {
102
- params.order = null;
103
- }
104
- if (!isNullOrUndefined(filterParameters.search)) {
105
- params.search = filterParameters.search;
106
- }
107
- if (!isNullOrUndefined(filterParameters.rules)) {
108
- params.rules = JSON.stringify(filterParameters.rules);
109
- }
110
- return params;
111
- }
112
- static fromObject(obj) {
113
- Object.entries(obj).forEach(([key, value]) => {
114
- if (value === undefined) {
115
- delete obj[key];
116
- }
117
- });
118
- return new HttpParams({
119
- fromObject: obj
120
- }).toString();
121
- }
122
- }
123
-
124
- class NiceFilterApi {
125
- constructor(filterApiUrl, path, http) {
126
- this.filterApiUrl = filterApiUrl;
127
- this.path = path;
128
- this.http = http;
129
- }
130
- filter(queryModel) {
131
- return this.http.post(this.url("filter"), queryModel);
132
- }
133
- filterCount(queryModel) {
134
- return this.http.post(this.url("filter-count"), queryModel);
135
- }
136
- downloadData(type, queryModel) {
137
- return this.http.post(this.url(`download/${type}`), queryModel, { responseType: "blob" });
138
- }
139
- getPrintableHtml(queryModel) {
140
- return this.http.post(this.url(`download/html`), queryModel, { responseType: "text" });
141
- }
142
- getFilterConfig() {
143
- return this.http.get(this.url("filter/config"));
144
- }
145
- searchFilterValue(id, value) {
146
- if (value === undefined) {
147
- value = "";
148
- }
149
- return this.http.get(this.url(`filter/config/value?id=${id}&value=${value}`));
150
- }
151
- searchFilterResourceValue(id, resourceId) {
152
- return this.http.get(this.url(`filter/config/id?id=${id}&resourceId=${resourceId}`));
153
- }
154
- url(...args) {
155
- const [route, queryParams] = this.transformUrlArgs(args);
156
- const params = queryParams ? `?${QueryParamsUtils.fromObject(queryParams)}` : "";
157
- if (route) {
158
- return `${this.filterApiUrl}/${this.path}/${route}${params}`;
159
- }
160
- return `${this.filterApiUrl}/${this.path}${params}`;
161
- }
162
- transformUrlArgs(args) {
163
- var _a;
164
- const [routeOfQueryParams, query] = args;
165
- if (args.length === 1) {
166
- if (typeof routeOfQueryParams === "string") {
167
- return [routeOfQueryParams];
168
- }
169
- return ["", routeOfQueryParams];
170
- }
171
- return [(_a = routeOfQueryParams) !== null && _a !== void 0 ? _a : "", query];
172
- }
173
- }
174
-
175
- class NiceBaseListButtonsDirective {
176
- constructor(template) {
177
- this.template = template;
178
- this.position = "suffix";
179
- }
180
- }
181
- NiceBaseListButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListButtonsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
182
- NiceBaseListButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListButtonsDirective, selector: "[niceListButton]", inputs: { position: "position" }, ngImport: i0 });
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListButtonsDirective, decorators: [{
184
- type: Directive,
185
- args: [{ selector: "[niceListButton]" }]
186
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { position: [{
187
- type: Input
188
- }] } });
189
-
190
- class NiceBaseListCardsDirective {
191
- constructor(template) {
192
- this.template = template;
193
- }
194
- }
195
- NiceBaseListCardsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListCardsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
196
- NiceBaseListCardsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListCardsDirective, selector: "[niceListCards]", ngImport: i0 });
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListCardsDirective, decorators: [{
198
- type: Directive,
199
- args: [{ selector: "[niceListCards]" }]
200
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
201
-
202
- class NiceBaseListCustomContentDirective {
203
- constructor(template) {
204
- this.template = template;
205
- }
206
- }
207
- NiceBaseListCustomContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListCustomContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
208
- NiceBaseListCustomContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListCustomContentDirective, selector: "[niceListContent]", ngImport: i0 });
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListCustomContentDirective, decorators: [{
210
- type: Directive,
211
- args: [{ selector: "[niceListContent]" }]
212
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
213
-
214
- class NiceBaseListFiltersDirective {
215
- constructor(template) {
216
- this.template = template;
217
- }
218
- }
219
- NiceBaseListFiltersDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListFiltersDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
220
- NiceBaseListFiltersDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListFiltersDirective, selector: "[niceListFilters]", ngImport: i0 });
221
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListFiltersDirective, decorators: [{
222
- type: Directive,
223
- args: [{ selector: "[niceListFilters]" }]
224
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
225
-
226
- class NiceBaseListTableDirective {
227
- constructor(template) {
228
- this.template = template;
229
- }
230
- }
231
- NiceBaseListTableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListTableDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
232
- NiceBaseListTableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListTableDirective, selector: "[niceListTable]", ngImport: i0 });
233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListTableDirective, decorators: [{
234
- type: Directive,
235
- args: [{ selector: "[niceListTable]" }]
236
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
237
-
238
- class NiceBaseListTitleDirective {
239
- constructor(template) {
240
- this.template = template;
241
- }
242
- }
243
- NiceBaseListTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListTitleDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
244
- NiceBaseListTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListTitleDirective, selector: "[niceListTitle]", ngImport: i0 });
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListTitleDirective, decorators: [{
246
- type: Directive,
247
- args: [{ selector: "[niceListTitle]" }]
248
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
249
-
250
- class NiceBaseListDirectiveModule {
251
- }
252
- NiceBaseListDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
253
- NiceBaseListDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListDirectiveModule, declarations: [NiceBaseListButtonsDirective,
254
- NiceBaseListTitleDirective,
255
- NiceBaseListTableDirective,
256
- NiceBaseListCardsDirective,
257
- NiceBaseListCustomContentDirective,
258
- NiceBaseListFiltersDirective], exports: [NiceBaseListButtonsDirective,
259
- NiceBaseListTitleDirective,
260
- NiceBaseListTableDirective,
261
- NiceBaseListCardsDirective,
262
- NiceBaseListCustomContentDirective,
263
- NiceBaseListFiltersDirective] });
264
- NiceBaseListDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListDirectiveModule });
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListDirectiveModule, decorators: [{
266
- type: NgModule,
267
- args: [{
268
- declarations: [
269
- NiceBaseListButtonsDirective,
270
- NiceBaseListTitleDirective,
271
- NiceBaseListTableDirective,
272
- NiceBaseListCardsDirective,
273
- NiceBaseListCustomContentDirective,
274
- NiceBaseListFiltersDirective
275
- ],
276
- exports: [
277
- NiceBaseListButtonsDirective,
278
- NiceBaseListTitleDirective,
279
- NiceBaseListTableDirective,
280
- NiceBaseListCardsDirective,
281
- NiceBaseListCustomContentDirective,
282
- NiceBaseListFiltersDirective
283
- ]
284
- }]
285
- }] });
286
-
287
- class TableColumns {
288
- constructor(id, sortable = true) {
289
- this.id = id;
290
- this.sortable = sortable;
291
- }
292
- }
293
-
294
- var LayoutContent;
295
- (function (LayoutContent) {
296
- LayoutContent["Table"] = "table";
297
- LayoutContent["Cards"] = "cards";
298
- LayoutContent["Custom"] = "custom";
299
- })(LayoutContent || (LayoutContent = {}));
300
- const defaultLayout = {
301
- default: {
302
- type: "column",
303
- items: [
304
- {
305
- type: "row",
306
- classes: ["mb-8"],
307
- items: [
308
- {
309
- name: "title",
310
- flex: "33"
311
- },
312
- {
313
- type: "row",
314
- flex: "1 0 auto",
315
- align: "center center",
316
- items: [
317
- {
318
- name: "search",
319
- flex: "1 0 auto"
320
- },
321
- {
322
- type: "row",
323
- flex: "1 0 auto",
324
- align: "end",
325
- items: [
326
- {
327
- name: "prefixButtons",
328
- align: "end center"
329
- },
330
- {
331
- name: "exportButtons",
332
- align: "end center"
333
- },
334
- {
335
- name: "suffixButtons",
336
- align: "end center"
337
- }
338
- ]
339
- }
340
- ]
341
- }
342
- ]
343
- },
344
- {
345
- name: "queryBuilder"
346
- },
347
- {
348
- name: "filters"
349
- },
350
- {
351
- name: "content"
352
- },
353
- {
354
- name: "pagination"
355
- }
356
- ]
357
- },
358
- sm: {
359
- type: "column",
360
- items: [
361
- {
362
- type: "row",
363
- classes: ["mb-8"],
364
- align: "center center",
365
- items: [
366
- {
367
- name: "title",
368
- flex: "50"
369
- },
370
- {
371
- type: "row",
372
- flex: "1 0 auto",
373
- align: "end center",
374
- items: [
375
- {
376
- name: "prefixButtons"
377
- },
378
- {
379
- name: "exportButtons"
380
- },
381
- {
382
- name: "suffixButtons"
383
- }
384
- ]
385
- }
386
- ]
387
- },
388
- {
389
- name: "search",
390
- align: "center center",
391
- classes: ["mb-8"]
392
- },
393
- {
394
- name: "queryBuilder"
395
- },
396
- {
397
- name: "filters"
398
- },
399
- {
400
- name: "content"
401
- },
402
- {
403
- name: "pagination"
404
- }
405
- ]
406
- },
407
- xs: {
408
- type: "column",
409
- items: [
410
- {
411
- type: "row",
412
- classes: ["mb-8"],
413
- align: "center center",
414
- items: [
415
- {
416
- name: "title",
417
- flex: "50"
418
- },
419
- {
420
- type: "row",
421
- flex: "1 0 auto",
422
- align: "end center",
423
- items: [
424
- {
425
- name: "prefixButtons"
426
- },
427
- {
428
- name: "exportButtons"
429
- },
430
- {
431
- name: "suffixButtons"
432
- }
433
- ]
434
- }
435
- ]
436
- },
437
- {
438
- name: "search",
439
- align: "center center",
440
- classes: ["mb-8"]
441
- },
442
- {
443
- name: "queryBuilder"
444
- },
445
- {
446
- name: "filters"
447
- },
448
- {
449
- name: "content"
450
- },
451
- {
452
- name: "pagination"
453
- }
454
- ]
455
- }
456
- };
457
-
458
- class FilterUtils {
459
- static parametersToRequest(filterParameters) {
460
- var _a, _b, _c, _d, _e, _f;
461
- return {
462
- page: {
463
- number: Math.ceil(((_a = filterParameters.start) !== null && _a !== void 0 ? _a : 0) / ((_b = filterParameters.length) !== null && _b !== void 0 ? _b : 1)),
464
- size: (_c = filterParameters.length) !== null && _c !== void 0 ? _c : 0
465
- },
466
- search: {
467
- value: (_d = filterParameters.search) !== null && _d !== void 0 ? _d : ""
468
- },
469
- query: {
470
- condition: "and",
471
- rules: (_e = filterParameters.rules) !== null && _e !== void 0 ? _e : []
472
- },
473
- order: (_f = filterParameters.order) !== null && _f !== void 0 ? _f : undefined,
474
- data: filterParameters.data
475
- };
476
- }
477
- static filterChangeNeedsRefresh(currentFilters, newFilters) {
478
- const newFilterKeys = Object.keys(newFilters).sort();
479
- if (newFilterKeys.length === 0) {
480
- return true;
481
- }
482
- return newFilterKeys.some((key) => {
483
- const currentValue = currentFilters[key];
484
- const newValue = currentFilters[key];
485
- if (Array.isArray(currentValue)) {
486
- return !ObjectUtils.areObjectsEqual(currentValue, newValue);
487
- }
488
- else if (typeof currentValue === "object" && currentValue !== null) {
489
- return !ObjectUtils.areObjectsEqual(currentValue, newValue);
490
- }
491
- else {
492
- return currentValue !== newValue;
493
- }
494
- });
495
- }
496
- }
497
-
498
- class NiceFilterService {
499
- constructor(api) {
500
- this.api = api;
501
- }
502
- filter(params) {
503
- var _a;
504
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.filter(FilterUtils.parametersToRequest(params));
505
- }
506
- getFile(type, parameters) {
507
- var _a;
508
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.downloadData(type, FilterUtils.parametersToRequest(parameters));
509
- }
510
- getPrintableHtml(parameters) {
511
- var _a;
512
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.getPrintableHtml(FilterUtils.parametersToRequest(parameters));
513
- }
514
- getFilterConfig() {
515
- var _a;
516
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.getFilterConfig();
517
- }
518
- searchFilterValue(filterConfig, value) {
519
- var _a;
520
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.searchFilterValue(filterConfig.id, value);
521
- }
522
- searchFilterResourceValue(filterConfig, resourceId) {
523
- var _a;
524
- return (_a = this.api) === null || _a === void 0 ? void 0 : _a.searchFilterResourceValue(filterConfig.id, resourceId);
525
- }
526
- }
527
- NiceFilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceFilterService, deps: [{ token: NiceFilterApi }], target: i0.ɵɵFactoryTarget.Injectable });
528
- NiceFilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceFilterService });
529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceFilterService, decorators: [{
530
- type: Injectable
531
- }], ctorParameters: function () { return [{ type: NiceFilterApi }]; } });
532
-
533
- class NiceSavedReportsApi {
534
- constructor(filterApiUrl, path, http) {
535
- this.filterApiUrl = filterApiUrl;
536
- this.path = path;
537
- this.http = http;
538
- }
539
- create(dto) {
540
- return this.http.post(this.url(), dto);
541
- }
542
- getAll() {
543
- return this.http.get(this.url());
544
- }
545
- getByTable(table) {
546
- return this.http.get(this.url(`${table}`));
547
- }
548
- getTopByTable(table) {
549
- return this.http.get(this.url(`${table}/top`));
550
- }
551
- hit(id) {
552
- return this.http.put(this.url(`${id}/hit`), null);
553
- }
554
- update(id, dto) {
555
- return this.http.put(this.url(`${id}`), dto);
556
- }
557
- delete(id) {
558
- return this.http.delete(this.url(`${id}`));
559
- }
560
- url(...args) {
561
- const [route, queryParams] = this.transformUrlArgs(args);
562
- const params = queryParams ? `?${QueryParamsUtils.fromObject(queryParams)}` : "";
563
- if (route) {
564
- return `${this.filterApiUrl}/${this.path}/${route}${params}`;
565
- }
566
- return `${this.filterApiUrl}/${this.path}${params}`;
567
- }
568
- transformUrlArgs(args) {
569
- var _a;
570
- const [routeOfQueryParams, query] = args;
571
- if (args.length === 1) {
572
- if (typeof routeOfQueryParams === "string") {
573
- return [routeOfQueryParams];
574
- }
575
- return ["", routeOfQueryParams];
576
- }
577
- return [(_a = routeOfQueryParams) !== null && _a !== void 0 ? _a : "", query];
578
- }
579
- }
580
-
581
- class NiceSavedReportService {
582
- constructor(api) {
583
- this.api = api;
584
- }
585
- create(report) {
586
- return this.api.create(report);
587
- }
588
- update(id, report) {
589
- return this.api.update(id, report);
590
- }
591
- remove(id) {
592
- return this.api.delete(id);
593
- }
594
- getByTableName(table) {
595
- return this.api.getByTable(table);
596
- }
597
- getTopByTableName(table) {
598
- return this.api.getTopByTable(table);
599
- }
600
- hit(id) {
601
- return this.api.hit(id);
602
- }
603
- }
604
- NiceSavedReportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceSavedReportService, deps: [{ token: NiceSavedReportsApi }], target: i0.ɵɵFactoryTarget.Injectable });
605
- NiceSavedReportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceSavedReportService });
606
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceSavedReportService, decorators: [{
607
- type: Injectable
608
- }], ctorParameters: function () { return [{ type: NiceSavedReportsApi }]; } });
609
-
610
- const BASE_LIST_LAYOUT = new InjectionToken("base_list_layout");
611
- const DEFAULT_PARAMETERS = new InjectionToken("default_parameters");
612
- const LIST_TABLE = new InjectionToken("list_table");
613
- const TABLE_COLUMNS = new InjectionToken("table_columns");
614
- const EXPORTS_SETTINGS = new InjectionToken("exports_settings");
615
- const ENABLE_QUERY_BUILDER = new InjectionToken("enable_query_builder");
616
-
617
- const initialBaseListState = {
618
- disabled: false,
619
- mergePageResults: false,
620
- resetPaging: false,
621
- filterConfigLoading: false,
622
- filterResult: null,
623
- filterParameters: {
624
- start: 0,
625
- length: 10,
626
- order: {},
627
- search: "",
628
- rules: [],
629
- data: {}
630
- },
631
- filterConfig: [],
632
- showQueryBuilder: false,
633
- defaultRules: []
634
- };
635
- let NiceBaseListStore = class NiceBaseListStore extends Store {
636
- constructor(parameters) {
637
- super(Object.assign(Object.assign({}, initialBaseListState), { filterParameters: Object.assign(Object.assign({}, initialBaseListState.filterParameters), (parameters !== null && parameters !== void 0 ? parameters : {})) }));
638
- }
639
- setFilterConfigLoading(loading) {
640
- this.update({
641
- filterConfigLoading: loading
642
- });
643
- }
644
- setResult(filterResult, reset = false) {
645
- const { mergePageResults } = this.getValue();
646
- if (mergePageResults && !reset) {
647
- this.update((state) => {
648
- var _a, _b;
649
- return ({
650
- filterResult: {
651
- page: filterResult.page,
652
- total: filterResult.total,
653
- values: state.resetPaging ? filterResult.values : [
654
- ...((_b = (_a = state.filterResult) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : []),
655
- ...filterResult.values
656
- ]
657
- },
658
- resetPaging: false
659
- });
660
- });
661
- }
662
- else {
663
- this.update({
664
- filterResult
665
- });
666
- }
667
- }
668
- setParameters(filterParameters) {
669
- this.update({
670
- filterParameters
671
- });
672
- }
673
- };
674
- NiceBaseListStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListStore, deps: [{ token: DEFAULT_PARAMETERS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
675
- NiceBaseListStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListStore });
676
- NiceBaseListStore = __decorate([
677
- StoreConfig({ name: "base-list", resettable: true }),
678
- __metadata("design:paramtypes", [Object])
679
- ], NiceBaseListStore);
680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListStore, decorators: [{
681
- type: Injectable
682
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
683
- type: Optional
684
- }, {
685
- type: Inject,
686
- args: [DEFAULT_PARAMETERS]
687
- }] }]; } });
688
-
689
- class NiceBaseListQuery extends Query {
690
- constructor(store) {
691
- super(store);
692
- this.store = store;
693
- }
694
- selectData() {
695
- return this.select(s => { var _a, _b; return (_b = (_a = s.filterResult) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : []; });
696
- }
697
- selectFilterParameters() {
698
- return this.select(s => s.filterParameters);
699
- }
700
- selectFilterResult() {
701
- return this.select(s => s.filterResult);
702
- }
703
- selectFilterConfig() {
704
- return this.select(s => s.filterConfig);
705
- }
706
- selectFilterConfigLoading() {
707
- return this.select(s => s.filterConfigLoading);
708
- }
709
- selectShowQueryBuilder() {
710
- return this.select(s => s.showQueryBuilder);
711
- }
712
- }
713
- NiceBaseListQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListQuery, deps: [{ token: NiceBaseListStore }], target: i0.ɵɵFactoryTarget.Injectable });
714
- NiceBaseListQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListQuery });
715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListQuery, decorators: [{
716
- type: Injectable
717
- }], ctorParameters: function () { return [{ type: NiceBaseListStore }]; } });
718
-
719
- var FilterType;
720
- (function (FilterType) {
721
- FilterType["Text"] = "text";
722
- FilterType["Number"] = "number";
723
- FilterType["Date"] = "date";
724
- FilterType["Select"] = "select";
725
- FilterType["Radio"] = "radio";
726
- })(FilterType || (FilterType = {}));
727
-
728
- var FilterOperatorTypes;
729
- (function (FilterOperatorTypes) {
730
- FilterOperatorTypes["Equal"] = "equal";
731
- FilterOperatorTypes["NotEqual"] = "not_equal";
732
- FilterOperatorTypes["In"] = "in";
733
- FilterOperatorTypes["NotIn"] = "not_in";
734
- FilterOperatorTypes["Less"] = "less";
735
- FilterOperatorTypes["LessOrEqual"] = "less_or_equal";
736
- FilterOperatorTypes["Greater"] = "greater";
737
- FilterOperatorTypes["GreaterOrEqual"] = "greater_or_equal";
738
- FilterOperatorTypes["Between"] = "between";
739
- FilterOperatorTypes["NotBetween"] = "not_between";
740
- FilterOperatorTypes["IsNull"] = "is_null";
741
- FilterOperatorTypes["IsNotNull"] = "is_not_null";
742
- FilterOperatorTypes["BeginsWith"] = "begins_with";
743
- FilterOperatorTypes["NotBeginsWith"] = "not_begins_with";
744
- FilterOperatorTypes["EndsWith"] = "ends_with";
745
- FilterOperatorTypes["NotEndsWith"] = "not_ends_with";
746
- FilterOperatorTypes["Contains"] = "contains";
747
- FilterOperatorTypes["NotContains"] = "not_contains";
748
- FilterOperatorTypes["IsEmpty"] = "is_empty";
749
- FilterOperatorTypes["IsNotEmpty"] = "is_not_empty";
750
- FilterOperatorTypes["None"] = "none";
751
- })(FilterOperatorTypes || (FilterOperatorTypes = {}));
752
-
753
- class QBFilterUtils {
754
- static isSingleInput(filterOperator) {
755
- if (!filterOperator) {
756
- return false;
757
- }
758
- return QBFilterUtils.singleInputOperators.includes(filterOperator);
759
- }
760
- static isDoubleInput(filterOperator) {
761
- if (!filterOperator) {
762
- return false;
763
- }
764
- return QBFilterUtils.doubleInputOperators.includes(filterOperator);
765
- }
766
- static isNoInput(filterOperator) {
767
- if (!filterOperator) {
768
- return false;
769
- }
770
- return QBFilterUtils.noInputOperators.includes(filterOperator);
771
- }
772
- static createRule(config, operator) {
773
- var _a, _b, _c;
774
- const base = {
775
- id: config.id,
776
- operation: operator || config.operators[0].id
777
- };
778
- switch (config.type) {
779
- case FilterType.Text:
780
- return Object.assign(Object.assign({}, base), { value: QBFilterUtils.isDoubleInput(operator) ? ["", ""] : "" });
781
- case FilterType.Select:
782
- return Object.assign(Object.assign({}, base), { value: QBFilterUtils.isDoubleInput(operator) ? [null, null] : null });
783
- case FilterType.Date:
784
- return Object.assign(Object.assign({}, base), { value: QBFilterUtils.isDoubleInput(operator) ? [new Date(), new Date()] : new Date() });
785
- case FilterType.Radio:
786
- return Object.assign(Object.assign({}, base), { value: QBFilterUtils.isDoubleInput(operator)
787
- ? [(_a = config.options) === null || _a === void 0 ? void 0 : _a[0].key, (_b = config.options) === null || _b === void 0 ? void 0 : _b[0].key]
788
- : (_c = config.options) === null || _c === void 0 ? void 0 : _c[0].key });
789
- case FilterType.Number:
790
- return Object.assign(Object.assign({}, base), { value: QBFilterUtils.isDoubleInput(operator) ? [0, 0] : 0 });
791
- }
792
- }
793
- static createQueryModel(config) {
794
- return {
795
- condition: "or",
796
- rules: [QBFilterUtils.createRule(config)]
797
- };
798
- }
799
- }
800
- QBFilterUtils.noInputOperators = [
801
- FilterOperatorTypes.IsEmpty,
802
- FilterOperatorTypes.IsNotEmpty,
803
- FilterOperatorTypes.IsNull,
804
- FilterOperatorTypes.IsNotNull,
805
- FilterOperatorTypes.None
806
- ];
807
- QBFilterUtils.singleInputOperators = [
808
- FilterOperatorTypes.Equal,
809
- FilterOperatorTypes.NotEqual,
810
- FilterOperatorTypes.Less,
811
- FilterOperatorTypes.LessOrEqual,
812
- FilterOperatorTypes.Greater,
813
- FilterOperatorTypes.GreaterOrEqual,
814
- FilterOperatorTypes.BeginsWith,
815
- FilterOperatorTypes.NotBeginsWith,
816
- FilterOperatorTypes.EndsWith,
817
- FilterOperatorTypes.NotEndsWith,
818
- FilterOperatorTypes.Contains,
819
- FilterOperatorTypes.NotContains
820
- ];
821
- QBFilterUtils.doubleInputOperators = [
822
- FilterOperatorTypes.Between,
823
- FilterOperatorTypes.NotBetween
824
- ];
825
-
826
- class NiceBaseListService {
827
- constructor(store, filterService, activatedRoute, router, appRef) {
828
- this.store = store;
829
- this.filterService = filterService;
830
- this.activatedRoute = activatedRoute;
831
- this.router = router;
832
- this.appRef = appRef;
833
- this.queryParamsLoaded$ = new Subject();
834
- this.downloadFileName = "data";
835
- this.unsubscribeAll$ = new Subject();
836
- this.loadingData = false;
837
- }
838
- init() {
839
- return __awaiter(this, void 0, void 0, function* () {
840
- this.store.setFilterConfigLoading(true);
841
- try {
842
- const filterConfig = yield this.filterService.getFilterConfig().toPromise();
843
- this.store.update({
844
- filterConfig
845
- });
846
- }
847
- catch (e) {
848
- this.store.setError(e);
849
- }
850
- finally {
851
- this.store.setFilterConfigLoading(false);
852
- }
853
- });
854
- }
855
- resetStore() {
856
- this.store.reset();
857
- }
858
- resetData() {
859
- this.store.update({
860
- filterResult: null
861
- });
862
- }
863
- closeSubscriptions() {
864
- this.unsubscribeAll$.next();
865
- this.unsubscribeAll$.complete();
866
- this.queryParamsLoaded$.complete();
867
- }
868
- disableList() {
869
- this.store.update({
870
- disabled: true
871
- });
872
- }
873
- enableList() {
874
- this.store.update({
875
- disabled: false
876
- });
877
- }
878
- setLoading(loading) {
879
- this.store.setLoading(loading);
880
- }
881
- setMode(mode) {
882
- this.store.update({
883
- mergePageResults: mode === "infinite-scroll"
884
- });
885
- }
886
- loadQueryParams(autoLoad) {
887
- var _a;
888
- (_a = this.activatedRoute) === null || _a === void 0 ? void 0 : _a.queryParams.pipe(takeUntil(this.unsubscribeAll$), map((params) => {
889
- return {
890
- params: QueryParamsUtils.extractFilterParameters(params)
891
- };
892
- })).subscribe(({ params }) => {
893
- if (!params || Object.keys(params).length === 0) {
894
- params = this.store.getValue().filterParameters;
895
- }
896
- const { filterParameters, filterResult } = this.store.getValue();
897
- if (FilterUtils.filterChangeNeedsRefresh(filterParameters, params) ||
898
- !filterResult) {
899
- if (autoLoad) {
900
- this.loadData(params, false);
901
- }
902
- else {
903
- this.setParameters(params, false);
904
- }
905
- }
906
- this.queryParamsLoaded$.next();
907
- });
908
- }
909
- resetAndLoadData(parameters, updateQueryParams = true) {
910
- return __awaiter(this, void 0, void 0, function* () {
911
- return this.loadData(parameters, updateQueryParams, true);
912
- });
913
- }
914
- loadData(parameters, updateQueryParams = true, reset = false) {
915
- return __awaiter(this, void 0, void 0, function* () {
916
- const { disabled } = this.store.getValue();
917
- try {
918
- const filterParameters = this.mergeParameters(parameters);
919
- if (!disabled) {
920
- this.store.setLoading(true);
921
- this.loadingData = true;
922
- const result = yield this.filterService.filter(this.getParameters(filterParameters)).toPromise();
923
- this.store.setResult(result, reset);
924
- }
925
- if (filterParameters) {
926
- this.setParameters(filterParameters, disabled ? false : updateQueryParams);
927
- }
928
- }
929
- catch (e) {
930
- this.store.setError(e);
931
- }
932
- finally {
933
- this.store.setLoading(false);
934
- this.loadingData = false;
935
- }
936
- });
937
- }
938
- searchData(search) {
939
- return __awaiter(this, void 0, void 0, function* () {
940
- const { filterParameters } = this.store.getValue();
941
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { search }));
942
- });
943
- }
944
- loadNewPage(start, length) {
945
- return __awaiter(this, void 0, void 0, function* () {
946
- const { filterParameters } = this.store.getValue();
947
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { start,
948
- length }));
949
- });
950
- }
951
- loadNextPage() {
952
- return __awaiter(this, void 0, void 0, function* () {
953
- const { filterParameters } = this.store.getValue();
954
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { start: filterParameters.start + filterParameters.length }));
955
- });
956
- }
957
- resetPaging() {
958
- return __awaiter(this, void 0, void 0, function* () {
959
- const { filterParameters } = this.store.getValue();
960
- this.store.setParameters(Object.assign(Object.assign({}, filterParameters), { start: 0 }));
961
- this.store.update({
962
- resetPaging: true
963
- });
964
- });
965
- }
966
- downloadData(type, parameters, updateQueryParams = true) {
967
- return __awaiter(this, void 0, void 0, function* () {
968
- try {
969
- this.store.setLoading(true);
970
- this.loadingData = true;
971
- const filterParameters = this.mergeParameters(parameters);
972
- if (filterParameters) {
973
- this.setParameters(filterParameters, updateQueryParams);
974
- }
975
- const result = yield this.filterService.getFile(type, this.getParameters(filterParameters)).toPromise();
976
- FileUtils.downloadFile(`${this.downloadFileName}.${type}`, result);
977
- }
978
- catch (e) {
979
- this.store.setError(e);
980
- }
981
- finally {
982
- this.store.setLoading(false);
983
- this.loadingData = false;
984
- }
985
- });
986
- }
987
- printData(parameters, updateQueryParams = true) {
988
- return __awaiter(this, void 0, void 0, function* () {
989
- try {
990
- this.store.setLoading(true);
991
- this.loadingData = true;
992
- const filterParameters = this.mergeParameters(parameters);
993
- if (filterParameters) {
994
- this.setParameters(filterParameters, updateQueryParams);
995
- }
996
- const result = yield this.filterService.getPrintableHtml(this.getParameters(filterParameters)).toPromise();
997
- FileUtils.openPrintableWindow(result);
998
- }
999
- catch (e) {
1000
- this.store.setError(e);
1001
- }
1002
- finally {
1003
- this.store.setLoading(false);
1004
- this.loadingData = false;
1005
- }
1006
- });
1007
- }
1008
- updateRule(id, newRule) {
1009
- var _a;
1010
- const { filterParameters } = this.store.getValue();
1011
- const rules = (_a = filterParameters.rules) === null || _a === void 0 ? void 0 : _a[0];
1012
- if (!rules || rules.rules.length === 0) {
1013
- this.updateRules([newRule]);
1014
- return;
1015
- }
1016
- const oldRule = rules.rules.find((r) => r.id === id);
1017
- let newRules = rules.rules;
1018
- if (oldRule) {
1019
- if (newRule) {
1020
- // Array replace
1021
- newRules = [
1022
- ...rules.rules.slice(0, rules.rules.indexOf(oldRule)),
1023
- newRule,
1024
- ...rules.rules.slice(rules.rules.indexOf(oldRule) + 1, rules.rules.length)
1025
- ];
1026
- }
1027
- else {
1028
- newRules = rules.rules.filter((r) => r.id !== id);
1029
- }
1030
- }
1031
- else {
1032
- newRules = [...newRules, newRule];
1033
- }
1034
- this.updateRules(newRules);
1035
- }
1036
- updateDefaultRules(rule) {
1037
- this.store.update({
1038
- defaultRules: rule
1039
- });
1040
- }
1041
- updateGlobalRules(rules, updateQueryParams = true) {
1042
- return __awaiter(this, void 0, void 0, function* () {
1043
- const { filterParameters } = this.store.getValue();
1044
- const newRules = Object.assign(Object.assign({}, filterParameters), { rules });
1045
- yield this.loadData(newRules, updateQueryParams);
1046
- });
1047
- }
1048
- addRuleFromConfig(config) {
1049
- const { filterParameters } = this.store.getValue();
1050
- const newRules = Object.assign(Object.assign({}, filterParameters), { rules: [
1051
- ...filterParameters.rules,
1052
- QBFilterUtils.createQueryModel(config)
1053
- ] });
1054
- this.store.update({
1055
- showQueryBuilder: true
1056
- });
1057
- this.loadData(newRules, true);
1058
- }
1059
- updateRules(rules) {
1060
- const { filterParameters } = this.store.getValue();
1061
- const newRules = {
1062
- order: filterParameters.order,
1063
- rules: [
1064
- {
1065
- condition: "and",
1066
- rules
1067
- }
1068
- ]
1069
- };
1070
- this.loadData(newRules, true);
1071
- }
1072
- toggleQueryBuilder() {
1073
- this.store.update((state) => ({
1074
- showQueryBuilder: !state.showQueryBuilder
1075
- }));
1076
- }
1077
- updateListValue(value, key = "id") {
1078
- const { filterResult } = this.store.getValue();
1079
- if (!filterResult) {
1080
- return;
1081
- }
1082
- this.store.update({
1083
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayUpsert(filterResult.values, value[key], value) })
1084
- });
1085
- }
1086
- removeListValue(value, key = "id") {
1087
- const { filterResult } = this.store.getValue();
1088
- if (!filterResult) {
1089
- return;
1090
- }
1091
- this.store.update({
1092
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayRemove(filterResult.values, value[key]) })
1093
- });
1094
- }
1095
- updateQueryParams(queryParams) {
1096
- return __awaiter(this, void 0, void 0, function* () {
1097
- if (!this.activatedRoute) {
1098
- return;
1099
- }
1100
- yield this.router.navigate([], {
1101
- relativeTo: this.activatedRoute,
1102
- queryParams,
1103
- queryParamsHandling: "merge"
1104
- });
1105
- });
1106
- }
1107
- getParameters(filterParameters) {
1108
- const { defaultRules } = this.store.getValue();
1109
- const parameters = Object.assign(Object.assign({}, filterParameters), { rules: (filterParameters === null || filterParameters === void 0 ? void 0 : filterParameters.rules) ? [...filterParameters.rules] : [] });
1110
- if (defaultRules === null || defaultRules === void 0 ? void 0 : defaultRules.length) {
1111
- parameters.rules.push({
1112
- condition: "and",
1113
- rules: defaultRules
1114
- });
1115
- }
1116
- return parameters;
1117
- }
1118
- mergeParameters(parameters) {
1119
- const { filterParameters } = this.store.getValue();
1120
- if (!parameters) {
1121
- return filterParameters;
1122
- }
1123
- return Object.assign(Object.assign(Object.assign({}, filterParameters), parameters), { order: filterParameters.order && !parameters.order
1124
- ? undefined
1125
- : Object.assign(Object.assign({}, filterParameters.order), parameters.order) });
1126
- }
1127
- setParameters(parameters, updateQueryParams = true) {
1128
- this.store.setParameters(parameters);
1129
- if (updateQueryParams) {
1130
- this.updateQueryParams(QueryParamsUtils.filterParametersToParamsMap(parameters));
1131
- }
1132
- }
1133
- }
1134
- NiceBaseListService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListService, deps: [{ token: NiceBaseListStore }, { token: NiceFilterService }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
1135
- NiceBaseListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListService });
1136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListService, decorators: [{
1137
- type: Injectable
1138
- }], ctorParameters: function () { return [{ type: NiceBaseListStore }, { type: NiceFilterService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i0.ApplicationRef }]; } });
1139
-
1140
- class QueryRuleForm {
1141
- constructor(rule) {
1142
- if (!rule) {
1143
- return;
1144
- }
1145
- this.id = rule.id;
1146
- this.operation = rule.operation;
1147
- if (QBFilterUtils.isDoubleInput(rule.operation)) {
1148
- this.value = rule.value[0];
1149
- this.secondValue = rule.value[1];
1150
- }
1151
- else {
1152
- this.value = rule.value;
1153
- }
1154
- }
1155
- transform() {
1156
- return {
1157
- id: this.id,
1158
- operation: this.operation,
1159
- value: this.secondValue === undefined ? this.value : [this.value, this.secondValue]
1160
- };
1161
- }
1162
- }
1163
- __decorate([
1164
- Control(),
1165
- Required(),
1166
- __metadata("design:type", String)
1167
- ], QueryRuleForm.prototype, "id", void 0);
1168
- __decorate([
1169
- Control(),
1170
- Required(),
1171
- __metadata("design:type", String)
1172
- ], QueryRuleForm.prototype, "operation", void 0);
1173
- __decorate([
1174
- Control(),
1175
- Required(),
1176
- __metadata("design:type", Object)
1177
- ], QueryRuleForm.prototype, "value", void 0);
1178
- __decorate([
1179
- Control(),
1180
- Required(),
1181
- __metadata("design:type", Object)
1182
- ], QueryRuleForm.prototype, "secondValue", void 0);
1183
- class QueryForm {
1184
- }
1185
- __decorate([
1186
- Control(),
1187
- Required(),
1188
- __metadata("design:type", String)
1189
- ], QueryForm.prototype, "condition", void 0);
1190
- __decorate([
1191
- Array$1(QueryRuleForm),
1192
- __metadata("design:type", Array$1)
1193
- ], QueryForm.prototype, "rules", void 0);
1194
- class QueryBuilderForm {
1195
- constructor(rules) {
1196
- if (!rules) {
1197
- rules = [];
1198
- }
1199
- this.rules = rules.map(x => ({
1200
- condition: x.condition,
1201
- rules: x.rules.map(rule => new QueryRuleForm(rule))
1202
- }));
1203
- }
1204
- transform() {
1205
- return this.rules.map(x => ({
1206
- condition: x.condition,
1207
- rules: x.rules.map(rule => rule.transform())
1208
- }));
1209
- }
1210
- }
1211
- __decorate([
1212
- Array$1(QueryForm),
1213
- __metadata("design:type", Array$1)
1214
- ], QueryBuilderForm.prototype, "rules", void 0);
1215
-
1216
- class FilterComponent {
1217
- constructor() {
1218
- this.valueIndex = -1;
1219
- this.propagateChanges = (_) => { };
1220
- }
1221
- get value() {
1222
- if (this.valueIndex < 0) {
1223
- return this._value;
1224
- }
1225
- else if (this._value instanceof Array) {
1226
- return this._value[this.valueIndex];
1227
- }
1228
- return undefined;
1229
- }
1230
- registerOnTouched(fn) {
1231
- // NO-OP
1232
- }
1233
- registerOnChange(fn) {
1234
- this.propagateChanges = fn;
1235
- }
1236
- writeValue(value) {
1237
- this._value = value;
1238
- }
1239
- onValueChange(value) {
1240
- if (this.valueIndex < 0) {
1241
- this.propagateChanges(value);
1242
- }
1243
- else if (this._value instanceof Array) {
1244
- const v = [...this._value];
1245
- v[this.valueIndex] = value;
1246
- this.propagateChanges(v);
1247
- }
1248
- }
1249
- }
1250
- FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1251
- FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: FilterComponent, selector: "ng-component", inputs: { valueIndex: "valueIndex" }, ngImport: i0, template: ``, isInline: true });
1252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, decorators: [{
1253
- type: Component,
1254
- args: [{ template: `` }]
1255
- }], propDecorators: { valueIndex: [{
1256
- type: Input
1257
- }] } });
1258
-
1259
- class TextFilterComponent extends FilterComponent {
1260
- }
1261
- TextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1262
- TextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: TextFilterComponent, selector: "nice-text-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1263
- {
1264
- provide: NG_VALUE_ACCESSOR,
1265
- useExisting: forwardRef(() => TextFilterComponent),
1266
- multi: true
1267
- }
1268
- ], usesInheritance: true, ngImport: i0, template: "<mat-form-field fxFlex>\n <input matInput [ngModel]=\"value\" (ngModelChange)=\"onValueChange($event)\" [mask]=\"(filterConfig?.mask) || ''\" [validation]=\"false\" type=\"text\" />\n</mat-form-field>\n", components: [{ type: i1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.MaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
1269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, decorators: [{
1270
- type: Component,
1271
- args: [{
1272
- selector: "nice-text-filter",
1273
- templateUrl: "text-filter.template.html",
1274
- encapsulation: ViewEncapsulation.None,
1275
- providers: [
1276
- {
1277
- provide: NG_VALUE_ACCESSOR,
1278
- useExisting: forwardRef(() => TextFilterComponent),
1279
- multi: true
1280
- }
1281
- ]
1282
- }]
1283
- }], propDecorators: { filterConfig: [{
1284
- type: Input
1285
- }] } });
1286
-
1287
- class NumberFilterComponent extends FilterComponent {
1288
- }
1289
- NumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1290
- NumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NumberFilterComponent, selector: "nice-number-filter", providers: [
1291
- {
1292
- provide: NG_VALUE_ACCESSOR,
1293
- useExisting: forwardRef(() => NumberFilterComponent),
1294
- multi: true
1295
- }
1296
- ], usesInheritance: true, ngImport: i0, template: "<mat-form-field fxFlex>\n <input matInput [ngModel]=\"value\" (ngModelChange)=\"onValueChange($event)\" type=\"number\" />\n</mat-form-field>\n", components: [{ type: i1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
1297
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, decorators: [{
1298
- type: Component,
1299
- args: [{
1300
- selector: "nice-number-filter",
1301
- templateUrl: "number-filter.template.html",
1302
- encapsulation: ViewEncapsulation.None,
1303
- providers: [
1304
- {
1305
- provide: NG_VALUE_ACCESSOR,
1306
- useExisting: forwardRef(() => NumberFilterComponent),
1307
- multi: true
1308
- }
1309
- ]
1310
- }]
1311
- }] });
1312
-
1313
- class RadioFilterComponent extends FilterComponent {
1314
- }
1315
- RadioFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1316
- RadioFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: RadioFilterComponent, selector: "nice-radio-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1317
- {
1318
- provide: NG_VALUE_ACCESSOR,
1319
- useExisting: forwardRef(() => RadioFilterComponent),
1320
- multi: true
1321
- }
1322
- ], usesInheritance: true, ngImport: i0, template: "<mat-radio-group fxFlex [ngModel]=\"value\" (ngModelChange)=\"onValueChange($event)\">\n <mat-radio-button class=\"mx-16\" *ngFor=\"let option of filterConfig.options\" [value]=\"option?.key\">\n {{ option?.name }}\n </mat-radio-button>\n</mat-radio-group>\n", components: [{ type: i1$2.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], directives: [{ type: i1$2.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
1323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, decorators: [{
1324
- type: Component,
1325
- args: [{
1326
- selector: "nice-radio-filter",
1327
- templateUrl: "radio-filter.template.html",
1328
- encapsulation: ViewEncapsulation.None,
1329
- providers: [
1330
- {
1331
- provide: NG_VALUE_ACCESSOR,
1332
- useExisting: forwardRef(() => RadioFilterComponent),
1333
- multi: true
1334
- }
1335
- ]
1336
- }]
1337
- }], propDecorators: { filterConfig: [{
1338
- type: Input
1339
- }] } });
1340
-
1341
- class SelectFilterComponent extends FilterComponent {
1342
- constructor(filterService) {
1343
- super();
1344
- this.filterService = filterService;
1345
- this.values = [];
1346
- this.search$ = new Subject();
1347
- }
1348
- ngOnInit() {
1349
- return __awaiter(this, void 0, void 0, function* () {
1350
- if (!this.filterConfig.lazyLoading) {
1351
- this.values = this.filterConfig.values;
1352
- }
1353
- this.searchSub$ = this.search$
1354
- .pipe(debounceTime(300), switchMap(value => {
1355
- if (this.filterConfig.lazyLoading) {
1356
- return this.filterService.searchFilterValue(this.filterConfig, value);
1357
- }
1358
- return of(this.filterConfig.values);
1359
- }))
1360
- .subscribe(values => {
1361
- this.values = values;
1362
- });
1363
- });
1364
- }
1365
- ngOnChanges(changes) {
1366
- if ("filterConfig" in changes) {
1367
- if (!this.filterConfig.lazyLoading) {
1368
- this.values = this.filterConfig.values;
1369
- }
1370
- }
1371
- }
1372
- searchValue() {
1373
- return __awaiter(this, void 0, void 0, function* () {
1374
- if (this.value && !this.values.find(v => v.id === this.value)) {
1375
- const value = yield this.filterService
1376
- .searchFilterResourceValue(this.filterConfig, this.value)
1377
- .toPromise();
1378
- this.values = [...this.values, value];
1379
- }
1380
- });
1381
- }
1382
- onValueChange(value) {
1383
- super.onValueChange(value);
1384
- this.searchValue();
1385
- }
1386
- ngOnDestroy() {
1387
- this.searchSub$.unsubscribe();
1388
- }
1389
- writeValue(value) {
1390
- super.writeValue(value);
1391
- this.searchValue();
1392
- }
1393
- }
1394
- SelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: SelectFilterComponent, deps: [{ token: NiceFilterService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1395
- SelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: SelectFilterComponent, selector: "nice-select-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1396
- {
1397
- provide: NG_VALUE_ACCESSOR,
1398
- useExisting: forwardRef(() => SelectFilterComponent),
1399
- multi: true
1400
- }
1401
- ], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<mat-form-field fxFlex>\n <nice-typeahead\n [ngModel]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n [items]=\"values\"\n [typeahead]=\"search$\"\n bindValue=\"id\"\n bindLabel=\"name\"\n ></nice-typeahead>\n</mat-form-field>\n", components: [{ type: i1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i18.NiceTypeaheadComponent, selector: "nice-typeahead", inputs: ["items", "labelFormatFn", "required", "disabled", "placeholder", "emptyPlaceholder", "allowNotFoundItems", "panelClass", "bindValue", "bindLabel", "typeahead", "page$", "loading", "loadingPage", "searchFn", "optionTemplate"], outputs: ["change"] }], directives: [{ type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
1402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: SelectFilterComponent, decorators: [{
1403
- type: Component,
1404
- args: [{
1405
- selector: "nice-select-filter",
1406
- templateUrl: "select-filter.template.html",
1407
- encapsulation: ViewEncapsulation.None,
1408
- providers: [
1409
- {
1410
- provide: NG_VALUE_ACCESSOR,
1411
- useExisting: forwardRef(() => SelectFilterComponent),
1412
- multi: true
1413
- }
1414
- ]
1415
- }]
1416
- }], ctorParameters: function () { return [{ type: NiceFilterService, decorators: [{
1417
- type: Optional
1418
- }] }]; }, propDecorators: { filterConfig: [{
1419
- type: Input
1420
- }] } });
1421
-
1422
- class DateFilterComponent extends FilterComponent {
1423
- }
1424
- DateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1425
- DateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: DateFilterComponent, selector: "nice-date-filter", providers: [
1426
- {
1427
- provide: NG_VALUE_ACCESSOR,
1428
- useExisting: forwardRef(() => DateFilterComponent),
1429
- multi: true
1430
- }
1431
- ], usesInheritance: true, ngImport: i0, template: "<mat-form-field fxFlex>\n <input matInput [matDatepicker]=\"picker\" [ngModel]=\"value\" (ngModelChange)=\"onValueChange($event)\" />\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>\n", components: [{ type: i1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["tabIndex", "disabled", "for", "aria-label", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1.MatSuffix, selector: "[matSuffix]" }], encapsulation: i0.ViewEncapsulation.None });
1432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, decorators: [{
1433
- type: Component,
1434
- args: [{
1435
- selector: "nice-date-filter",
1436
- templateUrl: "date-filter.template.html",
1437
- encapsulation: ViewEncapsulation.None,
1438
- providers: [
1439
- {
1440
- provide: NG_VALUE_ACCESSOR,
1441
- useExisting: forwardRef(() => DateFilterComponent),
1442
- multi: true
1443
- }
1444
- ]
1445
- }]
1446
- }] });
1447
-
1448
- class NiceFilterGroupService {
1449
- }
1450
-
1451
- class FilterGroupIconPipe {
1452
- constructor(service) {
1453
- this.service = service;
1454
- }
1455
- transform(value) {
1456
- return this.service.getFilterGroupIconClass(value);
1457
- }
1458
- }
1459
- FilterGroupIconPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, deps: [{ token: NiceFilterGroupService }], target: i0.ɵɵFactoryTarget.Pipe });
1460
- FilterGroupIconPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, name: "filterGroupIcon" });
1461
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, decorators: [{
1462
- type: Pipe,
1463
- args: [{
1464
- name: "filterGroupIcon"
1465
- }]
1466
- }], ctorParameters: function () { return [{ type: NiceFilterGroupService }]; } });
1467
-
1468
- class FilterSelectionComponent {
1469
- constructor() {
1470
- this.filterSelected = new EventEmitter();
1471
- }
1472
- get filterGroups() {
1473
- const groups = ArrayUtils.uniqueObjects(this.filterConfigs.map(x => x.group), x => x === null || x === void 0 ? void 0 : x.key);
1474
- const result = [];
1475
- for (const group of groups) {
1476
- if (!group) {
1477
- continue;
1478
- }
1479
- result.push([group, this.filterConfigs.filter(x => { var _a; return ((_a = x.group) === null || _a === void 0 ? void 0 : _a.key) === group.key; })]);
1480
- }
1481
- return result.sort(([, a], [, b]) => b.length - a.length);
1482
- }
1483
- selectFilter(filterConfigurationModel) {
1484
- this.filterSelected.emit(filterConfigurationModel);
1485
- }
1486
- }
1487
- FilterSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1488
- FilterSelectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: FilterSelectionComponent, selector: "nice-filter-selection", inputs: { filterConfigs: "filterConfigs", loading: "loading" }, outputs: { filterSelected: "filterSelected" }, ngImport: i0, template: "<mat-card fxLayout=\"row wrap\" class=\"filter-selection-container\" [niceLoadingOverlay]=\"loading\">\n <mat-list [fxFlex]=\"filterGroups.length > 1 ? 50 : 100\" *ngFor=\"let group of filterGroups\">\n <mat-list-item>\n <i mat-list-icon class=\"text-accent fal\" [ngClass]=\"group[0].key | filterGroupIcon\"></i>\n <strong mat-line>{{ group[0].name }}</strong>\n </mat-list-item>\n <mat-list-item (click)=\"selectFilter(filter)\" mat-ripple class=\"filter\" *ngFor=\"let filter of group[1]\">\n {{ filter?.name }}\n </mat-list-item>\n </mat-list>\n</mat-card>\n", styles: ["nice-filter-selection .filter-selection-container{min-width:150px;min-height:150px;max-width:600px;padding:8px}nice-filter-selection .mat-list-item{height:auto!important;min-height:32px!important;padding:16px}nice-filter-selection .mat-list-item strong{font-weight:700!important}nice-filter-selection .mat-list-item.filter{padding:8px 48px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px!important}@media screen and (max-width:959px){nice-filter-selection .mat-list-item.filter{padding:8px 24px}}"], components: [{ type: i9.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i2$1.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }], directives: [{ type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i18.NiceLoadingDirective, selector: "[niceLoadingOverlay]", inputs: ["niceLoadingOverlay"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i2$1.MatListIconCssMatStyler, selector: "[mat-list-icon], [matListIcon]" }, { type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i6.MatLine, selector: "[mat-line], [matLine]" }, { type: i6.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }], pipes: { "filterGroupIcon": FilterGroupIconPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1489
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, decorators: [{
1490
- type: Component,
1491
- args: [{
1492
- selector: "nice-filter-selection",
1493
- templateUrl: "filter-selection.template.html",
1494
- styleUrls: ["./filter-selection.style.scss"],
1495
- encapsulation: ViewEncapsulation.None,
1496
- changeDetection: ChangeDetectionStrategy.OnPush
1497
- }]
1498
- }], propDecorators: { filterConfigs: [{
1499
- type: Input
1500
- }], loading: [{
1501
- type: Input
1502
- }], filterSelected: [{
1503
- type: Output
1504
- }] } });
1505
-
1506
- class QueryBuilderTriggerDirective {
1507
- constructor(overlayPositionBuilder, elementRef, overlay, platform) {
1508
- this.overlayPositionBuilder = overlayPositionBuilder;
1509
- this.elementRef = elementRef;
1510
- this.overlay = overlay;
1511
- this.platform = platform;
1512
- this.queryBuilderFilterSelected = new EventEmitter();
1513
- }
1514
- set queryBuilderFilters(queryBuilderFilters) {
1515
- if (queryBuilderFilters) {
1516
- this._queryBuilderFilters = queryBuilderFilters;
1517
- }
1518
- this.updateFilterSelectionComponent();
1519
- }
1520
- set queryBuilderFiltersLoading(queryBuilderFiltersLoading) {
1521
- this._queryBuilderFiltersLoading = queryBuilderFiltersLoading;
1522
- this.updateFilterSelectionComponent();
1523
- }
1524
- click() {
1525
- const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([
1526
- {
1527
- originX: "center",
1528
- originY: "bottom",
1529
- overlayX: this.isMobile() ? "end" : "center",
1530
- overlayY: "top"
1531
- }
1532
- ]);
1533
- this.overlayRef = this.overlay.create({
1534
- positionStrategy,
1535
- hasBackdrop: true,
1536
- backdropClass: "cdk-overlay-transparent-backdrop"
1537
- });
1538
- const filterSelectionPortal = new ComponentPortal(FilterSelectionComponent);
1539
- this.filterSelectionRef = this.overlayRef.attach(filterSelectionPortal);
1540
- this.updateFilterSelectionComponent();
1541
- this.overlayRef.backdropClick().subscribe(() => this.close());
1542
- }
1543
- close() {
1544
- this.overlayRef.dispose();
1545
- }
1546
- updateFilterSelectionComponent() {
1547
- if (!this.filterSelectionRef) {
1548
- return;
1549
- }
1550
- this.filterSelectionRef.instance.filterConfigs = this._queryBuilderFilters;
1551
- this.filterSelectionRef.instance.loading = this._queryBuilderFiltersLoading;
1552
- this.filterSelectionRef.instance.filterSelected.subscribe((filter) => {
1553
- this.queryBuilderFilterSelected.emit(filter);
1554
- this.close();
1555
- });
1556
- }
1557
- isMobile() {
1558
- return this.platform.ANDROID || this.platform.IOS;
1559
- }
1560
- }
1561
- QueryBuilderTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderTriggerDirective, deps: [{ token: i1$3.OverlayPositionBuilder }, { token: i0.ElementRef }, { token: i1$3.Overlay }, { token: i2$2.Platform }], target: i0.ɵɵFactoryTarget.Directive });
1562
- QueryBuilderTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: QueryBuilderTriggerDirective, selector: "[niceQueryBuilderTrigger]", inputs: { queryBuilderFilters: "queryBuilderFilters", queryBuilderFiltersLoading: "queryBuilderFiltersLoading" }, outputs: { queryBuilderFilterSelected: "queryBuilderFilterSelected" }, host: { listeners: { "click": "click()" } }, ngImport: i0 });
1563
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderTriggerDirective, decorators: [{
1564
- type: Directive,
1565
- args: [{ selector: "[niceQueryBuilderTrigger]" }]
1566
- }], ctorParameters: function () { return [{ type: i1$3.OverlayPositionBuilder }, { type: i0.ElementRef }, { type: i1$3.Overlay }, { type: i2$2.Platform }]; }, propDecorators: { queryBuilderFilters: [{
1567
- type: Input
1568
- }], queryBuilderFiltersLoading: [{
1569
- type: Input
1570
- }], queryBuilderFilterSelected: [{
1571
- type: Output
1572
- }], click: [{
1573
- type: HostListener,
1574
- args: ["click"]
1575
- }] } });
1576
-
1577
- class RuleComponent {
1578
- constructor(formGroupName) {
1579
- this.formGroupName = formGroupName;
1580
- this.remove = new EventEmitter();
1581
- }
1582
- get filterConfig() {
1583
- var _a;
1584
- const rule = this.rules.at(0).value;
1585
- return (_a = this.filterConfigs) === null || _a === void 0 ? void 0 : _a.find(f => f.id === rule.id);
1586
- }
1587
- get isSingleInput() {
1588
- return !this.isDoubleInput && !this.isNoInput;
1589
- }
1590
- get isDoubleInput() {
1591
- return QBFilterUtils.isDoubleInput(this.filterOperator);
1592
- }
1593
- get isNoInput() {
1594
- return QBFilterUtils.isNoInput(this.filterOperator);
1595
- }
1596
- ngOnInit() {
1597
- this.formGroup = this.formGroupName.control;
1598
- this.rules = this.formGroup.get("rules");
1599
- this.filterOperator = this.rules.at(0).value.operation;
1600
- }
1601
- onUpdateFilterConfig(config) {
1602
- const rule = QBFilterUtils.createRule(config);
1603
- this.rules.patchValue([rule]);
1604
- this.filterOperator = rule.operation;
1605
- }
1606
- onClickOr() {
1607
- this.rules.push(QBFilterUtils.createRule(this.filterConfig, this.filterOperator));
1608
- }
1609
- onUpdateFilterOperator(operator) {
1610
- var _a, _b;
1611
- this.filterOperator = operator;
1612
- for (const rule of this.rules.controls) {
1613
- (_a = rule.get("operation")) === null || _a === void 0 ? void 0 : _a.patchValue(this.filterOperator);
1614
- if (this.isDoubleInput) {
1615
- (_b = rule.get("value")) === null || _b === void 0 ? void 0 : _b.patchValue([rule.value.value, rule.value.value]);
1616
- }
1617
- }
1618
- }
1619
- onClickDelete(index) {
1620
- if (this.rules.length > 1) {
1621
- this.rules.removeAt(index);
1622
- }
1623
- else {
1624
- this.remove.emit();
1625
- }
1626
- }
1627
- }
1628
- RuleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RuleComponent, deps: [{ token: i1$1.FormGroupName }], target: i0.ɵɵFactoryTarget.Component });
1629
- RuleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: RuleComponent, selector: "nice-rule", inputs: { filterConfigs: "filterConfigs" }, outputs: { remove: "remove" }, ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"10px\">\n <button\n fxFlex=\"150px\"\n class=\"select-filter\"\n mat-raised-button\n color=\"accent\"\n niceQueryBuilderTrigger\n [queryBuilderFilters]=\"filterConfigs\"\n (queryBuilderFilterSelected)=\"onUpdateFilterConfig($event)\"\n >\n <div fxFlex=\"row\" fxLayoutAlign=\"space-between center\">\n <div class=\"truncate\" fxFlex=\"0 1 90px\">{{ filterConfig?.name }}</div>\n <mat-icon fxFlex=\"24px\">arrow_drop_down</mat-icon>\n </div>\n </button>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxFlex=\"1 1 auto\" fxLayoutAlign=\"start center\" fxLayoutGap=\"10px\">\n <mat-form-field ngClass.lt-md=\"w-90-p\" fxFlex=\"0 0 188px\">\n <mat-select\n fxFlex=\"150px\"\n fxFlex.lt-md=\"100%\"\n [ngModel]=\"filterOperator\"\n (ngModelChange)=\"onUpdateFilterOperator($event)\"\n >\n <mat-option *ngFor=\"let operator of filterConfig?.operators\" [value]=\"operator.id\">\n {{ operator?.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <div fxFlex fxLayout=\"row wrap\" fxLayout.lt-md=\"column\" [formGroup]=\"formGroup\">\n <ng-container formArrayName=\"rules\">\n <div\n class=\"rule-container\"\n [fxFlex]=\"isDoubleInput ? '100%' : '50%'\"\n [formGroupName]=\"i\"\n fxFlex.lt-md=\"100%\"\n fxLayout.lt-md=\"column\"\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\"\n *ngFor=\"let rule of rules.controls; let i = index\"\n >\n <ng-container *ngIf=\"isSingleInput\">\n <ng-container [ngSwitch]=\"filterConfig?.type\">\n <nice-text-filter *ngSwitchCase=\"'text'\" fxFlex formControlName=\"value\" [filterConfig]=\"filterConfig\"></nice-text-filter>\n <nice-number-filter *ngSwitchCase=\"'number'\" fxFlex formControlName=\"value\"></nice-number-filter>\n <nice-radio-filter\n *ngSwitchCase=\"'radio'\"\n fxFlex\n formControlName=\"value\"\n [filterConfig]=\"filterConfig\"\n class=\"mb-16\"\n ></nice-radio-filter>\n <nice-select-filter\n *ngSwitchCase=\"'select'\"\n fxFlex\n formControlName=\"value\"\n [filterConfig]=\"filterConfig\"\n ></nice-select-filter>\n <nice-date-filter *ngSwitchCase=\"'date'\" fxFlex formControlName=\"value\"></nice-date-filter>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"isDoubleInput\">\n <ng-container [ngSwitch]=\"filterConfig?.type\">\n <nice-text-filter\n *ngSwitchCase=\"'text'\"\n [valueIndex]=\"0\"\n [filterConfig]=\"filterConfig\"\n fxFlex\n formControlName=\"secondValue\"\n ></nice-text-filter>\n <nice-number-filter\n *ngSwitchCase=\"'number'\"\n [valueIndex]=\"0\"\n fxFlex\n formControlName=\"secondValue\"\n ></nice-number-filter>\n <nice-radio-filter\n *ngSwitchCase=\"'radio'\"\n fxFlex\n formControlName=\"secondValue\"\n [filterConfig]=\"filterConfig\"\n [valueIndex]=\"0\"\n class=\"mb-16\"\n ></nice-radio-filter>\n <nice-select-filter\n *ngSwitchCase=\"'select'\"\n fxFlex\n formControlName=\"secondValue\"\n [filterConfig]=\"filterConfig\"\n [valueIndex]=\"0\"\n ></nice-select-filter>\n <nice-date-filter\n *ngSwitchCase=\"'date'\"\n [valueIndex]=\"0\"\n fxFlex\n formControlName=\"secondValue\"\n ></nice-date-filter>\n </ng-container>\n <h3 class=\"aligned-text\">\n {{ \"components.query_builder.rule.conditions.and\" | translate }}\n </h3>\n <ng-container [ngSwitch]=\"filterConfig?.type\">\n <nice-text-filter\n *ngSwitchCase=\"'text'\"\n [valueIndex]=\"1\"\n [filterConfig]=\"filterConfig\"\n fxFlex\n formControlName=\"value\"\n ></nice-text-filter>\n <nice-number-filter\n *ngSwitchCase=\"'number'\"\n [valueIndex]=\"1\"\n fxFlex\n formControlName=\"value\"\n ></nice-number-filter>\n <nice-radio-filter\n *ngSwitchCase=\"'radio'\"\n fxFlex\n formControlName=\"value\"\n [filterConfig]=\"filterConfig\"\n [valueIndex]=\"1\"\n class=\"mb-16\"\n ></nice-radio-filter>\n <nice-select-filter\n *ngSwitchCase=\"'select'\"\n fxFlex\n formControlName=\"value\"\n [filterConfig]=\"filterConfig\"\n [valueIndex]=\"1\"\n ></nice-select-filter>\n <nice-date-filter\n *ngSwitchCase=\"'date'\"\n [valueIndex]=\"1\"\n fxFlex\n formControlName=\"value\"\n ></nice-date-filter>\n </ng-container>\n </ng-container>\n <div fxLayout=\"row\" fxLayoutGap=\"8px\">\n <button mat-mini-fab class=\"or-button aligned-button\" (click)=\"onClickOr()\">\n {{ \"components.query_builder.rule.conditions.or\" | translate }}\n </button>\n <button class=\"aligned-button\" mat-icon-button color=\"warn\" (click)=\"onClickDelete(i)\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["nice-rule{background:transparent}nice-rule .select-filter{height:36px}nice-rule .aligned-button,nice-rule .select-filter{margin-bottom:1.25em}nice-rule .aligned-text{margin-bottom:2em}nice-rule .filter-select{margin-top:-14px}nice-rule .mat-form-field-infix{border:none}@media screen and (max-width:959px){nice-rule .mat-form-field-infix{max-width:150px}}nice-rule .rule-container{padding-left:12px;padding-right:12px}@media screen and (max-width:959px){nice-rule .rule-container{padding:0}}"], components: [{ type: i7.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: TextFilterComponent, selector: "nice-text-filter", inputs: ["filterConfig"] }, { type: NumberFilterComponent, selector: "nice-number-filter" }, { type: RadioFilterComponent, selector: "nice-radio-filter", inputs: ["filterConfig"] }, { type: SelectFilterComponent, selector: "nice-select-filter", inputs: ["filterConfig"] }, { type: DateFilterComponent, selector: "nice-date-filter" }], directives: [{ type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: QueryBuilderTriggerDirective, selector: "[niceQueryBuilderTrigger]", inputs: ["queryBuilderFilters", "queryBuilderFiltersLoading"], outputs: ["queryBuilderFilterSelected"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "translate": i1$4.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RuleComponent, decorators: [{
1631
- type: Component,
1632
- args: [{
1633
- selector: "nice-rule",
1634
- templateUrl: "rule.template.html",
1635
- styleUrls: ["./rule.style.scss"],
1636
- encapsulation: ViewEncapsulation.None
1637
- }]
1638
- }], ctorParameters: function () { return [{ type: i1$1.FormGroupName }]; }, propDecorators: { filterConfigs: [{
1639
- type: Input
1640
- }], remove: [{
1641
- type: Output
1642
- }] } });
1643
-
1644
- class QueryBuilderComponent {
1645
- constructor(formGroup) {
1646
- this.formGroup = formGroup;
1647
- this.close = new EventEmitter();
1648
- this.createReport = new EventEmitter();
1649
- this.updateReport = new EventEmitter();
1650
- this.propagateChanges = (_) => { };
1651
- this.rules = this.formGroup.get("rules");
1652
- }
1653
- get canSave() {
1654
- return !this.currentSavedReport;
1655
- }
1656
- registerOnChange(fn) {
1657
- this.propagateChanges = fn;
1658
- }
1659
- registerOnTouched(fn) { }
1660
- writeValue(rules) {
1661
- this.rules.clear();
1662
- this.formGroup.patchValue(new QueryBuilderForm(rules));
1663
- }
1664
- onClickAddRule(filterConfigurationModel) {
1665
- this.rules.push(QBFilterUtils.createQueryModel(filterConfigurationModel));
1666
- }
1667
- onClickDeleteRule(id) {
1668
- this.rules.removeAt(id);
1669
- if (this.rules.length === 0) {
1670
- this.close.emit();
1671
- this.onClickApply();
1672
- }
1673
- }
1674
- onClickApply() {
1675
- this.propagateChanges(this.formGroup.getRawValue().transform());
1676
- }
1677
- onClickSaveReport() {
1678
- this.createReport.emit();
1679
- }
1680
- onClickUpdateReport() {
1681
- this.updateReport.emit();
1682
- }
1683
- }
1684
- QueryBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderComponent, deps: [{ token: i1$5.GeneratedFormGroup }], target: i0.ɵɵFactoryTarget.Component });
1685
- QueryBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: QueryBuilderComponent, selector: "nice-query-builder", inputs: { filterConfigs: "filterConfigs", currentSavedReport: "currentSavedReport", loading: "loading" }, outputs: { close: "close", createReport: "createReport", updateReport: "updateReport" }, providers: [
1686
- {
1687
- provide: NG_VALUE_ACCESSOR,
1688
- useExisting: forwardRef(() => QueryBuilderComponent),
1689
- multi: true
1690
- },
1691
- {
1692
- provide: GeneratedFormGroup,
1693
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1694
- }
1695
- ], ngImport: i0, template: "<div class=\"rules-container\" fxLayout=\"column\" *ngIf=\"!loading\" [formGroup]=\"formGroup\">\n <ng-container formArrayName=\"rules\">\n <nice-rule\n *ngFor=\"let rule of rules.controls; let i = index\"\n (remove)=\"onClickDeleteRule(i)\"\n [filterConfigs]=\"filterConfigs\"\n [formGroupName]=\"i\"\n ></nice-rule>\n </ng-container>\n <div fxLayoutAlign=\"space-between\">\n <button\n class=\"add-button add-rule-button\"\n mat-mini-fab\n niceQueryBuilderTrigger\n [queryBuilderFilters]=\"filterConfigs\"\n (queryBuilderFilterSelected)=\"onClickAddRule($event)\"\n >\n <mat-icon>add</mat-icon>\n </button>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxLayoutGap=\"16px\">\n <!-- TODO: Support saved reports -->\n <!--<button mat-button color=\"primary\" (click)=\"onClickSaveReport()\" *ngIf=\"canSave\">\n <mat-icon class=\"mr-8\" fxHide.lt-md>save</mat-icon>\n {{ \"components.query_builder.save_report\" | translate }}\n </button>\n <button mat-button color=\"primary\" (click)=\"onClickUpdateReport()\" *ngIf=\"!canSave\">\n <mat-icon class=\"mr-8\" fxHide.lt-md>save</mat-icon>\n {{ \"components.query_builder.update_report\" | translate }}\n </button>-->\n <button mat-stroked-button color=\"accent\" (click)=\"onClickApply()\">\n {{ \"components.query_builder.update\" | translate }}\n <mat-icon class=\"ml-8\">refresh</mat-icon>\n </button>\n </div>\n </div>\n</div>\n", styles: ["nice-query-builder .rules-container{position:relative}nice-query-builder .rules-container:before{content:\"\";position:absolute;top:32px;bottom:32px;left:46px;width:4px;background:rgba(0,0,0,.12)}nice-query-builder .save-report-button{height:36px}nice-query-builder .add-rule-button{margin-left:28px;margin-right:28px}"], components: [{ type: RuleComponent, selector: "nice-rule", inputs: ["filterConfigs"], outputs: ["remove"] }, { type: i7.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: QueryBuilderTriggerDirective, selector: "[niceQueryBuilderTrigger]", inputs: ["queryBuilderFilters", "queryBuilderFiltersLoading"], outputs: ["queryBuilderFilterSelected"] }, { type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }], pipes: { "translate": i1$4.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1696
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderComponent, decorators: [{
1697
- type: Component,
1698
- args: [{
1699
- selector: "nice-query-builder",
1700
- templateUrl: "./query-builder.template.html",
1701
- styleUrls: ["./query-builder.style.scss"],
1702
- encapsulation: ViewEncapsulation.None,
1703
- providers: [
1704
- {
1705
- provide: NG_VALUE_ACCESSOR,
1706
- useExisting: forwardRef(() => QueryBuilderComponent),
1707
- multi: true
1708
- },
1709
- {
1710
- provide: GeneratedFormGroup,
1711
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1712
- }
1713
- ]
1714
- }]
1715
- }], ctorParameters: function () { return [{ type: i1$5.GeneratedFormGroup }]; }, propDecorators: { filterConfigs: [{
1716
- type: Input
1717
- }], currentSavedReport: [{
1718
- type: Input
1719
- }], loading: [{
1720
- type: Input
1721
- }], close: [{
1722
- type: Output
1723
- }], createReport: [{
1724
- type: Output
1725
- }], updateReport: [{
1726
- type: Output
1727
- }] } });
1728
-
1729
- class NiceBaseListComponent {
1730
- constructor(enableQueryBuilder, listLayout, columns, exportsSettings, query, service, activatedRoute, bottomSheet, router, mediaObserver) {
1731
- this.enableQueryBuilder = enableQueryBuilder;
1732
- this.listLayout = listLayout;
1733
- this.columns = columns;
1734
- this.exportsSettings = exportsSettings;
1735
- this.query = query;
1736
- this.service = service;
1737
- this.activatedRoute = activatedRoute;
1738
- this.bottomSheet = bottomSheet;
1739
- this.router = router;
1740
- this.mediaObserver = mediaObserver;
1741
- this.mode = "normal";
1742
- this.layout = "page";
1743
- this.layoutContent = LayoutContent.Table;
1744
- this.autoChangeLayout = true;
1745
- this.autoLoad = true;
1746
- this.canExport = true;
1747
- this.disableRouting = false;
1748
- this.customExport = [];
1749
- this.newPage = new EventEmitter();
1750
- this.defaultPageSizeOptions = [10, 25, 50, 100];
1751
- this.columnNames = [];
1752
- this.loading$ = this.query.selectLoading();
1753
- this.filterResult$ = this.query.selectFilterResult();
1754
- this.data$ = this.query.selectData();
1755
- this.recordsFiltered$ = this.filterResult$.pipe(map(f => f && f.total));
1756
- this.showQueryBuilder$ = this.query.selectShowQueryBuilder();
1757
- this.filterParameters$ = this.query.selectFilterParameters();
1758
- this.index$ = this.filterParameters$.pipe(map(f => { var _a, _b; return Math.floor(((_a = f.start) !== null && _a !== void 0 ? _a : 0) / ((_b = f.length) !== null && _b !== void 0 ? _b : 1)); }));
1759
- this.length$ = this.filterParameters$.pipe(map(f => f.length));
1760
- this.isEmpty$ = this.recordsFiltered$.pipe(map(r => r === 0));
1761
- this.searchQuery$ = this.filterParameters$.pipe(map(f => f.search));
1762
- this.filterConfig$ = this.query.selectFilterConfig();
1763
- this.sortColumn$ = this.filterParameters$.pipe(map(f => { var _a; return (_a = (f.order && f.order.column)) !== null && _a !== void 0 ? _a : ""; }));
1764
- this.sortDirection$ = this.filterParameters$.pipe(map(f => f.order && f.order.direction));
1765
- this.filterConfigLoading$ = this.query.selectFilterConfigLoading();
1766
- this.rules$ = this.filterParameters$.pipe(map(parameters => parameters.rules));
1767
- this.rulesCount$ = this.filterParameters$.pipe(map(parameters => { var _a, _b; return (_b = (_a = parameters.rules) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; }));
1768
- this.searchText$ = new Subject();
1769
- this.setColumn(columns);
1770
- }
1771
- get prefixButtons() {
1772
- var _a, _b;
1773
- return (_b = (_a = this.buttons) === null || _a === void 0 ? void 0 : _a.find(x => x.position === "prefix")) === null || _b === void 0 ? void 0 : _b.template;
1774
- }
1775
- get suffixButtons() {
1776
- var _a, _b;
1777
- return (_b = (_a = this.buttons) === null || _a === void 0 ? void 0 : _a.find(x => x.position === "suffix")) === null || _b === void 0 ? void 0 : _b.template;
1778
- }
1779
- ngOnInit() {
1780
- return __awaiter(this, void 0, void 0, function* () {
1781
- yield this.service.init();
1782
- this.service.loadQueryParams(this.autoLoad);
1783
- this.searchText$
1784
- .pipe(debounceTime(300), distinctUntilChanged(), switchMap((search) => {
1785
- this.service.resetPaging();
1786
- return this.service.searchData(search);
1787
- }))
1788
- .subscribe();
1789
- this.mediaObserver.asObservable().subscribe(() => {
1790
- if (!this.autoChangeLayout) {
1791
- return;
1792
- }
1793
- if (this.mediaObserver.isActive("lt-md") && this.layoutContent === LayoutContent.Table) {
1794
- this.layoutContent = LayoutContent.Cards;
1795
- }
1796
- else {
1797
- this.layoutContent = LayoutContent.Table;
1798
- }
1799
- });
1800
- });
1801
- }
1802
- ngOnDestroy() {
1803
- this.service.closeSubscriptions();
1804
- }
1805
- ngOnChanges(changes) {
1806
- if ("mode" in changes) {
1807
- this.service.setMode(changes.mode.currentValue);
1808
- }
1809
- }
1810
- setLoading(loading) {
1811
- this.service.setLoading(loading);
1812
- }
1813
- clickToggleShowQueryBuilder() {
1814
- this.service.toggleQueryBuilder();
1815
- }
1816
- onUpdateRules(rules) {
1817
- this.service.updateGlobalRules(rules);
1818
- }
1819
- onQueryBuilderFilterSelected(filterConfigurationModel) {
1820
- this.service.addRuleFromConfig(filterConfigurationModel);
1821
- }
1822
- onUpdatePage(pageEvent) {
1823
- this.service.loadNewPage(pageEvent.pageIndex * pageEvent.pageSize, pageEvent.pageSize);
1824
- this.newPage.emit(pageEvent);
1825
- }
1826
- onUpdateSearch(search) {
1827
- this.searchText$.next(search);
1828
- }
1829
- getFilterRule$(id) {
1830
- return this.filterParameters$.pipe(map(f => {
1831
- return (f.rules &&
1832
- f.rules[0] &&
1833
- f.rules[0].rules &&
1834
- f.rules[0].rules.find((r) => r.id === id));
1835
- }));
1836
- }
1837
- onUpdateSort(sort) {
1838
- if (!sort.active || !sort.direction) {
1839
- sort = {
1840
- active: "id",
1841
- direction: "asc"
1842
- };
1843
- }
1844
- this.service.loadData({
1845
- order: sort.active && sort.direction ? { column: sort.active, direction: sort.direction } : null
1846
- });
1847
- }
1848
- updateRule(id, newRule) {
1849
- this.service.updateRule(id, newRule);
1850
- }
1851
- updateRules(rules) {
1852
- this.service.updateRules(rules);
1853
- }
1854
- clickExport() {
1855
- const exports = [];
1856
- if (this.exportsSettings.xlsx) {
1857
- exports.push({
1858
- type: "xlsx",
1859
- onClickExport: () => this.clickXlsx()
1860
- });
1861
- }
1862
- else if (this.exportsSettings.csv) {
1863
- exports.push({
1864
- type: "csv",
1865
- onClickExport: () => this.clickCsv()
1866
- });
1867
- }
1868
- else if (this.exportsSettings.pdf) {
1869
- exports.push({
1870
- type: "pdf",
1871
- onClickExport: () => this.clickPdf()
1872
- });
1873
- }
1874
- this.bottomSheet.open(ExportBottomSheetComponent, {
1875
- data: {
1876
- exportStrategies: [
1877
- ...exports,
1878
- ...this.customExport
1879
- ]
1880
- }
1881
- });
1882
- }
1883
- navigate(item) {
1884
- if (this.navigateFn) {
1885
- this.navigateFn(this.baseRoute, item);
1886
- }
1887
- else {
1888
- const route = this.routeFn ? this.routeFn(item) : [(this.baseRoute || "") + (item === null || item === void 0 ? void 0 : item.id)];
1889
- this.router.navigate(typeof route === "string" ? [route] : route, { relativeTo: this.activatedRoute });
1890
- }
1891
- }
1892
- clickXlsx() {
1893
- this.service.downloadData("xlsx");
1894
- }
1895
- clickCsv() {
1896
- this.service.downloadData("csv");
1897
- }
1898
- clickPrint() {
1899
- this.service.printData();
1900
- }
1901
- clickPdf() {
1902
- this.service.downloadData("pdf");
1903
- }
1904
- setColumn(columns) {
1905
- this.columns = columns;
1906
- this.columnNames = columns.map(x => x.id);
1907
- }
1908
- }
1909
- NiceBaseListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListComponent, deps: [{ token: ENABLE_QUERY_BUILDER, optional: true }, { token: BASE_LIST_LAYOUT }, { token: TABLE_COLUMNS }, { token: EXPORTS_SETTINGS }, { token: NiceBaseListQuery }, { token: NiceBaseListService }, { token: i3.ActivatedRoute }, { token: i4$1.MatBottomSheet }, { token: i3.Router }, { token: i4.MediaObserver }], target: i0.ɵɵFactoryTarget.Component });
1910
- NiceBaseListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NiceBaseListComponent, selector: "nice-base-list", inputs: { mode: "mode", layout: "layout", layoutContent: "layoutContent", autoChangeLayout: "autoChangeLayout", baseRoute: "baseRoute", routeFn: "routeFn", navigateFn: "navigateFn", autoLoad: "autoLoad", pageTitle: "pageTitle", canExport: "canExport", disableRouting: "disableRouting", customExport: "customExport" }, outputs: { newPage: "newPage" }, providers: [
1911
- NiceBaseListQuery,
1912
- NiceBaseListService,
1913
- NiceBaseListStore
1914
- ], queries: [{ propertyName: "title", first: true, predicate: NiceBaseListTitleDirective, descendants: true, read: TemplateRef }, { propertyName: "table", first: true, predicate: NiceBaseListTableDirective, descendants: true, read: TemplateRef }, { propertyName: "cards", first: true, predicate: NiceBaseListCardsDirective, descendants: true, read: TemplateRef }, { propertyName: "customContent", first: true, predicate: NiceBaseListCustomContentDirective, descendants: true, read: TemplateRef }, { propertyName: "filters", first: true, predicate: NiceBaseListFiltersDirective, descendants: true, read: TemplateRef }, { propertyName: "buttons", predicate: NiceBaseListButtonsDirective }], usesOnChanges: true, ngImport: i0, template: "<div class=\"list page-layout carded fullwidth inner-scroll\" *ngIf=\"layout === 'page'; else content\">\n <div class=\"center\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container *ngIf=\"listLayout.xl\">\n <div fxHide fxShow.xl>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.xl }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.lg\">\n <div fxHide fxShow.lg>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.lg }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.md\">\n <div fxHide fxShow.md>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.md }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.sm\">\n <div fxHide fxShow.sm>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.sm }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.xs\">\n <div fxHide fxShow.xs>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.xs }\"></ng-container>\n </div>\n </ng-container>\n\n <div\n [fxHide.xs]=\"!!listLayout.xs\"\n [fxHide.sm]=\"!!listLayout.sm\"\n [fxHide.md]=\"!!listLayout.md\"\n [fxHide.lg]=\"!!listLayout.lg\"\n [fxHide.xl]=\"!!listLayout.xl\"\n >\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.default }\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #pageLayout let-layout=\"layout\">\n <ng-container *ngIf=\"layout?.length; else isObject\">\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: { type: 'column', items: layout } }\"></ng-container>\n </ng-container>\n\n <ng-template #isObject>\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: layout }\"></ng-container>\n </ng-template>\n</ng-template>\n\n<ng-template #contentLayout let-layout=\"layout\">\n <div [fxFlex]=\"layout.flex\" [fxLayout]=\"layout.type\" [fxLayoutAlign]=\"layout.align || ''\" [ngClass]=\"layout.classes\">\n <ng-container *ngFor=\"let item of layout.items\">\n <ng-container *ngIf=\"item.name; else childIsLayout\">\n <ng-container *ngTemplateOutlet=\"layoutItem; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-template #childIsLayout>\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: item }\"></ng-container>\n </ng-template>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #layoutItem let-item=\"item\">\n <ng-container *ngIf=\"item.name === 'title' && title\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'search'\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <div class=\"search-wrapper mx-md-0\">\n <div class=\"search\" fxFlex fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>search</mat-icon>\n <input [ngModel]=\"searchQuery$ | async\" (ngModelChange)=\"onUpdateSearch($event)\" [placeholder]=\"'general.search' | translate\" />\n <ng-container *ngIf=\"enableQueryBuilder\">\n <button\n *ngIf=\"!(showQueryBuilder$ | async) && !(rulesCount$ | async)\"\n mat-icon-button\n niceQueryBuilderTrigger\n [queryBuilderFilters]=\"filterConfig$ | async\"\n [queryBuilderFiltersLoading]=\"(filterConfigLoading$ | async) || false\"\n (queryBuilderFilterSelected)=\"onQueryBuilderFilterSelected($event)\"\n [matTooltip]=\"'general.query_builder.show_advanced_search' | translate\"\n >\n <mat-icon\n [matBadge]=\"rulesCount$ | async\"\n [matBadgeHidden]=\"!(rulesCount$ | async)\"\n matBadgeColor=\"accent\"\n >\n filter_list\n </mat-icon>\n </button>\n <button\n mat-icon-button\n *ngIf=\"!(showQueryBuilder$ | async) && (rulesCount$ | async)\"\n [disabled]=\"filterConfigLoading$ | async\"\n (click)=\"clickToggleShowQueryBuilder()\"\n [matTooltip]=\"'general.query_builder.show_advanced_search' | translate\"\n >\n <mat-icon\n [matBadge]=\"rulesCount$ | async\"\n [matBadgeHidden]=\"!(rulesCount$ | async)\"\n matBadgeColor=\"accent\"\n >\n filter_list\n </mat-icon>\n </button>\n <button\n mat-icon-button\n *ngIf=\"showQueryBuilder$ | async\"\n (click)=\"clickToggleShowQueryBuilder()\"\n [matTooltip]=\"'general.query_builder.close_advanced_search' | translate\"\n >\n <mat-icon>\n clear\n </mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'prefixButtons' && prefixButtons\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"prefixButtons\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'suffixButtons' && suffixButtons\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"suffixButtons\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'exportButtons' && canExport\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\" [class.mr-2]=\"!!suffixButtons\" [class.ml-2]=\"!!prefixButtons\">\n <button\n (click)=\"clickPrint()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.print' | translate\"\n class=\"list-button mr-2\"\n mat-mini-fab\n >\n <mat-icon>print</mat-icon>\n </button>\n\n <button\n (click)=\"clickExport()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.export' | translate\"\n class=\"list-button mr-2\"\n mat-mini-fab\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'content'\">\n <ng-container *ngIf=\"layoutContent === 'table' && table\">\n <ng-container *ngTemplateOutlet=\"tableLayout; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"layoutContent === 'cards' && cards\">\n <ng-container *ngTemplateOutlet=\"cardsLayout; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"layoutContent === 'custom' && customContent\">\n <ng-container *ngTemplateOutlet=\"customLayout; context: { item: item }\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'pagination' && layoutContent !== 'custom'\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <mat-paginator\n (page)=\"onUpdatePage($event)\"\n [length]=\"recordsFiltered$ | async\"\n [pageIndex]=\"index$ | async\"\n [pageSizeOptions]=\"defaultPageSizeOptions\"\n [pageSize]=\"length$ | async\"\n [showFirstLastButtons]=\"true\"\n >\n </mat-paginator>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'queryBuilder' && enableQueryBuilder\">\n <div fxLayout=\"column\" *ngIf=\"showQueryBuilder$ | async\">\n <mat-card class=\"my-4\" [niceLoadingOverlay]=\"filterConfigLoading$ | async\">\n <mat-card-content fxLayout=\"column\">\n <div fxFlex>\n <nice-query-builder\n [filterConfigs]=\"filterConfig$ | async\"\n [ngModel]=\"rules$ | async\"\n (ngModelChange)=\"onUpdateRules($event)\"\n (close)=\"clickToggleShowQueryBuilder()\"\n ></nice-query-builder>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'filters' && filters\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"filters\"></ng-container>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tableLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <div\n [niceLoadingOverlay]=\"loading$ | async\"\n class=\"content-card base-list\"\n fxLayout=\"column\"\n fxLayoutAlign=\"space-between\"\n >\n <mat-table\n (matSortChange)=\"onUpdateSort($event)\"\n [dataSource]=\"data$\"\n [matSortActive]=\"(sortColumn$ | async) || ''\"\n [matSortDirection]=\"(sortDirection$ | async) || ''\"\n fxFlex=\"1 1 auto\"\n matSort\n >\n <mat-header-row *matHeaderRowDef=\"columnNames; sticky: true\"></mat-header-row>\n\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <ng-container *ngIf=\"column.sortable\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, header: true }\"\n ></ng-container>\n </mat-header-cell>\n </ng-container>\n <ng-container *ngIf=\"!column.sortable\">\n <mat-header-cell *matHeaderCellDef>\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, header: true }\"\n ></ng-container>\n </mat-header-cell>\n </ng-container>\n\n <mat-cell *matCellDef=\"let item\">\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, data: true, item: item }\"\n ></ng-container>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngIf=\"disableRouting; else withRouting\">\n <mat-row *matRowDef=\"let item; columns: columnNames;\" class=\"item\"></mat-row>\n </ng-container>\n\n <ng-template #withRouting>\n <mat-row\n *matRowDef=\"let item; columns: columnNames;\"\n (click)=\"navigate(item)\"\n class=\"item clickable\"\n matRipple\n >\n </mat-row>\n </ng-template>\n </mat-table>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cardsLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngFor=\"let data of data$ | async\">\n <ng-container *ngTemplateOutlet=\"cards; context: { item: data }\"></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #customLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"customContent; context: { data: data$ | async }\"></ng-container>\n </div>\n</ng-template>\n", components: [{ type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i7.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i9.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: QueryBuilderComponent, selector: "nice-query-builder", inputs: ["filterConfigs", "currentSavedReport", "loading"], outputs: ["close", "createReport", "updateReport"] }, { type: i11.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i11.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "arrowPosition", "disableClear", "mat-sort-header", "start"], exportAs: ["matSortHeader"] }, { type: i11.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: QueryBuilderTriggerDirective, selector: "[niceQueryBuilderTrigger]", inputs: ["queryBuilderFilters", "queryBuilderFiltersLoading"], outputs: ["queryBuilderFilterSelected"] }, { type: i16.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i17.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgePosition", "matBadgeSize", "matBadgeColor", "matBadgeOverlap", "matBadgeDescription", "matBadgeHidden", "matBadge"] }, { type: i18.NiceLoadingDirective, selector: "[niceLoadingOverlay]", inputs: ["niceLoadingOverlay"] }, { type: i9.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i12.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortActive"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i11.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i11.MatCellDef, selector: "[matCellDef]" }, { type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i11.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i6.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }], pipes: { "async": i13.AsyncPipe, "translate": i1$4.TranslatePipe } });
1915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListComponent, decorators: [{
1916
- type: Component,
1917
- args: [{
1918
- selector: "nice-base-list",
1919
- templateUrl: "./base-list.template.html",
1920
- providers: [
1921
- NiceBaseListQuery,
1922
- NiceBaseListService,
1923
- NiceBaseListStore
1924
- ]
1925
- }]
1926
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1927
- type: Optional
1928
- }, {
1929
- type: Inject,
1930
- args: [ENABLE_QUERY_BUILDER]
1931
- }] }, { type: undefined, decorators: [{
1932
- type: Inject,
1933
- args: [BASE_LIST_LAYOUT]
1934
- }] }, { type: undefined, decorators: [{
1935
- type: Inject,
1936
- args: [TABLE_COLUMNS]
1937
- }] }, { type: undefined, decorators: [{
1938
- type: Inject,
1939
- args: [EXPORTS_SETTINGS]
1940
- }] }, { type: NiceBaseListQuery }, { type: NiceBaseListService }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }]; }, propDecorators: { title: [{
1941
- type: ContentChild,
1942
- args: [NiceBaseListTitleDirective, { read: TemplateRef }]
1943
- }], buttons: [{
1944
- type: ContentChildren,
1945
- args: [NiceBaseListButtonsDirective]
1946
- }], table: [{
1947
- type: ContentChild,
1948
- args: [NiceBaseListTableDirective, { read: TemplateRef }]
1949
- }], cards: [{
1950
- type: ContentChild,
1951
- args: [NiceBaseListCardsDirective, { read: TemplateRef }]
1952
- }], customContent: [{
1953
- type: ContentChild,
1954
- args: [NiceBaseListCustomContentDirective, { read: TemplateRef }]
1955
- }], filters: [{
1956
- type: ContentChild,
1957
- args: [NiceBaseListFiltersDirective, { read: TemplateRef }]
1958
- }], mode: [{
1959
- type: Input
1960
- }], layout: [{
1961
- type: Input
1962
- }], layoutContent: [{
1963
- type: Input
1964
- }], autoChangeLayout: [{
1965
- type: Input
1966
- }], baseRoute: [{
1967
- type: Input
1968
- }], routeFn: [{
1969
- type: Input
1970
- }], navigateFn: [{
1971
- type: Input
1972
- }], autoLoad: [{
1973
- type: Input
1974
- }], pageTitle: [{
1975
- type: Input
1976
- }], canExport: [{
1977
- type: Input
1978
- }], disableRouting: [{
1979
- type: Input
1980
- }], customExport: [{
1981
- type: Input
1982
- }], newPage: [{
1983
- type: Output
1984
- }] } });
1985
-
1986
- class NiceCustomDateAdapter extends NativeDateAdapter {
1987
- constructor(translateService, locale, platform) {
1988
- super(locale, platform);
1989
- this.translateService = translateService;
1990
- this.setLocale(this.translateService.getDefaultLang());
1991
- // @ts-ignore
1992
- this._format = (dtf, date) => {
1993
- return dtf.format(date);
1994
- };
1995
- }
1996
- format(date, displayFormat) {
1997
- return super.format(date, displayFormat);
1998
- }
1999
- getDate(date) {
2000
- return date.getUTCDate();
2001
- }
2002
- getMonth(date) {
2003
- return date.getUTCMonth();
2004
- }
2005
- getYear(date) {
2006
- return date.getUTCFullYear();
2007
- }
2008
- }
2009
- NiceCustomDateAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter, deps: [{ token: i1$4.TranslateService }, { token: MAT_DATE_LOCALE }, { token: i2$2.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
2010
- NiceCustomDateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter });
2011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter, decorators: [{
2012
- type: Injectable
2013
- }], ctorParameters: function () { return [{ type: i1$4.TranslateService }, { type: undefined, decorators: [{
2014
- type: Inject,
2015
- args: [MAT_DATE_LOCALE]
2016
- }] }, { type: i2$2.Platform }]; } });
2017
-
2018
- class QueryBuilderModule {
2019
- }
2020
- QueryBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2021
- QueryBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, declarations: [QueryBuilderComponent,
2022
- QueryBuilderTriggerDirective,
2023
- FilterSelectionComponent,
2024
- RuleComponent,
2025
- SelectFilterComponent,
2026
- TextFilterComponent,
2027
- NumberFilterComponent,
2028
- RadioFilterComponent,
2029
- DateFilterComponent,
2030
- FilterGroupIconPipe], imports: [CommonModule,
2031
- FormsModule,
2032
- TranslateModule,
2033
- OverlayModule,
2034
- MatCardModule,
2035
- MatListModule,
2036
- FlexLayoutModule,
2037
- MatButtonModule,
2038
- MatRippleModule,
2039
- MatIconModule,
2040
- MatSelectModule,
2041
- MatInputModule,
2042
- MatDatepickerModule,
2043
- MatRadioModule,
2044
- NiceLoadingSpinnerModule,
2045
- NiceTypeaheadModule,
2046
- ReactiveFormsModule,
2047
- NgxMaskModule], exports: [QueryBuilderComponent, QueryBuilderTriggerDirective] });
2048
- QueryBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }], imports: [[
2049
- CommonModule,
2050
- FormsModule,
2051
- TranslateModule,
2052
- OverlayModule,
2053
- MatCardModule,
2054
- MatListModule,
2055
- FlexLayoutModule,
2056
- MatButtonModule,
2057
- MatRippleModule,
2058
- MatIconModule,
2059
- MatSelectModule,
2060
- MatInputModule,
2061
- MatDatepickerModule,
2062
- MatRadioModule,
2063
- NiceLoadingSpinnerModule,
2064
- NiceTypeaheadModule,
2065
- ReactiveFormsModule,
2066
- NgxMaskModule
2067
- ]] });
2068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, decorators: [{
2069
- type: NgModule,
2070
- args: [{
2071
- imports: [
2072
- CommonModule,
2073
- FormsModule,
2074
- TranslateModule,
2075
- OverlayModule,
2076
- MatCardModule,
2077
- MatListModule,
2078
- FlexLayoutModule,
2079
- MatButtonModule,
2080
- MatRippleModule,
2081
- MatIconModule,
2082
- MatSelectModule,
2083
- MatInputModule,
2084
- MatDatepickerModule,
2085
- MatRadioModule,
2086
- NiceLoadingSpinnerModule,
2087
- NiceTypeaheadModule,
2088
- ReactiveFormsModule,
2089
- NgxMaskModule
2090
- ],
2091
- declarations: [
2092
- QueryBuilderComponent,
2093
- QueryBuilderTriggerDirective,
2094
- FilterSelectionComponent,
2095
- RuleComponent,
2096
- SelectFilterComponent,
2097
- TextFilterComponent,
2098
- NumberFilterComponent,
2099
- RadioFilterComponent,
2100
- DateFilterComponent,
2101
- FilterGroupIconPipe
2102
- ],
2103
- providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }],
2104
- exports: [QueryBuilderComponent, QueryBuilderTriggerDirective]
2105
- }]
2106
- }] });
2107
-
2108
- class NiceBaseListModule {
2109
- static forRoot(options) {
2110
- var _a;
2111
- return {
2112
- ngModule: NiceBaseListModule,
2113
- providers: [
2114
- {
2115
- provide: BASE_LIST_LAYOUT,
2116
- useValue: (_a = options === null || options === void 0 ? void 0 : options.layout) !== null && _a !== void 0 ? _a : defaultLayout
2117
- },
2118
- ...((options === null || options === void 0 ? void 0 : options.queryBuilder) ? [
2119
- {
2120
- provide: ENABLE_QUERY_BUILDER,
2121
- useValue: true
2122
- },
2123
- {
2124
- provide: NiceFilterGroupService,
2125
- useClass: options.queryBuilder.filterGroupService
2126
- },
2127
- options.queryBuilder.savedReportService ? {
2128
- provide: NiceSavedReportService,
2129
- useClass: options.queryBuilder.savedReportService
2130
- } : undefined
2131
- ] : [])
2132
- ].filter(x => !!x)
2133
- };
2134
- }
2135
- static providerFactory(options) {
2136
- var _a;
2137
- return [
2138
- {
2139
- provide: NiceFilterService,
2140
- useClass: options.filterService
2141
- },
2142
- {
2143
- provide: LIST_TABLE,
2144
- useValue: options.table
2145
- },
2146
- {
2147
- provide: TABLE_COLUMNS,
2148
- useValue: options.columns,
2149
- },
2150
- {
2151
- provide: DEFAULT_PARAMETERS,
2152
- useValue: options.defaultParameters
2153
- },
2154
- options.layout ? {
2155
- provide: BASE_LIST_LAYOUT,
2156
- useValue: options.layout
2157
- } : undefined,
2158
- {
2159
- provide: EXPORTS_SETTINGS,
2160
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2161
- pdf: true,
2162
- xlsx: true,
2163
- csv: true
2164
- }
2165
- },
2166
- options.disableQueryBuilder !== undefined ? {
2167
- provide: ENABLE_QUERY_BUILDER,
2168
- useValue: !options.disableQueryBuilder
2169
- } : null,
2170
- ...(options.queryBuilder ? [
2171
- {
2172
- provide: NiceFilterGroupService,
2173
- useClass: options.queryBuilder.filterGroupService
2174
- },
2175
- options.queryBuilder.savedReportService ? {
2176
- provide: NiceSavedReportService,
2177
- useClass: options.queryBuilder.savedReportService
2178
- } : undefined
2179
- ] : [])
2180
- ].filter(x => !!x);
2181
- }
2182
- }
2183
- NiceBaseListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2184
- NiceBaseListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, declarations: [NiceBaseListComponent], imports: [NiceExportBottomSheetModule,
2185
- NiceBaseListDirectiveModule,
2186
- CommonModule,
2187
- FlexModule,
2188
- ExtendedModule,
2189
- FormsModule,
2190
- RouterModule,
2191
- MatButtonModule,
2192
- MatIconModule,
2193
- MatTooltipModule,
2194
- MatCardModule,
2195
- MatPaginatorModule,
2196
- TranslateModule,
2197
- NiceLoadingSpinnerModule,
2198
- MatTableModule,
2199
- MatSortModule,
2200
- MatRippleModule,
2201
- MatBottomSheetModule,
2202
- QueryBuilderModule,
2203
- MatBadgeModule], exports: [NiceBaseListComponent,
2204
- NiceBaseListDirectiveModule] });
2205
- NiceBaseListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, imports: [[
2206
- NiceExportBottomSheetModule,
2207
- NiceBaseListDirectiveModule,
2208
- CommonModule,
2209
- FlexModule,
2210
- ExtendedModule,
2211
- FormsModule,
2212
- RouterModule,
2213
- MatButtonModule,
2214
- MatIconModule,
2215
- MatTooltipModule,
2216
- MatCardModule,
2217
- MatPaginatorModule,
2218
- TranslateModule,
2219
- NiceLoadingSpinnerModule,
2220
- MatTableModule,
2221
- MatSortModule,
2222
- MatRippleModule,
2223
- MatBottomSheetModule,
2224
- QueryBuilderModule,
2225
- MatBadgeModule
2226
- ], NiceBaseListDirectiveModule] });
2227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, decorators: [{
2228
- type: NgModule,
2229
- args: [{
2230
- imports: [
2231
- NiceExportBottomSheetModule,
2232
- NiceBaseListDirectiveModule,
2233
- CommonModule,
2234
- FlexModule,
2235
- ExtendedModule,
2236
- FormsModule,
2237
- RouterModule,
2238
- MatButtonModule,
2239
- MatIconModule,
2240
- MatTooltipModule,
2241
- MatCardModule,
2242
- MatPaginatorModule,
2243
- TranslateModule,
2244
- NiceLoadingSpinnerModule,
2245
- MatTableModule,
2246
- MatSortModule,
2247
- MatRippleModule,
2248
- MatBottomSheetModule,
2249
- QueryBuilderModule,
2250
- MatBadgeModule
2251
- ],
2252
- declarations: [
2253
- NiceBaseListComponent
2254
- ],
2255
- exports: [
2256
- NiceBaseListComponent,
2257
- NiceBaseListDirectiveModule
2258
- ]
2259
- }]
2260
- }] });
2261
-
2262
- class NiceListState {
2263
- }
2264
-
2265
- class NiceMultiStateFilterService extends NiceFilterService {
2266
- constructor(filters) {
2267
- super();
2268
- this.filters = filters;
2269
- }
2270
- switchState(state) {
2271
- this.api = this.filters[state];
2272
- }
2273
- }
2274
-
2275
- const initialValue = Object.assign({}, initialBaseListState);
2276
- let NiceMultiStateListStore = class NiceMultiStateListStore extends NiceBaseListStore {
2277
- constructor() {
2278
- super(null);
2279
- }
2280
- };
2281
- NiceMultiStateListStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2282
- NiceMultiStateListStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore });
2283
- NiceMultiStateListStore = __decorate([
2284
- StoreConfig({ name: "multi-state-list", resettable: true }),
2285
- __metadata("design:paramtypes", [])
2286
- ], NiceMultiStateListStore);
2287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, decorators: [{
2288
- type: Injectable
2289
- }], ctorParameters: function () { return []; } });
2290
-
2291
- class NiceMultiStateListQuery extends NiceBaseListQuery {
2292
- constructor(store) {
2293
- super(store);
2294
- this.store = store;
2295
- }
2296
- }
2297
- NiceMultiStateListQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, deps: [{ token: NiceMultiStateListStore }], target: i0.ɵɵFactoryTarget.Injectable });
2298
- NiceMultiStateListQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery });
2299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, decorators: [{
2300
- type: Injectable
2301
- }], ctorParameters: function () { return [{ type: NiceMultiStateListStore }]; } });
2302
-
2303
- const LIST_STATES = new InjectionToken("list_states");
2304
-
2305
- class NiceMultiStateListService extends NiceBaseListService {
2306
- constructor(states, store, activatedRoute, router, appRef, multiFilterService) {
2307
- super(store, multiFilterService, activatedRoute, router, appRef);
2308
- this.states = states;
2309
- this.multiFilterService = multiFilterService;
2310
- }
2311
- reset() {
2312
- this.store.reset();
2313
- }
2314
- setStateDefaultFilter(state, parameters) {
2315
- this.states[state].defaultParameters = parameters;
2316
- }
2317
- switchState(state) {
2318
- var _a;
2319
- const newState = this.states[state];
2320
- if (!state) {
2321
- return [];
2322
- }
2323
- this.multiFilterService.switchState(state);
2324
- this.reset();
2325
- this.init();
2326
- this.loadData((_a = newState.defaultParameters) !== null && _a !== void 0 ? _a : initialBaseListState.filterParameters);
2327
- return newState.columns;
2328
- }
2329
- }
2330
- NiceMultiStateListService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService, deps: [{ token: LIST_STATES }, { token: NiceMultiStateListStore }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i0.ApplicationRef }, { token: NiceMultiStateFilterService }], target: i0.ɵɵFactoryTarget.Injectable });
2331
- NiceMultiStateListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService });
2332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService, decorators: [{
2333
- type: Injectable
2334
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2335
- type: Inject,
2336
- args: [LIST_STATES]
2337
- }] }, { type: NiceMultiStateListStore }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i0.ApplicationRef }, { type: NiceMultiStateFilterService }]; } });
2338
-
2339
- class NiceMultiStateListComponent extends NiceBaseListComponent {
2340
- constructor(enableQueryBuilder, listLayout, exportsSetting, query, activatedRoute, bottomSheet, router, mediaObserver, multiStateListService) {
2341
- super(enableQueryBuilder, listLayout, [], exportsSetting, query, multiStateListService, activatedRoute, bottomSheet, router, mediaObserver);
2342
- this.multiStateListService = multiStateListService;
2343
- }
2344
- set state(state) {
2345
- this.switchState(state);
2346
- }
2347
- switchState(state) {
2348
- const columns = this.multiStateListService.switchState(state);
2349
- this.setColumn(columns);
2350
- }
2351
- }
2352
- NiceMultiStateListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListComponent, deps: [{ token: ENABLE_QUERY_BUILDER, optional: true }, { token: BASE_LIST_LAYOUT }, { token: EXPORTS_SETTINGS }, { token: NiceMultiStateListQuery }, { token: i3.ActivatedRoute }, { token: i4$1.MatBottomSheet }, { token: i3.Router }, { token: i4.MediaObserver }, { token: NiceMultiStateListService }], target: i0.ɵɵFactoryTarget.Component });
2353
- NiceMultiStateListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NiceMultiStateListComponent, selector: "nice-multi-state-list", inputs: { state: "state" }, providers: [
2354
- NiceMultiStateListQuery,
2355
- NiceMultiStateListService,
2356
- NiceMultiStateListStore
2357
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"list page-layout carded fullwidth inner-scroll\" *ngIf=\"layout === 'page'; else content\">\n <div class=\"center\">\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n </div>\n</div>\n\n<ng-template #content>\n <ng-container *ngIf=\"listLayout.xl\">\n <div fxHide fxShow.xl>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.xl }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.lg\">\n <div fxHide fxShow.lg>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.lg }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.md\">\n <div fxHide fxShow.md>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.md }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.sm\">\n <div fxHide fxShow.sm>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.sm }\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"listLayout.xs\">\n <div fxHide fxShow.xs>\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.xs }\"></ng-container>\n </div>\n </ng-container>\n\n <div\n [fxHide.xs]=\"!!listLayout.xs\"\n [fxHide.sm]=\"!!listLayout.sm\"\n [fxHide.md]=\"!!listLayout.md\"\n [fxHide.lg]=\"!!listLayout.lg\"\n [fxHide.xl]=\"!!listLayout.xl\"\n >\n <ng-container *ngTemplateOutlet=\"pageLayout; context: { layout: listLayout.default }\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #pageLayout let-layout=\"layout\">\n <ng-container *ngIf=\"layout?.length; else isObject\">\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: { type: 'column', items: layout } }\"></ng-container>\n </ng-container>\n\n <ng-template #isObject>\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: layout }\"></ng-container>\n </ng-template>\n</ng-template>\n\n<ng-template #contentLayout let-layout=\"layout\">\n <div [fxFlex]=\"layout.flex\" [fxLayout]=\"layout.type\" [fxLayoutAlign]=\"layout.align || ''\" [ngClass]=\"layout.classes\">\n <ng-container *ngFor=\"let item of layout.items\">\n <ng-container *ngIf=\"item.name; else childIsLayout\">\n <ng-container *ngTemplateOutlet=\"layoutItem; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-template #childIsLayout>\n <ng-container *ngTemplateOutlet=\"contentLayout; context: { layout: item }\"></ng-container>\n </ng-template>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #layoutItem let-item=\"item\">\n <ng-container *ngIf=\"item.name === 'title' && title\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'search'\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <div class=\"search-wrapper mx-md-0\">\n <div class=\"search\" fxFlex fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>search</mat-icon>\n <input [ngModel]=\"searchQuery$ | async\" (ngModelChange)=\"onUpdateSearch($event)\" [placeholder]=\"'general.search' | translate\" />\n <ng-container *ngIf=\"enableQueryBuilder\">\n <button\n *ngIf=\"!(showQueryBuilder$ | async) && !(rulesCount$ | async)\"\n mat-icon-button\n niceQueryBuilderTrigger\n [queryBuilderFilters]=\"filterConfig$ | async\"\n [queryBuilderFiltersLoading]=\"(filterConfigLoading$ | async) || false\"\n (queryBuilderFilterSelected)=\"onQueryBuilderFilterSelected($event)\"\n [matTooltip]=\"'general.query_builder.show_advanced_search' | translate\"\n >\n <mat-icon\n [matBadge]=\"rulesCount$ | async\"\n [matBadgeHidden]=\"!(rulesCount$ | async)\"\n matBadgeColor=\"accent\"\n >\n filter_list\n </mat-icon>\n </button>\n <button\n mat-icon-button\n *ngIf=\"!(showQueryBuilder$ | async) && (rulesCount$ | async)\"\n [disabled]=\"filterConfigLoading$ | async\"\n (click)=\"clickToggleShowQueryBuilder()\"\n [matTooltip]=\"'general.query_builder.show_advanced_search' | translate\"\n >\n <mat-icon\n [matBadge]=\"rulesCount$ | async\"\n [matBadgeHidden]=\"!(rulesCount$ | async)\"\n matBadgeColor=\"accent\"\n >\n filter_list\n </mat-icon>\n </button>\n <button\n mat-icon-button\n *ngIf=\"showQueryBuilder$ | async\"\n (click)=\"clickToggleShowQueryBuilder()\"\n [matTooltip]=\"'general.query_builder.close_advanced_search' | translate\"\n >\n <mat-icon>\n clear\n </mat-icon>\n </button>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'prefixButtons' && prefixButtons\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"prefixButtons\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'suffixButtons' && suffixButtons\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"suffixButtons\"></ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'exportButtons' && canExport\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\" [class.mr-2]=\"!!suffixButtons\" [class.ml-2]=\"!!prefixButtons\">\n <button\n (click)=\"clickPrint()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.print' | translate\"\n class=\"list-button mr-2\"\n mat-mini-fab\n >\n <mat-icon>print</mat-icon>\n </button>\n\n <button\n (click)=\"clickExport()\"\n [disabled]=\"loading$ | async\"\n [matTooltip]=\"'general.export' | translate\"\n class=\"list-button mr-2\"\n mat-mini-fab\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'content'\">\n <ng-container *ngIf=\"layoutContent === 'table' && table\">\n <ng-container *ngTemplateOutlet=\"tableLayout; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"layoutContent === 'cards' && cards\">\n <ng-container *ngTemplateOutlet=\"cardsLayout; context: { item: item }\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"layoutContent === 'custom' && customContent\">\n <ng-container *ngTemplateOutlet=\"customLayout; context: { item: item }\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'pagination' && layoutContent !== 'custom'\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <mat-paginator\n (page)=\"onUpdatePage($event)\"\n [length]=\"recordsFiltered$ | async\"\n [pageIndex]=\"index$ | async\"\n [pageSizeOptions]=\"defaultPageSizeOptions\"\n [pageSize]=\"length$ | async\"\n [showFirstLastButtons]=\"true\"\n >\n </mat-paginator>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'queryBuilder' && enableQueryBuilder\">\n <div fxLayout=\"column\" *ngIf=\"showQueryBuilder$ | async\">\n <mat-card class=\"my-4\" [niceLoadingOverlay]=\"filterConfigLoading$ | async\">\n <mat-card-content fxLayout=\"column\">\n <div fxFlex>\n <nice-query-builder\n [filterConfigs]=\"filterConfig$ | async\"\n [ngModel]=\"rules$ | async\"\n (ngModelChange)=\"onUpdateRules($event)\"\n (close)=\"clickToggleShowQueryBuilder()\"\n ></nice-query-builder>\n </div>\n </mat-card-content>\n </mat-card>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"item.name === 'filters' && filters\">\n <div [fxFlex]=\"item.flex\" [fxLayoutAlign]=\"item.align || ''\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"filters\"></ng-container>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tableLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <div\n [niceLoadingOverlay]=\"loading$ | async\"\n class=\"content-card base-list\"\n fxLayout=\"column\"\n fxLayoutAlign=\"space-between\"\n >\n <mat-table\n (matSortChange)=\"onUpdateSort($event)\"\n [dataSource]=\"data$\"\n [matSortActive]=\"(sortColumn$ | async) || ''\"\n [matSortDirection]=\"(sortDirection$ | async) || ''\"\n fxFlex=\"1 1 auto\"\n matSort\n >\n <mat-header-row *matHeaderRowDef=\"columnNames; sticky: true\"></mat-header-row>\n\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <ng-container *ngIf=\"column.sortable\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, header: true }\"\n ></ng-container>\n </mat-header-cell>\n </ng-container>\n <ng-container *ngIf=\"!column.sortable\">\n <mat-header-cell *matHeaderCellDef>\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, header: true }\"\n ></ng-container>\n </mat-header-cell>\n </ng-container>\n\n <mat-cell *matCellDef=\"let item\">\n <ng-container\n *ngTemplateOutlet=\"table; context: { column: column.id, data: true, item: item }\"\n ></ng-container>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngIf=\"disableRouting; else withRouting\">\n <mat-row *matRowDef=\"let item; columns: columnNames;\" class=\"item\"></mat-row>\n </ng-container>\n\n <ng-template #withRouting>\n <mat-row\n *matRowDef=\"let item; columns: columnNames;\"\n (click)=\"navigate(item)\"\n class=\"item clickable\"\n matRipple\n >\n </mat-row>\n </ng-template>\n </mat-table>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cardsLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngFor=\"let data of data$ | async\">\n <ng-container *ngTemplateOutlet=\"cards; context: { item: data }\"></ng-container>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #customLayout let-item=\"item\">\n <div [fxFlex]=\"item.flex\" [ngClass]=\"item.classes\">\n <ng-container *ngTemplateOutlet=\"customContent; context: { data: data$ | async }\"></ng-container>\n </div>\n</ng-template>\n", components: [{ type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i7.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i9.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: QueryBuilderComponent, selector: "nice-query-builder", inputs: ["filterConfigs", "currentSavedReport", "loading"], outputs: ["close", "createReport", "updateReport"] }, { type: i11.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i11.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "arrowPosition", "disableClear", "mat-sort-header", "start"], exportAs: ["matSortHeader"] }, { type: i11.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i13.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i13.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i13.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i13.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: QueryBuilderTriggerDirective, selector: "[niceQueryBuilderTrigger]", inputs: ["queryBuilderFilters", "queryBuilderFiltersLoading"], outputs: ["queryBuilderFilterSelected"] }, { type: i16.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i17.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgePosition", "matBadgeSize", "matBadgeColor", "matBadgeOverlap", "matBadgeDescription", "matBadgeHidden", "matBadge"] }, { type: i18.NiceLoadingDirective, selector: "[niceLoadingOverlay]", inputs: ["niceLoadingOverlay"] }, { type: i9.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i12.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortActive"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i11.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i11.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i11.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i11.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i11.MatCellDef, selector: "[matCellDef]" }, { type: i11.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i11.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i6.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }], pipes: { "async": i13.AsyncPipe, "translate": i1$4.TranslatePipe } });
2358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListComponent, decorators: [{
2359
- type: Component,
2360
- args: [{
2361
- selector: "nice-multi-state-list",
2362
- templateUrl: "../base-list/base-list.template.html",
2363
- providers: [
2364
- NiceMultiStateListQuery,
2365
- NiceMultiStateListService,
2366
- NiceMultiStateListStore
2367
- ]
2368
- }]
2369
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2370
- type: Optional
2371
- }, {
2372
- type: Inject,
2373
- args: [ENABLE_QUERY_BUILDER]
2374
- }] }, { type: undefined, decorators: [{
2375
- type: Inject,
2376
- args: [BASE_LIST_LAYOUT]
2377
- }] }, { type: undefined, decorators: [{
2378
- type: Inject,
2379
- args: [EXPORTS_SETTINGS]
2380
- }] }, { type: NiceMultiStateListQuery }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }, { type: NiceMultiStateListService }]; }, propDecorators: { state: [{
2381
- type: Input
2382
- }] } });
2383
-
2384
- class NiceMultiStateListModule {
2385
- static providerFactory(options) {
2386
- var _a;
2387
- return [
2388
- {
2389
- provide: NiceMultiStateFilterService,
2390
- useExisting: options.filterService
2391
- },
2392
- {
2393
- provide: LIST_STATES,
2394
- useValue: options.states
2395
- },
2396
- options.layout ? {
2397
- provide: BASE_LIST_LAYOUT,
2398
- useValue: options.layout
2399
- } : undefined,
2400
- {
2401
- provide: EXPORTS_SETTINGS,
2402
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2403
- pdf: true,
2404
- xlsx: true,
2405
- csv: true
2406
- }
2407
- },
2408
- ...(options.queryBuilder ? [
2409
- {
2410
- provide: ENABLE_QUERY_BUILDER,
2411
- useValue: true
2412
- },
2413
- {
2414
- provide: NiceFilterGroupService,
2415
- useClass: options.queryBuilder.filterGroupService
2416
- },
2417
- options.queryBuilder.savedReportService ? {
2418
- provide: NiceSavedReportService,
2419
- useClass: options.queryBuilder.savedReportService
2420
- } : undefined
2421
- ] : [])
2422
- ].filter(x => !!x);
2423
- }
2424
- }
2425
- NiceMultiStateListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2426
- NiceMultiStateListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, declarations: [NiceMultiStateListComponent], imports: [NiceExportBottomSheetModule,
2427
- NiceBaseListDirectiveModule,
2428
- CommonModule,
2429
- FlexModule,
2430
- ExtendedModule,
2431
- FormsModule,
2432
- RouterModule,
2433
- MatButtonModule,
2434
- MatIconModule,
2435
- MatTooltipModule,
2436
- MatCardModule,
2437
- MatPaginatorModule,
2438
- TranslateModule,
2439
- NiceLoadingSpinnerModule,
2440
- MatTableModule,
2441
- MatSortModule,
2442
- MatRippleModule,
2443
- MatBottomSheetModule,
2444
- QueryBuilderModule,
2445
- MatBadgeModule], exports: [NiceMultiStateListComponent,
2446
- NiceBaseListDirectiveModule] });
2447
- NiceMultiStateListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, imports: [[
2448
- NiceExportBottomSheetModule,
2449
- NiceBaseListDirectiveModule,
2450
- CommonModule,
2451
- FlexModule,
2452
- ExtendedModule,
2453
- FormsModule,
2454
- RouterModule,
2455
- MatButtonModule,
2456
- MatIconModule,
2457
- MatTooltipModule,
2458
- MatCardModule,
2459
- MatPaginatorModule,
2460
- TranslateModule,
2461
- NiceLoadingSpinnerModule,
2462
- MatTableModule,
2463
- MatSortModule,
2464
- MatRippleModule,
2465
- MatBottomSheetModule,
2466
- QueryBuilderModule,
2467
- MatBadgeModule
2468
- ], NiceBaseListDirectiveModule] });
2469
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, decorators: [{
2470
- type: NgModule,
2471
- args: [{
2472
- imports: [
2473
- NiceExportBottomSheetModule,
2474
- NiceBaseListDirectiveModule,
2475
- CommonModule,
2476
- FlexModule,
2477
- ExtendedModule,
2478
- FormsModule,
2479
- RouterModule,
2480
- MatButtonModule,
2481
- MatIconModule,
2482
- MatTooltipModule,
2483
- MatCardModule,
2484
- MatPaginatorModule,
2485
- TranslateModule,
2486
- NiceLoadingSpinnerModule,
2487
- MatTableModule,
2488
- MatSortModule,
2489
- MatRippleModule,
2490
- MatBottomSheetModule,
2491
- QueryBuilderModule,
2492
- MatBadgeModule
2493
- ],
2494
- declarations: [
2495
- NiceMultiStateListComponent
2496
- ],
2497
- exports: [
2498
- NiceMultiStateListComponent,
2499
- NiceBaseListDirectiveModule
2500
- ]
2501
- }]
2502
- }] });
2503
-
2504
- class StringUtils {
2505
- }
2506
- String.prototype.toTableColumn = function (sortable) {
2507
- return new TableColumns(this.toString(), sortable);
2508
- };
2509
-
2510
- /*
2511
- * Public API Surface of nice-data-filter-kit
2512
- */
2513
-
2514
- /**
2515
- * Generated bundle index. Do not edit.
2516
- */
2517
-
2518
- export { DateFilterComponent, FilterComponent, FilterGroupIconPipe, FilterOperatorTypes, FilterSelectionComponent, FilterType, FilterUtils, LayoutContent, NiceBaseListButtonsDirective, NiceBaseListCardsDirective, NiceBaseListComponent, NiceBaseListCustomContentDirective, NiceBaseListDirectiveModule, NiceBaseListFiltersDirective, NiceBaseListModule, NiceBaseListQuery, NiceBaseListService, NiceBaseListStore, NiceBaseListTableDirective, NiceBaseListTitleDirective, NiceCustomDateAdapter, NiceFilterApi, NiceFilterGroupService, NiceFilterService, NiceListState, NiceMultiStateFilterService, NiceMultiStateListComponent, NiceMultiStateListModule, NiceMultiStateListQuery, NiceMultiStateListService, NiceMultiStateListStore, NiceSavedReportService, NumberFilterComponent, QBFilterUtils, QueryBuilderComponent, QueryBuilderModule, QueryBuilderTriggerDirective, RadioFilterComponent, RuleComponent, SelectFilterComponent, StringUtils, TableColumns, TextFilterComponent, defaultLayout, initialBaseListState, initialValue };
2519
- //# sourceMappingURL=recursyve-nice-data-filter-kit.js.map