@recursyve/nice-data-filter-kit 12.1.30 → 13.0.3

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 (102) 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/esm2020/lib/components/query-builder/rule/components/filter.component.mjs +45 -0
  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/lib/components/query-builder/rule/components/filter.component.d.ts +2 -1
  71. package/package.json +30 -16
  72. package/src/lib/components/base-list/base-list.theme.scss +5 -5
  73. package/src/lib/components/query-builder/filter-selection/filter-selection.theme.scss +41 -0
  74. package/src/lib/components/query-builder/query-builder.theme.scss +2 -0
  75. package/src/lib/components/query-builder/rule/rule.theme.scss +83 -1
  76. package/src/lib/nice-data-filter.theme.scss +7 -0
  77. package/bundles/recursyve-nice-data-filter-kit.umd.js +0 -3173
  78. package/bundles/recursyve-nice-data-filter-kit.umd.js.map +0 -1
  79. package/esm2015/lib/api/filter.api.js +0 -52
  80. package/esm2015/lib/api/saved-report.api.js +0 -49
  81. package/esm2015/lib/components/base-list/base-list.component.js +0 -297
  82. package/esm2015/lib/components/base-list/base-list.module.js +0 -180
  83. package/esm2015/lib/components/base-list/models/layout.model.js +0 -164
  84. package/esm2015/lib/components/base-list/providers/base-filter.service.js +0 -40
  85. package/esm2015/lib/components/base-list/store/base-list.query.js +0 -35
  86. package/esm2015/lib/components/base-list/store/base-list.service.js +0 -330
  87. package/esm2015/lib/components/base-list/store/base-list.store.js +0 -78
  88. package/esm2015/lib/components/multi-state-list/multi-state-list.component.js +0 -75
  89. package/esm2015/lib/components/multi-state-list/store/multi-state-list.store.js +0 -22
  90. package/esm2015/lib/components/query-builder/filter-selection/filter-selection.component.js +0 -48
  91. package/esm2015/lib/components/query-builder/query-builder.component.js +0 -100
  92. package/esm2015/lib/components/query-builder/query-builder.module.js +0 -120
  93. package/esm2015/lib/components/query-builder/rule/components/date/date-filter.component.js +0 -35
  94. package/esm2015/lib/components/query-builder/rule/components/filter.component.js +0 -29
  95. package/esm2015/lib/components/query-builder/rule/components/number/number-filter.component.js +0 -34
  96. package/esm2015/lib/components/query-builder/rule/components/radio/radio-filter.component.js +0 -36
  97. package/esm2015/lib/components/query-builder/rule/components/select/select-filter.component.js +0 -94
  98. package/esm2015/lib/components/query-builder/rule/components/text/text-filter.component.js +0 -37
  99. package/esm2015/lib/components/query-builder/rule/rule.component.js +0 -86
  100. package/esm2015/lib/utils/filter.utils.js +0 -41
  101. package/fesm2015/recursyve-nice-data-filter-kit.js +0 -2503
  102. package/fesm2015/recursyve-nice-data-filter-kit.js.map +0 -1
@@ -1,2503 +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.propagateChanges = (_) => { };
1219
- }
1220
- get value() {
1221
- return this._value;
1222
- }
1223
- registerOnTouched(fn) {
1224
- // NO-OP
1225
- }
1226
- registerOnChange(fn) {
1227
- this.propagateChanges = fn;
1228
- }
1229
- writeValue(value) {
1230
- this._value = value;
1231
- }
1232
- onValueChange(value) {
1233
- this.propagateChanges(value);
1234
- }
1235
- }
1236
- FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1237
- FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: FilterComponent, selector: "ng-component", ngImport: i0, template: ``, isInline: true });
1238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, decorators: [{
1239
- type: Component,
1240
- args: [{ template: `` }]
1241
- }] });
1242
-
1243
- class TextFilterComponent extends FilterComponent {
1244
- }
1245
- TextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1246
- TextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: TextFilterComponent, selector: "nice-text-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1247
- {
1248
- provide: NG_VALUE_ACCESSOR,
1249
- useExisting: forwardRef(() => TextFilterComponent),
1250
- multi: true
1251
- }
1252
- ], 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 });
1253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, decorators: [{
1254
- type: Component,
1255
- args: [{
1256
- selector: "nice-text-filter",
1257
- templateUrl: "text-filter.template.html",
1258
- encapsulation: ViewEncapsulation.None,
1259
- providers: [
1260
- {
1261
- provide: NG_VALUE_ACCESSOR,
1262
- useExisting: forwardRef(() => TextFilterComponent),
1263
- multi: true
1264
- }
1265
- ]
1266
- }]
1267
- }], propDecorators: { filterConfig: [{
1268
- type: Input
1269
- }] } });
1270
-
1271
- class NumberFilterComponent extends FilterComponent {
1272
- }
1273
- NumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1274
- NumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NumberFilterComponent, selector: "nice-number-filter", providers: [
1275
- {
1276
- provide: NG_VALUE_ACCESSOR,
1277
- useExisting: forwardRef(() => NumberFilterComponent),
1278
- multi: true
1279
- }
1280
- ], 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 });
1281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, decorators: [{
1282
- type: Component,
1283
- args: [{
1284
- selector: "nice-number-filter",
1285
- templateUrl: "number-filter.template.html",
1286
- encapsulation: ViewEncapsulation.None,
1287
- providers: [
1288
- {
1289
- provide: NG_VALUE_ACCESSOR,
1290
- useExisting: forwardRef(() => NumberFilterComponent),
1291
- multi: true
1292
- }
1293
- ]
1294
- }]
1295
- }] });
1296
-
1297
- class RadioFilterComponent extends FilterComponent {
1298
- }
1299
- RadioFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1300
- RadioFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: RadioFilterComponent, selector: "nice-radio-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1301
- {
1302
- provide: NG_VALUE_ACCESSOR,
1303
- useExisting: forwardRef(() => RadioFilterComponent),
1304
- multi: true
1305
- }
1306
- ], 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 });
1307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, decorators: [{
1308
- type: Component,
1309
- args: [{
1310
- selector: "nice-radio-filter",
1311
- templateUrl: "radio-filter.template.html",
1312
- encapsulation: ViewEncapsulation.None,
1313
- providers: [
1314
- {
1315
- provide: NG_VALUE_ACCESSOR,
1316
- useExisting: forwardRef(() => RadioFilterComponent),
1317
- multi: true
1318
- }
1319
- ]
1320
- }]
1321
- }], propDecorators: { filterConfig: [{
1322
- type: Input
1323
- }] } });
1324
-
1325
- class SelectFilterComponent extends FilterComponent {
1326
- constructor(filterService) {
1327
- super();
1328
- this.filterService = filterService;
1329
- this.values = [];
1330
- this.search$ = new Subject();
1331
- }
1332
- ngOnInit() {
1333
- return __awaiter(this, void 0, void 0, function* () {
1334
- if (!this.filterConfig.lazyLoading) {
1335
- this.values = this.filterConfig.values;
1336
- }
1337
- this.searchSub$ = this.search$
1338
- .pipe(debounceTime(300), switchMap(value => {
1339
- if (this.filterConfig.lazyLoading) {
1340
- return this.filterService.searchFilterValue(this.filterConfig, value);
1341
- }
1342
- return of(this.filterConfig.values);
1343
- }))
1344
- .subscribe(values => {
1345
- this.values = values;
1346
- });
1347
- });
1348
- }
1349
- ngOnChanges(changes) {
1350
- if ("filterConfig" in changes) {
1351
- if (!this.filterConfig.lazyLoading) {
1352
- this.values = this.filterConfig.values;
1353
- }
1354
- }
1355
- }
1356
- searchValue() {
1357
- return __awaiter(this, void 0, void 0, function* () {
1358
- if (this.value && !this.values.find(v => v.id === this.value)) {
1359
- const value = yield this.filterService
1360
- .searchFilterResourceValue(this.filterConfig, this.value)
1361
- .toPromise();
1362
- this.values = [...this.values, value];
1363
- }
1364
- });
1365
- }
1366
- onValueChange(value) {
1367
- super.onValueChange(value);
1368
- this.searchValue();
1369
- }
1370
- ngOnDestroy() {
1371
- this.searchSub$.unsubscribe();
1372
- }
1373
- writeValue(value) {
1374
- super.writeValue(value);
1375
- this.searchValue();
1376
- }
1377
- }
1378
- 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 });
1379
- SelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: SelectFilterComponent, selector: "nice-select-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1380
- {
1381
- provide: NG_VALUE_ACCESSOR,
1382
- useExisting: forwardRef(() => SelectFilterComponent),
1383
- multi: true
1384
- }
1385
- ], 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", "loading", "loadingPage", "bindValue", "bindLabel", "typeahead", "page$", "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 });
1386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: SelectFilterComponent, decorators: [{
1387
- type: Component,
1388
- args: [{
1389
- selector: "nice-select-filter",
1390
- templateUrl: "select-filter.template.html",
1391
- encapsulation: ViewEncapsulation.None,
1392
- providers: [
1393
- {
1394
- provide: NG_VALUE_ACCESSOR,
1395
- useExisting: forwardRef(() => SelectFilterComponent),
1396
- multi: true
1397
- }
1398
- ]
1399
- }]
1400
- }], ctorParameters: function () { return [{ type: NiceFilterService, decorators: [{
1401
- type: Optional
1402
- }] }]; }, propDecorators: { filterConfig: [{
1403
- type: Input
1404
- }] } });
1405
-
1406
- class DateFilterComponent extends FilterComponent {
1407
- }
1408
- DateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1409
- DateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: DateFilterComponent, selector: "nice-date-filter", providers: [
1410
- {
1411
- provide: NG_VALUE_ACCESSOR,
1412
- useExisting: forwardRef(() => DateFilterComponent),
1413
- multi: true
1414
- }
1415
- ], 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 });
1416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, decorators: [{
1417
- type: Component,
1418
- args: [{
1419
- selector: "nice-date-filter",
1420
- templateUrl: "date-filter.template.html",
1421
- encapsulation: ViewEncapsulation.None,
1422
- providers: [
1423
- {
1424
- provide: NG_VALUE_ACCESSOR,
1425
- useExisting: forwardRef(() => DateFilterComponent),
1426
- multi: true
1427
- }
1428
- ]
1429
- }]
1430
- }] });
1431
-
1432
- class NiceFilterGroupService {
1433
- }
1434
-
1435
- class FilterGroupIconPipe {
1436
- constructor(service) {
1437
- this.service = service;
1438
- }
1439
- transform(value) {
1440
- return this.service.getFilterGroupIconClass(value);
1441
- }
1442
- }
1443
- FilterGroupIconPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, deps: [{ token: NiceFilterGroupService }], target: i0.ɵɵFactoryTarget.Pipe });
1444
- FilterGroupIconPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, name: "filterGroupIcon" });
1445
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, decorators: [{
1446
- type: Pipe,
1447
- args: [{
1448
- name: "filterGroupIcon"
1449
- }]
1450
- }], ctorParameters: function () { return [{ type: NiceFilterGroupService }]; } });
1451
-
1452
- class FilterSelectionComponent {
1453
- constructor() {
1454
- this.filterSelected = new EventEmitter();
1455
- }
1456
- get filterGroups() {
1457
- const groups = ArrayUtils.uniqueObjects(this.filterConfigs.map(x => x.group), x => x === null || x === void 0 ? void 0 : x.key);
1458
- const result = [];
1459
- for (const group of groups) {
1460
- if (!group) {
1461
- continue;
1462
- }
1463
- result.push([group, this.filterConfigs.filter(x => { var _a; return ((_a = x.group) === null || _a === void 0 ? void 0 : _a.key) === group.key; })]);
1464
- }
1465
- return result.sort(([, a], [, b]) => b.length - a.length);
1466
- }
1467
- selectFilter(filterConfigurationModel) {
1468
- this.filterSelected.emit(filterConfigurationModel);
1469
- }
1470
- }
1471
- FilterSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1472
- 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 });
1473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, decorators: [{
1474
- type: Component,
1475
- args: [{
1476
- selector: "nice-filter-selection",
1477
- templateUrl: "filter-selection.template.html",
1478
- styleUrls: ["./filter-selection.style.scss"],
1479
- encapsulation: ViewEncapsulation.None,
1480
- changeDetection: ChangeDetectionStrategy.OnPush
1481
- }]
1482
- }], propDecorators: { filterConfigs: [{
1483
- type: Input
1484
- }], loading: [{
1485
- type: Input
1486
- }], filterSelected: [{
1487
- type: Output
1488
- }] } });
1489
-
1490
- class QueryBuilderTriggerDirective {
1491
- constructor(overlayPositionBuilder, elementRef, overlay, platform) {
1492
- this.overlayPositionBuilder = overlayPositionBuilder;
1493
- this.elementRef = elementRef;
1494
- this.overlay = overlay;
1495
- this.platform = platform;
1496
- this.queryBuilderFilterSelected = new EventEmitter();
1497
- }
1498
- set queryBuilderFilters(queryBuilderFilters) {
1499
- if (queryBuilderFilters) {
1500
- this._queryBuilderFilters = queryBuilderFilters;
1501
- }
1502
- this.updateFilterSelectionComponent();
1503
- }
1504
- set queryBuilderFiltersLoading(queryBuilderFiltersLoading) {
1505
- this._queryBuilderFiltersLoading = queryBuilderFiltersLoading;
1506
- this.updateFilterSelectionComponent();
1507
- }
1508
- click() {
1509
- const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([
1510
- {
1511
- originX: "center",
1512
- originY: "bottom",
1513
- overlayX: this.isMobile() ? "end" : "center",
1514
- overlayY: "top"
1515
- }
1516
- ]);
1517
- this.overlayRef = this.overlay.create({
1518
- positionStrategy,
1519
- hasBackdrop: true,
1520
- backdropClass: "cdk-overlay-transparent-backdrop"
1521
- });
1522
- const filterSelectionPortal = new ComponentPortal(FilterSelectionComponent);
1523
- this.filterSelectionRef = this.overlayRef.attach(filterSelectionPortal);
1524
- this.updateFilterSelectionComponent();
1525
- this.overlayRef.backdropClick().subscribe(() => this.close());
1526
- }
1527
- close() {
1528
- this.overlayRef.dispose();
1529
- }
1530
- updateFilterSelectionComponent() {
1531
- if (!this.filterSelectionRef) {
1532
- return;
1533
- }
1534
- this.filterSelectionRef.instance.filterConfigs = this._queryBuilderFilters;
1535
- this.filterSelectionRef.instance.loading = this._queryBuilderFiltersLoading;
1536
- this.filterSelectionRef.instance.filterSelected.subscribe((filter) => {
1537
- this.queryBuilderFilterSelected.emit(filter);
1538
- this.close();
1539
- });
1540
- }
1541
- isMobile() {
1542
- return this.platform.ANDROID || this.platform.IOS;
1543
- }
1544
- }
1545
- 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 });
1546
- 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 });
1547
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderTriggerDirective, decorators: [{
1548
- type: Directive,
1549
- args: [{ selector: "[niceQueryBuilderTrigger]" }]
1550
- }], ctorParameters: function () { return [{ type: i1$3.OverlayPositionBuilder }, { type: i0.ElementRef }, { type: i1$3.Overlay }, { type: i2$2.Platform }]; }, propDecorators: { queryBuilderFilters: [{
1551
- type: Input
1552
- }], queryBuilderFiltersLoading: [{
1553
- type: Input
1554
- }], queryBuilderFilterSelected: [{
1555
- type: Output
1556
- }], click: [{
1557
- type: HostListener,
1558
- args: ["click"]
1559
- }] } });
1560
-
1561
- class RuleComponent {
1562
- constructor(formGroupName) {
1563
- this.formGroupName = formGroupName;
1564
- this.remove = new EventEmitter();
1565
- }
1566
- get filterConfig() {
1567
- var _a;
1568
- const rule = this.rules.at(0).value;
1569
- return (_a = this.filterConfigs) === null || _a === void 0 ? void 0 : _a.find(f => f.id === rule.id);
1570
- }
1571
- get isSingleInput() {
1572
- return !this.isDoubleInput && !this.isNoInput;
1573
- }
1574
- get isDoubleInput() {
1575
- return QBFilterUtils.isDoubleInput(this.filterOperator);
1576
- }
1577
- get isNoInput() {
1578
- return QBFilterUtils.isNoInput(this.filterOperator);
1579
- }
1580
- ngOnInit() {
1581
- this.formGroup = this.formGroupName.control;
1582
- this.rules = this.formGroup.get("rules");
1583
- this.filterOperator = this.rules.at(0).value.operation;
1584
- }
1585
- onUpdateFilterConfig(config) {
1586
- const rule = QBFilterUtils.createRule(config);
1587
- this.rules.patchValue([rule]);
1588
- this.filterOperator = rule.operation;
1589
- }
1590
- onClickOr() {
1591
- this.rules.push(QBFilterUtils.createRule(this.filterConfig, this.filterOperator));
1592
- }
1593
- onUpdateFilterOperator(operator) {
1594
- var _a, _b;
1595
- this.filterOperator = operator;
1596
- for (const rule of this.rules.controls) {
1597
- (_a = rule.get("operation")) === null || _a === void 0 ? void 0 : _a.patchValue(this.filterOperator);
1598
- if (this.isDoubleInput) {
1599
- (_b = rule.get("value")) === null || _b === void 0 ? void 0 : _b.patchValue([rule.value.value, rule.value.value]);
1600
- }
1601
- }
1602
- }
1603
- onClickDelete(index) {
1604
- if (this.rules.length > 1) {
1605
- this.rules.removeAt(index);
1606
- }
1607
- else {
1608
- this.remove.emit();
1609
- }
1610
- }
1611
- }
1612
- 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 });
1613
- 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 [filterConfig]=\"filterConfig\"\n fxFlex\n formControlName=\"value\"\n ></nice-text-filter>\n <nice-number-filter\n *ngSwitchCase=\"'number'\"\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 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\n *ngSwitchCase=\"'date'\"\n fxFlex\n formControlName=\"value\"\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 [filterConfig]=\"filterConfig\"\n fxFlex\n formControlName=\"secondValue\"\n ></nice-text-filter>\n <nice-number-filter\n *ngSwitchCase=\"'number'\"\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 class=\"mb-16\"\n ></nice-radio-filter>\n <nice-select-filter\n *ngSwitchCase=\"'select'\"\n fxFlex\n formControlName=\"secondValue\"\n [filterConfig]=\"filterConfig\"\n ></nice-select-filter>\n <nice-date-filter\n *ngSwitchCase=\"'date'\"\n fxFlex\n formControlName=\"secondValue\"\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 });
1614
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RuleComponent, decorators: [{
1615
- type: Component,
1616
- args: [{
1617
- selector: "nice-rule",
1618
- templateUrl: "rule.template.html",
1619
- styleUrls: ["./rule.style.scss"],
1620
- encapsulation: ViewEncapsulation.None
1621
- }]
1622
- }], ctorParameters: function () { return [{ type: i1$1.FormGroupName }]; }, propDecorators: { filterConfigs: [{
1623
- type: Input
1624
- }], remove: [{
1625
- type: Output
1626
- }] } });
1627
-
1628
- class QueryBuilderComponent {
1629
- constructor(formGroup) {
1630
- this.formGroup = formGroup;
1631
- this.close = new EventEmitter();
1632
- this.createReport = new EventEmitter();
1633
- this.updateReport = new EventEmitter();
1634
- this.propagateChanges = (_) => { };
1635
- this.rules = this.formGroup.get("rules");
1636
- }
1637
- get canSave() {
1638
- return !this.currentSavedReport;
1639
- }
1640
- registerOnChange(fn) {
1641
- this.propagateChanges = fn;
1642
- }
1643
- registerOnTouched(fn) { }
1644
- writeValue(rules) {
1645
- this.rules.clear();
1646
- this.formGroup.patchValue(new QueryBuilderForm(rules));
1647
- }
1648
- onClickAddRule(filterConfigurationModel) {
1649
- this.rules.push(QBFilterUtils.createQueryModel(filterConfigurationModel));
1650
- }
1651
- onClickDeleteRule(id) {
1652
- this.rules.removeAt(id);
1653
- if (this.rules.length === 0) {
1654
- this.close.emit();
1655
- this.onClickApply();
1656
- }
1657
- }
1658
- onClickApply() {
1659
- this.propagateChanges(this.formGroup.getRawValue().transform());
1660
- }
1661
- onClickSaveReport() {
1662
- this.createReport.emit();
1663
- }
1664
- onClickUpdateReport() {
1665
- this.updateReport.emit();
1666
- }
1667
- }
1668
- 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 });
1669
- 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: [
1670
- {
1671
- provide: NG_VALUE_ACCESSOR,
1672
- useExisting: forwardRef(() => QueryBuilderComponent),
1673
- multi: true
1674
- },
1675
- {
1676
- provide: GeneratedFormGroup,
1677
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1678
- }
1679
- ], 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 });
1680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderComponent, decorators: [{
1681
- type: Component,
1682
- args: [{
1683
- selector: "nice-query-builder",
1684
- templateUrl: "./query-builder.template.html",
1685
- styleUrls: ["./query-builder.style.scss"],
1686
- encapsulation: ViewEncapsulation.None,
1687
- providers: [
1688
- {
1689
- provide: NG_VALUE_ACCESSOR,
1690
- useExisting: forwardRef(() => QueryBuilderComponent),
1691
- multi: true
1692
- },
1693
- {
1694
- provide: GeneratedFormGroup,
1695
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1696
- }
1697
- ]
1698
- }]
1699
- }], ctorParameters: function () { return [{ type: i1$5.GeneratedFormGroup }]; }, propDecorators: { filterConfigs: [{
1700
- type: Input
1701
- }], currentSavedReport: [{
1702
- type: Input
1703
- }], loading: [{
1704
- type: Input
1705
- }], close: [{
1706
- type: Output
1707
- }], createReport: [{
1708
- type: Output
1709
- }], updateReport: [{
1710
- type: Output
1711
- }] } });
1712
-
1713
- class NiceBaseListComponent {
1714
- constructor(enableQueryBuilder, listLayout, columns, exportsSettings, query, service, activatedRoute, bottomSheet, router, mediaObserver) {
1715
- this.enableQueryBuilder = enableQueryBuilder;
1716
- this.listLayout = listLayout;
1717
- this.columns = columns;
1718
- this.exportsSettings = exportsSettings;
1719
- this.query = query;
1720
- this.service = service;
1721
- this.activatedRoute = activatedRoute;
1722
- this.bottomSheet = bottomSheet;
1723
- this.router = router;
1724
- this.mediaObserver = mediaObserver;
1725
- this.mode = "normal";
1726
- this.layout = "page";
1727
- this.layoutContent = LayoutContent.Table;
1728
- this.autoChangeLayout = true;
1729
- this.autoLoad = true;
1730
- this.canExport = true;
1731
- this.disableRouting = false;
1732
- this.customExport = [];
1733
- this.newPage = new EventEmitter();
1734
- this.defaultPageSizeOptions = [10, 25, 50, 100];
1735
- this.columnNames = [];
1736
- this.loading$ = this.query.selectLoading();
1737
- this.filterResult$ = this.query.selectFilterResult();
1738
- this.data$ = this.query.selectData();
1739
- this.recordsFiltered$ = this.filterResult$.pipe(map(f => f && f.total));
1740
- this.showQueryBuilder$ = this.query.selectShowQueryBuilder();
1741
- this.filterParameters$ = this.query.selectFilterParameters();
1742
- 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)); }));
1743
- this.length$ = this.filterParameters$.pipe(map(f => f.length));
1744
- this.isEmpty$ = this.recordsFiltered$.pipe(map(r => r === 0));
1745
- this.searchQuery$ = this.filterParameters$.pipe(map(f => f.search));
1746
- this.filterConfig$ = this.query.selectFilterConfig();
1747
- this.sortColumn$ = this.filterParameters$.pipe(map(f => { var _a; return (_a = (f.order && f.order.column)) !== null && _a !== void 0 ? _a : ""; }));
1748
- this.sortDirection$ = this.filterParameters$.pipe(map(f => f.order && f.order.direction));
1749
- this.filterConfigLoading$ = this.query.selectFilterConfigLoading();
1750
- this.rules$ = this.filterParameters$.pipe(map(parameters => parameters.rules));
1751
- 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; }));
1752
- this.searchText$ = new Subject();
1753
- this.setColumn(columns);
1754
- }
1755
- get prefixButtons() {
1756
- var _a, _b;
1757
- 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;
1758
- }
1759
- get suffixButtons() {
1760
- var _a, _b;
1761
- 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;
1762
- }
1763
- ngOnInit() {
1764
- return __awaiter(this, void 0, void 0, function* () {
1765
- yield this.service.init();
1766
- this.service.loadQueryParams(this.autoLoad);
1767
- this.searchText$
1768
- .pipe(debounceTime(300), distinctUntilChanged(), switchMap((search) => {
1769
- this.service.resetPaging();
1770
- return this.service.searchData(search);
1771
- }))
1772
- .subscribe();
1773
- this.mediaObserver.asObservable().subscribe(() => {
1774
- if (!this.autoChangeLayout) {
1775
- return;
1776
- }
1777
- if (this.mediaObserver.isActive("lt-md") && this.layoutContent === LayoutContent.Table) {
1778
- this.layoutContent = LayoutContent.Cards;
1779
- }
1780
- else {
1781
- this.layoutContent = LayoutContent.Table;
1782
- }
1783
- });
1784
- });
1785
- }
1786
- ngOnDestroy() {
1787
- this.service.closeSubscriptions();
1788
- }
1789
- ngOnChanges(changes) {
1790
- if ("mode" in changes) {
1791
- this.service.setMode(changes.mode.currentValue);
1792
- }
1793
- }
1794
- setLoading(loading) {
1795
- this.service.setLoading(loading);
1796
- }
1797
- clickToggleShowQueryBuilder() {
1798
- this.service.toggleQueryBuilder();
1799
- }
1800
- onUpdateRules(rules) {
1801
- this.service.updateGlobalRules(rules);
1802
- }
1803
- onQueryBuilderFilterSelected(filterConfigurationModel) {
1804
- this.service.addRuleFromConfig(filterConfigurationModel);
1805
- }
1806
- onUpdatePage(pageEvent) {
1807
- this.service.loadNewPage(pageEvent.pageIndex * pageEvent.pageSize, pageEvent.pageSize);
1808
- this.newPage.emit(pageEvent);
1809
- }
1810
- onUpdateSearch(search) {
1811
- this.searchText$.next(search);
1812
- }
1813
- getFilterRule$(id) {
1814
- return this.filterParameters$.pipe(map(f => {
1815
- return (f.rules &&
1816
- f.rules[0] &&
1817
- f.rules[0].rules &&
1818
- f.rules[0].rules.find((r) => r.id === id));
1819
- }));
1820
- }
1821
- onUpdateSort(sort) {
1822
- if (!sort.active || !sort.direction) {
1823
- sort = {
1824
- active: "id",
1825
- direction: "asc"
1826
- };
1827
- }
1828
- this.service.loadData({
1829
- order: sort.active && sort.direction ? { column: sort.active, direction: sort.direction } : null
1830
- });
1831
- }
1832
- updateRule(id, newRule) {
1833
- this.service.updateRule(id, newRule);
1834
- }
1835
- updateRules(rules) {
1836
- this.service.updateRules(rules);
1837
- }
1838
- clickExport() {
1839
- const exports = [];
1840
- if (this.exportsSettings.xlsx) {
1841
- exports.push({
1842
- type: "xlsx",
1843
- onClickExport: () => this.clickXlsx()
1844
- });
1845
- }
1846
- else if (this.exportsSettings.csv) {
1847
- exports.push({
1848
- type: "csv",
1849
- onClickExport: () => this.clickCsv()
1850
- });
1851
- }
1852
- else if (this.exportsSettings.pdf) {
1853
- exports.push({
1854
- type: "pdf",
1855
- onClickExport: () => this.clickPdf()
1856
- });
1857
- }
1858
- this.bottomSheet.open(ExportBottomSheetComponent, {
1859
- data: {
1860
- exportStrategies: [
1861
- ...exports,
1862
- ...this.customExport
1863
- ]
1864
- }
1865
- });
1866
- }
1867
- navigate(item) {
1868
- if (this.navigateFn) {
1869
- this.navigateFn(this.baseRoute, item);
1870
- }
1871
- else {
1872
- const route = this.routeFn ? this.routeFn(item) : [(this.baseRoute || "") + (item === null || item === void 0 ? void 0 : item.id)];
1873
- this.router.navigate(typeof route === "string" ? [route] : route, { relativeTo: this.activatedRoute });
1874
- }
1875
- }
1876
- clickXlsx() {
1877
- this.service.downloadData("xlsx");
1878
- }
1879
- clickCsv() {
1880
- this.service.downloadData("csv");
1881
- }
1882
- clickPrint() {
1883
- this.service.printData();
1884
- }
1885
- clickPdf() {
1886
- this.service.downloadData("pdf");
1887
- }
1888
- setColumn(columns) {
1889
- this.columns = columns;
1890
- this.columnNames = columns.map(x => x.id);
1891
- }
1892
- }
1893
- 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 });
1894
- 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: [
1895
- NiceBaseListQuery,
1896
- NiceBaseListService,
1897
- NiceBaseListStore
1898
- ], 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 } });
1899
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListComponent, decorators: [{
1900
- type: Component,
1901
- args: [{
1902
- selector: "nice-base-list",
1903
- templateUrl: "./base-list.template.html",
1904
- providers: [
1905
- NiceBaseListQuery,
1906
- NiceBaseListService,
1907
- NiceBaseListStore
1908
- ]
1909
- }]
1910
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1911
- type: Optional
1912
- }, {
1913
- type: Inject,
1914
- args: [ENABLE_QUERY_BUILDER]
1915
- }] }, { type: undefined, decorators: [{
1916
- type: Inject,
1917
- args: [BASE_LIST_LAYOUT]
1918
- }] }, { type: undefined, decorators: [{
1919
- type: Inject,
1920
- args: [TABLE_COLUMNS]
1921
- }] }, { type: undefined, decorators: [{
1922
- type: Inject,
1923
- args: [EXPORTS_SETTINGS]
1924
- }] }, { type: NiceBaseListQuery }, { type: NiceBaseListService }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }]; }, propDecorators: { title: [{
1925
- type: ContentChild,
1926
- args: [NiceBaseListTitleDirective, { read: TemplateRef }]
1927
- }], buttons: [{
1928
- type: ContentChildren,
1929
- args: [NiceBaseListButtonsDirective]
1930
- }], table: [{
1931
- type: ContentChild,
1932
- args: [NiceBaseListTableDirective, { read: TemplateRef }]
1933
- }], cards: [{
1934
- type: ContentChild,
1935
- args: [NiceBaseListCardsDirective, { read: TemplateRef }]
1936
- }], customContent: [{
1937
- type: ContentChild,
1938
- args: [NiceBaseListCustomContentDirective, { read: TemplateRef }]
1939
- }], filters: [{
1940
- type: ContentChild,
1941
- args: [NiceBaseListFiltersDirective, { read: TemplateRef }]
1942
- }], mode: [{
1943
- type: Input
1944
- }], layout: [{
1945
- type: Input
1946
- }], layoutContent: [{
1947
- type: Input
1948
- }], autoChangeLayout: [{
1949
- type: Input
1950
- }], baseRoute: [{
1951
- type: Input
1952
- }], routeFn: [{
1953
- type: Input
1954
- }], navigateFn: [{
1955
- type: Input
1956
- }], autoLoad: [{
1957
- type: Input
1958
- }], pageTitle: [{
1959
- type: Input
1960
- }], canExport: [{
1961
- type: Input
1962
- }], disableRouting: [{
1963
- type: Input
1964
- }], customExport: [{
1965
- type: Input
1966
- }], newPage: [{
1967
- type: Output
1968
- }] } });
1969
-
1970
- class NiceCustomDateAdapter extends NativeDateAdapter {
1971
- constructor(translateService, locale, platform) {
1972
- super(locale, platform);
1973
- this.translateService = translateService;
1974
- this.setLocale(this.translateService.getDefaultLang());
1975
- // @ts-ignore
1976
- this._format = (dtf, date) => {
1977
- return dtf.format(date);
1978
- };
1979
- }
1980
- format(date, displayFormat) {
1981
- return super.format(date, displayFormat);
1982
- }
1983
- getDate(date) {
1984
- return date.getUTCDate();
1985
- }
1986
- getMonth(date) {
1987
- return date.getUTCMonth();
1988
- }
1989
- getYear(date) {
1990
- return date.getUTCFullYear();
1991
- }
1992
- }
1993
- 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 });
1994
- NiceCustomDateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter });
1995
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter, decorators: [{
1996
- type: Injectable
1997
- }], ctorParameters: function () { return [{ type: i1$4.TranslateService }, { type: undefined, decorators: [{
1998
- type: Inject,
1999
- args: [MAT_DATE_LOCALE]
2000
- }] }, { type: i2$2.Platform }]; } });
2001
-
2002
- class QueryBuilderModule {
2003
- }
2004
- QueryBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2005
- QueryBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, declarations: [QueryBuilderComponent,
2006
- QueryBuilderTriggerDirective,
2007
- FilterSelectionComponent,
2008
- RuleComponent,
2009
- SelectFilterComponent,
2010
- TextFilterComponent,
2011
- NumberFilterComponent,
2012
- RadioFilterComponent,
2013
- DateFilterComponent,
2014
- FilterGroupIconPipe], imports: [CommonModule,
2015
- FormsModule,
2016
- TranslateModule,
2017
- OverlayModule,
2018
- MatCardModule,
2019
- MatListModule,
2020
- FlexLayoutModule,
2021
- MatButtonModule,
2022
- MatRippleModule,
2023
- MatIconModule,
2024
- MatSelectModule,
2025
- MatInputModule,
2026
- MatDatepickerModule,
2027
- MatRadioModule,
2028
- NiceLoadingSpinnerModule,
2029
- NiceTypeaheadModule,
2030
- ReactiveFormsModule,
2031
- NgxMaskModule], exports: [QueryBuilderComponent, QueryBuilderTriggerDirective] });
2032
- QueryBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }], imports: [[
2033
- CommonModule,
2034
- FormsModule,
2035
- TranslateModule,
2036
- OverlayModule,
2037
- MatCardModule,
2038
- MatListModule,
2039
- FlexLayoutModule,
2040
- MatButtonModule,
2041
- MatRippleModule,
2042
- MatIconModule,
2043
- MatSelectModule,
2044
- MatInputModule,
2045
- MatDatepickerModule,
2046
- MatRadioModule,
2047
- NiceLoadingSpinnerModule,
2048
- NiceTypeaheadModule,
2049
- ReactiveFormsModule,
2050
- NgxMaskModule
2051
- ]] });
2052
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, decorators: [{
2053
- type: NgModule,
2054
- args: [{
2055
- imports: [
2056
- CommonModule,
2057
- FormsModule,
2058
- TranslateModule,
2059
- OverlayModule,
2060
- MatCardModule,
2061
- MatListModule,
2062
- FlexLayoutModule,
2063
- MatButtonModule,
2064
- MatRippleModule,
2065
- MatIconModule,
2066
- MatSelectModule,
2067
- MatInputModule,
2068
- MatDatepickerModule,
2069
- MatRadioModule,
2070
- NiceLoadingSpinnerModule,
2071
- NiceTypeaheadModule,
2072
- ReactiveFormsModule,
2073
- NgxMaskModule
2074
- ],
2075
- declarations: [
2076
- QueryBuilderComponent,
2077
- QueryBuilderTriggerDirective,
2078
- FilterSelectionComponent,
2079
- RuleComponent,
2080
- SelectFilterComponent,
2081
- TextFilterComponent,
2082
- NumberFilterComponent,
2083
- RadioFilterComponent,
2084
- DateFilterComponent,
2085
- FilterGroupIconPipe
2086
- ],
2087
- providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }],
2088
- exports: [QueryBuilderComponent, QueryBuilderTriggerDirective]
2089
- }]
2090
- }] });
2091
-
2092
- class NiceBaseListModule {
2093
- static forRoot(options) {
2094
- var _a;
2095
- return {
2096
- ngModule: NiceBaseListModule,
2097
- providers: [
2098
- {
2099
- provide: BASE_LIST_LAYOUT,
2100
- useValue: (_a = options === null || options === void 0 ? void 0 : options.layout) !== null && _a !== void 0 ? _a : defaultLayout
2101
- },
2102
- ...((options === null || options === void 0 ? void 0 : options.queryBuilder) ? [
2103
- {
2104
- provide: ENABLE_QUERY_BUILDER,
2105
- useValue: true
2106
- },
2107
- {
2108
- provide: NiceFilterGroupService,
2109
- useClass: options.queryBuilder.filterGroupService
2110
- },
2111
- options.queryBuilder.savedReportService ? {
2112
- provide: NiceSavedReportService,
2113
- useClass: options.queryBuilder.savedReportService
2114
- } : undefined
2115
- ] : [])
2116
- ].filter(x => !!x)
2117
- };
2118
- }
2119
- static providerFactory(options) {
2120
- var _a;
2121
- return [
2122
- {
2123
- provide: NiceFilterService,
2124
- useClass: options.filterService
2125
- },
2126
- {
2127
- provide: LIST_TABLE,
2128
- useValue: options.table
2129
- },
2130
- {
2131
- provide: TABLE_COLUMNS,
2132
- useValue: options.columns,
2133
- },
2134
- {
2135
- provide: DEFAULT_PARAMETERS,
2136
- useValue: options.defaultParameters
2137
- },
2138
- options.layout ? {
2139
- provide: BASE_LIST_LAYOUT,
2140
- useValue: options.layout
2141
- } : undefined,
2142
- {
2143
- provide: EXPORTS_SETTINGS,
2144
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2145
- pdf: true,
2146
- xlsx: true,
2147
- csv: true
2148
- }
2149
- },
2150
- options.disableQueryBuilder !== undefined ? {
2151
- provide: ENABLE_QUERY_BUILDER,
2152
- useValue: !options.disableQueryBuilder
2153
- } : null,
2154
- ...(options.queryBuilder ? [
2155
- {
2156
- provide: NiceFilterGroupService,
2157
- useClass: options.queryBuilder.filterGroupService
2158
- },
2159
- options.queryBuilder.savedReportService ? {
2160
- provide: NiceSavedReportService,
2161
- useClass: options.queryBuilder.savedReportService
2162
- } : undefined
2163
- ] : [])
2164
- ].filter(x => !!x);
2165
- }
2166
- }
2167
- NiceBaseListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2168
- NiceBaseListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, declarations: [NiceBaseListComponent], imports: [NiceExportBottomSheetModule,
2169
- NiceBaseListDirectiveModule,
2170
- CommonModule,
2171
- FlexModule,
2172
- ExtendedModule,
2173
- FormsModule,
2174
- RouterModule,
2175
- MatButtonModule,
2176
- MatIconModule,
2177
- MatTooltipModule,
2178
- MatCardModule,
2179
- MatPaginatorModule,
2180
- TranslateModule,
2181
- NiceLoadingSpinnerModule,
2182
- MatTableModule,
2183
- MatSortModule,
2184
- MatRippleModule,
2185
- MatBottomSheetModule,
2186
- QueryBuilderModule,
2187
- MatBadgeModule], exports: [NiceBaseListComponent,
2188
- NiceBaseListDirectiveModule] });
2189
- NiceBaseListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, imports: [[
2190
- NiceExportBottomSheetModule,
2191
- NiceBaseListDirectiveModule,
2192
- CommonModule,
2193
- FlexModule,
2194
- ExtendedModule,
2195
- FormsModule,
2196
- RouterModule,
2197
- MatButtonModule,
2198
- MatIconModule,
2199
- MatTooltipModule,
2200
- MatCardModule,
2201
- MatPaginatorModule,
2202
- TranslateModule,
2203
- NiceLoadingSpinnerModule,
2204
- MatTableModule,
2205
- MatSortModule,
2206
- MatRippleModule,
2207
- MatBottomSheetModule,
2208
- QueryBuilderModule,
2209
- MatBadgeModule
2210
- ], NiceBaseListDirectiveModule] });
2211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, decorators: [{
2212
- type: NgModule,
2213
- args: [{
2214
- imports: [
2215
- NiceExportBottomSheetModule,
2216
- NiceBaseListDirectiveModule,
2217
- CommonModule,
2218
- FlexModule,
2219
- ExtendedModule,
2220
- FormsModule,
2221
- RouterModule,
2222
- MatButtonModule,
2223
- MatIconModule,
2224
- MatTooltipModule,
2225
- MatCardModule,
2226
- MatPaginatorModule,
2227
- TranslateModule,
2228
- NiceLoadingSpinnerModule,
2229
- MatTableModule,
2230
- MatSortModule,
2231
- MatRippleModule,
2232
- MatBottomSheetModule,
2233
- QueryBuilderModule,
2234
- MatBadgeModule
2235
- ],
2236
- declarations: [
2237
- NiceBaseListComponent
2238
- ],
2239
- exports: [
2240
- NiceBaseListComponent,
2241
- NiceBaseListDirectiveModule
2242
- ]
2243
- }]
2244
- }] });
2245
-
2246
- class NiceListState {
2247
- }
2248
-
2249
- class NiceMultiStateFilterService extends NiceFilterService {
2250
- constructor(filters) {
2251
- super();
2252
- this.filters = filters;
2253
- }
2254
- switchState(state) {
2255
- this.api = this.filters[state];
2256
- }
2257
- }
2258
-
2259
- const initialValue = Object.assign({}, initialBaseListState);
2260
- let NiceMultiStateListStore = class NiceMultiStateListStore extends NiceBaseListStore {
2261
- constructor() {
2262
- super(null);
2263
- }
2264
- };
2265
- NiceMultiStateListStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2266
- NiceMultiStateListStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore });
2267
- NiceMultiStateListStore = __decorate([
2268
- StoreConfig({ name: "multi-state-list", resettable: true }),
2269
- __metadata("design:paramtypes", [])
2270
- ], NiceMultiStateListStore);
2271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, decorators: [{
2272
- type: Injectable
2273
- }], ctorParameters: function () { return []; } });
2274
-
2275
- class NiceMultiStateListQuery extends NiceBaseListQuery {
2276
- constructor(store) {
2277
- super(store);
2278
- this.store = store;
2279
- }
2280
- }
2281
- NiceMultiStateListQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, deps: [{ token: NiceMultiStateListStore }], target: i0.ɵɵFactoryTarget.Injectable });
2282
- NiceMultiStateListQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery });
2283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, decorators: [{
2284
- type: Injectable
2285
- }], ctorParameters: function () { return [{ type: NiceMultiStateListStore }]; } });
2286
-
2287
- const LIST_STATES = new InjectionToken("list_states");
2288
-
2289
- class NiceMultiStateListService extends NiceBaseListService {
2290
- constructor(states, store, activatedRoute, router, appRef, multiFilterService) {
2291
- super(store, multiFilterService, activatedRoute, router, appRef);
2292
- this.states = states;
2293
- this.multiFilterService = multiFilterService;
2294
- }
2295
- reset() {
2296
- this.store.reset();
2297
- }
2298
- setStateDefaultFilter(state, parameters) {
2299
- this.states[state].defaultParameters = parameters;
2300
- }
2301
- switchState(state) {
2302
- var _a;
2303
- const newState = this.states[state];
2304
- if (!state) {
2305
- return [];
2306
- }
2307
- this.multiFilterService.switchState(state);
2308
- this.reset();
2309
- this.init();
2310
- this.loadData((_a = newState.defaultParameters) !== null && _a !== void 0 ? _a : initialBaseListState.filterParameters);
2311
- return newState.columns;
2312
- }
2313
- }
2314
- 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 });
2315
- NiceMultiStateListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService });
2316
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService, decorators: [{
2317
- type: Injectable
2318
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2319
- type: Inject,
2320
- args: [LIST_STATES]
2321
- }] }, { type: NiceMultiStateListStore }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i0.ApplicationRef }, { type: NiceMultiStateFilterService }]; } });
2322
-
2323
- class NiceMultiStateListComponent extends NiceBaseListComponent {
2324
- constructor(enableQueryBuilder, listLayout, exportsSetting, query, activatedRoute, bottomSheet, router, mediaObserver, multiStateListService) {
2325
- super(enableQueryBuilder, listLayout, [], exportsSetting, query, multiStateListService, activatedRoute, bottomSheet, router, mediaObserver);
2326
- this.multiStateListService = multiStateListService;
2327
- }
2328
- set state(state) {
2329
- this.switchState(state);
2330
- }
2331
- switchState(state) {
2332
- const columns = this.multiStateListService.switchState(state);
2333
- this.setColumn(columns);
2334
- }
2335
- }
2336
- 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 });
2337
- NiceMultiStateListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NiceMultiStateListComponent, selector: "nice-multi-state-list", inputs: { state: "state" }, providers: [
2338
- NiceMultiStateListQuery,
2339
- NiceMultiStateListService,
2340
- NiceMultiStateListStore
2341
- ], 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 } });
2342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListComponent, decorators: [{
2343
- type: Component,
2344
- args: [{
2345
- selector: "nice-multi-state-list",
2346
- templateUrl: "../base-list/base-list.template.html",
2347
- providers: [
2348
- NiceMultiStateListQuery,
2349
- NiceMultiStateListService,
2350
- NiceMultiStateListStore
2351
- ]
2352
- }]
2353
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2354
- type: Optional
2355
- }, {
2356
- type: Inject,
2357
- args: [ENABLE_QUERY_BUILDER]
2358
- }] }, { type: undefined, decorators: [{
2359
- type: Inject,
2360
- args: [BASE_LIST_LAYOUT]
2361
- }] }, { type: undefined, decorators: [{
2362
- type: Inject,
2363
- args: [EXPORTS_SETTINGS]
2364
- }] }, { type: NiceMultiStateListQuery }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }, { type: NiceMultiStateListService }]; }, propDecorators: { state: [{
2365
- type: Input
2366
- }] } });
2367
-
2368
- class NiceMultiStateListModule {
2369
- static providerFactory(options) {
2370
- var _a;
2371
- return [
2372
- {
2373
- provide: NiceMultiStateFilterService,
2374
- useExisting: options.filterService
2375
- },
2376
- {
2377
- provide: LIST_STATES,
2378
- useValue: options.states
2379
- },
2380
- options.layout ? {
2381
- provide: BASE_LIST_LAYOUT,
2382
- useValue: options.layout
2383
- } : undefined,
2384
- {
2385
- provide: EXPORTS_SETTINGS,
2386
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2387
- pdf: true,
2388
- xlsx: true,
2389
- csv: true
2390
- }
2391
- },
2392
- ...(options.queryBuilder ? [
2393
- {
2394
- provide: ENABLE_QUERY_BUILDER,
2395
- useValue: true
2396
- },
2397
- {
2398
- provide: NiceFilterGroupService,
2399
- useClass: options.queryBuilder.filterGroupService
2400
- },
2401
- options.queryBuilder.savedReportService ? {
2402
- provide: NiceSavedReportService,
2403
- useClass: options.queryBuilder.savedReportService
2404
- } : undefined
2405
- ] : [])
2406
- ].filter(x => !!x);
2407
- }
2408
- }
2409
- NiceMultiStateListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2410
- NiceMultiStateListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, declarations: [NiceMultiStateListComponent], imports: [NiceExportBottomSheetModule,
2411
- NiceBaseListDirectiveModule,
2412
- CommonModule,
2413
- FlexModule,
2414
- ExtendedModule,
2415
- FormsModule,
2416
- RouterModule,
2417
- MatButtonModule,
2418
- MatIconModule,
2419
- MatTooltipModule,
2420
- MatCardModule,
2421
- MatPaginatorModule,
2422
- TranslateModule,
2423
- NiceLoadingSpinnerModule,
2424
- MatTableModule,
2425
- MatSortModule,
2426
- MatRippleModule,
2427
- MatBottomSheetModule,
2428
- QueryBuilderModule,
2429
- MatBadgeModule], exports: [NiceMultiStateListComponent,
2430
- NiceBaseListDirectiveModule] });
2431
- NiceMultiStateListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, imports: [[
2432
- NiceExportBottomSheetModule,
2433
- NiceBaseListDirectiveModule,
2434
- CommonModule,
2435
- FlexModule,
2436
- ExtendedModule,
2437
- FormsModule,
2438
- RouterModule,
2439
- MatButtonModule,
2440
- MatIconModule,
2441
- MatTooltipModule,
2442
- MatCardModule,
2443
- MatPaginatorModule,
2444
- TranslateModule,
2445
- NiceLoadingSpinnerModule,
2446
- MatTableModule,
2447
- MatSortModule,
2448
- MatRippleModule,
2449
- MatBottomSheetModule,
2450
- QueryBuilderModule,
2451
- MatBadgeModule
2452
- ], NiceBaseListDirectiveModule] });
2453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, decorators: [{
2454
- type: NgModule,
2455
- args: [{
2456
- imports: [
2457
- NiceExportBottomSheetModule,
2458
- NiceBaseListDirectiveModule,
2459
- CommonModule,
2460
- FlexModule,
2461
- ExtendedModule,
2462
- FormsModule,
2463
- RouterModule,
2464
- MatButtonModule,
2465
- MatIconModule,
2466
- MatTooltipModule,
2467
- MatCardModule,
2468
- MatPaginatorModule,
2469
- TranslateModule,
2470
- NiceLoadingSpinnerModule,
2471
- MatTableModule,
2472
- MatSortModule,
2473
- MatRippleModule,
2474
- MatBottomSheetModule,
2475
- QueryBuilderModule,
2476
- MatBadgeModule
2477
- ],
2478
- declarations: [
2479
- NiceMultiStateListComponent
2480
- ],
2481
- exports: [
2482
- NiceMultiStateListComponent,
2483
- NiceBaseListDirectiveModule
2484
- ]
2485
- }]
2486
- }] });
2487
-
2488
- class StringUtils {
2489
- }
2490
- String.prototype.toTableColumn = function (sortable) {
2491
- return new TableColumns(this.toString(), sortable);
2492
- };
2493
-
2494
- /*
2495
- * Public API Surface of nice-data-filter-kit
2496
- */
2497
-
2498
- /**
2499
- * Generated bundle index. Do not edit.
2500
- */
2501
-
2502
- 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 };
2503
- //# sourceMappingURL=recursyve-nice-data-filter-kit.js.map