@hortiview/shared-components 2.27.1 → 2.27.3

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.
@@ -12,6 +12,11 @@ export declare const capitalizeFirstLetters: (text: string) => string;
12
12
  * @returns
13
13
  */
14
14
  export declare const trimLeadingAndTrailingSpaces: <T extends Record<string, unknown>>(obj: T) => T;
15
+ /**
16
+ * Flattens any nested object into a single searchable string.
17
+ * Useful for option objects where the searchable text can live at any depth.
18
+ */
19
+ export declare const flattenObjectToString: (value: unknown) => string;
15
20
  /**
16
21
  * Receives a number and returns the value as a locale string.
17
22
  * Note: Should only be used for displaying numbers, not for calculations
@@ -1,10 +1,9 @@
1
- import { i as n } from "../isArray-olhCpv2e.js";
2
- import { i as p, a as s } from "../isString-BNdV0Jpg.js";
3
- import { AVAILABLE_LOCALES as a, LANGUAGE_CODES_MAPPER as e } from "../types/Languages.js";
1
+ import { i as o } from "../isArray-olhCpv2e.js";
2
+ import { i as e, a as m } from "../isString-C0tJxuT4.js";
3
+ import { isValidElement as a } from "react";
4
4
  import "react/jsx-runtime";
5
5
  import "../isEmpty-l2xQKl4x.js";
6
- import "react";
7
- import "../react-tooltip.min-Dkz5ltCC.js";
6
+ import "../react-tooltip.min-D7xPMD-P.js";
8
7
  import "../orderBy-Ce85KqD6.js";
9
8
  import "../index-CuHybtft.js";
10
9
  import "../components/SharedComponentsPermissionProvider/PermissionContext.js";
@@ -14,20 +13,22 @@ import "react-hook-form";
14
13
  import "../get-CBFiuc3f.js";
15
14
  import "../omit-BWQrFyQ-.js";
16
15
  import { DATE_FORMAT as c } from "../types/Time.js";
16
+ import { AVAILABLE_LOCALES as g, LANGUAGE_CODES_MAPPER as p } from "../types/Languages.js";
17
17
  import "../react.esm-DF7i80eN.js";
18
- const P = (t) => t.split(" ").map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join(" "), f = (t) => Object.fromEntries(
19
- Object.entries(t).map(([r, i]) => [r, o(i)])
20
- ), o = (t) => n(t) ? t.map(o) : p(t) ? f(t) : s(t) ? t.trim() : t, U = (t, r, i = 2) => {
18
+ const P = (t) => t.split(" ").map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join(" "), A = (t) => Object.fromEntries(
19
+ Object.entries(t).map(([r, i]) => [r, f(i)])
20
+ ), n = (t) => t == null || a(t) ? "" : e(t) || typeof t == "number" || typeof t == "boolean" || typeof t == "bigint" ? String(t) : o(t) ? t.map(n).filter(Boolean).join(" ") : m(t) ? Object.values(t).map(n).filter(Boolean).join(" ") : "", f = (t) => o(t) ? t.map(f) : m(t) ? A(t) : e(t) ? t.trim() : t, U = (t, r, i = 2) => {
21
21
  if (!r) return "0";
22
- const m = e[t];
23
- return r.toLocaleString(m, { maximumFractionDigits: i });
24
- }, y = (t, r = "en-US", i = c) => a.includes(r) ? new Intl.DateTimeFormat(
25
- e[r],
22
+ const s = p[t];
23
+ return r.toLocaleString(s, { maximumFractionDigits: i });
24
+ }, G = (t, r = "en-US", i = c) => g.includes(r) ? new Intl.DateTimeFormat(
25
+ p[r],
26
26
  i
27
27
  ).format(new Date(t)) : new Intl.DateTimeFormat(r, i).format(new Date(t));
28
28
  export {
29
29
  P as capitalizeFirstLetters,
30
- y as getFormattedDateTime,
30
+ n as flattenObjectToString,
31
+ G as getFormattedDateTime,
31
32
  U as getNumberAsLocaleString,
32
- f as trimLeadingAndTrailingSpaces
33
+ A as trimLeadingAndTrailingSpaces
33
34
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "2.27.1",
4
+ "version": "2.27.3",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",