@mediusinc/mng-commons 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +3 -2
- package/assets/i18n/sl.json +3 -2
- package/esm2020/lib/api/models/filter-param.model.mjs +1 -1
- package/esm2020/lib/api/utils/medius-rest.util.mjs +66 -8
- package/esm2020/lib/components/action/action.component.mjs +17 -4
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +1 -1
- package/esm2020/lib/components/action/models/action-execution.model.mjs +6 -1
- package/esm2020/lib/components/action/models/index.mjs +2 -1
- package/esm2020/lib/components/action/models/tableview-action-default-categories.model.mjs +11 -0
- package/esm2020/lib/components/form/date-range/date-range.component.mjs +106 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +1 -1
- package/esm2020/lib/components/form/index.mjs +2 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -10
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +5 -13
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +38 -23
- package/esm2020/lib/components/tableview/table/table.component.mjs +54 -21
- package/esm2020/lib/components/tableview/tableview.component.mjs +9 -3
- package/esm2020/lib/data-providers/table.data-provider.mjs +9 -2
- package/esm2020/lib/data-providers/tableview.data-provider.mjs +30 -2
- package/esm2020/lib/descriptors/action.descriptor.mjs +11 -1
- package/esm2020/lib/descriptors/column.descriptor.mjs +121 -29
- package/esm2020/lib/descriptors/editor.descriptor.mjs +109 -7
- package/esm2020/lib/descriptors/field.descriptor.mjs +38 -4
- package/esm2020/lib/descriptors/filter.descriptor.mjs +32 -6
- package/esm2020/lib/descriptors/index.mjs +2 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +282 -16
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +175 -3
- package/esm2020/lib/descriptors/types/table.type.mjs +10 -1
- package/esm2020/lib/mng-commons.module.mjs +9 -2
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/tableview-attr.model.mjs +2 -0
- package/esm2020/lib/pipes/class-map.pipe.mjs +22 -0
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +41 -17
- package/esm2020/lib/services/action-executor.service.mjs +1 -1
- package/esm2020/lib/services/commons.service.mjs +6 -5
- package/esm2020/lib/utils/date.util.mjs +118 -0
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/tableview.util.mjs +144 -0
- package/fesm2015/mediusinc-mng-commons.mjs +1462 -169
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1428 -147
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/filter-param.model.d.ts +2 -2
- package/lib/api/utils/medius-rest.util.d.ts +1 -0
- package/lib/components/action/action.component.d.ts +2 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/action/models/index.d.ts +1 -0
- package/lib/components/action/models/tableview-action-default-categories.model.d.ts +10 -0
- package/lib/components/form/date-range/date-range.component.d.ts +28 -0
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +9 -4
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -5
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +13 -7
- package/lib/components/tableview/table/table.component.d.ts +4 -2
- package/lib/components/tableview/tableview.component.d.ts +3 -0
- package/lib/data-providers/table.data-provider.d.ts +6 -1
- package/lib/data-providers/tableview.data-provider.d.ts +16 -2
- package/lib/descriptors/action.descriptor.d.ts +4 -0
- package/lib/descriptors/column.descriptor.d.ts +39 -5
- package/lib/descriptors/editor.descriptor.d.ts +69 -11
- package/lib/descriptors/field.descriptor.d.ts +7 -2
- package/lib/descriptors/filter.descriptor.d.ts +12 -6
- package/lib/descriptors/index.d.ts +1 -1
- package/lib/descriptors/table.descriptor.d.ts +124 -8
- package/lib/descriptors/tableview.descriptor.d.ts +81 -7
- package/lib/descriptors/types/table.type.d.ts +8 -0
- package/lib/mng-commons.module.d.ts +73 -71
- package/lib/models/index.d.ts +1 -0
- package/lib/models/tableview-attr.model.d.ts +9 -0
- package/lib/pipes/class-map.pipe.d.ts +7 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/router/models/router.model.d.ts +6 -0
- package/lib/router/tableview-route-builder.d.ts +3 -0
- package/lib/services/commons.service.d.ts +3 -2
- package/lib/utils/date.util.d.ts +7 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/tableview.util.d.ts +39 -0
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_tableview.scss +17 -0
- package/version-info.json +5 -5
|
@@ -3,11 +3,11 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import * as i1$3 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
6
|
+
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, inject, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
7
7
|
import * as i2$1 from '@angular/forms';
|
|
8
8
|
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
|
-
import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
10
|
+
import { NavigationEnd, ActivatedRoute, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
11
11
|
import * as i2$2 from '@ngx-formly/core';
|
|
12
12
|
import { FieldWrapper, FieldType, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
|
|
13
13
|
import * as i1$2 from '@ngx-translate/core';
|
|
@@ -63,7 +63,7 @@ import { SelectButtonModule } from 'primeng/selectbutton';
|
|
|
63
63
|
import * as i7$3 from 'primeng/skeleton';
|
|
64
64
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
65
65
|
import * as i6$4 from 'primeng/table';
|
|
66
|
-
import { Table, TableModule } from 'primeng/table';
|
|
66
|
+
import { ColumnFilter, Table, TableModule } from 'primeng/table';
|
|
67
67
|
import * as i4$4 from 'primeng/tabview';
|
|
68
68
|
import { TabViewModule } from 'primeng/tabview';
|
|
69
69
|
import { TagModule } from 'primeng/tag';
|
|
@@ -74,7 +74,7 @@ import * as i6$2 from 'primeng/toolbar';
|
|
|
74
74
|
import { ToolbarModule } from 'primeng/toolbar';
|
|
75
75
|
import * as i7 from 'primeng/tooltip';
|
|
76
76
|
import { TooltipModule } from 'primeng/tooltip';
|
|
77
|
-
import { isObservable, throwError, of, Subject, BehaviorSubject, ReplaySubject, distinctUntilChanged, combineLatest, tap, switchMap, mergeMap as mergeMap$1, from, Observable } from 'rxjs';
|
|
77
|
+
import { isObservable, throwError, of, Subject, BehaviorSubject, ReplaySubject, distinctUntilChanged, combineLatest, tap, switchMap, mergeMap as mergeMap$1, from, Observable, merge, debounceTime } from 'rxjs';
|
|
78
78
|
import { map, mergeMap, catchError, first, filter, finalize, startWith } from 'rxjs/operators';
|
|
79
79
|
import 'reflect-metadata';
|
|
80
80
|
import * as i4 from '@angular/platform-browser';
|
|
@@ -464,6 +464,125 @@ class ActionDataProviderUtil {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
+
class DateUtil {
|
|
468
|
+
static toIsoString(date, inUtc = false, withTimezone = false, withMillis = false) {
|
|
469
|
+
if (typeof date === 'string') {
|
|
470
|
+
date = new Date(date);
|
|
471
|
+
}
|
|
472
|
+
if (!(date instanceof Date)) {
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
475
|
+
if (inUtc) {
|
|
476
|
+
let str = date.toISOString();
|
|
477
|
+
if (!withMillis) {
|
|
478
|
+
const dotIdx = str.lastIndexOf('.');
|
|
479
|
+
str = str.substring(0, dotIdx) + str.substring(dotIdx + 4, str.length);
|
|
480
|
+
}
|
|
481
|
+
if (!withTimezone) {
|
|
482
|
+
str = str.substring(0, str.length - 1);
|
|
483
|
+
}
|
|
484
|
+
return str;
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
const tzo = -date.getTimezoneOffset(), dif = tzo >= 0 ? '+' : '-', pad = (num) => (num < 10 ? '0' : '') + num;
|
|
488
|
+
let base = date.getFullYear() +
|
|
489
|
+
'-' +
|
|
490
|
+
pad(date.getMonth() + 1) +
|
|
491
|
+
'-' +
|
|
492
|
+
pad(date.getDate()) +
|
|
493
|
+
'T' +
|
|
494
|
+
pad(date.getHours()) +
|
|
495
|
+
':' +
|
|
496
|
+
pad(date.getMinutes()) +
|
|
497
|
+
':' +
|
|
498
|
+
pad(date.getSeconds());
|
|
499
|
+
if (withMillis) {
|
|
500
|
+
base += '.' + pad(date.getMilliseconds());
|
|
501
|
+
}
|
|
502
|
+
if (withTimezone) {
|
|
503
|
+
return base + (dif + pad(Math.floor(Math.abs(tzo) / 60)) + ':' + pad(Math.abs(tzo) % 60));
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
return base;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
static fromPrimeToAngularDateFormat(ngDateFormat) {
|
|
511
|
+
var _a;
|
|
512
|
+
let primeDateFormat = ngDateFormat;
|
|
513
|
+
for (const regex of DateUtil.NG_PRIME_FORMAT_OTHER) {
|
|
514
|
+
primeDateFormat = primeDateFormat.replace(regex, ' ');
|
|
515
|
+
}
|
|
516
|
+
for (const regex of DateUtil.NG_PRIME_FORMAT_SUPPORTED) {
|
|
517
|
+
const matches = [...primeDateFormat.matchAll(regex)].reverse();
|
|
518
|
+
for (const match of matches) {
|
|
519
|
+
if (match.index) {
|
|
520
|
+
const matchStr = match[0];
|
|
521
|
+
const replacement = (_a = DateUtil.NG_PRIME_FORMAT_MAP[matchStr]) !== null && _a !== void 0 ? _a : match[0];
|
|
522
|
+
primeDateFormat = primeDateFormat.substring(0, match.index) + replacement + primeDateFormat.substring(match.index + matchStr.length);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
primeDateFormat = primeDateFormat.replace(/\s+\W\s+/g, ' ');
|
|
527
|
+
primeDateFormat = primeDateFormat.replace(/\s\s+/g, ' ');
|
|
528
|
+
return primeDateFormat.trim();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
DateUtil.NG_PRIME_FORMAT_SUPPORTED = [/d{1,2}/g, /E{1,5}/g, /c{1,5}/g, /M{1,5}/g, /L{1,5}/g, /y{1,4}/g, /Y{1,4}/g];
|
|
532
|
+
DateUtil.NG_PRIME_FORMAT_OTHER = [
|
|
533
|
+
/G{1,5}/g,
|
|
534
|
+
/w{1,2}/g,
|
|
535
|
+
/W/g,
|
|
536
|
+
/a{1,5}/g,
|
|
537
|
+
/B{1,5}/g,
|
|
538
|
+
/b{1,5}/g,
|
|
539
|
+
/h{1,2}/g,
|
|
540
|
+
/H{1,2}/g,
|
|
541
|
+
/m{1,2}/g,
|
|
542
|
+
/s{1,2}/g,
|
|
543
|
+
/S{1,3}/g,
|
|
544
|
+
/z{1,4}/g,
|
|
545
|
+
/Z{1,5}/g,
|
|
546
|
+
/O{1,4}/g
|
|
547
|
+
];
|
|
548
|
+
DateUtil.NG_PRIME_FORMAT_MAP = {
|
|
549
|
+
// days
|
|
550
|
+
d: 'd',
|
|
551
|
+
dd: 'dd',
|
|
552
|
+
E: 'D',
|
|
553
|
+
EE: 'D',
|
|
554
|
+
EEE: 'D',
|
|
555
|
+
EEEE: 'DD',
|
|
556
|
+
EEEEE: 'D',
|
|
557
|
+
EEEEEE: 'D',
|
|
558
|
+
c: 'd',
|
|
559
|
+
cc: 'dd',
|
|
560
|
+
ccc: 'D',
|
|
561
|
+
cccc: 'DD',
|
|
562
|
+
ccccc: 'D',
|
|
563
|
+
cccccc: 'D',
|
|
564
|
+
// months
|
|
565
|
+
M: 'm',
|
|
566
|
+
MM: 'mm',
|
|
567
|
+
MMM: 'M',
|
|
568
|
+
MMMM: 'MM',
|
|
569
|
+
MMMMM: 'M',
|
|
570
|
+
L: 'm',
|
|
571
|
+
LL: 'mm',
|
|
572
|
+
LLL: 'M',
|
|
573
|
+
LLLL: 'MM',
|
|
574
|
+
LLLLL: 'M',
|
|
575
|
+
// year
|
|
576
|
+
y: 'y',
|
|
577
|
+
yy: 'y',
|
|
578
|
+
yyy: 'yy',
|
|
579
|
+
yyyy: 'yy',
|
|
580
|
+
Y: 'y',
|
|
581
|
+
YY: 'y',
|
|
582
|
+
YYY: 'yy',
|
|
583
|
+
YYYY: 'yy'
|
|
584
|
+
};
|
|
585
|
+
|
|
467
586
|
class DataProvider {
|
|
468
587
|
constructor(modelType, serviceType) {
|
|
469
588
|
this._modelType = modelType;
|
|
@@ -534,28 +653,63 @@ class TableDataProvider extends DataProvider {
|
|
|
534
653
|
constructor(modelType, serviceType) {
|
|
535
654
|
super(modelType, serviceType);
|
|
536
655
|
this._getAll = () => of(new MediusQueryResult());
|
|
656
|
+
this._getAllReloadSubject = new Subject();
|
|
537
657
|
}
|
|
538
658
|
get getAll() {
|
|
539
659
|
return this._getAll;
|
|
540
660
|
}
|
|
661
|
+
get getAllReload$() {
|
|
662
|
+
return this._getAllReloadSubject.asObservable();
|
|
663
|
+
}
|
|
541
664
|
withGetAll(getAll) {
|
|
542
665
|
this._getAll = getAll;
|
|
543
666
|
return this;
|
|
544
667
|
}
|
|
668
|
+
getAllReload(queryParam) {
|
|
669
|
+
this._getAllReloadSubject.next(queryParam);
|
|
670
|
+
}
|
|
545
671
|
}
|
|
546
672
|
|
|
547
673
|
class TableviewDataProvider extends EditorDataProvider {
|
|
548
674
|
constructor(modelType, serviceType) {
|
|
549
675
|
super(modelType, serviceType);
|
|
550
676
|
this._getAll = () => of(new MediusQueryResult());
|
|
677
|
+
this._getAllReloadSubject = new Subject();
|
|
551
678
|
}
|
|
552
679
|
get getAll() {
|
|
553
680
|
return this._getAll;
|
|
554
681
|
}
|
|
682
|
+
get getAllReload$() {
|
|
683
|
+
return this._getAllReloadSubject.asObservable();
|
|
684
|
+
}
|
|
555
685
|
withGetAll(getAll) {
|
|
556
686
|
this._getAll = getAll;
|
|
557
687
|
return this;
|
|
558
688
|
}
|
|
689
|
+
getAllReload(queryParam) {
|
|
690
|
+
this._getAllReloadSubject.next(queryParam);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
694
|
+
constructor() {
|
|
695
|
+
super({});
|
|
696
|
+
this._getAll = () => of(new MediusQueryResult());
|
|
697
|
+
this._fetch = () => of({});
|
|
698
|
+
}
|
|
699
|
+
withGetAll(getAll) {
|
|
700
|
+
this._getAll = getAll;
|
|
701
|
+
return this;
|
|
702
|
+
}
|
|
703
|
+
withFetch(fetch) {
|
|
704
|
+
this._fetch = fetch;
|
|
705
|
+
return this;
|
|
706
|
+
}
|
|
707
|
+
get getAll() {
|
|
708
|
+
return this._getAll;
|
|
709
|
+
}
|
|
710
|
+
get fetch() {
|
|
711
|
+
return this._fetch;
|
|
712
|
+
}
|
|
559
713
|
}
|
|
560
714
|
|
|
561
715
|
class TableviewCrudDataProvider extends TableviewDataProvider {
|
|
@@ -853,6 +1007,15 @@ var TableSizeEnum;
|
|
|
853
1007
|
TableSizeEnum[TableSizeEnum["Normal"] = 1] = "Normal";
|
|
854
1008
|
TableSizeEnum[TableSizeEnum["Large"] = 2] = "Large";
|
|
855
1009
|
})(TableSizeEnum || (TableSizeEnum = {}));
|
|
1010
|
+
/**
|
|
1011
|
+
* EXCLUDE default, all columns has sort and filter on by default, developer EXCLUDES properties from sort/filter
|
|
1012
|
+
* INCLUDE_ONLY only selected columns have sort/filter, developers INCLUDES properties
|
|
1013
|
+
*/
|
|
1014
|
+
var TableDynamicColumnsModeEnum;
|
|
1015
|
+
(function (TableDynamicColumnsModeEnum) {
|
|
1016
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["EXCLUDE"] = 0] = "EXCLUDE";
|
|
1017
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["INCLUDE_ONLY"] = 1] = "INCLUDE_ONLY";
|
|
1018
|
+
})(TableDynamicColumnsModeEnum || (TableDynamicColumnsModeEnum = {}));
|
|
856
1019
|
|
|
857
1020
|
class StylesUtil {
|
|
858
1021
|
static calculateTableColumnActionWidth(table, actions) {
|
|
@@ -1171,6 +1334,8 @@ class ActionDescriptor {
|
|
|
1171
1334
|
this._hasRunNotificationError = true;
|
|
1172
1335
|
//button
|
|
1173
1336
|
this._buttonDescriptor = new ButtonDescriptor();
|
|
1337
|
+
// multiple row selection
|
|
1338
|
+
this._hasItemsSelection = false;
|
|
1174
1339
|
this._model = model;
|
|
1175
1340
|
this._actionName = actionName;
|
|
1176
1341
|
if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
|
|
@@ -1282,6 +1447,9 @@ class ActionDescriptor {
|
|
|
1282
1447
|
get permissionsRouteType() {
|
|
1283
1448
|
return this._permissionsRouteType;
|
|
1284
1449
|
}
|
|
1450
|
+
get hasItemsSelection() {
|
|
1451
|
+
return this._hasItemsSelection;
|
|
1452
|
+
}
|
|
1285
1453
|
get buttonDescriptor() {
|
|
1286
1454
|
return this._buttonDescriptor;
|
|
1287
1455
|
}
|
|
@@ -1369,6 +1537,12 @@ class ActionDescriptor {
|
|
|
1369
1537
|
this._buttonDescriptor = buttonDescriptor;
|
|
1370
1538
|
return this;
|
|
1371
1539
|
}
|
|
1540
|
+
withItemsSelection(hasSelection = true) {
|
|
1541
|
+
var _a;
|
|
1542
|
+
this._hasItemsSelection = hasSelection;
|
|
1543
|
+
this._isEnabledFunction = (_a = this._isEnabledFunction) !== null && _a !== void 0 ? _a : (ctx => { var _a, _b; return of(((_b = (_a = ctx.parameters.selectedItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0); });
|
|
1544
|
+
return this;
|
|
1545
|
+
}
|
|
1372
1546
|
}
|
|
1373
1547
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1374
1548
|
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
@@ -1668,14 +1842,157 @@ class ActionLinkDescriptor extends ActionDescriptor {
|
|
|
1668
1842
|
}
|
|
1669
1843
|
}
|
|
1670
1844
|
|
|
1845
|
+
class TableviewUtil {
|
|
1846
|
+
/**
|
|
1847
|
+
* returns attributes from class type and extends to typed def with column and field enum type
|
|
1848
|
+
* @param modelType class type
|
|
1849
|
+
*/
|
|
1850
|
+
static getAttributeDefMap(modelType) {
|
|
1851
|
+
return TableviewUtil.expandAttributeDefWithTableviewTypes(ObjectSerializer.get().findAttributesDefinitionByClassType(modelType));
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* expands AttributeDef to TableviewAttributeDef with defined input and column enum type
|
|
1855
|
+
* @param attributes open api specification model
|
|
1856
|
+
*/
|
|
1857
|
+
static expandAttributeDefWithTableviewTypes(attributes) {
|
|
1858
|
+
if (attributes == null) {
|
|
1859
|
+
throw new Error('AttributeDef is null, problem with ObjectSerializer::findAttributesDefinitionByClassType?');
|
|
1860
|
+
}
|
|
1861
|
+
const objectSerializer = ObjectSerializer.get();
|
|
1862
|
+
const tableviewAttributeDef = [];
|
|
1863
|
+
for (const attribute of attributes) {
|
|
1864
|
+
const enumType = objectSerializer.findEnum(attribute.type);
|
|
1865
|
+
tableviewAttributeDef.push({
|
|
1866
|
+
name: attribute.name,
|
|
1867
|
+
baseName: attribute.baseName,
|
|
1868
|
+
type: attribute.type,
|
|
1869
|
+
columnType: enumType ? ColumnTypeEnum.Enum : TableviewUtil.toColumnType(attribute.type),
|
|
1870
|
+
fieldType: TableviewUtil.toFieldInputType(attribute.type),
|
|
1871
|
+
enumType: objectSerializer.findEnum(attribute.type),
|
|
1872
|
+
classType: objectSerializer.findType(attribute.type)
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
return tableviewAttributeDef;
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* converts column to number or date on value based
|
|
1879
|
+
* @param column column to be transformed
|
|
1880
|
+
* @param value value to check if applicable
|
|
1881
|
+
*/
|
|
1882
|
+
static stringColumnConverter(column, value) {
|
|
1883
|
+
if (typeof value === 'boolean') {
|
|
1884
|
+
return column.asBoolean();
|
|
1885
|
+
}
|
|
1886
|
+
else if (!isNaN(value) && typeof value === 'number') {
|
|
1887
|
+
return column.asNumber();
|
|
1888
|
+
}
|
|
1889
|
+
else if (this._dateRegex.test(value)) {
|
|
1890
|
+
return column.asDate();
|
|
1891
|
+
}
|
|
1892
|
+
else {
|
|
1893
|
+
return column;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* converts string type to column type enum, default is string
|
|
1898
|
+
* @param property
|
|
1899
|
+
*/
|
|
1900
|
+
static toColumnType(property) {
|
|
1901
|
+
const os = ObjectSerializer.get();
|
|
1902
|
+
if (os.findEnum(property)) {
|
|
1903
|
+
property = 'enum';
|
|
1904
|
+
}
|
|
1905
|
+
else if (os.findType(property)) {
|
|
1906
|
+
property = 'class';
|
|
1907
|
+
}
|
|
1908
|
+
switch (property) {
|
|
1909
|
+
case 'number':
|
|
1910
|
+
return ColumnTypeEnum.Number;
|
|
1911
|
+
case 'currency':
|
|
1912
|
+
return ColumnTypeEnum.Currency;
|
|
1913
|
+
case 'boolean':
|
|
1914
|
+
return ColumnTypeEnum.Boolean;
|
|
1915
|
+
case 'date':
|
|
1916
|
+
return ColumnTypeEnum.Date;
|
|
1917
|
+
case 'enum':
|
|
1918
|
+
return ColumnTypeEnum.Enum;
|
|
1919
|
+
case 'custom':
|
|
1920
|
+
return ColumnTypeEnum.Custom;
|
|
1921
|
+
case 'class':
|
|
1922
|
+
return ColumnTypeEnum.String;
|
|
1923
|
+
case 'string':
|
|
1924
|
+
default:
|
|
1925
|
+
return ColumnTypeEnum.String;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* converts string type to type enum, default is text
|
|
1930
|
+
* @param property
|
|
1931
|
+
*/
|
|
1932
|
+
static toFieldInputType(property) {
|
|
1933
|
+
switch (property) {
|
|
1934
|
+
case 'hidden':
|
|
1935
|
+
return FieldInputTypeEnum.Hidden;
|
|
1936
|
+
case 'label':
|
|
1937
|
+
return FieldInputTypeEnum.Label;
|
|
1938
|
+
case 'textarea':
|
|
1939
|
+
return FieldInputTypeEnum.Textarea;
|
|
1940
|
+
case 'number':
|
|
1941
|
+
return FieldInputTypeEnum.Number;
|
|
1942
|
+
case 'currency':
|
|
1943
|
+
return FieldInputTypeEnum.Currency;
|
|
1944
|
+
case 'switch':
|
|
1945
|
+
case 'boolean':
|
|
1946
|
+
return FieldInputTypeEnum.Switch;
|
|
1947
|
+
case 'radio':
|
|
1948
|
+
return FieldInputTypeEnum.Radio;
|
|
1949
|
+
case 'datepicker':
|
|
1950
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1951
|
+
case 'mask':
|
|
1952
|
+
return FieldInputTypeEnum.Mask;
|
|
1953
|
+
case 'file':
|
|
1954
|
+
return FieldInputTypeEnum.File;
|
|
1955
|
+
case 'custom':
|
|
1956
|
+
return FieldInputTypeEnum.Custom;
|
|
1957
|
+
case 'text':
|
|
1958
|
+
default:
|
|
1959
|
+
return FieldInputTypeEnum.Text;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* convert column type to equivalent field input type
|
|
1964
|
+
* @param type column type
|
|
1965
|
+
*/
|
|
1966
|
+
static toFieldInputTypeFromColumnType(type) {
|
|
1967
|
+
switch (type) {
|
|
1968
|
+
case ColumnTypeEnum.Number:
|
|
1969
|
+
return FieldInputTypeEnum.Number;
|
|
1970
|
+
case ColumnTypeEnum.Currency:
|
|
1971
|
+
return FieldInputTypeEnum.Currency;
|
|
1972
|
+
case ColumnTypeEnum.Boolean:
|
|
1973
|
+
return FieldInputTypeEnum.Switch;
|
|
1974
|
+
case ColumnTypeEnum.Date:
|
|
1975
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1976
|
+
case ColumnTypeEnum.Custom:
|
|
1977
|
+
return FieldInputTypeEnum.Custom;
|
|
1978
|
+
case ColumnTypeEnum.String:
|
|
1979
|
+
case ColumnTypeEnum.Enum:
|
|
1980
|
+
default:
|
|
1981
|
+
return FieldInputTypeEnum.Text;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
TableviewUtil._dateRegex = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
|
|
1986
|
+
|
|
1671
1987
|
class FilterDescriptor {
|
|
1672
1988
|
constructor(property) {
|
|
1673
1989
|
this._filterType = FilterTypeEnum.String;
|
|
1674
1990
|
this._hasDefaultValue = false;
|
|
1675
|
-
this._defaultFilterMatchMode = FilterMatchModeEnum.Equals;
|
|
1676
1991
|
this._matchModes = null;
|
|
1677
1992
|
this._numberUseGrouping = true;
|
|
1678
1993
|
this._datePickerShowTime = false;
|
|
1994
|
+
this._datePickerValueWithTimezone = false;
|
|
1995
|
+
this._datePickerValueInUtc = false;
|
|
1679
1996
|
this._className = '';
|
|
1680
1997
|
this._columnClassName = '';
|
|
1681
1998
|
this._columnWidth = null;
|
|
@@ -1718,6 +2035,12 @@ class FilterDescriptor {
|
|
|
1718
2035
|
get datePickerShowTime() {
|
|
1719
2036
|
return this._datePickerShowTime;
|
|
1720
2037
|
}
|
|
2038
|
+
get datePickerValueInUtc() {
|
|
2039
|
+
return this._datePickerValueInUtc;
|
|
2040
|
+
}
|
|
2041
|
+
get datePickerValueWithTimezone() {
|
|
2042
|
+
return this._datePickerValueWithTimezone;
|
|
2043
|
+
}
|
|
1721
2044
|
get placeholder() {
|
|
1722
2045
|
return this._placeholder;
|
|
1723
2046
|
}
|
|
@@ -1748,13 +2071,11 @@ class FilterDescriptor {
|
|
|
1748
2071
|
this._filterProperty = filterProperty;
|
|
1749
2072
|
return this;
|
|
1750
2073
|
}
|
|
1751
|
-
withDefaultFilter(filterValue, filterValueTo, filterMatchMode
|
|
2074
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
1752
2075
|
this._hasDefaultValue = true;
|
|
1753
2076
|
this._defaultValue = filterValue;
|
|
1754
2077
|
this._defaultValueTo = filterValueTo;
|
|
1755
|
-
|
|
1756
|
-
this._defaultFilterMatchMode = filterMatchMode;
|
|
1757
|
-
}
|
|
2078
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
1758
2079
|
return this;
|
|
1759
2080
|
}
|
|
1760
2081
|
withNumberFractions(min, max) {
|
|
@@ -1771,6 +2092,15 @@ class FilterDescriptor {
|
|
|
1771
2092
|
this._datePickerShowTime = showTime;
|
|
1772
2093
|
return this;
|
|
1773
2094
|
}
|
|
2095
|
+
withDateValue(inUtc, withTimezone) {
|
|
2096
|
+
if (typeof inUtc !== 'undefined') {
|
|
2097
|
+
this._datePickerValueInUtc = inUtc;
|
|
2098
|
+
}
|
|
2099
|
+
if (typeof withTimezone !== 'undefined') {
|
|
2100
|
+
this._datePickerValueWithTimezone = withTimezone;
|
|
2101
|
+
}
|
|
2102
|
+
return this;
|
|
2103
|
+
}
|
|
1774
2104
|
withPlaceholder(placeholder) {
|
|
1775
2105
|
this._placeholder = placeholder;
|
|
1776
2106
|
return this;
|
|
@@ -1809,6 +2139,8 @@ class FilterDescriptor {
|
|
|
1809
2139
|
descriptor._numberUseGrouping = this._numberUseGrouping;
|
|
1810
2140
|
descriptor._datePickerFormat = this._datePickerFormat;
|
|
1811
2141
|
descriptor._datePickerShowTime = this._datePickerShowTime;
|
|
2142
|
+
descriptor._datePickerValueInUtc = this._datePickerValueInUtc;
|
|
2143
|
+
descriptor._datePickerValueWithTimezone = this._datePickerValueWithTimezone;
|
|
1812
2144
|
descriptor._placeholder = this._placeholder;
|
|
1813
2145
|
descriptor._className = this._className;
|
|
1814
2146
|
descriptor._columnWidth = this._columnWidth;
|
|
@@ -1901,6 +2233,16 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1901
2233
|
this._dropdownClassName = dropdownClassName;
|
|
1902
2234
|
return this;
|
|
1903
2235
|
}
|
|
2236
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
2237
|
+
this._hasDefaultValue = true;
|
|
2238
|
+
this._defaultValue = filterValue;
|
|
2239
|
+
this._defaultValueTo = filterValueTo;
|
|
2240
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
2241
|
+
if (Array.isArray(filterValue) && !this.multiselect) {
|
|
2242
|
+
throw new Error('Array default filter can only be used with a multiselect filter.');
|
|
2243
|
+
}
|
|
2244
|
+
return this;
|
|
2245
|
+
}
|
|
1904
2246
|
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
1905
2247
|
this._lookupType = FilterLookupTypeEnum.Autocomplete;
|
|
1906
2248
|
this._autocompleteOpenOnFocus = openOnFocus;
|
|
@@ -2060,9 +2402,29 @@ class ColumnDescriptor {
|
|
|
2060
2402
|
get getter() {
|
|
2061
2403
|
return this._getter;
|
|
2062
2404
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2405
|
+
/**
|
|
2406
|
+
* converts column to given type with additional arguments
|
|
2407
|
+
* @param type column type enum
|
|
2408
|
+
* @param args any additional arguments for column (optional)
|
|
2409
|
+
*/
|
|
2410
|
+
asType(type, ...args) {
|
|
2411
|
+
switch (type) {
|
|
2412
|
+
case ColumnTypeEnum.Number:
|
|
2413
|
+
return this.asNumber(...args);
|
|
2414
|
+
case ColumnTypeEnum.Currency:
|
|
2415
|
+
return this.asCurrency(...args);
|
|
2416
|
+
case ColumnTypeEnum.Boolean:
|
|
2417
|
+
return this.asBoolean(...args);
|
|
2418
|
+
case ColumnTypeEnum.Date:
|
|
2419
|
+
return this.asDate(...args);
|
|
2420
|
+
case ColumnTypeEnum.Enum:
|
|
2421
|
+
return this.asEnum(args[0], args[1], args[2]);
|
|
2422
|
+
case ColumnTypeEnum.Custom:
|
|
2423
|
+
return this.asCustomComponent(args[0]);
|
|
2424
|
+
case ColumnTypeEnum.String:
|
|
2425
|
+
default:
|
|
2426
|
+
return this;
|
|
2427
|
+
}
|
|
2066
2428
|
}
|
|
2067
2429
|
asNumber(displayFormat = '1.0-0', locale) {
|
|
2068
2430
|
this._columnType = ColumnTypeEnum.Number;
|
|
@@ -2137,6 +2499,7 @@ class ColumnDescriptor {
|
|
|
2137
2499
|
return this;
|
|
2138
2500
|
}
|
|
2139
2501
|
withFilter(forceSimple = false) {
|
|
2502
|
+
var _a, _b, _c;
|
|
2140
2503
|
this._filterDescriptor = new FilterDescriptor(this._property);
|
|
2141
2504
|
let filterType;
|
|
2142
2505
|
if (!forceSimple && this._objectModelType) {
|
|
@@ -2144,6 +2507,7 @@ class ColumnDescriptor {
|
|
|
2144
2507
|
}
|
|
2145
2508
|
switch (this._columnType) {
|
|
2146
2509
|
case ColumnTypeEnum.Number:
|
|
2510
|
+
case ColumnTypeEnum.Currency:
|
|
2147
2511
|
filterType = FilterTypeEnum.Number;
|
|
2148
2512
|
break;
|
|
2149
2513
|
case ColumnTypeEnum.Boolean:
|
|
@@ -2167,6 +2531,19 @@ class ColumnDescriptor {
|
|
|
2167
2531
|
break;
|
|
2168
2532
|
}
|
|
2169
2533
|
this._filterDescriptor.asFilterType(filterType);
|
|
2534
|
+
if (filterType === FilterTypeEnum.Number) {
|
|
2535
|
+
const displayFormatFractions = (_c = (_b = (_a = this._displayFormat) === null || _a === void 0 ? void 0 : _a.split('.')) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.split('-');
|
|
2536
|
+
if (displayFormatFractions && displayFormatFractions.length > 2) {
|
|
2537
|
+
this._filterDescriptor.withNumberFractions(parseInt(displayFormatFractions[0]), parseInt(displayFormatFractions[1]));
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
else if (filterType === FilterTypeEnum.Date) {
|
|
2541
|
+
const displayFormat = this._displayFormat;
|
|
2542
|
+
if (displayFormat) {
|
|
2543
|
+
const filterDisplayFormat = DateUtil.fromPrimeToAngularDateFormat(displayFormat);
|
|
2544
|
+
this._filterDescriptor.withDateFormat(filterDisplayFormat);
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2170
2547
|
return this._filterDescriptor;
|
|
2171
2548
|
}
|
|
2172
2549
|
withFilterLookup() {
|
|
@@ -2204,34 +2581,90 @@ class ColumnDescriptor {
|
|
|
2204
2581
|
return this;
|
|
2205
2582
|
}
|
|
2206
2583
|
copy() {
|
|
2207
|
-
var _a;
|
|
2208
2584
|
const descriptor = new ColumnDescriptor(this._table, this._property);
|
|
2209
|
-
|
|
2585
|
+
this.copyFieldsTo(descriptor);
|
|
2586
|
+
return descriptor;
|
|
2587
|
+
}
|
|
2588
|
+
copyFieldsTo(obj) {
|
|
2589
|
+
var _a;
|
|
2590
|
+
obj._jsonPath = this._jsonPath;
|
|
2591
|
+
obj._title = this._title;
|
|
2592
|
+
obj._isSortEnabled = this._isSortEnabled;
|
|
2593
|
+
obj._columnType = this._columnType;
|
|
2594
|
+
obj._filterDescriptor = (_a = this._filterDescriptor) === null || _a === void 0 ? void 0 : _a.copy();
|
|
2595
|
+
obj._enumType = this._enumType;
|
|
2596
|
+
obj._enumTitlePath = this._enumTitlePath;
|
|
2597
|
+
obj._enumNameAsValue = this._enumNameAsValue;
|
|
2598
|
+
obj._booleanAsIcon = this._booleanAsIcon;
|
|
2599
|
+
obj._booleanYes = this._booleanYes;
|
|
2600
|
+
obj._booleanNo = this._booleanNo;
|
|
2601
|
+
obj._objectModelType = this._objectModelType;
|
|
2602
|
+
obj._objectTitleProperty = this._objectTitleProperty;
|
|
2603
|
+
obj._locale = this._locale;
|
|
2604
|
+
obj._currencyCode = this._currencyCode;
|
|
2605
|
+
obj._currencyDisplay = this._currencyDisplay;
|
|
2606
|
+
obj._currencyFromProperty = this._currencyFromProperty;
|
|
2607
|
+
obj._displayFormat = this._displayFormat;
|
|
2608
|
+
obj._headerClassName = this._headerClassName;
|
|
2609
|
+
obj._className = this._className;
|
|
2610
|
+
obj._width = this._width;
|
|
2611
|
+
obj._minWidth = this._minWidth;
|
|
2612
|
+
obj._maxWidth = this._maxWidth;
|
|
2613
|
+
obj._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2614
|
+
obj._template = this._template;
|
|
2615
|
+
obj._getter = this._getter;
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
2619
|
+
// private _filterStatus;
|
|
2620
|
+
constructor(table, property) {
|
|
2621
|
+
super(table, property);
|
|
2622
|
+
this._visibility = true;
|
|
2623
|
+
this._table = table;
|
|
2624
|
+
}
|
|
2625
|
+
get visibility() {
|
|
2626
|
+
return this._visibility;
|
|
2627
|
+
}
|
|
2628
|
+
/**
|
|
2629
|
+
* sets column's title and returns this column
|
|
2630
|
+
* @param title title to be set
|
|
2631
|
+
* @param override should column title if all ready set?
|
|
2632
|
+
*/
|
|
2633
|
+
withTitle(title, override = false) {
|
|
2634
|
+
if (this._title == null || override) {
|
|
2635
|
+
this._title = title;
|
|
2636
|
+
}
|
|
2637
|
+
return this;
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* defines automatic type and returns this column
|
|
2641
|
+
* @param value
|
|
2642
|
+
*/
|
|
2643
|
+
withAutomaticType(value) {
|
|
2644
|
+
TableviewUtil.stringColumnConverter(this, value);
|
|
2645
|
+
return this;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* sets visibility state for column and returns this column
|
|
2649
|
+
* @param visibility
|
|
2650
|
+
*/
|
|
2651
|
+
withVisibility(visibility) {
|
|
2652
|
+
this._visibility = visibility;
|
|
2653
|
+
return this;
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* creates deep copy of column dynamic descriptor
|
|
2657
|
+
*/
|
|
2658
|
+
copy() {
|
|
2659
|
+
const descriptor = new ColumnDynamicDescriptor(this._table, this._property);
|
|
2660
|
+
this.copyFieldsTo(descriptor);
|
|
2210
2661
|
descriptor._title = this._title;
|
|
2211
|
-
descriptor.
|
|
2212
|
-
descriptor
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
descriptor
|
|
2216
|
-
|
|
2217
|
-
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2218
|
-
descriptor._booleanYes = this._booleanYes;
|
|
2219
|
-
descriptor._booleanNo = this._booleanNo;
|
|
2220
|
-
descriptor._objectModelType = this._objectModelType;
|
|
2221
|
-
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
2222
|
-
descriptor._locale = this._locale;
|
|
2223
|
-
descriptor._currencyCode = this._currencyCode;
|
|
2224
|
-
descriptor._currencyDisplay = this._currencyDisplay;
|
|
2225
|
-
descriptor._currencyFromProperty = this._currencyFromProperty;
|
|
2226
|
-
descriptor._displayFormat = this._displayFormat;
|
|
2227
|
-
descriptor._headerClassName = this._headerClassName;
|
|
2228
|
-
descriptor._className = this._className;
|
|
2229
|
-
descriptor._width = this._width;
|
|
2230
|
-
descriptor._minWidth = this._minWidth;
|
|
2231
|
-
descriptor._maxWidth = this._maxWidth;
|
|
2232
|
-
descriptor._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2233
|
-
descriptor._template = this._template;
|
|
2234
|
-
descriptor._getter = this._getter;
|
|
2662
|
+
descriptor._visibility = this._visibility;
|
|
2663
|
+
return descriptor;
|
|
2664
|
+
}
|
|
2665
|
+
toColumnDescriptor(tableDescriptor) {
|
|
2666
|
+
const descriptor = new ColumnDescriptor(tableDescriptor, this._property);
|
|
2667
|
+
this.copyFieldsTo(descriptor);
|
|
2235
2668
|
return descriptor;
|
|
2236
2669
|
}
|
|
2237
2670
|
}
|
|
@@ -2242,9 +2675,37 @@ class EditorDescriptor {
|
|
|
2242
2675
|
this._groups = [];
|
|
2243
2676
|
this._fields = [];
|
|
2244
2677
|
this._disabled = false;
|
|
2678
|
+
this._modelType = modelType;
|
|
2245
2679
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2246
2680
|
this._tableviewEditorType = tableviewEditorType;
|
|
2247
2681
|
}
|
|
2682
|
+
/**
|
|
2683
|
+
* auto generated editor descriptor based on openapi definition
|
|
2684
|
+
* generates all fields from definition
|
|
2685
|
+
* @param modelType class type
|
|
2686
|
+
* @param idProperty
|
|
2687
|
+
* @param titleProperty
|
|
2688
|
+
* @param tableEditorType
|
|
2689
|
+
*/
|
|
2690
|
+
static from(modelType, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2691
|
+
return EditorDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), titleProperty, idProperty, tableEditorType);
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* auto generated editor descriptor based on openapi definition
|
|
2695
|
+
* generates only selected fields
|
|
2696
|
+
* @param modelType class type
|
|
2697
|
+
* @param attributes list of selected properties to generate fields based on
|
|
2698
|
+
* @param idProperty
|
|
2699
|
+
* @param titleProperty
|
|
2700
|
+
* @param tableEditorType
|
|
2701
|
+
*/
|
|
2702
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2703
|
+
const descriptor = new EditorDescriptor(modelType, idProperty, titleProperty, tableEditorType);
|
|
2704
|
+
attributes
|
|
2705
|
+
.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array'))
|
|
2706
|
+
.forEach(attr => descriptor.upsertFieldFromAttributeDef(attr, descriptor.fields.find(col => col.property === attr.name)));
|
|
2707
|
+
return descriptor;
|
|
2708
|
+
}
|
|
2248
2709
|
get model() {
|
|
2249
2710
|
return this._model;
|
|
2250
2711
|
}
|
|
@@ -2292,20 +2753,23 @@ class EditorDescriptor {
|
|
|
2292
2753
|
this.addFieldDescriptor(field);
|
|
2293
2754
|
return field;
|
|
2294
2755
|
}
|
|
2756
|
+
/**
|
|
2757
|
+
* removes filed if exists in descriptor
|
|
2758
|
+
* @param property field name
|
|
2759
|
+
*/
|
|
2295
2760
|
removeField(property) {
|
|
2296
2761
|
const fieldIdx = this._fields.findIndex(f => f.property === property);
|
|
2297
2762
|
if (fieldIdx < 0) {
|
|
2298
2763
|
throw new Error(`Field ${property} does not exist.`);
|
|
2299
2764
|
}
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2302
|
-
const groupFieldIdx = field.group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2765
|
+
for (const group of this._groups) {
|
|
2766
|
+
const groupFieldIdx = group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2303
2767
|
if (groupFieldIdx >= 0) {
|
|
2304
|
-
|
|
2768
|
+
group.fields.splice(groupFieldIdx, 1);
|
|
2769
|
+
break;
|
|
2305
2770
|
}
|
|
2306
2771
|
}
|
|
2307
2772
|
this._fields.splice(fieldIdx, 1);
|
|
2308
|
-
return this;
|
|
2309
2773
|
}
|
|
2310
2774
|
getField(property) {
|
|
2311
2775
|
var _a;
|
|
@@ -2381,6 +2845,76 @@ class EditorDescriptor {
|
|
|
2381
2845
|
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
2382
2846
|
}
|
|
2383
2847
|
}
|
|
2848
|
+
/**
|
|
2849
|
+
* modifies selected field
|
|
2850
|
+
* do not use it for enums! (use withFieldModifiedEnum instead)
|
|
2851
|
+
* @param property field name
|
|
2852
|
+
* @param fieldType new field type for selected field
|
|
2853
|
+
* @param args additional parameters for field
|
|
2854
|
+
*/
|
|
2855
|
+
withFieldModifiedType(property, fieldType, ...args) {
|
|
2856
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(attribute => attribute.name === property);
|
|
2857
|
+
if (attribute) {
|
|
2858
|
+
attribute.fieldType = fieldType;
|
|
2859
|
+
this.upsertFieldFromAttributeDef(attribute, this.fields.find(fi => fi.property === property), ...args);
|
|
2860
|
+
}
|
|
2861
|
+
return this;
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* modifies selected field with enum type
|
|
2865
|
+
* @param property field property name
|
|
2866
|
+
* @param enumType type of enum for new field
|
|
2867
|
+
* @param optionsTitlePath
|
|
2868
|
+
* @param values
|
|
2869
|
+
* @param nameAsValue
|
|
2870
|
+
*/
|
|
2871
|
+
withFieldModifiedEnum(property, enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
2872
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(a => a.name === property);
|
|
2873
|
+
if (attribute) {
|
|
2874
|
+
attribute.fieldType = FieldInputTypeEnum.Radio;
|
|
2875
|
+
const field = this.fields.find(f => f.property === property);
|
|
2876
|
+
if (field && field instanceof FieldInputDescriptor) {
|
|
2877
|
+
field.asRadioFromEnum(enumType !== null && enumType !== void 0 ? enumType : ObjectSerializer.get().findEnum(attribute.type), optionsTitlePath, values, nameAsValue);
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
return this;
|
|
2881
|
+
}
|
|
2882
|
+
/**
|
|
2883
|
+
* adds lookup to given field
|
|
2884
|
+
* @param property field property name
|
|
2885
|
+
* @param modelType model type of field
|
|
2886
|
+
* @param lookupProvider provider to be added to field
|
|
2887
|
+
* @param titleProperty
|
|
2888
|
+
*/
|
|
2889
|
+
withFieldModifiedLookup(property, modelType, lookupProvider, titleProperty) {
|
|
2890
|
+
this.removeField(property);
|
|
2891
|
+
const field = this.addFieldLookup(property, modelType).asAutocomplete().withLookupDataProvider(lookupProvider);
|
|
2892
|
+
if (titleProperty) {
|
|
2893
|
+
field.withItemsLabelProperty(titleProperty);
|
|
2894
|
+
}
|
|
2895
|
+
return this;
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* generates field based on attribute definition, used for auto model
|
|
2899
|
+
* @param attribute definition
|
|
2900
|
+
* @param field optional, if defined will be replaced, otherwise new will be generated
|
|
2901
|
+
* @param args additional arguments
|
|
2902
|
+
*/
|
|
2903
|
+
upsertFieldFromAttributeDef(attribute, field, ...args) {
|
|
2904
|
+
var _a;
|
|
2905
|
+
if (field == null) {
|
|
2906
|
+
field = this.addField(attribute.name);
|
|
2907
|
+
}
|
|
2908
|
+
if (field instanceof FieldInputDescriptor) {
|
|
2909
|
+
if (attribute.enumType) {
|
|
2910
|
+
return field.asRadioFromEnum(attribute.enumType);
|
|
2911
|
+
}
|
|
2912
|
+
else {
|
|
2913
|
+
return field.asType((_a = attribute.fieldType) !== null && _a !== void 0 ? _a : TableviewUtil.toFieldInputTypeFromColumnType(attribute.columnType), ...args);
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
return field;
|
|
2917
|
+
}
|
|
2384
2918
|
}
|
|
2385
2919
|
EditorDescriptor.defaultGroupName = '_default';
|
|
2386
2920
|
|
|
@@ -2453,9 +2987,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
2453
2987
|
get property() {
|
|
2454
2988
|
return this._property;
|
|
2455
2989
|
}
|
|
2456
|
-
get group() {
|
|
2457
|
-
return this._group;
|
|
2458
|
-
}
|
|
2459
2990
|
get label() {
|
|
2460
2991
|
return this._label;
|
|
2461
2992
|
}
|
|
@@ -2619,6 +3150,39 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2619
3150
|
this._fileMultiple = false;
|
|
2620
3151
|
this._fileMaxFileSize = 500000;
|
|
2621
3152
|
}
|
|
3153
|
+
/**
|
|
3154
|
+
* converts field to given type with additional arguments
|
|
3155
|
+
* @param fieldType field type enum
|
|
3156
|
+
* @param args any additional arguments for field (optional)
|
|
3157
|
+
*/
|
|
3158
|
+
asType(fieldType, ...args) {
|
|
3159
|
+
switch (fieldType) {
|
|
3160
|
+
case FieldInputTypeEnum.Hidden:
|
|
3161
|
+
return this.asHidden();
|
|
3162
|
+
case FieldInputTypeEnum.Label:
|
|
3163
|
+
return this.asLabel();
|
|
3164
|
+
case FieldInputTypeEnum.Textarea:
|
|
3165
|
+
return this.asTextarea(...args);
|
|
3166
|
+
case FieldInputTypeEnum.Number:
|
|
3167
|
+
return this.asNumber();
|
|
3168
|
+
case FieldInputTypeEnum.Currency:
|
|
3169
|
+
return this.asCurrency(...args);
|
|
3170
|
+
case FieldInputTypeEnum.Switch:
|
|
3171
|
+
return this.asSwitch();
|
|
3172
|
+
case FieldInputTypeEnum.Radio:
|
|
3173
|
+
return this.asRadio(args[0], args[1]);
|
|
3174
|
+
case FieldInputTypeEnum.Datepicker:
|
|
3175
|
+
return this.asDatePicker(...args);
|
|
3176
|
+
case FieldInputTypeEnum.Mask:
|
|
3177
|
+
return this.asMask(args[0], args[1]);
|
|
3178
|
+
case FieldInputTypeEnum.File:
|
|
3179
|
+
return this.asFile(...args);
|
|
3180
|
+
case FieldInputTypeEnum.Custom:
|
|
3181
|
+
return this.asCustomComponent(args[0]);
|
|
3182
|
+
case FieldInputTypeEnum.Text:
|
|
3183
|
+
return this.asText();
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
2622
3186
|
get fieldType() {
|
|
2623
3187
|
return this._fieldType;
|
|
2624
3188
|
}
|
|
@@ -3153,6 +3717,10 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
3153
3717
|
this._name = `${this.baseName}${name}`;
|
|
3154
3718
|
this._default = name === EditorDescriptor.defaultGroupName;
|
|
3155
3719
|
}
|
|
3720
|
+
removeField(property, filterFunction) {
|
|
3721
|
+
this._fields = filterFunction(this._fields);
|
|
3722
|
+
return this._fields;
|
|
3723
|
+
}
|
|
3156
3724
|
get title() {
|
|
3157
3725
|
return this._title;
|
|
3158
3726
|
}
|
|
@@ -3304,9 +3872,33 @@ class TableDescriptor {
|
|
|
3304
3872
|
this._size = TableSizeEnum.Large;
|
|
3305
3873
|
this._hasHover = true;
|
|
3306
3874
|
this._hasGridlines = false;
|
|
3875
|
+
this._autoGenerated = false;
|
|
3876
|
+
this._modelType = modelType;
|
|
3307
3877
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3308
3878
|
this._dataKeyProperty = (_a = idProperty !== null && idProperty !== void 0 ? idProperty : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : undefined;
|
|
3309
3879
|
}
|
|
3880
|
+
/**
|
|
3881
|
+
* generates descriptor based on modelType attribute definition
|
|
3882
|
+
* @param modelType class type
|
|
3883
|
+
* @param idProperty
|
|
3884
|
+
* @param titleProperty
|
|
3885
|
+
*/
|
|
3886
|
+
static from(modelType, idProperty, titleProperty) {
|
|
3887
|
+
return TableDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), idProperty, titleProperty);
|
|
3888
|
+
}
|
|
3889
|
+
/**
|
|
3890
|
+
* generates descriptor base on given attribute definition
|
|
3891
|
+
* @param modelType class type
|
|
3892
|
+
* @param attributes attributes from which descriptor is generated
|
|
3893
|
+
* @param idProperty
|
|
3894
|
+
* @param titleProperty
|
|
3895
|
+
*/
|
|
3896
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty) {
|
|
3897
|
+
const descriptor = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3898
|
+
descriptor._autoGenerated = true;
|
|
3899
|
+
attributes.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array')).forEach(attr => descriptor.upsertColumnFromAttributeDef(attr));
|
|
3900
|
+
return descriptor;
|
|
3901
|
+
}
|
|
3310
3902
|
get filterDisplay() {
|
|
3311
3903
|
return this._filterDisplay;
|
|
3312
3904
|
}
|
|
@@ -3361,6 +3953,18 @@ class TableDescriptor {
|
|
|
3361
3953
|
get hasGridlines() {
|
|
3362
3954
|
return this._hasGridlines;
|
|
3363
3955
|
}
|
|
3956
|
+
get rowClassName() {
|
|
3957
|
+
return this._rowClassName;
|
|
3958
|
+
}
|
|
3959
|
+
get rowClassNameMapFn() {
|
|
3960
|
+
return this._rowClassNameMapFn;
|
|
3961
|
+
}
|
|
3962
|
+
get headerClassName() {
|
|
3963
|
+
return this._headerClassName;
|
|
3964
|
+
}
|
|
3965
|
+
getColumn(property) {
|
|
3966
|
+
return this._columns.find(col => col.property === property);
|
|
3967
|
+
}
|
|
3364
3968
|
addColumnDescriptor(column) {
|
|
3365
3969
|
this._columns.push(column);
|
|
3366
3970
|
return this;
|
|
@@ -3400,6 +4004,10 @@ class TableDescriptor {
|
|
|
3400
4004
|
this._columns.push(column);
|
|
3401
4005
|
return column;
|
|
3402
4006
|
}
|
|
4007
|
+
removeColumn(property) {
|
|
4008
|
+
const columndIdx = this._columns.findIndex(c => c.property === property);
|
|
4009
|
+
this._columns.splice(columndIdx, 1);
|
|
4010
|
+
}
|
|
3403
4011
|
withFilterDisplay(filterDisplayType) {
|
|
3404
4012
|
this._filterDisplay = filterDisplayType;
|
|
3405
4013
|
return this;
|
|
@@ -3446,44 +4054,271 @@ class TableDescriptor {
|
|
|
3446
4054
|
this._size = size;
|
|
3447
4055
|
return this;
|
|
3448
4056
|
}
|
|
3449
|
-
withTableFullHeightOffset(tableFullHeightOffset) {
|
|
3450
|
-
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
4057
|
+
withTableFullHeightOffset(tableFullHeightOffset) {
|
|
4058
|
+
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
4059
|
+
return this;
|
|
4060
|
+
}
|
|
4061
|
+
withRowHeight(rowHeight) {
|
|
4062
|
+
this._rowHeight = rowHeight;
|
|
4063
|
+
return this;
|
|
4064
|
+
}
|
|
4065
|
+
withHover(hover) {
|
|
4066
|
+
this._hasHover = hover;
|
|
4067
|
+
return this;
|
|
4068
|
+
}
|
|
4069
|
+
withGridlines(gridlines) {
|
|
4070
|
+
this._hasGridlines = gridlines;
|
|
4071
|
+
return this;
|
|
4072
|
+
}
|
|
4073
|
+
withRowClassName(rowClassName, classNameMapFn) {
|
|
4074
|
+
this._rowClassName = rowClassName;
|
|
4075
|
+
this._rowClassNameMapFn = classNameMapFn;
|
|
4076
|
+
return this;
|
|
4077
|
+
}
|
|
4078
|
+
withHeaderClassName(headerClassName) {
|
|
4079
|
+
this._headerClassName = headerClassName;
|
|
4080
|
+
return this;
|
|
4081
|
+
}
|
|
4082
|
+
copyFieldsTo(obj) {
|
|
4083
|
+
obj._title = this._title;
|
|
4084
|
+
obj._hideHeader = this._hideHeader;
|
|
4085
|
+
obj._dataKeyProperty = this._dataKeyProperty;
|
|
4086
|
+
obj._hasDefaultSort = this._hasDefaultSort;
|
|
4087
|
+
obj._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
4088
|
+
obj._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
4089
|
+
obj._filterDisplay = this._filterDisplay;
|
|
4090
|
+
obj._className = this._className;
|
|
4091
|
+
obj._size = this._size;
|
|
4092
|
+
obj._tableFullHeightOffset = this._tableFullHeightOffset;
|
|
4093
|
+
obj._rowHeight = this._rowHeight;
|
|
4094
|
+
obj._hasHover = this._hasHover;
|
|
4095
|
+
obj._hasGridlines = this._hasGridlines;
|
|
4096
|
+
}
|
|
4097
|
+
copy() {
|
|
4098
|
+
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
4099
|
+
this.copyFieldsTo(descriptor);
|
|
4100
|
+
descriptor._columns = this.columns.map(c => c.copy());
|
|
4101
|
+
return descriptor;
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* generates column based on attributes
|
|
4105
|
+
* @param attribute attribute map
|
|
4106
|
+
* @param column if provided, replaced by new, otherwise new is created
|
|
4107
|
+
* @param args additional parameters
|
|
4108
|
+
*/
|
|
4109
|
+
upsertColumnFromAttributeDef(attribute, column, ...args) {
|
|
4110
|
+
if (column == null) {
|
|
4111
|
+
column = this.addColumn(attribute.name);
|
|
4112
|
+
}
|
|
4113
|
+
if (attribute.columnType === ColumnTypeEnum.Enum && args.length === 0) {
|
|
4114
|
+
args = [attribute.enumType];
|
|
4115
|
+
}
|
|
4116
|
+
column = column.asType(attribute.columnType, ...args);
|
|
4117
|
+
if (attribute.classType) {
|
|
4118
|
+
column.withObjectProperty(attribute.classType).withSort();
|
|
4119
|
+
}
|
|
4120
|
+
else {
|
|
4121
|
+
column.withSort().withFilter();
|
|
4122
|
+
}
|
|
4123
|
+
return column;
|
|
4124
|
+
}
|
|
4125
|
+
/**
|
|
4126
|
+
* defines modified type of column
|
|
4127
|
+
* DO NOT USE with enum (use withCustomEnumType)
|
|
4128
|
+
* @param property column name
|
|
4129
|
+
* @param columnType modified type
|
|
4130
|
+
* @param args additional attributes
|
|
4131
|
+
*/
|
|
4132
|
+
withColumnModifiedType(property, columnType, ...args) {
|
|
4133
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4134
|
+
if (attributeDef != null) {
|
|
4135
|
+
attributeDef.columnType = columnType !== null && columnType !== void 0 ? columnType : attributeDef.columnType;
|
|
4136
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === attributeDef.name), ...args);
|
|
4137
|
+
}
|
|
4138
|
+
return this;
|
|
4139
|
+
}
|
|
4140
|
+
/**
|
|
4141
|
+
* defines custom enum type for column
|
|
4142
|
+
* @param property column name
|
|
4143
|
+
* @param enumType
|
|
4144
|
+
*/
|
|
4145
|
+
withColumnModifiedEnum(property, enumType) {
|
|
4146
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4147
|
+
if (attributeDef != null) {
|
|
4148
|
+
attributeDef.columnType = ColumnTypeEnum.Enum;
|
|
4149
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === property), enumType !== null && enumType !== void 0 ? enumType : ObjectSerializer.get().findEnum(attributeDef.type));
|
|
4150
|
+
}
|
|
4151
|
+
return this;
|
|
4152
|
+
}
|
|
4153
|
+
/**
|
|
4154
|
+
* modifies column with class and lookup provider
|
|
4155
|
+
* @param property column name
|
|
4156
|
+
* @param lookupProvider lookupProvider for class
|
|
4157
|
+
* @param itemsLabelProperty
|
|
4158
|
+
* @param filterProperty
|
|
4159
|
+
*/
|
|
4160
|
+
withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty) {
|
|
4161
|
+
const column = this.columns.find(col => col.property === property);
|
|
4162
|
+
if (column) {
|
|
4163
|
+
column.withFilterLookup().withLookupDataProvider(lookupProvider);
|
|
4164
|
+
if (column instanceof FilterLookupDescriptor) {
|
|
4165
|
+
if (itemsLabelProperty) {
|
|
4166
|
+
column.withItemsLabelProperty(itemsLabelProperty);
|
|
4167
|
+
}
|
|
4168
|
+
if (filterProperty) {
|
|
4169
|
+
column.withFilterProperty(filterProperty);
|
|
4170
|
+
}
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
return this;
|
|
4174
|
+
}
|
|
4175
|
+
}
|
|
4176
|
+
class TableDynamicDescriptor extends TableDescriptor {
|
|
4177
|
+
constructor(idProperty, titleProperty) {
|
|
4178
|
+
super({}, idProperty, titleProperty);
|
|
4179
|
+
this._excludedColumns = [];
|
|
4180
|
+
this._filterColumns = [];
|
|
4181
|
+
this._sortColumns = [];
|
|
4182
|
+
this._sortColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4183
|
+
this._filterColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4184
|
+
this._columns = [];
|
|
4185
|
+
this.withTitle('Dynamic table');
|
|
4186
|
+
}
|
|
4187
|
+
get columns() {
|
|
4188
|
+
return this._columns;
|
|
4189
|
+
}
|
|
4190
|
+
/**
|
|
4191
|
+
* defines excluded columns when generating descriptor
|
|
4192
|
+
* @param excludedColumn names of excluded columns
|
|
4193
|
+
*/
|
|
4194
|
+
withColumnsExcluded(excludedColumn) {
|
|
4195
|
+
this._excludedColumns = excludedColumn;
|
|
4196
|
+
return this;
|
|
4197
|
+
}
|
|
4198
|
+
/**
|
|
4199
|
+
* defines column properties on which sort is defined or not depending on sortColumnMode
|
|
4200
|
+
* @param sortOnColumns column names
|
|
4201
|
+
* @param sortColumnMode INCLUDE_ONLY (default) only given columns will have sort, EXCLUDE given columns will NOT have sort
|
|
4202
|
+
*/
|
|
4203
|
+
withColumnsSort(sortOnColumns, sortColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4204
|
+
this._sortColumnMode = sortColumnMode;
|
|
4205
|
+
this._sortColumns = sortOnColumns;
|
|
4206
|
+
return this;
|
|
4207
|
+
}
|
|
4208
|
+
/**
|
|
4209
|
+
* defines column properties on which filter is defined or not depending on filterColumnMode
|
|
4210
|
+
* @param filterOnColumn column names
|
|
4211
|
+
* @param filterColumnMode INCLUDE_ONLY (default) only given columns will have filter, EXCLUDE given columns will NOT have filter
|
|
4212
|
+
*/
|
|
4213
|
+
withColumnsFilter(filterOnColumn, filterColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4214
|
+
this._filterColumnMode = filterColumnMode;
|
|
4215
|
+
this._filterColumns = filterOnColumn;
|
|
3451
4216
|
return this;
|
|
3452
4217
|
}
|
|
3453
|
-
|
|
3454
|
-
|
|
4218
|
+
/**
|
|
4219
|
+
* sets given type to column with given property and returns this table
|
|
4220
|
+
* @param property column's property
|
|
4221
|
+
* @param type custom type for column
|
|
4222
|
+
* @param args addition arguments for column
|
|
4223
|
+
*/
|
|
4224
|
+
withColumnModifiedType(property, type, ...args) {
|
|
4225
|
+
var _a;
|
|
4226
|
+
const column = (_a = this._columns.find(col => property === col.property)) !== null && _a !== void 0 ? _a : this.addColumn(property).withTitle(property);
|
|
4227
|
+
if (column) {
|
|
4228
|
+
column.asType(type, ...args);
|
|
4229
|
+
}
|
|
3455
4230
|
return this;
|
|
3456
4231
|
}
|
|
3457
|
-
|
|
3458
|
-
|
|
4232
|
+
/**
|
|
4233
|
+
* sets title to column with given property and returns this table
|
|
4234
|
+
* @param property column's property
|
|
4235
|
+
* @param title column's title
|
|
4236
|
+
*/
|
|
4237
|
+
withColumnTitle(property, title) {
|
|
4238
|
+
var _a;
|
|
4239
|
+
const column = (_a = this._columns.find(col => property === col.property)) !== null && _a !== void 0 ? _a : this.addColumn(property);
|
|
4240
|
+
column.withTitle(title, true);
|
|
3459
4241
|
return this;
|
|
3460
4242
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
4243
|
+
/**
|
|
4244
|
+
* generates columns defined on table based on data fetched from api
|
|
4245
|
+
* @param data data from api
|
|
4246
|
+
*/
|
|
4247
|
+
toTableDescriptorFromData(data) {
|
|
4248
|
+
const tableDescriptor = this.toTableDescriptor();
|
|
4249
|
+
if (data.pageData == null || data.pageData.length == 0) {
|
|
4250
|
+
return tableDescriptor;
|
|
4251
|
+
}
|
|
4252
|
+
const objectModel = data.pageData[0];
|
|
4253
|
+
const entries = Object.entries(objectModel)
|
|
4254
|
+
.filter(([key]) => !this._excludedColumns.includes(key))
|
|
4255
|
+
.filter(([, value]) => !Array.isArray(value)); //exclude arrays and sets
|
|
4256
|
+
for (const [key, value] of entries) {
|
|
4257
|
+
const metaColumn = this._columns.find(col => col.property === key);
|
|
4258
|
+
let column;
|
|
4259
|
+
if (metaColumn) {
|
|
4260
|
+
if (!metaColumn.visibility) {
|
|
4261
|
+
continue;
|
|
4262
|
+
}
|
|
4263
|
+
column = metaColumn.toColumnDescriptor(tableDescriptor);
|
|
4264
|
+
tableDescriptor.addColumnDescriptor(column);
|
|
4265
|
+
}
|
|
4266
|
+
else {
|
|
4267
|
+
column = tableDescriptor.addColumn(key).withTitle(key);
|
|
4268
|
+
TableviewUtil.stringColumnConverter(column, value);
|
|
4269
|
+
}
|
|
4270
|
+
const elementOfSortColumns = this._sortColumns.includes(column.property);
|
|
4271
|
+
if ((this._sortColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfSortColumns) ||
|
|
4272
|
+
(this._sortColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfSortColumns)) {
|
|
4273
|
+
column.withSort();
|
|
4274
|
+
}
|
|
4275
|
+
const elementOfFilterColumns = this._filterColumns.includes(column.property);
|
|
4276
|
+
if ((this._filterColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfFilterColumns) ||
|
|
4277
|
+
(this._filterColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfFilterColumns)) {
|
|
4278
|
+
column.withFilter();
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
return tableDescriptor;
|
|
4282
|
+
}
|
|
4283
|
+
/**
|
|
4284
|
+
* adds ColumnDynamicDescriptor to this table
|
|
4285
|
+
* @param property column's property
|
|
4286
|
+
*/
|
|
4287
|
+
addColumn(property) {
|
|
4288
|
+
const column = new ColumnDynamicDescriptor(this, property);
|
|
4289
|
+
this._columns.push(column);
|
|
4290
|
+
return column;
|
|
4291
|
+
}
|
|
4292
|
+
removeColumn(property) {
|
|
4293
|
+
var _a;
|
|
4294
|
+
const column = (_a = this.columns.find(col => col.property === property)) !== null && _a !== void 0 ? _a : this.addColumn(property);
|
|
4295
|
+
column.withVisibility(false);
|
|
3463
4296
|
return this;
|
|
3464
4297
|
}
|
|
4298
|
+
/**
|
|
4299
|
+
* creates deep copy of table dynamic descriptor
|
|
4300
|
+
*/
|
|
3465
4301
|
copy() {
|
|
3466
|
-
const descriptor = new
|
|
4302
|
+
const descriptor = new TableDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4303
|
+
this.copyFieldsTo(descriptor);
|
|
3467
4304
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
3468
|
-
descriptor.
|
|
3469
|
-
descriptor.
|
|
3470
|
-
descriptor.
|
|
3471
|
-
descriptor.
|
|
3472
|
-
descriptor.
|
|
3473
|
-
descriptor
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
descriptor
|
|
3477
|
-
|
|
3478
|
-
descriptor._rowHeight = this._rowHeight;
|
|
3479
|
-
descriptor._hasHover = this._hasHover;
|
|
3480
|
-
descriptor._hasGridlines = this._hasGridlines;
|
|
4305
|
+
descriptor._excludedColumns = [...this._excludedColumns];
|
|
4306
|
+
descriptor._filterColumns = [...this._filterColumns];
|
|
4307
|
+
descriptor._sortColumns = [...this._sortColumns];
|
|
4308
|
+
descriptor._filterColumnMode = this._filterColumnMode;
|
|
4309
|
+
descriptor._sortColumnMode = this._sortColumnMode;
|
|
4310
|
+
return descriptor;
|
|
4311
|
+
}
|
|
4312
|
+
toTableDescriptor() {
|
|
4313
|
+
const descriptor = new TableDescriptor({}, this.model.idPropertyName, this.model.titlePropertyName);
|
|
4314
|
+
this.copyFieldsTo(descriptor);
|
|
3481
4315
|
return descriptor;
|
|
3482
4316
|
}
|
|
3483
4317
|
}
|
|
3484
4318
|
|
|
3485
4319
|
class TableviewDescriptor {
|
|
3486
4320
|
constructor(modelType, idProperty, titleProperty) {
|
|
4321
|
+
this._modelType = modelType;
|
|
3487
4322
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3488
4323
|
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3489
4324
|
this._viewEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.View);
|
|
@@ -3492,6 +4327,38 @@ class TableviewDescriptor {
|
|
|
3492
4327
|
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.Edit);
|
|
3493
4328
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
3494
4329
|
}
|
|
4330
|
+
/**
|
|
4331
|
+
* generates descriptor from attribute definition of openaapi model
|
|
4332
|
+
* @param modelType class type
|
|
4333
|
+
* @param idProperty
|
|
4334
|
+
* @param titleProperty
|
|
4335
|
+
*/
|
|
4336
|
+
static from(modelType, idProperty, titleProperty) {
|
|
4337
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4338
|
+
descriptor._table = TableDescriptor.from(modelType, idProperty, titleProperty);
|
|
4339
|
+
descriptor._editEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4340
|
+
descriptor._viewEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4341
|
+
descriptor._addEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4342
|
+
return descriptor;
|
|
4343
|
+
}
|
|
4344
|
+
/**
|
|
4345
|
+
* generates descriptor from given attribute definition
|
|
4346
|
+
* @param modelType class type
|
|
4347
|
+
* @param columnAttributes attribute definition to generate columns
|
|
4348
|
+
* @param fieldAttributes attribute definition to generate fields, if undefined columnDefinition is used, if null editors are not generated
|
|
4349
|
+
* @param idProperty
|
|
4350
|
+
* @param titleProperty
|
|
4351
|
+
*/
|
|
4352
|
+
static fromModelWithDefinition(modelType, columnAttributes, fieldAttributes, idProperty, titleProperty) {
|
|
4353
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4354
|
+
descriptor._table = TableDescriptor.fromModelWithAttributes(modelType, columnAttributes, idProperty, titleProperty);
|
|
4355
|
+
if (fieldAttributes !== null) {
|
|
4356
|
+
descriptor._editEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4357
|
+
descriptor._viewEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4358
|
+
descriptor._addEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4359
|
+
}
|
|
4360
|
+
return descriptor;
|
|
4361
|
+
}
|
|
3495
4362
|
get table() {
|
|
3496
4363
|
return this._table;
|
|
3497
4364
|
}
|
|
@@ -3514,6 +4381,12 @@ class TableviewDescriptor {
|
|
|
3514
4381
|
this._table = descriptor;
|
|
3515
4382
|
return this;
|
|
3516
4383
|
}
|
|
4384
|
+
withEditorDescriptors(descriptor) {
|
|
4385
|
+
this._viewEditor = descriptor;
|
|
4386
|
+
this._editEditor = descriptor;
|
|
4387
|
+
this._addEditor = descriptor;
|
|
4388
|
+
return this;
|
|
4389
|
+
}
|
|
3517
4390
|
withViewDescriptor(descriptor) {
|
|
3518
4391
|
this._viewEditor = descriptor;
|
|
3519
4392
|
return this;
|
|
@@ -3542,6 +4415,26 @@ class TableviewDescriptor {
|
|
|
3542
4415
|
addColumn(property) {
|
|
3543
4416
|
return this._table.addColumn(property);
|
|
3544
4417
|
}
|
|
4418
|
+
removeColumn(property) {
|
|
4419
|
+
this._table.removeColumn(property);
|
|
4420
|
+
}
|
|
4421
|
+
getField(property, editorType) {
|
|
4422
|
+
switch (editorType) {
|
|
4423
|
+
case TableviewTypeEnum.Edit:
|
|
4424
|
+
return this._editEditor.getField(property);
|
|
4425
|
+
case TableviewTypeEnum.Add:
|
|
4426
|
+
return this._addEditor.getField(property);
|
|
4427
|
+
case TableviewTypeEnum.View:
|
|
4428
|
+
return this._viewEditor.getField(property);
|
|
4429
|
+
case TableviewTypeEnum.None:
|
|
4430
|
+
return null;
|
|
4431
|
+
}
|
|
4432
|
+
}
|
|
4433
|
+
removeField(property) {
|
|
4434
|
+
this._editEditor.removeField(property);
|
|
4435
|
+
this._addEditor.removeField(property);
|
|
4436
|
+
this._viewEditor.removeField(property);
|
|
4437
|
+
}
|
|
3545
4438
|
addColumnNumber(property, displayFormat) {
|
|
3546
4439
|
return this._table.addColumnNumber(property, displayFormat);
|
|
3547
4440
|
}
|
|
@@ -3613,6 +4506,117 @@ class TableviewDescriptor {
|
|
|
3613
4506
|
tableview._editEditor = this._editEditor.copy();
|
|
3614
4507
|
return tableview;
|
|
3615
4508
|
}
|
|
4509
|
+
/**
|
|
4510
|
+
* creates column and field with custom type, for example currency
|
|
4511
|
+
* if field exists, it is replaced
|
|
4512
|
+
* DO NOT USE WITH TYPES WHERE ARGS ARE REQUIRED - ERROR WILL BE THROWN
|
|
4513
|
+
* for enum use withEnumType
|
|
4514
|
+
* for custom class use withClassType
|
|
4515
|
+
* @param property name of field
|
|
4516
|
+
* @param columnType required column type
|
|
4517
|
+
* @param fieldType optional, if not provided it is converted from column type
|
|
4518
|
+
*/
|
|
4519
|
+
withModifiedType(property, columnType, fieldType) {
|
|
4520
|
+
if (columnType === ColumnTypeEnum.Enum) {
|
|
4521
|
+
throw new Error('Do not use with types where args are required');
|
|
4522
|
+
}
|
|
4523
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4524
|
+
if (attributeDef != null) {
|
|
4525
|
+
fieldType !== null && fieldType !== void 0 ? fieldType : (fieldType = TableviewUtil.toFieldInputTypeFromColumnType(columnType));
|
|
4526
|
+
attributeDef.fieldType = fieldType;
|
|
4527
|
+
this._table.withColumnModifiedType(property, columnType);
|
|
4528
|
+
this._editEditor.withFieldModifiedType(property, fieldType);
|
|
4529
|
+
this._addEditor.withFieldModifiedType(property, fieldType);
|
|
4530
|
+
this._viewEditor.withFieldModifiedType(property, fieldType);
|
|
4531
|
+
}
|
|
4532
|
+
return this;
|
|
4533
|
+
}
|
|
4534
|
+
/**
|
|
4535
|
+
* creates column with enum type
|
|
4536
|
+
* if fields exists, it is replaced
|
|
4537
|
+
* @param property property name
|
|
4538
|
+
* @param enumType type of enum
|
|
4539
|
+
* @param fieldType type of field, optional, default is Text
|
|
4540
|
+
*/
|
|
4541
|
+
withModifiedEnum(property, enumType, fieldType) {
|
|
4542
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4543
|
+
if (attributeDef != null) {
|
|
4544
|
+
attributeDef.fieldType = fieldType !== null && fieldType !== void 0 ? fieldType : FieldInputTypeEnum.Text;
|
|
4545
|
+
this._table.withColumnModifiedEnum(property, enumType);
|
|
4546
|
+
this._editEditor.withFieldModifiedEnum(property, enumType);
|
|
4547
|
+
this._viewEditor.withFieldModifiedEnum(property, enumType);
|
|
4548
|
+
this._addEditor.withFieldModifiedEnum(property, enumType);
|
|
4549
|
+
}
|
|
4550
|
+
return this;
|
|
4551
|
+
}
|
|
4552
|
+
/**
|
|
4553
|
+
* generates column with custom class type
|
|
4554
|
+
* field is generated only if lookupProvider is provided
|
|
4555
|
+
* @param property property name
|
|
4556
|
+
* @param modelType class type of object
|
|
4557
|
+
* @param titleProperty
|
|
4558
|
+
* @param lookupProvider
|
|
4559
|
+
* @param itemsLabelProperty
|
|
4560
|
+
* @param filterProperty
|
|
4561
|
+
*/
|
|
4562
|
+
withModifiedLookup(property, modelType, lookupProvider, titleProperty, itemsLabelProperty, filterProperty) {
|
|
4563
|
+
var _a, _b, _c;
|
|
4564
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4565
|
+
if (attributeDef != null) {
|
|
4566
|
+
modelType !== null && modelType !== void 0 ? modelType : (modelType = (_a = attributeDef.classType) !== null && _a !== void 0 ? _a : ObjectSerializer.get().findType(attributeDef.type));
|
|
4567
|
+
titleProperty !== null && titleProperty !== void 0 ? titleProperty : (titleProperty = (_b = ModelUtil.findTitleAttribute(modelType)) !== null && _b !== void 0 ? _b : undefined);
|
|
4568
|
+
itemsLabelProperty !== null && itemsLabelProperty !== void 0 ? itemsLabelProperty : (itemsLabelProperty = titleProperty);
|
|
4569
|
+
attributeDef.columnType = ColumnTypeEnum.String;
|
|
4570
|
+
attributeDef.fieldType = FieldInputTypeEnum.Text;
|
|
4571
|
+
if (lookupProvider != null) {
|
|
4572
|
+
this._table.withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty);
|
|
4573
|
+
this._addEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4574
|
+
this._viewEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4575
|
+
this._editEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4576
|
+
}
|
|
4577
|
+
else {
|
|
4578
|
+
const column = (_c = this._table.getColumn(property)) !== null && _c !== void 0 ? _c : this.addColumn(property);
|
|
4579
|
+
column.withObjectProperty(modelType, titleProperty);
|
|
4580
|
+
}
|
|
4581
|
+
}
|
|
4582
|
+
return this;
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
class TableviewDynamicDescriptor extends TableviewDescriptor {
|
|
4586
|
+
constructor(idProperty, titleProperty) {
|
|
4587
|
+
super({}, idProperty, titleProperty);
|
|
4588
|
+
this._table = new TableDynamicDescriptor(idProperty, titleProperty);
|
|
4589
|
+
super._tableTitle = undefined;
|
|
4590
|
+
}
|
|
4591
|
+
get table() {
|
|
4592
|
+
return this._table;
|
|
4593
|
+
}
|
|
4594
|
+
/**
|
|
4595
|
+
* sets custom table descriptor
|
|
4596
|
+
* @param descriptor
|
|
4597
|
+
*/
|
|
4598
|
+
withTableDescriptor(descriptor) {
|
|
4599
|
+
this._table = descriptor;
|
|
4600
|
+
return this;
|
|
4601
|
+
}
|
|
4602
|
+
/**
|
|
4603
|
+
* sets visibility hidden state to column with given property
|
|
4604
|
+
* equals to be removing in auto and base tableview descriptor
|
|
4605
|
+
* * @param property column's property
|
|
4606
|
+
*/
|
|
4607
|
+
removeColumn(property) {
|
|
4608
|
+
this._table.removeColumn(property);
|
|
4609
|
+
return this;
|
|
4610
|
+
}
|
|
4611
|
+
/**
|
|
4612
|
+
* creates depp copy of tableview object and its children
|
|
4613
|
+
*/
|
|
4614
|
+
copy() {
|
|
4615
|
+
const descriptor = new TableviewDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4616
|
+
descriptor._table = this._table.copy();
|
|
4617
|
+
descriptor._tableTitle = this._tableTitle;
|
|
4618
|
+
return descriptor;
|
|
4619
|
+
}
|
|
3616
4620
|
}
|
|
3617
4621
|
|
|
3618
4622
|
class ButtonDescriptor {
|
|
@@ -4755,7 +5759,6 @@ ObjectSerializer._instance = new ObjectSerializer();
|
|
|
4755
5759
|
|
|
4756
5760
|
class MediusRestUtil {
|
|
4757
5761
|
static fromAngularQueryParamsToMediusQueryParams(params, filterDescriptors, defaultItemsPerPage = 10, defaultOffset = 0) {
|
|
4758
|
-
var _a;
|
|
4759
5762
|
const offset = params['first'] ? parseInt(params['first']) : defaultOffset;
|
|
4760
5763
|
const itemsPerPage = params['rows'] ? parseInt(params['rows']) : defaultItemsPerPage;
|
|
4761
5764
|
const mediusParamsBuilder = MediusQueryParamBuilder.create(itemsPerPage, offset);
|
|
@@ -4775,7 +5778,7 @@ class MediusRestUtil {
|
|
|
4775
5778
|
const operator = filterFieldSplit.length > 1 ? filterFieldSplit[1] : 'eq';
|
|
4776
5779
|
// prepare value
|
|
4777
5780
|
let value = filterFieldSplit.length > 2 ? filterFieldSplit.slice(2).join(':') : '';
|
|
4778
|
-
|
|
5781
|
+
let valueTo = undefined;
|
|
4779
5782
|
if (value.startsWith("'")) {
|
|
4780
5783
|
value = value.substring(1, value.length - 1);
|
|
4781
5784
|
}
|
|
@@ -4785,18 +5788,21 @@ class MediusRestUtil {
|
|
|
4785
5788
|
.split(',')
|
|
4786
5789
|
.map((v) => (v.startsWith("'") ? v.substring(1, v.length - 1) : v));
|
|
4787
5790
|
}
|
|
5791
|
+
if (operator === 'ft') {
|
|
5792
|
+
valueTo = value[1];
|
|
5793
|
+
value = value[0];
|
|
5794
|
+
}
|
|
4788
5795
|
const filterDescriptor = filterDescriptors.find(f => f.property === field);
|
|
4789
5796
|
const matchMode = MediusRestUtil.getMapping(operator, filterDescriptor === null || filterDescriptor === void 0 ? void 0 : filterDescriptor.filterType, 1);
|
|
4790
5797
|
if (matchMode && filterDescriptor) {
|
|
4791
|
-
|
|
4792
|
-
mediusParamsBuilder.withFilter(fieldFilterProperty, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
5798
|
+
mediusParamsBuilder.withFilter(filterDescriptor.property, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
4793
5799
|
}
|
|
4794
5800
|
}
|
|
4795
5801
|
}
|
|
4796
5802
|
return mediusParamsBuilder.build();
|
|
4797
5803
|
}
|
|
4798
5804
|
static fromPrimeLazyLoadEventToAngularQueryParams(event, defaultItemsPerPage = 10, defaultOffset = 0) {
|
|
4799
|
-
var _a, _b
|
|
5805
|
+
var _a, _b;
|
|
4800
5806
|
const params = {
|
|
4801
5807
|
first: null,
|
|
4802
5808
|
rows: null,
|
|
@@ -4809,8 +5815,8 @@ class MediusRestUtil {
|
|
|
4809
5815
|
if (event.rows && event.rows !== defaultItemsPerPage && event.rows > 0) {
|
|
4810
5816
|
params['rows'] = event.rows;
|
|
4811
5817
|
}
|
|
4812
|
-
if ((
|
|
4813
|
-
params['sort'] = (
|
|
5818
|
+
if ((_a = event.multiSortMeta) === null || _a === void 0 ? void 0 : _a.length) {
|
|
5819
|
+
params['sort'] = (_b = event.multiSortMeta) === null || _b === void 0 ? void 0 : _b.map(s => `${s.field}${s.order === 1 ? '' : ':desc'}`).join(',');
|
|
4814
5820
|
}
|
|
4815
5821
|
if (event.filters) {
|
|
4816
5822
|
const filters = [];
|
|
@@ -4828,11 +5834,21 @@ class MediusRestUtil {
|
|
|
4828
5834
|
doAddFilter = true;
|
|
4829
5835
|
}
|
|
4830
5836
|
else if (Array.isArray(value)) {
|
|
4831
|
-
|
|
5837
|
+
const joinedValue = value
|
|
5838
|
+
.map(v => {
|
|
5839
|
+
if (v instanceof Date) {
|
|
5840
|
+
// for query params, always convert to iso string, correct transformation will be done later
|
|
5841
|
+
return v.toISOString();
|
|
5842
|
+
}
|
|
5843
|
+
return v;
|
|
5844
|
+
})
|
|
5845
|
+
.join(',');
|
|
5846
|
+
value = `[${joinedValue}]`;
|
|
4832
5847
|
doAddFilter = true;
|
|
4833
5848
|
}
|
|
4834
5849
|
else if (value instanceof Date) {
|
|
4835
|
-
|
|
5850
|
+
// for query params, always convert to iso string, correct transformation will be done later
|
|
5851
|
+
value = value.toISOString();
|
|
4836
5852
|
doAddFilter = true;
|
|
4837
5853
|
}
|
|
4838
5854
|
if (doAddFilter) {
|
|
@@ -4846,6 +5862,50 @@ class MediusRestUtil {
|
|
|
4846
5862
|
}
|
|
4847
5863
|
return params;
|
|
4848
5864
|
}
|
|
5865
|
+
static modifyFilterProperties(mediusQueryParams, filterDescriptors) {
|
|
5866
|
+
var _a, _b;
|
|
5867
|
+
for (const filterParam of (_a = mediusQueryParams.filterParams) !== null && _a !== void 0 ? _a : []) {
|
|
5868
|
+
const filterDescriptor = filterDescriptors.find(f => f.property === filterParam.property);
|
|
5869
|
+
filterParam.property = (_b = filterDescriptor === null || filterDescriptor === void 0 ? void 0 : filterDescriptor.filterProperty) !== null && _b !== void 0 ? _b : filterParam.property;
|
|
5870
|
+
if ((filterDescriptor === null || filterDescriptor === void 0 ? void 0 : filterDescriptor.filterType) === FilterTypeEnum.Date) {
|
|
5871
|
+
if (filterParam.filterMatchType === MediusFilterMatchType.Equals) {
|
|
5872
|
+
// convert date equals filter to date range
|
|
5873
|
+
const filterDate = filterParam.filterValue;
|
|
5874
|
+
const startDate = new Date(filterDate);
|
|
5875
|
+
const endDate = new Date(startDate);
|
|
5876
|
+
if (filterDescriptor.datePickerShowTime) {
|
|
5877
|
+
startDate.setHours(startDate.getHours(), startDate.getMinutes(), 0, 0);
|
|
5878
|
+
endDate.setHours(endDate.getHours(), endDate.getMinutes() + 1, 0, 0);
|
|
5879
|
+
}
|
|
5880
|
+
else {
|
|
5881
|
+
startDate.setHours(0, 0, 0, 0);
|
|
5882
|
+
endDate.setHours(0, 0, 0, 0);
|
|
5883
|
+
endDate.setDate(endDate.getDate() + 1);
|
|
5884
|
+
}
|
|
5885
|
+
filterParam.filterMatchType = MediusFilterMatchType.FromTo;
|
|
5886
|
+
filterParam.filterValue = startDate;
|
|
5887
|
+
filterParam.filterValueTo = endDate;
|
|
5888
|
+
}
|
|
5889
|
+
// transform dates to correct iso string
|
|
5890
|
+
if (typeof filterParam.filterValue !== 'undefined') {
|
|
5891
|
+
if (Array.isArray(filterParam.filterValue)) {
|
|
5892
|
+
filterParam.filterValue = filterParam.filterValue.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc, filterDescriptor.datePickerValueWithTimezone));
|
|
5893
|
+
}
|
|
5894
|
+
else {
|
|
5895
|
+
filterParam.filterValue = DateUtil.toIsoString(filterParam.filterValue, filterDescriptor.datePickerValueInUtc, filterDescriptor.datePickerValueWithTimezone);
|
|
5896
|
+
}
|
|
5897
|
+
}
|
|
5898
|
+
if (typeof filterParam.filterValueTo !== 'undefined') {
|
|
5899
|
+
if (Array.isArray(filterParam.filterValueTo)) {
|
|
5900
|
+
filterParam.filterValueTo = filterParam.filterValueTo.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc, filterDescriptor.datePickerValueWithTimezone));
|
|
5901
|
+
}
|
|
5902
|
+
else {
|
|
5903
|
+
filterParam.filterValueTo = DateUtil.toIsoString(filterParam.filterValueTo, filterDescriptor.datePickerValueInUtc, filterDescriptor.datePickerValueWithTimezone);
|
|
5904
|
+
}
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
}
|
|
5908
|
+
}
|
|
4849
5909
|
static fromPrimeLazyLoadEventToMediusQueryParams(event) {
|
|
4850
5910
|
const queryParamBuilder = MediusQueryParamBuilder.create(event.rows, event.first);
|
|
4851
5911
|
// apply sorting
|
|
@@ -4900,7 +5960,8 @@ MediusRestUtil.matchModeMapping = [
|
|
|
4900
5960
|
[FilterMatchMode.STARTS_WITH, 'sw', MediusFilterMatchType.StartsWith, null],
|
|
4901
5961
|
[FilterMatchMode.IN, 'in', MediusFilterMatchType.In, null],
|
|
4902
5962
|
[FilterMatchMode.NOT_EQUALS, 'neq', MediusFilterMatchType.NotEquals, null],
|
|
4903
|
-
[FilterMatchMode.
|
|
5963
|
+
[FilterMatchMode.BETWEEN, 'ft', MediusFilterMatchType.FromTo, FilterTypeEnum.Date],
|
|
5964
|
+
[FilterMatchMode.DATE_IS, 'dteq', MediusFilterMatchType.Equals, FilterTypeEnum.Date],
|
|
4904
5965
|
[FilterMatchMode.DATE_BEFORE, 'lt', MediusFilterMatchType.SmallerThan, FilterTypeEnum.Date],
|
|
4905
5966
|
[FilterMatchMode.DATE_AFTER, 'gt', MediusFilterMatchType.GreaterThan, FilterTypeEnum.Date],
|
|
4906
5967
|
[FilterMatchMode.DATE_IS_NOT, 'neq', MediusFilterMatchType.NotEquals, FilterTypeEnum.Date]
|
|
@@ -5097,6 +6158,7 @@ class ActionParameters {
|
|
|
5097
6158
|
constructor(itemId, item) {
|
|
5098
6159
|
this.itemId = itemId;
|
|
5099
6160
|
this.item = item;
|
|
6161
|
+
this.selectedItems = [];
|
|
5100
6162
|
}
|
|
5101
6163
|
withActionData(actionData) {
|
|
5102
6164
|
this.actionData = actionData;
|
|
@@ -5118,6 +6180,10 @@ class ActionParameters {
|
|
|
5118
6180
|
this.route = route;
|
|
5119
6181
|
return this;
|
|
5120
6182
|
}
|
|
6183
|
+
withSelectedItems(selectedItems) {
|
|
6184
|
+
this.selectedItems = selectedItems;
|
|
6185
|
+
return this;
|
|
6186
|
+
}
|
|
5121
6187
|
}
|
|
5122
6188
|
var ActionInstanceStateEnum;
|
|
5123
6189
|
(function (ActionInstanceStateEnum) {
|
|
@@ -5141,6 +6207,17 @@ var ActionInstanceStateEnum;
|
|
|
5141
6207
|
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
5142
6208
|
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
5143
6209
|
|
|
6210
|
+
/**
|
|
6211
|
+
* Default categories for tableview actions
|
|
6212
|
+
*/
|
|
6213
|
+
class TableviewActionDefaultCategories {
|
|
6214
|
+
}
|
|
6215
|
+
TableviewActionDefaultCategories.READ = 'read';
|
|
6216
|
+
TableviewActionDefaultCategories.ADD = 'add';
|
|
6217
|
+
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
6218
|
+
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
6219
|
+
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
6220
|
+
|
|
5144
6221
|
class AuthorizationUtil {
|
|
5145
6222
|
static isPermitted(permissions, userRoles) {
|
|
5146
6223
|
switch (permissions.authorizationType) {
|
|
@@ -5597,6 +6674,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
5597
6674
|
}]
|
|
5598
6675
|
}], ctorParameters: function () { return [{ type: MngParametrizePipe }]; } });
|
|
5599
6676
|
|
|
6677
|
+
class MngClassMapPipe {
|
|
6678
|
+
transform(value, classNameMapFn, i) {
|
|
6679
|
+
if (classNameMapFn && typeof classNameMapFn === 'function') {
|
|
6680
|
+
return classNameMapFn(value, i);
|
|
6681
|
+
}
|
|
6682
|
+
else {
|
|
6683
|
+
return value !== null && value !== void 0 ? value : '';
|
|
6684
|
+
}
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6687
|
+
MngClassMapPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6688
|
+
MngClassMapPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, name: "mngClassMapPipe" });
|
|
6689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, decorators: [{
|
|
6690
|
+
type: Pipe,
|
|
6691
|
+
args: [{
|
|
6692
|
+
name: 'mngClassMapPipe',
|
|
6693
|
+
pure: true
|
|
6694
|
+
}]
|
|
6695
|
+
}] });
|
|
6696
|
+
|
|
5600
6697
|
class MngActionExecutorService {
|
|
5601
6698
|
constructor(injector, router, dialogService, confirmationService, translate, configurationService, navigationService, errorMapper, parametrize, defaultEditorDialogComponent) {
|
|
5602
6699
|
this.injector = injector;
|
|
@@ -6141,11 +7238,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6141
7238
|
} });
|
|
6142
7239
|
|
|
6143
7240
|
class MngCommonsService {
|
|
6144
|
-
constructor(router, primengConfig, translate, titleService, moduleConfig, localStorage) {
|
|
7241
|
+
constructor(router, primengConfig, translate, titleService, filterService, moduleConfig, localStorage) {
|
|
6145
7242
|
this.router = router;
|
|
6146
7243
|
this.primengConfig = primengConfig;
|
|
6147
7244
|
this.translate = translate;
|
|
6148
7245
|
this.titleService = titleService;
|
|
7246
|
+
this.filterService = filterService;
|
|
6149
7247
|
this.moduleConfig = moduleConfig;
|
|
6150
7248
|
this.localStorage = localStorage;
|
|
6151
7249
|
// menu
|
|
@@ -6311,7 +7409,7 @@ class MngCommonsService {
|
|
|
6311
7409
|
this.primengConfig.filterMatchModeOptions = {
|
|
6312
7410
|
text: [FilterMatchModeEnum.Contains, FilterMatchModeEnum.Equals, FilterMatchModeEnum.NotEquals, FilterMatchModeEnum.StartsWith, FilterMatchModeEnum.EndsWith],
|
|
6313
7411
|
numeric: [FilterMatchModeEnum.Equals, FilterMatchModeEnum.NotEquals, FilterMatchModeEnum.LessThan, FilterMatchModeEnum.GreaterThan],
|
|
6314
|
-
date: [FilterMatchModeEnum.DateIs, FilterMatchModeEnum.
|
|
7412
|
+
date: [FilterMatchModeEnum.DateIs, FilterMatchModeEnum.DateBefore, FilterMatchModeEnum.DateAfter, FilterMatchModeEnum.Between]
|
|
6315
7413
|
};
|
|
6316
7414
|
// translate
|
|
6317
7415
|
this.translate.langs = this.appLanguages;
|
|
@@ -6470,12 +7568,12 @@ class MngCommonsService {
|
|
|
6470
7568
|
return titlePieces.join(' - ');
|
|
6471
7569
|
}
|
|
6472
7570
|
}
|
|
6473
|
-
MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i1$2.TranslateService }, { token: i4.Title }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7571
|
+
MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i1$2.TranslateService }, { token: i4.Title }, { token: i2.FilterService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6474
7572
|
MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsService });
|
|
6475
7573
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsService, decorators: [{
|
|
6476
7574
|
type: Injectable
|
|
6477
7575
|
}], ctorParameters: function () {
|
|
6478
|
-
return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i1$2.TranslateService }, { type: i4.Title }, { type: undefined, decorators: [{
|
|
7576
|
+
return [{ type: i1.Router }, { type: i2.PrimeNGConfig }, { type: i1$2.TranslateService }, { type: i4.Title }, { type: i2.FilterService }, { type: undefined, decorators: [{
|
|
6479
7577
|
type: Inject,
|
|
6480
7578
|
args: [MNG_MODULE_CONFIG_IT]
|
|
6481
7579
|
}] }, { type: Storage, decorators: [{
|
|
@@ -6587,6 +7685,7 @@ class MngActionComponent {
|
|
|
6587
7685
|
this.isHostHidden = false;
|
|
6588
7686
|
this.inputDisabled = of(false);
|
|
6589
7687
|
this.inputLoading = of(false);
|
|
7688
|
+
this.selectedItems = [];
|
|
6590
7689
|
this.finishEventEmitter = new EventEmitter();
|
|
6591
7690
|
this.loadingSubject = new ReplaySubject(1);
|
|
6592
7691
|
this.$loading = this.loadingSubject.asObservable();
|
|
@@ -6635,8 +7734,11 @@ class MngActionComponent {
|
|
|
6635
7734
|
this.buttonClass = this.action.buttonDescriptor.styleClass.getButtonClass(this.hasNoTitle);
|
|
6636
7735
|
}
|
|
6637
7736
|
ngOnChanges(changes) {
|
|
6638
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6639
|
-
if (!((_b = (_a = changes['item']) === null || _a === void 0 ? void 0 : _a.firstChange) !== null && _b !== void 0 ? _b : true) ||
|
|
7737
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7738
|
+
if (!((_b = (_a = changes['item']) === null || _a === void 0 ? void 0 : _a.firstChange) !== null && _b !== void 0 ? _b : true) ||
|
|
7739
|
+
!((_d = (_c = changes['itemId']) === null || _c === void 0 ? void 0 : _c.firstChange) !== null && _d !== void 0 ? _d : true) ||
|
|
7740
|
+
!((_f = (_e = changes['actionData']) === null || _e === void 0 ? void 0 : _e.firstChange) !== null && _f !== void 0 ? _f : true) ||
|
|
7741
|
+
(this.action.hasItemsSelection && !((_h = (_g = changes['selectedItems']) === null || _g === void 0 ? void 0 : _g.firstChange) !== null && _h !== void 0 ? _h : true))) {
|
|
6640
7742
|
this.processSubscriptions();
|
|
6641
7743
|
}
|
|
6642
7744
|
}
|
|
@@ -6658,11 +7760,16 @@ class MngActionComponent {
|
|
|
6658
7760
|
.withQueryParam(this.queryParam)
|
|
6659
7761
|
.withRoute(this.route)
|
|
6660
7762
|
.withViewContainer(this.viewContainer)
|
|
6661
|
-
.withSourceComponent(this)
|
|
7763
|
+
.withSourceComponent(this)
|
|
7764
|
+
.withSelectedItems(this.selectedItems);
|
|
6662
7765
|
const instance = this.actionExecutor.triggerAction(this.action, parameters);
|
|
6663
7766
|
this.subscriptions.push(instance.result$.subscribe({
|
|
6664
7767
|
next: () => {
|
|
7768
|
+
var _a;
|
|
6665
7769
|
this.finishEventEmitter.next(instance);
|
|
7770
|
+
if (this.action.hasItemsSelection) {
|
|
7771
|
+
(_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.triggerTableReload({});
|
|
7772
|
+
}
|
|
6666
7773
|
}
|
|
6667
7774
|
}));
|
|
6668
7775
|
this.subscriptions.push(instance.error$.subscribe({
|
|
@@ -6688,6 +7795,9 @@ class MngActionComponent {
|
|
|
6688
7795
|
.withActionData(this.actionData)
|
|
6689
7796
|
.withViewContainer((_a = this.viewContainer) !== null && _a !== void 0 ? _a : undefined)
|
|
6690
7797
|
.withSourceComponent(this);
|
|
7798
|
+
if (this.action.hasItemsSelection) {
|
|
7799
|
+
parameters.withSelectedItems(this.selectedItems);
|
|
7800
|
+
}
|
|
6691
7801
|
const context = this.actionExecutor.prepareActionContextValidation(this.action, parameters, this.dataProvider);
|
|
6692
7802
|
if (typeof this.action.isVisibleFunction === 'function') {
|
|
6693
7803
|
(_b = this.isVisibleSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
@@ -6723,7 +7833,7 @@ class MngActionComponent {
|
|
|
6723
7833
|
}
|
|
6724
7834
|
}
|
|
6725
7835
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngAuthorizationService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6726
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7836
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6727
7837
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
6728
7838
|
type: Component,
|
|
6729
7839
|
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
@@ -6758,6 +7868,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6758
7868
|
}], viewContainerInit: [{
|
|
6759
7869
|
type: Input,
|
|
6760
7870
|
args: ['viewContainer']
|
|
7871
|
+
}], selectedItems: [{
|
|
7872
|
+
type: Input
|
|
6761
7873
|
}], finishEventEmitter: [{
|
|
6762
7874
|
type: Output,
|
|
6763
7875
|
args: ['finish']
|
|
@@ -7637,6 +8749,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
7637
8749
|
args: [Dropdown]
|
|
7638
8750
|
}] } });
|
|
7639
8751
|
|
|
8752
|
+
const MNG_DATE_RANGE_VALUE_ACCESSOR = {
|
|
8753
|
+
provide: NG_VALUE_ACCESSOR,
|
|
8754
|
+
useExisting: forwardRef(() => MngDateRangeComponent),
|
|
8755
|
+
multi: true
|
|
8756
|
+
};
|
|
8757
|
+
class MngDateRangeComponent {
|
|
8758
|
+
constructor(formBuilder) {
|
|
8759
|
+
this.formBuilder = formBuilder;
|
|
8760
|
+
this.showTime = false;
|
|
8761
|
+
this.showSeconds = false;
|
|
8762
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
8763
|
+
this.onChangeFn = () => { };
|
|
8764
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
8765
|
+
this.onTouchedFn = () => { };
|
|
8766
|
+
this.subscriptions = [];
|
|
8767
|
+
}
|
|
8768
|
+
get fromCtrl() {
|
|
8769
|
+
return this.fromToFormControl.get('from');
|
|
8770
|
+
}
|
|
8771
|
+
get toCtrl() {
|
|
8772
|
+
return this.fromToFormControl.get('to');
|
|
8773
|
+
}
|
|
8774
|
+
get dateRangeCtrl() {
|
|
8775
|
+
return this.fromToFormControl.get('dateRange');
|
|
8776
|
+
}
|
|
8777
|
+
ngOnInit() {
|
|
8778
|
+
this.fromToFormControl = this.formBuilder.group({
|
|
8779
|
+
from: [],
|
|
8780
|
+
to: [],
|
|
8781
|
+
dateRange: []
|
|
8782
|
+
});
|
|
8783
|
+
this.subscriptions.push(merge(this.fromCtrl.valueChanges, this.toCtrl.valueChanges, this.dateRangeCtrl.valueChanges).subscribe(() => this.onValueChange()));
|
|
8784
|
+
}
|
|
8785
|
+
ngOnDestroy() {
|
|
8786
|
+
this.subscriptions.forEach(value => value.unsubscribe());
|
|
8787
|
+
}
|
|
8788
|
+
registerOnChange(fn) {
|
|
8789
|
+
this.onChangeFn = fn;
|
|
8790
|
+
}
|
|
8791
|
+
registerOnTouched(fn) {
|
|
8792
|
+
this.onTouchedFn = fn;
|
|
8793
|
+
}
|
|
8794
|
+
setDisabledState(isDisabled) {
|
|
8795
|
+
if (isDisabled) {
|
|
8796
|
+
this.fromToFormControl.disable();
|
|
8797
|
+
}
|
|
8798
|
+
else {
|
|
8799
|
+
this.fromToFormControl.enable();
|
|
8800
|
+
}
|
|
8801
|
+
}
|
|
8802
|
+
writeValue(obj) {
|
|
8803
|
+
let startDate = null;
|
|
8804
|
+
let endDate = null;
|
|
8805
|
+
if (Array.isArray(obj)) {
|
|
8806
|
+
if (obj.length > 0 && (obj[0] instanceof Date || typeof obj[0] === 'string' || typeof obj[0] === 'number')) {
|
|
8807
|
+
startDate = new Date(obj[0]);
|
|
8808
|
+
}
|
|
8809
|
+
if (obj.length > 1 && (obj[1] instanceof Date || typeof obj[1] === 'string' || typeof obj[1] === 'number')) {
|
|
8810
|
+
endDate = new Date(obj[1]);
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
else if (obj instanceof Date || typeof obj === 'string' || typeof obj === 'number') {
|
|
8814
|
+
startDate = new Date(obj);
|
|
8815
|
+
}
|
|
8816
|
+
if (this.showTime) {
|
|
8817
|
+
this.fromCtrl.setValue(startDate);
|
|
8818
|
+
this.toCtrl.setValue(endDate);
|
|
8819
|
+
}
|
|
8820
|
+
else {
|
|
8821
|
+
this.dateRangeCtrl.setValue([startDate, endDate]);
|
|
8822
|
+
}
|
|
8823
|
+
}
|
|
8824
|
+
onValueChange() {
|
|
8825
|
+
if (this.showTime) {
|
|
8826
|
+
const fromDate = this.fromCtrl.value;
|
|
8827
|
+
const toDate = this.toCtrl.value;
|
|
8828
|
+
this.onChangeFn([fromDate, toDate]);
|
|
8829
|
+
}
|
|
8830
|
+
else {
|
|
8831
|
+
const date = this.dateRangeCtrl.value;
|
|
8832
|
+
this.onChangeFn(date);
|
|
8833
|
+
}
|
|
8834
|
+
}
|
|
8835
|
+
}
|
|
8836
|
+
MngDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngDateRangeComponent, deps: [{ token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
8837
|
+
MngDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngDateRangeComponent, selector: "mng-date-range", inputs: { placeholder: "placeholder", showTime: "showTime", showSeconds: "showSeconds", dateFormat: "dateFormat" }, providers: [MNG_DATE_RANGE_VALUE_ACCESSOR], ngImport: i0, template: "<ng-container *ngIf=\"showTime; else defaultRange\">\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n [showTime]=\"showTime\"\n [showSeconds]=\"showSeconds\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n [showTime]=\"showTime\"\n [showSeconds]=\"showSeconds\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n</ng-container>\n<ng-template #defaultRange>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$3.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8838
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngDateRangeComponent, decorators: [{
|
|
8839
|
+
type: Component,
|
|
8840
|
+
args: [{ selector: 'mng-date-range', providers: [MNG_DATE_RANGE_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"showTime; else defaultRange\">\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n [showTime]=\"showTime\"\n [showSeconds]=\"showSeconds\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n [showTime]=\"showTime\"\n [showSeconds]=\"showSeconds\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n</ng-container>\n<ng-template #defaultRange>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"$any(placeholder)\"\n [dateFormat]=\"$any(dateFormat)\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n</ng-template>\n" }]
|
|
8841
|
+
}], ctorParameters: function () { return [{ type: i2$1.FormBuilder }]; }, propDecorators: { placeholder: [{
|
|
8842
|
+
type: Input
|
|
8843
|
+
}], showTime: [{
|
|
8844
|
+
type: Input
|
|
8845
|
+
}], showSeconds: [{
|
|
8846
|
+
type: Input
|
|
8847
|
+
}], dateFormat: [{
|
|
8848
|
+
type: Input
|
|
8849
|
+
}] } });
|
|
8850
|
+
|
|
7640
8851
|
class MngActionEditorComponent {
|
|
7641
8852
|
constructor(injector, translate, actionExecutor, mngCommonsService, navigationService, dialogRef, dialogConfig, viewContainerService) {
|
|
7642
8853
|
this.injector = injector;
|
|
@@ -7828,7 +9039,7 @@ class MngActionEditorComponent {
|
|
|
7828
9039
|
}
|
|
7829
9040
|
}
|
|
7830
9041
|
MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
7831
|
-
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9042
|
+
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7832
9043
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
7833
9044
|
type: Component,
|
|
7834
9045
|
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n" }]
|
|
@@ -8188,10 +9399,20 @@ class MngTableColumnFilterComponent {
|
|
|
8188
9399
|
this.primeShowMatchMode = true;
|
|
8189
9400
|
this.primeDisplay = 'row';
|
|
8190
9401
|
this.primeMatchModes = null;
|
|
9402
|
+
this.dateDebounceSubject = new Subject();
|
|
9403
|
+
this.dateDebounceSubscription = this.dateDebounceSubject.pipe(debounceTime(500), distinctUntilChanged()).subscribe(v => {
|
|
9404
|
+
var _a;
|
|
9405
|
+
(_a = this.dateFilterCallback) === null || _a === void 0 ? void 0 : _a.call(this, v);
|
|
9406
|
+
});
|
|
8191
9407
|
}
|
|
8192
|
-
|
|
9408
|
+
get activeMatchMode() {
|
|
8193
9409
|
var _a;
|
|
8194
|
-
this.
|
|
9410
|
+
const filter = (_a = this.primeColumnFilter) === null || _a === void 0 ? void 0 : _a.dt.filters[this.descriptor.property];
|
|
9411
|
+
return filter === null || filter === void 0 ? void 0 : filter.matchMode;
|
|
9412
|
+
}
|
|
9413
|
+
ngOnInit() {
|
|
9414
|
+
var _a, _b;
|
|
9415
|
+
this.primeDefaultMatchMode = (_a = this.descriptor.defaultFilterMatchMode) !== null && _a !== void 0 ? _a : FilterMatchModeEnum.Equals;
|
|
8195
9416
|
switch (this.descriptor.filterType) {
|
|
8196
9417
|
case FilterTypeEnum.Boolean:
|
|
8197
9418
|
this.primeType = 'boolean';
|
|
@@ -8202,7 +9423,7 @@ class MngTableColumnFilterComponent {
|
|
|
8202
9423
|
break;
|
|
8203
9424
|
case FilterTypeEnum.Date:
|
|
8204
9425
|
this.primeType = 'date';
|
|
8205
|
-
this.primeDefaultMatchMode =
|
|
9426
|
+
this.primeDefaultMatchMode = FilterMatchModeEnum.DateIs;
|
|
8206
9427
|
break;
|
|
8207
9428
|
case FilterTypeEnum.Lookup:
|
|
8208
9429
|
this.primeType = 'lookup';
|
|
@@ -8210,10 +9431,13 @@ class MngTableColumnFilterComponent {
|
|
|
8210
9431
|
this.lookupDescriptor = this.descriptor;
|
|
8211
9432
|
this.primeField = `${this.descriptor.property}${this.lookupDescriptor.itemsValueProperty ? `.${this.lookupDescriptor.itemsValueProperty}` : ''}`;
|
|
8212
9433
|
this.primeMatchModes = [{ value: FilterMatchModeEnum.Equals, label: this.primeConfig.getTranslation(FilterMatchModeEnum.Equals) }];
|
|
9434
|
+
if (this.lookupDescriptor.multiselect) {
|
|
9435
|
+
this.primeDefaultMatchMode = FilterMatchModeEnum.In;
|
|
9436
|
+
}
|
|
8213
9437
|
break;
|
|
8214
9438
|
case FilterTypeEnum.String:
|
|
8215
9439
|
this.primeType = 'text';
|
|
8216
|
-
this.primeDefaultMatchMode =
|
|
9440
|
+
this.primeDefaultMatchMode = FilterMatchModeEnum.Contains;
|
|
8217
9441
|
break;
|
|
8218
9442
|
}
|
|
8219
9443
|
if (this.descriptor.matchModes) {
|
|
@@ -8221,26 +9445,29 @@ class MngTableColumnFilterComponent {
|
|
|
8221
9445
|
if (!this.primeMatchModes.map(matchMode => matchMode.value).includes(this.primeDefaultMatchMode)) {
|
|
8222
9446
|
this.primeDefaultMatchMode = this.descriptor.matchModes[0];
|
|
8223
9447
|
}
|
|
8224
|
-
this.primeShowMatchMode = ((
|
|
9448
|
+
this.primeShowMatchMode = ((_b = this.primeMatchModes) === null || _b === void 0 ? void 0 : _b.length) > 1;
|
|
8225
9449
|
}
|
|
8226
9450
|
if (this.display === TableFilterDisplayEnum.Menu) {
|
|
8227
9451
|
this.primeDisplay = 'menu';
|
|
8228
9452
|
}
|
|
8229
9453
|
}
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
return new Date(value);
|
|
8234
|
-
}
|
|
8235
|
-
else if (value instanceof Date) {
|
|
8236
|
-
return value;
|
|
8237
|
-
}
|
|
8238
|
-
else {
|
|
8239
|
-
return null;
|
|
8240
|
-
}
|
|
9454
|
+
ngOnDestroy() {
|
|
9455
|
+
var _a;
|
|
9456
|
+
(_a = this.dateDebounceSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
8241
9457
|
}
|
|
8242
9458
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
8243
9459
|
dateFilter(value, filterCallback) {
|
|
9460
|
+
this.dateFilterCallback = filterCallback;
|
|
9461
|
+
if (this.activeMatchMode === FilterMatchModeEnum.Between && Array.isArray(value)) {
|
|
9462
|
+
const dateValues = value.filter(v => v instanceof Date);
|
|
9463
|
+
if (dateValues.length <= 1) {
|
|
9464
|
+
return;
|
|
9465
|
+
}
|
|
9466
|
+
}
|
|
9467
|
+
this.dateDebounceSubject.next(value);
|
|
9468
|
+
}
|
|
9469
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
9470
|
+
dateRangeChange(value, filterCallback) {
|
|
8244
9471
|
filterCallback(value);
|
|
8245
9472
|
}
|
|
8246
9473
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -8254,19 +9481,19 @@ class MngTableColumnFilterComponent {
|
|
|
8254
9481
|
}
|
|
8255
9482
|
filterCallback(value);
|
|
8256
9483
|
}
|
|
8257
|
-
toLookupFilterValue(value) {
|
|
8258
|
-
return this.lookupDescriptor.dataKeyProperty && value ? { [this.lookupDescriptor.dataKeyProperty]: value } : value;
|
|
8259
|
-
}
|
|
8260
9484
|
}
|
|
8261
9485
|
MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
8262
|
-
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <p-calendar\n
|
|
9486
|
+
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, viewQueries: [{ propertyName: "primeColumnFilter", first: true, predicate: ColumnFilter, descendants: true }], ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"$any(primeDefaultMatchMode)\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container *ngIf=\"activeMatchMode === 'between'; else datePicker\">\n <mng-date-range\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [dateFormat]=\"descriptor.datePickerFormat\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"></mng-date-range>\n </ng-container>\n <ng-template #datePicker>\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookupDescriptor.multiselect\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4$3.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { kind: "component", type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { kind: "component", type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsLabelTranslate", "itemsValueProperty", "itemsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur"], outputs: ["valueChange"] }, { kind: "component", type: MngDateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
8263
9487
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
|
|
8264
9488
|
type: Component,
|
|
8265
|
-
args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <p-calendar\n
|
|
9489
|
+
args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"$any(primeDefaultMatchMode)\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [showMenu]=\"primeShowMatchMode\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container *ngIf=\"activeMatchMode === 'between'; else datePicker\">\n <mng-date-range\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [dateFormat]=\"descriptor.datePickerFormat\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"></mng-date-range>\n </ng-container>\n <ng-template #datePicker>\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"lookupDescriptor.multiselect\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
|
|
8266
9490
|
}], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
|
|
8267
9491
|
type: Input
|
|
8268
9492
|
}], display: [{
|
|
8269
9493
|
type: Input
|
|
9494
|
+
}], primeColumnFilter: [{
|
|
9495
|
+
type: ViewChild,
|
|
9496
|
+
args: [ColumnFilter]
|
|
8270
9497
|
}] } });
|
|
8271
9498
|
|
|
8272
9499
|
class MngTableComponent {
|
|
@@ -8315,6 +9542,7 @@ class MngTableComponent {
|
|
|
8315
9542
|
this.dataProviderLatestLazyLoadEventVersion = 0;
|
|
8316
9543
|
this.dataProviderLatestQueryParamVersion = 0;
|
|
8317
9544
|
// filter, sort
|
|
9545
|
+
this.hasColumnFilters = false;
|
|
8318
9546
|
this.isFilterChanged = false;
|
|
8319
9547
|
this.isSortChanged = false;
|
|
8320
9548
|
this.filterDescriptors = [];
|
|
@@ -8325,12 +9553,16 @@ class MngTableComponent {
|
|
|
8325
9553
|
this.subscriptions = [];
|
|
8326
9554
|
}
|
|
8327
9555
|
ngOnInit() {
|
|
8328
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
9556
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
8329
9557
|
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
8330
|
-
|
|
9558
|
+
if (!(this.initialDescriptor instanceof TableDynamicDescriptor)) {
|
|
9559
|
+
this.descriptor = this.initialDescriptor;
|
|
9560
|
+
}
|
|
8331
9561
|
// map row settings
|
|
8332
|
-
this.
|
|
8333
|
-
this.
|
|
9562
|
+
this.filterDescriptors = (_d = (_c = this.descriptor) === null || _c === void 0 ? void 0 : _c.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor)) !== null && _d !== void 0 ? _d : [];
|
|
9563
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9564
|
+
this.rows = (_f = (_e = this.descriptor) === null || _e === void 0 ? void 0 : _e.defaultNumRows) !== null && _f !== void 0 ? _f : 25;
|
|
9565
|
+
this.rowsPerPageOptions = (_h = (_g = this.descriptor) === null || _g === void 0 ? void 0 : _g.rowsPerPageOptions) !== null && _h !== void 0 ? _h : [25, 50, 100];
|
|
8334
9566
|
// process actions
|
|
8335
9567
|
for (const action of this.actions) {
|
|
8336
9568
|
switch (action.position) {
|
|
@@ -8344,14 +9576,14 @@ class MngTableComponent {
|
|
|
8344
9576
|
}
|
|
8345
9577
|
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
8346
9578
|
// define all styles
|
|
8347
|
-
this.className = this.descriptor.className;
|
|
8348
|
-
this.tableFullHeightOffset = (
|
|
8349
|
-
this.rowHeight = (
|
|
9579
|
+
this.className = (_k = (_j = this.descriptor) === null || _j === void 0 ? void 0 : _j.className) !== null && _k !== void 0 ? _k : '';
|
|
9580
|
+
this.tableFullHeightOffset = (_m = (_l = this.descriptor) === null || _l === void 0 ? void 0 : _l.tableFullHeightOffset) !== null && _m !== void 0 ? _m : null;
|
|
9581
|
+
this.rowHeight = (_p = (_o = this.descriptor) === null || _o === void 0 ? void 0 : _o.rowHeight) !== null && _p !== void 0 ? _p : null;
|
|
8350
9582
|
if (typeof this.isColumnClickable === 'undefined') {
|
|
8351
9583
|
// define if cell click is being observed via output
|
|
8352
9584
|
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
8353
9585
|
}
|
|
8354
|
-
switch (this.descriptor.size) {
|
|
9586
|
+
switch ((_q = this.descriptor) === null || _q === void 0 ? void 0 : _q.size) {
|
|
8355
9587
|
case TableSizeEnum.Small:
|
|
8356
9588
|
this.className += ' p-datatable-sm';
|
|
8357
9589
|
break;
|
|
@@ -8359,18 +9591,18 @@ class MngTableComponent {
|
|
|
8359
9591
|
this.className += ' p-datatable-lg';
|
|
8360
9592
|
break;
|
|
8361
9593
|
}
|
|
8362
|
-
if (this.descriptor.hasGridlines) {
|
|
9594
|
+
if ((_r = this.descriptor) === null || _r === void 0 ? void 0 : _r.hasGridlines) {
|
|
8363
9595
|
this.className += ' p-datatable-gridlines';
|
|
8364
9596
|
}
|
|
8365
|
-
if (!this.columnActionMinWidth) {
|
|
9597
|
+
if (this.descriptor && !this.columnActionMinWidth) {
|
|
8366
9598
|
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(this.descriptor, this.rowInlineActions);
|
|
8367
9599
|
}
|
|
8368
9600
|
// check if infinite scroll
|
|
8369
|
-
if (this.descriptor.paginationMode === TablePaginationModeEnum.InfiniteScroll) {
|
|
9601
|
+
if (((_s = this.descriptor) === null || _s === void 0 ? void 0 : _s.paginationMode) === TablePaginationModeEnum.InfiniteScroll) {
|
|
8370
9602
|
this.infiniteScroll = true;
|
|
8371
9603
|
this.scrollHeight = 'flex';
|
|
8372
|
-
this.tableFullHeightOffset = (
|
|
8373
|
-
this.rowHeight = (
|
|
9604
|
+
this.tableFullHeightOffset = (_t = this.descriptor.tableFullHeightOffset) !== null && _t !== void 0 ? _t : 315;
|
|
9605
|
+
this.rowHeight = (_u = this.descriptor.rowHeight) !== null && _u !== void 0 ? _u : 45;
|
|
8374
9606
|
this.useQueryParams = false;
|
|
8375
9607
|
}
|
|
8376
9608
|
// check if data provider is supplied, if is, use it primarily
|
|
@@ -8388,6 +9620,12 @@ class MngTableComponent {
|
|
|
8388
9620
|
if (this.dataProvider.serviceType) {
|
|
8389
9621
|
this.dataProviderService = this.injector.get(this.dataProvider.serviceType);
|
|
8390
9622
|
}
|
|
9623
|
+
const reloadSubscription = this.dataProvider.getAllReload$.subscribe({
|
|
9624
|
+
next: () => {
|
|
9625
|
+
this.reload();
|
|
9626
|
+
}
|
|
9627
|
+
});
|
|
9628
|
+
this.subscriptions.push(reloadSubscription);
|
|
8391
9629
|
}
|
|
8392
9630
|
else {
|
|
8393
9631
|
// if query result is provided, use it as secondary source or else try to use items
|
|
@@ -8405,7 +9643,7 @@ class MngTableComponent {
|
|
|
8405
9643
|
return queryResult;
|
|
8406
9644
|
}));
|
|
8407
9645
|
if (!isObservable(this.items)) {
|
|
8408
|
-
this.itemsSubject.next((
|
|
9646
|
+
this.itemsSubject.next((_v = this.items) !== null && _v !== void 0 ? _v : []);
|
|
8409
9647
|
}
|
|
8410
9648
|
}
|
|
8411
9649
|
if (typeof this.loading !== 'undefined') {
|
|
@@ -8414,7 +9652,7 @@ class MngTableComponent {
|
|
|
8414
9652
|
}
|
|
8415
9653
|
const initialQueryParamMap = this.route.snapshot.queryParamMap;
|
|
8416
9654
|
if (this.useQueryParams &&
|
|
8417
|
-
((!initialQueryParamMap.has('sort') && this.descriptor.hasDefaultSort) ||
|
|
9655
|
+
((!initialQueryParamMap.has('sort') && ((_w = this.descriptor) === null || _w === void 0 ? void 0 : _w.hasDefaultSort)) ||
|
|
8418
9656
|
(!initialQueryParamMap.has('filter') && this.filterDescriptors.some(fd => fd.hasDefaultValue)))) {
|
|
8419
9657
|
// default sort/filters are applied, no additional filtering/sorting is specified in query param
|
|
8420
9658
|
// redirect must be done at first step
|
|
@@ -8464,7 +9702,12 @@ class MngTableComponent {
|
|
|
8464
9702
|
}
|
|
8465
9703
|
reload(emitEvent = false, resetParams = false) {
|
|
8466
9704
|
var _a;
|
|
8467
|
-
|
|
9705
|
+
const queryParamsBuilder = resetParams
|
|
9706
|
+
? MediusQueryParamBuilder.create(this.rowsPerPageOptions[0], 0)
|
|
9707
|
+
: MediusQueryParamBuilder.createFromExisting((_a = this.dataProviderLatestQueryParam) !== null && _a !== void 0 ? _a : new MediusQueryParam())
|
|
9708
|
+
.withItemsPerPage(this.rows)
|
|
9709
|
+
.withItemsOffset(this.offset);
|
|
9710
|
+
this.loadTableWithDataProvider(queryParamsBuilder.build(), emitEvent);
|
|
8468
9711
|
}
|
|
8469
9712
|
onTableLazyLoad(event) {
|
|
8470
9713
|
this.dataProviderLatestLazyLoadEvent = event;
|
|
@@ -8531,9 +9774,17 @@ class MngTableComponent {
|
|
|
8531
9774
|
}
|
|
8532
9775
|
this.dataProviderLatestQueryParam = queryParam;
|
|
8533
9776
|
this.dataProviderLatestQueryParamVersion++;
|
|
9777
|
+
MediusRestUtil.modifyFilterProperties(queryParam, this.filterDescriptors);
|
|
8534
9778
|
this.dataProviderSubscription = (_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getAll(queryParam, this.dataProviderService).subscribe({
|
|
8535
9779
|
next: res => {
|
|
8536
9780
|
var _a, _b, _c;
|
|
9781
|
+
if (this.initialDescriptor instanceof TableDynamicDescriptor) {
|
|
9782
|
+
this.descriptor = this.initialDescriptor.toTableDescriptorFromData(res);
|
|
9783
|
+
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
9784
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9785
|
+
// } else {
|
|
9786
|
+
// this.descriptor = this.initialDescriptor.onDataReceivedTypeBuilding(res);
|
|
9787
|
+
}
|
|
8537
9788
|
if (this.infiniteScroll) {
|
|
8538
9789
|
if (this.isFilterChanged || this.isSortChanged) {
|
|
8539
9790
|
this.dataProviderInfiniteScrollItems = [];
|
|
@@ -8549,6 +9800,7 @@ class MngTableComponent {
|
|
|
8549
9800
|
this.dataProviderLoadingSubject.next(false);
|
|
8550
9801
|
},
|
|
8551
9802
|
error: err => {
|
|
9803
|
+
// TODO: check what happens on error with no model iniside descriptor
|
|
8552
9804
|
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
|
|
8553
9805
|
const emptyQueryResult = new MediusQueryResult();
|
|
8554
9806
|
emptyQueryResult.pageData = [];
|
|
@@ -8594,7 +9846,7 @@ class MngTableComponent {
|
|
|
8594
9846
|
const applyDefaultFilters = ((_b = (_a = params.filterParams) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0;
|
|
8595
9847
|
this.filterDescriptors.forEach(f => {
|
|
8596
9848
|
let matchMode;
|
|
8597
|
-
if (f.
|
|
9849
|
+
if (f.defaultFilterMatchMode) {
|
|
8598
9850
|
matchMode = f.defaultFilterMatchMode;
|
|
8599
9851
|
}
|
|
8600
9852
|
else {
|
|
@@ -8603,7 +9855,7 @@ class MngTableComponent {
|
|
|
8603
9855
|
matchMode = FilterMatchMode.CONTAINS;
|
|
8604
9856
|
break;
|
|
8605
9857
|
case FilterTypeEnum.Date:
|
|
8606
|
-
matchMode = FilterMatchMode.
|
|
9858
|
+
matchMode = FilterMatchMode.DATE_IS;
|
|
8607
9859
|
break;
|
|
8608
9860
|
case FilterTypeEnum.Lookup:
|
|
8609
9861
|
case FilterTypeEnum.LookupEnum: {
|
|
@@ -8636,6 +9888,11 @@ class MngTableComponent {
|
|
|
8636
9888
|
if (typeof filterValue === 'string' || typeof filterValue === 'number') {
|
|
8637
9889
|
filterValue = new Date(filterValue);
|
|
8638
9890
|
}
|
|
9891
|
+
// if range is provided, take that into account
|
|
9892
|
+
if (typeof f.filterValueTo === 'string' || typeof f.filterValueTo === 'number') {
|
|
9893
|
+
const filterValueTo = new Date(f.filterValueTo);
|
|
9894
|
+
filterValue = [filterValue, filterValueTo];
|
|
9895
|
+
}
|
|
8639
9896
|
}
|
|
8640
9897
|
primeFilterMeta[descriptor.property] = {
|
|
8641
9898
|
value: filterValue,
|
|
@@ -8646,7 +9903,7 @@ class MngTableComponent {
|
|
|
8646
9903
|
return primeFilterMeta;
|
|
8647
9904
|
}
|
|
8648
9905
|
createSortMeta(mediusQueryParam) {
|
|
8649
|
-
var _a, _b, _c;
|
|
9906
|
+
var _a, _b, _c, _d;
|
|
8650
9907
|
let params;
|
|
8651
9908
|
if (!mediusQueryParam) {
|
|
8652
9909
|
params = new MediusQueryParam();
|
|
@@ -8656,7 +9913,7 @@ class MngTableComponent {
|
|
|
8656
9913
|
}
|
|
8657
9914
|
let sortMeta;
|
|
8658
9915
|
const applyDefaultSorts = ((_b = (_a = params.sortProperty) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0;
|
|
8659
|
-
if (applyDefaultSorts && this.descriptor.hasDefaultSort) {
|
|
9916
|
+
if (applyDefaultSorts && ((_c = this.descriptor) === null || _c === void 0 ? void 0 : _c.hasDefaultSort)) {
|
|
8660
9917
|
sortMeta = this.descriptor.defaultSortProperty.map((p, idx) => ({
|
|
8661
9918
|
field: p,
|
|
8662
9919
|
order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
|
|
@@ -8665,7 +9922,7 @@ class MngTableComponent {
|
|
|
8665
9922
|
else {
|
|
8666
9923
|
sortMeta = [];
|
|
8667
9924
|
}
|
|
8668
|
-
(
|
|
9925
|
+
(_d = params.sortProperty) === null || _d === void 0 ? void 0 : _d.forEach((s, idx) => {
|
|
8669
9926
|
var _a, _b, _c, _d;
|
|
8670
9927
|
const existingIndex = sortMeta.findIndex(value => value.field === s);
|
|
8671
9928
|
if (existingIndex > -1) {
|
|
@@ -8702,16 +9959,17 @@ class MngTableComponent {
|
|
|
8702
9959
|
}
|
|
8703
9960
|
}
|
|
8704
9961
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8705
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9962
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8706
9963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
8707
9964
|
type: Component,
|
|
8708
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor
|
|
9965
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
8709
9966
|
}], ctorParameters: function () {
|
|
8710
9967
|
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
8711
9968
|
type: Optional
|
|
8712
9969
|
}] }];
|
|
8713
|
-
}, propDecorators: {
|
|
8714
|
-
type: Input
|
|
9970
|
+
}, propDecorators: { initialDescriptor: [{
|
|
9971
|
+
type: Input,
|
|
9972
|
+
args: ['descriptor']
|
|
8715
9973
|
}], items: [{
|
|
8716
9974
|
type: Input
|
|
8717
9975
|
}], queryResult: [{
|
|
@@ -8780,6 +10038,8 @@ class MngTableviewComponent {
|
|
|
8780
10038
|
this.toolbarLeftActions = [];
|
|
8781
10039
|
this.toolbarRightActions = [];
|
|
8782
10040
|
this.subscriptions = [];
|
|
10041
|
+
this.hasItemSelectionAction = false;
|
|
10042
|
+
this.selectedItems = [];
|
|
8783
10043
|
}
|
|
8784
10044
|
ngOnInit() {
|
|
8785
10045
|
this.viewContainerService.actions = this.actions;
|
|
@@ -8807,6 +10067,7 @@ class MngTableviewComponent {
|
|
|
8807
10067
|
}
|
|
8808
10068
|
}
|
|
8809
10069
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
10070
|
+
this.hasItemSelectionAction = [...this.toolbarLeftActions, ...this.toolbarRightActions].some(e => e.hasItemsSelection);
|
|
8810
10071
|
}
|
|
8811
10072
|
ngOnDestroy() {
|
|
8812
10073
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -8824,12 +10085,15 @@ class MngTableviewComponent {
|
|
|
8824
10085
|
onTableLoad(event) {
|
|
8825
10086
|
this.tableQueryParam = event.queryParam;
|
|
8826
10087
|
}
|
|
10088
|
+
selectionChange(selectedItems) {
|
|
10089
|
+
this.selectedItems = selectedItems;
|
|
10090
|
+
}
|
|
8827
10091
|
}
|
|
8828
10092
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$2.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8829
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\"
|
|
10093
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$4.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
8830
10094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
8831
10095
|
type: Component,
|
|
8832
|
-
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\"
|
|
10096
|
+
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
8833
10097
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$2.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
8834
10098
|
type: Input
|
|
8835
10099
|
}], dataProvider: [{
|
|
@@ -8842,6 +10106,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
8842
10106
|
}] } });
|
|
8843
10107
|
|
|
8844
10108
|
class AMngTableviewRouteComponent {
|
|
10109
|
+
constructor() {
|
|
10110
|
+
this.route = inject(ActivatedRoute);
|
|
10111
|
+
}
|
|
10112
|
+
get routeData() {
|
|
10113
|
+
return this.route.snapshot.data;
|
|
10114
|
+
}
|
|
8845
10115
|
ngOnInit() {
|
|
8846
10116
|
this.descriptor = this.createTableviewDescriptor();
|
|
8847
10117
|
this.dataProvider = this.createTableviewDataProvider();
|
|
@@ -8855,25 +10125,25 @@ class AMngTableviewRouteComponent {
|
|
|
8855
10125
|
this.createActionDescriptorForDelete(),
|
|
8856
10126
|
this.createActionDescriptorForRefresh(),
|
|
8857
10127
|
this.createActionDescriptorForExport()
|
|
8858
|
-
];
|
|
10128
|
+
].filter(e => e != null);
|
|
8859
10129
|
}
|
|
8860
10130
|
createActionDescriptorForDetails(descriptor = this.descriptor.viewEditor) {
|
|
8861
|
-
return new ActionEditorDetailsDescriptor(descriptor);
|
|
10131
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDetails ? new ActionEditorDetailsDescriptor(descriptor) : null;
|
|
8862
10132
|
}
|
|
8863
10133
|
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
8864
|
-
return new ActionEditorAddDescriptor(descriptor);
|
|
10134
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasAdd ? new ActionEditorAddDescriptor(descriptor) : null;
|
|
8865
10135
|
}
|
|
8866
10136
|
createActionDescriptorForEdit(descriptor = this.descriptor.editEditor) {
|
|
8867
|
-
return new ActionEditorEditDescriptor(descriptor);
|
|
10137
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasEdit ? new ActionEditorEditDescriptor(descriptor) : null;
|
|
8868
10138
|
}
|
|
8869
10139
|
createActionDescriptorForDelete(descriptor = this.descriptor.model) {
|
|
8870
|
-
return new ActionDeleteDescriptor(descriptor);
|
|
10140
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDelete ? new ActionDeleteDescriptor(descriptor) : null;
|
|
8871
10141
|
}
|
|
8872
10142
|
createActionDescriptorForExport(descriptor = this.descriptor.model) {
|
|
8873
10143
|
const action = new ActionDescriptor(descriptor, 'export')
|
|
8874
10144
|
.withRunFunction(ctx => {
|
|
8875
10145
|
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
8876
|
-
queryParamBuilder.withItemsOffset(0).withItemsPerPage(
|
|
10146
|
+
queryParamBuilder.withItemsOffset(0).withItemsPerPage(500);
|
|
8877
10147
|
ctx.parameters.withQueryParam(queryParamBuilder.build());
|
|
8878
10148
|
return ActionDataProviderUtil.runGetAllOrFail(ctx).pipe(map(res => {
|
|
8879
10149
|
var _a, _b;
|
|
@@ -8892,7 +10162,7 @@ class AMngTableviewRouteComponent {
|
|
|
8892
10162
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8893
10163
|
.withPermissionsRouteType(Permissions.ActionTypes.READ)
|
|
8894
10164
|
.withRunNotificationSuccess(undefined, undefined, false)
|
|
8895
|
-
.withRunFunction(ctx => {
|
|
10165
|
+
.withRunFunction((ctx) => {
|
|
8896
10166
|
ctx.parameters.viewContainer.triggerTableReload({});
|
|
8897
10167
|
return of(null);
|
|
8898
10168
|
});
|
|
@@ -8904,16 +10174,9 @@ AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.
|
|
|
8904
10174
|
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
8905
10175
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
|
|
8906
10176
|
type: Directive
|
|
8907
|
-
}] });
|
|
10177
|
+
}], ctorParameters: function () { return []; } });
|
|
8908
10178
|
|
|
8909
10179
|
class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
8910
|
-
constructor(route) {
|
|
8911
|
-
super();
|
|
8912
|
-
this.route = route;
|
|
8913
|
-
}
|
|
8914
|
-
get routeData() {
|
|
8915
|
-
return this.route.snapshot.data;
|
|
8916
|
-
}
|
|
8917
10180
|
createTableviewDescriptor() {
|
|
8918
10181
|
var _a, _b;
|
|
8919
10182
|
if (this.descriptorInit) {
|
|
@@ -8946,12 +10209,12 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
|
8946
10209
|
(_a = this.tableviewComponent) === null || _a === void 0 ? void 0 : _a.reloadTable();
|
|
8947
10210
|
}
|
|
8948
10211
|
}
|
|
8949
|
-
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps:
|
|
10212
|
+
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8950
10213
|
MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewRouteComponent, selector: "mng-tableview-route", inputs: { descriptorInit: ["descriptor", "descriptorInit"], dataProviderInit: ["dataProvider", "dataProviderInit"], actionsInit: ["actions", "actionsInit"] }, viewQueries: [{ propertyName: "tableviewComponent", first: true, predicate: MngTableviewComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
|
|
8951
10214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
8952
10215
|
type: Component,
|
|
8953
10216
|
args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
|
|
8954
|
-
}],
|
|
10217
|
+
}], propDecorators: { descriptorInit: [{
|
|
8955
10218
|
type: Input,
|
|
8956
10219
|
args: ['descriptor']
|
|
8957
10220
|
}], dataProviderInit: [{
|
|
@@ -9283,7 +10546,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
9283
10546
|
}
|
|
9284
10547
|
}
|
|
9285
10548
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9286
|
-
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10549
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9287
10550
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
9288
10551
|
type: Component,
|
|
9289
10552
|
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
|
|
@@ -10412,6 +11675,7 @@ const declarations = [
|
|
|
10412
11675
|
MngParametrizePipe,
|
|
10413
11676
|
MngGetterPipe,
|
|
10414
11677
|
MngTemplatePipe,
|
|
11678
|
+
MngClassMapPipe,
|
|
10415
11679
|
// layout components
|
|
10416
11680
|
MngBreadcrumbComponent,
|
|
10417
11681
|
MngFooterComponent,
|
|
@@ -10423,6 +11687,7 @@ const declarations = [
|
|
|
10423
11687
|
// mng fields
|
|
10424
11688
|
MngAutocompleteComponent,
|
|
10425
11689
|
MngDropdownComponent,
|
|
11690
|
+
MngDateRangeComponent,
|
|
10426
11691
|
// formly wrappers
|
|
10427
11692
|
MngFormlyFieldWrapperComponent,
|
|
10428
11693
|
MngFormlyTableWrapperComponent,
|
|
@@ -10535,6 +11800,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10535
11800
|
MngParametrizePipe,
|
|
10536
11801
|
MngGetterPipe,
|
|
10537
11802
|
MngTemplatePipe,
|
|
11803
|
+
MngClassMapPipe,
|
|
10538
11804
|
// layout components
|
|
10539
11805
|
MngBreadcrumbComponent,
|
|
10540
11806
|
MngFooterComponent,
|
|
@@ -10546,6 +11812,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10546
11812
|
// mng fields
|
|
10547
11813
|
MngAutocompleteComponent,
|
|
10548
11814
|
MngDropdownComponent,
|
|
11815
|
+
MngDateRangeComponent,
|
|
10549
11816
|
// formly wrappers
|
|
10550
11817
|
MngFormlyFieldWrapperComponent,
|
|
10551
11818
|
MngFormlyTableWrapperComponent,
|
|
@@ -10656,6 +11923,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10656
11923
|
MngParametrizePipe,
|
|
10657
11924
|
MngGetterPipe,
|
|
10658
11925
|
MngTemplatePipe,
|
|
11926
|
+
MngClassMapPipe,
|
|
10659
11927
|
// layout components
|
|
10660
11928
|
MngBreadcrumbComponent,
|
|
10661
11929
|
MngFooterComponent,
|
|
@@ -10667,6 +11935,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10667
11935
|
// mng fields
|
|
10668
11936
|
MngAutocompleteComponent,
|
|
10669
11937
|
MngDropdownComponent,
|
|
11938
|
+
MngDateRangeComponent,
|
|
10670
11939
|
// formly wrappers
|
|
10671
11940
|
MngFormlyFieldWrapperComponent,
|
|
10672
11941
|
MngFormlyTableWrapperComponent,
|
|
@@ -11354,6 +12623,7 @@ class TableviewRouteBuilder {
|
|
|
11354
12623
|
this.editPath = ':itemId/edit';
|
|
11355
12624
|
this.hasAdd = true;
|
|
11356
12625
|
this.addPath = 'add';
|
|
12626
|
+
this.hasDelete = true;
|
|
11357
12627
|
}
|
|
11358
12628
|
static fromComponent(path, component) {
|
|
11359
12629
|
const inst = new TableviewRouteBuilder(path);
|
|
@@ -11381,6 +12651,15 @@ class TableviewRouteBuilder {
|
|
|
11381
12651
|
}
|
|
11382
12652
|
return inst;
|
|
11383
12653
|
}
|
|
12654
|
+
withReadOnly(permissions) {
|
|
12655
|
+
if (permissions) {
|
|
12656
|
+
this.withPermissions(permissions);
|
|
12657
|
+
}
|
|
12658
|
+
this.withAdd(false);
|
|
12659
|
+
this.withEdit(false);
|
|
12660
|
+
this.withDelete(false);
|
|
12661
|
+
return this;
|
|
12662
|
+
}
|
|
11384
12663
|
withDetails(hasDetails = true, permissions, path) {
|
|
11385
12664
|
this.hasDetails = hasDetails;
|
|
11386
12665
|
if (permissions) {
|
|
@@ -11411,24 +12690,31 @@ class TableviewRouteBuilder {
|
|
|
11411
12690
|
}
|
|
11412
12691
|
return this;
|
|
11413
12692
|
}
|
|
12693
|
+
withDelete(hasDelete = true, permissions) {
|
|
12694
|
+
this.hasDelete = hasDelete;
|
|
12695
|
+
if (permissions) {
|
|
12696
|
+
this.withPermissions(undefined, undefined, undefined, permissions);
|
|
12697
|
+
}
|
|
12698
|
+
return this;
|
|
12699
|
+
}
|
|
11414
12700
|
withPermissions(read, add, edit, delet, details) {
|
|
11415
12701
|
if (!this.permissions) {
|
|
11416
12702
|
this.permissions = {};
|
|
11417
12703
|
}
|
|
11418
12704
|
if (read) {
|
|
11419
|
-
this.permissions[
|
|
12705
|
+
this.permissions[TableviewActionDefaultCategories.READ] = read;
|
|
11420
12706
|
}
|
|
11421
12707
|
if (add) {
|
|
11422
|
-
this.permissions[
|
|
12708
|
+
this.permissions[TableviewActionDefaultCategories.ADD] = add;
|
|
11423
12709
|
}
|
|
11424
12710
|
if (edit) {
|
|
11425
|
-
this.permissions[
|
|
12711
|
+
this.permissions[TableviewActionDefaultCategories.EDIT] = edit;
|
|
11426
12712
|
}
|
|
11427
12713
|
if (delet) {
|
|
11428
|
-
this.permissions[
|
|
12714
|
+
this.permissions[TableviewActionDefaultCategories.DELETE] = delet;
|
|
11429
12715
|
}
|
|
11430
12716
|
if (details) {
|
|
11431
|
-
this.permissions[
|
|
12717
|
+
this.permissions[TableviewActionDefaultCategories.DETAILS] = details;
|
|
11432
12718
|
}
|
|
11433
12719
|
return this;
|
|
11434
12720
|
}
|
|
@@ -11465,35 +12751,42 @@ class TableviewRouteBuilder {
|
|
|
11465
12751
|
if (this.permissions) {
|
|
11466
12752
|
routeData.tableviewPermissions = Object.assign({}, this.permissions);
|
|
11467
12753
|
}
|
|
12754
|
+
routeData.tableviewActions = {
|
|
12755
|
+
hasAdd: this.hasAdd,
|
|
12756
|
+
hasEdit: this.hasEdit,
|
|
12757
|
+
hasDetails: this.hasDetails,
|
|
12758
|
+
hasDelete: this.hasDelete
|
|
12759
|
+
};
|
|
11468
12760
|
tableviewRouteBuilder.withData(routeData);
|
|
11469
|
-
if ((_a = this.permissions) === null || _a === void 0 ? void 0 : _a[
|
|
11470
|
-
tableviewRouteBuilder.withPermissions(this.permissions[
|
|
12761
|
+
if ((_a = this.permissions) === null || _a === void 0 ? void 0 : _a[TableviewActionDefaultCategories.READ]) {
|
|
12762
|
+
tableviewRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11471
12763
|
}
|
|
11472
12764
|
// list route
|
|
11473
12765
|
const rootChildRouteBuilder = RouteBuilder.create('', MngActionRouteComponent);
|
|
11474
|
-
|
|
11475
|
-
|
|
12766
|
+
rootChildRouteBuilder.withData(Object.assign({}, routeData));
|
|
12767
|
+
if ((_b = this.permissions) === null || _b === void 0 ? void 0 : _b[TableviewActionDefaultCategories.READ]) {
|
|
12768
|
+
rootChildRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11476
12769
|
}
|
|
11477
12770
|
tableviewRouteBuilder.addChildBuilder(rootChildRouteBuilder);
|
|
11478
12771
|
// add route
|
|
11479
12772
|
if (this.hasAdd) {
|
|
11480
12773
|
const routeBuilder = RouteBuilder.create(this.addPath, MngActionRouteComponent);
|
|
11481
|
-
if ((_c = this.permissions) === null || _c === void 0 ? void 0 : _c[
|
|
11482
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12774
|
+
if ((_c = this.permissions) === null || _c === void 0 ? void 0 : _c[TableviewActionDefaultCategories.ADD]) {
|
|
12775
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.ADD]);
|
|
11483
12776
|
}
|
|
11484
12777
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11485
12778
|
}
|
|
11486
12779
|
if (this.hasDetails) {
|
|
11487
12780
|
const routeBuilder = RouteBuilder.create(this.detailsPath, MngActionRouteComponent);
|
|
11488
|
-
if ((_d = this.permissions) === null || _d === void 0 ? void 0 : _d[
|
|
11489
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12781
|
+
if ((_d = this.permissions) === null || _d === void 0 ? void 0 : _d[TableviewActionDefaultCategories.DETAILS]) {
|
|
12782
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.DETAILS]);
|
|
11490
12783
|
}
|
|
11491
12784
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11492
12785
|
}
|
|
11493
12786
|
if (this.hasEdit) {
|
|
11494
12787
|
const routeBuilder = RouteBuilder.create(this.editPath, MngActionRouteComponent);
|
|
11495
|
-
if ((_e = this.permissions) === null || _e === void 0 ? void 0 : _e[
|
|
11496
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12788
|
+
if ((_e = this.permissions) === null || _e === void 0 ? void 0 : _e[TableviewActionDefaultCategories.EDIT]) {
|
|
12789
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.EDIT]);
|
|
11497
12790
|
}
|
|
11498
12791
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11499
12792
|
}
|
|
@@ -11509,5 +12802,5 @@ class TableviewRouteBuilder {
|
|
|
11509
12802
|
* Generated bundle index. Do not edit.
|
|
11510
12803
|
*/
|
|
11511
12804
|
|
|
11512
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonDescriptor, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngButtonComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
12805
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonDescriptor, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngButtonComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
11513
12806
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|