@mediusinc/mng-commons 5.2.0-rc.0 → 5.2.0-rc.2
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/core/components/notification/notification-wrapper.component.d.ts +3 -1
- package/core/error/error-helpers.d.ts +5 -0
- package/core/error/error.model.d.ts +6 -0
- package/core/helpers/route.d.ts +1 -1
- package/core/models/menu.model.d.ts +2 -1
- package/core/router/route-builder.d.ts +0 -1
- package/core/security/permission.service.d.ts +13 -5
- package/core/security/permissions.model.d.ts +27 -2
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +6 -5
- package/esm2022/core/error/error-helpers.mjs +8 -1
- package/esm2022/core/error/error.model.mjs +2 -1
- package/esm2022/core/models/menu.model.mjs +1 -1
- package/esm2022/core/router/route-builder.mjs +1 -24
- package/esm2022/core/rxjs/map-data-list-result-operator.mjs +4 -1
- package/esm2022/core/security/permission.guard.mjs +2 -2
- package/esm2022/core/security/permission.service.mjs +65 -15
- package/esm2022/core/security/permissions.model.mjs +1 -1
- package/esm2022/form/components/date-range/date-range.component.mjs +9 -3
- package/esm2022/form/components/number-range/number-range.component.mjs +106 -0
- package/esm2022/form/index.mjs +2 -1
- package/esm2022/model/descriptors/enum.descriptor.mjs +1 -1
- package/esm2022/model/helpers/i18n.mjs +2 -2
- package/esm2022/table/api/descriptors/column.descriptor.mjs +8 -19
- package/esm2022/table/api/descriptors/table.descriptor.mjs +13 -9
- package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +3 -2
- package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +72 -10
- package/esm2022/table/helpers/notification.mjs +2 -2
- package/esm2022/tableview/action/components/action/action.component.mjs +6 -7
- package/esm2022/tableview/action/helpers/i18n.mjs +4 -4
- package/esm2022/tableview/action/services/action-executor.service.mjs +6 -3
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +2 -2
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +5 -4
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +2 -3
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +2 -3
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +14 -7
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +1 -1
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +12 -4
- package/fesm2022/mediusinc-mng-commons-core.mjs +82 -42
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +109 -3
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +21 -27
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +72 -10
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +20 -13
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +23 -14
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/form/components/date-range/date-range.component.d.ts +4 -2
- package/form/components/number-range/number-range.component.d.ts +30 -0
- package/form/index.d.ts +1 -0
- package/i18n/en.json +1 -1
- package/i18n/sl.json +1 -1
- package/model/descriptors/enum.descriptor.d.ts +1 -1
- package/package.json +7 -7
- package/table/api/descriptors/column.descriptor.d.ts +4 -10
- package/table/api/descriptors/table.descriptor.d.ts +2 -1
- package/table/components/column-filter-full/column-filter-full.component.d.ts +3 -2
- package/tableview/action/components/action/action.component.d.ts +0 -1
- package/tableview/action/services/action-executor.service.d.ts +1 -0
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +12 -7
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +5 -5
- package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +1 -0
- package/version-info.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { of, throwError, isObservable, Subject, tap } from 'rxjs';
|
|
2
|
-
import { StyleLevelEnum, CommonsInternalError, findReflectTypeName, DataProviderInst, LoggerService, StyleSizeEnum, ACommonsErrorBase, toObservable,
|
|
2
|
+
import { StyleLevelEnum, CommonsInternalError, findReflectTypeName, DataProviderInst, LoggerService, StyleSizeEnum, ACommonsErrorBase, toObservable, fromEnumValuesAsValueArray, fromEnumConstantsAsValueArray, getEnumConstantName, getI18nTypeTabKey, getI18nTypeGroupKey, TypeRegistry, GetterPipe, copyDataListParams } from '@mediusinc/mng-commons/core';
|
|
3
3
|
import { ActionButtonDescriptor, ButtonStyleBuilder, LookupDataProviderInst, ButtonStyleRoundedEnum } from '@mediusinc/mng-commons/form/api';
|
|
4
4
|
import { TypeDescriptor, ModelDescriptor, trySetLookupItemsProperties, enumModelGeneric, model, findClassTitleAttribute } from '@mediusinc/mng-commons/model';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
@@ -488,7 +488,7 @@ function action(typeOrActionName, actionNameOrCfg, cfg) {
|
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
function actionWithProvider(typeOrServiceProvider, serviceProviderOrActionName, actionNameOrCfg, cfg) {
|
|
491
|
-
const actionName = serviceProviderOrActionName === 'string' ? serviceProviderOrActionName : typeof actionNameOrCfg === 'string' ? actionNameOrCfg : 'default';
|
|
491
|
+
const actionName = typeof serviceProviderOrActionName === 'string' ? serviceProviderOrActionName : typeof actionNameOrCfg === 'string' ? actionNameOrCfg : 'default';
|
|
492
492
|
if (typeOrServiceProvider instanceof TypeDescriptor) {
|
|
493
493
|
return new ActionDescriptorInst(actionName, {
|
|
494
494
|
...(typeof serviceProviderOrActionName === 'string' ? {} : actionGetProviderCfgObj(serviceProviderOrActionName)),
|
|
@@ -1325,7 +1325,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
1325
1325
|
/** @ignore */ this._isLocalized = false;
|
|
1326
1326
|
/** @ignore */ this._eventsSubject = new Subject();
|
|
1327
1327
|
this._property = property;
|
|
1328
|
-
this._label = getI18nTypePropertyKey(this._editor.model.i18nBaseKey, property);
|
|
1329
1328
|
}
|
|
1330
1329
|
get property() {
|
|
1331
1330
|
return this._property;
|
|
@@ -1873,7 +1872,7 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
|
1873
1872
|
this._optionEnumValues = Array.isArray(options)
|
|
1874
1873
|
? fromEnumValuesAsValueArray(this._enumModel.type, options, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined)
|
|
1875
1874
|
: fromEnumConstantsAsValueArray(this._enumModel.type, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined);
|
|
1876
|
-
this.withLookup(() =>
|
|
1875
|
+
this.withLookup(() => this._optionEnumValues);
|
|
1877
1876
|
this.withOptionsLabelProperty('title', this._enumModel.i18nBaseKey !== null);
|
|
1878
1877
|
this.withOptionsDisabledProperty('disabled');
|
|
1879
1878
|
}
|
|
@@ -2298,12 +2297,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2298
2297
|
}
|
|
2299
2298
|
asDatePicker(opts) {
|
|
2300
2299
|
this._fieldType = FieldInputTypeEnum.Datepicker;
|
|
2301
|
-
this.
|
|
2302
|
-
this.
|
|
2303
|
-
this._datePickerMax = opts?.max;
|
|
2304
|
-
this._datePickerShowTime = opts?.showTime;
|
|
2305
|
-
this._datePickerShowSeconds = opts?.showSeconds;
|
|
2306
|
-
this._datePickerValueAsDateObj = opts?.asDateObj;
|
|
2300
|
+
this.withDateValidation(opts);
|
|
2301
|
+
this.withDatePickerDisplay(opts);
|
|
2307
2302
|
this.withDateValue({
|
|
2308
2303
|
asDateObj: opts?.asDateObj,
|
|
2309
2304
|
utc: opts?.utc,
|
|
@@ -2370,6 +2365,17 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2370
2365
|
this._pattern = opts?.pattern;
|
|
2371
2366
|
return this;
|
|
2372
2367
|
}
|
|
2368
|
+
withDatePickerDisplay(opts) {
|
|
2369
|
+
this._datePickerFormat = opts?.format;
|
|
2370
|
+
this._datePickerShowTime = opts?.showTime;
|
|
2371
|
+
this._datePickerShowSeconds = opts?.showSeconds;
|
|
2372
|
+
return this;
|
|
2373
|
+
}
|
|
2374
|
+
withDateValidation(opts) {
|
|
2375
|
+
this._datePickerMin = opts?.min;
|
|
2376
|
+
this._datePickerMax = opts?.max;
|
|
2377
|
+
return this;
|
|
2378
|
+
}
|
|
2373
2379
|
withInputTrim(trimOption = 'both') {
|
|
2374
2380
|
this._inputTrim = trimOption;
|
|
2375
2381
|
return this;
|
|
@@ -2568,6 +2574,9 @@ class EditorDescriptorInst {
|
|
|
2568
2574
|
* @param field Field descriptor.
|
|
2569
2575
|
*/
|
|
2570
2576
|
addFieldDescriptor(field) {
|
|
2577
|
+
if (this._fields.some(f => f.property === field.property)) {
|
|
2578
|
+
throw new CommonsInternalError(`Field '${field.property}' already exists.`);
|
|
2579
|
+
}
|
|
2571
2580
|
this.createDefaultGroup();
|
|
2572
2581
|
this._fields.push(field);
|
|
2573
2582
|
this._currentGroup?.addField(field);
|
|
@@ -2578,9 +2587,7 @@ class EditorDescriptorInst {
|
|
|
2578
2587
|
* @param property Model property name.
|
|
2579
2588
|
*/
|
|
2580
2589
|
addField(property) {
|
|
2581
|
-
|
|
2582
|
-
this.addFieldDescriptor(field);
|
|
2583
|
-
return field;
|
|
2590
|
+
return this.addFieldUnsafe(property);
|
|
2584
2591
|
}
|
|
2585
2592
|
/**
|
|
2586
2593
|
* Adds field by the model property name (UNSAFE). Property is not checked on editor model.
|