@hortiview/modulebase 0.0.11938 → 0.0.12109

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.
@@ -1 +1 @@
1
- export declare const useBreadcrumbTranslation: () => (key: string, value: string) => void;
1
+ export declare const useBreadcrumbTranslation: () => (key: string, value: string | false) => void;
@@ -1,20 +1,23 @@
1
- import { useCallback as s } from "react";
2
- import { useBasePropsStore as o } from "../stores/BasePropsStore.js";
3
- const c = () => {
4
- const a = o(
5
- (r) => r.addBreadcrumbTranslation
6
- ), t = o((r) => r.addTranslation);
7
- return s(
8
- (r, n) => {
9
- if (a) {
10
- a({ key: r, value: n });
1
+ import { useCallback as d } from "react";
2
+ import { useBasePropsStore as s } from "../stores/BasePropsStore.js";
3
+ const u = () => {
4
+ const o = s((a) => a.addBreadcrumbTranslation), t = s((a) => a.addTranslation);
5
+ return d(
6
+ (a, r) => {
7
+ const e = a, n = typeof r == "boolean" ? a : r;
8
+ if (o) {
9
+ o(
10
+ { key: e, value: n },
11
+ //if boolean hide the translation in the breadcrumb
12
+ typeof r == "boolean"
13
+ );
11
14
  return;
12
15
  }
13
- t && t({ key: r, value: n });
16
+ t && t({ key: e, value: n }, typeof r == "boolean");
14
17
  },
15
- [a, t]
18
+ [o, t]
16
19
  );
17
20
  };
18
21
  export {
19
- c as useBreadcrumbTranslation
22
+ u as useBreadcrumbTranslation
20
23
  };
@@ -13,7 +13,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
13
13
  addBreadcrumbTranslation?: (translation: {
14
14
  key: string;
15
15
  value: string;
16
- }) => void;
16
+ }, hide?: boolean) => void;
17
17
  showSnackbar?: (message: string, icon?: string) => void;
18
18
  showMessage?: (message: import('../types/SystemMessage').SystemMessage) => void;
19
19
  logEvent?: (event: import('../types/AppInsights').AppInsightsEvent, customProperties?: import('../types/AppInsights').AppInsightsProperties) => void;
@@ -24,12 +24,12 @@ export type BaseProps = DeprecatedBaseProps & {
24
24
  currentLanguage?: string;
25
25
  currentLanguageId?: string;
26
26
  alertRules?: string;
27
- commonOptions?: AllDropdownsData<CommonOption>["items"];
27
+ commonOptions?: AllDropdownsData<CommonOption>['items'];
28
28
  navigateInHortiview?: (path: string) => void;
29
29
  addBreadcrumbTranslation?: (translation: {
30
30
  key: string;
31
31
  value: string;
32
- }) => void;
32
+ }, hide?: boolean) => void;
33
33
  showSnackbar?: (message: string, icon?: string) => void;
34
34
  showMessage?: (message: SystemMessage) => void;
35
35
  logEvent?: (event: AppInsightsEvent, customProperties?: AppInsightsProperties) => void;
@@ -31,7 +31,7 @@ export type DeprecatedBaseProps = {
31
31
  addTranslation?: (translation: {
32
32
  key: string;
33
33
  value: string;
34
- }) => void;
34
+ }, hide?: boolean) => void;
35
35
  /**
36
36
  * @deprecated Use `navigateInHortiview` instead
37
37
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/modulebase",
3
3
  "description": "This is a base module for hortiview",
4
- "version": "0.0.11938",
4
+ "version": "0.0.12109",
5
5
  "type": "module",
6
6
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
7
7
  "contributors": [