@onecx/angular-accelerator 6.10.0 → 6.11.1
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/fesm2022/onecx-angular-accelerator-testing.mjs +25 -1
- package/fesm2022/onecx-angular-accelerator-testing.mjs.map +1 -1
- package/fesm2022/onecx-angular-accelerator.mjs +46 -19
- package/fesm2022/onecx-angular-accelerator.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/components/data-table/data-table.component.d.ts +4 -1
- package/lib/components/page-header/page-header.component.d.ts +15 -2
- package/lib/model/translation.model.d.ts +31 -0
- package/lib/services/portal-dialog.service.d.ts +1 -31
- package/package.json +12 -8
- package/testing/page-header.harness.d.ts +6 -2
package/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './lib/model/breadcrumb-menu-item.model';
|
|
|
40
40
|
export * from './lib/model/column-type.model';
|
|
41
41
|
export * from './lib/model/data-action';
|
|
42
42
|
export * from './lib/model/button-dialog';
|
|
43
|
+
export * from './lib/model/translation.model';
|
|
43
44
|
export * from './lib/model/data-sort-direction';
|
|
44
45
|
export * from './lib/model/data-table-column.model';
|
|
45
46
|
export * from './lib/model/diagram-column';
|
|
@@ -86,7 +86,9 @@ export declare class DataTableComponent extends DataSortBase implements OnInit,
|
|
|
86
86
|
selectionEnabledField: string | undefined;
|
|
87
87
|
allowSelectAll: boolean;
|
|
88
88
|
paginator: boolean;
|
|
89
|
-
|
|
89
|
+
_page$: BehaviorSubject<number>;
|
|
90
|
+
get page(): number;
|
|
91
|
+
set page(value: number);
|
|
90
92
|
tableStyle: {
|
|
91
93
|
[klass: string]: any;
|
|
92
94
|
} | undefined;
|
|
@@ -198,6 +200,7 @@ export declare class DataTableComponent extends DataSortBase implements OnInit,
|
|
|
198
200
|
isRowSelectionDisabled(rowObject: Row): boolean;
|
|
199
201
|
rowSelectable(event: any): boolean;
|
|
200
202
|
onSelectionChange(selection: Row[]): void;
|
|
203
|
+
emitSelectionChanged(): void;
|
|
201
204
|
mergeWithDisabledKeys(newSelectionIds: (string | number)[], disabledRowIds: (string | number)[]): (string | number)[];
|
|
202
205
|
isSelected(row: Row): boolean;
|
|
203
206
|
onPageChange(event: any): void;
|
|
@@ -3,6 +3,7 @@ import { MenuItem } from 'primeng/api';
|
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { BreadcrumbService } from '../../services/breadcrumb.service';
|
|
5
5
|
import { PrimeIcon } from '../../utils/primeicon.utils';
|
|
6
|
+
import { TranslationKey } from '../../model/translation.model';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* Action definition.
|
|
@@ -43,9 +44,12 @@ export interface ObjectDetailItem {
|
|
|
43
44
|
valueCssClass?: string;
|
|
44
45
|
actionItemIcon?: PrimeIcon;
|
|
45
46
|
actionItemCallback?: () => void;
|
|
46
|
-
actionItemTooltip?: string;
|
|
47
|
-
actionItemAriaLabelKey?: string;
|
|
48
47
|
actionItemAriaLabel?: string;
|
|
48
|
+
actionItemAriaLabelKey?: TranslationKey;
|
|
49
|
+
actionItemTooltip?: string;
|
|
50
|
+
actionItemTooltipKey?: TranslationKey;
|
|
51
|
+
labelTooltipKey?: TranslationKey;
|
|
52
|
+
valueTooltipKey?: TranslationKey;
|
|
49
53
|
}
|
|
50
54
|
export interface HomeItem {
|
|
51
55
|
menuItem: MenuItem;
|
|
@@ -100,6 +104,15 @@ export declare class PageHeaderComponent implements OnInit {
|
|
|
100
104
|
private filterActionsBasedOnPermissions;
|
|
101
105
|
private getActionTranslationKeys;
|
|
102
106
|
private mapOverflowActionsToMenuItems;
|
|
107
|
+
/**
|
|
108
|
+
* Helper to extract translation key and parameters from a string or object.
|
|
109
|
+
* @param input - Can be a string or an object with 'key' and 'parameters'.
|
|
110
|
+
* @returns An object with { key, params } for use in translation pipes or services. The returned key is always a string (never undefined).
|
|
111
|
+
*/
|
|
112
|
+
extractKeyAndParams(input: any): {
|
|
113
|
+
key: string;
|
|
114
|
+
params: any;
|
|
115
|
+
};
|
|
103
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<PageHeaderComponent, never>;
|
|
104
117
|
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>;
|
|
105
118
|
}
|
|
@@ -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;
|
|
@@ -3,38 +3,8 @@ import { DialogService } from 'primeng/dynamicdialog';
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ButtonDialogButtonDetails, ButtonDialogCustomButtonDetails } from '../model/button-dialog';
|
|
5
5
|
import { PrimeIcon } from '../utils/primeicon.utils';
|
|
6
|
+
import { TranslationKey } from '../model/translation.model';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Object containing key for translation with parameters object for translation
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ## Assume such translation is in the translation file
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const translations = {
|
|
14
|
-
* MY_KEY = 'text with parameter value = {{value}}',
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* ## TranslationKeyWithParameters declaration
|
|
19
|
-
* ```
|
|
20
|
-
* // will be translated into
|
|
21
|
-
* // text with parameter value = hello
|
|
22
|
-
* const myKey: TranslationKeyWithParameters = {
|
|
23
|
-
* key: 'MY_KEY',
|
|
24
|
-
* parameters: {
|
|
25
|
-
* value: 'hello',
|
|
26
|
-
* },
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
type TranslationKeyWithParameters = {
|
|
31
|
-
key: string;
|
|
32
|
-
parameters: Record<string, unknown>;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* String with key to translation or {@link TranslationKeyWithParameters} object. If provided string cannot be translated it will be displayed as is.
|
|
36
|
-
*/
|
|
37
|
-
type TranslationKey = string | TranslationKeyWithParameters;
|
|
38
8
|
/**
|
|
39
9
|
* Object containing message of type {@link TranslationKey} and icon to be displayed along the message.
|
|
40
10
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/angular-accelerator",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.1",
|
|
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": "^19.0.0",
|
|
7
11
|
"@angular/core": "^19.0.0",
|
|
@@ -12,19 +16,19 @@
|
|
|
12
16
|
"@ngx-translate/core": "^16.0.0",
|
|
13
17
|
"@ngx-translate/http-loader": "^8.0.0",
|
|
14
18
|
"@ngneat/until-destroy": "^10.0.0",
|
|
15
|
-
"@onecx/integration-interface": "^6.
|
|
16
|
-
"@onecx/accelerator": "^6.
|
|
17
|
-
"@onecx/angular-integration-interface": "^6.
|
|
18
|
-
"@onecx/angular-remote-components": "^6.
|
|
19
|
-
"@onecx/angular-testing": "^6.
|
|
20
|
-
"@onecx/angular-utils": "^6.
|
|
19
|
+
"@onecx/integration-interface": "^6.11.1",
|
|
20
|
+
"@onecx/accelerator": "^6.11.1",
|
|
21
|
+
"@onecx/angular-integration-interface": "^6.11.1",
|
|
22
|
+
"@onecx/angular-remote-components": "^6.11.1",
|
|
23
|
+
"@onecx/angular-testing": "^6.11.1",
|
|
24
|
+
"@onecx/angular-utils": "^6.11.1",
|
|
21
25
|
"chart.js": "^4.4.3",
|
|
22
26
|
"d3-scale-chromatic": "^3.1.0",
|
|
23
27
|
"rxjs": "~7.8.1",
|
|
24
28
|
"primeng": "^19.0.0",
|
|
25
29
|
"@storybook/angular": "^8.3.2",
|
|
26
30
|
"@nx/devkit": "^20.3.0",
|
|
27
|
-
"@onecx/nx-migration-utils": "^6.
|
|
31
|
+
"@onecx/nx-migration-utils": "^6.11.1",
|
|
28
32
|
"@primeng/themes": "^19.0.0"
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
2
|
import { ListItemHarness, MenuItemHarness, PBreadcrumbHarness, PButtonHarness, PMenuHarness } from '@onecx/angular-testing';
|
|
3
3
|
export declare class PageHeaderHarness extends ComponentHarness {
|
|
4
4
|
static hostSelector: string;
|
|
@@ -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
|
|
25
|
+
declare class ObjectDetailItemHarness extends ContentContainerComponentHarness {
|
|
26
26
|
static hostSelector: string;
|
|
27
27
|
getLabelElement: () => Promise<import("@onecx/angular-testing").TestElement>;
|
|
28
28
|
getValueElement: () => Promise<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 {};
|