@recursyve/nice-data-filter-kit 12.1.28 → 13.0.1

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 +1 -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 -3153
  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 -290
  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 -327
  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 -2485
  105. package/fesm2015/recursyve-nice-data-filter-kit.js.map +0 -1
@@ -1,2485 +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
- searchData(search) {
911
- return __awaiter(this, void 0, void 0, function* () {
912
- const { filterParameters } = this.store.getValue();
913
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { search }));
914
- });
915
- }
916
- loadNewPage(start, length) {
917
- return __awaiter(this, void 0, void 0, function* () {
918
- const { filterParameters } = this.store.getValue();
919
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { start,
920
- length }));
921
- });
922
- }
923
- loadNextPage() {
924
- return __awaiter(this, void 0, void 0, function* () {
925
- const { filterParameters } = this.store.getValue();
926
- yield this.loadData(Object.assign(Object.assign({}, filterParameters), { start: filterParameters.start + filterParameters.length }));
927
- });
928
- }
929
- resetPaging() {
930
- return __awaiter(this, void 0, void 0, function* () {
931
- const { filterParameters } = this.store.getValue();
932
- this.store.setParameters(Object.assign(Object.assign({}, filterParameters), { start: 0 }));
933
- this.store.update({
934
- resetPaging: true
935
- });
936
- });
937
- }
938
- downloadData(type, parameters, updateQueryParams = true) {
939
- return __awaiter(this, void 0, void 0, function* () {
940
- try {
941
- this.store.setLoading(true);
942
- this.loadingData = true;
943
- const filterParameters = this.mergeParameters(parameters);
944
- if (filterParameters) {
945
- this.setParameters(filterParameters, updateQueryParams);
946
- }
947
- const result = yield this.filterService.getFile(type, this.getParameters(filterParameters)).toPromise();
948
- FileUtils.downloadFile(`${this.downloadFileName}.${type}`, result);
949
- }
950
- catch (e) {
951
- this.store.setError(e);
952
- }
953
- finally {
954
- this.store.setLoading(false);
955
- this.loadingData = false;
956
- }
957
- });
958
- }
959
- printData(parameters, updateQueryParams = true) {
960
- return __awaiter(this, void 0, void 0, function* () {
961
- try {
962
- this.store.setLoading(true);
963
- this.loadingData = true;
964
- const filterParameters = this.mergeParameters(parameters);
965
- if (filterParameters) {
966
- this.setParameters(filterParameters, updateQueryParams);
967
- }
968
- const result = yield this.filterService.getPrintableHtml(this.getParameters(filterParameters)).toPromise();
969
- FileUtils.openPrintableWindow(result);
970
- }
971
- catch (e) {
972
- this.store.setError(e);
973
- }
974
- finally {
975
- this.store.setLoading(false);
976
- this.loadingData = false;
977
- }
978
- });
979
- }
980
- updateRule(id, newRule) {
981
- var _a;
982
- const { filterParameters } = this.store.getValue();
983
- const rules = (_a = filterParameters.rules) === null || _a === void 0 ? void 0 : _a[0];
984
- if (!rules || rules.rules.length === 0) {
985
- this.updateRules([newRule]);
986
- return;
987
- }
988
- const oldRule = rules.rules.find((r) => r.id === id);
989
- let newRules = rules.rules;
990
- if (oldRule) {
991
- if (newRule) {
992
- // Array replace
993
- newRules = [
994
- ...rules.rules.slice(0, rules.rules.indexOf(oldRule)),
995
- newRule,
996
- ...rules.rules.slice(rules.rules.indexOf(oldRule) + 1, rules.rules.length)
997
- ];
998
- }
999
- else {
1000
- newRules = rules.rules.filter((r) => r.id !== id);
1001
- }
1002
- }
1003
- else {
1004
- newRules = [...newRules, newRule];
1005
- }
1006
- this.updateRules(newRules);
1007
- }
1008
- updateDefaultRules(rule) {
1009
- this.store.update({
1010
- defaultRules: rule
1011
- });
1012
- }
1013
- updateGlobalRules(rules, updateQueryParams = true) {
1014
- return __awaiter(this, void 0, void 0, function* () {
1015
- const { filterParameters } = this.store.getValue();
1016
- const newRules = Object.assign(Object.assign({}, filterParameters), { rules });
1017
- yield this.loadData(newRules, updateQueryParams);
1018
- });
1019
- }
1020
- addRuleFromConfig(config) {
1021
- const { filterParameters } = this.store.getValue();
1022
- const newRules = Object.assign(Object.assign({}, filterParameters), { rules: [
1023
- ...filterParameters.rules,
1024
- QBFilterUtils.createQueryModel(config)
1025
- ] });
1026
- this.store.update({
1027
- showQueryBuilder: true
1028
- });
1029
- this.loadData(newRules, true);
1030
- }
1031
- updateRules(rules) {
1032
- const { filterParameters } = this.store.getValue();
1033
- const newRules = {
1034
- order: filterParameters.order,
1035
- rules: [
1036
- {
1037
- condition: "and",
1038
- rules
1039
- }
1040
- ]
1041
- };
1042
- this.loadData(newRules, true);
1043
- }
1044
- toggleQueryBuilder() {
1045
- this.store.update((state) => ({
1046
- showQueryBuilder: !state.showQueryBuilder
1047
- }));
1048
- }
1049
- updateListValue(value, key = "id") {
1050
- const { filterResult } = this.store.getValue();
1051
- if (!filterResult) {
1052
- return;
1053
- }
1054
- this.store.update({
1055
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayUpsert(filterResult.values, value[key], value) })
1056
- });
1057
- }
1058
- removeListValue(value, key = "id") {
1059
- const { filterResult } = this.store.getValue();
1060
- if (!filterResult) {
1061
- return;
1062
- }
1063
- this.store.update({
1064
- filterResult: Object.assign(Object.assign({}, filterResult), { values: arrayRemove(filterResult.values, value[key]) })
1065
- });
1066
- }
1067
- updateQueryParams(queryParams) {
1068
- return __awaiter(this, void 0, void 0, function* () {
1069
- if (!this.activatedRoute) {
1070
- return;
1071
- }
1072
- yield this.router.navigate([], {
1073
- relativeTo: this.activatedRoute,
1074
- queryParams,
1075
- queryParamsHandling: "merge"
1076
- });
1077
- });
1078
- }
1079
- getParameters(filterParameters) {
1080
- const { defaultRules } = this.store.getValue();
1081
- const parameters = Object.assign(Object.assign({}, filterParameters), { rules: (filterParameters === null || filterParameters === void 0 ? void 0 : filterParameters.rules) ? [...filterParameters.rules] : [] });
1082
- if (defaultRules === null || defaultRules === void 0 ? void 0 : defaultRules.length) {
1083
- parameters.rules.push({
1084
- condition: "and",
1085
- rules: defaultRules
1086
- });
1087
- }
1088
- return parameters;
1089
- }
1090
- mergeParameters(parameters) {
1091
- const { filterParameters } = this.store.getValue();
1092
- if (!parameters) {
1093
- return filterParameters;
1094
- }
1095
- return Object.assign(Object.assign(Object.assign({}, filterParameters), parameters), { order: filterParameters.order && !parameters.order
1096
- ? undefined
1097
- : Object.assign(Object.assign({}, filterParameters.order), parameters.order) });
1098
- }
1099
- setParameters(parameters, updateQueryParams = true) {
1100
- this.store.setParameters(parameters);
1101
- if (updateQueryParams) {
1102
- this.updateQueryParams(QueryParamsUtils.filterParametersToParamsMap(parameters));
1103
- }
1104
- }
1105
- }
1106
- 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 });
1107
- NiceBaseListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListService });
1108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListService, decorators: [{
1109
- type: Injectable
1110
- }], ctorParameters: function () { return [{ type: NiceBaseListStore }, { type: NiceFilterService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i0.ApplicationRef }]; } });
1111
-
1112
- class QueryRuleForm {
1113
- constructor(rule) {
1114
- if (!rule) {
1115
- return;
1116
- }
1117
- this.id = rule.id;
1118
- this.operation = rule.operation;
1119
- if (QBFilterUtils.isDoubleInput(rule.operation)) {
1120
- this.value = rule.value[0];
1121
- this.secondValue = rule.value[1];
1122
- }
1123
- else {
1124
- this.value = rule.value;
1125
- }
1126
- }
1127
- transform() {
1128
- return {
1129
- id: this.id,
1130
- operation: this.operation,
1131
- value: this.secondValue === undefined ? this.value : [this.value, this.secondValue]
1132
- };
1133
- }
1134
- }
1135
- __decorate([
1136
- Control(),
1137
- Required(),
1138
- __metadata("design:type", String)
1139
- ], QueryRuleForm.prototype, "id", void 0);
1140
- __decorate([
1141
- Control(),
1142
- Required(),
1143
- __metadata("design:type", String)
1144
- ], QueryRuleForm.prototype, "operation", void 0);
1145
- __decorate([
1146
- Control(),
1147
- Required(),
1148
- __metadata("design:type", Object)
1149
- ], QueryRuleForm.prototype, "value", void 0);
1150
- __decorate([
1151
- Control(),
1152
- Required(),
1153
- __metadata("design:type", Object)
1154
- ], QueryRuleForm.prototype, "secondValue", void 0);
1155
- class QueryForm {
1156
- }
1157
- __decorate([
1158
- Control(),
1159
- Required(),
1160
- __metadata("design:type", String)
1161
- ], QueryForm.prototype, "condition", void 0);
1162
- __decorate([
1163
- Array$1(QueryRuleForm),
1164
- __metadata("design:type", Array$1)
1165
- ], QueryForm.prototype, "rules", void 0);
1166
- class QueryBuilderForm {
1167
- constructor(rules) {
1168
- if (!rules) {
1169
- rules = [];
1170
- }
1171
- this.rules = rules.map(x => ({
1172
- condition: x.condition,
1173
- rules: x.rules.map(rule => new QueryRuleForm(rule))
1174
- }));
1175
- }
1176
- transform() {
1177
- return this.rules.map(x => ({
1178
- condition: x.condition,
1179
- rules: x.rules.map(rule => rule.transform())
1180
- }));
1181
- }
1182
- }
1183
- __decorate([
1184
- Array$1(QueryForm),
1185
- __metadata("design:type", Array$1)
1186
- ], QueryBuilderForm.prototype, "rules", void 0);
1187
-
1188
- class FilterComponent {
1189
- constructor() {
1190
- this.valueIndex = -1;
1191
- this.propagateChanges = (_) => { };
1192
- }
1193
- get value() {
1194
- if (this.valueIndex < 0) {
1195
- return this._value;
1196
- }
1197
- else if (this._value instanceof Array) {
1198
- return this._value[this.valueIndex];
1199
- }
1200
- return undefined;
1201
- }
1202
- registerOnTouched(fn) {
1203
- // NO-OP
1204
- }
1205
- registerOnChange(fn) {
1206
- this.propagateChanges = fn;
1207
- }
1208
- writeValue(value) {
1209
- this._value = value;
1210
- }
1211
- onValueChange(value) {
1212
- if (this.valueIndex < 0) {
1213
- this.propagateChanges(value);
1214
- }
1215
- else if (this._value instanceof Array) {
1216
- const v = [...this._value];
1217
- v[this.valueIndex] = value;
1218
- this.propagateChanges(v);
1219
- }
1220
- }
1221
- }
1222
- FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1223
- 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 });
1224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterComponent, decorators: [{
1225
- type: Component,
1226
- args: [{ template: `` }]
1227
- }], propDecorators: { valueIndex: [{
1228
- type: Input
1229
- }] } });
1230
-
1231
- class TextFilterComponent extends FilterComponent {
1232
- }
1233
- TextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1234
- TextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: TextFilterComponent, selector: "nice-text-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1235
- {
1236
- provide: NG_VALUE_ACCESSOR,
1237
- useExisting: forwardRef(() => TextFilterComponent),
1238
- multi: true
1239
- }
1240
- ], 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 });
1241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: TextFilterComponent, decorators: [{
1242
- type: Component,
1243
- args: [{
1244
- selector: "nice-text-filter",
1245
- templateUrl: "text-filter.template.html",
1246
- encapsulation: ViewEncapsulation.None,
1247
- providers: [
1248
- {
1249
- provide: NG_VALUE_ACCESSOR,
1250
- useExisting: forwardRef(() => TextFilterComponent),
1251
- multi: true
1252
- }
1253
- ]
1254
- }]
1255
- }], propDecorators: { filterConfig: [{
1256
- type: Input
1257
- }] } });
1258
-
1259
- class NumberFilterComponent extends FilterComponent {
1260
- }
1261
- NumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1262
- NumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NumberFilterComponent, selector: "nice-number-filter", providers: [
1263
- {
1264
- provide: NG_VALUE_ACCESSOR,
1265
- useExisting: forwardRef(() => NumberFilterComponent),
1266
- multi: true
1267
- }
1268
- ], 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 });
1269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFilterComponent, decorators: [{
1270
- type: Component,
1271
- args: [{
1272
- selector: "nice-number-filter",
1273
- templateUrl: "number-filter.template.html",
1274
- encapsulation: ViewEncapsulation.None,
1275
- providers: [
1276
- {
1277
- provide: NG_VALUE_ACCESSOR,
1278
- useExisting: forwardRef(() => NumberFilterComponent),
1279
- multi: true
1280
- }
1281
- ]
1282
- }]
1283
- }] });
1284
-
1285
- class RadioFilterComponent extends FilterComponent {
1286
- }
1287
- RadioFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1288
- RadioFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: RadioFilterComponent, selector: "nice-radio-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1289
- {
1290
- provide: NG_VALUE_ACCESSOR,
1291
- useExisting: forwardRef(() => RadioFilterComponent),
1292
- multi: true
1293
- }
1294
- ], 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 });
1295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RadioFilterComponent, decorators: [{
1296
- type: Component,
1297
- args: [{
1298
- selector: "nice-radio-filter",
1299
- templateUrl: "radio-filter.template.html",
1300
- encapsulation: ViewEncapsulation.None,
1301
- providers: [
1302
- {
1303
- provide: NG_VALUE_ACCESSOR,
1304
- useExisting: forwardRef(() => RadioFilterComponent),
1305
- multi: true
1306
- }
1307
- ]
1308
- }]
1309
- }], propDecorators: { filterConfig: [{
1310
- type: Input
1311
- }] } });
1312
-
1313
- class SelectFilterComponent extends FilterComponent {
1314
- constructor(filterService) {
1315
- super();
1316
- this.filterService = filterService;
1317
- this.values = [];
1318
- this.search$ = new Subject();
1319
- }
1320
- ngOnInit() {
1321
- return __awaiter(this, void 0, void 0, function* () {
1322
- if (!this.filterConfig.lazyLoading) {
1323
- this.values = this.filterConfig.values;
1324
- }
1325
- this.searchSub$ = this.search$
1326
- .pipe(debounceTime(300), switchMap(value => {
1327
- if (this.filterConfig.lazyLoading) {
1328
- return this.filterService.searchFilterValue(this.filterConfig, value);
1329
- }
1330
- return of(this.filterConfig.values);
1331
- }))
1332
- .subscribe(values => {
1333
- this.values = values;
1334
- });
1335
- });
1336
- }
1337
- ngOnChanges(changes) {
1338
- if ("filterConfig" in changes) {
1339
- if (!this.filterConfig.lazyLoading) {
1340
- this.values = this.filterConfig.values;
1341
- }
1342
- }
1343
- }
1344
- searchValue() {
1345
- return __awaiter(this, void 0, void 0, function* () {
1346
- if (this.value && !this.values.find(v => v.id === this.value)) {
1347
- const value = yield this.filterService
1348
- .searchFilterResourceValue(this.filterConfig, this.value)
1349
- .toPromise();
1350
- this.values = [...this.values, value];
1351
- }
1352
- });
1353
- }
1354
- onValueChange(value) {
1355
- super.onValueChange(value);
1356
- this.searchValue();
1357
- }
1358
- ngOnDestroy() {
1359
- this.searchSub$.unsubscribe();
1360
- }
1361
- writeValue(value) {
1362
- super.writeValue(value);
1363
- this.searchValue();
1364
- }
1365
- }
1366
- 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 });
1367
- SelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: SelectFilterComponent, selector: "nice-select-filter", inputs: { filterConfig: "filterConfig" }, providers: [
1368
- {
1369
- provide: NG_VALUE_ACCESSOR,
1370
- useExisting: forwardRef(() => SelectFilterComponent),
1371
- multi: true
1372
- }
1373
- ], 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 });
1374
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: SelectFilterComponent, decorators: [{
1375
- type: Component,
1376
- args: [{
1377
- selector: "nice-select-filter",
1378
- templateUrl: "select-filter.template.html",
1379
- encapsulation: ViewEncapsulation.None,
1380
- providers: [
1381
- {
1382
- provide: NG_VALUE_ACCESSOR,
1383
- useExisting: forwardRef(() => SelectFilterComponent),
1384
- multi: true
1385
- }
1386
- ]
1387
- }]
1388
- }], ctorParameters: function () { return [{ type: NiceFilterService, decorators: [{
1389
- type: Optional
1390
- }] }]; }, propDecorators: { filterConfig: [{
1391
- type: Input
1392
- }] } });
1393
-
1394
- class DateFilterComponent extends FilterComponent {
1395
- }
1396
- DateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1397
- DateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: DateFilterComponent, selector: "nice-date-filter", providers: [
1398
- {
1399
- provide: NG_VALUE_ACCESSOR,
1400
- useExisting: forwardRef(() => DateFilterComponent),
1401
- multi: true
1402
- }
1403
- ], 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 });
1404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFilterComponent, decorators: [{
1405
- type: Component,
1406
- args: [{
1407
- selector: "nice-date-filter",
1408
- templateUrl: "date-filter.template.html",
1409
- encapsulation: ViewEncapsulation.None,
1410
- providers: [
1411
- {
1412
- provide: NG_VALUE_ACCESSOR,
1413
- useExisting: forwardRef(() => DateFilterComponent),
1414
- multi: true
1415
- }
1416
- ]
1417
- }]
1418
- }] });
1419
-
1420
- class NiceFilterGroupService {
1421
- }
1422
-
1423
- class FilterGroupIconPipe {
1424
- constructor(service) {
1425
- this.service = service;
1426
- }
1427
- transform(value) {
1428
- return this.service.getFilterGroupIconClass(value);
1429
- }
1430
- }
1431
- FilterGroupIconPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, deps: [{ token: NiceFilterGroupService }], target: i0.ɵɵFactoryTarget.Pipe });
1432
- FilterGroupIconPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, name: "filterGroupIcon" });
1433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterGroupIconPipe, decorators: [{
1434
- type: Pipe,
1435
- args: [{
1436
- name: "filterGroupIcon"
1437
- }]
1438
- }], ctorParameters: function () { return [{ type: NiceFilterGroupService }]; } });
1439
-
1440
- class FilterSelectionComponent {
1441
- constructor() {
1442
- this.filterSelected = new EventEmitter();
1443
- }
1444
- get filterGroups() {
1445
- const groups = ArrayUtils.uniqueObjects(this.filterConfigs.map(x => x.group), x => x === null || x === void 0 ? void 0 : x.key);
1446
- const result = [];
1447
- for (const group of groups) {
1448
- if (!group) {
1449
- continue;
1450
- }
1451
- result.push([group, this.filterConfigs.filter(x => { var _a; return ((_a = x.group) === null || _a === void 0 ? void 0 : _a.key) === group.key; })]);
1452
- }
1453
- return result.sort(([, a], [, b]) => b.length - a.length);
1454
- }
1455
- selectFilter(filterConfigurationModel) {
1456
- this.filterSelected.emit(filterConfigurationModel);
1457
- }
1458
- }
1459
- FilterSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1460
- 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 });
1461
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: FilterSelectionComponent, decorators: [{
1462
- type: Component,
1463
- args: [{
1464
- selector: "nice-filter-selection",
1465
- templateUrl: "filter-selection.template.html",
1466
- styleUrls: ["./filter-selection.style.scss"],
1467
- encapsulation: ViewEncapsulation.None,
1468
- changeDetection: ChangeDetectionStrategy.OnPush
1469
- }]
1470
- }], propDecorators: { filterConfigs: [{
1471
- type: Input
1472
- }], loading: [{
1473
- type: Input
1474
- }], filterSelected: [{
1475
- type: Output
1476
- }] } });
1477
-
1478
- class QueryBuilderTriggerDirective {
1479
- constructor(overlayPositionBuilder, elementRef, overlay, platform) {
1480
- this.overlayPositionBuilder = overlayPositionBuilder;
1481
- this.elementRef = elementRef;
1482
- this.overlay = overlay;
1483
- this.platform = platform;
1484
- this.queryBuilderFilterSelected = new EventEmitter();
1485
- }
1486
- set queryBuilderFilters(queryBuilderFilters) {
1487
- if (queryBuilderFilters) {
1488
- this._queryBuilderFilters = queryBuilderFilters;
1489
- }
1490
- this.updateFilterSelectionComponent();
1491
- }
1492
- set queryBuilderFiltersLoading(queryBuilderFiltersLoading) {
1493
- this._queryBuilderFiltersLoading = queryBuilderFiltersLoading;
1494
- this.updateFilterSelectionComponent();
1495
- }
1496
- click() {
1497
- const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([
1498
- {
1499
- originX: "center",
1500
- originY: "bottom",
1501
- overlayX: this.isMobile() ? "end" : "center",
1502
- overlayY: "top"
1503
- }
1504
- ]);
1505
- this.overlayRef = this.overlay.create({
1506
- positionStrategy,
1507
- hasBackdrop: true,
1508
- backdropClass: "cdk-overlay-transparent-backdrop"
1509
- });
1510
- const filterSelectionPortal = new ComponentPortal(FilterSelectionComponent);
1511
- this.filterSelectionRef = this.overlayRef.attach(filterSelectionPortal);
1512
- this.updateFilterSelectionComponent();
1513
- this.overlayRef.backdropClick().subscribe(() => this.close());
1514
- }
1515
- close() {
1516
- this.overlayRef.dispose();
1517
- }
1518
- updateFilterSelectionComponent() {
1519
- if (!this.filterSelectionRef) {
1520
- return;
1521
- }
1522
- this.filterSelectionRef.instance.filterConfigs = this._queryBuilderFilters;
1523
- this.filterSelectionRef.instance.loading = this._queryBuilderFiltersLoading;
1524
- this.filterSelectionRef.instance.filterSelected.subscribe((filter) => {
1525
- this.queryBuilderFilterSelected.emit(filter);
1526
- this.close();
1527
- });
1528
- }
1529
- isMobile() {
1530
- return this.platform.ANDROID || this.platform.IOS;
1531
- }
1532
- }
1533
- 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 });
1534
- 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 });
1535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderTriggerDirective, decorators: [{
1536
- type: Directive,
1537
- args: [{ selector: "[niceQueryBuilderTrigger]" }]
1538
- }], ctorParameters: function () { return [{ type: i1$3.OverlayPositionBuilder }, { type: i0.ElementRef }, { type: i1$3.Overlay }, { type: i2$2.Platform }]; }, propDecorators: { queryBuilderFilters: [{
1539
- type: Input
1540
- }], queryBuilderFiltersLoading: [{
1541
- type: Input
1542
- }], queryBuilderFilterSelected: [{
1543
- type: Output
1544
- }], click: [{
1545
- type: HostListener,
1546
- args: ["click"]
1547
- }] } });
1548
-
1549
- class RuleComponent {
1550
- constructor(formGroupName) {
1551
- this.formGroupName = formGroupName;
1552
- this.remove = new EventEmitter();
1553
- }
1554
- get filterConfig() {
1555
- var _a;
1556
- const rule = this.rules.at(0).value;
1557
- return (_a = this.filterConfigs) === null || _a === void 0 ? void 0 : _a.find(f => f.id === rule.id);
1558
- }
1559
- get isSingleInput() {
1560
- return !this.isDoubleInput && !this.isNoInput;
1561
- }
1562
- get isDoubleInput() {
1563
- return QBFilterUtils.isDoubleInput(this.filterOperator);
1564
- }
1565
- get isNoInput() {
1566
- return QBFilterUtils.isNoInput(this.filterOperator);
1567
- }
1568
- ngOnInit() {
1569
- this.formGroup = this.formGroupName.control;
1570
- this.rules = this.formGroup.get("rules");
1571
- this.filterOperator = this.rules.at(0).value.operation;
1572
- }
1573
- onUpdateFilterConfig(config) {
1574
- const rule = QBFilterUtils.createRule(config);
1575
- this.rules.patchValue([rule]);
1576
- this.filterOperator = rule.operation;
1577
- }
1578
- onClickOr() {
1579
- this.rules.push(QBFilterUtils.createRule(this.filterConfig, this.filterOperator));
1580
- }
1581
- onUpdateFilterOperator(operator) {
1582
- var _a, _b;
1583
- this.filterOperator = operator;
1584
- for (const rule of this.rules.controls) {
1585
- (_a = rule.get("operation")) === null || _a === void 0 ? void 0 : _a.patchValue(this.filterOperator);
1586
- if (this.isDoubleInput) {
1587
- (_b = rule.get("value")) === null || _b === void 0 ? void 0 : _b.patchValue([rule.value.value, rule.value.value]);
1588
- }
1589
- }
1590
- }
1591
- onClickDelete(index) {
1592
- if (this.rules.length > 1) {
1593
- this.rules.removeAt(index);
1594
- }
1595
- else {
1596
- this.remove.emit();
1597
- }
1598
- }
1599
- }
1600
- 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 });
1601
- 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 });
1602
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: RuleComponent, decorators: [{
1603
- type: Component,
1604
- args: [{
1605
- selector: "nice-rule",
1606
- templateUrl: "rule.template.html",
1607
- styleUrls: ["./rule.style.scss"],
1608
- encapsulation: ViewEncapsulation.None
1609
- }]
1610
- }], ctorParameters: function () { return [{ type: i1$1.FormGroupName }]; }, propDecorators: { filterConfigs: [{
1611
- type: Input
1612
- }], remove: [{
1613
- type: Output
1614
- }] } });
1615
-
1616
- class QueryBuilderComponent {
1617
- constructor(formGroup) {
1618
- this.formGroup = formGroup;
1619
- this.close = new EventEmitter();
1620
- this.createReport = new EventEmitter();
1621
- this.updateReport = new EventEmitter();
1622
- this.propagateChanges = (_) => { };
1623
- this.rules = this.formGroup.get("rules");
1624
- }
1625
- get canSave() {
1626
- return !this.currentSavedReport;
1627
- }
1628
- registerOnChange(fn) {
1629
- this.propagateChanges = fn;
1630
- }
1631
- registerOnTouched(fn) { }
1632
- writeValue(rules) {
1633
- this.rules.clear();
1634
- this.formGroup.patchValue(new QueryBuilderForm(rules));
1635
- }
1636
- onClickAddRule(filterConfigurationModel) {
1637
- this.rules.push(QBFilterUtils.createQueryModel(filterConfigurationModel));
1638
- }
1639
- onClickDeleteRule(id) {
1640
- this.rules.removeAt(id);
1641
- if (this.rules.length === 0) {
1642
- this.close.emit();
1643
- this.onClickApply();
1644
- }
1645
- }
1646
- onClickApply() {
1647
- this.propagateChanges(this.formGroup.getRawValue().transform());
1648
- }
1649
- onClickSaveReport() {
1650
- this.createReport.emit();
1651
- }
1652
- onClickUpdateReport() {
1653
- this.updateReport.emit();
1654
- }
1655
- }
1656
- 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 });
1657
- 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: [
1658
- {
1659
- provide: NG_VALUE_ACCESSOR,
1660
- useExisting: forwardRef(() => QueryBuilderComponent),
1661
- multi: true
1662
- },
1663
- {
1664
- provide: GeneratedFormGroup,
1665
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1666
- }
1667
- ], 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 });
1668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderComponent, decorators: [{
1669
- type: Component,
1670
- args: [{
1671
- selector: "nice-query-builder",
1672
- templateUrl: "./query-builder.template.html",
1673
- styleUrls: ["./query-builder.style.scss"],
1674
- encapsulation: ViewEncapsulation.None,
1675
- providers: [
1676
- {
1677
- provide: NG_VALUE_ACCESSOR,
1678
- useExisting: forwardRef(() => QueryBuilderComponent),
1679
- multi: true
1680
- },
1681
- {
1682
- provide: GeneratedFormGroup,
1683
- useFactory: ngxFormGeneratorFactory(QueryBuilderForm)
1684
- }
1685
- ]
1686
- }]
1687
- }], ctorParameters: function () { return [{ type: i1$5.GeneratedFormGroup }]; }, propDecorators: { filterConfigs: [{
1688
- type: Input
1689
- }], currentSavedReport: [{
1690
- type: Input
1691
- }], loading: [{
1692
- type: Input
1693
- }], close: [{
1694
- type: Output
1695
- }], createReport: [{
1696
- type: Output
1697
- }], updateReport: [{
1698
- type: Output
1699
- }] } });
1700
-
1701
- class NiceBaseListComponent {
1702
- constructor(enableQueryBuilder, listLayout, columns, exportsSettings, query, service, activatedRoute, bottomSheet, router, mediaObserver) {
1703
- this.enableQueryBuilder = enableQueryBuilder;
1704
- this.listLayout = listLayout;
1705
- this.columns = columns;
1706
- this.exportsSettings = exportsSettings;
1707
- this.query = query;
1708
- this.service = service;
1709
- this.activatedRoute = activatedRoute;
1710
- this.bottomSheet = bottomSheet;
1711
- this.router = router;
1712
- this.mediaObserver = mediaObserver;
1713
- this.mode = "normal";
1714
- this.layout = "page";
1715
- this.layoutContent = LayoutContent.Table;
1716
- this.autoChangeLayout = true;
1717
- this.autoLoad = true;
1718
- this.canExport = true;
1719
- this.disableRouting = false;
1720
- this.customExport = [];
1721
- this.newPage = new EventEmitter();
1722
- this.defaultPageSizeOptions = [10, 25, 50, 100];
1723
- this.columnNames = [];
1724
- this.loading$ = this.query.selectLoading();
1725
- this.filterResult$ = this.query.selectFilterResult();
1726
- this.data$ = this.query.selectData();
1727
- this.recordsFiltered$ = this.filterResult$.pipe(map(f => f && f.total));
1728
- this.showQueryBuilder$ = this.query.selectShowQueryBuilder();
1729
- this.filterParameters$ = this.query.selectFilterParameters();
1730
- 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)); }));
1731
- this.length$ = this.filterParameters$.pipe(map(f => f.length));
1732
- this.isEmpty$ = this.recordsFiltered$.pipe(map(r => r === 0));
1733
- this.searchQuery$ = this.filterParameters$.pipe(map(f => f.search));
1734
- this.filterConfig$ = this.query.selectFilterConfig();
1735
- this.sortColumn$ = this.filterParameters$.pipe(map(f => { var _a; return (_a = (f.order && f.order.column)) !== null && _a !== void 0 ? _a : ""; }));
1736
- this.sortDirection$ = this.filterParameters$.pipe(map(f => f.order && f.order.direction));
1737
- this.filterConfigLoading$ = this.query.selectFilterConfigLoading();
1738
- this.rules$ = this.filterParameters$.pipe(map(parameters => parameters.rules));
1739
- 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; }));
1740
- this.searchText$ = new Subject();
1741
- this.setColumn(columns);
1742
- }
1743
- get prefixButtons() {
1744
- var _a, _b;
1745
- 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;
1746
- }
1747
- get suffixButtons() {
1748
- var _a, _b;
1749
- 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;
1750
- }
1751
- ngOnInit() {
1752
- return __awaiter(this, void 0, void 0, function* () {
1753
- yield this.service.init();
1754
- this.service.loadQueryParams(this.autoLoad);
1755
- this.searchText$
1756
- .pipe(debounceTime(300), distinctUntilChanged(), switchMap((search) => {
1757
- this.service.resetPaging();
1758
- return this.service.searchData(search);
1759
- }))
1760
- .subscribe();
1761
- this.mediaObserver.asObservable().subscribe(() => {
1762
- if (!this.autoChangeLayout) {
1763
- return;
1764
- }
1765
- if (this.mediaObserver.isActive("lt-md") && this.layoutContent === LayoutContent.Table) {
1766
- this.layoutContent = LayoutContent.Cards;
1767
- }
1768
- else {
1769
- this.layoutContent = LayoutContent.Table;
1770
- }
1771
- });
1772
- });
1773
- }
1774
- ngOnDestroy() {
1775
- this.service.closeSubscriptions();
1776
- }
1777
- ngOnChanges(changes) {
1778
- if ("mode" in changes) {
1779
- this.service.setMode(changes.mode.currentValue);
1780
- }
1781
- }
1782
- clickToggleShowQueryBuilder() {
1783
- this.service.toggleQueryBuilder();
1784
- }
1785
- onUpdateRules(rules) {
1786
- this.service.updateGlobalRules(rules);
1787
- }
1788
- onQueryBuilderFilterSelected(filterConfigurationModel) {
1789
- this.service.addRuleFromConfig(filterConfigurationModel);
1790
- }
1791
- onUpdatePage(pageEvent) {
1792
- this.service.loadNewPage(pageEvent.pageIndex * pageEvent.pageSize, pageEvent.pageSize);
1793
- this.newPage.emit(pageEvent);
1794
- }
1795
- onUpdateSearch(search) {
1796
- this.searchText$.next(search);
1797
- }
1798
- getFilterRule$(id) {
1799
- return this.filterParameters$.pipe(map(f => {
1800
- return (f.rules &&
1801
- f.rules[0] &&
1802
- f.rules[0].rules &&
1803
- f.rules[0].rules.find((r) => r.id === id));
1804
- }));
1805
- }
1806
- onUpdateSort(sort) {
1807
- if (!sort.active || !sort.direction) {
1808
- sort = {
1809
- active: "id",
1810
- direction: "asc"
1811
- };
1812
- }
1813
- this.service.loadData({
1814
- order: sort.active && sort.direction ? { column: sort.active, direction: sort.direction } : null
1815
- });
1816
- }
1817
- updateRule(id, newRule) {
1818
- this.service.updateRule(id, newRule);
1819
- }
1820
- updateRules(rules) {
1821
- this.service.updateRules(rules);
1822
- }
1823
- clickExport() {
1824
- const exports = [];
1825
- if (this.exportsSettings.xlsx) {
1826
- exports.push({
1827
- type: "xlsx",
1828
- onClickExport: () => this.clickXlsx()
1829
- });
1830
- }
1831
- else if (this.exportsSettings.csv) {
1832
- exports.push({
1833
- type: "csv",
1834
- onClickExport: () => this.clickCsv()
1835
- });
1836
- }
1837
- else if (this.exportsSettings.pdf) {
1838
- exports.push({
1839
- type: "pdf",
1840
- onClickExport: () => this.clickPdf()
1841
- });
1842
- }
1843
- this.bottomSheet.open(ExportBottomSheetComponent, {
1844
- data: {
1845
- exportStrategies: [
1846
- ...exports,
1847
- ...this.customExport
1848
- ]
1849
- }
1850
- });
1851
- }
1852
- navigate(item) {
1853
- if (this.navigateFn) {
1854
- this.navigateFn(this.baseRoute, item);
1855
- }
1856
- else {
1857
- const route = this.routeFn ? this.routeFn(item) : [(this.baseRoute || "") + (item === null || item === void 0 ? void 0 : item.id)];
1858
- this.router.navigate(typeof route === "string" ? [route] : route, { relativeTo: this.activatedRoute });
1859
- }
1860
- }
1861
- clickXlsx() {
1862
- this.service.downloadData("xlsx");
1863
- }
1864
- clickCsv() {
1865
- this.service.downloadData("csv");
1866
- }
1867
- clickPrint() {
1868
- this.service.printData();
1869
- }
1870
- clickPdf() {
1871
- this.service.downloadData("pdf");
1872
- }
1873
- setColumn(columns) {
1874
- this.columns = columns;
1875
- this.columnNames = columns.map(x => x.id);
1876
- }
1877
- }
1878
- 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 });
1879
- 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: [
1880
- NiceBaseListQuery,
1881
- NiceBaseListService,
1882
- NiceBaseListStore
1883
- ], 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 } });
1884
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListComponent, decorators: [{
1885
- type: Component,
1886
- args: [{
1887
- selector: "nice-base-list",
1888
- templateUrl: "./base-list.template.html",
1889
- providers: [
1890
- NiceBaseListQuery,
1891
- NiceBaseListService,
1892
- NiceBaseListStore
1893
- ]
1894
- }]
1895
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1896
- type: Optional
1897
- }, {
1898
- type: Inject,
1899
- args: [ENABLE_QUERY_BUILDER]
1900
- }] }, { type: undefined, decorators: [{
1901
- type: Inject,
1902
- args: [BASE_LIST_LAYOUT]
1903
- }] }, { type: undefined, decorators: [{
1904
- type: Inject,
1905
- args: [TABLE_COLUMNS]
1906
- }] }, { type: undefined, decorators: [{
1907
- type: Inject,
1908
- args: [EXPORTS_SETTINGS]
1909
- }] }, { type: NiceBaseListQuery }, { type: NiceBaseListService }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }]; }, propDecorators: { title: [{
1910
- type: ContentChild,
1911
- args: [NiceBaseListTitleDirective, { read: TemplateRef }]
1912
- }], buttons: [{
1913
- type: ContentChildren,
1914
- args: [NiceBaseListButtonsDirective]
1915
- }], table: [{
1916
- type: ContentChild,
1917
- args: [NiceBaseListTableDirective, { read: TemplateRef }]
1918
- }], cards: [{
1919
- type: ContentChild,
1920
- args: [NiceBaseListCardsDirective, { read: TemplateRef }]
1921
- }], customContent: [{
1922
- type: ContentChild,
1923
- args: [NiceBaseListCustomContentDirective, { read: TemplateRef }]
1924
- }], mode: [{
1925
- type: Input
1926
- }], layout: [{
1927
- type: Input
1928
- }], layoutContent: [{
1929
- type: Input
1930
- }], autoChangeLayout: [{
1931
- type: Input
1932
- }], baseRoute: [{
1933
- type: Input
1934
- }], routeFn: [{
1935
- type: Input
1936
- }], navigateFn: [{
1937
- type: Input
1938
- }], autoLoad: [{
1939
- type: Input
1940
- }], pageTitle: [{
1941
- type: Input
1942
- }], canExport: [{
1943
- type: Input
1944
- }], disableRouting: [{
1945
- type: Input
1946
- }], customExport: [{
1947
- type: Input
1948
- }], newPage: [{
1949
- type: Output
1950
- }] } });
1951
-
1952
- class NiceCustomDateAdapter extends NativeDateAdapter {
1953
- constructor(translateService, locale, platform) {
1954
- super(locale, platform);
1955
- this.translateService = translateService;
1956
- this.setLocale(this.translateService.getDefaultLang());
1957
- // @ts-ignore
1958
- this._format = (dtf, date) => {
1959
- return dtf.format(date);
1960
- };
1961
- }
1962
- format(date, displayFormat) {
1963
- return super.format(date, displayFormat);
1964
- }
1965
- getDate(date) {
1966
- return date.getUTCDate();
1967
- }
1968
- getMonth(date) {
1969
- return date.getUTCMonth();
1970
- }
1971
- getYear(date) {
1972
- return date.getUTCFullYear();
1973
- }
1974
- }
1975
- 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 });
1976
- NiceCustomDateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter });
1977
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceCustomDateAdapter, decorators: [{
1978
- type: Injectable
1979
- }], ctorParameters: function () { return [{ type: i1$4.TranslateService }, { type: undefined, decorators: [{
1980
- type: Inject,
1981
- args: [MAT_DATE_LOCALE]
1982
- }] }, { type: i2$2.Platform }]; } });
1983
-
1984
- class QueryBuilderModule {
1985
- }
1986
- QueryBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1987
- QueryBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, declarations: [QueryBuilderComponent,
1988
- QueryBuilderTriggerDirective,
1989
- FilterSelectionComponent,
1990
- RuleComponent,
1991
- SelectFilterComponent,
1992
- TextFilterComponent,
1993
- NumberFilterComponent,
1994
- RadioFilterComponent,
1995
- DateFilterComponent,
1996
- FilterGroupIconPipe], imports: [CommonModule,
1997
- FormsModule,
1998
- TranslateModule,
1999
- OverlayModule,
2000
- MatCardModule,
2001
- MatListModule,
2002
- FlexLayoutModule,
2003
- MatButtonModule,
2004
- MatRippleModule,
2005
- MatIconModule,
2006
- MatSelectModule,
2007
- MatInputModule,
2008
- MatDatepickerModule,
2009
- MatRadioModule,
2010
- NiceLoadingSpinnerModule,
2011
- NiceTypeaheadModule,
2012
- ReactiveFormsModule,
2013
- NgxMaskModule], exports: [QueryBuilderComponent, QueryBuilderTriggerDirective] });
2014
- QueryBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }], imports: [[
2015
- CommonModule,
2016
- FormsModule,
2017
- TranslateModule,
2018
- OverlayModule,
2019
- MatCardModule,
2020
- MatListModule,
2021
- FlexLayoutModule,
2022
- MatButtonModule,
2023
- MatRippleModule,
2024
- MatIconModule,
2025
- MatSelectModule,
2026
- MatInputModule,
2027
- MatDatepickerModule,
2028
- MatRadioModule,
2029
- NiceLoadingSpinnerModule,
2030
- NiceTypeaheadModule,
2031
- ReactiveFormsModule,
2032
- NgxMaskModule
2033
- ]] });
2034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QueryBuilderModule, decorators: [{
2035
- type: NgModule,
2036
- args: [{
2037
- imports: [
2038
- CommonModule,
2039
- FormsModule,
2040
- TranslateModule,
2041
- OverlayModule,
2042
- MatCardModule,
2043
- MatListModule,
2044
- FlexLayoutModule,
2045
- MatButtonModule,
2046
- MatRippleModule,
2047
- MatIconModule,
2048
- MatSelectModule,
2049
- MatInputModule,
2050
- MatDatepickerModule,
2051
- MatRadioModule,
2052
- NiceLoadingSpinnerModule,
2053
- NiceTypeaheadModule,
2054
- ReactiveFormsModule,
2055
- NgxMaskModule
2056
- ],
2057
- declarations: [
2058
- QueryBuilderComponent,
2059
- QueryBuilderTriggerDirective,
2060
- FilterSelectionComponent,
2061
- RuleComponent,
2062
- SelectFilterComponent,
2063
- TextFilterComponent,
2064
- NumberFilterComponent,
2065
- RadioFilterComponent,
2066
- DateFilterComponent,
2067
- FilterGroupIconPipe
2068
- ],
2069
- providers: [{ provide: DateAdapter, useClass: NiceCustomDateAdapter }],
2070
- exports: [QueryBuilderComponent, QueryBuilderTriggerDirective]
2071
- }]
2072
- }] });
2073
-
2074
- class NiceBaseListModule {
2075
- static forRoot(options) {
2076
- var _a;
2077
- return {
2078
- ngModule: NiceBaseListModule,
2079
- providers: [
2080
- {
2081
- provide: BASE_LIST_LAYOUT,
2082
- useValue: (_a = options === null || options === void 0 ? void 0 : options.layout) !== null && _a !== void 0 ? _a : defaultLayout
2083
- },
2084
- ...((options === null || options === void 0 ? void 0 : options.queryBuilder) ? [
2085
- {
2086
- provide: ENABLE_QUERY_BUILDER,
2087
- useValue: true
2088
- },
2089
- {
2090
- provide: NiceFilterGroupService,
2091
- useClass: options.queryBuilder.filterGroupService
2092
- },
2093
- options.queryBuilder.savedReportService ? {
2094
- provide: NiceSavedReportService,
2095
- useClass: options.queryBuilder.savedReportService
2096
- } : undefined
2097
- ] : [])
2098
- ].filter(x => !!x)
2099
- };
2100
- }
2101
- static providerFactory(options) {
2102
- var _a;
2103
- return [
2104
- {
2105
- provide: NiceFilterService,
2106
- useClass: options.filterService
2107
- },
2108
- {
2109
- provide: LIST_TABLE,
2110
- useValue: options.table
2111
- },
2112
- {
2113
- provide: TABLE_COLUMNS,
2114
- useValue: options.columns,
2115
- },
2116
- {
2117
- provide: DEFAULT_PARAMETERS,
2118
- useValue: options.defaultParameters
2119
- },
2120
- options.layout ? {
2121
- provide: BASE_LIST_LAYOUT,
2122
- useValue: options.layout
2123
- } : undefined,
2124
- {
2125
- provide: EXPORTS_SETTINGS,
2126
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2127
- pdf: true,
2128
- xlsx: true,
2129
- csv: true
2130
- }
2131
- },
2132
- options.disableQueryBuilder !== undefined ? {
2133
- provide: ENABLE_QUERY_BUILDER,
2134
- useValue: !options.disableQueryBuilder
2135
- } : null,
2136
- ...(options.queryBuilder ? [
2137
- {
2138
- provide: NiceFilterGroupService,
2139
- useClass: options.queryBuilder.filterGroupService
2140
- },
2141
- options.queryBuilder.savedReportService ? {
2142
- provide: NiceSavedReportService,
2143
- useClass: options.queryBuilder.savedReportService
2144
- } : undefined
2145
- ] : [])
2146
- ].filter(x => !!x);
2147
- }
2148
- }
2149
- NiceBaseListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2150
- NiceBaseListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, declarations: [NiceBaseListComponent], imports: [NiceExportBottomSheetModule,
2151
- NiceBaseListDirectiveModule,
2152
- CommonModule,
2153
- FlexModule,
2154
- ExtendedModule,
2155
- FormsModule,
2156
- RouterModule,
2157
- MatButtonModule,
2158
- MatIconModule,
2159
- MatTooltipModule,
2160
- MatCardModule,
2161
- MatPaginatorModule,
2162
- TranslateModule,
2163
- NiceLoadingSpinnerModule,
2164
- MatTableModule,
2165
- MatSortModule,
2166
- MatRippleModule,
2167
- MatBottomSheetModule,
2168
- QueryBuilderModule,
2169
- MatBadgeModule], exports: [NiceBaseListComponent,
2170
- NiceBaseListDirectiveModule] });
2171
- NiceBaseListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, imports: [[
2172
- NiceExportBottomSheetModule,
2173
- NiceBaseListDirectiveModule,
2174
- CommonModule,
2175
- FlexModule,
2176
- ExtendedModule,
2177
- FormsModule,
2178
- RouterModule,
2179
- MatButtonModule,
2180
- MatIconModule,
2181
- MatTooltipModule,
2182
- MatCardModule,
2183
- MatPaginatorModule,
2184
- TranslateModule,
2185
- NiceLoadingSpinnerModule,
2186
- MatTableModule,
2187
- MatSortModule,
2188
- MatRippleModule,
2189
- MatBottomSheetModule,
2190
- QueryBuilderModule,
2191
- MatBadgeModule
2192
- ], NiceBaseListDirectiveModule] });
2193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceBaseListModule, decorators: [{
2194
- type: NgModule,
2195
- args: [{
2196
- imports: [
2197
- NiceExportBottomSheetModule,
2198
- NiceBaseListDirectiveModule,
2199
- CommonModule,
2200
- FlexModule,
2201
- ExtendedModule,
2202
- FormsModule,
2203
- RouterModule,
2204
- MatButtonModule,
2205
- MatIconModule,
2206
- MatTooltipModule,
2207
- MatCardModule,
2208
- MatPaginatorModule,
2209
- TranslateModule,
2210
- NiceLoadingSpinnerModule,
2211
- MatTableModule,
2212
- MatSortModule,
2213
- MatRippleModule,
2214
- MatBottomSheetModule,
2215
- QueryBuilderModule,
2216
- MatBadgeModule
2217
- ],
2218
- declarations: [
2219
- NiceBaseListComponent
2220
- ],
2221
- exports: [
2222
- NiceBaseListComponent,
2223
- NiceBaseListDirectiveModule
2224
- ]
2225
- }]
2226
- }] });
2227
-
2228
- class NiceListState {
2229
- }
2230
-
2231
- class NiceMultiStateFilterService extends NiceFilterService {
2232
- constructor(filters) {
2233
- super();
2234
- this.filters = filters;
2235
- }
2236
- switchState(state) {
2237
- this.api = this.filters[state];
2238
- }
2239
- }
2240
-
2241
- const initialValue = Object.assign({}, initialBaseListState);
2242
- let NiceMultiStateListStore = class NiceMultiStateListStore extends NiceBaseListStore {
2243
- constructor() {
2244
- super(null);
2245
- }
2246
- };
2247
- NiceMultiStateListStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2248
- NiceMultiStateListStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore });
2249
- NiceMultiStateListStore = __decorate([
2250
- StoreConfig({ name: "multi-state-list", resettable: true }),
2251
- __metadata("design:paramtypes", [])
2252
- ], NiceMultiStateListStore);
2253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListStore, decorators: [{
2254
- type: Injectable
2255
- }], ctorParameters: function () { return []; } });
2256
-
2257
- class NiceMultiStateListQuery extends NiceBaseListQuery {
2258
- constructor(store) {
2259
- super(store);
2260
- this.store = store;
2261
- }
2262
- }
2263
- NiceMultiStateListQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, deps: [{ token: NiceMultiStateListStore }], target: i0.ɵɵFactoryTarget.Injectable });
2264
- NiceMultiStateListQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery });
2265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListQuery, decorators: [{
2266
- type: Injectable
2267
- }], ctorParameters: function () { return [{ type: NiceMultiStateListStore }]; } });
2268
-
2269
- const LIST_STATES = new InjectionToken("list_states");
2270
-
2271
- class NiceMultiStateListService extends NiceBaseListService {
2272
- constructor(states, store, activatedRoute, router, appRef, multiFilterService) {
2273
- super(store, multiFilterService, activatedRoute, router, appRef);
2274
- this.states = states;
2275
- this.multiFilterService = multiFilterService;
2276
- }
2277
- reset() {
2278
- this.store.reset();
2279
- }
2280
- setStateDefaultFilter(state, parameters) {
2281
- this.states[state].defaultParameters = parameters;
2282
- }
2283
- switchState(state) {
2284
- var _a;
2285
- const newState = this.states[state];
2286
- if (!state) {
2287
- return [];
2288
- }
2289
- this.multiFilterService.switchState(state);
2290
- this.reset();
2291
- this.init();
2292
- this.loadData((_a = newState.defaultParameters) !== null && _a !== void 0 ? _a : initialBaseListState.filterParameters);
2293
- return newState.columns;
2294
- }
2295
- }
2296
- 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 });
2297
- NiceMultiStateListService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService });
2298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListService, decorators: [{
2299
- type: Injectable
2300
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2301
- type: Inject,
2302
- args: [LIST_STATES]
2303
- }] }, { type: NiceMultiStateListStore }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i0.ApplicationRef }, { type: NiceMultiStateFilterService }]; } });
2304
-
2305
- class NiceMultiStateListComponent extends NiceBaseListComponent {
2306
- constructor(enableQueryBuilder, listLayout, exportsSetting, query, activatedRoute, bottomSheet, router, mediaObserver, multiStateListService) {
2307
- super(enableQueryBuilder, listLayout, [], exportsSetting, query, multiStateListService, activatedRoute, bottomSheet, router, mediaObserver);
2308
- this.multiStateListService = multiStateListService;
2309
- }
2310
- set state(state) {
2311
- this.switchState(state);
2312
- }
2313
- switchState(state) {
2314
- const columns = this.multiStateListService.switchState(state);
2315
- this.setColumn(columns);
2316
- }
2317
- }
2318
- 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 });
2319
- NiceMultiStateListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.0", type: NiceMultiStateListComponent, selector: "nice-multi-state-list", inputs: { state: "state" }, providers: [
2320
- NiceMultiStateListQuery,
2321
- NiceMultiStateListService,
2322
- NiceMultiStateListStore
2323
- ], 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 } });
2324
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListComponent, decorators: [{
2325
- type: Component,
2326
- args: [{
2327
- selector: "nice-multi-state-list",
2328
- templateUrl: "../base-list/base-list.template.html",
2329
- providers: [
2330
- NiceMultiStateListQuery,
2331
- NiceMultiStateListService,
2332
- NiceMultiStateListStore
2333
- ]
2334
- }]
2335
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2336
- type: Optional
2337
- }, {
2338
- type: Inject,
2339
- args: [ENABLE_QUERY_BUILDER]
2340
- }] }, { type: undefined, decorators: [{
2341
- type: Inject,
2342
- args: [BASE_LIST_LAYOUT]
2343
- }] }, { type: undefined, decorators: [{
2344
- type: Inject,
2345
- args: [EXPORTS_SETTINGS]
2346
- }] }, { type: NiceMultiStateListQuery }, { type: i3.ActivatedRoute }, { type: i4$1.MatBottomSheet }, { type: i3.Router }, { type: i4.MediaObserver }, { type: NiceMultiStateListService }]; }, propDecorators: { state: [{
2347
- type: Input
2348
- }] } });
2349
-
2350
- class NiceMultiStateListModule {
2351
- static providerFactory(options) {
2352
- var _a;
2353
- return [
2354
- {
2355
- provide: NiceMultiStateFilterService,
2356
- useExisting: options.filterService
2357
- },
2358
- {
2359
- provide: LIST_STATES,
2360
- useValue: options.states
2361
- },
2362
- options.layout ? {
2363
- provide: BASE_LIST_LAYOUT,
2364
- useValue: options.layout
2365
- } : undefined,
2366
- {
2367
- provide: EXPORTS_SETTINGS,
2368
- useValue: (_a = options.exports) !== null && _a !== void 0 ? _a : {
2369
- pdf: true,
2370
- xlsx: true,
2371
- csv: true
2372
- }
2373
- },
2374
- ...(options.queryBuilder ? [
2375
- {
2376
- provide: ENABLE_QUERY_BUILDER,
2377
- useValue: true
2378
- },
2379
- {
2380
- provide: NiceFilterGroupService,
2381
- useClass: options.queryBuilder.filterGroupService
2382
- },
2383
- options.queryBuilder.savedReportService ? {
2384
- provide: NiceSavedReportService,
2385
- useClass: options.queryBuilder.savedReportService
2386
- } : undefined
2387
- ] : [])
2388
- ].filter(x => !!x);
2389
- }
2390
- }
2391
- NiceMultiStateListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2392
- NiceMultiStateListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, declarations: [NiceMultiStateListComponent], imports: [NiceExportBottomSheetModule,
2393
- NiceBaseListDirectiveModule,
2394
- CommonModule,
2395
- FlexModule,
2396
- ExtendedModule,
2397
- FormsModule,
2398
- RouterModule,
2399
- MatButtonModule,
2400
- MatIconModule,
2401
- MatTooltipModule,
2402
- MatCardModule,
2403
- MatPaginatorModule,
2404
- TranslateModule,
2405
- NiceLoadingSpinnerModule,
2406
- MatTableModule,
2407
- MatSortModule,
2408
- MatRippleModule,
2409
- MatBottomSheetModule,
2410
- QueryBuilderModule,
2411
- MatBadgeModule], exports: [NiceMultiStateListComponent,
2412
- NiceBaseListDirectiveModule] });
2413
- NiceMultiStateListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, imports: [[
2414
- NiceExportBottomSheetModule,
2415
- NiceBaseListDirectiveModule,
2416
- CommonModule,
2417
- FlexModule,
2418
- ExtendedModule,
2419
- FormsModule,
2420
- RouterModule,
2421
- MatButtonModule,
2422
- MatIconModule,
2423
- MatTooltipModule,
2424
- MatCardModule,
2425
- MatPaginatorModule,
2426
- TranslateModule,
2427
- NiceLoadingSpinnerModule,
2428
- MatTableModule,
2429
- MatSortModule,
2430
- MatRippleModule,
2431
- MatBottomSheetModule,
2432
- QueryBuilderModule,
2433
- MatBadgeModule
2434
- ], NiceBaseListDirectiveModule] });
2435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NiceMultiStateListModule, decorators: [{
2436
- type: NgModule,
2437
- args: [{
2438
- imports: [
2439
- NiceExportBottomSheetModule,
2440
- NiceBaseListDirectiveModule,
2441
- CommonModule,
2442
- FlexModule,
2443
- ExtendedModule,
2444
- FormsModule,
2445
- RouterModule,
2446
- MatButtonModule,
2447
- MatIconModule,
2448
- MatTooltipModule,
2449
- MatCardModule,
2450
- MatPaginatorModule,
2451
- TranslateModule,
2452
- NiceLoadingSpinnerModule,
2453
- MatTableModule,
2454
- MatSortModule,
2455
- MatRippleModule,
2456
- MatBottomSheetModule,
2457
- QueryBuilderModule,
2458
- MatBadgeModule
2459
- ],
2460
- declarations: [
2461
- NiceMultiStateListComponent
2462
- ],
2463
- exports: [
2464
- NiceMultiStateListComponent,
2465
- NiceBaseListDirectiveModule
2466
- ]
2467
- }]
2468
- }] });
2469
-
2470
- class StringUtils {
2471
- }
2472
- String.prototype.toTableColumn = function (sortable) {
2473
- return new TableColumns(this.toString(), sortable);
2474
- };
2475
-
2476
- /*
2477
- * Public API Surface of nice-data-filter-kit
2478
- */
2479
-
2480
- /**
2481
- * Generated bundle index. Do not edit.
2482
- */
2483
-
2484
- 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 };
2485
- //# sourceMappingURL=recursyve-nice-data-filter-kit.js.map