@hortiview/shared-components 0.0.4730 → 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 (73) hide show
  1. package/README.md +199 -1
  2. package/dist/ListAreaService-BPp_O2BH.js +67 -0
  3. package/dist/assets/DeleteModal.css +1 -22
  4. package/dist/assets/FormDatePicker.css +1 -0
  5. package/dist/assets/FormSelect.css +1 -0
  6. package/dist/assets/FormText.css +1 -0
  7. package/dist/assets/main.css +22 -0
  8. package/dist/components/BaseView/BaseView.d.ts +1 -0
  9. package/dist/components/BaseView/BaseView.js +23 -21
  10. package/dist/components/BaseView/BaseView.test.js +1 -1
  11. package/dist/components/BasicHeading/BasicHeading.js +52 -41
  12. package/dist/components/BlockView/BlockView.js +51 -41
  13. package/dist/components/DeleteModal/DeleteModal.js +31 -43
  14. package/dist/components/DeleteModal/DeleteModal.test.js +3 -3
  15. package/dist/components/Disclaimer/Disclaimer.js +11 -8
  16. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +30 -0
  17. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +42 -0
  18. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +1 -0
  19. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +50 -0
  20. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +36 -0
  21. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +64 -0
  22. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +1 -0
  23. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +69 -0
  24. package/dist/components/FormComponents/FormRadio/FormRadio.d.ts +21 -0
  25. package/dist/components/FormComponents/FormRadio/FormRadio.js +30 -0
  26. package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +1 -0
  27. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +73 -0
  28. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +61 -0
  29. package/dist/components/FormComponents/FormSelect/FormSelect.js +80 -0
  30. package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +1 -0
  31. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +65 -0
  32. package/dist/components/FormComponents/FormSlider/FormSlider.d.ts +27 -0
  33. package/dist/components/FormComponents/FormSlider/FormSlider.js +37 -0
  34. package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +1 -0
  35. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +49 -0
  36. package/dist/components/FormComponents/FormText/FormText.d.ts +69 -0
  37. package/dist/components/FormComponents/FormText/FormText.js +108 -0
  38. package/dist/components/FormComponents/FormText/FormText.test.d.ts +1 -0
  39. package/dist/components/FormComponents/FormText/FormText.test.js +84 -0
  40. package/dist/components/HashTabView/HashTabView.js +48 -40
  41. package/dist/components/HeaderFilter/HeaderFilter.js +16 -14
  42. package/dist/components/Iconify/Iconify.d.ts +1 -0
  43. package/dist/components/ListArea/ListArea.d.ts +1 -0
  44. package/dist/components/ListArea/ListArea.js +494 -316
  45. package/dist/components/ListArea/ListArea.test.js +1 -1
  46. package/dist/components/ListArea/ListAreaService.js +8 -55
  47. package/dist/components/SearchBar/SearchBar.js +23 -21
  48. package/dist/components/VerticalDivider/VerticalDivider.js +6 -4
  49. package/dist/get-Dyz8NMrE.js +321 -0
  50. package/dist/hooks/useBreakpoint.js +2 -2
  51. package/dist/main.d.ts +6 -0
  52. package/dist/main.js +42 -29
  53. package/dist/types/HashTab.d.ts +1 -0
  54. package/dist/types/ListElement.d.ts +1 -0
  55. package/dist/types/internal/ReactRouterTypes.d.ts +1 -0
  56. package/dist/{useBreakpoint-DyAmuka7.js → useBreakpoint-DROHPVxO.js} +2 -2
  57. package/package.json +7 -2
  58. package/dist/BlockView.module-8kbPxxc4.js +0 -15
  59. package/dist/HashTabView.module-BY0tbl3B.js +0 -13
  60. package/dist/HeaderFilter.module-DiBmulr5.js +0 -7
  61. package/dist/_getTag-DyrzUAbj.js +0 -494
  62. package/dist/baseView.module-DXWalo9p.js +0 -7
  63. package/dist/basicHeading.module-ClcvD7x2.js +0 -16
  64. package/dist/disclaimer.module-BZydt-Q_.js +0 -8
  65. package/dist/listArea.module-B04TR5bj.js +0 -14
  66. package/dist/searchBar.module-9gKyrZRT.js +0 -7
  67. package/dist/verticalDivider.module-C3_GL-fH.js +0 -7
  68. /package/dist/assets/{baseView.css → BaseView.css} +0 -0
  69. /package/dist/assets/{basicHeading.css → BasicHeading.css} +0 -0
  70. /package/dist/assets/{disclaimer.css → Disclaimer.css} +0 -0
  71. /package/dist/assets/{listArea.css → ListAreaService.css} +0 -0
  72. /package/dist/assets/{searchBar.css → SearchBar.css} +0 -0
  73. /package/dist/assets/{verticalDivider.css → VerticalDivider.css} +0 -0
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { LinkProps } from '../../types/internal/ReactRouterTypes';
2
3
  import { BaseListElement } from '../../types/ListElement';
3
4
  type BaseViewProps = {
@@ -1,15 +1,17 @@
1
- import { jsx as i, Fragment as x, jsxs as e } from "react/jsx-runtime";
1
+ import "../../assets/BaseView.css";
2
+ import { jsx as t, Fragment as x, jsxs as e } from "react/jsx-runtime";
2
3
  import { useMemo as n } from "react";
3
4
  import { EmptyView as k } from "../EmptyView/EmptyView.js";
4
- import { ListArea as A } from "../ListArea/ListArea.js";
5
- import { VerticalDivider as H } from "../VerticalDivider/VerticalDivider.js";
6
- import { s as L } from "../../baseView.module-DXWalo9p.js";
7
- import { u as V } from "../../useBreakpoint-DyAmuka7.js";
8
- import { Grid as W, GridRow as j, GridCol as m, Group as u } from "@element/react-components";
5
+ import { ListArea as y } from "../ListArea/ListArea.js";
6
+ import { VerticalDivider as A } from "../VerticalDivider/VerticalDivider.js";
7
+ import { a as H } from "../../useBreakpoint-DROHPVxO.js";
8
+ import { Grid as L, GridRow as V, GridCol as m, Group as u } from "@element/react-components";
9
9
  import { BasicHeading as a } from "../BasicHeading/BasicHeading.js";
10
- const z = ({
11
- action: c,
12
- heading: d,
10
+ const W = "_divider_anyyu_1", _ = {
11
+ divider: W
12
+ }, z = ({
13
+ action: d,
14
+ heading: c,
13
15
  elements: o,
14
16
  emptyText: s,
15
17
  hasSearch: h = !0,
@@ -21,13 +23,13 @@ const z = ({
21
23
  routerLinkElement: C,
22
24
  searchPlaceholder: B
23
25
  }) => {
24
- const { isLg: r } = V(), t = n(() => o.find((w) => w.route === l), [l, o]), G = n(() => t?.component ?? (r ? /* @__PURE__ */ i(k, { subtitle: s }) : /* @__PURE__ */ i(x, {})), [t, r, s]), b = n(() => r ? !0 : !t, [t, r]);
25
- return /* @__PURE__ */ i(W, { className: f ?? "", fullHeight: !0, fullWidth: !0, columnGap: 0, children: /* @__PURE__ */ e(j, { children: [
26
+ const { isLg: r } = H(), i = n(() => o.find((w) => w.route === l), [l, o]), G = n(() => i?.component ?? (r ? /* @__PURE__ */ t(k, { subtitle: s }) : /* @__PURE__ */ t(x, {})), [i, r, s]), b = n(() => r ? !0 : !i, [i, r]);
27
+ return /* @__PURE__ */ t(L, { className: f ?? "", fullHeight: !0, fullWidth: !0, columnGap: 0, children: /* @__PURE__ */ e(V, { children: [
26
28
  b && /* @__PURE__ */ e(m, { desktopCol: 4, tabletCol: 12, phoneCol: 12, children: [
27
29
  /* @__PURE__ */ e(u, { direction: "vertical", fullWidth: !0, children: [
28
- d && /* @__PURE__ */ i(a, { heading: d, level: 4, marginBottom: 0, children: c }),
29
- /* @__PURE__ */ i(
30
- A,
30
+ c && /* @__PURE__ */ t(a, { heading: c, level: 4, marginBottom: 0, children: d }),
31
+ /* @__PURE__ */ t(
32
+ y,
31
33
  {
32
34
  elements: o,
33
35
  hasSearch: h,
@@ -39,19 +41,19 @@ const z = ({
39
41
  }
40
42
  )
41
43
  ] }),
42
- r && /* @__PURE__ */ i(H, { className: L.divider, height: "100%" })
44
+ r && /* @__PURE__ */ t(A, { className: _.divider, height: "100%" })
43
45
  ] }),
44
- /* @__PURE__ */ i(m, { desktopCol: 8, tabletCol: 12, phoneCol: 12, children: /* @__PURE__ */ e(u, { direction: "vertical", fullWidth: !0, children: [
45
- /* @__PURE__ */ i(
46
+ /* @__PURE__ */ t(m, { desktopCol: 8, tabletCol: 12, phoneCol: 12, children: /* @__PURE__ */ e(u, { direction: "vertical", fullWidth: !0, children: [
47
+ /* @__PURE__ */ t(
46
48
  a,
47
49
  {
48
- heading: t?.detailTitle ?? t?.title ?? "",
50
+ heading: i?.detailTitle ?? i?.title ?? "",
49
51
  level: 4,
50
- icon: t?.hideIconInDetail === !0 ? void 0 : t?.icon,
52
+ icon: i?.hideIconInDetail === !0 ? void 0 : i?.icon,
51
53
  marginBottom: 0,
52
- invisibleButton: t?.detailAction === void 0,
54
+ invisibleButton: i?.detailAction === void 0,
53
55
  withAvatar: v,
54
- children: t?.detailAction ?? c
56
+ children: i?.detailAction ?? d
55
57
  }
56
58
  ),
57
59
  G
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, Fragment as s } from "react/jsx-runtime";
2
- import { a as l } from "../../useBreakpoint-DyAmuka7.js";
2
+ import { u as l } from "../../useBreakpoint-DROHPVxO.js";
3
3
  import { BaseView as r } from "./BaseView.js";
4
4
  import { r as i, s as e, f as p } from "../../react.esm-BeDwcQWb.js";
5
5
  import { d as u, b as m, t as n, g as t, v as c } from "../../vi.JYQecGiw-BbUbJcT8.js";
@@ -1,63 +1,74 @@
1
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import { TypoDisplay as v, TypoBody as N, Icon as I } from "@element/react-components";
3
- import { u as B } from "../../useBreakpoint-DyAmuka7.js";
4
- import { Iconify as C } from "../Iconify/Iconify.js";
5
- import { s as e } from "../../basicHeading.module-ClcvD7x2.js";
6
- import { AvailableCustomIcons as $ } from "../../enums/AvailableCustomIcons.js";
7
- const x = ({ icon: i }) => i ? typeof i != "string" ? /* @__PURE__ */ a("div", { className: e.iconContainer, children: i }) : i in $ ? /* @__PURE__ */ a(
8
- C,
1
+ import "../../assets/BasicHeading.css";
2
+ import { jsxs as t, jsx as i } from "react/jsx-runtime";
3
+ import { TypoDisplay as C, TypoBody as w, Icon as y } from "@element/react-components";
4
+ import { a as u } from "../../useBreakpoint-DROHPVxO.js";
5
+ import { Iconify as I } from "../Iconify/Iconify.js";
6
+ import { AvailableCustomIcons as B } from "../../enums/AvailableCustomIcons.js";
7
+ const N = "_pageHeader_fwns1_1", H = "_headlineContainer_fwns1_11", b = "_actionButtonContainer_fwns1_16", A = "_content_fwns1_25", W = "_leadingIcon_fwns1_31", $ = "_headingWrapper_fwns1_38", x = "_headingContainer_fwns1_43", T = "_invisible_fwns1_48", j = "_withAvatar_fwns1_52", z = "_iconContainer_fwns1_57", n = {
8
+ pageHeader: N,
9
+ headlineContainer: H,
10
+ actionButtonContainer: b,
11
+ content: A,
12
+ leadingIcon: W,
13
+ headingWrapper: $,
14
+ headingContainer: x,
15
+ invisible: T,
16
+ withAvatar: j,
17
+ iconContainer: z
18
+ }, L = ({ icon: e }) => e ? typeof e != "string" ? /* @__PURE__ */ i("div", { className: n.iconContainer, children: e }) : e in B ? /* @__PURE__ */ i(
19
+ I,
9
20
  {
10
- icon: i,
11
- className: e.leadingIcon,
21
+ icon: e,
22
+ className: n.leadingIcon,
12
23
  iconSize: "large",
13
24
  iconType: "filled"
14
25
  }
15
- ) : /* @__PURE__ */ a(I, { iconSize: "large", iconType: "filled", icon: i, className: e.leadingIcon }) : null, L = ({
16
- children: i,
17
- marginBottom: t,
18
- heading: d,
19
- icon: c,
20
- className: m,
21
- subHeading: n,
22
- subHeadingLevel: p = 2,
26
+ ) : /* @__PURE__ */ i(y, { iconSize: "large", iconType: "filled", icon: e, className: n.leadingIcon }) : null, q = ({
27
+ children: e,
28
+ marginBottom: a,
29
+ heading: l,
30
+ icon: d,
31
+ className: p,
32
+ subHeading: o,
33
+ subHeadingLevel: _ = 2,
23
34
  invisibleButton: f = !1,
24
- level: s = 4,
25
- fontWeight: o = 400,
26
- withAvatar: y = !1
35
+ level: r = 4,
36
+ fontWeight: s = 400,
37
+ withAvatar: g = !1
27
38
  }) => {
28
- const { isLg: l } = B(), g = l ? s : s + 1, h = o === "bold" ? 500 : o, u = () => {
29
- if (t !== void 0)
30
- return typeof t == "number" ? `${t}px` : "2rem";
39
+ const { isLg: c } = u(), h = c ? r : r + 1, m = s === "bold" ? 500 : s, v = () => {
40
+ if (a !== void 0)
41
+ return typeof a == "number" ? `${a}px` : "2rem";
31
42
  };
32
- return /* @__PURE__ */ r(
43
+ return /* @__PURE__ */ t(
33
44
  "div",
34
45
  {
35
- className: e.pageHeader,
36
- style: { marginBottom: u() },
46
+ className: n.pageHeader,
47
+ style: { marginBottom: v() },
37
48
  "data-testid": "HeaderContainer",
38
49
  children: [
39
- /* @__PURE__ */ r("div", { className: `${y && l ? e.withAvatar : ""} ${e.headingWrapper}`, children: [
40
- /* @__PURE__ */ a(x, { icon: c }),
41
- /* @__PURE__ */ r("div", { className: n ? e.headingContainer : "", children: [
42
- /* @__PURE__ */ a(
43
- v,
50
+ /* @__PURE__ */ t("div", { className: `${g && c ? n.withAvatar : ""} ${n.headingWrapper}`, children: [
51
+ /* @__PURE__ */ i(L, { icon: d }),
52
+ /* @__PURE__ */ t("div", { className: o ? n.headingContainer : "", children: [
53
+ /* @__PURE__ */ i(
54
+ C,
44
55
  {
45
- level: g,
56
+ level: h,
46
57
  "data-testid": "Header",
47
- className: m ?? "",
48
- style: { fontWeight: h },
49
- children: d
58
+ className: p ?? "",
59
+ style: { fontWeight: m },
60
+ children: l
50
61
  }
51
62
  ),
52
- /* @__PURE__ */ a(N, { level: p, children: n })
63
+ /* @__PURE__ */ i(w, { level: _, children: o })
53
64
  ] })
54
65
  ] }),
55
- /* @__PURE__ */ a(
66
+ /* @__PURE__ */ i(
56
67
  "div",
57
68
  {
58
- className: `${e.actionButtonContainer} ${f && e.invisible}`,
69
+ className: `${n.actionButtonContainer} ${f && n.invisible}`,
59
70
  "data-testid": "RightPart",
60
- children: i
71
+ children: e
61
72
  }
62
73
  )
63
74
  ]
@@ -65,5 +76,5 @@ const x = ({ icon: i }) => i ? typeof i != "string" ? /* @__PURE__ */ a("div", {
65
76
  );
66
77
  };
67
78
  export {
68
- L as BasicHeading
79
+ q as BasicHeading
69
80
  };
@@ -1,63 +1,73 @@
1
- import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
- import { TypoSubtitle as B, TypoDisplay as C } from "@element/react-components";
3
- import { useState as A, useEffect as D, useMemo as E } from "react";
4
- import { s as e } from "../../BlockView.module-8kbPxxc4.js";
5
- import { getBlockNumberByDto as S } from "../../services/BlockService.js";
6
- const R = ({
1
+ import "../../assets/BlockView.css";
2
+ import { jsxs as g, jsx as l } from "react/jsx-runtime";
3
+ import { TypoSubtitle as x, TypoDisplay as T } from "@element/react-components";
4
+ import { useState as L, useEffect as R, useMemo as B } from "react";
5
+ import { getBlockNumberByDto as C } from "../../services/BlockService.js";
6
+ const A = "_grid_g18cu_1", D = "_black_g18cu_11", E = "_blockLayout_g18cu_15", S = "_blockRow_g18cu_27", V = "_block_g18cu_15", M = "_active_g18cu_46", j = "_error_g18cu_52", q = "_empty_g18cu_58", F = "_blockText_g18cu_65", o = {
7
+ grid: A,
8
+ black: D,
9
+ blockLayout: E,
10
+ blockRow: S,
11
+ block: V,
12
+ active: M,
13
+ error: j,
14
+ empty: q,
15
+ blockText: F
16
+ }, O = ({
7
17
  rows: s,
8
18
  columns: t,
9
- hideText: n = !1,
10
- errorBlocks: k = [],
19
+ hideText: u = !1,
20
+ errorBlocks: p = [],
11
21
  showNumbers: y = !0,
12
- clickable: N = !0,
13
- size: d = 15,
14
- onClick: u = null,
15
- currentBlock: c,
16
- blocks: b,
22
+ clickable: h = !0,
23
+ size: m = 15,
24
+ onClick: b = null,
25
+ currentBlock: i,
26
+ blocks: _,
17
27
  blockViewTitle: v,
18
- blockLabel: $
28
+ blockLabel: f
19
29
  }) => {
20
- const [p, h] = A(0);
21
- D(() => {
22
- if (!c)
30
+ const [k, d] = L(0);
31
+ R(() => {
32
+ if (!i)
23
33
  return;
24
- const o = S(c, t);
25
- h(o);
26
- }, [c, t]);
27
- const g = E(() => s * t, [s, t]), w = (o) => {
28
- u && u(o, c ?? void 0);
29
- }, x = ({ row: o, column: l }) => b.length === 0 ? !0 : b.some((m) => m.position?.row === o && m.position?.column === l);
30
- return /* @__PURE__ */ f("div", { className: e.grid, children: [
31
- !n && /* @__PURE__ */ i(B, { level: 1, bold: !0, className: e.black, children: v }),
32
- /* @__PURE__ */ i("div", { className: e.blockLayout, style: { width: `${d}rem`, height: `${d}rem` }, children: Array.from({ length: s }).map((o, l) => /* @__PURE__ */ i("div", { className: e.blockRow, children: Array.from({ length: t }).map((m, a) => {
33
- const r = t * l + a + 1;
34
- return /* @__PURE__ */ i(
34
+ const c = C(i, t);
35
+ d(c);
36
+ }, [i, t]);
37
+ const N = B(() => s * t, [s, t]), $ = (c) => {
38
+ b && b(c, i ?? void 0);
39
+ }, w = ({ row: c, column: r }) => _.length === 0 ? !0 : _.some((n) => n.position?.row === c && n.position?.column === r);
40
+ return /* @__PURE__ */ g("div", { className: o.grid, children: [
41
+ !u && /* @__PURE__ */ l(x, { level: 1, bold: !0, className: o.black, children: v }),
42
+ /* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${m}rem`, height: `${m}rem` }, children: Array.from({ length: s }).map((c, r) => /* @__PURE__ */ l("div", { className: o.blockRow, children: Array.from({ length: t }).map((n, a) => {
43
+ const e = t * r + a + 1;
44
+ return /* @__PURE__ */ l(
35
45
  "div",
36
46
  {
37
47
  "data-testid": "blockViewBlock",
38
- className: `${e.block} ${p === r ? e.active : ""} ${x({ row: l + 1, column: a + 1 }) ? "" : e.empty} ${k.includes(r) ? e.error : ""}`,
39
- id: `block${r}`,
40
- onClick: N ? () => {
41
- h(r), w({ row: l + 1, column: a + 1 });
48
+ className: `${o.block} ${k === e ? o.active : ""} ${w({ row: r + 1, column: a + 1 }) ? "" : o.empty} ${p.includes(e) ? o.error : ""}`,
49
+ id: `block${e}`,
50
+ onClick: h ? () => {
51
+ d(e), $({ row: r + 1, column: a + 1 });
42
52
  } : void 0,
43
- children: y && /* @__PURE__ */ i(
53
+ children: y && /* @__PURE__ */ l(
44
54
  "div",
45
55
  {
46
- className: `${e.blockText} ${p === r ? e.black : ""}`,
47
- children: r
56
+ className: `${o.blockText} ${k === e ? o.black : ""}`,
57
+ children: e
48
58
  }
49
59
  )
50
60
  },
51
- r
61
+ e
52
62
  );
53
- }) }, l)) }),
54
- !n && /* @__PURE__ */ f(C, { themeColor: "primary", level: 6, children: [
55
- g,
63
+ }) }, r)) }),
64
+ !u && /* @__PURE__ */ g(T, { themeColor: "primary", level: 6, children: [
65
+ N,
56
66
  " ",
57
- $
67
+ f
58
68
  ] })
59
69
  ] });
60
70
  };
61
71
  export {
62
- R as BlockView
72
+ O as BlockView
63
73
  };
@@ -1,81 +1,69 @@
1
1
  import "../../assets/DeleteModal.css";
2
- import { jsx as o, jsxs as m, Fragment as f } from "react/jsx-runtime";
3
- import { Modal as k, Button as c, Group as t, Icon as y, TypoBody as l } from "@element/react-components";
2
+ import { jsx as e, jsxs as c, Fragment as f } from "react/jsx-runtime";
3
+ import { Modal as k, Button as m, Group as r, Icon as y, TypoBody as t } from "@element/react-components";
4
4
  import { Iconify as C } from "../Iconify/Iconify.js";
5
5
  import { uniqueId as D } from "lodash";
6
- import "react";
7
- import "../../_getTag-DyrzUAbj.js";
8
- import "../../searchBar.module-9gKyrZRT.js";
9
- import "../../listArea.module-B04TR5bj.js";
10
6
  import { AvailableCustomIcons as s } from "../../enums/AvailableCustomIcons.js";
11
- import "../../verticalDivider.module-C3_GL-fH.js";
12
- import "../../baseView.module-DXWalo9p.js";
13
- import "../../basicHeading.module-ClcvD7x2.js";
14
- import "../../BlockView.module-8kbPxxc4.js";
15
- import "../../disclaimer.module-BZydt-Q_.js";
16
- import "../../HashTabView.module-BY0tbl3B.js";
17
- import "../../HeaderFilter.module-DiBmulr5.js";
18
- import "../Scrollbar/Scrollbar.js";
19
- const j = "_bulletPoint_469qk_1", q = "_modal_469qk_6", I = "_colorDanger_469qk_10", e = {
7
+ const j = "_bulletPoint_469qk_1", q = "_modal_469qk_6", I = "_colorDanger_469qk_10", l = {
20
8
  bulletPoint: j,
21
9
  modal: q,
22
10
  colorDanger: I
23
- }, R = ({
11
+ }, M = ({
24
12
  title: d,
25
- confirmButtonLabel: p,
26
- cancelButtonLabel: u,
27
- deleteHeader: g,
28
- deleteBody: i,
29
- icon: r,
13
+ confirmButtonLabel: u,
14
+ cancelButtonLabel: g,
15
+ deleteHeader: p,
16
+ deleteBody: a,
17
+ icon: o,
30
18
  impossibleDeleteHeader: b,
31
19
  open: v,
32
- setOpen: a,
20
+ setOpen: n,
33
21
  onDelete: h,
34
- isDeletePossible: n = !0
35
- }) => /* @__PURE__ */ o(
22
+ isDeletePossible: i = !0
23
+ }) => /* @__PURE__ */ e(
36
24
  k,
37
25
  {
38
- className: e.modal,
26
+ className: l.modal,
39
27
  modalSize: "small",
40
28
  open: v,
41
- onClose: () => a(!1),
29
+ onClose: () => n(!1),
42
30
  title: d,
43
- primaryButton: /* @__PURE__ */ o(
44
- c,
31
+ primaryButton: /* @__PURE__ */ e(
32
+ m,
45
33
  {
46
34
  variant: "danger",
47
- label: p,
35
+ label: u,
48
36
  onClick: h,
49
- disabled: !n
37
+ disabled: !i
50
38
  }
51
39
  ),
52
- dismissiveButton: /* @__PURE__ */ o(c, { variant: "text", label: u, onClick: () => a(!1) }),
53
- children: /* @__PURE__ */ m(t, { direction: "vertical", secondaryAlign: "center", children: [
54
- r && Object.values(s).includes(r) && /* @__PURE__ */ o(
40
+ dismissiveButton: /* @__PURE__ */ e(m, { variant: "text", label: g, onClick: () => n(!1) }),
41
+ children: /* @__PURE__ */ c(r, { direction: "vertical", secondaryAlign: "center", children: [
42
+ o && Object.values(s).includes(o) && /* @__PURE__ */ e(
55
43
  C,
56
44
  {
57
- icon: r,
45
+ icon: o,
58
46
  iconSize: "xlarge",
59
- className: e.colorDanger
47
+ className: l.colorDanger
60
48
  }
61
49
  ),
62
- r && !Object.values(s).includes(r) && /* @__PURE__ */ o(y, { icon: r, iconSize: "xlarge", className: e.colorDanger }),
63
- /* @__PURE__ */ o(t, { direction: "vertical", children: n ? /* @__PURE__ */ m(f, { children: [
64
- /* @__PURE__ */ o(l, { level: 1, themeColor: "text-primary-on-background", children: g }),
65
- i && /* @__PURE__ */ o(t, { direction: "vertical", gap: "none", children: i.map((x, _) => /* @__PURE__ */ o(
66
- l,
50
+ o && !Object.values(s).includes(o) && /* @__PURE__ */ e(y, { icon: o, iconSize: "xlarge", className: l.colorDanger }),
51
+ /* @__PURE__ */ e(r, { direction: "vertical", children: i ? /* @__PURE__ */ c(f, { children: [
52
+ /* @__PURE__ */ e(t, { level: 1, themeColor: "text-primary-on-background", children: p }),
53
+ a && /* @__PURE__ */ e(r, { direction: "vertical", gap: "none", children: a.map((x, _) => /* @__PURE__ */ e(
54
+ t,
67
55
  {
68
56
  level: 2,
69
- className: e.bulletPoint,
57
+ className: l.bulletPoint,
70
58
  themeColor: "text-secondary-on-background",
71
59
  children: x
72
60
  },
73
61
  D(_.toString())
74
62
  )) })
75
- ] }) : /* @__PURE__ */ o(l, { level: 1, themeColor: "text-primary-on-background", children: b }) })
63
+ ] }) : /* @__PURE__ */ e(t, { level: 1, themeColor: "text-primary-on-background", children: b }) })
76
64
  ] })
77
65
  }
78
66
  );
79
67
  export {
80
- R as DeleteModal
68
+ M as DeleteModal
81
69
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { r as c, s as e } from "../../react.esm-BeDwcQWb.js";
3
3
  import { DeleteModal as b } from "./DeleteModal.js";
4
- import { d, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
- d("DeleteModal Test", () => {
4
+ import { d as B, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ B("DeleteModal Test", () => {
6
6
  a("should render the DeleteModal properly", () => {
7
7
  c(
8
8
  /* @__PURE__ */ n(
@@ -40,7 +40,7 @@ d("DeleteModal Test", () => {
40
40
  isDeletePossible: !1
41
41
  }
42
42
  )
43
- ), e.debug(), t(e.getByText("DELETE")).toBeInTheDocument(), t(e.getByTestId("block")).toBeInTheDocument(), t(e.queryByText("block 1")).not.toBeInTheDocument(), t(e.queryByText("block 2")).not.toBeInTheDocument(), t(e.queryByText("block 3")).not.toBeInTheDocument(), t(e.getByText("Remove")).toBeInTheDocument(), t(e.getByText("Remove").parentElement).toBeDisabled(), t(e.getByText("Cancel")).toBeInTheDocument(), t(e.queryByText("block cant be deleted")).toBeInTheDocument();
43
+ ), t(e.getByText("DELETE")).toBeInTheDocument(), t(e.getByTestId("block")).toBeInTheDocument(), t(e.queryByText("block 1")).not.toBeInTheDocument(), t(e.queryByText("block 2")).not.toBeInTheDocument(), t(e.queryByText("block 3")).not.toBeInTheDocument(), t(e.getByText("Remove")).toBeInTheDocument(), t(e.getByText("Remove").parentElement).toBeDisabled(), t(e.getByText("Cancel")).toBeInTheDocument(), t(e.queryByText("block cant be deleted")).toBeInTheDocument();
44
44
  }), a("should call setOpen with false when clicking on cancel button", () => {
45
45
  const l = o.fn();
46
46
  c(
@@ -1,16 +1,19 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { Group as n, TypoSubtitle as m, TypoBody as t, Icon as d } from "@element/react-components";
3
- import { s as l } from "../../disclaimer.module-BZydt-Q_.js";
4
- const f = ({ text: o, subtext: e, icon: i, level: c = 2, bold: a = !1 }) => /* @__PURE__ */ s(
5
- n,
1
+ import "../../assets/Disclaimer.css";
2
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
3
+ import { Group as s, TypoSubtitle as t, TypoBody as m, Icon as d } from "@element/react-components";
4
+ const p = "_disclaimer_1k38t_1", y = "_iconArea_1k38t_7", c = {
5
+ disclaimer: p,
6
+ iconArea: y
7
+ }, f = ({ text: o, subtext: e, icon: i, level: l = 2, bold: a = !1 }) => /* @__PURE__ */ n(
8
+ s,
6
9
  {
7
10
  direction: i || e ? "vertical" : "horizontal",
8
11
  secondaryAlign: "center",
9
12
  primaryAlign: "center",
10
13
  children: [
11
- /* @__PURE__ */ r(m, { className: l.disclaimer, level: c, bold: a, children: o }),
12
- e && /* @__PURE__ */ r(t, { level: 2, children: e }),
13
- i && /* @__PURE__ */ r("div", { className: l.iconArea, children: /* @__PURE__ */ r(d, { className: l.Icon, icon: i, iconSize: "large" }) })
14
+ /* @__PURE__ */ r(t, { className: c.disclaimer, level: l, bold: a, children: o }),
15
+ e && /* @__PURE__ */ r(m, { level: 2, children: e }),
16
+ i && /* @__PURE__ */ r("div", { className: c.iconArea, children: /* @__PURE__ */ r(d, { className: c.Icon, icon: i, iconSize: "large" }) })
14
17
  ]
15
18
  }
16
19
  );
@@ -0,0 +1,30 @@
1
+ import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
2
+ type FormCheckProps<T extends FieldValues> = {
3
+ /** The name of the property that this checkbox represents. */
4
+ propertyName: Path<T>;
5
+ /** Label to be displayed with the checkbox. */
6
+ label: string;
7
+ /** Validation rules for the checkbox. */
8
+ validate?: RegisterOptions<T>['validate'];
9
+ /** Determines if this input is mandatory. */
10
+ required?: boolean;
11
+ /** Function to be called when the checkbox value changes. */
12
+ onChange?: () => void;
13
+ /** Determines if this input is disabled. */
14
+ disabled?: boolean;
15
+ };
16
+ /**
17
+ * FormCheckBox is a custom form input component for selecting checkboxes.
18
+ * It is integrated with react-hook-form for form management.
19
+ *
20
+ * @param propertyName - the name of the property this checkbox maps to in the form.
21
+ * @param label - label displayed along with the checkbox.
22
+ * @param validate - validation rules for the checkbox.
23
+ * @param required - determines if the checkbox is required.
24
+ * @param onChange - function to be called when the checkbox value changes.
25
+ * @param disabled - determines if the checkbox is disabled.
26
+ *
27
+ * @returns A JSX element that renders a checkbox form input.
28
+ */
29
+ export declare const FormCheckBox: <T extends FieldValues>({ propertyName, label, validate, required, onChange, disabled, }: FormCheckProps<T>) => import("react/jsx-runtime").JSX.Element;
30
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx as o, jsxs as p, Fragment as x } from "react/jsx-runtime";
2
+ import { Checkbox as l, TypoCaption as u } from "@element/react-components";
3
+ import { useFormContext as g, Controller as i } from "react-hook-form";
4
+ const b = ({
5
+ propertyName: n,
6
+ label: t,
7
+ validate: m,
8
+ required: c,
9
+ onChange: s,
10
+ disabled: h
11
+ }) => {
12
+ const { control: C } = g();
13
+ return /* @__PURE__ */ o(
14
+ i,
15
+ {
16
+ name: n,
17
+ control: C,
18
+ rules: {
19
+ required: c,
20
+ validate: m
21
+ },
22
+ render: ({ field: r, fieldState: e }) => /* @__PURE__ */ p(x, { children: [
23
+ /* @__PURE__ */ o(
24
+ l,
25
+ {
26
+ ...r,
27
+ label: t,
28
+ onChange: (...a) => {
29
+ r.onChange(...a), s?.();
30
+ },
31
+ checked: r.value,
32
+ disabled: h
33
+ }
34
+ ),
35
+ e.error && /* @__PURE__ */ o(u, { themeColor: "error", children: e.error.message })
36
+ ] })
37
+ }
38
+ );
39
+ };
40
+ export {
41
+ b as FormCheckBox
42
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { r as n, s as t, f as m } from "../../../react.esm-BeDwcQWb.js";
3
+ import { FormCheckBox as c } from "./FormCheckBox.js";
4
+ import { v as e, d as h, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
5
+ const a = e.fn();
6
+ e.mock("react-hook-form", () => ({
7
+ ...e.importActual("react-hook-form"),
8
+ Controller: ({
9
+ render: o
10
+ }) => o({
11
+ field: {
12
+ onChange: a
13
+ },
14
+ fieldState: { error: { message: "error" } }
15
+ }),
16
+ useFormContext: () => ({
17
+ control: {
18
+ register: e.fn(),
19
+ unregister: e.fn(),
20
+ getFieldState: e.fn(),
21
+ _names: {
22
+ array: new Set("test"),
23
+ mount: new Set("test"),
24
+ unMount: new Set("test"),
25
+ watch: new Set("test"),
26
+ focus: "test",
27
+ watchAll: !1
28
+ },
29
+ _subjects: {
30
+ watch: e.fn(),
31
+ array: e.fn(),
32
+ state: e.fn()
33
+ },
34
+ _getWatch: e.fn(),
35
+ _formValues: ["test"],
36
+ _defaultValues: ["test"]
37
+ },
38
+ formState: { errors: {} },
39
+ watch: () => "2024-08-07"
40
+ })
41
+ }));
42
+ h("FormCheckBox Test", () => {
43
+ l("render FormCheckBox", () => {
44
+ n(/* @__PURE__ */ s(c, { propertyName: "hasValue", label: "user.hasValue" })), r(t.getByText("user.hasValue")).toBeInTheDocument(), r(t.getByText("error")).toBeInTheDocument(), r(t.getByRole("checkbox")).toBeInTheDocument();
45
+ }), l("render FormCheckBox click", () => {
46
+ n(/* @__PURE__ */ s(c, { propertyName: "hasValue", label: "user.hasValue", onChange: a }));
47
+ const o = t.getByRole("checkbox");
48
+ m.click(o), r(a).toHaveBeenCalled();
49
+ });
50
+ });