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