@hortiview/shared-components 2.17.0 → 2.18.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,17 @@
|
|
|
1
|
+
## [2.18.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.17.0...v2.18.0) (2026-03-05)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* adjust searchable default logic ([0e66c32](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/0e66c32a89b72fad851aad24b2a24bc152844520))
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* fixed publish.yaml to use devops service user ([ec046ce](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/ec046ce290294d3857a6fedf4594a0e688bfd9f0))
|
|
10
|
+
|
|
11
|
+
### Code Refactoring
|
|
12
|
+
|
|
13
|
+
* replace isDesktopNavbar with isDesktop and update tests ([6bc6f7e](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/6bc6f7e47a963b95f367200938d79d25c83ba231))
|
|
14
|
+
|
|
1
15
|
## [2.17.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.16.2...v2.17.0) (2026-02-27)
|
|
2
16
|
|
|
3
17
|
### Features
|
|
@@ -26,7 +26,7 @@ export type FormSelectProps<T extends FieldValues> = Omit<SelectProps, 'classNam
|
|
|
26
26
|
multi?: boolean;
|
|
27
27
|
/** if true, the select allows the user to clear the selection */
|
|
28
28
|
clearable?: boolean;
|
|
29
|
-
/** if true, the select allows the user to search for options */
|
|
29
|
+
/** if true, the select allows the user to search for options defaults to enabled on desktop and disabled on mobile unless explicitly overridden */
|
|
30
30
|
searchable?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* the rules for the picker
|
|
@@ -47,7 +47,7 @@ export type FormSelectOption = {
|
|
|
47
47
|
* creates a Select which should be part of a form component.
|
|
48
48
|
* the Select is wrapped by the react hook forms {@link Controller} component.
|
|
49
49
|
* @param clearable if the select allows the user to clear the selection
|
|
50
|
-
* @param searchable
|
|
50
|
+
* @param searchable whether the select allows the user to search for options. If not provided, search is enabled on desktop and disabled on mobile by default.
|
|
51
51
|
* @param disabled if the select is disabled
|
|
52
52
|
* @param hidden if the select should be hidden
|
|
53
53
|
* @param hoisted if the select should be rendered outside of the parent
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, Fragment as g, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import { g as u } from "../../../get-D8IXqiys.js";
|
|
3
|
-
import { i as
|
|
3
|
+
import { i as L } from "../../../isArray-BjSPDQ4v.js";
|
|
4
4
|
import { useMemo as z } from "react";
|
|
5
|
-
import { useFormContext as
|
|
6
|
-
import { M as
|
|
7
|
-
import { useHelperText as
|
|
8
|
-
import { Select as
|
|
9
|
-
import { SelectTooltipText as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
import { useFormContext as O, Controller as C } from "react-hook-form";
|
|
6
|
+
import { M as Q } from "../../../react-tooltip.min-CVsI--2Y.js";
|
|
7
|
+
import { useHelperText as R } from "../../../hooks/useHelperText.js";
|
|
8
|
+
import { Select as U } from "../../Select/Select.js";
|
|
9
|
+
import { SelectTooltipText as W } from "./SelectTooltipText.js";
|
|
10
|
+
import { u as X } from "../../../useBreakpoints-MzTZ0tCT.js";
|
|
11
|
+
import '../../../assets/FormSelect.css';const Y = "_invalidHelperText_zh2wu_1", Z = "_invalidBorder_zh2wu_5", N = "_invalidPlaceholder_zh2wu_9", y = "_invalidDropdownIcon_zh2wu_13", K = "_formSelectContainer_zh2wu_18", ee = "_formSelect_zh2wu_18", te = "_multiText_zh2wu_53", ie = "_tooltip_zh2wu_62", oe = "_disabled_zh2wu_67", t = {
|
|
12
|
+
invalidHelperText: Y,
|
|
13
|
+
invalidBorder: Z,
|
|
14
|
+
invalidPlaceholder: N,
|
|
15
|
+
invalidDropdownIcon: y,
|
|
16
|
+
formSelectContainer: K,
|
|
17
|
+
formSelect: ee,
|
|
18
|
+
multiText: te,
|
|
19
|
+
tooltip: ie,
|
|
20
|
+
disabled: oe
|
|
21
|
+
}, _e = ({
|
|
21
22
|
propertyName: i,
|
|
22
|
-
label:
|
|
23
|
+
label: c,
|
|
23
24
|
options: r,
|
|
24
25
|
multi: a = !1,
|
|
25
26
|
disabled: _ = !1,
|
|
@@ -28,100 +29,100 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_zh2wu_1",
|
|
|
28
29
|
valueKey: n = "value",
|
|
29
30
|
textKey: x = "text",
|
|
30
31
|
clearable: I = !1,
|
|
31
|
-
searchable: D
|
|
32
|
-
noOptionsMessage:
|
|
33
|
-
rules:
|
|
34
|
-
menuPosition:
|
|
35
|
-
...
|
|
32
|
+
searchable: D,
|
|
33
|
+
noOptionsMessage: S = "",
|
|
34
|
+
rules: m,
|
|
35
|
+
menuPosition: b = "auto",
|
|
36
|
+
...o
|
|
36
37
|
}) => {
|
|
37
|
-
const {
|
|
38
|
-
control:
|
|
39
|
-
getFieldState:
|
|
40
|
-
formState: { errors:
|
|
41
|
-
} =
|
|
42
|
-
() => !w && u(
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
() =>
|
|
46
|
-
[
|
|
47
|
-
), { helperText:
|
|
38
|
+
const { isDesktop: B } = X(), {
|
|
39
|
+
control: T,
|
|
40
|
+
getFieldState: P,
|
|
41
|
+
formState: { errors: v, isValidating: w }
|
|
42
|
+
} = O(), F = z(
|
|
43
|
+
() => !w && u(v, i) !== void 0,
|
|
44
|
+
[v, i, w]
|
|
45
|
+
), M = z(
|
|
46
|
+
() => m?.required?.message,
|
|
47
|
+
[m]
|
|
48
|
+
), { helperText: j, helperTextPersistent: k } = R({
|
|
48
49
|
propertyName: i,
|
|
49
|
-
helperText:
|
|
50
|
-
requiredText:
|
|
50
|
+
helperText: o.helperText,
|
|
51
|
+
requiredText: M,
|
|
51
52
|
hasCharacterCount: !1
|
|
52
53
|
});
|
|
53
|
-
return H ? /* @__PURE__ */
|
|
54
|
+
return H ? /* @__PURE__ */ l(C, { name: i, control: T, render: () => /* @__PURE__ */ l(g, {}) }) : /* @__PURE__ */ l(
|
|
54
55
|
"div",
|
|
55
56
|
{
|
|
56
57
|
"data-testid": "form-select-container",
|
|
57
58
|
className: t.formSelectContainer,
|
|
58
|
-
"data-tooltip-id":
|
|
59
|
-
children: /* @__PURE__ */
|
|
59
|
+
"data-tooltip-id": c,
|
|
60
|
+
children: /* @__PURE__ */ l(
|
|
60
61
|
C,
|
|
61
62
|
{
|
|
62
63
|
name: i,
|
|
63
|
-
rules:
|
|
64
|
-
control:
|
|
65
|
-
render: ({ field: { ref:
|
|
64
|
+
rules: m,
|
|
65
|
+
control: T,
|
|
66
|
+
render: ({ field: { ref: le, onChange: f, value: p, ...q } }) => {
|
|
66
67
|
let h = r;
|
|
67
|
-
|
|
68
|
+
L(r) && u(r[0], "options") !== void 0 && (h = r.flatMap((e) => u(e, "options") ?? []));
|
|
68
69
|
const d = a ? h?.filter(
|
|
69
70
|
(e) => p?.includes(e[n])
|
|
70
|
-
) : h?.find((e) => e[n] === p), A = a &&
|
|
71
|
+
) : h?.find((e) => e[n] === p), A = a && o.multiDisplayType === "text" && o.fixedHeightInput, s = P(i).invalid, E = D ?? B, V = `
|
|
71
72
|
${t.formSelect}
|
|
72
|
-
${
|
|
73
|
-
${
|
|
74
|
-
${
|
|
75
|
-
${
|
|
73
|
+
${s ? t.invalidHelperText : ""}
|
|
74
|
+
${s ? t.invalidDropdownIcon : ""}
|
|
75
|
+
${s ? t.invalidBorder : ""}
|
|
76
|
+
${s ? t.invalidPlaceholder : ""}
|
|
76
77
|
${A ? t.multiText : ""}
|
|
77
78
|
${_ ? t.disabled : ""}`;
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
79
|
+
return /* @__PURE__ */ J(g, { children: [
|
|
80
|
+
/* @__PURE__ */ l(
|
|
81
|
+
U,
|
|
81
82
|
{
|
|
82
83
|
...q,
|
|
83
|
-
...
|
|
84
|
+
...o,
|
|
84
85
|
value: d ?? [],
|
|
85
|
-
label:
|
|
86
|
+
label: c,
|
|
86
87
|
variant: "outlined",
|
|
87
|
-
helperText:
|
|
88
|
-
helperTextPersistent:
|
|
88
|
+
helperText: j,
|
|
89
|
+
helperTextPersistent: k,
|
|
89
90
|
options: r,
|
|
90
91
|
valid: !F,
|
|
91
|
-
"data-testid":
|
|
92
|
-
multiSelect: !r?.length &&
|
|
93
|
-
className:
|
|
92
|
+
"data-testid": o["data-testid"] ?? `select-${i}`,
|
|
93
|
+
multiSelect: !r?.length && S ? !1 : a,
|
|
94
|
+
className: V,
|
|
94
95
|
disabled: _,
|
|
95
96
|
valueKey: n,
|
|
96
97
|
textKey: x,
|
|
97
98
|
onChange: (e) => {
|
|
98
99
|
if (e == null) {
|
|
99
|
-
|
|
100
|
+
f(e);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
if (a) {
|
|
103
|
-
|
|
104
|
+
f(e.map((G) => G[n]));
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
f(e[n]), o?.onChange?.(e);
|
|
107
108
|
},
|
|
108
109
|
hoisted: $,
|
|
109
|
-
noOptionsMessage:
|
|
110
|
-
searchable:
|
|
110
|
+
noOptionsMessage: S,
|
|
111
|
+
searchable: E,
|
|
111
112
|
clearable: I,
|
|
112
|
-
menuPosition:
|
|
113
|
+
menuPosition: b
|
|
113
114
|
}
|
|
114
115
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
116
|
+
/* @__PURE__ */ l(
|
|
117
|
+
Q,
|
|
117
118
|
{
|
|
118
|
-
id:
|
|
119
|
+
id: c,
|
|
119
120
|
noArrow: !0,
|
|
120
121
|
place: "bottom",
|
|
121
122
|
delayShow: 420,
|
|
122
123
|
className: t.tooltip,
|
|
123
|
-
hidden: !d || d.length === 0 || !
|
|
124
|
-
children: /* @__PURE__ */
|
|
124
|
+
hidden: !d || d.length === 0 || !o.fixedHeightInput,
|
|
125
|
+
children: /* @__PURE__ */ l(W, { value: d, textKey: x, valueKey: n })
|
|
125
126
|
}
|
|
126
127
|
)
|
|
127
128
|
] });
|
|
@@ -132,5 +133,5 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_zh2wu_1",
|
|
|
132
133
|
);
|
|
133
134
|
};
|
|
134
135
|
export {
|
|
135
|
-
|
|
136
|
+
_e as FormSelect
|
|
136
137
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a, s as t, f as
|
|
3
|
-
import { u as
|
|
4
|
-
import { FormSelect as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { a as s, s as t, f as B, w as f } from "../../../react.esm-Bm0cAgpZ.js";
|
|
3
|
+
import { u as y } from "../../../index-BLPBqbdx.js";
|
|
4
|
+
import { FormSelect as c } from "./FormSelect.js";
|
|
5
5
|
import { SelectTooltipText as d } from "./SelectTooltipText.js";
|
|
6
|
-
import { a as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { a as m } from "../../../useBreakpoints-MzTZ0tCT.js";
|
|
7
|
+
import { a as r, b as h, d as v, t as u, g as e } from "../../../vi.bdSIJ99Y-B308Q-4w.js";
|
|
8
|
+
const g = r.fn();
|
|
9
|
+
r.mock("react-hook-form", () => ({
|
|
10
|
+
...r.importActual("react-hook-form"),
|
|
10
11
|
Controller: ({
|
|
11
|
-
render:
|
|
12
|
-
}) =>
|
|
12
|
+
render: l
|
|
13
|
+
}) => l({
|
|
13
14
|
field: {
|
|
14
15
|
ref: void 0,
|
|
15
16
|
onChange: g,
|
|
@@ -18,9 +19,9 @@ n.mock("react-hook-form", () => ({
|
|
|
18
19
|
}),
|
|
19
20
|
useFormContext: () => ({
|
|
20
21
|
control: {
|
|
21
|
-
register:
|
|
22
|
-
unregister:
|
|
23
|
-
getFieldState:
|
|
22
|
+
register: r.fn(),
|
|
23
|
+
unregister: r.fn(),
|
|
24
|
+
getFieldState: r.fn(),
|
|
24
25
|
_names: {
|
|
25
26
|
array: new Set("test"),
|
|
26
27
|
mount: new Set("test"),
|
|
@@ -30,11 +31,11 @@ n.mock("react-hook-form", () => ({
|
|
|
30
31
|
watchAll: !1
|
|
31
32
|
},
|
|
32
33
|
_subjects: {
|
|
33
|
-
watch:
|
|
34
|
-
array:
|
|
35
|
-
state:
|
|
34
|
+
watch: r.fn(),
|
|
35
|
+
array: r.fn(),
|
|
36
|
+
state: r.fn()
|
|
36
37
|
},
|
|
37
|
-
_getWatch:
|
|
38
|
+
_getWatch: r.fn(),
|
|
38
39
|
_formValues: ["test"],
|
|
39
40
|
_defaultValues: ["test"]
|
|
40
41
|
},
|
|
@@ -42,12 +43,20 @@ n.mock("react-hook-form", () => ({
|
|
|
42
43
|
getFieldState: () => ({ invalid: !1 })
|
|
43
44
|
})
|
|
44
45
|
}));
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
h(() => {
|
|
47
|
+
r.spyOn(m, "useBreakpoints").mockReturnValue({
|
|
48
|
+
isDesktop: !0,
|
|
49
|
+
isMobile: !1,
|
|
50
|
+
isTablet: !1,
|
|
51
|
+
isDesktopNavbar: !1
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
v("FormSelect Test", () => {
|
|
55
|
+
const l = [
|
|
47
56
|
{ id: "1", value: "Germany", description: "" },
|
|
48
57
|
{ id: "2", value: "France", description: "" },
|
|
49
58
|
{ id: "3", value: "Afar", description: "" }
|
|
50
|
-
],
|
|
59
|
+
], p = [
|
|
51
60
|
{
|
|
52
61
|
groupValue: "Europe",
|
|
53
62
|
groupName: "Europe",
|
|
@@ -63,14 +72,14 @@ f("FormSelect Test", () => {
|
|
|
63
72
|
}
|
|
64
73
|
];
|
|
65
74
|
u("render FormSelect", () => {
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
75
|
+
s(
|
|
76
|
+
/* @__PURE__ */ a(
|
|
77
|
+
c,
|
|
69
78
|
{
|
|
70
79
|
label: "address.country",
|
|
71
80
|
rules: { required: { value: !0, message: "required" } },
|
|
72
81
|
propertyName: "countryId",
|
|
73
|
-
options:
|
|
82
|
+
options: l,
|
|
74
83
|
valueKey: "id",
|
|
75
84
|
textKey: "value"
|
|
76
85
|
}
|
|
@@ -78,77 +87,140 @@ f("FormSelect Test", () => {
|
|
|
78
87
|
);
|
|
79
88
|
const o = t.getByRole("combobox");
|
|
80
89
|
e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument();
|
|
90
|
+
}), u("enables search by default when isDesktop is true", () => {
|
|
91
|
+
r.spyOn(m, "useBreakpoints").mockReturnValue({
|
|
92
|
+
isMobile: !1,
|
|
93
|
+
isTablet: !1,
|
|
94
|
+
isDesktop: !0,
|
|
95
|
+
isDesktopNavbar: !1
|
|
96
|
+
}), s(
|
|
97
|
+
/* @__PURE__ */ a(
|
|
98
|
+
c,
|
|
99
|
+
{
|
|
100
|
+
label: "address.country",
|
|
101
|
+
propertyName: "countryId",
|
|
102
|
+
options: l,
|
|
103
|
+
valueKey: "id",
|
|
104
|
+
textKey: "value"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
const o = t.getByRole("combobox");
|
|
109
|
+
e(o).not.toHaveAttribute("aria-readonly");
|
|
110
|
+
}), u("searchable=false overrides isDesktop=true", async () => {
|
|
111
|
+
const o = y.setup();
|
|
112
|
+
r.spyOn(m, "useBreakpoints").mockReturnValue({
|
|
113
|
+
isMobile: !1,
|
|
114
|
+
isTablet: !1,
|
|
115
|
+
isDesktop: !0,
|
|
116
|
+
isDesktopNavbar: !1
|
|
117
|
+
}), s(
|
|
118
|
+
/* @__PURE__ */ a(
|
|
119
|
+
c,
|
|
120
|
+
{
|
|
121
|
+
label: "address.country",
|
|
122
|
+
propertyName: "countryId",
|
|
123
|
+
options: l,
|
|
124
|
+
valueKey: "id",
|
|
125
|
+
textKey: "value",
|
|
126
|
+
searchable: !1
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
const n = t.getByRole("combobox");
|
|
131
|
+
e(n).toHaveAttribute("aria-readonly", "true"), await o.click(n), await o.type(n, "Ger"), e(n).toHaveValue("");
|
|
132
|
+
}), u("cannot type when isDesktop=false and searchable is undefined", async () => {
|
|
133
|
+
const o = y.setup();
|
|
134
|
+
r.spyOn(m, "useBreakpoints").mockReturnValue({
|
|
135
|
+
isMobile: !1,
|
|
136
|
+
isTablet: !1,
|
|
137
|
+
isDesktop: !1,
|
|
138
|
+
isDesktopNavbar: !1
|
|
139
|
+
}), s(
|
|
140
|
+
/* @__PURE__ */ a(
|
|
141
|
+
c,
|
|
142
|
+
{
|
|
143
|
+
label: "address.country",
|
|
144
|
+
propertyName: "countryId",
|
|
145
|
+
options: l,
|
|
146
|
+
valueKey: "id",
|
|
147
|
+
textKey: "value"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
const n = t.getByRole("combobox");
|
|
152
|
+
await o.click(n), await o.type(n, "Ger"), e(n).toHaveValue("");
|
|
81
153
|
}), u("render grouped FormSelect and click on option", () => {
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
154
|
+
s(
|
|
155
|
+
/* @__PURE__ */ a(
|
|
156
|
+
c,
|
|
85
157
|
{
|
|
86
158
|
label: "address.country",
|
|
87
159
|
rules: { required: { value: !0, message: "required" } },
|
|
88
160
|
propertyName: "countryId",
|
|
89
|
-
options:
|
|
161
|
+
options: p,
|
|
90
162
|
valueKey: "id",
|
|
91
163
|
textKey: "value"
|
|
92
164
|
}
|
|
93
165
|
)
|
|
94
166
|
);
|
|
95
167
|
const o = t.getByRole("combobox");
|
|
96
|
-
e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(),
|
|
97
|
-
const
|
|
98
|
-
e(
|
|
99
|
-
const
|
|
100
|
-
e(
|
|
101
|
-
const
|
|
102
|
-
e(
|
|
168
|
+
e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(), B.mouseDown(o);
|
|
169
|
+
const n = t.getByText("Africa");
|
|
170
|
+
e(n).toBeInTheDocument(), e(n.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
|
|
171
|
+
const i = t.getByText("Europe");
|
|
172
|
+
e(i).toBeInTheDocument(), e(i.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
|
|
173
|
+
const T = t.getByText("France");
|
|
174
|
+
e(T).toBeInTheDocument(), e(T.parentElement?.parentElement).not.toBeInstanceOf(HTMLHeadingElement), e(t.getByText("Germany")).toBeInTheDocument(), e(t.getAllByText("Afar")).toHaveLength(2), B.click(T), e(g).toBeCalledWith("2");
|
|
103
175
|
}), u("render grouped FormSelect and hover to see tooltip on fixedHeightInput", async () => {
|
|
104
|
-
const o =
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
176
|
+
const o = y.setup();
|
|
177
|
+
s(
|
|
178
|
+
/* @__PURE__ */ a(
|
|
179
|
+
c,
|
|
108
180
|
{
|
|
109
181
|
label: "address.country",
|
|
110
182
|
rules: { required: { value: !0, message: "required" } },
|
|
111
183
|
propertyName: "countryId",
|
|
112
|
-
options:
|
|
184
|
+
options: p,
|
|
113
185
|
valueKey: "id",
|
|
114
186
|
textKey: "value",
|
|
115
187
|
fixedHeightInput: !0
|
|
116
188
|
}
|
|
117
189
|
)
|
|
118
190
|
);
|
|
119
|
-
const
|
|
120
|
-
e(
|
|
121
|
-
const
|
|
122
|
-
e(
|
|
191
|
+
const n = document.querySelector('div[data-tooltip-id="address.country"]');
|
|
192
|
+
e(n).toBeInTheDocument();
|
|
193
|
+
const i = t.getByRole("combobox");
|
|
194
|
+
e(i).toBeInTheDocument(), e(i).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(), o.hover(t.getByText("Afar")), await f(() => {
|
|
123
195
|
e(t.getByRole("tooltip")).toBeInTheDocument();
|
|
124
196
|
});
|
|
125
197
|
}), u("render grouped FormSelect and no tooltip on fixedHeightInput === false", async () => {
|
|
126
|
-
const o =
|
|
127
|
-
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
198
|
+
const o = y.setup();
|
|
199
|
+
s(
|
|
200
|
+
/* @__PURE__ */ a(
|
|
201
|
+
c,
|
|
130
202
|
{
|
|
131
203
|
label: "address.country",
|
|
132
204
|
rules: { required: { value: !0, message: "required" } },
|
|
133
205
|
propertyName: "countryId",
|
|
134
|
-
options:
|
|
206
|
+
options: p,
|
|
135
207
|
valueKey: "id",
|
|
136
208
|
textKey: "value",
|
|
137
209
|
fixedHeightInput: !1
|
|
138
210
|
}
|
|
139
211
|
)
|
|
140
212
|
);
|
|
141
|
-
const
|
|
142
|
-
e(
|
|
213
|
+
const n = document.querySelector('div[data-tooltip-id="address.country"]');
|
|
214
|
+
e(n).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), o.hover(t.getByText("Afar")), await f(() => {
|
|
143
215
|
e(t.queryByRole("tooltip")).not.toBeInTheDocument();
|
|
144
216
|
});
|
|
145
217
|
}), u("render ToolTipText", async () => {
|
|
146
|
-
|
|
218
|
+
s(/* @__PURE__ */ a(d, { value: l[0], textKey: "value", valueKey: "id" })), e(t.getByText("Germany")).toBeInTheDocument();
|
|
147
219
|
}), u("render ToolTipText with multiple entries", async () => {
|
|
148
|
-
|
|
220
|
+
s(/* @__PURE__ */ a(d, { value: l, textKey: "value", valueKey: "id" })), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("France")).toBeInTheDocument(), e(t.getByText("Germany")).toBeInTheDocument();
|
|
149
221
|
}), u("render ToolTipText with no entries", async () => {
|
|
150
|
-
|
|
222
|
+
s(/* @__PURE__ */ a(d, { value: [], textKey: "value", valueKey: "id" })), e(t.queryByText("Afar")).not.toBeInTheDocument(), e(t.queryByText("France")).not.toBeInTheDocument(), e(t.queryByText("Germany")).not.toBeInTheDocument();
|
|
151
223
|
}), u("render ToolTipText with no entries", async () => {
|
|
152
|
-
|
|
224
|
+
s(/* @__PURE__ */ a(d, { value: void 0, textKey: "value", valueKey: "id" })), e(t.queryByText("Afar")).not.toBeInTheDocument(), e(t.queryByText("France")).not.toBeInTheDocument(), e(t.queryByText("Germany")).not.toBeInTheDocument();
|
|
153
225
|
});
|
|
154
226
|
});
|
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.
|
|
4
|
+
"version": "2.18.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>",
|