@mediusinc/mng-commons 0.2.9 → 0.2.14

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.
Files changed (39) hide show
  1. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +2 -4
  2. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  3. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +9 -8
  4. package/esm2020/lib/components/layout/menu-item.component.mjs +59 -17
  5. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
  6. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +6 -3
  7. package/esm2020/lib/config/formly.config.mjs +10 -1
  8. package/esm2020/lib/descriptors/editor.descriptor.mjs +27 -1
  9. package/esm2020/lib/descriptors/table.descriptor.mjs +82 -3
  10. package/esm2020/lib/descriptors/tableview.descriptor.mjs +4 -1
  11. package/esm2020/lib/mng-commons.module.mjs +5 -2
  12. package/esm2020/lib/models/index.mjs +2 -1
  13. package/esm2020/lib/models/menu.model.mjs +2 -0
  14. package/esm2020/lib/pipes/enum.pipe.mjs +22 -0
  15. package/esm2020/lib/pipes/index.mjs +2 -1
  16. package/esm2020/lib/router/route-builder.mjs +86 -17
  17. package/esm2020/lib/services/commons.service.mjs +1 -1
  18. package/esm2020/lib/utils/editor-formly.util.mjs +7 -1
  19. package/esm2020/lib/utils/enum.util.mjs +23 -2
  20. package/esm2020/public-api.mjs +2 -1
  21. package/fesm2015/mediusinc-mng-commons.mjs +330 -51
  22. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  23. package/fesm2020/mediusinc-mng-commons.mjs +325 -50
  24. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  25. package/lib/components/layout/menu-item.component.d.ts +13 -5
  26. package/lib/components/tableview/table/column-value/column-value.component.d.ts +1 -0
  27. package/lib/descriptors/editor.descriptor.d.ts +11 -1
  28. package/lib/descriptors/table.descriptor.d.ts +22 -4
  29. package/lib/descriptors/tableview.descriptor.d.ts +1 -0
  30. package/lib/mng-commons.module.d.ts +70 -69
  31. package/lib/models/index.d.ts +1 -0
  32. package/lib/models/menu.model.d.ts +25 -0
  33. package/lib/pipes/enum.pipe.d.ts +7 -0
  34. package/lib/pipes/index.d.ts +1 -0
  35. package/lib/router/route-builder.d.ts +9 -5
  36. package/lib/services/commons.service.d.ts +6 -6
  37. package/lib/utils/enum.util.d.ts +11 -0
  38. package/package.json +1 -1
  39. package/public-api.d.ts +1 -0
@@ -6,7 +6,7 @@ import { Injectable, InjectionToken, Inject, Component, ChangeDetectionStrategy,
6
6
  import * as i2$3 from '@angular/forms';
7
7
  import { Validators, FormGroup, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/router';
9
- import { NavigationEnd, RouterModule } from '@angular/router';
9
+ import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
10
10
  import * as i3 from '@ngx-formly/core';
11
11
  import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
12
12
  import * as i2$2 from '@ngx-translate/core';
@@ -36,14 +36,15 @@ import { DynamicDialogModule, DialogService } from 'primeng/dynamicdialog';
36
36
  import * as i1$5 from 'primeng/fieldset';
37
37
  import { FieldsetModule } from 'primeng/fieldset';
38
38
  import { FileUploadModule } from 'primeng/fileupload';
39
+ import * as i6$1 from 'primeng/inputmask';
39
40
  import { InputMaskModule } from 'primeng/inputmask';
40
41
  import * as i1$3 from 'primeng/inputnumber';
41
42
  import { InputNumberModule } from 'primeng/inputnumber';
42
43
  import * as i2$5 from 'primeng/inputswitch';
43
44
  import { InputSwitchModule } from 'primeng/inputswitch';
44
- import * as i9$1 from 'primeng/inputtext';
45
+ import * as i10$1 from 'primeng/inputtext';
45
46
  import { InputTextModule } from 'primeng/inputtext';
46
- import * as i8$1 from 'primeng/inputtextarea';
47
+ import * as i9$1 from 'primeng/inputtextarea';
47
48
  import { InputTextareaModule } from 'primeng/inputtextarea';
48
49
  import * as i3$1 from 'primeng/messages';
49
50
  import { MessagesModule } from 'primeng/messages';
@@ -67,11 +68,11 @@ import { TagModule } from 'primeng/tag';
67
68
  import * as i7$1 from 'primeng/toast';
68
69
  import { ToastModule } from 'primeng/toast';
69
70
  import { ToggleButtonModule } from 'primeng/togglebutton';
70
- import * as i8$2 from 'primeng/toolbar';
71
+ import * as i8$1 from 'primeng/toolbar';
71
72
  import { ToolbarModule } from 'primeng/toolbar';
72
73
  import * as i10 from 'primeng/tooltip';
73
74
  import { TooltipModule } from 'primeng/tooltip';
74
- import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject } from 'rxjs';
75
+ import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
75
76
  import 'reflect-metadata';
76
77
  import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
77
78
  import * as i4 from '@angular/platform-browser';
@@ -1038,6 +1039,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1038
1039
  get pattern() {
1039
1040
  return this._pattern;
1040
1041
  }
1042
+ get mask() {
1043
+ return this._mask;
1044
+ }
1045
+ get slotChar() {
1046
+ return this._slotChar;
1047
+ }
1048
+ get customComponentName() {
1049
+ return this._customComponentName;
1050
+ }
1041
1051
  asText(minLength, maxLength, pattern, isEmail) {
1042
1052
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1043
1053
  this._minLength = minLength;
@@ -1092,6 +1102,17 @@ class FieldInputDescriptor extends AFieldDescriptor {
1092
1102
  this._datePickerShowTime = showTime ?? false;
1093
1103
  return this;
1094
1104
  }
1105
+ asMask(mask, slotChar) {
1106
+ this._fieldType = FieldInputDescriptor.TypeEnum.Mask;
1107
+ this._mask = mask;
1108
+ this._slotChar = slotChar;
1109
+ return this;
1110
+ }
1111
+ asCustomComponent(customComponentName) {
1112
+ this._fieldType = FieldInputDescriptor.TypeEnum.Custom;
1113
+ this._customComponentName = customComponentName;
1114
+ return this;
1115
+ }
1095
1116
  copy() {
1096
1117
  const field = new FieldInputDescriptor(this._editor, this._property);
1097
1118
  this.copyFieldsTo(field);
@@ -1110,6 +1131,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
1110
1131
  field._maxLength = this._maxLength;
1111
1132
  field._minLength = this._minLength;
1112
1133
  field._pattern = this._pattern;
1134
+ field._mask = this._mask;
1135
+ field._slotChar = this._slotChar;
1136
+ field._customComponentName = this._customComponentName;
1113
1137
  return field;
1114
1138
  }
1115
1139
  }
@@ -1122,6 +1146,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
1122
1146
  TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
1123
1147
  TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
1124
1148
  TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
1149
+ TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
1150
+ TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
1125
1151
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1126
1152
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1127
1153
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -1210,6 +1236,7 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
1210
1236
  this.withLookupDataProvider(dataProvider);
1211
1237
  this.withItemsLabelProperty('title');
1212
1238
  this.withItemsValueProperty('value');
1239
+ this.withDataKeyProperty('value');
1213
1240
  }
1214
1241
  get enumType() {
1215
1242
  return this._enumType;
@@ -1573,6 +1600,13 @@ class TableDescriptor {
1573
1600
  this.setDataKeyFromColumn();
1574
1601
  return column;
1575
1602
  }
1603
+ addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
1604
+ const column = new ColumnDescriptor(this, property);
1605
+ column.asEnum(enumType, nameAsValue, titlePath);
1606
+ this._columns.push(column);
1607
+ this.setDataKeyFromColumn();
1608
+ return column;
1609
+ }
1576
1610
  addColumnObject(property, modelType, displayProperty) {
1577
1611
  const column = new ColumnDescriptor(this, property);
1578
1612
  column.withModelType(modelType);
@@ -1649,6 +1683,7 @@ class ColumnDescriptor {
1649
1683
  this._modelType = null;
1650
1684
  this._columnType = ColumnDescriptor.TypeEnum.String;
1651
1685
  this._isSortEnabled = false;
1686
+ this._enumNameAsValue = false;
1652
1687
  this._table = table;
1653
1688
  this._property = property;
1654
1689
  }
@@ -1679,6 +1714,15 @@ class ColumnDescriptor {
1679
1714
  get property() {
1680
1715
  return this._property;
1681
1716
  }
1717
+ get enumType() {
1718
+ return this._enumType;
1719
+ }
1720
+ get enumTitlePath() {
1721
+ return this._enumTitlePath;
1722
+ }
1723
+ get enumNameAsValue() {
1724
+ return this._enumNameAsValue;
1725
+ }
1682
1726
  asType(type = ColumnDescriptor.TypeEnum.String) {
1683
1727
  this._columnType = type;
1684
1728
  return this;
@@ -1697,6 +1741,16 @@ class ColumnDescriptor {
1697
1741
  this._columnType = ColumnDescriptor.TypeEnum.Boolean;
1698
1742
  return this;
1699
1743
  }
1744
+ asEnum(enumType, nameAsValue = false, titlePath) {
1745
+ this._columnType = ColumnDescriptor.TypeEnum.Enum;
1746
+ this._enumType = enumType;
1747
+ this._enumNameAsValue = nameAsValue;
1748
+ if (typeof titlePath === 'undefined') {
1749
+ titlePath = TypeUtil.findEnumName(enumType);
1750
+ }
1751
+ this._enumTitlePath = titlePath;
1752
+ return this;
1753
+ }
1700
1754
  withModelType(modelType) {
1701
1755
  this._modelType = modelType;
1702
1756
  return this;
@@ -1711,7 +1765,23 @@ class ColumnDescriptor {
1711
1765
  }
1712
1766
  withFilter() {
1713
1767
  this._filterDescriptor = new FilterDescriptor(this._property);
1714
- this._filterDescriptor.asFilterType(this._columnType);
1768
+ let filterType;
1769
+ switch (this._columnType) {
1770
+ case ColumnDescriptor.TypeEnum.Number:
1771
+ filterType = FilterDescriptor.TypeEnum.Number;
1772
+ break;
1773
+ case ColumnDescriptor.TypeEnum.Boolean:
1774
+ filterType = FilterDescriptor.TypeEnum.Boolean;
1775
+ break;
1776
+ case ColumnDescriptor.TypeEnum.Date:
1777
+ filterType = FilterDescriptor.TypeEnum.Date;
1778
+ break;
1779
+ case ColumnDescriptor.TypeEnum.String:
1780
+ default:
1781
+ filterType = FilterDescriptor.TypeEnum.String;
1782
+ break;
1783
+ }
1784
+ this._filterDescriptor.asFilterType(filterType);
1715
1785
  return this._filterDescriptor;
1716
1786
  }
1717
1787
  withFilterLookup() {
@@ -1719,6 +1789,14 @@ class ColumnDescriptor {
1719
1789
  this._filterDescriptor = filterDescriptor;
1720
1790
  return filterDescriptor;
1721
1791
  }
1792
+ withFilterLookupEnum(options) {
1793
+ if (this._columnType !== ColumnDescriptor.TypeEnum.Enum || !this._enumType) {
1794
+ throw new Error(`Column ${this._property} is not of type enum or enum type is undefined.`);
1795
+ }
1796
+ const filterDescriptor = new FilterLookupEnumDescriptor(this._property, this._enumType, options, this._enumNameAsValue, this._enumTitlePath);
1797
+ this._filterDescriptor = filterDescriptor;
1798
+ return filterDescriptor;
1799
+ }
1722
1800
  withSort(isEnabled = true) {
1723
1801
  this._isSortEnabled = isEnabled;
1724
1802
  return this;
@@ -1740,6 +1818,7 @@ class ColumnDescriptor {
1740
1818
  TypeEnum[TypeEnum["Number"] = 1] = "Number";
1741
1819
  TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
1742
1820
  TypeEnum[TypeEnum["Date"] = 3] = "Date";
1821
+ TypeEnum[TypeEnum["Enum"] = 4] = "Enum";
1743
1822
  })(TypeEnum = ColumnDescriptor.TypeEnum || (ColumnDescriptor.TypeEnum = {}));
1744
1823
  })(ColumnDescriptor || (ColumnDescriptor = {}));
1745
1824
  class FilterDescriptor {
@@ -1811,6 +1890,7 @@ class FilterDescriptor {
1811
1890
  TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
1812
1891
  TypeEnum[TypeEnum["Date"] = 3] = "Date";
1813
1892
  TypeEnum[TypeEnum["Lookup"] = 4] = "Lookup";
1893
+ TypeEnum[TypeEnum["LookupEnum"] = 5] = "LookupEnum";
1814
1894
  })(TypeEnum = FilterDescriptor.TypeEnum || (FilterDescriptor.TypeEnum = {}));
1815
1895
  let MatchModeEnum;
1816
1896
  (function (MatchModeEnum) {
@@ -1917,6 +1997,31 @@ class FilterLookupDescriptor extends FilterDescriptor {
1917
1997
  descriptor._dataKeyProperty = this._dataKeyProperty;
1918
1998
  }
1919
1999
  }
2000
+ class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
2001
+ constructor(property, enumType, options, nameAsValue = false, optionsTitlePath) {
2002
+ super(property, null);
2003
+ this._enumType = enumType;
2004
+ if (typeof optionsTitlePath === 'undefined') {
2005
+ optionsTitlePath = TypeUtil.findEnumName(enumType);
2006
+ }
2007
+ const optionEnumValues = Array.isArray(options)
2008
+ ? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
2009
+ : EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
2010
+ const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
2011
+ this.withLookupDataProvider(dataProvider);
2012
+ this.withItemsLabelProperty('title');
2013
+ this.withItemsValueProperty('value');
2014
+ this.withDataKeyProperty('value');
2015
+ }
2016
+ get enumType() {
2017
+ return this._enumType;
2018
+ }
2019
+ copy() {
2020
+ const field = new FilterLookupEnumDescriptor(this._property, this._enumType, []);
2021
+ this.copyFieldsTo(field);
2022
+ return field;
2023
+ }
2024
+ }
1920
2025
  (function (FilterLookupDescriptor) {
1921
2026
  let LookupTypeEnum;
1922
2027
  (function (LookupTypeEnum) {
@@ -1994,6 +2099,9 @@ class TableviewDescriptor {
1994
2099
  addColumnBoolean(property) {
1995
2100
  return this._table.addColumnBoolean(property);
1996
2101
  }
2102
+ addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
2103
+ return this._table.addColumnEnum(property, enumType, nameAsValue, titlePath);
2104
+ }
1997
2105
  addColumnObject(property, modelType, displayProperty) {
1998
2106
  return this._table.addColumnObject(property, modelType, displayProperty);
1999
2107
  }
@@ -2166,6 +2274,12 @@ class EditorFormlyUtil {
2166
2274
  case FieldInputDescriptor.TypeEnum.Datepicker:
2167
2275
  field.type = 'datepicker';
2168
2276
  break;
2277
+ case FieldInputDescriptor.TypeEnum.Mask:
2278
+ field.type = 'mask';
2279
+ break;
2280
+ case FieldInputDescriptor.TypeEnum.Custom:
2281
+ field.type = descriptor.customComponentName;
2282
+ break;
2169
2283
  default:
2170
2284
  field.type = 'input';
2171
2285
  field.templateOptions.minLength = descriptor.minLength;
@@ -2225,8 +2339,15 @@ class EnumUtil {
2225
2339
  * @param enumType Enum object.
2226
2340
  */
2227
2341
  static getConstantNames(enumType) {
2342
+ return EnumUtil.getConstantNamesFromEnumObject(enumType);
2343
+ }
2344
+ /**
2345
+ * Returns array of names for constants in enum.
2346
+ * @param enumObj Enum object.
2347
+ */
2348
+ static getConstantNamesFromEnumObject(enumObj) {
2228
2349
  // in number enum, the numbers are also represented in objects and should be filtered out
2229
- return Object.keys(enumType).filter(v => isNaN(+v));
2350
+ return Object.keys(enumObj).filter(v => isNaN(+v));
2230
2351
  }
2231
2352
  /**
2232
2353
  * Returns array of string values for constants in enum.
@@ -2278,6 +2399,20 @@ class EnumUtil {
2278
2399
  return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
2279
2400
  }
2280
2401
  }
2402
+ /**
2403
+ * Gets constant name for value.
2404
+ * @param enumObj Enum object.
2405
+ * @param value Value of enum constant.
2406
+ */
2407
+ static getConstantNameFromEnumObject(enumObj, value) {
2408
+ const enumObjAny = enumObj;
2409
+ if (typeof value === 'string') {
2410
+ return this.getConstantNamesFromEnumObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
2411
+ }
2412
+ else {
2413
+ return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
2414
+ }
2415
+ }
2281
2416
  }
2282
2417
 
2283
2418
  class I18nUtil {
@@ -4291,9 +4426,7 @@ class MngDropdownComponent {
4291
4426
  }
4292
4427
  writeValue(obj) {
4293
4428
  this.dropdownFormControl.setValue(obj, { emitEvent: false });
4294
- if (this.primeDropdown) {
4295
- this.primeDropdown.writeValue(obj);
4296
- }
4429
+ this.primeDropdown?.writeValue(obj);
4297
4430
  }
4298
4431
  }
4299
4432
  MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
@@ -4486,10 +4619,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4486
4619
  }
4487
4620
  }
4488
4621
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4489
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i8$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i9$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4622
+ MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4490
4623
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4491
4624
  type: Component,
4492
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4625
+ args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4493
4626
  }] });
4494
4627
 
4495
4628
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4499,10 +4632,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
4499
4632
  }
4500
4633
  }
4501
4634
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4502
- MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4635
+ MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4503
4636
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
4504
4637
  type: Component,
4505
- args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n" }]
4638
+ args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n" }]
4506
4639
  }] });
4507
4640
 
4508
4641
  class MngTableLoadEvent {
@@ -4586,10 +4719,10 @@ class MngTableColumnFilterComponent {
4586
4719
  }
4587
4720
  }
4588
4721
  MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2$1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
4589
- MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (change)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i2$2.TranslatePipe } });
4722
+ MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i2$2.TranslatePipe } });
4590
4723
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
4591
4724
  type: Component,
4592
- args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (change)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
4725
+ args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
4593
4726
  }], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
4594
4727
  type: Input
4595
4728
  }], display: [{
@@ -4650,19 +4783,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4650
4783
  }]
4651
4784
  }] });
4652
4785
 
4786
+ class MngEnumPipe {
4787
+ transform(value, enumObj, i18nPath, nameAsValue = false) {
4788
+ const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
4789
+ if (typeof i18nPath === 'undefined') {
4790
+ i18nPath = TypeUtil.findEnumName(enumObj);
4791
+ }
4792
+ return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
4793
+ }
4794
+ }
4795
+ MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4796
+ MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
4797
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
4798
+ type: Pipe,
4799
+ args: [{
4800
+ name: 'enum',
4801
+ pure: true
4802
+ }]
4803
+ }] });
4804
+
4653
4805
  class MngTableColumnValueComponent {
4654
4806
  constructor() {
4655
4807
  this.columnTypeString = ColumnDescriptor.TypeEnum.String;
4656
4808
  this.columnTypeNumber = ColumnDescriptor.TypeEnum.Number;
4657
4809
  this.columnTypeBoolean = ColumnDescriptor.TypeEnum.Boolean;
4658
4810
  this.columnTypeDate = ColumnDescriptor.TypeEnum.Date;
4811
+ this.columnTypeEnum = ColumnDescriptor.TypeEnum.Enum;
4659
4812
  }
4660
4813
  }
4661
4814
  MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4662
- MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4$1.DecimalPipe, "date": i4$1.DatePipe, "boolean": MngBooleanPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4815
+ MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n", directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "propertyPath": MngPropertyPathPipe, "number": i4$1.DecimalPipe, "date": i4$1.DatePipe, "boolean": MngBooleanPipe, "translate": i2$2.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4663
4816
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
4664
4817
  type: Component,
4665
- args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n</ng-container>\n" }]
4818
+ args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property] }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n {{ (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property]) | boolean }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{\n (descriptor.displayPropertyPath ? (item | propertyPath: descriptor.displayPropertyPath) : item[descriptor.property])\n | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue\n | translate\n }}\n </ng-container>\n</ng-container>\n" }]
4666
4819
  }], propDecorators: { descriptor: [{
4667
4820
  type: Input
4668
4821
  }], item: [{
@@ -5426,8 +5579,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5426
5579
  }], ctorParameters: function () { return [{ type: MngCommonsService }]; } });
5427
5580
 
5428
5581
  class MngMenuItemComponent {
5429
- constructor(router, mngCommons, mainLayoutService) {
5582
+ constructor(injector, router, route, mngCommons, mainLayoutService) {
5583
+ this.injector = injector;
5430
5584
  this.router = router;
5585
+ this.route = route;
5431
5586
  this.mngCommons = mngCommons;
5432
5587
  this.mainLayoutService = mainLayoutService;
5433
5588
  this.index = 0;
@@ -5436,6 +5591,8 @@ class MngMenuItemComponent {
5436
5591
  this.key = '';
5437
5592
  this.active = false;
5438
5593
  this.hover = false;
5594
+ this.isAllowedSubject = new BehaviorSubject(true);
5595
+ this.isAllowed$ = this.isAllowedSubject.asObservable().pipe(distinctUntilChanged());
5439
5596
  }
5440
5597
  ngOnInit() {
5441
5598
  if (!this.mngCommons.menuModeIsSlim && this.item.routerLink) {
@@ -5459,14 +5616,20 @@ class MngMenuItemComponent {
5459
5616
  this.menuResetSubscription = this.mngCommons.menuReset$.subscribe(() => {
5460
5617
  this.active = false;
5461
5618
  });
5462
- this.routerEventsSubscription = this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
5463
- if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
5464
- this.active = false;
5619
+ this.routerEventsSubscription = this.router.events.subscribe(next => {
5620
+ if (next instanceof GuardsCheckEnd && next.shouldActivate) {
5621
+ this.checkIfMenuItemIsAllowedFromGuard(next.state);
5465
5622
  }
5466
- else {
5467
- this.updateActiveStateFromRoute();
5623
+ else if (next instanceof NavigationEnd) {
5624
+ if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
5625
+ this.active = false;
5626
+ }
5627
+ else {
5628
+ this.updateActiveStateFromRoute();
5629
+ }
5468
5630
  }
5469
5631
  });
5632
+ this.checkIfMenuItemIsAllowedFromGuard(this.router.routerState.snapshot);
5470
5633
  }
5471
5634
  updateActiveStateFromRoute() {
5472
5635
  if (this.itemUrl) {
@@ -5488,10 +5651,6 @@ class MngMenuItemComponent {
5488
5651
  }
5489
5652
  // notify other items
5490
5653
  this.mngCommons.menuChangeActiveKey(this.key);
5491
- // execute command
5492
- if (this.item.command) {
5493
- this.item.command({ originalEvent: event, item: this.item });
5494
- }
5495
5654
  // toggle active state
5496
5655
  if (this.item.items) {
5497
5656
  this.active = !this.active;
@@ -5523,10 +5682,45 @@ class MngMenuItemComponent {
5523
5682
  this.menuSourceSubscription?.unsubscribe();
5524
5683
  this.menuResetSubscription?.unsubscribe();
5525
5684
  this.routerEventsSubscription?.unsubscribe();
5685
+ this.guardsSubscription?.unsubscribe();
5686
+ }
5687
+ checkIfMenuItemIsAllowedFromGuard(routerState) {
5688
+ this.guardsSubscription?.unsubscribe();
5689
+ if (this.item.guards?.length) {
5690
+ const obs = [];
5691
+ for (const guard of this.item.guards) {
5692
+ const tokenInjectedInstance = this.injector.get(guard);
5693
+ if (tokenInjectedInstance && 'canActivate' in tokenInjectedInstance) {
5694
+ const guardInstance = tokenInjectedInstance;
5695
+ const canActivateRes = guardInstance.canActivate(this.route.snapshot, routerState);
5696
+ let canActivateObs;
5697
+ if (canActivateRes instanceof Observable) {
5698
+ canActivateObs = canActivateRes;
5699
+ }
5700
+ else if (canActivateRes instanceof Promise) {
5701
+ canActivateObs = from(canActivateRes);
5702
+ }
5703
+ else {
5704
+ canActivateObs = of(canActivateRes);
5705
+ }
5706
+ obs.push(canActivateObs.pipe(first(), map(res => res === true) // if url tree is present, that means redirect and implies not allowed
5707
+ ));
5708
+ }
5709
+ }
5710
+ this.guardsSubscription = combineLatest(obs)
5711
+ .pipe(first())
5712
+ .subscribe(next => {
5713
+ const result = next.every(n => n === true);
5714
+ this.isAllowedSubject.next(result);
5715
+ });
5716
+ }
5717
+ else {
5718
+ this.isAllowedSubject.next(true);
5719
+ }
5526
5720
  }
5527
5721
  }
5528
- MngMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuItemComponent, deps: [{ token: i1.Router }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5529
- MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false\" class=\"layout-menuitem-root-text\">{{ item.label | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false\"\n [attr.href]=\"item.url\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClass\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i2$2.TranslatePipe, "async": i4$1.AsyncPipe }, animations: [
5722
+ MngMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuItemComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5723
+ MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, animations: [
5530
5724
  trigger('children', [
5531
5725
  state('void', style({
5532
5726
  height: '0px'
@@ -5578,8 +5772,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5578
5772
  transition('hiddenAnimated => visibleAnimated', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')),
5579
5773
  transition('void => visibleAnimated, visibleAnimated => void', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
5580
5774
  ])
5581
- ], template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false\" class=\"layout-menuitem-root-text\">{{ item.label | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false\"\n [attr.href]=\"item.url\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClass\"></li>\n </ng-template>\n </ul>\n</ng-container>\n" }]
5582
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
5775
+ ], template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n" }]
5776
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
5583
5777
  type: Input
5584
5778
  }], index: [{
5585
5779
  type: Input
@@ -5748,7 +5942,7 @@ class MngTableviewComponent {
5748
5942
  }
5749
5943
  }
5750
5944
  MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2$1.MessageService }, { token: i2$2.TranslateService }, { token: i2.DialogService }, { token: i2$1.ConfirmationService }, { token: MngActionService }, { token: TableviewComponentService }], target: i0.ɵɵFactoryTarget.Component });
5751
- MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, TableviewComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($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-m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\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 </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i2$2.TranslatePipe } });
5945
+ MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, TableviewComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($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-m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\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 </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$1.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i2$2.TranslatePipe } });
5752
5946
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5753
5947
  type: Component,
5754
5948
  args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, TableviewComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($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-m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\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 </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
@@ -5899,6 +6093,15 @@ const formlyTypesConfig = [
5899
6093
  }
5900
6094
  }
5901
6095
  },
6096
+ {
6097
+ name: 'mask',
6098
+ extends: 'input',
6099
+ defaultOptions: {
6100
+ templateOptions: {
6101
+ type: 'mask'
6102
+ }
6103
+ }
6104
+ },
5902
6105
  {
5903
6106
  name: 'dropdown',
5904
6107
  component: MngFormlyFieldDropdownComponent,
@@ -6049,6 +6252,7 @@ const declarations = [
6049
6252
  MngTemplateDirective,
6050
6253
  // pipes
6051
6254
  MngPropertyPathPipe,
6255
+ MngEnumPipe,
6052
6256
  MngBooleanPipe,
6053
6257
  MngI18nPropertyPipe,
6054
6258
  // layout components
@@ -6141,6 +6345,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6141
6345
  MngTemplateDirective,
6142
6346
  // pipes
6143
6347
  MngPropertyPathPipe,
6348
+ MngEnumPipe,
6144
6349
  MngBooleanPipe,
6145
6350
  MngI18nPropertyPipe,
6146
6351
  // layout components
@@ -6251,6 +6456,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6251
6456
  MngTemplateDirective,
6252
6457
  // pipes
6253
6458
  MngPropertyPathPipe,
6459
+ MngEnumPipe,
6254
6460
  MngBooleanPipe,
6255
6461
  MngI18nPropertyPipe,
6256
6462
  // layout components
@@ -6471,8 +6677,12 @@ class RoutesBuilder {
6471
6677
  addRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
6472
6678
  return this.addRouteBuilder(RouteBuilder.createRedirect(path, redirectTo, pathMatch));
6473
6679
  }
6474
- addLazyRoute(path, loadChildren) {
6475
- return this.addRouteBuilder(RouteBuilder.createFromRoute({ path: path, loadChildren: loadChildren }));
6680
+ addLazyRoute(path, loadChildren, canLoad) {
6681
+ const route = { path: path, loadChildren: loadChildren };
6682
+ if (canLoad?.length) {
6683
+ route.canLoad = canLoad;
6684
+ }
6685
+ return this.addRouteBuilder(RouteBuilder.createFromRoute(route));
6476
6686
  }
6477
6687
  addRoute(path, component) {
6478
6688
  return this.addRouteBuilder(RouteBuilder.create(path, component));
@@ -6612,11 +6822,32 @@ class RouteBuilder {
6612
6822
  this.withBreadcrumb(title);
6613
6823
  return this;
6614
6824
  }
6825
+ withCanActivate(diToken) {
6826
+ if (!this.route.canActivate) {
6827
+ this.route.canActivate = [];
6828
+ }
6829
+ this.route.canActivate.push(diToken);
6830
+ return this;
6831
+ }
6832
+ withCanDeactivate(diToken) {
6833
+ if (!this.route.canDeactivate) {
6834
+ this.route.canDeactivate = [];
6835
+ }
6836
+ this.route.canDeactivate.push(diToken);
6837
+ return this;
6838
+ }
6839
+ withResolver(diToken, name) {
6840
+ if (!this.route.resolve) {
6841
+ this.route.resolve = {};
6842
+ }
6843
+ this.route.resolve[name] = diToken;
6844
+ return this;
6845
+ }
6615
6846
  withData(data) {
6616
6847
  this.route.data = data;
6617
6848
  return this;
6618
6849
  }
6619
- withPrimeMenuItem(menuItem) {
6850
+ withMngMenuItem(menuItem) {
6620
6851
  this.menuItem = menuItem;
6621
6852
  return this;
6622
6853
  }
@@ -6688,34 +6919,61 @@ class RouteBuilder {
6688
6919
  }
6689
6920
  }
6690
6921
  }
6922
+ if (this.route.canActivate) {
6923
+ angularRoute.canActivate = [...this.route.canActivate];
6924
+ }
6925
+ if (this.route.canActivateChild) {
6926
+ angularRoute.canActivateChild = [...this.route.canActivateChild];
6927
+ }
6928
+ if (this.route.canLoad) {
6929
+ angularRoute.canLoad = [...this.route.canLoad];
6930
+ }
6931
+ if (this.route.canDeactivate) {
6932
+ angularRoute.canDeactivate = [...this.route.canDeactivate];
6933
+ }
6934
+ if (this.route.resolve) {
6935
+ angularRoute.resolve = { ...this.route.resolve };
6936
+ }
6691
6937
  return angularRoute;
6692
6938
  }
6693
6939
  buildMenu() {
6694
- const menuItem = this.menuItem ? { ...this.menuItem } : null;
6940
+ const menuItemBuild = this.menuItem ? { ...this.menuItem } : null;
6695
6941
  const routeChildrenMenuItems = this.children.flatMap(child => child.buildMenu());
6696
6942
  const menuItemChildren = [];
6697
- const finalMenuItemChildren = [];
6698
- if (menuItem?.items) {
6699
- finalMenuItemChildren.push(...menuItem.items);
6943
+ const menuItemChildrenBuild = [];
6944
+ if (menuItemBuild?.items) {
6945
+ menuItemChildrenBuild.push(...menuItemBuild.items);
6700
6946
  }
6701
6947
  for (const menuItemChild of this.menuItemChildren) {
6702
6948
  const finalMenuItemChild = { ...menuItemChild };
6703
6949
  if (!finalMenuItemChild.routerLink) {
6704
6950
  finalMenuItemChild.routerLink = this.routePath;
6705
6951
  }
6952
+ if (typeof finalMenuItemChild.routerLink === 'string') {
6953
+ finalMenuItemChild.routerLink = [finalMenuItemChild.routerLink];
6954
+ }
6706
6955
  finalMenuItemChild.routerLink = RouteUtil.removeEmptyPathSegments(finalMenuItemChild.routerLink);
6707
6956
  menuItemChildren.push(finalMenuItemChild);
6708
6957
  }
6709
- finalMenuItemChildren.push(...menuItemChildren, ...routeChildrenMenuItems);
6710
- if (!menuItem) {
6711
- return finalMenuItemChildren;
6958
+ menuItemChildrenBuild.push(...menuItemChildren, ...routeChildrenMenuItems);
6959
+ if (!menuItemBuild) {
6960
+ return menuItemChildrenBuild;
6712
6961
  }
6713
- menuItem.label = menuItem.label ?? this.pageTitle;
6714
- menuItem.routerLink = RouteUtil.removeEmptyPathSegments(menuItem.routerLink ?? this.routePath);
6715
- if (finalMenuItemChildren.length > 0) {
6716
- menuItem.items = finalMenuItemChildren;
6962
+ menuItemBuild.label = menuItemBuild.label ?? this.pageTitle;
6963
+ if (typeof menuItemBuild.routerLink === 'string') {
6964
+ menuItemBuild.routerLink = [menuItemBuild.routerLink];
6717
6965
  }
6718
- return [menuItem];
6966
+ menuItemBuild.routerLink = RouteUtil.removeEmptyPathSegments(menuItemBuild.routerLink ?? this.routePath);
6967
+ if (menuItemChildrenBuild.length > 0) {
6968
+ menuItemBuild.items = menuItemChildrenBuild;
6969
+ }
6970
+ if (!menuItemBuild.guards) {
6971
+ const guards = this.findMenuItemGuards();
6972
+ if (guards.length > 0) {
6973
+ menuItemBuild.guards = guards;
6974
+ }
6975
+ }
6976
+ return [menuItemBuild];
6719
6977
  }
6720
6978
  createMenuItem(icon, label, routerLink) {
6721
6979
  const menuItem = {};
@@ -6733,13 +6991,30 @@ class RouteBuilder {
6733
6991
  adjustMenuRouterLinksFromBuilder(menuItems) {
6734
6992
  for (const menuItem of menuItems) {
6735
6993
  if (menuItem.routerLink) {
6736
- menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, menuItem.routerLink);
6994
+ menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, typeof menuItem.routerLink === 'string' ? [menuItem.routerLink] : menuItem.routerLink);
6737
6995
  }
6738
6996
  if (Array.isArray(menuItem.items)) {
6739
6997
  this.adjustMenuRouterLinksFromBuilder(menuItem.items);
6740
6998
  }
6741
6999
  }
6742
7000
  }
7001
+ findMenuItemGuards() {
7002
+ const guards = [];
7003
+ if (this.route.canActivate?.length) {
7004
+ guards.push(...this.route.canActivate);
7005
+ }
7006
+ if (this.parent) {
7007
+ // Check for parent guards that should be included in decision to hide menu item!
7008
+ // Some parent routes might have guards, but no menu items, so this guards must be taken into account here,
7009
+ // because there is no parent menu item to hide.
7010
+ this.parent.findMenuItemGuards().forEach(g => {
7011
+ if (guards.indexOf(g) < 0) {
7012
+ guards.push(g);
7013
+ }
7014
+ });
7015
+ }
7016
+ return guards;
7017
+ }
6743
7018
  }
6744
7019
 
6745
7020
  /*
@@ -6750,5 +7025,5 @@ class RouteBuilder {
6750
7025
  * Generated bundle index. Do not edit.
6751
7026
  */
6752
7027
 
6753
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7028
+ export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
6754
7029
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map