@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';
|
|
@@ -440,6 +440,13 @@ class MediusQueryParamBuilder {
|
|
|
440
440
|
queryParam.queryMode = MediusQueryMode.All;
|
|
441
441
|
return new MediusQueryParamBuilder(queryParam);
|
|
442
442
|
}
|
|
443
|
+
static createFromExisting(queryParam, itemsPerPage, itemsOffset) {
|
|
444
|
+
var _a, _b, _c;
|
|
445
|
+
queryParam.itemsPerPage = (_a = itemsPerPage !== null && itemsPerPage !== void 0 ? itemsPerPage : queryParam.itemsPerPage) !== null && _a !== void 0 ? _a : 50;
|
|
446
|
+
queryParam.itemsOffset = (_b = itemsOffset !== null && itemsOffset !== void 0 ? itemsOffset : queryParam.itemsOffset) !== null && _b !== void 0 ? _b : 0;
|
|
447
|
+
queryParam.queryMode = (_c = queryParam.queryMode) !== null && _c !== void 0 ? _c : MediusQueryMode.All;
|
|
448
|
+
return new MediusQueryParamBuilder(queryParam);
|
|
449
|
+
}
|
|
443
450
|
withItemsPerPage(itemsPerPage) {
|
|
444
451
|
this.queryParam.itemsPerPage = itemsPerPage;
|
|
445
452
|
return this;
|
|
@@ -1356,6 +1363,11 @@ class ColumnDescriptor {
|
|
|
1356
1363
|
constructor(table, property) {
|
|
1357
1364
|
this._columnType = ColumnDescriptor.TypeEnum.String;
|
|
1358
1365
|
this._isSortEnabled = false;
|
|
1366
|
+
// styling
|
|
1367
|
+
this._headerClassName = '';
|
|
1368
|
+
this._className = '';
|
|
1369
|
+
this._width = null;
|
|
1370
|
+
this._minWidth = null;
|
|
1359
1371
|
this._enumNameAsValue = false;
|
|
1360
1372
|
// boolean specifics
|
|
1361
1373
|
this._booleanAsIcon = false;
|
|
@@ -1386,6 +1398,18 @@ class ColumnDescriptor {
|
|
|
1386
1398
|
get property() {
|
|
1387
1399
|
return this._property;
|
|
1388
1400
|
}
|
|
1401
|
+
get headerClassName() {
|
|
1402
|
+
return this._headerClassName;
|
|
1403
|
+
}
|
|
1404
|
+
get className() {
|
|
1405
|
+
return this._className;
|
|
1406
|
+
}
|
|
1407
|
+
get width() {
|
|
1408
|
+
return this._width;
|
|
1409
|
+
}
|
|
1410
|
+
get minWidth() {
|
|
1411
|
+
return this._minWidth;
|
|
1412
|
+
}
|
|
1389
1413
|
get enumType() {
|
|
1390
1414
|
return this._enumType;
|
|
1391
1415
|
}
|
|
@@ -1449,6 +1473,16 @@ class ColumnDescriptor {
|
|
|
1449
1473
|
this._customComponentType = customComponentType;
|
|
1450
1474
|
return this;
|
|
1451
1475
|
}
|
|
1476
|
+
withClassName(className, headerClassName) {
|
|
1477
|
+
this._className = className !== null && className !== void 0 ? className : '';
|
|
1478
|
+
this._headerClassName = headerClassName !== null && headerClassName !== void 0 ? headerClassName : '';
|
|
1479
|
+
return this;
|
|
1480
|
+
}
|
|
1481
|
+
withWidth(width, minWidth) {
|
|
1482
|
+
this._width = width !== null && width !== void 0 ? width : null;
|
|
1483
|
+
this._minWidth = minWidth !== null && minWidth !== void 0 ? minWidth : null;
|
|
1484
|
+
return this;
|
|
1485
|
+
}
|
|
1452
1486
|
withObjectProperty(modelType, titleProperty) {
|
|
1453
1487
|
var _a;
|
|
1454
1488
|
this._objectModelType = modelType;
|
|
@@ -1535,6 +1569,10 @@ class ColumnDescriptor {
|
|
|
1535
1569
|
descriptor._booleanNo = this._booleanNo;
|
|
1536
1570
|
descriptor._objectModelType = this._objectModelType;
|
|
1537
1571
|
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
1572
|
+
descriptor._headerClassName = this._headerClassName;
|
|
1573
|
+
descriptor._className = this._className;
|
|
1574
|
+
descriptor._width = this._width;
|
|
1575
|
+
descriptor._minWidth = this._minWidth;
|
|
1538
1576
|
return descriptor;
|
|
1539
1577
|
}
|
|
1540
1578
|
}
|
|
@@ -2595,8 +2633,11 @@ class TableDescriptor {
|
|
|
2595
2633
|
this._hasDefaultSort = false;
|
|
2596
2634
|
this._defaultSortProperty = [];
|
|
2597
2635
|
this._defaultSortAsc = [];
|
|
2598
|
-
|
|
2599
|
-
this.
|
|
2636
|
+
// visual
|
|
2637
|
+
this._className = '';
|
|
2638
|
+
this._size = TableDescriptor.SizeEnum.Large;
|
|
2639
|
+
this._hasHover = true;
|
|
2640
|
+
this._hasGridlines = false;
|
|
2600
2641
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2601
2642
|
this._dataKeyProperty = (_a = idProperty !== null && idProperty !== void 0 ? idProperty : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : undefined;
|
|
2602
2643
|
}
|
|
@@ -2633,14 +2674,26 @@ class TableDescriptor {
|
|
|
2633
2674
|
get defaultSortAsc() {
|
|
2634
2675
|
return this._defaultSortAsc;
|
|
2635
2676
|
}
|
|
2636
|
-
get
|
|
2637
|
-
return this.
|
|
2677
|
+
get model() {
|
|
2678
|
+
return this._model;
|
|
2679
|
+
}
|
|
2680
|
+
get className() {
|
|
2681
|
+
return this._className;
|
|
2682
|
+
}
|
|
2683
|
+
get size() {
|
|
2684
|
+
return this._size;
|
|
2638
2685
|
}
|
|
2639
2686
|
get tableFullHeightOffset() {
|
|
2640
2687
|
return this._tableFullHeightOffset;
|
|
2641
2688
|
}
|
|
2642
|
-
get
|
|
2643
|
-
return this.
|
|
2689
|
+
get rowHeight() {
|
|
2690
|
+
return this._rowHeight;
|
|
2691
|
+
}
|
|
2692
|
+
get hasHover() {
|
|
2693
|
+
return this._hasHover;
|
|
2694
|
+
}
|
|
2695
|
+
get hasGridlines() {
|
|
2696
|
+
return this._hasGridlines;
|
|
2644
2697
|
}
|
|
2645
2698
|
addColumnDescriptor(column) {
|
|
2646
2699
|
this._columns.push(column);
|
|
@@ -2719,14 +2772,30 @@ class TableDescriptor {
|
|
|
2719
2772
|
this._defaultSortAsc.push(asc);
|
|
2720
2773
|
return this;
|
|
2721
2774
|
}
|
|
2722
|
-
|
|
2723
|
-
this.
|
|
2775
|
+
withClassName(className) {
|
|
2776
|
+
this._className = className;
|
|
2777
|
+
return this;
|
|
2778
|
+
}
|
|
2779
|
+
withSize(size = TableDescriptor.SizeEnum.Normal) {
|
|
2780
|
+
this._size = size;
|
|
2724
2781
|
return this;
|
|
2725
2782
|
}
|
|
2726
2783
|
withTableFullHeightOffset(tableFullHeightOffset) {
|
|
2727
2784
|
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
2728
2785
|
return this;
|
|
2729
2786
|
}
|
|
2787
|
+
withRowHeight(rowHeight) {
|
|
2788
|
+
this._rowHeight = rowHeight;
|
|
2789
|
+
return this;
|
|
2790
|
+
}
|
|
2791
|
+
withHover(hover) {
|
|
2792
|
+
this._hasHover = hover;
|
|
2793
|
+
return this;
|
|
2794
|
+
}
|
|
2795
|
+
withGridlines(gridlines) {
|
|
2796
|
+
this._hasGridlines = gridlines;
|
|
2797
|
+
return this;
|
|
2798
|
+
}
|
|
2730
2799
|
copy() {
|
|
2731
2800
|
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
2732
2801
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
@@ -2736,6 +2805,12 @@ class TableDescriptor {
|
|
|
2736
2805
|
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
2737
2806
|
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
2738
2807
|
descriptor._filterDisplay = this._filterDisplay;
|
|
2808
|
+
descriptor._className = this._className;
|
|
2809
|
+
descriptor._size = this._size;
|
|
2810
|
+
descriptor._tableFullHeightOffset = this._tableFullHeightOffset;
|
|
2811
|
+
descriptor._rowHeight = this._rowHeight;
|
|
2812
|
+
descriptor._hasHover = this._hasHover;
|
|
2813
|
+
descriptor._hasGridlines = this._hasGridlines;
|
|
2739
2814
|
return descriptor;
|
|
2740
2815
|
}
|
|
2741
2816
|
}
|
|
@@ -2750,6 +2825,12 @@ class TableDescriptor {
|
|
|
2750
2825
|
FilterDisplayEnum[FilterDisplayEnum["Row"] = 0] = "Row";
|
|
2751
2826
|
FilterDisplayEnum[FilterDisplayEnum["Menu"] = 1] = "Menu";
|
|
2752
2827
|
})(FilterDisplayEnum = TableDescriptor.FilterDisplayEnum || (TableDescriptor.FilterDisplayEnum = {}));
|
|
2828
|
+
let SizeEnum;
|
|
2829
|
+
(function (SizeEnum) {
|
|
2830
|
+
SizeEnum[SizeEnum["Small"] = 0] = "Small";
|
|
2831
|
+
SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
|
|
2832
|
+
SizeEnum[SizeEnum["Large"] = 2] = "Large";
|
|
2833
|
+
})(SizeEnum = TableDescriptor.SizeEnum || (TableDescriptor.SizeEnum = {}));
|
|
2753
2834
|
})(TableDescriptor || (TableDescriptor = {}));
|
|
2754
2835
|
|
|
2755
2836
|
var TableviewEditorTypeEnum = EditorDescriptor.TableviewEditorTypeEnum;
|
|
@@ -6379,6 +6460,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6379
6460
|
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" }]
|
|
6380
6461
|
}] });
|
|
6381
6462
|
|
|
6463
|
+
class StylesUtil {
|
|
6464
|
+
static calculateTableColumnActionWidth(table, actions) {
|
|
6465
|
+
const buttonsWidth = actions.reduce((acc, action) => acc + StylesUtil.getActionButtonRoundedWidth(action) + 2 * StylesUtil.ACTION_BUTTON_MARGIN_X, 0);
|
|
6466
|
+
const tablePadding = StylesUtil.getTableCellPaddingX(table);
|
|
6467
|
+
return buttonsWidth + 2 * tablePadding;
|
|
6468
|
+
}
|
|
6469
|
+
static getTableCellPaddingX(table) {
|
|
6470
|
+
switch (table.size) {
|
|
6471
|
+
case TableDescriptor.SizeEnum.Small:
|
|
6472
|
+
return StylesUtil.TABLE_CELL_PADDING_X_SM;
|
|
6473
|
+
case TableDescriptor.SizeEnum.Large:
|
|
6474
|
+
return StylesUtil.TABLE_CELL_PADDING_X_LG;
|
|
6475
|
+
default:
|
|
6476
|
+
return StylesUtil.TABLE_CELL_PADDING_X;
|
|
6477
|
+
}
|
|
6478
|
+
}
|
|
6479
|
+
static getActionButtonRoundedWidth(action) {
|
|
6480
|
+
switch (action.size) {
|
|
6481
|
+
case ActionDescriptor.SizeEnum.ExtraSmall:
|
|
6482
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_XS;
|
|
6483
|
+
case ActionDescriptor.SizeEnum.Small:
|
|
6484
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_SM;
|
|
6485
|
+
case ActionDescriptor.SizeEnum.Large:
|
|
6486
|
+
case ActionDescriptor.SizeEnum.ExtraLarge:
|
|
6487
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH_LG;
|
|
6488
|
+
case ActionDescriptor.SizeEnum.Normal:
|
|
6489
|
+
default:
|
|
6490
|
+
return StylesUtil.BUTTON_ROUNDED_WIDTH;
|
|
6491
|
+
}
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_XS = 26;
|
|
6495
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_SM = 28;
|
|
6496
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH = 32;
|
|
6497
|
+
StylesUtil.BUTTON_ROUNDED_WIDTH_LG = 45;
|
|
6498
|
+
StylesUtil.ACTION_BUTTON_MARGIN_X = 2;
|
|
6499
|
+
StylesUtil.TABLE_CELL_PADDING_X = 8; // left and right paddings are same
|
|
6500
|
+
StylesUtil.TABLE_CELL_PADDING_X_SM = 4;
|
|
6501
|
+
StylesUtil.TABLE_CELL_PADDING_X_LG = 12;
|
|
6502
|
+
|
|
6382
6503
|
class MngTableLoadEvent {
|
|
6383
6504
|
}
|
|
6384
6505
|
class MngTableCellClickEvent {
|
|
@@ -6506,11 +6627,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6506
6627
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
6507
6628
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
6508
6629
|
class MngTableComponent {
|
|
6509
|
-
constructor(injector, router,
|
|
6630
|
+
constructor(injector, router, route, translate, actionExecutor, viewContainerService) {
|
|
6510
6631
|
this.injector = injector;
|
|
6511
6632
|
this.router = router;
|
|
6512
|
-
this.
|
|
6633
|
+
this.route = route;
|
|
6513
6634
|
this.translate = translate;
|
|
6635
|
+
this.actionExecutor = actionExecutor;
|
|
6514
6636
|
this.viewContainerService = viewContainerService;
|
|
6515
6637
|
this.filterDisplayRow = TableDescriptor.FilterDisplayEnum.Row;
|
|
6516
6638
|
this.filterDisplayMenu = TableDescriptor.FilterDisplayEnum.Menu;
|
|
@@ -6518,8 +6640,9 @@ class MngTableComponent {
|
|
|
6518
6640
|
// extra features input
|
|
6519
6641
|
this.selectionMode = 'multiple';
|
|
6520
6642
|
this.selectionEnabled = false;
|
|
6521
|
-
//
|
|
6522
|
-
this.
|
|
6643
|
+
// actions
|
|
6644
|
+
this.actions = [];
|
|
6645
|
+
this.columnActionMinWidth = null;
|
|
6523
6646
|
// event outputs
|
|
6524
6647
|
this.loadEventEmitter = new EventEmitter();
|
|
6525
6648
|
this.cellClickEventEmitter = new EventEmitter();
|
|
@@ -6530,12 +6653,14 @@ class MngTableComponent {
|
|
|
6530
6653
|
this.useDataProvider = false;
|
|
6531
6654
|
this.useQueryParamsInitialized = false;
|
|
6532
6655
|
this.dataProviderInfiniteScrollItems = [];
|
|
6656
|
+
this.itemsSubject = new ReplaySubject(1);
|
|
6533
6657
|
this.offset = 0;
|
|
6534
6658
|
this.multiSortMeta = null;
|
|
6535
6659
|
this.filterMetadata = {};
|
|
6536
6660
|
// infinite scroll
|
|
6537
6661
|
this.infiniteScroll = false;
|
|
6538
6662
|
this.scrollHeight = null;
|
|
6663
|
+
this.tableFullHeightOffset = null;
|
|
6539
6664
|
this.rowHeight = null;
|
|
6540
6665
|
// selection
|
|
6541
6666
|
this.selection = [];
|
|
@@ -6549,18 +6674,60 @@ class MngTableComponent {
|
|
|
6549
6674
|
this.isFilterChanged = false;
|
|
6550
6675
|
this.isSortChanged = false;
|
|
6551
6676
|
this.filterDescriptors = [];
|
|
6677
|
+
// actions
|
|
6678
|
+
this.showInlineActionsColumn = false;
|
|
6679
|
+
this.rowClickActions = [];
|
|
6680
|
+
this.rowInlineActions = [];
|
|
6552
6681
|
this.subscriptions = [];
|
|
6553
6682
|
}
|
|
6554
6683
|
ngOnInit() {
|
|
6555
|
-
var _a, _b;
|
|
6684
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6556
6685
|
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
6557
6686
|
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
6687
|
+
// map row settings
|
|
6558
6688
|
this.rows = this.descriptor.defaultNumRows;
|
|
6559
6689
|
this.rowsPerPageOptions = this.descriptor.rowsPerPageOptions;
|
|
6690
|
+
// process actions
|
|
6691
|
+
for (const action of this.actions) {
|
|
6692
|
+
switch (action.position) {
|
|
6693
|
+
case ActionPositionEnum.RowClick:
|
|
6694
|
+
this.rowClickActions.push(action);
|
|
6695
|
+
break;
|
|
6696
|
+
case ActionPositionEnum.RowInline:
|
|
6697
|
+
this.rowInlineActions.push(action);
|
|
6698
|
+
break;
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
6702
|
+
console.log(this.showInlineActionsColumn, this.rowInlineActions);
|
|
6703
|
+
// define all styles
|
|
6704
|
+
this.className = this.descriptor.className;
|
|
6705
|
+
this.tableFullHeightOffset = (_c = this.descriptor.tableFullHeightOffset) !== null && _c !== void 0 ? _c : null;
|
|
6706
|
+
this.rowHeight = (_d = this.descriptor.rowHeight) !== null && _d !== void 0 ? _d : null;
|
|
6707
|
+
if (typeof this.isColumnClickable === 'undefined') {
|
|
6708
|
+
// define if cell click is being observed via output
|
|
6709
|
+
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
6710
|
+
}
|
|
6711
|
+
switch (this.descriptor.size) {
|
|
6712
|
+
case TableDescriptor.SizeEnum.Small:
|
|
6713
|
+
this.className += ' p-datatable-sm';
|
|
6714
|
+
break;
|
|
6715
|
+
case TableDescriptor.SizeEnum.Large:
|
|
6716
|
+
this.className += ' p-datatable-lg';
|
|
6717
|
+
break;
|
|
6718
|
+
}
|
|
6719
|
+
if (this.descriptor.hasGridlines) {
|
|
6720
|
+
this.className += ' p-datatable-gridlines';
|
|
6721
|
+
}
|
|
6722
|
+
if (!this.columnActionMinWidth) {
|
|
6723
|
+
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(this.descriptor, this.rowInlineActions);
|
|
6724
|
+
}
|
|
6725
|
+
// check if infinite scroll
|
|
6560
6726
|
if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
|
|
6561
6727
|
this.infiniteScroll = true;
|
|
6562
6728
|
this.scrollHeight = 'flex';
|
|
6563
|
-
this.
|
|
6729
|
+
this.tableFullHeightOffset = (_e = this.descriptor.tableFullHeightOffset) !== null && _e !== void 0 ? _e : 315;
|
|
6730
|
+
this.rowHeight = (_f = this.descriptor.rowHeight) !== null && _f !== void 0 ? _f : 45;
|
|
6564
6731
|
this.useQueryParams = false;
|
|
6565
6732
|
}
|
|
6566
6733
|
// check if data provider is supplied, if is, use it primarily
|
|
@@ -6584,8 +6751,8 @@ class MngTableComponent {
|
|
|
6584
6751
|
if (this.queryResult) {
|
|
6585
6752
|
this.queryResult$ = this.queryResult instanceof Observable ? this.queryResult : of(this.queryResult);
|
|
6586
6753
|
}
|
|
6587
|
-
else
|
|
6588
|
-
this.queryResult$ = (this.items
|
|
6754
|
+
else {
|
|
6755
|
+
this.queryResult$ = (isObservable(this.items) ? this.items : this.itemsSubject.asObservable()).pipe(
|
|
6589
6756
|
// distinctUntilChanged((v1, v2) => v1.length === v2.length &&
|
|
6590
6757
|
// v1.every((v1i, idx) => v1i[this.descriptor.dataKeyProperty] === v2[idx][this.descriptor.dataKeyProperty])),
|
|
6591
6758
|
map(items => {
|
|
@@ -6594,13 +6761,16 @@ class MngTableComponent {
|
|
|
6594
6761
|
queryResult.allDataCount = items.length;
|
|
6595
6762
|
return queryResult;
|
|
6596
6763
|
}));
|
|
6764
|
+
if (!isObservable(this.items)) {
|
|
6765
|
+
this.itemsSubject.next((_g = this.items) !== null && _g !== void 0 ? _g : []);
|
|
6766
|
+
}
|
|
6597
6767
|
}
|
|
6598
6768
|
if (typeof this.loading !== 'undefined') {
|
|
6599
6769
|
this.loading$ = this.loading instanceof Observable ? this.loading : of(this.loading);
|
|
6600
6770
|
}
|
|
6601
6771
|
}
|
|
6602
6772
|
if (this.useQueryParams) {
|
|
6603
|
-
const subscription = this.
|
|
6773
|
+
const subscription = this.route.queryParams.subscribe(qp => {
|
|
6604
6774
|
this.loadTableFromRouteUpdate(qp);
|
|
6605
6775
|
});
|
|
6606
6776
|
this.subscriptions.push(subscription);
|
|
@@ -6621,10 +6791,18 @@ class MngTableComponent {
|
|
|
6621
6791
|
break;
|
|
6622
6792
|
case 'columnAction':
|
|
6623
6793
|
this.columnActionTemplate = template.template;
|
|
6794
|
+
if (!this.showInlineActionsColumn) {
|
|
6795
|
+
this.showInlineActionsColumn = true;
|
|
6796
|
+
}
|
|
6624
6797
|
break;
|
|
6625
6798
|
}
|
|
6626
6799
|
});
|
|
6627
6800
|
}
|
|
6801
|
+
ngOnChanges(changes) {
|
|
6802
|
+
if (changes['items'] && !changes['items'].firstChange && Array.isArray(changes['items'].currentValue)) {
|
|
6803
|
+
this.itemsSubject.next(changes['items'].currentValue);
|
|
6804
|
+
}
|
|
6805
|
+
}
|
|
6628
6806
|
ngOnDestroy() {
|
|
6629
6807
|
var _a;
|
|
6630
6808
|
(_a = this.dataProviderSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
@@ -6643,7 +6821,7 @@ class MngTableComponent {
|
|
|
6643
6821
|
event.multiSortMeta = this.getDefaultSortMeta();
|
|
6644
6822
|
}
|
|
6645
6823
|
this.router.navigate([], {
|
|
6646
|
-
relativeTo: this.
|
|
6824
|
+
relativeTo: this.route,
|
|
6647
6825
|
replaceUrl: true,
|
|
6648
6826
|
queryParams: MediusRestUtil.fromPrimeLazyLoadEventToAngularQueryParams(event, this.rowsPerPageOptions[0])
|
|
6649
6827
|
});
|
|
@@ -6661,9 +6839,15 @@ class MngTableComponent {
|
|
|
6661
6839
|
onTableFilter(event) {
|
|
6662
6840
|
this.isFilterChanged = true;
|
|
6663
6841
|
}
|
|
6664
|
-
onCellClick(col, item, idx) {
|
|
6842
|
+
onCellClick(event, col, item, idx) {
|
|
6843
|
+
console.log(event);
|
|
6665
6844
|
const mngEvent = new MngTableCellClickEvent(col, item, idx);
|
|
6666
6845
|
this.cellClickEventEmitter.next(mngEvent);
|
|
6846
|
+
if (this.rowClickActions.length) {
|
|
6847
|
+
for (const action of this.rowClickActions) {
|
|
6848
|
+
this.actionExecutor.triggerRowClickAction(action, mngEvent, this.route, this.descriptor);
|
|
6849
|
+
}
|
|
6850
|
+
}
|
|
6667
6851
|
}
|
|
6668
6852
|
onSelectionChange(event) {
|
|
6669
6853
|
this.selectionChangeEventEmitter.emit(event);
|
|
@@ -6769,13 +6953,13 @@ class MngTableComponent {
|
|
|
6769
6953
|
}
|
|
6770
6954
|
}
|
|
6771
6955
|
}
|
|
6772
|
-
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 });
|
|
6773
|
-
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 });
|
|
6956
|
+
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 });
|
|
6957
|
+
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 });
|
|
6774
6958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
6775
6959
|
type: Component,
|
|
6776
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' +
|
|
6960
|
+
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" }]
|
|
6777
6961
|
}], ctorParameters: function () {
|
|
6778
|
-
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6962
|
+
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6779
6963
|
type: Optional
|
|
6780
6964
|
}] }];
|
|
6781
6965
|
}, propDecorators: { descriptor: [{
|
|
@@ -6794,6 +6978,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6794
6978
|
type: Input
|
|
6795
6979
|
}], selectionEnabled: [{
|
|
6796
6980
|
type: Input
|
|
6981
|
+
}], actions: [{
|
|
6982
|
+
type: Input
|
|
6797
6983
|
}], isColumnClickable: [{
|
|
6798
6984
|
type: Input
|
|
6799
6985
|
}], viewContainerInit: [{
|
|
@@ -6803,6 +6989,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6803
6989
|
type: Input
|
|
6804
6990
|
}], columnActionComponent: [{
|
|
6805
6991
|
type: Input
|
|
6992
|
+
}], columnActionMinWidth: [{
|
|
6993
|
+
type: Input
|
|
6806
6994
|
}], loadEventEmitter: [{
|
|
6807
6995
|
type: Output,
|
|
6808
6996
|
args: ['tableLoad']
|
|
@@ -6839,7 +7027,6 @@ class MngTableviewComponent {
|
|
|
6839
7027
|
this.actionExecutor = actionExecutor;
|
|
6840
7028
|
this.viewContainerService = viewContainerService;
|
|
6841
7029
|
this.actions = [];
|
|
6842
|
-
this.tableComponent = null;
|
|
6843
7030
|
this.rowClickActions = [];
|
|
6844
7031
|
this.rowInlineActions = [];
|
|
6845
7032
|
this.toolbarLeftActions = [];
|
|
@@ -6886,19 +7073,12 @@ class MngTableviewComponent {
|
|
|
6886
7073
|
var _a;
|
|
6887
7074
|
(_a = this.tableComponent) === null || _a === void 0 ? void 0 : _a.reload();
|
|
6888
7075
|
}
|
|
6889
|
-
onTableCellClick(event) {
|
|
6890
|
-
if (this.rowClickActions.length) {
|
|
6891
|
-
for (const action of this.rowClickActions) {
|
|
6892
|
-
this.actionExecutor.triggerRowClickAction(action, event, this.route, this.descriptor.table);
|
|
6893
|
-
}
|
|
6894
|
-
}
|
|
6895
|
-
}
|
|
6896
7076
|
}
|
|
6897
7077
|
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 });
|
|
6898
|
-
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
|
|
7078
|
+
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 } });
|
|
6899
7079
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
6900
7080
|
type: Component,
|
|
6901
|
-
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
|
|
7081
|
+
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" }]
|
|
6902
7082
|
}], 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: [{
|
|
6903
7083
|
type: Input
|
|
6904
7084
|
}], dataProvider: [{
|
|
@@ -7150,7 +7330,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
7150
7330
|
}
|
|
7151
7331
|
}
|
|
7152
7332
|
MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
7153
|
-
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 });
|
|
7333
|
+
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 });
|
|
7154
7334
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
|
|
7155
7335
|
type: Component,
|
|
7156
7336
|
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" }]
|
|
@@ -7167,9 +7347,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7167
7347
|
this.actionExecutor = actionExecutor;
|
|
7168
7348
|
this.itemsSubject = new ReplaySubject(1);
|
|
7169
7349
|
this.items$ = this.itemsSubject.asObservable();
|
|
7350
|
+
this.actions = [];
|
|
7170
7351
|
this.toolbarRightActions = [];
|
|
7171
|
-
this.rowClickActions = [];
|
|
7172
|
-
this.rowInlineActions = [];
|
|
7173
7352
|
this.subscriptions = [];
|
|
7174
7353
|
this.isDisabledSubject = new BehaviorSubject(false);
|
|
7175
7354
|
this.isEnabled$ = this.isDisabledSubject.asObservable().pipe(distinctUntilChanged(), map(e => !e));
|
|
@@ -7187,7 +7366,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7187
7366
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
7188
7367
|
.withDialogSize(DialogSizeEnum.Small);
|
|
7189
7368
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitDescriptor.TypeEnum.Cancel)]);
|
|
7190
|
-
this.
|
|
7369
|
+
this.actions.push(viewAction);
|
|
7191
7370
|
}
|
|
7192
7371
|
if (hasAddAction) {
|
|
7193
7372
|
const addAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.addEditor, 'add', this.descriptor.editor.model.type, this.descriptor.property)
|
|
@@ -7210,10 +7389,11 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7210
7389
|
})
|
|
7211
7390
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
|
|
7212
7391
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7213
|
-
this.
|
|
7392
|
+
this.actions.push(addAction);
|
|
7214
7393
|
}
|
|
7215
7394
|
if (hasEditAction) {
|
|
7216
7395
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
7396
|
+
.withPosition(ActionPositionEnum.RowInline)
|
|
7217
7397
|
.withTitle(null)
|
|
7218
7398
|
.withIcon('pi pi-pencil')
|
|
7219
7399
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
@@ -7232,49 +7412,48 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7232
7412
|
})
|
|
7233
7413
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.disabled)); })
|
|
7234
7414
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7235
|
-
this.
|
|
7415
|
+
this.actions.push(editAction);
|
|
7236
7416
|
}
|
|
7237
7417
|
if (hasDeleteAction) {
|
|
7238
7418
|
const deleteAction = new ActionDescriptor(this.descriptor.tableviewDescriptor.model, 'delete', this.descriptor.editor.model.type, this.descriptor.property)
|
|
7419
|
+
.withPosition(ActionPositionEnum.RowInline)
|
|
7239
7420
|
.withLevel(ActionLevelEnum.Danger)
|
|
7240
7421
|
.withTitle(null)
|
|
7241
7422
|
.withIcon('pi pi-trash')
|
|
7242
7423
|
.withSize(SizeEnum.ExtraSmall)
|
|
7243
7424
|
.withRunFunction(ctx => {
|
|
7244
|
-
var _a;
|
|
7425
|
+
var _a, _b;
|
|
7245
7426
|
if (!((_a = ctx.data) === null || _a === void 0 ? void 0 : _a.item)) {
|
|
7246
|
-
|
|
7427
|
+
return throwError(() => new Error(`No item was provided in context, delete cannot be done.`));
|
|
7247
7428
|
}
|
|
7248
7429
|
let formControlValue = this.formControl.value;
|
|
7249
7430
|
const compareProperty = this.descriptor.tableDescriptor.dataKeyProperty
|
|
7250
7431
|
? this.descriptor.tableDescriptor.dataKeyProperty
|
|
7251
7432
|
: this.descriptor.tableDescriptor.model.idPropertyName;
|
|
7252
|
-
if (!compareProperty) {
|
|
7253
|
-
throw new Error('Cannot compare items, please provide main table data key property or model id property.');
|
|
7254
|
-
}
|
|
7255
7433
|
const ctxItem = ctx.data.item;
|
|
7256
|
-
if (
|
|
7257
|
-
|
|
7434
|
+
if (compareProperty && (ctxItem === null || ctxItem === void 0 ? void 0 : ctxItem[compareProperty])) {
|
|
7435
|
+
formControlValue = formControlValue.filter((i) => i[compareProperty] !== ctxItem[compareProperty]);
|
|
7436
|
+
this.formControl.patchValue(formControlValue);
|
|
7258
7437
|
}
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7438
|
+
else if (typeof ((_b = ctx.data.actionData) === null || _b === void 0 ? void 0 : _b['itemIndex']) === 'number') {
|
|
7439
|
+
formControlValue.splice(ctx.data.actionData['itemIndex'], 1);
|
|
7440
|
+
this.formControl.patchValue([...formControlValue]);
|
|
7441
|
+
}
|
|
7442
|
+
else {
|
|
7443
|
+
return throwError(() => new Error('Cannot compare items, please provide main table data key property or model id property.'));
|
|
7444
|
+
}
|
|
7445
|
+
return of(ctxItem);
|
|
7262
7446
|
})
|
|
7263
7447
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
|
|
7264
7448
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
7265
|
-
this.
|
|
7449
|
+
this.actions.push(deleteAction);
|
|
7266
7450
|
}
|
|
7267
|
-
|
|
7451
|
+
this.actions.push(...this.descriptor.actions);
|
|
7452
|
+
for (const action of this.actions) {
|
|
7268
7453
|
switch (action.position) {
|
|
7269
7454
|
case ActionPositionEnum.ToolbarRight:
|
|
7270
7455
|
this.toolbarRightActions.push(action);
|
|
7271
7456
|
break;
|
|
7272
|
-
case ActionPositionEnum.RowInline:
|
|
7273
|
-
this.rowInlineActions.push(action);
|
|
7274
|
-
break;
|
|
7275
|
-
case ActionPositionEnum.RowClick:
|
|
7276
|
-
// this.footerRightActions.push(action);
|
|
7277
|
-
break;
|
|
7278
7457
|
}
|
|
7279
7458
|
}
|
|
7280
7459
|
// init values
|
|
@@ -7299,20 +7478,12 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
7299
7478
|
ngOnDestroy() {
|
|
7300
7479
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
7301
7480
|
}
|
|
7302
|
-
onTableCellClick(event) {
|
|
7303
|
-
console.log(event);
|
|
7304
|
-
if (this.rowClickActions.length) {
|
|
7305
|
-
for (const action of this.rowClickActions) {
|
|
7306
|
-
this.actionExecutor.triggerRowClickAction(action, event);
|
|
7307
|
-
}
|
|
7308
|
-
}
|
|
7309
|
-
}
|
|
7310
7481
|
}
|
|
7311
7482
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7312
|
-
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$\"
|
|
7483
|
+
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 });
|
|
7313
7484
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
7314
7485
|
type: Component,
|
|
7315
|
-
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\"
|
|
7486
|
+
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"] }]
|
|
7316
7487
|
}], ctorParameters: function () { return [{ type: MngActionExecutorService }]; } });
|
|
7317
7488
|
|
|
7318
7489
|
class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
@@ -7423,7 +7594,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
7423
7594
|
}
|
|
7424
7595
|
}
|
|
7425
7596
|
MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
7426
|
-
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 });
|
|
7597
|
+
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 });
|
|
7427
7598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
|
|
7428
7599
|
type: Component,
|
|
7429
7600
|
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" }]
|
|
@@ -8222,8 +8393,8 @@ function getEmailValidationMessage(translate) {
|
|
|
8222
8393
|
const getFormlyValidationMessages = (translate) => {
|
|
8223
8394
|
return [
|
|
8224
8395
|
{ name: 'required', message: getRequiredValidationMessage(translate) },
|
|
8225
|
-
{ name: '
|
|
8226
|
-
{ name: '
|
|
8396
|
+
{ name: 'minLength', message: getMinLengthValidationMessage(translate) },
|
|
8397
|
+
{ name: 'maxLength', message: getMaxLengthValidationMessage(translate) },
|
|
8227
8398
|
{ name: 'pattern', message: getTextPatternValidationMessage(translate) },
|
|
8228
8399
|
{ name: 'email', message: getEmailValidationMessage(translate) }
|
|
8229
8400
|
];
|