@hortiview/shared-components 1.1.1 → 1.1.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,3 +1,12 @@
|
|
|
1
|
+
## [1.1.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.1.1...v1.1.2) (2025-03-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add MultiNoOptions story to showcase no options available message ([0e8f107](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/0e8f107bd70166534628dc78e0d51e54cfdec509))
|
|
7
|
+
* adjust comment ([175a23b](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/175a23b093cee6306945806ce64ac42fd11f8ecc))
|
|
8
|
+
* display no option message when component it multiselectable ([2b31b42](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/2b31b423bc42f14ddaced133a31336b8f02ab0d0)), closes [#14499](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/issues/14499)
|
|
9
|
+
|
|
1
10
|
## [1.1.1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.1.0...v1.1.1) (2025-03-28)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, Fragment as k, jsxs as z } from "react/jsx-runtime";
|
|
2
2
|
import { g as _ } from "../../../get-DFv1gXfq.js";
|
|
3
|
-
import { i as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { useFormContext as
|
|
6
|
-
import { M as
|
|
7
|
-
import { useHelperText as
|
|
3
|
+
import { i as G } from "../../../isArray-Dub1wGJM.js";
|
|
4
|
+
import { useMemo as C } from "react";
|
|
5
|
+
import { useFormContext as J, Controller as $ } from "react-hook-form";
|
|
6
|
+
import { M as L } from "../../../react-tooltip.min-DSY6KDqS.js";
|
|
7
|
+
import { useHelperText as O } from "../../../hooks/useHelperText.js";
|
|
8
8
|
import { Select as Q } from "../../Select/Select.js";
|
|
9
9
|
import { SelectTooltipText as R } from "./SelectTooltipText.js";
|
|
10
10
|
import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1", W = "_invalidBorder_ht9kd_5", X = "_invalidPlaceholder_ht9kd_9", Y = "_invalidDropdownIcon_ht9kd_13", Z = "_formSelectContainer_ht9kd_18", N = "_formSelect_ht9kd_18", y = "_multiText_ht9kd_44", K = "_tooltip_ht9kd_53", tt = "_disabled_ht9kd_58", e = {
|
|
@@ -17,111 +17,111 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1",
|
|
|
17
17
|
multiText: y,
|
|
18
18
|
tooltip: K,
|
|
19
19
|
disabled: tt
|
|
20
|
-
},
|
|
20
|
+
}, ft = ({
|
|
21
21
|
propertyName: i,
|
|
22
|
-
label:
|
|
23
|
-
options:
|
|
22
|
+
label: s,
|
|
23
|
+
options: o,
|
|
24
24
|
multi: d = !1,
|
|
25
25
|
disabled: x = !1,
|
|
26
|
-
hoisted:
|
|
27
|
-
hidden:
|
|
28
|
-
valueKey:
|
|
26
|
+
hoisted: H = !1,
|
|
27
|
+
hidden: I = !1,
|
|
28
|
+
valueKey: r = "value",
|
|
29
29
|
textKey: u = "text",
|
|
30
|
-
clearable:
|
|
31
|
-
searchable:
|
|
32
|
-
noOptionsMessage:
|
|
33
|
-
rules:
|
|
30
|
+
clearable: w = !1,
|
|
31
|
+
searchable: D = !0,
|
|
32
|
+
noOptionsMessage: T = "",
|
|
33
|
+
rules: f,
|
|
34
34
|
menuPosition: P = "auto",
|
|
35
|
-
...
|
|
35
|
+
...n
|
|
36
36
|
}) => {
|
|
37
37
|
const {
|
|
38
|
-
control:
|
|
38
|
+
control: v,
|
|
39
39
|
getFieldState: B,
|
|
40
|
-
formState: { errors:
|
|
41
|
-
} =
|
|
42
|
-
() => !
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
() =>
|
|
46
|
-
[
|
|
47
|
-
), { helperText:
|
|
40
|
+
formState: { errors: S, isValidating: p }
|
|
41
|
+
} = J(), F = C(
|
|
42
|
+
() => !p && _(S, i) !== void 0,
|
|
43
|
+
[S, i, p]
|
|
44
|
+
), b = C(
|
|
45
|
+
() => f?.required?.message,
|
|
46
|
+
[f]
|
|
47
|
+
), { helperText: M, helperTextPersistent: j } = O({
|
|
48
48
|
propertyName: i,
|
|
49
|
-
helperText:
|
|
50
|
-
requiredText:
|
|
49
|
+
helperText: n.helperText,
|
|
50
|
+
requiredText: b,
|
|
51
51
|
hasCharacterCount: !1
|
|
52
52
|
});
|
|
53
|
-
return
|
|
53
|
+
return I ? /* @__PURE__ */ l($, { name: i, control: v, render: () => /* @__PURE__ */ l(k, {}) }) : /* @__PURE__ */ l(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
"data-testid": "form-select-container",
|
|
57
57
|
className: e.formSelectContainer,
|
|
58
|
-
"data-tooltip-id":
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
|
|
58
|
+
"data-tooltip-id": s,
|
|
59
|
+
children: /* @__PURE__ */ l(
|
|
60
|
+
$,
|
|
61
61
|
{
|
|
62
62
|
name: i,
|
|
63
|
-
rules:
|
|
64
|
-
control:
|
|
65
|
-
render: ({ field: { ref: et, onChange:
|
|
66
|
-
let h =
|
|
67
|
-
|
|
63
|
+
rules: f,
|
|
64
|
+
control: v,
|
|
65
|
+
render: ({ field: { ref: et, onChange: m, value: g, ...q } }) => {
|
|
66
|
+
let h = o;
|
|
67
|
+
G(o) && _(o[0], "options") !== void 0 && (h = o.flatMap((t) => _(t, "options") ?? []));
|
|
68
68
|
const a = d ? h?.filter(
|
|
69
|
-
(t) =>
|
|
70
|
-
) : h?.find((t) => t[
|
|
69
|
+
(t) => g?.includes(t[r])
|
|
70
|
+
) : h?.find((t) => t[r] === g), A = d && n.multiDisplayType === "text" && n.fixedHeightInput, c = B(i).invalid, E = `
|
|
71
71
|
${e.formSelect}
|
|
72
|
-
${
|
|
73
|
-
${
|
|
74
|
-
${
|
|
75
|
-
${
|
|
72
|
+
${c ? e.invalidHelperText : ""}
|
|
73
|
+
${c ? e.invalidDropdownIcon : ""}
|
|
74
|
+
${c ? e.invalidBorder : ""}
|
|
75
|
+
${c ? e.invalidPlaceholder : ""}
|
|
76
76
|
${A ? e.multiText : ""}
|
|
77
77
|
${x ? e.disabled : ""}`;
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ z(k, { children: [
|
|
79
|
+
/* @__PURE__ */ l(
|
|
80
80
|
Q,
|
|
81
81
|
{
|
|
82
82
|
...q,
|
|
83
|
-
...
|
|
83
|
+
...n,
|
|
84
84
|
value: a ?? [],
|
|
85
|
-
label:
|
|
85
|
+
label: s,
|
|
86
86
|
variant: "outlined",
|
|
87
|
-
helperText:
|
|
87
|
+
helperText: M,
|
|
88
88
|
helperTextPersistent: j,
|
|
89
|
-
options:
|
|
89
|
+
options: o,
|
|
90
90
|
valid: !F,
|
|
91
91
|
"data-testid": `select-${i}`,
|
|
92
|
-
multiSelect: d,
|
|
92
|
+
multiSelect: !o?.length && T ? !1 : d,
|
|
93
93
|
className: E,
|
|
94
94
|
disabled: x,
|
|
95
|
-
valueKey:
|
|
95
|
+
valueKey: r,
|
|
96
96
|
textKey: u,
|
|
97
97
|
onChange: (t) => {
|
|
98
98
|
if (t == null) {
|
|
99
|
-
|
|
99
|
+
m(t);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (d) {
|
|
103
|
-
|
|
103
|
+
m(t.map((V) => V[r]));
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
m(t[r]), n?.onChange?.(t);
|
|
107
107
|
},
|
|
108
|
-
hoisted:
|
|
109
|
-
noOptionsMessage:
|
|
110
|
-
searchable:
|
|
111
|
-
clearable:
|
|
108
|
+
hoisted: H,
|
|
109
|
+
noOptionsMessage: T,
|
|
110
|
+
searchable: D,
|
|
111
|
+
clearable: w,
|
|
112
112
|
menuPosition: P
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
115
|
+
/* @__PURE__ */ l(
|
|
116
|
+
L,
|
|
117
117
|
{
|
|
118
|
-
id:
|
|
118
|
+
id: s,
|
|
119
119
|
noArrow: !0,
|
|
120
120
|
place: "bottom",
|
|
121
121
|
delayShow: 420,
|
|
122
122
|
className: e.tooltip,
|
|
123
|
-
hidden: !a || a.length === 0 || !
|
|
124
|
-
children: /* @__PURE__ */
|
|
123
|
+
hidden: !a || a.length === 0 || !n.fixedHeightInput,
|
|
124
|
+
children: /* @__PURE__ */ l(R, { value: a, textKey: u, valueKey: r })
|
|
125
125
|
}
|
|
126
126
|
)
|
|
127
127
|
] });
|
|
@@ -132,5 +132,5 @@ import '../../../assets/FormSelect.css';const U = "_invalidHelperText_ht9kd_1",
|
|
|
132
132
|
);
|
|
133
133
|
};
|
|
134
134
|
export {
|
|
135
|
-
|
|
135
|
+
ft as FormSelect
|
|
136
136
|
};
|
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.1.
|
|
4
|
+
"version": "1.1.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>",
|