@rosoftlab/core 0.0.100 → 0.0.101
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/esm2020/lib/base-components/base-form-edit.component.mjs +15 -41
- package/esm2020/lib/base-components/field-error-display/field-error-display.component.mjs +3 -3
- package/esm2020/lib/base-components/generic-table/generic-table.component.mjs +17 -80
- package/esm2020/lib/base-components/index.mjs +1 -2
- package/esm2020/lib/base-components/page-not-found/page-not-found.component.mjs +3 -3
- package/esm2020/lib/base-components/under-construction/under-construction.component.mjs +3 -3
- package/esm2020/lib/decorators/attribute.decorator.mjs +1 -4
- package/esm2020/lib/interfaces/attribute-decorator-options.interface.mjs +1 -1
- package/esm2020/lib/models/base.model.mjs +3 -46
- package/esm2020/lib/models/grid-layout-format.enum.mjs +1 -2
- package/esm2020/lib/module.mjs +5 -14
- package/esm2020/lib/services/base.service.mjs +2 -6
- package/fesm2015/rosoftlab-core.mjs +72 -443
- package/fesm2015/rosoftlab-core.mjs.map +1 -1
- package/fesm2020/rosoftlab-core.mjs +72 -438
- package/fesm2020/rosoftlab-core.mjs.map +1 -1
- package/lib/base-components/base-form-edit.component.d.ts +4 -9
- package/lib/base-components/field-error-display/field-error-display.component.d.ts +1 -1
- package/lib/base-components/generic-table/generic-table.component.d.ts +4 -17
- package/lib/base-components/index.d.ts +0 -1
- package/lib/base-components/page-not-found/page-not-found.component.d.ts +1 -1
- package/lib/base-components/under-construction/under-construction.component.d.ts +1 -1
- package/lib/interfaces/attribute-decorator-options.interface.d.ts +0 -1
- package/lib/models/base.model.d.ts +3 -7
- package/lib/models/grid-layout-format.enum.d.ts +1 -2
- package/lib/module.d.ts +6 -8
- package/package.json +3 -3
- package/esm2020/lib/base-components/searchable-dropdown/searchable-dropdown.component.mjs +0 -231
- package/lib/base-components/searchable-dropdown/searchable-dropdown.component.d.ts +0 -62
@@ -1,52 +1,47 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Component, Input,
|
3
|
-
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
4
|
-
import * as i2 from '@angular/forms';
|
5
|
-
import { FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
6
|
-
import { Subject, Observable, throwError, from, merge, of, fromEvent, BehaviorSubject, combineLatest } from 'rxjs';
|
7
|
-
import { filter, debounceTime, tap, switchMap, finalize, takeUntil, map, catchError, distinctUntilChanged, startWith } from 'rxjs/operators';
|
8
|
-
import * as i1 from '@angular/cdk/a11y';
|
9
|
-
import * as i3 from '@angular/material/form-field';
|
10
|
-
import * as i4 from '@angular/material/button';
|
11
|
-
import { MatButtonModule } from '@angular/material/button';
|
12
|
-
import * as i5 from '@angular/material/icon';
|
13
|
-
import { MatIconModule } from '@angular/material/icon';
|
14
|
-
import * as i6 from '@angular/material/autocomplete';
|
15
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
16
|
-
import * as i7 from '@angular/material/core';
|
17
|
-
import { MatNativeDateModule, MatRippleModule, MatOptionModule } from '@angular/material/core';
|
18
|
-
import * as i8 from '@angular/material/input';
|
19
|
-
import { MatInputModule } from '@angular/material/input';
|
20
|
-
import * as i3$1 from '@angular/common';
|
21
|
-
import { DatePipe, DecimalPipe, PercentPipe, CommonModule } from '@angular/common';
|
22
|
-
import * as i1$1 from '@ngx-translate/core';
|
23
|
-
import { TranslateModule } from '@ngx-translate/core';
|
2
|
+
import { Component, Input, Injectable, EventEmitter, ElementRef, ViewChild, Output, Directive, ContentChildren, NgModule, Pipe } from '@angular/core';
|
24
3
|
import { __decorate } from 'tslib';
|
25
|
-
import * as
|
4
|
+
import * as i1$1 from '@angular/forms';
|
5
|
+
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
6
|
+
import * as i2$1 from 'ng-block-ui';
|
26
7
|
import { BlockUI, BlockUIModule } from 'ng-block-ui';
|
27
|
-
import
|
28
|
-
import * as
|
8
|
+
import { Observable, throwError, from, Subject, merge, of, BehaviorSubject, combineLatest } from 'rxjs';
|
9
|
+
import * as i2 from '@angular/router';
|
10
|
+
import * as i1 from '@angular/common/http';
|
29
11
|
import { HttpHeaders, HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
|
30
12
|
import { compare } from 'fast-json-patch';
|
31
13
|
import * as qs from 'qs';
|
14
|
+
import { map, catchError, debounceTime, distinctUntilChanged, startWith, switchMap } from 'rxjs/operators';
|
32
15
|
import Swal from 'sweetalert2';
|
33
|
-
import * as
|
16
|
+
import * as i1$2 from '@ngx-translate/core';
|
17
|
+
import { TranslateModule } from '@ngx-translate/core';
|
18
|
+
import * as i3 from '@angular/common';
|
19
|
+
import { DatePipe, DecimalPipe, PercentPipe, CommonModule } from '@angular/common';
|
20
|
+
import * as i11 from '@angular/cdk/drag-drop';
|
34
21
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
35
22
|
import * as i9 from '@angular/material/paginator';
|
36
23
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
37
|
-
import * as i8
|
24
|
+
import * as i8 from '@angular/material/sort';
|
38
25
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
39
|
-
import * as i6
|
26
|
+
import * as i6 from '@angular/material/table';
|
40
27
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
41
28
|
import * as jsonLogic from 'json-logic-js/logic.js';
|
42
|
-
import * as
|
29
|
+
import * as i4 from '@angular/material/form-field';
|
30
|
+
import * as i5 from '@angular/material/progress-spinner';
|
43
31
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
44
|
-
import * as
|
32
|
+
import * as i7 from '@angular/material/icon';
|
33
|
+
import { MatIconModule } from '@angular/material/icon';
|
34
|
+
import * as i10 from '@angular/material/input';
|
35
|
+
import { MatInputModule } from '@angular/material/input';
|
36
|
+
import * as i12 from '@angular/material/tooltip';
|
45
37
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
46
38
|
import { parseISO } from 'date-fns';
|
39
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
40
|
+
import { MatButtonModule } from '@angular/material/button';
|
47
41
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
48
42
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
49
43
|
import { MatChipsModule } from '@angular/material/chips';
|
44
|
+
import { MatNativeDateModule, MatRippleModule, MatOptionModule } from '@angular/material/core';
|
50
45
|
import { MatGridListModule } from '@angular/material/grid-list';
|
51
46
|
import { MatMenuModule } from '@angular/material/menu';
|
52
47
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
@@ -73,10 +68,10 @@ import { CdkStepperModule } from '@angular/cdk/stepper';
|
|
73
68
|
class FieldErrorDisplayComponent {
|
74
69
|
}
|
75
70
|
FieldErrorDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FieldErrorDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
76
|
-
FieldErrorDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: FieldErrorDisplayComponent, selector: "
|
71
|
+
FieldErrorDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: FieldErrorDisplayComponent, selector: "app-field-error-display", inputs: { errorMsg: "errorMsg", displayError: "displayError" }, ngImport: i0, template: "<div *ngIf=\"displayError\" >\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\n <span class=\"sr-only\">(error)</span>\n <div class=\"error-msg\">\n {{ errorMsg }}\n </div>\n</div>\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] });
|
77
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FieldErrorDisplayComponent, decorators: [{
|
78
73
|
type: Component,
|
79
|
-
args: [{ selector: '
|
74
|
+
args: [{ selector: 'app-field-error-display', template: "<div *ngIf=\"displayError\" >\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\n <span class=\"sr-only\">(error)</span>\n <div class=\"error-msg\">\n {{ errorMsg }}\n </div>\n</div>\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }]
|
80
75
|
}], propDecorators: { errorMsg: [{
|
81
76
|
type: Input
|
82
77
|
}], displayError: [{
|
@@ -90,235 +85,20 @@ class PageNotFoundComponent {
|
|
90
85
|
}
|
91
86
|
}
|
92
87
|
PageNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
93
|
-
PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: PageNotFoundComponent, selector: "
|
88
|
+
PageNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: PageNotFoundComponent, selector: "app-page-not-found", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page not found\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] });
|
94
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
95
90
|
type: Component,
|
96
|
-
args: [{ selector: '
|
91
|
+
args: [{ selector: 'app-page-not-found', template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page not found\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }]
|
97
92
|
}], ctorParameters: function () { return []; } });
|
98
93
|
|
99
|
-
class SearchableDropdownComponent {
|
100
|
-
constructor(_focusMonitor, _elementRef, ngControl) {
|
101
|
-
this._focusMonitor = _focusMonitor;
|
102
|
-
this._elementRef = _elementRef;
|
103
|
-
this.ngControl = ngControl;
|
104
|
-
this.onChange = (_) => { };
|
105
|
-
this.onTouched = () => { };
|
106
|
-
this.stateChanges = new Subject();
|
107
|
-
this.focused = false;
|
108
|
-
this.errorState = false;
|
109
|
-
this.id = `rsl-searchable-dropdown-${SearchableDropdownComponent.nextId++}`;
|
110
|
-
// label for the search dropdown
|
111
|
-
this.label = '';
|
112
|
-
//Fields for sorting the API data
|
113
|
-
this.sortFields = '';
|
114
|
-
// The value used to populate the control value
|
115
|
-
this.valueField = 'id';
|
116
|
-
// The minumum char for search
|
117
|
-
this.minLengthTerm = 3;
|
118
|
-
this.modelSelected = new EventEmitter();
|
119
|
-
this._required = false;
|
120
|
-
this._disabled = false;
|
121
|
-
this.showSerach = true;
|
122
|
-
this.isLoading = false;
|
123
|
-
this.options = [];
|
124
|
-
this.filteredOptions = [];
|
125
|
-
/** Subject that emits when the component has been destroyed. */
|
126
|
-
this._onDestroy = new Subject();
|
127
|
-
this.searchControl = new FormControl('');
|
128
|
-
_focusMonitor.monitor(_elementRef, true).subscribe(origin => {
|
129
|
-
if (this.focused && !origin) {
|
130
|
-
this.onTouched();
|
131
|
-
}
|
132
|
-
this.focused = !!origin;
|
133
|
-
this.stateChanges.next();
|
134
|
-
});
|
135
|
-
if (this.ngControl) {
|
136
|
-
this.ngControl.valueAccessor = this;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
get empty() {
|
140
|
-
return !this.value;
|
141
|
-
}
|
142
|
-
get required() { return this._required; }
|
143
|
-
set required(value) {
|
144
|
-
this._required = coerceBooleanProperty(value);
|
145
|
-
this.stateChanges.next();
|
146
|
-
}
|
147
|
-
get disabled() { return this._disabled; }
|
148
|
-
set disabled(value) {
|
149
|
-
this._disabled = coerceBooleanProperty(value);
|
150
|
-
this.stateChanges.next();
|
151
|
-
}
|
152
|
-
get value() {
|
153
|
-
return this._value;
|
154
|
-
}
|
155
|
-
set value(value) {
|
156
|
-
if (value)
|
157
|
-
if (this._value !== value) {
|
158
|
-
this.loadModel(value);
|
159
|
-
}
|
160
|
-
this._value = value;
|
161
|
-
this.stateChanges.next();
|
162
|
-
}
|
163
|
-
ngOnInit() {
|
164
|
-
if (!this.displayFields)
|
165
|
-
this.displayFields = this.searchFields;
|
166
|
-
this.loadModel(this.ngControl.value);
|
167
|
-
if (this.preloadElementsCount) {
|
168
|
-
this.serviceRef.getAll(1, this.preloadElementsCount).subscribe({
|
169
|
-
next: (data) => {
|
170
|
-
this.showSerach = false;
|
171
|
-
this.options = data.getModels();
|
172
|
-
this.filteredOptions = this.options;
|
173
|
-
}
|
174
|
-
});
|
175
|
-
}
|
176
|
-
this.searchControl.valueChanges
|
177
|
-
.pipe(filter((res) => {
|
178
|
-
const result = res !== null && res.length >= this.minLengthTerm;
|
179
|
-
if (!result) {
|
180
|
-
this.options = [];
|
181
|
-
this.filteredOptions = [];
|
182
|
-
}
|
183
|
-
this.showSerach = !result;
|
184
|
-
return result;
|
185
|
-
}), debounceTime(300), tap(() => {
|
186
|
-
this.filteredOptions = [];
|
187
|
-
this.isLoading = true;
|
188
|
-
}), switchMap((value) => this.serviceRef
|
189
|
-
.getAll(1, 10, this.sortFields, `${this.searchFields.replace(',', '|')}@=*${value}`)
|
190
|
-
.pipe(finalize(() => {
|
191
|
-
this.isLoading = false;
|
192
|
-
}))), takeUntil(this._onDestroy))
|
193
|
-
.subscribe((options) => {
|
194
|
-
this.filteredOptions = options.getModels();
|
195
|
-
});
|
196
|
-
}
|
197
|
-
onSelected($event) {
|
198
|
-
const value = $event.option.value;
|
199
|
-
this.searchControl.setValue(value);
|
200
|
-
this.modelSelected.emit(value);
|
201
|
-
if (this.valueField in value) {
|
202
|
-
this.setControlValue(value[this.valueField]);
|
203
|
-
}
|
204
|
-
}
|
205
|
-
setControlValue(value) {
|
206
|
-
this.value = value;
|
207
|
-
this.ngControl.control.setValue(value);
|
208
|
-
}
|
209
|
-
displayWith(value) {
|
210
|
-
return this.getConcatedFields(value);
|
211
|
-
}
|
212
|
-
clearSelection() {
|
213
|
-
this.modelSelected.emit(null);
|
214
|
-
this.setControlValue(null);
|
215
|
-
this.searchControl.setValue(null);
|
216
|
-
this.filteredOptions = this.options;
|
217
|
-
}
|
218
|
-
getConcatedFields(option) {
|
219
|
-
if (!option)
|
220
|
-
return null;
|
221
|
-
const filtersArr = this.displayFields.split(',');
|
222
|
-
return filtersArr.reduce((acc, cv) => {
|
223
|
-
return acc.concat(option[cv] + ' ');
|
224
|
-
}, '');
|
225
|
-
}
|
226
|
-
ngOnDestroy() {
|
227
|
-
this.searchControl = null;
|
228
|
-
this.stateChanges.complete();
|
229
|
-
this._focusMonitor.stopMonitoring(this._elementRef);
|
230
|
-
this._onDestroy.next();
|
231
|
-
this._onDestroy.complete();
|
232
|
-
}
|
233
|
-
getSearchText() {
|
234
|
-
return `Enter ${this.minLengthTerm} characters to start search`;
|
235
|
-
}
|
236
|
-
writeValue(model) {
|
237
|
-
console.log(model);
|
238
|
-
this.value = model;
|
239
|
-
}
|
240
|
-
registerOnChange(fn) {
|
241
|
-
this.onChange = fn;
|
242
|
-
}
|
243
|
-
registerOnTouched(fn) {
|
244
|
-
this.onTouched = fn;
|
245
|
-
}
|
246
|
-
setDisabledState(isDisabled) {
|
247
|
-
this.disabled = isDisabled;
|
248
|
-
}
|
249
|
-
loadModel(id) {
|
250
|
-
//Load the model from API to display the value
|
251
|
-
let needLoad = false;
|
252
|
-
if (id) {
|
253
|
-
if (!this.searchControl.value)
|
254
|
-
needLoad = true;
|
255
|
-
else {
|
256
|
-
if (this.searchControl.value[this.valueField] !== id) {
|
257
|
-
needLoad = true;
|
258
|
-
}
|
259
|
-
}
|
260
|
-
}
|
261
|
-
if (needLoad) {
|
262
|
-
this.serviceRef.get(id).subscribe({
|
263
|
-
next: (model) => {
|
264
|
-
this.options.push(model);
|
265
|
-
this.filteredOptions = this.options;
|
266
|
-
this.searchControl.setValue(model);
|
267
|
-
}
|
268
|
-
});
|
269
|
-
}
|
270
|
-
}
|
271
|
-
}
|
272
|
-
SearchableDropdownComponent.nextId = 0;
|
273
|
-
SearchableDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SearchableDropdownComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ElementRef }, { token: i2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
274
|
-
SearchableDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: SearchableDropdownComponent, selector: "rsl-searchable-dropdown", inputs: { label: "label", fControlName: "fControlName", serviceRef: "serviceRef", searchFields: "searchFields", displayFields: "displayFields", sortFields: "sortFields", valueField: "valueField", minLengthTerm: "minLengthTerm", preloadElementsCount: "preloadElementsCount", required: "required", disabled: "disabled", value: "value" }, outputs: { modelSelected: "modelSelected" }, host: { properties: { "class.example-floating": "shouldLabelFloat", "id": "id", "attr.aria-describedby": "describedBy" } }, ngImport: i0, template: "<div class=\"form-group\">\r\n <label>{{label | translate}}</label>\r\n <mat-form-field appearance=\"outline\" fxFlex>\r\n <input matInput [matAutocomplete]=\"auto\" [formControl]=\"searchControl\">\r\n <button *ngIf=\"searchControl.value\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearSelection()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\"\r\n [displayWith]=\"displayWith.bind(this)\">\r\n <mat-option *ngIf=\"isLoading\">Loading...</mat-option>\r\n <mat-option *ngIf=\"!isLoading && filteredOptions.length == 0 && !showSerach\" disabled>Not found</mat-option>\r\n <mat-option *ngIf=\"showSerach\" disabled>{{getSearchText()}}</mat-option>\r\n <ng-container *ngIf=\"!isLoading && filteredOptions.length > 0\">\r\n <mat-option *ngFor=\"let option of filteredOptions\" [value]=\"option\">\r\n <span><b>{{getConcatedFields(option)}}</b></span>\r\n </mat-option>\r\n </ng-container>\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n</div>", components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4.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: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.MatSuffix, selector: "[matSuffix]" }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
275
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SearchableDropdownComponent, decorators: [{
|
276
|
-
type: Component,
|
277
|
-
args: [{ selector: 'rsl-searchable-dropdown', host: {
|
278
|
-
'[class.example-floating]': 'shouldLabelFloat',
|
279
|
-
'[id]': 'id',
|
280
|
-
'[attr.aria-describedby]': 'describedBy',
|
281
|
-
}, template: "<div class=\"form-group\">\r\n <label>{{label | translate}}</label>\r\n <mat-form-field appearance=\"outline\" fxFlex>\r\n <input matInput [matAutocomplete]=\"auto\" [formControl]=\"searchControl\">\r\n <button *ngIf=\"searchControl.value\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearSelection()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\"\r\n [displayWith]=\"displayWith.bind(this)\">\r\n <mat-option *ngIf=\"isLoading\">Loading...</mat-option>\r\n <mat-option *ngIf=\"!isLoading && filteredOptions.length == 0 && !showSerach\" disabled>Not found</mat-option>\r\n <mat-option *ngIf=\"showSerach\" disabled>{{getSearchText()}}</mat-option>\r\n <ng-container *ngIf=\"!isLoading && filteredOptions.length > 0\">\r\n <mat-option *ngFor=\"let option of filteredOptions\" [value]=\"option\">\r\n <span><b>{{getConcatedFields(option)}}</b></span>\r\n </mat-option>\r\n </ng-container>\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n</div>" }]
|
282
|
-
}], ctorParameters: function () { return [{ type: i1.FocusMonitor }, { type: i0.ElementRef }, { type: i2.NgControl, decorators: [{
|
283
|
-
type: Optional
|
284
|
-
}, {
|
285
|
-
type: Self
|
286
|
-
}] }]; }, propDecorators: { label: [{
|
287
|
-
type: Input
|
288
|
-
}], fControlName: [{
|
289
|
-
type: Input
|
290
|
-
}], serviceRef: [{
|
291
|
-
type: Input
|
292
|
-
}], searchFields: [{
|
293
|
-
type: Input
|
294
|
-
}], displayFields: [{
|
295
|
-
type: Input
|
296
|
-
}], sortFields: [{
|
297
|
-
type: Input
|
298
|
-
}], valueField: [{
|
299
|
-
type: Input
|
300
|
-
}], minLengthTerm: [{
|
301
|
-
type: Input
|
302
|
-
}], preloadElementsCount: [{
|
303
|
-
type: Input
|
304
|
-
}], modelSelected: [{
|
305
|
-
type: Output
|
306
|
-
}], required: [{
|
307
|
-
type: Input
|
308
|
-
}], disabled: [{
|
309
|
-
type: Input
|
310
|
-
}], value: [{
|
311
|
-
type: Input
|
312
|
-
}] } });
|
313
|
-
|
314
94
|
class UnderConstructionComponent {
|
315
95
|
constructor() { }
|
316
96
|
}
|
317
97
|
UnderConstructionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: UnderConstructionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
318
|
-
UnderConstructionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: UnderConstructionComponent, selector: "
|
98
|
+
UnderConstructionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: UnderConstructionComponent, selector: "app-under-construction", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page under construction\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] });
|
319
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: UnderConstructionComponent, decorators: [{
|
320
100
|
type: Component,
|
321
|
-
args: [{ selector: '
|
101
|
+
args: [{ selector: 'app-under-construction', template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page under construction\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }]
|
322
102
|
}], ctorParameters: function () { return []; } });
|
323
103
|
|
324
104
|
class BaseQueryData {
|
@@ -652,11 +432,11 @@ class BaseDatastore {
|
|
652
432
|
return qs.stringify(params, { arrayFormat: 'brackets' });
|
653
433
|
}
|
654
434
|
}
|
655
|
-
BaseDatastore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseDatastore, deps: [{ token: i1
|
435
|
+
BaseDatastore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseDatastore, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
656
436
|
BaseDatastore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseDatastore });
|
657
437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseDatastore, decorators: [{
|
658
438
|
type: Injectable
|
659
|
-
}], ctorParameters: function () { return [{ type: i1
|
439
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
660
440
|
|
661
441
|
class BaseService {
|
662
442
|
constructor(datastore) {
|
@@ -731,11 +511,7 @@ class BaseService {
|
|
731
511
|
return fromModel.getFromGroup(fb);
|
732
512
|
}
|
733
513
|
fromFormGroup(formGroup, id) {
|
734
|
-
|
735
|
-
// saveModel.id = id ? id : null;
|
736
|
-
// return saveModel;
|
737
|
-
const saveModel = this.newModel();
|
738
|
-
saveModel.getModelFromFormGroup(formGroup);
|
514
|
+
const saveModel = this.newModel(formGroup.getRawValue());
|
739
515
|
saveModel.id = id ? id : null;
|
740
516
|
return saveModel;
|
741
517
|
}
|
@@ -956,18 +732,10 @@ class BaseFormEditComponent {
|
|
956
732
|
}
|
957
733
|
afterFormGenerated() {
|
958
734
|
}
|
959
|
-
|
960
|
-
|
961
|
-
return this.baseForm;
|
962
|
-
if (formGroup instanceof FormGroup)
|
963
|
-
return formGroup;
|
964
|
-
return this.baseForm.controls[formGroup];
|
965
|
-
}
|
966
|
-
validateAllFormFields(formGroup = null) {
|
967
|
-
const fg = this.getFromGroup(formGroup);
|
968
|
-
Object.keys(fg.controls).forEach(field => {
|
735
|
+
validateAllFormFields(formGroup) {
|
736
|
+
Object.keys(formGroup.controls).forEach(field => {
|
969
737
|
// console.log(field);
|
970
|
-
const control =
|
738
|
+
const control = formGroup.get(field);
|
971
739
|
if (control instanceof FormControl) {
|
972
740
|
control.markAsTouched({ onlySelf: true });
|
973
741
|
}
|
@@ -976,32 +744,22 @@ class BaseFormEditComponent {
|
|
976
744
|
}
|
977
745
|
});
|
978
746
|
}
|
979
|
-
isFieldValid(
|
980
|
-
|
981
|
-
const filedControl = fg.get(field);
|
982
|
-
return !filedControl.valid && filedControl.touched;
|
983
|
-
}
|
984
|
-
isFieldValidFromArray(arrayIndex, field, arrayName = 'formArray') {
|
985
|
-
const fieldControl = this.baseForm.get(arrayName).get([arrayIndex]).get(field);
|
986
|
-
return !fieldControl.valid && fieldControl.touched;
|
747
|
+
isFieldValid(form, field) {
|
748
|
+
return !form.get(field).valid && form.get(field).touched;
|
987
749
|
}
|
988
|
-
displayFieldCss(field) {
|
750
|
+
displayFieldCss(form, field) {
|
989
751
|
return {
|
990
|
-
'has-error': this.isFieldValid(field),
|
991
|
-
'has-feedback': this.isFieldValid(field)
|
752
|
+
'has-error': this.isFieldValid(form, field),
|
753
|
+
'has-feedback': this.isFieldValid(form, field)
|
992
754
|
};
|
993
755
|
}
|
994
756
|
onCancel() {
|
995
757
|
this.router.navigate([this.cancelRoute]);
|
996
758
|
}
|
997
759
|
onSave() {
|
998
|
-
this.saveModel(this.baseForm);
|
999
|
-
}
|
1000
|
-
saveModel(formGroup = null) {
|
1001
|
-
const fg = this.getFromGroup(formGroup);
|
1002
760
|
const that = this;
|
1003
|
-
if (
|
1004
|
-
if (
|
761
|
+
if (this.baseForm) {
|
762
|
+
if (this.baseForm.valid) {
|
1005
763
|
that.blockUI.start('Saving ...');
|
1006
764
|
this.beforeSave(this.model).subscribe(_ => {
|
1007
765
|
this.modelService.save(this.baseForm, this.modelId, this.model).subscribe((newModel) => {
|
@@ -1017,7 +775,7 @@ class BaseFormEditComponent {
|
|
1017
775
|
this.afterSave(newModel).subscribe((val) => {
|
1018
776
|
this.blockUI.stop();
|
1019
777
|
this.dialogService.showSaveMessage('Your changes were saved successfully.').subscribe(d => {
|
1020
|
-
|
778
|
+
this.baseForm.markAsPristine();
|
1021
779
|
});
|
1022
780
|
});
|
1023
781
|
}, err => {
|
@@ -1027,7 +785,7 @@ class BaseFormEditComponent {
|
|
1027
785
|
});
|
1028
786
|
}
|
1029
787
|
else {
|
1030
|
-
this.validateAllFormFields(
|
788
|
+
this.validateAllFormFields(this.baseForm);
|
1031
789
|
}
|
1032
790
|
}
|
1033
791
|
}
|
@@ -1076,16 +834,8 @@ class BaseFormEditComponent {
|
|
1076
834
|
getCustomErrorMessage(error, fieldLabel) {
|
1077
835
|
return '';
|
1078
836
|
}
|
1079
|
-
|
1080
|
-
const
|
1081
|
-
return this.getErrorMessageForField(fieldControl, filedTranslationKey);
|
1082
|
-
}
|
1083
|
-
getErrorMessage(field, filedTranslationKey, formGroup = null) {
|
1084
|
-
const fg = this.getFromGroup(formGroup);
|
1085
|
-
return this.getErrorMessageForField(fg.get(field), filedTranslationKey);
|
1086
|
-
}
|
1087
|
-
getErrorMessageForField(fieldControl, filedTranslationKey) {
|
1088
|
-
const error = fieldControl.errors;
|
837
|
+
getErrorMessage(field, filedTranslationKey) {
|
838
|
+
const error = this.baseForm.get(field).errors;
|
1089
839
|
const fieldLabel = this.translate.instant(filedTranslationKey);
|
1090
840
|
let rvalue = '';
|
1091
841
|
if (error !== null) {
|
@@ -1111,7 +861,7 @@ class BaseFormEditComponent {
|
|
1111
861
|
return rvalue;
|
1112
862
|
}
|
1113
863
|
}
|
1114
|
-
BaseFormEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseFormEditComponent, deps: [{ token:
|
864
|
+
BaseFormEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: BaseFormEditComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: BaseService }, { token: DialogService }, { token: i1$2.TranslateService }, { token: i3.Location }], target: i0.ɵɵFactoryTarget.Component });
|
1115
865
|
BaseFormEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: BaseFormEditComponent, selector: "app-base.form.edit", ngImport: i0, template: '', isInline: true });
|
1116
866
|
__decorate([
|
1117
867
|
BlockUI()
|
@@ -1122,7 +872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
1122
872
|
selector: 'app-base.form.edit',
|
1123
873
|
template: ''
|
1124
874
|
}]
|
1125
|
-
}], ctorParameters: function () { return [{ type:
|
875
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: BaseService }, { type: DialogService }, { type: i1$2.TranslateService }, { type: i3.Location }]; }, propDecorators: { blockUI: [] } });
|
1126
876
|
|
1127
877
|
var GridLayoutFormat;
|
1128
878
|
(function (GridLayoutFormat) {
|
@@ -1130,7 +880,6 @@ var GridLayoutFormat;
|
|
1130
880
|
GridLayoutFormat[GridLayoutFormat["date"] = 1] = "date";
|
1131
881
|
GridLayoutFormat[GridLayoutFormat["number"] = 2] = "number";
|
1132
882
|
GridLayoutFormat[GridLayoutFormat["percent"] = 3] = "percent";
|
1133
|
-
GridLayoutFormat[GridLayoutFormat["picture"] = 4] = "picture";
|
1134
883
|
})(GridLayoutFormat || (GridLayoutFormat = {}));
|
1135
884
|
var CellTextAlign;
|
1136
885
|
(function (CellTextAlign) {
|
@@ -1141,13 +890,12 @@ var CellTextAlign;
|
|
1141
890
|
|
1142
891
|
class GenericTableComponent {
|
1143
892
|
// ruleEngineService: RuleEngineService<T>;
|
1144
|
-
constructor(dialogService, router, datePipe, numberPipe, percentPipe
|
893
|
+
constructor(dialogService, router, datePipe, numberPipe, percentPipe) {
|
1145
894
|
this.dialogService = dialogService;
|
1146
895
|
this.router = router;
|
1147
896
|
this.datePipe = datePipe;
|
1148
897
|
this.numberPipe = numberPipe;
|
1149
898
|
this.percentPipe = percentPipe;
|
1150
|
-
this.renderer = renderer;
|
1151
899
|
this.defaultSort = null;
|
1152
900
|
this.defaultSortDirection = null;
|
1153
901
|
this.deletePropertyName = 'name';
|
@@ -1157,14 +905,12 @@ class GenericTableComponent {
|
|
1157
905
|
this.allowEdit = true;
|
1158
906
|
this.popupEdit = false;
|
1159
907
|
this.customInclude = null;
|
1160
|
-
this.infiniteScroll = false;
|
1161
908
|
this.dataSource = new MatTableDataSource();
|
1162
909
|
this.resultsLength = 0;
|
1163
910
|
this.isLoadingResults = true;
|
1164
911
|
this.isRateLimitReached = false;
|
1165
912
|
this.filterChanged = new Subject();
|
1166
913
|
this.selectedObject = new EventEmitter();
|
1167
|
-
this.click = new EventEmitter();
|
1168
914
|
this.editModel = new EventEmitter();
|
1169
915
|
}
|
1170
916
|
ngOnChanges() {
|
@@ -1231,20 +977,8 @@ class GenericTableComponent {
|
|
1231
977
|
this.isRateLimitReached = true;
|
1232
978
|
return of([]);
|
1233
979
|
})).subscribe(data => {
|
1234
|
-
// if (this.infiniteScroll) {
|
1235
|
-
// let oldData = this.dataSource.data ?? null;
|
1236
|
-
// // if (oldData.length === 0) {
|
1237
|
-
// // oldData = data;
|
1238
|
-
// // } else {
|
1239
|
-
// oldData=oldData.concat(data);
|
1240
|
-
// // }
|
1241
|
-
// this.dataSource.data = oldData;
|
1242
|
-
// }
|
1243
|
-
// else {
|
1244
980
|
this.dataSource.data = data;
|
1245
|
-
// }
|
1246
981
|
});
|
1247
|
-
// this.paginator.nextPage()
|
1248
982
|
}
|
1249
983
|
getData() {
|
1250
984
|
this.isLoadingResults = true;
|
@@ -1342,9 +1076,6 @@ class GenericTableComponent {
|
|
1342
1076
|
getCellTextAlign(column) {
|
1343
1077
|
return column.textAlign ?? CellTextAlign.left;
|
1344
1078
|
}
|
1345
|
-
showPictureCell(column) {
|
1346
|
-
return (column?.formating ?? GridLayoutFormat.none) === GridLayoutFormat.picture;
|
1347
|
-
}
|
1348
1079
|
deleteDisabled(model) {
|
1349
1080
|
if (this.deleteDisableRule) {
|
1350
1081
|
return this.evaluateRule(this.deleteDisableRule, model);
|
@@ -1353,9 +1084,6 @@ class GenericTableComponent {
|
|
1353
1084
|
return false;
|
1354
1085
|
}
|
1355
1086
|
}
|
1356
|
-
cellClick(model, propertyName) {
|
1357
|
-
this.click.emit({ propertyName, model });
|
1358
|
-
}
|
1359
1087
|
evaluateRule(rules, model) {
|
1360
1088
|
let result = true;
|
1361
1089
|
rules.forEach(rule => {
|
@@ -1414,14 +1142,12 @@ class GenericTableComponent {
|
|
1414
1142
|
applyFilter(event) {
|
1415
1143
|
}
|
1416
1144
|
dropTable(event) {
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
this.table.renderRows();
|
1424
|
-
}
|
1145
|
+
const prevItem = this.dataSource.data[event.previousIndex];
|
1146
|
+
const currentItem = this.dataSource.data[event.currentIndex];
|
1147
|
+
if (this.changeItemPosition(prevItem, currentItem)) {
|
1148
|
+
const prevIndex = this.dataSource.data.findIndex((d) => d === event.item.data);
|
1149
|
+
moveItemInArray(this.dataSource.data, prevIndex, event.currentIndex);
|
1150
|
+
this.table.renderRows();
|
1425
1151
|
}
|
1426
1152
|
}
|
1427
1153
|
isColumnSticky(name) {
|
@@ -1445,45 +1171,13 @@ class GenericTableComponent {
|
|
1445
1171
|
this.dataSource.data = newData;
|
1446
1172
|
this.dataSource._updateChangeSubscription();
|
1447
1173
|
}
|
1448
|
-
ngAfterViewInit() {
|
1449
|
-
fromEvent(this.matTableRef.nativeElement, 'scroll')
|
1450
|
-
.pipe(debounceTime(700))
|
1451
|
-
.subscribe((e) => this.onTableScroll(e));
|
1452
|
-
}
|
1453
|
-
onTableScroll(e) {
|
1454
|
-
const tableViewHeight = e.target.offsetHeight; // viewport: ~500px
|
1455
|
-
const tableScrollHeight = e.target.scrollHeight; // length of all table
|
1456
|
-
const scrollLocation = e.target.scrollTop; // how far user scrolled
|
1457
|
-
// If the user has scrolled within 200px of the bottom, add more data
|
1458
|
-
const scrollThreshold = 200;
|
1459
|
-
const scrollUpLimit = scrollThreshold;
|
1460
|
-
if (scrollLocation < scrollUpLimit && this.paginator.pageIndex > 0) {
|
1461
|
-
// this.firstPage--;
|
1462
|
-
console.log(`onTableScroll() UP: firstPage decreased to ${this.paginator.pageIndex}. Now fetching data...`);
|
1463
|
-
// this.fetchData();
|
1464
|
-
this.scrollTo(tableScrollHeight / 2 - 2 * tableViewHeight);
|
1465
|
-
}
|
1466
|
-
const scrollDownLimit = tableScrollHeight - tableViewHeight - scrollThreshold;
|
1467
|
-
if (scrollLocation > scrollDownLimit && this.paginator.pageIndex < this.paginator.getNumberOfPages()) {
|
1468
|
-
// this.firstPage++;
|
1469
|
-
console.log(`onTableScroll(): firstPage increased to ${this.paginator.pageIndex}. Now fetching data...`);
|
1470
|
-
this.paginator.nextPage();
|
1471
|
-
// this.scrollTo(tableScrollHeight / 2 + tableViewHeight);
|
1472
|
-
}
|
1473
|
-
}
|
1474
|
-
scrollTo(position) {
|
1475
|
-
this.renderer.setProperty(this.matTableRef.nativeElement, 'scrollTop', position);
|
1476
|
-
}
|
1477
|
-
getCellClass(model, property) {
|
1478
|
-
return model.getCellClass(property);
|
1479
|
-
}
|
1480
1174
|
}
|
1481
|
-
GenericTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: GenericTableComponent, deps: [{ token: DialogService }, { token: i2
|
1482
|
-
GenericTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: GenericTableComponent, selector: "rsl-generic-table", inputs: { modelType: "modelType", baseService: "baseService", gridLayoutService: "gridLayoutService", editLink: "editLink", defaultSort: "defaultSort", defaultSortDirection: "defaultSortDirection", deleteDisableRule: "deleteDisableRule", deletePropertyName: "deletePropertyName", hasSearch: "hasSearch", searchFields: "searchFields", defaultFilter: "defaultFilter", allowReorderItems: "allowReorderItems", stickyColumns: "stickyColumns", editOnClick: "editOnClick", editOnDblClick: "editOnDblClick", allowEdit: "allowEdit", popupEdit: "popupEdit", customInclude: "customInclude", changeItemPosition: "changeItemPosition", infiniteScroll: "infiniteScroll" }, outputs: { selectedObject: "selectedObject", click: "click", editModel: "editModel" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ElementRef, descendants: true }, { propertyName: "table", first: true, predicate: ["table"], descendants: true }, { propertyName: "matTableRef", first: true, predicate: ["table"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"containerX\" *ngIf=\"hasSearch\">\r\n <div fxLayout=\"row\" fxLayout.xs=\"column\" fxLayout.sm=\"column\" fxFlexFill>\r\n <mat-form-field fxFlex>\r\n <mat-label>Filter</mat-label>\r\n <input matInput [ngModel]='filterValue' (ngModelChange)='filterChanged.next($event)' #filter>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n<div class=\"table-container\">\r\n <div class=\"mat-elevation-z2\">\r\n <!-- #applicationsContainer -->\r\n <div class=\"example-loading-shade\" *ngIf=\"isLoadingResults || isRateLimitReached\">\r\n <mat-spinner *ngIf=\"isLoadingResults\"></mat-spinner>\r\n <div class=\"example-rate-limit-reached\" *ngIf=\"isRateLimitReached\">\r\n {{'General.LoadingData' | translate}}\r\n </div>\r\n </div>\r\n\r\n\r\n <mat-table fxFlex #table [dataSource]=\"dataSource\" id=\"tempalte-forms-table\" matSort matSortDisableClear\r\n matSortDirection=\"asc\" cdkDropList [cdkDropListData]=\"dataSource\" (cdkDropListDropped)=\"dropTable($event)\">\r\n <!-- (scroll)=\"onTableScroll($event)\" -->\r\n\r\n\r\n <ng-container matColumnDef=\"position\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n <!-- {{'General.Order' | translate}} -->\r\n </mat-header-cell>\r\n <mat-cell fxFlex *matCellDef=\"let element;\">\r\n <mat-icon cdkDragHandle>reorder</mat-icon>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngFor=\"let column of gridLayout\" [matColumnDef]=\"column.propertyName\"\r\n [sticky]=\"isColumnSticky(column.propertyName)\">\r\n <mat-header-cell mat-sort-header disableClear [style.flex]=\"getFlexStyle(column)\" *matHeaderCellDef>\r\n {{column.translateKey | translate}}\r\n </mat-header-cell>\r\n <mat-cell matTooltip={{getCelValue(row,column.propertyName)}} [style.flex]=\"getFlexStyle(column)\"\r\n [style.text-align]=\"getCellTextAlign(column)\" *matCellDef=\"let row\" (click)=\"cellClick(row,column.propertyName)\">\r\n <div [ngClass]=\"getCellClass(row,column.propertyName)\" *ngIf=\"!showPictureCell(column)\">\r\n {{getCelValue(row,column.propertyName)}}\r\n </div>\r\n <img [ngClass]=\"getCellClass(row,column.propertyName)\" *ngIf=\"showPictureCell(column)\">\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"delete\" stickyEnd *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\">\r\n <button class=\"btn btn-green btn-fill btn-wd btn-just-icon\" (click)=\"editObject(row)\"\r\n matTooltip=\"{{'General.Edit' | translate}}\">\r\n <!-- <mat-icon>edit</mat-icon> -->\r\n <i class=\"material-icons\">edit</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n <button class=\"btn btn-red btn-fill btn-wd btn-just-icon\" (click)=\"deleteObject(row)\"\r\n [disabled]=\"deleteDisabled(row)\" matTooltip=\"{{'General.Delete' | translate}}\">\r\n <i class=\"material-icons\">delete</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns;sticky: true\"></mat-header-row>\r\n\r\n <ng-container *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"highlight(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\">\r\n </mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"editObject(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!editOnClick && editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (dblclick)=\"editObject(row)\"\r\n (click)=\"highlight(row)\" (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\"\r\n style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <!-- [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\"\r\n (click)=\"highlight(row)\" (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" -->\r\n </mat-table>\r\n <mat-paginator #paginator [hidden]=\"infiniteScroll\" [length]=\"resultsLength\" [pageSize]=\"15\"\r\n [pageSizeOptions]=\"[15, 30, 100]\" [showFirstLastButtons]=\"true\">\r\n </mat-paginator>\r\n </div>\r\n</div>", styles: [".mat-column-delete{flex:0 0 90px;padding-right:30px}.mat-sort-header-button{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-column-position{flex:0 0 60px!important}.mat-table{overflow-x:auto}[hidden]{display:none!important}\n"], components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8$1.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i9.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.MatLabel, selector: "mat-label" }, { type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i8$1.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i12.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i6$1.MatCellDef, selector: "[matCellDef]" }, { type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i12.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i13.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i12.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], pipes: { "translate": i1$1.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
1175
|
+
GenericTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: GenericTableComponent, deps: [{ token: DialogService }, { token: i2.Router }, { token: i3.DatePipe }, { token: i3.DecimalPipe }, { token: i3.PercentPipe }], target: i0.ɵɵFactoryTarget.Component });
|
1176
|
+
GenericTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: GenericTableComponent, selector: "app-generic-table", inputs: { modelType: "modelType", baseService: "baseService", gridLayoutService: "gridLayoutService", editLink: "editLink", defaultSort: "defaultSort", defaultSortDirection: "defaultSortDirection", deleteDisableRule: "deleteDisableRule", deletePropertyName: "deletePropertyName", hasSearch: "hasSearch", searchFields: "searchFields", defaultFilter: "defaultFilter", allowReorderItems: "allowReorderItems", stickyColumns: "stickyColumns", editOnClick: "editOnClick", editOnDblClick: "editOnDblClick", allowEdit: "allowEdit", popupEdit: "popupEdit", customInclude: "customInclude", changeItemPosition: "changeItemPosition" }, outputs: { selectedObject: "selectedObject", editModel: "editModel" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ElementRef, descendants: true }, { propertyName: "table", first: true, predicate: ["table"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"containerX\" *ngIf=\"hasSearch\">\r\n <div fxLayout=\"row\" fxLayout.xs=\"column\" fxLayout.sm=\"column\" fxFlexFill>\r\n <mat-form-field fxFlex>\r\n <mat-label>Filter</mat-label>\r\n <input matInput [ngModel]='filterValue' (ngModelChange)='filterChanged.next($event)' #filter>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n<div class=\"table-container\">\r\n <div class=\"mat-elevation-z2\">\r\n <!-- #applicationsContainer -->\r\n <div class=\"example-loading-shade\" *ngIf=\"isLoadingResults || isRateLimitReached\">\r\n <mat-spinner *ngIf=\"isLoadingResults\"></mat-spinner>\r\n <div class=\"example-rate-limit-reached\" *ngIf=\"isRateLimitReached\">\r\n {{'General.LoadingData' | translate}}\r\n </div>\r\n </div>\r\n\r\n\r\n <mat-table fxFlex #table [dataSource]=\"dataSource\" id=\"tempalte-forms-table\" matSort matSortDisableClear\r\n matSortDirection=\"asc\" cdkDropList [cdkDropListData]=\"dataSource\" (cdkDropListDropped)=\"dropTable($event)\">\r\n\r\n\r\n <ng-container matColumnDef=\"position\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n <!-- {{'General.Order' | translate}} -->\r\n </mat-header-cell>\r\n <mat-cell fxFlex *matCellDef=\"let element;\">\r\n <mat-icon cdkDragHandle>reorder</mat-icon>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngFor=\"let column of gridLayout\" [matColumnDef]=\"column.propertyName\"\r\n [sticky]=\"isColumnSticky(column.propertyName)\">\r\n <mat-header-cell mat-sort-header disableClear [style.flex]=\"getFlexStyle(column)\" *matHeaderCellDef>\r\n {{column.translateKey | translate}}\r\n </mat-header-cell>\r\n <mat-cell matTooltip={{getCelValue(row,column.propertyName)}} [style.flex]=\"getFlexStyle(column)\"\r\n [style.text-align]=\"getCellTextAlign(column)\" *matCellDef=\"let row\">{{getCelValue(row,column.propertyName)}}\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"delete\" stickyEnd *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\">\r\n <button class=\"btn btn-green btn-fill btn-wd btn-just-icon\" (click)=\"editObject(row)\"\r\n matTooltip=\"{{'General.Edit' | translate}}\">\r\n <!-- <mat-icon>edit</mat-icon> -->\r\n <i class=\"material-icons\">edit</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n <button class=\"btn btn-red btn-fill btn-wd btn-just-icon\" (click)=\"deleteObject(row)\"\r\n [disabled]=\"deleteDisabled(row)\" matTooltip=\"{{'General.Delete' | translate}}\">\r\n <i class=\"material-icons\">delete</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns;sticky: true\"></mat-header-row>\r\n\r\n <ng-container *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"highlight(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\">\r\n </mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"editObject(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!editOnClick && editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (dblclick)=\"editObject(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <!-- [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\"\r\n (click)=\"highlight(row)\" (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" -->\r\n </mat-table>\r\n <mat-paginator #paginator [length]=\"resultsLength\" [pageSize]=\"15\" [pageSizeOptions]=\"[15, 30, 100]\"\r\n [showFirstLastButtons]=\"true\">\r\n </mat-paginator>\r\n </div>\r\n</div>", styles: [".mat-column-delete{flex:0 0 90px;padding-right:30px}.mat-sort-header-button{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-column-position{flex:0 0 60px!important}.mat-table{overflow-x:scroll}\n"], components: [{ type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { type: i6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i9.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatLabel, selector: "mat-label" }, { type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i8.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i11.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i6.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i6.MatCellDef, selector: "[matCellDef]" }, { type: i6.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i11.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i11.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i1$2.TranslatePipe } });
|
1483
1177
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: GenericTableComponent, decorators: [{
|
1484
1178
|
type: Component,
|
1485
|
-
args: [{ selector: '
|
1486
|
-
}], ctorParameters: function () { return [{ type: DialogService }, { type: i2
|
1179
|
+
args: [{ selector: 'app-generic-table', template: "<div class=\"containerX\" *ngIf=\"hasSearch\">\r\n <div fxLayout=\"row\" fxLayout.xs=\"column\" fxLayout.sm=\"column\" fxFlexFill>\r\n <mat-form-field fxFlex>\r\n <mat-label>Filter</mat-label>\r\n <input matInput [ngModel]='filterValue' (ngModelChange)='filterChanged.next($event)' #filter>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n<div class=\"table-container\">\r\n <div class=\"mat-elevation-z2\">\r\n <!-- #applicationsContainer -->\r\n <div class=\"example-loading-shade\" *ngIf=\"isLoadingResults || isRateLimitReached\">\r\n <mat-spinner *ngIf=\"isLoadingResults\"></mat-spinner>\r\n <div class=\"example-rate-limit-reached\" *ngIf=\"isRateLimitReached\">\r\n {{'General.LoadingData' | translate}}\r\n </div>\r\n </div>\r\n\r\n\r\n <mat-table fxFlex #table [dataSource]=\"dataSource\" id=\"tempalte-forms-table\" matSort matSortDisableClear\r\n matSortDirection=\"asc\" cdkDropList [cdkDropListData]=\"dataSource\" (cdkDropListDropped)=\"dropTable($event)\">\r\n\r\n\r\n <ng-container matColumnDef=\"position\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n <!-- {{'General.Order' | translate}} -->\r\n </mat-header-cell>\r\n <mat-cell fxFlex *matCellDef=\"let element;\">\r\n <mat-icon cdkDragHandle>reorder</mat-icon>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngFor=\"let column of gridLayout\" [matColumnDef]=\"column.propertyName\"\r\n [sticky]=\"isColumnSticky(column.propertyName)\">\r\n <mat-header-cell mat-sort-header disableClear [style.flex]=\"getFlexStyle(column)\" *matHeaderCellDef>\r\n {{column.translateKey | translate}}\r\n </mat-header-cell>\r\n <mat-cell matTooltip={{getCelValue(row,column.propertyName)}} [style.flex]=\"getFlexStyle(column)\"\r\n [style.text-align]=\"getCellTextAlign(column)\" *matCellDef=\"let row\">{{getCelValue(row,column.propertyName)}}\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"delete\" stickyEnd *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-header-cell *matHeaderCellDef disableClear=\"true\">\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\">\r\n <button class=\"btn btn-green btn-fill btn-wd btn-just-icon\" (click)=\"editObject(row)\"\r\n matTooltip=\"{{'General.Edit' | translate}}\">\r\n <!-- <mat-icon>edit</mat-icon> -->\r\n <i class=\"material-icons\">edit</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n <button class=\"btn btn-red btn-fill btn-wd btn-just-icon\" (click)=\"deleteObject(row)\"\r\n [disabled]=\"deleteDisabled(row)\" matTooltip=\"{{'General.Delete' | translate}}\">\r\n <i class=\"material-icons\">delete</i>\r\n <div class=\"ripple-container\"></div>\r\n </button>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns;sticky: true\"></mat-header-row>\r\n\r\n <ng-container *ngIf=\"!editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"highlight(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\">\r\n </mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"editOnClick && !editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (click)=\"editObject(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!editOnClick && editOnDblClick\">\r\n <mat-row *matRowDef=\"let row;let index = dataIndex; columns: displayedColumns;\" cdkDrag [cdkDragData]=\"row\"\r\n [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\" (dblclick)=\"editObject(row)\"\r\n (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" style=\"cursor: pointer;\"></mat-row>\r\n </ng-container>\r\n\r\n <!-- [ngClass]=\"{hovered: row.hovered, highlighted: row.highlighted}\"\r\n (click)=\"highlight(row)\" (mouseover)=\"row.hovered = true\" (mouseout)=\"row.hovered = false\" -->\r\n </mat-table>\r\n <mat-paginator #paginator [length]=\"resultsLength\" [pageSize]=\"15\" [pageSizeOptions]=\"[15, 30, 100]\"\r\n [showFirstLastButtons]=\"true\">\r\n </mat-paginator>\r\n </div>\r\n</div>", styles: [".mat-column-delete{flex:0 0 90px;padding-right:30px}.mat-sort-header-button{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-column-position{flex:0 0 60px!important}.mat-table{overflow-x:scroll}\n"] }]
|
1180
|
+
}], ctorParameters: function () { return [{ type: DialogService }, { type: i2.Router }, { type: i3.DatePipe }, { type: i3.DecimalPipe }, { type: i3.PercentPipe }]; }, propDecorators: { modelType: [{
|
1487
1181
|
type: Input
|
1488
1182
|
}], baseService: [{
|
1489
1183
|
type: Input
|
@@ -1521,8 +1215,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
1521
1215
|
type: Input
|
1522
1216
|
}], changeItemPosition: [{
|
1523
1217
|
type: Input
|
1524
|
-
}], infiniteScroll: [{
|
1525
|
-
type: Input
|
1526
1218
|
}], paginator: [{
|
1527
1219
|
type: ViewChild,
|
1528
1220
|
args: [MatPaginator, { static: true }]
|
@@ -1535,13 +1227,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
1535
1227
|
}], table: [{
|
1536
1228
|
type: ViewChild,
|
1537
1229
|
args: ['table']
|
1538
|
-
}], matTableRef: [{
|
1539
|
-
type: ViewChild,
|
1540
|
-
args: ['table', { read: ElementRef }]
|
1541
1230
|
}], selectedObject: [{
|
1542
1231
|
type: Output
|
1543
|
-
}], click: [{
|
1544
|
-
type: Output
|
1545
1232
|
}], editModel: [{
|
1546
1233
|
type: Output
|
1547
1234
|
}] } });
|
@@ -1602,9 +1289,6 @@ function Attribute(options = {}) {
|
|
1602
1289
|
const defaultMetadata = Reflect.getMetadata('AttributedefaultValue', target) || {};
|
1603
1290
|
defaultMetadata[serializedPropertyName] = options.defaultValue !== undefined ? options.defaultValue : null;
|
1604
1291
|
Reflect.defineMetadata('AttributedefaultValue', defaultMetadata, target);
|
1605
|
-
const formSubGroupMetadata = Reflect.getMetadata('AttributeformSubGroup', target) || {};
|
1606
|
-
formSubGroupMetadata[serializedPropertyName] = options.formSubGroup !== undefined ? options.formSubGroup : null;
|
1607
|
-
Reflect.defineMetadata('AttributeformSubGroup', formSubGroupMetadata, target);
|
1608
1292
|
};
|
1609
1293
|
const setMetadata = (hasDirtyAttributes, instance, oldValue, newValue, isNew) => {
|
1610
1294
|
const targetType = Reflect.getMetadata('design:type', target, propertyName);
|
@@ -1792,14 +1476,14 @@ class TranslatedContentDirective {
|
|
1792
1476
|
this.subs.forEach(sub => sub.unsubscribe());
|
1793
1477
|
}
|
1794
1478
|
}
|
1795
|
-
TranslatedContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TranslatedContentDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i1$
|
1479
|
+
TranslatedContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TranslatedContentDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i1$2.TranslateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
1796
1480
|
TranslatedContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: TranslatedContentDirective, selector: "[appTranslatedContent]", inputs: { translationKey: ["appTranslatedContent", "translationKey"] }, queries: [{ propertyName: "elements", predicate: TranslatedElementDirective }], ngImport: i0 });
|
1797
1481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TranslatedContentDirective, decorators: [{
|
1798
1482
|
type: Directive,
|
1799
1483
|
args: [{
|
1800
1484
|
selector: '[appTranslatedContent]',
|
1801
1485
|
}]
|
1802
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i1$
|
1486
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i1$2.TranslateService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { translationKey: [{
|
1803
1487
|
type: Input,
|
1804
1488
|
args: ['appTranslatedContent']
|
1805
1489
|
}], elements: [{
|
@@ -1912,65 +1596,25 @@ class BaseModel {
|
|
1912
1596
|
getModelDefaultPropertyValues(model) {
|
1913
1597
|
return Reflect.getMetadata('AttributedefaultValue', model);
|
1914
1598
|
}
|
1915
|
-
getModelSubGroupPropertyNames(model) {
|
1916
|
-
return Reflect.getMetadata('AttributeformSubGroup', model);
|
1917
|
-
}
|
1918
1599
|
getFromGroup(fb) {
|
1919
1600
|
const props = Object.keys(this.getModelPropertyNames(this));
|
1920
1601
|
const requiredProps = this.getModelRequiredPropertyNames(this);
|
1921
1602
|
const defaultValues = this.getModelDefaultPropertyValues(this);
|
1922
|
-
const formSubGroupsValues = this.getModelSubGroupPropertyNames(this);
|
1923
1603
|
const controlsConfig = {};
|
1924
1604
|
const that = this;
|
1925
1605
|
if (props) {
|
1926
1606
|
props.forEach(property => {
|
1927
1607
|
const value = that[property] !== undefined ? that[property] : defaultValues[property];
|
1928
|
-
const formSubGroup = formSubGroupsValues[property] ?? null;
|
1929
1608
|
if (requiredProps[property]) {
|
1930
|
-
|
1931
|
-
this.getSubFromGroup(fb, controlsConfig, formSubGroup).addControl(property, fb.control(value, Validators.required));
|
1932
|
-
else
|
1933
|
-
controlsConfig[property] = [value, Validators.required];
|
1609
|
+
controlsConfig[property] = [value, Validators.required];
|
1934
1610
|
}
|
1935
1611
|
else {
|
1936
|
-
|
1937
|
-
this.getSubFromGroup(fb, controlsConfig, formSubGroup).addControl(property, fb.control(value));
|
1938
|
-
else
|
1939
|
-
controlsConfig[property] = value;
|
1612
|
+
controlsConfig[property] = value;
|
1940
1613
|
}
|
1941
1614
|
});
|
1942
1615
|
}
|
1943
1616
|
return fb.group(controlsConfig);
|
1944
1617
|
}
|
1945
|
-
getSubFromGroup(fb, controlsConfig, subGroup) {
|
1946
|
-
if (!controlsConfig[subGroup])
|
1947
|
-
controlsConfig[subGroup] = fb.group({});
|
1948
|
-
return controlsConfig[subGroup];
|
1949
|
-
}
|
1950
|
-
getModelFromFormGroup(formGroup, id) {
|
1951
|
-
const props = Object.keys(this.getModelPropertyNames(this));
|
1952
|
-
const formSubGroupsValues = this.getModelSubGroupPropertyNames(this);
|
1953
|
-
const data = {};
|
1954
|
-
if (id) {
|
1955
|
-
data.id = id;
|
1956
|
-
}
|
1957
|
-
const that = this;
|
1958
|
-
if (props) {
|
1959
|
-
props.forEach(property => {
|
1960
|
-
const formSubGroup = formSubGroupsValues[property] ?? null;
|
1961
|
-
if (!formSubGroup)
|
1962
|
-
data[property] = formGroup.controls[property].value ?? null;
|
1963
|
-
else
|
1964
|
-
data[property] = formGroup.controls[formSubGroup].controls[property].value ?? null;
|
1965
|
-
});
|
1966
|
-
}
|
1967
|
-
if (data) {
|
1968
|
-
if (id) {
|
1969
|
-
this.id = id;
|
1970
|
-
}
|
1971
|
-
Object.assign(this, data);
|
1972
|
-
}
|
1973
|
-
}
|
1974
1618
|
getGridLayout() {
|
1975
1619
|
const result = Array();
|
1976
1620
|
const gridLayout = Reflect.getMetadata('GridLayout', this);
|
@@ -1987,9 +1631,6 @@ class BaseModel {
|
|
1987
1631
|
const attributesMetadata = this[AttributeMetadata];
|
1988
1632
|
return this._datastore.modelToEntity(this, attributesMetadata, true);
|
1989
1633
|
}
|
1990
|
-
getCellClass(property) {
|
1991
|
-
return '';
|
1992
|
-
}
|
1993
1634
|
}
|
1994
1635
|
|
1995
1636
|
class ErrorResponse {
|
@@ -2090,32 +1731,26 @@ const PROVIDERS = [
|
|
2090
1731
|
class RslBaseModule {
|
2091
1732
|
}
|
2092
1733
|
RslBaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: RslBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
2093
|
-
RslBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: RslBaseModule, declarations: [GenericTableComponent,
|
2094
|
-
|
2095
|
-
ReactiveFormsModule, i2$2.BlockUIModule], exports: [HttpClientModule,
|
2096
|
-
GenericTableComponent,
|
2097
|
-
SearchableDropdownComponent] });
|
1734
|
+
RslBaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: RslBaseModule, declarations: [GenericTableComponent], imports: [CommonModule, i1$2.TranslateModule, MaterialModule, i2$1.BlockUIModule], exports: [HttpClientModule,
|
1735
|
+
GenericTableComponent] });
|
2098
1736
|
RslBaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: RslBaseModule, providers: [
|
2099
1737
|
PROVIDERS
|
2100
1738
|
], imports: [[
|
2101
1739
|
CommonModule,
|
2102
1740
|
TranslateModule.forChild({}),
|
2103
1741
|
MaterialModule,
|
2104
|
-
ReactiveFormsModule,
|
2105
1742
|
BlockUIModule.forRoot(),
|
2106
1743
|
], HttpClientModule] });
|
2107
1744
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: RslBaseModule, decorators: [{
|
2108
1745
|
type: NgModule,
|
2109
1746
|
args: [{
|
2110
1747
|
declarations: [
|
2111
|
-
GenericTableComponent
|
2112
|
-
SearchableDropdownComponent
|
1748
|
+
GenericTableComponent
|
2113
1749
|
],
|
2114
1750
|
imports: [
|
2115
1751
|
CommonModule,
|
2116
1752
|
TranslateModule.forChild({}),
|
2117
1753
|
MaterialModule,
|
2118
|
-
ReactiveFormsModule,
|
2119
1754
|
BlockUIModule.forRoot(),
|
2120
1755
|
],
|
2121
1756
|
providers: [
|
@@ -2123,8 +1758,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
2123
1758
|
],
|
2124
1759
|
exports: [
|
2125
1760
|
HttpClientModule,
|
2126
|
-
GenericTableComponent
|
2127
|
-
SearchableDropdownComponent
|
1761
|
+
GenericTableComponent
|
2128
1762
|
]
|
2129
1763
|
}]
|
2130
1764
|
}] });
|
@@ -2154,14 +1788,14 @@ class InputErrorPipe {
|
|
2154
1788
|
return rvalue;
|
2155
1789
|
}
|
2156
1790
|
}
|
2157
|
-
InputErrorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: InputErrorPipe, deps: [{ token: i1$
|
1791
|
+
InputErrorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: InputErrorPipe, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
|
2158
1792
|
InputErrorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: InputErrorPipe, name: "inputError" });
|
2159
1793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: InputErrorPipe, decorators: [{
|
2160
1794
|
type: Pipe,
|
2161
1795
|
args: [{
|
2162
1796
|
name: 'inputError'
|
2163
1797
|
}]
|
2164
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1798
|
+
}], ctorParameters: function () { return [{ type: i1$2.TranslateService }]; } });
|
2165
1799
|
|
2166
1800
|
class Nl2brPipe {
|
2167
1801
|
transform(value, args) {
|
@@ -2206,5 +1840,5 @@ class CustomValidators {
|
|
2206
1840
|
* Generated bundle index. Do not edit.
|
2207
1841
|
*/
|
2208
1842
|
|
2209
|
-
export { Attribute, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CellTextAlign, CustomType, CustomValidators, DialogService, ErrorResponse, FieldErrorDisplayComponent, GenericTableComponent, GridLayout, GridLayoutFormat, GridLayoutModel, GridLayoutService, InputErrorPipe, MaterialModule, Nl2brPipe, PROVIDERS, PageNotFoundComponent, RslBaseModule, Rule,
|
1843
|
+
export { Attribute, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CellTextAlign, CustomType, CustomValidators, DialogService, ErrorResponse, FieldErrorDisplayComponent, GenericTableComponent, GridLayout, GridLayoutFormat, GridLayoutModel, GridLayoutService, InputErrorPipe, MaterialModule, Nl2brPipe, PROVIDERS, PageNotFoundComponent, RslBaseModule, Rule, TranslatedContentDirective, TranslatedElementDirective, UnderConstructionComponent };
|
2210
1844
|
//# sourceMappingURL=rosoftlab-core.mjs.map
|