@mediusinc/mng-commons 0.17.0 → 0.17.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.
Files changed (28) hide show
  1. package/esm2020/lib/api/utils/object-serializer.util.mjs +14 -10
  2. package/esm2020/lib/components/action/editor/action-editor.component.mjs +2 -2
  3. package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
  4. package/esm2020/lib/descriptors/action.descriptor.mjs +18 -8
  5. package/esm2020/lib/descriptors/editor.descriptor.mjs +5 -5
  6. package/esm2020/lib/descriptors/field.descriptor.mjs +2 -2
  7. package/esm2020/lib/descriptors/model.descriptor.mjs +13 -2
  8. package/esm2020/lib/descriptors/table.descriptor.mjs +3 -3
  9. package/esm2020/lib/descriptors/tableview.descriptor.mjs +8 -8
  10. package/esm2020/lib/pipes/i18n-property.pipe.mjs +2 -2
  11. package/esm2020/lib/types/type.decorator.mjs +14 -5
  12. package/esm2020/lib/utils/i18n.util.mjs +6 -6
  13. package/esm2020/lib/utils/model.util.mjs +10 -1
  14. package/esm2020/lib/utils/type.util.mjs +52 -36
  15. package/fesm2015/mediusinc-mng-commons.mjs +148 -90
  16. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  17. package/fesm2020/mediusinc-mng-commons.mjs +146 -88
  18. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  19. package/lib/descriptors/action.descriptor.d.ts +4 -2
  20. package/lib/descriptors/editor.descriptor.d.ts +1 -1
  21. package/lib/descriptors/model.descriptor.d.ts +4 -1
  22. package/lib/descriptors/table.descriptor.d.ts +1 -1
  23. package/lib/descriptors/tableview.descriptor.d.ts +1 -1
  24. package/lib/types/type.decorator.d.ts +2 -2
  25. package/lib/utils/type.util.d.ts +28 -7
  26. package/package.json +1 -1
  27. package/scss/mng-overrides/_layout_dialog.scss +16 -5
  28. package/version-info.json +5 -5
@@ -16,7 +16,7 @@ export declare class ActionDescriptor<T> {
16
16
  protected readonly _parentType?: ClassType<unknown>;
17
17
  protected readonly _parentTypeName?: string;
18
18
  protected readonly _parentProperty?: string;
19
- protected readonly _i18nModelActionBaseKey?: string;
19
+ protected _i18nModelActionBaseKey?: string;
20
20
  protected _type: ActionTypeEnum;
21
21
  protected _activationTrigger: ActionActivationTriggerEnum;
22
22
  protected _position: ActionPositionEnum;
@@ -73,6 +73,7 @@ export declare class ActionDescriptor<T> {
73
73
  get hasItemsSelection(): boolean;
74
74
  get button(): ActionButtonDescriptor;
75
75
  get positionTableviewCategories(): string[] | undefined;
76
+ protected setI18nModelActionBaseKey(base?: string): void;
76
77
  withDataProvider(dataProvider: IDataProvider<T, any>): this;
77
78
  withServiceType<S>(serviceType: Type<S>): this;
78
79
  withRunFunction<S>(fn: (ctx: ActionContext<T, S>) => Observable<T | undefined | null>): this;
@@ -99,9 +100,10 @@ export declare class ActionDescriptor<T> {
99
100
  withButton(label?: string | null, icon?: string | null, styleLevel?: StyleLevelEnum, styleText?: boolean): this;
100
101
  withItemsSelection(hasSelection?: boolean): this;
101
102
  withPositionTableviewCategories(positionTableviewCategories: string[]): this;
103
+ withI18nBase(base: ClassType<unknown> | string): this;
102
104
  }
103
105
  export declare class ActionSimpleDescriptor<T> extends ActionDescriptor<T> {
104
- constructor(actionName: string, modelType?: ClassType<T>, idProperty?: string, titleProperty?: string);
106
+ constructor(actionName: string, modelType?: ClassType<T>, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<unknown>);
105
107
  }
106
108
  export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
107
109
  private readonly _editorDescriptor;
@@ -14,7 +14,7 @@ export declare class EditorDescriptor<T> {
14
14
  protected _currentTabGroup?: FieldTabGroupDescriptor<T>;
15
15
  protected _currentGroup?: FieldGroupDescriptor<T>;
16
16
  protected _disabled: boolean;
17
- constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?: TableviewEditorTypeEnum);
17
+ constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?: TableviewEditorTypeEnum, i18nBaseKey?: string | ClassType<unknown>);
18
18
  /**
19
19
  * auto generated editor descriptor based on openapi definition
20
20
  * generates all fields from definition
@@ -2,14 +2,17 @@ import { ClassType } from '../types';
2
2
  export declare class ModelDescriptor<T> {
3
3
  private readonly _type;
4
4
  private readonly _typeName;
5
+ private _i18nBaseKey;
5
6
  private _idPropertyName?;
6
7
  private _titlePropertyName?;
7
- constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
8
+ constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<unknown>);
8
9
  get type(): ClassType<T>;
9
10
  get typeName(): string;
11
+ get i18nBaseKey(): string;
10
12
  get idPropertyName(): string | undefined;
11
13
  get titlePropertyName(): string | undefined;
12
14
  withIdPropertyName(idProperty: string): this;
13
15
  withTitlePropertyName(titleProperty: string): this;
16
+ withI18nBase(base: ClassType<T> | string): this;
14
17
  copy(): ModelDescriptor<T>;
15
18
  }
@@ -31,7 +31,7 @@ export declare class TableDescriptor<T> {
31
31
  private _rowClassName?;
32
32
  private _rowClassNameMapFn?;
33
33
  private _autoGenerated;
34
- constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
34
+ constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<unknown>);
35
35
  /**
36
36
  * generates descriptor based on modelType attribute definition
37
37
  * @param modelType class type
@@ -14,7 +14,7 @@ export declare class TableviewDescriptor<T> {
14
14
  protected _addEditor: EditorDescriptor<T>;
15
15
  protected _editEditor: EditorDescriptor<T>;
16
16
  protected _tableTitle?: string;
17
- constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
17
+ constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, i18nBaseKey?: string | ClassType<unknown>);
18
18
  /**
19
19
  * generates descriptor from attribute definition of openaapi model
20
20
  * @param modelType class type
@@ -1,4 +1,4 @@
1
- export declare const typeNameDecoratorPropertyName = "typeName";
2
1
  export declare function TypeName(typeName: string): ClassDecorator;
3
- export declare const enumNameDecoratorPropertyName = "enumName";
2
+ export declare function IdProperty(): PropertyDecorator;
3
+ export declare function TitleProperty(): PropertyDecorator;
4
4
  export declare function EnumName(typeName: string): ClassDecorator;
@@ -1,12 +1,16 @@
1
1
  import 'reflect-metadata';
2
2
  import { ClassType, EnumType } from '../types';
3
3
  export declare class TypeUtil {
4
+ static readonly reflectTypeNameKey = "typeName";
5
+ static readonly reflectTypeIdPropertyKey = "typeIdProperty";
6
+ static readonly reflectTypeTitlePropertyKey = "typeTitleProperty";
7
+ static readonly reflectEnumNameKey = "enumName";
4
8
  /**
5
9
  * Defines type name decorator.
6
10
  * @param targetType class.
7
11
  * @param typeName Name of the type.
8
12
  */
9
- static defineReflectTypeName(targetType: ClassType<any>, typeName?: string): void;
13
+ static defineReflectTypeName(targetType: ClassType<any>, typeName: string): void;
10
14
  /**
11
15
  * Defines enum name decorator.
12
16
  * @param targetType enum object.
@@ -14,23 +18,40 @@ export declare class TypeUtil {
14
18
  */
15
19
  static defineReflectEnumName(targetType: EnumType, enumName: string): void;
16
20
  /**
17
- * Gets type name from either decorator or reflect metadata.
21
+ * Defines type's id property.
22
+ * @param targetType class.
23
+ * @param typeName Name of the type.
24
+ */
25
+ static defineReflectTypeIdProperty(targetType: ClassType<any>, idProperty: string | symbol): void;
26
+ /**
27
+ * Defines type's id property.
28
+ * @param targetType class.
29
+ * @param typeName Name of the type.
30
+ */
31
+ static defineReflectTypeTitleProperty(targetType: ClassType<any>, titleProperty: string | symbol): void;
32
+ /**
33
+ * Gets type name from reflect metadata.
18
34
  * @param type Class.
19
35
  */
20
36
  static findTypeName(type: ClassType<any>): string;
37
+ /**
38
+ * Gets type name from either decorator or reflect metadata.
39
+ * @param type Class.
40
+ */
41
+ static typeNameExists(type: ClassType<any>): boolean;
21
42
  /**
22
43
  * Gets enum name from either decorator or reflect metadata.
23
44
  * @param enumType Class.
24
45
  */
25
46
  static findEnumName(enumType: EnumType): string;
26
47
  /**
27
- * Get value from decorator defined property name
48
+ * Gets type's id property from reflect metadata.
28
49
  * @param type Class.
29
50
  */
30
- static getDecoratorTypeName(type: Function): string | undefined;
51
+ static findTypeIdProperty(type: ClassType<any>): string;
31
52
  /**
32
- * Get value from decorator defined property name
33
- * @param type Enum object.
53
+ * Gets type's title property from reflect metadata.
54
+ * @param type Class.
34
55
  */
35
- static getDecoratorEnumName(type: EnumType): string | undefined;
56
+ static findTypeTitleProperty(type: ClassType<any>): string;
36
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.1.0",
6
6
  "@angular/core": "^14.1.0",
@@ -34,6 +34,7 @@
34
34
  &.mng-dialog-sm {
35
35
  width: 50vw;
36
36
  height: initial;
37
+ max-height: 90vh;
37
38
 
38
39
  @include mediaMaxLg() {
39
40
  width: 70vw;
@@ -56,13 +57,23 @@
56
57
  width: 70vw;
57
58
  }
58
59
  }
59
- }
60
60
 
61
- &.mng-formly-field-lookup-dialog {
62
- width: 450px;
61
+ &.mng-formly-field-lookup-dialog {
62
+ width: 95vw;
63
+ height: initial;
64
+ max-height: 90vh;
65
+
66
+ @include mediaMinSm() {
67
+ width: 90vw;
68
+ }
69
+
70
+ @include mediaMinMd() {
71
+ width: 80vw;
72
+ }
63
73
 
64
- @include mediaMaxXs() {
65
- width: 80%;
74
+ @include mediaMinLg() {
75
+ width: 70vw;
76
+ }
66
77
  }
67
78
  }
68
79
  }
package/version-info.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.17.0",
4
- "tag": "v0.17.0",
3
+ "version": "0.17.2",
4
+ "tag": "v0.17.2",
5
5
  "distance": 0,
6
- "hash": "32392869",
6
+ "hash": "c0561ddc",
7
7
  "dirty": false,
8
- "semver": "0.17.0",
9
- "raw": "v0.17.0-32392869"
8
+ "semver": "0.17.2",
9
+ "raw": "v0.17.2-c0561ddc"
10
10
  }