@mediusinc/mng-commons 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/api/models/builders/query-param.builder.mjs +7 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +25 -34
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +91 -22
- package/esm2020/lib/components/tableview/tableview.component.mjs +3 -11
- package/esm2020/lib/config/formly.config.mjs +3 -3
- package/esm2020/lib/descriptors/column.descriptor.mjs +32 -1
- package/esm2020/lib/descriptors/table.descriptor.mjs +52 -9
- package/esm2020/lib/utils/styles.util.mjs +41 -0
- package/fesm2015/mediusinc-mng-commons.mjs +242 -71
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +239 -69
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/builders/query-param.builder.d.ts +1 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +1 -4
- package/lib/components/tableview/table/table.component.d.ts +20 -10
- package/lib/components/tableview/tableview.component.d.ts +1 -3
- package/lib/descriptors/column.descriptor.d.ts +10 -0
- package/lib/descriptors/table.descriptor.d.ts +22 -5
- package/lib/utils/styles.util.d.ts +14 -0
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_datatable.scss +21 -0
- package/scss/mng-overrides/_theme_tableview.scss +0 -43
|
@@ -58,7 +58,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
|
|
|
58
58
|
import * as i8 from 'primeng/ripple';
|
|
59
59
|
import { RippleModule } from 'primeng/ripple';
|
|
60
60
|
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
61
|
-
import * as
|
|
61
|
+
import * as i8$1 from 'primeng/skeleton';
|
|
62
62
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
63
63
|
import * as i4$5 from 'primeng/table';
|
|
64
64
|
import { Table, TableModule } from 'primeng/table';
|
|
@@ -432,6 +432,12 @@ class MediusQueryParamBuilder {
|
|
|
432
432
|
queryParam.queryMode = MediusQueryMode.All;
|
|
433
433
|
return new MediusQueryParamBuilder(queryParam);
|
|
434
434
|
}
|
|
435
|
+
static createFromExisting(queryParam, itemsPerPage, itemsOffset) {
|
|
436
|
+
queryParam.itemsPerPage = itemsPerPage ?? queryParam.itemsPerPage ?? 50;
|
|
437
|
+
queryParam.itemsOffset = itemsOffset ?? queryParam.itemsOffset ?? 0;
|
|
438
|
+
queryParam.queryMode = queryParam.queryMode ?? MediusQueryMode.All;
|
|
439
|
+
return new MediusQueryParamBuilder(queryParam);
|
|
440
|
+
}
|
|
435
441
|
withItemsPerPage(itemsPerPage) {
|
|
436
442
|
this.queryParam.itemsPerPage = itemsPerPage;
|
|
437
443
|
return this;
|
|
@@ -1344,6 +1350,11 @@ class ColumnDescriptor {
|
|
|
1344
1350
|
constructor(table, property) {
|
|
1345
1351
|
this._columnType = ColumnDescriptor.TypeEnum.String;
|
|
1346
1352
|
this._isSortEnabled = false;
|
|
1353
|
+
// styling
|
|
1354
|
+
this._headerClassName = '';
|
|
1355
|
+
this._className = '';
|
|
1356
|
+
this._width = null;
|
|
1357
|
+
this._minWidth = null;
|
|
1347
1358
|
this._enumNameAsValue = false;
|
|
1348
1359
|
// boolean specifics
|
|
1349
1360
|
this._booleanAsIcon = false;
|
|
@@ -1374,6 +1385,18 @@ class ColumnDescriptor {
|
|
|
1374
1385
|
get property() {
|
|
1375
1386
|
return this._property;
|
|
1376
1387
|
}
|
|
1388
|
+
get headerClassName() {
|
|
1389
|
+
return this._headerClassName;
|
|
1390
|
+
}
|
|
1391
|
+
get className() {
|
|
1392
|
+
return this._className;
|
|
1393
|
+
}
|
|
1394
|
+
get width() {
|
|
1395
|
+
return this._width;
|
|
1396
|
+
}
|
|
1397
|
+
get minWidth() {
|
|
1398
|
+
return this._minWidth;
|
|
1399
|
+
}
|
|
1377
1400
|
get enumType() {
|
|
1378
1401
|
return this._enumType;
|
|
1379
1402
|
}
|
|
@@ -1437,6 +1460,16 @@ class ColumnDescriptor {
|
|
|
1437
1460
|
this._customComponentType = customComponentType;
|
|
1438
1461
|
return this;
|
|
1439
1462
|
}
|
|
1463
|
+
withClassName(className, headerClassName) {
|
|
1464
|
+
this._className = className ?? '';
|
|
1465
|
+
this._headerClassName = headerClassName ?? '';
|
|
1466
|
+
return this;
|
|
1467
|
+
}
|
|
1468
|
+
withWidth(width, minWidth) {
|
|
1469
|
+
this._width = width ?? null;
|
|
1470
|
+
this._minWidth = minWidth ?? null;
|
|
1471
|
+
return this;
|
|
1472
|
+
}
|
|
1440
1473
|
withObjectProperty(modelType, titleProperty) {
|
|
1441
1474
|
this._objectModelType = modelType;
|
|
1442
1475
|
if (!titleProperty) {
|
|
@@ -1520,6 +1553,10 @@ class ColumnDescriptor {
|
|
|
1520
1553
|
descriptor._booleanNo = this._booleanNo;
|
|
1521
1554
|
descriptor._objectModelType = this._objectModelType;
|
|
1522
1555
|
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
1556
|
+
descriptor._headerClassName = this._headerClassName;
|
|
1557
|
+
descriptor._className = this._className;
|
|
1558
|
+
descriptor._width = this._width;
|
|
1559
|
+
descriptor._minWidth = this._minWidth;
|
|
1523
1560
|
return descriptor;
|
|
1524
1561
|
}
|
|
1525
1562
|
}
|
|
@@ -2574,8 +2611,11 @@ class TableDescriptor {
|
|
|
2574
2611
|
this._hasDefaultSort = false;
|
|
2575
2612
|
this._defaultSortProperty = [];
|
|
2576
2613
|
this._defaultSortAsc = [];
|
|
2577
|
-
|
|
2578
|
-
this.
|
|
2614
|
+
// visual
|
|
2615
|
+
this._className = '';
|
|
2616
|
+
this._size = TableDescriptor.SizeEnum.Large;
|
|
2617
|
+
this._hasHover = true;
|
|
2618
|
+
this._hasGridlines = false;
|
|
2579
2619
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2580
2620
|
this._dataKeyProperty = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
2581
2621
|
}
|
|
@@ -2612,14 +2652,26 @@ class TableDescriptor {
|
|
|
2612
2652
|
get defaultSortAsc() {
|
|
2613
2653
|
return this._defaultSortAsc;
|
|
2614
2654
|
}
|
|
2615
|
-
get
|
|
2616
|
-
return this.
|
|
2655
|
+
get model() {
|
|
2656
|
+
return this._model;
|
|
2657
|
+
}
|
|
2658
|
+
get className() {
|
|
2659
|
+
return this._className;
|
|
2660
|
+
}
|
|
2661
|
+
get size() {
|
|
2662
|
+
return this._size;
|
|
2617
2663
|
}
|
|
2618
2664
|
get tableFullHeightOffset() {
|
|
2619
2665
|
return this._tableFullHeightOffset;
|
|
2620
2666
|
}
|
|
2621
|
-
get
|
|
2622
|
-
return this.
|
|
2667
|
+
get rowHeight() {
|
|
2668
|
+
return this._rowHeight;
|
|
2669
|
+
}
|
|
2670
|
+
get hasHover() {
|
|
2671
|
+
return this._hasHover;
|
|
2672
|
+
}
|
|
2673
|
+
get hasGridlines() {
|
|
2674
|
+
return this._hasGridlines;
|
|
2623
2675
|
}
|
|
2624
2676
|
addColumnDescriptor(column) {
|
|
2625
2677
|
this._columns.push(column);
|
|
@@ -2698,14 +2750,30 @@ class TableDescriptor {
|
|
|
2698
2750
|
this._defaultSortAsc.push(asc);
|
|
2699
2751
|
return this;
|
|
2700
2752
|
}
|
|
2701
|
-
|
|
2702
|
-
this.
|
|
2753
|
+
withClassName(className) {
|
|
2754
|
+
this._className = className;
|
|
2755
|
+
return this;
|
|
2756
|
+
}
|
|
2757
|
+
withSize(size = TableDescriptor.SizeEnum.Normal) {
|
|
2758
|
+
this._size = size;
|
|
2703
2759
|
return this;
|
|
2704
2760
|
}
|
|
2705
2761
|
withTableFullHeightOffset(tableFullHeightOffset) {
|
|
2706
2762
|
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
2707
2763
|
return this;
|
|
2708
2764
|
}
|
|
2765
|
+
withRowHeight(rowHeight) {
|
|
2766
|
+
this._rowHeight = rowHeight;
|
|
2767
|
+
return this;
|
|
2768
|
+
}
|
|
2769
|
+
withHover(hover) {
|
|
2770
|
+
this._hasHover = hover;
|
|
2771
|
+
return this;
|
|
2772
|
+
}
|
|
2773
|
+
withGridlines(gridlines) {
|
|
2774
|
+
this._hasGridlines = gridlines;
|
|
2775
|
+
return this;
|
|
2776
|
+
}
|
|
2709
2777
|
copy() {
|
|
2710
2778
|
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
2711
2779
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
@@ -2715,6 +2783,12 @@ class TableDescriptor {
|
|
|
2715
2783
|
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
2716
2784
|
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
2717
2785
|
descriptor._filterDisplay = this._filterDisplay;
|
|
2786
|
+
descriptor._className = this._className;
|
|
2787
|
+
descriptor._size = this._size;
|
|
2788
|
+
descriptor._tableFullHeightOffset = this._tableFullHeightOffset;
|
|
2789
|
+
descriptor._rowHeight = this._rowHeight;
|
|
2790
|
+
descriptor._hasHover = this._hasHover;
|
|
2791
|
+
descriptor._hasGridlines = this._hasGridlines;
|
|
2718
2792
|
return descriptor;
|
|
2719
2793
|
}
|
|
2720
2794
|
}
|
|
@@ -2729,6 +2803,12 @@ class TableDescriptor {
|
|
|
2729
2803
|
FilterDisplayEnum[FilterDisplayEnum["Row"] = 0] = "Row";
|
|
2730
2804
|
FilterDisplayEnum[FilterDisplayEnum["Menu"] = 1] = "Menu";
|
|
2731
2805
|
})(FilterDisplayEnum = TableDescriptor.FilterDisplayEnum || (TableDescriptor.FilterDisplayEnum = {}));
|
|
2806
|
+
let SizeEnum;
|
|
2807
|
+
(function (SizeEnum) {
|
|
2808
|
+
SizeEnum[SizeEnum["Small"] = 0] = "Small";
|
|
2809
|
+
SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
|
|
2810
|
+
SizeEnum[SizeEnum["Large"] = 2] = "Large";
|
|
2811
|
+
})(SizeEnum = TableDescriptor.SizeEnum || (TableDescriptor.SizeEnum = {}));
|
|
2732
2812
|
})(TableDescriptor || (TableDescriptor = {}));
|
|
2733
2813
|
|
|
2734
2814
|
var TableviewEditorTypeEnum = EditorDescriptor.TableviewEditorTypeEnum;
|
|
@@ -6292,6 +6372,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6292
6372
|
args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"descriptor.placeholder\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"descriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"descriptor.itemsLabelTranslate\"\n [itemsValueProperty]=\"descriptor.itemsValueProperty\"\n [itemsDisabledProperty]=\"descriptor.itemsDisabledProperty\"\n [dataKeyProperty]=\"descriptor.dataKeyProperty\"\n [showClear]=\"!to.required\"\n [className]=\"descriptor.inputClassName\">\n</mng-dropdown>\n" }]
|
|
6293
6373
|
}] });
|
|
6294
6374
|
|
|
6375
|
+
class StylesUtil {
|
|
6376
|
+
static calculateTableColumnActionWidth(table, actions) {
|
|
6377
|
+
const buttonsWidth = actions.reduce((acc, action) => acc + StylesUtil.getActionButtonRoundedWidth(action) + 2 * StylesUtil.ACTION_BUTTON_MARGIN_X, 0);
|
|
6378
|
+
const tablePadding = StylesUtil.getTableCellPaddingX(table);
|
|
6379
|
+
return buttonsWidth + 2 * tablePadding;
|
|
6380
|
+
}
|
|
6381
|
+
static getTableCellPaddingX(table) {
|
|
6382
|
+
switch (table.size) {
|
|
6383
|
+
case TableDescriptor.SizeEnum.Small:
|
|
6384
|
+
return StylesUtil.TABLE_CELL_PADDING_X_SM;
|
|
6385
|
+
case TableDescriptor.SizeEnum.Large:
|
|
6386
|
+
return StylesUtil.TABLE_CELL_PADDING_X_LG;
|
|
6387
|
+
default:
|
|
6388
|
+
return StylesUtil.TABLE_CELL_PADDING_X;
|
|
6389
|
+
}
|
|
6390
|
+
}
|
|
6391
|
+
static getActionButtonRoundedWidth(action) {
|
|
6392
|
+
switch (action.size) {
|
|
6393
|
+
case ActionDescriptor.SizeEnum.ExtraSmall:
|
|
6394
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_XS;
|
|
6395
|
+
case ActionDescriptor.SizeEnum.Small:
|
|
6396
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_SM;
|
|
6397
|
+
case ActionDescriptor.SizeEnum.Large:
|
|
6398
|
+
case ActionDescriptor.SizeEnum.ExtraLarge:
|
|
6399
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_LG;
|
|
6400
|
+
case ActionDescriptor.SizeEnum.Normal:
|
|
6401
|
+
default:
|
|
6402
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH;
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6405
|
+
}
|
|
6406
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_XS = 26;
|
|
6407
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_SM = 28;
|
|
6408
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH = 32;
|
|
6409
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_LG = 45;
|
|
6410
|
+
StylesUtil.ACTION_BUTTON_MARGIN_X = 2;
|
|
6411
|
+
StylesUtil.TABLE_CELL_PADDING_X = 8; // left and right paddings are same
|
|
6412
|
+
StylesUtil.TABLE_CELL_PADDING_X_SM = 4;
|
|
6413
|
+
StylesUtil.TABLE_CELL_PADDING_X_LG = 12;
|
|
6414
|
+
|
|
6295
6415
|
class MngTableLoadEvent {
|
|
6296
6416
|
}
|
|
6297
6417
|
class MngTableCellClickEvent {
|
|
@@ -6418,11 +6538,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6418
6538
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
6419
6539
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
6420
6540
|
class MngTableComponent {
|
|
6421
|
-
constructor(injector, router,
|
|
6541
|
+
constructor(injector, router, route, translate, actionExecutor, viewContainerService) {
|
|
6422
6542
|
this.injector = injector;
|
|
6423
6543
|
this.router = router;
|
|
6424
|
-
this.
|
|
6544
|
+
this.route = route;
|
|
6425
6545
|
this.translate = translate;
|
|
6546
|
+
this.actionExecutor = actionExecutor;
|
|
6426
6547
|
this.viewContainerService = viewContainerService;
|
|
6427
6548
|
this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
|
|
6428
6549
|
this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
|
|
@@ -6430,8 +6551,9 @@ class MngTableComponent {
|
|
|
6430
6551
|
// extra features input
|
|
6431
6552
|
this.selectionMode = 'multiple';
|
|
6432
6553
|
this.selectionEnabled = false;
|
|
6433
|
-
//
|
|
6434
|
-
this.
|
|
6554
|
+
// actions
|
|
6555
|
+
this.actions = [];
|
|
6556
|
+
this.columnActionMinWidth = null;
|
|
6435
6557
|
// event outputs
|
|
6436
6558
|
this.loadEventEmitter = new EventEmitter();
|
|
6437
6559
|
this.cellClickEventEmitter = new EventEmitter();
|
|
@@ -6442,12 +6564,14 @@ class MngTableComponent {
|
|
|
6442
6564
|
this.useDataProvider = false;
|
|
6443
6565
|
this.useQueryParamsInitialized = false;
|
|
6444
6566
|
this.dataProviderInfiniteScrollItems = [];
|
|
6567
|
+
this.itemsSubject = new ReplaySubject(1);
|
|
6445
6568
|
this.offset = 0;
|
|
6446
6569
|
this.multiSortMeta = null;
|
|
6447
6570
|
this.filterMetadata = {};
|
|
6448
6571
|
// infinite scroll
|
|
6449
6572
|
this.infiniteScroll = false;
|
|
6450
6573
|
this.scrollHeight = null;
|
|
6574
|
+
this.tableFullHeightOffset = null;
|
|
6451
6575
|
this.rowHeight = null;
|
|
6452
6576
|
// selection
|
|
6453
6577
|
this.selection = [];
|
|
@@ -6461,17 +6585,59 @@ class MngTableComponent {
|
|
|
6461
6585
|
this.isFilterChanged = false;
|
|
6462
6586
|
this.isSortChanged = false;
|
|
6463
6587
|
this.filterDescriptors = [];
|
|
6588
|
+
// actions
|
|
6589
|
+
this.showInlineActionsColumn = false;
|
|
6590
|
+
this.rowClickActions = [];
|
|
6591
|
+
this.rowInlineActions = [];
|
|
6464
6592
|
this.subscriptions = [];
|
|
6465
6593
|
}
|
|
6466
6594
|
ngOnInit() {
|
|
6467
6595
|
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
6468
6596
|
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
6597
|
+
// map row settings
|
|
6469
6598
|
this.rows = this.descriptor.defaultNumRows;
|
|
6470
6599
|
this.rowsPerPageOptions = this.descriptor.rowsPerPageOptions;
|
|
6600
|
+
// process actions
|
|
6601
|
+
for (const action of this.actions) {
|
|
6602
|
+
switch (action.position) {
|
|
6603
|
+
case ActionPositionEnum.RowClick:
|
|
6604
|
+
this.rowClickActions.push(action);
|
|
6605
|
+
break;
|
|
6606
|
+
case ActionPositionEnum.RowInline:
|
|
6607
|
+
this.rowInlineActions.push(action);
|
|
6608
|
+
break;
|
|
6609
|
+
}
|
|
6610
|
+
}
|
|
6611
|
+
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
6612
|
+
console.log(this.showInlineActionsColumn, this.rowInlineActions);
|
|
6613
|
+
// define all styles
|
|
6614
|
+
this.className = this.descriptor.className;
|
|
6615
|
+
this.tableFullHeightOffset = this.descriptor.tableFullHeightOffset ?? null;
|
|
6616
|
+
this.rowHeight = this.descriptor.rowHeight ?? null;
|
|
6617
|
+
if (typeof this.isColumnClickable === 'undefined') {
|
|
6618
|
+
// define if cell click is being observed via output
|
|
6619
|
+
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
6620
|
+
}
|
|
6621
|
+
switch (this.descriptor.size) {
|
|
6622
|
+
case TableDescriptor.SizeEnum.Small:
|
|
6623
|
+
this.className += ' p-datatable-sm';
|
|
6624
|
+
break;
|
|
6625
|
+
case TableDescriptor.SizeEnum.Large:
|
|
6626
|
+
this.className += ' p-datatable-lg';
|
|
6627
|
+
break;
|
|
6628
|
+
}
|
|
6629
|
+
if (this.descriptor.hasGridlines) {
|
|
6630
|
+
this.className += ' p-datatable-gridlines';
|
|
6631
|
+
}
|
|
6632
|
+
if (!this.columnActionMinWidth) {
|
|
6633
|
+
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(this.descriptor, this.rowInlineActions);
|
|
6634
|
+
}
|
|
6635
|
+
// check if infinite scroll
|
|
6471
6636
|
if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
|
|
6472
6637
|
this.infiniteScroll = true;
|
|
6473
6638
|
this.scrollHeight = 'flex';
|
|
6474
|
-
this.
|
|
6639
|
+
this.tableFullHeightOffset = this.descriptor.tableFullHeightOffset ?? 315;
|
|
6640
|
+
this.rowHeight = this.descriptor.rowHeight ?? 45;
|
|
6475
6641
|
this.useQueryParams = false;
|
|
6476
6642
|
}
|
|
6477
6643
|
// check if data provider is supplied, if is, use it primarily
|
|
@@ -6495,8 +6661,8 @@ class MngTableComponent {
|
|
|
6495
6661
|
if (this.queryResult) {
|
|
6496
6662
|
this.queryResult$ = this.queryResult instanceof Observable ? this.queryResult : of(this.queryResult);
|
|
6497
6663
|
}
|
|
6498
|
-
else
|
|
6499
|
-
this.queryResult$ = (this.items
|
|
6664
|
+
else {
|
|
6665
|
+
this.queryResult$ = (isObservable(this.items) ? this.items : this.itemsSubject.asObservable()).pipe(
|
|
6500
6666
|
// distinctUntilChanged((v1, v2) => v1.length === v2.length &&
|
|
6501
6667
|
// v1.every((v1i, idx) => v1i[this.descriptor.dataKeyProperty] === v2[idx][this.descriptor.dataKeyProperty])),
|
|
6502
6668
|
map(items => {
|
|
@@ -6505,13 +6671,16 @@ class MngTableComponent {
|
|
|
6505
6671
|
queryResult.allDataCount = items.length;
|
|
6506
6672
|
return queryResult;
|
|
6507
6673
|
}));
|
|
6674
|
+
if (!isObservable(this.items)) {
|
|
6675
|
+
this.itemsSubject.next(this.items ?? []);
|
|
6676
|
+
}
|
|
6508
6677
|
}
|
|
6509
6678
|
if (typeof this.loading !== 'undefined') {
|
|
6510
6679
|
this.loading$ = this.loading instanceof Observable ? this.loading : of(this.loading);
|
|
6511
6680
|
}
|
|
6512
6681
|
}
|
|
6513
6682
|
if (this.useQueryParams) {
|
|
6514
|
-
const subscription = this.
|
|
6683
|
+
const subscription = this.route.queryParams.subscribe(qp => {
|
|
6515
6684
|
this.loadTableFromRouteUpdate(qp);
|
|
6516
6685
|
});
|
|
6517
6686
|
this.subscriptions.push(subscription);
|
|
@@ -6532,10 +6701,18 @@ class MngTableComponent {
|
|
|
6532
6701
|
break;
|
|
6533
6702
|
case 'columnAction':
|
|
6534
6703
|
this.columnActionTemplate = template.template;
|
|
6704
|
+
if (!this.showInlineActionsColumn) {
|
|
6705
|
+
this.showInlineActionsColumn = true;
|
|
6706
|
+
}
|
|
6535
6707
|
break;
|
|
6536
6708
|
}
|
|
6537
6709
|
});
|
|
6538
6710
|
}
|
|
6711
|
+
ngOnChanges(changes) {
|
|
6712
|
+
if (changes['items'] && !changes['items'].firstChange && Array.isArray(changes['items'].currentValue)) {
|
|
6713
|
+
this.itemsSubject.next(changes['items'].currentValue);
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6539
6716
|
ngOnDestroy() {
|
|
6540
6717
|
this.dataProviderSubscription?.unsubscribe();
|
|
6541
6718
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -6552,7 +6729,7 @@ class MngTableComponent {
|
|
|
6552
6729
|
event.multiSortMeta = this.getDefaultSortMeta();
|
|
6553
6730
|
}
|
|
6554
6731
|
this.router.navigate([], {
|
|
6555
|
-
relativeTo: this.
|
|
6732
|
+
relativeTo: this.route,
|
|
6556
6733
|
replaceUrl: true,
|
|
6557
6734
|
queryParams: MediusRestUtil.fromPrimeLazyLoadEventToAngularQueryParams(event, this.rowsPerPageOptions[0])
|
|
6558
6735
|
});
|
|
@@ -6570,9 +6747,15 @@ class MngTableComponent {
|
|
|
6570
6747
|
onTableFilter(event) {
|
|
6571
6748
|
this.isFilterChanged = true;
|
|
6572
6749
|
}
|
|
6573
|
-
onCellClick(col, item, idx) {
|
|
6750
|
+
onCellClick(event, col, item, idx) {
|
|
6751
|
+
console.log(event);
|
|
6574
6752
|
const mngEvent = new MngTableCellClickEvent(col, item, idx);
|
|
6575
6753
|
this.cellClickEventEmitter.next(mngEvent);
|
|
6754
|
+
if (this.rowClickActions.length) {
|
|
6755
|
+
for (const action of this.rowClickActions) {
|
|
6756
|
+
this.actionExecutor.triggerRowClickAction(action, mngEvent, this.route, this.descriptor);
|
|
6757
|
+
}
|
|
6758
|
+
}
|
|
6576
6759
|
}
|
|
6577
6760
|
onSelectionChange(event) {
|
|
6578
6761
|
this.selectionChangeEventEmitter.emit(event);
|
|
@@ -6674,12 +6857,12 @@ class MngTableComponent {
|
|
|
6674
6857
|
}
|
|
6675
6858
|
}
|
|
6676
6859
|
}
|
|
6677
|
-
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6678
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, 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 }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.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\"\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 [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\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=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\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=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\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=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\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=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 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 + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.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", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "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"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6860
|
+
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6861
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", 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\"\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 <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\">\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=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\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'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\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 </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", components: [{ type: i4$5.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", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "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"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: i8$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6679
6862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
6680
6863
|
type: Component,
|
|
6681
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' +
|
|
6682
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6864
|
+
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\"\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 <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\">\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=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\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'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\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 </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" }]
|
|
6865
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6683
6866
|
type: Optional
|
|
6684
6867
|
}] }]; }, propDecorators: { descriptor: [{
|
|
6685
6868
|
type: Input
|
|
@@ -6697,6 +6880,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6697
6880
|
type: Input
|
|
6698
6881
|
}], selectionEnabled: [{
|
|
6699
6882
|
type: Input
|
|
6883
|
+
}], actions: [{
|
|
6884
|
+
type: Input
|
|
6700
6885
|
}], isColumnClickable: [{
|
|
6701
6886
|
type: Input
|
|
6702
6887
|
}], viewContainerInit: [{
|
|
@@ -6706,6 +6891,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6706
6891
|
type: Input
|
|
6707
6892
|
}], columnActionComponent: [{
|
|
6708
6893
|
type: Input
|
|
6894
|
+
}], columnActionMinWidth: [{
|
|
6895
|
+
type: Input
|
|
6709
6896
|
}], loadEventEmitter: [{
|
|
6710
6897
|
type: Output,
|
|
6711
6898
|
args: ['tableLoad']
|
|
@@ -6742,7 +6929,6 @@ class MngTableviewComponent {
|
|
|
6742
6929
|
this.actionExecutor = actionExecutor;
|
|
6743
6930
|
this.viewContainerService = viewContainerService;
|
|
6744
6931
|
this.actions = [];
|
|
6745
|
-
this.tableComponent = null;
|
|
6746
6932
|
this.rowClickActions = [];
|
|
6747
6933
|
this.rowInlineActions = [];
|
|
6748
6934
|
this.toolbarLeftActions = [];
|
|
@@ -6788,19 +6974,12 @@ class MngTableviewComponent {
|
|
|
6788
6974
|
reloadTable() {
|
|
6789
6975
|
this.tableComponent?.reload();
|
|
6790
6976
|
}
|
|
6791
|
-
onTableCellClick(event) {
|
|
6792
|
-
if (this.rowClickActions.length) {
|
|
6793
|
-
for (const action of this.rowClickActions) {
|
|
6794
|
-
this.actionExecutor.triggerRowClickAction(action, event, this.route, this.descriptor.table);
|
|
6795
|
-
}
|
|
6796
|
-
}
|
|
6797
|
-
}
|
|
6798
6977
|
}
|
|
6799
6978
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$1.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6800
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", 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\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table
|
|
6979
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", 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\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" [actions]=\"actions\">\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", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { 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"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
|
6801
6980
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
6802
6981
|
type: Component,
|
|
6803
|
-
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\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table
|
|
6982
|
+
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\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" [actions]=\"actions\">\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" }]
|
|
6804
6983
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$1.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
6805
6984
|
type: Input
|
|
6806
6985
|
}], dataProvider: [{
|
|
@@ -7044,7 +7223,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
7044
7223
|
}
|
|
7045
7224
|
}
|
|
7046
7225
|
MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
7047
|
-
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7226
|
+
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { 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"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7048
7227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
|
|
7049
7228
|
type: Component,
|
|
7050
7229
|
args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
|
|
@@ -7061,9 +7240,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7061
7240
|
this.actionExecutor = actionExecutor;
|
|
7062
7241
|
this.itemsSubject = new ReplaySubject(1);
|
|
7063
7242
|
this.items$ = this.itemsSubject.asObservable();
|
|
7243
|
+
this.actions = [];
|
|
7064
7244
|
this.toolbarRightActions = [];
|
|
7065
|
-
this.rowClickActions = [];
|
|
7066
|
-
this.rowInlineActions = [];
|
|
7067
7245
|
this.subscriptions = [];
|
|
7068
7246
|
this.isDisabledSubject = new BehaviorSubject(false);
|
|
7069
7247
|
this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
|
|
@@ -7081,7 +7259,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7081
7259
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
7082
7260
|
.withDialogSize(DialogSizeEnum.Small);
|
|
7083
7261
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
7084
|
-
this.
|
|
7262
|
+
this.actions.push(viewAction);
|
|
7085
7263
|
}
|
|
7086
7264
|
if (hasAddAction) {
|
|
7087
7265
|
const addAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.addEditor, 'add', this.descriptor.editor.model.type, this.descriptor.property)
|
|
@@ -7103,10 +7281,11 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7103
7281
|
})
|
|
7104
7282
|
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
7105
7283
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7106
|
-
this.
|
|
7284
|
+
this.actions.push(addAction);
|
|
7107
7285
|
}
|
|
7108
7286
|
if (hasEditAction) {
|
|
7109
7287
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
7288
|
+
.withPosition(ActionPositionEnum.RowInline)
|
|
7110
7289
|
.withTitle(null)
|
|
7111
7290
|
.withIcon('pi pi-pencil')
|
|
7112
7291
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
@@ -7124,48 +7303,47 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7124
7303
|
})
|
|
7125
7304
|
.withIsVisibleFunction(() => of(!this.formControl?.disabled))
|
|
7126
7305
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7127
|
-
this.
|
|
7306
|
+
this.actions.push(editAction);
|
|
7128
7307
|
}
|
|
7129
7308
|
if (hasDeleteAction) {
|
|
7130
7309
|
const deleteAction = new ActionDescriptor(this.descriptor.tableviewDescriptor.model, 'delete', this.descriptor.editor.model.type, this.descriptor.property)
|
|
7310
|
+
.withPosition(ActionPositionEnum.RowInline)
|
|
7131
7311
|
.withLevel(ActionLevelEnum.Danger)
|
|
7132
7312
|
.withTitle(null)
|
|
7133
7313
|
.withIcon('pi pi-trash')
|
|
7134
7314
|
.withSize(SizeEnum.ExtraSmall)
|
|
7135
7315
|
.withRunFunction(ctx => {
|
|
7136
7316
|
if (!ctx.data?.item) {
|
|
7137
|
-
|
|
7317
|
+
return throwError(() => new Error(`No item was provided in context, delete cannot be done.`));
|
|
7138
7318
|
}
|
|
7139
7319
|
let formControlValue = this.formControl.value;
|
|
7140
7320
|
const compareProperty = this.descriptor.tableDescriptor.dataKeyProperty
|
|
7141
7321
|
? this.descriptor.tableDescriptor.dataKeyProperty
|
|
7142
7322
|
: this.descriptor.tableDescriptor.model.idPropertyName;
|
|
7143
|
-
if (!compareProperty) {
|
|
7144
|
-
throw new Error('Cannot compare items, please provide main table data key property or model id property.');
|
|
7145
|
-
}
|
|
7146
7323
|
const ctxItem = ctx.data.item;
|
|
7147
|
-
if (
|
|
7148
|
-
|
|
7324
|
+
if (compareProperty && ctxItem?.[compareProperty]) {
|
|
7325
|
+
formControlValue = formControlValue.filter((i) => i[compareProperty] !== ctxItem[compareProperty]);
|
|
7326
|
+
this.formControl.patchValue(formControlValue);
|
|
7149
7327
|
}
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7328
|
+
else if (typeof ctx.data.actionData?.['itemIndex'] === 'number') {
|
|
7329
|
+
formControlValue.splice(ctx.data.actionData['itemIndex'], 1);
|
|
7330
|
+
this.formControl.patchValue([...formControlValue]);
|
|
7331
|
+
}
|
|
7332
|
+
else {
|
|
7333
|
+
return throwError(() => new Error('Cannot compare items, please provide main table data key property or model id property.'));
|
|
7334
|
+
}
|
|
7335
|
+
return of(ctxItem);
|
|
7153
7336
|
})
|
|
7154
7337
|
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
7155
7338
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7156
|
-
this.
|
|
7339
|
+
this.actions.push(deleteAction);
|
|
7157
7340
|
}
|
|
7158
|
-
|
|
7341
|
+
this.actions.push(...this.descriptor.actions);
|
|
7342
|
+
for (const action of this.actions) {
|
|
7159
7343
|
switch (action.position) {
|
|
7160
7344
|
case ActionPositionEnum.ToolbarRight:
|
|
7161
7345
|
this.toolbarRightActions.push(action);
|
|
7162
7346
|
break;
|
|
7163
|
-
case ActionPositionEnum.RowInline:
|
|
7164
|
-
this.rowInlineActions.push(action);
|
|
7165
|
-
break;
|
|
7166
|
-
case ActionPositionEnum.RowClick:
|
|
7167
|
-
// this.footerRightActions.push(action);
|
|
7168
|
-
break;
|
|
7169
7347
|
}
|
|
7170
7348
|
}
|
|
7171
7349
|
// init values
|
|
@@ -7190,20 +7368,12 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7190
7368
|
ngOnDestroy() {
|
|
7191
7369
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
7192
7370
|
}
|
|
7193
|
-
onTableCellClick(event) {
|
|
7194
|
-
console.log(event);
|
|
7195
|
-
if (this.rowClickActions.length) {
|
|
7196
|
-
for (const action of this.rowClickActions) {
|
|
7197
|
-
this.actionExecutor.triggerRowClickAction(action, event);
|
|
7198
|
-
}
|
|
7199
|
-
}
|
|
7200
|
-
}
|
|
7201
7371
|
}
|
|
7202
7372
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7203
|
-
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\"
|
|
7373
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", 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"], components: [{ 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"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7204
7374
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
7205
7375
|
type: Component,
|
|
7206
|
-
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\"
|
|
7376
|
+
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"] }]
|
|
7207
7377
|
}], ctorParameters: function () { return [{ type: MngActionExecutorService }]; } });
|
|
7208
7378
|
|
|
7209
7379
|
class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
@@ -7311,7 +7481,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
7311
7481
|
}
|
|
7312
7482
|
}
|
|
7313
7483
|
MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
7314
|
-
MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\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 <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-field-dialog mng-action-editor-dialog mng-action-editor-dialog-sm\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7484
|
+
MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\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 <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-field-dialog mng-action-editor-dialog mng-action-editor-dialog-sm\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ 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"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7315
7485
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
|
|
7316
7486
|
type: Component,
|
|
7317
7487
|
args: [{ selector: 'mng-formly-table-multiselect-add-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\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 <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-field-dialog mng-action-editor-dialog mng-action-editor-dialog-sm\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
|
|
@@ -8098,8 +8268,8 @@ function getEmailValidationMessage(translate) {
|
|
|
8098
8268
|
const getFormlyValidationMessages = (translate) => {
|
|
8099
8269
|
return [
|
|
8100
8270
|
{ name: 'required', message: getRequiredValidationMessage(translate) },
|
|
8101
|
-
{ name: '
|
|
8102
|
-
{ name: '
|
|
8271
|
+
{ name: 'minLength', message: getMinLengthValidationMessage(translate) },
|
|
8272
|
+
{ name: 'maxLength', message: getMaxLengthValidationMessage(translate) },
|
|
8103
8273
|
{ name: 'pattern', message: getTextPatternValidationMessage(translate) },
|
|
8104
8274
|
{ name: 'email', message: getEmailValidationMessage(translate) }
|
|
8105
8275
|
];
|