@hortiview/shared-components 0.0.10001 → 0.0.10012
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/formSelect.css +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.js +88 -80
- package/dist/components/GenericTable/GenericTable.js +1 -1
- package/dist/formSelect.module-C6cK23EF.js +15 -0
- package/package.json +1 -1
- package/dist/formSelect.module-nnJoBE6f.js +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._invalidHelperText_11d5q_1+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-danger)!important}._invalidBorder_11d5q_5 *[class*=mdc-notched-outline]{border-color:var(--lmnt-theme-danger)!important}._invalidPlaceholder_11d5q_9 *[class*=lmnt-select-label]{color:var(--lmnt-theme-danger)!important}._invalidDropdownIcon_11d5q_13 *[class*=mdc-select__dropdown-icon]{fill:var(--lmnt-theme-danger)!important}._formSelectContainer_11d5q_18{display:flex;flex-wrap:wrap;width:100%}._formSelectContainer_11d5q_18 *[class*=mdc-select-helper-text]{color:var(--lmnt-helper-text-color)}._formSelectContainer_11d5q_18 *[class*=lmnt__multi-value__label]{overflow:visible}._formSelect_11d5q_18+*[class*=mdc-select-helper-text]{margin-bottom:-19.33px!important}._formSelect_11d5q_18 *[class*=lmnt-select-menu]{z-index:2001}._multiText_11d5q_44 *[class*=lmnt-select-value-container]{white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis;display:block!important;padding:1.125rem 0!important}._tooltip_11d5q_53{z-index:42}._disabled_11d5q_58+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-on-surface-disabled)}[id*=select-container][class*=top] [class*=mdc-menu-surface--open]{bottom:0}[id*=select-container][class*=bottom] [class*=mdc-menu-surface--open]{top:0}[class*=lmnt__menu-portal]{z-index:6!important}
|
|
@@ -32,7 +32,7 @@ import "../../loadingSpinner.module-CLtqSMWA.js";
|
|
|
32
32
|
import "../Scrollbar/Scrollbar.js";
|
|
33
33
|
import "react-hook-form";
|
|
34
34
|
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
35
|
-
import "../../formSelect.module-
|
|
35
|
+
import "../../formSelect.module-C6cK23EF.js";
|
|
36
36
|
import "../../formText.module-C0by6_DK.js";
|
|
37
37
|
import "../../isPlainObject-BlCDf1Kc.js";
|
|
38
38
|
const kt = ({
|
|
@@ -1,122 +1,130 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { g as
|
|
4
|
-
import { i as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
import { H as
|
|
8
|
-
import { SelectTooltipText as
|
|
9
|
-
import { s as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as n, Fragment as E, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import { Select as R } from "@element/react-components";
|
|
3
|
+
import { g as v } from "../../../get-BJn2Enx7.js";
|
|
4
|
+
import { i as U } from "../../../isArray-thIeLpc5.js";
|
|
5
|
+
import { useEffect as W, useMemo as C } from "react";
|
|
6
|
+
import { useFormContext as X, Controller as M } from "react-hook-form";
|
|
7
|
+
import { H as Y } from "../../../react-tooltip.min-BzHiZW8k.js";
|
|
8
|
+
import { SelectTooltipText as Z } from "./SelectTooltipText.js";
|
|
9
|
+
import { s as r } from "../../../formSelect.module-C6cK23EF.js";
|
|
10
|
+
const ne = ({
|
|
11
11
|
propertyName: t,
|
|
12
|
-
label:
|
|
13
|
-
options:
|
|
12
|
+
label: S,
|
|
13
|
+
options: o,
|
|
14
14
|
multi: f = !1,
|
|
15
|
-
disabled:
|
|
16
|
-
hoisted:
|
|
17
|
-
hidden:
|
|
18
|
-
valueKey:
|
|
19
|
-
textKey:
|
|
15
|
+
disabled: $ = !1,
|
|
16
|
+
hoisted: g = !1,
|
|
17
|
+
hidden: w = !1,
|
|
18
|
+
valueKey: l = "value",
|
|
19
|
+
textKey: p = "text",
|
|
20
20
|
clearable: j = !1,
|
|
21
|
-
searchable:
|
|
22
|
-
noOptionsMessage:
|
|
23
|
-
rules:
|
|
24
|
-
menuPosition:
|
|
25
|
-
...
|
|
21
|
+
searchable: A = !0,
|
|
22
|
+
noOptionsMessage: B = "",
|
|
23
|
+
rules: a,
|
|
24
|
+
menuPosition: d = "auto",
|
|
25
|
+
...s
|
|
26
26
|
}) => {
|
|
27
27
|
const {
|
|
28
28
|
control: I,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
getFieldState: D,
|
|
30
|
+
formState: { errors: c, isValidating: H }
|
|
31
|
+
} = X(), m = CSS.escape(t) + "-select-container", b = '[id="' + CSS.escape(m) + '"]';
|
|
32
|
+
W(() => {
|
|
33
|
+
if (!(!g || d === "auto") && !document.getElementById(m)) {
|
|
34
|
+
const i = document.createElement("div");
|
|
35
|
+
i.id = m, i.classList.add(d), document.body.appendChild(i);
|
|
35
36
|
}
|
|
36
|
-
}, [
|
|
37
|
-
const
|
|
38
|
-
() =>
|
|
39
|
-
[c, t,
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
() =>
|
|
45
|
-
[
|
|
46
|
-
),
|
|
37
|
+
}, [g, d, m]);
|
|
38
|
+
const q = C(
|
|
39
|
+
() => !H && v(c, t) !== void 0,
|
|
40
|
+
[c, t, H]
|
|
41
|
+
), L = C(
|
|
42
|
+
() => a?.required?.value,
|
|
43
|
+
[a]
|
|
44
|
+
), O = C(
|
|
45
|
+
() => a?.required?.message,
|
|
46
|
+
[a]
|
|
47
|
+
), V = () => {
|
|
47
48
|
if (c && c[t]) {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
49
|
+
const i = c[t]?.message;
|
|
50
|
+
return i || "Invalid input";
|
|
50
51
|
}
|
|
51
|
-
return
|
|
52
|
+
return O;
|
|
52
53
|
};
|
|
53
|
-
return
|
|
54
|
+
return w ? /* @__PURE__ */ n(M, { name: t, control: I, render: () => /* @__PURE__ */ n(E, {}) }) : /* @__PURE__ */ n(
|
|
54
55
|
"div",
|
|
55
56
|
{
|
|
56
57
|
"data-testid": "form-select-container",
|
|
57
|
-
className:
|
|
58
|
-
"data-tooltip-id":
|
|
59
|
-
children: /* @__PURE__ */
|
|
58
|
+
className: r.formSelectContainer,
|
|
59
|
+
"data-tooltip-id": S,
|
|
60
|
+
children: /* @__PURE__ */ n(
|
|
60
61
|
M,
|
|
61
62
|
{
|
|
62
63
|
name: t,
|
|
63
|
-
rules:
|
|
64
|
+
rules: a,
|
|
64
65
|
control: I,
|
|
65
|
-
render: ({ field: { ref:
|
|
66
|
-
let T =
|
|
67
|
-
|
|
66
|
+
render: ({ field: { ref: i, onChange: h, value: F, ...k } }) => {
|
|
67
|
+
let T = o;
|
|
68
|
+
U(o) && v(o[0], "options") !== void 0 && (T = o.flatMap((e) => v(e, "options") ?? []));
|
|
68
69
|
const u = f ? T?.filter(
|
|
69
|
-
(e) =>
|
|
70
|
-
) : T?.find((e) => e[
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
(e) => F?.includes(e[l])
|
|
71
|
+
) : T?.find((e) => e[l] === F), z = f && s.multiDisplayType === "text" && s.fixedHeightInput, x = D(t).invalid, G = `
|
|
72
|
+
${r.formSelect}
|
|
73
|
+
${x ? r.invalidHelperText : ""}
|
|
74
|
+
${x ? r.invalidDropdownIcon : ""}
|
|
75
|
+
${x ? r.invalidBorder : ""}
|
|
76
|
+
${x ? r.invalidPlaceholder : ""}
|
|
77
|
+
${z ? r.multiText : ""}
|
|
78
|
+
${$ ? r.disabled : ""}`;
|
|
79
|
+
return /* @__PURE__ */ Q(E, { children: [
|
|
80
|
+
/* @__PURE__ */ n(
|
|
81
|
+
R,
|
|
74
82
|
{
|
|
75
|
-
...
|
|
76
|
-
...
|
|
83
|
+
...k,
|
|
84
|
+
...s,
|
|
77
85
|
value: u ?? [],
|
|
78
|
-
label:
|
|
86
|
+
label: S,
|
|
79
87
|
variant: "outlined",
|
|
80
|
-
helperText:
|
|
81
|
-
helperTextPersistent:
|
|
82
|
-
options:
|
|
83
|
-
valid: !
|
|
88
|
+
helperText: V(),
|
|
89
|
+
helperTextPersistent: L || q,
|
|
90
|
+
options: o,
|
|
91
|
+
valid: !q,
|
|
84
92
|
"data-testid": `select-${t}`,
|
|
85
93
|
multiSelect: f,
|
|
86
|
-
className:
|
|
87
|
-
disabled:
|
|
88
|
-
valueKey:
|
|
89
|
-
textKey:
|
|
94
|
+
className: G,
|
|
95
|
+
disabled: $,
|
|
96
|
+
valueKey: l,
|
|
97
|
+
textKey: p,
|
|
90
98
|
onChange: (e) => {
|
|
91
99
|
if (e == null) {
|
|
92
100
|
h(e);
|
|
93
101
|
return;
|
|
94
102
|
}
|
|
95
103
|
if (f) {
|
|
96
|
-
h(e.map((
|
|
104
|
+
h(e.map((J) => J[l]));
|
|
97
105
|
return;
|
|
98
106
|
}
|
|
99
|
-
h(e[
|
|
107
|
+
h(e[l]), s?.onChange?.(e);
|
|
100
108
|
},
|
|
101
|
-
hoisted:
|
|
102
|
-
noOptionsMessage:
|
|
103
|
-
searchable:
|
|
109
|
+
hoisted: g,
|
|
110
|
+
noOptionsMessage: B,
|
|
111
|
+
searchable: A,
|
|
104
112
|
clearable: j,
|
|
105
113
|
menuMaxHeight: "15rem",
|
|
106
|
-
menuPosition:
|
|
107
|
-
portalContainer:
|
|
114
|
+
menuPosition: d,
|
|
115
|
+
portalContainer: d !== "auto" && b
|
|
108
116
|
}
|
|
109
117
|
),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
118
|
+
/* @__PURE__ */ n(
|
|
119
|
+
Y,
|
|
112
120
|
{
|
|
113
|
-
id:
|
|
121
|
+
id: S,
|
|
114
122
|
noArrow: !0,
|
|
115
123
|
place: "bottom",
|
|
116
124
|
delayShow: 420,
|
|
117
|
-
className:
|
|
118
|
-
hidden: !u || u.length === 0 || !
|
|
119
|
-
children: /* @__PURE__ */
|
|
125
|
+
className: r.tooltip,
|
|
126
|
+
hidden: !u || u.length === 0 || !s.fixedHeightInput,
|
|
127
|
+
children: /* @__PURE__ */ n(Z, { value: u, textKey: p, valueKey: l })
|
|
120
128
|
}
|
|
121
129
|
)
|
|
122
130
|
] });
|
|
@@ -127,5 +135,5 @@ const te = ({
|
|
|
127
135
|
);
|
|
128
136
|
};
|
|
129
137
|
export {
|
|
130
|
-
|
|
138
|
+
ne as FormSelect
|
|
131
139
|
};
|
|
@@ -30,7 +30,7 @@ import "../../loadingSpinner.module-CLtqSMWA.js";
|
|
|
30
30
|
import "../Scrollbar/Scrollbar.js";
|
|
31
31
|
import "react-hook-form";
|
|
32
32
|
import "../../formDatePicker.module-BV3ma_7y.js";
|
|
33
|
-
import "../../formSelect.module-
|
|
33
|
+
import "../../formSelect.module-C6cK23EF.js";
|
|
34
34
|
import "../../formText.module-C0by6_DK.js";
|
|
35
35
|
import "../../isPlainObject-BlCDf1Kc.js";
|
|
36
36
|
import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./assets/formSelect.css";
|
|
2
|
+
const o = "_invalidHelperText_11d5q_1", e = "_invalidBorder_11d5q_5", i = "_invalidPlaceholder_11d5q_9", l = "_invalidDropdownIcon_11d5q_13", t = "_formSelectContainer_11d5q_18", d = "_formSelect_11d5q_18", n = "_multiText_11d5q_44", _ = "_tooltip_11d5q_53", r = "_disabled_11d5q_58", c = {
|
|
3
|
+
invalidHelperText: o,
|
|
4
|
+
invalidBorder: e,
|
|
5
|
+
invalidPlaceholder: i,
|
|
6
|
+
invalidDropdownIcon: l,
|
|
7
|
+
formSelectContainer: t,
|
|
8
|
+
formSelect: d,
|
|
9
|
+
multiText: n,
|
|
10
|
+
tooltip: _,
|
|
11
|
+
disabled: r
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
c as s
|
|
15
|
+
};
|
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.10012",
|
|
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>",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "./assets/formSelect.css";
|
|
2
|
-
const t = "_invalid_pywdu_1", o = "_formSelectContainer_pywdu_6", e = "_formSelect_pywdu_6", i = "_multiText_pywdu_32", l = "_tooltip_pywdu_41", _ = "_disabled_pywdu_46", d = {
|
|
3
|
-
invalid: t,
|
|
4
|
-
formSelectContainer: o,
|
|
5
|
-
formSelect: e,
|
|
6
|
-
multiText: i,
|
|
7
|
-
tooltip: l,
|
|
8
|
-
disabled: _
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
d as s
|
|
12
|
-
};
|