@hortiview/shared-components 2.23.2 → 2.23.3
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.23.3](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.23.2...v2.23.3) (2026-04-19)
|
|
2
|
+
|
|
3
|
+
### Code Refactoring
|
|
4
|
+
|
|
5
|
+
* add EmptyAndActiveBlocks story to showcase combined block views ([233f5b0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/233f5b09b67e4ce0d0f2cf441f48c18bcae49d5f))
|
|
6
|
+
* enhance BlockView styles and click handling for better user interaction ([a7f0318](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/a7f031827c250363684d57bc7828dce473bfd389))
|
|
7
|
+
|
|
1
8
|
## [2.23.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.23.1...v2.23.2) (2026-04-15)
|
|
2
9
|
|
|
3
10
|
### Code Refactoring
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._grid_gfk3g_1{display:flex;padding-bottom:0;flex-direction:column;justify-content:center;align-items:center;gap:1rem;align-self:stretch}._blockLayout_gfk3g_11{padding:.5rem;gap:.5rem;display:flex;flex-direction:column;border-radius:.5rem;background:var(--lmnt-theme-secondary-100);width:15rem;height:15rem}._blockRow_gfk3g_22{display:flex;flex-direction:row;gap:.5rem;height:100%;align-self:stretch}._block_gfk3g_11{flex:auto;border-radius:.25rem;background:var(--lmnt-theme-secondary);align-items:center;display:flex;justify-content:center;position:relative}._block_gfk3g_11._active_gfk3g_41{background:var(--lmnt-theme-primary);margin:-2px}._block_gfk3g_11._error_gfk3g_46{border:2px solid var(--lmnt-theme-danger);background:var(--lmnt-theme-danger-50);margin:-2px}._block_gfk3g_11._empty_gfk3g_52{background:var(--lmnt-theme-secondary-200);cursor:default}._activeBlock_gfk3g_57{background:var(--lmnt-theme-primary)}._block_gfk3g_11._clickable_gfk3g_61{cursor:pointer}._blockText_gfk3g_65{display:flex;justify-content:center;position:absolute;width:1vw;height:1vh;align-items:center;color:var(--lmnt-theme-on-primary)}._emptyLayout_gfk3g_75{display:flex;justify-content:center;align-items:center;background:var(--lmnt-theme-surface-variant);border-radius:.5rem}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as o, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { c as D, b as S, a as F } from "../../index.es-DUrjyxNI.js";
|
|
3
3
|
import { c as M } from "../../index-Df2FYN-K.js";
|
|
4
4
|
import { useState as V, useEffect as q, useMemo as G } from "react";
|
|
5
5
|
import { getBlockNumberByDto as H } from "../../services/BlockService.js";
|
|
6
|
-
import '../../assets/BlockView.css';const I = "
|
|
6
|
+
import '../../assets/BlockView.css';const I = "_grid_gfk3g_1", J = "_blockLayout_gfk3g_11", K = "_blockRow_gfk3g_22", O = "_block_gfk3g_11", P = "_active_gfk3g_41", Q = "_error_gfk3g_46", U = "_empty_gfk3g_52", W = "_activeBlock_gfk3g_57", X = "_clickable_gfk3g_61", Y = "_blockText_gfk3g_65", Z = "_emptyLayout_gfk3g_75", t = {
|
|
7
7
|
grid: I,
|
|
8
8
|
blockLayout: J,
|
|
9
9
|
blockRow: K,
|
|
@@ -12,50 +12,52 @@ import '../../assets/BlockView.css';const I = "_grid_1ym34_1", J = "_blockLayout
|
|
|
12
12
|
error: Q,
|
|
13
13
|
empty: U,
|
|
14
14
|
activeBlock: W,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
clickable: X,
|
|
16
|
+
blockText: Y,
|
|
17
|
+
emptyLayout: Z
|
|
17
18
|
}, rt = ({
|
|
18
19
|
rows: e,
|
|
19
|
-
columns:
|
|
20
|
-
hideText:
|
|
20
|
+
columns: c,
|
|
21
|
+
hideText: h = !1,
|
|
21
22
|
hideBlockCountText: w = !1,
|
|
22
23
|
errorBlocks: N = [],
|
|
23
|
-
showNumbers:
|
|
24
|
-
clickable:
|
|
25
|
-
size:
|
|
24
|
+
showNumbers: x = !0,
|
|
25
|
+
clickable: b = !0,
|
|
26
|
+
size: _ = 15,
|
|
26
27
|
onClick: u = null,
|
|
27
|
-
currentBlock:
|
|
28
|
-
activeBlocks:
|
|
28
|
+
currentBlock: a,
|
|
29
|
+
activeBlocks: g,
|
|
29
30
|
blocks: m,
|
|
30
31
|
blockViewTitle: L,
|
|
31
32
|
blockLabel: T,
|
|
32
33
|
emptyViewTitle: B
|
|
33
34
|
}) => {
|
|
34
|
-
const [C,
|
|
35
|
+
const [C, y] = V(0);
|
|
35
36
|
q(() => {
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
const E = G(() => e *
|
|
41
|
-
u && u(
|
|
42
|
-
}, $ = ({ row:
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
!
|
|
37
|
+
if (!a) return;
|
|
38
|
+
const l = H(a, c);
|
|
39
|
+
y(l);
|
|
40
|
+
}, [a, c]);
|
|
41
|
+
const E = G(() => e * c, [e, c]), R = (l) => {
|
|
42
|
+
u && u(l, a ?? void 0);
|
|
43
|
+
}, $ = ({ row: l, column: r }) => m.length === 0 ? !0 : m.some((d) => d.position?.row === l && d.position?.column === r), p = !e && !c;
|
|
44
|
+
return /* @__PURE__ */ f("div", { "data-testid": "block-view-container", className: t.grid, children: [
|
|
45
|
+
!h && /* @__PURE__ */ o(D, { level: 1, bold: !0, className: t.black, children: L }),
|
|
45
46
|
/* @__PURE__ */ o(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
48
49
|
"data-testid": "block-view-layout",
|
|
49
|
-
className:
|
|
50
|
-
style: { width: `${
|
|
51
|
-
children:
|
|
52
|
-
const
|
|
50
|
+
className: p ? t.emptyLayout : t.blockLayout,
|
|
51
|
+
style: { width: `${_}rem`, height: `${_}rem` },
|
|
52
|
+
children: p ? /* @__PURE__ */ o(j, { emptyViewTitle: B }) : /* @__PURE__ */ o(v, { children: Array.from({ length: e }).map((l, r) => /* @__PURE__ */ o("div", { "data-testid": "block-view-row", className: t.blockRow, children: Array.from({ length: c }).map((d, s) => {
|
|
53
|
+
const i = c * r + s + 1, n = $({ row: r + 1, column: s + 1 }), A = M(
|
|
53
54
|
t.block,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
b && n && t.clickable,
|
|
56
|
+
C === i && t.active,
|
|
57
|
+
!n && t.empty,
|
|
58
|
+
N.includes(i) && t.error,
|
|
59
|
+
g && m.some(
|
|
60
|
+
(k) => k.id && g.includes(k.id) && k.position?.row === r + 1 && k.position?.column === s + 1
|
|
59
61
|
) && t.activeBlock
|
|
60
62
|
);
|
|
61
63
|
return /* @__PURE__ */ o(
|
|
@@ -63,31 +65,31 @@ import '../../assets/BlockView.css';const I = "_grid_1ym34_1", J = "_blockLayout
|
|
|
63
65
|
{
|
|
64
66
|
"data-testid": "block-view-block",
|
|
65
67
|
className: A,
|
|
66
|
-
id: `block${
|
|
67
|
-
onClick:
|
|
68
|
-
|
|
68
|
+
id: `block${i}`,
|
|
69
|
+
onClick: b && n ? () => {
|
|
70
|
+
y(i), R({ row: r + 1, column: s + 1 });
|
|
69
71
|
} : void 0,
|
|
70
|
-
children:
|
|
72
|
+
children: x && n && /* @__PURE__ */ o(
|
|
71
73
|
"div",
|
|
72
74
|
{
|
|
73
75
|
"data-testid": "block-view-block-number",
|
|
74
76
|
className: t.blockText,
|
|
75
|
-
children:
|
|
77
|
+
children: i
|
|
76
78
|
}
|
|
77
79
|
)
|
|
78
80
|
},
|
|
79
|
-
|
|
81
|
+
i
|
|
80
82
|
);
|
|
81
|
-
}) },
|
|
83
|
+
}) }, r)) })
|
|
82
84
|
}
|
|
83
85
|
),
|
|
84
|
-
!w && /* @__PURE__ */
|
|
86
|
+
!w && /* @__PURE__ */ f(S, { themeColor: "primary", level: 6, children: [
|
|
85
87
|
E,
|
|
86
88
|
" ",
|
|
87
89
|
T
|
|
88
90
|
] })
|
|
89
91
|
] });
|
|
90
|
-
},
|
|
92
|
+
}, j = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ o(F, { bold: !0, children: e }) : /* @__PURE__ */ o(v, {});
|
|
91
93
|
export {
|
|
92
94
|
rt as BlockView
|
|
93
95
|
};
|
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": "2.23.
|
|
4
|
+
"version": "2.23.3",
|
|
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>",
|