@mediusinc/mng-commons 1.3.0-1c14fa2b → 1.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +9 -0
- package/assets/i18n/sl.json +9 -0
- package/esm2020/lib/components/action/action.component.mjs +68 -16
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +6 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +21 -2
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +6 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +31 -6
- package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
- package/esm2020/lib/descriptors/action.descriptor.mjs +18 -1
- package/esm2020/lib/descriptors/table.descriptor.mjs +16 -1
- package/esm2020/lib/mng-commons.module.mjs +15 -5
- package/esm2020/lib/services/action-executor.service.mjs +5 -2
- package/esm2020/lib/services/commons.service.mjs +6 -4
- package/esm2020/lib/types/i18n.type.mjs +2 -0
- package/esm2020/lib/types/index.mjs +2 -1
- package/esm2020/lib/utils/export.util.mjs +20 -0
- package/esm2020/lib/utils/i18n.util.mjs +49 -6
- package/esm2020/lib/utils/index.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +248 -33
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +249 -34
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/action.component.d.ts +8 -3
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +4 -0
- package/lib/descriptors/action.descriptor.d.ts +6 -0
- package/lib/descriptors/table.descriptor.d.ts +5 -0
- package/lib/mng-commons.module.d.ts +16 -14
- package/lib/types/i18n.type.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/export.util.d.ts +5 -0
- package/lib/utils/i18n.util.d.ts +31 -2
- package/lib/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/scss/common/theme/designer/_components.scss +4 -4
- package/scss/mng-overrides/_layout_menu.scss +4 -0
- package/version-info.json +6 -6
|
@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import * as i1$2 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpClient, HttpClientModule, HttpParams } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Directive, Input, Output, Component, ChangeDetectionStrategy, Optional, HostBinding,
|
|
6
|
+
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Directive, Input, Output, Component, ChangeDetectionStrategy, Optional, HostBinding, ViewChild, ContentChildren, forwardRef, LOCALE_ID, ViewChildren, inject, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
7
7
|
import * as i1$1 from '@angular/forms';
|
|
8
8
|
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
@@ -48,7 +48,7 @@ import * as i9$1 from 'primeng/inputswitch';
|
|
|
48
48
|
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
49
49
|
import * as i10$1 from 'primeng/inputtext';
|
|
50
50
|
import { InputTextModule } from 'primeng/inputtext';
|
|
51
|
-
import * as i11 from 'primeng/inputtextarea';
|
|
51
|
+
import * as i11$1 from 'primeng/inputtextarea';
|
|
52
52
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
53
53
|
import * as i6 from 'primeng/messages';
|
|
54
54
|
import { MessagesModule } from 'primeng/messages';
|
|
@@ -57,13 +57,17 @@ import { MultiSelectModule } from 'primeng/multiselect';
|
|
|
57
57
|
import { PaginatorModule } from 'primeng/paginator';
|
|
58
58
|
import * as i7$1 from 'primeng/progressspinner';
|
|
59
59
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
60
|
-
import * as i12 from 'primeng/radiobutton';
|
|
60
|
+
import * as i12$1 from 'primeng/radiobutton';
|
|
61
61
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
62
62
|
import * as i10 from 'primeng/ripple';
|
|
63
63
|
import { RippleModule } from 'primeng/ripple';
|
|
64
64
|
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
65
65
|
import * as i7$3 from 'primeng/skeleton';
|
|
66
66
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
67
|
+
import * as i12 from 'primeng/slidemenu';
|
|
68
|
+
import { SlideMenuModule } from 'primeng/slidemenu';
|
|
69
|
+
import * as i11 from 'primeng/splitbutton';
|
|
70
|
+
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
67
71
|
import * as i6$4 from 'primeng/table';
|
|
68
72
|
import { ColumnFilter, Table, TableModule } from 'primeng/table';
|
|
69
73
|
import * as i4$3 from 'primeng/tabview';
|
|
@@ -1552,6 +1556,9 @@ class ActionDescriptor {
|
|
|
1552
1556
|
this._button = new ActionButtonDescriptor();
|
|
1553
1557
|
// multiple row selection
|
|
1554
1558
|
this._hasItemsSelection = false;
|
|
1559
|
+
// subactions
|
|
1560
|
+
this._subactionsAsMenu = false;
|
|
1561
|
+
this._subactions = [];
|
|
1555
1562
|
this._model = model;
|
|
1556
1563
|
this._actionName = actionName;
|
|
1557
1564
|
if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
|
|
@@ -1671,6 +1678,12 @@ class ActionDescriptor {
|
|
|
1671
1678
|
get positionTableviewCategories() {
|
|
1672
1679
|
return this._positionTableviewCategories;
|
|
1673
1680
|
}
|
|
1681
|
+
get subactionsAsMenu() {
|
|
1682
|
+
return this._subactionsAsMenu;
|
|
1683
|
+
}
|
|
1684
|
+
get subactions() {
|
|
1685
|
+
return this._subactions;
|
|
1686
|
+
}
|
|
1674
1687
|
setI18nModelActionBaseKey(base) {
|
|
1675
1688
|
if (this._parentTypeName || this._model) {
|
|
1676
1689
|
this._i18nModelActionBaseKey = this._parentTypeName
|
|
@@ -1788,6 +1801,14 @@ class ActionDescriptor {
|
|
|
1788
1801
|
this.setI18nModelActionBaseKey(base);
|
|
1789
1802
|
return this;
|
|
1790
1803
|
}
|
|
1804
|
+
withSubactionsAsMenu() {
|
|
1805
|
+
this._subactionsAsMenu = true;
|
|
1806
|
+
return this;
|
|
1807
|
+
}
|
|
1808
|
+
withSubactions(...subactions) {
|
|
1809
|
+
this._subactions.push(...subactions);
|
|
1810
|
+
return this;
|
|
1811
|
+
}
|
|
1791
1812
|
}
|
|
1792
1813
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1793
1814
|
constructor(actionName, modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
@@ -4045,7 +4066,7 @@ class MngActionExecutorService {
|
|
|
4045
4066
|
ctx.instance.isRunLoadingSubject.next(false);
|
|
4046
4067
|
// handle notification
|
|
4047
4068
|
if (ctx.instance.action.hasRunNotificationSuccess) {
|
|
4048
|
-
ctx.notification = NotificationUtil.actionNotificationSuccess(this.translate, ctx.instance.action, ctx.functionName, ctx.instance.action.runNotificationSuccessTitle, ctx.instance.action.runNotificationSuccessMessage, (_a = ctx.parameters.viewContainer) !== null && _a !== void 0 ? _a : undefined, (_b = ctx.parameters) === null || _b === void 0 ? void 0 : _b.item);
|
|
4069
|
+
ctx.notification = NotificationUtil.actionNotificationSuccess(this.translate, ctx.instance.action, ctx.functionName, ctx.instance.action.runNotificationSuccessTitle, ctx.instance.action.runNotificationSuccessMessage, (_a = ctx.parameters.viewContainer) !== null && _a !== void 0 ? _a : undefined, Object.assign(Object.assign({}, (_b = ctx.parameters) === null || _b === void 0 ? void 0 : _b.item), runResult));
|
|
4049
4070
|
}
|
|
4050
4071
|
// handle possible after run action
|
|
4051
4072
|
if (ctx.instance.action.afterRunAction) {
|
|
@@ -4559,7 +4580,7 @@ class MngCommonsService {
|
|
|
4559
4580
|
}
|
|
4560
4581
|
}
|
|
4561
4582
|
get appLanguage$() {
|
|
4562
|
-
return this.languageSubject.asObservable();
|
|
4583
|
+
return this.languageSubject.asObservable().pipe(distinctUntilChanged());
|
|
4563
4584
|
}
|
|
4564
4585
|
initLanguage() {
|
|
4565
4586
|
var _a;
|
|
@@ -4601,7 +4622,7 @@ class MngCommonsService {
|
|
|
4601
4622
|
}
|
|
4602
4623
|
}
|
|
4603
4624
|
get appDataLanguage$() {
|
|
4604
|
-
return this.dataLanguageSubject.asObservable();
|
|
4625
|
+
return this.dataLanguageSubject.asObservable().pipe(distinctUntilChanged());
|
|
4605
4626
|
}
|
|
4606
4627
|
// We assume, that default data language is the first one from the array of all available data languages
|
|
4607
4628
|
get defaultDataLanguage() {
|
|
@@ -4708,6 +4729,8 @@ class MngCommonsService {
|
|
|
4708
4729
|
// translate
|
|
4709
4730
|
this.translate.langs = this.appLanguages;
|
|
4710
4731
|
const lang = this.getOrInitLanguage();
|
|
4732
|
+
this.languageSubject.next(lang);
|
|
4733
|
+
this.dataLanguageSubject.next(this.appDataLanguage);
|
|
4711
4734
|
this.translate.use(lang);
|
|
4712
4735
|
this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
|
|
4713
4736
|
(_r = this.routerEventsSubscription) === null || _r === void 0 ? void 0 : _r.unsubscribe();
|
|
@@ -6051,6 +6074,8 @@ class TableDescriptor {
|
|
|
6051
6074
|
this._size = TableSizeEnum.Large;
|
|
6052
6075
|
this._hasHover = true;
|
|
6053
6076
|
this._hasGridlines = false;
|
|
6077
|
+
this._hasResizableColumns = false;
|
|
6078
|
+
this._columnResizeMode = 'expand';
|
|
6054
6079
|
this._autoGenerated = false;
|
|
6055
6080
|
this._isLocalized = false;
|
|
6056
6081
|
this._modelType = modelType;
|
|
@@ -6133,6 +6158,12 @@ class TableDescriptor {
|
|
|
6133
6158
|
get hasGridlines() {
|
|
6134
6159
|
return this._hasGridlines;
|
|
6135
6160
|
}
|
|
6161
|
+
get hasResizableColumns() {
|
|
6162
|
+
return this._hasResizableColumns;
|
|
6163
|
+
}
|
|
6164
|
+
get columnResizeMode() {
|
|
6165
|
+
return this._columnResizeMode;
|
|
6166
|
+
}
|
|
6136
6167
|
get rowClassName() {
|
|
6137
6168
|
return this._rowClassName;
|
|
6138
6169
|
}
|
|
@@ -6256,6 +6287,11 @@ class TableDescriptor {
|
|
|
6256
6287
|
this._hasGridlines = gridlines;
|
|
6257
6288
|
return this;
|
|
6258
6289
|
}
|
|
6290
|
+
withResizableColumns(resizableColumns = true, columnResizeMode = 'fit') {
|
|
6291
|
+
this._hasResizableColumns = resizableColumns;
|
|
6292
|
+
this._columnResizeMode = columnResizeMode;
|
|
6293
|
+
return this;
|
|
6294
|
+
}
|
|
6259
6295
|
withRowClassName(rowClassName, classNameMapFn) {
|
|
6260
6296
|
this._rowClassName = rowClassName;
|
|
6261
6297
|
this._rowClassNameMapFn = classNameMapFn;
|
|
@@ -6288,6 +6324,8 @@ class TableDescriptor {
|
|
|
6288
6324
|
obj._rowHeight = this._rowHeight;
|
|
6289
6325
|
obj._hasHover = this._hasHover;
|
|
6290
6326
|
obj._hasGridlines = this._hasGridlines;
|
|
6327
|
+
obj._hasResizableColumns = this._hasResizableColumns;
|
|
6328
|
+
obj._columnResizeMode = this._columnResizeMode;
|
|
6291
6329
|
obj._isLocalized = this._isLocalized;
|
|
6292
6330
|
obj._localizationLocaleProperty = this._localizationLocaleProperty;
|
|
6293
6331
|
}
|
|
@@ -7465,17 +7503,60 @@ var I18nUtils;
|
|
|
7465
7503
|
}
|
|
7466
7504
|
I18nUtils.Model = Model;
|
|
7467
7505
|
class Action {
|
|
7468
|
-
|
|
7506
|
+
/**
|
|
7507
|
+
* Returns translation for action with given keys and params
|
|
7508
|
+
* @param translate TranslateService
|
|
7509
|
+
* @param action action descriptor
|
|
7510
|
+
* @param actionPathKeys action path keys
|
|
7511
|
+
* @param customKey custom key
|
|
7512
|
+
* @param item
|
|
7513
|
+
* @param fallbackKey fallback key
|
|
7514
|
+
* @param params additional params for translation
|
|
7515
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
7516
|
+
*/
|
|
7517
|
+
static get(translate, action, actionPathKeys, customKey, item, fallbackKey, params, missingTranslationStrategy = 'returnFirstKey') {
|
|
7469
7518
|
const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
|
|
7470
7519
|
const i18nParams = I18nUtils.Action.getParams(translate, action, item, params);
|
|
7471
|
-
|
|
7520
|
+
const i18nValue = I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
7521
|
+
return this.getTranslationDependingOnStrategy(missingTranslationStrategy, { i18nValue, firstKey: keys[0], fallbackKey });
|
|
7472
7522
|
}
|
|
7473
|
-
|
|
7523
|
+
/**
|
|
7524
|
+
* Returns async translation for given keys with given params.
|
|
7525
|
+
* @param translate TranslateService
|
|
7526
|
+
* @param action action descriptor
|
|
7527
|
+
* @param actionPathKeys action path keys
|
|
7528
|
+
* @param customKey custom key
|
|
7529
|
+
* @param item item
|
|
7530
|
+
* @param fallbackKey fallback key, used as fallback key
|
|
7531
|
+
* @param params additional params for translation
|
|
7532
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
7533
|
+
*/
|
|
7534
|
+
static getAsync(translate, action, actionPathKeys, customKey, item, fallbackKey, params, missingTranslationStrategy = 'returnFirstKey') {
|
|
7474
7535
|
return I18nUtils.Action.getParamsAsync(translate, action, item, params).pipe(mergeMap$1(i18nParams => {
|
|
7475
7536
|
const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
|
|
7476
|
-
return I18nUtils.Common.getAsync(translate, i18nParams, ...keys);
|
|
7537
|
+
return I18nUtils.Common.getAsync(translate, i18nParams, ...keys).pipe(map(i18nValue => this.getTranslationDependingOnStrategy(missingTranslationStrategy, { i18nValue, firstKey: keys[0], fallbackKey })));
|
|
7477
7538
|
}));
|
|
7478
7539
|
}
|
|
7540
|
+
/**
|
|
7541
|
+
* Returns translation depending on missingTranslationStrategy
|
|
7542
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
7543
|
+
* @param values object with values, i18nValue is translation, firstKey is first key in array of keys, fallbackKey is fallback key
|
|
7544
|
+
*/
|
|
7545
|
+
static getTranslationDependingOnStrategy(missingTranslationStrategy, { i18nValue, firstKey, fallbackKey }) {
|
|
7546
|
+
if (i18nValue !== null) {
|
|
7547
|
+
return i18nValue;
|
|
7548
|
+
}
|
|
7549
|
+
else {
|
|
7550
|
+
switch (missingTranslationStrategy) {
|
|
7551
|
+
case 'returnNull':
|
|
7552
|
+
return null;
|
|
7553
|
+
case 'returnFallbackKey':
|
|
7554
|
+
return fallbackKey !== null && fallbackKey !== void 0 ? fallbackKey : null;
|
|
7555
|
+
case 'returnFirstKey':
|
|
7556
|
+
return firstKey !== null && firstKey !== void 0 ? firstKey : null;
|
|
7557
|
+
}
|
|
7558
|
+
}
|
|
7559
|
+
}
|
|
7479
7560
|
static getTitleAsync(translate, action, item) {
|
|
7480
7561
|
return I18nUtils.Action.getAsync(translate, action, 'title', undefined, item);
|
|
7481
7562
|
}
|
|
@@ -7699,6 +7780,26 @@ class StringUtil {
|
|
|
7699
7780
|
}
|
|
7700
7781
|
}
|
|
7701
7782
|
|
|
7783
|
+
class ExportUtils {
|
|
7784
|
+
static prepareDataForExport(pageData, delimiter, descriptor, translate) {
|
|
7785
|
+
const replaceNullValue = (key, value) => (value === null ? '' : value);
|
|
7786
|
+
return [
|
|
7787
|
+
descriptor.table.columns.map(col => translate.instant(descriptor.model.typeName + '.properties.' + col.property)).join(delimiter),
|
|
7788
|
+
...pageData.map((row) => descriptor.table.columns
|
|
7789
|
+
.map(column => {
|
|
7790
|
+
if (column.objectTitleProperty) {
|
|
7791
|
+
const object = row[column.property];
|
|
7792
|
+
return JSON.stringify(object[column.objectTitleProperty], replaceNullValue);
|
|
7793
|
+
}
|
|
7794
|
+
else {
|
|
7795
|
+
return JSON.stringify(row[column.property], replaceNullValue);
|
|
7796
|
+
}
|
|
7797
|
+
})
|
|
7798
|
+
.join(delimiter))
|
|
7799
|
+
].join('\r\n');
|
|
7800
|
+
}
|
|
7801
|
+
}
|
|
7802
|
+
|
|
7702
7803
|
class ObjectSerializer {
|
|
7703
7804
|
constructor() {
|
|
7704
7805
|
this._primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', 'number', 'any'];
|
|
@@ -8395,6 +8496,8 @@ class MngActionComponent {
|
|
|
8395
8496
|
this.hasNoTitle = false;
|
|
8396
8497
|
this.subscriptions = [];
|
|
8397
8498
|
this.buttonClass = 'p-button-primary';
|
|
8499
|
+
this.subactions = [];
|
|
8500
|
+
this.subactionSubscriptions = [];
|
|
8398
8501
|
this.loadingSubject.next(false);
|
|
8399
8502
|
}
|
|
8400
8503
|
ngOnInit() {
|
|
@@ -8443,8 +8546,14 @@ class MngActionComponent {
|
|
|
8443
8546
|
(_d = this.labelSubscription) === null || _d === void 0 ? void 0 : _d.unsubscribe();
|
|
8444
8547
|
(_e = this.tooltipSubscription) === null || _e === void 0 ? void 0 : _e.unsubscribe();
|
|
8445
8548
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
8549
|
+
this.subactionSubscriptions.forEach(s => s.unsubscribe());
|
|
8446
8550
|
}
|
|
8447
|
-
triggerAction(parameters) {
|
|
8551
|
+
triggerAction(action, parameters, event) {
|
|
8552
|
+
var _a;
|
|
8553
|
+
if (action.subactionsAsMenu) {
|
|
8554
|
+
(_a = this.subactionsMenu) === null || _a === void 0 ? void 0 : _a.toggle(event);
|
|
8555
|
+
return;
|
|
8556
|
+
}
|
|
8448
8557
|
const actionData = this.actionData ? this.actionData : {};
|
|
8449
8558
|
actionData['cmpId'] = this.cmpId;
|
|
8450
8559
|
parameters !== null && parameters !== void 0 ? parameters : (parameters = new ActionParameters(this.itemId, this.item)
|
|
@@ -8455,12 +8564,12 @@ class MngActionComponent {
|
|
|
8455
8564
|
.withSourceComponent(this)
|
|
8456
8565
|
.withHostComponent(this.hostComponent)
|
|
8457
8566
|
.withSelectedItems(this.selectedItems));
|
|
8458
|
-
const instance = this.actionExecutor.triggerAction(
|
|
8567
|
+
const instance = this.actionExecutor.triggerAction(action, parameters);
|
|
8459
8568
|
this.subscriptions.push(instance.result$.subscribe({
|
|
8460
8569
|
next: () => {
|
|
8461
8570
|
var _a, _b;
|
|
8462
8571
|
this.finishEventEmitter.next(instance);
|
|
8463
|
-
if (
|
|
8572
|
+
if (action.hasItemsSelection) {
|
|
8464
8573
|
(_b = (_a = this.viewContainer) === null || _a === void 0 ? void 0 : _a.reloadTable) === null || _b === void 0 ? void 0 : _b.call(_a, { data: { event: event } });
|
|
8465
8574
|
}
|
|
8466
8575
|
}
|
|
@@ -8482,6 +8591,48 @@ class MngActionComponent {
|
|
|
8482
8591
|
getConfirmationServiceInstanceKey(action) {
|
|
8483
8592
|
return `${action.actionName}_${this.cmpId}`;
|
|
8484
8593
|
}
|
|
8594
|
+
onCustomActionCmpInst(instance) {
|
|
8595
|
+
const cmpInstSubscription = instance.triggerActionEventEmitter.subscribe(params => this.triggerAction(this.action, params));
|
|
8596
|
+
this.subscriptions.push(cmpInstSubscription);
|
|
8597
|
+
}
|
|
8598
|
+
processSubactions() {
|
|
8599
|
+
var _a, _b, _c;
|
|
8600
|
+
this.subactionSubscriptions.forEach(s => s.unsubscribe());
|
|
8601
|
+
this.subactionSubscriptions = [];
|
|
8602
|
+
const menuItems = [];
|
|
8603
|
+
this.action.subactions;
|
|
8604
|
+
for (const subaction of this.action.subactions) {
|
|
8605
|
+
const menuItem = {};
|
|
8606
|
+
menuItem.icon = (_a = subaction.button.icon) !== null && _a !== void 0 ? _a : undefined;
|
|
8607
|
+
this.subactionSubscriptions.push(I18nUtils.Action.getAsync(this.translate, subaction, 'title', (_b = subaction.button.label) !== null && _b !== void 0 ? _b : undefined, this.item).subscribe({
|
|
8608
|
+
next: res => (menuItem.label = res)
|
|
8609
|
+
}));
|
|
8610
|
+
this.subactionSubscriptions.push(I18nUtils.Action.getAsync(this.translate, subaction, 'tooltip', this.action.button.tooltip, this.item).subscribe({
|
|
8611
|
+
next: res => (menuItem.tooltip = res)
|
|
8612
|
+
}));
|
|
8613
|
+
const parameters = new ActionParameters(this.itemId, this.item)
|
|
8614
|
+
.withActionData(this.actionData)
|
|
8615
|
+
.withViewContainer((_c = this.viewContainer) !== null && _c !== void 0 ? _c : undefined)
|
|
8616
|
+
.withSourceComponent(this);
|
|
8617
|
+
if (subaction.hasItemsSelection) {
|
|
8618
|
+
parameters.withSelectedItems(this.selectedItems);
|
|
8619
|
+
}
|
|
8620
|
+
const context = this.actionExecutor.prepareActionContextValidation(subaction, parameters, this.dataProvider);
|
|
8621
|
+
if (typeof subaction.isEnabledFunction === 'function') {
|
|
8622
|
+
this.subactionSubscriptions.push(subaction.isEnabledFunction(context).subscribe({
|
|
8623
|
+
next: res => (menuItem.disabled = !res)
|
|
8624
|
+
}));
|
|
8625
|
+
}
|
|
8626
|
+
if (typeof subaction.isVisibleFunction === 'function') {
|
|
8627
|
+
this.subactionSubscriptions.push(subaction.isVisibleFunction(context).subscribe({
|
|
8628
|
+
next: res => (menuItem.visible = res)
|
|
8629
|
+
}));
|
|
8630
|
+
}
|
|
8631
|
+
menuItem.command = () => this.triggerAction(subaction);
|
|
8632
|
+
menuItems.push(menuItem);
|
|
8633
|
+
}
|
|
8634
|
+
return menuItems;
|
|
8635
|
+
}
|
|
8485
8636
|
processSubscriptions() {
|
|
8486
8637
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8487
8638
|
const parameters = new ActionParameters(this.itemId, this.item)
|
|
@@ -8520,20 +8671,19 @@ class MngActionComponent {
|
|
|
8520
8671
|
});
|
|
8521
8672
|
}
|
|
8522
8673
|
(_h = this.tooltipSubscription) === null || _h === void 0 ? void 0 : _h.unsubscribe();
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
this.subscriptions.push(cmpInstSubscription);
|
|
8674
|
+
if (this.action.button.tooltip) {
|
|
8675
|
+
this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action.button.tooltip, this.item, undefined, undefined).subscribe({
|
|
8676
|
+
next: i18n => this.tooltipSubject.next(i18n)
|
|
8677
|
+
});
|
|
8678
|
+
}
|
|
8679
|
+
this.subactions = this.processSubactions();
|
|
8530
8680
|
}
|
|
8531
8681
|
}
|
|
8532
8682
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.TranslateService }, { token: MngAuthorizationService }, { token: MngActionExecutorService }, { token: i2$1.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8533
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", hostComponent: "hostComponent", routeInit: ["route", "routeInit"], inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [label]=\"($label | async) ?? ''\"\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else customComponent\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [relativeTo]=\"route\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n </ng-template>\n <ng-template #customComponent>\n <ng-container\n *ngIf=\"action.component; else
|
|
8683
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", hostComponent: "hostComponent", routeInit: ["route", "routeInit"], inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"], selectedItems: "selectedItems" }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], viewQueries: [{ propertyName: "subactionsMenu", first: true, predicate: ["subactionsMenu"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [label]=\"($label | async) ?? ''\"\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else customComponent\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [relativeTo]=\"route\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n </ng-template>\n <ng-template #customComponent>\n <ng-container\n *ngIf=\"action.component; else splitButton\"\n [mngComponent]=\"action.component\"\n [inputs]=\"{\n action: action,\n item: item,\n itemId: itemId,\n actionData: actionData,\n enabled: $isEnabled,\n loading: $loading,\n viewContainer: viewContainer\n }\"\n (instanceCreated)=\"onCustomActionCmpInst($event)\">\n </ng-container>\n </ng-template>\n <ng-template #splitButton>\n <p-splitButton\n *ngIf=\"action.subactions.length > 0 && !action.subactionsAsMenu; else button\"\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (onClick)=\"triggerAction(action)\"\n [class]=\"buttonClass\"\n [model]=\"subactions\">\n </p-splitButton>\n </ng-template>\n <ng-template #button>\n <button\n pButton\n pRipple\n type=\"button\"\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction(action, undefined, $event)\"\n [class]=\"buttonClass\"></button>\n <p-slideMenu #subactionsMenu [model]=\"subactions\" [popup]=\"true\" [viewportHeight]=\"100\"></p-slideMenu>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i10.Ripple, selector: "[pRipple]" }, { kind: "component", type: i11.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }, { kind: "component", type: i12.SlideMenu, selector: "p-slideMenu", inputs: ["model", "popup", "style", "styleClass", "menuWidth", "viewportHeight", "effectDuration", "easing", "backLabel", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8534
8684
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
8535
8685
|
type: Component,
|
|
8536
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [label]=\"($label | async) ?? ''\"\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else customComponent\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [relativeTo]=\"route\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n </ng-template>\n <ng-template #customComponent>\n <ng-container\n *ngIf=\"action.component; else
|
|
8686
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [label]=\"($label | async) ?? ''\"\n [icon]=\"$any(action.button.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else customComponent\"\n pButton\n pRipple\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [relativeTo]=\"route\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [pTooltip]=\"$any($tooltip | async)\"\n [class]=\"buttonClass\"></a>\n </ng-template>\n <ng-template #customComponent>\n <ng-container\n *ngIf=\"action.component; else splitButton\"\n [mngComponent]=\"action.component\"\n [inputs]=\"{\n action: action,\n item: item,\n itemId: itemId,\n actionData: actionData,\n enabled: $isEnabled,\n loading: $loading,\n viewContainer: viewContainer\n }\"\n (instanceCreated)=\"onCustomActionCmpInst($event)\">\n </ng-container>\n </ng-template>\n <ng-template #splitButton>\n <p-splitButton\n *ngIf=\"action.subactions.length > 0 && !action.subactionsAsMenu; else button\"\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (onClick)=\"triggerAction(action)\"\n [class]=\"buttonClass\"\n [model]=\"subactions\">\n </p-splitButton>\n </ng-template>\n <ng-template #button>\n <button\n pButton\n pRipple\n type=\"button\"\n [icon]=\"$any(action.button.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction(action, undefined, $event)\"\n [class]=\"buttonClass\"></button>\n <p-slideMenu #subactionsMenu [model]=\"subactions\" [popup]=\"true\" [viewportHeight]=\"100\"></p-slideMenu>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
8537
8687
|
}], ctorParameters: function () {
|
|
8538
8688
|
return [{ type: i1.ActivatedRoute }, { type: i2.TranslateService }, { type: MngAuthorizationService }, { type: MngActionExecutorService }, { type: i2$1.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
8539
8689
|
type: Optional
|
|
@@ -8575,6 +8725,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
8575
8725
|
}], finishEventEmitter: [{
|
|
8576
8726
|
type: Output,
|
|
8577
8727
|
args: ['finish']
|
|
8728
|
+
}], subactionsMenu: [{
|
|
8729
|
+
type: ViewChild,
|
|
8730
|
+
args: ['subactionsMenu']
|
|
8578
8731
|
}] } });
|
|
8579
8732
|
|
|
8580
8733
|
class MngActionRouteComponent {
|
|
@@ -10118,7 +10271,7 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
10118
10271
|
}
|
|
10119
10272
|
}
|
|
10120
10273
|
MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldInputComponent, deps: [{ token: LOCALE_ID }, { token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
10121
|
-
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"props.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMin : null)\"\n [max]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMax : null)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [locale]=\"$any(descriptor.locale ?? applicationLocale)\"\n [mode]=\"$any(numberFieldMode)\"\n [currency]=\"$any(currency)\"\n [currencyDisplay]=\"$any(descriptor.currencyDisplay)\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"field flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ props?.label! | translate }} <span *ngIf=\"props.required && props['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showSeconds]=\"descriptor.datePickerShowSeconds\"\n [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [firstDayOfWeek]=\"1\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <p-fileUpload\n *ngSwitchCase=\"'file'\"\n [multiple]=\"descriptor.fileMultiple\"\n [accept]=\"$any(descriptor.fileAccept)\"\n [maxFileSize]=\"descriptor.fileMaxFileSize\"\n [showUploadButton]=\"false\"\n (onSelect)=\"onFileSelect($event)\"\n (onRemove)=\"onFileRemove($event)\"\n (onClear)=\"onFileClear($event)\">\n </p-fileUpload>\n\n <div *ngSwitchCase=\"'imageUrl'\">\n <div *ngIf=\"descriptor.imagePreview\" class=\"flex flex-wrap justify-content-start\">\n <ng-container *ngFor=\"let image of imageFormArray.controls; let idx = index\">\n <p-image\n *ngIf=\"imageFormArray.at(idx).valid && imageFormArray.at(idx).value; else noImage\"\n [src]=\"imageFormArray.at(idx).value\"\n [preview]=\"true\"\n (onImageError)=\"onImageUrlLoadError(idx, $event)\"\n styleClass=\"mng-image m-2\"></p-image>\n </ng-container>\n <ng-template #noImage>\n <span class=\"mng-image m-2 p-image-preview-container no-image\">\n <div class=\"p-image-preview-indicator\">\n <i class=\"p-image-preview-icon pi pi-ban\"></i>\n </div>\n </span>\n </ng-template>\n </div>\n <ng-container *ngIf=\"!descriptor.imagePreview || descriptor.imageUrlInputVisibleOnDisabled || !iFormControl.disabled\">\n <div *ngFor=\"let imageCtrlName of imageFormArray.controls; let idx = index\" class=\"p-inputgroup mt-1\">\n <input\n pInputText\n [placeholder]=\"'mngEditor.imageUrlPlaceholder' | translate\"\n [id]=\"$any(key)\"\n type=\"text\"\n [formControl]=\"$any(imageFormArray.at(idx))\"\n [formlyAttributes]=\"field\" />\n <button *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\" type=\"button\" pButton pRipple icon=\"pi pi-minus\" (click)=\"removeImageUrlAt(idx)\"></button>\n </div>\n <button\n *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\"\n type=\"button\"\n pButton\n pRipple\n icon=\"pi pi-plus\"\n class=\"p-button-primary w-auto mt-1\"\n [label]=\"'mngEditor.imageUrlAdd' | translate\"\n (click)=\"addImageUrl()\"></button>\n </ng-container>\n </div>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"props.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: i2$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i3$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i6$3.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError"] }, { kind: "component", type: i7$2.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", "showClear", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i8.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "showClear", "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", "onClear"] }, { kind: "component", type: i9$1.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy"], outputs: ["onChange"] }, { kind: "directive", type: i10$1.InputText, selector: "[pInputText]" }, { kind: "directive", type: i11.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { kind: "component", type: i12.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i10.Ripple, selector: "[pRipple]" }, { kind: "component", type: i14.Image, selector: "p-image", inputs: ["imageClass", "imageStyle", "styleClass", "style", "src", "alt", "width", "height", "appendTo", "preview", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide", "onImageError"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10274
|
+
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"props.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMin : null)\"\n [max]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMax : null)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [locale]=\"$any(descriptor.locale ?? applicationLocale)\"\n [mode]=\"$any(numberFieldMode)\"\n [currency]=\"$any(currency)\"\n [currencyDisplay]=\"$any(descriptor.currencyDisplay)\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"field flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ props?.label! | translate }} <span *ngIf=\"props.required && props['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showSeconds]=\"descriptor.datePickerShowSeconds\"\n [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [firstDayOfWeek]=\"1\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <p-fileUpload\n *ngSwitchCase=\"'file'\"\n [multiple]=\"descriptor.fileMultiple\"\n [accept]=\"$any(descriptor.fileAccept)\"\n [maxFileSize]=\"descriptor.fileMaxFileSize\"\n [showUploadButton]=\"false\"\n (onSelect)=\"onFileSelect($event)\"\n (onRemove)=\"onFileRemove($event)\"\n (onClear)=\"onFileClear($event)\">\n </p-fileUpload>\n\n <div *ngSwitchCase=\"'imageUrl'\">\n <div *ngIf=\"descriptor.imagePreview\" class=\"flex flex-wrap justify-content-start\">\n <ng-container *ngFor=\"let image of imageFormArray.controls; let idx = index\">\n <p-image\n *ngIf=\"imageFormArray.at(idx).valid && imageFormArray.at(idx).value; else noImage\"\n [src]=\"imageFormArray.at(idx).value\"\n [preview]=\"true\"\n (onImageError)=\"onImageUrlLoadError(idx, $event)\"\n styleClass=\"mng-image m-2\"></p-image>\n </ng-container>\n <ng-template #noImage>\n <span class=\"mng-image m-2 p-image-preview-container no-image\">\n <div class=\"p-image-preview-indicator\">\n <i class=\"p-image-preview-icon pi pi-ban\"></i>\n </div>\n </span>\n </ng-template>\n </div>\n <ng-container *ngIf=\"!descriptor.imagePreview || descriptor.imageUrlInputVisibleOnDisabled || !iFormControl.disabled\">\n <div *ngFor=\"let imageCtrlName of imageFormArray.controls; let idx = index\" class=\"p-inputgroup mt-1\">\n <input\n pInputText\n [placeholder]=\"'mngEditor.imageUrlPlaceholder' | translate\"\n [id]=\"$any(key)\"\n type=\"text\"\n [formControl]=\"$any(imageFormArray.at(idx))\"\n [formlyAttributes]=\"field\" />\n <button *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\" type=\"button\" pButton pRipple icon=\"pi pi-minus\" (click)=\"removeImageUrlAt(idx)\"></button>\n </div>\n <button\n *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\"\n type=\"button\"\n pButton\n pRipple\n icon=\"pi pi-plus\"\n class=\"p-button-primary w-auto mt-1\"\n [label]=\"'mngEditor.imageUrlAdd' | translate\"\n (click)=\"addImageUrl()\"></button>\n </ng-container>\n </div>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"props.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "component", type: i2$2.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i3$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i6$3.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError"] }, { kind: "component", type: i7$2.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", "showClear", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i8.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "showClear", "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", "onClear"] }, { kind: "component", type: i9$1.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy"], outputs: ["onChange"] }, { kind: "directive", type: i10$1.InputText, selector: "[pInputText]" }, { kind: "directive", type: i11$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { kind: "component", type: i12$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i10.Ripple, selector: "[pRipple]" }, { kind: "component", type: i14.Image, selector: "p-image", inputs: ["imageClass", "imageStyle", "styleClass", "style", "src", "alt", "width", "height", "appendTo", "preview", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide", "onImageError"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10122
10275
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
10123
10276
|
type: Component,
|
|
10124
10277
|
args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"props.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMin : null)\"\n [max]=\"$any(descriptor.numberAutoCorrect ? descriptor.numberMax : null)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [locale]=\"$any(descriptor.locale ?? applicationLocale)\"\n [mode]=\"$any(numberFieldMode)\"\n [currency]=\"$any(currency)\"\n [currencyDisplay]=\"$any(descriptor.currencyDisplay)\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"field flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ props?.label! | translate }} <span *ngIf=\"props.required && props['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showSeconds]=\"descriptor.datePickerShowSeconds\"\n [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\"\n [firstDayOfWeek]=\"1\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <p-fileUpload\n *ngSwitchCase=\"'file'\"\n [multiple]=\"descriptor.fileMultiple\"\n [accept]=\"$any(descriptor.fileAccept)\"\n [maxFileSize]=\"descriptor.fileMaxFileSize\"\n [showUploadButton]=\"false\"\n (onSelect)=\"onFileSelect($event)\"\n (onRemove)=\"onFileRemove($event)\"\n (onClear)=\"onFileClear($event)\">\n </p-fileUpload>\n\n <div *ngSwitchCase=\"'imageUrl'\">\n <div *ngIf=\"descriptor.imagePreview\" class=\"flex flex-wrap justify-content-start\">\n <ng-container *ngFor=\"let image of imageFormArray.controls; let idx = index\">\n <p-image\n *ngIf=\"imageFormArray.at(idx).valid && imageFormArray.at(idx).value; else noImage\"\n [src]=\"imageFormArray.at(idx).value\"\n [preview]=\"true\"\n (onImageError)=\"onImageUrlLoadError(idx, $event)\"\n styleClass=\"mng-image m-2\"></p-image>\n </ng-container>\n <ng-template #noImage>\n <span class=\"mng-image m-2 p-image-preview-container no-image\">\n <div class=\"p-image-preview-indicator\">\n <i class=\"p-image-preview-icon pi pi-ban\"></i>\n </div>\n </span>\n </ng-template>\n </div>\n <ng-container *ngIf=\"!descriptor.imagePreview || descriptor.imageUrlInputVisibleOnDisabled || !iFormControl.disabled\">\n <div *ngFor=\"let imageCtrlName of imageFormArray.controls; let idx = index\" class=\"p-inputgroup mt-1\">\n <input\n pInputText\n [placeholder]=\"'mngEditor.imageUrlPlaceholder' | translate\"\n [id]=\"$any(key)\"\n type=\"text\"\n [formControl]=\"$any(imageFormArray.at(idx))\"\n [formlyAttributes]=\"field\" />\n <button *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\" type=\"button\" pButton pRipple icon=\"pi pi-minus\" (click)=\"removeImageUrlAt(idx)\"></button>\n </div>\n <button\n *ngIf=\"descriptor.fileMultiple && !iFormControl.disabled\"\n type=\"button\"\n pButton\n pRipple\n icon=\"pi pi-plus\"\n class=\"p-button-primary w-auto mt-1\"\n [label]=\"'mngEditor.imageUrlAdd' | translate\"\n (click)=\"addImageUrl()\"></button>\n </ng-container>\n </div>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"props.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
|
|
@@ -10899,10 +11052,10 @@ class MngTableComponent {
|
|
|
10899
11052
|
}
|
|
10900
11053
|
}
|
|
10901
11054
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.TranslateService }, { token: MngCommonsService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
10902
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"isLazy\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"isPagination && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th\n *ngIf=\"col.isSortEnabled\"\n [pSortableColumn]=\"col.property\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th\n *ngIf=\"!col.isSortEnabled\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr\n [style.height.px]=\"rowHeight\"\n [ngClass]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item | mngLocaleDefaultRowClass: descriptor:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"\n col.className +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor ? ' mng-column-filter-' + col.filterDescriptor.filterType : '')\n \"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [viewContainer]=\"viewContainerInit\"\n [hostComponent]=\"this\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i6$4.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "hostComponent", "route", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }, { kind: "pipe", type: MngLocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11055
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"isLazy\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"isPagination && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n [resizableColumns]=\"descriptor?.hasResizableColumns ?? false\"\n [columnResizeMode]=\"descriptor?.columnResizeMode ?? 'fit'\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th\n *ngIf=\"col.isSortEnabled\"\n pResizableColumn\n [pSortableColumn]=\"col.property\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th\n pResizableColumn\n *ngIf=\"!col.isSortEnabled\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr\n [style.height.px]=\"rowHeight\"\n [ngClass]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item | mngLocaleDefaultRowClass: descriptor:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"\n col.className +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor ? ' mng-column-filter-' + col.filterDescriptor.filterType : '')\n \"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [viewContainer]=\"viewContainerInit\"\n [hostComponent]=\"this\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i6$4.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i6$4.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "hostComponent", "route", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }, { kind: "pipe", type: MngLocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10903
11056
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
10904
11057
|
type: Component,
|
|
10905
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"isLazy\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"isPagination && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th\n *ngIf=\"col.isSortEnabled\"\n [pSortableColumn]=\"col.property\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th\n *ngIf=\"!col.isSortEnabled\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr\n [style.height.px]=\"rowHeight\"\n [ngClass]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item | mngLocaleDefaultRowClass: descriptor:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"\n col.className +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor ? ' mng-column-filter-' + col.filterDescriptor.filterType : '')\n \"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [viewContainer]=\"viewContainerInit\"\n [hostComponent]=\"this\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
11058
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"isLazy\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"isPagination && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n [resizableColumns]=\"descriptor?.hasResizableColumns ?? false\"\n [columnResizeMode]=\"descriptor?.columnResizeMode ?? 'fit'\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th\n *ngIf=\"col.isSortEnabled\"\n pResizableColumn\n [pSortableColumn]=\"col.property\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th\n pResizableColumn\n *ngIf=\"!col.isSortEnabled\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\"\n [class]=\"\n col.headerClassName +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor\n ? ' mng-column-filter-' + col.filterDescriptor.filterType\n : '')\n \">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\" [style.min-width.px]=\"columnActionMinWidth\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr\n [style.height.px]=\"rowHeight\"\n [ngClass]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item | mngLocaleDefaultRowClass: descriptor:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"\n col.className +\n (descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters && col.filterDescriptor ? ' mng-column-filter-' + col.filterDescriptor.filterType : '')\n \"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\"\n [style.max-width.px]=\"col.maxWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [viewContainer]=\"viewContainerInit\"\n [hostComponent]=\"this\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
10906
11059
|
}], ctorParameters: function () {
|
|
10907
11060
|
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.TranslateService }, { type: MngCommonsService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
10908
11061
|
type: Optional
|
|
@@ -11061,6 +11214,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
11061
11214
|
class AMngTableviewRouteComponent {
|
|
11062
11215
|
constructor() {
|
|
11063
11216
|
this.route = inject(ActivatedRoute);
|
|
11217
|
+
this.translateService = inject(TranslateService);
|
|
11064
11218
|
}
|
|
11065
11219
|
get routeData() {
|
|
11066
11220
|
return this.route.snapshot.data;
|
|
@@ -11128,7 +11282,12 @@ class AMngTableviewRouteComponent {
|
|
|
11128
11282
|
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDelete ? new ActionDeleteDescriptor(descriptor) : null;
|
|
11129
11283
|
}
|
|
11130
11284
|
createActionDescriptorForExport(descriptor = this.descriptor.model) {
|
|
11131
|
-
const
|
|
11285
|
+
const exportAction = new ActionDescriptor(descriptor, 'export').withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-download')).withSubactionsAsMenu();
|
|
11286
|
+
exportAction.withSubactions(this.createActionDescriptorForExportJson(descriptor), this.createActionDescriptorForExportCsv(descriptor));
|
|
11287
|
+
return exportAction;
|
|
11288
|
+
}
|
|
11289
|
+
createActionDescriptorForExportJson(descriptor = this.descriptor.model) {
|
|
11290
|
+
return new ActionDescriptor(descriptor, 'exportJson')
|
|
11132
11291
|
.withRunFunction(ctx => {
|
|
11133
11292
|
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
11134
11293
|
queryParamBuilder.withItemsOffset(0).withItemsPerPage(500);
|
|
@@ -11141,9 +11300,28 @@ class AMngTableviewRouteComponent {
|
|
|
11141
11300
|
return undefined;
|
|
11142
11301
|
}));
|
|
11143
11302
|
})
|
|
11303
|
+
.withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-code'))
|
|
11304
|
+
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
11305
|
+
}
|
|
11306
|
+
createActionDescriptorForExportCsv(descriptor = this.descriptor.model) {
|
|
11307
|
+
return new ActionDescriptor(descriptor, 'exportCsv')
|
|
11308
|
+
.withRunFunction(ctx => {
|
|
11309
|
+
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
11310
|
+
queryParamBuilder.withItemsOffset(0).withItemsPerPage(500);
|
|
11311
|
+
ctx.parameters.withQueryParam(queryParamBuilder.build());
|
|
11312
|
+
return ActionDataProviderUtil.runGetAllOrFail(ctx).pipe(map(res => {
|
|
11313
|
+
var _a, _b;
|
|
11314
|
+
if (!res.pageData) {
|
|
11315
|
+
return undefined;
|
|
11316
|
+
}
|
|
11317
|
+
const blob = new Blob([ExportUtils.prepareDataForExport(res.pageData, ',', this.descriptor, this.translateService)], { type: 'text/csv;charset=utf-8' });
|
|
11318
|
+
const typeName = (_b = (_a = ctx.instance.action.model) === null || _a === void 0 ? void 0 : _a.typeName) !== null && _b !== void 0 ? _b : '';
|
|
11319
|
+
FileSaver.saveAs(blob, `${typeName ? typeName + '_' : ''}${ctx.instance.action.actionName}.csv`);
|
|
11320
|
+
return undefined;
|
|
11321
|
+
}));
|
|
11322
|
+
})
|
|
11323
|
+
.withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-file'))
|
|
11144
11324
|
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
11145
|
-
action.button.withIcon('pi pi-upload');
|
|
11146
|
-
return action;
|
|
11147
11325
|
}
|
|
11148
11326
|
createActionDescriptorForRefresh(descriptor = this.descriptor.model) {
|
|
11149
11327
|
const action = new ActionDescriptor(descriptor, 'refresh')
|
|
@@ -11321,6 +11499,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
11321
11499
|
}
|
|
11322
11500
|
this.dialogSelectedItem = null;
|
|
11323
11501
|
this.isDialogVisible = true;
|
|
11502
|
+
this.formControl.markAsTouched();
|
|
11324
11503
|
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DialogLifecycle, MngFormlyFieldLookupDialogComponent, this, {
|
|
11325
11504
|
eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
|
|
11326
11505
|
dialogVisible: true
|
|
@@ -11343,6 +11522,8 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
11343
11522
|
}
|
|
11344
11523
|
clear() {
|
|
11345
11524
|
this.formControl.setValue(undefined);
|
|
11525
|
+
this.formControl.markAsTouched();
|
|
11526
|
+
this.formControl.markAsDirty();
|
|
11346
11527
|
this.dialogSelectedItem = null;
|
|
11347
11528
|
this.dialogAreItemsLoaded = false;
|
|
11348
11529
|
this.hideDialog();
|
|
@@ -11356,6 +11537,8 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
11356
11537
|
}
|
|
11357
11538
|
addItem() {
|
|
11358
11539
|
this.formControl.setValue(this.dialogSelectedItem);
|
|
11540
|
+
this.formControl.markAsDirty();
|
|
11541
|
+
this.formControl.markAsTouched();
|
|
11359
11542
|
this.dialogSelectedItem = null;
|
|
11360
11543
|
this.dialogAreItemsLoaded = false;
|
|
11361
11544
|
this.hideDialog();
|
|
@@ -11410,7 +11593,11 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11410
11593
|
if (hasViewAction) {
|
|
11411
11594
|
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.detailsEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
11412
11595
|
.withPosition(ActionPositionEnum.RowClick)
|
|
11413
|
-
.withDialogSize(StyleSizeEnum.Small)
|
|
11596
|
+
.withDialogSize(StyleSizeEnum.Small)
|
|
11597
|
+
.withFetchFunction(ctx => {
|
|
11598
|
+
this.formControl.markAsTouched();
|
|
11599
|
+
return of(ctx.parameters.item || {});
|
|
11600
|
+
});
|
|
11414
11601
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitTypeEnum.Cancel)]);
|
|
11415
11602
|
viewAction.button.withLabel(null);
|
|
11416
11603
|
this.actions.push(viewAction);
|
|
@@ -11420,6 +11607,10 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11420
11607
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
11421
11608
|
.withDialogSize(StyleSizeEnum.Small)
|
|
11422
11609
|
.withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(StyleSizeEnum.ExtraSmall)))
|
|
11610
|
+
.withFetchFunction(ctx => {
|
|
11611
|
+
this.formControl.markAsTouched();
|
|
11612
|
+
return of(ctx.parameters.item || {});
|
|
11613
|
+
})
|
|
11423
11614
|
.withSubmitFunction(ctx => {
|
|
11424
11615
|
if (!ctx.parameters.item) {
|
|
11425
11616
|
return throwError(() => new Error(`No item was provided in context, edit cannot be done.`));
|
|
@@ -11428,6 +11619,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11428
11619
|
let value = this.formControl.value;
|
|
11429
11620
|
value = [...value, ctx.parameters.item];
|
|
11430
11621
|
this.formControl.patchValue(value);
|
|
11622
|
+
this.formControl.markAsDirty();
|
|
11623
|
+
this.formControl.markAsTouched();
|
|
11431
11624
|
return of(ctx.parameters.item);
|
|
11432
11625
|
})
|
|
11433
11626
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
|
|
@@ -11440,6 +11633,10 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11440
11633
|
.withPosition(ActionPositionEnum.RowInline)
|
|
11441
11634
|
.withDialogSize(StyleSizeEnum.Small)
|
|
11442
11635
|
.withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(StyleSizeEnum.ExtraSmall)))
|
|
11636
|
+
.withFetchFunction(ctx => {
|
|
11637
|
+
this.formControl.markAsTouched();
|
|
11638
|
+
return of(ctx.parameters.item || {});
|
|
11639
|
+
})
|
|
11443
11640
|
.withSubmitFunction(ctx => {
|
|
11444
11641
|
var _a;
|
|
11445
11642
|
if (!ctx.parameters.item) {
|
|
@@ -11449,6 +11646,8 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11449
11646
|
const formControlValue = this.formControl.value;
|
|
11450
11647
|
formControlValue[(_a = ctx.parameters.actionData) === null || _a === void 0 ? void 0 : _a['itemIndex']] = ctx.parameters.item;
|
|
11451
11648
|
this.formControl.patchValue(formControlValue);
|
|
11649
|
+
this.formControl.markAsDirty();
|
|
11650
|
+
this.formControl.markAsTouched();
|
|
11452
11651
|
return of(ctx.parameters.item);
|
|
11453
11652
|
})
|
|
11454
11653
|
.withIsVisibleFunction(ctx => { var _a; return (this.hideActionsForRowWithDefaultLocalization(ctx) ? of(false) : of(!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.disabled))); })
|
|
@@ -11473,14 +11672,17 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
11473
11672
|
if (compareProperty && (ctxItem === null || ctxItem === void 0 ? void 0 : ctxItem[compareProperty])) {
|
|
11474
11673
|
formControlValue = formControlValue.filter((i) => i[compareProperty] !== ctxItem[compareProperty]);
|
|
11475
11674
|
this.formControl.patchValue(formControlValue);
|
|
11675
|
+
this.formControl.markAsDirty();
|
|
11476
11676
|
}
|
|
11477
11677
|
else if (typeof ((_a = ctx.parameters.actionData) === null || _a === void 0 ? void 0 : _a['itemIndex']) === 'number') {
|
|
11478
11678
|
formControlValue.splice(ctx.parameters.actionData['itemIndex'], 1);
|
|
11479
11679
|
this.formControl.patchValue([...formControlValue]);
|
|
11680
|
+
this.formControl.markAsDirty();
|
|
11480
11681
|
}
|
|
11481
11682
|
else {
|
|
11482
11683
|
return throwError(() => new Error('Cannot compare items, please provide main table data key property or model id property.'));
|
|
11483
11684
|
}
|
|
11685
|
+
this.formControl.markAsTouched();
|
|
11484
11686
|
return of(ctxItem);
|
|
11485
11687
|
})
|
|
11486
11688
|
.withIsVisibleFunction(ctx => { var _a; return (this.hideActionsForRowWithDefaultLocalization(ctx) ? of(false) : of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled))); })
|
|
@@ -11641,6 +11843,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
11641
11843
|
}
|
|
11642
11844
|
this.dialogSelectedAddItems = [];
|
|
11643
11845
|
this.isDialogVisible = true;
|
|
11846
|
+
this.formControl.markAsTouched();
|
|
11644
11847
|
this.descriptor.nextEvent(MngFormFieldEventTypeEnum.DialogLifecycle, MngFormlyFieldTableDialogMultiselectComponent, this, {
|
|
11645
11848
|
eventSubtype: MngFormFieldEventDialogSubtype.VISIBILITY,
|
|
11646
11849
|
dialogVisible: true
|
|
@@ -11663,6 +11866,8 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
11663
11866
|
}
|
|
11664
11867
|
value = [...value, ...this.dialogSelectedAddItems];
|
|
11665
11868
|
this.formControl.patchValue(value);
|
|
11869
|
+
this.formControl.markAsDirty();
|
|
11870
|
+
this.formControl.markAsTouched();
|
|
11666
11871
|
this.dialogSelectedAddItems = [];
|
|
11667
11872
|
this.dialogAreItemsLoaded = false;
|
|
11668
11873
|
this.hideDialog();
|
|
@@ -11680,6 +11885,8 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
11680
11885
|
}
|
|
11681
11886
|
value = value.filter((i) => i[compareProperty] !== item[compareProperty]);
|
|
11682
11887
|
this.formControl.patchValue(value);
|
|
11888
|
+
this.formControl.markAsTouched();
|
|
11889
|
+
this.formControl.markAsDirty();
|
|
11683
11890
|
this.dialogAreItemsLoaded = false;
|
|
11684
11891
|
}
|
|
11685
11892
|
}
|
|
@@ -12758,6 +12965,7 @@ const primeNgModules = [
|
|
|
12758
12965
|
RadioButtonModule,
|
|
12759
12966
|
RippleModule,
|
|
12760
12967
|
SelectButtonModule,
|
|
12968
|
+
SplitButtonModule,
|
|
12761
12969
|
TableModule,
|
|
12762
12970
|
TagModule,
|
|
12763
12971
|
ToastModule,
|
|
@@ -12769,7 +12977,8 @@ const primeNgModules = [
|
|
|
12769
12977
|
TabViewModule,
|
|
12770
12978
|
FieldsetModule,
|
|
12771
12979
|
MultiSelectModule,
|
|
12772
|
-
SkeletonModule
|
|
12980
|
+
SkeletonModule,
|
|
12981
|
+
SlideMenuModule
|
|
12773
12982
|
];
|
|
12774
12983
|
const declarations = [
|
|
12775
12984
|
// directives
|
|
@@ -12984,6 +13193,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
12984
13193
|
RadioButtonModule,
|
|
12985
13194
|
RippleModule,
|
|
12986
13195
|
SelectButtonModule,
|
|
13196
|
+
SplitButtonModule,
|
|
12987
13197
|
TableModule,
|
|
12988
13198
|
TagModule,
|
|
12989
13199
|
ToastModule,
|
|
@@ -12995,7 +13205,8 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
12995
13205
|
TabViewModule,
|
|
12996
13206
|
FieldsetModule,
|
|
12997
13207
|
MultiSelectModule,
|
|
12998
|
-
SkeletonModule,
|
|
13208
|
+
SkeletonModule,
|
|
13209
|
+
SlideMenuModule, ImageModule
|
|
12999
13210
|
], exports: [AutoCompleteModule,
|
|
13000
13211
|
BreadcrumbModule,
|
|
13001
13212
|
ButtonModule,
|
|
@@ -13018,6 +13229,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
13018
13229
|
RadioButtonModule,
|
|
13019
13230
|
RippleModule,
|
|
13020
13231
|
SelectButtonModule,
|
|
13232
|
+
SplitButtonModule,
|
|
13021
13233
|
TableModule,
|
|
13022
13234
|
TagModule,
|
|
13023
13235
|
ToastModule,
|
|
@@ -13030,6 +13242,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
13030
13242
|
FieldsetModule,
|
|
13031
13243
|
MultiSelectModule,
|
|
13032
13244
|
SkeletonModule,
|
|
13245
|
+
SlideMenuModule,
|
|
13033
13246
|
// directives
|
|
13034
13247
|
MngComponentDirective,
|
|
13035
13248
|
MngTemplateDirective,
|
|
@@ -13115,6 +13328,7 @@ MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
|
|
|
13115
13328
|
RadioButtonModule,
|
|
13116
13329
|
RippleModule,
|
|
13117
13330
|
SelectButtonModule,
|
|
13331
|
+
SplitButtonModule,
|
|
13118
13332
|
TableModule,
|
|
13119
13333
|
TagModule,
|
|
13120
13334
|
ToastModule,
|
|
@@ -13126,7 +13340,8 @@ MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
|
|
|
13126
13340
|
TabViewModule,
|
|
13127
13341
|
FieldsetModule,
|
|
13128
13342
|
MultiSelectModule,
|
|
13129
|
-
SkeletonModule
|
|
13343
|
+
SkeletonModule,
|
|
13344
|
+
SlideMenuModule
|
|
13130
13345
|
] });
|
|
13131
13346
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsModule, decorators: [{
|
|
13132
13347
|
type: NgModule,
|
|
@@ -13960,5 +14175,5 @@ function EnumName(typeName) {
|
|
|
13960
14175
|
* Generated bundle index. Do not edit.
|
|
13961
14176
|
*/
|
|
13962
14177
|
|
|
13963
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDisplayTypeEnum, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, EnumeratePipeI18nHelper, FieldActionDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, IdProperty, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDataLanguageDropdownComponent, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngEnumerateAsyncPipe, MngEnumeratePipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldActionComponent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldNoLabelWrapperComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngLocaleDefaultRowClassPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewEditorTypeEnum, TableviewRouteBuilder, TitleProperty, TypeName, TypeUtil, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMaxValidationMessage, getMinLengthValidationMessage, getMinValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase };
|
|
14178
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDisplayTypeEnum, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, EnumeratePipeI18nHelper, ExportUtils, FieldActionDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, IdProperty, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDataLanguageDropdownComponent, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngEnumerateAsyncPipe, MngEnumeratePipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldActionComponent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldNoLabelWrapperComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngLocaleDefaultRowClassPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewEditorTypeEnum, TableviewRouteBuilder, TitleProperty, TypeName, TypeUtil, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMaxValidationMessage, getMinLengthValidationMessage, getMinValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase };
|
|
13964
14179
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|