@onecx/angular-accelerator 5.51.0 → 5.52.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/assets/i18n/de.json +6 -6
- package/assets/i18n/en.json +6 -6
- package/assets/i18n/storybook-translations/page-header/de.json +13 -0
- package/assets/i18n/storybook-translations/page-header/en.json +13 -0
- package/esm2022/index.mjs +2 -1
- package/esm2022/lib/angular-accelerator-primeng.module.mjs +4 -4
- package/esm2022/lib/angular-accelerator.module.mjs +6 -6
- package/esm2022/lib/components/column-group-selection/column-group-selection.component.mjs +3 -3
- package/esm2022/lib/components/custom-group-column-selector/custom-group-column-selector.component.mjs +3 -3
- package/esm2022/lib/components/data-layout-selection/data-layout-selection.component.mjs +3 -3
- package/esm2022/lib/components/data-list-grid/data-list-grid.component.mjs +3 -3
- package/esm2022/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.mjs +10 -6
- package/esm2022/lib/components/data-loading-error/data-loading-error.component.mjs +3 -3
- package/esm2022/lib/components/data-table/data-table.component.mjs +6 -8
- package/esm2022/lib/components/data-view/data-view.component.mjs +3 -3
- package/esm2022/lib/components/diagram/diagram.component.mjs +3 -3
- package/esm2022/lib/components/filter-view/filter-view.component.mjs +3 -3
- package/esm2022/lib/components/group-by-count-diagram/group-by-count-diagram.component.mjs +3 -3
- package/esm2022/lib/components/interactive-data-view/interactive-data-view.component.mjs +3 -3
- package/esm2022/lib/components/page-header/page-header.component.mjs +25 -5
- package/esm2022/lib/components/search-header/search-header.component.mjs +5 -5
- package/esm2022/lib/directives/advanced.directive.mjs +3 -3
- package/esm2022/lib/directives/if-breakpoint.directive.mjs +3 -3
- package/esm2022/lib/directives/if-permission.directive.mjs +3 -3
- package/esm2022/lib/directives/src.directive.mjs +3 -3
- package/esm2022/lib/directives/tooltipOnOverflow.directive.mjs +3 -3
- package/esm2022/lib/model/translation.model.mjs +2 -0
- package/esm2022/lib/pipes/dynamic.pipe.mjs +3 -3
- package/esm2022/lib/pipes/ocxtimeago.pipe.mjs +3 -3
- package/esm2022/lib/services/breadcrumb.service.mjs +18 -6
- package/esm2022/lib/services/translation-cache.service.mjs +12 -6
- package/esm2022/lib/utils/dateutils.mjs +3 -3
- package/esm2022/testing/page-header.harness.mjs +26 -2
- package/fesm2022/onecx-angular-accelerator-testing.mjs +25 -1
- package/fesm2022/onecx-angular-accelerator-testing.mjs.map +1 -1
- package/fesm2022/onecx-angular-accelerator.mjs +133 -93
- package/fesm2022/onecx-angular-accelerator.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/components/page-header/page-header.component.d.ts +21 -2
- package/lib/model/translation.model.d.ts +31 -0
- package/lib/services/breadcrumb.service.d.ts +9 -4
- package/lib/services/translation-cache.service.d.ts +8 -1
- package/package.json +11 -7
- package/testing/page-header.harness.d.ts +5 -1
package/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from './lib/model/data-table-column.model';
|
|
|
30
30
|
export * from './lib/model/diagram-column';
|
|
31
31
|
export * from './lib/model/diagram-type';
|
|
32
32
|
export * from './lib/model/filter.model';
|
|
33
|
+
export * from './lib/model/translation.model';
|
|
33
34
|
export * from './lib/angular-accelerator.module';
|
|
34
35
|
export * from './lib/angular-accelerator-primeng.module';
|
|
35
36
|
export * from './lib/functions/flatten-object';
|
|
@@ -7,6 +7,7 @@ import { UserService } from '@onecx/angular-integration-interface';
|
|
|
7
7
|
import { BreadcrumbService } from '../../services/breadcrumb.service';
|
|
8
8
|
import { PrimeIcon } from '../../utils/primeicon.utils';
|
|
9
9
|
import { HasPermissionChecker } from '@onecx/angular-utils';
|
|
10
|
+
import { TranslationKey } from '../../model/translation.model';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
/**
|
|
12
13
|
* Action definition.
|
|
@@ -51,9 +52,12 @@ export interface ObjectDetailItem {
|
|
|
51
52
|
valueCssClass?: string;
|
|
52
53
|
actionItemIcon?: PrimeIcon;
|
|
53
54
|
actionItemCallback?: () => void;
|
|
54
|
-
actionItemTooltip?: string;
|
|
55
|
-
actionItemAriaLabelKey?: string;
|
|
56
55
|
actionItemAriaLabel?: string;
|
|
56
|
+
actionItemAriaLabelKey?: TranslationKey;
|
|
57
|
+
actionItemTooltip?: string;
|
|
58
|
+
actionItemTooltipKey?: TranslationKey;
|
|
59
|
+
labelTooltipKey?: TranslationKey;
|
|
60
|
+
valueTooltipKey?: TranslationKey;
|
|
57
61
|
}
|
|
58
62
|
export interface HomeItem {
|
|
59
63
|
menuItem: MenuItem;
|
|
@@ -108,6 +112,21 @@ export declare class PageHeaderComponent implements OnInit {
|
|
|
108
112
|
private filterActionsBasedOnPermissions;
|
|
109
113
|
private getActionTranslationKeys;
|
|
110
114
|
private mapOverflowActionsToMenuItems;
|
|
115
|
+
/**
|
|
116
|
+
* Helper to extract translation key and parameters from a string or object.
|
|
117
|
+
* @param input - Can be a string or an object with 'key' and 'parameters'.
|
|
118
|
+
* @returns An object with { key, params } for use in translation pipes or services. The returned key is always a string (never undefined).
|
|
119
|
+
*
|
|
120
|
+
* Example usage in template:
|
|
121
|
+
* let result = extractKeyAndParams(item.labelTooltipKey);
|
|
122
|
+
* result.key | translate : result.params
|
|
123
|
+
*
|
|
124
|
+
* .key will always be a string, so you do not need to use `?? ''` in the template.
|
|
125
|
+
*/
|
|
126
|
+
extractKeyAndParams(input: any): {
|
|
127
|
+
key: string;
|
|
128
|
+
params: any;
|
|
129
|
+
};
|
|
111
130
|
static ɵfac: i0.ɵɵFactoryDeclaration<PageHeaderComponent, never>;
|
|
112
131
|
static ɵcmp: i0.ɵɵComponentDeclaration<PageHeaderComponent, "ocx-page-header", never, { "header": { "alias": "header"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "figureBackground": { "alias": "figureBackground"; "required": false; }; "showFigure": { "alias": "showFigure"; "required": false; }; "figureImage": { "alias": "figureImage"; "required": false; }; "disableDefaultActions": { "alias": "disableDefaultActions"; "required": false; }; "subheader": { "alias": "subheader"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "objectDetails": { "alias": "objectDetails"; "required": false; }; "showBreadcrumbs": { "alias": "showBreadcrumbs"; "required": false; }; "manualBreadcrumbs": { "alias": "manualBreadcrumbs"; "required": false; }; "enableGridView": { "alias": "enableGridView"; "required": false; }; "gridLayoutDesktopColumns": { "alias": "gridLayoutDesktopColumns"; "required": false; }; }, { "save": "save"; }, ["additionalToolbarContent", "additionalToolbarContentLeft"], ["[figureImage]", "[toolbarItems]", "*"], false, never>;
|
|
113
132
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object containing key for translation with parameters object for translation
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ## Assume such translation is in the translation file
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const translations = {
|
|
8
|
+
* MY_KEY = 'text with parameter value = {{value}}',
|
|
9
|
+
* }
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* ## TranslationKeyWithParameters declaration
|
|
13
|
+
* ```
|
|
14
|
+
* // will be translated into
|
|
15
|
+
* // text with parameter value = hello
|
|
16
|
+
* const myKey: TranslationKeyWithParameters = {
|
|
17
|
+
* key: 'MY_KEY',
|
|
18
|
+
* parameters: {
|
|
19
|
+
* value: 'hello',
|
|
20
|
+
* },
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export type TranslationKeyWithParameters = {
|
|
25
|
+
key: string;
|
|
26
|
+
parameters?: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* String with key to translation or {@link TranslationKeyWithParameters} object. If provided string cannot be translated it will be displayed as is.
|
|
30
|
+
*/
|
|
31
|
+
export type TranslationKey = string | TranslationKeyWithParameters;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
2
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
5
|
import { MenuItem } from 'primeng/api';
|
|
5
6
|
import { BreadCrumbMenuItem } from '../model/breadcrumb-menu-item.model';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class BreadcrumbService {
|
|
8
|
+
export declare class BreadcrumbService implements OnDestroy {
|
|
8
9
|
private router;
|
|
9
10
|
private activeRoute;
|
|
10
11
|
private translateService;
|
|
11
|
-
private
|
|
12
|
+
private _itemSource$;
|
|
13
|
+
private get itemsSource$();
|
|
14
|
+
private set itemsSource$(value);
|
|
12
15
|
generatedItemsSource: BehaviorSubject<MenuItem[]>;
|
|
13
|
-
|
|
16
|
+
_itemsHandler: Observable<MenuItem[]> | undefined;
|
|
17
|
+
get itemsHandler(): Observable<MenuItem[]>;
|
|
14
18
|
constructor(router: Router, activeRoute: ActivatedRoute, translateService: TranslateService);
|
|
19
|
+
ngOnDestroy(): void;
|
|
15
20
|
private generateBreadcrumbs;
|
|
16
21
|
private addBreadcrumb;
|
|
17
22
|
private createBreadcrumb;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { SyncableTopic } from '@onecx/accelerator';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
declare class TranslationCacheTopic extends SyncableTopic<string> {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
4
8
|
declare global {
|
|
5
9
|
interface Window {
|
|
6
10
|
onecxTranslations: Record<string, any>;
|
|
@@ -10,10 +14,13 @@ declare global {
|
|
|
10
14
|
* @deprecated Please import from `@onecx/angular-utils` instead.
|
|
11
15
|
*/
|
|
12
16
|
export declare class TranslationCacheService implements OnDestroy {
|
|
13
|
-
private
|
|
17
|
+
private _translationTopic$;
|
|
18
|
+
get translationTopic$(): TranslationCacheTopic;
|
|
19
|
+
set translationTopic$(topic: TranslationCacheTopic);
|
|
14
20
|
constructor();
|
|
15
21
|
ngOnDestroy(): void;
|
|
16
22
|
getTranslationFile(url: string, cacheMissFunction: () => Observable<any>): Observable<any>;
|
|
17
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationCacheService, never>;
|
|
18
24
|
static ɵprov: i0.ɵɵInjectableDeclaration<TranslationCacheService>;
|
|
19
25
|
}
|
|
26
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/angular-accelerator",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.52.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/onecx/onecx-portal-ui-libs"
|
|
8
|
+
},
|
|
5
9
|
"peerDependencies": {
|
|
6
10
|
"@angular/common": "^18.0.5",
|
|
7
11
|
"@angular/core": "^18.0.5",
|
|
@@ -12,12 +16,12 @@
|
|
|
12
16
|
"@ngx-translate/core": "^15.0.0",
|
|
13
17
|
"@ngx-translate/http-loader": "^8.0.0",
|
|
14
18
|
"@ngneat/until-destroy": "^10.0.0",
|
|
15
|
-
"@onecx/integration-interface": "^5.
|
|
16
|
-
"@onecx/accelerator": "^5.
|
|
17
|
-
"@onecx/angular-integration-interface": "^5.
|
|
18
|
-
"@onecx/angular-remote-components": "^5.
|
|
19
|
-
"@onecx/angular-testing": "^5.
|
|
20
|
-
"@onecx/angular-utils": "^5.
|
|
19
|
+
"@onecx/integration-interface": "^5.52.0",
|
|
20
|
+
"@onecx/accelerator": "^5.52.0",
|
|
21
|
+
"@onecx/angular-integration-interface": "^5.52.0",
|
|
22
|
+
"@onecx/angular-remote-components": "^5.52.0",
|
|
23
|
+
"@onecx/angular-testing": "^5.52.0",
|
|
24
|
+
"@onecx/angular-utils": "^5.52.0",
|
|
21
25
|
"chart.js": "^4.4.3",
|
|
22
26
|
"d3-scale-chromatic": "^3.1.0",
|
|
23
27
|
"rxjs": "~7.8.1",
|
|
@@ -22,7 +22,7 @@ export declare class PageHeaderHarness extends ComponentHarness {
|
|
|
22
22
|
interface ObjectDetailItemHarnessFilters extends BaseHarnessFilters {
|
|
23
23
|
label?: string;
|
|
24
24
|
}
|
|
25
|
-
declare class ObjectDetailItemHarness extends ComponentHarness {
|
|
25
|
+
export declare class ObjectDetailItemHarness extends ComponentHarness {
|
|
26
26
|
static hostSelector: string;
|
|
27
27
|
getLabelElement: import("@onecx/angular-testing").AsyncFactoryFn<import("@onecx/angular-testing").TestElement>;
|
|
28
28
|
getValueElement: import("@onecx/angular-testing").AsyncFactoryFn<import("@onecx/angular-testing").TestElement | null>;
|
|
@@ -32,5 +32,9 @@ declare class ObjectDetailItemHarness extends ComponentHarness {
|
|
|
32
32
|
getValue(): Promise<string | undefined>;
|
|
33
33
|
getValueStyles(): Promise<string | null | undefined>;
|
|
34
34
|
getIcon(): Promise<string | null | undefined>;
|
|
35
|
+
getLabelTooltipContent(): Promise<string | null>;
|
|
36
|
+
getValueTooltipContent(): Promise<string | null>;
|
|
37
|
+
getActionItemTooltipContent(): Promise<string | null>;
|
|
38
|
+
private getTooltipFromElement;
|
|
35
39
|
}
|
|
36
40
|
export {};
|