@mediusinc/mng-commons 2.0.0-rc.1-b808fba6 → 2.0.0-rc.1-e41a1d28
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/components/action/action.component.mjs +10 -8
- package/esm2020/lib/router/routes-builder.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +2 -2
- package/esm2020/lib/types/i18n.type.mjs +2 -0
- package/esm2020/lib/types/index.mjs +2 -1
- package/esm2020/lib/utils/i18n.util.mjs +49 -6
- package/fesm2015/mediusinc-mng-commons.mjs +57 -11
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +57 -11
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/action.component.d.ts +2 -2
- package/lib/types/i18n.type.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/i18n.util.d.ts +31 -2
- package/package.json +1 -1
- package/scss/common/theme/designer/_components.scss +1 -1
- package/scss/common/theme/extensions/_vendor_extensions.scss +1 -1
- package/scss/mng-overrides/_layout_menu.scss +1 -1
- package/scss/mng-overrides/_theme_menu.scss +5 -0
- package/scss/mng-overrides/_theme_styles.scss +1 -0
- package/version-info.json +5 -5
|
@@ -2,7 +2,7 @@ import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angu
|
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
4
|
import { ConfirmationService, MenuItem } from 'primeng/api';
|
|
5
|
-
import {
|
|
5
|
+
import { Menu } from 'primeng/menu';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
7
|
import { MediusQueryParam } from '../../api/models';
|
|
8
8
|
import { IDataProvider } from '../../data-providers';
|
|
@@ -36,7 +36,7 @@ export declare class MngActionComponent<T, S> implements OnInit, OnChanges, OnDe
|
|
|
36
36
|
viewContainerInit?: IViewContainer<T, S>;
|
|
37
37
|
selectedItems: Array<T>;
|
|
38
38
|
finishEventEmitter: EventEmitter<ActionInstance<T, S>>;
|
|
39
|
-
subactionsMenu?:
|
|
39
|
+
subactionsMenu?: Menu;
|
|
40
40
|
private loadingSubject;
|
|
41
41
|
$loading: Observable<boolean>;
|
|
42
42
|
cmpId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type I18nType = 'returnNull' | 'returnFallbackKey' | 'returnFirstKey';
|
package/lib/types/index.d.ts
CHANGED
package/lib/utils/i18n.util.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ModelDescriptor } from '../descriptors';
|
|
|
4
4
|
import { ActionDescriptor, ActionEditorDescriptor } from '../descriptors/action';
|
|
5
5
|
import { MngError } from '../models';
|
|
6
6
|
import { ClassType } from '../types';
|
|
7
|
+
import { I18nType } from '../types/i18n.type';
|
|
7
8
|
export declare namespace I18nUtils {
|
|
8
9
|
class Common {
|
|
9
10
|
static getAsync(translate: TranslateService, params?: any, ...keys: Array<string>): Observable<string | null>;
|
|
@@ -41,8 +42,36 @@ export declare namespace I18nUtils {
|
|
|
41
42
|
private static getKeysByPriority;
|
|
42
43
|
}
|
|
43
44
|
class Action {
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Returns translation for action with given keys and params
|
|
47
|
+
* @param translate TranslateService
|
|
48
|
+
* @param action action descriptor
|
|
49
|
+
* @param actionPathKeys action path keys
|
|
50
|
+
* @param customKey custom key
|
|
51
|
+
* @param item
|
|
52
|
+
* @param fallbackKey fallback key
|
|
53
|
+
* @param params additional params for translation
|
|
54
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
55
|
+
*/
|
|
56
|
+
static get(translate: TranslateService, action: ActionDescriptor<any>, actionPathKeys: string | Array<string>, customKey?: string, item?: any, fallbackKey?: string, params?: any, missingTranslationStrategy?: I18nType): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Returns async translation for given keys with given params.
|
|
59
|
+
* @param translate TranslateService
|
|
60
|
+
* @param action action descriptor
|
|
61
|
+
* @param actionPathKeys action path keys
|
|
62
|
+
* @param customKey custom key
|
|
63
|
+
* @param item item
|
|
64
|
+
* @param fallbackKey fallback key, used as fallback key
|
|
65
|
+
* @param params additional params for translation
|
|
66
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
67
|
+
*/
|
|
68
|
+
static getAsync(translate: TranslateService, action: ActionDescriptor<any>, actionPathKeys: string | Array<string>, customKey?: string, item?: any, fallbackKey?: string, params?: any, missingTranslationStrategy?: I18nType): Observable<string | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns translation depending on missingTranslationStrategy
|
|
71
|
+
* @param missingTranslationStrategy strategy when no translation is found
|
|
72
|
+
* @param values object with values, i18nValue is translation, firstKey is first key in array of keys, fallbackKey is fallback key
|
|
73
|
+
*/
|
|
74
|
+
private static getTranslationDependingOnStrategy;
|
|
46
75
|
static getTitleAsync(translate: TranslateService, action: ActionDescriptor<any>, item?: any): Observable<string | null>;
|
|
47
76
|
static getEditorTitleAsync(translate: TranslateService, action: ActionEditorDescriptor<any>, item?: any): Observable<string | null>;
|
|
48
77
|
static getParams(translate: TranslateService, action: ActionDescriptor<any>, item?: any, params?: any): any;
|
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
@import './components/menu/_menu';
|
|
76
76
|
// @import './components/menu/_menubar';
|
|
77
77
|
// @import './components/menu/_panelmenu';
|
|
78
|
-
|
|
78
|
+
//@import './components/menu/_slidemenu';
|
|
79
79
|
@import './components/menu/_steps';
|
|
80
80
|
// @import './components/menu/_tabmenu';
|
|
81
81
|
//@import './components/menu/_tieredmenu';
|
package/version-info.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediusinc/mng-commons",
|
|
3
|
-
"version": "2.0.0-rc.1-
|
|
3
|
+
"version": "2.0.0-rc.1-e41a1d28",
|
|
4
4
|
"tag": "v1.4.0-rc.0",
|
|
5
|
-
"distance":
|
|
6
|
-
"hash": "
|
|
5
|
+
"distance": 29,
|
|
6
|
+
"hash": "e41a1d28",
|
|
7
7
|
"dirty": true,
|
|
8
|
-
"semver": "1.4.0-rc.0+
|
|
9
|
-
"raw": "v1.4.0-rc.0-
|
|
8
|
+
"semver": "1.4.0-rc.0+29.ge41a1d28.dirty",
|
|
9
|
+
"raw": "v1.4.0-rc.0-29-e41a1d28-dirty"
|
|
10
10
|
}
|