@hortiview/shared-components 1.1.0 → 1.1.1
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,10 @@
|
|
|
1
|
+
## [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
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* helpertext from formNumber does not display the correct message ([16eee72](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/16eee726194ea7b778558514abafbb543c591b6d))
|
|
7
|
+
|
|
1
8
|
# [1.1.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v1.0.1...v1.1.0) (2025-03-26)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,63 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const B = ({
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFormContext as d, Controller as N } from "react-hook-form";
|
|
3
|
+
import { N as T } from "../../../react-number-format.es-BK1EpVXq.js";
|
|
4
|
+
import { useHelperText as C } from "../../../hooks/useHelperText.js";
|
|
5
|
+
import { useDecimalSeparator as S, useThousandSeparator as y } from "../../../services/NumberService.js";
|
|
6
|
+
import { CustomTextField as F } from "./CustomTextField.js";
|
|
7
|
+
const I = ({
|
|
9
8
|
/**numeric format props */
|
|
10
|
-
decimalScale:
|
|
9
|
+
decimalScale: n = 2,
|
|
11
10
|
/** TextField props */
|
|
12
|
-
helperTextPersistent:
|
|
11
|
+
helperTextPersistent: u = !0,
|
|
13
12
|
/** custom props */
|
|
14
|
-
languageCode:
|
|
15
|
-
additionalTrigger:
|
|
13
|
+
languageCode: t = "es-MX",
|
|
14
|
+
additionalTrigger: l = "none",
|
|
16
15
|
...e
|
|
17
16
|
}) => {
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return r || "Invalid input";
|
|
26
|
-
}
|
|
27
|
-
return e.helperText;
|
|
28
|
-
}, [a, e.propertyName, e.helperText]), d = y(m), x = F(m);
|
|
29
|
-
return /* @__PURE__ */ u(
|
|
30
|
-
T,
|
|
17
|
+
const { control: s } = d(), { helperText: i, helperTextPersistent: f } = C({
|
|
18
|
+
propertyName: e.propertyName,
|
|
19
|
+
helperText: e.helperText,
|
|
20
|
+
hasCharacterCount: !1
|
|
21
|
+
}), p = S(t), x = y(t);
|
|
22
|
+
return /* @__PURE__ */ m(
|
|
23
|
+
N,
|
|
31
24
|
{
|
|
32
25
|
name: e.propertyName,
|
|
33
|
-
control:
|
|
34
|
-
render: ({ field: { value:
|
|
35
|
-
|
|
26
|
+
control: s,
|
|
27
|
+
render: ({ field: { value: c, onChange: o, onBlur: h } }) => /* @__PURE__ */ m(
|
|
28
|
+
T,
|
|
36
29
|
{
|
|
37
30
|
"data-testid": `form-number-${e.propertyName}`,
|
|
38
31
|
...e,
|
|
39
32
|
valueIsNumericString: !0,
|
|
40
|
-
value:
|
|
41
|
-
onValueChange: (
|
|
42
|
-
|
|
33
|
+
value: c,
|
|
34
|
+
onValueChange: (r) => {
|
|
35
|
+
r.value === "" ? o(null) : o(Number(r.value));
|
|
43
36
|
},
|
|
44
|
-
decimalSeparator:
|
|
37
|
+
decimalSeparator: p,
|
|
45
38
|
thousandSeparator: x,
|
|
46
|
-
decimalScale:
|
|
47
|
-
customInput:
|
|
48
|
-
isAllowed: (
|
|
49
|
-
const { floatValue:
|
|
50
|
-
return
|
|
39
|
+
decimalScale: n,
|
|
40
|
+
customInput: F,
|
|
41
|
+
isAllowed: (r) => {
|
|
42
|
+
const { floatValue: a } = r;
|
|
43
|
+
return a ? e.maxValue && a > e.maxValue ? !1 : e.isAllowed?.(r) ?? !0 : !0;
|
|
51
44
|
},
|
|
52
|
-
formOnBlur:
|
|
53
|
-
additionalTrigger:
|
|
54
|
-
helperText:
|
|
55
|
-
helperTextPersistent:
|
|
45
|
+
formOnBlur: h,
|
|
46
|
+
additionalTrigger: l,
|
|
47
|
+
helperText: i,
|
|
48
|
+
helperTextPersistent: u || f
|
|
56
49
|
}
|
|
57
50
|
)
|
|
58
51
|
}
|
|
59
52
|
);
|
|
60
53
|
};
|
|
61
54
|
export {
|
|
62
|
-
|
|
55
|
+
I as FormNumber
|
|
63
56
|
};
|
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.1",
|
|
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>",
|