@hortiview/shared-components 0.0.4775 → 0.0.4779

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 (48) hide show
  1. package/dist/ListAreaService-BPp_O2BH.js +67 -0
  2. package/dist/assets/DeleteModal.css +1 -22
  3. package/dist/assets/main.css +22 -0
  4. package/dist/components/BaseView/BaseView.js +23 -21
  5. package/dist/components/BaseView/BaseView.test.js +1 -1
  6. package/dist/components/BasicHeading/BasicHeading.js +52 -41
  7. package/dist/components/BlockView/BlockView.js +51 -41
  8. package/dist/components/DeleteModal/DeleteModal.js +34 -51
  9. package/dist/components/Disclaimer/Disclaimer.js +11 -8
  10. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +31 -29
  11. package/dist/components/FormComponents/FormSelect/FormSelect.js +57 -53
  12. package/dist/components/FormComponents/FormText/FormText.js +64 -59
  13. package/dist/components/HashTabView/HashTabView.js +48 -40
  14. package/dist/components/HeaderFilter/HeaderFilter.js +16 -14
  15. package/dist/components/ListArea/ListArea.js +494 -283
  16. package/dist/components/ListArea/ListArea.test.js +1 -1
  17. package/dist/components/ListArea/ListAreaService.js +8 -55
  18. package/dist/components/SearchBar/SearchBar.js +23 -21
  19. package/dist/components/VerticalDivider/VerticalDivider.js +6 -4
  20. package/dist/get-Dyz8NMrE.js +321 -0
  21. package/dist/hooks/useBreakpoint.js +2 -2
  22. package/dist/main.js +44 -43
  23. package/dist/{useBreakpoint-DyAmuka7.js → useBreakpoint-DROHPVxO.js} +2 -2
  24. package/package.json +1 -1
  25. package/dist/BlockView.module-8kbPxxc4.js +0 -15
  26. package/dist/HashTabView.module-BY0tbl3B.js +0 -13
  27. package/dist/HeaderFilter.module-DiBmulr5.js +0 -7
  28. package/dist/_baseToString-ByHt83eL.js +0 -282
  29. package/dist/_getTag-D4bRay2z.js +0 -226
  30. package/dist/baseView.module-DXWalo9p.js +0 -7
  31. package/dist/basicHeading.module-ClcvD7x2.js +0 -16
  32. package/dist/disclaimer.module-BZydt-Q_.js +0 -8
  33. package/dist/formDatePicker.module-DllLVp7D.js +0 -7
  34. package/dist/formSelect.module-CdHEvmH_.js +0 -9
  35. package/dist/formText.module-3BZ0M2vV.js +0 -10
  36. package/dist/get-BYajYtEc.js +0 -46
  37. package/dist/listArea.module-B04TR5bj.js +0 -14
  38. package/dist/searchBar.module-9gKyrZRT.js +0 -7
  39. package/dist/verticalDivider.module-C3_GL-fH.js +0 -7
  40. /package/dist/assets/{baseView.css → BaseView.css} +0 -0
  41. /package/dist/assets/{basicHeading.css → BasicHeading.css} +0 -0
  42. /package/dist/assets/{disclaimer.css → Disclaimer.css} +0 -0
  43. /package/dist/assets/{formDatePicker.css → FormDatePicker.css} +0 -0
  44. /package/dist/assets/{formSelect.css → FormSelect.css} +0 -0
  45. /package/dist/assets/{formText.css → FormText.css} +0 -0
  46. /package/dist/assets/{listArea.css → ListAreaService.css} +0 -0
  47. /package/dist/assets/{searchBar.css → SearchBar.css} +0 -0
  48. /package/dist/assets/{verticalDivider.css → VerticalDivider.css} +0 -0
@@ -1,69 +1,73 @@
1
- import { jsx as s, Fragment as V } from "react/jsx-runtime";
2
- import { Select as k } from "@element/react-components";
3
- import { g as u } from "../../../get-BYajYtEc.js";
4
- import { useState as v, useMemo as w, useEffect as z } from "react";
5
- import { useFormContext as A, Controller as x } from "react-hook-form";
6
- import { s as i } from "../../../formSelect.module-CdHEvmH_.js";
7
- const Q = ({
8
- propertyName: r,
9
- label: S,
10
- required: m = !1,
1
+ import "../../../assets/FormSelect.css";
2
+ import { jsx as o, Fragment as H } from "react/jsx-runtime";
3
+ import { Select as P } from "@element/react-components";
4
+ import { g as S } from "../../../get-Dyz8NMrE.js";
5
+ import { useState as V, useMemo as k, useEffect as w } from "react";
6
+ import { useFormContext as z, Controller as u } from "react-hook-form";
7
+ const A = "_invalid_1vo1h_1", B = "_formSelect_1vo1h_5", D = "_formSelectContainer_1vo1h_9", f = {
8
+ invalid: A,
9
+ formSelect: B,
10
+ formSelectContainer: D
11
+ }, U = ({
12
+ propertyName: t,
13
+ label: _,
14
+ required: c = !1,
11
15
  requiredText: h,
12
- options: o,
13
- multi: n = !1,
14
- disabled: g = !1,
15
- hoisted: F = !1,
16
+ options: l,
17
+ multi: s = !1,
18
+ disabled: x = !1,
19
+ hoisted: v = !1,
16
20
  hidden: C = !1,
17
- valueKey: t = "value",
18
- textKey: E = "text",
19
- clearable: M = !1,
20
- noOptionsMessage: T = ""
21
+ valueKey: r = "value",
22
+ textKey: g = "text",
23
+ clearable: F = !1,
24
+ noOptionsMessage: E = ""
21
25
  }) => {
22
26
  const {
23
- control: a,
24
- formState: { errors: l }
25
- } = A(), [c, $] = v(!0), b = w(() => u(l, r) !== void 0, [l, r]);
26
- return z(() => {
27
- $(u(l, r) === void 0);
28
- }, [l, b, r]), C ? /* @__PURE__ */ s(x, { name: r, control: a, render: () => /* @__PURE__ */ s(V, {}) }) : /* @__PURE__ */ s("div", { className: i.formSelectContainer, children: /* @__PURE__ */ s(
29
- x,
27
+ control: m,
28
+ formState: { errors: n }
29
+ } = z(), [a, M] = V(!0), T = k(() => S(n, t) !== void 0, [n, t]);
30
+ return w(() => {
31
+ M(S(n, t) === void 0);
32
+ }, [n, T, t]), C ? /* @__PURE__ */ o(u, { name: t, control: m, render: () => /* @__PURE__ */ o(H, {}) }) : /* @__PURE__ */ o("div", { className: f.formSelectContainer, children: /* @__PURE__ */ o(
33
+ u,
30
34
  {
31
- name: r,
35
+ name: t,
32
36
  rules: {
33
- required: m
37
+ required: c
34
38
  },
35
- control: a,
36
- render: ({ field: { ref: B, onChange: f, value: d, ...j } }) => {
37
- const H = n ? o?.filter(
38
- (e) => d?.includes(e[t])
39
- ) : o?.find((e) => e[t] === d);
40
- return /* @__PURE__ */ s(
41
- k,
39
+ control: m,
40
+ render: ({ field: { ref: G, onChange: i, value: d, ...$ } }) => {
41
+ const b = s ? l?.filter(
42
+ (e) => d?.includes(e[r])
43
+ ) : l?.find((e) => e[r] === d);
44
+ return /* @__PURE__ */ o(
45
+ P,
42
46
  {
43
- ...j,
44
- value: H,
45
- label: S,
47
+ ...$,
48
+ value: b,
49
+ label: _,
46
50
  variant: "outlined",
47
51
  helperText: h,
48
- helperTextPersistent: m,
49
- options: o,
50
- valid: c,
51
- multiSelect: n,
52
- className: `${i.formSelect} ${c ? "" : i.invalid}`,
53
- disabled: g,
54
- valueKey: t,
55
- textKey: E,
52
+ helperTextPersistent: c,
53
+ options: l,
54
+ valid: a,
55
+ multiSelect: s,
56
+ className: `${f.formSelect} ${a ? "" : f.invalid}`,
57
+ disabled: x,
58
+ valueKey: r,
59
+ textKey: g,
56
60
  onChange: (e) => {
57
61
  if (e == null)
58
- return f(e);
59
- if (n)
60
- return f(e.map((P) => P[t]));
61
- f(e[t]);
62
+ return i(e);
63
+ if (s)
64
+ return i(e.map((j) => j[r]));
65
+ i(e[r]);
62
66
  },
63
- hoisted: F,
64
- noOptionsMessage: T,
67
+ hoisted: v,
68
+ noOptionsMessage: E,
65
69
  searchable: !0,
66
- clearable: M,
70
+ clearable: F,
67
71
  menuMaxHeight: "15rem"
68
72
  }
69
73
  );
@@ -72,5 +76,5 @@ const Q = ({
72
76
  ) });
73
77
  };
74
78
  export {
75
- Q as FormSelect
79
+ U as FormSelect
76
80
  };
@@ -1,103 +1,108 @@
1
- import { jsx as t, Fragment as R, jsxs as V } from "react/jsx-runtime";
2
- import { Textfield as W } from "@element/react-components";
3
- import { useState as b } from "react";
4
- import { useFormContext as w, Controller as g } from "react-hook-form";
5
- import { s as a } from "../../../formText.module-3BZ0M2vV.js";
6
- const D = ({
1
+ import "../../../assets/FormText.css";
2
+ import { jsx as t, Fragment as P, jsxs as R } from "react/jsx-runtime";
3
+ import { Textfield as V } from "@element/react-components";
4
+ import { useState as W } from "react";
5
+ import { useFormContext as b, Controller as _ } from "react-hook-form";
6
+ const w = "_formTextAreaHelperText_7ae2c_1", D = "_invalid_7ae2c_6", E = "_formText_7ae2c_1", G = "_formTextArea_7ae2c_1", s = {
7
+ formTextAreaHelperText: w,
8
+ invalid: D,
9
+ formText: E,
10
+ formTextArea: G
11
+ }, J = ({
7
12
  count: e,
8
- maxCount: u,
13
+ maxCount: c,
9
14
  required: r = !1,
10
15
  requiredText: l = ""
11
- }) => /* @__PURE__ */ V("div", { className: a.formTextAreaHelperText, children: [
16
+ }) => /* @__PURE__ */ R("div", { className: s.formTextAreaHelperText, children: [
12
17
  r ? /* @__PURE__ */ t("div", { children: l }) : /* @__PURE__ */ t("div", {}),
13
- /* @__PURE__ */ t("div", { children: `${e}/${u}` })
14
- ] }), X = (e) => e.textarea ? /* @__PURE__ */ t(E, { ...e }) : /* @__PURE__ */ t(G, { ...e }), E = (e) => /* @__PURE__ */ t("div", { className: a.formTextArea, children: /* @__PURE__ */ t(h, { ...e }) }), G = (e) => /* @__PURE__ */ t(h, { ...e }), h = ({
18
+ /* @__PURE__ */ t("div", { children: `${e}/${c}` })
19
+ ] }), p = (e) => e.textarea ? /* @__PURE__ */ t(K, { ...e }) : /* @__PURE__ */ t(O, { ...e }), K = (e) => /* @__PURE__ */ t("div", { className: s.formTextArea, children: /* @__PURE__ */ t(g, { ...e }) }), O = (e) => /* @__PURE__ */ t(g, { ...e }), g = ({
15
20
  propertyName: e,
16
- label: u,
21
+ label: c,
17
22
  maxLength: r,
18
23
  minLength: l,
19
- required: c = !1,
20
- requiredText: f = "",
21
- disabled: C = !1,
24
+ required: f = !1,
25
+ requiredText: m = "",
26
+ disabled: h = !1,
22
27
  textarea: i = !1,
23
- hidden: F = !1,
24
- pattern: S,
25
- placeholder: $,
26
- type: A,
27
- prefixText: B,
28
- inputMode: H,
29
- trailingIcon: j,
30
- trigger: d = "likeForm",
31
- validate: k
28
+ hidden: C = !1,
29
+ pattern: A,
30
+ placeholder: F,
31
+ type: H,
32
+ prefixText: S,
33
+ inputMode: $,
34
+ trailingIcon: B,
35
+ trigger: u = "likeForm",
36
+ validate: j
32
37
  }) => {
33
38
  const {
34
- control: m,
35
- getFieldState: v,
36
- formState: { errors: s },
37
- trigger: x
38
- } = w(), [z, I] = b(0), M = (n) => {
39
+ control: x,
40
+ getFieldState: T,
41
+ formState: { errors: a },
42
+ trigger: d
43
+ } = b(), [k, z] = W(0), I = (n) => {
39
44
  const o = n.target.value;
40
- I(o?.length ?? 0);
41
- }, P = () => {
42
- if (s && s[e]) {
43
- const n = s[e]?.message;
45
+ z(o?.length ?? 0);
46
+ }, M = () => {
47
+ if (a && a[e]) {
48
+ const n = a[e]?.message;
44
49
  return n || "Invalid input";
45
50
  }
46
51
  return r && i ? /* @__PURE__ */ t(
47
- D,
52
+ J,
48
53
  {
49
- count: z,
54
+ count: k,
50
55
  maxCount: r,
51
- required: c,
52
- requiredText: f
56
+ required: f,
57
+ requiredText: m
53
58
  }
54
- ) : f;
59
+ ) : m;
55
60
  };
56
- return F ? /* @__PURE__ */ t(g, { name: e, control: m, render: () => /* @__PURE__ */ t(R, {}) }) : /* @__PURE__ */ t(
57
- g,
61
+ return C ? /* @__PURE__ */ t(_, { name: e, control: x, render: () => /* @__PURE__ */ t(P, {}) }) : /* @__PURE__ */ t(
62
+ _,
58
63
  {
59
64
  name: e,
60
65
  rules: {
61
- required: c,
66
+ required: f,
62
67
  maxLength: r,
63
68
  minLength: l,
64
- pattern: S,
65
- validate: k
69
+ pattern: A,
70
+ validate: j
66
71
  },
67
- control: m,
72
+ control: x,
68
73
  render: ({ field: { ref: n, ...o } }) => /* @__PURE__ */ t(
69
- W,
74
+ V,
70
75
  {
71
76
  ...o,
72
77
  value: o.value ?? "",
73
- type: A,
78
+ type: H,
74
79
  fullWidth: !0,
75
- inputMode: H,
76
- placeholder: $,
77
- prefixText: B,
78
- disabled: C,
79
- helperText: P(),
80
- helperTextPersistent: s !== void 0 || c || r !== void 0 && i,
81
- label: u,
80
+ inputMode: $,
81
+ placeholder: F,
82
+ prefixText: S,
83
+ disabled: h,
84
+ helperText: M(),
85
+ helperTextPersistent: a !== void 0 || f || r !== void 0 && i,
86
+ label: c,
82
87
  variant: "outlined",
83
88
  maxlength: r,
84
89
  minLength: l,
85
90
  textarea: i,
86
91
  noResize: !1,
87
92
  onBlur: () => {
88
- d === "onBlur" && x(e);
93
+ u === "onBlur" && d(e);
89
94
  },
90
- onChange: (T) => {
91
- o.onChange(T), i && r !== void 0 && M(T), d === "onChange" && x(e);
95
+ onChange: (v) => {
96
+ o.onChange(v), i && r !== void 0 && I(v), u === "onChange" && d(e);
92
97
  },
93
- valid: !v(e).invalid,
94
- className: `${a.formText} ${v(e).invalid ? a.invalid : ""}`,
95
- trailingIcon: j
98
+ valid: !T(e).invalid,
99
+ className: `${s.formText} ${T(e).invalid ? s.invalid : ""}`,
100
+ trailingIcon: B
96
101
  }
97
102
  )
98
103
  }
99
104
  );
100
105
  };
101
106
  export {
102
- X as FormText
107
+ p as FormText
103
108
  };
@@ -1,50 +1,58 @@
1
- import { jsx as a, jsxs as d, Fragment as I } from "react/jsx-runtime";
2
- import { Elevation as N, Group as o, TabBar as b, Tab as x, Padding as y } from "@element/react-components";
3
- import { useState as k, useEffect as w } from "react";
4
- import { s as t } from "../../HashTabView.module-BY0tbl3B.js";
5
- import { u as $ } from "../../useBreakpoint-DyAmuka7.js";
6
- const g = (n, r, i) => !i || !r || !n ? 0 : n.findIndex((c) => `#${c.hash}` === r) ?? 0, F = ({
1
+ import "../../assets/HashTabView.css";
2
+ import { jsx as r, jsxs as d, Fragment as w } from "react/jsx-runtime";
3
+ import { Elevation as T, Group as o, TabBar as C, Tab as k, Padding as A } from "@element/react-components";
4
+ import { useState as I, useEffect as L } from "react";
5
+ import { a as N } from "../../useBreakpoint-DROHPVxO.js";
6
+ const x = "_elevation_1rcw6_1", y = "_themeBackground_1rcw6_6", W = "_tabBar_1rcw6_10", $ = "_tabWrapper_1rcw6_16", j = "_tabButton_1rcw6_20", E = "_childContainer_1rcw6_24", z = "_childContainerLg_1rcw6_28", a = {
7
+ elevation: x,
8
+ themeBackground: y,
9
+ tabBar: W,
10
+ tabWrapper: $,
11
+ tabButton: j,
12
+ childContainer: E,
13
+ childContainerLg: z
14
+ }, _ = (n, t, c) => !c || !t || !n ? 0 : n.findIndex((i) => `#${i.hash}` === t) ?? 0, q = ({
7
15
  tabs: n,
8
- hasHash: r = !0,
9
- hash: i = "",
10
- clusterAlign: c = "start",
11
- hasClusteredTabs: f,
12
- children: s,
16
+ hasHash: t = !0,
17
+ hash: c = "",
18
+ clusterAlign: i = "start",
19
+ hasClusteredTabs: g,
20
+ children: l,
13
21
  verticalGap: h = "none",
14
- elevation: v = 0,
15
- backgroundColor: T = "themeBackground",
16
- onChange: A
22
+ elevation: B = 0,
23
+ backgroundColor: v = "themeBackground",
24
+ onChange: b
17
25
  }) => {
18
- const [m, p] = k(g(n, i, r)), { isLg: l } = $();
19
- w(() => {
20
- const e = g(n, i, r);
26
+ const [m, p] = I(_(n, c, t)), { isLg: s } = N();
27
+ L(() => {
28
+ const e = _(n, c, t);
21
29
  p(e);
22
- }, [i, n, r]);
23
- const B = (e) => {
30
+ }, [c, n, t]);
31
+ const f = (e) => {
24
32
  const u = n[e].hash;
25
- u != null && r && (window.location.hash = u), p(e), A?.(e);
33
+ u != null && t && (window.location.hash = u), p(e), b?.(e);
26
34
  };
27
- return /* @__PURE__ */ a(
28
- N,
35
+ return /* @__PURE__ */ r(
36
+ T,
29
37
  {
30
- elevation: v,
31
- className: `${t.elevation} ${T === "none" ? "" : t.themeBackground}`,
38
+ elevation: B,
39
+ className: `${a.elevation} ${v === "none" ? "" : a.themeBackground}`,
32
40
  children: /* @__PURE__ */ d(o, { direction: "vertical", gap: h, secondaryAlign: "stretch", children: [
33
- /* @__PURE__ */ d(o, { direction: l ? "horizontal" : "vertical", className: t.tabWrapper, children: [
34
- /* @__PURE__ */ a(
35
- b,
41
+ /* @__PURE__ */ d(o, { direction: s ? "horizontal" : "vertical", className: a.tabWrapper, children: [
42
+ /* @__PURE__ */ r(
43
+ C,
36
44
  {
37
- className: t.tabBar,
38
- clustered: l ? f : !1,
39
- clusterAlign: c,
45
+ className: a.tabBar,
46
+ clustered: s ? g : !1,
47
+ clusterAlign: i,
40
48
  variant: "surface",
41
49
  activeTabIndex: m,
42
- onTabActivated: B,
43
- children: n.map((e) => /* @__PURE__ */ a(
44
- x,
50
+ onTabActivated: f,
51
+ children: n.map((e) => /* @__PURE__ */ r(
52
+ k,
45
53
  {
46
54
  icon: e.leadingIcon,
47
- className: s ? t.tabButton : "",
55
+ className: l ? a.tabButton : "",
48
56
  children: /* @__PURE__ */ d(o, { gap: "dense", children: [
49
57
  e.title,
50
58
  e.trailingIcon
@@ -54,14 +62,14 @@ const g = (n, r, i) => !i || !r || !n ? 0 : n.findIndex((c) => `#${c.hash}` ===
54
62
  ))
55
63
  }
56
64
  ),
57
- s ? /* @__PURE__ */ a(
58
- y,
65
+ l ? /* @__PURE__ */ r(
66
+ A,
59
67
  {
60
68
  variant: "dense",
61
- className: l ? t.childContainer : t.childContainerLg,
62
- children: /* @__PURE__ */ a(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: s })
69
+ className: s ? a.childContainer : a.childContainerLg,
70
+ children: /* @__PURE__ */ r(o, { gap: "dense", primaryAlign: "center", secondaryAlign: "center", children: l })
63
71
  }
64
- ) : /* @__PURE__ */ a(I, {})
72
+ ) : /* @__PURE__ */ r(w, {})
65
73
  ] }),
66
74
  n[m]?.component
67
75
  ] })
@@ -69,5 +77,5 @@ const g = (n, r, i) => !i || !r || !n ? 0 : n.findIndex((c) => `#${c.hash}` ===
69
77
  );
70
78
  };
71
79
  export {
72
- F as HashTabView
80
+ q as HashTabView
73
81
  };
@@ -1,25 +1,27 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { TypoBody as n, Select as d } from "@element/react-components";
3
- import { BasicHeading as l } from "../BasicHeading/BasicHeading.js";
4
- import { s as m } from "../../HeaderFilter.module-DiBmulr5.js";
5
- const h = ({
1
+ import "../../assets/HeaderFilter.css";
2
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
3
+ import { TypoBody as a, Select as s } from "@element/react-components";
4
+ import { BasicHeading as c } from "../BasicHeading/BasicHeading.js";
5
+ const d = "_filterSelect_923nc_1", m = {
6
+ filterSelect: d
7
+ }, h = ({
6
8
  heading: r,
7
9
  filterByText: e,
8
- setFilter: o,
9
- filterValue: a,
10
- filterOptions: i
11
- }) => /* @__PURE__ */ s(l, { "data-testid": "HeaderContainer", heading: r, children: [
12
- e && /* @__PURE__ */ t(n, { level: 2, children: e }),
10
+ setFilter: i,
11
+ filterValue: l,
12
+ filterOptions: o
13
+ }) => /* @__PURE__ */ n(c, { "data-testid": "HeaderContainer", heading: r, children: [
14
+ e && /* @__PURE__ */ t(a, { level: 2, children: e }),
13
15
  /* @__PURE__ */ t(
14
- d,
16
+ s,
15
17
  {
16
18
  "data-testid": "Select",
17
19
  dense: !0,
18
20
  className: m.filterSelect,
19
21
  variant: "outlined",
20
- onChange: o,
21
- value: a,
22
- options: i
22
+ onChange: i,
23
+ value: l,
24
+ options: o
23
25
  }
24
26
  )
25
27
  ] });