@box/metadata-editor 0.97.2 → 0.97.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,69 +1,69 @@
|
|
1
1
|
import { ComboboxWithApiTreeView as K } from "@box/combobox-with-api";
|
2
2
|
import { useFormikContext as W, getIn as $, Field as j } from "formik";
|
3
|
-
import { forwardRef as D } from "react";
|
4
|
-
import { useIntl as
|
5
|
-
import
|
6
|
-
import { ComboboxWithApiPagination as
|
7
|
-
import { g as
|
3
|
+
import { forwardRef as D, useCallback as R } from "react";
|
4
|
+
import { useIntl as q } from "react-intl";
|
5
|
+
import z from "../../../../messages.js";
|
6
|
+
import { ComboboxWithApiPagination as A } from "../../../combobox-with-api-pagination/combobox-with-api-pagination.js";
|
7
|
+
import { g as b } from "../../../../../../chunks/utils2.js";
|
8
8
|
import { jsx as e } from "react/jsx-runtime";
|
9
|
-
const
|
9
|
+
const X = /* @__PURE__ */ D(({
|
10
10
|
description: i,
|
11
11
|
disableForm: l,
|
12
12
|
isAiSuggestionApplied: u,
|
13
13
|
fieldNamePrefix: p,
|
14
14
|
label: r,
|
15
15
|
portalElement: s,
|
16
|
-
taxonomyOptionsFetcher:
|
17
|
-
updateModePrefix:
|
18
|
-
className:
|
19
|
-
isMultilevelTaxonomyFieldEnabled:
|
20
|
-
},
|
21
|
-
const
|
22
|
-
setFieldValue:
|
23
|
-
values:
|
16
|
+
taxonomyOptionsFetcher: c,
|
17
|
+
updateModePrefix: k,
|
18
|
+
className: d,
|
19
|
+
isMultilevelTaxonomyFieldEnabled: M
|
20
|
+
}, h) => {
|
21
|
+
const P = q(), a = `${k ?? p}.value`, {
|
22
|
+
setFieldValue: f,
|
23
|
+
values: g
|
24
24
|
} = W(), {
|
25
25
|
metadata: {
|
26
|
-
templateKey:
|
27
|
-
scope:
|
26
|
+
templateKey: v,
|
27
|
+
scope: x
|
28
28
|
}
|
29
|
-
} =
|
30
|
-
key:
|
29
|
+
} = g, T = $(g, p), {
|
30
|
+
key: C,
|
31
31
|
optionsRules: {
|
32
|
-
multiSelect:
|
32
|
+
multiSelect: n,
|
33
33
|
selectableLevels: t
|
34
34
|
},
|
35
35
|
levels: w
|
36
|
-
} =
|
36
|
+
} = T, I = M && (t == null ? void 0 : t.some((o) => o > 1)), y = R((o) => c(x, v, C, t == null ? void 0 : t[0], o), [C, x, t, c, v]), F = (o) => n || !(o != null && o.length) ? P.formatMessage(z.taxonomyPlaceholder) : void 0;
|
37
37
|
return /* @__PURE__ */ e("div", {
|
38
38
|
"data-testid": `${r}-field`,
|
39
39
|
onKeyDown: (o) => o.stopPropagation(),
|
40
40
|
role: "presentation",
|
41
41
|
children: /* @__PURE__ */ e(j, {
|
42
|
-
name:
|
42
|
+
name: a,
|
43
43
|
children: ({
|
44
44
|
field: o
|
45
45
|
}) => I ? /* @__PURE__ */ e(K, {
|
46
|
-
ref:
|
47
|
-
className:
|
48
|
-
defaultFetcher:
|
46
|
+
ref: h,
|
47
|
+
className: d,
|
48
|
+
defaultFetcher: y,
|
49
49
|
disabled: l,
|
50
|
-
label:
|
50
|
+
label: b(r, i, u),
|
51
51
|
levels: w,
|
52
|
-
multiselect:
|
53
|
-
onValueChange: (m) =>
|
54
|
-
placeholder:
|
52
|
+
multiselect: n,
|
53
|
+
onValueChange: (m) => f(a, m),
|
54
|
+
placeholder: F(o.value),
|
55
55
|
portalElement: s,
|
56
56
|
selectableLevels: t,
|
57
57
|
value: o.value
|
58
|
-
}) : /* @__PURE__ */ e(
|
59
|
-
ref:
|
60
|
-
className:
|
61
|
-
defaultFetcher:
|
58
|
+
}) : /* @__PURE__ */ e(A, {
|
59
|
+
ref: h,
|
60
|
+
className: d,
|
61
|
+
defaultFetcher: y,
|
62
62
|
disabled: l,
|
63
|
-
label:
|
64
|
-
multiselect:
|
65
|
-
onValueChange: (m) =>
|
66
|
-
placeholder:
|
63
|
+
label: b(r, i, u),
|
64
|
+
multiselect: n,
|
65
|
+
onValueChange: (m) => f(a, m),
|
66
|
+
placeholder: F(o.value),
|
67
67
|
portalElement: s,
|
68
68
|
value: o.value
|
69
69
|
})
|
@@ -71,5 +71,5 @@ const U = /* @__PURE__ */ D(({
|
|
71
71
|
});
|
72
72
|
});
|
73
73
|
export {
|
74
|
-
|
74
|
+
X as MetadataTaxonomyField
|
75
75
|
};
|