@recursyve/nice-data-filter-kit 12.1.27 → 13.0.0

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