@hortiview/shared-components 0.0.9183 → 0.0.9233

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 (40) hide show
  1. package/dist/Iconify-B9ptjDuU.js +91 -0
  2. package/dist/_Map-2-rfNHMr.js +59 -0
  3. package/dist/{_baseToString-CW6fzR92.js → _baseToString-xTcv8tEN.js} +12 -12
  4. package/dist/{_equalByTag-D07t7TSb.js → _equalByTag-Bi6Uk01d.js} +13 -13
  5. package/dist/_overArg-BC4qXKbU.js +9 -0
  6. package/dist/components/BaseView/BaseView.js +45 -37
  7. package/dist/components/BasicHeading/BasicHeading.js +1 -1
  8. package/dist/components/BlockView/BlockView.js +15 -15
  9. package/dist/components/BlockView/BlockView.test.js +4 -4
  10. package/dist/components/ChipCard/ChipCard.js +11 -9
  11. package/dist/components/ContextMenu/ContextMenu.js +31 -31
  12. package/dist/components/ContextMenu/ContextMenu.test.js +17 -17
  13. package/dist/components/DeleteModal/DeleteModal.js +42 -33
  14. package/dist/components/EmptyView/EmptyView.js +21 -13
  15. package/dist/components/Filter/Filter.js +37 -36
  16. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +13 -4
  17. package/dist/components/FormComponents/FormSelect/FormSelect.js +88 -79
  18. package/dist/components/FormComponents/FormSlider/FormSlider.js +14 -13
  19. package/dist/components/FormComponents/FormText/FormText.js +36 -33
  20. package/dist/components/GenericTable/GenericTable.js +16 -15
  21. package/dist/components/HashTabView/HashTabView.js +68 -57
  22. package/dist/components/Iconify/Iconify.js +2 -2
  23. package/dist/components/Iconify/Iconify.test.js +1 -1
  24. package/dist/components/ListArea/ListArea.js +208 -198
  25. package/dist/components/ListArea/ListAreaService.d.ts +2 -0
  26. package/dist/components/ListArea/ListAreaService.js +42 -32
  27. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +1 -1
  28. package/dist/components/Modal/Modal.js +3 -2
  29. package/dist/components/SearchBar/SearchBar.js +16 -15
  30. package/dist/{get-BLA_8TrC.js → get-DAwLfiRB.js} +2 -2
  31. package/dist/{iconify.module-BX040Mko.js → iconify.module-D_I3-4iU.js} +11 -11
  32. package/dist/isArray-thIeLpc5.js +35 -0
  33. package/dist/isPlainObject-BlCDf1Kc.js +18 -0
  34. package/dist/main.js +1 -1
  35. package/dist/services/UtilService.js +6 -5
  36. package/dist/services/services.test.js +6 -3
  37. package/package.json +1 -1
  38. package/dist/Iconify-DV7QhHmp.js +0 -96
  39. package/dist/_Map-CMkK6TmZ.js +0 -54
  40. package/dist/isArray-D_4rqWbH.js +0 -43
@@ -1,111 +1,120 @@
1
- import { jsx as e, Fragment as $, jsxs as b } from "react/jsx-runtime";
1
+ import { jsx as r, Fragment as M, jsxs as b } from "react/jsx-runtime";
2
2
  import { Select as k } from "@element/react-components";
3
- import { g as h } from "../../../get-BLA_8TrC.js";
4
- import { i as z } from "../../../isArray-D_4rqWbH.js";
3
+ import { g as h } from "../../../get-DAwLfiRB.js";
4
+ import { i as z } from "../../../isArray-thIeLpc5.js";
5
5
  import { useMemo as S } from "react";
6
6
  import { useFormContext as B, Controller as C } from "react-hook-form";
7
7
  import { H as G } from "../../../react-tooltip.min-BzHiZW8k.js";
8
8
  import { SelectTooltipText as J } from "./SelectTooltipText.js";
9
9
  import { s as n } from "../../../formSelect.module-DMHh1bp8.js";
10
10
  const N = ({
11
- propertyName: r,
12
- label: d,
11
+ propertyName: e,
12
+ label: f,
13
13
  options: o,
14
- multi: m = !1,
14
+ multi: d = !1,
15
15
  disabled: T = !1,
16
16
  hoisted: F = !1,
17
17
  hidden: I = !1,
18
18
  valueKey: i = "value",
19
- textKey: p = "text",
19
+ textKey: H = "text",
20
20
  clearable: j = !1,
21
21
  searchable: v = !0,
22
22
  noOptionsMessage: w = "",
23
- rules: l,
24
- ...s
23
+ rules: s,
24
+ ...l
25
25
  }) => {
26
26
  const {
27
- control: H,
28
- formState: { errors: a, isValidating: q }
27
+ control: $,
28
+ formState: { errors: a, isValidating: p }
29
29
  } = B(), c = S(
30
- () => !q && h(a, r) !== void 0,
31
- [a, r, q]
30
+ () => !p && h(a, e) !== void 0,
31
+ [a, e, p]
32
32
  ), A = S(
33
- () => l?.required?.value,
34
- [l]
33
+ () => s?.required?.value,
34
+ [s]
35
35
  ), D = S(
36
- () => l?.required?.message,
37
- [l]
36
+ () => s?.required?.message,
37
+ [s]
38
38
  ), E = () => {
39
- if (a && a[r]) {
40
- const u = a[r]?.message;
39
+ if (a && a[e]) {
40
+ const u = a[e]?.message;
41
41
  return u || "Invalid input";
42
42
  }
43
43
  return D;
44
44
  };
45
- return I ? /* @__PURE__ */ e(C, { name: r, control: H, render: () => /* @__PURE__ */ e($, {}) }) : /* @__PURE__ */ e("div", { className: n.formSelectContainer, "data-tooltip-id": d, children: /* @__PURE__ */ e(
46
- C,
45
+ return I ? /* @__PURE__ */ r(C, { name: e, control: $, render: () => /* @__PURE__ */ r(M, {}) }) : /* @__PURE__ */ r(
46
+ "div",
47
47
  {
48
- name: r,
49
- rules: l,
50
- control: H,
51
- render: ({ field: { ref: u, onChange: x, value: M, ...O } }) => {
52
- let g = o;
53
- z(o) && h(o[0], "options") !== void 0 && (g = o.flatMap((t) => h(t, "options") ?? []));
54
- const f = m ? g?.filter(
55
- (t) => M?.includes(t[i])
56
- ) : g?.find((t) => t[i] === M), P = m && s.multiDisplayType === "text" && s.fixedHeightInput;
57
- return /* @__PURE__ */ b($, { children: [
58
- /* @__PURE__ */ e(
59
- k,
60
- {
61
- ...O,
62
- ...s,
63
- value: f ?? [],
64
- label: d,
65
- variant: "outlined",
66
- helperText: E(),
67
- helperTextPersistent: A || c,
68
- options: o,
69
- valid: !c,
70
- multiSelect: m,
71
- className: `${n.formSelect} ${c ? n.invalid : ""} ${P ? n.multiText : ""} ${T ? n.disabled : ""}`,
72
- disabled: T,
73
- valueKey: i,
74
- textKey: p,
75
- onChange: (t) => {
76
- if (t == null) {
77
- x(t);
78
- return;
48
+ "data-testid": "form-select-container",
49
+ className: n.formSelectContainer,
50
+ "data-tooltip-id": f,
51
+ children: /* @__PURE__ */ r(
52
+ C,
53
+ {
54
+ name: e,
55
+ rules: s,
56
+ control: $,
57
+ render: ({ field: { ref: u, onChange: x, value: q, ...O } }) => {
58
+ let g = o;
59
+ z(o) && h(o[0], "options") !== void 0 && (g = o.flatMap((t) => h(t, "options") ?? []));
60
+ const m = d ? g?.filter(
61
+ (t) => q?.includes(t[i])
62
+ ) : g?.find((t) => t[i] === q), P = d && l.multiDisplayType === "text" && l.fixedHeightInput;
63
+ return /* @__PURE__ */ b(M, { children: [
64
+ /* @__PURE__ */ r(
65
+ k,
66
+ {
67
+ ...O,
68
+ ...l,
69
+ value: m ?? [],
70
+ label: f,
71
+ variant: "outlined",
72
+ helperText: E(),
73
+ helperTextPersistent: A || c,
74
+ options: o,
75
+ valid: !c,
76
+ "data-testid": `select-${e}`,
77
+ multiSelect: d,
78
+ className: `${n.formSelect} ${c ? n.invalid : ""} ${P ? n.multiText : ""} ${T ? n.disabled : ""}`,
79
+ disabled: T,
80
+ valueKey: i,
81
+ textKey: H,
82
+ onChange: (t) => {
83
+ if (t == null) {
84
+ x(t);
85
+ return;
86
+ }
87
+ if (d) {
88
+ x(t.map((V) => V[i]));
89
+ return;
90
+ }
91
+ x(t[i]), l?.onChange?.(t);
92
+ },
93
+ hoisted: F,
94
+ noOptionsMessage: w,
95
+ searchable: v,
96
+ clearable: j,
97
+ menuMaxHeight: "15rem"
79
98
  }
80
- if (m) {
81
- x(t.map((V) => V[i]));
82
- return;
99
+ ),
100
+ /* @__PURE__ */ r(
101
+ G,
102
+ {
103
+ id: f,
104
+ noArrow: !0,
105
+ place: "bottom",
106
+ delayShow: 420,
107
+ className: n.tooltip,
108
+ hidden: !m || m.length === 0 || !l.fixedHeightInput,
109
+ children: /* @__PURE__ */ r(J, { value: m, textKey: H, valueKey: i })
83
110
  }
84
- x(t[i]), s?.onChange?.(t);
85
- },
86
- hoisted: F,
87
- noOptionsMessage: w,
88
- searchable: v,
89
- clearable: j,
90
- menuMaxHeight: "15rem"
91
- }
92
- ),
93
- /* @__PURE__ */ e(
94
- G,
95
- {
96
- id: d,
97
- noArrow: !0,
98
- place: "bottom",
99
- delayShow: 420,
100
- className: n.tooltip,
101
- hidden: !f || f.length === 0 || !s.fixedHeightInput,
102
- children: /* @__PURE__ */ e(J, { value: f, textKey: p, valueKey: i })
103
- }
104
- )
105
- ] });
106
- }
111
+ )
112
+ ] });
113
+ }
114
+ }
115
+ )
107
116
  }
108
- ) });
117
+ );
109
118
  };
110
119
  export {
111
120
  N as FormSelect
@@ -1,29 +1,30 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Slider as s } from "@element/react-components";
3
- import { useFormContext as u, Controller as x } from "react-hook-form";
2
+ import { Slider as d } from "@element/react-components";
3
+ import { useFormContext as p, Controller as u } from "react-hook-form";
4
4
  const f = ({
5
- propertyName: n,
6
- label: e,
7
- minValue: t,
5
+ propertyName: e,
6
+ label: t,
7
+ minValue: n,
8
8
  maxValue: m,
9
9
  step: a,
10
10
  disabled: i
11
11
  }) => {
12
- const { control: l } = u();
12
+ const { control: l } = p();
13
13
  return /* @__PURE__ */ o(
14
- x,
14
+ u,
15
15
  {
16
- name: n,
16
+ name: e,
17
17
  control: l,
18
18
  render: ({ field: r }) => /* @__PURE__ */ o(
19
- s,
19
+ d,
20
20
  {
21
+ "data-testid": "slider",
21
22
  ...r,
22
- onChange: (p) => {
23
- r.onChange(p.value);
23
+ onChange: (s) => {
24
+ r.onChange(s.value);
24
25
  },
25
- label: e,
26
- min: t,
26
+ label: t,
27
+ min: n,
27
28
  max: m,
28
29
  step: a,
29
30
  disabled: i
@@ -1,58 +1,60 @@
1
1
  import { jsx as t, Fragment as S, jsxs as J } from "react/jsx-runtime";
2
2
  import { Textfield as K, TypoCaption as O } from "@element/react-components";
3
- import { g as B } from "../../../get-BLA_8TrC.js";
3
+ import { g as B } from "../../../get-DAwLfiRB.js";
4
4
  import { useState as A, useCallback as Q, useMemo as c, useEffect as U } from "react";
5
5
  import { useFormContext as X, Controller as j } from "react-hook-form";
6
6
  import { s as i } from "../../../formText.module-C0by6_DK.js";
7
7
  const Y = ({
8
8
  count: e,
9
- maxCount: d,
10
- invalid: m = !1,
9
+ maxCount: u,
10
+ invalid: f = !1,
11
11
  hasRequiredText: r = !1
12
12
  }) => /* @__PURE__ */ t(
13
13
  "div",
14
14
  {
15
- className: `${i.formTextAreaHelperText} ${m ? i.invalid : ""} ${r ? i.required : ""}`,
16
- children: /* @__PURE__ */ t(O, { children: `${e}/${d}` })
15
+ "data-testid": "character-counter-container",
16
+ className: `${i.formTextAreaHelperText} ${f ? i.invalid : ""} ${r ? i.required : ""}`,
17
+ children: /* @__PURE__ */ t(O, { children: `${e}/${u}` })
17
18
  }
18
- ), re = (e) => e.textarea ? /* @__PURE__ */ t(Z, { ...e }) : /* @__PURE__ */ t(_, { ...e }), Z = (e) => /* @__PURE__ */ t("div", { className: i.formTextArea, children: /* @__PURE__ */ t(k, { ...e }) }), _ = (e) => /* @__PURE__ */ t(
19
+ ), re = (e) => e.textarea ? /* @__PURE__ */ t(Z, { ...e }) : /* @__PURE__ */ t(_, { ...e }), Z = (e) => /* @__PURE__ */ t("div", { "data-testid": "form-text-area", className: i.formTextArea, children: /* @__PURE__ */ t(k, { ...e }) }), _ = (e) => /* @__PURE__ */ t(
19
20
  "div",
20
21
  {
22
+ "data-testid": "form-text-field",
21
23
  className: `${e.hasCharacterCount ? i.characterCount : i.withoutCharacterCount}`,
22
24
  children: /* @__PURE__ */ t(k, { ...e })
23
25
  }
24
26
  ), k = ({
25
27
  propertyName: e,
26
- label: d,
27
- disabled: m = !1,
28
+ label: u,
29
+ disabled: f = !1,
28
30
  textarea: r = !1,
29
- hasCharacterCount: u = !1,
31
+ hasCharacterCount: d = !1,
30
32
  hidden: H = !1,
31
33
  placeholder: R,
32
34
  type: b,
33
35
  prefixText: w,
34
36
  inputMode: z,
35
37
  trailingIcon: E,
36
- trigger: v = "likeForm",
38
+ trigger: h = "likeForm",
37
39
  rules: n,
38
- ...x
40
+ ...v
39
41
  }) => {
40
42
  const {
41
43
  control: T,
42
- getFieldState: f,
44
+ getFieldState: m,
43
45
  formState: { errors: C },
44
- trigger: F
45
- } = X(), [I, g] = A(0), [o, M] = A(), h = Q(
46
+ trigger: $
47
+ } = X(), [I, x] = A(0), [o, M] = A(), g = Q(
46
48
  (l) => {
47
49
  if (o != null) {
48
- g(o.length);
50
+ x(o.length);
49
51
  return;
50
52
  }
51
53
  if (l) {
52
- g(l.length);
54
+ x(l.length);
53
55
  return;
54
56
  }
55
- g(0);
57
+ x(0);
56
58
  },
57
59
  [o]
58
60
  ), P = () => {
@@ -61,7 +63,7 @@ const Y = ({
61
63
  const s = l.message;
62
64
  return s || "Invalid input";
63
65
  }
64
- return $;
66
+ return F;
65
67
  }, a = c(
66
68
  () => n?.maxLength?.value,
67
69
  [n]
@@ -71,13 +73,13 @@ const Y = ({
71
73
  ), W = c(
72
74
  () => n?.required?.value,
73
75
  [n]
74
- ), $ = c(
76
+ ), F = c(
75
77
  () => n?.required?.message,
76
78
  [n]
77
79
  );
78
80
  return U(() => {
79
- (r || u) && a !== void 0 && o != null && h();
80
- }, [o, r, u, a, h]), H ? /* @__PURE__ */ t(j, { name: e, control: T, render: () => /* @__PURE__ */ t(S, {}) }) : /* @__PURE__ */ t(
81
+ (r || d) && a !== void 0 && o != null && g();
82
+ }, [o, r, d, a, g]), H ? /* @__PURE__ */ t(j, { name: e, control: T, render: () => /* @__PURE__ */ t(S, {}) }) : /* @__PURE__ */ t(
81
83
  j,
82
84
  {
83
85
  name: e,
@@ -85,47 +87,48 @@ const Y = ({
85
87
  control: T,
86
88
  render: ({ field: { ref: l, ...s }, formState: { defaultValues: D } }) => {
87
89
  const q = B(D, e);
88
- return !o && q && (u || r) && h(q), /* @__PURE__ */ J(S, { children: [
90
+ return !o && q && (d || r) && g(q), /* @__PURE__ */ J(S, { children: [
89
91
  /* @__PURE__ */ t(
90
92
  K,
91
93
  {
92
- ...x,
94
+ ...v,
93
95
  ...s,
94
96
  value: s.value ?? "",
95
97
  type: b,
96
98
  fullWidth: !0,
99
+ "data-testid": `textfield-${e}`,
97
100
  inputMode: z,
98
101
  placeholder: R,
99
102
  prefixText: w,
100
- disabled: m,
103
+ disabled: f,
101
104
  helperText: P(),
102
- helperTextPersistent: C !== void 0 || W || a !== void 0 && (r || u),
103
- label: d,
105
+ helperTextPersistent: C !== void 0 || W || a !== void 0 && (r || d),
106
+ label: u,
104
107
  variant: "outlined",
105
108
  maxlength: a,
106
109
  minLength: V,
107
110
  textarea: r,
108
111
  noResize: !1,
109
112
  onBlur: () => {
110
- v === "onBlur" && F(e), x.onBlur?.();
113
+ h === "onBlur" && $(e), v.onBlur?.();
111
114
  },
112
115
  onChange: (L) => {
113
116
  s.onChange(L);
114
117
  const G = L?.target?.value;
115
- M(G), v === "onChange" && F(e);
118
+ M(G), h === "onChange" && $(e);
116
119
  },
117
- valid: !f(e).invalid,
118
- className: `${i.formText} ${f(e).invalid ? i.invalid : ""}`,
120
+ valid: !m(e).invalid,
121
+ className: `${i.formText} ${m(e).invalid ? i.invalid : ""}`,
119
122
  trailingIcon: E
120
123
  }
121
124
  ),
122
- a !== void 0 && (u || r) && /* @__PURE__ */ t(
125
+ a !== void 0 && (d || r) && /* @__PURE__ */ t(
123
126
  Y,
124
127
  {
125
128
  count: I,
126
129
  maxCount: a,
127
- invalid: f(e).invalid,
128
- hasRequiredText: !!$
130
+ invalid: m(e).invalid,
131
+ hasRequiredText: !!F
129
132
  }
130
133
  )
131
134
  ] });
@@ -4,13 +4,13 @@ import { Fragment as C } from "react";
4
4
  import { a as t } from "../../genericTable.module-Dk3yy2S3.js";
5
5
  import { u as j } from "../../useBreakpoints-MzTZ0tCT.js";
6
6
  import "../../alertBanner.module-BPiKN0gh.js";
7
- import "../../iconify.module-BX040Mko.js";
8
- import "../../isArray-D_4rqWbH.js";
7
+ import "../../iconify.module-D_I3-4iU.js";
8
+ import "../../isArray-thIeLpc5.js";
9
9
  import "../../react-tooltip.min-BzHiZW8k.js";
10
10
  import "../../overflowTooltip.module-YyRN2MGc.js";
11
11
  import "../../basicHeading.module-BYb8xvuk.js";
12
- import "../../_baseToString-CW6fzR92.js";
13
- import "../../_equalByTag-D07t7TSb.js";
12
+ import "../../_baseToString-xTcv8tEN.js";
13
+ import "../../_equalByTag-Bi6Uk01d.js";
14
14
  import "../../searchBar.module-9gKyrZRT.js";
15
15
  import "../../listArea.module-BhO_OJ1S.js";
16
16
  import "../../verticalDivider.module-C3_GL-fH.js";
@@ -32,15 +32,16 @@ import "react-hook-form";
32
32
  import "../../formDatePicker.module-BV3ma_7y.js";
33
33
  import "../../formSelect.module-DMHh1bp8.js";
34
34
  import "../../formText.module-C0by6_DK.js";
35
+ import "../../isPlainObject-BlCDf1Kc.js";
35
36
  import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
36
37
  import { GenericCardList as A } from "./Mobile/GenericCardList.js";
37
- const gr = ({
38
- data: l = [],
39
- hiddenColumns: n = [],
38
+ const hr = ({
39
+ data: p = [],
40
+ hiddenColumns: l = [],
40
41
  order: f = [],
41
42
  cellTemplates: g = void 0,
42
43
  tableActions: i = [],
43
- noContentText: p = "No data available",
44
+ noContentText: n = "No data available",
44
45
  headerTranslation: h = (a) => a,
45
46
  pagination: y = !1,
46
47
  getRowActions: s = void 0,
@@ -50,7 +51,7 @@ const gr = ({
50
51
  cardSubTitleColumn: T
51
52
  }) => {
52
53
  const { isDesktop: a } = j(), o = x({
53
- data: l,
54
+ data: p,
54
55
  order: f,
55
56
  cellTemplates: g,
56
57
  headerTranslation: h,
@@ -59,7 +60,7 @@ const gr = ({
59
60
  cardTitleColumn: v,
60
61
  cardSubTitleColumn: T
61
62
  }), d = _({
62
- data: l,
63
+ data: p,
63
64
  getRowActions: s
64
65
  });
65
66
  return a ? /* @__PURE__ */ r(D, { elevation: 1, className: t.elevation, "data-testid": "generic-table-elevation", children: /* @__PURE__ */ r(
@@ -70,7 +71,7 @@ const gr = ({
70
71
  fullWidth: !0,
71
72
  alwaysUseDivTags: !0,
72
73
  layout: "standard",
73
- hiddenColumns: n,
74
+ hiddenColumns: l,
74
75
  data: d,
75
76
  columns: o,
76
77
  leadingContent: e && i?.length === 0 ? /* @__PURE__ */ r(u, { title: e }) : i?.length > 0 && /* @__PURE__ */ r(
@@ -102,7 +103,7 @@ const gr = ({
102
103
  primaryAlign: "center",
103
104
  secondaryAlign: "center",
104
105
  className: t.emptyTable,
105
- children: /* @__PURE__ */ r(k, { children: p })
106
+ children: /* @__PURE__ */ r(k, { children: n })
106
107
  }
107
108
  )
108
109
  }
@@ -111,11 +112,11 @@ const gr = ({
111
112
  {
112
113
  data: d,
113
114
  columns: o,
114
- hiddenColumns: n,
115
- noContentText: p
115
+ hiddenColumns: l,
116
+ noContentText: n
116
117
  }
117
118
  ) });
118
119
  };
119
120
  export {
120
- gr as GenericTable
121
+ hr as GenericTable
121
122
  };
@@ -1,73 +1,84 @@
1
- import { jsx as i, jsxs as m, Fragment as y } from "react/jsx-runtime";
2
- import { Elevation as I, Group as o, TabBar as N, Tab as $, Padding as b } from "@element/react-components";
1
+ import { jsx as i, jsxs as m, Fragment as B } from "react/jsx-runtime";
2
+ import { Elevation as $, Group as o, TabBar as y, Tab as I, Padding as N } from "@element/react-components";
3
3
  import { useState as k, useEffect as w } from "react";
4
4
  import { u as x } from "../../useBreakpoints-MzTZ0tCT.js";
5
- import { s as r } from "../../HashTabView.module-DUekkiTC.js";
6
- const u = (n, t) => !t || !n ? 0 : n.findIndex((a) => a.hash === t.replace("#", "")) ?? 0, z = ({
7
- tabs: n,
8
- hasHash: t = !0,
9
- hash: a = "",
5
+ import { s as a } from "../../HashTabView.module-DUekkiTC.js";
6
+ const u = (t, n) => !n || !t ? 0 : t.findIndex((r) => r.hash === n.replace("#", "")) ?? 0, z = ({
7
+ tabs: t,
8
+ hasHash: n = !0,
9
+ hash: r = "",
10
10
  clusterAlign: f = "start",
11
- hasClusteredTabs: g,
11
+ hasClusteredTabs: h,
12
12
  children: s,
13
- verticalGap: v = "none",
14
- elevation: h = 0,
13
+ verticalGap: g = "none",
14
+ elevation: v = 0,
15
15
  backgroundColor: T = "themeBackground",
16
- onChange: A
16
+ onChange: b
17
17
  }) => {
18
- const [l, p] = k(u(n, a)), { isDesktop: d } = x();
18
+ const [l, p] = k(u(t, r)), { isDesktop: d } = x();
19
19
  w(() => {
20
- if (!t || !a)
20
+ if (!n || !r)
21
21
  return;
22
- const e = u(n, a);
22
+ const e = u(t, r);
23
23
  p(e);
24
- }, [n, a, t]);
25
- const B = (e) => {
26
- const c = n[e].hash;
27
- c != null && t && window.history.replaceState(null, "", `#${c}`), p(e), A?.(e);
24
+ }, [t, r, n]);
25
+ const A = (e) => {
26
+ const c = t[e].hash;
27
+ c != null && n && window.history.replaceState(null, "", `#${c}`), p(e), b?.(e);
28
28
  };
29
29
  return /* @__PURE__ */ i(
30
- I,
30
+ $,
31
31
  {
32
- elevation: h,
33
- className: `${r.elevation} ${T === "none" ? "" : r.themeBackground}`,
34
- children: /* @__PURE__ */ m(o, { direction: "vertical", gap: v, secondaryAlign: "stretch", children: [
35
- /* @__PURE__ */ m(o, { direction: d ? "horizontal" : "vertical", className: r.tabWrapper, children: [
36
- /* @__PURE__ */ i(
37
- N,
38
- {
39
- className: r.tabBar,
40
- clustered: d ? g : !1,
41
- clusterAlign: f,
42
- variant: "surface",
43
- activeTabIndex: l,
44
- onTabActivated: B,
45
- children: n.map((e, c) => /* @__PURE__ */ i(
46
- $,
32
+ elevation: v,
33
+ className: `${a.elevation} ${T === "none" ? "" : a.themeBackground}`,
34
+ children: /* @__PURE__ */ m(
35
+ o,
36
+ {
37
+ "data-testid": "hash-tab-container",
38
+ direction: "vertical",
39
+ gap: g,
40
+ secondaryAlign: "stretch",
41
+ children: [
42
+ /* @__PURE__ */ m(o, { direction: d ? "horizontal" : "vertical", className: a.tabWrapper, children: [
43
+ /* @__PURE__ */ i(
44
+ y,
47
45
  {
48
- icon: e.leadingIcon,
49
- className: s ? r.tabButton : "",
50
- active: l === c,
51
- children: /* @__PURE__ */ m(o, { gap: "dense", children: [
52
- e.title,
53
- e.trailingIcon
54
- ] })
55
- },
56
- `${c}_${e.hash}`
57
- ))
58
- }
59
- ),
60
- s ? /* @__PURE__ */ i(
61
- b,
62
- {
63
- variant: "dense",
64
- className: d ? r.childContainer : r.childContainerPhone,
65
- children: /* @__PURE__ */ i(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: s })
66
- }
67
- ) : /* @__PURE__ */ i(y, {})
68
- ] }),
69
- n[l]?.component
70
- ] })
46
+ "data-testid": "tab-bar",
47
+ className: a.tabBar,
48
+ clustered: d ? h : !1,
49
+ clusterAlign: f,
50
+ variant: "surface",
51
+ activeTabIndex: l,
52
+ onTabActivated: A,
53
+ children: t.map((e, c) => /* @__PURE__ */ i(
54
+ I,
55
+ {
56
+ "data-testid": `tab-${e.title}`,
57
+ icon: e.leadingIcon,
58
+ className: s ? a.tabButton : "",
59
+ active: l === c,
60
+ children: /* @__PURE__ */ m(o, { gap: "dense", children: [
61
+ e.title,
62
+ e.trailingIcon
63
+ ] })
64
+ },
65
+ `${c}_${e.hash}`
66
+ ))
67
+ }
68
+ ),
69
+ s ? /* @__PURE__ */ i(
70
+ N,
71
+ {
72
+ variant: "dense",
73
+ className: d ? a.childContainer : a.childContainerPhone,
74
+ children: /* @__PURE__ */ i(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: s })
75
+ }
76
+ ) : /* @__PURE__ */ i(B, {})
77
+ ] }),
78
+ t[l]?.component
79
+ ]
80
+ }
81
+ )
71
82
  }
72
83
  );
73
84
  };
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@element/react-components";
3
- import { I as f } from "../../Iconify-DV7QhHmp.js";
3
+ import { I as f } from "../../Iconify-B9ptjDuU.js";
4
4
  import "../../enums/AvailableCustomIcons.js";
5
- import "../../iconify.module-BX040Mko.js";
5
+ import "../../iconify.module-D_I3-4iU.js";
6
6
  export {
7
7
  f as Iconify
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { I as c } from "../../Iconify-DV7QhHmp.js";
2
+ import { I as c } from "../../Iconify-B9ptjDuU.js";
3
3
  import { AvailableCustomIcons as l } from "../../enums/AvailableCustomIcons.js";
4
4
  import { a as r, w as s, s as i } from "../../react.esm-Dy4VzU4L.js";
5
5
  import { d as f, t as a, g as o } from "../../vi.JYQecGiw-BbUbJcT8.js";