@hortiview/shared-components 1.5.0 → 1.6.0
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,9 @@
|
|
|
1
|
+
## [1.6.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.5.0...v1.6.0) (2025-05-06)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add new test in FormCheckbox.test.tsx & change data-testid ([81525bd](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/81525bd36c7e3ff3de5127083d48d289d9efe039))
|
|
6
|
+
|
|
1
7
|
## [1.5.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.4.2...v1.5.0) (2025-05-05)
|
|
2
8
|
|
|
3
9
|
### Features
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { C } from "../../../index.es-BvrQnJ3j.js";
|
|
1
|
+
import { jsx as o, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { C as p } from "../../../index.es-BvrQnJ3j.js";
|
|
3
3
|
import { G as x } from "../../../index.es-DntoATwO.js";
|
|
4
4
|
import { a as d } from "../../../index.es-CF_xy2ns.js";
|
|
5
5
|
import { useFormContext as l, Controller as u } from "react-hook-form";
|
|
6
6
|
const v = ({
|
|
7
|
-
propertyName:
|
|
7
|
+
propertyName: e,
|
|
8
8
|
label: n,
|
|
9
|
-
validate:
|
|
10
|
-
required:
|
|
11
|
-
onChange:
|
|
12
|
-
disabled:
|
|
9
|
+
validate: s,
|
|
10
|
+
required: a,
|
|
11
|
+
onChange: c,
|
|
12
|
+
disabled: m
|
|
13
13
|
}) => {
|
|
14
14
|
const { control: h } = l();
|
|
15
15
|
return /* @__PURE__ */ o(
|
|
16
16
|
u,
|
|
17
17
|
{
|
|
18
|
-
name:
|
|
18
|
+
name: e,
|
|
19
19
|
control: h,
|
|
20
20
|
rules: {
|
|
21
|
-
required:
|
|
22
|
-
validate:
|
|
21
|
+
required: a,
|
|
22
|
+
validate: s
|
|
23
23
|
},
|
|
24
|
-
render: ({ field: r, fieldState:
|
|
24
|
+
render: ({ field: r, fieldState: t }) => /* @__PURE__ */ C(x, { direction: "vertical", gap: "none", children: [
|
|
25
25
|
/* @__PURE__ */ o(
|
|
26
|
-
|
|
26
|
+
p,
|
|
27
27
|
{
|
|
28
|
-
"data-testid":
|
|
28
|
+
"data-testid": `checkbox-${e}`,
|
|
29
29
|
...r,
|
|
30
30
|
label: n,
|
|
31
31
|
onChange: (...i) => {
|
|
32
|
-
r.onChange(...i),
|
|
32
|
+
r.onChange(...i), c?.();
|
|
33
33
|
},
|
|
34
34
|
checked: r.value,
|
|
35
|
-
disabled:
|
|
35
|
+
disabled: m
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
|
|
38
|
+
t.error && /* @__PURE__ */ o(d, { "data-testid": "checkbox-error-message", themeColor: "error", children: t.error.message })
|
|
39
39
|
] })
|
|
40
40
|
}
|
|
41
41
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a as
|
|
3
|
-
import { FormCheckBox as
|
|
4
|
-
import { v as e, d as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { a as s, s as t, f as h } from "../../../react.esm-CX1WJ2Pp.js";
|
|
3
|
+
import { FormCheckBox as n } from "./FormCheckBox.js";
|
|
4
|
+
import { v as e, d as m, t as c, g as r } from "../../../vi.CjhMlMwf-BCJNwXvu.js";
|
|
5
|
+
const l = e.fn();
|
|
6
6
|
e.mock("react-hook-form", () => ({
|
|
7
7
|
...e.importActual("react-hook-form"),
|
|
8
8
|
Controller: ({
|
|
9
9
|
render: o
|
|
10
10
|
}) => o({
|
|
11
11
|
field: {
|
|
12
|
-
onChange:
|
|
12
|
+
onChange: l
|
|
13
13
|
},
|
|
14
14
|
fieldState: { error: { message: "error" } }
|
|
15
15
|
}),
|
|
@@ -39,12 +39,14 @@ e.mock("react-hook-form", () => ({
|
|
|
39
39
|
watch: () => "2024-08-07"
|
|
40
40
|
})
|
|
41
41
|
}));
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
|
|
42
|
+
m("FormCheckBox Test", () => {
|
|
43
|
+
c("render FormCheckBox", () => {
|
|
44
|
+
s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue" })), r(t.getByText("user.hasValue")).toBeInTheDocument(), r(t.getByText("error")).toBeInTheDocument(), r(t.getByRole("checkbox")).toBeInTheDocument();
|
|
45
|
+
}), c("render FormCheckBox click", () => {
|
|
46
|
+
s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue", onChange: l }));
|
|
47
47
|
const o = t.getByRole("checkbox");
|
|
48
|
-
|
|
48
|
+
h.click(o), r(l).toHaveBeenCalled();
|
|
49
|
+
}), c("should render checkbox with correct data-testid", () => {
|
|
50
|
+
s(/* @__PURE__ */ a(n, { propertyName: "hasValue", label: "user.hasValue" })), r(t.getByTestId("checkbox-hasValue")).toBeInTheDocument();
|
|
49
51
|
});
|
|
50
52
|
});
|
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": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
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>",
|