@hortiview/shared-components 2.26.1 → 2.26.2
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,19 +1,8 @@
|
|
|
1
|
-
## [2.26.
|
|
2
|
-
|
|
3
|
-
### Bug Fixes
|
|
4
|
-
|
|
5
|
-
* add permission provider to broken stories ([6677f7f](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/6677f7fb9cfc4b5e256ea16fce429b95348f55d0))
|
|
6
|
-
* add workaround for element bug on textKey = 'value' and multiSelect = true ([4926a72](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/4926a726b75b422f6f7bd8cacf71b86565d32b14))
|
|
7
|
-
* fix search functionality on multi select component ([5a01163](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/5a011636eeef5c5296d2959a1307425256fed706))
|
|
1
|
+
## [2.26.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.26.1...v2.26.2) (2026-05-26)
|
|
8
2
|
|
|
9
3
|
### Code Refactoring
|
|
10
4
|
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
### Styles
|
|
14
|
-
|
|
15
|
-
* improve positioning of search cursor in multi select ([d71bff9](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/d71bff9f3abda3a3a3466bb16850b67f3aa11bfc))
|
|
16
|
-
* improve stories by adding width ([de089f8](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/de089f84d720f6bd47b1b22900259f007d6b1a1e))
|
|
5
|
+
* adjust BlockView size props, minor styling achanges ([c2dca99](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/c2dca9979c41025c00a14330094aea081cc44c23)), closes [#20844](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/issues/20844)
|
|
17
6
|
|
|
18
7
|
## [2.26.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.26.0...v2.26.1) (2026-05-22)
|
|
19
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._grid_otqrz_1{display:flex;padding-bottom:0;flex-direction:column;justify-content:center;align-items:center;gap:1rem;align-self:stretch;height:100%}._blockLayout_otqrz_13{padding:.5rem;gap:.5rem;display:flex;flex-direction:column;border-radius:.5rem;background:var(--lmnt-theme-secondary-100)}._absoluteSize_otqrz_22{height:15rem;width:15rem}._relativeSize_otqrz_27{height:70%;width:50%;max-height:50vh;max-width:50vw;min-height:10rem;min-width:10rem}._relativeSize_otqrz_27._mobile_otqrz_38{height:70%;width:60%;max-height:50vh;max-width:75vw}._blockRow_otqrz_46{display:flex;flex-direction:row;gap:.5rem;height:100%;align-self:stretch}._block_otqrz_13{flex:auto;justify-content:center;border-radius:.25rem;background:var(--lmnt-theme-secondary);align-items:center;display:flex;position:relative;-webkit-tap-highlight-color:transparent;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,transform .2s ease-in-out}._block_otqrz_13._clickable_otqrz_70{cursor:pointer}._block_otqrz_13._empty_otqrz_74{background:var(--lmnt-theme-secondary-200);cursor:default}._block_otqrz_13._active_otqrz_79{background:var(--lmnt-theme-primary)}._block_otqrz_13._error_otqrz_83{box-shadow:inset 0 0 0 3px var(--lmnt-theme-danger)}._block_otqrz_13._hoverEffects_otqrz_87._active_otqrz_79:hover{background:var(--lmnt-theme-primary-600)}._block_otqrz_13._hoverEffects_otqrz_87._clickable_otqrz_70:hover:not(._active_otqrz_79){background:var(--lmnt-theme-secondary-500)}._block_otqrz_13._hoverEffects_otqrz_87._clickable_otqrz_70:hover{transform:scale(1.02)}._blockText_otqrz_99{display:flex;justify-content:center;position:absolute;width:1vw;height:1vh;align-items:center;color:var(--lmnt-theme-on-primary)}._emptyLayout_otqrz_109{display:flex;justify-content:center;align-items:center;background:var(--lmnt-theme-surface-variant);border-radius:.5rem}
|
|
@@ -47,9 +47,15 @@ type BlockViewProps<T extends Block & {
|
|
|
47
47
|
*/
|
|
48
48
|
clickable?: boolean;
|
|
49
49
|
/**
|
|
50
|
-
* the size
|
|
50
|
+
* Set the size for the block view
|
|
51
|
+
* @remarks
|
|
52
|
+
* - 'absolute' - For containers without fixed dimensions (size depending on content) </br>Uses: { height: '15rem', width: '15rem' }
|
|
53
|
+
* - 'relative' - For containers with fixed size constraints (like modals with fixed dimensions) </br>Uses: { height: '70%', width: '50%' }
|
|
54
|
+
* - IMPORTANT: For 'relative' the parent container of the BlockView needs to have a fixed height and width. Otherwise you'll run into css issues
|
|
55
|
+
*
|
|
56
|
+
* @default 'absolute'
|
|
51
57
|
*/
|
|
52
|
-
size?:
|
|
58
|
+
size?: 'absolute' | 'relative';
|
|
53
59
|
/**
|
|
54
60
|
* the title of the block view, shown when `hideText` is false
|
|
55
61
|
*/
|
|
@@ -1,95 +1,98 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useState as V, useEffect as
|
|
1
|
+
import { jsxs as z, jsx as o, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { c as A, b as F, a as M } from "../../index.es-EXzC8zuP.js";
|
|
3
|
+
import { c as h } from "../../index-_-9ybP20.js";
|
|
4
|
+
import { useState as V, useEffect as $, useMemo as G } from "react";
|
|
5
5
|
import { getBlockNumberByDto as H } from "../../services/BlockService.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
import { useBreakpoints as I } from "../../hooks/useBreakpoints.js";
|
|
7
|
+
import '../../assets/BlockView.css';const J = "_grid_otqrz_1", K = "_blockLayout_otqrz_13", O = "_absoluteSize_otqrz_22", P = "_relativeSize_otqrz_27", Q = "_mobile_otqrz_38", U = "_blockRow_otqrz_46", W = "_block_otqrz_13", X = "_clickable_otqrz_70", Y = "_empty_otqrz_74", Z = "_active_otqrz_79", j = "_error_otqrz_83", tt = "_hoverEffects_otqrz_87", ot = "_blockText_otqrz_99", et = "_emptyLayout_otqrz_109", t = {
|
|
8
|
+
grid: J,
|
|
9
|
+
blockLayout: K,
|
|
10
|
+
absoluteSize: O,
|
|
11
|
+
relativeSize: P,
|
|
12
|
+
mobile: Q,
|
|
13
|
+
blockRow: U,
|
|
14
|
+
block: W,
|
|
15
15
|
clickable: X,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
empty: Y,
|
|
17
|
+
active: Z,
|
|
18
|
+
error: j,
|
|
19
|
+
hoverEffects: tt,
|
|
20
|
+
blockText: ot,
|
|
21
|
+
emptyLayout: et
|
|
22
|
+
}, bt = ({
|
|
19
23
|
rows: e,
|
|
20
|
-
columns:
|
|
21
|
-
hideText:
|
|
22
|
-
hideBlockCountText:
|
|
23
|
-
errorBlocks:
|
|
24
|
+
columns: r,
|
|
25
|
+
hideText: w = !1,
|
|
26
|
+
hideBlockCountText: N = !1,
|
|
27
|
+
errorBlocks: g = [],
|
|
24
28
|
showNumbers: x = !0,
|
|
25
|
-
clickable:
|
|
26
|
-
size:
|
|
27
|
-
onClick:
|
|
28
|
-
currentBlock:
|
|
29
|
-
activeBlocks:
|
|
29
|
+
clickable: d = !1,
|
|
30
|
+
size: k = "absolute",
|
|
31
|
+
onClick: p = null,
|
|
32
|
+
currentBlock: s,
|
|
33
|
+
activeBlocks: v,
|
|
30
34
|
blocks: m,
|
|
31
|
-
blockViewTitle:
|
|
32
|
-
blockLabel:
|
|
33
|
-
emptyViewTitle:
|
|
35
|
+
blockViewTitle: S,
|
|
36
|
+
blockLabel: E,
|
|
37
|
+
emptyViewTitle: L
|
|
34
38
|
}) => {
|
|
35
|
-
const [
|
|
36
|
-
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
39
|
-
y(
|
|
40
|
-
}, [
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
!
|
|
39
|
+
const [T, y] = V(0), { isDesktop: f } = I();
|
|
40
|
+
$(() => {
|
|
41
|
+
if (!s) return;
|
|
42
|
+
const c = H(s, r);
|
|
43
|
+
y(c);
|
|
44
|
+
}, [s, r]);
|
|
45
|
+
const C = G(() => e * r, [e, r]), R = (c) => {
|
|
46
|
+
p && p(c, s ?? void 0);
|
|
47
|
+
}, B = ({ row: c, column: i }) => m.length === 0 ? !0 : m.some((u) => u.position?.row === c && u.position?.column === i), _ = !e && !r;
|
|
48
|
+
return /* @__PURE__ */ z("div", { "data-testid": "block-view-container", className: t.grid, children: [
|
|
49
|
+
!w && /* @__PURE__ */ o(A, { level: 1, bold: !0, className: t.black, children: S }),
|
|
46
50
|
/* @__PURE__ */ o(
|
|
47
51
|
"div",
|
|
48
52
|
{
|
|
49
53
|
"data-testid": "block-view-layout",
|
|
50
|
-
className:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
className: h(
|
|
55
|
+
_ && t.emptyLayout,
|
|
56
|
+
!_ && t.blockLayout,
|
|
57
|
+
k === "absolute" && t.absoluteSize,
|
|
58
|
+
k === "relative" && t.relativeSize,
|
|
59
|
+
!f && t.mobile
|
|
60
|
+
),
|
|
61
|
+
children: _ ? /* @__PURE__ */ o(rt, { emptyViewTitle: L }) : /* @__PURE__ */ o(q, { children: Array.from({ length: e }).map((c, i) => /* @__PURE__ */ o("div", { "data-testid": "block-view-row", className: t.blockRow, children: Array.from({ length: r }).map((u, a) => {
|
|
62
|
+
const l = r * i + a + 1, n = B({ row: i + 1, column: a + 1 }), D = h(
|
|
54
63
|
t.block,
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
f && t.hoverEffects,
|
|
65
|
+
d && n && t.clickable,
|
|
66
|
+
T === l && t.active,
|
|
57
67
|
!n && t.empty,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
) && t.
|
|
68
|
+
g.includes(l) && t.error,
|
|
69
|
+
v && m.some(
|
|
70
|
+
(b) => b.id && v.includes(b.id) && b.position?.row === i + 1 && b.position?.column === a + 1
|
|
71
|
+
) && t.active
|
|
62
72
|
);
|
|
63
73
|
return /* @__PURE__ */ o(
|
|
64
74
|
"div",
|
|
65
75
|
{
|
|
66
76
|
"data-testid": "block-view-block",
|
|
67
|
-
className:
|
|
68
|
-
id: `block${
|
|
69
|
-
onClick:
|
|
70
|
-
y(
|
|
77
|
+
className: D,
|
|
78
|
+
id: `block${l}`,
|
|
79
|
+
onClick: d && n ? () => {
|
|
80
|
+
y(l), R({ row: i + 1, column: a + 1 });
|
|
71
81
|
} : void 0,
|
|
72
|
-
children: x && n && /* @__PURE__ */ o(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
"data-testid": "block-view-block-number",
|
|
76
|
-
className: t.blockText,
|
|
77
|
-
children: i
|
|
78
|
-
}
|
|
79
|
-
)
|
|
82
|
+
children: x && n && /* @__PURE__ */ o("div", { "data-testid": "block-view-block-number", className: t.blockText, children: l })
|
|
80
83
|
},
|
|
81
|
-
|
|
84
|
+
l
|
|
82
85
|
);
|
|
83
|
-
}) },
|
|
86
|
+
}) }, i)) })
|
|
84
87
|
}
|
|
85
88
|
),
|
|
86
|
-
!
|
|
87
|
-
|
|
89
|
+
!N && /* @__PURE__ */ z(F, { themeColor: "primary", level: 6, children: [
|
|
90
|
+
C,
|
|
88
91
|
" ",
|
|
89
|
-
|
|
92
|
+
E
|
|
90
93
|
] })
|
|
91
94
|
] });
|
|
92
|
-
},
|
|
95
|
+
}, rt = ({ emptyViewTitle: e }) => e ? /* @__PURE__ */ o(M, { bold: !0, children: e }) : /* @__PURE__ */ o(q, {});
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
bt as BlockView
|
|
95
98
|
};
|
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.26.
|
|
4
|
+
"version": "2.26.2",
|
|
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>",
|