@mediusinc/mng-commons 0.13.0 → 0.14.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/utils/medius-rest.util.mjs +8 -3
- package/esm2020/lib/components/action/action.component.mjs +17 -4
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +1 -1
- package/esm2020/lib/components/action/models/action-execution.model.mjs +6 -1
- package/esm2020/lib/components/action/models/index.mjs +2 -1
- package/esm2020/lib/components/action/models/tableview-action-default-categories.model.mjs +11 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +1 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -10
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +5 -13
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +5 -2
- package/esm2020/lib/components/tableview/table/table.component.mjs +48 -20
- package/esm2020/lib/components/tableview/tableview.component.mjs +9 -3
- package/esm2020/lib/data-providers/table.data-provider.mjs +9 -2
- package/esm2020/lib/data-providers/tableview.data-provider.mjs +30 -2
- package/esm2020/lib/descriptors/action.descriptor.mjs +11 -1
- package/esm2020/lib/descriptors/column.descriptor.mjs +106 -29
- package/esm2020/lib/descriptors/editor.descriptor.mjs +109 -7
- package/esm2020/lib/descriptors/field.descriptor.mjs +38 -4
- package/esm2020/lib/descriptors/filter.descriptor.mjs +13 -6
- package/esm2020/lib/descriptors/index.mjs +2 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +282 -16
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +175 -3
- package/esm2020/lib/descriptors/types/table.type.mjs +10 -1
- package/esm2020/lib/mng-commons.module.mjs +5 -1
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/tableview-attr.model.mjs +2 -0
- package/esm2020/lib/pipes/class-map.pipe.mjs +22 -0
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +41 -17
- package/esm2020/lib/services/action-executor.service.mjs +1 -1
- package/esm2020/lib/utils/tableview.util.mjs +144 -0
- package/fesm2015/mediusinc-mng-commons.mjs +1095 -128
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1077 -117
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +1 -0
- package/lib/components/action/action.component.d.ts +2 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/action/models/index.d.ts +1 -0
- package/lib/components/action/models/tableview-action-default-categories.model.d.ts +10 -0
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +9 -4
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -5
- package/lib/components/tableview/table/table.component.d.ts +4 -2
- package/lib/components/tableview/tableview.component.d.ts +3 -0
- package/lib/data-providers/table.data-provider.d.ts +6 -1
- package/lib/data-providers/tableview.data-provider.d.ts +16 -2
- package/lib/descriptors/action.descriptor.d.ts +4 -0
- package/lib/descriptors/column.descriptor.d.ts +39 -5
- package/lib/descriptors/editor.descriptor.d.ts +69 -11
- package/lib/descriptors/field.descriptor.d.ts +7 -2
- package/lib/descriptors/filter.descriptor.d.ts +7 -6
- package/lib/descriptors/index.d.ts +1 -1
- package/lib/descriptors/table.descriptor.d.ts +124 -8
- package/lib/descriptors/tableview.descriptor.d.ts +81 -7
- package/lib/descriptors/types/table.type.d.ts +8 -0
- package/lib/mng-commons.module.d.ts +72 -71
- package/lib/models/index.d.ts +1 -0
- package/lib/models/tableview-attr.model.d.ts +9 -0
- package/lib/pipes/class-map.pipe.d.ts +7 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/router/models/router.model.d.ts +6 -0
- package/lib/router/tableview-route-builder.d.ts +3 -0
- package/lib/utils/tableview.util.d.ts +39 -0
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_tableview.scss +17 -0
- package/version-info.json +5 -5
|
@@ -3,11 +3,11 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import * as i1$3 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
6
|
+
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, inject, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
7
7
|
import * as i2$1 from '@angular/forms';
|
|
8
8
|
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
|
-
import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
10
|
+
import { NavigationEnd, ActivatedRoute, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
11
11
|
import * as i2$2 from '@ngx-formly/core';
|
|
12
12
|
import { FieldWrapper, FieldType, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
|
|
13
13
|
import * as i1$2 from '@ngx-translate/core';
|
|
@@ -523,28 +523,63 @@ class TableDataProvider extends DataProvider {
|
|
|
523
523
|
constructor(modelType, serviceType) {
|
|
524
524
|
super(modelType, serviceType);
|
|
525
525
|
this._getAll = () => of(new MediusQueryResult());
|
|
526
|
+
this._getAllReloadSubject = new Subject();
|
|
526
527
|
}
|
|
527
528
|
get getAll() {
|
|
528
529
|
return this._getAll;
|
|
529
530
|
}
|
|
531
|
+
get getAllReload$() {
|
|
532
|
+
return this._getAllReloadSubject.asObservable();
|
|
533
|
+
}
|
|
530
534
|
withGetAll(getAll) {
|
|
531
535
|
this._getAll = getAll;
|
|
532
536
|
return this;
|
|
533
537
|
}
|
|
538
|
+
getAllReload(queryParam) {
|
|
539
|
+
this._getAllReloadSubject.next(queryParam);
|
|
540
|
+
}
|
|
534
541
|
}
|
|
535
542
|
|
|
536
543
|
class TableviewDataProvider extends EditorDataProvider {
|
|
537
544
|
constructor(modelType, serviceType) {
|
|
538
545
|
super(modelType, serviceType);
|
|
539
546
|
this._getAll = () => of(new MediusQueryResult());
|
|
547
|
+
this._getAllReloadSubject = new Subject();
|
|
540
548
|
}
|
|
541
549
|
get getAll() {
|
|
542
550
|
return this._getAll;
|
|
543
551
|
}
|
|
552
|
+
get getAllReload$() {
|
|
553
|
+
return this._getAllReloadSubject.asObservable();
|
|
554
|
+
}
|
|
544
555
|
withGetAll(getAll) {
|
|
545
556
|
this._getAll = getAll;
|
|
546
557
|
return this;
|
|
547
558
|
}
|
|
559
|
+
getAllReload(queryParam) {
|
|
560
|
+
this._getAllReloadSubject.next(queryParam);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
564
|
+
constructor() {
|
|
565
|
+
super({});
|
|
566
|
+
this._getAll = () => of(new MediusQueryResult());
|
|
567
|
+
this._fetch = () => of({});
|
|
568
|
+
}
|
|
569
|
+
withGetAll(getAll) {
|
|
570
|
+
this._getAll = getAll;
|
|
571
|
+
return this;
|
|
572
|
+
}
|
|
573
|
+
withFetch(fetch) {
|
|
574
|
+
this._fetch = fetch;
|
|
575
|
+
return this;
|
|
576
|
+
}
|
|
577
|
+
get getAll() {
|
|
578
|
+
return this._getAll;
|
|
579
|
+
}
|
|
580
|
+
get fetch() {
|
|
581
|
+
return this._fetch;
|
|
582
|
+
}
|
|
548
583
|
}
|
|
549
584
|
|
|
550
585
|
class TableviewCrudDataProvider extends TableviewDataProvider {
|
|
@@ -841,6 +876,15 @@ var TableSizeEnum;
|
|
|
841
876
|
TableSizeEnum[TableSizeEnum["Normal"] = 1] = "Normal";
|
|
842
877
|
TableSizeEnum[TableSizeEnum["Large"] = 2] = "Large";
|
|
843
878
|
})(TableSizeEnum || (TableSizeEnum = {}));
|
|
879
|
+
/**
|
|
880
|
+
* EXCLUDE default, all columns has sort and filter on by default, developer EXCLUDES properties from sort/filter
|
|
881
|
+
* INCLUDE_ONLY only selected columns have sort/filter, developers INCLUDES properties
|
|
882
|
+
*/
|
|
883
|
+
var TableDynamicColumnsModeEnum;
|
|
884
|
+
(function (TableDynamicColumnsModeEnum) {
|
|
885
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["EXCLUDE"] = 0] = "EXCLUDE";
|
|
886
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["INCLUDE_ONLY"] = 1] = "INCLUDE_ONLY";
|
|
887
|
+
})(TableDynamicColumnsModeEnum || (TableDynamicColumnsModeEnum = {}));
|
|
844
888
|
|
|
845
889
|
class StylesUtil {
|
|
846
890
|
static calculateTableColumnActionWidth(table, actions) {
|
|
@@ -1159,6 +1203,8 @@ class ActionDescriptor {
|
|
|
1159
1203
|
this._hasRunNotificationError = true;
|
|
1160
1204
|
//button
|
|
1161
1205
|
this._buttonDescriptor = new ButtonDescriptor();
|
|
1206
|
+
// multiple row selection
|
|
1207
|
+
this._hasItemsSelection = false;
|
|
1162
1208
|
this._model = model;
|
|
1163
1209
|
this._actionName = actionName;
|
|
1164
1210
|
if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
|
|
@@ -1270,6 +1316,9 @@ class ActionDescriptor {
|
|
|
1270
1316
|
get permissionsRouteType() {
|
|
1271
1317
|
return this._permissionsRouteType;
|
|
1272
1318
|
}
|
|
1319
|
+
get hasItemsSelection() {
|
|
1320
|
+
return this._hasItemsSelection;
|
|
1321
|
+
}
|
|
1273
1322
|
get buttonDescriptor() {
|
|
1274
1323
|
return this._buttonDescriptor;
|
|
1275
1324
|
}
|
|
@@ -1357,6 +1406,11 @@ class ActionDescriptor {
|
|
|
1357
1406
|
this._buttonDescriptor = buttonDescriptor;
|
|
1358
1407
|
return this;
|
|
1359
1408
|
}
|
|
1409
|
+
withItemsSelection(hasSelection = true) {
|
|
1410
|
+
this._hasItemsSelection = hasSelection;
|
|
1411
|
+
this._isEnabledFunction = this._isEnabledFunction ?? (ctx => of((ctx.parameters.selectedItems?.length ?? 0) > 0));
|
|
1412
|
+
return this;
|
|
1413
|
+
}
|
|
1360
1414
|
}
|
|
1361
1415
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1362
1416
|
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
@@ -1655,11 +1709,152 @@ class ActionLinkDescriptor extends ActionDescriptor {
|
|
|
1655
1709
|
}
|
|
1656
1710
|
}
|
|
1657
1711
|
|
|
1712
|
+
class TableviewUtil {
|
|
1713
|
+
/**
|
|
1714
|
+
* returns attributes from class type and extends to typed def with column and field enum type
|
|
1715
|
+
* @param modelType class type
|
|
1716
|
+
*/
|
|
1717
|
+
static getAttributeDefMap(modelType) {
|
|
1718
|
+
return TableviewUtil.expandAttributeDefWithTableviewTypes(ObjectSerializer.get().findAttributesDefinitionByClassType(modelType));
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* expands AttributeDef to TableviewAttributeDef with defined input and column enum type
|
|
1722
|
+
* @param attributes open api specification model
|
|
1723
|
+
*/
|
|
1724
|
+
static expandAttributeDefWithTableviewTypes(attributes) {
|
|
1725
|
+
if (attributes == null) {
|
|
1726
|
+
throw new Error('AttributeDef is null, problem with ObjectSerializer::findAttributesDefinitionByClassType?');
|
|
1727
|
+
}
|
|
1728
|
+
const objectSerializer = ObjectSerializer.get();
|
|
1729
|
+
const tableviewAttributeDef = [];
|
|
1730
|
+
for (const attribute of attributes) {
|
|
1731
|
+
const enumType = objectSerializer.findEnum(attribute.type);
|
|
1732
|
+
tableviewAttributeDef.push({
|
|
1733
|
+
name: attribute.name,
|
|
1734
|
+
baseName: attribute.baseName,
|
|
1735
|
+
type: attribute.type,
|
|
1736
|
+
columnType: enumType ? ColumnTypeEnum.Enum : TableviewUtil.toColumnType(attribute.type),
|
|
1737
|
+
fieldType: TableviewUtil.toFieldInputType(attribute.type),
|
|
1738
|
+
enumType: objectSerializer.findEnum(attribute.type),
|
|
1739
|
+
classType: objectSerializer.findType(attribute.type)
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
return tableviewAttributeDef;
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* converts column to number or date on value based
|
|
1746
|
+
* @param column column to be transformed
|
|
1747
|
+
* @param value value to check if applicable
|
|
1748
|
+
*/
|
|
1749
|
+
static stringColumnConverter(column, value) {
|
|
1750
|
+
if (typeof value === 'boolean') {
|
|
1751
|
+
return column.asBoolean();
|
|
1752
|
+
}
|
|
1753
|
+
else if (!isNaN(value) && typeof value === 'number') {
|
|
1754
|
+
return column.asNumber();
|
|
1755
|
+
}
|
|
1756
|
+
else if (this._dateRegex.test(value)) {
|
|
1757
|
+
return column.asDate();
|
|
1758
|
+
}
|
|
1759
|
+
else {
|
|
1760
|
+
return column;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* converts string type to column type enum, default is string
|
|
1765
|
+
* @param property
|
|
1766
|
+
*/
|
|
1767
|
+
static toColumnType(property) {
|
|
1768
|
+
const os = ObjectSerializer.get();
|
|
1769
|
+
if (os.findEnum(property)) {
|
|
1770
|
+
property = 'enum';
|
|
1771
|
+
}
|
|
1772
|
+
else if (os.findType(property)) {
|
|
1773
|
+
property = 'class';
|
|
1774
|
+
}
|
|
1775
|
+
switch (property) {
|
|
1776
|
+
case 'number':
|
|
1777
|
+
return ColumnTypeEnum.Number;
|
|
1778
|
+
case 'currency':
|
|
1779
|
+
return ColumnTypeEnum.Currency;
|
|
1780
|
+
case 'boolean':
|
|
1781
|
+
return ColumnTypeEnum.Boolean;
|
|
1782
|
+
case 'date':
|
|
1783
|
+
return ColumnTypeEnum.Date;
|
|
1784
|
+
case 'enum':
|
|
1785
|
+
return ColumnTypeEnum.Enum;
|
|
1786
|
+
case 'custom':
|
|
1787
|
+
return ColumnTypeEnum.Custom;
|
|
1788
|
+
case 'class':
|
|
1789
|
+
return ColumnTypeEnum.String;
|
|
1790
|
+
case 'string':
|
|
1791
|
+
default:
|
|
1792
|
+
return ColumnTypeEnum.String;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* converts string type to type enum, default is text
|
|
1797
|
+
* @param property
|
|
1798
|
+
*/
|
|
1799
|
+
static toFieldInputType(property) {
|
|
1800
|
+
switch (property) {
|
|
1801
|
+
case 'hidden':
|
|
1802
|
+
return FieldInputTypeEnum.Hidden;
|
|
1803
|
+
case 'label':
|
|
1804
|
+
return FieldInputTypeEnum.Label;
|
|
1805
|
+
case 'textarea':
|
|
1806
|
+
return FieldInputTypeEnum.Textarea;
|
|
1807
|
+
case 'number':
|
|
1808
|
+
return FieldInputTypeEnum.Number;
|
|
1809
|
+
case 'currency':
|
|
1810
|
+
return FieldInputTypeEnum.Currency;
|
|
1811
|
+
case 'switch':
|
|
1812
|
+
case 'boolean':
|
|
1813
|
+
return FieldInputTypeEnum.Switch;
|
|
1814
|
+
case 'radio':
|
|
1815
|
+
return FieldInputTypeEnum.Radio;
|
|
1816
|
+
case 'datepicker':
|
|
1817
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1818
|
+
case 'mask':
|
|
1819
|
+
return FieldInputTypeEnum.Mask;
|
|
1820
|
+
case 'file':
|
|
1821
|
+
return FieldInputTypeEnum.File;
|
|
1822
|
+
case 'custom':
|
|
1823
|
+
return FieldInputTypeEnum.Custom;
|
|
1824
|
+
case 'text':
|
|
1825
|
+
default:
|
|
1826
|
+
return FieldInputTypeEnum.Text;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* convert column type to equivalent field input type
|
|
1831
|
+
* @param type column type
|
|
1832
|
+
*/
|
|
1833
|
+
static toFieldInputTypeFromColumnType(type) {
|
|
1834
|
+
switch (type) {
|
|
1835
|
+
case ColumnTypeEnum.Number:
|
|
1836
|
+
return FieldInputTypeEnum.Number;
|
|
1837
|
+
case ColumnTypeEnum.Currency:
|
|
1838
|
+
return FieldInputTypeEnum.Currency;
|
|
1839
|
+
case ColumnTypeEnum.Boolean:
|
|
1840
|
+
return FieldInputTypeEnum.Switch;
|
|
1841
|
+
case ColumnTypeEnum.Date:
|
|
1842
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1843
|
+
case ColumnTypeEnum.Custom:
|
|
1844
|
+
return FieldInputTypeEnum.Custom;
|
|
1845
|
+
case ColumnTypeEnum.String:
|
|
1846
|
+
case ColumnTypeEnum.Enum:
|
|
1847
|
+
default:
|
|
1848
|
+
return FieldInputTypeEnum.Text;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
TableviewUtil._dateRegex = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
|
|
1853
|
+
|
|
1658
1854
|
class FilterDescriptor {
|
|
1659
1855
|
constructor(property) {
|
|
1660
1856
|
this._filterType = FilterTypeEnum.String;
|
|
1661
1857
|
this._hasDefaultValue = false;
|
|
1662
|
-
this._defaultFilterMatchMode = FilterMatchModeEnum.Equals;
|
|
1663
1858
|
this._matchModes = null;
|
|
1664
1859
|
this._numberUseGrouping = true;
|
|
1665
1860
|
this._datePickerShowTime = false;
|
|
@@ -1735,13 +1930,11 @@ class FilterDescriptor {
|
|
|
1735
1930
|
this._filterProperty = filterProperty;
|
|
1736
1931
|
return this;
|
|
1737
1932
|
}
|
|
1738
|
-
withDefaultFilter(filterValue, filterValueTo, filterMatchMode
|
|
1933
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
1739
1934
|
this._hasDefaultValue = true;
|
|
1740
1935
|
this._defaultValue = filterValue;
|
|
1741
1936
|
this._defaultValueTo = filterValueTo;
|
|
1742
|
-
|
|
1743
|
-
this._defaultFilterMatchMode = filterMatchMode;
|
|
1744
|
-
}
|
|
1937
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
1745
1938
|
return this;
|
|
1746
1939
|
}
|
|
1747
1940
|
withNumberFractions(min, max) {
|
|
@@ -1888,6 +2081,16 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1888
2081
|
this._dropdownClassName = dropdownClassName;
|
|
1889
2082
|
return this;
|
|
1890
2083
|
}
|
|
2084
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
2085
|
+
this._hasDefaultValue = true;
|
|
2086
|
+
this._defaultValue = filterValue;
|
|
2087
|
+
this._defaultValueTo = filterValueTo;
|
|
2088
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
2089
|
+
if (Array.isArray(filterValue) && !this.multiselect) {
|
|
2090
|
+
throw new Error('Array default filter can only be used with a multiselect filter.');
|
|
2091
|
+
}
|
|
2092
|
+
return this;
|
|
2093
|
+
}
|
|
1891
2094
|
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
1892
2095
|
this._lookupType = FilterLookupTypeEnum.Autocomplete;
|
|
1893
2096
|
this._autocompleteOpenOnFocus = openOnFocus;
|
|
@@ -2047,9 +2250,29 @@ class ColumnDescriptor {
|
|
|
2047
2250
|
get getter() {
|
|
2048
2251
|
return this._getter;
|
|
2049
2252
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2253
|
+
/**
|
|
2254
|
+
* converts column to given type with additional arguments
|
|
2255
|
+
* @param type column type enum
|
|
2256
|
+
* @param args any additional arguments for column (optional)
|
|
2257
|
+
*/
|
|
2258
|
+
asType(type, ...args) {
|
|
2259
|
+
switch (type) {
|
|
2260
|
+
case ColumnTypeEnum.Number:
|
|
2261
|
+
return this.asNumber(...args);
|
|
2262
|
+
case ColumnTypeEnum.Currency:
|
|
2263
|
+
return this.asCurrency(...args);
|
|
2264
|
+
case ColumnTypeEnum.Boolean:
|
|
2265
|
+
return this.asBoolean(...args);
|
|
2266
|
+
case ColumnTypeEnum.Date:
|
|
2267
|
+
return this.asDate(...args);
|
|
2268
|
+
case ColumnTypeEnum.Enum:
|
|
2269
|
+
return this.asEnum(args[0], args[1], args[2]);
|
|
2270
|
+
case ColumnTypeEnum.Custom:
|
|
2271
|
+
return this.asCustomComponent(args[0]);
|
|
2272
|
+
case ColumnTypeEnum.String:
|
|
2273
|
+
default:
|
|
2274
|
+
return this;
|
|
2275
|
+
}
|
|
2053
2276
|
}
|
|
2054
2277
|
asNumber(displayFormat = '1.0-0', locale) {
|
|
2055
2278
|
this._columnType = ColumnTypeEnum.Number;
|
|
@@ -2190,32 +2413,88 @@ class ColumnDescriptor {
|
|
|
2190
2413
|
}
|
|
2191
2414
|
copy() {
|
|
2192
2415
|
const descriptor = new ColumnDescriptor(this._table, this._property);
|
|
2193
|
-
|
|
2416
|
+
this.copyFieldsTo(descriptor);
|
|
2417
|
+
return descriptor;
|
|
2418
|
+
}
|
|
2419
|
+
copyFieldsTo(obj) {
|
|
2420
|
+
obj._jsonPath = this._jsonPath;
|
|
2421
|
+
obj._title = this._title;
|
|
2422
|
+
obj._isSortEnabled = this._isSortEnabled;
|
|
2423
|
+
obj._columnType = this._columnType;
|
|
2424
|
+
obj._filterDescriptor = this._filterDescriptor?.copy();
|
|
2425
|
+
obj._enumType = this._enumType;
|
|
2426
|
+
obj._enumTitlePath = this._enumTitlePath;
|
|
2427
|
+
obj._enumNameAsValue = this._enumNameAsValue;
|
|
2428
|
+
obj._booleanAsIcon = this._booleanAsIcon;
|
|
2429
|
+
obj._booleanYes = this._booleanYes;
|
|
2430
|
+
obj._booleanNo = this._booleanNo;
|
|
2431
|
+
obj._objectModelType = this._objectModelType;
|
|
2432
|
+
obj._objectTitleProperty = this._objectTitleProperty;
|
|
2433
|
+
obj._locale = this._locale;
|
|
2434
|
+
obj._currencyCode = this._currencyCode;
|
|
2435
|
+
obj._currencyDisplay = this._currencyDisplay;
|
|
2436
|
+
obj._currencyFromProperty = this._currencyFromProperty;
|
|
2437
|
+
obj._displayFormat = this._displayFormat;
|
|
2438
|
+
obj._headerClassName = this._headerClassName;
|
|
2439
|
+
obj._className = this._className;
|
|
2440
|
+
obj._width = this._width;
|
|
2441
|
+
obj._minWidth = this._minWidth;
|
|
2442
|
+
obj._maxWidth = this._maxWidth;
|
|
2443
|
+
obj._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2444
|
+
obj._template = this._template;
|
|
2445
|
+
obj._getter = this._getter;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
2449
|
+
// private _filterStatus;
|
|
2450
|
+
constructor(table, property) {
|
|
2451
|
+
super(table, property);
|
|
2452
|
+
this._visibility = true;
|
|
2453
|
+
this._table = table;
|
|
2454
|
+
}
|
|
2455
|
+
get visibility() {
|
|
2456
|
+
return this._visibility;
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* sets column's title and returns this column
|
|
2460
|
+
* @param title title to be set
|
|
2461
|
+
* @param override should column title if all ready set?
|
|
2462
|
+
*/
|
|
2463
|
+
withTitle(title, override = false) {
|
|
2464
|
+
if (this._title == null || override) {
|
|
2465
|
+
this._title = title;
|
|
2466
|
+
}
|
|
2467
|
+
return this;
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* defines automatic type and returns this column
|
|
2471
|
+
* @param value
|
|
2472
|
+
*/
|
|
2473
|
+
withAutomaticType(value) {
|
|
2474
|
+
TableviewUtil.stringColumnConverter(this, value);
|
|
2475
|
+
return this;
|
|
2476
|
+
}
|
|
2477
|
+
/**
|
|
2478
|
+
* sets visibility state for column and returns this column
|
|
2479
|
+
* @param visibility
|
|
2480
|
+
*/
|
|
2481
|
+
withVisibility(visibility) {
|
|
2482
|
+
this._visibility = visibility;
|
|
2483
|
+
return this;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* creates deep copy of column dynamic descriptor
|
|
2487
|
+
*/
|
|
2488
|
+
copy() {
|
|
2489
|
+
const descriptor = new ColumnDynamicDescriptor(this._table, this._property);
|
|
2490
|
+
this.copyFieldsTo(descriptor);
|
|
2194
2491
|
descriptor._title = this._title;
|
|
2195
|
-
descriptor.
|
|
2196
|
-
descriptor
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
descriptor
|
|
2200
|
-
|
|
2201
|
-
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2202
|
-
descriptor._booleanYes = this._booleanYes;
|
|
2203
|
-
descriptor._booleanNo = this._booleanNo;
|
|
2204
|
-
descriptor._objectModelType = this._objectModelType;
|
|
2205
|
-
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
2206
|
-
descriptor._locale = this._locale;
|
|
2207
|
-
descriptor._currencyCode = this._currencyCode;
|
|
2208
|
-
descriptor._currencyDisplay = this._currencyDisplay;
|
|
2209
|
-
descriptor._currencyFromProperty = this._currencyFromProperty;
|
|
2210
|
-
descriptor._displayFormat = this._displayFormat;
|
|
2211
|
-
descriptor._headerClassName = this._headerClassName;
|
|
2212
|
-
descriptor._className = this._className;
|
|
2213
|
-
descriptor._width = this._width;
|
|
2214
|
-
descriptor._minWidth = this._minWidth;
|
|
2215
|
-
descriptor._maxWidth = this._maxWidth;
|
|
2216
|
-
descriptor._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2217
|
-
descriptor._template = this._template;
|
|
2218
|
-
descriptor._getter = this._getter;
|
|
2492
|
+
descriptor._visibility = this._visibility;
|
|
2493
|
+
return descriptor;
|
|
2494
|
+
}
|
|
2495
|
+
toColumnDescriptor(tableDescriptor) {
|
|
2496
|
+
const descriptor = new ColumnDescriptor(tableDescriptor, this._property);
|
|
2497
|
+
this.copyFieldsTo(descriptor);
|
|
2219
2498
|
return descriptor;
|
|
2220
2499
|
}
|
|
2221
2500
|
}
|
|
@@ -2226,9 +2505,37 @@ class EditorDescriptor {
|
|
|
2226
2505
|
this._groups = [];
|
|
2227
2506
|
this._fields = [];
|
|
2228
2507
|
this._disabled = false;
|
|
2508
|
+
this._modelType = modelType;
|
|
2229
2509
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2230
2510
|
this._tableviewEditorType = tableviewEditorType;
|
|
2231
2511
|
}
|
|
2512
|
+
/**
|
|
2513
|
+
* auto generated editor descriptor based on openapi definition
|
|
2514
|
+
* generates all fields from definition
|
|
2515
|
+
* @param modelType class type
|
|
2516
|
+
* @param idProperty
|
|
2517
|
+
* @param titleProperty
|
|
2518
|
+
* @param tableEditorType
|
|
2519
|
+
*/
|
|
2520
|
+
static from(modelType, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2521
|
+
return EditorDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), titleProperty, idProperty, tableEditorType);
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* auto generated editor descriptor based on openapi definition
|
|
2525
|
+
* generates only selected fields
|
|
2526
|
+
* @param modelType class type
|
|
2527
|
+
* @param attributes list of selected properties to generate fields based on
|
|
2528
|
+
* @param idProperty
|
|
2529
|
+
* @param titleProperty
|
|
2530
|
+
* @param tableEditorType
|
|
2531
|
+
*/
|
|
2532
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2533
|
+
const descriptor = new EditorDescriptor(modelType, idProperty, titleProperty, tableEditorType);
|
|
2534
|
+
attributes
|
|
2535
|
+
.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array'))
|
|
2536
|
+
.forEach(attr => descriptor.upsertFieldFromAttributeDef(attr, descriptor.fields.find(col => col.property === attr.name)));
|
|
2537
|
+
return descriptor;
|
|
2538
|
+
}
|
|
2232
2539
|
get model() {
|
|
2233
2540
|
return this._model;
|
|
2234
2541
|
}
|
|
@@ -2275,20 +2582,23 @@ class EditorDescriptor {
|
|
|
2275
2582
|
this.addFieldDescriptor(field);
|
|
2276
2583
|
return field;
|
|
2277
2584
|
}
|
|
2585
|
+
/**
|
|
2586
|
+
* removes filed if exists in descriptor
|
|
2587
|
+
* @param property field name
|
|
2588
|
+
*/
|
|
2278
2589
|
removeField(property) {
|
|
2279
2590
|
const fieldIdx = this._fields.findIndex(f => f.property === property);
|
|
2280
2591
|
if (fieldIdx < 0) {
|
|
2281
2592
|
throw new Error(`Field ${property} does not exist.`);
|
|
2282
2593
|
}
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
const groupFieldIdx = field.group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2594
|
+
for (const group of this._groups) {
|
|
2595
|
+
const groupFieldIdx = group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2286
2596
|
if (groupFieldIdx >= 0) {
|
|
2287
|
-
|
|
2597
|
+
group.fields.splice(groupFieldIdx, 1);
|
|
2598
|
+
break;
|
|
2288
2599
|
}
|
|
2289
2600
|
}
|
|
2290
2601
|
this._fields.splice(fieldIdx, 1);
|
|
2291
|
-
return this;
|
|
2292
2602
|
}
|
|
2293
2603
|
getField(property) {
|
|
2294
2604
|
return this._fields.find(f => f.property === property) ?? null;
|
|
@@ -2361,6 +2671,75 @@ class EditorDescriptor {
|
|
|
2361
2671
|
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
2362
2672
|
}
|
|
2363
2673
|
}
|
|
2674
|
+
/**
|
|
2675
|
+
* modifies selected field
|
|
2676
|
+
* do not use it for enums! (use withFieldModifiedEnum instead)
|
|
2677
|
+
* @param property field name
|
|
2678
|
+
* @param fieldType new field type for selected field
|
|
2679
|
+
* @param args additional parameters for field
|
|
2680
|
+
*/
|
|
2681
|
+
withFieldModifiedType(property, fieldType, ...args) {
|
|
2682
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(attribute => attribute.name === property);
|
|
2683
|
+
if (attribute) {
|
|
2684
|
+
attribute.fieldType = fieldType;
|
|
2685
|
+
this.upsertFieldFromAttributeDef(attribute, this.fields.find(fi => fi.property === property), ...args);
|
|
2686
|
+
}
|
|
2687
|
+
return this;
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* modifies selected field with enum type
|
|
2691
|
+
* @param property field property name
|
|
2692
|
+
* @param enumType type of enum for new field
|
|
2693
|
+
* @param optionsTitlePath
|
|
2694
|
+
* @param values
|
|
2695
|
+
* @param nameAsValue
|
|
2696
|
+
*/
|
|
2697
|
+
withFieldModifiedEnum(property, enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
2698
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(a => a.name === property);
|
|
2699
|
+
if (attribute) {
|
|
2700
|
+
attribute.fieldType = FieldInputTypeEnum.Radio;
|
|
2701
|
+
const field = this.fields.find(f => f.property === property);
|
|
2702
|
+
if (field && field instanceof FieldInputDescriptor) {
|
|
2703
|
+
field.asRadioFromEnum(enumType ?? ObjectSerializer.get().findEnum(attribute.type), optionsTitlePath, values, nameAsValue);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
return this;
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* adds lookup to given field
|
|
2710
|
+
* @param property field property name
|
|
2711
|
+
* @param modelType model type of field
|
|
2712
|
+
* @param lookupProvider provider to be added to field
|
|
2713
|
+
* @param titleProperty
|
|
2714
|
+
*/
|
|
2715
|
+
withFieldModifiedLookup(property, modelType, lookupProvider, titleProperty) {
|
|
2716
|
+
this.removeField(property);
|
|
2717
|
+
const field = this.addFieldLookup(property, modelType).asAutocomplete().withLookupDataProvider(lookupProvider);
|
|
2718
|
+
if (titleProperty) {
|
|
2719
|
+
field.withItemsLabelProperty(titleProperty);
|
|
2720
|
+
}
|
|
2721
|
+
return this;
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* generates field based on attribute definition, used for auto model
|
|
2725
|
+
* @param attribute definition
|
|
2726
|
+
* @param field optional, if defined will be replaced, otherwise new will be generated
|
|
2727
|
+
* @param args additional arguments
|
|
2728
|
+
*/
|
|
2729
|
+
upsertFieldFromAttributeDef(attribute, field, ...args) {
|
|
2730
|
+
if (field == null) {
|
|
2731
|
+
field = this.addField(attribute.name);
|
|
2732
|
+
}
|
|
2733
|
+
if (field instanceof FieldInputDescriptor) {
|
|
2734
|
+
if (attribute.enumType) {
|
|
2735
|
+
return field.asRadioFromEnum(attribute.enumType);
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
return field.asType(attribute.fieldType ?? TableviewUtil.toFieldInputTypeFromColumnType(attribute.columnType), ...args);
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
return field;
|
|
2742
|
+
}
|
|
2364
2743
|
}
|
|
2365
2744
|
EditorDescriptor.defaultGroupName = '_default';
|
|
2366
2745
|
|
|
@@ -2433,9 +2812,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
2433
2812
|
get property() {
|
|
2434
2813
|
return this._property;
|
|
2435
2814
|
}
|
|
2436
|
-
get group() {
|
|
2437
|
-
return this._group;
|
|
2438
|
-
}
|
|
2439
2815
|
get label() {
|
|
2440
2816
|
return this._label;
|
|
2441
2817
|
}
|
|
@@ -2599,6 +2975,39 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2599
2975
|
this._fileMultiple = false;
|
|
2600
2976
|
this._fileMaxFileSize = 500000;
|
|
2601
2977
|
}
|
|
2978
|
+
/**
|
|
2979
|
+
* converts field to given type with additional arguments
|
|
2980
|
+
* @param fieldType field type enum
|
|
2981
|
+
* @param args any additional arguments for field (optional)
|
|
2982
|
+
*/
|
|
2983
|
+
asType(fieldType, ...args) {
|
|
2984
|
+
switch (fieldType) {
|
|
2985
|
+
case FieldInputTypeEnum.Hidden:
|
|
2986
|
+
return this.asHidden();
|
|
2987
|
+
case FieldInputTypeEnum.Label:
|
|
2988
|
+
return this.asLabel();
|
|
2989
|
+
case FieldInputTypeEnum.Textarea:
|
|
2990
|
+
return this.asTextarea(...args);
|
|
2991
|
+
case FieldInputTypeEnum.Number:
|
|
2992
|
+
return this.asNumber();
|
|
2993
|
+
case FieldInputTypeEnum.Currency:
|
|
2994
|
+
return this.asCurrency(...args);
|
|
2995
|
+
case FieldInputTypeEnum.Switch:
|
|
2996
|
+
return this.asSwitch();
|
|
2997
|
+
case FieldInputTypeEnum.Radio:
|
|
2998
|
+
return this.asRadio(args[0], args[1]);
|
|
2999
|
+
case FieldInputTypeEnum.Datepicker:
|
|
3000
|
+
return this.asDatePicker(...args);
|
|
3001
|
+
case FieldInputTypeEnum.Mask:
|
|
3002
|
+
return this.asMask(args[0], args[1]);
|
|
3003
|
+
case FieldInputTypeEnum.File:
|
|
3004
|
+
return this.asFile(...args);
|
|
3005
|
+
case FieldInputTypeEnum.Custom:
|
|
3006
|
+
return this.asCustomComponent(args[0]);
|
|
3007
|
+
case FieldInputTypeEnum.Text:
|
|
3008
|
+
return this.asText();
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
2602
3011
|
get fieldType() {
|
|
2603
3012
|
return this._fieldType;
|
|
2604
3013
|
}
|
|
@@ -3132,6 +3541,10 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
3132
3541
|
this._name = `${this.baseName}${name}`;
|
|
3133
3542
|
this._default = name === EditorDescriptor.defaultGroupName;
|
|
3134
3543
|
}
|
|
3544
|
+
removeField(property, filterFunction) {
|
|
3545
|
+
this._fields = filterFunction(this._fields);
|
|
3546
|
+
return this._fields;
|
|
3547
|
+
}
|
|
3135
3548
|
get title() {
|
|
3136
3549
|
return this._title;
|
|
3137
3550
|
}
|
|
@@ -3281,9 +3694,33 @@ class TableDescriptor {
|
|
|
3281
3694
|
this._size = TableSizeEnum.Large;
|
|
3282
3695
|
this._hasHover = true;
|
|
3283
3696
|
this._hasGridlines = false;
|
|
3697
|
+
this._autoGenerated = false;
|
|
3698
|
+
this._modelType = modelType;
|
|
3284
3699
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3285
3700
|
this._dataKeyProperty = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
3286
3701
|
}
|
|
3702
|
+
/**
|
|
3703
|
+
* generates descriptor based on modelType attribute definition
|
|
3704
|
+
* @param modelType class type
|
|
3705
|
+
* @param idProperty
|
|
3706
|
+
* @param titleProperty
|
|
3707
|
+
*/
|
|
3708
|
+
static from(modelType, idProperty, titleProperty) {
|
|
3709
|
+
return TableDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), idProperty, titleProperty);
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* generates descriptor base on given attribute definition
|
|
3713
|
+
* @param modelType class type
|
|
3714
|
+
* @param attributes attributes from which descriptor is generated
|
|
3715
|
+
* @param idProperty
|
|
3716
|
+
* @param titleProperty
|
|
3717
|
+
*/
|
|
3718
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty) {
|
|
3719
|
+
const descriptor = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3720
|
+
descriptor._autoGenerated = true;
|
|
3721
|
+
attributes.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array')).forEach(attr => descriptor.upsertColumnFromAttributeDef(attr));
|
|
3722
|
+
return descriptor;
|
|
3723
|
+
}
|
|
3287
3724
|
get filterDisplay() {
|
|
3288
3725
|
return this._filterDisplay;
|
|
3289
3726
|
}
|
|
@@ -3338,6 +3775,18 @@ class TableDescriptor {
|
|
|
3338
3775
|
get hasGridlines() {
|
|
3339
3776
|
return this._hasGridlines;
|
|
3340
3777
|
}
|
|
3778
|
+
get rowClassName() {
|
|
3779
|
+
return this._rowClassName;
|
|
3780
|
+
}
|
|
3781
|
+
get rowClassNameMapFn() {
|
|
3782
|
+
return this._rowClassNameMapFn;
|
|
3783
|
+
}
|
|
3784
|
+
get headerClassName() {
|
|
3785
|
+
return this._headerClassName;
|
|
3786
|
+
}
|
|
3787
|
+
getColumn(property) {
|
|
3788
|
+
return this._columns.find(col => col.property === property);
|
|
3789
|
+
}
|
|
3341
3790
|
addColumnDescriptor(column) {
|
|
3342
3791
|
this._columns.push(column);
|
|
3343
3792
|
return this;
|
|
@@ -3377,6 +3826,10 @@ class TableDescriptor {
|
|
|
3377
3826
|
this._columns.push(column);
|
|
3378
3827
|
return column;
|
|
3379
3828
|
}
|
|
3829
|
+
removeColumn(property) {
|
|
3830
|
+
const columndIdx = this._columns.findIndex(c => c.property === property);
|
|
3831
|
+
this._columns.splice(columndIdx, 1);
|
|
3832
|
+
}
|
|
3380
3833
|
withFilterDisplay(filterDisplayType) {
|
|
3381
3834
|
this._filterDisplay = filterDisplayType;
|
|
3382
3835
|
return this;
|
|
@@ -3439,28 +3892,252 @@ class TableDescriptor {
|
|
|
3439
3892
|
this._hasGridlines = gridlines;
|
|
3440
3893
|
return this;
|
|
3441
3894
|
}
|
|
3895
|
+
withRowClassName(rowClassName, classNameMapFn) {
|
|
3896
|
+
this._rowClassName = rowClassName;
|
|
3897
|
+
this._rowClassNameMapFn = classNameMapFn;
|
|
3898
|
+
return this;
|
|
3899
|
+
}
|
|
3900
|
+
withHeaderClassName(headerClassName) {
|
|
3901
|
+
this._headerClassName = headerClassName;
|
|
3902
|
+
return this;
|
|
3903
|
+
}
|
|
3904
|
+
copyFieldsTo(obj) {
|
|
3905
|
+
obj._title = this._title;
|
|
3906
|
+
obj._hideHeader = this._hideHeader;
|
|
3907
|
+
obj._dataKeyProperty = this._dataKeyProperty;
|
|
3908
|
+
obj._hasDefaultSort = this._hasDefaultSort;
|
|
3909
|
+
obj._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
3910
|
+
obj._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
3911
|
+
obj._filterDisplay = this._filterDisplay;
|
|
3912
|
+
obj._className = this._className;
|
|
3913
|
+
obj._size = this._size;
|
|
3914
|
+
obj._tableFullHeightOffset = this._tableFullHeightOffset;
|
|
3915
|
+
obj._rowHeight = this._rowHeight;
|
|
3916
|
+
obj._hasHover = this._hasHover;
|
|
3917
|
+
obj._hasGridlines = this._hasGridlines;
|
|
3918
|
+
}
|
|
3442
3919
|
copy() {
|
|
3443
3920
|
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
3921
|
+
this.copyFieldsTo(descriptor);
|
|
3444
3922
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
3445
|
-
descriptor
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3923
|
+
return descriptor;
|
|
3924
|
+
}
|
|
3925
|
+
/**
|
|
3926
|
+
* generates column based on attributes
|
|
3927
|
+
* @param attribute attribute map
|
|
3928
|
+
* @param column if provided, replaced by new, otherwise new is created
|
|
3929
|
+
* @param args additional parameters
|
|
3930
|
+
*/
|
|
3931
|
+
upsertColumnFromAttributeDef(attribute, column, ...args) {
|
|
3932
|
+
if (column == null) {
|
|
3933
|
+
column = this.addColumn(attribute.name);
|
|
3934
|
+
}
|
|
3935
|
+
if (attribute.columnType === ColumnTypeEnum.Enum && args.length === 0) {
|
|
3936
|
+
args = [attribute.enumType];
|
|
3937
|
+
}
|
|
3938
|
+
column = column.asType(attribute.columnType, ...args);
|
|
3939
|
+
if (attribute.classType) {
|
|
3940
|
+
column.withObjectProperty(attribute.classType).withSort();
|
|
3941
|
+
}
|
|
3942
|
+
else {
|
|
3943
|
+
column.withSort().withFilter();
|
|
3944
|
+
}
|
|
3945
|
+
return column;
|
|
3946
|
+
}
|
|
3947
|
+
/**
|
|
3948
|
+
* defines modified type of column
|
|
3949
|
+
* DO NOT USE with enum (use withCustomEnumType)
|
|
3950
|
+
* @param property column name
|
|
3951
|
+
* @param columnType modified type
|
|
3952
|
+
* @param args additional attributes
|
|
3953
|
+
*/
|
|
3954
|
+
withColumnModifiedType(property, columnType, ...args) {
|
|
3955
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
3956
|
+
if (attributeDef != null) {
|
|
3957
|
+
attributeDef.columnType = columnType ?? attributeDef.columnType;
|
|
3958
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === attributeDef.name), ...args);
|
|
3959
|
+
}
|
|
3960
|
+
return this;
|
|
3961
|
+
}
|
|
3962
|
+
/**
|
|
3963
|
+
* defines custom enum type for column
|
|
3964
|
+
* @param property column name
|
|
3965
|
+
* @param enumType
|
|
3966
|
+
*/
|
|
3967
|
+
withColumnModifiedEnum(property, enumType) {
|
|
3968
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
3969
|
+
if (attributeDef != null) {
|
|
3970
|
+
attributeDef.columnType = ColumnTypeEnum.Enum;
|
|
3971
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === property), enumType ?? ObjectSerializer.get().findEnum(attributeDef.type));
|
|
3972
|
+
}
|
|
3973
|
+
return this;
|
|
3974
|
+
}
|
|
3975
|
+
/**
|
|
3976
|
+
* modifies column with class and lookup provider
|
|
3977
|
+
* @param property column name
|
|
3978
|
+
* @param lookupProvider lookupProvider for class
|
|
3979
|
+
* @param itemsLabelProperty
|
|
3980
|
+
* @param filterProperty
|
|
3981
|
+
*/
|
|
3982
|
+
withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty) {
|
|
3983
|
+
const column = this.columns.find(col => col.property === property);
|
|
3984
|
+
if (column) {
|
|
3985
|
+
column.withFilterLookup().withLookupDataProvider(lookupProvider);
|
|
3986
|
+
if (column instanceof FilterLookupDescriptor) {
|
|
3987
|
+
if (itemsLabelProperty) {
|
|
3988
|
+
column.withItemsLabelProperty(itemsLabelProperty);
|
|
3989
|
+
}
|
|
3990
|
+
if (filterProperty) {
|
|
3991
|
+
column.withFilterProperty(filterProperty);
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
return this;
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
class TableDynamicDescriptor extends TableDescriptor {
|
|
3999
|
+
constructor(idProperty, titleProperty) {
|
|
4000
|
+
super({}, idProperty, titleProperty);
|
|
4001
|
+
this._excludedColumns = [];
|
|
4002
|
+
this._filterColumns = [];
|
|
4003
|
+
this._sortColumns = [];
|
|
4004
|
+
this._sortColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4005
|
+
this._filterColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4006
|
+
this._columns = [];
|
|
4007
|
+
this.withTitle('Dynamic table');
|
|
4008
|
+
}
|
|
4009
|
+
get columns() {
|
|
4010
|
+
return this._columns;
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* defines excluded columns when generating descriptor
|
|
4014
|
+
* @param excludedColumn names of excluded columns
|
|
4015
|
+
*/
|
|
4016
|
+
withColumnsExcluded(excludedColumn) {
|
|
4017
|
+
this._excludedColumns = excludedColumn;
|
|
4018
|
+
return this;
|
|
4019
|
+
}
|
|
4020
|
+
/**
|
|
4021
|
+
* defines column properties on which sort is defined or not depending on sortColumnMode
|
|
4022
|
+
* @param sortOnColumns column names
|
|
4023
|
+
* @param sortColumnMode INCLUDE_ONLY (default) only given columns will have sort, EXCLUDE given columns will NOT have sort
|
|
4024
|
+
*/
|
|
4025
|
+
withColumnsSort(sortOnColumns, sortColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4026
|
+
this._sortColumnMode = sortColumnMode;
|
|
4027
|
+
this._sortColumns = sortOnColumns;
|
|
4028
|
+
return this;
|
|
4029
|
+
}
|
|
4030
|
+
/**
|
|
4031
|
+
* defines column properties on which filter is defined or not depending on filterColumnMode
|
|
4032
|
+
* @param filterOnColumn column names
|
|
4033
|
+
* @param filterColumnMode INCLUDE_ONLY (default) only given columns will have filter, EXCLUDE given columns will NOT have filter
|
|
4034
|
+
*/
|
|
4035
|
+
withColumnsFilter(filterOnColumn, filterColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4036
|
+
this._filterColumnMode = filterColumnMode;
|
|
4037
|
+
this._filterColumns = filterOnColumn;
|
|
4038
|
+
return this;
|
|
4039
|
+
}
|
|
4040
|
+
/**
|
|
4041
|
+
* sets given type to column with given property and returns this table
|
|
4042
|
+
* @param property column's property
|
|
4043
|
+
* @param type custom type for column
|
|
4044
|
+
* @param args addition arguments for column
|
|
4045
|
+
*/
|
|
4046
|
+
withColumnModifiedType(property, type, ...args) {
|
|
4047
|
+
const column = this._columns.find(col => property === col.property) ?? this.addColumn(property).withTitle(property);
|
|
4048
|
+
if (column) {
|
|
4049
|
+
column.asType(type, ...args);
|
|
4050
|
+
}
|
|
4051
|
+
return this;
|
|
4052
|
+
}
|
|
4053
|
+
/**
|
|
4054
|
+
* sets title to column with given property and returns this table
|
|
4055
|
+
* @param property column's property
|
|
4056
|
+
* @param title column's title
|
|
4057
|
+
*/
|
|
4058
|
+
withColumnTitle(property, title) {
|
|
4059
|
+
const column = this._columns.find(col => property === col.property) ?? this.addColumn(property);
|
|
4060
|
+
column.withTitle(title, true);
|
|
4061
|
+
return this;
|
|
4062
|
+
}
|
|
4063
|
+
/**
|
|
4064
|
+
* generates columns defined on table based on data fetched from api
|
|
4065
|
+
* @param data data from api
|
|
4066
|
+
*/
|
|
4067
|
+
toTableDescriptorFromData(data) {
|
|
4068
|
+
const tableDescriptor = this.toTableDescriptor();
|
|
4069
|
+
if (data.pageData == null || data.pageData.length == 0) {
|
|
4070
|
+
return tableDescriptor;
|
|
4071
|
+
}
|
|
4072
|
+
const objectModel = data.pageData[0];
|
|
4073
|
+
const entries = Object.entries(objectModel)
|
|
4074
|
+
.filter(([key]) => !this._excludedColumns.includes(key))
|
|
4075
|
+
.filter(([, value]) => !Array.isArray(value)); //exclude arrays and sets
|
|
4076
|
+
for (const [key, value] of entries) {
|
|
4077
|
+
const metaColumn = this._columns.find(col => col.property === key);
|
|
4078
|
+
let column;
|
|
4079
|
+
if (metaColumn) {
|
|
4080
|
+
if (!metaColumn.visibility) {
|
|
4081
|
+
continue;
|
|
4082
|
+
}
|
|
4083
|
+
column = metaColumn.toColumnDescriptor(tableDescriptor);
|
|
4084
|
+
tableDescriptor.addColumnDescriptor(column);
|
|
4085
|
+
}
|
|
4086
|
+
else {
|
|
4087
|
+
column = tableDescriptor.addColumn(key).withTitle(key);
|
|
4088
|
+
TableviewUtil.stringColumnConverter(column, value);
|
|
4089
|
+
}
|
|
4090
|
+
const elementOfSortColumns = this._sortColumns.includes(column.property);
|
|
4091
|
+
if ((this._sortColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfSortColumns) ||
|
|
4092
|
+
(this._sortColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfSortColumns)) {
|
|
4093
|
+
column.withSort();
|
|
4094
|
+
}
|
|
4095
|
+
const elementOfFilterColumns = this._filterColumns.includes(column.property);
|
|
4096
|
+
if ((this._filterColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfFilterColumns) ||
|
|
4097
|
+
(this._filterColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfFilterColumns)) {
|
|
4098
|
+
column.withFilter();
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
return tableDescriptor;
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* adds ColumnDynamicDescriptor to this table
|
|
4105
|
+
* @param property column's property
|
|
4106
|
+
*/
|
|
4107
|
+
addColumn(property) {
|
|
4108
|
+
const column = new ColumnDynamicDescriptor(this, property);
|
|
4109
|
+
this._columns.push(column);
|
|
4110
|
+
return column;
|
|
4111
|
+
}
|
|
4112
|
+
removeColumn(property) {
|
|
4113
|
+
const column = this.columns.find(col => col.property === property) ?? this.addColumn(property);
|
|
4114
|
+
column.withVisibility(false);
|
|
4115
|
+
return this;
|
|
4116
|
+
}
|
|
4117
|
+
/**
|
|
4118
|
+
* creates deep copy of table dynamic descriptor
|
|
4119
|
+
*/
|
|
4120
|
+
copy() {
|
|
4121
|
+
const descriptor = new TableDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4122
|
+
this.copyFieldsTo(descriptor);
|
|
4123
|
+
descriptor._columns = this.columns.map(c => c.copy());
|
|
4124
|
+
descriptor._excludedColumns = [...this._excludedColumns];
|
|
4125
|
+
descriptor._filterColumns = [...this._filterColumns];
|
|
4126
|
+
descriptor._sortColumns = [...this._sortColumns];
|
|
4127
|
+
descriptor._filterColumnMode = this._filterColumnMode;
|
|
4128
|
+
descriptor._sortColumnMode = this._sortColumnMode;
|
|
4129
|
+
return descriptor;
|
|
4130
|
+
}
|
|
4131
|
+
toTableDescriptor() {
|
|
4132
|
+
const descriptor = new TableDescriptor({}, this.model.idPropertyName, this.model.titlePropertyName);
|
|
4133
|
+
this.copyFieldsTo(descriptor);
|
|
3458
4134
|
return descriptor;
|
|
3459
4135
|
}
|
|
3460
4136
|
}
|
|
3461
4137
|
|
|
3462
4138
|
class TableviewDescriptor {
|
|
3463
4139
|
constructor(modelType, idProperty, titleProperty) {
|
|
4140
|
+
this._modelType = modelType;
|
|
3464
4141
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3465
4142
|
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3466
4143
|
this._viewEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.View);
|
|
@@ -3469,6 +4146,38 @@ class TableviewDescriptor {
|
|
|
3469
4146
|
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.Edit);
|
|
3470
4147
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
3471
4148
|
}
|
|
4149
|
+
/**
|
|
4150
|
+
* generates descriptor from attribute definition of openaapi model
|
|
4151
|
+
* @param modelType class type
|
|
4152
|
+
* @param idProperty
|
|
4153
|
+
* @param titleProperty
|
|
4154
|
+
*/
|
|
4155
|
+
static from(modelType, idProperty, titleProperty) {
|
|
4156
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4157
|
+
descriptor._table = TableDescriptor.from(modelType, idProperty, titleProperty);
|
|
4158
|
+
descriptor._editEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4159
|
+
descriptor._viewEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4160
|
+
descriptor._addEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4161
|
+
return descriptor;
|
|
4162
|
+
}
|
|
4163
|
+
/**
|
|
4164
|
+
* generates descriptor from given attribute definition
|
|
4165
|
+
* @param modelType class type
|
|
4166
|
+
* @param columnAttributes attribute definition to generate columns
|
|
4167
|
+
* @param fieldAttributes attribute definition to generate fields, if undefined columnDefinition is used, if null editors are not generated
|
|
4168
|
+
* @param idProperty
|
|
4169
|
+
* @param titleProperty
|
|
4170
|
+
*/
|
|
4171
|
+
static fromModelWithDefinition(modelType, columnAttributes, fieldAttributes, idProperty, titleProperty) {
|
|
4172
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4173
|
+
descriptor._table = TableDescriptor.fromModelWithAttributes(modelType, columnAttributes, idProperty, titleProperty);
|
|
4174
|
+
if (fieldAttributes !== null) {
|
|
4175
|
+
descriptor._editEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes ?? columnAttributes, idProperty, titleProperty);
|
|
4176
|
+
descriptor._viewEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes ?? columnAttributes, idProperty, titleProperty);
|
|
4177
|
+
descriptor._addEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes ?? columnAttributes, idProperty, titleProperty);
|
|
4178
|
+
}
|
|
4179
|
+
return descriptor;
|
|
4180
|
+
}
|
|
3472
4181
|
get table() {
|
|
3473
4182
|
return this._table;
|
|
3474
4183
|
}
|
|
@@ -3491,6 +4200,12 @@ class TableviewDescriptor {
|
|
|
3491
4200
|
this._table = descriptor;
|
|
3492
4201
|
return this;
|
|
3493
4202
|
}
|
|
4203
|
+
withEditorDescriptors(descriptor) {
|
|
4204
|
+
this._viewEditor = descriptor;
|
|
4205
|
+
this._editEditor = descriptor;
|
|
4206
|
+
this._addEditor = descriptor;
|
|
4207
|
+
return this;
|
|
4208
|
+
}
|
|
3494
4209
|
withViewDescriptor(descriptor) {
|
|
3495
4210
|
this._viewEditor = descriptor;
|
|
3496
4211
|
return this;
|
|
@@ -3519,6 +4234,26 @@ class TableviewDescriptor {
|
|
|
3519
4234
|
addColumn(property) {
|
|
3520
4235
|
return this._table.addColumn(property);
|
|
3521
4236
|
}
|
|
4237
|
+
removeColumn(property) {
|
|
4238
|
+
this._table.removeColumn(property);
|
|
4239
|
+
}
|
|
4240
|
+
getField(property, editorType) {
|
|
4241
|
+
switch (editorType) {
|
|
4242
|
+
case TableviewTypeEnum.Edit:
|
|
4243
|
+
return this._editEditor.getField(property);
|
|
4244
|
+
case TableviewTypeEnum.Add:
|
|
4245
|
+
return this._addEditor.getField(property);
|
|
4246
|
+
case TableviewTypeEnum.View:
|
|
4247
|
+
return this._viewEditor.getField(property);
|
|
4248
|
+
case TableviewTypeEnum.None:
|
|
4249
|
+
return null;
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
removeField(property) {
|
|
4253
|
+
this._editEditor.removeField(property);
|
|
4254
|
+
this._addEditor.removeField(property);
|
|
4255
|
+
this._viewEditor.removeField(property);
|
|
4256
|
+
}
|
|
3522
4257
|
addColumnNumber(property, displayFormat) {
|
|
3523
4258
|
return this._table.addColumnNumber(property, displayFormat);
|
|
3524
4259
|
}
|
|
@@ -3590,6 +4325,116 @@ class TableviewDescriptor {
|
|
|
3590
4325
|
tableview._editEditor = this._editEditor.copy();
|
|
3591
4326
|
return tableview;
|
|
3592
4327
|
}
|
|
4328
|
+
/**
|
|
4329
|
+
* creates column and field with custom type, for example currency
|
|
4330
|
+
* if field exists, it is replaced
|
|
4331
|
+
* DO NOT USE WITH TYPES WHERE ARGS ARE REQUIRED - ERROR WILL BE THROWN
|
|
4332
|
+
* for enum use withEnumType
|
|
4333
|
+
* for custom class use withClassType
|
|
4334
|
+
* @param property name of field
|
|
4335
|
+
* @param columnType required column type
|
|
4336
|
+
* @param fieldType optional, if not provided it is converted from column type
|
|
4337
|
+
*/
|
|
4338
|
+
withModifiedType(property, columnType, fieldType) {
|
|
4339
|
+
if (columnType === ColumnTypeEnum.Enum) {
|
|
4340
|
+
throw new Error('Do not use with types where args are required');
|
|
4341
|
+
}
|
|
4342
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4343
|
+
if (attributeDef != null) {
|
|
4344
|
+
fieldType ?? (fieldType = TableviewUtil.toFieldInputTypeFromColumnType(columnType));
|
|
4345
|
+
attributeDef.fieldType = fieldType;
|
|
4346
|
+
this._table.withColumnModifiedType(property, columnType);
|
|
4347
|
+
this._editEditor.withFieldModifiedType(property, fieldType);
|
|
4348
|
+
this._addEditor.withFieldModifiedType(property, fieldType);
|
|
4349
|
+
this._viewEditor.withFieldModifiedType(property, fieldType);
|
|
4350
|
+
}
|
|
4351
|
+
return this;
|
|
4352
|
+
}
|
|
4353
|
+
/**
|
|
4354
|
+
* creates column with enum type
|
|
4355
|
+
* if fields exists, it is replaced
|
|
4356
|
+
* @param property property name
|
|
4357
|
+
* @param enumType type of enum
|
|
4358
|
+
* @param fieldType type of field, optional, default is Text
|
|
4359
|
+
*/
|
|
4360
|
+
withModifiedEnum(property, enumType, fieldType) {
|
|
4361
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4362
|
+
if (attributeDef != null) {
|
|
4363
|
+
attributeDef.fieldType = fieldType ?? FieldInputTypeEnum.Text;
|
|
4364
|
+
this._table.withColumnModifiedEnum(property, enumType);
|
|
4365
|
+
this._editEditor.withFieldModifiedEnum(property, enumType);
|
|
4366
|
+
this._viewEditor.withFieldModifiedEnum(property, enumType);
|
|
4367
|
+
this._addEditor.withFieldModifiedEnum(property, enumType);
|
|
4368
|
+
}
|
|
4369
|
+
return this;
|
|
4370
|
+
}
|
|
4371
|
+
/**
|
|
4372
|
+
* generates column with custom class type
|
|
4373
|
+
* field is generated only if lookupProvider is provided
|
|
4374
|
+
* @param property property name
|
|
4375
|
+
* @param modelType class type of object
|
|
4376
|
+
* @param titleProperty
|
|
4377
|
+
* @param lookupProvider
|
|
4378
|
+
* @param itemsLabelProperty
|
|
4379
|
+
* @param filterProperty
|
|
4380
|
+
*/
|
|
4381
|
+
withModifiedLookup(property, modelType, lookupProvider, titleProperty, itemsLabelProperty, filterProperty) {
|
|
4382
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4383
|
+
if (attributeDef != null) {
|
|
4384
|
+
modelType ?? (modelType = attributeDef.classType ?? ObjectSerializer.get().findType(attributeDef.type));
|
|
4385
|
+
titleProperty ?? (titleProperty = ModelUtil.findTitleAttribute(modelType) ?? undefined);
|
|
4386
|
+
itemsLabelProperty ?? (itemsLabelProperty = titleProperty);
|
|
4387
|
+
attributeDef.columnType = ColumnTypeEnum.String;
|
|
4388
|
+
attributeDef.fieldType = FieldInputTypeEnum.Text;
|
|
4389
|
+
if (lookupProvider != null) {
|
|
4390
|
+
this._table.withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty);
|
|
4391
|
+
this._addEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4392
|
+
this._viewEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4393
|
+
this._editEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4394
|
+
}
|
|
4395
|
+
else {
|
|
4396
|
+
const column = this._table.getColumn(property) ?? this.addColumn(property);
|
|
4397
|
+
column.withObjectProperty(modelType, titleProperty);
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
return this;
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
class TableviewDynamicDescriptor extends TableviewDescriptor {
|
|
4404
|
+
constructor(idProperty, titleProperty) {
|
|
4405
|
+
super({}, idProperty, titleProperty);
|
|
4406
|
+
this._table = new TableDynamicDescriptor(idProperty, titleProperty);
|
|
4407
|
+
super._tableTitle = undefined;
|
|
4408
|
+
}
|
|
4409
|
+
get table() {
|
|
4410
|
+
return this._table;
|
|
4411
|
+
}
|
|
4412
|
+
/**
|
|
4413
|
+
* sets custom table descriptor
|
|
4414
|
+
* @param descriptor
|
|
4415
|
+
*/
|
|
4416
|
+
withTableDescriptor(descriptor) {
|
|
4417
|
+
this._table = descriptor;
|
|
4418
|
+
return this;
|
|
4419
|
+
}
|
|
4420
|
+
/**
|
|
4421
|
+
* sets visibility hidden state to column with given property
|
|
4422
|
+
* equals to be removing in auto and base tableview descriptor
|
|
4423
|
+
* * @param property column's property
|
|
4424
|
+
*/
|
|
4425
|
+
removeColumn(property) {
|
|
4426
|
+
this._table.removeColumn(property);
|
|
4427
|
+
return this;
|
|
4428
|
+
}
|
|
4429
|
+
/**
|
|
4430
|
+
* creates depp copy of tableview object and its children
|
|
4431
|
+
*/
|
|
4432
|
+
copy() {
|
|
4433
|
+
const descriptor = new TableviewDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4434
|
+
descriptor._table = this._table.copy();
|
|
4435
|
+
descriptor._tableTitle = this._tableTitle;
|
|
4436
|
+
return descriptor;
|
|
4437
|
+
}
|
|
3593
4438
|
}
|
|
3594
4439
|
|
|
3595
4440
|
class ButtonDescriptor {
|
|
@@ -4757,8 +5602,7 @@ class MediusRestUtil {
|
|
|
4757
5602
|
const filterDescriptor = filterDescriptors.find(f => f.property === field);
|
|
4758
5603
|
const matchMode = MediusRestUtil.getMapping(operator, filterDescriptor?.filterType, 1);
|
|
4759
5604
|
if (matchMode && filterDescriptor) {
|
|
4760
|
-
|
|
4761
|
-
mediusParamsBuilder.withFilter(fieldFilterProperty, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
5605
|
+
mediusParamsBuilder.withFilter(filterDescriptor.property, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
4762
5606
|
}
|
|
4763
5607
|
}
|
|
4764
5608
|
}
|
|
@@ -4814,6 +5658,12 @@ class MediusRestUtil {
|
|
|
4814
5658
|
}
|
|
4815
5659
|
return params;
|
|
4816
5660
|
}
|
|
5661
|
+
static modifyFilterProperties(mediusQueryParams, filterDescriptors) {
|
|
5662
|
+
for (const filterParam of mediusQueryParams.filterParams ?? []) {
|
|
5663
|
+
const filterDescriptor = filterDescriptors.find(f => f.property === filterParam.property);
|
|
5664
|
+
filterParam.property = filterDescriptor?.filterProperty ?? filterParam.property;
|
|
5665
|
+
}
|
|
5666
|
+
}
|
|
4817
5667
|
static fromPrimeLazyLoadEventToMediusQueryParams(event) {
|
|
4818
5668
|
const queryParamBuilder = MediusQueryParamBuilder.create(event.rows, event.first);
|
|
4819
5669
|
// apply sorting
|
|
@@ -5063,6 +5913,7 @@ class ActionParameters {
|
|
|
5063
5913
|
constructor(itemId, item) {
|
|
5064
5914
|
this.itemId = itemId;
|
|
5065
5915
|
this.item = item;
|
|
5916
|
+
this.selectedItems = [];
|
|
5066
5917
|
}
|
|
5067
5918
|
withActionData(actionData) {
|
|
5068
5919
|
this.actionData = actionData;
|
|
@@ -5084,6 +5935,10 @@ class ActionParameters {
|
|
|
5084
5935
|
this.route = route;
|
|
5085
5936
|
return this;
|
|
5086
5937
|
}
|
|
5938
|
+
withSelectedItems(selectedItems) {
|
|
5939
|
+
this.selectedItems = selectedItems;
|
|
5940
|
+
return this;
|
|
5941
|
+
}
|
|
5087
5942
|
}
|
|
5088
5943
|
var ActionInstanceStateEnum;
|
|
5089
5944
|
(function (ActionInstanceStateEnum) {
|
|
@@ -5107,6 +5962,17 @@ var ActionInstanceStateEnum;
|
|
|
5107
5962
|
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
5108
5963
|
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
5109
5964
|
|
|
5965
|
+
/**
|
|
5966
|
+
* Default categories for tableview actions
|
|
5967
|
+
*/
|
|
5968
|
+
class TableviewActionDefaultCategories {
|
|
5969
|
+
}
|
|
5970
|
+
TableviewActionDefaultCategories.READ = 'read';
|
|
5971
|
+
TableviewActionDefaultCategories.ADD = 'add';
|
|
5972
|
+
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
5973
|
+
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
5974
|
+
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
5975
|
+
|
|
5110
5976
|
class AuthorizationUtil {
|
|
5111
5977
|
static isPermitted(permissions, userRoles) {
|
|
5112
5978
|
switch (permissions.authorizationType) {
|
|
@@ -5567,6 +6433,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
5567
6433
|
}]
|
|
5568
6434
|
}], ctorParameters: function () { return [{ type: MngParametrizePipe }]; } });
|
|
5569
6435
|
|
|
6436
|
+
class MngClassMapPipe {
|
|
6437
|
+
transform(value, classNameMapFn, i) {
|
|
6438
|
+
if (classNameMapFn && typeof classNameMapFn === 'function') {
|
|
6439
|
+
return classNameMapFn(value, i);
|
|
6440
|
+
}
|
|
6441
|
+
else {
|
|
6442
|
+
return value ?? '';
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6445
|
+
}
|
|
6446
|
+
MngClassMapPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6447
|
+
MngClassMapPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, name: "mngClassMapPipe" });
|
|
6448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, decorators: [{
|
|
6449
|
+
type: Pipe,
|
|
6450
|
+
args: [{
|
|
6451
|
+
name: 'mngClassMapPipe',
|
|
6452
|
+
pure: true
|
|
6453
|
+
}]
|
|
6454
|
+
}] });
|
|
6455
|
+
|
|
5570
6456
|
class MngActionExecutorService {
|
|
5571
6457
|
constructor(injector, router, dialogService, confirmationService, translate, configurationService, navigationService, errorMapper, parametrize, defaultEditorDialogComponent) {
|
|
5572
6458
|
this.injector = injector;
|
|
@@ -6533,6 +7419,7 @@ class MngActionComponent {
|
|
|
6533
7419
|
this.isHostHidden = false;
|
|
6534
7420
|
this.inputDisabled = of(false);
|
|
6535
7421
|
this.inputLoading = of(false);
|
|
7422
|
+
this.selectedItems = [];
|
|
6536
7423
|
this.finishEventEmitter = new EventEmitter();
|
|
6537
7424
|
this.loadingSubject = new ReplaySubject(1);
|
|
6538
7425
|
this.$loading = this.loadingSubject.asObservable();
|
|
@@ -6580,7 +7467,10 @@ class MngActionComponent {
|
|
|
6580
7467
|
this.buttonClass = this.action.buttonDescriptor.styleClass.getButtonClass(this.hasNoTitle);
|
|
6581
7468
|
}
|
|
6582
7469
|
ngOnChanges(changes) {
|
|
6583
|
-
if (!(changes['item']?.firstChange ?? true) ||
|
|
7470
|
+
if (!(changes['item']?.firstChange ?? true) ||
|
|
7471
|
+
!(changes['itemId']?.firstChange ?? true) ||
|
|
7472
|
+
!(changes['actionData']?.firstChange ?? true) ||
|
|
7473
|
+
(this.action.hasItemsSelection && !(changes['selectedItems']?.firstChange ?? true))) {
|
|
6584
7474
|
this.processSubscriptions();
|
|
6585
7475
|
}
|
|
6586
7476
|
}
|
|
@@ -6601,11 +7491,15 @@ class MngActionComponent {
|
|
|
6601
7491
|
.withQueryParam(this.queryParam)
|
|
6602
7492
|
.withRoute(this.route)
|
|
6603
7493
|
.withViewContainer(this.viewContainer)
|
|
6604
|
-
.withSourceComponent(this)
|
|
7494
|
+
.withSourceComponent(this)
|
|
7495
|
+
.withSelectedItems(this.selectedItems);
|
|
6605
7496
|
const instance = this.actionExecutor.triggerAction(this.action, parameters);
|
|
6606
7497
|
this.subscriptions.push(instance.result$.subscribe({
|
|
6607
7498
|
next: () => {
|
|
6608
7499
|
this.finishEventEmitter.next(instance);
|
|
7500
|
+
if (this.action.hasItemsSelection) {
|
|
7501
|
+
this.viewContainerService?.triggerTableReload({});
|
|
7502
|
+
}
|
|
6609
7503
|
}
|
|
6610
7504
|
}));
|
|
6611
7505
|
this.subscriptions.push(instance.error$.subscribe({
|
|
@@ -6630,6 +7524,9 @@ class MngActionComponent {
|
|
|
6630
7524
|
.withActionData(this.actionData)
|
|
6631
7525
|
.withViewContainer(this.viewContainer ?? undefined)
|
|
6632
7526
|
.withSourceComponent(this);
|
|
7527
|
+
if (this.action.hasItemsSelection) {
|
|
7528
|
+
parameters.withSelectedItems(this.selectedItems);
|
|
7529
|
+
}
|
|
6633
7530
|
const context = this.actionExecutor.prepareActionContextValidation(this.action, parameters, this.dataProvider);
|
|
6634
7531
|
if (typeof this.action.isVisibleFunction === 'function') {
|
|
6635
7532
|
this.isVisibleSubscription?.unsubscribe();
|
|
@@ -6665,7 +7562,7 @@ class MngActionComponent {
|
|
|
6665
7562
|
}
|
|
6666
7563
|
}
|
|
6667
7564
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngAuthorizationService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6668
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7565
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6669
7566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
6670
7567
|
type: Component,
|
|
6671
7568
|
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
@@ -6698,6 +7595,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6698
7595
|
}], viewContainerInit: [{
|
|
6699
7596
|
type: Input,
|
|
6700
7597
|
args: ['viewContainer']
|
|
7598
|
+
}], selectedItems: [{
|
|
7599
|
+
type: Input
|
|
6701
7600
|
}], finishEventEmitter: [{
|
|
6702
7601
|
type: Output,
|
|
6703
7602
|
args: ['finish']
|
|
@@ -7745,7 +8644,7 @@ class MngActionEditorComponent {
|
|
|
7745
8644
|
}
|
|
7746
8645
|
}
|
|
7747
8646
|
MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
7748
|
-
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8647
|
+
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7749
8648
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
7750
8649
|
type: Component,
|
|
7751
8650
|
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n" }]
|
|
@@ -8094,7 +8993,7 @@ class MngTableColumnFilterComponent {
|
|
|
8094
8993
|
this.primeMatchModes = null;
|
|
8095
8994
|
}
|
|
8096
8995
|
ngOnInit() {
|
|
8097
|
-
this.primeDefaultMatchMode = this.descriptor.defaultFilterMatchMode;
|
|
8996
|
+
this.primeDefaultMatchMode = this.descriptor.defaultFilterMatchMode ?? FilterMatchModeEnum.Equals;
|
|
8098
8997
|
switch (this.descriptor.filterType) {
|
|
8099
8998
|
case FilterTypeEnum.Boolean:
|
|
8100
8999
|
this.primeType = 'boolean';
|
|
@@ -8113,6 +9012,9 @@ class MngTableColumnFilterComponent {
|
|
|
8113
9012
|
this.lookupDescriptor = this.descriptor;
|
|
8114
9013
|
this.primeField = `${this.descriptor.property}${this.lookupDescriptor.itemsValueProperty ? `.${this.lookupDescriptor.itemsValueProperty}` : ''}`;
|
|
8115
9014
|
this.primeMatchModes = [{ value: FilterMatchModeEnum.Equals, label: this.primeConfig.getTranslation(FilterMatchModeEnum.Equals) }];
|
|
9015
|
+
if (this.lookupDescriptor.multiselect) {
|
|
9016
|
+
this.primeDefaultMatchMode = FilterMatchModeEnum.In;
|
|
9017
|
+
}
|
|
8116
9018
|
break;
|
|
8117
9019
|
case FilterTypeEnum.String:
|
|
8118
9020
|
this.primeType = 'text';
|
|
@@ -8218,6 +9120,7 @@ class MngTableComponent {
|
|
|
8218
9120
|
this.dataProviderLatestLazyLoadEventVersion = 0;
|
|
8219
9121
|
this.dataProviderLatestQueryParamVersion = 0;
|
|
8220
9122
|
// filter, sort
|
|
9123
|
+
this.hasColumnFilters = false;
|
|
8221
9124
|
this.isFilterChanged = false;
|
|
8222
9125
|
this.isSortChanged = false;
|
|
8223
9126
|
this.filterDescriptors = [];
|
|
@@ -8229,10 +9132,14 @@ class MngTableComponent {
|
|
|
8229
9132
|
}
|
|
8230
9133
|
ngOnInit() {
|
|
8231
9134
|
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
8232
|
-
|
|
9135
|
+
if (!(this.initialDescriptor instanceof TableDynamicDescriptor)) {
|
|
9136
|
+
this.descriptor = this.initialDescriptor;
|
|
9137
|
+
}
|
|
8233
9138
|
// map row settings
|
|
8234
|
-
this.
|
|
8235
|
-
this.
|
|
9139
|
+
this.filterDescriptors = this.descriptor?.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor) ?? [];
|
|
9140
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9141
|
+
this.rows = this.descriptor?.defaultNumRows ?? 25;
|
|
9142
|
+
this.rowsPerPageOptions = this.descriptor?.rowsPerPageOptions ?? [25, 50, 100];
|
|
8236
9143
|
// process actions
|
|
8237
9144
|
for (const action of this.actions) {
|
|
8238
9145
|
switch (action.position) {
|
|
@@ -8246,14 +9153,14 @@ class MngTableComponent {
|
|
|
8246
9153
|
}
|
|
8247
9154
|
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
8248
9155
|
// define all styles
|
|
8249
|
-
this.className = this.descriptor
|
|
8250
|
-
this.tableFullHeightOffset = this.descriptor
|
|
8251
|
-
this.rowHeight = this.descriptor
|
|
9156
|
+
this.className = this.descriptor?.className ?? '';
|
|
9157
|
+
this.tableFullHeightOffset = this.descriptor?.tableFullHeightOffset ?? null;
|
|
9158
|
+
this.rowHeight = this.descriptor?.rowHeight ?? null;
|
|
8252
9159
|
if (typeof this.isColumnClickable === 'undefined') {
|
|
8253
9160
|
// define if cell click is being observed via output
|
|
8254
9161
|
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
8255
9162
|
}
|
|
8256
|
-
switch (this.descriptor
|
|
9163
|
+
switch (this.descriptor?.size) {
|
|
8257
9164
|
case TableSizeEnum.Small:
|
|
8258
9165
|
this.className += ' p-datatable-sm';
|
|
8259
9166
|
break;
|
|
@@ -8261,14 +9168,14 @@ class MngTableComponent {
|
|
|
8261
9168
|
this.className += ' p-datatable-lg';
|
|
8262
9169
|
break;
|
|
8263
9170
|
}
|
|
8264
|
-
if (this.descriptor
|
|
9171
|
+
if (this.descriptor?.hasGridlines) {
|
|
8265
9172
|
this.className += ' p-datatable-gridlines';
|
|
8266
9173
|
}
|
|
8267
|
-
if (!this.columnActionMinWidth) {
|
|
9174
|
+
if (this.descriptor && !this.columnActionMinWidth) {
|
|
8268
9175
|
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(this.descriptor, this.rowInlineActions);
|
|
8269
9176
|
}
|
|
8270
9177
|
// check if infinite scroll
|
|
8271
|
-
if (this.descriptor
|
|
9178
|
+
if (this.descriptor?.paginationMode === TablePaginationModeEnum.InfiniteScroll) {
|
|
8272
9179
|
this.infiniteScroll = true;
|
|
8273
9180
|
this.scrollHeight = 'flex';
|
|
8274
9181
|
this.tableFullHeightOffset = this.descriptor.tableFullHeightOffset ?? 315;
|
|
@@ -8290,6 +9197,12 @@ class MngTableComponent {
|
|
|
8290
9197
|
if (this.dataProvider.serviceType) {
|
|
8291
9198
|
this.dataProviderService = this.injector.get(this.dataProvider.serviceType);
|
|
8292
9199
|
}
|
|
9200
|
+
const reloadSubscription = this.dataProvider.getAllReload$.subscribe({
|
|
9201
|
+
next: () => {
|
|
9202
|
+
this.reload();
|
|
9203
|
+
}
|
|
9204
|
+
});
|
|
9205
|
+
this.subscriptions.push(reloadSubscription);
|
|
8293
9206
|
}
|
|
8294
9207
|
else {
|
|
8295
9208
|
// if query result is provided, use it as secondary source or else try to use items
|
|
@@ -8316,7 +9229,7 @@ class MngTableComponent {
|
|
|
8316
9229
|
}
|
|
8317
9230
|
const initialQueryParamMap = this.route.snapshot.queryParamMap;
|
|
8318
9231
|
if (this.useQueryParams &&
|
|
8319
|
-
((!initialQueryParamMap.has('sort') && this.descriptor
|
|
9232
|
+
((!initialQueryParamMap.has('sort') && this.descriptor?.hasDefaultSort) ||
|
|
8320
9233
|
(!initialQueryParamMap.has('filter') && this.filterDescriptors.some(fd => fd.hasDefaultValue)))) {
|
|
8321
9234
|
// default sort/filters are applied, no additional filtering/sorting is specified in query param
|
|
8322
9235
|
// redirect must be done at first step
|
|
@@ -8364,7 +9277,12 @@ class MngTableComponent {
|
|
|
8364
9277
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
8365
9278
|
}
|
|
8366
9279
|
reload(emitEvent = false, resetParams = false) {
|
|
8367
|
-
|
|
9280
|
+
const queryParamsBuilder = resetParams
|
|
9281
|
+
? MediusQueryParamBuilder.create(this.rowsPerPageOptions[0], 0)
|
|
9282
|
+
: MediusQueryParamBuilder.createFromExisting(this.dataProviderLatestQueryParam ?? new MediusQueryParam())
|
|
9283
|
+
.withItemsPerPage(this.rows)
|
|
9284
|
+
.withItemsOffset(this.offset);
|
|
9285
|
+
this.loadTableWithDataProvider(queryParamsBuilder.build(), emitEvent);
|
|
8368
9286
|
}
|
|
8369
9287
|
onTableLazyLoad(event) {
|
|
8370
9288
|
this.dataProviderLatestLazyLoadEvent = event;
|
|
@@ -8430,8 +9348,16 @@ class MngTableComponent {
|
|
|
8430
9348
|
}
|
|
8431
9349
|
this.dataProviderLatestQueryParam = queryParam;
|
|
8432
9350
|
this.dataProviderLatestQueryParamVersion++;
|
|
9351
|
+
MediusRestUtil.modifyFilterProperties(queryParam, this.filterDescriptors);
|
|
8433
9352
|
this.dataProviderSubscription = this.dataProvider?.getAll(queryParam, this.dataProviderService).subscribe({
|
|
8434
9353
|
next: res => {
|
|
9354
|
+
if (this.initialDescriptor instanceof TableDynamicDescriptor) {
|
|
9355
|
+
this.descriptor = this.initialDescriptor.toTableDescriptorFromData(res);
|
|
9356
|
+
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
9357
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9358
|
+
// } else {
|
|
9359
|
+
// this.descriptor = this.initialDescriptor.onDataReceivedTypeBuilding(res);
|
|
9360
|
+
}
|
|
8435
9361
|
if (this.infiniteScroll) {
|
|
8436
9362
|
if (this.isFilterChanged || this.isSortChanged) {
|
|
8437
9363
|
this.dataProviderInfiniteScrollItems = [];
|
|
@@ -8447,6 +9373,7 @@ class MngTableComponent {
|
|
|
8447
9373
|
this.dataProviderLoadingSubject.next(false);
|
|
8448
9374
|
},
|
|
8449
9375
|
error: err => {
|
|
9376
|
+
// TODO: check what happens on error with no model iniside descriptor
|
|
8450
9377
|
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
|
|
8451
9378
|
const emptyQueryResult = new MediusQueryResult();
|
|
8452
9379
|
emptyQueryResult.pageData = [];
|
|
@@ -8490,7 +9417,7 @@ class MngTableComponent {
|
|
|
8490
9417
|
const applyDefaultFilters = (params.filterParams?.length ?? 0) === 0;
|
|
8491
9418
|
this.filterDescriptors.forEach(f => {
|
|
8492
9419
|
let matchMode;
|
|
8493
|
-
if (f.
|
|
9420
|
+
if (f.defaultFilterMatchMode) {
|
|
8494
9421
|
matchMode = f.defaultFilterMatchMode;
|
|
8495
9422
|
}
|
|
8496
9423
|
else {
|
|
@@ -8550,7 +9477,7 @@ class MngTableComponent {
|
|
|
8550
9477
|
}
|
|
8551
9478
|
let sortMeta;
|
|
8552
9479
|
const applyDefaultSorts = (params.sortProperty?.length ?? 0) === 0;
|
|
8553
|
-
if (applyDefaultSorts && this.descriptor
|
|
9480
|
+
if (applyDefaultSorts && this.descriptor?.hasDefaultSort) {
|
|
8554
9481
|
sortMeta = this.descriptor.defaultSortProperty.map((p, idx) => ({
|
|
8555
9482
|
field: p,
|
|
8556
9483
|
order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
|
|
@@ -8595,14 +9522,15 @@ class MngTableComponent {
|
|
|
8595
9522
|
}
|
|
8596
9523
|
}
|
|
8597
9524
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8598
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9525
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8599
9526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
8600
9527
|
type: Component,
|
|
8601
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor
|
|
9528
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
8602
9529
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
8603
9530
|
type: Optional
|
|
8604
|
-
}] }]; }, propDecorators: {
|
|
8605
|
-
type: Input
|
|
9531
|
+
}] }]; }, propDecorators: { initialDescriptor: [{
|
|
9532
|
+
type: Input,
|
|
9533
|
+
args: ['descriptor']
|
|
8606
9534
|
}], items: [{
|
|
8607
9535
|
type: Input
|
|
8608
9536
|
}], queryResult: [{
|
|
@@ -8671,6 +9599,8 @@ class MngTableviewComponent {
|
|
|
8671
9599
|
this.toolbarLeftActions = [];
|
|
8672
9600
|
this.toolbarRightActions = [];
|
|
8673
9601
|
this.subscriptions = [];
|
|
9602
|
+
this.hasItemSelectionAction = false;
|
|
9603
|
+
this.selectedItems = [];
|
|
8674
9604
|
}
|
|
8675
9605
|
ngOnInit() {
|
|
8676
9606
|
this.viewContainerService.actions = this.actions;
|
|
@@ -8698,6 +9628,7 @@ class MngTableviewComponent {
|
|
|
8698
9628
|
}
|
|
8699
9629
|
}
|
|
8700
9630
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
9631
|
+
this.hasItemSelectionAction = [...this.toolbarLeftActions, ...this.toolbarRightActions].some(e => e.hasItemsSelection);
|
|
8701
9632
|
}
|
|
8702
9633
|
ngOnDestroy() {
|
|
8703
9634
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -8714,12 +9645,15 @@ class MngTableviewComponent {
|
|
|
8714
9645
|
onTableLoad(event) {
|
|
8715
9646
|
this.tableQueryParam = event.queryParam;
|
|
8716
9647
|
}
|
|
9648
|
+
selectionChange(selectedItems) {
|
|
9649
|
+
this.selectedItems = selectedItems;
|
|
9650
|
+
}
|
|
8717
9651
|
}
|
|
8718
9652
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$2.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8719
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\"
|
|
9653
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$4.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
8720
9654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
8721
9655
|
type: Component,
|
|
8722
|
-
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\"
|
|
9656
|
+
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle ?? '' | translate }}</h5>\n </div>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
8723
9657
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$2.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
8724
9658
|
type: Input
|
|
8725
9659
|
}], dataProvider: [{
|
|
@@ -8732,6 +9666,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
8732
9666
|
}] } });
|
|
8733
9667
|
|
|
8734
9668
|
class AMngTableviewRouteComponent {
|
|
9669
|
+
constructor() {
|
|
9670
|
+
this.route = inject(ActivatedRoute);
|
|
9671
|
+
}
|
|
9672
|
+
get routeData() {
|
|
9673
|
+
return this.route.snapshot.data;
|
|
9674
|
+
}
|
|
8735
9675
|
ngOnInit() {
|
|
8736
9676
|
this.descriptor = this.createTableviewDescriptor();
|
|
8737
9677
|
this.dataProvider = this.createTableviewDataProvider();
|
|
@@ -8745,25 +9685,25 @@ class AMngTableviewRouteComponent {
|
|
|
8745
9685
|
this.createActionDescriptorForDelete(),
|
|
8746
9686
|
this.createActionDescriptorForRefresh(),
|
|
8747
9687
|
this.createActionDescriptorForExport()
|
|
8748
|
-
];
|
|
9688
|
+
].filter(e => e != null);
|
|
8749
9689
|
}
|
|
8750
9690
|
createActionDescriptorForDetails(descriptor = this.descriptor.viewEditor) {
|
|
8751
|
-
return new ActionEditorDetailsDescriptor(descriptor);
|
|
9691
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDetails ? new ActionEditorDetailsDescriptor(descriptor) : null;
|
|
8752
9692
|
}
|
|
8753
9693
|
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
8754
|
-
return new ActionEditorAddDescriptor(descriptor);
|
|
9694
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasAdd ? new ActionEditorAddDescriptor(descriptor) : null;
|
|
8755
9695
|
}
|
|
8756
9696
|
createActionDescriptorForEdit(descriptor = this.descriptor.editEditor) {
|
|
8757
|
-
return new ActionEditorEditDescriptor(descriptor);
|
|
9697
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasEdit ? new ActionEditorEditDescriptor(descriptor) : null;
|
|
8758
9698
|
}
|
|
8759
9699
|
createActionDescriptorForDelete(descriptor = this.descriptor.model) {
|
|
8760
|
-
return new ActionDeleteDescriptor(descriptor);
|
|
9700
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDelete ? new ActionDeleteDescriptor(descriptor) : null;
|
|
8761
9701
|
}
|
|
8762
9702
|
createActionDescriptorForExport(descriptor = this.descriptor.model) {
|
|
8763
9703
|
const action = new ActionDescriptor(descriptor, 'export')
|
|
8764
9704
|
.withRunFunction(ctx => {
|
|
8765
9705
|
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
8766
|
-
queryParamBuilder.withItemsOffset(0).withItemsPerPage(
|
|
9706
|
+
queryParamBuilder.withItemsOffset(0).withItemsPerPage(500);
|
|
8767
9707
|
ctx.parameters.withQueryParam(queryParamBuilder.build());
|
|
8768
9708
|
return ActionDataProviderUtil.runGetAllOrFail(ctx).pipe(map(res => {
|
|
8769
9709
|
const blob = new Blob([JSON.stringify(res.pageData, undefined, 4)], { type: 'application/json;charset=utf-8' });
|
|
@@ -8781,7 +9721,7 @@ class AMngTableviewRouteComponent {
|
|
|
8781
9721
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8782
9722
|
.withPermissionsRouteType(Permissions.ActionTypes.READ)
|
|
8783
9723
|
.withRunNotificationSuccess(undefined, undefined, false)
|
|
8784
|
-
.withRunFunction(ctx => {
|
|
9724
|
+
.withRunFunction((ctx) => {
|
|
8785
9725
|
ctx.parameters.viewContainer.triggerTableReload({});
|
|
8786
9726
|
return of(null);
|
|
8787
9727
|
});
|
|
@@ -8793,16 +9733,9 @@ AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.
|
|
|
8793
9733
|
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
8794
9734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
|
|
8795
9735
|
type: Directive
|
|
8796
|
-
}] });
|
|
9736
|
+
}], ctorParameters: function () { return []; } });
|
|
8797
9737
|
|
|
8798
9738
|
class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
8799
|
-
constructor(route) {
|
|
8800
|
-
super();
|
|
8801
|
-
this.route = route;
|
|
8802
|
-
}
|
|
8803
|
-
get routeData() {
|
|
8804
|
-
return this.route.snapshot.data;
|
|
8805
|
-
}
|
|
8806
9739
|
createTableviewDescriptor() {
|
|
8807
9740
|
if (this.descriptorInit) {
|
|
8808
9741
|
return this.descriptorInit;
|
|
@@ -8831,12 +9764,12 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
|
8831
9764
|
this.tableviewComponent?.reloadTable();
|
|
8832
9765
|
}
|
|
8833
9766
|
}
|
|
8834
|
-
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps:
|
|
9767
|
+
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8835
9768
|
MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewRouteComponent, selector: "mng-tableview-route", inputs: { descriptorInit: ["descriptor", "descriptorInit"], dataProviderInit: ["dataProvider", "dataProviderInit"], actionsInit: ["actions", "actionsInit"] }, viewQueries: [{ propertyName: "tableviewComponent", first: true, predicate: MngTableviewComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
|
|
8836
9769
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
8837
9770
|
type: Component,
|
|
8838
9771
|
args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
|
|
8839
|
-
}],
|
|
9772
|
+
}], propDecorators: { descriptorInit: [{
|
|
8840
9773
|
type: Input,
|
|
8841
9774
|
args: ['descriptor']
|
|
8842
9775
|
}], dataProviderInit: [{
|
|
@@ -9160,7 +10093,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
9160
10093
|
}
|
|
9161
10094
|
}
|
|
9162
10095
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9163
|
-
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10096
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9164
10097
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
9165
10098
|
type: Component,
|
|
9166
10099
|
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"] }]
|
|
@@ -10273,6 +11206,7 @@ const declarations = [
|
|
|
10273
11206
|
MngParametrizePipe,
|
|
10274
11207
|
MngGetterPipe,
|
|
10275
11208
|
MngTemplatePipe,
|
|
11209
|
+
MngClassMapPipe,
|
|
10276
11210
|
// layout components
|
|
10277
11211
|
MngBreadcrumbComponent,
|
|
10278
11212
|
MngFooterComponent,
|
|
@@ -10396,6 +11330,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10396
11330
|
MngParametrizePipe,
|
|
10397
11331
|
MngGetterPipe,
|
|
10398
11332
|
MngTemplatePipe,
|
|
11333
|
+
MngClassMapPipe,
|
|
10399
11334
|
// layout components
|
|
10400
11335
|
MngBreadcrumbComponent,
|
|
10401
11336
|
MngFooterComponent,
|
|
@@ -10515,6 +11450,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10515
11450
|
MngParametrizePipe,
|
|
10516
11451
|
MngGetterPipe,
|
|
10517
11452
|
MngTemplatePipe,
|
|
11453
|
+
MngClassMapPipe,
|
|
10518
11454
|
// layout components
|
|
10519
11455
|
MngBreadcrumbComponent,
|
|
10520
11456
|
MngFooterComponent,
|
|
@@ -11213,6 +12149,7 @@ class TableviewRouteBuilder {
|
|
|
11213
12149
|
this.editPath = ':itemId/edit';
|
|
11214
12150
|
this.hasAdd = true;
|
|
11215
12151
|
this.addPath = 'add';
|
|
12152
|
+
this.hasDelete = true;
|
|
11216
12153
|
}
|
|
11217
12154
|
static fromComponent(path, component) {
|
|
11218
12155
|
const inst = new TableviewRouteBuilder(path);
|
|
@@ -11240,6 +12177,15 @@ class TableviewRouteBuilder {
|
|
|
11240
12177
|
}
|
|
11241
12178
|
return inst;
|
|
11242
12179
|
}
|
|
12180
|
+
withReadOnly(permissions) {
|
|
12181
|
+
if (permissions) {
|
|
12182
|
+
this.withPermissions(permissions);
|
|
12183
|
+
}
|
|
12184
|
+
this.withAdd(false);
|
|
12185
|
+
this.withEdit(false);
|
|
12186
|
+
this.withDelete(false);
|
|
12187
|
+
return this;
|
|
12188
|
+
}
|
|
11243
12189
|
withDetails(hasDetails = true, permissions, path) {
|
|
11244
12190
|
this.hasDetails = hasDetails;
|
|
11245
12191
|
if (permissions) {
|
|
@@ -11270,24 +12216,31 @@ class TableviewRouteBuilder {
|
|
|
11270
12216
|
}
|
|
11271
12217
|
return this;
|
|
11272
12218
|
}
|
|
12219
|
+
withDelete(hasDelete = true, permissions) {
|
|
12220
|
+
this.hasDelete = hasDelete;
|
|
12221
|
+
if (permissions) {
|
|
12222
|
+
this.withPermissions(undefined, undefined, undefined, permissions);
|
|
12223
|
+
}
|
|
12224
|
+
return this;
|
|
12225
|
+
}
|
|
11273
12226
|
withPermissions(read, add, edit, delet, details) {
|
|
11274
12227
|
if (!this.permissions) {
|
|
11275
12228
|
this.permissions = {};
|
|
11276
12229
|
}
|
|
11277
12230
|
if (read) {
|
|
11278
|
-
this.permissions[
|
|
12231
|
+
this.permissions[TableviewActionDefaultCategories.READ] = read;
|
|
11279
12232
|
}
|
|
11280
12233
|
if (add) {
|
|
11281
|
-
this.permissions[
|
|
12234
|
+
this.permissions[TableviewActionDefaultCategories.ADD] = add;
|
|
11282
12235
|
}
|
|
11283
12236
|
if (edit) {
|
|
11284
|
-
this.permissions[
|
|
12237
|
+
this.permissions[TableviewActionDefaultCategories.EDIT] = edit;
|
|
11285
12238
|
}
|
|
11286
12239
|
if (delet) {
|
|
11287
|
-
this.permissions[
|
|
12240
|
+
this.permissions[TableviewActionDefaultCategories.DELETE] = delet;
|
|
11288
12241
|
}
|
|
11289
12242
|
if (details) {
|
|
11290
|
-
this.permissions[
|
|
12243
|
+
this.permissions[TableviewActionDefaultCategories.DETAILS] = details;
|
|
11291
12244
|
}
|
|
11292
12245
|
return this;
|
|
11293
12246
|
}
|
|
@@ -11323,35 +12276,42 @@ class TableviewRouteBuilder {
|
|
|
11323
12276
|
if (this.permissions) {
|
|
11324
12277
|
routeData.tableviewPermissions = { ...this.permissions };
|
|
11325
12278
|
}
|
|
12279
|
+
routeData.tableviewActions = {
|
|
12280
|
+
hasAdd: this.hasAdd,
|
|
12281
|
+
hasEdit: this.hasEdit,
|
|
12282
|
+
hasDetails: this.hasDetails,
|
|
12283
|
+
hasDelete: this.hasDelete
|
|
12284
|
+
};
|
|
11326
12285
|
tableviewRouteBuilder.withData(routeData);
|
|
11327
|
-
if (this.permissions?.[
|
|
11328
|
-
tableviewRouteBuilder.withPermissions(this.permissions[
|
|
12286
|
+
if (this.permissions?.[TableviewActionDefaultCategories.READ]) {
|
|
12287
|
+
tableviewRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11329
12288
|
}
|
|
11330
12289
|
// list route
|
|
11331
12290
|
const rootChildRouteBuilder = RouteBuilder.create('', MngActionRouteComponent);
|
|
11332
|
-
|
|
11333
|
-
|
|
12291
|
+
rootChildRouteBuilder.withData({ ...routeData });
|
|
12292
|
+
if (this.permissions?.[TableviewActionDefaultCategories.READ]) {
|
|
12293
|
+
rootChildRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11334
12294
|
}
|
|
11335
12295
|
tableviewRouteBuilder.addChildBuilder(rootChildRouteBuilder);
|
|
11336
12296
|
// add route
|
|
11337
12297
|
if (this.hasAdd) {
|
|
11338
12298
|
const routeBuilder = RouteBuilder.create(this.addPath, MngActionRouteComponent);
|
|
11339
|
-
if (this.permissions?.[
|
|
11340
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12299
|
+
if (this.permissions?.[TableviewActionDefaultCategories.ADD]) {
|
|
12300
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.ADD]);
|
|
11341
12301
|
}
|
|
11342
12302
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11343
12303
|
}
|
|
11344
12304
|
if (this.hasDetails) {
|
|
11345
12305
|
const routeBuilder = RouteBuilder.create(this.detailsPath, MngActionRouteComponent);
|
|
11346
|
-
if (this.permissions?.[
|
|
11347
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12306
|
+
if (this.permissions?.[TableviewActionDefaultCategories.DETAILS]) {
|
|
12307
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.DETAILS]);
|
|
11348
12308
|
}
|
|
11349
12309
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11350
12310
|
}
|
|
11351
12311
|
if (this.hasEdit) {
|
|
11352
12312
|
const routeBuilder = RouteBuilder.create(this.editPath, MngActionRouteComponent);
|
|
11353
|
-
if (this.permissions?.[
|
|
11354
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12313
|
+
if (this.permissions?.[TableviewActionDefaultCategories.EDIT]) {
|
|
12314
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.EDIT]);
|
|
11355
12315
|
}
|
|
11356
12316
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11357
12317
|
}
|
|
@@ -11367,5 +12327,5 @@ class TableviewRouteBuilder {
|
|
|
11367
12327
|
* Generated bundle index. Do not edit.
|
|
11368
12328
|
*/
|
|
11369
12329
|
|
|
11370
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonDescriptor, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngButtonComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
12330
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonDescriptor, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngButtonComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
11371
12331
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|