@hortiview/shared-components 0.0.11589 → 0.0.11797

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/README.md CHANGED
@@ -64,6 +64,10 @@ Additionally the library provides form components using [react-hook-form](https:
64
64
  1. [trimLeadingAndTrailingSpaces](#trimleadingandtrailingspaces)
65
65
  1. [getNumberAsLocaleString](#getnumberaslocalestring)
66
66
 
67
+ ## Available constants
68
+
69
+ 1. [Languages and countries](#languages-and-countries)
70
+
67
71
  ## Available Components:
68
72
 
69
73
  ### AlertBanner
@@ -1027,3 +1031,27 @@ const overlineTitle = `${getNumberAsLocaleString(userLocale, totalArea, 5)} ${t(
1027
1031
  'squaremeter-unit'
1028
1032
  )}`;
1029
1033
  ```
1034
+
1035
+ ## Available constants
1036
+
1037
+ ### Languages and countries
1038
+
1039
+ The file contains different languages and country constants as well as language ids, which represents the available languages and countries of the hortiview platform.
1040
+
1041
+ The supported languages are:
1042
+
1043
+ - English (en)
1044
+ - Spanish (es)
1045
+ - Turkish (tr)
1046
+
1047
+ The supported countries are:
1048
+
1049
+ - Spain (esp)
1050
+ - Mexico (mex)
1051
+ - Turkey (tur)
1052
+
1053
+ ```typescript
1054
+ const languageCode = 'en' as AVAILABLE_LANGUAGE_CODES;
1055
+ const languageCountryCode = LANGUAGE_CODES_MAPPER[languageCode];
1056
+ console.log(languageCountryCode); // 'en-US'
1057
+ ```
@@ -44,7 +44,7 @@ e.mock("react-hook-form", () => ({
44
44
  }));
45
45
  m("FormNumber Test", () => {
46
46
  f("render FormNumber with correct properties", () => {
47
- a(/* @__PURE__ */ o(s, { languageCode: "de-DE", propertyName: "de-DE" }));
47
+ a(/* @__PURE__ */ o(s, { languageCode: "es-MX", propertyName: "es-MX" }));
48
48
  const t = n.getByRole("textbox");
49
49
  r(t).toBeInTheDocument(), r(t).toHaveAttribute("type", "text"), r(t).toHaveAttribute("inputmode", "decimal");
50
50
  });
@@ -1,140 +1,130 @@
1
- import { jsx as t, Fragment as F, jsxs as D } from "react/jsx-runtime";
2
- import { T as G } from "../../../index.es-25EARqhH.js";
3
- import { a as I } from "../../../index.es-CF_xy2ns.js";
4
- import { g as J } from "../../../get-DFv1gXfq.js";
5
- import { useState as q, useCallback as K, useMemo as T, useEffect as O } from "react";
6
- import { useFormContext as Q, Controller as H } from "react-hook-form";
7
- import { useHelperText as U } from "../../../hooks/useHelperText.js";
8
- import '../../../assets/FormText.css';const X = "_formTextAreaHelperText_168p8_1", Y = "_invalid_168p8_7", Z = "_required_168p8_11", N = "_formTextArea_168p8_1", y = "_characterCount_168p8_25", p = "_withoutCharacterCount_168p8_31", n = {
9
- formTextAreaHelperText: X,
10
- invalid: Y,
11
- required: Z,
12
- formTextArea: N,
13
- characterCount: y,
14
- withoutCharacterCount: p
15
- }, ee = ({
1
+ import { jsx as t, Fragment as v, jsxs as z } from "react/jsx-runtime";
2
+ import { T as M } from "../../../index.es-25EARqhH.js";
3
+ import { a as P } from "../../../index.es-CF_xy2ns.js";
4
+ import { useState as V, useCallback as W, useMemo as m } from "react";
5
+ import { useFormContext as D, Controller as _ } from "react-hook-form";
6
+ import { useHelperText as E } from "../../../hooks/useHelperText.js";
7
+ import '../../../assets/FormText.css';const G = "_formTextAreaHelperText_168p8_1", I = "_invalid_168p8_7", J = "_required_168p8_11", K = "_formTextArea_168p8_1", O = "_characterCount_168p8_25", Q = "_withoutCharacterCount_168p8_31", r = {
8
+ formTextAreaHelperText: G,
9
+ invalid: I,
10
+ required: J,
11
+ formTextArea: K,
12
+ characterCount: O,
13
+ withoutCharacterCount: Q
14
+ }, U = ({
16
15
  count: e,
17
- maxCount: s,
18
- invalid: u = !1,
19
- hasRequiredText: r = !1
16
+ maxCount: u,
17
+ invalid: s = !1,
18
+ hasRequiredText: n = !1
20
19
  }) => /* @__PURE__ */ t(
21
20
  "div",
22
21
  {
23
22
  "data-testid": "character-counter-container",
24
- className: `${n.formTextAreaHelperText} ${u ? n.invalid : ""} ${r ? n.required : ""}`,
25
- children: /* @__PURE__ */ t(I, { children: `${e}/${s}` })
23
+ className: `${r.formTextAreaHelperText} ${s ? r.invalid : ""} ${n ? r.required : ""}`,
24
+ children: /* @__PURE__ */ t(P, { children: `${e}/${u}` })
26
25
  }
27
- ), ue = (e) => e.textarea ? /* @__PURE__ */ t(te, { ...e }) : /* @__PURE__ */ t(re, { ...e }), te = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: n.formTextArea, children: /* @__PURE__ */ t(L, { ...e }) }), re = (e) => /* @__PURE__ */ t(
26
+ ), re = (e) => e.textarea ? /* @__PURE__ */ t(X, { ...e }) : /* @__PURE__ */ t(Y, { ...e }), X = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: r.formTextArea, children: /* @__PURE__ */ t(A, { ...e }) }), Y = (e) => /* @__PURE__ */ t(
28
27
  "div",
29
28
  {
30
29
  "data-testid": "form-text-field",
31
- className: `${e.hasCharacterCount ? n.characterCount : n.withoutCharacterCount}`,
32
- children: /* @__PURE__ */ t(L, { ...e })
30
+ className: `${e.hasCharacterCount ? r.characterCount : r.withoutCharacterCount}`,
31
+ children: /* @__PURE__ */ t(A, { ...e })
33
32
  }
34
- ), L = ({
33
+ ), A = ({
35
34
  propertyName: e,
36
- label: s,
37
- disabled: u = !1,
38
- textarea: r = !1,
39
- hasCharacterCount: c = !1,
40
- hidden: w = !1,
41
- placeholder: B,
42
- type: S,
43
- prefixText: j,
44
- inputMode: k,
45
- trailingIcon: R,
46
- trigger: C = "likeForm",
35
+ label: u,
36
+ disabled: s = !1,
37
+ textarea: n = !1,
38
+ hasCharacterCount: o = !1,
39
+ hidden: $ = !1,
40
+ placeholder: F,
41
+ type: q,
42
+ prefixText: H,
43
+ inputMode: L,
44
+ trailingIcon: w,
45
+ trigger: x = "likeForm",
47
46
  rules: a,
48
47
  ...i
49
48
  }) => {
50
- const { control: g, getFieldState: d, trigger: v } = Q(), [b, m] = q(0), [o, z] = q(), f = K(
49
+ const { control: f, getFieldState: d, trigger: T } = D(), [B, C] = V(0), S = W(
51
50
  (h) => {
52
- if (o != null) {
53
- m(o.length);
54
- return;
51
+ if (!(!n && !o)) {
52
+ if (h) {
53
+ C(h.length);
54
+ return;
55
+ }
56
+ C(0);
55
57
  }
56
- if (h) {
57
- m(h.length);
58
- return;
59
- }
60
- m(0);
61
58
  },
62
- [o]
63
- ), l = T(
64
- () => i.maxlength ?? a?.maxLength?.value,
59
+ [o, n]
60
+ ), l = m(
61
+ () => i.maxlength ? i.maxlength : a?.maxLength?.value,
65
62
  [a, i.maxlength]
66
- ), E = T(
63
+ ), j = m(
67
64
  () => a?.minLength?.value,
68
65
  [a]
69
- ), _ = T(
66
+ ), g = m(
70
67
  () => a?.required?.message,
71
68
  [a]
72
- ), { helperText: M, helperTextPersistent: P } = U({
69
+ ), { helperText: k, helperTextPersistent: R } = E({
73
70
  propertyName: e,
74
71
  helperText: i.helperText,
75
- requiredText: _,
72
+ requiredText: g,
76
73
  maxLength: l,
77
- hasCharacterCount: r || c
74
+ hasCharacterCount: n || o
78
75
  });
79
- return O(() => {
80
- (r || c) && l !== void 0 && o != null && f();
81
- }, [o, r, c, l, f]), w ? /* @__PURE__ */ t(H, { name: e, control: g, render: () => /* @__PURE__ */ t(F, {}) }) : /* @__PURE__ */ t(
82
- H,
76
+ return $ ? /* @__PURE__ */ t(_, { name: e, control: f, render: () => /* @__PURE__ */ t(v, {}) }) : /* @__PURE__ */ t(
77
+ _,
83
78
  {
84
79
  name: e,
85
80
  rules: a,
86
- control: g,
87
- render: ({ field: { ref: h, ...x }, formState: { defaultValues: V } }) => {
88
- const A = J(V, e);
89
- return !o && A && (c || r) && f(A), /* @__PURE__ */ D(F, { children: [
90
- /* @__PURE__ */ t(
91
- G,
92
- {
93
- ...i,
94
- ...x,
95
- value: x.value ?? "",
96
- type: S,
97
- fullWidth: !0,
98
- "data-testid": `textfield-${e}`,
99
- inputMode: k,
100
- placeholder: B,
101
- prefixText: j,
102
- disabled: u,
103
- helperText: M,
104
- helperTextPersistent: P,
105
- label: s,
106
- variant: "outlined",
107
- maxlength: l,
108
- minLength: E,
109
- textarea: r,
110
- noResize: !1,
111
- onBlur: () => {
112
- C === "onBlur" && v(e), i.onBlur?.();
113
- },
114
- onChange: ($) => {
115
- x.onChange($);
116
- const W = $?.target?.value;
117
- z(W), C === "onChange" && v(e);
118
- },
119
- valid: !d(e).invalid,
120
- className: `${n.formText} ${d(e).invalid ? n.invalid : ""}`,
121
- trailingIcon: R
122
- }
123
- ),
124
- l !== void 0 && (c || r) && /* @__PURE__ */ t(
125
- ee,
126
- {
127
- count: b,
128
- maxCount: l,
129
- invalid: d(e).invalid,
130
- hasRequiredText: !!i.helperText || !!_
131
- }
132
- )
133
- ] });
134
- }
81
+ control: f,
82
+ render: ({ field: { ref: h, ...c } }) => (S(c.value), /* @__PURE__ */ z(v, { children: [
83
+ /* @__PURE__ */ t(
84
+ M,
85
+ {
86
+ ...i,
87
+ ...c,
88
+ value: c.value ?? "",
89
+ type: q,
90
+ fullWidth: !0,
91
+ "data-testid": `textfield-${e}`,
92
+ inputMode: L,
93
+ placeholder: F,
94
+ prefixText: H,
95
+ disabled: s,
96
+ helperText: k,
97
+ helperTextPersistent: R,
98
+ label: u,
99
+ variant: "outlined",
100
+ maxlength: l,
101
+ minLength: j,
102
+ textarea: n,
103
+ noResize: !1,
104
+ onBlur: () => {
105
+ x === "onBlur" && T(e), i.onBlur?.();
106
+ },
107
+ onChange: (b) => {
108
+ c.onChange(b), x === "onChange" && T(e);
109
+ },
110
+ valid: !d(e).invalid,
111
+ className: `${r.formText} ${d(e).invalid ? r.invalid : ""}`,
112
+ trailingIcon: w
113
+ }
114
+ ),
115
+ l !== void 0 && (o || n) && /* @__PURE__ */ t(
116
+ U,
117
+ {
118
+ count: B,
119
+ maxCount: l,
120
+ invalid: d(e).invalid,
121
+ hasRequiredText: !!i.helperText || !!g
122
+ }
123
+ )
124
+ ] }))
135
125
  }
136
126
  );
137
127
  };
138
128
  export {
139
- ue as FormText
129
+ re as FormText
140
130
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { a as s, s as r, f as d } from "../../../react.esm-DNwojocF.js";
2
+ import { a as s, s as r, f as i } from "../../../react.esm-DNwojocF.js";
3
3
  import { FormText as o } from "./FormText.js";
4
4
  import { v as a, d as u, t as l, g as e } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
5
- const m = a.fn();
5
+ const d = a.fn();
6
6
  a.mock("react-hook-form", () => ({
7
7
  ...a.importActual("react-hook-form"),
8
8
  Controller: ({
@@ -10,7 +10,7 @@ a.mock("react-hook-form", () => ({
10
10
  }) => t({
11
11
  field: {
12
12
  ref: void 0,
13
- onChange: m,
13
+ onChange: d,
14
14
  value: "test"
15
15
  },
16
16
  formState: { defaultValue: {} }
@@ -62,23 +62,9 @@ u("FormText Test", () => {
62
62
  const t = r.getByRole("textbox");
63
63
  e(t).toBeInTheDocument(), e(t).toBeInstanceOf(HTMLInputElement), e(t).toHaveAttribute("maxlength", "100"), e(r.getByText("address.line2")).toBeInTheDocument();
64
64
  }), l("change value of single line text field", () => {
65
- s(
66
- /* @__PURE__ */ n(
67
- o,
68
- {
69
- rules: {
70
- maxLength: {
71
- value: 100,
72
- message: "max length is 100"
73
- }
74
- },
75
- label: "address.line2",
76
- propertyName: "addressLine2"
77
- }
78
- )
79
- );
65
+ s(/* @__PURE__ */ n(o, { label: "address.line2", propertyName: "addressLine2" }));
80
66
  const t = r.getByRole("textbox");
81
- e(t).toHaveValue("test"), d.change(t, { target: { value: "test-change" } }), e(m).toHaveBeenCalled();
67
+ e(t).toHaveValue("test"), i.change(t, { target: { value: "test-change" } }), e(d).toHaveBeenCalled();
82
68
  }), l("render FormText and return text area", () => {
83
69
  s(
84
70
  /* @__PURE__ */ n(
@@ -103,22 +89,7 @@ u("FormText Test", () => {
103
89
  const t = r.getByRole("textbox");
104
90
  e(t).toBeInTheDocument(), e(t).toBeInstanceOf(HTMLTextAreaElement), e(t).toHaveAttribute("maxlength", "200"), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.getByText("required")).toBeInTheDocument();
105
91
  }), l("render FormText with maxLength indicator", () => {
106
- s(
107
- /* @__PURE__ */ n(
108
- o,
109
- {
110
- rules: {
111
- maxLength: {
112
- value: 200,
113
- message: "max length is 200"
114
- }
115
- },
116
- label: "address.line1",
117
- propertyName: "addressLine1",
118
- textarea: !0
119
- }
120
- )
121
- ), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.queryByText("required")).not.toBeInTheDocument(), e(r.getByText("0/200")).toBeInTheDocument();
92
+ s(/* @__PURE__ */ n(o, { maxlength: 200, label: "address.line1", propertyName: "addressLine1", textarea: !0 })), e(r.getByText("address.line1")).toBeInTheDocument(), e(r.queryByText("required")).not.toBeInTheDocument(), e(r.getByText("4/200")).toBeInTheDocument();
122
93
  }), l("change value of text area", () => {
123
94
  s(
124
95
  /* @__PURE__ */ n(
@@ -128,10 +99,6 @@ u("FormText Test", () => {
128
99
  required: {
129
100
  value: !0,
130
101
  message: "required"
131
- },
132
- maxLength: {
133
- value: 200,
134
- message: "max length is 200"
135
102
  }
136
103
  },
137
104
  label: "address.line1",
@@ -141,6 +108,6 @@ u("FormText Test", () => {
141
108
  )
142
109
  );
143
110
  const t = r.getByRole("textbox");
144
- d.change(t, { target: { value: "test-change" } }), e(m).toHaveBeenCalled();
111
+ i.change(t, { target: { value: "test-change" } }), e(d).toHaveBeenCalled();
145
112
  });
146
113
  });
package/dist/main.d.ts CHANGED
@@ -36,7 +36,7 @@ export { FormToggle } from './components/FormComponents/FormToggle/FormToggle';
36
36
  export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
37
37
  export { ThemeColor } from './enums/ThemeColor';
38
38
  export { useBreakpoints } from './hooks/useBreakpoints';
39
- export { capitalizeFirstLetters, getNumberAsLocaleString, trimLeadingAndTrailingSpaces, } from './services/UtilService';
39
+ export { capitalizeFirstLetters, getNumberAsLocaleString, trimLeadingAndTrailingSpaces } from './services/UtilService';
40
40
  export type { ActionProps } from './components/ContextMenu/ContextMenu';
41
41
  export type { FormSelectOption } from './components/FormComponents/FormSelect/FormSelect';
42
42
  export type { FormTextProps } from './components/FormComponents/FormText/FormText';
@@ -45,5 +45,5 @@ export type { FilterData, FilterOption, FilterSelection } from './types/Filter';
45
45
  export type { CellTemplate, CellTemplateProps, TableLayoutProps } from './types/GenericTable';
46
46
  export type { HashTab } from './types/HashTab';
47
47
  export type { BaseListElement, ListElement } from './types/ListElement';
48
- export { LANGUAGE_CODES_MAPPER } from './types/Languages';
49
- export type { LANGUAGE_CODES, LANGUAGE_COUNTRY_CODES } from './types/Languages';
48
+ export { AVAILABLE_COUNTRY_KEYS, AVAILABLE_LOCALES, ENGLISH_LANGUAGE_ID, GERMAN_LANGUAGE_ID, LANGUAGE_CODES_MAPPER, LANGUAGE_ID_MAPPER, SPANISH_LANGUAGE_ID, TURKISH_LANGUAGE_ID } from './types/Languages';
49
+ export type { AVAILABLE_LANGUAGE_CODES, LANGUAGE_COUNTRY_CODES } from './types/Languages';
package/dist/main.js CHANGED
@@ -3,25 +3,25 @@ import { AlertBanner as t } from "./components/AlertBanner/AlertBanner.js";
3
3
  import { BaseView as p } from "./components/BaseView/BaseView.js";
4
4
  import { BasicHeading as x } from "./components/BasicHeading/BasicHeading.js";
5
5
  import { BlockView as a } from "./components/BlockView/BlockView.js";
6
- import { ChipCard as c } from "./components/ChipCard/ChipCard.js";
7
- import { ContextMenu as d } from "./components/ContextMenu/ContextMenu.js";
8
- import { DeleteModal as F } from "./components/DeleteModal/DeleteModal.js";
9
- import { Disclaimer as g } from "./components/Disclaimer/Disclaimer.js";
10
- import { EmptyView as b } from "./components/EmptyView/EmptyView.js";
11
- import { Filter as C } from "./components/Filter/Filter.js";
12
- import { FormattedNumberDisplay as B } from "./components/FormattedNumberDisplay/FormattedNumberDisplay.js";
13
- import { GenericTable as D } from "./components/GenericTable/GenericTable.js";
14
- import { HashTabView as k } from "./components/HashTabView/HashTabView.js";
15
- import { HeaderFilter as M } from "./components/HeaderFilter/HeaderFilter.js";
16
- import { HealthCheckFailed as E } from "./components/HealthCheckFailed/HealthCheckFailed.js";
6
+ import { ChipCard as A } from "./components/ChipCard/ChipCard.js";
7
+ import { ContextMenu as n } from "./components/ContextMenu/ContextMenu.js";
8
+ import { DeleteModal as d } from "./components/DeleteModal/DeleteModal.js";
9
+ import { Disclaimer as G } from "./components/Disclaimer/Disclaimer.js";
10
+ import { EmptyView as s } from "./components/EmptyView/EmptyView.js";
11
+ import { Filter as F } from "./components/Filter/Filter.js";
12
+ import { FormattedNumberDisplay as N } from "./components/FormattedNumberDisplay/FormattedNumberDisplay.js";
13
+ import { GenericTable as C } from "./components/GenericTable/GenericTable.js";
14
+ import { HashTabView as u } from "./components/HashTabView/HashTabView.js";
15
+ import { HeaderFilter as T } from "./components/HeaderFilter/HeaderFilter.js";
16
+ import { HealthCheckFailed as U } from "./components/HealthCheckFailed/HealthCheckFailed.js";
17
17
  import { Iconify as H } from "./components/Iconify/Iconify.js";
18
18
  import { InfoGroup as P } from "./components/InfoGroup/InfoGroup.js";
19
- import { ListArea as y } from "./components/ListArea/ListArea.js";
20
- import { LoadingSpinner as O } from "./components/LoadingSpinner/Default/LoadingSpinner.js";
21
- import { Modal as _ } from "./components/Modal/Modal.js";
22
- import { ModulePadding as U } from "./components/ModulePadding/ModulePadding.js";
23
- import { OverflowTooltip as Y } from "./components/OverflowTooltip/OverflowTooltip.js";
24
- import { ScrollbarX as q, ScrollbarY as J } from "./components/Scrollbar/Scrollbar.js";
19
+ import { ListArea as R } from "./components/ListArea/ListArea.js";
20
+ import { LoadingSpinner as w } from "./components/LoadingSpinner/Default/LoadingSpinner.js";
21
+ import { Modal as v } from "./components/Modal/Modal.js";
22
+ import { ModulePadding as Y } from "./components/ModulePadding/ModulePadding.js";
23
+ import { OverflowTooltip as z } from "./components/OverflowTooltip/OverflowTooltip.js";
24
+ import { ScrollbarX as j, ScrollbarY as q } from "./components/Scrollbar/Scrollbar.js";
25
25
  import { SearchBar as Q } from "./components/SearchBar/SearchBar.js";
26
26
  import { Select as Z } from "./components/Select/Select.js";
27
27
  import { VerticalDivider as rr } from "./components/VerticalDivider/VerticalDivider.js";
@@ -30,55 +30,62 @@ import { FormDatePicker as mr } from "./components/FormComponents/FormDatePicker
30
30
  import { FormNumber as fr } from "./components/FormComponents/FormNumber/FormNumber.js";
31
31
  import { FormRadio as ir } from "./components/FormComponents/FormRadio/FormRadio.js";
32
32
  import { FormSelect as lr } from "./components/FormComponents/FormSelect/FormSelect.js";
33
- import { FormSlider as nr } from "./components/FormComponents/FormSlider/FormSlider.js";
34
- import { FormText as sr } from "./components/FormComponents/FormText/FormText.js";
35
- import { FormToggle as Sr } from "./components/FormComponents/FormToggle/FormToggle.js";
36
- import { AvailableCustomIcons as ur } from "./enums/AvailableCustomIcons.js";
37
- import { ThemeColor as Ar } from "./enums/ThemeColor.js";
38
- import { u as hr } from "./useBreakpoints-MzTZ0tCT.js";
39
- import { capitalizeFirstLetters as Tr, getNumberAsLocaleString as Dr, trimLeadingAndTrailingSpaces as Lr } from "./services/UtilService.js";
40
- import { LANGUAGE_CODES_MAPPER as wr } from "./types/Languages.js";
33
+ import { FormSlider as cr } from "./components/FormComponents/FormSlider/FormSlider.js";
34
+ import { FormText as Lr } from "./components/FormComponents/FormText/FormText.js";
35
+ import { FormToggle as Er } from "./components/FormComponents/FormToggle/FormToggle.js";
36
+ import { AvailableCustomIcons as Sr } from "./enums/AvailableCustomIcons.js";
37
+ import { ThemeColor as _r } from "./enums/ThemeColor.js";
38
+ import { u as Ir } from "./useBreakpoints-MzTZ0tCT.js";
39
+ import { capitalizeFirstLetters as Dr, getNumberAsLocaleString as Cr, trimLeadingAndTrailingSpaces as gr } from "./services/UtilService.js";
40
+ import { AVAILABLE_COUNTRY_KEYS as Br, AVAILABLE_LOCALES as Tr, ENGLISH_LANGUAGE_ID as br, GERMAN_LANGUAGE_ID as Ur, LANGUAGE_CODES_MAPPER as hr, LANGUAGE_ID_MAPPER as Hr, SPANISH_LANGUAGE_ID as Mr, TURKISH_LANGUAGE_ID as Pr } from "./types/Languages.js";
41
41
  export {
42
+ Br as AVAILABLE_COUNTRY_KEYS,
43
+ Tr as AVAILABLE_LOCALES,
42
44
  t as AlertBanner,
43
- ur as AvailableCustomIcons,
45
+ Sr as AvailableCustomIcons,
44
46
  p as BaseView,
45
47
  x as BasicHeading,
46
48
  a as BlockView,
47
- c as ChipCard,
48
- d as ContextMenu,
49
- F as DeleteModal,
50
- g as Disclaimer,
51
- b as EmptyView,
52
- C as Filter,
49
+ A as ChipCard,
50
+ n as ContextMenu,
51
+ d as DeleteModal,
52
+ G as Disclaimer,
53
+ br as ENGLISH_LANGUAGE_ID,
54
+ s as EmptyView,
55
+ F as Filter,
53
56
  er as FormCheckBox,
54
57
  mr as FormDatePicker,
55
58
  fr as FormNumber,
56
59
  ir as FormRadio,
57
60
  lr as FormSelect,
58
- nr as FormSlider,
59
- sr as FormText,
60
- Sr as FormToggle,
61
- B as FormattedNumberDisplay,
62
- D as GenericTable,
63
- k as HashTabView,
64
- M as HeaderFilter,
65
- E as HealthCheckFailed,
61
+ cr as FormSlider,
62
+ Lr as FormText,
63
+ Er as FormToggle,
64
+ N as FormattedNumberDisplay,
65
+ Ur as GERMAN_LANGUAGE_ID,
66
+ C as GenericTable,
67
+ u as HashTabView,
68
+ T as HeaderFilter,
69
+ U as HealthCheckFailed,
66
70
  H as Iconify,
67
71
  P as InfoGroup,
68
- wr as LANGUAGE_CODES_MAPPER,
69
- y as ListArea,
70
- O as LoadingSpinner,
71
- _ as Modal,
72
- U as ModulePadding,
73
- Y as OverflowTooltip,
74
- q as ScrollbarX,
75
- J as ScrollbarY,
72
+ hr as LANGUAGE_CODES_MAPPER,
73
+ Hr as LANGUAGE_ID_MAPPER,
74
+ R as ListArea,
75
+ w as LoadingSpinner,
76
+ v as Modal,
77
+ Y as ModulePadding,
78
+ z as OverflowTooltip,
79
+ Mr as SPANISH_LANGUAGE_ID,
80
+ j as ScrollbarX,
81
+ q as ScrollbarY,
76
82
  Q as SearchBar,
77
83
  Z as Select,
78
- Ar as ThemeColor,
84
+ Pr as TURKISH_LANGUAGE_ID,
85
+ _r as ThemeColor,
79
86
  rr as VerticalDivider,
80
- Tr as capitalizeFirstLetters,
81
- Dr as getNumberAsLocaleString,
82
- Lr as trimLeadingAndTrailingSpaces,
83
- hr as useBreakpoints
87
+ Dr as capitalizeFirstLetters,
88
+ Cr as getNumberAsLocaleString,
89
+ gr as trimLeadingAndTrailingSpaces,
90
+ Ir as useBreakpoints
84
91
  };
@@ -1,4 +1,4 @@
1
- import { LANGUAGE_CODES } from '../types/Languages';
1
+ import { AVAILABLE_LANGUAGE_CODES } from '../types/Languages';
2
2
 
3
3
  /**
4
4
  * Capitalizes the first letter of every word in a given text string
@@ -22,4 +22,4 @@ export declare const trimLeadingAndTrailingSpaces: <T extends Record<string, unk
22
22
  * @param maximumFractionDigits - The maximum number of decimal digits (default is 2).
23
23
  * @returns The language-specific formatted number.
24
24
  */
25
- export declare const getNumberAsLocaleString: (locale: LANGUAGE_CODES, value?: number, maximumFractionDigits?: number) => string;
25
+ export declare const getNumberAsLocaleString: (locale: AVAILABLE_LANGUAGE_CODES, value?: number, maximumFractionDigits?: number) => string;
@@ -1,3 +1,96 @@
1
- export type LANGUAGE_COUNTRY_CODES = 'de-DE' | 'es-MX' | 'fr-FR' | 'en-US' | 'de-CH';
2
- export type LANGUAGE_CODES = 'es' | 'en';
3
- export declare const LANGUAGE_CODES_MAPPER: Record<LANGUAGE_CODES, LANGUAGE_COUNTRY_CODES>;
1
+ /**
2
+ * HortiView platform english language id
3
+ */
4
+ export declare const ENGLISH_LANGUAGE_ID = "bb8077e3-ad50-4c1d-8b17-b768b1c9f041";
5
+ /**
6
+ * HortiView platform german language id
7
+ */
8
+ export declare const GERMAN_LANGUAGE_ID = "bb8077e3-ad50-4c1d-8b17-b768b1c9f055";
9
+ /**
10
+ * HortiView platform spanish language id
11
+ */
12
+ export declare const SPANISH_LANGUAGE_ID = "bb8077e3-ad50-4c1d-8b17-b768b1c9f149";
13
+ /**
14
+ * HortiView platform turkish language id
15
+ */
16
+ export declare const TURKISH_LANGUAGE_ID = "bb8077e3-ad50-4c1d-8b17-b768b1c9f166";
17
+ /**
18
+ * Language id mapper for the HortiView platform
19
+ * @description
20
+ * It is a record object that maps the available language codes to the available language ids.
21
+ * The available language ids are:
22
+ * - English (en) mapped to {@link ENGLISH_LANGUAGE_ID}
23
+ * - Spanish (es) mapped to {@link SPANISH_LANGUAGE_ID}
24
+ * - Turkish (tr) mapped to {@link TURKISH_LANGUAGE_ID}
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const languageCode = 'en' as AVAILABLE_LANGUAGE_CODES;
29
+ * const languageId = LANGUAGE_ID_MAPPER[languageCode];
30
+ * console.log(languageId); // 'bb8077e3-ad50-4c1d-8b17-b768b1c9f041'
31
+ * ```
32
+ */
33
+ export declare const LANGUAGE_ID_MAPPER: {
34
+ en: string;
35
+ es: string;
36
+ tr: string;
37
+ };
38
+ /**
39
+ * Available languages for the HortiView platform
40
+ * @description
41
+ * It is a constant array of the available language codes in ISO 639-1:2002 format (2-digit).
42
+ * The available languages are:
43
+ *
44
+ * - English (en)
45
+ * - Spanish (es)
46
+ * - Turkish (tr)
47
+ */
48
+ export declare const AVAILABLE_LOCALES: readonly ["en", "es", "tr"];
49
+ /**
50
+ * Available language country codes for the HortiView platform
51
+ * @description
52
+ * It is a literal string type of the available language country codes in the format language-country, like 'en-US'.
53
+ * The available language country codes are:
54
+ * - English (en-US)
55
+ * - Spanish (es-MX)
56
+ * - Turkish (tr-TR)
57
+ */
58
+ export type LANGUAGE_COUNTRY_CODES = 'es-MX' | 'en-US' | 'tr-TR';
59
+ /**
60
+ * Available languages for the HortiView platform
61
+ * @description
62
+ * It is a literal string type of the available languages in in ISO 639-1:2002 format (2-digit). It is based in {@link AVAILABLE_LOCALES}.
63
+ * The available language country codes are:
64
+ * - English (en)
65
+ * - Spanish (es)
66
+ * - Turkish (tr)
67
+ */
68
+ export type AVAILABLE_LANGUAGE_CODES = (typeof AVAILABLE_LOCALES)[number];
69
+ /**
70
+ * Language codes mapper for the HortiView platform
71
+ * @description
72
+ * It is a record object that maps the available language codes to the available language country codes.
73
+ * The available language country codes are:
74
+ * - English (en) mapped to 'en-US'
75
+ * - Spanish (es) mapped to 'es-MX'
76
+ * - Turkish (tr) mapped to 'tr-TR'
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const languageCode = 'en' as AVAILABLE_LANGUAGE_CODES;
81
+ * const languageCountryCode = LANGUAGE_CODES_MAPPER[languageCode];
82
+ * console.log(languageCountryCode); // 'en-US'
83
+ * ```
84
+ */
85
+ export declare const LANGUAGE_CODES_MAPPER: Record<AVAILABLE_LANGUAGE_CODES, LANGUAGE_COUNTRY_CODES>;
86
+ /**
87
+ * Available country keys for the HortiView platform
88
+ * @description
89
+ * It is a constant array of the available country keys in ISO 3166-1 alpha-3 format (3-digit).
90
+ * The available country keys are:
91
+ *
92
+ * - Spain (esp)
93
+ * - Mexico (mex)
94
+ * - Turkey (tur)
95
+ */
96
+ export declare const AVAILABLE_COUNTRY_KEYS: string[];
@@ -1,7 +1,24 @@
1
- const e = {
1
+ const A = "bb8077e3-ad50-4c1d-8b17-b768b1c9f041", e = "bb8077e3-ad50-4c1d-8b17-b768b1c9f055", b = "bb8077e3-ad50-4c1d-8b17-b768b1c9f149", c = "bb8077e3-ad50-4c1d-8b17-b768b1c9f166", E = {
2
+ en: A,
3
+ es: b,
4
+ tr: c
5
+ }, _ = [
6
+ "en",
7
+ "es",
8
+ "tr"
9
+ // 'de' currently not supported
10
+ ], t = {
2
11
  en: "en-US",
3
- es: "es-MX"
4
- };
12
+ es: "es-MX",
13
+ tr: "tr-TR"
14
+ }, G = ["esp", "mex", "tur"];
5
15
  export {
6
- e as LANGUAGE_CODES_MAPPER
16
+ G as AVAILABLE_COUNTRY_KEYS,
17
+ _ as AVAILABLE_LOCALES,
18
+ A as ENGLISH_LANGUAGE_ID,
19
+ e as GERMAN_LANGUAGE_ID,
20
+ t as LANGUAGE_CODES_MAPPER,
21
+ E as LANGUAGE_ID_MAPPER,
22
+ b as SPANISH_LANGUAGE_ID,
23
+ c as TURKISH_LANGUAGE_ID
7
24
  };
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": "0.0.11589",
4
+ "version": "0.0.11797",
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>",