@hortiview/shared-components 0.0.4801 → 0.0.4804
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.
|
@@ -2,7 +2,7 @@ import "../../../assets/FormText.css";
|
|
|
2
2
|
import { jsx as t, Fragment as z, jsxs as I } from "react/jsx-runtime";
|
|
3
3
|
import { Textfield as P } from "@element/react-components";
|
|
4
4
|
import { useState as R, useMemo as s } from "react";
|
|
5
|
-
import { useFormContext as V, Controller as
|
|
5
|
+
import { useFormContext as V, Controller as _ } from "react-hook-form";
|
|
6
6
|
const W = "_formTextAreaHelperText_7ae2c_1", b = "_invalid_7ae2c_6", w = "_formText_7ae2c_1", D = "_formTextArea_7ae2c_1", m = {
|
|
7
7
|
formTextAreaHelperText: W,
|
|
8
8
|
invalid: b,
|
|
@@ -16,17 +16,17 @@ const W = "_formTextAreaHelperText_7ae2c_1", b = "_invalid_7ae2c_6", w = "_formT
|
|
|
16
16
|
}) => /* @__PURE__ */ I("div", { className: m.formTextAreaHelperText, children: [
|
|
17
17
|
x ? /* @__PURE__ */ t("div", { children: r }) : /* @__PURE__ */ t("div", {}),
|
|
18
18
|
/* @__PURE__ */ t("div", { children: `${e}/${c}` })
|
|
19
|
-
] }), Y = (e) => e.textarea ? /* @__PURE__ */ t(G, { ...e }) : /* @__PURE__ */ t(J, { ...e }), G = (e) => /* @__PURE__ */ t("div", { className: m.formTextArea, children: /* @__PURE__ */ t(
|
|
19
|
+
] }), Y = (e) => e.textarea ? /* @__PURE__ */ t(G, { ...e }) : /* @__PURE__ */ t(J, { ...e }), G = (e) => /* @__PURE__ */ t("div", { className: m.formTextArea, children: /* @__PURE__ */ t(C, { ...e }) }), J = (e) => /* @__PURE__ */ t(C, { ...e }), C = ({
|
|
20
20
|
propertyName: e,
|
|
21
21
|
label: c,
|
|
22
22
|
disabled: x = !1,
|
|
23
23
|
textarea: r = !1,
|
|
24
|
-
hidden:
|
|
25
|
-
placeholder:
|
|
26
|
-
type:
|
|
27
|
-
prefixText:
|
|
28
|
-
inputMode:
|
|
29
|
-
trailingIcon:
|
|
24
|
+
hidden: A = !1,
|
|
25
|
+
placeholder: F,
|
|
26
|
+
type: L,
|
|
27
|
+
prefixText: H,
|
|
28
|
+
inputMode: q,
|
|
29
|
+
trailingIcon: S,
|
|
30
30
|
trigger: d = "likeForm",
|
|
31
31
|
rules: n
|
|
32
32
|
}) => {
|
|
@@ -35,10 +35,10 @@ const W = "_formTextAreaHelperText_7ae2c_1", b = "_invalid_7ae2c_6", w = "_formT
|
|
|
35
35
|
getFieldState: u,
|
|
36
36
|
formState: { errors: l },
|
|
37
37
|
trigger: T
|
|
38
|
-
} = V(), [
|
|
38
|
+
} = V(), [$, B] = R(0), j = (i) => {
|
|
39
39
|
const a = i.target.value;
|
|
40
|
-
|
|
41
|
-
},
|
|
40
|
+
B(a?.length ?? 0);
|
|
41
|
+
}, M = () => {
|
|
42
42
|
if (l && l[e]) {
|
|
43
43
|
const i = l[e]?.message;
|
|
44
44
|
return i || "Invalid input";
|
|
@@ -46,27 +46,27 @@ const W = "_formTextAreaHelperText_7ae2c_1", b = "_invalid_7ae2c_6", w = "_formT
|
|
|
46
46
|
return o && r ? /* @__PURE__ */ t(
|
|
47
47
|
E,
|
|
48
48
|
{
|
|
49
|
-
count:
|
|
49
|
+
count: $,
|
|
50
50
|
maxCount: o,
|
|
51
|
-
required:
|
|
52
|
-
requiredText:
|
|
51
|
+
required: v,
|
|
52
|
+
requiredText: g
|
|
53
53
|
}
|
|
54
|
-
) :
|
|
54
|
+
) : g;
|
|
55
55
|
}, o = s(
|
|
56
56
|
() => n?.maxLength?.value,
|
|
57
57
|
[n]
|
|
58
|
-
),
|
|
58
|
+
), k = s(
|
|
59
59
|
() => n?.minLength?.value,
|
|
60
60
|
[n]
|
|
61
|
-
),
|
|
61
|
+
), v = s(
|
|
62
62
|
() => n?.required?.value,
|
|
63
63
|
[n]
|
|
64
|
-
),
|
|
64
|
+
), g = s(
|
|
65
65
|
() => n?.required?.message,
|
|
66
66
|
[n]
|
|
67
67
|
);
|
|
68
|
-
return
|
|
69
|
-
|
|
68
|
+
return A ? /* @__PURE__ */ t(_, { name: e, control: f, render: () => /* @__PURE__ */ t(z, {}) }) : /* @__PURE__ */ t(
|
|
69
|
+
_,
|
|
70
70
|
{
|
|
71
71
|
name: e,
|
|
72
72
|
rules: n,
|
|
@@ -76,29 +76,29 @@ const W = "_formTextAreaHelperText_7ae2c_1", b = "_invalid_7ae2c_6", w = "_formT
|
|
|
76
76
|
{
|
|
77
77
|
...a,
|
|
78
78
|
value: a.value ?? "",
|
|
79
|
-
type:
|
|
79
|
+
type: L,
|
|
80
80
|
fullWidth: !0,
|
|
81
|
-
inputMode:
|
|
82
|
-
placeholder:
|
|
83
|
-
prefixText:
|
|
81
|
+
inputMode: q,
|
|
82
|
+
placeholder: F,
|
|
83
|
+
prefixText: H,
|
|
84
84
|
disabled: x,
|
|
85
|
-
helperText:
|
|
86
|
-
helperTextPersistent: l !== void 0 ||
|
|
85
|
+
helperText: M(),
|
|
86
|
+
helperTextPersistent: l !== void 0 || v || o !== void 0 && r,
|
|
87
87
|
label: c,
|
|
88
88
|
variant: "outlined",
|
|
89
89
|
maxlength: o,
|
|
90
|
-
minLength:
|
|
90
|
+
minLength: k,
|
|
91
91
|
textarea: r,
|
|
92
92
|
noResize: !1,
|
|
93
93
|
onBlur: () => {
|
|
94
94
|
d === "onBlur" && T(e);
|
|
95
95
|
},
|
|
96
|
-
onChange: (
|
|
97
|
-
a.onChange(
|
|
96
|
+
onChange: (h) => {
|
|
97
|
+
a.onChange(h), r && o !== void 0 && j(h), d === "onChange" && T(e);
|
|
98
98
|
},
|
|
99
99
|
valid: !u(e).invalid,
|
|
100
100
|
className: `${m.formText} ${u(e).invalid ? m.invalid : ""}`,
|
|
101
|
-
trailingIcon:
|
|
101
|
+
trailingIcon: S
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
}
|
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.4804",
|
|
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>",
|