@hortiview/shared-components 0.0.5696 → 0.0.5871
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/dist/assets/FormDatePicker.css +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +5 -2
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +62 -52
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +7 -7
- package/dist/components/FormComponents/FormSelect/FormSelect.js +66 -63
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +62 -26
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._datePickerContainer_73m8g_1{width:100%}._invalid_73m8g_5+*[class*=mdc-text-field-helper-line] *[class*=mdc-text-field-helper-text]{color:var(--lmnt-theme-danger)!important}._fromPickerText_73m8g_9+*[class*=mdc-text-field-helper-line] *[class*=mdc-text-field-helper-text]{margin-bottom:-19.33px!important}._datePickerCalendar_73m8g_13{z-index:101}._trailingContent_73m8g_17{text-align:right}
|
|
@@ -2,8 +2,10 @@ import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
|
2
2
|
type DatePickerProps<T extends FieldValues> = {
|
|
3
3
|
/** Name of the property that this date picker represents. */
|
|
4
4
|
propertyName: Path<T>;
|
|
5
|
-
/** Label to be displayed
|
|
5
|
+
/** Label to be displayed at the date picker input field. */
|
|
6
6
|
label: string;
|
|
7
|
+
/** Label to be displayed as close button text. */
|
|
8
|
+
closeLabel: string;
|
|
7
9
|
/**
|
|
8
10
|
* the rules for the picker
|
|
9
11
|
* @default undefined
|
|
@@ -26,6 +28,7 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
26
28
|
*
|
|
27
29
|
* @param propertyName - the name of the property this date picker maps to in the form.
|
|
28
30
|
* @param label - label displayed along with the date picker.
|
|
31
|
+
* @param closeLabel - label displayed as close button text.
|
|
29
32
|
* @param className - class name to be passed if provided.
|
|
30
33
|
* @param minRangeYear - number of years to subtract from the current date as bottom of range
|
|
31
34
|
* @param maxRangeYear - number of years to add to the current date as top of range
|
|
@@ -34,5 +37,5 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
34
37
|
*
|
|
35
38
|
* @returns A JSX element that renders a date picker form input.
|
|
36
39
|
*/
|
|
37
|
-
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, className, minRangeYear, maxRangeYear, locale, rules, }: DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, }: DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
38
41
|
export {};
|
|
@@ -1,89 +1,99 @@
|
|
|
1
1
|
import "../../../assets/FormDatePicker.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Datepicker as
|
|
4
|
-
import { g as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
const
|
|
8
|
-
datePickerContainer:
|
|
9
|
-
invalid:
|
|
10
|
-
fromPickerText:
|
|
11
|
-
datePickerCalendar:
|
|
12
|
-
|
|
2
|
+
import { jsx as n, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import { Datepicker as O, Divider as Y, Padding as b, Button as j } from "@element/react-components";
|
|
4
|
+
import { g as H } from "../../../get-Dyz8NMrE.js";
|
|
5
|
+
import { useMemo as a, useState as M } from "react";
|
|
6
|
+
import { useFormContext as Q, Controller as $ } from "react-hook-form";
|
|
7
|
+
const w = "_datePickerContainer_73m8g_1", B = "_invalid_73m8g_5", E = "_fromPickerText_73m8g_9", I = "_datePickerCalendar_73m8g_13", L = "_trailingContent_73m8g_17", c = {
|
|
8
|
+
datePickerContainer: w,
|
|
9
|
+
invalid: B,
|
|
10
|
+
fromPickerText: E,
|
|
11
|
+
datePickerCalendar: I,
|
|
12
|
+
trailingContent: L
|
|
13
|
+
}, N = ({
|
|
13
14
|
propertyName: t,
|
|
14
|
-
label:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
label: P,
|
|
16
|
+
closeLabel: C,
|
|
17
|
+
className: x,
|
|
18
|
+
minRangeYear: m,
|
|
19
|
+
maxRangeYear: f,
|
|
20
|
+
locale: _,
|
|
19
21
|
rules: o
|
|
20
22
|
}) => {
|
|
21
23
|
const {
|
|
22
|
-
control:
|
|
23
|
-
formState: { errors: r, isValidating:
|
|
24
|
-
} =
|
|
24
|
+
control: p,
|
|
25
|
+
formState: { errors: r, isValidating: g }
|
|
26
|
+
} = Q(), k = a(
|
|
25
27
|
() => o?.required?.value,
|
|
26
28
|
[o]
|
|
27
|
-
),
|
|
29
|
+
), u = a(
|
|
28
30
|
() => o?.required?.message,
|
|
29
31
|
[o]
|
|
30
|
-
),
|
|
31
|
-
() => (/* @__PURE__ */ new Date()).getFullYear() - (
|
|
32
|
-
[l]
|
|
33
|
-
), C = n(
|
|
34
|
-
() => (/* @__PURE__ */ new Date()).getFullYear() + (m ?? 15),
|
|
32
|
+
), v = a(
|
|
33
|
+
() => (/* @__PURE__ */ new Date()).getFullYear() - (m ?? 95),
|
|
35
34
|
[m]
|
|
36
|
-
),
|
|
37
|
-
() =>
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
), T = a(
|
|
36
|
+
() => (/* @__PURE__ */ new Date()).getFullYear() + (f ?? 15),
|
|
37
|
+
[f]
|
|
38
|
+
), l = a(
|
|
39
|
+
() => !g && H(r, t) !== void 0,
|
|
40
|
+
[r, t, g]
|
|
41
|
+
), D = a(() => ({
|
|
42
|
+
valid: !l,
|
|
43
|
+
helperTextPersistent: l || k,
|
|
42
44
|
helperText: (() => {
|
|
43
45
|
if (r && r[t]) {
|
|
44
46
|
const i = r[t]?.message;
|
|
45
47
|
return i || "Invalid input";
|
|
46
48
|
}
|
|
47
|
-
return
|
|
49
|
+
return u;
|
|
48
50
|
})(),
|
|
49
|
-
className: `${
|
|
50
|
-
}), [r,
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
51
|
+
className: `${c.fromPickerText} ${l ? c.invalid : ""}`
|
|
52
|
+
}), [r, u, t, k, l]), [S, d] = M(!1);
|
|
53
|
+
return /* @__PURE__ */ n(
|
|
54
|
+
$,
|
|
53
55
|
{
|
|
54
56
|
name: t,
|
|
55
57
|
rules: o,
|
|
56
|
-
control:
|
|
57
|
-
render: ({ field: { ref:
|
|
58
|
-
|
|
58
|
+
control: p,
|
|
59
|
+
render: ({ field: { ref: h, onChange: i, value: s, ...q } }) => /* @__PURE__ */ n("div", { className: c.datePickerContainer, children: /* @__PURE__ */ n(
|
|
60
|
+
O,
|
|
59
61
|
{
|
|
60
|
-
...
|
|
61
|
-
className:
|
|
62
|
-
value:
|
|
62
|
+
...q,
|
|
63
|
+
className: x ?? "",
|
|
64
|
+
value: s,
|
|
63
65
|
variant: "outlined",
|
|
64
|
-
label:
|
|
65
|
-
format: (e) => e ? e.toLocaleDateString(
|
|
66
|
+
label: P,
|
|
67
|
+
format: (e) => e ? e.toLocaleDateString(_ ?? "en") : "",
|
|
66
68
|
disableClearing: !0,
|
|
69
|
+
trailingContent: /* @__PURE__ */ F("div", { className: c.trailingContent, children: [
|
|
70
|
+
/* @__PURE__ */ n(Y, {}),
|
|
71
|
+
/* @__PURE__ */ n(b, { variant: "dense", children: /* @__PURE__ */ n(j, { label: C, variant: "text", onClick: () => d(!1) }) })
|
|
72
|
+
] }),
|
|
73
|
+
onClick: () => {
|
|
74
|
+
d(!0);
|
|
75
|
+
},
|
|
67
76
|
onSelect: (e) => {
|
|
68
|
-
i(e);
|
|
77
|
+
i(e), d(!1);
|
|
69
78
|
},
|
|
70
79
|
onSelectMonth: (e) => {
|
|
71
|
-
|
|
80
|
+
s && (e.setDate(s.getDate()), i(e));
|
|
72
81
|
},
|
|
73
82
|
onSelectYear: (e) => {
|
|
74
|
-
|
|
83
|
+
s && (e.setDate(s.getDate()), i(e));
|
|
75
84
|
},
|
|
76
85
|
hoisted: !0,
|
|
77
|
-
calendarProps: { hoisted: !0, className:
|
|
78
|
-
minQuickSelectYear:
|
|
79
|
-
maxQuickSelectYear:
|
|
86
|
+
calendarProps: { hoisted: !0, className: c.datePickerCalendar },
|
|
87
|
+
minQuickSelectYear: v,
|
|
88
|
+
maxQuickSelectYear: T,
|
|
80
89
|
readOnly: !0,
|
|
81
|
-
textfieldProps:
|
|
90
|
+
textfieldProps: D,
|
|
91
|
+
alwaysOpen: S
|
|
82
92
|
}
|
|
83
93
|
) })
|
|
84
94
|
}
|
|
85
95
|
);
|
|
86
96
|
};
|
|
87
97
|
export {
|
|
88
|
-
|
|
98
|
+
N as FormDatePicker
|
|
89
99
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { r as s, s as
|
|
2
|
+
import { r as s, s as o, f as m } from "../../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { FormDatePicker as c } from "./FormDatePicker.js";
|
|
4
4
|
import { v as e, d as f, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
const i = e.fn();
|
|
@@ -42,15 +42,15 @@ e.mock("react-hook-form", () => ({
|
|
|
42
42
|
f("FormDatePicker Test", () => {
|
|
43
43
|
l("render FormDatePicker", () => {
|
|
44
44
|
s(
|
|
45
|
-
/* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", maxRangeYear: 0 })
|
|
45
|
+
/* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", closeLabel: "close", maxRangeYear: 0 })
|
|
46
46
|
);
|
|
47
|
-
const t =
|
|
48
|
-
r(t).toBeInTheDocument(), r(t).toBeInstanceOf(HTMLInputElement), r(
|
|
47
|
+
const t = o.getByRole("textbox");
|
|
48
|
+
r(t).toBeInTheDocument(), r(t).toBeInstanceOf(HTMLInputElement), r(o.getByText("user.date-of-birth")).toBeInTheDocument(), r(o.getByText("close")).toBeInTheDocument();
|
|
49
49
|
}), l("change FormDatePicker value", () => {
|
|
50
50
|
s(
|
|
51
|
-
/* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", maxRangeYear: 0 })
|
|
51
|
+
/* @__PURE__ */ n(c, { propertyName: "birthday", label: "user.date-of-birth", closeLabel: "close", maxRangeYear: 0 })
|
|
52
52
|
);
|
|
53
|
-
const t =
|
|
54
|
-
m.change(t, { target: { value:
|
|
53
|
+
const t = o.getByRole("textbox"), a = /* @__PURE__ */ new Date();
|
|
54
|
+
m.change(t, { target: { value: a } }), r(t.getAttribute("value")).toBe(a.toString());
|
|
55
55
|
});
|
|
56
56
|
});
|
|
@@ -1,85 +1,88 @@
|
|
|
1
1
|
import "../../../assets/FormSelect.css";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as l, Fragment as O } from "react/jsx-runtime";
|
|
3
3
|
import { Select as P } from "@element/react-components";
|
|
4
|
-
import { g as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
|
|
4
|
+
import { g as d } from "../../../get-Dyz8NMrE.js";
|
|
5
|
+
import { useMemo as u } from "react";
|
|
6
|
+
import { useFormContext as V, Controller as g } from "react-hook-form";
|
|
7
|
+
import { isArray as k } from "lodash";
|
|
8
|
+
const w = "_invalid_1vo1h_1", z = "_formSelect_1vo1h_5", B = "_formSelectContainer_1vo1h_9", S = {
|
|
8
9
|
invalid: w,
|
|
9
10
|
formSelect: z,
|
|
10
|
-
formSelectContainer:
|
|
11
|
-
},
|
|
11
|
+
formSelectContainer: B
|
|
12
|
+
}, W = ({
|
|
12
13
|
propertyName: r,
|
|
13
|
-
label:
|
|
14
|
-
options:
|
|
15
|
-
multi:
|
|
16
|
-
disabled:
|
|
17
|
-
hoisted:
|
|
18
|
-
hidden:
|
|
19
|
-
valueKey:
|
|
20
|
-
textKey:
|
|
21
|
-
clearable:
|
|
22
|
-
noOptionsMessage:
|
|
23
|
-
rules:
|
|
24
|
-
...
|
|
14
|
+
label: h,
|
|
15
|
+
options: t,
|
|
16
|
+
multi: s = !1,
|
|
17
|
+
disabled: C = !1,
|
|
18
|
+
hoisted: p = !1,
|
|
19
|
+
hidden: q = !1,
|
|
20
|
+
valueKey: n = "value",
|
|
21
|
+
textKey: T = "text",
|
|
22
|
+
clearable: F = !1,
|
|
23
|
+
noOptionsMessage: M = "",
|
|
24
|
+
rules: i,
|
|
25
|
+
...b
|
|
25
26
|
}) => {
|
|
26
27
|
const {
|
|
27
|
-
control:
|
|
28
|
-
formState: { errors: o, isValidating:
|
|
29
|
-
} =
|
|
30
|
-
() => !
|
|
31
|
-
[o, r,
|
|
32
|
-
),
|
|
33
|
-
() =>
|
|
34
|
-
[
|
|
35
|
-
), $ =
|
|
36
|
-
() =>
|
|
37
|
-
[
|
|
38
|
-
),
|
|
28
|
+
control: v,
|
|
29
|
+
formState: { errors: o, isValidating: x }
|
|
30
|
+
} = V(), a = u(
|
|
31
|
+
() => !x && d(o, r) !== void 0,
|
|
32
|
+
[o, r, x]
|
|
33
|
+
), H = u(
|
|
34
|
+
() => i?.required?.value,
|
|
35
|
+
[i]
|
|
36
|
+
), $ = u(
|
|
37
|
+
() => i?.required?.message,
|
|
38
|
+
[i]
|
|
39
|
+
), j = () => {
|
|
39
40
|
if (o && o[r]) {
|
|
40
|
-
const
|
|
41
|
-
return
|
|
41
|
+
const f = o[r]?.message;
|
|
42
|
+
return f || "Invalid input";
|
|
42
43
|
}
|
|
43
44
|
return $;
|
|
44
45
|
};
|
|
45
|
-
return
|
|
46
|
-
|
|
46
|
+
return q ? /* @__PURE__ */ l(g, { name: r, control: v, render: () => /* @__PURE__ */ l(O, {}) }) : /* @__PURE__ */ l("div", { className: S.formSelectContainer, children: /* @__PURE__ */ l(
|
|
47
|
+
g,
|
|
47
48
|
{
|
|
48
49
|
name: r,
|
|
49
|
-
rules:
|
|
50
|
-
control:
|
|
51
|
-
render: ({ field: { ref:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
rules: i,
|
|
51
|
+
control: v,
|
|
52
|
+
render: ({ field: { ref: f, onChange: m, value: _, ...A } }) => {
|
|
53
|
+
let c = t;
|
|
54
|
+
k(t) && d(t[0], "options") !== void 0 && (c = t.flatMap((e) => d(e, "options") ?? []));
|
|
55
|
+
const E = s ? c?.filter(
|
|
56
|
+
(e) => _?.includes(e[n])
|
|
57
|
+
) : c?.find((e) => e[n] === _);
|
|
58
|
+
return /* @__PURE__ */ l(
|
|
56
59
|
P,
|
|
57
60
|
{
|
|
58
|
-
...
|
|
59
|
-
...
|
|
60
|
-
value:
|
|
61
|
-
label:
|
|
61
|
+
...A,
|
|
62
|
+
...b,
|
|
63
|
+
value: E,
|
|
64
|
+
label: h,
|
|
62
65
|
variant: "outlined",
|
|
63
|
-
helperText:
|
|
64
|
-
helperTextPersistent:
|
|
65
|
-
options:
|
|
66
|
-
valid: !
|
|
67
|
-
multiSelect:
|
|
68
|
-
className: `${
|
|
69
|
-
disabled:
|
|
70
|
-
valueKey:
|
|
71
|
-
textKey:
|
|
66
|
+
helperText: j(),
|
|
67
|
+
helperTextPersistent: H || a,
|
|
68
|
+
options: t,
|
|
69
|
+
valid: !a,
|
|
70
|
+
multiSelect: s,
|
|
71
|
+
className: `${S.formSelect} ${a ? S.invalid : ""}`,
|
|
72
|
+
disabled: C,
|
|
73
|
+
valueKey: n,
|
|
74
|
+
textKey: T,
|
|
72
75
|
onChange: (e) => {
|
|
73
76
|
if (e == null)
|
|
74
|
-
return
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
77
|
-
|
|
77
|
+
return m(e);
|
|
78
|
+
if (s)
|
|
79
|
+
return m(e.map((I) => I[n]));
|
|
80
|
+
m(e[n]);
|
|
78
81
|
},
|
|
79
|
-
hoisted:
|
|
80
|
-
noOptionsMessage:
|
|
82
|
+
hoisted: p,
|
|
83
|
+
noOptionsMessage: M,
|
|
81
84
|
searchable: !0,
|
|
82
|
-
clearable:
|
|
85
|
+
clearable: F,
|
|
83
86
|
menuMaxHeight: "15rem"
|
|
84
87
|
}
|
|
85
88
|
);
|
|
@@ -88,5 +91,5 @@ const w = "_invalid_1vo1h_1", z = "_formSelect_1vo1h_5", A = "_formSelectContain
|
|
|
88
91
|
) });
|
|
89
92
|
};
|
|
90
93
|
export {
|
|
91
|
-
|
|
94
|
+
W as FormSelect
|
|
92
95
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { r as
|
|
3
|
-
import { FormSelect as
|
|
4
|
-
import { v as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
...
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { r as l, s as t, f as i } from "../../../react.esm-C0LtovhP.js";
|
|
3
|
+
import { FormSelect as m } from "./FormSelect.js";
|
|
4
|
+
import { v as n, d as g, t as d, g as e } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
const p = n.fn();
|
|
6
|
+
n.mock("react-hook-form", () => ({
|
|
7
|
+
...n.importActual("react-hook-form"),
|
|
8
8
|
Controller: ({
|
|
9
|
-
render:
|
|
10
|
-
}) =>
|
|
9
|
+
render: r
|
|
10
|
+
}) => r({
|
|
11
11
|
field: {
|
|
12
12
|
ref: void 0,
|
|
13
|
-
onChange:
|
|
13
|
+
onChange: p,
|
|
14
14
|
value: "3"
|
|
15
15
|
}
|
|
16
16
|
}),
|
|
17
17
|
useFormContext: () => ({
|
|
18
18
|
control: {
|
|
19
|
-
register:
|
|
20
|
-
unregister:
|
|
21
|
-
getFieldState:
|
|
19
|
+
register: n.fn(),
|
|
20
|
+
unregister: n.fn(),
|
|
21
|
+
getFieldState: n.fn(),
|
|
22
22
|
_names: {
|
|
23
23
|
array: new Set("test"),
|
|
24
24
|
mount: new Set("test"),
|
|
@@ -28,11 +28,11 @@ e.mock("react-hook-form", () => ({
|
|
|
28
28
|
watchAll: !1
|
|
29
29
|
},
|
|
30
30
|
_subjects: {
|
|
31
|
-
watch:
|
|
32
|
-
array:
|
|
33
|
-
state:
|
|
31
|
+
watch: n.fn(),
|
|
32
|
+
array: n.fn(),
|
|
33
|
+
state: n.fn()
|
|
34
34
|
},
|
|
35
|
-
_getWatch:
|
|
35
|
+
_getWatch: n.fn(),
|
|
36
36
|
_formValues: ["test"],
|
|
37
37
|
_defaultValues: ["test"]
|
|
38
38
|
},
|
|
@@ -40,27 +40,63 @@ e.mock("react-hook-form", () => ({
|
|
|
40
40
|
getFieldState: () => ({ invalid: !1 })
|
|
41
41
|
})
|
|
42
42
|
}));
|
|
43
|
-
|
|
44
|
-
const
|
|
43
|
+
g("FormSelect Test", () => {
|
|
44
|
+
const r = [
|
|
45
45
|
{ id: "1", value: "Germany", description: "" },
|
|
46
46
|
{ id: "2", value: "France", description: "" },
|
|
47
47
|
{ id: "3", value: "Afar", description: "" }
|
|
48
|
+
], f = [
|
|
49
|
+
{
|
|
50
|
+
groupValue: "Europe",
|
|
51
|
+
groupName: "Europe",
|
|
52
|
+
options: [
|
|
53
|
+
{ id: "1", value: "Germany", description: "" },
|
|
54
|
+
{ id: "2", value: "France", description: "" }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
groupValue: "Africa",
|
|
59
|
+
groupName: "Africa",
|
|
60
|
+
options: [{ id: "3", value: "Afar", description: "" }]
|
|
61
|
+
}
|
|
48
62
|
];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
63
|
+
d("render FormSelect", () => {
|
|
64
|
+
l(
|
|
65
|
+
/* @__PURE__ */ u(
|
|
66
|
+
m,
|
|
67
|
+
{
|
|
68
|
+
label: "address.country",
|
|
69
|
+
rules: { required: { value: !0, message: "required" } },
|
|
70
|
+
propertyName: "countryId",
|
|
71
|
+
options: r,
|
|
72
|
+
valueKey: "id",
|
|
73
|
+
textKey: "value"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
const o = t.getByRole("combobox");
|
|
78
|
+
e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument();
|
|
79
|
+
}), d("render grouped FormSelect and click on option", () => {
|
|
80
|
+
l(
|
|
81
|
+
/* @__PURE__ */ u(
|
|
82
|
+
m,
|
|
53
83
|
{
|
|
54
84
|
label: "address.country",
|
|
55
85
|
rules: { required: { value: !0, message: "required" } },
|
|
56
86
|
propertyName: "countryId",
|
|
57
|
-
options:
|
|
87
|
+
options: f,
|
|
58
88
|
valueKey: "id",
|
|
59
89
|
textKey: "value"
|
|
60
90
|
}
|
|
61
91
|
)
|
|
62
92
|
);
|
|
63
|
-
const
|
|
64
|
-
|
|
93
|
+
const o = t.getByRole("combobox");
|
|
94
|
+
e(o).toBeInTheDocument(), e(o).toBeInstanceOf(HTMLInputElement), e(t.getByText("address.country")).toBeInTheDocument(), e(t.getByText("Afar")).toBeInTheDocument(), e(t.getByText("required")).toBeInTheDocument(), i.mouseDown(o);
|
|
95
|
+
const s = t.getByText("Africa");
|
|
96
|
+
e(s).toBeInTheDocument(), e(s.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
|
|
97
|
+
const c = t.getByText("Europe");
|
|
98
|
+
e(c).toBeInTheDocument(), e(c.parentElement?.parentElement).toBeInstanceOf(HTMLHeadingElement);
|
|
99
|
+
const a = t.getByText("France");
|
|
100
|
+
e(a).toBeInTheDocument(), e(a.parentElement?.parentElement).not.toBeInstanceOf(HTMLHeadingElement), e(t.getByText("Germany")).toBeInTheDocument(), e(t.getAllByText("Afar")).toHaveLength(2), i.click(a), e(p).toBeCalledWith("2");
|
|
65
101
|
});
|
|
66
102
|
});
|
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": "0.0.
|
|
4
|
+
"version": "0.0.5871",
|
|
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>",
|