@box/metadata-editor 0.66.2 → 0.66.3
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.
@@ -1,54 +1,54 @@
|
|
1
|
-
import { TextInput as
|
2
|
-
import { useFormikContext as
|
3
|
-
import { forwardRef as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
1
|
+
import { TextInput as C } from "@box/blueprint-web";
|
2
|
+
import { useFormikContext as R, getIn as T, Field as V } from "formik";
|
3
|
+
import { forwardRef as $, useRef as b } from "react";
|
4
|
+
import { getFieldLabel as B } from "../../utils.js";
|
5
|
+
import { fieldDefaultProps as I } from "../constants.js";
|
6
|
+
import { useFloatValidation as M } from "./use-float-validation.js";
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
8
|
-
const
|
8
|
+
const P = /* @__PURE__ */ $(({
|
9
9
|
className: l,
|
10
|
-
description:
|
10
|
+
description: i,
|
11
11
|
label: o,
|
12
|
-
fieldNamePrefix:
|
13
|
-
disableForm:
|
12
|
+
fieldNamePrefix: d,
|
13
|
+
disableForm: n,
|
14
14
|
updateModePrefix: s
|
15
15
|
}, u) => {
|
16
16
|
const {
|
17
17
|
values: f,
|
18
18
|
setFieldValue: m,
|
19
19
|
setFieldTouched: c
|
20
|
-
} =
|
20
|
+
} = R(), t = `${s ?? d}.value`, p = T(f, t), a = b(p), {
|
21
21
|
validateFloats: F
|
22
|
-
} =
|
22
|
+
} = M(), h = (e) => {
|
23
23
|
a.current = e, m(t, e);
|
24
24
|
}, v = (e) => {
|
25
25
|
c(e, !0);
|
26
26
|
};
|
27
27
|
return /* @__PURE__ */ r("div", {
|
28
28
|
"data-testid": `${o}-field`,
|
29
|
-
children: /* @__PURE__ */ r(
|
29
|
+
children: /* @__PURE__ */ r(V, {
|
30
30
|
name: `${t}`,
|
31
31
|
validate: () => F(a.current),
|
32
32
|
children: ({
|
33
33
|
field: e,
|
34
34
|
meta: g
|
35
|
-
}) => /* @__PURE__ */ r(
|
36
|
-
...
|
35
|
+
}) => /* @__PURE__ */ r(C, {
|
36
|
+
...I,
|
37
37
|
...e,
|
38
38
|
ref: u,
|
39
39
|
className: l,
|
40
|
-
disabled:
|
40
|
+
disabled: n,
|
41
41
|
error: g.error,
|
42
|
-
|
42
|
+
inputMode: "decimal",
|
43
|
+
label: B(o, i),
|
43
44
|
onBlur: () => v(t),
|
44
45
|
onChange: (x) => h(x.currentTarget.value),
|
45
|
-
placeholder: "0"
|
46
|
-
type: "number"
|
46
|
+
placeholder: "0"
|
47
47
|
})
|
48
48
|
})
|
49
49
|
});
|
50
50
|
});
|
51
51
|
export {
|
52
|
-
|
53
|
-
|
52
|
+
P as MetadataFloatField,
|
53
|
+
P as default
|
54
54
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/metadata-editor",
|
3
|
-
"version": "0.66.
|
3
|
+
"version": "0.66.3",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@ariakit/react": "0.4.5",
|
6
6
|
"@box/blueprint-web": "^7.30.3",
|
@@ -53,5 +53,5 @@
|
|
53
53
|
"**/*.css"
|
54
54
|
],
|
55
55
|
"license": "SEE LICENSE IN LICENSE",
|
56
|
-
"gitHead": "
|
56
|
+
"gitHead": "5bc701e16606e786417f6289c33cf74e17939494"
|
57
57
|
}
|