@mediusinc/mng-commons 2.4.0 → 2.4.1-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/esm2020/lib/api/utils/medius-rest.util.mjs +9 -5
- package/esm2020/lib/descriptors/filter/filter.descriptor.mjs +10 -2
- package/esm2020/lib/models/config.model.mjs +1 -1
- package/esm2020/lib/services/commons.service.mjs +6 -8
- package/fesm2015/mediusinc-mng-commons.mjs +21 -14
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +22 -12
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +2 -0
- package/lib/descriptors/filter/filter.descriptor.d.ts +5 -3
- package/lib/models/config.model.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1039,6 +1039,7 @@ class MediusRestUtil {
|
|
|
1039
1039
|
this.dateTimeInUtc = true;
|
|
1040
1040
|
this.dateTimeWithTimezone = true;
|
|
1041
1041
|
this.dateTimeWithMillis = true;
|
|
1042
|
+
this.dateOnlyDisabled = false;
|
|
1042
1043
|
// empty
|
|
1043
1044
|
}
|
|
1044
1045
|
static get() {
|
|
@@ -1054,6 +1055,9 @@ class MediusRestUtil {
|
|
|
1054
1055
|
if (config.dateTimeWithMillis !== undefined) {
|
|
1055
1056
|
this.dateTimeWithMillis = config.dateTimeWithMillis;
|
|
1056
1057
|
}
|
|
1058
|
+
if (config.dateOnlyDisabled !== undefined) {
|
|
1059
|
+
this.dateOnlyDisabled = config.dateOnlyDisabled;
|
|
1060
|
+
}
|
|
1057
1061
|
}
|
|
1058
1062
|
fromAngularQueryParamsToMediusQueryParams(params, filterDescriptors, defaultItemsPerPage = 10, defaultOffset = 0) {
|
|
1059
1063
|
const offset = params['first'] ? parseInt(params['first']) : defaultOffset;
|
|
@@ -1187,19 +1191,19 @@ class MediusRestUtil {
|
|
|
1187
1191
|
// transform dates to correct iso string
|
|
1188
1192
|
if (typeof filterParam.filterValue !== 'undefined') {
|
|
1189
1193
|
if (Array.isArray(filterParam.filterValue)) {
|
|
1190
|
-
filterParam.filterValue = filterParam.filterValue.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, !filterDescriptor.datePickerShowTime));
|
|
1194
|
+
filterParam.filterValue = filterParam.filterValue.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, filterDescriptor.datePickerValueDateOnly ?? (this.dateOnlyDisabled ? false : !filterDescriptor.datePickerShowTime)));
|
|
1191
1195
|
}
|
|
1192
1196
|
else {
|
|
1193
1197
|
filterDescriptor.datePickerValueInUtc;
|
|
1194
|
-
filterParam.filterValue = DateUtil.toIsoString(filterParam.filterValue, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, !filterDescriptor.datePickerShowTime);
|
|
1198
|
+
filterParam.filterValue = DateUtil.toIsoString(filterParam.filterValue, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, filterDescriptor.datePickerValueDateOnly ?? (this.dateOnlyDisabled ? false : !filterDescriptor.datePickerShowTime));
|
|
1195
1199
|
}
|
|
1196
1200
|
}
|
|
1197
1201
|
if (typeof filterParam.filterValueTo !== 'undefined') {
|
|
1198
1202
|
if (Array.isArray(filterParam.filterValueTo)) {
|
|
1199
|
-
filterParam.filterValueTo = filterParam.filterValueTo.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, !filterDescriptor.datePickerShowTime));
|
|
1203
|
+
filterParam.filterValueTo = filterParam.filterValueTo.map(v => DateUtil.toIsoString(v, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, filterDescriptor.datePickerValueDateOnly ?? (this.dateOnlyDisabled ? false : !filterDescriptor.datePickerShowTime)));
|
|
1200
1204
|
}
|
|
1201
1205
|
else {
|
|
1202
|
-
filterParam.filterValueTo = DateUtil.toIsoString(filterParam.filterValueTo, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, !filterDescriptor.datePickerShowTime);
|
|
1206
|
+
filterParam.filterValueTo = DateUtil.toIsoString(filterParam.filterValueTo, filterDescriptor.datePickerValueInUtc ?? this.dateTimeInUtc, filterDescriptor.datePickerValueWithTimezone ?? this.dateTimeWithTimezone, this.dateTimeWithMillis, filterDescriptor.datePickerValueDateOnly ?? (this.dateOnlyDisabled ? false : !filterDescriptor.datePickerShowTime));
|
|
1203
1207
|
}
|
|
1204
1208
|
}
|
|
1205
1209
|
}
|
|
@@ -3313,13 +3317,11 @@ class MngCommonsService {
|
|
|
3313
3317
|
this.setPageTitle();
|
|
3314
3318
|
});
|
|
3315
3319
|
// serialization
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
};
|
|
3321
|
-
ObjectSerializer.get().configure(dateSerializationConfig);
|
|
3322
|
-
MediusRestUtil.get().configure(dateSerializationConfig);
|
|
3320
|
+
ObjectSerializer.get().configure({ ...(this.moduleConfig?.serialization ?? {}) });
|
|
3321
|
+
MediusRestUtil.get().configure({
|
|
3322
|
+
...(this.moduleConfig?.serialization ?? {}),
|
|
3323
|
+
dateOnlyDisabled: this.moduleConfig.serialization?.filtersDateOnlyDisabled
|
|
3324
|
+
});
|
|
3323
3325
|
}
|
|
3324
3326
|
// MENU actions
|
|
3325
3327
|
menuChangeActiveKey(key) {
|
|
@@ -3831,6 +3833,7 @@ class FilterDescriptor {
|
|
|
3831
3833
|
this._datePickerShowTime = false;
|
|
3832
3834
|
this._datePickerValueWithTimezone = undefined;
|
|
3833
3835
|
this._datePickerValueInUtc = undefined;
|
|
3836
|
+
this._datePickerValueDateOnly = undefined;
|
|
3834
3837
|
this._className = '';
|
|
3835
3838
|
this._columnClassName = '';
|
|
3836
3839
|
this._columnWidth = null;
|
|
@@ -3879,6 +3882,9 @@ class FilterDescriptor {
|
|
|
3879
3882
|
get datePickerValueWithTimezone() {
|
|
3880
3883
|
return this._datePickerValueWithTimezone;
|
|
3881
3884
|
}
|
|
3885
|
+
get datePickerValueDateOnly() {
|
|
3886
|
+
return this._datePickerValueDateOnly;
|
|
3887
|
+
}
|
|
3882
3888
|
get placeholder() {
|
|
3883
3889
|
return this._placeholder;
|
|
3884
3890
|
}
|
|
@@ -3930,13 +3936,16 @@ class FilterDescriptor {
|
|
|
3930
3936
|
this._datePickerShowTime = showTime;
|
|
3931
3937
|
return this;
|
|
3932
3938
|
}
|
|
3933
|
-
withDateValue(inUtc, withTimezone) {
|
|
3939
|
+
withDateValue(inUtc, withTimezone, dateOnly) {
|
|
3934
3940
|
if (typeof inUtc !== 'undefined') {
|
|
3935
3941
|
this._datePickerValueInUtc = inUtc;
|
|
3936
3942
|
}
|
|
3937
3943
|
if (typeof withTimezone !== 'undefined') {
|
|
3938
3944
|
this._datePickerValueWithTimezone = withTimezone;
|
|
3939
3945
|
}
|
|
3946
|
+
if (typeof dateOnly !== 'undefined') {
|
|
3947
|
+
this._datePickerValueDateOnly = dateOnly;
|
|
3948
|
+
}
|
|
3940
3949
|
return this;
|
|
3941
3950
|
}
|
|
3942
3951
|
withPlaceholder(placeholder) {
|
|
@@ -3979,6 +3988,7 @@ class FilterDescriptor {
|
|
|
3979
3988
|
descriptor._datePickerShowTime = this._datePickerShowTime;
|
|
3980
3989
|
descriptor._datePickerValueInUtc = this._datePickerValueInUtc;
|
|
3981
3990
|
descriptor._datePickerValueWithTimezone = this._datePickerValueWithTimezone;
|
|
3991
|
+
descriptor._datePickerValueDateOnly = this._datePickerValueDateOnly;
|
|
3982
3992
|
descriptor._placeholder = this._placeholder;
|
|
3983
3993
|
descriptor._className = this._className;
|
|
3984
3994
|
descriptor._columnWidth = this._columnWidth;
|