@onecx/angular-accelerator 5.50.0 → 5.51.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.
Files changed (43) hide show
  1. package/assets/i18n/de.json +6 -6
  2. package/assets/i18n/en.json +6 -6
  3. package/assets/i18n/storybook-translations/page-header/de.json +13 -0
  4. package/assets/i18n/storybook-translations/page-header/en.json +13 -0
  5. package/esm2022/index.mjs +2 -1
  6. package/esm2022/lib/angular-accelerator-primeng.module.mjs +4 -4
  7. package/esm2022/lib/angular-accelerator.module.mjs +6 -6
  8. package/esm2022/lib/components/column-group-selection/column-group-selection.component.mjs +3 -3
  9. package/esm2022/lib/components/custom-group-column-selector/custom-group-column-selector.component.mjs +3 -3
  10. package/esm2022/lib/components/data-layout-selection/data-layout-selection.component.mjs +3 -3
  11. package/esm2022/lib/components/data-list-grid/data-list-grid.component.mjs +3 -3
  12. package/esm2022/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.mjs +10 -6
  13. package/esm2022/lib/components/data-loading-error/data-loading-error.component.mjs +3 -3
  14. package/esm2022/lib/components/data-table/data-table.component.mjs +23 -14
  15. package/esm2022/lib/components/data-view/data-view.component.mjs +3 -3
  16. package/esm2022/lib/components/diagram/diagram.component.mjs +3 -3
  17. package/esm2022/lib/components/filter-view/filter-view.component.mjs +3 -3
  18. package/esm2022/lib/components/group-by-count-diagram/group-by-count-diagram.component.mjs +3 -3
  19. package/esm2022/lib/components/interactive-data-view/interactive-data-view.component.mjs +3 -3
  20. package/esm2022/lib/components/page-header/page-header.component.mjs +25 -5
  21. package/esm2022/lib/components/search-header/search-header.component.mjs +5 -5
  22. package/esm2022/lib/directives/advanced.directive.mjs +3 -3
  23. package/esm2022/lib/directives/if-breakpoint.directive.mjs +3 -3
  24. package/esm2022/lib/directives/if-permission.directive.mjs +3 -3
  25. package/esm2022/lib/directives/src.directive.mjs +3 -3
  26. package/esm2022/lib/directives/tooltipOnOverflow.directive.mjs +3 -3
  27. package/esm2022/lib/model/translation.model.mjs +2 -0
  28. package/esm2022/lib/pipes/dynamic.pipe.mjs +3 -3
  29. package/esm2022/lib/pipes/ocxtimeago.pipe.mjs +3 -3
  30. package/esm2022/lib/services/breadcrumb.service.mjs +3 -3
  31. package/esm2022/lib/services/translation-cache.service.mjs +3 -3
  32. package/esm2022/lib/utils/dateutils.mjs +3 -3
  33. package/esm2022/testing/page-header.harness.mjs +26 -2
  34. package/fesm2022/onecx-angular-accelerator-testing.mjs +25 -1
  35. package/fesm2022/onecx-angular-accelerator-testing.mjs.map +1 -1
  36. package/fesm2022/onecx-angular-accelerator.mjs +128 -95
  37. package/fesm2022/onecx-angular-accelerator.mjs.map +1 -1
  38. package/index.d.ts +1 -0
  39. package/lib/components/data-table/data-table.component.d.ts +4 -1
  40. package/lib/components/page-header/page-header.component.d.ts +21 -2
  41. package/lib/model/translation.model.d.ts +31 -0
  42. package/package.json +11 -7
  43. 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';
@@ -101,7 +101,9 @@ export declare class DataTableComponent extends DataSortBase implements OnInit,
101
101
  selectionEnabledField: string | undefined;
102
102
  allowSelectAll: boolean;
103
103
  paginator: boolean;
104
- page: number;
104
+ _page$: BehaviorSubject<number>;
105
+ get page(): number;
106
+ set page(value: number);
105
107
  tableStyle: {
106
108
  [klass: string]: any;
107
109
  } | undefined;
@@ -237,6 +239,7 @@ export declare class DataTableComponent extends DataSortBase implements OnInit,
237
239
  isRowSelectionDisabled(rowObject: Row): boolean;
238
240
  rowSelectable(event: any): boolean;
239
241
  onSelectionChange(selection: Row[]): void;
242
+ emitSelectionChanged(): void;
240
243
  mergeWithDisabledKeys(newSelectionIds: (string | number)[], disabledRowIds: (string | number)[]): (string | number)[];
241
244
  isSelected(row: Row): boolean;
242
245
  onPageChange(event: any): void;
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@onecx/angular-accelerator",
3
- "version": "5.50.0",
3
+ "version": "5.51.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": "^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.50.0",
16
- "@onecx/accelerator": "^5.50.0",
17
- "@onecx/angular-integration-interface": "^5.50.0",
18
- "@onecx/angular-remote-components": "^5.50.0",
19
- "@onecx/angular-testing": "^5.50.0",
20
- "@onecx/angular-utils": "^5.50.0",
19
+ "@onecx/integration-interface": "^5.51.1",
20
+ "@onecx/accelerator": "^5.51.1",
21
+ "@onecx/angular-integration-interface": "^5.51.1",
22
+ "@onecx/angular-remote-components": "^5.51.1",
23
+ "@onecx/angular-testing": "^5.51.1",
24
+ "@onecx/angular-utils": "^5.51.1",
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 {};