@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.
@@ -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 { SlideMenu } from 'primeng/slidemenu';
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?: SlideMenu;
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';
@@ -1,2 +1,3 @@
1
1
  export * from './type.decorator';
2
2
  export * from './type.model';
3
+ export * from './i18n.type';
@@ -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
- static get(translate: TranslateService, action: ActionDescriptor<any>, actionPathKeys: string | Array<string>, customKey?: string, item?: any, fallbackKey?: string, params?: any): string | null;
45
- static getAsync(translate: TranslateService, action: ActionDescriptor<any>, actionPathKeys: string | Array<string>, customKey?: string, item?: any, fallbackKey?: string, params?: any): Observable<string | null>;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "2.0.0-rc.1-b808fba6",
3
+ "version": "2.0.0-rc.1-e41a1d28",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "~15.2.1",
6
6
  "@angular/core": "~15.2.1",
@@ -75,7 +75,7 @@
75
75
  @import './components/menu/_menu';
76
76
  // @import './components/menu/_menubar';
77
77
  // @import './components/menu/_panelmenu';
78
- @import './components/menu/_slidemenu';
78
+ //@import './components/menu/_slidemenu';
79
79
  @import './components/menu/_steps';
80
80
  // @import './components/menu/_tabmenu';
81
81
  //@import './components/menu/_tieredmenu';
@@ -9,7 +9,7 @@
9
9
  // @import './_fieldset';
10
10
  // @import './_galleria';
11
11
  // @import './_megamenu';
12
- // @import './_menu';
12
+ @import './_menu';
13
13
  // @import './_menubar';
14
14
  // @import './_orderlist';
15
15
  @import './_paginator';
@@ -5,6 +5,6 @@
5
5
  }
6
6
  }
7
7
 
8
- .p-slidemenu {
8
+ .p-menu {
9
9
  width: auto !important;
10
10
  }
@@ -0,0 +1,5 @@
1
+ .p-menu {
2
+ &.mng-action-menu.p-menu-overlay {
3
+ border: $menuBorder;
4
+ }
5
+ }
@@ -10,6 +10,7 @@
10
10
  @import './_theme_autocomplete';
11
11
  @import './_theme_image';
12
12
  @import './theme_toast';
13
+ @import './theme_menu';
13
14
 
14
15
  .p-tabview-title-error {
15
16
  color: $errorColor !important;
package/version-info.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "2.0.0-rc.1-b808fba6",
3
+ "version": "2.0.0-rc.1-e41a1d28",
4
4
  "tag": "v1.4.0-rc.0",
5
- "distance": 27,
6
- "hash": "b808fba6",
5
+ "distance": 29,
6
+ "hash": "e41a1d28",
7
7
  "dirty": true,
8
- "semver": "1.4.0-rc.0+27.gb808fba6.dirty",
9
- "raw": "v1.4.0-rc.0-27-b808fba6-dirty"
8
+ "semver": "1.4.0-rc.0+29.ge41a1d28.dirty",
9
+ "raw": "v1.4.0-rc.0-29-e41a1d28-dirty"
10
10
  }