@hortiview/shared-components 0.0.4539 → 0.0.4624

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 (82) hide show
  1. package/README.md +101 -29
  2. package/dist/BlockView.module-8kbPxxc4.js +15 -0
  3. package/dist/HashTabView.module-BY0tbl3B.js +13 -0
  4. package/dist/HeaderFilter.module-DiBmulr5.js +7 -0
  5. package/dist/_getTag-DNUtgXkb.js +136 -0
  6. package/dist/_stringToPath-BfzwTbL6.js +54 -0
  7. package/dist/assets/{main.css → DeleteModal.css} +2 -2
  8. package/dist/assets/HeaderFilter.css +1 -0
  9. package/dist/assets/Scrollbar.css +1 -0
  10. package/dist/assets/disclaimer.css +1 -0
  11. package/dist/baseView.module-DXWalo9p.js +7 -0
  12. package/dist/basicHeading.module-ClcvD7x2.js +16 -0
  13. package/dist/{component-D1YrRAXe.js → component-Rx4bNsGO.js} +61 -54
  14. package/dist/components/BaseView/BaseView.d.ts +5 -1
  15. package/dist/components/BaseView/BaseView.js +75 -75
  16. package/dist/components/BaseView/BaseView.test.js +15 -14
  17. package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
  18. package/dist/components/BasicHeading/BasicHeading.js +38 -49
  19. package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
  20. package/dist/components/BlockView/BlockView.js +41 -51
  21. package/dist/components/BlockView/BlockView.test.js +15 -14
  22. package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
  23. package/dist/components/DeleteModal/DeleteModal.js +4719 -0
  24. package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
  25. package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
  26. package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
  27. package/dist/components/Disclaimer/Disclaimer.js +21 -0
  28. package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
  29. package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
  30. package/dist/components/EmptyView/EmptyView.js +4 -4
  31. package/dist/components/EmptyView/EmptyView.test.js +14 -13
  32. package/dist/components/HashTabView/HashTabView.js +60 -68
  33. package/dist/components/HashTabView/HashTabView.test.js +9 -8
  34. package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
  35. package/dist/components/HeaderFilter/HeaderFilter.js +7605 -0
  36. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
  37. package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
  38. package/dist/components/Iconify/Iconify.js +1 -1
  39. package/dist/components/Iconify/Iconify.test.js +8 -7
  40. package/dist/components/ListArea/ListArea.js +247 -5344
  41. package/dist/components/ListArea/ListArea.test.js +4 -3
  42. package/dist/components/ListArea/ListAreaService.js +56 -9
  43. package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
  44. package/dist/components/Scrollbar/Scrollbar.js +9 -0
  45. package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
  46. package/dist/components/Scrollbar/scrollbar.test.js +15 -0
  47. package/dist/components/SearchBar/SearchBar.js +2051 -3
  48. package/dist/components/SearchBar/SearchBar.test.js +16 -15
  49. package/dist/components/VerticalDivider/VerticalDivider.js +4 -6
  50. package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
  51. package/dist/disclaimer.module-BZydt-Q_.js +8 -0
  52. package/dist/index.es-Ba9oZK_n.js +769 -0
  53. package/dist/{index.es-CUWXKh7P.js → index.es-C1ojb4Lq.js} +8 -8
  54. package/dist/{index.es-DYsXox--.js → index.es-CNBieliG.js} +1 -1
  55. package/dist/index.es-CQ3ep412.js +305 -0
  56. package/dist/{index.es-mBp_Btvi.js → index.es-CVCp4d0C.js} +2 -2
  57. package/dist/{index.es-WZ1mqvGz.js → index.es-Cct4Uapb.js} +106 -99
  58. package/dist/index.es-Cj9DW-2T.js +430 -0
  59. package/dist/{index.es-BD4kFWFx.js → index.es-Cm4X20_S.js} +4 -4
  60. package/dist/{index.es-Cv6meSAn.js → index.es-InSNsV4f.js} +1 -1
  61. package/dist/index.es-L0ZCcbUf.js +4939 -0
  62. package/dist/listArea.module-B04TR5bj.js +14 -0
  63. package/dist/main.d.ts +6 -0
  64. package/dist/main.js +33 -23
  65. package/dist/react.esm-BeDwcQWb.js +12741 -0
  66. package/dist/searchBar.module-9gKyrZRT.js +7 -0
  67. package/dist/services/UtilService.d.ts +6 -0
  68. package/dist/services/UtilService.js +4 -0
  69. package/dist/services/services.test.d.ts +1 -0
  70. package/dist/services/services.test.js +22 -0
  71. package/dist/{tslib.es6-BOWp4lfV.js → tslib.es6-CIXEwqhg.js} +4 -4
  72. package/dist/verticalDivider.module-C3_GL-fH.js +7 -0
  73. package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
  74. package/package.json +1 -1
  75. package/dist/ListAreaService-CFOmATRF.js +0 -68
  76. package/dist/SearchBar-CY2zfu6B.js +0 -3232
  77. package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
  78. /package/dist/assets/{BaseView.css → baseView.css} +0 -0
  79. /package/dist/assets/{BasicHeading.css → basicHeading.css} +0 -0
  80. /package/dist/assets/{ListAreaService.css → listArea.css} +0 -0
  81. /package/dist/assets/{SearchBar.css → searchBar.css} +0 -0
  82. /package/dist/assets/{VerticalDivider.css → verticalDivider.css} +0 -0
@@ -1,73 +1,63 @@
1
- import "../../assets/BlockView.css";
2
- import { jsxs as g, jsx as l } from "react/jsx-runtime";
3
- import { useState as x, useEffect as T, useMemo as L } from "react";
4
- import { getBlockNumberByDto as R } from "../../services/BlockService.js";
5
- import { a as B, b as C } from "../../index.es-BD4kFWFx.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 = ({
1
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
+ import { useState as B, useEffect as C, useMemo as A } from "react";
3
+ import { s as e } from "../../BlockView.module-8kbPxxc4.js";
4
+ import { getBlockNumberByDto as D } from "../../services/BlockService.js";
5
+ import { a as E, c as S } from "../../index.es-Cm4X20_S.js";
6
+ const R = ({
17
7
  rows: s,
18
8
  columns: t,
19
- hideText: u = !1,
20
- errorBlocks: p = [],
9
+ hideText: n = !1,
10
+ errorBlocks: k = [],
21
11
  showNumbers: y = !0,
22
- clickable: h = !0,
23
- size: b = 15,
24
- onClick: m = null,
25
- currentBlock: i,
26
- blocks: _,
12
+ clickable: N = !0,
13
+ size: d = 15,
14
+ onClick: u = null,
15
+ currentBlock: c,
16
+ blocks: b,
27
17
  blockViewTitle: v,
28
- blockLabel: f
18
+ blockLabel: $
29
19
  }) => {
30
- const [k, d] = x(0);
31
- T(() => {
32
- if (!i)
20
+ const [p, h] = B(0);
21
+ C(() => {
22
+ if (!c)
33
23
  return;
34
- const c = R(i, t);
35
- d(c);
36
- }, [i, t]);
37
- const N = L(() => s * t, [s, t]), $ = (c) => {
38
- m && m(c, i ?? void 0);
39
- }, w = ({ row: c, column: r }) => _.length === 0 ? !0 : _.some((a) => a.position?.row === c && a.position?.column === r);
40
- return /* @__PURE__ */ g("div", { className: o.grid, children: [
41
- !u && /* @__PURE__ */ l(B, { level: 1, bold: !0, className: o.black, children: v }),
42
- /* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${b}rem`, height: `${b}rem` }, children: Array.from({ length: s }).map((c, r) => /* @__PURE__ */ l("div", { className: o.blockRow, children: Array.from({ length: t }).map((a, n) => {
43
- const e = t * r + n + 1;
44
- return /* @__PURE__ */ l(
24
+ const o = D(c, t);
25
+ h(o);
26
+ }, [c, t]);
27
+ const g = A(() => 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((a) => a.position?.row === o && a.position?.column === l);
30
+ return /* @__PURE__ */ f("div", { className: e.grid, children: [
31
+ !n && /* @__PURE__ */ i(E, { 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((a, m) => {
33
+ const r = t * l + m + 1;
34
+ return /* @__PURE__ */ i(
45
35
  "div",
46
36
  {
47
37
  "data-testid": "blockViewBlock",
48
- className: `${o.block} ${k === e ? o.active : ""} ${w({ row: r + 1, column: n + 1 }) ? "" : o.empty} ${p.includes(e) ? o.error : ""}`,
49
- id: `block${e}`,
50
- onClick: h ? () => {
51
- d(e), $({ row: r + 1, column: n + 1 });
38
+ className: `${e.block} ${p === r ? e.active : ""} ${x({ row: l + 1, column: m + 1 }) ? "" : e.empty} ${k.includes(r) ? e.error : ""}`,
39
+ id: `block${r}`,
40
+ onClick: N ? () => {
41
+ h(r), w({ row: l + 1, column: m + 1 });
52
42
  } : void 0,
53
- children: y && /* @__PURE__ */ l(
43
+ children: y && /* @__PURE__ */ i(
54
44
  "div",
55
45
  {
56
- className: `${o.blockText} ${k === e ? o.black : ""}`,
57
- children: e
46
+ className: `${e.blockText} ${p === r ? e.black : ""}`,
47
+ children: r
58
48
  }
59
49
  )
60
50
  },
61
- e
51
+ r
62
52
  );
63
- }) }, r)) }),
64
- !u && /* @__PURE__ */ g(C, { themeColor: "primary", level: 6, children: [
65
- N,
53
+ }) }, l)) }),
54
+ !n && /* @__PURE__ */ f(S, { themeColor: "primary", level: 6, children: [
55
+ g,
66
56
  " ",
67
- f
57
+ $
68
58
  ] })
69
59
  ] });
70
60
  };
71
61
  export {
72
- O as BlockView
62
+ R as BlockView
73
63
  };
@@ -1,8 +1,9 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { d as n, v as B, t as s, r as i, g as o, s as t, f as a } from "../../vi.JYQecGiw-8gz0k16C.js";
3
- import { BlockView as k } from "./BlockView.js";
4
- n("BlockView Test", () => {
5
- const c = B.fn(), e = {
2
+ import { r as s, s as o, f as n } from "../../react.esm-BeDwcQWb.js";
3
+ import { BlockView as r } from "./BlockView.js";
4
+ import { d as B, v as a, t as i, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ B("BlockView Test", () => {
6
+ const c = a.fn(), e = {
6
7
  id: "1",
7
8
  fieldId: "2",
8
9
  position: {
@@ -10,10 +11,10 @@ n("BlockView Test", () => {
10
11
  column: 2
11
12
  }
12
13
  };
13
- s("renders BlockView correctly with 2x3 blocks", () => {
14
- i(
14
+ i("renders BlockView correctly with 2x3 blocks", () => {
15
+ s(
15
16
  /* @__PURE__ */ l(
16
- k,
17
+ r,
17
18
  {
18
19
  blocks: [e],
19
20
  columns: 2,
@@ -23,13 +24,13 @@ n("BlockView Test", () => {
23
24
  blockLabel: "Block"
24
25
  }
25
26
  )
26
- ), o(t.getByText("Layout")).toBeInTheDocument(), o(t.getByText("6 Block")).toBeInTheDocument();
27
- const r = t.getAllByTestId("blockViewBlock");
28
- o(r.length).toBe(6);
29
- }), s("executes onClick method", () => {
30
- i(
27
+ ), t(o.getByText("Layout")).toBeInTheDocument(), t(o.getByText("6 Block")).toBeInTheDocument();
28
+ const k = o.getAllByTestId("blockViewBlock");
29
+ t(k.length).toBe(6);
30
+ }), i("executes onClick method", () => {
31
+ s(
31
32
  /* @__PURE__ */ l(
32
- k,
33
+ r,
33
34
  {
34
35
  blocks: [e],
35
36
  columns: 2,
@@ -41,6 +42,6 @@ n("BlockView Test", () => {
41
42
  blockLabel: "Block"
42
43
  }
43
44
  )
44
- ), a.click(t.getByText("6")), o(c).toHaveBeenCalled();
45
+ ), n.click(o.getByText("6")), t(c).toHaveBeenCalled();
45
46
  });
46
47
  });
@@ -0,0 +1,65 @@
1
+ type DeleteModalProps = {
2
+ /**
3
+ * The title of the modal.
4
+ */
5
+ title: string;
6
+ /**
7
+ * The label of the confirm button.
8
+ */
9
+ confirmButtonLabel: string;
10
+ /**
11
+ * The label of the cancel button.
12
+ */
13
+ cancelButtonLabel: string;
14
+ /**
15
+ * The header text of the delete modal.
16
+ */
17
+ deleteHeader: string;
18
+ /**
19
+ * The body text of the delete modal. Each entry will be displayed as a bullet point.
20
+ */
21
+ deleteBody?: string[];
22
+ /**
23
+ * The header to display in the modal if the {@link isDeletePossible} is false.
24
+ */
25
+ impossibleDeleteHeader: string;
26
+ /**
27
+ * The icon to display in the modal.
28
+ */
29
+ icon?: string;
30
+ /**
31
+ * The state of the modal.
32
+ */
33
+ open: boolean;
34
+ /**
35
+ * The function to set the state of the modal.
36
+ */
37
+ setOpen: (open: boolean) => void;
38
+ /**
39
+ * The function to call when the confirm button is clicked.
40
+ */
41
+ onDelete: () => void;
42
+ /**
43
+ * If true, the delete button will be enabled.
44
+ * If false, the delete button will be disabled and the {@link impossibleDeleteHeader} will be displayed.
45
+ * Default is _true_.
46
+ */
47
+ isDeletePossible?: boolean;
48
+ };
49
+ /**
50
+ * A modal component for deleting items.
51
+ * @prop {string} title - The title of the modal.
52
+ * @prop {string} confirmButtonLabel - The label of the confirm button.
53
+ * @prop {string} cancelButtonLabel - The label of the cancel button.
54
+ * @prop {string} deleteHeader - The header text of the delete modal.
55
+ * @prop {string[]} deleteBody - The body text of the delete modal. Each entry will be displayed as a bullet point.
56
+ * @prop {string} impossibleDeleteHeader - The header to display in the modal if the {@link isDeletePossible} is false.
57
+ * @prop {string} icon - The icon to display in the modal.
58
+ * @prop {boolean} open - The state of the modal.
59
+ * @prop {function} setOpen - The function to set the state of the modal.
60
+ * @prop {function} onDelete - The function to call when the confirm button is clicked.
61
+ * @prop {boolean} isDeletePossible - If true, the delete button will be enabled. If false, the delete button will be disabled and the {@link impossibleDeleteHeader} will be displayed. Default is _true_.
62
+ * @returns {ReactElement} A modal component for deleting items.
63
+ */
64
+ export declare const DeleteModal: ({ title, confirmButtonLabel, cancelButtonLabel, deleteHeader, deleteBody, icon, impossibleDeleteHeader, open, setOpen, onDelete, isDeletePossible, }: DeleteModalProps) => import("react/jsx-runtime").JSX.Element;
65
+ export {};