@mediusinc/mng-commons 0.7.0 → 0.7.1
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 +3 -3
- package/assets/i18n/sl.json +3 -3
- package/esm2020/lib/api/utils/medius-rest.util.mjs +52 -26
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +26 -9
- package/esm2020/lib/components/tableview/table/table.component.mjs +29 -12
- package/esm2020/lib/descriptors/action.descriptor.mjs +3 -1
- package/esm2020/lib/descriptors/field.descriptor.mjs +2 -2
- package/esm2020/lib/descriptors/filter.descriptor.mjs +61 -3
- package/esm2020/lib/services/commons.service.mjs +3 -3
- package/esm2020/lib/utils/enum.util.mjs +3 -3
- package/fesm2015/mediusinc-mng-commons.mjs +166 -49
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +164 -48
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +4 -2
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +2 -0
- package/lib/components/tableview/table/table.component.d.ts +1 -2
- package/lib/descriptors/action.descriptor.d.ts +2 -2
- package/lib/descriptors/filter.descriptor.d.ts +21 -2
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_datatable.scss +36 -0
|
@@ -12,7 +12,7 @@ import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-forml
|
|
|
12
12
|
import * as i1$1 from '@ngx-translate/core';
|
|
13
13
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
14
14
|
import * as i2 from 'primeng/api';
|
|
15
|
-
import { ConfirmationService, MessageService
|
|
15
|
+
import { FilterMatchMode, ConfirmationService, MessageService } from 'primeng/api';
|
|
16
16
|
import * as i2$1 from 'primeng/autocomplete';
|
|
17
17
|
import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
|
|
18
18
|
import * as i2$4 from 'primeng/breadcrumb';
|
|
@@ -765,11 +765,13 @@ class ActionDescriptor {
|
|
|
765
765
|
this._hasRunNotificationSuccess = hasNotification;
|
|
766
766
|
this._runNotificationSuccessTitle = title;
|
|
767
767
|
this._runNotificationSuccessMessage = message;
|
|
768
|
+
return this;
|
|
768
769
|
}
|
|
769
770
|
withRunNotificationError(title, message, hasNotification = true) {
|
|
770
771
|
this._hasRunNotificationError = hasNotification;
|
|
771
772
|
this._runNotificationErrorTitle = title;
|
|
772
773
|
this._runNotificationErrorMessage = message;
|
|
774
|
+
return this;
|
|
773
775
|
}
|
|
774
776
|
}
|
|
775
777
|
(function (ActionDescriptor) {
|
|
@@ -1116,7 +1118,12 @@ class FilterDescriptor {
|
|
|
1116
1118
|
constructor(property) {
|
|
1117
1119
|
this._filterType = FilterDescriptor.TypeEnum.String;
|
|
1118
1120
|
this._matchModes = null;
|
|
1121
|
+
this._numberUseGrouping = true;
|
|
1122
|
+
this._datePickerShowTime = false;
|
|
1119
1123
|
this._className = '';
|
|
1124
|
+
this._columnClassName = '';
|
|
1125
|
+
this._columnWidth = null;
|
|
1126
|
+
this._columnMinWidth = null;
|
|
1120
1127
|
this._property = property;
|
|
1121
1128
|
}
|
|
1122
1129
|
get filterType() {
|
|
@@ -1128,12 +1135,36 @@ class FilterDescriptor {
|
|
|
1128
1135
|
get matchModes() {
|
|
1129
1136
|
return this._matchModes;
|
|
1130
1137
|
}
|
|
1138
|
+
get numberMinFractionDigits() {
|
|
1139
|
+
return this._numberMinFractionDigits;
|
|
1140
|
+
}
|
|
1141
|
+
get numberMaxFractionDigits() {
|
|
1142
|
+
return this._numberMaxFractionDigits;
|
|
1143
|
+
}
|
|
1144
|
+
get numberUseGrouping() {
|
|
1145
|
+
return this._numberUseGrouping;
|
|
1146
|
+
}
|
|
1147
|
+
get datePickerFormat() {
|
|
1148
|
+
return this._datePickerFormat;
|
|
1149
|
+
}
|
|
1150
|
+
get datePickerShowTime() {
|
|
1151
|
+
return this._datePickerShowTime;
|
|
1152
|
+
}
|
|
1131
1153
|
get placeholder() {
|
|
1132
1154
|
return this._placeholder;
|
|
1133
1155
|
}
|
|
1134
1156
|
get className() {
|
|
1135
1157
|
return this._className;
|
|
1136
1158
|
}
|
|
1159
|
+
get columnClassName() {
|
|
1160
|
+
return this._columnClassName;
|
|
1161
|
+
}
|
|
1162
|
+
get columnWidth() {
|
|
1163
|
+
return this._columnWidth;
|
|
1164
|
+
}
|
|
1165
|
+
get columnMinWidth() {
|
|
1166
|
+
return this._columnMinWidth;
|
|
1167
|
+
}
|
|
1137
1168
|
get property() {
|
|
1138
1169
|
return this._property;
|
|
1139
1170
|
}
|
|
@@ -1149,6 +1180,20 @@ class FilterDescriptor {
|
|
|
1149
1180
|
this._filterProperty = filterProperty;
|
|
1150
1181
|
return this;
|
|
1151
1182
|
}
|
|
1183
|
+
withNumberFractions(min, max) {
|
|
1184
|
+
this._numberMinFractionDigits = min;
|
|
1185
|
+
this._numberMaxFractionDigits = max;
|
|
1186
|
+
return this;
|
|
1187
|
+
}
|
|
1188
|
+
withNumberGrouping(useGrouping = true) {
|
|
1189
|
+
this._numberUseGrouping = useGrouping;
|
|
1190
|
+
return this;
|
|
1191
|
+
}
|
|
1192
|
+
withDateFormat(format, showTime = false) {
|
|
1193
|
+
this._datePickerFormat = format;
|
|
1194
|
+
this._datePickerShowTime = showTime;
|
|
1195
|
+
return this;
|
|
1196
|
+
}
|
|
1152
1197
|
withPlaceholder(placeholder) {
|
|
1153
1198
|
this._placeholder = placeholder;
|
|
1154
1199
|
return this;
|
|
@@ -1157,6 +1202,15 @@ class FilterDescriptor {
|
|
|
1157
1202
|
this._className = className;
|
|
1158
1203
|
return this;
|
|
1159
1204
|
}
|
|
1205
|
+
withColumnClassName(className) {
|
|
1206
|
+
this._columnClassName = className;
|
|
1207
|
+
return this;
|
|
1208
|
+
}
|
|
1209
|
+
withColumnWidth(width, minWidth) {
|
|
1210
|
+
this._columnWidth = width ?? null;
|
|
1211
|
+
this._columnMinWidth = minWidth ?? null;
|
|
1212
|
+
return this;
|
|
1213
|
+
}
|
|
1160
1214
|
withMatchModes(matchModes) {
|
|
1161
1215
|
this._matchModes = matchModes;
|
|
1162
1216
|
return this;
|
|
@@ -1169,8 +1223,16 @@ class FilterDescriptor {
|
|
|
1169
1223
|
copyFieldsTo(descriptor) {
|
|
1170
1224
|
descriptor._filterType = this._filterType;
|
|
1171
1225
|
descriptor._filterProperty = this._filterProperty;
|
|
1226
|
+
descriptor._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1227
|
+
descriptor._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1228
|
+
descriptor._numberUseGrouping = this._numberUseGrouping;
|
|
1229
|
+
descriptor._datePickerFormat = this._datePickerFormat;
|
|
1230
|
+
descriptor._datePickerShowTime = this._datePickerShowTime;
|
|
1172
1231
|
descriptor._placeholder = this._placeholder;
|
|
1173
1232
|
descriptor._className = this._className;
|
|
1233
|
+
descriptor._columnWidth = this._columnWidth;
|
|
1234
|
+
descriptor._columnMinWidth = this._columnMinWidth;
|
|
1235
|
+
descriptor._columnClassName = this._columnClassName;
|
|
1174
1236
|
}
|
|
1175
1237
|
}
|
|
1176
1238
|
(function (FilterDescriptor) {
|
|
@@ -1192,9 +1254,7 @@ class FilterDescriptor {
|
|
|
1192
1254
|
MatchModeEnum["NotEquals"] = "notEquals";
|
|
1193
1255
|
MatchModeEnum["In"] = "in";
|
|
1194
1256
|
MatchModeEnum["LessThan"] = "lt";
|
|
1195
|
-
MatchModeEnum["LessThanOrEqualTo"] = "lte";
|
|
1196
1257
|
MatchModeEnum["GreaterThan"] = "gt";
|
|
1197
|
-
MatchModeEnum["GreaterThanOrEqualTo"] = "gte";
|
|
1198
1258
|
MatchModeEnum["Between"] = "between";
|
|
1199
1259
|
MatchModeEnum["DateIs"] = "dateIs";
|
|
1200
1260
|
MatchModeEnum["DateIsNot"] = "dateIsNot";
|
|
@@ -2064,7 +2124,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2064
2124
|
}
|
|
2065
2125
|
asDatePicker(format, min, max, showTime) {
|
|
2066
2126
|
this._fieldType = FieldInputDescriptor.TypeEnum.Datepicker;
|
|
2067
|
-
this._datePickerFormat = format
|
|
2127
|
+
this._datePickerFormat = format;
|
|
2068
2128
|
this._datePickerMin = min;
|
|
2069
2129
|
this._datePickerMax = max;
|
|
2070
2130
|
this._datePickerShowTime = showTime ?? false;
|
|
@@ -3206,7 +3266,7 @@ class EnumUtil {
|
|
|
3206
3266
|
*/
|
|
3207
3267
|
static getConstantName(enumType, value) {
|
|
3208
3268
|
if (typeof value === 'string') {
|
|
3209
|
-
return
|
|
3269
|
+
return EnumUtil.getConstantNames(enumType).find(c => enumType[c] === value) ?? null;
|
|
3210
3270
|
}
|
|
3211
3271
|
else {
|
|
3212
3272
|
return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
|
|
@@ -3220,7 +3280,7 @@ class EnumUtil {
|
|
|
3220
3280
|
static getConstantNameFromEnumObject(enumObj, value) {
|
|
3221
3281
|
const enumObjAny = enumObj;
|
|
3222
3282
|
if (typeof value === 'string') {
|
|
3223
|
-
return
|
|
3283
|
+
return EnumUtil.getConstantNamesFromEnumObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
|
|
3224
3284
|
}
|
|
3225
3285
|
else {
|
|
3226
3286
|
return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
|
|
@@ -3912,7 +3972,7 @@ class MediusRestUtil {
|
|
|
3912
3972
|
const field = filterFieldSplit[0];
|
|
3913
3973
|
const operator = filterFieldSplit.length > 1 ? filterFieldSplit[1] : 'eq';
|
|
3914
3974
|
// prepare value
|
|
3915
|
-
let value = filterFieldSplit.length > 2 ? filterFieldSplit
|
|
3975
|
+
let value = filterFieldSplit.length > 2 ? filterFieldSplit.slice(2).join(':') : '';
|
|
3916
3976
|
const valueTo = undefined;
|
|
3917
3977
|
if (value.startsWith("'")) {
|
|
3918
3978
|
value = value.substring(1, value.length - 1);
|
|
@@ -3923,11 +3983,11 @@ class MediusRestUtil {
|
|
|
3923
3983
|
.split(',')
|
|
3924
3984
|
.map((v) => (v.startsWith("'") ? v.substring(1, v.length - 1) : v));
|
|
3925
3985
|
}
|
|
3926
|
-
const operatorMapping = MediusRestUtil.matchModeMapping.find(mapping => mapping[1] === operator);
|
|
3927
3986
|
const filterDescriptor = filterDescriptors.find(f => f.property === field);
|
|
3928
|
-
|
|
3987
|
+
const matchMode = MediusRestUtil.getMapping(operator, filterDescriptor?.filterType, 1);
|
|
3988
|
+
if (matchMode && filterDescriptor) {
|
|
3929
3989
|
const fieldFilterProperty = filterDescriptor.filterProperty ?? filterDescriptor.property;
|
|
3930
|
-
mediusParamsBuilder.withFilter(fieldFilterProperty, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(
|
|
3990
|
+
mediusParamsBuilder.withFilter(fieldFilterProperty, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
3931
3991
|
}
|
|
3932
3992
|
}
|
|
3933
3993
|
}
|
|
@@ -3954,18 +4014,27 @@ class MediusRestUtil {
|
|
|
3954
4014
|
for (const field in event.filters) {
|
|
3955
4015
|
const primeOperator = event.filters[field].matchMode;
|
|
3956
4016
|
let value = event.filters[field].value;
|
|
3957
|
-
const operatorMapping = MediusRestUtil.
|
|
3958
|
-
if (operatorMapping &&
|
|
3959
|
-
|
|
3960
|
-
value
|
|
3961
|
-
|
|
3962
|
-
|
|
4017
|
+
const operatorMapping = primeOperator ? MediusRestUtil.getMapping(primeOperator, undefined, 0) : undefined;
|
|
4018
|
+
if (operatorMapping && typeof value !== 'undefined' && value !== null) {
|
|
4019
|
+
let doAddFilter = false;
|
|
4020
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
4021
|
+
value = `'${value}'`;
|
|
4022
|
+
doAddFilter = true;
|
|
4023
|
+
}
|
|
4024
|
+
else if (typeof value === 'number') {
|
|
4025
|
+
doAddFilter = true;
|
|
4026
|
+
}
|
|
4027
|
+
else if (Array.isArray(value)) {
|
|
3963
4028
|
value = `[${value.map(v => `'${v}'`).join(',')}]`;
|
|
4029
|
+
doAddFilter = true;
|
|
3964
4030
|
}
|
|
3965
|
-
else {
|
|
3966
|
-
value =
|
|
4031
|
+
else if (value instanceof Date) {
|
|
4032
|
+
value = `${value.toISOString()}`;
|
|
4033
|
+
doAddFilter = true;
|
|
4034
|
+
}
|
|
4035
|
+
if (doAddFilter) {
|
|
4036
|
+
filters.push(`${field}:${operatorMapping[1]}:${value}`);
|
|
3967
4037
|
}
|
|
3968
|
-
filters.push(`${field}:${operatorMapping[1]}:${value}`);
|
|
3969
4038
|
}
|
|
3970
4039
|
}
|
|
3971
4040
|
if (filters.length > 0) {
|
|
@@ -3997,24 +4066,39 @@ class MediusRestUtil {
|
|
|
3997
4066
|
return queryParamBuilder.build();
|
|
3998
4067
|
}
|
|
3999
4068
|
static addMediusFilterFromPrimeFilterMetadata(queryParamBuilder, property, filterMetadata) {
|
|
4000
|
-
const matchType = MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(filterMetadata.matchMode ?? '
|
|
4069
|
+
const matchType = MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(filterMetadata.matchMode ?? 'equals');
|
|
4001
4070
|
queryParamBuilder.withFilter(property, filterMetadata.value, undefined, matchType);
|
|
4002
4071
|
}
|
|
4003
|
-
static getMediusFilterMatchTypeFromPrimeMatchMode(matchMode) {
|
|
4004
|
-
|
|
4005
|
-
|
|
4072
|
+
static getMediusFilterMatchTypeFromPrimeMatchMode(matchMode, dataType) {
|
|
4073
|
+
return MediusRestUtil.getMapping(matchMode, dataType)?.[2] ?? MediusFilterMatchType.Equals;
|
|
4074
|
+
}
|
|
4075
|
+
static getMapping(matchMode, dataType, idx = 0) {
|
|
4076
|
+
const mappings = MediusRestUtil.matchModeMapping.filter(m => m[idx] === matchMode && (!dataType || !m[3] || dataType === m[3]));
|
|
4077
|
+
if (mappings.length === 0) {
|
|
4078
|
+
return null;
|
|
4079
|
+
}
|
|
4080
|
+
else if (mappings.length === 1) {
|
|
4081
|
+
return mappings[0];
|
|
4082
|
+
}
|
|
4083
|
+
else {
|
|
4084
|
+
return mappings.sort((m1, m2) => (m2[3] ?? -1) - (m1[3] ?? -1))[0];
|
|
4085
|
+
}
|
|
4006
4086
|
}
|
|
4007
4087
|
}
|
|
4008
4088
|
// first value is from primeNG, second is for use in query params
|
|
4009
4089
|
MediusRestUtil.matchModeMapping = [
|
|
4010
|
-
[
|
|
4011
|
-
[
|
|
4012
|
-
[
|
|
4013
|
-
[
|
|
4014
|
-
[
|
|
4015
|
-
[
|
|
4016
|
-
[
|
|
4017
|
-
[
|
|
4090
|
+
[FilterMatchMode.CONTAINS, 'c', MediusFilterMatchType.Contains, null],
|
|
4091
|
+
[FilterMatchMode.ENDS_WITH, 'ew', MediusFilterMatchType.EndsWith, null],
|
|
4092
|
+
[FilterMatchMode.EQUALS, 'eq', MediusFilterMatchType.Equals, null],
|
|
4093
|
+
[FilterMatchMode.GREATER_THAN, 'gt', MediusFilterMatchType.GreaterThan, null],
|
|
4094
|
+
[FilterMatchMode.LESS_THAN, 'lt', MediusFilterMatchType.SmallerThan, null],
|
|
4095
|
+
[FilterMatchMode.STARTS_WITH, 'sw', MediusFilterMatchType.StartsWith, null],
|
|
4096
|
+
[FilterMatchMode.IN, 'in', MediusFilterMatchType.In, null],
|
|
4097
|
+
[FilterMatchMode.NOT_EQUALS, 'neq', MediusFilterMatchType.NotEquals, null],
|
|
4098
|
+
[FilterMatchMode.DATE_IS, 'eq', MediusFilterMatchType.Equals, FilterDescriptor.TypeEnum.Date],
|
|
4099
|
+
[FilterMatchMode.DATE_BEFORE, 'lt', MediusFilterMatchType.SmallerThan, FilterDescriptor.TypeEnum.Date],
|
|
4100
|
+
[FilterMatchMode.DATE_AFTER, 'gt', MediusFilterMatchType.GreaterThan, FilterDescriptor.TypeEnum.Date],
|
|
4101
|
+
[FilterMatchMode.DATE_IS_NOT, 'neq', MediusFilterMatchType.NotEquals, FilterDescriptor.TypeEnum.Date]
|
|
4018
4102
|
];
|
|
4019
4103
|
|
|
4020
4104
|
class ActionExecContext {
|
|
@@ -4929,8 +5013,8 @@ class MngCommonsService {
|
|
|
4929
5013
|
numeric: [
|
|
4930
5014
|
FilterDescriptor.MatchModeEnum.Equals,
|
|
4931
5015
|
FilterDescriptor.MatchModeEnum.NotEquals,
|
|
4932
|
-
FilterDescriptor.MatchModeEnum.
|
|
4933
|
-
FilterDescriptor.MatchModeEnum.
|
|
5016
|
+
FilterDescriptor.MatchModeEnum.LessThan,
|
|
5017
|
+
FilterDescriptor.MatchModeEnum.GreaterThan
|
|
4934
5018
|
],
|
|
4935
5019
|
date: [
|
|
4936
5020
|
FilterDescriptor.MatchModeEnum.DateIs,
|
|
@@ -6317,10 +6401,10 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
6317
6401
|
}
|
|
6318
6402
|
}
|
|
6319
6403
|
MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6320
|
-
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['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]=\"
|
|
6404
|
+
MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['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 [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\">\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 <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$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", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$3.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$4.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$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", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.InputText, selector: "[pInputText]" }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6321
6405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
6322
6406
|
type: Component,
|
|
6323
|
-
args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['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]=\"
|
|
6407
|
+
args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['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 [showIcon]=\"true\"\n [inputStyleClass]=\"descriptor.inputClassName\">\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 <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
|
|
6324
6408
|
}] });
|
|
6325
6409
|
|
|
6326
6410
|
class MngFormlyFieldLabelComponent {
|
|
@@ -6454,6 +6538,7 @@ class MngTableColumnFilterComponent {
|
|
|
6454
6538
|
break;
|
|
6455
6539
|
case FilterDescriptor.TypeEnum.Date:
|
|
6456
6540
|
this.primeType = 'date';
|
|
6541
|
+
this.primeDefaultMatchMode = FilterMatchMode.DATE_AFTER;
|
|
6457
6542
|
break;
|
|
6458
6543
|
case FilterDescriptor.TypeEnum.Lookup:
|
|
6459
6544
|
this.primeType = 'lookup';
|
|
@@ -6478,6 +6563,22 @@ class MngTableColumnFilterComponent {
|
|
|
6478
6563
|
break;
|
|
6479
6564
|
}
|
|
6480
6565
|
}
|
|
6566
|
+
valueToDate(value) {
|
|
6567
|
+
console.log('call', this.descriptor.property);
|
|
6568
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
6569
|
+
return new Date(value);
|
|
6570
|
+
}
|
|
6571
|
+
else if (value instanceof Date) {
|
|
6572
|
+
return value;
|
|
6573
|
+
}
|
|
6574
|
+
else {
|
|
6575
|
+
return null;
|
|
6576
|
+
}
|
|
6577
|
+
}
|
|
6578
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6579
|
+
dateFilter(value, filterCallback) {
|
|
6580
|
+
filterCallback(value);
|
|
6581
|
+
}
|
|
6481
6582
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6482
6583
|
autocompleteFilter(value, filterCallback) {
|
|
6483
6584
|
filterCallback(value);
|
|
@@ -6487,15 +6588,14 @@ class MngTableColumnFilterComponent {
|
|
|
6487
6588
|
filterCallback(value);
|
|
6488
6589
|
}
|
|
6489
6590
|
toLookupFilterValue(value) {
|
|
6490
|
-
console.log(this.descriptor.property, value);
|
|
6491
6591
|
return this.lookupDescriptor.dataKeyProperty && value ? { [this.lookupDescriptor.dataKeyProperty]: value } : value;
|
|
6492
6592
|
}
|
|
6493
6593
|
}
|
|
6494
6594
|
MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
6495
|
-
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"
|
|
6595
|
+
MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$5.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: i5$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", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsValueProperty", "itemsLabelProperty", "itemsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsLabelTranslate", "itemsValueProperty", "itemsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
|
6496
6596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
|
|
6497
6597
|
type: Component,
|
|
6498
|
-
args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"
|
|
6598
|
+
args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\"\n [minFractionDigits]=\"$any(descriptor.numberMinFractionDigits)\"\n [maxFractionDigits]=\"$any(descriptor.numberMaxFractionDigits)\"\n [useGrouping]=\"descriptor.numberUseGrouping\">\n <ng-template *ngIf=\"primeType === 'date'\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <p-calendar\n appendTo=\"body\"\n [ngModel]=\"value\"\n (ngModelChange)=\"dateFilter($event, filterCallback)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [dateFormat]=\"descriptor.datePickerFormat ?? 'dd.mm.yy'\"\n [showTime]=\"descriptor.datePickerShowTime\">\n </p-calendar>\n </ng-template>\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [openOnFocus]=\"lookupDescriptor.autocompleteOpenOnFocus\"\n [inlineSearch]=\"lookupDescriptor.autocompleteInlineSearch\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsLabelTranslate]=\"lookupDescriptor.itemsLabelTranslate\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"false\"\n (valueChange)=\"dropdownFilter($event, filterCallback)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
|
|
6499
6599
|
}], ctorParameters: function () { return [{ type: i2.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
|
|
6500
6600
|
type: Input
|
|
6501
6601
|
}], display: [{
|
|
@@ -6535,8 +6635,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
6535
6635
|
type: Input
|
|
6536
6636
|
}] } });
|
|
6537
6637
|
|
|
6538
|
-
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
6539
6638
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
6639
|
+
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
6540
6640
|
class MngTableComponent {
|
|
6541
6641
|
constructor(injector, router, route, translate, actionExecutor, viewContainerService) {
|
|
6542
6642
|
this.injector = injector;
|
|
@@ -6609,7 +6709,6 @@ class MngTableComponent {
|
|
|
6609
6709
|
}
|
|
6610
6710
|
}
|
|
6611
6711
|
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
6612
|
-
console.log(this.showInlineActionsColumn, this.rowInlineActions);
|
|
6613
6712
|
// define all styles
|
|
6614
6713
|
this.className = this.descriptor.className;
|
|
6615
6714
|
this.tableFullHeightOffset = this.descriptor.tableFullHeightOffset ?? null;
|
|
@@ -6748,7 +6847,6 @@ class MngTableComponent {
|
|
|
6748
6847
|
this.isFilterChanged = true;
|
|
6749
6848
|
}
|
|
6750
6849
|
onCellClick(event, col, item, idx) {
|
|
6751
|
-
console.log(event);
|
|
6752
6850
|
const mngEvent = new MngTableCellClickEvent(col, item, idx);
|
|
6753
6851
|
this.cellClickEventEmitter.next(mngEvent);
|
|
6754
6852
|
if (this.rowClickActions.length) {
|
|
@@ -6819,9 +6917,21 @@ class MngTableComponent {
|
|
|
6819
6917
|
const primeSortMeta = [];
|
|
6820
6918
|
const primeFilterMeta = {};
|
|
6821
6919
|
this.filterDescriptors.forEach(f => {
|
|
6920
|
+
let matchMode;
|
|
6921
|
+
switch (f.filterType) {
|
|
6922
|
+
case TypeEnum.String:
|
|
6923
|
+
matchMode = FilterMatchMode.CONTAINS;
|
|
6924
|
+
break;
|
|
6925
|
+
case TypeEnum.Date:
|
|
6926
|
+
matchMode = FilterMatchMode.DATE_AFTER;
|
|
6927
|
+
break;
|
|
6928
|
+
default:
|
|
6929
|
+
matchMode = FilterMatchMode.EQUALS;
|
|
6930
|
+
break;
|
|
6931
|
+
}
|
|
6822
6932
|
primeFilterMeta[f.property] = {
|
|
6823
6933
|
value: null,
|
|
6824
|
-
matchMode:
|
|
6934
|
+
matchMode: matchMode
|
|
6825
6935
|
};
|
|
6826
6936
|
});
|
|
6827
6937
|
mediusQueryParam?.sortProperty?.forEach((s, idx) => {
|
|
@@ -6832,11 +6942,17 @@ class MngTableComponent {
|
|
|
6832
6942
|
});
|
|
6833
6943
|
mediusQueryParam?.filterParams?.forEach(f => {
|
|
6834
6944
|
const descriptor = this.filterDescriptors.find(fd => fd.filterProperty === f.property || fd.property === f.property);
|
|
6835
|
-
const
|
|
6836
|
-
if (descriptor &&
|
|
6945
|
+
const matchMode = f.filterMatchType && descriptor ? MediusRestUtil.getMapping(f.filterMatchType, descriptor.filterType, 2)?.[0] : MediusFilterMatchType.Equals;
|
|
6946
|
+
if (descriptor && matchMode) {
|
|
6947
|
+
let filterValue = f.filterValue;
|
|
6948
|
+
if (descriptor.filterType === TypeEnum.Date && typeof filterValue !== 'undefined') {
|
|
6949
|
+
if (typeof filterValue === 'string' || typeof filterValue === 'number') {
|
|
6950
|
+
filterValue = new Date(filterValue);
|
|
6951
|
+
}
|
|
6952
|
+
}
|
|
6837
6953
|
primeFilterMeta[descriptor.property] = {
|
|
6838
|
-
value:
|
|
6839
|
-
matchMode:
|
|
6954
|
+
value: filterValue,
|
|
6955
|
+
matchMode: matchMode
|
|
6840
6956
|
};
|
|
6841
6957
|
}
|
|
6842
6958
|
});
|
|
@@ -6858,10 +6974,10 @@ class MngTableComponent {
|
|
|
6858
6974
|
}
|
|
6859
6975
|
}
|
|
6860
6976
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6861
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: i8$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6977
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: i8$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6862
6978
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
6863
6979
|
type: Component,
|
|
6864
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width:
|
|
6980
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
6865
6981
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6866
6982
|
type: Optional
|
|
6867
6983
|
}] }]; }, propDecorators: { descriptor: [{
|